questions) {
+ this.questions = questions;
+ }
+}
diff --git a/Trading/src/main/java/com/suneesh/trading/models/requests/LandingCompanyDetailsRequest.java b/Trading/src/main/java/com/suneesh/trading/models/requests/LandingCompanyDetailsRequest.java
new file mode 100644
index 0000000..d94a7f7
--- /dev/null
+++ b/Trading/src/main/java/com/suneesh/trading/models/requests/LandingCompanyDetailsRequest.java
@@ -0,0 +1,41 @@
+package com.suneesh.trading.models.requests;
+
+import com.suneesh.trading.models.responses.LandingCompanyDetailsResponse;
+import com.suneesh.trading.utils.Validator;
+import com.google.gson.annotations.SerializedName;
+
+/**
+ * LandingCompanyDetailsRequest
+ *
+ * Landing Company Details Send
+ *
+ * Binary.com has a number of licensed subsidiaries in various jurisidictions,
+ * which are called Landing Companies (and which are wholly owned subsidiaries of the Binary Group).
+ * This call provides information about each Landing Company.
+ *
+ * @author Morteza Tavanarad
+ * @version 1.0.0
+ * @since 8/2/2017
+ */
+public class LandingCompanyDetailsRequest extends RequestBase {
+ /**
+ * Landing company shortcode (for example: costarica, malta, maltainvest, iom)
+ */
+ @SerializedName("landing_company_details")
+ private String landingCompanyCode;
+
+ public LandingCompanyDetailsRequest(String landingCompanyCode){
+ this.responseType = LandingCompanyDetailsResponse.class;
+ this.setLandingCompanyCode(landingCompanyCode);
+ }
+
+ public String getLandingCompanyCode() {
+ return landingCompanyCode;
+ }
+
+ public void setLandingCompanyCode(String landingCompanyCode) {
+ Validator.checkPattern("^(\\w|-){3,20}$", landingCompanyCode,
+ "Landing Company Code does not match the regex pattern /^(\\w|-){3,20}$/");
+ this.landingCompanyCode = landingCompanyCode;
+ }
+}
diff --git a/Trading/src/main/java/com/suneesh/trading/models/requests/LandingCompanyRequest.java b/Trading/src/main/java/com/suneesh/trading/models/requests/LandingCompanyRequest.java
new file mode 100644
index 0000000..ace4e18
--- /dev/null
+++ b/Trading/src/main/java/com/suneesh/trading/models/requests/LandingCompanyRequest.java
@@ -0,0 +1,41 @@
+package com.suneesh.trading.models.requests;
+
+import com.suneesh.trading.models.responses.LandingCompanyResponse;
+import com.suneesh.trading.utils.Validator;
+import com.google.gson.annotations.SerializedName;
+
+/**
+ * LandingCompanyRequest
+ *
+ * Landing Company Send
+ * Binary.com has a number of licensed subsidiaries in various jurisidictions, which are called Landing Companies.
+ * This call will return the appropriate Landing Company for clients of a given country.
+ * The landing company may differ for gaming contracts (Volatility Indices)
+ * and financial contracts (forex, stock indices, commodities)
+ *
+ * @author Morteza Tavanarad
+ * @version 1.0.0
+ * @since 8/1/2017
+ */
+public class LandingCompanyRequest extends RequestBase {
+
+ /**
+ * Client country
+ */
+ @SerializedName("landing_company")
+ private String landingCompany;
+
+ public LandingCompanyRequest(String landingCompany){
+ this.responseType = LandingCompanyResponse.class;
+ this.landingCompany = landingCompany;
+ }
+
+ public String getLandingCompany() {
+ return landingCompany;
+ }
+
+ public void setLandingCompany(String landingCompany) {
+ Validator.checkPattern("^\\w{2}$", landingCompany, "LandingCompany value does not match the regex pattern \\^\\w{2}$\\");
+ this.landingCompany = landingCompany;
+ }
+}
diff --git a/Trading/src/main/java/com/suneesh/trading/models/requests/LoginHistoryRequest.java b/Trading/src/main/java/com/suneesh/trading/models/requests/LoginHistoryRequest.java
new file mode 100644
index 0000000..78ac810
--- /dev/null
+++ b/Trading/src/main/java/com/suneesh/trading/models/requests/LoginHistoryRequest.java
@@ -0,0 +1,47 @@
+package com.suneesh.trading.models.requests;
+
+import com.suneesh.trading.models.responses.LoginHistoryResponse;
+import com.google.gson.annotations.SerializedName;
+import io.reactivex.annotations.Nullable;
+
+/**
+ * LoginHistoryRequest
+ *
+ * Login History
+ *
+ * Retrieve a summary of login history for user.
+ *
+ *
+ * @author Morteza Tavanarad
+ * @version 1.0.0
+ * @since 8/7/2017
+ */
+public class LoginHistoryRequest extends RequestBase {
+
+ @SerializedName("login_history")
+ private final int loginHistory = 1;
+
+ /**
+ * Apply limit to count of login history records, default to 10. Max:50
+ */
+ @SerializedName("limit")
+ @Nullable
+ private Integer limit;
+
+ public LoginHistoryRequest() {
+ this.responseType = LoginHistoryResponse.class;
+ }
+
+ public LoginHistoryRequest(Integer limit) {
+ this();
+ this.setLimit(limit);
+ }
+
+ public Integer getLimit() {
+ return limit;
+ }
+
+ public void setLimit(Integer limit) {
+ this.limit = limit;
+ }
+}
diff --git a/Trading/src/main/java/com/suneesh/trading/models/requests/LogoutRequest.java b/Trading/src/main/java/com/suneesh/trading/models/requests/LogoutRequest.java
new file mode 100644
index 0000000..4040093
--- /dev/null
+++ b/Trading/src/main/java/com/suneesh/trading/models/requests/LogoutRequest.java
@@ -0,0 +1,25 @@
+package com.suneesh.trading.models.requests;
+
+import com.suneesh.trading.models.responses.LogoutResponse;
+import com.google.gson.annotations.SerializedName;
+
+/**
+ * LogoutReques
+ *
+ * Logout Request
+ *
+ * Logout the session
+ *
+ * @author Morteza Tavanarad
+ * @version 1.0.0
+ * @since 8/7/2017
+ */
+public class LogoutRequest extends RequestBase {
+
+ @SerializedName("logout")
+ private final int logout = 1;
+
+ public LogoutRequest() {
+ this.responseType = LogoutResponse.class;
+ }
+}
diff --git a/Trading/src/main/java/com/suneesh/trading/models/requests/NewVirtualAccountRequest.java b/Trading/src/main/java/com/suneesh/trading/models/requests/NewVirtualAccountRequest.java
new file mode 100644
index 0000000..502f799
--- /dev/null
+++ b/Trading/src/main/java/com/suneesh/trading/models/requests/NewVirtualAccountRequest.java
@@ -0,0 +1,182 @@
+package com.suneesh.trading.models.requests;
+
+import com.suneesh.trading.models.responses.NewVirtualAccountResponse;
+import com.suneesh.trading.utils.Validator;
+import com.google.gson.annotations.SerializedName;
+import io.reactivex.annotations.Nullable;
+
+/**
+ * NewVirtualAccountRequest
+ *
+ * Create virtual account Send
+ * Create a new virtual-money account
+ *
+ * @author Morteza Tavanarad
+ * @version 1.0.0
+ * @since 8/2/2017
+ */
+public class NewVirtualAccountRequest extends RequestBase {
+
+ @SerializedName("new_account_virtual")
+ private final int newAccountVirtual = 1;
+
+ /**
+ * Email verification code (received from a verify_email call, which must be done first)
+ */
+ @SerializedName("verification_code")
+ private String verficationCode;
+
+ /**
+ * Password (length within 6-25 chars, accepts any printable ASCII character)
+ */
+ @SerializedName("client_password")
+ private String clientPassword;
+
+ /**
+ * 2-letter country code (value received from residence_list call)
+ */
+ @SerializedName("residence")
+ private String residence;
+
+ /**
+ * Affiliate token, within 32 characters.
+ */
+ @SerializedName("affiliate_token")
+ @Nullable
+ private String affiliateToken;
+
+ /**
+ * Optional field to identify the source of traffic such as: search engine, newsletter, or other referral
+ */
+ @SerializedName("utm_source")
+ @Nullable
+ private String utmSource;
+
+ /**
+ * Optional field to identify the medium the link was used upon such as: email, CPC, or other methods of sharing
+ */
+ @SerializedName("utm_medium")
+ @Nullable
+ private String utmMedium;
+
+ /**
+ * Optional field to identify a specific product promotion or
+ * strategic campaign such as a spring sale or other promotions
+ */
+ @SerializedName("utm_campaign")
+ @Nullable
+ private String utmCampaign;
+
+ /**
+ * Boolean value 1 or 0, indicating permission to use email address for any contact which may include marketing
+ */
+ @SerializedName("email_consent")
+ @Nullable
+ private Integer emailConsent;
+
+ /**
+ * (Google Click Identifier) to track source
+ */
+ @SerializedName("gclid_url")
+ @Nullable
+ private String googleClickId;
+
+ public NewVirtualAccountRequest(String verficationCode, String clientPassword, String residence){
+ this.responseType = NewVirtualAccountResponse.class;
+ this.setVerficationCode(verficationCode);
+ this.setClientPassword(clientPassword);
+ this.setResidence(residence);
+ }
+
+ public int getNewAccountVirtual() {
+ return newAccountVirtual;
+ }
+
+ public String getVerficationCode() {
+ return verficationCode;
+ }
+
+ public void setVerficationCode(String verficationCode) {
+ Validator.checkPattern("^\\w{8,128}$", verficationCode,
+ "Verification Code does not match the regex pattern /^\\w{8,128}$/");
+ this.verficationCode = verficationCode;
+ }
+
+ public String getClientPassword() {
+ return clientPassword;
+ }
+
+ public void setClientPassword(String clientPassword) {
+ Validator.checkPattern("^[ -~]{6,25}$", clientPassword,
+ "Client Password does not match the regex pattern /^[ -~]{6,25}$/");
+ this.clientPassword = clientPassword;
+ }
+
+ public String getResidence() {
+ return residence;
+ }
+
+ public void setResidence(String residence) {
+ Validator.checkPattern("^[a-z]{2}$", residence, "Residence does not match the regex pattern /^[a-z]{2}$/");
+ this.residence = residence;
+ }
+
+ public String getAffiliateToken() {
+ return affiliateToken;
+ }
+
+ public void setAffiliateToken(String affiliateToken) {
+ Validator.checkPattern("^[\\w-]{0,32}$", affiliateToken,
+ "Affiliate Token does not match the regex pattern /^[\\w-]{0,32}$/");
+ this.affiliateToken = affiliateToken;
+ }
+
+ public String getUtmSource() {
+ return utmSource;
+ }
+
+ public void setUtmSource(String utmSource) {
+ Validator.checkPattern("^[a-zA-Z0-9\\s\\-\\.\\_]{0,100}$", utmSource,
+ "UTM Source does not match the regex pattern /^[a-zA-Z0-9\\s\\-\\.\\_]{0,100}$/");
+ this.utmSource = utmSource;
+ }
+
+ public String getUtmMedium() {
+ return utmMedium;
+ }
+
+ public void setUtmMedium(String utmMedium) {
+ Validator.checkPattern("^[a-zA-Z0-9\\s\\-\\.\\_]{0,100}$", utmMedium,
+ "UTM Medium does not match the regex pattern /^[a-zA-Z0-9\\s\\-\\.\\_]{0,100}$/");
+ this.utmMedium = utmMedium;
+ }
+
+ public String getUtmCampaign() {
+ return utmCampaign;
+ }
+
+ public void setUtmCampaign(String utmCampaign) {
+ Validator.checkPattern("^[a-zA-Z0-9\\s\\-\\.\\_]{0,100}$", utmCampaign,
+ "UTM Campaign does not match the regex pattern /^[a-zA-Z0-9\\s\\-\\.\\_]{0,100}$/");
+ this.utmCampaign = utmCampaign;
+ }
+
+ public Integer getEmailConsent() {
+ return emailConsent;
+ }
+
+ public void setEmailConsent(Integer emailConsent) {
+ Validator.checkPattern("^(0|1)$", emailConsent.toString(), "Email Conset doesn't match the regex patter /^(0|1)$/");
+ this.emailConsent = emailConsent;
+ }
+
+ public String getGoogleClickId() {
+ return googleClickId;
+ }
+
+ public void setGoogleClickId(String googleClickId) {
+ Validator.checkPattern("^[a-zA-Z0-9\\s\\-\\.\\_]{0,100}$", googleClickId,
+ "Google Click Identifier URL does not match the regex pattern /^[a-zA-Z0-9\\s\\-\\.\\_]{0,100}$/");
+ this.googleClickId = googleClickId;
+ }
+}
diff --git a/Trading/src/main/java/com/suneesh/trading/models/requests/OAuthApplicationsRequest.java b/Trading/src/main/java/com/suneesh/trading/models/requests/OAuthApplicationsRequest.java
new file mode 100644
index 0000000..b2d1495
--- /dev/null
+++ b/Trading/src/main/java/com/suneesh/trading/models/requests/OAuthApplicationsRequest.java
@@ -0,0 +1,26 @@
+package com.suneesh.trading.models.requests;
+
+import com.suneesh.trading.models.responses.OAuthApplicationResponse;
+import com.google.gson.annotations.SerializedName;
+
+/**
+ * OAuthApplicationsRequest
+ *
+ * OAuth Applications Send
+ *
+ * List all my used OAuth applications.
+ *
+ *
+ * @author Morteza Tavanarad
+ * @version 1.0.0
+ * @since 8/7/2017
+ */
+public class OAuthApplicationsRequest extends RequestBase {
+
+ @SerializedName("oauth_apps")
+ private final int oauthApps = 1;
+
+ public OAuthApplicationsRequest() {
+ this.responseType = OAuthApplicationResponse.class;
+ }
+}
diff --git a/Trading/src/main/java/com/suneesh/trading/models/requests/PaymentAgentListRequest.java b/Trading/src/main/java/com/suneesh/trading/models/requests/PaymentAgentListRequest.java
new file mode 100644
index 0000000..4adbdd8
--- /dev/null
+++ b/Trading/src/main/java/com/suneesh/trading/models/requests/PaymentAgentListRequest.java
@@ -0,0 +1,42 @@
+package com.suneesh.trading.models.requests;
+
+import com.suneesh.trading.models.responses.PaymentAgentListResponse;
+import com.suneesh.trading.utils.Validator;
+import com.google.gson.annotations.SerializedName;
+
+/**
+ * PaymentAgentListRequest
+ *
+ * Payment Agent List Send
+ *
+ * Will return a list of Payment Agents for a given country.
+ * Payment agents allow Binary.com users to deposit and withdraw funds using local payment methods
+ * that might not be available via the main Binary.com cashier system.
+ *
+ * @author Morteza Tavanarad
+ * @version 1.0.0
+ * @since 8/2/2017
+ */
+public class PaymentAgentListRequest extends RequestBase {
+
+ /**
+ * Client country (2-letter country code).
+ */
+ @SerializedName("paymentagent_list")
+ private String countryCode;
+
+ public PaymentAgentListRequest(String countryCode) {
+ this.responseType = PaymentAgentListResponse.class;
+ this.setCountryCode(countryCode);
+ }
+
+ public String getCountryCode() {
+ return countryCode;
+ }
+
+ public void setCountryCode(String countryCode) {
+ Validator.checkPattern("^\\w\\w$", countryCode,
+ "Country Code does not match the regex pattern /^\\w\\w$/");
+ this.countryCode = countryCode;
+ }
+}
diff --git a/Trading/src/main/java/com/suneesh/trading/models/requests/PaymentAgentTransferRequest.java b/Trading/src/main/java/com/suneesh/trading/models/requests/PaymentAgentTransferRequest.java
new file mode 100644
index 0000000..311e180
--- /dev/null
+++ b/Trading/src/main/java/com/suneesh/trading/models/requests/PaymentAgentTransferRequest.java
@@ -0,0 +1,82 @@
+package com.suneesh.trading.models.requests;
+
+import com.suneesh.trading.models.responses.PaymentAgentTransferResponse;
+import com.google.gson.annotations.SerializedName;
+
+import java.math.BigDecimal;
+
+/**
+ * PaymentAgentTransferRequest
+ *
+ * Payment Agent Transfer Request
+ * Payment Agent Transfer - this call is available only to accounts that are approved Payment Agents.
+ *
+ * @author Morteza Tavanarad
+ * @version 1.0.0
+ * @since 9/15/2017
+ */
+public class PaymentAgentTransferRequest extends RequestBase {
+
+ @SerializedName("paymentagent_transfer")
+ private final int paymentAgentTransfer = 1;
+
+ /**
+ * The transfer_to loginid
+ */
+ @SerializedName("transfer_to")
+ private String transferTo;
+
+ /**
+ * Currency
+ */
+ @SerializedName("currency")
+ private String currency;
+
+ /**
+ * Amount
+ */
+ @SerializedName("amount")
+ private BigDecimal amount;
+
+ /**
+ * If 1, just do validation
+ */
+ @SerializedName("dry_run")
+ private Integer dryRun;
+
+ public PaymentAgentTransferRequest() {
+ this.responseType = PaymentAgentTransferResponse.class;
+ }
+
+ public String getTransferTo() {
+ return transferTo;
+ }
+
+ public void setTransferTo(String transferTo) {
+ this.transferTo = transferTo;
+ }
+
+ public String getCurrency() {
+ return currency;
+ }
+
+ public void setCurrency(String currency) {
+ this.currency = currency;
+ }
+
+ public BigDecimal getAmount() {
+ return amount;
+ }
+
+ public void setAmount(BigDecimal amount) {
+ this.amount = amount;
+ }
+
+ public boolean getDryRun() {
+ return dryRun == 1 ? true : false;
+ }
+
+ public void setDryRun(boolean dryRun) {
+ this.dryRun = dryRun ? 1 : 0;
+ }
+}
diff --git a/Trading/src/main/java/com/suneesh/trading/models/requests/PaymentAgentWithdrawalRequest.java b/Trading/src/main/java/com/suneesh/trading/models/requests/PaymentAgentWithdrawalRequest.java
new file mode 100644
index 0000000..328c0bb
--- /dev/null
+++ b/Trading/src/main/java/com/suneesh/trading/models/requests/PaymentAgentWithdrawalRequest.java
@@ -0,0 +1,110 @@
+package com.suneesh.trading.models.requests;
+
+import com.suneesh.trading.models.responses.PaymentAgentWithdrawalResponse;
+import com.google.gson.annotations.SerializedName;
+
+import java.math.BigDecimal;
+
+/**
+ * PaymentAgentWithdrawalRequest
+ *
+ * Payment Agent Withdrawal Request
+ * Initiate a withdrawal to an approved Payment Agent.
+ *
+ * @author Morteza Tavanarad
+ * @version 1.0.0
+ * @since 9/15/2017
+ */
+public class PaymentAgentWithdrawalRequest extends RequestBase {
+
+ @SerializedName("paymentagent_withdraw")
+ private final int paymentAgentWithdraw = 1;
+
+ /**
+ * The payment agent loginid received from the paymentagent_list call
+ */
+ @SerializedName("paymentagent_loginid")
+ private String loginId;
+
+ /**
+ * Currency
+ */
+ @SerializedName("currency")
+ private String currency;
+
+ /**
+ * Amount
+ */
+ @SerializedName("amount")
+ private BigDecimal amount;
+
+ /**
+ * Email verification code (received from a verify_email call, which must be done first)
+ */
+ @SerializedName("verification_code")
+ private String verificationCode;
+
+ /**
+ * Optional field for remarks about the withdraw. Only letters, numbers, space, period, comma, - ' are allowed.
+ */
+ @SerializedName("description")
+ private String description;
+
+ /**
+ * If 1, just do validation
+ */
+ @SerializedName("dry_run")
+ private Integer dryRun;
+
+ public PaymentAgentWithdrawalRequest() {
+ this.responseType = PaymentAgentWithdrawalResponse.class;
+ }
+
+ public String getLoginId() {
+ return loginId;
+ }
+
+ public void setLoginId(String loginId) {
+ this.loginId = loginId;
+ }
+
+ public String getCurrency() {
+ return currency;
+ }
+
+ public void setCurrency(String currency) {
+ this.currency = currency;
+ }
+
+ public BigDecimal getAmount() {
+ return amount;
+ }
+
+ public void setAmount(BigDecimal amount) {
+ this.amount = amount;
+ }
+
+ public String getVerificationCode() {
+ return verificationCode;
+ }
+
+ public void setVerificationCode(String verificationCode) {
+ this.verificationCode = verificationCode;
+ }
+
+ public String getDescription() {
+ return description;
+ }
+
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ public boolean getDryRun() {
+ return dryRun == 1 ? true : false;
+ }
+
+ public void setDryRun(boolean dryRun) {
+ this.dryRun = dryRun ? 1 : 0;
+ }
+}
diff --git a/Trading/src/main/java/com/suneesh/trading/models/requests/PayoutCurrenciesRequest.java b/Trading/src/main/java/com/suneesh/trading/models/requests/PayoutCurrenciesRequest.java
new file mode 100644
index 0000000..5c004e2
--- /dev/null
+++ b/Trading/src/main/java/com/suneesh/trading/models/requests/PayoutCurrenciesRequest.java
@@ -0,0 +1,25 @@
+package com.suneesh.trading.models.requests;
+
+import com.suneesh.trading.models.responses.PayoutCurrenciesResponse;
+import com.google.gson.annotations.SerializedName;
+
+/**
+ * PayoutCurrenciesRequest
+ *
+ * Payout Currencies Send
+ * Retrieve a list of available option payout currencies.
+ * If a user is logged in, only the currency available for his account will be returned.
+ *
+ * @author Morteza Tavanarad
+ * @version 1.0.0
+ * @since 8/2/2017
+ */
+public class PayoutCurrenciesRequest extends RequestBase {
+
+ @SerializedName("payout_currencies")
+ private final int payoutCurrencies = 1;
+
+ public PayoutCurrenciesRequest(){
+ this.responseType = PayoutCurrenciesResponse.class;
+ }
+}
diff --git a/Trading/src/main/java/com/suneesh/trading/models/requests/PingRequest.java b/Trading/src/main/java/com/suneesh/trading/models/requests/PingRequest.java
new file mode 100644
index 0000000..83172a0
--- /dev/null
+++ b/Trading/src/main/java/com/suneesh/trading/models/requests/PingRequest.java
@@ -0,0 +1,19 @@
+package com.suneesh.trading.models.requests;
+
+import com.suneesh.trading.models.responses.PingResponse;
+import com.google.gson.annotations.SerializedName;
+
+/**
+ * @author Morteza Tavanarad
+ * @version 1.0.0
+ * @since 8/2/2017
+ */
+public class PingRequest extends RequestBase {
+
+ @SerializedName("ping")
+ private final int ping = 1;
+
+ public PingRequest(){
+ this.responseType = PingResponse.class;
+ }
+}
diff --git a/Trading/src/main/java/com/suneesh/trading/models/requests/PortfolioRequest.java b/Trading/src/main/java/com/suneesh/trading/models/requests/PortfolioRequest.java
new file mode 100644
index 0000000..8f2b84b
--- /dev/null
+++ b/Trading/src/main/java/com/suneesh/trading/models/requests/PortfolioRequest.java
@@ -0,0 +1,26 @@
+package com.suneesh.trading.models.requests;
+
+import com.suneesh.trading.models.responses.PortfolioResponse;
+import com.google.gson.annotations.SerializedName;
+
+/**
+ * PortfolioRequest
+ *
+ * Portfolio Send
+ *
+ * Receive information about my current portfolio of outstanding options
+ *
+ *
+ * @author Morteza Tavanarad
+ * @version 1.0.0
+ * @since 8/7/2017
+ */
+public class PortfolioRequest extends RequestBase {
+
+ @SerializedName("portfolio")
+ private final int portfolio = 1;
+
+ public PortfolioRequest() {
+ this.responseType = PortfolioResponse.class;
+ }
+}
diff --git a/Trading/src/main/java/com/suneesh/trading/models/requests/PriceProposalRequest.java b/Trading/src/main/java/com/suneesh/trading/models/requests/PriceProposalRequest.java
new file mode 100644
index 0000000..faa5f0f
--- /dev/null
+++ b/Trading/src/main/java/com/suneesh/trading/models/requests/PriceProposalRequest.java
@@ -0,0 +1,251 @@
+package com.suneesh.trading.models.requests;
+
+import com.suneesh.trading.models.enums.BasisTypes;
+import com.suneesh.trading.models.enums.DurationUnits;
+import com.suneesh.trading.models.responses.PriceProposalResponse;
+import com.suneesh.trading.utils.Validator;
+import com.google.gson.annotations.SerializedName;
+import io.reactivex.annotations.Nullable;
+
+import java.math.BigDecimal;
+
+/**
+ * PriceProposalRequest
+ *
+ * Get latest price for a specific contract
+ * Get latest price for a specific contract
+ *
+ * @author Morteza Tavanarad
+ * @version 1.0.0
+ * @since 8/2/2017
+ */
+public class PriceProposalRequest extends RequestBase {
+
+ @SerializedName("proposal")
+ private final int proposal = 1;
+
+ /**
+ * 1 - to initiate a realtime stream of prices.
+ * Note that tick trades, digit trades and less than 24 hours at-the-money contracts for
+ * the following underlying symbols are not streamed: R_100 R_50 R_25 R_75 RDBULL RDBEAR
+ * (this is because their price is constant).
+ */
+ @SerializedName("subscribe")
+ @Nullable
+ private Integer subscribe = null;
+
+ /**
+ * Proposed contract payout or stake value
+ */
+ @SerializedName("amount")
+ private BigDecimal amount;
+
+ /**
+ * Indicate whether amount is 'payout' or 'stake'
+ */
+ @SerializedName("basis")
+ private String basis;
+
+ /**
+ * A valid contract-type
+ */
+ @SerializedName("contract_type")
+ private String contractType;
+
+ /**
+ * This can only be the account-holder's currency
+ */
+ @SerializedName("currency")
+ private String currency;
+
+ /**
+ * For forward-starting contracts, epoch value of the starting time of the contract.
+ */
+ @SerializedName("date_start")
+ @Nullable
+ private Integer dateStart;
+
+ /**
+ * Epoch value of the expiry time of the contract. You must either specify date_expiry or duration.
+ */
+ @SerializedName("date_expiry")
+ @Nullable
+ private Integer dateExpiry;
+
+ /**
+ * Duration quantity
+ */
+ @SerializedName("duration")
+ private int duration;
+
+ /**
+ * Duration unit is s(seconds), m(minutes), h(hours), d(days), t(ticks).
+ * If this parameter is not set then duration will be counted as seconds.
+ */
+ @SerializedName("duration_unit")
+ private String durationUnit;
+
+ /**
+ * Symbol code
+ */
+ @SerializedName("symbol")
+ private String symbol;
+
+ /**
+ * Barrier for the contract (or last digit prediction for digit contracts).
+ * Contracts less than 24 hours in duration would need a relative barrier (barriers which need +/-),
+ * meaning that the entry spot would be adjusted accordingly with that amount to define a barrier.
+ */
+ @SerializedName("barrier")
+ private String barrier;
+
+ /**
+ * Low barrier for the contract (for contracts with two barriers).
+ * Contracts less than 24 hours in duration would need a relative barrier (barriers which need +/-),
+ * meaning that the entry spot would be adjusted accordingly with that amount to define a barrier.
+ */
+ @SerializedName("barrier2")
+ private String barrier2;
+
+ /**
+ * [For japan only] An epoch value of a predefined trading period start time
+ */
+ @SerializedName("trading_period_start")
+ private String tradingPeriodStart;
+
+ public PriceProposalRequest() {
+ this.responseType = PriceProposalResponse.class;
+ }
+
+ public PriceProposalRequest(String symbol, BigDecimal amount, BasisTypes basis, String contractType,
+ String currency, int duration, DurationUnits durationUnit) {
+ this();
+ this.setSymbol(symbol);
+ this.setAmount(amount);
+ this.setBasis(basis);
+ this.setContractType(contractType);
+ this.setCurrency(currency);
+ this.setDuration(duration);
+ this.setDurationUnit(durationUnit);
+ }
+
+ public Integer getSubscribe() {
+ return subscribe;
+ }
+
+ public void setSubscribe(Integer subscribe) {
+ this.subscribe = subscribe;
+ }
+
+ public BigDecimal getAmount() {
+ return amount;
+ }
+
+ public void setAmount(BigDecimal amount) {
+ Validator.checkPattern("^[0-9]+([.][0-9]+)?$", amount.toString(),
+ "Amount does not match the regex pattern /^[0-9]+([.][0-9]+)?$/");
+ this.amount = amount;
+ }
+
+ public String getBasis() {
+ return basis;
+ }
+
+ public void setBasis(BasisTypes basis) {
+ this.basis = basis.toString().toLowerCase();
+ }
+
+ public String getContractType() {
+ return contractType;
+ }
+
+ public void setContractType(String contractType) {
+ Validator.checkPattern("^\\w{2,30}$", contractType,
+ "ContractType does not match regex pattern /^\\w{2,30}$/");
+ this.contractType = contractType;
+ }
+
+ public String getCurrency() {
+ return currency;
+ }
+
+ public void setCurrency(String currency) {
+ Validator.checkPattern("^[A-Z]{3}$", currency,
+ "Currency does not match the regex pattern /^[A-Z]{3}$/");
+ this.currency = currency;
+ }
+
+ public int getDateStart() {
+ return dateStart;
+ }
+
+ public void setDateStart(int dateStart) {
+ Validator.checkPattern("^\\d{1,10}$", Integer.toString(dateStart),
+ "Date Start does not match the regex pattern /^\\d{1,10}$/");
+ this.dateStart = dateStart;
+ }
+
+ public int getDateExpiry() {
+ return dateExpiry;
+ }
+
+ public void setDateExpiry(int dateExpiry) {
+ Validator.checkPattern("^\\d{1,10}$", Integer.toString(dateStart),
+ "Date Expiry does not match the regex pattern /^\\d{1,10}$/");
+ this.dateExpiry = dateExpiry;
+ }
+
+ public int getDuration() {
+ return duration;
+ }
+
+ public void setDuration(int duration) {
+ this.duration = duration;
+ }
+
+ public String getDurationUnit() {
+ return durationUnit;
+ }
+
+ public void setDurationUnit(DurationUnits durationUnit) {
+ this.durationUnit = durationUnit.toString().toLowerCase().substring(0, 1);
+ }
+
+ public String getSymbol() {
+ return symbol;
+ }
+
+ public void setSymbol(String symbol) {
+ Validator.checkPattern("^\\w{2,30}$", symbol,
+ "Symbol does not match the regex pattern /^\\w{2,30}$/");
+ this.symbol = symbol;
+ }
+
+ public String getBarrier() {
+ return barrier;
+ }
+
+ public void setBarrier(String barrier) {
+ Validator.checkPattern("^[+-]?\\d+\\.?\\d*$", barrier,
+ "Barrier does not match the regex pattern /^[+-]?\\d+\\.?\\d*$/");
+ this.barrier = barrier;
+ }
+
+ public String getBarrier2() {
+ return barrier2;
+ }
+
+ public void setBarrier2(String barrier2) {
+ Validator.checkPattern("^[+-]?\\d+\\.?\\d*$", barrier,
+ "Barrier2 does not match the regex pattern /^[+-]?\\d+\\.?\\d*$/");
+ this.barrier2 = barrier2;
+ }
+
+ public String getTradingPeriodStart() {
+ return tradingPeriodStart;
+ }
+
+ public void setTradingPeriodStart(String tradingPeriodStart) {
+ this.tradingPeriodStart = tradingPeriodStart;
+ }
+}
diff --git a/Trading/src/main/java/com/suneesh/trading/models/requests/ProfitTableRequest.java b/Trading/src/main/java/com/suneesh/trading/models/requests/ProfitTableRequest.java
new file mode 100644
index 0000000..5293cfd
--- /dev/null
+++ b/Trading/src/main/java/com/suneesh/trading/models/requests/ProfitTableRequest.java
@@ -0,0 +1,127 @@
+package com.suneesh.trading.models.requests;
+
+import com.suneesh.trading.models.enums.SortTypes;
+import com.suneesh.trading.models.responses.ProfitTableResponse;
+import com.suneesh.trading.utils.Validator;
+import com.google.gson.annotations.SerializedName;
+import io.reactivex.annotations.Nullable;
+
+/**
+ * ProfitTableRequest
+ *
+ * Profit Table Send
+ *
+ * Retrieve a summary of account Profit Table, according to given search criteria
+ *
+ *
+ * @author Morteza Tavanarad
+ * @version 1.0.0
+ * @since 8/8/2017
+ */
+public class ProfitTableRequest extends RequestBase {
+
+ @SerializedName("profit_table")
+ private final int profitTable = 1;
+
+ /**
+ * If set to 1, will return full contracts description.
+ */
+ @SerializedName("description")
+ @Nullable
+ private Integer description;
+
+ /**
+ * Apply upper limit to count of transactions received
+ */
+ @SerializedName("limit")
+ @Nullable
+ private Integer limit;
+
+ /**
+ * Skip this many transactions
+ */
+ @SerializedName("offset")
+ @Nullable
+ private Integer offset;
+
+ /**
+ * Optional start date (epoch or YYYY-MM-DD)
+ */
+ @SerializedName("date_from")
+ @Nullable
+ private String date_from;
+
+ /**
+ * Optional end date (epoch or YYYY-MM-DD)
+ */
+ @SerializedName("date_to")
+ @Nullable
+ private String date_to;
+
+ /**
+ * sort direction, default DESC
+ */
+ @SerializedName("sort")
+ @Nullable
+ private String sort;
+
+ public ProfitTableRequest() {
+ this.responseType = ProfitTableResponse.class;
+ }
+
+ public boolean getDescription() {
+ return description == 1 ? true : false;
+ }
+
+ public void setDescription(boolean description) {
+ this.description = description ? 1 : null;
+ }
+
+ public Integer getLimit() {
+ return limit;
+ }
+
+ public void setLimit(Integer limit) {
+ Validator.checkPattern("^\\d{1,3}$", limit.toString(),
+ "Limit does not match the regex pattern /^\\d{1,3}$/");
+ this.limit = limit;
+ }
+
+ public Integer getOffset() {
+ return offset;
+ }
+
+ public void setOffset(Integer offset) {
+ this.offset = offset;
+ }
+
+ public String getDate_from() {
+ return date_from;
+ }
+
+ public void setDate_from(String date_from) {
+ Validator.checkPattern("^(\\d{4}-(0?[1-9]|1[012])-(0?[1-9]|[12][0-9]|3[01])|\\d{1,10})$",
+ date_from,
+ "DateFrom does not match the regex pattern /^(\\d{4}-(0?[1-9]|1[012])-(0?[1-9]|[12][0-9]|3[01])|\\d{1,10})$/");
+ this.date_from = date_from;
+ }
+
+ public String getDate_to() {
+ return date_to;
+ }
+
+ public void setDate_to(String date_to) {
+ Validator.checkPattern("^(\\d{4}-(0?[1-9]|1[012])-(0?[1-9]|[12][0-9]|3[01])|\\d{1,10})$",
+ date_to,
+ "DateTo does not match the regex pattern /^(\\d{4}-(0?[1-9]|1[012])-(0?[1-9]|[12][0-9]|3[01])|\\d{1,10})$/");
+ this.date_to = date_to;
+ }
+
+ public String getSort() {
+ return sort;
+ }
+
+ public void setSort(SortTypes sort) {
+ this.sort = sort.toString();
+ }
+}
diff --git a/Trading/src/main/java/com/suneesh/trading/models/requests/ProposalOpenContractRequest.java b/Trading/src/main/java/com/suneesh/trading/models/requests/ProposalOpenContractRequest.java
new file mode 100644
index 0000000..1aabede
--- /dev/null
+++ b/Trading/src/main/java/com/suneesh/trading/models/requests/ProposalOpenContractRequest.java
@@ -0,0 +1,41 @@
+package com.suneesh.trading.models.requests;
+
+import com.suneesh.trading.models.responses.ProposalOpenContractResponse;
+import com.google.gson.annotations.SerializedName;
+
+/**
+ * ProposalOpenContractRequest
+ *
+ * Latest price for an open contract
+ *
+ * Get latest price (and other information) for a contract in the user's portfolio
+ *
+ *
+ * @author Morteza Tavanarad
+ * @version 1.0.0
+ * @since 8/8/2017
+ */
+public class ProposalOpenContractRequest extends RequestBase {
+
+ @SerializedName("proposal_open_contract")
+ private final int proposalOpenContract = 1;
+
+ /**
+ * Contract id received from a Portfolio request. If not set, you will receive stream of all open contracts.
+ */
+ @SerializedName("contract_id")
+ private Long contractId;
+
+ public ProposalOpenContractRequest(Long contractId) {
+ this.responseType = ProposalOpenContractResponse.class;
+ this.contractId = contractId;
+ }
+
+ public Long getContractId() {
+ return contractId;
+ }
+
+ public void setContractId(Long contractId) {
+ this.contractId = contractId;
+ }
+}
diff --git a/Trading/src/main/java/com/suneesh/trading/models/requests/RealityCheckRequest.java b/Trading/src/main/java/com/suneesh/trading/models/requests/RealityCheckRequest.java
new file mode 100644
index 0000000..9bbb801
--- /dev/null
+++ b/Trading/src/main/java/com/suneesh/trading/models/requests/RealityCheckRequest.java
@@ -0,0 +1,28 @@
+package com.suneesh.trading.models.requests;
+
+import com.suneesh.trading.models.responses.RealityCheckResponse;
+import com.google.gson.annotations.SerializedName;
+
+/**
+ * RealityCheckRequest
+ *
+ * Reality check send
+ *
+ * Retrieve summary of client's trades and account for the Reality Check facility.
+ * A 'reality check' means a display of time elapsed since the session began, and associated client profit/loss.
+ * The Reality Check facility is a regulatory requirement for certain landing companies.
+ *
+ *
+ * @author Morteza Tavanarad
+ * @version 1.0.0
+ * @since 8/8/2017
+ */
+public class RealityCheckRequest extends RequestBase {
+
+ @SerializedName("reality_check")
+ private final int realityCheck = 1;
+
+ public RealityCheckRequest() {
+ this.responseType = RealityCheckResponse.class;
+ }
+}
diff --git a/Trading/src/main/java/com/suneesh/trading/models/requests/RequestBase.java b/Trading/src/main/java/com/suneesh/trading/models/requests/RequestBase.java
new file mode 100644
index 0000000..e623f3e
--- /dev/null
+++ b/Trading/src/main/java/com/suneesh/trading/models/requests/RequestBase.java
@@ -0,0 +1,49 @@
+package com.suneesh.trading.models.requests;
+
+import com.google.gson.JsonObject;
+import com.google.gson.annotations.Expose;
+import com.google.gson.annotations.SerializedName;
+import io.reactivex.annotations.Nullable;
+
+import java.lang.reflect.Type;
+
+/**
+ * Created by morteza on 7/19/2017.
+ */
+
+public class RequestBase {
+ @SerializedName("passthrough")
+ JsonObject passThrough;
+
+ @SerializedName("req_id")
+ @Nullable
+ Integer id = null;
+
+ @Expose
+ transient Type responseType;
+
+ public JsonObject getPassThrough() {
+ return passThrough;
+ }
+
+ public void setPassThrough(JsonObject passThrough) {
+ this.passThrough = passThrough;
+ }
+
+ @Nullable
+ public Integer getId() {
+ return id;
+ }
+
+ public void setId(@Nullable Integer id) {
+ this.id = id;
+ }
+
+ public Type getResponseType() {
+ return responseType;
+ }
+
+ public void setResponseType(Type responseType) {
+ this.responseType = responseType;
+ }
+}
diff --git a/Trading/src/main/java/com/suneesh/trading/models/requests/ResidenceListRequest.java b/Trading/src/main/java/com/suneesh/trading/models/requests/ResidenceListRequest.java
new file mode 100644
index 0000000..c7edeb1
--- /dev/null
+++ b/Trading/src/main/java/com/suneesh/trading/models/requests/ResidenceListRequest.java
@@ -0,0 +1,26 @@
+package com.suneesh.trading.models.requests;
+
+import com.suneesh.trading.models.responses.ResidenceListResponce;
+import com.google.gson.annotations.SerializedName;
+
+/**
+ * ResidenceListRequest
+ *
+ * Residence List Send
+ *
+ * This call returns a list of countries and 2-letter country codes, suitable for populating the account opening form.
+ *
+ *
+ * @author Morteza Tavanarad
+ * @version 1.0.0
+ * @since 8/2/2017
+ */
+public class ResidenceListRequest extends RequestBase {
+
+ @SerializedName("residence_list")
+ private final int residentList = 1;
+
+ public ResidenceListRequest(){
+ this.responseType = ResidenceListResponce.class;
+ }
+}
diff --git a/Trading/src/main/java/com/suneesh/trading/models/requests/RevokeOauthApplicationRequest.java b/Trading/src/main/java/com/suneesh/trading/models/requests/RevokeOauthApplicationRequest.java
new file mode 100644
index 0000000..10a71d8
--- /dev/null
+++ b/Trading/src/main/java/com/suneesh/trading/models/requests/RevokeOauthApplicationRequest.java
@@ -0,0 +1,27 @@
+package com.suneesh.trading.models.requests;
+
+import com.suneesh.trading.models.responses.RevokeOauthApplicationResponse;
+import com.google.gson.annotations.SerializedName;
+
+/**
+ * RevokeOauthApplicationRequest
+ *
+ * Revoke Oauth Framework Send
+ *
+ * Used for revoking access of particular app.
+ *
+ *
+ * @author Morteza Tavanarad
+ * @version 1.0.0
+ * @since 9/4/2017
+ */
+public class RevokeOauthApplicationRequest extends RequestBase {
+
+ @SerializedName("revoke_oauth_app")
+ private Long appId;
+
+ public RevokeOauthApplicationRequest(Long appId) {
+ this.responseType = RevokeOauthApplicationResponse.class;
+ this.appId = appId;
+ }
+}
diff --git a/Trading/src/main/java/com/suneesh/trading/models/requests/SellContractForMultipleAccountsRequest.java b/Trading/src/main/java/com/suneesh/trading/models/requests/SellContractForMultipleAccountsRequest.java
new file mode 100644
index 0000000..a8ca4de
--- /dev/null
+++ b/Trading/src/main/java/com/suneesh/trading/models/requests/SellContractForMultipleAccountsRequest.java
@@ -0,0 +1,81 @@
+package com.suneesh.trading.models.requests;
+
+import com.suneesh.trading.models.responses.SellContractForMultipleAccountsResponse;
+import com.google.gson.annotations.SerializedName;
+
+import java.math.BigDecimal;
+import java.util.List;
+
+/**
+ * SellContractForMultipleAccounts
+ *
+ * Sell multiple contracts
+ *
+ * Sell contracts for multiple accounts simultaneously. Uses the shortcode response from buy_contract_for_multiple_accounts to identify the contract,
+ * and authorisation tokens to select which accounts to sell those contracts on. Note that only the accounts identified by the tokens will be affected.
+ * This will not sell the contract on the currently-authorised account unless you include the token for the current account.
+ *
+ *
+ * @author Morteza Tavanarad
+ * @version 1.0.0
+ * @since 8/9/2017
+ */
+public class SellContractForMultipleAccountsRequest extends RequestBase {
+
+ @SerializedName("sell_contract_for_multiple_accounts")
+ private final int sellContractForMultipleAccounts = 1;
+
+ /**
+ * An internal ID used to identify the contract which was originally bought.
+ * This is returned from the buy and buy_for_multiple_accounts calls.
+ */
+ @SerializedName("shortcode")
+ private String shortCode;
+
+ /**
+ * Authorisation tokens which select the accounts to sell use for the affected accounts
+ */
+ @SerializedName("tokens")
+ private List tokens;
+
+ /**
+ * Minimum price at which to sell the contract, or '0' for 'sell at market'
+ */
+ @SerializedName("price")
+ private BigDecimal price;
+
+ private SellContractForMultipleAccountsRequest() {
+ this.responseType = SellContractForMultipleAccountsResponse.class;
+ }
+
+ public SellContractForMultipleAccountsRequest(String shortCode, BigDecimal price, List tokens) {
+ this();
+ this.price = price;
+ this.tokens = tokens;
+ this.shortCode = shortCode;
+ }
+
+ public String getShortCode() {
+ return shortCode;
+ }
+
+ public void setShortCode(String shortCode) {
+ this.shortCode = shortCode;
+ }
+
+ public List getTokens() {
+ return tokens;
+ }
+
+ public void setTokens(List tokens) {
+ this.tokens = tokens;
+ }
+
+ public BigDecimal getPrice() {
+ return price;
+ }
+
+ public void setPrice(BigDecimal price) {
+ this.price = price;
+ }
+}
diff --git a/Trading/src/main/java/com/suneesh/trading/models/requests/SellContractRequest.java b/Trading/src/main/java/com/suneesh/trading/models/requests/SellContractRequest.java
new file mode 100644
index 0000000..9c457d2
--- /dev/null
+++ b/Trading/src/main/java/com/suneesh/trading/models/requests/SellContractRequest.java
@@ -0,0 +1,59 @@
+package com.suneesh.trading.models.requests;
+
+import com.suneesh.trading.models.responses.SellContractResponse;
+import com.google.gson.annotations.SerializedName;
+
+import java.math.BigDecimal;
+
+/**
+ * SellContractRequest
+ *
+ * Sell a Contract Send
+ *
+ * Sell a Contract as identified from a previous Portfolio call
+ *
+ *
+ * @author Morteza Tavanarad
+ * @version 1.0.0
+ * @since 8/9/2017
+ */
+public class SellContractRequest extends RequestBase {
+
+ /**
+ * Pass contract_id received from the Portfolio call
+ */
+ @SerializedName("sell")
+ private Long contractId;
+
+ /**
+ * Minimum price at which to sell the contract, or '0' for 'sell at market'
+ */
+ @SerializedName("price")
+ private BigDecimal price;
+
+ private SellContractRequest() {
+ this.responseType = SellContractResponse.class;
+ }
+
+ public SellContractRequest(Long contractId, BigDecimal price) {
+ this();
+ this.price = price;
+ this.contractId = contractId;
+ }
+
+ public Long getContractId() {
+ return contractId;
+ }
+
+ public void setContractId(Long contractId) {
+ this.contractId = contractId;
+ }
+
+ public BigDecimal getPrice() {
+ return price;
+ }
+
+ public void setPrice(BigDecimal price) {
+ this.price = price;
+ }
+}
diff --git a/Trading/src/main/java/com/suneesh/trading/models/requests/SellExpiredContractsRequest.java b/Trading/src/main/java/com/suneesh/trading/models/requests/SellExpiredContractsRequest.java
new file mode 100644
index 0000000..9d1219c
--- /dev/null
+++ b/Trading/src/main/java/com/suneesh/trading/models/requests/SellExpiredContractsRequest.java
@@ -0,0 +1,26 @@
+package com.suneesh.trading.models.requests;
+
+import com.suneesh.trading.models.responses.SellExpiredContractsResponse;
+import com.google.gson.annotations.SerializedName;
+
+/**
+ * SellExpiredContractsRequest
+ *
+ * Sell expired contracts
+ *
+ * This call will try to sell any expired contracts and return the number of sold contracts.
+ *
+ *
+ * @author Morteza Tavanarad
+ * @version 1.0.0
+ * @since 8/9/2017
+ */
+public class SellExpiredContractsRequest extends RequestBase {
+
+ @SerializedName("sell_expired")
+ private final int sellExpired = 1;
+
+ public SellExpiredContractsRequest() {
+ this.responseType = SellExpiredContractsResponse.class;
+ }
+}
diff --git a/Trading/src/main/java/com/suneesh/trading/models/requests/SetAccountCurrencyRequest.java b/Trading/src/main/java/com/suneesh/trading/models/requests/SetAccountCurrencyRequest.java
new file mode 100644
index 0000000..00b212b
--- /dev/null
+++ b/Trading/src/main/java/com/suneesh/trading/models/requests/SetAccountCurrencyRequest.java
@@ -0,0 +1,39 @@
+package com.suneesh.trading.models.requests;
+
+import com.suneesh.trading.models.responses.SetAccountCurrencyResponse;
+import com.google.gson.annotations.SerializedName;
+
+/**
+ * SetAccountCurrencyRequest
+ *
+ * Set Account Currency
+ *
+ * Set account currency, this will be default currency for your account i.e currency for trading, deposit.
+ * Please note that account currency can only be set once, and then can never be changed.
+ *
+ *
+ * @author Morteza Tavanarad
+ * @version 1.0.0
+ * @since 9/4/2017
+ */
+public class SetAccountCurrencyRequest extends RequestBase {
+
+ /**
+ * Currency of the account. List of supported currencies can be acquired with 'payout_currencies' call
+ */
+ @SerializedName("set_account_currency")
+ private String accountCurrency;
+
+ public SetAccountCurrencyRequest(String accountCurrency) {
+ this.responseType = SetAccountCurrencyResponse.class;
+ this.accountCurrency = accountCurrency;
+ }
+
+ public String getAccountCurrency() {
+ return accountCurrency;
+ }
+
+ public void setAccountCurrency(String accountCurrency) {
+ this.accountCurrency = accountCurrency;
+ }
+}
diff --git a/Trading/src/main/java/com/suneesh/trading/models/requests/SetAccountSettingsRequest.java b/Trading/src/main/java/com/suneesh/trading/models/requests/SetAccountSettingsRequest.java
new file mode 100644
index 0000000..5b9dec6
--- /dev/null
+++ b/Trading/src/main/java/com/suneesh/trading/models/requests/SetAccountSettingsRequest.java
@@ -0,0 +1,220 @@
+package com.suneesh.trading.models.requests;
+
+import com.suneesh.trading.models.enums.AccountOpeningReasons;
+import com.suneesh.trading.models.responses.SetAccountSettingsResponse;
+import com.google.gson.annotations.SerializedName;
+
+/**
+ * @author Morteza Tavanarad
+ * @version 1.0.0
+ * @since 9/13/2017
+ */
+public class SetAccountSettingsRequest extends RequestBase {
+
+ @SerializedName("set_settings")
+ private final int setSettings = 1;
+
+ /**
+ * Note: not applicable for virtual account. Required field for real money account.
+ */
+ @SerializedName("address_line_1")
+ private String firstLineAddress;
+
+ /**
+ * Note: not applicable for virtual account. Required field for real money account.
+ */
+ @SerializedName("address_line_2")
+ private String secondLineAddress;
+
+ /**
+ * Note: not applicable for virtual account. Required field for real money account.
+ */
+ @SerializedName("address_city")
+ private String city;
+
+ /**
+ * Note: not applicable for virtual account. Required field for real money account.
+ */
+ @SerializedName("address_state")
+ private String state;
+
+ /**
+ * Note: not applicable for virtual account. Required field for real money account.
+ */
+ @SerializedName("address_postcode")
+ private String postcode;
+
+ /**
+ * Note: not applicable for virtual account. Required field for real money account.
+ */
+ @SerializedName("phone")
+ private String phone;
+
+ /**
+ * 2-letter country code. Note: not applicable for real money account.
+ * Only allow for Virtual account without residence set.
+ */
+ @SerializedName("residence")
+ private String residence;
+
+ /**
+ * Boolean value 1 or 0, indicating permission to use email address for any contact which may include marketing
+ */
+ @SerializedName("email_consent")
+ private Integer emailConsent;
+
+ /**
+ * Place of birth, 2-letter country code.
+ */
+ @SerializedName("place_of_birth")
+ private String placeOfBirth;
+
+ /**
+ * Residence for tax purpose. Comma separated iso country code if multiple jurisdictions.
+ * Only applicable for real money account. Required for maltainvest landing company.
+ */
+ @SerializedName("tax_residence")
+ private String taxResidence;
+
+ /**
+ * Tax identification number. Only applicable for real money account. Required for maltainvest landing company.
+ */
+ @SerializedName("tax_identification_number")
+ private String taxIdentificationNumber;
+
+ /**
+ * Purpose and reason for requesting the account opening.
+ * Only applicable for real money account. Required for clients that have not set it yet. Can only be set once.
+ */
+ @SerializedName("account_opening_reason")
+ private String accountOpeningReason;
+
+ /**
+ * Boolean value 1 or 0, indicating permission to allow others to follow your trades.
+ * Note: not applicable for Virtual account. Only allow for real money account.
+ */
+ @SerializedName("allow_copiers")
+ private Integer allowCopiers;
+
+ /**
+ * Japan real money client settings, only applicable for Japan real money account client.
+ */
+ @SerializedName("jp_settings")
+ private JapanAccountSetting japanAccountSetting;
+
+ public SetAccountSettingsRequest() {
+ this.responseType = SetAccountSettingsResponse.class;
+ }
+
+ public String getFirstLineAddress() {
+ return firstLineAddress;
+ }
+
+ public void setFirstLineAddress(String firstLineAddress) {
+ this.firstLineAddress = firstLineAddress;
+ }
+
+ public String getSecondLineAddress() {
+ return secondLineAddress;
+ }
+
+ public void setSecondLineAddress(String secondLineAddress) {
+ this.secondLineAddress = secondLineAddress;
+ }
+
+ public String getCity() {
+ return city;
+ }
+
+ public void setCity(String city) {
+ this.city = city;
+ }
+
+ public String getState() {
+ return state;
+ }
+
+ public void setState(String state) {
+ this.state = state;
+ }
+
+ public String getPostcode() {
+ return postcode;
+ }
+
+ public void setPostcode(String postcode) {
+ this.postcode = postcode;
+ }
+
+ public String getPhone() {
+ return phone;
+ }
+
+ public void setPhone(String phone) {
+ this.phone = phone;
+ }
+
+ public String getResidence() {
+ return residence;
+ }
+
+ public void setResidence(String residence) {
+ this.residence = residence;
+ }
+
+ public boolean getEmailConsent() {
+ return emailConsent == 1 ? true : false;
+ }
+
+ public void setEmailConsent(boolean emailConsent) {
+ this.emailConsent = emailConsent ? 1 : 0;
+ }
+
+ public String getPlaceOfBirth() {
+ return placeOfBirth;
+ }
+
+ public void setPlaceOfBirth(String placeOfBirth) {
+ this.placeOfBirth = placeOfBirth;
+ }
+
+ public String getTaxResidence() {
+ return taxResidence;
+ }
+
+ public void setTaxResidence(String taxResidence) {
+ this.taxResidence = taxResidence;
+ }
+
+ public String getTaxIdentificationNumber() {
+ return taxIdentificationNumber;
+ }
+
+ public void setTaxIdentificationNumber(String taxIdentificationNumber) {
+ this.taxIdentificationNumber = taxIdentificationNumber;
+ }
+
+ public String getAccountOpeningReason() {
+ return accountOpeningReason;
+ }
+
+ public void setAccountOpeningReason(AccountOpeningReasons accountOpeningReason) {
+ this.accountOpeningReason = accountOpeningReason.toString();
+ }
+
+ public boolean getAllowCopiers() {
+ return allowCopiers == 1 ? true : false;
+ }
+
+ public void setAllowCopiers(boolean allowCopiers) {
+ this.allowCopiers = allowCopiers ? 1 : 0;
+ }
+
+ public JapanAccountSetting getJapanAccountSetting() {
+ return japanAccountSetting;
+ }
+
+ public void setJapanAccountSetting(JapanAccountSetting japanAccountSetting) {
+ this.japanAccountSetting = japanAccountSetting;
+ }
+}
diff --git a/Trading/src/main/java/com/suneesh/trading/models/requests/SetFinancialAssessmentRequest.java b/Trading/src/main/java/com/suneesh/trading/models/requests/SetFinancialAssessmentRequest.java
new file mode 100644
index 0000000..b71097c
--- /dev/null
+++ b/Trading/src/main/java/com/suneesh/trading/models/requests/SetFinancialAssessmentRequest.java
@@ -0,0 +1,323 @@
+package com.suneesh.trading.models.requests;
+
+import com.suneesh.trading.models.enums.*;
+import com.suneesh.trading.models.responses.SetFinancialAssessmentResponse;
+import com.google.gson.annotations.SerializedName;
+import com.suneesh.trading.models.enums.*;
+
+/**
+ * SetFinancialAssessmentRequest
+ *
+ * Save Financial assessment details send
+ *
+ * This call sets the financial assessement details based on the client's answers to analyse
+ * whether he possess the experience and knowledge to understand the risks involved with binary options trading.
+ * Not applicable for Japan landing company.
+ *
+ * @author Morteza Tavanarad
+ * @version 1.0.0
+ * @since 9/4/2017
+ */
+public class SetFinancialAssessmentRequest extends RequestBase {
+
+ @SerializedName("set_financial_assessment")
+ private final int setFinancialAssessment = 1;
+
+ /**
+ * Forex trading experience
+ */
+ @SerializedName("forex_trading_experience")
+ private String forexTradingExperience;
+
+ /**
+ * Forex trading frequency
+ */
+ @SerializedName("forex_trading_frequency")
+ private String forexTradingFrequency;
+
+ /**
+ * Indices trading experience
+ */
+ @SerializedName("indices_trading_experience")
+ private String indicesTradingExperience;
+
+ /**
+ * Indices trading frequency
+ */
+ @SerializedName("indices_trading_frequency")
+ private String indicesTradingFrequency;
+
+ /**
+ * Commodities trading experience
+ */
+ @SerializedName("commodities_trading_experience")
+ private String commoditiesTradingExperience;
+
+ /**
+ * Commodities trading frequency
+ */
+ @SerializedName("commodities_trading_frequency")
+ private String commoditiesTradingFrequency;
+
+ /**
+ * Stocks trading experience
+ */
+ @SerializedName("stocks_trading_experience")
+ private String stocksTradingExperience;
+
+ /**
+ * Stocks trading frequency
+ */
+ @SerializedName("stocks_trading_frequency")
+ private String stocksTradingFrequency;
+
+ /**
+ * Binary options or other financial derivatives trading experience
+ */
+ @SerializedName("other_derivatives_trading_experience")
+ private String otherDerivativesTradingExperience;
+
+ /**
+ * Binary options or other derivatives trading frequency
+ */
+ @SerializedName("other_derivatives_trading_frequency")
+ private String otherDerivativesTradingFrequency;
+
+ /**
+ * Other financial instruments trading experience
+ */
+ @SerializedName("other_instruments_trading_experience")
+ private String otherInstrumentsTradingExperience;
+
+ /**
+ * Other financial instruments trading frequency
+ */
+ @SerializedName("other_instruments_trading_frequency")
+ private String otherInstrumentsTradingFrequency;
+
+ /**
+ * Industry of Employment
+ */
+ @SerializedName("employment_industry")
+ private String employmentIndustry;
+
+ /**
+ * Level of education
+ */
+ @SerializedName("education_level")
+ private String educationLevel;
+
+ /**
+ * Income source
+ */
+ @SerializedName("income_source")
+ private String incomeSource;
+
+ /**
+ * Net annual income
+ */
+ @SerializedName("net_income")
+ private String netIncome;
+
+ /**
+ * Estimated Net worth
+ */
+ @SerializedName("estimated_worth")
+ private String estimatedWorth;
+
+ /**
+ * The anticipated account turnover
+ */
+ @SerializedName("account_turnover")
+ private String accountTurnover;
+
+ /**
+ * Occupation
+ */
+ @SerializedName("occupation")
+ private String occupation;
+
+ /**
+ * Employment status
+ */
+ @SerializedName("employment_status")
+ private String employmentStatus;
+
+ /**
+ * Source of wealth
+ */
+ @SerializedName("source_of_wealth")
+ private String sourceOfWealth;
+
+ public SetFinancialAssessmentRequest() {
+ this.responseType = SetFinancialAssessmentResponse.class;
+ }
+
+ public String getForexTradingExperience() {
+ return forexTradingExperience;
+ }
+
+ public void setForexTradingExperience(ExperienceDuration forexTradingExperience) {
+ this.forexTradingExperience = forexTradingExperience.toString();
+ }
+
+ public String getForexTradingFrequency() {
+ return forexTradingFrequency;
+ }
+
+ public void setForexTradingFrequency(TradeFrequency forexTradingFrequency) {
+ this.forexTradingFrequency = forexTradingFrequency.toString();
+ }
+
+ public String getIndicesTradingExperience() {
+ return indicesTradingExperience;
+ }
+
+ public void setIndicesTradingExperience(ExperienceDuration indicesTradingExperience) {
+ this.indicesTradingExperience = indicesTradingExperience.toString();
+ }
+
+ public String getIndicesTradingFrequency() {
+ return indicesTradingFrequency;
+ }
+
+ public void setIndicesTradingFrequency(TradeFrequency indicesTradingFrequency) {
+ this.indicesTradingFrequency = indicesTradingFrequency.toString();
+ }
+
+ public String getCommoditiesTradingExperience() {
+ return commoditiesTradingExperience;
+ }
+
+ public void setCommoditiesTradingExperience(ExperienceDuration commoditiesTradingExperience) {
+ this.commoditiesTradingExperience = commoditiesTradingExperience.toString();
+ }
+
+ public String getCommoditiesTradingFrequency() {
+ return commoditiesTradingFrequency;
+ }
+
+ public void setCommoditiesTradingFrequency(TradeFrequency commoditiesTradingFrequency) {
+ this.commoditiesTradingFrequency = commoditiesTradingFrequency.toString();
+ }
+
+ public String getStocksTradingExperience() {
+ return stocksTradingExperience;
+ }
+
+ public void setStocksTradingExperience(ExperienceDuration stocksTradingExperience) {
+ this.stocksTradingExperience = stocksTradingExperience.toString();
+ }
+
+ public String getStocksTradingFrequency() {
+ return stocksTradingFrequency;
+ }
+
+ public void setStocksTradingFrequency(TradeFrequency stocksTradingFrequency) {
+ this.stocksTradingFrequency = stocksTradingFrequency.toString();
+ }
+
+ public String getOtherDerivativesTradingExperience() {
+ return otherDerivativesTradingExperience;
+ }
+
+ public void setOtherDerivativesTradingExperience(ExperienceDuration otherDerivativesTradingExperience) {
+ this.otherDerivativesTradingExperience = otherDerivativesTradingExperience.toString();
+ }
+
+ public String getOtherDerivativesTradingFrequency() {
+ return otherDerivativesTradingFrequency;
+ }
+
+ public void setOtherDerivativesTradingFrequency(TradeFrequency otherDerivativesTradingFrequency) {
+ this.otherDerivativesTradingFrequency = otherDerivativesTradingFrequency.toString();
+ }
+
+ public String getOtherInstrumentsTradingExperience() {
+ return otherInstrumentsTradingExperience;
+ }
+
+ public void setOtherInstrumentsTradingExperience(ExperienceDuration otherInstrumentsTradingExperience) {
+ this.otherInstrumentsTradingExperience = otherInstrumentsTradingExperience.toString();
+ }
+
+ public String getOtherInstrumentsTradingFrequency() {
+ return otherInstrumentsTradingFrequency;
+ }
+
+ public void setOtherInstrumentsTradingFrequency(TradeFrequency otherInstrumentsTradingFrequency) {
+ this.otherInstrumentsTradingFrequency = otherInstrumentsTradingFrequency.toString();
+ }
+
+ public String getEmploymentIndustry() {
+ return employmentIndustry;
+ }
+
+ public void setEmploymentIndustry(EmploymentIndustries employmentIndustry) {
+ this.employmentIndustry = employmentIndustry.toString();
+ }
+
+ public String getEducationLevel() {
+ return educationLevel;
+ }
+
+ public void setEducationLevel(EducationLevels educationLevel) {
+ this.educationLevel = educationLevel.toString();
+ }
+
+ public String getIncomeSource() {
+ return incomeSource;
+ }
+
+ public void setIncomeSource(IncomeSources incomeSource) {
+ this.incomeSource = incomeSource.toString();
+ }
+
+ public String getNetIncome() {
+ return netIncome;
+ }
+
+ public void setNetIncome(TurnoverRanges netIncome) {
+ this.netIncome = netIncome.toString();
+ }
+
+ public String getEstimatedWorth() {
+ return estimatedWorth;
+ }
+
+ public void setEstimatedWorth(EstimatedWorth estimatedWorth) {
+ this.estimatedWorth = estimatedWorth.toString();
+ }
+
+ public String getAccountTurnover() {
+ return accountTurnover;
+ }
+
+ public void setAccountTurnover(TurnoverRanges accountTurnover) {
+ this.accountTurnover = accountTurnover.toString();
+ }
+
+ public String getOccupation() {
+ return occupation;
+ }
+
+ public void setOccupation(Occupations occupation) {
+ this.occupation = occupation.toString();
+ }
+
+ public String getEmploymentStatus() {
+ return employmentStatus;
+ }
+
+ public void setEmploymentStatus(EmploymentStatuses employmentStatus) {
+ this.employmentStatus = employmentStatus.toString();
+ }
+
+ public String getSourceOfWealth() {
+ return sourceOfWealth;
+ }
+
+ public void setSourceOfWealth(WealthSources sourceOfWealth) {
+ this.sourceOfWealth = sourceOfWealth.toString();
+ }
+}
diff --git a/Trading/src/main/java/com/suneesh/trading/models/requests/SetSelfExclusionSettingsRequest.java b/Trading/src/main/java/com/suneesh/trading/models/requests/SetSelfExclusionSettingsRequest.java
new file mode 100644
index 0000000..188b226
--- /dev/null
+++ b/Trading/src/main/java/com/suneesh/trading/models/requests/SetSelfExclusionSettingsRequest.java
@@ -0,0 +1,175 @@
+package com.suneesh.trading.models.requests;
+
+import com.suneesh.trading.models.responses.SetSelfExclusionSettingsResponse;
+import com.google.gson.annotations.SerializedName;
+
+import java.math.BigDecimal;
+
+/**
+ * @author Morteza Tavanarad
+ * @version 1.0.0
+ * @since 9/12/2017
+ */
+public class SetSelfExclusionSettingsRequest extends RequestBase {
+
+ @SerializedName("set_self_exclusion")
+ private final int setSelfExclusion = 1;
+
+ /**
+ * Maximum account cash balance
+ */
+ @SerializedName("max_balance")
+ private BigDecimal maxBalance;
+
+ /**
+ * Daily turnover limit
+ */
+ @SerializedName("max_turnover")
+ private BigDecimal maxTurnover;
+
+ /**
+ * Daily limit on losses
+ */
+ @SerializedName("max_losses")
+ private BigDecimal maxLosses;
+
+ /**
+ * 7-day turnover limit
+ */
+ @SerializedName("max_7day_turnover")
+ private BigDecimal maxSevenDayTurnover;
+
+ /**
+ * 7-day limit on losses
+ */
+ @SerializedName("max_7day_losses")
+ private BigDecimal maxSevenDayLosses;
+
+ /**
+ * 30-day turnover limit
+ */
+ @SerializedName("max_30day_turnover")
+ private BigDecimal maxThirtyDayTurnover;
+
+ /**
+ * 30-day limit on losses
+ */
+ @SerializedName("max_30day_losses")
+ private BigDecimal maxThirtyDayLosses;
+
+ /**
+ * Maximum number of open positions
+ */
+ @SerializedName("max_open_bets")
+ private Integer maxOpenBets;
+
+ /**
+ * Session duration limit, in minutes
+ */
+ @SerializedName("session_duration_limit")
+ private Integer sessionDurationLimit;
+
+ /**
+ * Exclude me from the website until
+ */
+ @SerializedName("exclude_until")
+ private String excludeUntil;
+
+ /**
+ * Exclude me from the website until (epoch time)
+ */
+ @SerializedName("timeout_until")
+ private Long timeoutUntil;
+
+ public SetSelfExclusionSettingsRequest(){
+ this.responseType = SetSelfExclusionSettingsResponse.class;
+ }
+
+ public BigDecimal getMaxBalance() {
+ return maxBalance;
+ }
+
+ public void setMaxBalance(BigDecimal maxBalance) {
+ this.maxBalance = maxBalance;
+ }
+
+ public BigDecimal getMaxTurnover() {
+ return maxTurnover;
+ }
+
+ public void setMaxTurnover(BigDecimal maxTurnover) {
+ this.maxTurnover = maxTurnover;
+ }
+
+ public BigDecimal getMaxLosses() {
+ return maxLosses;
+ }
+
+ public void setMaxLosses(BigDecimal maxLosses) {
+ this.maxLosses = maxLosses;
+ }
+
+ public BigDecimal getMaxSevenDayTurnover() {
+ return maxSevenDayTurnover;
+ }
+
+ public void setMaxSevenDayTurnover(BigDecimal maxSevenDayTurnover) {
+ this.maxSevenDayTurnover = maxSevenDayTurnover;
+ }
+
+ public BigDecimal getMaxSevenDayLosses() {
+ return maxSevenDayLosses;
+ }
+
+ public void setMaxSevenDayLosses(BigDecimal maxSevenDayLosses) {
+ this.maxSevenDayLosses = maxSevenDayLosses;
+ }
+
+ public BigDecimal getMaxThirtyDayTurnover() {
+ return maxThirtyDayTurnover;
+ }
+
+ public void setMaxThirtyDayTurnover(BigDecimal maxThirtyDayTurnover) {
+ this.maxThirtyDayTurnover = maxThirtyDayTurnover;
+ }
+
+ public BigDecimal getMaxThirtyDayLosses() {
+ return maxThirtyDayLosses;
+ }
+
+ public void setMaxThirtyDayLosses(BigDecimal maxThirtyDayLosses) {
+ this.maxThirtyDayLosses = maxThirtyDayLosses;
+ }
+
+ public Integer getMaxOpenBets() {
+ return maxOpenBets;
+ }
+
+ public void setMaxOpenBets(Integer maxOpenBets) {
+ this.maxOpenBets = maxOpenBets;
+ }
+
+ public Integer getSessionDurationLimit() {
+ return sessionDurationLimit;
+ }
+
+ public void setSessionDurationLimit(Integer sessionDurationLimit) {
+ this.sessionDurationLimit = sessionDurationLimit;
+ }
+
+ public String getExcludeUntil() {
+ return excludeUntil;
+ }
+
+ public void setExcludeUntil(String excludeUntil) {
+ this.excludeUntil = excludeUntil;
+ }
+
+ public Long getTimeoutUntil() {
+ return timeoutUntil;
+ }
+
+ public void setTimeoutUntil(Long timeoutUntil) {
+ this.timeoutUntil = timeoutUntil;
+ }
+}
diff --git a/Trading/src/main/java/com/suneesh/trading/models/requests/StartCopyTradeRequest.java b/Trading/src/main/java/com/suneesh/trading/models/requests/StartCopyTradeRequest.java
new file mode 100644
index 0000000..c28d8bd
--- /dev/null
+++ b/Trading/src/main/java/com/suneesh/trading/models/requests/StartCopyTradeRequest.java
@@ -0,0 +1,110 @@
+package com.suneesh.trading.models.requests;
+
+import com.suneesh.trading.models.responses.StartCopyTradeResponse;
+import com.suneesh.trading.utils.Validator;
+import com.google.gson.annotations.SerializedName;
+
+import java.math.BigDecimal;
+import java.util.List;
+
+/**
+ * StartCopyTradeRequest
+ *
+ * Copy Start Send
+ *
+ * Start copy trader bets
+ *
+ *
+ *
+ * @author Morteza Tavanarad
+ * @version 1.0.0
+ * @since 8/9/2017
+ */
+public class StartCopyTradeRequest extends RequestBase {
+
+ /**
+ * API tokens identifying the accounts of trader which will be used to copy trades
+ *
+ */
+ @SerializedName("copy_start")
+ private String traderToken;
+
+ /**
+ * Optional field, used to set minimal trade stake to be copied
+ *
+ */
+ @SerializedName("min_trade_stake")
+ private BigDecimal minTradeStake;
+
+ /**
+ * Optional field, used to set maximum trade stake to be copied
+ *
+ */
+ @SerializedName("max_trade_stake")
+ private BigDecimal maxTradeStake;
+
+ /**
+ * Optional field, used to set assets to be copied. E.x ["frxUSDJPY", "R_50"]
+ *
+ */
+ @SerializedName("assets")
+ private List assets;
+
+ /**
+ * Optional field, used to set trade types to be copied. E.x ["CALL", "PUT"]
+ *
+ */
+ @SerializedName("trade_types")
+ private List tradeTypes;
+
+ private StartCopyTradeRequest() {
+ this.responseType = StartCopyTradeResponse.class;
+ }
+
+ public StartCopyTradeRequest(String traderToken) {
+ this();
+ this.setTraderToken(traderToken);
+ }
+
+ public String getTraderToken() {
+ return traderToken;
+ }
+
+ public void setTraderToken(String traderToken) {
+ Validator.checkPattern("^[\\w\\s-]{15,32}$", traderToken,
+ "Trader Token does not match the regex pattern /^[\\w\\s-]{15,32}$/");
+ this.traderToken = traderToken;
+ }
+
+ public BigDecimal getMinTradeStake() {
+ return minTradeStake;
+ }
+
+ public void setMinTradeStake(BigDecimal minTradeStake) {
+ this.minTradeStake = minTradeStake;
+ }
+
+ public BigDecimal getMaxTradeStake() {
+ return maxTradeStake;
+ }
+
+ public void setMaxTradeStake(BigDecimal maxTradeStake) {
+ this.maxTradeStake = maxTradeStake;
+ }
+
+ public List getAssets() {
+ return assets;
+ }
+
+ public void setAssets(List assets) {
+ this.assets = assets;
+ }
+
+ public List getTradeTypes() {
+ return tradeTypes;
+ }
+
+ public void setTradeTypes(List tradeTypes) {
+ this.tradeTypes = tradeTypes;
+ }
+}
diff --git a/Trading/src/main/java/com/suneesh/trading/models/requests/StatementRequest.java b/Trading/src/main/java/com/suneesh/trading/models/requests/StatementRequest.java
new file mode 100644
index 0000000..c0930d8
--- /dev/null
+++ b/Trading/src/main/java/com/suneesh/trading/models/requests/StatementRequest.java
@@ -0,0 +1,125 @@
+package com.suneesh.trading.models.requests;
+
+import com.suneesh.trading.models.enums.TransactionType;
+import com.suneesh.trading.models.responses.StatementResponse;
+import com.suneesh.trading.utils.Validator;
+import com.google.gson.annotations.SerializedName;
+import io.reactivex.annotations.Nullable;
+
+/**
+ * StatementRequest
+ *
+ *
Statement Send
+ *
+ * Retrieve a summary of account transactions, according to given search criteria
+ *
+ *
+ * @author Morteza Tavanarad
+ * @version 1.0.0
+ * @since 8/7/2017
+ */
+public class StatementRequest extends RequestBase {
+
+ @SerializedName("statement")
+ private final int statement = 1;
+
+ /**
+ * If set to 1, will return full contracts description.
+ */
+ @SerializedName("description")
+ @Nullable
+ private Integer description;
+
+ /**
+ * Apply upper limit to count of transactions received
+ */
+ @SerializedName("limit")
+ @Nullable
+ private Integer limit;
+
+ /**
+ * Skip this many transactions
+ */
+ @SerializedName("offset")
+ @Nullable
+ private Integer offset;
+
+ /**
+ * Optional start date (epoch)
+ */
+ @SerializedName("date_from")
+ @Nullable
+ private Integer dateFrom;
+
+ /**
+ * Optional end date (epoch)
+ */
+ @SerializedName("date_end")
+ @Nullable
+ private Integer dateEnd;
+
+ /**
+ * Optional filter for statement (deposit,withdrawal,buy,sell)
+ */
+ @SerializedName("action_type")
+ @Nullable
+ private String actionType;
+
+ public StatementRequest() {
+ this.responseType = StatementResponse.class;
+ }
+
+ public boolean getDescription() {
+ return description == 1 ? true : false;
+ }
+
+ public void setDescription(boolean description) {
+ this.description = description ? 1 : 0;
+ }
+
+ public Integer getLimit() {
+ return limit;
+ }
+
+ public void setLimit(Integer limit) {
+ this.limit = limit;
+ }
+
+ public Integer getOffset() {
+ return offset;
+ }
+
+ public void setOffset(Integer offset) {
+ Validator.checkPattern("^\\d{1,3}$", offset.toString(),
+ "Offset does not match the regex pattern /^\\d{1,3}/");
+ this.offset = offset;
+ }
+
+ public Integer getDateFrom() {
+ return dateFrom;
+ }
+
+ public void setDateFrom(Integer dateFrom) {
+ Validator.checkPattern("^\\d{1,10}$", dateFrom.toString(),
+ "DateFrom does not match the regex pattern /^\\d{1,10}/");
+ this.dateFrom = dateFrom;
+ }
+
+ public Integer getDateEnd() {
+ return dateEnd;
+ }
+
+ public void setDateEnd(Integer dateEnd) {
+ Validator.checkPattern("^\\d{1,10}$", dateEnd.toString(),
+ "DateEnd does not match the regex pattern /^\\d{1,10}/");
+ this.dateEnd = dateEnd;
+ }
+
+ public String getActionType() {
+ return actionType;
+ }
+
+ public void setActionType(TransactionType actionType) {
+ this.actionType = actionType.toString();
+ }
+}
\ No newline at end of file
diff --git a/Trading/src/main/java/com/suneesh/trading/models/requests/StatesListRequest.java b/Trading/src/main/java/com/suneesh/trading/models/requests/StatesListRequest.java
new file mode 100644
index 0000000..62a437e
--- /dev/null
+++ b/Trading/src/main/java/com/suneesh/trading/models/requests/StatesListRequest.java
@@ -0,0 +1,39 @@
+package com.suneesh.trading.models.requests;
+
+import com.suneesh.trading.models.responses.StatesListResponse;
+import com.suneesh.trading.utils.Validator;
+import com.google.gson.annotations.SerializedName;
+
+/**
+ * StatesListRequest
+ *
+ * States List Send
+ * For a given country, returns a list of States of that country. This is useful to populate the account opening form.
+ *
+ * @author Morteza Tavanarad
+ * @version 1.0.0
+ * @since 8/2/2017
+ */
+public class StatesListRequest extends RequestBase {
+
+ /**
+ * Two letter country code.
+ */
+ @SerializedName("states_list")
+ private String countyCode;
+
+ public StatesListRequest(String countyCode) {
+ this.responseType = StatesListResponse.class;
+ this.setCountyCode(countyCode);
+ }
+
+ public String getCountyCode() {
+ return countyCode;
+ }
+
+ public void setCountyCode(String countyCode) {
+ Validator.checkPattern("^\\w\\w$", countyCode,
+ "Country Code does not match the regex pattern /^\\w\\w$/");
+ this.countyCode = countyCode;
+ }
+}
diff --git a/Trading/src/main/java/com/suneesh/trading/models/requests/StopCopyTradeRequest.java b/Trading/src/main/java/com/suneesh/trading/models/requests/StopCopyTradeRequest.java
new file mode 100644
index 0000000..5b44283
--- /dev/null
+++ b/Trading/src/main/java/com/suneesh/trading/models/requests/StopCopyTradeRequest.java
@@ -0,0 +1,45 @@
+package com.suneesh.trading.models.requests;
+
+import com.suneesh.trading.models.responses.StopCopyTradeResponse;
+import com.suneesh.trading.utils.Validator;
+import com.google.gson.annotations.SerializedName;
+
+/**
+ * StopCopyTradeRequest
+ *
+ * Copy Stop Send
+ *
+ * Stop copy trader bets
+ *
+ *
+ * @author Morteza Tavanarad
+ * @version 1.0.0
+ * @since 8/9/2017
+ */
+public class StopCopyTradeRequest extends RequestBase {
+
+ /**
+ * API tokens identifying the accounts which needs not to be copied
+ */
+ @SerializedName("copy_stop")
+ private String traderToken;
+
+ private StopCopyTradeRequest(){
+ this.responseType = StopCopyTradeResponse.class;
+ }
+
+ public StopCopyTradeRequest(String traderToken) {
+ this();
+ this.setTraderToken(traderToken);
+ }
+
+ public String getTraderToken() {
+ return traderToken;
+ }
+
+ public void setTraderToken(String traderToken) {
+ Validator.checkPattern("^[\\w\\s-]{15,32}$", traderToken,
+ "Trader Token does not match the regex pattern /^[\\w\\s-]{15,32}$/");
+ this.traderToken = traderToken;
+ }
+}
diff --git a/Trading/src/main/java/com/suneesh/trading/models/requests/TNCApprovalRequest.java b/Trading/src/main/java/com/suneesh/trading/models/requests/TNCApprovalRequest.java
new file mode 100644
index 0000000..4b7f787
--- /dev/null
+++ b/Trading/src/main/java/com/suneesh/trading/models/requests/TNCApprovalRequest.java
@@ -0,0 +1,37 @@
+package com.suneesh.trading.models.requests;
+
+import com.suneesh.trading.models.responses.TNCApprovalResponse;
+import com.google.gson.annotations.SerializedName;
+
+/**
+ * TNCApprovalRequest
+ *
+ * T&C Approval Send
+ *
+ * @author Morteza Tavanarad
+ * @version 1.0.0
+ * @since 9/4/2017
+ */
+public class TNCApprovalRequest extends RequestBase {
+
+ @SerializedName("tnc_approval")
+ private final int tcApproval = 1;
+
+ /**
+ * for ASK_UK_FUNDS_PROTECTION in cashier
+ */
+ @SerializedName("ukgc_funds_protection")
+ private Integer askUKFundsProtection;
+
+ public TNCApprovalRequest() {
+ this.responseType = TNCApprovalResponse.class;
+ }
+
+ public Integer getAskUKFundsProtection() {
+ return askUKFundsProtection;
+ }
+
+ public void setAskUKFundsProtection(Integer askUKFundsProtection) {
+ this.askUKFundsProtection = askUKFundsProtection;
+ }
+}
diff --git a/Trading/src/main/java/com/suneesh/trading/models/requests/TickHistoryRequest.java b/Trading/src/main/java/com/suneesh/trading/models/requests/TickHistoryRequest.java
new file mode 100644
index 0000000..8ca693f
--- /dev/null
+++ b/Trading/src/main/java/com/suneesh/trading/models/requests/TickHistoryRequest.java
@@ -0,0 +1,157 @@
+package com.suneesh.trading.models.requests;
+
+import com.suneesh.trading.models.enums.TickStyles;
+import com.suneesh.trading.models.responses.TickHistoryResponse;
+import com.suneesh.trading.utils.Validator;
+import com.google.gson.annotations.SerializedName;
+import io.reactivex.annotations.Nullable;
+
+/**
+ * TickHistoryRequest
+ *
+ * Tick History Request
+ * Get historic tick data for a given symbol name
+ *
+ * @author Morteza Tavanarad
+ * @version 1.0.0
+ * @since 8/3/2017
+ */
+public class TickHistoryRequest extends RequestBase {
+
+ /**
+ * Short symbol name
+ */
+ @SerializedName("ticks_history")
+ private String symbol;
+
+ /**
+ * Epoch value representing the end-datetime of the ticks.
+ * If non-numeric value (e.g. "latest", the end-datetime will be the latest available timestamp.
+ */
+ @SerializedName("end")
+ private String end;
+
+ /**
+ * Epoch value representing the start-datetime of the ticks (For styles: 'ticks', it will default to 1 day ago.
+ * For styles: 'candle', it will default to 1 day ago if count or granularity is undef )
+ */
+ @SerializedName("start")
+ @Nullable
+ private Integer start;
+
+ /**
+ * An upper limit on ticks to receive (default: 5000)
+ */
+ @SerializedName("count")
+ @Nullable
+ private Integer count;
+
+ /**
+ * The tick-output style: must be one of 'ticks' or 'candles' (default: 'ticks')
+ */
+ @SerializedName("style")
+ @Nullable
+ private String style;
+
+ /**
+ * Provide for style: 'candles'. Candle time-dimension width setting.
+ * Allowed values 60, 120, 180, 300, 600, 900, 1800, 3600, 7200, 14400, 28800, 86400 (default: '60').
+ */
+ @SerializedName("granularity")
+ @Nullable
+ private Integer granularity;
+
+ /**
+ * If market is closed at the end time, or license limit is before end time, then move interval backwards.
+ */
+ @SerializedName("adjust_start_time")
+ @Nullable
+ private Integer adjustStartTime;
+
+ /**
+ * If set to 1, will send updates whenever the price changes
+ */
+ @SerializedName("subscribe")
+ @Nullable
+ private Integer subscribe;
+
+ public TickHistoryRequest(String symbol, String end){
+ this.responseType = TickHistoryResponse.class;
+ this.setSymbol(symbol);
+ this.setEnd(end);
+ }
+
+ public String getSymbol() {
+ return symbol;
+ }
+
+ public void setSymbol(String symbol) {
+ Validator.checkPattern("^\\w{2,30}$", symbol,
+ "Symbol does not match the regex pattern /^\\w{2,30}$/");
+ this.symbol = symbol;
+ }
+
+ public String getEnd() {
+ return end;
+ }
+
+ public void setEnd(String end) {
+ Validator.checkPattern("^(latest|\\d{1,10})$", end,
+ "End does not match the regex pattern /^(latest|\\d{1,10})$/");
+ this.end = end;
+ }
+
+ public Integer getStart() {
+ return start;
+ }
+
+ public void setStart(Integer start) {
+ Validator.checkPattern("^\\d{1,10}$", start.toString(),
+ "Start does not match the regex pattern /^\\d{1,10}$/");
+ this.start = start;
+ }
+
+ public Integer getCount() {
+ return count;
+ }
+
+ public void setCount(Integer count) {
+ this.count = count;
+ }
+
+ public String getStyle() {
+ return style;
+ }
+
+ public void setStyle(TickStyles style) {
+ this.style = style.toString().toLowerCase();
+ }
+
+ public Integer getGranularity() {
+ return granularity;
+ }
+
+ public void setGranularity(Integer granularity) {
+ this.granularity = granularity;
+ }
+
+ public Integer getAdjustStartTime() {
+ return adjustStartTime;
+ }
+
+ public void setAdjustStartTime(Integer adjustStartTime) {
+ Validator.checkPattern("^1?$", adjustStartTime.toString(),
+ "AdjustStartTime does not match the regex /^1?$/");
+ this.adjustStartTime = adjustStartTime;
+ }
+
+ public Integer getSubscribe() {
+ return subscribe;
+ }
+
+ public void setSubscribe(Integer subscribe) {
+ Validator.checkPattern("^1?$", subscribe.toString(),
+ "Subscribe does not match the regex /^1?$/");
+ this.subscribe = subscribe;
+ }
+}
diff --git a/Trading/src/main/java/com/suneesh/trading/models/requests/TickRequest.java b/Trading/src/main/java/com/suneesh/trading/models/requests/TickRequest.java
new file mode 100644
index 0000000..6c625ad
--- /dev/null
+++ b/Trading/src/main/java/com/suneesh/trading/models/requests/TickRequest.java
@@ -0,0 +1,52 @@
+package com.suneesh.trading.models.requests;
+
+import com.suneesh.trading.models.responses.TickResponse;
+import com.google.gson.annotations.SerializedName;
+import io.reactivex.annotations.Nullable;
+
+/**
+ * Created by morteza on 7/19/2017.
+ */
+
+public class TickRequest extends RequestBase{
+
+ public TickRequest(){
+ this.responseType = TickResponse.class;
+ }
+
+ public TickRequest(String symbol) {
+ this();
+ this.symbol = symbol;
+ }
+
+ public TickRequest(String symbol, Boolean subscribe){
+ this(symbol);
+ this.subscribe = subscribe? 1: null;
+ }
+
+ @SerializedName("ticks")
+ private String symbol;
+
+ /**
+ * If set to 1, will send updates whenever the price changes
+ */
+ @SerializedName("subscribe")
+ @Nullable
+ private Integer subscribe = null;
+
+ public String getSymbol() {
+ return symbol;
+ }
+
+ public void setSymbol(String symbol) {
+ this.symbol = symbol;
+ }
+
+ public Integer getSubscribe() {
+ return subscribe;
+ }
+
+ public void setSubscribe(Integer subscribe) {
+ this.subscribe = subscribe;
+ }
+}
diff --git a/Trading/src/main/java/com/suneesh/trading/models/requests/TimeRequest.java b/Trading/src/main/java/com/suneesh/trading/models/requests/TimeRequest.java
new file mode 100644
index 0000000..38f7dcd
--- /dev/null
+++ b/Trading/src/main/java/com/suneesh/trading/models/requests/TimeRequest.java
@@ -0,0 +1,24 @@
+package com.suneesh.trading.models.requests;
+
+import com.suneesh.trading.models.responses.TimeResponse;
+import com.google.gson.annotations.SerializedName;
+
+/**
+ * TimeRequest
+ *
+ * Time request
+ * Request back-end server epoch time
+ *
+ * @author Morteza Tavanarad
+ * @version 1.0.0
+ * @since 8/3/2017
+ */
+public class TimeRequest extends RequestBase {
+
+ @SerializedName("time")
+ private final int time = 1;
+
+ public TimeRequest() {
+ this.responseType = TimeResponse.class;
+ }
+}
diff --git a/Trading/src/main/java/com/suneesh/trading/models/requests/TopUpVirtualMoneyAccountRequest.java b/Trading/src/main/java/com/suneesh/trading/models/requests/TopUpVirtualMoneyAccountRequest.java
new file mode 100644
index 0000000..d1a193b
--- /dev/null
+++ b/Trading/src/main/java/com/suneesh/trading/models/requests/TopUpVirtualMoneyAccountRequest.java
@@ -0,0 +1,26 @@
+package com.suneesh.trading.models.requests;
+
+import com.suneesh.trading.models.responses.TopUpVirtualMoneyAccountResponse;
+import com.google.gson.annotations.SerializedName;
+
+/**
+ * TopUpVirtualMoneyAccountRequest
+ *
+ * Top Up Virtual Request
+ *
+ * When a virtual-money's account balance becomes low, it can be topped up using this call.
+ *
+ *
+ * @author Morteza Tavanarad
+ * @version 1.0.0
+ * @since 8/9/2017
+ */
+public class TopUpVirtualMoneyAccountRequest extends RequestBase {
+
+ @SerializedName("topup_virtual")
+ private final int topUpVirtual = 1;
+
+ public TopUpVirtualMoneyAccountRequest() {
+ this.responseType = TopUpVirtualMoneyAccountResponse.class;
+ }
+}
diff --git a/Trading/src/main/java/com/suneesh/trading/models/requests/TradingTimesRequest.java b/Trading/src/main/java/com/suneesh/trading/models/requests/TradingTimesRequest.java
new file mode 100644
index 0000000..c97aadf
--- /dev/null
+++ b/Trading/src/main/java/com/suneesh/trading/models/requests/TradingTimesRequest.java
@@ -0,0 +1,43 @@
+package com.suneesh.trading.models.requests;
+
+import com.suneesh.trading.models.responses.TradingTimesResponse;
+import com.suneesh.trading.utils.Validator;
+import com.google.gson.annotations.SerializedName;
+
+/**
+ * TradingTimesRequest
+ *
+ * Trading Times Send
+ * Receive a list of marketing opening times for a given date
+ *
+ * @author Morteza Tavanarad
+ * @version 1.0.0
+ * @since 8/3/2017
+ */
+public class TradingTimesRequest extends RequestBase {
+
+ /**
+ * Trading date in yyyy-mm-dd format (or use 'today' for trading times for today's date).
+ */
+ @SerializedName("trading_times")
+ private String tradingDate;
+
+ public TradingTimesRequest() {
+ this.setResponseType(TradingTimesResponse.class);
+ }
+
+ public TradingTimesRequest(String tradingDate) {
+ this();
+ this.setTradingDate(tradingDate);
+ }
+
+ public String getTradingDate() {
+ return tradingDate;
+ }
+
+ public void setTradingDate(String tradingDate) {
+ Validator.checkPattern("^(\\d{4}-\\d{1,2}-\\d{1,2}|today)$", tradingDate,
+ "Trading Date does not match the regex pattern /^(\\d{4}-\\d{1,2}-\\d{1,2}|today)$/");
+ this.tradingDate = tradingDate;
+ }
+}
diff --git a/Trading/src/main/java/com/suneesh/trading/models/requests/TransactionsStreamRequest.java b/Trading/src/main/java/com/suneesh/trading/models/requests/TransactionsStreamRequest.java
new file mode 100644
index 0000000..ee60b4d
--- /dev/null
+++ b/Trading/src/main/java/com/suneesh/trading/models/requests/TransactionsStreamRequest.java
@@ -0,0 +1,29 @@
+package com.suneesh.trading.models.requests;
+
+import com.suneesh.trading.models.responses.TransactionsStreamResponse;
+import com.google.gson.annotations.SerializedName;
+
+/**
+ * TransactionsStreamRequest
+ *
+ * Transaction Subscription
+ *
+ * Subscribe to transaction notifications
+ *
+ *
+ * @author Morteza Tavanarad
+ * @version 1.0.0
+ * @since 8/8/2017
+ */
+public class TransactionsStreamRequest extends RequestBase {
+
+ @SerializedName("transaction")
+ private final int transaction = 1;
+
+ @SerializedName("subscribe")
+ private final int subscribe = 1;
+
+ public TransactionsStreamRequest() {
+ this.responseType = TransactionsStreamResponse.class;
+ }
+}
diff --git a/Trading/src/main/java/com/suneesh/trading/models/requests/TransferBetweenAccountsRequest.java b/Trading/src/main/java/com/suneesh/trading/models/requests/TransferBetweenAccountsRequest.java
new file mode 100644
index 0000000..a3ccc18
--- /dev/null
+++ b/Trading/src/main/java/com/suneesh/trading/models/requests/TransferBetweenAccountsRequest.java
@@ -0,0 +1,88 @@
+package com.suneesh.trading.models.requests;
+
+import com.suneesh.trading.models.responses.TransferBetweenAccountsResponse;
+import com.google.gson.annotations.SerializedName;
+
+import java.math.BigDecimal;
+
+/**
+ * TransferBetweenAccountsRequest
+ *
+ * Transfer Between Accounts Request
+ *
+ * This call allows transfers between accounts held by a given user with the 'malta' and
+ * 'maltainvest' Landing Companies or between sub account and master account for omnibus accounts.
+ *
+ *
+ * @author Morteza Tavanarad
+ * @version 1.0.0
+ * @since 9/15/2017
+ */
+public class TransferBetweenAccountsRequest extends RequestBase {
+
+ /**
+ * if account_from and account_to are not provided, we'll just return available accounts
+ */
+ @SerializedName("transfer_between_accounts")
+ private final int transferBetweenAccounts = 1;
+
+ /**
+ * The account_from loginid
+ */
+ @SerializedName("account_from")
+ private String accountFrom;
+
+ /**
+ * The account_to loginid
+ */
+ @SerializedName("account_to")
+ private String accountTo;
+
+ /**
+ * Currency
+ */
+ @SerializedName("currency")
+ private String currency;
+
+ /**
+ * Amount
+ */
+ @SerializedName("amount")
+ private BigDecimal amount;
+
+ public TransferBetweenAccountsRequest() {
+ this.responseType = TransferBetweenAccountsResponse.class;
+ }
+
+ public String getAccountFrom() {
+ return accountFrom;
+ }
+
+ public void setAccountFrom(String accountFrom) {
+ this.accountFrom = accountFrom;
+ }
+
+ public String getAccountTo() {
+ return accountTo;
+ }
+
+ public void setAccountTo(String accountTo) {
+ this.accountTo = accountTo;
+ }
+
+ public String getCurrency() {
+ return currency;
+ }
+
+ public void setCurrency(String currency) {
+ this.currency = currency;
+ }
+
+ public BigDecimal getAmount() {
+ return amount;
+ }
+
+ public void setAmount(BigDecimal amount) {
+ this.amount = amount;
+ }
+}
diff --git a/Trading/src/main/java/com/suneesh/trading/models/requests/WebsiteStatusRequest.java b/Trading/src/main/java/com/suneesh/trading/models/requests/WebsiteStatusRequest.java
new file mode 100644
index 0000000..b56183f
--- /dev/null
+++ b/Trading/src/main/java/com/suneesh/trading/models/requests/WebsiteStatusRequest.java
@@ -0,0 +1,45 @@
+package com.suneesh.trading.models.requests;
+
+import com.suneesh.trading.models.responses.WebsiteStatusResponse;
+import com.suneesh.trading.utils.Validator;
+import com.google.gson.annotations.SerializedName;
+import io.reactivex.annotations.Nullable;
+import okhttp3.WebSocket;
+
+/**
+ * WebsiteStatusRequest
+ *
+ * Server Status request
+ * Request server status
+ *
+ * @author Morteza Tavanarad
+ * @version 1.0.0
+ * @since 8/3/2017
+ */
+public class WebsiteStatusRequest extends RequestBase {
+
+ @SerializedName("website_status")
+ private final int websiteStatus = 1;
+
+ @SerializedName("subscribe")
+ @Nullable
+ private Integer subscribe;
+
+ public WebsiteStatusRequest() {
+ this.responseType = WebsiteStatusResponse.class;
+ }
+
+ public WebsiteStatusRequest(Integer subscribe){
+ this();
+ }
+
+ public Integer getSubscribe() {
+ return subscribe;
+ }
+
+ public void setSubscribe(Integer subscribe) {
+ Validator.checkPattern("^(1|0)$", subscribe.toString(),
+ "Subscribe does not match the regex pattern /^(1|0)$/");
+ this.subscribe = subscribe;
+ }
+}
diff --git a/Trading/src/main/java/com/suneesh/trading/models/responses/AccountLimits.java b/Trading/src/main/java/com/suneesh/trading/models/responses/AccountLimits.java
new file mode 100644
index 0000000..9c76708
--- /dev/null
+++ b/Trading/src/main/java/com/suneesh/trading/models/responses/AccountLimits.java
@@ -0,0 +1,136 @@
+package com.suneesh.trading.models.responses;
+
+import com.google.gson.annotations.SerializedName;
+
+import java.math.BigDecimal;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @author Morteza Tavanarad
+ * @version 1.0.0
+ * @since 8/3/2017
+ */
+public class AccountLimits {
+
+ /**
+ * Maximum account cash balance
+ */
+ @SerializedName("account_balance")
+ private BigDecimal accountBalance;
+
+ /**
+ * Maximum daily turnover
+ */
+ @SerializedName("daily_turnover")
+ private BigDecimal dailyTurnover;
+
+ /**
+ * Maximum number of open positions
+ */
+ @SerializedName("open_positions")
+ private int openPositions;
+
+ /**
+ * Maximum aggregate payouts on open positions
+ */
+ @SerializedName("payout")
+ private BigDecimal payout;
+
+ /**
+ * Maximum aggregate payouts on open positions per symbol and contract type.
+ * This limit can be exceeded up to the overall payout limit if there is no prior open position.
+ */
+ @SerializedName("payout_per_symbol_and_contract_type")
+ private BigDecimal payoutPerSymbolAndContractType;
+
+ /**
+ * Lifetime withdrawal limit
+ */
+ @SerializedName("lifetime_limit")
+ private BigDecimal lifetimeLimit;
+
+ /**
+ * Number of days for num_of_days_limit withdrawal limit
+ */
+ @SerializedName("num_of_days")
+ private int numOfDays;
+
+ /**
+ * Withdrawal limit for num_of_days days
+ */
+ @SerializedName("num_of_days_limit")
+ private int numOfDaysLimit;
+
+ /**
+ * Amount left to reach withdrawal limit
+ */
+ @SerializedName("remainder")
+ private BigDecimal remainder;
+
+ /**
+ * Total withdrawal for num_of_days days
+ */
+ @SerializedName("withdrawal_for_x_days_monetary")
+ private BigDecimal withdrawalForXDaysMonetary;
+
+ /**
+ * Total withdrawal since inception
+ */
+ @SerializedName("withdrawal_since_inception_monetary")
+ private BigDecimal withdrawalSinceInceptionMonetary;
+
+ /**
+ * Markets Limits
+ */
+ @SerializedName("market_specific")
+ private Map> marketSpecific;
+
+ public BigDecimal getAccountBalance() {
+ return accountBalance;
+ }
+
+ public BigDecimal getDailyTurnover() {
+ return dailyTurnover;
+ }
+
+ public int getOpenPositions() {
+ return openPositions;
+ }
+
+ public BigDecimal getPayout() {
+ return payout;
+ }
+
+ public BigDecimal getPayoutPerSymbolAndContractType() {
+ return payoutPerSymbolAndContractType;
+ }
+
+ public BigDecimal getLifetimeLimit() {
+ return lifetimeLimit;
+ }
+
+ public int getNumOfDays() {
+ return numOfDays;
+ }
+
+ public int getNumOfDaysLimit() {
+ return numOfDaysLimit;
+ }
+
+ public BigDecimal getRemainder() {
+ return remainder;
+ }
+
+ public BigDecimal getWithdrawalForXDaysMonetary() {
+ return withdrawalForXDaysMonetary;
+ }
+
+ public BigDecimal getWithdrawalSinceInceptionMonetary() {
+ return withdrawalSinceInceptionMonetary;
+ }
+
+ public Map> getMarketSpecific() {
+ return marketSpecific;
+ }
+}
diff --git a/Trading/src/main/java/com/suneesh/trading/models/responses/AccountLimitsResponse.java b/Trading/src/main/java/com/suneesh/trading/models/responses/AccountLimitsResponse.java
new file mode 100644
index 0000000..a11cf2a
--- /dev/null
+++ b/Trading/src/main/java/com/suneesh/trading/models/responses/AccountLimitsResponse.java
@@ -0,0 +1,27 @@
+package com.suneesh.trading.models.responses;
+
+import com.suneesh.trading.models.requests.AccountLimitsRequest;
+import com.google.gson.annotations.SerializedName;
+
+/**
+ * AccountLimitResponse
+ *
+ * Get Limits Receive
+ * Trading and Withdrawal Limits
+ *
+ * @author Morteza Tavanarad
+ * @version 1.0.0
+ * @since 8/3/2017
+ */
+public class AccountLimitsResponse extends ResponseBase {
+
+ /**
+ * Trading limits of real account user
+ */
+ @SerializedName("get_limits")
+ private AccountLimits limits;
+
+ public AccountLimits getLimits() {
+ return limits;
+ }
+}
\ No newline at end of file
diff --git a/Trading/src/main/java/com/suneesh/trading/models/responses/AccountSettings.java b/Trading/src/main/java/com/suneesh/trading/models/responses/AccountSettings.java
new file mode 100644
index 0000000..2c12c32
--- /dev/null
+++ b/Trading/src/main/java/com/suneesh/trading/models/responses/AccountSettings.java
@@ -0,0 +1,357 @@
+package com.suneesh.trading.models.responses;
+
+import com.google.gson.annotations.SerializedName;
+import io.reactivex.annotations.Nullable;
+
+/**
+ * AccountSettings
+ *
+ * @author Morteza Tavanarad
+ * @version 1.0.0
+ * @since 8/4/2017
+ */
+public class AccountSettings {
+
+ /**
+ * User Email
+ */
+ @SerializedName("email")
+ private String email;
+
+ /**
+ * User Country
+ */
+ @SerializedName("country")
+ @Nullable
+ private String country;
+
+ /**
+ * 2-letter country code ISO standard
+ */
+ @SerializedName("country_code")
+ @Nullable
+ private String countryCode;
+
+ /**
+ * Salutation (note: not set for virtual-money accounts)
+ */
+ @SerializedName("salutation")
+ @Nullable
+ private String salutation;
+
+ /**
+ * First name (note: not set for virtual-money accounts)
+ */
+ @SerializedName("first_name")
+ @Nullable
+ private String firstName;
+
+ /**
+ * Last name (note: not set for virtual-money accounts)
+ */
+ @SerializedName("last_name")
+ @Nullable
+ private String lastName;
+
+ /**
+ * Epoch of user's birthday (note: not set for virtual-money accounts)
+ */
+ @SerializedName("date_of_birth")
+ @Nullable
+ private Integer dateOfBirth;
+
+ /**
+ * Address line 1 (note: not set for virtual-money accounts)
+ */
+ @SerializedName("address_line_1")
+ @Nullable
+ private String firstAddressLine;
+
+ /**
+ * Address line 2 (note: not set for virtual-money accounts)
+ */
+ @SerializedName("address_line_2")
+ @Nullable
+ private String secondAddressLine;
+
+ /**
+ * City (note: not set for virtual-money accounts)
+ */
+ @SerializedName("address_city")
+ @Nullable
+ private String addressCity;
+
+ /**
+ * State (note: not set for virtual-money accounts)
+ */
+ @SerializedName("address_state")
+ @Nullable
+ private String addressState;
+
+ /**
+ * Post Code (note: not set for virtual-money accounts)
+ */
+ @SerializedName("address_postcode")
+ @Nullable
+ private String addressPostcode;
+
+ /**
+ * Telephone (note: not set for virtual-money accounts)
+ */
+ @SerializedName("phone")
+ @Nullable
+ private String phone;
+
+ /**
+ * Boolean value 1 or 0, indicating whether is payment agent (note: not applicable for virtual money accounts)
+ */
+ @SerializedName("is_authenticated_payment_agent")
+ private int isAuthenticatedPaymentAgent;
+
+ /**
+ * Boolean value 1 or 0, indicating permission to use email address for any contact which may include marketing
+ */
+ @SerializedName("email_consent")
+ private int emailConsent;
+
+ /**
+ * Boolean value 1 or 0, indicating permission to allow others to follow your trades.
+ * Note: not applicable for Virtual account. Only allow for real money account.
+ */
+ @SerializedName("allow_copier")
+ private int allowCopier;
+
+ /**
+ * Latest terms and conditions version accepted by client
+ */
+ @SerializedName("client_tnc_status")
+ @Nullable
+ private String clientTNCStatus;
+
+ /**
+ * Place of birth, 2-letter country code.
+ */
+ @SerializedName("place_of_birth")
+ @Nullable
+ private String placeOfBirth;
+
+ /**
+ * Residence for tax purpose. Comma separated iso country code if multiple jurisdictions.
+ * Only applicable for real money account.
+ */
+ @SerializedName("tax_residence")
+ @Nullable
+ private String taxResidence;
+
+ /**
+ * Tax identification number. Only applicable for real money account.
+ */
+ @SerializedName("tax_identification_number")
+ @Nullable
+ private String taxIdentificationNumber;
+
+ /**
+ * Purpose and reason for requesting the account opening. Only applicable for real money account.
+ */
+ @SerializedName("account_opening_reason")
+ @Nullable
+ private String accountOpeningReason;
+
+ /**
+ * Japan real money account status, only applicable for Japan virtual money account client.
+ */
+ @SerializedName("jp_account_status")
+ @Nullable
+ private JPAccountStatus jpAccountStatus;
+
+ /**
+ * Japan real money client settings, only applicable for Japan real money account client.
+ */
+ @SerializedName("jp_settings")
+ @Nullable
+ private JPSettings jpSettings;
+
+ public String getEmail() {
+ return email;
+ }
+
+ public void setEmail(String email) {
+ this.email = email;
+ }
+
+ public String getCountry() {
+ return country;
+ }
+
+ public void setCountry(String country) {
+ this.country = country;
+ }
+
+ public String getCountryCode() {
+ return countryCode;
+ }
+
+ public void setCountryCode(String countryCode) {
+ this.countryCode = countryCode;
+ }
+
+ public String getSalutation() {
+ return salutation;
+ }
+
+ public void setSalutation(String salutation) {
+ this.salutation = salutation;
+ }
+
+ public String getFirstName() {
+ return firstName;
+ }
+
+ public void setFirstName(String firstName) {
+ this.firstName = firstName;
+ }
+
+ public String getLastName() {
+ return lastName;
+ }
+
+ public void setLastName(String lastName) {
+ this.lastName = lastName;
+ }
+
+ public Integer getDateOfBirth() {
+ return dateOfBirth;
+ }
+
+ public void setDateOfBirth(Integer dateOfBirth) {
+ this.dateOfBirth = dateOfBirth;
+ }
+
+ public String getFirstAddressLine() {
+ return firstAddressLine;
+ }
+
+ public void setFirstAddressLine(String firstAddressLine) {
+ this.firstAddressLine = firstAddressLine;
+ }
+
+ public String getSecondAddressLine() {
+ return secondAddressLine;
+ }
+
+ public void setSecondAddressLine(String secondAddressLine) {
+ this.secondAddressLine = secondAddressLine;
+ }
+
+ public String getAddressCity() {
+ return addressCity;
+ }
+
+ public void setAddressCity(String addressCity) {
+ this.addressCity = addressCity;
+ }
+
+ public String getAddressState() {
+ return addressState;
+ }
+
+ public void setAddressState(String addressState) {
+ this.addressState = addressState;
+ }
+
+ public String getAddressPostcode() {
+ return addressPostcode;
+ }
+
+ public void setAddressPostcode(String addressPostcode) {
+ this.addressPostcode = addressPostcode;
+ }
+
+ public String getPhone() {
+ return phone;
+ }
+
+ public void setPhone(String phone) {
+ this.phone = phone;
+ }
+
+ public boolean isAuthenticatedPaymentAgent() {
+ return isAuthenticatedPaymentAgent == 1 ? true : false;
+ }
+
+ public void setIsAuthenticatedPaymentAgent(boolean isAuthenticatedPaymentAgent) {
+ this.isAuthenticatedPaymentAgent = isAuthenticatedPaymentAgent ? 1 : 0;
+ }
+
+ public boolean getEmailConsent() {
+ return emailConsent == 1 ? true : false;
+ }
+
+ public void setEmailConsent(boolean emailConsent) {
+ this.emailConsent = emailConsent ? 1 : 0;
+ }
+
+ public boolean getAllowCopier() {
+ return allowCopier == 1 ? true : false;
+ }
+
+ public void setAllowCopier(boolean allowCopier) {
+ this.allowCopier = allowCopier ? 1 : 0;
+ }
+
+ public String getClientTNCStatus() {
+ return clientTNCStatus;
+ }
+
+ public void setClientTNCStatus(String clientTNCStatus) {
+ this.clientTNCStatus = clientTNCStatus;
+ }
+
+ public String getPlaceOfBirth() {
+ return placeOfBirth;
+ }
+
+ public void setPlaceOfBirth(String placeOfBirth) {
+ this.placeOfBirth = placeOfBirth;
+ }
+
+ public String getTaxResidence() {
+ return taxResidence;
+ }
+
+ public void setTaxResidence(String taxResidence) {
+ this.taxResidence = taxResidence;
+ }
+
+ public String getTaxIdentificationNumber() {
+ return taxIdentificationNumber;
+ }
+
+ public void setTaxIdentificationNumber(String taxIdentificationNumber) {
+ this.taxIdentificationNumber = taxIdentificationNumber;
+ }
+
+ public String getAccountOpeningReason() {
+ return accountOpeningReason;
+ }
+
+ public void setAccountOpeningReason(String accountOpeningReason) {
+ this.accountOpeningReason = accountOpeningReason;
+ }
+
+ public JPAccountStatus getJpAccountStatus() {
+ return jpAccountStatus;
+ }
+
+ public void setJpAccountStatus(JPAccountStatus jpAccountStatus) {
+ this.jpAccountStatus = jpAccountStatus;
+ }
+
+ public JPSettings getJpSettings() {
+ return jpSettings;
+ }
+
+ public void setJpSettings(JPSettings jpSettings) {
+ this.jpSettings = jpSettings;
+ }
+}
diff --git a/Trading/src/main/java/com/suneesh/trading/models/responses/AccountSettingsResponse.java b/Trading/src/main/java/com/suneesh/trading/models/responses/AccountSettingsResponse.java
new file mode 100644
index 0000000..dfa0eac
--- /dev/null
+++ b/Trading/src/main/java/com/suneesh/trading/models/responses/AccountSettingsResponse.java
@@ -0,0 +1,27 @@
+package com.suneesh.trading.models.responses;
+
+import com.suneesh.trading.models.requests.AccountSettingsRequest;
+import com.google.gson.annotations.SerializedName;
+
+/**
+ * AccountSettingsResponse
+ *
+ *
Get User Settings Receive
+ * A message with User Settings
+ *
+ * @author Morteza Tavanarad
+ * @version 1.0.0
+ * @since 8/4/2017
+ */
+public class AccountSettingsResponse extends ResponseBase {
+
+ /**
+ * Account settings
+ */
+ @SerializedName("get_settings")
+ private AccountSettings settings;
+
+ public AccountSettings getSettings() {
+ return settings;
+ }
+}
diff --git a/Trading/src/main/java/com/suneesh/trading/models/responses/AccountStatus.java b/Trading/src/main/java/com/suneesh/trading/models/responses/AccountStatus.java
new file mode 100644
index 0000000..aaa22f0
--- /dev/null
+++ b/Trading/src/main/java/com/suneesh/trading/models/responses/AccountStatus.java
@@ -0,0 +1,43 @@
+package com.suneesh.trading.models.responses;
+
+import com.google.gson.annotations.SerializedName;
+
+import java.util.List;
+
+/**
+ * @author Morteza Tavanarad
+ * @version 1.0.0
+ * @since 8/4/2017
+ */
+public class AccountStatus {
+
+ /**
+ * Array of Status
+ */
+ @SerializedName("status")
+ private List status;
+
+ /**
+ * Indicates whether the client should be prompted to authenticate their account.
+ */
+ @SerializedName("prompt_client_to_authenticate")
+ private int promptClientToAuthenticate;
+
+ /**
+ * Client risk classification: low, standard, high
+ */
+ @SerializedName("risk_classification")
+ private String riskClassification;
+
+ public List getStatus() {
+ return status;
+ }
+
+ public boolean getPromptClientToAuthenticate() {
+ return promptClientToAuthenticate == 1 ? true : false;
+ }
+
+ public String getRiskClassification() {
+ return riskClassification;
+ }
+}
diff --git a/Trading/src/main/java/com/suneesh/trading/models/responses/AccountStatusResponse.java b/Trading/src/main/java/com/suneesh/trading/models/responses/AccountStatusResponse.java
new file mode 100644
index 0000000..2a19598
--- /dev/null
+++ b/Trading/src/main/java/com/suneesh/trading/models/responses/AccountStatusResponse.java
@@ -0,0 +1,31 @@
+package com.suneesh.trading.models.responses;
+
+import com.suneesh.trading.models.requests.AccountStatusRequest;
+import com.google.gson.annotations.SerializedName;
+
+/**
+ * AccountStatusResponse
+ *
+ * Get Account Status Receive
+ * A message with Account Status
+ *
+ * @author Morteza Tavanarad
+ * @version 1.0.0
+ * @since 8/4/2017
+ */
+public class AccountStatusResponse extends ResponseBase {
+
+ public void setAccountStatus(AccountStatus accountStatus) {
+ this.accountStatus = accountStatus;
+ }
+
+ /**
+ * Account status details
+ */
+ @SerializedName("get_account_status")
+ private AccountStatus accountStatus;
+
+ public AccountStatus getAccountStatus() {
+ return accountStatus;
+ }
+}
diff --git a/Trading/src/main/java/com/suneesh/trading/models/responses/ActiveSymbol.java b/Trading/src/main/java/com/suneesh/trading/models/responses/ActiveSymbol.java
new file mode 100644
index 0000000..e2e5e64
--- /dev/null
+++ b/Trading/src/main/java/com/suneesh/trading/models/responses/ActiveSymbol.java
@@ -0,0 +1,357 @@
+package com.suneesh.trading.models.responses;
+
+import com.google.gson.annotations.SerializedName;
+import io.reactivex.annotations.Nullable;
+
+import java.math.BigDecimal;
+
+/**
+ * @author Morteza Tavanarad
+ * @version 1.0.0
+ * @since 7/31/2017
+ */
+public class ActiveSymbol {
+ /**
+ * intraday_interval_minutes
+ */
+ @SerializedName("symbol")
+ private String symbol;
+
+ /**
+ * Intraday interval minutes
+ */
+ @SerializedName("intraday_interval_minutes")
+ private int intradayIntervalMinutes;
+
+ /**
+ * Symbol type (forex, commodities, etc)
+ */
+ @SerializedName("symbol_type")
+ private String symbolType;
+
+ /**
+ * 1 or 0 - whether the market is currently open or closed
+ */
+ @SerializedName("exchange_is_open")
+ @Nullable
+ private Integer isExhcangeOpen;
+
+ /**
+ * Exchange name (for underlyings listed on a Stock Exchange)
+ */
+ @SerializedName("exchange_name")
+ private String exchangeName;
+
+ /**
+ * Exchange name (for underlyings listed on a Stock Exchange)
+ */
+ @SerializedName("delay_amount")
+ private int delayAmount;
+
+ /**
+ * Display name
+ */
+ @SerializedName("display_name")
+ private String displayName;
+
+ /**
+ * Latest spot price of the underlying
+ */
+ @SerializedName("spot")
+ @Nullable
+ private Integer spot;
+
+ /**
+ * Latest spot epoch time
+ */
+ @SerializedName("spot_time")
+ private String spotTime;
+
+ /**
+ * 1 indicates that trading is currently suspended
+ */
+ @SerializedName("is_trading_suspended")
+ @Nullable
+ private Integer isTradingSuspended;
+
+ /**
+ * For stocks and stock indices, the underlying currency for that instrument
+ */
+ @SerializedName("quoted_currency_symbole")
+ private String quotedCurrencySymbol;
+
+ /**
+ * Number of seconds elapsed since the last spot price
+ */
+ @SerializedName("spot_age")
+ private String spotAge;
+
+ /**
+ * Market category (forex, indices etc)
+ */
+ @SerializedName("market")
+ private String market;
+
+ /**
+ * Translated market name
+ */
+ @SerializedName("market_display_name")
+ private String marketDisplayName;
+
+ /**
+ * Submarket name
+ */
+ @SerializedName("submarket")
+ private String subMarket;
+
+ /**
+ * Translated submarket name
+ */
+ @SerializedName("submarket_display_name")
+ private String subMarketDisplayName;
+
+ /**
+ * Pip size (i.e. minimum fluctuation amount)
+ */
+ @SerializedName("pip")
+ private BigDecimal pip;
+
+ /**
+ * {@link ActiveSymbol#symbol}
+ */
+ public String getSymbol() {
+
+ return symbol;
+ }
+
+ /**
+ * {@link ActiveSymbol#symbol}
+ */
+ public void setSymbol(String symbol) {
+ this.symbol = symbol;
+ }
+
+ /**
+ * {@link ActiveSymbol#intradayIntervalMinutes}
+ */
+ public int getIntradayIntervalMinutes() {
+ return intradayIntervalMinutes;
+ }
+
+ /**
+ * {@link ActiveSymbol#intradayIntervalMinutes}
+ */
+ public void setIntradayIntervalMinutes(int intradayIntervalMinutes) {
+ this.intradayIntervalMinutes = intradayIntervalMinutes;
+ }
+
+ /**
+ * {@link ActiveSymbol#symbolType}
+ */
+ public String getSymbolType() {
+ return symbolType;
+ }
+
+ /**
+ * {@link ActiveSymbol#symbolType}
+ */
+ public void setSymbolType(String symbolType) {
+ this.symbolType = symbolType;
+ }
+
+ /**
+ * {@link ActiveSymbol#isExhcangeOpen}
+ */
+ public Integer getIsExhcangeOpen() {
+ return isExhcangeOpen;
+ }
+
+ /**
+ * {@link ActiveSymbol#isExhcangeOpen}
+ */
+ public void setIsExhcangeOpen(Integer isExhcangeOpen) {
+ this.isExhcangeOpen = isExhcangeOpen;
+ }
+
+ /**
+ * {@link ActiveSymbol#exchangeName}
+ */
+ public String getExchangeName() {
+ return exchangeName;
+ }
+
+ /**
+ * {@link ActiveSymbol#exchangeName}
+ */
+ public void setExchangeName(String exchangeName) {
+ this.exchangeName = exchangeName;
+ }
+
+ /**
+ * {@link ActiveSymbol#delayAmount}
+ */
+ public int getDelayAmount() {
+ return delayAmount;
+ }
+
+ /**
+ * {@link ActiveSymbol#delayAmount}
+ */
+ public void setDelayAmount(int delayAmount) {
+ this.delayAmount = delayAmount;
+ }
+
+ /**
+ * {@link ActiveSymbol#displayName}
+ */
+ public String getDisplayName() {
+ return displayName;
+ }
+
+ /**
+ * {@link ActiveSymbol#displayName}
+ */
+ public void setDisplayName(String displayName) {
+ this.displayName = displayName;
+ }
+
+ /**
+ * {@link ActiveSymbol#spot}
+ */
+ public Integer getSpot() {
+ return spot;
+ }
+
+ /**
+ * {@link ActiveSymbol#spot}
+ */
+ public void setSpot(Integer spot) {
+ this.spot = spot;
+ }
+
+ /**
+ * {@link ActiveSymbol#spotTime}
+ */
+ public String getSpotTime() {
+ return spotTime;
+ }
+
+ /**
+ * {@link ActiveSymbol#spotTime}
+ */
+ public void setSpotTime(String spotTime) {
+ this.spotTime = spotTime;
+ }
+
+ /**
+ * {@link ActiveSymbol#isTradingSuspended}
+ */
+ public Integer getIsTradingSuspended() {
+ return isTradingSuspended;
+ }
+
+ /**
+ * {@link ActiveSymbol#isTradingSuspended}
+ */
+ public void setIsTradingSuspended(Integer isTradingSuspended) {
+ this.isTradingSuspended = isTradingSuspended;
+ }
+
+ /**
+ * {@link ActiveSymbol#quotedCurrencySymbol}
+ */
+ public String getQuotedCurrencySymbol() {
+ return quotedCurrencySymbol;
+ }
+
+ /**
+ * {@link ActiveSymbol#quotedCurrencySymbol}
+ */
+ public void setQuotedCurrencySymbol(String quotedCurrencySymbol) {
+ this.quotedCurrencySymbol = quotedCurrencySymbol;
+ }
+
+ /**
+ * {@link ActiveSymbol#spotAge}
+ */
+ public String getSpotAge() {
+ return spotAge;
+ }
+
+ /**
+ * {@link ActiveSymbol#spotAge}
+ */
+ public void setSpotAge(String spotAge) {
+ this.spotAge = spotAge;
+ }
+
+ /**
+ * {@link ActiveSymbol#market}
+ */
+ public String getMarket() {
+ return market;
+ }
+
+ /**
+ * {@link ActiveSymbol#market}
+ */
+ public void setMarket(String market) {
+ this.market = market;
+ }
+
+ /**
+ * {@link ActiveSymbol#marketDisplayName}
+ */
+ public String getMarketDisplayName() {
+ return marketDisplayName;
+ }
+
+ /**
+ * {@link ActiveSymbol#marketDisplayName}
+ */
+ public void setMarketDisplayName(String marketDisplayName) {
+ this.marketDisplayName = marketDisplayName;
+ }
+
+ /**
+ * {@link ActiveSymbol#subMarket}
+ */
+ public String getSubMarket() {
+ return subMarket;
+ }
+
+ /**
+ * {@link ActiveSymbol#subMarket}
+ */
+ public void setSubMarket(String subMarket) {
+ this.subMarket = subMarket;
+ }
+
+ /**
+ * {@link ActiveSymbol#subMarketDisplayName}
+ */
+ public String getSubMarketDisplayName() {
+ return subMarketDisplayName;
+ }
+
+ /**
+ * {@link ActiveSymbol#subMarketDisplayName}
+ */
+ public void setSubMarketDisplayName(String subMarketDisplayName) {
+ this.subMarketDisplayName = subMarketDisplayName;
+ }
+
+ /**
+ * {@link ActiveSymbol#pip}
+ */
+ public BigDecimal getPip() {
+ return pip;
+ }
+
+ /**
+ * {@link ActiveSymbol#pip}
+ */
+ public void setPip(BigDecimal pip) {
+ this.pip = pip;
+ }
+}
diff --git a/Trading/src/main/java/com/suneesh/trading/models/responses/ActiveSymbolResponse.java b/Trading/src/main/java/com/suneesh/trading/models/responses/ActiveSymbolResponse.java
new file mode 100644
index 0000000..d96e36f
--- /dev/null
+++ b/Trading/src/main/java/com/suneesh/trading/models/responses/ActiveSymbolResponse.java
@@ -0,0 +1,38 @@
+package com.suneesh.trading.models.responses;
+
+import com.suneesh.trading.models.requests.ActiveSymbolRequest;
+import com.google.gson.annotations.SerializedName;
+
+/**
+ * ActiveSymbolResponse
+ *
+ * Get list of active symbols Receive
+ * A message list of active symbols
+ * @author Morteza Tavanarad
+ * @version 1.0.0
+ * @since 7/31/2017
+ */
+public class ActiveSymbolResponse extends ResponseBase {
+
+ /**
+ * List of active symbols. Note: if the user is authenticated,
+ * then only symbols allowed under his account will be returned.
+ */
+ @SerializedName("active_symbols")
+ private ActiveSymbol[] activeSymbols;
+
+ /**
+ * {@link ActiveSymbolResponse#activeSymbols}
+ */
+ public ActiveSymbol[] getActiveSymbols() {
+ return activeSymbols;
+ }
+
+ /**
+ * {@link ActiveSymbolResponse#activeSymbols}
+ */
+ public void setActiveSymbols(ActiveSymbol[] activeSymbols) {
+ this.activeSymbols = activeSymbols;
+ }
+}
+
diff --git a/Trading/src/main/java/com/suneesh/trading/models/responses/ApiCallLimit.java b/Trading/src/main/java/com/suneesh/trading/models/responses/ApiCallLimit.java
new file mode 100644
index 0000000..28645f1
--- /dev/null
+++ b/Trading/src/main/java/com/suneesh/trading/models/responses/ApiCallLimit.java
@@ -0,0 +1,42 @@
+package com.suneesh.trading.models.responses;
+
+import com.google.gson.annotations.SerializedName;
+import io.reactivex.annotations.Nullable;
+
+/**
+ * @author Morteza Tavanarad
+ * @version 1.0.0
+ * @since 8/3/2017
+ */
+public class ApiCallLimit {
+
+ @SerializedName("applies_to")
+ private String appliesTo;
+
+ @SerializedName("max")
+ @Nullable
+ private Integer max;
+
+ @SerializedName("hourly")
+ @Nullable
+ private Integer hourly;
+
+ @SerializedName("minutely")
+ private String minutely;
+
+ public String getAppliesTo() {
+ return appliesTo;
+ }
+
+ public Integer getMax() {
+ return max;
+ }
+
+ public Integer getHourly() {
+ return hourly;
+ }
+
+ public String getMinutely() {
+ return minutely;
+ }
+}
diff --git a/Trading/src/main/java/com/suneesh/trading/models/responses/ApiToken.java b/Trading/src/main/java/com/suneesh/trading/models/responses/ApiToken.java
new file mode 100644
index 0000000..0623c3a
--- /dev/null
+++ b/Trading/src/main/java/com/suneesh/trading/models/responses/ApiToken.java
@@ -0,0 +1,63 @@
+package com.suneesh.trading.models.responses;
+
+import com.google.gson.annotations.SerializedName;
+
+import java.util.List;
+
+/**
+ * @author Morteza Tavanarad
+ * @version 1.0.0
+ * @since 8/9/2017
+ */
+public class ApiToken {
+
+ /**
+ * Display name
+ */
+ @SerializedName("display_name")
+ private String displayName;
+
+ /**
+ * Last used
+ */
+ @SerializedName("last_used")
+ private String lastUsed;
+
+ /**
+ * Scopes
+ */
+ @SerializedName("scopes")
+ private List scopes;
+
+ /**
+ * Token
+ */
+ @SerializedName("token")
+ private String Token;
+
+ /**
+ * Validated IP(s) list
+ */
+ @SerializedName("valid_for_ip")
+ private String validForIp;
+
+ public String getDisplayName() {
+ return displayName;
+ }
+
+ public String getLastUsed() {
+ return lastUsed;
+ }
+
+ public List getScopes() {
+ return scopes;
+ }
+
+ public String getToken() {
+ return Token;
+ }
+
+ public String getValidForIp() {
+ return validForIp;
+ }
+}
diff --git a/Trading/src/main/java/com/suneesh/trading/models/responses/ApiTokenManagementResponse.java b/Trading/src/main/java/com/suneesh/trading/models/responses/ApiTokenManagementResponse.java
new file mode 100644
index 0000000..7e1e55e
--- /dev/null
+++ b/Trading/src/main/java/com/suneesh/trading/models/responses/ApiTokenManagementResponse.java
@@ -0,0 +1,68 @@
+package com.suneesh.trading.models.responses;
+
+import com.suneesh.trading.models.requests.ApiTokenManagementRequest;
+import com.google.gson.annotations.SerializedName;
+
+import java.util.List;
+
+/**
+ * ApiTokenManagementResponse
+ *
+ * API Token Response
+ *
+ * @author Morteza Tavanarad
+ * @version 1.0.0
+ * @since 8/9/2017
+ */
+public class ApiTokenManagementResponse extends ResponseBase {
+
+ /**
+ * Api Token
+ */
+ @SerializedName("api_token")
+ private ApiTokenResult apiTokenResult;
+
+ public ApiTokenResult getApiTokenResult() {
+ return apiTokenResult;
+ }
+
+ public class ApiTokenResult {
+
+ /**
+ * API tokens
+ */
+ @SerializedName("tokens")
+ private List tokens;
+
+ /**
+ * Token created.
+ */
+ @SerializedName("new_token")
+ private Integer isTokenCreated;
+
+ /**
+ * Token Deleted
+ */
+ @SerializedName("delete_token")
+ private Integer isTokenDeleted;
+
+ @SerializedName("sub_account")
+ private String subAccount;
+
+ public List getTokens() {
+ return tokens;
+ }
+
+ public boolean isTokenCreated() {
+ return isTokenCreated == 1 ? true : false;
+ }
+
+ public boolean isTokenDeleted() {
+ return isTokenDeleted == 1 ? true : false;
+ }
+
+ public String getSubAccount() {
+ return subAccount;
+ }
+ }
+}
diff --git a/Trading/src/main/java/com/suneesh/trading/models/responses/Application.java b/Trading/src/main/java/com/suneesh/trading/models/responses/Application.java
new file mode 100644
index 0000000..e830d6c
--- /dev/null
+++ b/Trading/src/main/java/com/suneesh/trading/models/responses/Application.java
@@ -0,0 +1,109 @@
+package com.suneesh.trading.models.responses;
+
+import com.google.gson.annotations.SerializedName;
+
+import java.math.BigDecimal;
+import java.util.List;
+
+/**
+ * @author Morteza Tavanarad
+ * @version 1.0.0
+ * @since 8/9/2017
+ */
+public class Application {
+
+ /**
+ * Framework name
+ *
+ */
+ @SerializedName("name")
+ private String name;
+
+ @SerializedName("app_id")
+ private Long applicationId;
+
+ /**
+ * Framework's homepage
+ *
+ */
+ @SerializedName("homepage")
+ private String homepageUrl;
+
+ /**
+ * Framework's GitHub page (for open-source projects)
+ *
+ */
+ @SerializedName("github")
+ private String githubUrl;
+
+ /**
+ * Framework's App Store URL (if applicable)
+ *
+ */
+ @SerializedName("appstore")
+ private String appStoreUrl;
+
+ /**
+ * Framework's Google Play URL (if applicable)
+ *
+ */
+ @SerializedName("googleplay")
+ private String googlePlayUrl;
+
+ /**
+ * Framework redirect_uri
+ *
+ */
+ @SerializedName("redirect_uri")
+ private String redirectUri;
+
+ /**
+ * Framework verification_uri
+ *
+ */
+ @SerializedName("verification_uri")
+ private String verificationUri;
+
+ /**
+ * Markup to be added to contract prices (as a percentage of contract payout). Min: 0, Max: 5
+ *
+ */
+ @SerializedName("app_markup_percentage")
+ private BigDecimal appMarkupPercentage;
+
+ public String getName() {
+ return name;
+ }
+
+ public Long getApplicationId() {
+ return applicationId;
+ }
+
+ public String getHomepageUrl() {
+ return homepageUrl;
+ }
+
+ public String getGithubUrl() {
+ return githubUrl;
+ }
+
+ public String getAppStoreUrl() {
+ return appStoreUrl;
+ }
+
+ public String getGooglePlayUrl() {
+ return googlePlayUrl;
+ }
+
+ public String getRedirectUri() {
+ return redirectUri;
+ }
+
+ public String getVerificationUri() {
+ return verificationUri;
+ }
+
+ public BigDecimal getAppMarkupPercentage() {
+ return appMarkupPercentage;
+ }
+}
diff --git a/Trading/src/main/java/com/suneesh/trading/models/responses/ApplicationDeletionResponse.java b/Trading/src/main/java/com/suneesh/trading/models/responses/ApplicationDeletionResponse.java
new file mode 100644
index 0000000..9f28b8b
--- /dev/null
+++ b/Trading/src/main/java/com/suneesh/trading/models/responses/ApplicationDeletionResponse.java
@@ -0,0 +1,21 @@
+package com.suneesh.trading.models.responses;
+
+import com.suneesh.trading.models.requests.ApplicationDeletionRequest;
+import com.google.gson.annotations.SerializedName;
+import io.reactivex.annotations.Nullable;
+
+/**
+ * @author Morteza Tavanarad
+ * @version 1.0.0
+ * @since 8/20/2017
+ */
+public class ApplicationDeletionResponse extends ResponseBase {
+
+ @SerializedName("app_delete")
+ @Nullable
+ private Integer response;
+
+ public boolean getResponse() {
+ return response == 1 ? true : false;
+ }
+}
diff --git a/Trading/src/main/java/com/suneesh/trading/models/responses/ApplicationDetailsResponse.java b/Trading/src/main/java/com/suneesh/trading/models/responses/ApplicationDetailsResponse.java
new file mode 100644
index 0000000..17eeb35
--- /dev/null
+++ b/Trading/src/main/java/com/suneesh/trading/models/responses/ApplicationDetailsResponse.java
@@ -0,0 +1,26 @@
+package com.suneesh.trading.models.responses;
+
+import com.suneesh.trading.models.requests.ApplicationDetailsRequest;
+import com.google.gson.annotations.SerializedName;
+import io.reactivex.annotations.Nullable;
+
+/**
+ * ApplicationDetailsResponse
+ *
+ * App Get Receive
+ * A message with requested application
+ *
+ * @author Morteza Tavanarad
+ * @version 1.0.0
+ * @since 8/27/2017
+ */
+public class ApplicationDetailsResponse extends ResponseBase {
+
+ @SerializedName("app_get")
+ @Nullable
+ private Application application;
+
+ public Application getApplication() {
+ return application;
+ }
+}
diff --git a/Trading/src/main/java/com/suneesh/trading/models/responses/ApplicationListResponse.java b/Trading/src/main/java/com/suneesh/trading/models/responses/ApplicationListResponse.java
new file mode 100644
index 0000000..ea9a0f2
--- /dev/null
+++ b/Trading/src/main/java/com/suneesh/trading/models/responses/ApplicationListResponse.java
@@ -0,0 +1,26 @@
+package com.suneesh.trading.models.responses;
+
+import com.suneesh.trading.models.requests.ApplicationListRequest;
+import com.google.gson.annotations.SerializedName;
+
+import java.util.List;
+
+/**
+ * ApplicationListResponse
+ *
+ * App List Receive
+ * A message with created applications
+ *
+ * @author Morteza Tavanarad
+ * @version 1.0.0
+ * @since 8/24/2017
+ */
+public class ApplicationListResponse extends ResponseBase {
+
+ @SerializedName("app_list")
+ private List applications;
+
+ public List getApplications() {
+ return applications;
+ }
+}
diff --git a/Trading/src/main/java/com/suneesh/trading/models/responses/ApplicationRegistrationResponse.java b/Trading/src/main/java/com/suneesh/trading/models/responses/ApplicationRegistrationResponse.java
new file mode 100644
index 0000000..e4bf2a9
--- /dev/null
+++ b/Trading/src/main/java/com/suneesh/trading/models/responses/ApplicationRegistrationResponse.java
@@ -0,0 +1,19 @@
+package com.suneesh.trading.models.responses;
+
+import com.suneesh.trading.models.requests.ApplicationRegistrationRequest;
+import com.google.gson.annotations.SerializedName;
+
+/**
+ * @author Morteza Tavanarad
+ * @version 1.0.0
+ * @since 8/9/2017
+ */
+public class ApplicationRegistrationResponse extends ResponseBase {
+
+ @SerializedName("app_register")
+ private Application registeredApplication;
+
+ public Application getRegisteredApplication() {
+ return registeredApplication;
+ }
+}
diff --git a/Trading/src/main/java/com/suneesh/trading/models/responses/ApplicationUpdateResponse.java b/Trading/src/main/java/com/suneesh/trading/models/responses/ApplicationUpdateResponse.java
new file mode 100644
index 0000000..ccf7fc0
--- /dev/null
+++ b/Trading/src/main/java/com/suneesh/trading/models/responses/ApplicationUpdateResponse.java
@@ -0,0 +1,21 @@
+package com.suneesh.trading.models.responses;
+
+import com.suneesh.trading.models.requests.ApplicationUpdateRequest;
+import com.google.gson.annotations.SerializedName;
+import io.reactivex.annotations.Nullable;
+
+/**
+ * @author Morteza Tavanarad
+ * @version 1.0.0
+ * @since 8/27/2017
+ */
+public class ApplicationUpdateResponse extends ResponseBase {
+
+ @SerializedName("app_update")
+ @Nullable
+ private Application application;
+
+ public Application getApplication() {
+ return application;
+ }
+}
diff --git a/Trading/src/main/java/com/suneesh/trading/models/responses/AssetIndex.java b/Trading/src/main/java/com/suneesh/trading/models/responses/AssetIndex.java
new file mode 100644
index 0000000..6a1bc81
--- /dev/null
+++ b/Trading/src/main/java/com/suneesh/trading/models/responses/AssetIndex.java
@@ -0,0 +1,41 @@
+package com.suneesh.trading.models.responses;
+
+import com.google.gson.annotations.SerializedName;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @author Morteza Tavanarad
+ * @version 1.0.0
+ * @since 7/31/2017
+ */
+public class AssetIndex {
+ private String symbol;
+ private String symbolDisplayName;
+ List contracts = new ArrayList<>();
+
+ public String getSymbol() {
+ return symbol;
+ }
+
+ public void setSymbol(String symbol) {
+ this.symbol = symbol;
+ }
+
+ public String getSymbolDisplayName() {
+ return symbolDisplayName;
+ }
+
+ public void setSymbolDisplayName(String symbolDisplayName) {
+ this.symbolDisplayName = symbolDisplayName;
+ }
+
+ public void addContract(ContractInfo contract) {
+ this.contracts.add(contract);
+ }
+
+ public List getContracts() {
+ return this.contracts;
+ }
+}
diff --git a/Trading/src/main/java/com/suneesh/trading/models/responses/AssetIndexResponse.java b/Trading/src/main/java/com/suneesh/trading/models/responses/AssetIndexResponse.java
new file mode 100644
index 0000000..34fe761
--- /dev/null
+++ b/Trading/src/main/java/com/suneesh/trading/models/responses/AssetIndexResponse.java
@@ -0,0 +1,23 @@
+package com.suneesh.trading.models.responses;
+
+import com.suneesh.trading.models.requests.AssetIndexRequest;
+import com.google.gson.annotations.SerializedName;
+
+/**
+ * @author Morteza Tavanarad
+ * @version 1.0.0
+ * @since 7/31/2017
+ */
+public class AssetIndexResponse extends ResponseBase {
+
+ @SerializedName("asset_index")
+ private AssetIndex[] assetIndex;
+
+ public AssetIndex[] getAssetIndex() {
+ return assetIndex;
+ }
+
+ public void setAssetIndex(AssetIndex[] assetIndex) {
+ this.assetIndex = assetIndex;
+ }
+}
diff --git a/Trading/src/main/java/com/suneesh/trading/models/responses/Authorize.java b/Trading/src/main/java/com/suneesh/trading/models/responses/Authorize.java
new file mode 100644
index 0000000..becb1ef
--- /dev/null
+++ b/Trading/src/main/java/com/suneesh/trading/models/responses/Authorize.java
@@ -0,0 +1,142 @@
+package com.suneesh.trading.models.responses;
+
+import com.google.gson.annotations.SerializedName;
+
+import java.math.BigDecimal;
+
+/**
+ * Created by morteza on 7/28/2017.
+ */
+public class Authorize {
+ @SerializedName("email")
+ private String email;
+
+ @SerializedName("currency")
+ private String currency;
+
+ @SerializedName("balance")
+ private BigDecimal balance;
+
+ @SerializedName("loginid")
+ private String loginId;
+
+ @SerializedName("is_virtual")
+ private int isVirtual;
+
+ @SerializedName("landing_company_name")
+ private String landingCompanyName;
+
+ @SerializedName("landing_company_fullname")
+ private String landingCompanyFullName;
+
+ @SerializedName("country")
+ private String country;
+
+ @SerializedName("fullname")
+ private String fullName;
+
+ @SerializedName("scopes")
+ private String[] scopes;
+
+ @SerializedName("allow_omnibus")
+ private int allowOmnibus;
+
+ @SerializedName("sub_accounts")
+ private SubAccount[] subAccounts;
+
+ public String getEmail() {
+ return email;
+ }
+
+ public void setEmail(String email) {
+ this.email = email;
+ }
+
+ public String getCurrency() {
+ return currency;
+ }
+
+ public void setCurrency(String currency) {
+ this.currency = currency;
+ }
+
+ public BigDecimal getBalance() {
+ return balance;
+ }
+
+ public void setBalance(BigDecimal balance) {
+ this.balance = balance;
+ }
+
+ public String getLoginId() {
+ return loginId;
+ }
+
+ public void setLoginId(String loginId) {
+ this.loginId = loginId;
+ }
+
+ public int getIsVirtual() {
+ return isVirtual;
+ }
+
+ public void setIsVirtual(int isVirtual) {
+ this.isVirtual = isVirtual;
+ }
+
+ public String getLandingCompanyName() {
+ return landingCompanyName;
+ }
+
+ public void setLandingCompanyName(String landingCompanyName) {
+ this.landingCompanyName = landingCompanyName;
+ }
+
+ public String getLandingCompanyFullName() {
+ return landingCompanyFullName;
+ }
+
+ public void setLandingCompanyFullName(String landingCompanyFullName) {
+ this.landingCompanyFullName = landingCompanyFullName;
+ }
+
+ public String getCountry() {
+ return country;
+ }
+
+ public void setCountry(String country) {
+ this.country = country;
+ }
+
+ public String getFullName() {
+ return fullName;
+ }
+
+ public void setFullName(String fullName) {
+ this.fullName = fullName;
+ }
+
+ public String[] getScopes() {
+ return scopes;
+ }
+
+ public void setScopes(String[] scopes) {
+ this.scopes = scopes;
+ }
+
+ public int getAllowOmnibus() {
+ return allowOmnibus;
+ }
+
+ public void setAllowOmnibus(int allowOmnibus) {
+ this.allowOmnibus = allowOmnibus;
+ }
+
+ public SubAccount[] getSubAccounts() {
+ return subAccounts;
+ }
+
+ public void setSubAccounts(SubAccount[] subAccounts) {
+ this.subAccounts = subAccounts;
+ }
+}
\ No newline at end of file
diff --git a/Trading/src/main/java/com/suneesh/trading/models/responses/AuthorizeResponse.java b/Trading/src/main/java/com/suneesh/trading/models/responses/AuthorizeResponse.java
new file mode 100644
index 0000000..4e8f0d4
--- /dev/null
+++ b/Trading/src/main/java/com/suneesh/trading/models/responses/AuthorizeResponse.java
@@ -0,0 +1,20 @@
+package com.suneesh.trading.models.responses;
+
+import com.suneesh.trading.models.requests.AuthorizeRequest;
+import com.google.gson.annotations.SerializedName;
+
+/**
+ * Created by morteza on 7/28/2017.
+ */
+public class AuthorizeResponse extends ResponseBase {
+ @SerializedName("authorize")
+ private Authorize authorize;
+
+ public Authorize getAuthorize() {
+ return authorize;
+ }
+
+ public void setAuthorize(Authorize authorize) {
+ this.authorize = authorize;
+ }
+}
diff --git a/Trading/src/main/java/com/suneesh/trading/models/responses/Balance.java b/Trading/src/main/java/com/suneesh/trading/models/responses/Balance.java
new file mode 100644
index 0000000..cfaf538
--- /dev/null
+++ b/Trading/src/main/java/com/suneesh/trading/models/responses/Balance.java
@@ -0,0 +1,56 @@
+package com.suneesh.trading.models.responses;
+
+import com.google.gson.annotations.SerializedName;
+import io.reactivex.annotations.Nullable;
+
+import java.math.BigDecimal;
+
+/**
+ * @author Morteza Tavanarad
+ * @version 1.0.0
+ * @since 8/4/2017
+ */
+public class Balance {
+
+ /**
+ * Balance amount
+ */
+ @SerializedName("balance")
+ private BigDecimal balance;
+
+ /**
+ * Currency Example: USD
+ */
+ @SerializedName("currency")
+ private String currency;
+
+ /**
+ * Client loginid Example: CR000000
+ */
+ @SerializedName("loginid")
+ private String loginId;
+
+ /**
+ * A stream id that can be used to cancel this stream using the Forget request.
+ * Example: 1d6651e7d599bce6c54bd71a8283e579
+ */
+ @SerializedName("id")
+ @Nullable
+ private String id;
+
+ public BigDecimal getBalance() {
+ return balance;
+ }
+
+ public String getCurrency() {
+ return currency;
+ }
+
+ public String getLoginId() {
+ return loginId;
+ }
+
+ public String getId() {
+ return id;
+ }
+}
diff --git a/Trading/src/main/java/com/suneesh/trading/models/responses/BalanceResponse.java b/Trading/src/main/java/com/suneesh/trading/models/responses/BalanceResponse.java
new file mode 100644
index 0000000..dd177c2
--- /dev/null
+++ b/Trading/src/main/java/com/suneesh/trading/models/responses/BalanceResponse.java
@@ -0,0 +1,32 @@
+package com.suneesh.trading.models.responses;
+
+import com.suneesh.trading.models.requests.BalanceRequest;
+import com.google.gson.annotations.SerializedName;
+
+/**
+ * BalanceResponse
+ *
+ * Realtime Balance
+ * Return details of user account balance
+ *
+ * @author Morteza Tavanarad
+ * @version 1.0.0
+ * @since 8/4/2017
+ */
+public class BalanceResponse extends ResponseBase {
+
+ /**
+ * Realtime stream of user balance changes.
+ */
+ @SerializedName("balance")
+ private Balance balance;
+
+ public Balance getBalance() {
+ return balance;
+ }
+
+ public void setBalance(Balance balance) {
+ this.balance = balance;
+ }
+
+}
diff --git a/Trading/src/main/java/com/suneesh/trading/models/responses/BuyContractForMultipleAccountsResponse.java b/Trading/src/main/java/com/suneesh/trading/models/responses/BuyContractForMultipleAccountsResponse.java
new file mode 100644
index 0000000..c1ca1b8
--- /dev/null
+++ b/Trading/src/main/java/com/suneesh/trading/models/responses/BuyContractForMultipleAccountsResponse.java
@@ -0,0 +1,41 @@
+package com.suneesh.trading.models.responses;
+
+import com.suneesh.trading.models.requests.BuyContractForMultipleAccountsRequest;
+import com.google.gson.annotations.SerializedName;
+
+import java.util.List;
+
+/**
+ * BuyContractForMultipleAccountsResponse
+ *
+ * Buy a Contract for multiple Accounts Receive
+ *
+ * A message with transaction results is received
+ *
+ *
+ * @author Morteza Tavanarad
+ * @version 1.0.0
+ * @since 8/8/2017
+ */
+public class BuyContractForMultipleAccountsResponse extends ResponseBase {
+
+ /**
+ * Receipt confirmation for the purchase
+ */
+ @SerializedName("buy_contract_for_multiple_accounts")
+ private MassBuyContractResult buyContractResult;
+
+ public MassBuyContractResult getMassBuyContractResult() {
+ return buyContractResult;
+ }
+
+ public class MassBuyContractResult {
+
+ @SerializedName("result")
+ private List result;
+
+ public List getResult() {
+ return result;
+ }
+ }
+}
diff --git a/Trading/src/main/java/com/suneesh/trading/models/responses/BuyContractResponse.java b/Trading/src/main/java/com/suneesh/trading/models/responses/BuyContractResponse.java
new file mode 100644
index 0000000..fa89a0d
--- /dev/null
+++ b/Trading/src/main/java/com/suneesh/trading/models/responses/BuyContractResponse.java
@@ -0,0 +1,29 @@
+package com.suneesh.trading.models.responses;
+
+import com.suneesh.trading.models.requests.BuyContractRequest;
+import com.google.gson.annotations.SerializedName;
+
+/**
+ * BuyContractResponse
+ *
+ * Buy a Contract Receive
+ *
+ * A message with transaction results is received
+ *
+ *
+ * @author Morteza Tavanarad
+ * @version 1.0.0
+ * @since 8/8/2017
+ */
+public class BuyContractResponse extends ResponseBase {
+
+ /**
+ *
+ */
+ @SerializedName("buy")
+ private BuyReceipt buyReceipt;
+
+ public BuyReceipt getBuyReceipt() {
+ return buyReceipt;
+ }
+}
diff --git a/Trading/src/main/java/com/suneesh/trading/models/responses/BuyReceipt.java b/Trading/src/main/java/com/suneesh/trading/models/responses/BuyReceipt.java
new file mode 100644
index 0000000..7a1c6cb
--- /dev/null
+++ b/Trading/src/main/java/com/suneesh/trading/models/responses/BuyReceipt.java
@@ -0,0 +1,132 @@
+package com.suneesh.trading.models.responses;
+
+import com.google.gson.annotations.SerializedName;
+
+import java.math.BigDecimal;
+
+/**
+ * @author Morteza Tavanarad
+ * @version 1.0.0
+ * @since 8/8/2017
+ */
+public class BuyReceipt {
+
+ /**
+ * The new account balance after completion of the purchase
+ * (Required)
+ *
+ */
+ @SerializedName("balance_after")
+ private BigDecimal balanceAfter;
+
+ /**
+ * The description of contract purchased
+ * (Required)
+ *
+ */
+ @SerializedName("longcode")
+ private String longCode;
+
+ /**
+ * Compact description of the contract purchased
+ * (Required)
+ *
+ */
+ @SerializedName("shortcode")
+ private String shortCode;
+
+ /**
+ * Epoch value showing the expected start time of the contract
+ * (Required)
+ *
+ */
+ @SerializedName("start_time")
+ private Long startTime;
+
+ /**
+ * Internal contract identifier
+ * (Required)
+ *
+ */
+ @SerializedName("contract_id")
+ private Long contractId;
+
+ /**
+ * Actual effected purchase price
+ * (Required)
+ *
+ */
+ @SerializedName("buy_price")
+ private BigDecimal buyPrice;
+
+ /**
+ * Epoch value of the transaction purchase time
+ * (Required)
+ *
+ */
+ @SerializedName("purchase_time")
+ private Long purchaseTime;
+
+ /**
+ * Internal transaction identifier
+ * (Required)
+ *
+ */
+ @SerializedName("transaction_id")
+ private Long transactionId;
+
+ /**
+ * Proposed payout value
+ * (Required)
+ *
+ */
+ @SerializedName("payout")
+ private BigDecimal payout;
+
+ /**
+ * Account token that contract is bought for it.
+ * Note: it is just available when request is BuyContractForMultipleAccounts
+ */
+ @SerializedName("token")
+ private String token;
+
+ public BigDecimal getBalanceAfter() {
+ return balanceAfter;
+ }
+
+ public String getLongCode() {
+ return longCode;
+ }
+
+ public String getShortCode() {
+ return shortCode;
+ }
+
+ public Long getStartTime() {
+ return startTime;
+ }
+
+ public Long getContractId() {
+ return contractId;
+ }
+
+ public BigDecimal getBuyPrice() {
+ return buyPrice;
+ }
+
+ public Long getPurchaseTime() {
+ return purchaseTime;
+ }
+
+ public Long getTransactionId() {
+ return transactionId;
+ }
+
+ public BigDecimal getPayout() {
+ return payout;
+ }
+
+ public String getToken() {
+ return token;
+ }
+}
diff --git a/Trading/src/main/java/com/suneesh/trading/models/responses/Candle.java b/Trading/src/main/java/com/suneesh/trading/models/responses/Candle.java
new file mode 100644
index 0000000..7767d26
--- /dev/null
+++ b/Trading/src/main/java/com/suneesh/trading/models/responses/Candle.java
@@ -0,0 +1,63 @@
+package com.suneesh.trading.models.responses;
+
+import com.google.gson.annotations.SerializedName;
+
+import java.math.BigDecimal;
+
+/**
+ * @author Morteza Tavanarad
+ * @version 1.0.0
+ * @since 8/3/2017
+ */
+public class Candle {
+
+ /**
+ * It is an epoch value
+ */
+ @SerializedName("epoch")
+ private Integer epoch;
+
+ /**
+ * It is the open price value for the given time
+ */
+ @SerializedName("open")
+ private BigDecimal open;
+
+ /**
+ * It is the high price value for the given time
+ */
+ @SerializedName("high")
+ private BigDecimal high;
+
+ /**
+ * It is the low price value for the given time
+ */
+ @SerializedName("low")
+ private BigDecimal low;
+
+ /**
+ * It is the close price value for the given time
+ */
+ @SerializedName("close")
+ private BigDecimal close;
+
+ public Integer getEpoch() {
+ return epoch;
+ }
+
+ public BigDecimal getOpen() {
+ return open;
+ }
+
+ public BigDecimal getHigh() {
+ return high;
+ }
+
+ public BigDecimal getLow() {
+ return low;
+ }
+
+ public BigDecimal getClose() {
+ return close;
+ }
+}
diff --git a/Trading/src/main/java/com/suneesh/trading/models/responses/CashierPasswordResponse.java b/Trading/src/main/java/com/suneesh/trading/models/responses/CashierPasswordResponse.java
new file mode 100644
index 0000000..b38f2be
--- /dev/null
+++ b/Trading/src/main/java/com/suneesh/trading/models/responses/CashierPasswordResponse.java
@@ -0,0 +1,19 @@
+package com.suneesh.trading.models.responses;
+
+import com.suneesh.trading.models.requests.CashierPasswordRequest;
+import com.google.gson.annotations.SerializedName;
+
+/**
+ * @author Morteza Tavanarad
+ * @version 1.0.0
+ * @since 9/14/2017
+ */
+public class CashierPasswordResponse extends ResponseBase {
+
+ @SerializedName("cashier_password")
+ private Integer lock;
+
+ public boolean isLock() {
+ return lock == 1 ? true : false;
+ }
+}
diff --git a/Trading/src/main/java/com/suneesh/trading/models/responses/CashierURLResponse.java b/Trading/src/main/java/com/suneesh/trading/models/responses/CashierURLResponse.java
new file mode 100644
index 0000000..5ec3667
--- /dev/null
+++ b/Trading/src/main/java/com/suneesh/trading/models/responses/CashierURLResponse.java
@@ -0,0 +1,25 @@
+package com.suneesh.trading.models.responses;
+
+import com.suneesh.trading.models.requests.CashierURLRequest;
+import com.google.gson.annotations.SerializedName;
+
+/**
+ * @author Morteza Tavanarad
+ * @version 1.0.0
+ * @since 9/14/2017
+ */
+public class CashierURLResponse extends ResponseBase {
+
+ /**
+ * cashier url,
+ * Note possible error codes: ASK_TNC_APPROVAL (API tnc_approval), ASK_AUTHENTICATE,
+ * ASK_UK_FUNDS_PROTECTION (API tnc_approval), ASK_CURRENCY (API set_account_currency),
+ * ASK_EMAIL_VERIFY (verify_email), ASK_FIX_DETAILS (API set_settings)
+ */
+ @SerializedName("cashier")
+ private String cashierURL;
+
+ public String getCashierURL() {
+ return cashierURL;
+ }
+}
diff --git a/Trading/src/main/java/com/suneesh/trading/models/responses/Company.java b/Trading/src/main/java/com/suneesh/trading/models/responses/Company.java
new file mode 100644
index 0000000..dede280
--- /dev/null
+++ b/Trading/src/main/java/com/suneesh/trading/models/responses/Company.java
@@ -0,0 +1,125 @@
+package com.suneesh.trading.models.responses;
+
+import com.google.gson.annotations.SerializedName;
+
+import java.util.List;
+
+/**
+ * @author Morteza Tavanarad
+ * @version 1.0.0
+ * @since 8/1/2017
+ */
+public class Company {
+
+ /**
+ * Landing Company short code
+ */
+ @SerializedName("shortcode")
+ private String shortCode;
+
+ /**
+ * Landing Company legal name
+ */
+ @SerializedName("name")
+ private String name;
+
+ /**
+ * Landing Company address
+ */
+ @SerializedName("address")
+ private List address;
+
+ /**
+ * Landing Company country of incorporation
+ */
+ @SerializedName("country")
+ private String country;
+
+ /**
+ * Default account currency
+ */
+ @SerializedName("legal_default_currency")
+ private String legalDefaultCurrency;
+
+ /**
+ * Allowable currencies
+ */
+ @SerializedName("legal_allowed_currencies")
+ private List legalAllowedCurrencies;
+
+ /**
+ * Allowable markets
+ */
+ @SerializedName("legal_allowed_markets")
+ private List legalAllowedMarkets;
+
+ /**
+ * Allowed contract types
+ */
+ @SerializedName("legal_allowed_contract_categories")
+ private List legalAllowedContractCategories;
+
+ public String getShortCode() {
+ return shortCode;
+ }
+
+ public void setShortCode(String shortCode) {
+ this.shortCode = shortCode;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public List getAddress() {
+ return address;
+ }
+
+ public void setAddress(List address) {
+ this.address = address;
+ }
+
+ public String getCountry() {
+ return country;
+ }
+
+ public void setCountry(String country) {
+ this.country = country;
+ }
+
+ public String getLegalDefaultCurrency() {
+ return legalDefaultCurrency;
+ }
+
+ public void setLegalDefaultCurrency(String legalDefaultCurrency) {
+ this.legalDefaultCurrency = legalDefaultCurrency;
+ }
+
+ public List getLegalAllowedCurrencies() {
+ return legalAllowedCurrencies;
+ }
+
+ public void setLegalAllowedCurrencies(List legalAllowedCurrencies) {
+ this.legalAllowedCurrencies = legalAllowedCurrencies;
+ }
+
+ public List getLegalAllowedMarkets() {
+ return legalAllowedMarkets;
+ }
+
+ public void setLegalAllowedMarkets(List legalAllowedMarkets) {
+ this.legalAllowedMarkets = legalAllowedMarkets;
+ }
+
+ public List getLegalAllowedContractCategories() {
+ return legalAllowedContractCategories;
+ }
+
+ public void setLegalAllowedContractCategories(List legalAllowedContractCategories) {
+ this.legalAllowedContractCategories = legalAllowedContractCategories;
+ }
+}
diff --git a/Trading/src/main/java/com/suneesh/trading/models/responses/Contract.java b/Trading/src/main/java/com/suneesh/trading/models/responses/Contract.java
new file mode 100644
index 0000000..6993a9e
--- /dev/null
+++ b/Trading/src/main/java/com/suneesh/trading/models/responses/Contract.java
@@ -0,0 +1,317 @@
+package com.suneesh.trading.models.responses;
+
+import com.google.gson.annotations.SerializedName;
+import io.reactivex.annotations.Nullable;
+
+import java.math.BigDecimal;
+
+/**
+ * @author Morteza Tavanarad
+ * @version 1.0.0
+ * @since 8/1/2017
+ */
+public class Contract {
+
+ /**
+ * Type of market (forex, indices, ...)
+ */
+ @SerializedName("market")
+ private String market;
+
+ /**
+ * Type of contract (example: asian up)
+ */
+ @SerializedName("contract_display")
+ private String contractsDisplay;
+
+ /**
+ * Maximum contract duration (example: 10)
+ */
+ @SerializedName("max_contract_duration")
+ private String maxContractDuration;
+
+ @SerializedName("max_historical_pricer_duration")
+ @Nullable
+ private String maxHistoricalPricerDuration;
+ /**
+ * Category of barrier (example: asian)
+ */
+ @SerializedName("barrier_category")
+ private String barrierCategory;
+
+ /**
+ * Maximum payout (example: 10000)
+ */
+ @SerializedName("payout_limit")
+ private BigDecimal payoutLimit;
+
+ /**
+ * Type of submarket (example: major_pairs)
+ */
+ @SerializedName("submarket")
+ private String subMarket;
+
+ /**
+ * Name of exchange (example: EURONEXT)
+ */
+ @SerializedName("exchange_name")
+ private String exchangeName;
+
+ /**
+ * Category of the contract (example: Asians)
+ */
+ @SerializedName("contract_category_display")
+ private String contractCategoryDisplay;
+
+ /**
+ * Type of contract (example: ASIANU)
+ */
+ @SerializedName("contract_type")
+ private String contractType;
+
+ /**
+ * Minimum contract duration (example: 5)
+ */
+ @SerializedName("min_contract_duration")
+ private String minContractDuration;
+
+ @SerializedName("min_historical_pricer_duration")
+ @Nullable
+ private String minHistoricalPricerDuration;
+
+ /**
+ * Type of sentiment (example: up)
+ */
+ @SerializedName("sentiment")
+ private String sentiment;
+
+ /**
+ * Barriers (example: 0)
+ */
+ @SerializedName("barrier")
+ private BigDecimal barrier;
+
+ /**
+ * Category of contract (example: asian)
+ */
+ @SerializedName("contract_category")
+ private String contractCategory;
+
+ /**
+ * Start Type (example: spot)
+ */
+ @SerializedName("start_type")
+ private String startType;
+
+ /**
+ * Expiry Type (example: tick)
+ */
+ @SerializedName("expiry_type")
+ private String expiryType;
+
+ /**
+ * Symbol code (example: R_50)
+ */
+ @SerializedName("underlying_symbol")
+ private String underlyingSymbol;
+
+ /**
+ * Array of returned forward starting options
+ */
+ @SerializedName("forward_starting_options")
+ @Nullable
+ private ForwardStartingOption[] forwardStartingOptions;
+
+ /**
+ * Array of available barriers for a predefined trading period (only return if region set to 'japan')
+ */
+ @SerializedName("available_barriers")
+ @Nullable
+ private BigDecimal[][] availableBarriers;
+
+ /**
+ * Array of barriers already expired (only return if region set to 'japan')
+ */
+ @SerializedName("expired_barriers")
+ @Nullable
+ private BigDecimal[][] expiredBarriers;
+
+ /**
+ * A hash of predefined trading period (only return if region set to 'japan')
+ */
+ @SerializedName("trading_period")
+ @Nullable
+ private TradingPeriod tradingPeriod;
+
+ @SerializedName("last_digit_range")
+ @Nullable
+ private int[] lastDigitRange;
+
+ public String getMarket() {
+ return market;
+ }
+
+ public void setMarket(String market) {
+ this.market = market;
+ }
+
+ public String getContractsDisplay() {
+ return contractsDisplay;
+ }
+
+ public void setContractsDisplay(String contractsDisplay) {
+ this.contractsDisplay = contractsDisplay;
+ }
+
+ public String getMaxContractDuration() {
+ return maxContractDuration;
+ }
+
+ public void setMaxContractDuration(String maxContractDuration) {
+ this.maxContractDuration = maxContractDuration;
+ }
+
+ public String getBarrierCategory() {
+ return barrierCategory;
+ }
+
+ public void setBarrierCategory(String barrierCategory) {
+ this.barrierCategory = barrierCategory;
+ }
+
+ public BigDecimal getPayoutLimit() {
+ return payoutLimit;
+ }
+
+ public void setPayoutLimit(BigDecimal payoutLimit) {
+ this.payoutLimit = payoutLimit;
+ }
+
+ public String getSubMarket() {
+ return subMarket;
+ }
+
+ public void setSubMarket(String subMarket) {
+ this.subMarket = subMarket;
+ }
+
+ public String getExchangeName() {
+ return exchangeName;
+ }
+
+ public void setExchangeName(String exchangeName) {
+ this.exchangeName = exchangeName;
+ }
+
+ public String getContractCategoryDisplay() {
+ return contractCategoryDisplay;
+ }
+
+ public void setContractCategoryDisplay(String contractCategoryDisplay) {
+ this.contractCategoryDisplay = contractCategoryDisplay;
+ }
+
+ public String getContractType() {
+ return contractType;
+ }
+
+ public void setContractType(String contractType) {
+ this.contractType = contractType;
+ }
+
+ public String getMinContractDuration() {
+ return minContractDuration;
+ }
+
+ public void setMinContractDuration(String minContractDuration) {
+ this.minContractDuration = minContractDuration;
+ }
+
+ public String getSentiment() {
+ return sentiment;
+ }
+
+ public void setSentiment(String sentiment) {
+ this.sentiment = sentiment;
+ }
+
+ public BigDecimal getBarrier() {
+ return barrier;
+ }
+
+ public void setBarrier(BigDecimal barrier) {
+ this.barrier = barrier;
+ }
+
+ public String getContractCategory() {
+ return contractCategory;
+ }
+
+ public void setContractCategory(String contractCategory) {
+ this.contractCategory = contractCategory;
+ }
+
+ public String getStartType() {
+ return startType;
+ }
+
+ public void setStartType(String startType) {
+ this.startType = startType;
+ }
+
+ public String getExpiryType() {
+ return expiryType;
+ }
+
+ public void setExpiryType(String expiryType) {
+ this.expiryType = expiryType;
+ }
+
+ public String getUnderlyingSymbol() {
+ return underlyingSymbol;
+ }
+
+ public void setUnderlyingSymbol(String underlyingSymbol) {
+ this.underlyingSymbol = underlyingSymbol;
+ }
+
+ public ForwardStartingOption[] getForwardStartingOptions() {
+ return forwardStartingOptions;
+ }
+
+ public void setForwardStartingOptions(ForwardStartingOption[] forwardStartingOptions) {
+ this.forwardStartingOptions = forwardStartingOptions;
+ }
+
+ public BigDecimal[][] getAvailableBarriers() {
+ return availableBarriers;
+ }
+
+ public void setAvailableBarriers(BigDecimal[][] availableBarriers) {
+ this.availableBarriers = availableBarriers;
+ }
+
+ public BigDecimal[][] getExpiredBarriers() {
+ return expiredBarriers;
+ }
+
+ public void setExpiredBarriers(BigDecimal[][] expiredBarriers) {
+ this.expiredBarriers = expiredBarriers;
+ }
+
+ public TradingPeriod getTradingPeriod() {
+ return tradingPeriod;
+ }
+
+ public void setTradingPeriod(TradingPeriod tradingPeriod) {
+ this.tradingPeriod = tradingPeriod;
+ }
+
+ public int[] getLastDigitRange() {
+ return lastDigitRange;
+ }
+
+ public void setLastDigitRange(int[] lastDigitRange) {
+ this.lastDigitRange = lastDigitRange;
+ }
+}
diff --git a/Trading/src/main/java/com/suneesh/trading/models/responses/ContractForSymbol.java b/Trading/src/main/java/com/suneesh/trading/models/responses/ContractForSymbol.java
new file mode 100644
index 0000000..85c6719
--- /dev/null
+++ b/Trading/src/main/java/com/suneesh/trading/models/responses/ContractForSymbol.java
@@ -0,0 +1,100 @@
+package com.suneesh.trading.models.responses;
+
+import com.google.gson.annotations.SerializedName;
+import io.reactivex.annotations.Nullable;
+
+import java.math.BigDecimal;
+
+/**
+ * @author Morteza Tavanarad
+ * @version 1.0.0
+ * @since 8/1/2017
+ */
+public class ContractForSymbol {
+ /**
+ * Array of available contracts details
+ */
+ @SerializedName("available")
+ private Contract[] available;
+
+ /**
+ * Symbol's next market-close time as an epoch value
+ */
+ @SerializedName("close")
+ @Nullable
+ private Integer close;
+
+ /**
+ * Symbol's next market-open time as an epoch value
+ */
+ @SerializedName("open")
+ @Nullable
+ private Integer open;
+
+ /**
+ * Count of contracts available
+ */
+ @SerializedName("hit_count")
+ private int hitCount;
+
+ /**
+ * Current spot price for this underlying
+ */
+ @SerializedName("spot")
+ @Nullable
+ private BigDecimal spot;
+
+ /**
+ * Indicates the feed license for symbol, for example whether its realtime or delayed
+ */
+ @SerializedName("feed_license")
+ private String feedLicense;
+
+ public Contract[] getAvailable() {
+ return available;
+ }
+
+ public void setAvailable(Contract[] available) {
+ this.available = available;
+ }
+
+ public Integer getClose() {
+ return close;
+ }
+
+ public void setClose(Integer close) {
+ this.close = close;
+ }
+
+ public Integer getOpen() {
+ return open;
+ }
+
+ public void setOpen(Integer open) {
+ this.open = open;
+ }
+
+ public int getHitCount() {
+ return hitCount;
+ }
+
+ public void setHitCount(int hitCount) {
+ this.hitCount = hitCount;
+ }
+
+ public BigDecimal getSpot() {
+ return spot;
+ }
+
+ public void setSpot(BigDecimal spot) {
+ this.spot = spot;
+ }
+
+ public String getFeedLicense() {
+ return feedLicense;
+ }
+
+ public void setFeedLicense(String feedLicense) {
+ this.feedLicense = feedLicense;
+ }
+}
diff --git a/Trading/src/main/java/com/suneesh/trading/models/responses/ContractInfo.java b/Trading/src/main/java/com/suneesh/trading/models/responses/ContractInfo.java
new file mode 100644
index 0000000..920e9be
--- /dev/null
+++ b/Trading/src/main/java/com/suneesh/trading/models/responses/ContractInfo.java
@@ -0,0 +1,45 @@
+package com.suneesh.trading.models.responses;
+
+/**
+ * @author Morteza Tavanarad
+ * @version 1.0.0
+ * @since 7/31/2017
+ */
+public class ContractInfo {
+ private String contractSymbol;
+ private String contractDisplayName;
+ private String minDuration;
+ private String maxDuration;
+
+ public String getContractSymbol() {
+ return contractSymbol;
+ }
+
+ public void setContractSymbol(String contractSymbol) {
+ this.contractSymbol = contractSymbol;
+ }
+
+ public String getContractDisplayName() {
+ return contractDisplayName;
+ }
+
+ public void setContractDisplayName(String contractDisplayName) {
+ this.contractDisplayName = contractDisplayName;
+ }
+
+ public String getMinDuration() {
+ return minDuration;
+ }
+
+ public void setMinDuration(String minDuration) {
+ this.minDuration = minDuration;
+ }
+
+ public String getMaxDuration() {
+ return maxDuration;
+ }
+
+ public void setMaxDuration(String maxDuration) {
+ this.maxDuration = maxDuration;
+ }
+}
diff --git a/Trading/src/main/java/com/suneesh/trading/models/responses/ContractsForSymbolResponse.java b/Trading/src/main/java/com/suneesh/trading/models/responses/ContractsForSymbolResponse.java
new file mode 100644
index 0000000..d446bed
--- /dev/null
+++ b/Trading/src/main/java/com/suneesh/trading/models/responses/ContractsForSymbolResponse.java
@@ -0,0 +1,24 @@
+package com.suneesh.trading.models.responses;
+
+import com.suneesh.trading.models.requests.ContractsForSymbolRequest;
+import com.google.gson.annotations.SerializedName;
+import io.reactivex.annotations.Nullable;
+
+/**
+ * @author Morteza Tavanarad
+ * @version 1.0.0
+ * @since 8/1/2017
+ */
+public class ContractsForSymbolResponse extends ResponseBase {
+
+ @SerializedName("contracts_for")
+ private ContractForSymbol contractsFor;
+
+ public ContractForSymbol getContractsFor() {
+ return contractsFor;
+ }
+
+ public void setContractsFor(ContractForSymbol contractsFor) {
+ this.contractsFor = contractsFor;
+ }
+}
diff --git a/Trading/src/main/java/com/suneesh/trading/models/responses/CreateMaltaAccountResponse.java b/Trading/src/main/java/com/suneesh/trading/models/responses/CreateMaltaAccountResponse.java
new file mode 100644
index 0000000..e36891f
--- /dev/null
+++ b/Trading/src/main/java/com/suneesh/trading/models/responses/CreateMaltaAccountResponse.java
@@ -0,0 +1,21 @@
+package com.suneesh.trading.models.responses;
+
+import com.suneesh.trading.models.requests.CreateMaltaAccountRequest;
+import com.google.gson.annotations.SerializedName;
+
+import java.util.Map;
+
+/**
+ * @author Morteza Tavanarad
+ * @version 1.0.0
+ * @since 9/3/2017
+ */
+public class CreateMaltaAccountResponse extends ResponseBase {
+
+ @SerializedName("new_account_maltainvest")
+ private Map account;
+
+ public Map getAccount() {
+ return account;
+ }
+}
diff --git a/Trading/src/main/java/com/suneesh/trading/models/responses/CreateRealAccountResponse.java b/Trading/src/main/java/com/suneesh/trading/models/responses/CreateRealAccountResponse.java
new file mode 100644
index 0000000..8c6ff57
--- /dev/null
+++ b/Trading/src/main/java/com/suneesh/trading/models/responses/CreateRealAccountResponse.java
@@ -0,0 +1,25 @@
+package com.suneesh.trading.models.responses;
+
+import com.suneesh.trading.models.requests.CreateRealAccountRequest;
+import com.google.gson.annotations.SerializedName;
+
+import java.util.Map;
+
+/**
+ * CreateRealAccountResponse
+ *
+ * Create real account Receive
+ *
+ * @author Morteza Tavanarad
+ * @version 1.0.0
+ * @since 9/3/2017
+ */
+public class CreateRealAccountResponse extends ResponseBase {
+
+ @SerializedName("new_account_real")
+ private Map account;
+
+ public Map getAccount() {
+ return account;
+ }
+}
diff --git a/Trading/src/main/java/com/suneesh/trading/models/responses/CreateRealSubAccountResponse.java b/Trading/src/main/java/com/suneesh/trading/models/responses/CreateRealSubAccountResponse.java
new file mode 100644
index 0000000..b649411
--- /dev/null
+++ b/Trading/src/main/java/com/suneesh/trading/models/responses/CreateRealSubAccountResponse.java
@@ -0,0 +1,28 @@
+package com.suneesh.trading.models.responses;
+
+import com.suneesh.trading.models.requests.CreateRealSubAccountRequest;
+import com.google.gson.annotations.SerializedName;
+
+import java.util.Map;
+
+/**
+ * CreateRealSubAccountResponse
+ *
+ * Create sub account receive
+ *
+ * Response for new sub account call
+ *
+ *
+ * @author Morteza Tavanarad
+ * @version 1.0.0
+ * @since 9/4/2017
+ */
+public class CreateRealSubAccountResponse extends ResponseBase {
+
+ @SerializedName("new_sub_account")
+ private Map account;
+
+ public Map getAccount() {
+ return account;
+ }
+}
diff --git a/Trading/src/main/java/com/suneesh/trading/models/responses/CurrencyConfig.java b/Trading/src/main/java/com/suneesh/trading/models/responses/CurrencyConfig.java
new file mode 100644
index 0000000..10b10fc
--- /dev/null
+++ b/Trading/src/main/java/com/suneesh/trading/models/responses/CurrencyConfig.java
@@ -0,0 +1,25 @@
+package com.suneesh.trading.models.responses;
+
+import com.google.gson.annotations.SerializedName;
+
+/**
+ * @author Morteza Tavanarad
+ * @version 1.0.0
+ * @since 8/3/2017
+ */
+public class CurrencyConfig {
+
+ @SerializedName("fractional_digits")
+ private int fractionalDigits;
+
+ @SerializedName("type")
+ private String type;
+
+ public int getFractionalDigits() {
+ return fractionalDigits;
+ }
+
+ public String getType() {
+ return type;
+ }
+}
diff --git a/Trading/src/main/java/com/suneesh/trading/models/responses/DateStructure.java b/Trading/src/main/java/com/suneesh/trading/models/responses/DateStructure.java
new file mode 100644
index 0000000..fc901e4
--- /dev/null
+++ b/Trading/src/main/java/com/suneesh/trading/models/responses/DateStructure.java
@@ -0,0 +1,32 @@
+package com.suneesh.trading.models.responses;
+
+import com.google.gson.annotations.SerializedName;
+
+/**
+ * @author Morteza Tavanarad
+ * @version 1.0.0
+ * @since 8/1/2017
+ */
+public class DateStructure {
+ @SerializedName("date")
+ private String date;
+
+ @SerializedName("epoch")
+ private String epoch;
+
+ public String getDate() {
+ return date;
+ }
+
+ public void setDate(String date) {
+ this.date = date;
+ }
+
+ public String getEpoch() {
+ return epoch;
+ }
+
+ public void setEpoch(String epoch) {
+ this.epoch = epoch;
+ }
+}
diff --git a/Trading/src/main/java/com/suneesh/trading/models/responses/EmailVerificationResponse.java b/Trading/src/main/java/com/suneesh/trading/models/responses/EmailVerificationResponse.java
new file mode 100644
index 0000000..424f051
--- /dev/null
+++ b/Trading/src/main/java/com/suneesh/trading/models/responses/EmailVerificationResponse.java
@@ -0,0 +1,27 @@
+package com.suneesh.trading.models.responses;
+
+import com.suneesh.trading.models.requests.EmailVerificationRequest;
+import com.google.gson.annotations.SerializedName;
+
+/**
+ * EmailVerificationResponse
+ *
+ * Verify Email Receive
+ * Verify Email Receive
+ *
+ * @author Morteza Tavanarad
+ * @version 1.0.0
+ * @since 8/3/2017
+ */
+public class EmailVerificationResponse extends ResponseBase {
+
+ /**
+ * 1 for success (secure code has been sent to the email address)
+ */
+ @SerializedName("verify_email")
+ private int VerifyEmail;
+
+ public int getVerifyEmail() {
+ return VerifyEmail;
+ }
+}
diff --git a/Trading/src/main/java/com/suneesh/trading/models/responses/Error.java b/Trading/src/main/java/com/suneesh/trading/models/responses/Error.java
new file mode 100644
index 0000000..0ce8950
--- /dev/null
+++ b/Trading/src/main/java/com/suneesh/trading/models/responses/Error.java
@@ -0,0 +1,33 @@
+package com.suneesh.trading.models.responses;
+
+import com.google.gson.annotations.Expose;
+import com.google.gson.annotations.SerializedName;
+
+/**
+ * Created by morteza on 7/28/2017.
+ */
+public class Error {
+ @SerializedName("code")
+ @Expose
+ private String code;
+
+ @SerializedName("message")
+ @Expose
+ private String message;
+
+ public String getCode() {
+ return code;
+ }
+
+ public void setCode(String code) {
+ this.code = code;
+ }
+
+ public String getMessage() {
+ return message;
+ }
+
+ public void setMessage(String message) {
+ this.message = message;
+ }
+}
diff --git a/Trading/src/main/java/com/suneesh/trading/models/responses/FinancialAssessment.java b/Trading/src/main/java/com/suneesh/trading/models/responses/FinancialAssessment.java
new file mode 100644
index 0000000..93d4687
--- /dev/null
+++ b/Trading/src/main/java/com/suneesh/trading/models/responses/FinancialAssessment.java
@@ -0,0 +1,321 @@
+package com.suneesh.trading.models.responses;
+
+import com.google.gson.annotations.SerializedName;
+import io.reactivex.annotations.Nullable;
+
+/**
+ * @author Morteza Tavanarad
+ * @version 1.0.0
+ * @since 8/29/2017
+ */
+public class FinancialAssessment {
+
+ /**
+ * Total score based on client's answer for financial assessment
+ */
+ @SerializedName("score")
+ @Nullable
+ private Integer score;
+
+ /**
+ * The anticipated account turnover
+ */
+ @SerializedName("account_turnover")
+ private String accountTurnover;
+
+ /**
+ * Forex trading frequency
+ */
+ @SerializedName("forex_trading_frequency")
+ private String forexTradingFrequency;
+
+ /**
+ * Forex trading experience
+ */
+ @SerializedName("forex_trading_experience")
+ private String forexTradingExperience;
+
+ /**
+ * Indices trading frequency
+ */
+ @SerializedName("indices_trading_frequency")
+ private String indicesTradingFrequency;
+
+ /**
+ * Indices trading experience
+ */
+ @SerializedName("indices_trading_experience")
+ private String indicesTradingExcperience;
+
+ /**
+ * Commodities trading frequency
+ */
+ @SerializedName("commodities_trading_frequency")
+ private String commoditiesTradingFrequency;
+
+ /**
+ * Commodities trading experience
+ */
+ @SerializedName("commodities_trading_experience")
+ private String commoditiesTradingExperience;
+
+ /**
+ * Stocks trading experience
+ */
+ @SerializedName("stocks_trading_experience")
+ private String stocksTradingExperience;
+
+ /**
+ * Stocks trading frequency
+ */
+ @SerializedName("stocks_trading_frequency")
+ private String stocksTradingFrequency;
+
+ /**
+ * Binary options or other financial derivatives trading frequency
+ */
+ @SerializedName("other_derivatives_trading_frequency")
+ private String otherDerivativesTradingFrequency;
+
+ /**
+ * Binary options or other financial derivatives trading experience
+ */
+ @SerializedName("other_derivatives_trading_experience")
+ private String otherDerivativesTradingExperience;
+
+ /**
+ * Other financial instruments trading frequency
+ */
+ @SerializedName("other_instruments_trading_frequency")
+ private String otherInstrumentsTradingFrequency;
+
+ /**
+ * Other financial instruments trading experience
+ */
+ @SerializedName("other_instruments_trading_experience")
+ private String otherInstrumentsTradingExperience;
+
+ /**
+ * Industry of Employment
+ */
+ @SerializedName("employment_industry")
+ private String employmentIndustry;
+
+ /**
+ * Level of Education
+ */
+ @SerializedName("education_level")
+ private String educationLevel;
+
+ /**
+ * Income Source
+ */
+ @SerializedName("income_source")
+ private String incomeSource;
+
+ /**
+ * Net Annual Income
+ */
+ @SerializedName("net_income")
+ private String netIncome;
+
+ /**
+ * Estimated Net Worth
+ */
+ @SerializedName("estimated_worth")
+ private String estimatedWorth;
+
+ /**
+ * Occupation
+ */
+ @SerializedName("occupation")
+ private String occupation;
+
+ /**
+ * Employment Status
+ */
+ @SerializedName("employment_status")
+ private String employmentStatus;
+
+ /**
+ * Source of wealth
+ */
+ @SerializedName("source_of_wealth")
+ private String sourceOfWealth;
+
+ public Integer getScore() {
+ return score;
+ }
+
+ public void setScore(Integer score) {
+ this.score = score;
+ }
+
+ public String getAccountTurnover() {
+ return accountTurnover;
+ }
+
+ public void setAccountTurnover(String accountTurnover) {
+ this.accountTurnover = accountTurnover;
+ }
+
+ public String getForexTradingFrequency() {
+ return forexTradingFrequency;
+ }
+
+ public void setForexTradingFrequency(String forexTradingFrequency) {
+ this.forexTradingFrequency = forexTradingFrequency;
+ }
+
+ public String getForexTradingExperience() {
+ return forexTradingExperience;
+ }
+
+ public void setForexTradingExperience(String forexTradingExperience) {
+ this.forexTradingExperience = forexTradingExperience;
+ }
+
+ public String getIndicesTradingFrequency() {
+ return indicesTradingFrequency;
+ }
+
+ public void setIndicesTradingFrequency(String indicesTradingFrequency) {
+ this.indicesTradingFrequency = indicesTradingFrequency;
+ }
+
+ public String getIndicesTradingExcperience() {
+ return indicesTradingExcperience;
+ }
+
+ public void setIndicesTradingExcperience(String indicesTradingExcperience) {
+ this.indicesTradingExcperience = indicesTradingExcperience;
+ }
+
+ public String getCommoditiesTradingFrequency() {
+ return commoditiesTradingFrequency;
+ }
+
+ public void setCommoditiesTradingFrequency(String commoditiesTradingFrequency) {
+ this.commoditiesTradingFrequency = commoditiesTradingFrequency;
+ }
+
+ public String getCommoditiesTradingExperience() {
+ return commoditiesTradingExperience;
+ }
+
+ public void setCommoditiesTradingExperience(String commoditiesTradingExperience) {
+ this.commoditiesTradingExperience = commoditiesTradingExperience;
+ }
+
+ public String getStocksTradingExperience() {
+ return stocksTradingExperience;
+ }
+
+ public void setStocksTradingExperience(String stocksTradingExperience) {
+ this.stocksTradingExperience = stocksTradingExperience;
+ }
+
+ public String getStocksTradingFrequency() {
+ return stocksTradingFrequency;
+ }
+
+ public void setStocksTradingFrequency(String stocksTradingFrequency) {
+ this.stocksTradingFrequency = stocksTradingFrequency;
+ }
+
+ public String getOtherDerivativesTradingFrequency() {
+ return otherDerivativesTradingFrequency;
+ }
+
+ public void setOtherDerivativesTradingFrequency(String otherDerivativesTradingFrequency) {
+ this.otherDerivativesTradingFrequency = otherDerivativesTradingFrequency;
+ }
+
+ public String getOtherDerivativesTradingExperience() {
+ return otherDerivativesTradingExperience;
+ }
+
+ public void setOtherDerivativesTradingExperience(String otherDerivativesTradingExperience) {
+ this.otherDerivativesTradingExperience = otherDerivativesTradingExperience;
+ }
+
+ public String getOtherInstrumentsTradingFrequency() {
+ return otherInstrumentsTradingFrequency;
+ }
+
+ public void setOtherInstrumentsTradingFrequency(String otherInstrumentsTradingFrequency) {
+ this.otherInstrumentsTradingFrequency = otherInstrumentsTradingFrequency;
+ }
+
+ public String getOtherInstrumentsTradingExperience() {
+ return otherInstrumentsTradingExperience;
+ }
+
+ public void setOtherInstrumentsTradingExperience(String otherInstrumentsTradingExperience) {
+ this.otherInstrumentsTradingExperience = otherInstrumentsTradingExperience;
+ }
+
+ public String getEmploymentIndustry() {
+ return employmentIndustry;
+ }
+
+ public void setEmploymentIndustry(String employmentIndustry) {
+ this.employmentIndustry = employmentIndustry;
+ }
+
+ public String getEducationLevel() {
+ return educationLevel;
+ }
+
+ public void setEducationLevel(String educationLevel) {
+ this.educationLevel = educationLevel;
+ }
+
+ public String getIncomeSource() {
+ return incomeSource;
+ }
+
+ public void setIncomeSource(String incomeSource) {
+ this.incomeSource = incomeSource;
+ }
+
+ public String getNetIncome() {
+ return netIncome;
+ }
+
+ public void setNetIncome(String netIncome) {
+ this.netIncome = netIncome;
+ }
+
+ public String getEstimatedWorth() {
+ return estimatedWorth;
+ }
+
+ public void setEstimatedWorth(String estimatedWorth) {
+ this.estimatedWorth = estimatedWorth;
+ }
+
+ public String getOccupation() {
+ return occupation;
+ }
+
+ public void setOccupation(String occupation) {
+ this.occupation = occupation;
+ }
+
+ public String getEmploymentStatus() {
+ return employmentStatus;
+ }
+
+ public void setEmploymentStatus(String employmentStatus) {
+ this.employmentStatus = employmentStatus;
+ }
+
+ public String getSourceOfWealth() {
+ return sourceOfWealth;
+ }
+
+ public void setSourceOfWealth(String sourceOfWealth) {
+ this.sourceOfWealth = sourceOfWealth;
+ }
+}
diff --git a/Trading/src/main/java/com/suneesh/trading/models/responses/ForgetResponse.java b/Trading/src/main/java/com/suneesh/trading/models/responses/ForgetResponse.java
new file mode 100644
index 0000000..e47786c
--- /dev/null
+++ b/Trading/src/main/java/com/suneesh/trading/models/responses/ForgetResponse.java
@@ -0,0 +1,22 @@
+package com.suneesh.trading.models.responses;
+
+import com.suneesh.trading.models.requests.ForgetRequest;
+import com.google.gson.annotations.SerializedName;
+
+/**
+ * @author Morteza Tavanarad
+ * @version 1.0.0
+ * @since 8/1/2017
+ */
+public class ForgetResponse extends ResponseBase {
+ @SerializedName("forget")
+ private int forget;
+
+ public int getForget() {
+ return forget;
+ }
+
+ public void setForget(int forget) {
+ this.forget = forget;
+ }
+}
diff --git a/Trading/src/main/java/com/suneesh/trading/models/responses/ForwardStartingOption.java b/Trading/src/main/java/com/suneesh/trading/models/responses/ForwardStartingOption.java
new file mode 100644
index 0000000..ad660d0
--- /dev/null
+++ b/Trading/src/main/java/com/suneesh/trading/models/responses/ForwardStartingOption.java
@@ -0,0 +1,45 @@
+package com.suneesh.trading.models.responses;
+
+import com.google.gson.annotations.SerializedName;
+
+import java.math.BigDecimal;
+
+/**
+ * @author Morteza Tavanarad
+ * @version 1.0.0
+ * @since 8/1/2017
+ */
+public class ForwardStartingOption {
+ @SerializedName("close")
+ private int close;
+
+ @SerializedName("date")
+ private int date;
+
+ @SerializedName("open")
+ private int open;
+
+ public int getClose() {
+ return close;
+ }
+
+ public void setClose(int close) {
+ this.close = close;
+ }
+
+ public int getDate() {
+ return date;
+ }
+
+ public void setDate(int date) {
+ this.date = date;
+ }
+
+ public int getOpen() {
+ return open;
+ }
+
+ public void setOpen(int open) {
+ this.open = open;
+ }
+}
diff --git a/Trading/src/main/java/com/suneesh/trading/models/responses/GetFinancialAssessmentResponse.java b/Trading/src/main/java/com/suneesh/trading/models/responses/GetFinancialAssessmentResponse.java
new file mode 100644
index 0000000..af7430b
--- /dev/null
+++ b/Trading/src/main/java/com/suneesh/trading/models/responses/GetFinancialAssessmentResponse.java
@@ -0,0 +1,31 @@
+package com.suneesh.trading.models.responses;
+
+import com.suneesh.trading.models.requests.GetFinancialAssessmentRequest;
+import com.google.gson.annotations.SerializedName;
+import io.reactivex.annotations.Nullable;
+
+/**
+ * GetFinancialAssessmentResponse
+ *
+ * Get financial assessment details
+ *
+ * This call gets the financial assessment details of client's account.
+ *
+ *
+ * @author Morteza Tavanarad
+ * @version 1.0.0
+ * @since 8/29/2017
+ */
+public class GetFinancialAssessmentResponse extends ResponseBase {
+
+ /**
+ * Client's financial asessment details
+ */
+ @SerializedName("get_financial_assessment")
+ @Nullable
+ private FinancialAssessment financialAssessment;
+
+ public FinancialAssessment getFinancialAssessment() {
+ return financialAssessment;
+ }
+}
diff --git a/Trading/src/main/java/com/suneesh/trading/models/responses/GetSelfExclusionResponse.java b/Trading/src/main/java/com/suneesh/trading/models/responses/GetSelfExclusionResponse.java
new file mode 100644
index 0000000..59eef8e
--- /dev/null
+++ b/Trading/src/main/java/com/suneesh/trading/models/responses/GetSelfExclusionResponse.java
@@ -0,0 +1,29 @@
+package com.suneesh.trading.models.responses;
+
+import com.suneesh.trading.models.requests.GetSelfExclusionRequest;
+import com.google.gson.annotations.SerializedName;
+
+/**
+ * GetSelfExclusionResponse
+ *
+ * Get User Self-Exclusion Receive
+ *
+ * A message with User Self-Exclusion
+ *
+ *
+ * @author Morteza Tavanarad
+ * @version 1.0.0
+ * @since 8/4/2017
+ */
+public class GetSelfExclusionResponse extends ResponseBase {
+
+ /**
+ * Echo of the request made
+ */
+ @SerializedName("get_self_exclusion")
+ private SelfExclusion selfExclusion;
+
+ public SelfExclusion getSelfExclusion() {
+ return selfExclusion;
+ }
+}
diff --git a/Trading/src/main/java/com/suneesh/trading/models/responses/History.java b/Trading/src/main/java/com/suneesh/trading/models/responses/History.java
new file mode 100644
index 0000000..4b58edf
--- /dev/null
+++ b/Trading/src/main/java/com/suneesh/trading/models/responses/History.java
@@ -0,0 +1,28 @@
+package com.suneesh.trading.models.responses;
+
+import com.google.gson.annotations.SerializedName;
+
+import java.math.BigDecimal;
+import java.util.List;
+
+/**
+ * @author Morteza Tavanarad
+ * @version 1.0.0
+ * @since 8/3/2017
+ */
+public class History {
+
+ @SerializedName("times")
+ private List times;
+
+ @SerializedName("prices")
+ private List prices;
+
+ public List getTimes() {
+ return times;
+ }
+
+ public List getPrices() {
+ return prices;
+ }
+}
diff --git a/Trading/src/main/java/com/suneesh/trading/models/responses/JPAccountStatus.java b/Trading/src/main/java/com/suneesh/trading/models/responses/JPAccountStatus.java
new file mode 100644
index 0000000..eaec805
--- /dev/null
+++ b/Trading/src/main/java/com/suneesh/trading/models/responses/JPAccountStatus.java
@@ -0,0 +1,60 @@
+package com.suneesh.trading.models.responses;
+
+import com.suneesh.trading.models.enums.JPStatus;
+import com.google.gson.annotations.SerializedName;
+import io.reactivex.annotations.Nullable;
+
+/**
+ * JPAccountStatus
+ *
+ * @author Morteza Tavanarad
+ * @version 1.0.0
+ * @since 8/4/2017
+ */
+public class JPAccountStatus {
+
+ /**
+ * Status of Japan real money account opening, any of the above.
+ */
+ @SerializedName("status")
+ private String status;
+
+ /**
+ * Optional field. When status equals 'jp_knowledge_test_fail', this shows last knowledge test taken time in epoch.
+ */
+ @SerializedName("last_test_epoch")
+ @Nullable
+ private Integer lastTestEpoch;
+
+ /**
+ * Optional field. When status equals 'jp_knowledge_test_pending' or 'jp_knowledge_test_fail',
+ * this shows next available knowledge test time in epoch.
+ */
+ @SerializedName("next_test_epoch")
+ @Nullable
+ private Integer nextTextEpoch;
+
+ public String getStatus() {
+ return status;
+ }
+
+ public void setStatus(JPStatus status) {
+ this.status = status.toString();
+ }
+
+ public Integer getLastTestEpoch() {
+ return lastTestEpoch;
+ }
+
+ public void setLastTestEpoch(Integer lastTestEpoch) {
+ this.lastTestEpoch = lastTestEpoch;
+ }
+
+ public Integer getNextTextEpoch() {
+ return nextTextEpoch;
+ }
+
+ public void setNextTextEpoch(Integer nextTextEpoch) {
+ this.nextTextEpoch = nextTextEpoch;
+ }
+}
diff --git a/Trading/src/main/java/com/suneesh/trading/models/responses/JPSettings.java b/Trading/src/main/java/com/suneesh/trading/models/responses/JPSettings.java
new file mode 100644
index 0000000..21600b3
--- /dev/null
+++ b/Trading/src/main/java/com/suneesh/trading/models/responses/JPSettings.java
@@ -0,0 +1,232 @@
+package com.suneesh.trading.models.responses;
+
+import com.suneesh.trading.models.enums.*;
+import com.google.gson.annotations.SerializedName;
+import com.suneesh.trading.models.enums.*;
+import io.reactivex.annotations.Nullable;
+
+import java.math.BigDecimal;
+
+/**
+ * JPSettings
+ *
+ * @author Morteza Tavanarad
+ * @version 1.0.0
+ * @since 8/4/2017
+ */
+public class JPSettings {
+
+ /**
+ * Male (m) or female (f) (note: only set for Japan real-money accounts)
+ */
+ @SerializedName("gender")
+ private String gender;
+
+ /**
+ * Occupation (note: only set for Japan real-money accounts)
+ */
+ @SerializedName("occupation")
+ private String occupation;
+
+ /**
+ * Annual income (note: only set for Japan real-money accounts)
+ */
+ @SerializedName("annual_income")
+ private String annualIncome;
+
+ /**
+ * Financial asset (note: only set for Japan real-money accounts)
+ */
+ @SerializedName("financial_asset")
+ private String financialAsset;
+
+ /**
+ * Daily limit on losses in JPY (note: only set for Japan real-money accounts)
+ */
+ @SerializedName("daily_loss_limit")
+ private BigDecimal daily_loss_limit;
+
+ /**
+ * Equities trading experience (note: only set for Japan real-money accounts)
+ */
+ @SerializedName("trading_experience_equities")
+ private String tradingExperienceEquities;
+
+ /**
+ * Commodities trading experience (note: only set for Japan real-money accounts)
+ */
+ @SerializedName("trading_experience_commodities")
+ private String tradingExperienceCommodities;
+
+ /**
+ * Foreign currency deposit trading experience (note: only set for Japan real-money accounts)
+ */
+ @SerializedName("trading_experience_foreign_currency_deposit")
+ private String tradingExperienceForeignCurrencyDeposit;
+
+ /**
+ * Margin FX trading experience (note: only set for Japan real-money accounts)
+ */
+ @SerializedName("trading_experience_margin_fx")
+ private String tradingExperienceMarginFX;
+
+ /**
+ * Investment trust trading experience (note: only set for Japan real-money accounts)
+ */
+ @SerializedName("trading_experience_investment_trust")
+ private String tradingExperienceInvestmentTrust;
+
+ /**
+ * Public and corporation bond trading experience (note: only set for Japan real-money accounts)
+ */
+ @SerializedName("trading_experience_public_bond")
+ private String tradingExperiencePublicBond;
+
+ /**
+ * OTC Derivative (Option) trading experience (note: only set for Japan real-money accounts)
+ */
+ @SerializedName("trading_experience_option_trading")
+ private String tradingExperienceOptionTrading;
+
+ /**
+ * Trading purpose (note: only set for Japan real-money accounts)
+ */
+ @SerializedName("trading_purpose")
+ private String tradingPurpose;
+
+ /**
+ * Classification of assets requiring hedge
+ * (note: only set for Japan real-money accounts, if 'Hedging' is selected for 'Trading purpose')
+ */
+ @SerializedName("hedge_asset")
+ @Nullable
+ private String hedgeAsset;
+
+ /**
+ * Hedge asset amount in JPY
+ * (note: only set for Japan real-money accounts, if 'Hedging' is selected for 'Trading purpose')
+ */
+ @SerializedName("hedge_asset_amount")
+ @Nullable
+ private BigDecimal hedgeAssetAmount;
+
+ public String getGender() {
+ return gender;
+ }
+
+ public void setGender(Gender gender) {
+ this.gender = gender.toString();
+ }
+
+ public String getOccupation() {
+ return occupation;
+ }
+
+ public void setOccupation(JPOccupations occupation) {
+ this.occupation = occupation.toString();
+ }
+
+ public String getAnnualIncome() {
+ return annualIncome;
+ }
+
+ public void setAnnualIncome(JPAnnualIncomes annualIncome) {
+ this.annualIncome = annualIncome.toString();
+ }
+
+ public String getFinancialAsset() {
+ return financialAsset;
+ }
+
+ public void setFinancialAsset(JPAnnualIncomes financialAsset) {
+ this.financialAsset = financialAsset.toString();
+ }
+
+ public BigDecimal getDaily_loss_limit() {
+ return daily_loss_limit;
+ }
+
+ public void setDaily_loss_limit(BigDecimal daily_loss_limit) {
+ this.daily_loss_limit = daily_loss_limit;
+ }
+
+ public String getTradingExperienceEquities() {
+ return tradingExperienceEquities;
+ }
+
+ public void setTradingExperienceEquities(JPTradingExperiences tradingExperienceEquities) {
+ this.tradingExperienceEquities = tradingExperienceEquities.toString();
+ }
+
+ public String getTradingExperienceCommodities() {
+ return tradingExperienceCommodities;
+ }
+
+ public void setTradingExperienceCommodities(JPTradingExperiences tradingExperienceCommodities) {
+ this.tradingExperienceCommodities = tradingExperienceCommodities.toString();
+ }
+
+ public String getTradingExperienceForeignCurrencyDeposit() {
+ return tradingExperienceForeignCurrencyDeposit;
+ }
+
+ public void setTradingExperienceForeignCurrencyDeposit(JPTradingExperiences tradingExperienceForeignCurrencyDeposit) {
+ this.tradingExperienceForeignCurrencyDeposit = tradingExperienceForeignCurrencyDeposit.toString();
+ }
+
+ public String getTradingExperienceMarginFX() {
+ return tradingExperienceMarginFX;
+ }
+
+ public void setTradingExperienceMarginFX(JPTradingExperiences tradingExperienceMarginFX) {
+ this.tradingExperienceMarginFX = tradingExperienceMarginFX.toString();
+ }
+
+ public String getTradingExperienceInvestmentTrust() {
+ return tradingExperienceInvestmentTrust;
+ }
+
+ public void setTradingExperienceInvestmentTrust(JPTradingExperiences tradingExperienceInvestmentTrust) {
+ this.tradingExperienceInvestmentTrust = tradingExperienceInvestmentTrust.toString();
+ }
+
+ public String getTradingExperiencePublicBond() {
+ return tradingExperiencePublicBond;
+ }
+
+ public void setTradingExperiencePublicBond(JPTradingExperiences tradingExperiencePublicBond) {
+ this.tradingExperiencePublicBond = tradingExperiencePublicBond.toString();
+ }
+
+ public String getTradingExperienceOptionTrading() {
+ return tradingExperienceOptionTrading;
+ }
+
+ public void setTradingExperienceOptionTrading(JPTradingExperiences tradingExperienceOptionTrading) {
+ this.tradingExperienceOptionTrading = tradingExperienceOptionTrading.toString();
+ }
+
+ public String getTradingPurpose() {
+ return tradingPurpose;
+ }
+
+ public void setTradingPurpose(JPTradingPurposes tradingPurpose) {
+ this.tradingPurpose = tradingPurpose.toString();
+ }
+
+ public String getHedgeAsset() {
+ return hedgeAsset;
+ }
+
+ public void setHedgeAsset(String hedgeAsset) {
+ this.hedgeAsset = hedgeAsset;
+ }
+
+ public BigDecimal getHedgeAssetAmount() {
+ return hedgeAssetAmount;
+ }
+
+ public void setHedgeAssetAmount(BigDecimal hedgeAssetAmount) {
+ this.hedgeAssetAmount = hedgeAssetAmount;
+ }
+}
diff --git a/Trading/src/main/java/com/suneesh/trading/models/responses/JapanKnowledgeTestResponse.java b/Trading/src/main/java/com/suneesh/trading/models/responses/JapanKnowledgeTestResponse.java
new file mode 100644
index 0000000..c63fb87
--- /dev/null
+++ b/Trading/src/main/java/com/suneesh/trading/models/responses/JapanKnowledgeTestResponse.java
@@ -0,0 +1,21 @@
+package com.suneesh.trading.models.responses;
+
+import com.suneesh.trading.models.requests.JapanKnowledgeTestRequest;
+import com.google.gson.annotations.SerializedName;
+
+import java.util.Map;
+
+/**
+ * @author Morteza Tavanarad
+ * @version 1.0.0
+ * @since 8/30/2017
+ */
+public class JapanKnowledgeTestResponse extends ResponseBase {
+
+ @SerializedName("jp_knowledge_test")
+ private Map japanKnowledgeTest;
+
+ public Map getJapanKnowledgeTest() {
+ return japanKnowledgeTest;
+ }
+}
diff --git a/Trading/src/main/java/com/suneesh/trading/models/responses/LandingCompany.java b/Trading/src/main/java/com/suneesh/trading/models/responses/LandingCompany.java
new file mode 100644
index 0000000..6f34cd9
--- /dev/null
+++ b/Trading/src/main/java/com/suneesh/trading/models/responses/LandingCompany.java
@@ -0,0 +1,105 @@
+package com.suneesh.trading.models.responses;
+
+import com.google.gson.annotations.SerializedName;
+import io.reactivex.annotations.Nullable;
+
+/**
+ * Landing Company
+ *
+ * Landing Company Receive
+ * Returns the Landing Company for clients of a given country.
+ *
+ * @author Morteza Tavanarad
+ * @version 1.0.0
+ * @since 8/1/2017
+ */
+public class LandingCompany {
+
+ /**
+ * Country code
+ */
+ @SerializedName("id")
+ private String id;
+
+ /**
+ * Country name
+ */
+ @SerializedName("name")
+ private String name;
+
+ /**
+ * Landing Company for gaming contracts (Volatility Indices)
+ */
+ @SerializedName("gaming_company")
+ @Nullable
+ private Company gamingCompany;
+
+ /**
+ * Landing Company for financial contracts (all except Volatility Indices)
+ */
+ @SerializedName("financial_company")
+ @Nullable
+ private Company financialCompany;
+
+ /**
+ * Landing Company for MT5 gaming contracts (Volatility Indices)
+ */
+ @SerializedName("mt_gaming_company")
+ @Nullable
+ private Company mtGamingCompany;
+
+ /**
+ * Landing Company for MT5 financial contracts (all except Volatility Indices)
+ */
+ @SerializedName("mt_financial_company")
+ @Nullable
+ private Company mtFinancialCompany;
+
+ public String getId() {
+ return id;
+ }
+
+ public void setId(String id) {
+ this.id = id;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public Company getGamingCompany() {
+ return gamingCompany;
+ }
+
+ public void setGamingCompany(Company gamingCompany) {
+ this.gamingCompany = gamingCompany;
+ }
+
+ public Company getFinancialCompany() {
+ return financialCompany;
+ }
+
+ public void setFinancialCompany(Company financialCompany) {
+ this.financialCompany = financialCompany;
+ }
+
+ public Company getMtGamingCompany() {
+ return mtGamingCompany;
+ }
+
+ public void setMtGamingCompany(Company mtGamingCompany) {
+ this.mtGamingCompany = mtGamingCompany;
+ }
+
+ public Company getMtFinancialCompany() {
+ return mtFinancialCompany;
+ }
+
+ public void setMtFinancialCompany(Company mtFinancialCompany) {
+ this.mtFinancialCompany = mtFinancialCompany;
+ }
+}
diff --git a/Trading/src/main/java/com/suneesh/trading/models/responses/LandingCompanyDetails.java b/Trading/src/main/java/com/suneesh/trading/models/responses/LandingCompanyDetails.java
new file mode 100644
index 0000000..ecd8c7b
--- /dev/null
+++ b/Trading/src/main/java/com/suneesh/trading/models/responses/LandingCompanyDetails.java
@@ -0,0 +1,101 @@
+package com.suneesh.trading.models.responses;
+
+import com.google.gson.annotations.SerializedName;
+import io.reactivex.annotations.Nullable;
+
+/**
+ * @author Morteza Tavanarad
+ * @version 1.0.0
+ * @since 8/2/2017
+ */
+public class LandingCompanyDetails {
+
+ /**
+ * Landing Company shortcode
+ */
+ @SerializedName("shortcode")
+ private String shortCode;
+
+ /**
+ * Landing Company name
+ */
+ @SerializedName("name")
+ private String name;
+
+ /**
+ * Landing Company address
+ */
+ @SerializedName("address")
+ @Nullable
+ private String[] address;
+
+ /**
+ * Landing Company country
+ */
+ @SerializedName("country")
+ private String county;
+
+ /**
+ * Default currency of client accounts with this Landing Company
+ */
+ @SerializedName("legal_default_currency")
+ private String legalDefaultCurrency;
+
+ /**
+ * Allowable currencies for accounts with this Landing Company
+ */
+ @SerializedName("legal_allowed_currencies")
+ private String[] legalAllowedCurrencies;
+
+ @SerializedName("legal_allowed_markets")
+ private String[] legalAllowedMarkets;
+
+ @SerializedName("legal_allowed_contract_categories")
+ private String[] legalAllowedContractCategories;
+
+ /**
+ * Flag to indicate whether reality check is applicable for this Landing Company.
+ * 1: applicable, 0: not applicable.
+ * The Reality Check is a feature that gives a summary of the client's trades
+ * and account balances on a regular basis throughout his session,
+ * and is a regulatory requirement for certain Landing Companies.
+ */
+ @SerializedName("has_reality_check")
+ private int hasRealityCheck;
+
+ public String getShortCode() {
+ return shortCode;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public String[] getAddress() {
+ return address;
+ }
+
+ public String getCounty() {
+ return county;
+ }
+
+ public String getLegalDefaultCurrency() {
+ return legalDefaultCurrency;
+ }
+
+ public String[] getLegalAllowedCurrencies() {
+ return legalAllowedCurrencies;
+ }
+
+ public String[] getLegalAllowedMarkets() {
+ return legalAllowedMarkets;
+ }
+
+ public String[] getLegalAllowedContractCategories() {
+ return legalAllowedContractCategories;
+ }
+
+ public int getHasRealityCheck() {
+ return hasRealityCheck;
+ }
+}
diff --git a/Trading/src/main/java/com/suneesh/trading/models/responses/LandingCompanyDetailsResponse.java b/Trading/src/main/java/com/suneesh/trading/models/responses/LandingCompanyDetailsResponse.java
new file mode 100644
index 0000000..4398a26
--- /dev/null
+++ b/Trading/src/main/java/com/suneesh/trading/models/responses/LandingCompanyDetailsResponse.java
@@ -0,0 +1,26 @@
+package com.suneesh.trading.models.responses;
+
+import com.suneesh.trading.models.requests.LandingCompanyDetailsRequest;
+import com.google.gson.annotations.SerializedName;
+
+/**
+ * LandingCompanyDetailsResponse
+ *
+ * Landing Company Receive
+ * A message with Landing Company
+ *
+ * @author Morteza Tavanarad
+ * @version 1.0.0
+ * @since 8/2/2017
+ */
+public class LandingCompanyDetailsResponse extends ResponseBase {
+ /**
+ * Landing Company Details
+ */
+ @SerializedName("landing_company_details")
+ private LandingCompanyDetails landingCompanyDetails;
+
+ public LandingCompanyDetails getLandingCompanyDetails() {
+ return landingCompanyDetails;
+ }
+}
diff --git a/Trading/src/main/java/com/suneesh/trading/models/responses/LandingCompanyResponse.java b/Trading/src/main/java/com/suneesh/trading/models/responses/LandingCompanyResponse.java
new file mode 100644
index 0000000..6af22e5
--- /dev/null
+++ b/Trading/src/main/java/com/suneesh/trading/models/responses/LandingCompanyResponse.java
@@ -0,0 +1,23 @@
+package com.suneesh.trading.models.responses;
+
+import com.suneesh.trading.models.requests.LandingCompanyRequest;
+import com.google.gson.annotations.SerializedName;
+
+/**
+ * @author Morteza Tavanarad
+ * @version 1.0.0
+ * @since 8/1/2017
+ */
+public class LandingCompanyResponse extends ResponseBase {
+
+ @SerializedName("landing_company")
+ private LandingCompany landingCompany;
+
+ public LandingCompany getLandingCompany() {
+ return landingCompany;
+ }
+
+ public void setLandingCompany(LandingCompany landingCompany) {
+ this.landingCompany = landingCompany;
+ }
+}
diff --git a/Trading/src/main/java/com/suneesh/trading/models/responses/LoginHistory.java b/Trading/src/main/java/com/suneesh/trading/models/responses/LoginHistory.java
new file mode 100644
index 0000000..eadec66
--- /dev/null
+++ b/Trading/src/main/java/com/suneesh/trading/models/responses/LoginHistory.java
@@ -0,0 +1,51 @@
+package com.suneesh.trading.models.responses;
+
+import com.google.gson.annotations.SerializedName;
+
+/**
+ * @author Morteza Tavanarad
+ * @version 1.0.0
+ * @since 8/7/2017
+ */
+public class LoginHistory {
+
+ /**
+ * Epoch time of the activity
+ */
+ @SerializedName("time")
+ private int time;
+
+ /**
+ * Type of action. Example: login, logout
+ */
+ @SerializedName("action")
+ private String action;
+
+ /**
+ * Provides details about browser, device used during login or logout
+ */
+ @SerializedName("environment")
+ private String evironment;
+
+ /**
+ * Status of activity: 1 - success, 0 - failure
+ */
+ @SerializedName("status")
+ private int status;
+
+ public int getTime() {
+ return time;
+ }
+
+ public String getAction() {
+ return action;
+ }
+
+ public String getEvironment() {
+ return evironment;
+ }
+
+ public boolean getStatus() {
+ return status == 1 ? true : false;
+ }
+}
diff --git a/Trading/src/main/java/com/suneesh/trading/models/responses/LoginHistoryResponse.java b/Trading/src/main/java/com/suneesh/trading/models/responses/LoginHistoryResponse.java
new file mode 100644
index 0000000..4a16ab3
--- /dev/null
+++ b/Trading/src/main/java/com/suneesh/trading/models/responses/LoginHistoryResponse.java
@@ -0,0 +1,31 @@
+package com.suneesh.trading.models.responses;
+
+import com.suneesh.trading.models.requests.LoginHistoryRequest;
+import com.google.gson.annotations.SerializedName;
+
+import java.util.List;
+
+/**
+ * LoginHistoryResponse
+ *
+ * Login History Response
+ *
+ * Recent login/logout history records
+ *
+ *
+ * @author Morteza Tavanarad
+ * @version 1.0.0
+ * @since 8/7/2017
+ */
+public class LoginHistoryResponse extends ResponseBase {
+
+ /**
+ * Array of records of client login/logout activities
+ */
+ @SerializedName("login_history")
+ private List loginHistories;
+
+ public List getLoginHistories() {
+ return loginHistories;
+ }
+}
diff --git a/Trading/src/main/java/com/suneesh/trading/models/responses/LogoutResponse.java b/Trading/src/main/java/com/suneesh/trading/models/responses/LogoutResponse.java
new file mode 100644
index 0000000..5adb0ee
--- /dev/null
+++ b/Trading/src/main/java/com/suneesh/trading/models/responses/LogoutResponse.java
@@ -0,0 +1,23 @@
+package com.suneesh.trading.models.responses;
+
+import com.suneesh.trading.models.requests.LogoutRequest;
+import com.google.gson.annotations.SerializedName;
+
+/**
+ * LogouResponse
+ *
+ * Logout Response
+ *
+ * @author Morteza Tavanarad
+ * @version 1.0.0
+ * @since 8/7/2017
+ */
+public class LogoutResponse extends ResponseBase {
+
+ @SerializedName("logout")
+ private int logout;
+
+ public boolean getLogout() {
+ return logout == 1 ? true : false;
+ }
+}
diff --git a/Trading/src/main/java/com/suneesh/trading/models/responses/Market.java b/Trading/src/main/java/com/suneesh/trading/models/responses/Market.java
new file mode 100644
index 0000000..557367a
--- /dev/null
+++ b/Trading/src/main/java/com/suneesh/trading/models/responses/Market.java
@@ -0,0 +1,27 @@
+package com.suneesh.trading.models.responses;
+
+import com.google.gson.annotations.SerializedName;
+
+import java.util.List;
+
+/**
+ * @author Morteza Tavanarad
+ * @version 1.0.0
+ * @since 8/3/2017
+ */
+public class Market {
+
+ @SerializedName("name")
+ private String name;
+
+ @SerializedName("submarkets")
+ private List subMarkets;
+
+ public String getName() {
+ return name;
+ }
+
+ public List getSubMarkets() {
+ return subMarkets;
+ }
+}
diff --git a/Trading/src/main/java/com/suneesh/trading/models/responses/MarketSpecific.java b/Trading/src/main/java/com/suneesh/trading/models/responses/MarketSpecific.java
new file mode 100644
index 0000000..082eab8
--- /dev/null
+++ b/Trading/src/main/java/com/suneesh/trading/models/responses/MarketSpecific.java
@@ -0,0 +1,41 @@
+package com.suneesh.trading.models.responses;
+
+import com.google.gson.annotations.SerializedName;
+
+import java.math.BigDecimal;
+
+/**
+ * @author Morteza Tavanarad
+ * @version 1.0.0
+ * @since 8/4/2017
+ */
+public class MarketSpecific {
+
+ @SerializedName("name")
+ private String name;
+
+ @SerializedName("turnover_limit")
+ private BigDecimal turnoverLimit;
+
+ @SerializedName("payout_limit")
+ private BigDecimal payoutLimit;
+
+ @SerializedName("profile_name")
+ private String profileName;
+
+ public String getName() {
+ return name;
+ }
+
+ public BigDecimal getTurnoverLimit() {
+ return turnoverLimit;
+ }
+
+ public BigDecimal getPayoutLimit() {
+ return payoutLimit;
+ }
+
+ public String getProfileName() {
+ return profileName;
+ }
+}
diff --git a/Trading/src/main/java/com/suneesh/trading/models/responses/MassSellReceipt.java b/Trading/src/main/java/com/suneesh/trading/models/responses/MassSellReceipt.java
new file mode 100644
index 0000000..7bd18e1
--- /dev/null
+++ b/Trading/src/main/java/com/suneesh/trading/models/responses/MassSellReceipt.java
@@ -0,0 +1,62 @@
+package com.suneesh.trading.models.responses;
+
+import com.google.gson.annotations.SerializedName;
+
+import java.math.BigDecimal;
+
+/**
+ * @author Morteza Tavanarad
+ * @version 1.0.0
+ * @since 8/9/2017
+ */
+public class MassSellReceipt {
+
+ @SerializedName("balance_after")
+ private BigDecimal balanceAfter;
+
+ @SerializedName("contract_id")
+ private Long contractId;
+
+ @SerializedName("reference_id")
+ private Long referenceId;
+
+ @SerializedName("sell_price")
+ private BigDecimal sellPrice;
+
+ @SerializedName("sell_time")
+ private String sellTime;
+
+ @SerializedName("transaction_id")
+ private Long transactionId;
+
+ @SerializedName("token")
+ private String token;
+
+ public BigDecimal getBalanceAfter() {
+ return balanceAfter;
+ }
+
+ public Long getContractId() {
+ return contractId;
+ }
+
+ public Long getReferenceId() {
+ return referenceId;
+ }
+
+ public BigDecimal getSellPrice() {
+ return sellPrice;
+ }
+
+ public String getSellTime() {
+ return sellTime;
+ }
+
+ public Long getTransactionId() {
+ return transactionId;
+ }
+
+ public String getToken() {
+ return token;
+ }
+}
diff --git a/Trading/src/main/java/com/suneesh/trading/models/responses/NewAccountVirtual.java b/Trading/src/main/java/com/suneesh/trading/models/responses/NewAccountVirtual.java
new file mode 100644
index 0000000..7370382
--- /dev/null
+++ b/Trading/src/main/java/com/suneesh/trading/models/responses/NewAccountVirtual.java
@@ -0,0 +1,62 @@
+package com.suneesh.trading.models.responses;
+
+import com.google.gson.annotations.SerializedName;
+
+import java.math.BigDecimal;
+
+/**
+ * @author Morteza Tavanarad
+ * @version 1.0.0
+ * @since 8/2/2017
+ */
+public class NewAccountVirtual {
+ /**
+ * Client id of the new virtual-money account
+ */
+ @SerializedName("client_id")
+ private String clientId;
+
+ /**
+ * Email of the new virtual-money account
+ */
+ @SerializedName("email")
+ private String email;
+
+ /**
+ * Account currency
+ */
+ @SerializedName("currency")
+ private String currency;
+
+ /**
+ * Account balance
+ */
+ @SerializedName("balance")
+ private BigDecimal balance;
+
+ /**
+ * Oauth token for the client's login session (so that the user may be logged in immediately)
+ */
+ @SerializedName("oauth_token")
+ private String oauthToken;
+
+ public String getClientId() {
+ return clientId;
+ }
+
+ public String getEmail() {
+ return email;
+ }
+
+ public String getCurrency() {
+ return currency;
+ }
+
+ public BigDecimal getBalance() {
+ return balance;
+ }
+
+ public String getOauthToken() {
+ return oauthToken;
+ }
+}
diff --git a/Trading/src/main/java/com/suneesh/trading/models/responses/NewVirtualAccountResponse.java b/Trading/src/main/java/com/suneesh/trading/models/responses/NewVirtualAccountResponse.java
new file mode 100644
index 0000000..e03844d
--- /dev/null
+++ b/Trading/src/main/java/com/suneesh/trading/models/responses/NewVirtualAccountResponse.java
@@ -0,0 +1,27 @@
+package com.suneesh.trading.models.responses;
+
+import com.suneesh.trading.models.requests.NewVirtualAccountRequest;
+import com.google.gson.annotations.SerializedName;
+
+/**
+ * NewVirtualAccountResponse
+ *
+ * Create virtual account Receive
+ * Create virtual-money account
+ *
+ * @author Morteza Tavanarad
+ * @version 1.0.0
+ * @since 8/2/2017
+ */
+public class NewVirtualAccountResponse extends ResponseBase {
+
+ /**
+ * New virtual-money account details
+ */
+ @SerializedName("new_account_virtual")
+ private NewAccountVirtual accountDetails;
+
+ public NewAccountVirtual getAccountDetails() {
+ return accountDetails;
+ }
+}
diff --git a/Trading/src/main/java/com/suneesh/trading/models/responses/OAuthApplication.java b/Trading/src/main/java/com/suneesh/trading/models/responses/OAuthApplication.java
new file mode 100644
index 0000000..20dcad0
--- /dev/null
+++ b/Trading/src/main/java/com/suneesh/trading/models/responses/OAuthApplication.java
@@ -0,0 +1,66 @@
+package com.suneesh.trading.models.responses;
+
+import com.google.gson.annotations.SerializedName;
+import io.reactivex.annotations.Nullable;
+
+import java.math.BigDecimal;
+import java.util.List;
+
+/**
+ * @author Morteza Tavanarad
+ * @version 1.0.0
+ * @since 8/7/2017
+ */
+public class OAuthApplication {
+
+ /**
+ * Framework name
+ */
+ @SerializedName("name")
+ private String name;
+
+ /**
+ * Framework id
+ */
+ @SerializedName("app_id")
+ private Integer applicationId;
+
+ /**
+ * Framework last used
+ */
+ @SerializedName("last_used")
+ @Nullable
+ private String lastUsed;
+
+ /**
+ * Scopes
+ */
+ @SerializedName("scopes")
+ private List scopes;
+
+ /**
+ * Markup added to contract prices (as a percentage of contract payout)
+ */
+ @SerializedName("app_markup_percentage")
+ private BigDecimal markupPercentage;
+
+ public String getName() {
+ return name;
+ }
+
+ public Integer getApplicationId() {
+ return applicationId;
+ }
+
+ public String getLastUsed() {
+ return lastUsed;
+ }
+
+ public List getScopes() {
+ return scopes;
+ }
+
+ public BigDecimal getMarkupPercentage() {
+ return markupPercentage;
+ }
+}
diff --git a/Trading/src/main/java/com/suneesh/trading/models/responses/OAuthApplicationResponse.java b/Trading/src/main/java/com/suneesh/trading/models/responses/OAuthApplicationResponse.java
new file mode 100644
index 0000000..9828475
--- /dev/null
+++ b/Trading/src/main/java/com/suneesh/trading/models/responses/OAuthApplicationResponse.java
@@ -0,0 +1,28 @@
+package com.suneesh.trading.models.responses;
+
+import com.suneesh.trading.models.requests.OAuthApplicationsRequest;
+import com.google.gson.annotations.SerializedName;
+
+import java.util.List;
+
+/**
+ * OAuthApplicationResponse
+ *
+ * OAuth Apps Receive
+ *
+ * A message with used applications
+ *
+ *
+ * @author Morteza Tavanarad
+ * @version 1.0.0
+ * @since 8/7/2017
+ */
+public class OAuthApplicationResponse extends ResponseBase {
+
+ @SerializedName("oauth_apps")
+ private List oauthApplications;
+
+ public List getOauthApplications() {
+ return oauthApplications;
+ }
+}
diff --git a/Trading/src/main/java/com/suneesh/trading/models/responses/OpenContract.java b/Trading/src/main/java/com/suneesh/trading/models/responses/OpenContract.java
new file mode 100644
index 0000000..2b7fe00
--- /dev/null
+++ b/Trading/src/main/java/com/suneesh/trading/models/responses/OpenContract.java
@@ -0,0 +1,425 @@
+package com.suneesh.trading.models.responses;
+
+import com.google.gson.annotations.SerializedName;
+
+import java.math.BigDecimal;
+import java.util.Map;
+
+/**
+ * @author Morteza Tavanarad
+ * @version 1.0.0
+ * @since 8/8/2017
+ */
+public class OpenContract {
+
+ /**
+ * High barrier of the contract (if any). Example: 42.123
+ */
+ @SerializedName("high_barrier")
+ private BigDecimal highBarrier;
+
+ /**
+ * Low barrier of the contract (if any). Example: 40.132
+ */
+ @SerializedName("low_barrier")
+ private BigDecimal lowBarrier;
+
+ /**
+ * Barrier of the contract (if any). Example: 42.123
+ */
+ @SerializedName("barrier")
+ private BigDecimal barrier;
+
+ /**
+ * The number of barriers a contract has. Example: 2
+ */
+ @SerializedName("barrier_count")
+ private Integer barrierCount;
+
+ /**
+ * Price at which the contract could be sold back to Binary.com. Example: 5.14
+ */
+ @SerializedName("bid_price")
+ private BigDecimal bidPrice;
+
+ /**
+ * Binary.com internal contract identifier
+ */
+ @SerializedName("contract_id")
+ private Long contractId;
+
+ /**
+ * Contract type, for example CALL, PUT
+ */
+ @SerializedName("contract_type")
+ private String contractType;
+
+ /**
+ * Example: USD
+ */
+ @SerializedName("currency")
+ private String currency;
+
+ /**
+ * Spot value if we have license to stream this symbol. Example: 9874.52
+ */
+ @SerializedName("current_spot")
+ private BigDecimal currentSpot;
+
+ /**
+ * Example: 1439999052
+ */
+ @SerializedName("current_spot_time")
+ private Long currentSpotTime;
+
+ /**
+ * Example: 9874.52
+ */
+ @SerializedName("entry_spot")
+ private Long entrySpot;
+
+ /**
+ * Expiry date (epoch) of the Contract. Example: 1446629000.
+ * Please note that it is not applicable for tick trade contracts.
+ */
+ @SerializedName("expiry_date")
+ private Long expiryDate;
+
+ /**
+ * Settlement date (epoch) of the contract. Example: 1446629000
+ */
+ @SerializedName("date_setelment")
+ private Long dateSetelment;
+
+ /**
+ * Start date (epoch) of the contract. Example: 1446629000
+ */
+ @SerializedName("date_start")
+ private Long dateStart;
+
+ /**
+ * A stream id that can be used to cancel this stream using the Forget request.
+ * Example: 1d6651e7d599bce6c54bd71a8283e579
+ */
+ @SerializedName("id")
+ private String id;
+
+ /**
+ * Whether the contract is expired or not. Boolean value 1 or 0
+ */
+ @SerializedName("is_expired")
+ private int isExpired;
+
+ /**
+ * Whether the contract is settleable or not. Boolean value 1 or 0
+ */
+ @SerializedName("is_settleable")
+ private int isSettleable;
+
+ /**
+ * Whether the contract is forward-starting or not. Boolean value 1 or 0
+ */
+ @SerializedName("is_forward_starting")
+ private int isFrowardStarting;
+
+ /**
+ * Whether the contract is an intraday contract. Boolean value 1 or 0
+ */
+ @SerializedName("is_intraday")
+ private int isIntraday;
+
+ /**
+ * Whether the contract expiry price will depend on the path of the market
+ * (e.g. One Touch contract). Boolean value 1 or 0
+ */
+ @SerializedName("is_path_dependent")
+ private int isPathDependent;
+
+ /**
+ * Whether the contract can be sold back to Binary.com. Boolean value 1 or 0
+ */
+ @SerializedName("is_valid_to_sell")
+ private int isValidToSell;
+
+ /**
+ * Text description of the contract purchased,
+ * Example: Win payout if Volatility 100 Index is strictly higher than entry spot at 10 minutes after contract start time.
+ */
+ @SerializedName("longcode")
+ private String longCode;
+
+ /**
+ * Payout value of the contract. Example: 10.50
+ */
+ @SerializedName("payout")
+ private BigDecimal payout;
+
+ /**
+ * Coded description of the contract purchased, Example: CALL_R_100_90_1446704187_1446704787_S0P_0
+ */
+ @SerializedName("shortcode")
+ private String shortCode;
+
+ /**
+ * Example: 5.14, same as ask_price
+ */
+ @SerializedName("display_value")
+ private BigDecimal displayValue;
+
+ /**
+ * Example: BSESENSEX30
+ */
+ @SerializedName("underlying")
+ private String underlying;
+
+ /**
+ * display_name
+ */
+ @SerializedName("display_name")
+ private String displayName;
+
+ /**
+ * This is the entry spot of the contract.
+ * For contracts starting immediately it is the next tick after the start time.
+ * For forward-starting contracts it is the spot at the start time. Example: 86.630.
+ */
+ @SerializedName("entry_tick")
+ private BigDecimal entryTick;
+
+ /**
+ * This is the epoch time of the entry tick. Example: 1446629000
+ */
+ @SerializedName("entry_tick_time")
+ private Long entryTickTime;
+
+ /**
+ * This is the latest spot value at the end time of the contract. Example: 86.810
+ */
+ @SerializedName("exit_tick")
+ private BigDecimal exitTick;
+
+ /**
+ * This is the epoch time of the exit tick.
+ * Note that since certain instruments don't tick every second, the exit tick time may be a few seconds before the end time. Example: 1446629000
+ */
+ @SerializedName("exit_tick_time")
+ private Long exitTickTime;
+
+ /**
+ * Only for tick trades, number of ticks
+ */
+ @SerializedName("tick_count")
+ private Integer tickCount;
+
+ /**
+ * Error message if validation fails
+ */
+ @SerializedName("validation_error")
+ private String validationError;
+
+ /**
+ * Price at which contract was sold, only available when contract has been sold.
+ */
+ @SerializedName("sell_price")
+ private BigDecimal sellPrice;
+
+ /**
+ * Price at which contract was purchased
+ */
+ @SerializedName("buy_price")
+ private BigDecimal buyPrice;
+
+ /**
+ * Epoch of purchase time, will be same as date_start for all contracts except forward starting contracts.
+ */
+ @SerializedName("purchase_time")
+ private Long purchaseTime;
+
+ /**
+ * Epoch time of when the contract was sold (only present for contracts already sold)
+ */
+ @SerializedName("sell_time")
+ private Long sellTime;
+
+ /**
+ * Latest spot value at the sell time. Example: 86.630 (only present for contracts already sold)
+ */
+ @SerializedName("sell_spot")
+ private BigDecimal sellSpot;
+
+ /**
+ * Epoch time of the sell spot.
+ * Note that since certain underlyings don't tick every second, the sell spot time may be a few seconds before the sell time.
+ * Example: 1446629000 (only present for contracts already sold)
+ */
+ @SerializedName("sell_spot_time")
+ private Long sellSpotTime;
+
+ /**
+ * Every contract has buy and sell transaction ids,
+ * i.e. when you purchase a contract we associate it with buy transaction id,
+ * and if contract is already sold we associate that with sell transaction id.
+ */
+ @SerializedName("transaction_ids")
+ private Map transactionIds;
+
+ public BigDecimal getHighBarrier() {
+ return highBarrier;
+ }
+
+ public BigDecimal getLowBarrier() {
+ return lowBarrier;
+ }
+
+ public BigDecimal getBarrier() {
+ return barrier;
+ }
+
+ public Integer getBarrierCount() {
+ return barrierCount;
+ }
+
+ public BigDecimal getBidPrice() {
+ return bidPrice;
+ }
+
+ public Long getContractId() {
+ return contractId;
+ }
+
+ public String getContractType() {
+ return contractType;
+ }
+
+ public String getCurrency() {
+ return currency;
+ }
+
+ public BigDecimal getCurrentSpot() {
+ return currentSpot;
+ }
+
+ public Long getCurrentSpotTime() {
+ return currentSpotTime;
+ }
+
+ public Long getEntrySpot() {
+ return entrySpot;
+ }
+
+ public Long getExpiryDate() {
+ return expiryDate;
+ }
+
+ public Long getDateSetelment() {
+ return dateSetelment;
+ }
+
+ public Long getDateStart() {
+ return dateStart;
+ }
+
+ public String getId() {
+ return id;
+ }
+
+ public boolean isExpired() {
+ return isExpired == 1 ? true : false;
+ }
+
+ public boolean isSettleable() {
+ return isSettleable == 1 ? true : false;
+ }
+
+ public boolean isFrowardStarting() {
+ return isFrowardStarting == 1 ? true : false;
+ }
+
+ public boolean isIntraday() {
+ return isIntraday == 1 ? true : false;
+ }
+
+ public boolean isPathDependent() {
+ return isPathDependent == 1 ? true : false;
+ }
+
+ public boolean isValidToSell() {
+ return isValidToSell == 1 ? true : false;
+ }
+
+ public String getLongCode() {
+ return longCode;
+ }
+
+ public BigDecimal getPayout() {
+ return payout;
+ }
+
+ public String getShortCode() {
+ return shortCode;
+ }
+
+ public BigDecimal getDisplayValue() {
+ return displayValue;
+ }
+
+ public String getUnderlying() {
+ return underlying;
+ }
+
+ public String getDisplayName() {
+ return displayName;
+ }
+
+ public BigDecimal getEntryTick() {
+ return entryTick;
+ }
+
+ public Long getEntryTickTime() {
+ return entryTickTime;
+ }
+
+ public BigDecimal getExitTick() {
+ return exitTick;
+ }
+
+ public Long getExitTickTime() {
+ return exitTickTime;
+ }
+
+ public Integer getTickCount() {
+ return tickCount;
+ }
+
+ public String getValidationError() {
+ return validationError;
+ }
+
+ public BigDecimal getSellPrice() {
+ return sellPrice;
+ }
+
+ public BigDecimal getBuyPrice() {
+ return buyPrice;
+ }
+
+ public Long getPurchaseTime() {
+ return purchaseTime;
+ }
+
+ public Long getSellTime() {
+ return sellTime;
+ }
+
+ public BigDecimal getSellSpot() {
+ return sellSpot;
+ }
+
+ public Long getSellSpotTime() {
+ return sellSpotTime;
+ }
+
+ public Map getTransactionIds() {
+ return transactionIds;
+ }
+}
diff --git a/Trading/src/main/java/com/suneesh/trading/models/responses/PaymentAgent.java b/Trading/src/main/java/com/suneesh/trading/models/responses/PaymentAgent.java
new file mode 100644
index 0000000..ec67aa5
--- /dev/null
+++ b/Trading/src/main/java/com/suneesh/trading/models/responses/PaymentAgent.java
@@ -0,0 +1,104 @@
+package com.suneesh.trading.models.responses;
+
+import com.google.gson.annotations.SerializedName;
+
+import java.math.BigDecimal;
+
+/**
+ * @author Morteza Tavanarad
+ * @version 1.0.0
+ * @since 8/2/2017
+ */
+public class PaymentAgent {
+
+ @SerializedName("currencies")
+ private String currencies;
+
+ @SerializedName("deposit_commission")
+ private String depositCommission;
+
+ @SerializedName("email")
+ private String email;
+
+ @SerializedName("further_information")
+ private String furtherInformation;
+
+ @SerializedName("max_withdrawal")
+ private BigDecimal maxWithdrawal;
+
+ @SerializedName("min_withdrawal")
+ private BigDecimal minWithdrawal;
+
+ @SerializedName("name")
+ private String name;
+
+ @SerializedName("paymentagent_loginid")
+ private String paymentAgentLoginId;
+
+ @SerializedName("summary")
+ private String summary;
+
+ @SerializedName("supported_banks")
+ private String supportedBanks;
+
+ @SerializedName("telephone")
+ private String telephone;
+
+ @SerializedName("url")
+ private String url;
+
+ @SerializedName("withdrawal_commission")
+ private String withdrawalCommission;
+
+ public String getCurrencies() {
+ return currencies;
+ }
+
+ public String getDepositCommission() {
+ return depositCommission;
+ }
+
+ public String getEmail() {
+ return email;
+ }
+
+ public String getFurtherInformation() {
+ return furtherInformation;
+ }
+
+ public BigDecimal getMaxWithdrawal() {
+ return maxWithdrawal;
+ }
+
+ public BigDecimal getMinWithdrawal() {
+ return minWithdrawal;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public String getPaymentAgentLoginId() {
+ return paymentAgentLoginId;
+ }
+
+ public String getSummary() {
+ return summary;
+ }
+
+ public String getSupportedBanks() {
+ return supportedBanks;
+ }
+
+ public String getTelephone() {
+ return telephone;
+ }
+
+ public String getUrl() {
+ return url;
+ }
+
+ public String getWithdrawalCommission() {
+ return withdrawalCommission;
+ }
+}
diff --git a/Trading/src/main/java/com/suneesh/trading/models/responses/PaymentAgentListResponse.java b/Trading/src/main/java/com/suneesh/trading/models/responses/PaymentAgentListResponse.java
new file mode 100644
index 0000000..8307478
--- /dev/null
+++ b/Trading/src/main/java/com/suneesh/trading/models/responses/PaymentAgentListResponse.java
@@ -0,0 +1,40 @@
+package com.suneesh.trading.models.responses;
+
+import com.suneesh.trading.models.requests.PaymentAgentListRequest;
+import com.google.gson.annotations.SerializedName;
+
+import java.util.List;
+
+/**
+ * @author Morteza Tavanarad
+ * @version 1.0.0
+ * @since 8/2/2017
+ */
+public class PaymentAgentListResponse extends ResponseBase {
+
+ /**
+ * Payment Agent List
+ */
+ @SerializedName("paymentagent_list")
+ private PaymentAgentList paymentAgentList;
+
+ public PaymentAgentList getPaymentAgentList() {
+ return paymentAgentList;
+ }
+
+ public class PaymentAgentList {
+ @SerializedName("available_countries")
+ private List> availableCountries;
+
+ @SerializedName("list")
+ private List paymentAgents;
+
+ public List> getAvailableCountries() {
+ return availableCountries;
+ }
+
+ public List getPaymentAgents() {
+ return paymentAgents;
+ }
+ }
+}
diff --git a/Trading/src/main/java/com/suneesh/trading/models/responses/PaymentAgentTransferResponse.java b/Trading/src/main/java/com/suneesh/trading/models/responses/PaymentAgentTransferResponse.java
new file mode 100644
index 0000000..930ef28
--- /dev/null
+++ b/Trading/src/main/java/com/suneesh/trading/models/responses/PaymentAgentTransferResponse.java
@@ -0,0 +1,54 @@
+package com.suneesh.trading.models.responses;
+
+import com.suneesh.trading.models.requests.PaymentAgentTransferRequest;
+import com.google.gson.annotations.SerializedName;
+
+/**
+ * PaymentAgentTransferResponse
+ *
+ * @author Morteza Tavanarad
+ * @version 1.0.0
+ * @since 9/15/2017
+ */
+public class PaymentAgentTransferResponse extends ResponseBase {
+
+ /**
+ * If 1, transfer success. If 2, dry-run success.
+ */
+ @SerializedName("paymentagent_transfer")
+ private Integer result;
+
+ /**
+ * The transfer_to client full name
+ */
+ @SerializedName("client_to_full_name")
+ private String clientToFullName;
+
+ /**
+ * The transfer_to client loginid
+ */
+ @SerializedName("client_to_loginid")
+ private String clientToLoginId;
+
+ /**
+ * Reference id of transfer performed
+ */
+ @SerializedName("transaction_id")
+ private Long transactionId;
+
+ public Integer getResult() {
+ return result;
+ }
+
+ public String getClientToFullName() {
+ return clientToFullName;
+ }
+
+ public String getClientToLoginId() {
+ return clientToLoginId;
+ }
+
+ public Long getTransactionId() {
+ return transactionId;
+ }
+}
diff --git a/Trading/src/main/java/com/suneesh/trading/models/responses/PaymentAgentWithdrawalResponse.java b/Trading/src/main/java/com/suneesh/trading/models/responses/PaymentAgentWithdrawalResponse.java
new file mode 100644
index 0000000..e46683e
--- /dev/null
+++ b/Trading/src/main/java/com/suneesh/trading/models/responses/PaymentAgentWithdrawalResponse.java
@@ -0,0 +1,46 @@
+package com.suneesh.trading.models.responses;
+
+import com.suneesh.trading.models.requests.PaymentAgentWithdrawalRequest;
+import com.google.gson.annotations.SerializedName;
+
+/**
+ * PaymentAgentWithdrawalResponse
+ *
+ * Payment Agent Withdrawal Response
+ *
+ * @author Morteza Tavanarad
+ * @version 1.0.0
+ * @since 9/15/2017
+ */
+public class PaymentAgentWithdrawalResponse extends ResponseBase {
+
+ /**
+ * If 1, withdrawal success. If 2, dry-run success.
+ */
+ @SerializedName("paymentagent_withdraw")
+ private Integer result;
+
+ /**
+ * Payment agent name
+ */
+ @SerializedName("paymentagent_name")
+ private String paymentAgentName;
+
+ /**
+ * Reference id of withdrawal performed
+ */
+ @SerializedName("transaction_id")
+ private Long transactionId;
+
+ public Integer getResult() {
+ return result;
+ }
+
+ public String getPaymentAgentName() {
+ return paymentAgentName;
+ }
+
+ public Long getTransactionId() {
+ return transactionId;
+ }
+}
diff --git a/Trading/src/main/java/com/suneesh/trading/models/responses/PayoutCurrenciesResponse.java b/Trading/src/main/java/com/suneesh/trading/models/responses/PayoutCurrenciesResponse.java
new file mode 100644
index 0000000..052a908
--- /dev/null
+++ b/Trading/src/main/java/com/suneesh/trading/models/responses/PayoutCurrenciesResponse.java
@@ -0,0 +1,25 @@
+package com.suneesh.trading.models.responses;
+
+import com.suneesh.trading.models.requests.PayoutCurrenciesRequest;
+import com.google.gson.annotations.SerializedName;
+
+import java.util.List;
+
+/**
+ * @author Morteza Tavanarad
+ * @version 1.0.0
+ * @since 8/2/2017
+ */
+public class PayoutCurrenciesResponse extends ResponseBase {
+
+ /**
+ * Available payout currencies.
+ * Note: if a user is logged in, only the currency available for his account will be returned.
+ */
+ @SerializedName("payout_currencies")
+ private List payoutCurrencies;
+
+ public List getPayoutCurrencies() {
+ return payoutCurrencies;
+ }
+}
diff --git a/Trading/src/main/java/com/suneesh/trading/models/responses/PingResponse.java b/Trading/src/main/java/com/suneesh/trading/models/responses/PingResponse.java
new file mode 100644
index 0000000..c0ddcca
--- /dev/null
+++ b/Trading/src/main/java/com/suneesh/trading/models/responses/PingResponse.java
@@ -0,0 +1,22 @@
+package com.suneesh.trading.models.responses;
+
+import com.suneesh.trading.models.requests.PingRequest;
+import com.google.gson.annotations.SerializedName;
+
+/**
+ * @author Morteza Tavanarad
+ * @version 1.0.0
+ * @since 8/2/2017
+ */
+public class PingResponse extends ResponseBase {
+
+ /**
+ * Will return 'pong'
+ */
+ @SerializedName("ping")
+ private String ping;
+
+ public String getPing() {
+ return ping;
+ }
+}
diff --git a/Trading/src/main/java/com/suneesh/trading/models/responses/Portfolio.java b/Trading/src/main/java/com/suneesh/trading/models/responses/Portfolio.java
new file mode 100644
index 0000000..2bb6f28
--- /dev/null
+++ b/Trading/src/main/java/com/suneesh/trading/models/responses/Portfolio.java
@@ -0,0 +1,27 @@
+package com.suneesh.trading.models.responses;
+
+import com.google.gson.annotations.SerializedName;
+
+import java.util.List;
+
+/**
+ * @author Morteza Tavanarad
+ * @version 1.0.0
+ * @since 8/7/2017
+ */
+public class Portfolio {
+
+ public void setContracts(List contracts) {
+ this.contracts = contracts;
+ }
+
+ /**
+ * Client open positions
+ */
+ @SerializedName("contracts")
+ private List contracts;
+
+ public List getContracts() {
+ return contracts;
+ }
+}
diff --git a/Trading/src/main/java/com/suneesh/trading/models/responses/PortfolioResponse.java b/Trading/src/main/java/com/suneesh/trading/models/responses/PortfolioResponse.java
new file mode 100644
index 0000000..b997c92
--- /dev/null
+++ b/Trading/src/main/java/com/suneesh/trading/models/responses/PortfolioResponse.java
@@ -0,0 +1,33 @@
+package com.suneesh.trading.models.responses;
+
+import com.suneesh.trading.models.requests.PortfolioRequest;
+import com.google.gson.annotations.SerializedName;
+
+/**
+ * PortfolioResponse
+ *
+ * Portfolio Receive
+ *
+ * Receive a list of outstanding options in the user's portfolio
+ *
+ *
+ * @author Morteza Tavanarad
+ * @version 1.0.0
+ * @since 8/7/2017
+ */
+public class PortfolioResponse extends ResponseBase {
+
+ public void setPortfolio(Portfolio portfolio) {
+ this.portfolio = portfolio;
+ }
+
+ /**
+ * Client open positions
+ */
+ @SerializedName("portfolio")
+ private Portfolio portfolio;
+
+ public Portfolio getPortfolio() {
+ return portfolio;
+ }
+}
diff --git a/Trading/src/main/java/com/suneesh/trading/models/responses/PortfolioTransaction.java b/Trading/src/main/java/com/suneesh/trading/models/responses/PortfolioTransaction.java
new file mode 100644
index 0000000..ddfcc97
--- /dev/null
+++ b/Trading/src/main/java/com/suneesh/trading/models/responses/PortfolioTransaction.java
@@ -0,0 +1,135 @@
+package com.suneesh.trading.models.responses;
+
+import com.google.gson.annotations.SerializedName;
+import io.reactivex.annotations.Nullable;
+
+import java.math.BigDecimal;
+
+/**
+ * @author Morteza Tavanarad
+ * @version 1.0.0
+ * @since 8/7/2017
+ */
+public class PortfolioTransaction {
+
+ /**
+ * Binary.com internal contract identifier number (to be used in a Price Proposal - Open Contract API call)
+ */
+ @SerializedName("contract_id")
+ private Long contractId;
+
+ /**
+ * It is the transaction id. Every contract (buy or sell) and every payment has a unique id. Example: 10867502908
+ */
+ @SerializedName("transaction_id")
+ private Long transactionId;
+
+ /**
+ * Epoch of purchase time
+ */
+ @SerializedName("time")
+ private long time;
+
+ /**
+ * Symbol code
+ */
+ @SerializedName("symbol")
+ private String symbol;
+
+ /**
+ * Payout price
+ */
+ @SerializedName("payout")
+ private BigDecimal payout;
+
+ /**
+ * Buy price
+ */
+ @SerializedName("buy_price")
+ private BigDecimal buyPrice;
+
+ /**
+ * Epoch of start date
+ */
+ @SerializedName("date_start")
+ private long dateStart;
+
+ /**
+ * Epoch of expiry time
+ */
+ @SerializedName("expiry_time")
+ private long expiryTime;
+
+ /**
+ * Contract type
+ */
+ @SerializedName("contract_type")
+ private String contractType;
+
+ /**
+ * Contract currency
+ */
+ @SerializedName("contract_currency")
+ private String currency;
+
+ /**
+ * Contract description
+ */
+ @SerializedName("longcode")
+ private String longCode;
+
+ /**
+ * Id of an app from where this contract was purchased. For example, it's 1 for binary.com.
+ */
+ @SerializedName("app_id")
+ @Nullable
+ private Integer appId;
+
+ public Long getContractId() {
+ return contractId;
+ }
+
+ public Long getTransactionId() {
+ return transactionId;
+ }
+
+ public long getTime() {
+ return time;
+ }
+
+ public String getSymbol() {
+ return symbol;
+ }
+
+ public BigDecimal getPayout() {
+ return payout;
+ }
+
+ public BigDecimal getBuyPrice() {
+ return buyPrice;
+ }
+
+ public long getDateStart() {
+ return dateStart;
+ }
+
+ public long getExpiryTime() {
+ return expiryTime;
+ }
+
+ public String getContractType() {
+ return contractType;
+ }
+
+ public String getCurrency() {
+ return currency;
+ }
+
+ public String getLongCode() {
+ return longCode;
+ }
+
+ public Integer getAppId() {
+ return appId;
+ }
+}
diff --git a/Trading/src/main/java/com/suneesh/trading/models/responses/PriceProposalResponse.java b/Trading/src/main/java/com/suneesh/trading/models/responses/PriceProposalResponse.java
new file mode 100644
index 0000000..5e3601a
--- /dev/null
+++ b/Trading/src/main/java/com/suneesh/trading/models/responses/PriceProposalResponse.java
@@ -0,0 +1,26 @@
+package com.suneesh.trading.models.responses;
+
+import com.suneesh.trading.models.requests.PriceProposalRequest;
+import com.google.gson.annotations.SerializedName;
+
+/**
+ * PriceProposalRequest
+ *
+ * Price Proposal Response
+ * Latest price and other details for a given contract
+ * @author Morteza Tavanarad
+ * @version 1.0.0
+ * @since 8/2/2017
+ */
+public class PriceProposalResponse extends ResponseBase {
+
+ /**
+ * Latest price and other details for a given contract
+ */
+ @SerializedName("proposal")
+ private Proposal proposal;
+
+ public Proposal getProposal() {
+ return proposal;
+ }
+}
diff --git a/Trading/src/main/java/com/suneesh/trading/models/responses/ProfitTable.java b/Trading/src/main/java/com/suneesh/trading/models/responses/ProfitTable.java
new file mode 100644
index 0000000..d7d1b03
--- /dev/null
+++ b/Trading/src/main/java/com/suneesh/trading/models/responses/ProfitTable.java
@@ -0,0 +1,33 @@
+package com.suneesh.trading.models.responses;
+
+import com.google.gson.annotations.SerializedName;
+
+import java.util.List;
+
+/**
+ * @author Morteza Tavanarad
+ * @version 1.0.0
+ * @since 8/8/2017
+ */
+public class ProfitTable {
+
+ /**
+ * Number of transactions returned in this call
+ */
+ @SerializedName("count")
+ private Integer count;
+
+ /**
+ * Array of returned transactions
+ */
+ @SerializedName("transactions")
+ private List transactions;
+
+ public Integer getCount() {
+ return count;
+ }
+
+ public List getTransactions() {
+ return transactions;
+ }
+}
diff --git a/Trading/src/main/java/com/suneesh/trading/models/responses/ProfitTableResponse.java b/Trading/src/main/java/com/suneesh/trading/models/responses/ProfitTableResponse.java
new file mode 100644
index 0000000..4a95e64
--- /dev/null
+++ b/Trading/src/main/java/com/suneesh/trading/models/responses/ProfitTableResponse.java
@@ -0,0 +1,31 @@
+package com.suneesh.trading.models.responses;
+
+import com.suneesh.trading.models.requests.ProfitTableRequest;
+import com.google.gson.annotations.SerializedName;
+import io.reactivex.annotations.Nullable;
+
+/**
+ * ProfitTableResponse
+ *
+ * Profit Table Receive
+ *
+ * A summary of account profit table is received
+ *
+ *
+ * @author Morteza Tavanarad
+ * @version 1.0.0
+ * @since 8/8/2017
+ */
+public class ProfitTableResponse extends ResponseBase {
+
+ /**
+ * Account Profit Table.
+ */
+ @SerializedName("profit_table")
+ @Nullable
+ private ProfitTable profitTable;
+
+ public ProfitTable getProfitTable() {
+ return profitTable;
+ }
+}
diff --git a/Trading/src/main/java/com/suneesh/trading/models/responses/ProfitTableTransaction.java b/Trading/src/main/java/com/suneesh/trading/models/responses/ProfitTableTransaction.java
new file mode 100644
index 0000000..0cb416d
--- /dev/null
+++ b/Trading/src/main/java/com/suneesh/trading/models/responses/ProfitTableTransaction.java
@@ -0,0 +1,77 @@
+package com.suneesh.trading.models.responses;
+
+import com.google.gson.annotations.SerializedName;
+import io.reactivex.annotations.Nullable;
+
+import java.math.BigDecimal;
+
+/**
+ * @author Morteza Tavanarad
+ * @version 1.0.0
+ * @since 8/8/2017
+ */
+public class ProfitTableTransaction {
+
+ /**
+ * It is the transaction id. every contract (buy or sell) and every payment has a unique id. Example: 10867502908
+ */
+ @SerializedName("transaction_id")
+ private String transactionId;
+
+ /**
+ * It is the contract id Example: 4867502908
+ */
+ @SerializedName("contract_id")
+ private String contractId;
+
+ /**
+ * It is the purchase time of transaction
+ */
+ @SerializedName("purchase_time")
+ private Long purchaseTime;
+
+ /**
+ * It is the sell time of transaction
+ */
+ @SerializedName("sell_time")
+ @Nullable
+ private Long sellTime;
+
+ /**
+ * Buy price
+ */
+ @SerializedName("buy_price")
+ private BigDecimal buyPrice;
+
+ /**
+ * Sold price
+ */
+ @SerializedName("sell_price")
+ private BigDecimal sellPrice;
+
+ /**
+ * The description of contract purchased if description is set to 1
+ */
+ @SerializedName("longcode")
+ private String longCode;
+
+ /**
+ * Compact description of the contract purchased if description is set to 1
+ */
+ @SerializedName("shortcode")
+ private String shortCode;
+
+ /**
+ * Payout price
+ */
+ @SerializedName("payout")
+ private BigDecimal payout;
+
+ /**
+ * App id of app where this transaction was performed. For example, it's 1 for binary.com.
+ */
+ @SerializedName("app_id")
+ @Nullable
+ private Integer applicationId;
+
+}
diff --git a/Trading/src/main/java/com/suneesh/trading/models/responses/Proposal.java b/Trading/src/main/java/com/suneesh/trading/models/responses/Proposal.java
new file mode 100644
index 0000000..049520a
--- /dev/null
+++ b/Trading/src/main/java/com/suneesh/trading/models/responses/Proposal.java
@@ -0,0 +1,94 @@
+package com.suneesh.trading.models.responses;
+
+import com.google.gson.annotations.SerializedName;
+
+import java.math.BigDecimal;
+
+/**
+ * @author Morteza Tavanarad
+ * @version 1.0.0
+ * @since 8/2/2017
+ */
+public class Proposal {
+
+ /**
+ * Example: Win payout if Random 100 Index is strictly higher than entry spot at 15 minutes after contract start time.
+ */
+ @SerializedName("longcode")
+ private String longCode;
+
+ /**
+ * Spot value (if there are no Exchange data-feed licensing restrictions for the underlying symbol).
+ * Example: 9874.52
+ */
+ @SerializedName("spot")
+ private BigDecimal spot;
+
+ /**
+ * Example: 1439999052
+ */
+ @SerializedName("spot_time")
+ private int spotTime;
+
+ /**
+ * Example: 5.14
+ */
+ @SerializedName("ask_price")
+ private BigDecimal askPrice;
+
+ /**
+ * Example: 5.14, same as ask_price
+ */
+ @SerializedName("display_value")
+ private BigDecimal displayValue;
+
+ /**
+ * Example: 1439999053
+ */
+ @SerializedName("date_start")
+ private int dateStart;
+
+ /**
+ * A stream id that can be used to cancel this stream using the Forget request. Example: 1d6651e7d599bce6c54bd71a8283e579
+ */
+ @SerializedName("id")
+ private String id;
+
+ /**
+ * Example: 10
+ */
+ @SerializedName("payout")
+ private BigDecimal payout;
+
+ public String getLongCode() {
+ return longCode;
+ }
+
+ public BigDecimal getSpot() {
+ return spot;
+ }
+
+ public int getSpotTime() {
+ return spotTime;
+ }
+
+ public BigDecimal getAskPrice() {
+ return askPrice;
+ }
+
+ public BigDecimal getDisplayValue() {
+ return displayValue;
+ }
+
+ public int getDateStart() {
+ return dateStart;
+ }
+
+ public String getId() {
+ return id;
+ }
+
+ public BigDecimal getPayout() {
+ return payout;
+ }
+}
diff --git a/Trading/src/main/java/com/suneesh/trading/models/responses/ProposalOpenContractResponse.java b/Trading/src/main/java/com/suneesh/trading/models/responses/ProposalOpenContractResponse.java
new file mode 100644
index 0000000..c94e4a6
--- /dev/null
+++ b/Trading/src/main/java/com/suneesh/trading/models/responses/ProposalOpenContractResponse.java
@@ -0,0 +1,29 @@
+package com.suneesh.trading.models.responses;
+
+import com.suneesh.trading.models.requests.ProposalOpenContractRequest;
+import com.google.gson.annotations.SerializedName;
+
+/**
+ * ProposalOpenContractResponse
+ *
+ * Open contract proposal response
+ *
+ * Latest price and other details for an open contract in the user's portfolio
+ *
+ *
+ * @author Morteza Tavanarad
+ * @version 1.0.0
+ * @since 8/8/2017
+ */
+public class ProposalOpenContractResponse extends ResponseBase {
+
+ /**
+ * Latest price and other details for an open contract
+ */
+ @SerializedName("proposal_open_contract")
+ private OpenContract openContract;
+
+ public OpenContract getOpenContract() {
+ return openContract;
+ }
+}
diff --git a/Trading/src/main/java/com/suneesh/trading/models/responses/RealityCheck.java b/Trading/src/main/java/com/suneesh/trading/models/responses/RealityCheck.java
new file mode 100644
index 0000000..d01de34
--- /dev/null
+++ b/Trading/src/main/java/com/suneesh/trading/models/responses/RealityCheck.java
@@ -0,0 +1,103 @@
+package com.suneesh.trading.models.responses;
+
+import com.google.gson.annotations.SerializedName;
+
+import java.math.BigDecimal;
+
+/**
+ * @author Morteza Tavanarad
+ * @version 1.0.0
+ * @since 8/8/2017
+ */
+public class RealityCheck {
+
+ /**
+ * Reality check summary start time epoch
+ */
+ @SerializedName("start_time")
+ private Long startTime;
+
+ /**
+ * Client loginid Example: CR000000
+ */
+ @SerializedName("loginid")
+ private String loginId;
+
+ /**
+ * Currency of client account i.e currency for trading
+ */
+ @SerializedName("currency")
+ private String currency;
+
+ /**
+ * Total count of contract purchased.
+ */
+ @SerializedName("buy_count")
+ private Integer buyCount;
+
+ /**
+ * Total amount of contract purchased.
+ */
+ @SerializedName("buy_amount")
+ private BigDecimal buyAmount;
+
+ /**
+ * Total count of contract sold.
+ */
+ @SerializedName("sell_count")
+ private Integer sellCount;
+
+ /**
+ * Total amount of contracts sold.
+ */
+ @SerializedName("sell_amount")
+ private BigDecimal sellAmount;
+
+ /**
+ * Indicative profit of contract as per current market price.
+ */
+ @SerializedName("potential_profit")
+ private BigDecimal potentialProfit;
+
+ /**
+ * Total count of contracts that are not yet expired.
+ */
+ @SerializedName("open_contract_count")
+ private Integer openContractCount;
+
+ public Long getStartTime() {
+ return startTime;
+ }
+
+ public String getLoginId() {
+ return loginId;
+ }
+
+ public String getCurrency() {
+ return currency;
+ }
+
+ public Integer getBuyCount() {
+ return buyCount;
+ }
+
+ public BigDecimal getBuyAmount() {
+ return buyAmount;
+ }
+
+ public Integer getSellCount() {
+ return sellCount;
+ }
+
+ public BigDecimal getSellAmount() {
+ return sellAmount;
+ }
+
+ public BigDecimal getPotentialProfit() {
+ return potentialProfit;
+ }
+
+ public Integer getOpenContractCount() {
+ return openContractCount;
+ }
+}
diff --git a/Trading/src/main/java/com/suneesh/trading/models/responses/RealityCheckResponse.java b/Trading/src/main/java/com/suneesh/trading/models/responses/RealityCheckResponse.java
new file mode 100644
index 0000000..955740c
--- /dev/null
+++ b/Trading/src/main/java/com/suneesh/trading/models/responses/RealityCheckResponse.java
@@ -0,0 +1,29 @@
+package com.suneesh.trading.models.responses;
+
+import com.suneesh.trading.models.requests.RealityCheckRequest;
+import com.google.gson.annotations.SerializedName;
+
+/**
+ * RealityCheckResponse
+ *
+ * Reality check receive
+ *
+ * This gives summary of client's trades and account for reality check
+ *
+ *
+ * @author Morteza Tavanarad
+ * @version 1.0.0
+ * @since 8/8/2017
+ */
+public class RealityCheckResponse extends ResponseBase {
+
+ /**
+ * Reality check summary of trades.
+ */
+ @SerializedName("reality_check")
+ private RealityCheck realityCheck;
+
+ public RealityCheck getRealityCheck() {
+ return realityCheck;
+ }
+}
diff --git a/Trading/src/main/java/com/suneesh/trading/models/responses/Residence.java b/Trading/src/main/java/com/suneesh/trading/models/responses/Residence.java
new file mode 100644
index 0000000..8438ea0
--- /dev/null
+++ b/Trading/src/main/java/com/suneesh/trading/models/responses/Residence.java
@@ -0,0 +1,43 @@
+package com.suneesh.trading.models.responses;
+
+import com.google.gson.annotations.SerializedName;
+import io.reactivex.annotations.Nullable;
+
+/**
+ * @author Morteza Tavanarad
+ * @version 1.0.0
+ * @since 8/2/2017
+ */
+public class Residence {
+
+ /**
+ * 2-letter country code
+ */
+ @SerializedName("value")
+ private String value;
+
+ /**
+ * Country full name
+ */
+ @SerializedName("text")
+ private String text;
+
+ /**
+ * IDD code of country
+ */
+ @SerializedName("phone_idd")
+ @Nullable
+ private String phoneIDD;
+
+ public String getValue() {
+ return value;
+ }
+
+ public String getText() {
+ return text;
+ }
+
+ public String getPhoneIDD() {
+ return phoneIDD;
+ }
+}
diff --git a/Trading/src/main/java/com/suneesh/trading/models/responses/ResidenceListResponce.java b/Trading/src/main/java/com/suneesh/trading/models/responses/ResidenceListResponce.java
new file mode 100644
index 0000000..759e5bd
--- /dev/null
+++ b/Trading/src/main/java/com/suneesh/trading/models/responses/ResidenceListResponce.java
@@ -0,0 +1,29 @@
+package com.suneesh.trading.models.responses;
+
+import com.suneesh.trading.models.requests.ResidenceListRequest;
+import com.google.gson.annotations.SerializedName;
+
+import java.util.List;
+
+/**
+ * ResidenceListResponse
+ *
+ * Residence List Receive
+ * A message with Residence List
+ *
+ * @author Morteza Tavanarad
+ * @version 1.0.0
+ * @since 8/2/2017
+ */
+public class ResidenceListResponce extends ResponseBase {
+
+ /**
+ * List of countries for account opening
+ */
+ @SerializedName("residence_list")
+ private List residenceList;
+
+ public List getResidenceList() {
+ return residenceList;
+ }
+}
diff --git a/Trading/src/main/java/com/suneesh/trading/models/responses/ResponseBase.java b/Trading/src/main/java/com/suneesh/trading/models/responses/ResponseBase.java
new file mode 100644
index 0000000..f3a5d57
--- /dev/null
+++ b/Trading/src/main/java/com/suneesh/trading/models/responses/ResponseBase.java
@@ -0,0 +1,34 @@
+package com.suneesh.trading.models.responses;
+
+import com.google.gson.annotations.Expose;
+import com.google.gson.annotations.SerializedName;
+
+/**
+ * Created by morteza on 7/19/2017.
+ */
+
+public abstract class ResponseBase {
+ @SerializedName("echo_req")
+ @Expose
+ T request;
+
+ @SerializedName("msg_type")
+ @Expose
+ String type;
+
+ @SerializedName("error")
+ @Expose
+ Error error;
+
+ public String getType(){
+ return this.type;
+ }
+
+ public T getRequest(){
+ return this.request;
+ }
+
+ public Error getError() {
+ return error;
+ }
+}
diff --git a/Trading/src/main/java/com/suneesh/trading/models/responses/RevokeOauthApplicationResponse.java b/Trading/src/main/java/com/suneesh/trading/models/responses/RevokeOauthApplicationResponse.java
new file mode 100644
index 0000000..cd37f59
--- /dev/null
+++ b/Trading/src/main/java/com/suneesh/trading/models/responses/RevokeOauthApplicationResponse.java
@@ -0,0 +1,28 @@
+package com.suneesh.trading.models.responses;
+
+import com.suneesh.trading.models.requests.RevokeOauthApplicationRequest;
+import com.google.gson.annotations.SerializedName;
+import io.reactivex.annotations.Nullable;
+
+/**
+ * RevokeOauthApplicationResponse
+ *
+ * Revoke an OAuth App
+ *
+ * A message with revoking a used application
+ *
+ *
+ * @author Morteza Tavanarad
+ * @version 1.0.0
+ * @since 9/4/2017
+ */
+public class RevokeOauthApplicationResponse extends ResponseBase {
+
+ @SerializedName("revoke_oauth_app")
+ @Nullable
+ private Integer result;
+
+ public Integer getResult() {
+ return result;
+ }
+}
diff --git a/Trading/src/main/java/com/suneesh/trading/models/responses/SelfExclusion.java b/Trading/src/main/java/com/suneesh/trading/models/responses/SelfExclusion.java
new file mode 100644
index 0000000..f48f24b
--- /dev/null
+++ b/Trading/src/main/java/com/suneesh/trading/models/responses/SelfExclusion.java
@@ -0,0 +1,183 @@
+package com.suneesh.trading.models.responses;
+
+import com.suneesh.trading.utils.Validator;
+import com.google.gson.annotations.SerializedName;
+import io.reactivex.annotations.Nullable;
+
+import java.math.BigDecimal;
+
+/**
+ * SelfExclusion
+ * @author Morteza Tavanarad
+ * @version 1.0.0
+ * @since 8/4/2017
+ */
+public class SelfExclusion {
+
+ /**
+ * Maximum account cash balance
+ */
+ @SerializedName("max_balance")
+ @Nullable
+ private BigDecimal maxBalance;
+
+ /**
+ * Daily turnover limit
+ */
+ @SerializedName("max_turnover")
+ @Nullable
+ private BigDecimal maxTurnover;
+
+ /**
+ * Daily limit on losses
+ */
+ @SerializedName("max_losses")
+ @Nullable
+ private BigDecimal maxLosses;
+
+ /**
+ * 7-day turnover limit
+ */
+ @SerializedName("max_7day_turnover")
+ @Nullable
+ private BigDecimal maxSevenDayTurnover;
+
+ /**
+ * 7-day limit on losses
+ */
+ @SerializedName("max_7day_losses")
+ @Nullable
+ private BigDecimal maxSevenDayLosses;
+
+ /**
+ * 30-day turnover limit
+ */
+ @SerializedName("max_30day_turnover")
+ @Nullable
+ private BigDecimal maxThirtyDayTurnover;
+
+ /**
+ * 30-day limit on losses
+ */
+ @SerializedName("max_30day_losses")
+ @Nullable
+ private BigDecimal maxThirtydayLosses;
+
+ /**
+ * Maximum number of open positions
+ */
+ @SerializedName("max_open_bets")
+ @Nullable
+ private Integer maxOpenBets;
+
+ /**
+ * Session duration limit, in minutes
+ */
+ @SerializedName("session_duration_limit")
+ @Nullable
+ private Integer sessionDurationLimit;
+
+ /**
+ * Exclude me from the website until (date YYYY-MM-DD)
+ */
+ @SerializedName("exclude_until")
+ @Nullable
+ private String excludeUntil;
+
+ /**
+ * Exclude me from the website until (epoch time)
+ */
+ @SerializedName("timeout_until")
+ @Nullable
+ private Integer timeoutUntil;
+
+ public BigDecimal getMaxBalance() {
+ return maxBalance;
+ }
+
+ public void setMaxBalance(BigDecimal maxBalance) {
+ this.maxBalance = maxBalance;
+ }
+
+ public BigDecimal getMaxTurnover() {
+ return maxTurnover;
+ }
+
+ public void setMaxTurnover(BigDecimal maxTurnover) {
+ this.maxTurnover = maxTurnover;
+ }
+
+ public BigDecimal getMaxLosses() {
+ return maxLosses;
+ }
+
+ public void setMaxLosses(BigDecimal maxLosses) {
+ this.maxLosses = maxLosses;
+ }
+
+ public BigDecimal getMaxSevenDayTurnover() {
+ return maxSevenDayTurnover;
+ }
+
+ public void setMaxSevenDayTurnover(BigDecimal maxSevenDayTurnover) {
+ this.maxSevenDayTurnover = maxSevenDayTurnover;
+ }
+
+ public BigDecimal getMaxSevenDayLosses() {
+ return maxSevenDayLosses;
+ }
+
+ public void setMaxSevenDayLosses(BigDecimal maxSevenDayLosses) {
+ this.maxSevenDayLosses = maxSevenDayLosses;
+ }
+
+ public BigDecimal getMaxThirtyDayTurnover() {
+ return maxThirtyDayTurnover;
+ }
+
+ public void setMaxThirtyDayTurnover(BigDecimal maxThirtyDayTurnover) {
+ this.maxThirtyDayTurnover = maxThirtyDayTurnover;
+ }
+
+ public BigDecimal getMaxThirtydayLosses() {
+ return maxThirtydayLosses;
+ }
+
+ public void setMaxThirtydayLosses(BigDecimal maxThirtydayLosses) {
+ this.maxThirtydayLosses = maxThirtydayLosses;
+ }
+
+ public Integer getMaxOpenBets() {
+ return maxOpenBets;
+ }
+
+ public void setMaxOpenBets(Integer maxOpenBets) {
+ this.maxOpenBets = maxOpenBets;
+ }
+
+ public Integer getSessionDurationLimit() {
+ return sessionDurationLimit;
+ }
+
+ public void setSessionDurationLimit(Integer sessionDurationLimit) {
+ this.sessionDurationLimit = sessionDurationLimit;
+ }
+
+ public String getExcludeUntil() {
+ return excludeUntil;
+ }
+
+ public void setExcludeUntil(String excludeUntil) {
+ Validator.checkPattern("^\\d{4}-\\d{2}-\\d{2}$", excludeUntil,
+ "ExcludeUntil does not match the regex pattern /^\\d{4}-\\d{2}-\\d{2}$/");
+ this.excludeUntil = excludeUntil;
+ }
+
+ public Integer getTimeoutUntil() {
+ return timeoutUntil;
+ }
+
+ public void setTimeoutUntil(Integer timeoutUntil) {
+ this.timeoutUntil = timeoutUntil;
+ }
+}
diff --git a/Trading/src/main/java/com/suneesh/trading/models/responses/SellContractForMultipleAccountsResponse.java b/Trading/src/main/java/com/suneesh/trading/models/responses/SellContractForMultipleAccountsResponse.java
new file mode 100644
index 0000000..1cc00a5
--- /dev/null
+++ b/Trading/src/main/java/com/suneesh/trading/models/responses/SellContractForMultipleAccountsResponse.java
@@ -0,0 +1,41 @@
+package com.suneesh.trading.models.responses;
+
+import com.suneesh.trading.models.requests.SellContractForMultipleAccountsRequest;
+import com.google.gson.annotations.SerializedName;
+
+import java.util.List;
+
+/**
+ * SellContractForMultipleAccountsResponse
+ *
+ * Sell for multiple contracts response
+ *
+ * Confirmation of the sale status for the selected contracts and accounts.
+ *
+ *
+ * @author Morteza Tavanarad
+ * @version 1.0.0
+ * @since 8/9/2017
+ */
+public class SellContractForMultipleAccountsResponse extends ResponseBase {
+
+ /**
+ * Status information for each affected acccount
+ */
+ @SerializedName("sell_contract_for_multiple_accounts")
+ private MassSellContractResult massSellContractResult;
+
+ public MassSellContractResult getMassSellContractResult() {
+ return massSellContractResult;
+ }
+
+ public class MassSellContractResult {
+
+ @SerializedName("result")
+ private List massSellReceipts;
+
+ public List getSellReceipts() {
+ return massSellReceipts;
+ }
+ }
+}
diff --git a/Trading/src/main/java/com/suneesh/trading/models/responses/SellContractResponse.java b/Trading/src/main/java/com/suneesh/trading/models/responses/SellContractResponse.java
new file mode 100644
index 0000000..32ab791
--- /dev/null
+++ b/Trading/src/main/java/com/suneesh/trading/models/responses/SellContractResponse.java
@@ -0,0 +1,29 @@
+package com.suneesh.trading.models.responses;
+
+import com.suneesh.trading.models.requests.SellContractRequest;
+import com.google.gson.annotations.SerializedName;
+
+/**
+ * SellContractResponse
+ *
+ * Sell a Contract Receive
+ *
+ * A message with transaction results is received
+ *
+ *
+ * @author Morteza Tavanarad
+ * @version 1.0.0
+ * @since 8/9/2017
+ */
+public class SellContractResponse extends ResponseBase {
+
+ /**
+ * Receipt for the transaction
+ */
+ @SerializedName("sell")
+ private SellReceipt sellReceipt;
+
+ public SellReceipt getSellReceipt() {
+ return sellReceipt;
+ }
+}
diff --git a/Trading/src/main/java/com/suneesh/trading/models/responses/SellExpiredContractsResponse.java b/Trading/src/main/java/com/suneesh/trading/models/responses/SellExpiredContractsResponse.java
new file mode 100644
index 0000000..d412781
--- /dev/null
+++ b/Trading/src/main/java/com/suneesh/trading/models/responses/SellExpiredContractsResponse.java
@@ -0,0 +1,31 @@
+package com.suneesh.trading.models.responses;
+
+import com.suneesh.trading.models.requests.SellExpiredContractsRequest;
+import com.google.gson.annotations.SerializedName;
+
+import java.util.Map;
+
+/**
+ * SellExpiredContractsResponse
+ *
+ * Sell expired contracts
+ *
+ * Sell expired contract response
+ *
+ *
+ * @author Morteza Tavanarad
+ * @version 1.0.0
+ * @since 8/9/2017
+ */
+public class SellExpiredContractsResponse extends ResponseBase {
+
+ /**
+ * Sell expired contract object containing count of contracts sold
+ */
+ @SerializedName("sell_expired")
+ private Map result;
+
+ public Integer getResult() {
+ return result.size() > 0 ? result.get("count") : new Integer(0);
+ }
+}
diff --git a/Trading/src/main/java/com/suneesh/trading/models/responses/SellReceipt.java b/Trading/src/main/java/com/suneesh/trading/models/responses/SellReceipt.java
new file mode 100644
index 0000000..d69f16b
--- /dev/null
+++ b/Trading/src/main/java/com/suneesh/trading/models/responses/SellReceipt.java
@@ -0,0 +1,63 @@
+package com.suneesh.trading.models.responses;
+
+import com.google.gson.annotations.SerializedName;
+
+import java.math.BigDecimal;
+
+/**
+ * @author Morteza Tavanarad
+ * @version 1.0.0
+ * @since 8/9/2017
+ */
+public class SellReceipt {
+
+ /**
+ * New account balance after completion of the sale
+ */
+ @SerializedName("balance_after")
+ private BigDecimal balanceAfter;
+
+ /**
+ * Internal contract identifier for the sold contract
+ */
+ @SerializedName("contract_id")
+ private Long contractId;
+
+ /**
+ * Actual effected sale price
+ */
+ @SerializedName("sold_for")
+ private BigDecimal soldFor;
+
+ /**
+ * Internal transaction identifier for the sale transaction
+ */
+ @SerializedName("transaction_id")
+ private Long transactionId;
+
+ /**
+ * Internal transaction identifier for the corresponding buy transaction
+ */
+ @SerializedName("reference_id")
+ private Long referenceId;
+
+ public BigDecimal getBalanceAfter() {
+ return balanceAfter;
+ }
+
+ public Long getContractId() {
+ return contractId;
+ }
+
+ public BigDecimal getSoldFor() {
+ return soldFor;
+ }
+
+ public Long getTransactionId() {
+ return transactionId;
+ }
+
+ public Long getReferenceId() {
+ return referenceId;
+ }
+}
\ No newline at end of file
diff --git a/Trading/src/main/java/com/suneesh/trading/models/responses/SetAccountCurrencyResponse.java b/Trading/src/main/java/com/suneesh/trading/models/responses/SetAccountCurrencyResponse.java
new file mode 100644
index 0000000..41cc772
--- /dev/null
+++ b/Trading/src/main/java/com/suneesh/trading/models/responses/SetAccountCurrencyResponse.java
@@ -0,0 +1,29 @@
+package com.suneesh.trading.models.responses;
+
+import com.suneesh.trading.models.requests.SetAccountCurrencyRequest;
+import com.google.gson.annotations.SerializedName;
+
+/**
+ * SetAccountCurrencyResponse
+ *
+ * Set Account Currency Response
+ *
+ * Status of set account currency call
+ *
+ *
+ * @author Morteza Tavanarad
+ * @version 1.0.0
+ * @since 9/4/2017
+ */
+public class SetAccountCurrencyResponse extends ResponseBase {
+
+ /**
+ * 1: success, 0: no change
+ */
+ @SerializedName("set_account_currency")
+ private Integer result;
+
+ public Integer getResult() {
+ return result;
+ }
+}
diff --git a/Trading/src/main/java/com/suneesh/trading/models/responses/SetAccountSettingsResponse.java b/Trading/src/main/java/com/suneesh/trading/models/responses/SetAccountSettingsResponse.java
new file mode 100644
index 0000000..ea93bd9
--- /dev/null
+++ b/Trading/src/main/java/com/suneesh/trading/models/responses/SetAccountSettingsResponse.java
@@ -0,0 +1,19 @@
+package com.suneesh.trading.models.responses;
+
+import com.suneesh.trading.models.requests.SetAccountSettingsRequest;
+import com.google.gson.annotations.SerializedName;
+
+/**
+ * @author Morteza Tavanarad
+ * @version 1.0.0
+ * @since 9/14/2017
+ */
+public class SetAccountSettingsResponse extends ResponseBase {
+
+ @SerializedName("set_settings")
+ private Integer result;
+
+ public Integer getResult() {
+ return result;
+ }
+}
diff --git a/Trading/src/main/java/com/suneesh/trading/models/responses/SetFinancialAssessmentResponse.java b/Trading/src/main/java/com/suneesh/trading/models/responses/SetFinancialAssessmentResponse.java
new file mode 100644
index 0000000..c784580
--- /dev/null
+++ b/Trading/src/main/java/com/suneesh/trading/models/responses/SetFinancialAssessmentResponse.java
@@ -0,0 +1,21 @@
+package com.suneesh.trading.models.responses;
+
+import com.suneesh.trading.models.requests.SetFinancialAssessmentRequest;
+import com.google.gson.annotations.SerializedName;
+
+import java.util.Map;
+
+/**
+ * @author Morteza Tavanarad
+ * @version 1.0.0
+ * @since 9/10/2017
+ */
+public class SetFinancialAssessmentResponse extends ResponseBase {
+
+ @SerializedName("set_financial_assessment")
+ private Map result;
+
+ public Map getResult() {
+ return result;
+ }
+}
diff --git a/Trading/src/main/java/com/suneesh/trading/models/responses/SetSelfExclusionSettingsResponse.java b/Trading/src/main/java/com/suneesh/trading/models/responses/SetSelfExclusionSettingsResponse.java
new file mode 100644
index 0000000..3c1dad2
--- /dev/null
+++ b/Trading/src/main/java/com/suneesh/trading/models/responses/SetSelfExclusionSettingsResponse.java
@@ -0,0 +1,19 @@
+package com.suneesh.trading.models.responses;
+
+import com.suneesh.trading.models.requests.SetSelfExclusionSettingsRequest;
+import com.google.gson.annotations.SerializedName;
+
+/**
+ * @author Morteza Tavanarad
+ * @version 1.0.0
+ * @since 9/12/2017
+ */
+public class SetSelfExclusionSettingsResponse extends ResponseBase {
+
+ @SerializedName("set_self_exclusion")
+ private Integer result;
+
+ public Integer getResult() {
+ return result;
+ }
+}
diff --git a/Trading/src/main/java/com/suneesh/trading/models/responses/StartCopyTradeResponse.java b/Trading/src/main/java/com/suneesh/trading/models/responses/StartCopyTradeResponse.java
new file mode 100644
index 0000000..a16a595
--- /dev/null
+++ b/Trading/src/main/java/com/suneesh/trading/models/responses/StartCopyTradeResponse.java
@@ -0,0 +1,29 @@
+package com.suneesh.trading.models.responses;
+
+import com.suneesh.trading.models.requests.StartCopyTradeRequest;
+import com.google.gson.annotations.SerializedName;
+
+/**
+ * StartCopyTradeResponse
+ *
+ * Copy Start Receive
+ *
+ * A message with results is received
+ *
+ *
+ * @author Morteza Tavanarad
+ * @version 1.0.0
+ * @since 8/9/2017
+ */
+public class StartCopyTradeResponse extends ResponseBase {
+
+ /**
+ * Copy start confirmation. Returns 1 is success.
+ */
+ @SerializedName("copy_start")
+ private Integer result;
+
+ public Integer getResult() {
+ return result;
+ }
+}
diff --git a/Trading/src/main/java/com/suneesh/trading/models/responses/State.java b/Trading/src/main/java/com/suneesh/trading/models/responses/State.java
new file mode 100644
index 0000000..188e2fa
--- /dev/null
+++ b/Trading/src/main/java/com/suneesh/trading/models/responses/State.java
@@ -0,0 +1,26 @@
+package com.suneesh.trading.models.responses;
+
+import com.google.gson.annotations.SerializedName;
+
+/**
+ * @author Morteza Tavanarad
+ * @version 1.0.0
+ * @since 8/2/2017
+ */
+public class State {
+
+ @SerializedName("value")
+ private String value;
+
+ @SerializedName("text")
+ private String text;
+
+ public String getText() {
+ return text;
+ }
+
+ public String getValue() {
+
+ return value;
+ }
+}
diff --git a/Trading/src/main/java/com/suneesh/trading/models/responses/Statement.java b/Trading/src/main/java/com/suneesh/trading/models/responses/Statement.java
new file mode 100644
index 0000000..5571022
--- /dev/null
+++ b/Trading/src/main/java/com/suneesh/trading/models/responses/Statement.java
@@ -0,0 +1,33 @@
+package com.suneesh.trading.models.responses;
+
+import com.google.gson.annotations.SerializedName;
+
+import java.util.List;
+
+/**
+ * @author Morteza Tavanarad
+ * @version 1.0.0
+ * @since 8/7/2017
+ */
+public class Statement {
+
+ /**
+ * Number of transactions returned in this call
+ */
+ @SerializedName("count")
+ private int count;
+
+ /**
+ * Array of returned transactions
+ */
+ @SerializedName("transactions")
+ private List transactions;
+
+ public int getCount() {
+ return count;
+ }
+
+ public List getTransactions() {
+ return transactions;
+ }
+}
diff --git a/Trading/src/main/java/com/suneesh/trading/models/responses/StatementResponse.java b/Trading/src/main/java/com/suneesh/trading/models/responses/StatementResponse.java
new file mode 100644
index 0000000..cfaf113
--- /dev/null
+++ b/Trading/src/main/java/com/suneesh/trading/models/responses/StatementResponse.java
@@ -0,0 +1,29 @@
+package com.suneesh.trading.models.responses;
+
+import com.suneesh.trading.models.requests.StatementRequest;
+import com.google.gson.annotations.SerializedName;
+
+/**
+ * StatementResponse
+ *
+ * Statement Receive
+ *
+ * A summary of account statement is received
+ *
+ *
+ * @author Morteza Tavanarad
+ * @version 1.0.0
+ * @since 8/7/2017
+ */
+public class StatementResponse extends ResponseBase {
+
+ /**
+ * Account statement.
+ */
+ @SerializedName("statement")
+ private Statement statement;
+
+ public Statement getStatement() {
+ return statement;
+ }
+}
diff --git a/Trading/src/main/java/com/suneesh/trading/models/responses/StatementTransaction.java b/Trading/src/main/java/com/suneesh/trading/models/responses/StatementTransaction.java
new file mode 100644
index 0000000..17e96af
--- /dev/null
+++ b/Trading/src/main/java/com/suneesh/trading/models/responses/StatementTransaction.java
@@ -0,0 +1,140 @@
+package com.suneesh.trading.models.responses;
+
+import com.google.gson.annotations.SerializedName;
+import io.reactivex.annotations.Nullable;
+
+import java.math.BigDecimal;
+
+/**
+ * @author Morteza Tavanarad
+ * @version 1.0.0
+ * @since 8/7/2017
+ */
+public class StatementTransaction {
+
+ /**
+ * It is the remaining balance Example: 10150.1300
+ */
+ @SerializedName("balance_after")
+ private BigDecimal balanceAfter;
+
+ /**
+ * It is the transaction id. In statement every contract (buy or sell) and every payment has a unique id.
+ * Example: 10867502908
+ */
+ @SerializedName("transaction_id")
+ private Long transactionId;
+
+ /**
+ * Internal transaction identifier for the corresponding buy transaction ( set only for contract selling )
+ */
+ @SerializedName("reference_id")
+ @Nullable
+ private Long referenceId;
+
+ /**
+ * It is the contract id Example: 4867502908
+ */
+ @SerializedName("contract_id")
+ @Nullable
+ private Long contractId;
+
+ /**
+ * It is the time of transaction Example: 1441175849
+ */
+ @SerializedName("transaction_time")
+ private int transactionTime;
+
+ /**
+ * Time at which contract was purchased, present only for sell transaction
+ */
+ @SerializedName("purchase_time")
+ private int purchaseTime;
+
+ /**
+ * It is the type of action Example: buy
+ */
+ @SerializedName("action_type")
+ private String actionType;
+
+ /**
+ * It is the amount of transaction Example: -83.2300
+ */
+ @SerializedName("amount")
+ private BigDecimal amount;
+
+ /**
+ * The description of contract purchased if description is set to 1
+ */
+ @SerializedName("longcode")
+ private String longCode;
+
+ /**
+ * Compact description of the contract purchased if description is set to 1
+ */
+ @SerializedName("shortcode")
+ @Nullable
+ private String shortCode;
+
+ /**
+ * Payout price
+ */
+ @SerializedName("payout")
+ @Nullable
+ private BigDecimal payout;
+
+ /**
+ * Id of an app where this transaction was performed. For example, it's 1 for binary.com.
+ */
+ @SerializedName("app_id")
+ @Nullable
+ private Integer applicationId;
+
+ public BigDecimal getBalanceAfter() {
+ return balanceAfter;
+ }
+
+ public Long getTransactionId() {
+ return transactionId;
+ }
+
+ public Long getReferenceId() {
+ return referenceId;
+ }
+
+ public Long getContractId() {
+ return contractId;
+ }
+
+ public int getTransactionTime() {
+ return transactionTime;
+ }
+
+ public int getPurchaseTime() {
+ return purchaseTime;
+ }
+
+ public String getActionType() {
+ return actionType;
+ }
+
+ public BigDecimal getAmount() {
+ return amount;
+ }
+
+ public String getLongCode() {
+ return longCode;
+ }
+
+ public String getShortCode() {
+ return shortCode;
+ }
+
+ public BigDecimal getPayout() {
+ return payout;
+ }
+
+ public Integer getApplicationId() {
+ return applicationId;
+ }
+}
diff --git a/Trading/src/main/java/com/suneesh/trading/models/responses/StatesListResponse.java b/Trading/src/main/java/com/suneesh/trading/models/responses/StatesListResponse.java
new file mode 100644
index 0000000..7e89337
--- /dev/null
+++ b/Trading/src/main/java/com/suneesh/trading/models/responses/StatesListResponse.java
@@ -0,0 +1,29 @@
+package com.suneesh.trading.models.responses;
+
+import com.suneesh.trading.models.requests.StatesListRequest;
+import com.google.gson.annotations.SerializedName;
+
+import java.util.List;
+
+/**
+ * StatesListResponse
+ *
+ * States List Receive
+ * A message with States List
+ *
+ * @author Morteza Tavanarad
+ * @version 1.0.0
+ * @since 8/2/2017
+ */
+public class StatesListResponse extends ResponseBase {
+
+ /**
+ * List of states.
+ */
+ @SerializedName("states_list")
+ private List statesList;
+
+ public List getStatesList() {
+ return statesList;
+ }
+}
diff --git a/Trading/src/main/java/com/suneesh/trading/models/responses/StopCopyTradeResponse.java b/Trading/src/main/java/com/suneesh/trading/models/responses/StopCopyTradeResponse.java
new file mode 100644
index 0000000..dc15c44
--- /dev/null
+++ b/Trading/src/main/java/com/suneesh/trading/models/responses/StopCopyTradeResponse.java
@@ -0,0 +1,29 @@
+package com.suneesh.trading.models.responses;
+
+import com.suneesh.trading.models.requests.StopCopyTradeRequest;
+import com.google.gson.annotations.SerializedName;
+
+/**
+ * StopCopyTradeResponse
+ *
+ * Copy Stop Receive
+ *
+ * A message with results is received
+ *
+ *
+ * @author Morteza Tavanarad
+ * @version 1.0.0
+ * @since 8/9/2017
+ */
+public class StopCopyTradeResponse extends ResponseBase {
+
+ /**
+ * Copy stopping confirmation. Returns 1 is success.
+ */
+ @SerializedName("copy_stop")
+ private Integer result;
+
+ public Integer getResult() {
+ return result;
+ }
+}
diff --git a/Trading/src/main/java/com/suneesh/trading/models/responses/SubAccount.java b/Trading/src/main/java/com/suneesh/trading/models/responses/SubAccount.java
new file mode 100644
index 0000000..9341cc2
--- /dev/null
+++ b/Trading/src/main/java/com/suneesh/trading/models/responses/SubAccount.java
@@ -0,0 +1,30 @@
+package com.suneesh.trading.models.responses;
+
+import com.google.gson.annotations.SerializedName;
+
+/**
+ * Created by morteza on 7/28/2017.
+ */
+public class SubAccount {
+ @SerializedName("loginid")
+ private String loginId;
+
+ @SerializedName("currency")
+ private String currency;
+
+ public String getLoginId() {
+ return loginId;
+ }
+
+ public void setLoginId(String loginId) {
+ this.loginId = loginId;
+ }
+
+ public String getCurrency() {
+ return currency;
+ }
+
+ public void setCurrency(String currency) {
+ this.currency = currency;
+ }
+}
diff --git a/Trading/src/main/java/com/suneesh/trading/models/responses/SubMarket.java b/Trading/src/main/java/com/suneesh/trading/models/responses/SubMarket.java
new file mode 100644
index 0000000..0d6440d
--- /dev/null
+++ b/Trading/src/main/java/com/suneesh/trading/models/responses/SubMarket.java
@@ -0,0 +1,27 @@
+package com.suneesh.trading.models.responses;
+
+import com.google.gson.annotations.SerializedName;
+
+import java.util.List;
+
+/**
+ * @author Morteza Tavanarad
+ * @version 1.0.0
+ * @since 8/3/2017
+ */
+public class SubMarket {
+
+ @SerializedName("name")
+ private String name;
+
+ @SerializedName("symbols")
+ private List symbols;
+
+ public String getName() {
+ return name;
+ }
+
+ public List getUnderlyings() {
+ return symbols;
+ }
+}
diff --git a/Trading/src/main/java/com/suneesh/trading/models/responses/TNCApprovalResponse.java b/Trading/src/main/java/com/suneesh/trading/models/responses/TNCApprovalResponse.java
new file mode 100644
index 0000000..ba58f07
--- /dev/null
+++ b/Trading/src/main/java/com/suneesh/trading/models/responses/TNCApprovalResponse.java
@@ -0,0 +1,23 @@
+package com.suneesh.trading.models.responses;
+
+import com.suneesh.trading.models.requests.TNCApprovalRequest;
+import com.google.gson.annotations.SerializedName;
+
+/**
+ * TNCApprovalResponse
+ *
+ * T&C Approval Receive
+ *
+ * @author Morteza Tavanarad
+ * @version 1.0.0
+ * @since 9/4/2017
+ */
+public class TNCApprovalResponse extends ResponseBase {
+
+ @SerializedName("tnc_approval")
+ private Integer result;
+
+ public Integer getResult() {
+ return result;
+ }
+}
diff --git a/Trading/src/main/java/com/suneesh/trading/models/responses/Tick.java b/Trading/src/main/java/com/suneesh/trading/models/responses/Tick.java
new file mode 100644
index 0000000..fa0313d
--- /dev/null
+++ b/Trading/src/main/java/com/suneesh/trading/models/responses/Tick.java
@@ -0,0 +1,104 @@
+package com.suneesh.trading.models.responses;
+
+import com.google.gson.annotations.Expose;
+import com.google.gson.annotations.SerializedName;
+import lombok.Data;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
+
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+
+/**
+ * Created by morteza on 7/19/2017.
+ */
+
+@Entity
+@Data
+public class Tick {
+ @SerializedName("id")
+ @Expose
+ @Id
+ @GeneratedValue(strategy = GenerationType.AUTO)
+ private Long id;
+
+ @SerializedName("ask")
+ @Expose
+ private
+ String ask;
+
+ @SerializedName("bid")
+ @Expose
+ private
+ String bid;
+
+// @SerializedName("id")
+// @Expose
+// private
+// String id;
+
+ @SerializedName("epoch")
+ @Expose
+ private
+ String epoch;
+
+ @SerializedName("quote")
+ @Expose
+ private
+ String quote;
+
+ @SerializedName("symbol")
+ @Expose
+ private
+ String symbol;
+
+ public String getAsk(){
+ return this.ask;
+ }
+
+ public String getBid(){
+ return this.bid;
+ }
+
+ public String getEpoch (){
+ return this.epoch;
+ }
+
+ public String getId(){
+ return String.valueOf(this.id);
+ }
+
+ public String getQuote(){
+ return this.quote;
+ }
+
+ public void setAsk(String ask) {
+ this.ask = ask;
+ }
+
+ public void setBid(String bid) {
+ this.bid = bid;
+ }
+
+ public void setEpoch(String epoch) {
+ this.epoch = epoch;
+ }
+
+ public void setId(String id) {
+ this.id = Long.valueOf(id);
+ }
+
+ public void setQuote(String quote) {
+ this.quote = quote;
+ }
+
+ public String getSymbol() {
+ return symbol;
+ }
+
+ public void setSymbol(String symbol) {
+ this.symbol = symbol;
+ }
+}
diff --git a/Trading/src/main/java/com/suneesh/trading/models/responses/TickHistoryResponse.java b/Trading/src/main/java/com/suneesh/trading/models/responses/TickHistoryResponse.java
new file mode 100644
index 0000000..9cafad4
--- /dev/null
+++ b/Trading/src/main/java/com/suneesh/trading/models/responses/TickHistoryResponse.java
@@ -0,0 +1,46 @@
+package com.suneesh.trading.models.responses;
+
+import com.suneesh.trading.models.requests.TickHistoryRequest;
+import com.google.gson.annotations.SerializedName;
+import io.reactivex.annotations.Nullable;
+
+import java.util.List;
+
+/**
+ * TickHistoryResponse
+ *
+ * Tick History Response
+ * Historic tick data for a single symbol
+ *
+ * @author Morteza Tavanarad
+ * @version 1.0.0
+ * @since 8/3/2017
+ */
+public class TickHistoryResponse extends ResponseBase {
+
+ /**
+ * Historic tick data for a given symbol
+ */
+ @SerializedName("history")
+ @Nullable
+ private History history;
+
+ public void setCandles(List candles) {
+ this.candles = candles;
+ }
+
+ /**
+ * Array of OHLC (open/high/low/close) price values for the given time (only for style='candles')
+ */
+ @SerializedName("candles")
+ @Nullable
+ private List candles;
+
+ public History getHistory() {
+ return history;
+ }
+
+ public List getCandles() {
+ return candles;
+ }
+}
diff --git a/Trading/src/main/java/com/suneesh/trading/models/responses/TickResponse.java b/Trading/src/main/java/com/suneesh/trading/models/responses/TickResponse.java
new file mode 100644
index 0000000..e0de944
--- /dev/null
+++ b/Trading/src/main/java/com/suneesh/trading/models/responses/TickResponse.java
@@ -0,0 +1,33 @@
+package com.suneesh.trading.models.responses;
+
+import com.suneesh.trading.models.requests.TickRequest;
+import com.google.gson.annotations.Expose;
+import com.google.gson.annotations.SerializedName;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+import org.springframework.context.annotation.ComponentScan;
+
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+
+/**
+ * Created by morteza on 7/19/2017.
+ */
+
+public class TickResponse extends ResponseBase {
+ @SerializedName("tick")
+ @Expose
+ private
+ Tick tick;
+
+ public Tick getTick() {
+ return tick;
+ }
+
+ public void setTick(Tick tick) {
+ this.tick = tick;
+ }
+}
diff --git a/Trading/src/main/java/com/suneesh/trading/models/responses/TimeResponse.java b/Trading/src/main/java/com/suneesh/trading/models/responses/TimeResponse.java
new file mode 100644
index 0000000..8289d44
--- /dev/null
+++ b/Trading/src/main/java/com/suneesh/trading/models/responses/TimeResponse.java
@@ -0,0 +1,24 @@
+package com.suneesh.trading.models.responses;
+
+import com.suneesh.trading.models.requests.TimeRequest;
+import com.google.gson.annotations.SerializedName;
+
+/**
+ * TimeResponse
+ *
+ * @author Morteza Tavanarad
+ * @version 1.0.0
+ * @since 8/3/2017
+ */
+public class TimeResponse extends ResponseBase {
+
+ /**
+ * Epoch of server time.
+ */
+ @SerializedName("time")
+ private int time;
+
+ public int getTime() {
+ return time;
+ }
+}
diff --git a/Trading/src/main/java/com/suneesh/trading/models/responses/TopUpVirtualMoneyAccountResponse.java b/Trading/src/main/java/com/suneesh/trading/models/responses/TopUpVirtualMoneyAccountResponse.java
new file mode 100644
index 0000000..a2e248d
--- /dev/null
+++ b/Trading/src/main/java/com/suneesh/trading/models/responses/TopUpVirtualMoneyAccountResponse.java
@@ -0,0 +1,33 @@
+package com.suneesh.trading.models.responses;
+
+import com.suneesh.trading.models.requests.TopUpVirtualMoneyAccountRequest;
+import com.google.gson.annotations.SerializedName;
+
+import java.math.BigDecimal;
+import java.util.Map;
+
+/**
+ * TopUpVirtualMoneyAccountResponse
+ *
+ * Top Up Virtual Response
+ *
+ * @author Morteza Tavanarad
+ * @version 1.0.0
+ * @since 8/9/2017
+ */
+public class TopUpVirtualMoneyAccountResponse extends ResponseBase {
+
+ /**
+ * Top Up Virtual Response
+ */
+ @SerializedName("topup_virtual")
+ private Map result;
+
+ public String getCurrency() {
+ return result.size() > 0 ? result.get("currency") : null;
+ }
+
+ public BigDecimal getAmount() {
+ return result.size() > 0 ? new BigDecimal(result.get("amount")) : null;
+ }
+}
diff --git a/Trading/src/main/java/com/suneesh/trading/models/responses/TradingPeriod.java b/Trading/src/main/java/com/suneesh/trading/models/responses/TradingPeriod.java
new file mode 100644
index 0000000..7a47330
--- /dev/null
+++ b/Trading/src/main/java/com/suneesh/trading/models/responses/TradingPeriod.java
@@ -0,0 +1,43 @@
+package com.suneesh.trading.models.responses;
+
+import com.google.gson.annotations.SerializedName;
+
+/**
+ * @author Morteza Tavanarad
+ * @version 1.0.0
+ * @since 8/1/2017
+ */
+public class TradingPeriod {
+ @SerializedName("date_start")
+ private DateStructure dateStart;
+
+ @SerializedName("date_expiry")
+ private DateStructure dateExpiry;
+
+ @SerializedName("duration")
+ private String duration;
+
+ public DateStructure getDateStart() {
+ return dateStart;
+ }
+
+ public void setDateStart(DateStructure dateStart) {
+ this.dateStart = dateStart;
+ }
+
+ public DateStructure getDateExpiry() {
+ return dateExpiry;
+ }
+
+ public void setDateExpiry(DateStructure dateExpiry) {
+ this.dateExpiry = dateExpiry;
+ }
+
+ public String getDuration() {
+ return duration;
+ }
+
+ public void setDuration(String duration) {
+ this.duration = duration;
+ }
+}
diff --git a/Trading/src/main/java/com/suneesh/trading/models/responses/TradingTimesResponse.java b/Trading/src/main/java/com/suneesh/trading/models/responses/TradingTimesResponse.java
new file mode 100644
index 0000000..3a4e1ef
--- /dev/null
+++ b/Trading/src/main/java/com/suneesh/trading/models/responses/TradingTimesResponse.java
@@ -0,0 +1,40 @@
+package com.suneesh.trading.models.responses;
+
+import com.suneesh.trading.models.requests.TradingTimesRequest;
+import com.google.gson.annotations.SerializedName;
+
+import java.util.List;
+
+/**
+ * TradingTimesResponse
+ *
+ * Trading Times Receive
+ * A message with Trading Times
+ *
+ * @author Morteza Tavanarad
+ * @version 1.0.0
+ * @since 8/3/2017
+ */
+public class TradingTimesResponse extends ResponseBase {
+
+ /**
+ * The trading times structure is a hierarchy as follows: Market -> SubMarket -> Underlyings
+ */
+ @SerializedName("trading_times")
+ private TradingTimes tradingTimes;
+
+ public TradingTimes getTradingTimes() {
+ return tradingTimes;
+ }
+
+
+ public class TradingTimes {
+
+ @SerializedName("markets")
+ private List markets;
+
+ public List