├── .gitignore ├── .gitlab-ci.yml ├── .travis.yml ├── README.md ├── docs ├── Bracketmodify.md ├── Bracketplace.md ├── Codmodify.md ├── Codplace.md ├── Ctdmodify.md ├── Ctdplace.md ├── ExistingMTFOrder.md ├── ExistingNormalOrder.md ├── ExistingOrder.md ├── ExistingSMOrder.md ├── ExistingSOROrder.md ├── Fault.md ├── Gtcmodify.md ├── Gtcplace.md ├── HistoricalApi.md ├── MarginApi.md ├── NewMTFOrder.md ├── NewNormalOrder.md ├── NewOrder.md ├── NewSMOrder.md ├── NewSOROrder.md ├── OrderApi.md ├── OrderInfo.md ├── PositionsApi.md ├── QuoteApi.md ├── ReportsApi.md ├── ReqMargin.md ├── SessionApi.md ├── Tslomodify.md ├── Tsloplace.md ├── UserCredentials.md └── UserDetails.md ├── git_push.sh ├── ks_api_client ├── __init__.py ├── api │ ├── __init__.py │ ├── historical_api.py │ ├── margin_api.py │ ├── margin_trading_api.py │ ├── mis_order_api.py │ ├── normal_order_api.py │ ├── order_api.py │ ├── positions_api.py │ ├── quote_api.py │ ├── reports_api.py │ ├── session_api.py │ ├── smart_order_routing_api.py │ └── super_multiple_order_api.py ├── api_client.py ├── configuration.py ├── exceptions.py ├── ks_api.py ├── models │ ├── __init__.py │ ├── bracketmodify.py │ ├── bracketplace.py │ ├── codmodify.py │ ├── codplace.py │ ├── ctdmodify.py │ ├── ctdplace.py │ ├── existing_mis_order.py │ ├── existing_mtf_order.py │ ├── existing_normal_order.py │ ├── existing_order.py │ ├── existing_sm_order.py │ ├── existing_sor_order.py │ ├── fault.py │ ├── gtcmodify.py │ ├── gtcplace.py │ ├── new_mis_order.py │ ├── new_mtf_order.py │ ├── new_normal_order.py │ ├── new_order.py │ ├── new_sm_order.py │ ├── new_sor_order.py │ ├── order_info.py │ ├── req_margin.py │ ├── tslomodify.py │ ├── tsloplace.py │ ├── user_credentials.py │ └── user_details.py ├── rest.py └── settings.py ├── requirements.txt ├── setup.cfg ├── setup.py ├── test-requirements.txt ├── test ├── __init__.py ├── test_api.py ├── test_bracketcancel.py ├── test_bracketmodify.py ├── test_bracketplace.py ├── test_buy.py ├── test_codcancel.py ├── test_codmodify.py ├── test_codplace.py ├── test_common_api.py ├── test_ctdmodify.py ├── test_ctdplace.py ├── test_depth.py ├── test_depth_buy.py ├── test_depth_sell.py ├── test_existing_mtf_order.py ├── test_existing_normal_order.py ├── test_existing_order.py ├── test_existing_sm_order.py ├── test_existing_sor_order.py ├── test_fault.py ├── test_gtccancel.py ├── test_gtcmodify.py ├── test_gtcplace.py ├── test_history.py ├── test_inline_response200.py ├── test_inline_response2001.py ├── test_inline_response2002.py ├── test_inline_response200_depth.py ├── test_inline_response200_depth_buy.py ├── test_inline_response200_ohlc.py ├── test_instrument.py ├── test_ltp_quote.py ├── test_margin_api.py ├── test_margin_det.py ├── test_margin_trading_api.py ├── test_market_details_quote.py ├── test_new_mtf_order.py ├── test_new_normal_order.py ├── test_new_order.py ├── test_new_sm_order.py ├── test_new_sor_order.py ├── test_normal_order_api.py ├── test_ohlc.py ├── test_ohlc_quote.py ├── test_open.py ├── test_order_api.py ├── test_order_info.py ├── test_orders.py ├── test_positions.py ├── test_positions_api.py ├── test_quote_api.py ├── test_reports_api.py ├── test_req_margin.py ├── test_res_login.py ├── test_res_logout.py ├── test_res_mtf_mod.py ├── test_res_mtf_order_cancel.py ├── test_res_new_mtf_order.py ├── test_res_new_normal_order.py ├── test_res_new_order.py ├── test_res_new_sm_order.py ├── test_res_new_sor_order.py ├── test_res_normal_order_cancel.py ├── test_res_normal_order_mod.py ├── test_res_order_cancel.py ├── test_res_order_mod.py ├── test_res_session2_fa.py ├── test_res_session_init.py ├── test_res_session_init_encryption.py ├── test_res_session_init_redirect.py ├── test_res_session_init_weblink.py ├── test_res_sm_order_cancel.py ├── test_res_sm_order_mod.py ├── test_res_sor_order_cancel.py ├── test_res_sor_order_mod.py ├── test_sell.py ├── test_session_api.py ├── test_smart_order_routing_api.py ├── test_sor.py ├── test_stocks.py ├── test_super_multiple_order_api.py ├── test_todays.py ├── test_trades.py ├── test_tslocancel.py ├── test_tslomodify.py ├── test_tsloplace.py ├── test_user_credentials.py └── test_user_details.py └── tox.ini /.gitignore: -------------------------------------------------------------------------------- 1 | # Byte-compiled / optimized / DLL files 2 | __pycache__/ 3 | *.py[cod] 4 | *$py.class 5 | 6 | # C extensions 7 | *.so 8 | 9 | # Distribution / packaging 10 | .Python 11 | env/ 12 | build/ 13 | develop-eggs/ 14 | dist/ 15 | downloads/ 16 | eggs/ 17 | .eggs/ 18 | lib/ 19 | lib64/ 20 | parts/ 21 | sdist/ 22 | var/ 23 | *.egg-info/ 24 | .installed.cfg 25 | *.egg 26 | 27 | # PyInstaller 28 | # Usually these files are written by a python script from a template 29 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 30 | *.manifest 31 | *.spec 32 | 33 | # Installer logs 34 | pip-log.txt 35 | pip-delete-this-directory.txt 36 | 37 | # Unit test / coverage reports 38 | htmlcov/ 39 | .tox/ 40 | .coverage 41 | .coverage.* 42 | .cache 43 | nosetests.xml 44 | coverage.xml 45 | *,cover 46 | .hypothesis/ 47 | venv/ 48 | .venv/ 49 | .python-version 50 | .pytest_cache 51 | 52 | # Translations 53 | *.mo 54 | *.pot 55 | 56 | # Django stuff: 57 | *.log 58 | 59 | # Sphinx documentation 60 | docs/_build/ 61 | 62 | # PyBuilder 63 | target/ 64 | 65 | #Ipython Notebook 66 | .ipynb_checkpoints 67 | -------------------------------------------------------------------------------- /.gitlab-ci.yml: -------------------------------------------------------------------------------- 1 | # ref: https://docs.gitlab.com/ee/ci/README.html 2 | 3 | stages: 4 | - test 5 | 6 | .nosetest: 7 | stage: test 8 | script: 9 | - pip install -r requirements.txt 10 | - pip install -r test-requirements.txt 11 | - pytest --cov=openapi_client 12 | 13 | nosetest-2.7: 14 | extends: .nosetest 15 | image: python:2.7-alpine 16 | nosetest-3.3: 17 | extends: .nosetest 18 | image: python:3.3-alpine 19 | nosetest-3.4: 20 | extends: .nosetest 21 | image: python:3.4-alpine 22 | nosetest-3.5: 23 | extends: .nosetest 24 | image: python:3.5-alpine 25 | nosetest-3.6: 26 | extends: .nosetest 27 | image: python:3.6-alpine 28 | nosetest-3.7: 29 | extends: .nosetest 30 | image: python:3.7-alpine 31 | nosetest-3.8: 32 | extends: .nosetest 33 | image: python:3.8-alpine 34 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | # ref: https://docs.travis-ci.com/user/languages/python 2 | language: python 3 | python: 4 | - "2.7" 5 | - "3.2" 6 | - "3.3" 7 | - "3.4" 8 | - "3.5" 9 | - "3.6" 10 | - "3.7" 11 | - "3.8" 12 | # command to install dependencies 13 | install: 14 | - "pip install -r requirements.txt" 15 | - "pip install -r test-requirements.txt" 16 | # command to run tests 17 | script: pytest --cov=openapi_client 18 | -------------------------------------------------------------------------------- /docs/Bracketmodify.md: -------------------------------------------------------------------------------- 1 | # Bracketmodify 2 | 3 | Bracket Order parmaeter for Product Bracket 4 | ## Properties 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **orderIndicator** | **int** | Order Indicator to modify Order | [optional] 8 | **Spread** | **float** | Spread of the order | [optional] 9 | **trailingPrice** | **float** | Triling price of TSLO Order. | [optional] 10 | **bookProfit** | **float** | Book Profit Price of the order | [optional] 11 | **bookDisclosedQty** | **int** | Quantity to be disclosed in bracket order | [optional] 12 | 13 | [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 14 | 15 | 16 | -------------------------------------------------------------------------------- /docs/Bracketplace.md: -------------------------------------------------------------------------------- 1 | # Bracketplace 2 | 3 | Bracket Order parmaeter for Product Bracket 4 | ## Properties 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **Spread** | **float** | Spread of the order | [optional] 8 | **trailingPrice** | **float** | Triling price of TSLO Order. | [optional] 9 | **bookProfit** | **float** | Book Profit Price of the order | [optional] 10 | **bookDisclosedQty** | **int** | Quantity to be disclosed in bracket order | [optional] 11 | 12 | [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 13 | 14 | 15 | -------------------------------------------------------------------------------- /docs/Codmodify.md: -------------------------------------------------------------------------------- 1 | # Codmodify 2 | 3 | Call of the day Order parmaeter for Product COD 4 | ## Properties 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **orderNo** | **str** | Order Number to modify | [optional] 8 | 9 | [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 10 | 11 | 12 | -------------------------------------------------------------------------------- /docs/Codplace.md: -------------------------------------------------------------------------------- 1 | # Codplace 2 | 3 | Call of the day Order parmaeter for Product COD 4 | ## Properties 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **squareOffFlag** | **int** | Square off flag for COD order, 1 to auto square off order. 0 - for no auto Square off by system. | [optional] 8 | 9 | [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 10 | 11 | 12 | -------------------------------------------------------------------------------- /docs/Ctdmodify.md: -------------------------------------------------------------------------------- 1 | # Ctdmodify 2 | 3 | Order parmaeter for Product CTD 4 | ## Properties 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **ConvertQuantity** | **int** | Quantity to convert to delivery | [optional] 8 | 9 | [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 10 | 11 | 12 | -------------------------------------------------------------------------------- /docs/Ctdplace.md: -------------------------------------------------------------------------------- 1 | # Ctdplace 2 | 3 | Order parmaeter for Product CTD 4 | ## Properties 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **ConvertQuantity** | **int** | Quantity to convert to delivery | [optional] 8 | 9 | [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 10 | 11 | 12 | -------------------------------------------------------------------------------- /docs/ExistingMTFOrder.md: -------------------------------------------------------------------------------- 1 | # ExistingMTFOrder 2 | 3 | ## Properties 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **orderId** | **str** | Order ID of the order to be modified | 7 | **quantity** | **int** | Order quantity - specified in same unit as quoted in market depth | [optional] 8 | **price** | **float** | Order Price, non zero positive for limit order and zero for market order | [optional] 9 | **disclosedQuantity** | **int** | Quantity to be disclosed in order | [optional] 10 | **triggerPrice** | **float** | Trigger price, required for stoploss or supermultiple order | [optional] 11 | 12 | [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 13 | 14 | 15 | -------------------------------------------------------------------------------- /docs/ExistingNormalOrder.md: -------------------------------------------------------------------------------- 1 | # ExistingNormalOrder 2 | 3 | ## Properties 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **orderId** | **str** | Order ID of the order to be modified | 7 | **quantity** | **int** | Order quantity - specified in same unit as quoted in market depth | [optional] 8 | **price** | **float** | Order Price, non zero positive for limit order and zero for market order | [optional] 9 | **disclosedQuantity** | **int** | Quantity to be disclosed in order | [optional] 10 | **triggerPrice** | **float** | Trigger price, required for stoploss or supermultiple order | [optional] 11 | 12 | [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 13 | 14 | 15 | -------------------------------------------------------------------------------- /docs/ExistingOrder.md: -------------------------------------------------------------------------------- 1 | # ExistingOrder 2 | 3 | ## Properties 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **orderId** | **str** | Order ID of the order to be modified | 7 | **quantity** | **int** | Order quantity - specified in same unit as quoted in market depth | [optional] 8 | **price** | **float** | Order Price, non zero positive for limit order and zero for market order | [optional] 9 | **disclosedQuantity** | **int** | Quantity to be disclosed in order | [optional] 10 | **triggerPrice** | **float** | Trigger price, required for stoploss or supermultiple order | [optional] 11 | **validity** | **str** | Validity of the order - GFD, IOC etc | [optional] 12 | **tslo** | [**Tslomodify**](Tslomodify.md) | | [optional] 13 | **bracket** | [**Bracketmodify**](Bracketmodify.md) | | [optional] 14 | **tslonew** | [**Tslomodify**](Tslomodify.md) | | [optional] 15 | **bracketnew** | [**Bracketmodify**](Bracketmodify.md) | | [optional] 16 | **gtc** | [**Gtcmodify**](Gtcmodify.md) | | [optional] 17 | **ctd** | [**Ctdmodify**](Ctdmodify.md) | | [optional] 18 | **cod** | [**Codmodify**](Codmodify.md) | | [optional] 19 | 20 | [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 21 | 22 | 23 | -------------------------------------------------------------------------------- /docs/ExistingSMOrder.md: -------------------------------------------------------------------------------- 1 | # ExistingSMOrder 2 | 3 | ## Properties 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **orderId** | **str** | Order ID of the order to be modified | 7 | **quantity** | **int** | Order quantity - specified in same unit as quoted in market depth | [optional] 8 | **price** | **float** | Order Price, non zero positive for limit order and zero for market order | [optional] 9 | **disclosedQuantity** | **int** | Quantity to be disclosed in order | [optional] 10 | **triggerPrice** | **float** | Trigger price, required for stoploss or supermultiple order | [optional] 11 | 12 | [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 13 | 14 | 15 | -------------------------------------------------------------------------------- /docs/ExistingSOROrder.md: -------------------------------------------------------------------------------- 1 | # ExistingSOROrder 2 | 3 | ## Properties 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **orderId** | **str** | Order ID of the order to be modified | 7 | **quantity** | **int** | Order quantity - specified in same unit as quoted in market depth | [optional] 8 | **price** | **float** | Order Price, non zero positive for limit order and zero for market order | [optional] 9 | **disclosedQuantity** | **int** | Quantity to be disclosed in order | [optional] 10 | **triggerPrice** | **float** | Trigger price, required for stoploss or supermultiple order | [optional] 11 | 12 | [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 13 | 14 | 15 | -------------------------------------------------------------------------------- /docs/Fault.md: -------------------------------------------------------------------------------- 1 | # Fault 2 | 3 | Fault Details 4 | ## Properties 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **code** | **int** | error code | [optional] 8 | **message** | **str** | error message | [optional] 9 | **description** | **str** | error description | [optional] 10 | 11 | [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 12 | 13 | 14 | -------------------------------------------------------------------------------- /docs/Gtcmodify.md: -------------------------------------------------------------------------------- 1 | # Gtcmodify 2 | 3 | Order parmaeter for Product GTC 4 | ## Properties 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **gtcOrderNo** | **str** | Order Number to modify | [optional] 8 | 9 | [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 10 | 11 | 12 | -------------------------------------------------------------------------------- /docs/Gtcplace.md: -------------------------------------------------------------------------------- 1 | # Gtcplace 2 | 3 | Order parmaeter for Product GTC 4 | ## Properties 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **closeDate** | **str** | Close date for GTC order till which order to be placed in exchange by system. | [optional] 8 | 9 | [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 10 | 11 | 12 | -------------------------------------------------------------------------------- /docs/HistoricalApi.md: -------------------------------------------------------------------------------- 1 | # ks_api_client.HistoricalApi 2 | 3 | All URIs are relative to *https://tradeapi.kotaksecurities.com/apim* 4 | 5 | Method | Description 6 | ------------- | ------------- 7 | [**history**](HistoricalApi.md#history) | Get historical data 8 | 9 | 10 | # **get_resource** 11 | > object history(resource, input) 12 | 13 | Get historical data based on given resource 14 | 15 | Get Historical data 16 | 17 | ### Example 18 | 19 | ```python 20 | from ks_api_client import ks_api 21 | 22 | client = ks_api.KSTradeApi(access_token = "access_token", userid = "userid", \ 23 | consumer_key = "consumer_key", ip = "IP", app_id = "app_id") 24 | 25 | #First initialize session and generate session token 26 | 27 | try: 28 | # Get historical prices 29 | client.history("historicalprices",{"exchange":"bse","cocode":"476","fromdate":"01-jan-2014","todate":"08-oct-2015"}) 30 | except Exception as e: 31 | print("Exception when calling Historical API->details: %s\n" % e) 32 | ``` 33 | 34 | ### Parameters 35 | 36 | Name | Type | Description | Notes 37 | ------------- | ------------- | ------------- | ------------- 38 | **resource** | **str**| | Type of resource historicalprices,historicalprices-unadjusted,NSEFNO_HistoricalContinuousChart,LiveorEODHistorical 39 | **input** | **str**| | Json as per resource selected 40 | 41 | ### Return type 42 | 43 | **object** 44 | 45 | 46 | ### HTTP request headers 47 | 48 | - **Accept**: application/json 49 | 50 | ### HTTP response details 51 | | Status code | Description | Response headers | 52 | |-------------|-------------|------------------| 53 | **200** | Historical Details | - | 54 | 55 | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) 56 | 57 | -------------------------------------------------------------------------------- /docs/MarginApi.md: -------------------------------------------------------------------------------- 1 | # ks_api_client.MarginApi 2 | 3 | All URIs are relative to *https://tradeapi.kotaksecurities.com/apim* 4 | 5 | Method | Description 6 | ------------- | ------------- 7 | [**margin_required**](MarginApi.md#margin_required) | Get Margin Required for an order by amount or quantity. 8 | 9 | 10 | # **margin_required** 11 | > object margin_required(transaction_type, order_info) 12 | 13 | Get Margin Required for an order by amount or quantity. 14 | 15 | Returns margin required for Equity, Super Multiple & MTF Order. 16 | 17 | ### Example 18 | 19 | 20 | ```python 21 | from ks_api_client import ks_api 22 | 23 | client = ks_api.KSTradeApi(access_token = "access_token", userid = "userid", \ 24 | consumer_key = "consumer_key", ip = "IP", app_id = "app_id") 25 | 26 | #First initialize session and generate session token 27 | 28 | try: 29 | # Get Margin Required for an order by amount or quantity. 30 | order_info = [ 31 | {"instrument_token": 727, "quantity": 1, "price": 1300, "amount": 0, "trigger_price": 1190}, 32 | {"instrument_token": 1374, "quantity": 1, "price": 1200, "amount": 0, "trigger_price": 1150} 33 | ] 34 | client.margin_required(transaction_type="BUY",order_info=order_info) 35 | except Exception as e: 36 | print("Exception when calling MarginApi->margin_required: %s\n" % e) 37 | ``` 38 | 39 | ### Parameters 40 | 41 | Name | Type | Description | Notes 42 | ------------- | ------------- | ------------- | ------------- 43 | **transaction_type** | **str** | Transaction Type - BUY or SELL | 44 | **order_info** | [**list[OrderInfo]**](OrderInfo.md) | | 45 | 46 | ### Return type 47 | 48 | **object** 49 | 50 | 51 | ### HTTP request headers 52 | 53 | - **Content-Type**: application/json 54 | - **Accept**: application/json 55 | 56 | ### HTTP response details 57 | | Status code | Description | Response headers | 58 | |-------------|-------------|------------------| 59 | **200** | Gets the Margin required by client for order. | - | 60 | **400** | Invalid or missing input parameters | - | 61 | **403** | Invalid session, please re-login to continue | - | 62 | **429** | Too many requests to the API | - | 63 | **500** | Unexpected error | - | 64 | **502** | Not able to communicate with OMS | - | 65 | **503** | Trade API service is unavailable | - | 66 | **504** | Gateway timeout, trade API is unreachable | - | 67 | 68 | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 69 | 70 | -------------------------------------------------------------------------------- /docs/NewMTFOrder.md: -------------------------------------------------------------------------------- 1 | # NewMTFOrder 2 | 3 | ## Properties 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **instrumentToken** | **int** | Instrument token of the scrip to be traded | [optional] 7 | **transactionType** | **str** | Transaction Type - BUY or SELL | [optional] 8 | **quantity** | **int** | Order quantity - specified in same unit as quoted in market depth | [optional] 9 | **price** | **float** | Order Price, non zero positive for limit order and zero for market order | [optional] 10 | **validity** | **str** | Validity of the order - GFD, IOC etc | [optional] 11 | **variety** | **str** | Variety of the order - REGULAR, AMO, SQUAREOFF - for Super Multiple Orders etc | [optional] 12 | **disclosedQuantity** | **int** | Quantity to be disclosed in order | [optional] 13 | **triggerPrice** | **float** | Trigger price, required for stoploss or supermultiple order | [optional] 14 | **tag** | **str** | Tag for this order | [optional] 15 | 16 | [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 17 | 18 | 19 | -------------------------------------------------------------------------------- /docs/NewNormalOrder.md: -------------------------------------------------------------------------------- 1 | # NewNormalOrder 2 | 3 | ## Properties 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **instrumentToken** | **int** | Instrument token of the scrip to be traded | [optional] 7 | **transactionType** | **str** | Transaction Type - BUY or SELL | [optional] 8 | **quantity** | **int** | Order quantity - specified in same unit as quoted in market depth | [optional] 9 | **price** | **float** | Order Price, non zero positive for limit order and zero for market order | [optional] 10 | **validity** | **str** | Validity of the order - GFD, IOC etc | [optional] 11 | **variety** | **str** | Variety of the order - REGULAR, AMO, SQUAREOFF - for Super Multiple Orders etc | [optional] 12 | **disclosedQuantity** | **int** | Quantity to be disclosed in order | [optional] 13 | **triggerPrice** | **float** | Trigger price, required for stoploss or supermultiple order | [optional] 14 | **tag** | **str** | Tag for this order | [optional] 15 | 16 | [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 17 | 18 | 19 | -------------------------------------------------------------------------------- /docs/NewOrder.md: -------------------------------------------------------------------------------- 1 | # NewOrder 2 | 3 | ## Properties 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **instrumentToken** | **int** | Instrument token of the scrip to be traded | [optional] 7 | **transactionType** | **str** | Transaction Type - BUY or SELL | [optional] 8 | **quantity** | **int** | Order quantity - specified in same unit as quoted in market depth | [optional] 9 | **price** | **float** | Order Price, non zero positive for limit order and zero for market order | [optional] 10 | **product** | **str** | Product type for this order - NORMAL, SUPERMULTIPLE, SUPERMULTIPLEOPTION, MTF | [optional] 11 | **validity** | **str** | Validity of the order - GFD, IOC etc | [optional] 12 | **variety** | **str** | Variety of the order - REGULAR, AMO, SQUAREOFF - for Super Multiple Orders etc | [optional] 13 | **disclosedQuantity** | **int** | Quantity to be disclosed in order | [optional] 14 | **triggerPrice** | **float** | Trigger price, required for stoploss or supermultiple order | [optional] 15 | **tslo** | [**Tsloplace**](Tsloplace.md) | | [optional] 16 | **bracket** | [**Bracketplace**](Bracketplace.md) | | [optional] 17 | **tslonew** | [**Tsloplace**](Tsloplace.md) | | [optional] 18 | **bracketnew** | [**Bracketplace**](Bracketplace.md) | | [optional] 19 | **gtc** | [**Gtcplace**](Gtcplace.md) | | [optional] 20 | **ctd** | [**Ctdplace**](Ctdplace.md) | | [optional] 21 | **cod** | [**Codplace**](Codplace.md) | | [optional] 22 | **tag** | **str** | Tag for this order | [optional] 23 | **smartOrderRouting** | **str** | smart Order Routing for this order | [optional] 24 | 25 | [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 26 | 27 | 28 | -------------------------------------------------------------------------------- /docs/NewSMOrder.md: -------------------------------------------------------------------------------- 1 | # NewSMOrder 2 | 3 | ## Properties 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **instrumentToken** | **int** | Instrument token of the scrip to be traded | [optional] 7 | **transactionType** | **str** | Transaction Type - BUY or SELL | [optional] 8 | **quantity** | **int** | Order quantity - specified in same unit as quoted in market depth | [optional] 9 | **price** | **float** | Order Price, non zero positive for limit order and zero for market order | [optional] 10 | **validity** | **str** | Validity of the order - GFD, IOC etc | [optional] 11 | **variety** | **str** | Variety of the order - REGULAR, AMO, SQUAREOFF - for Super Multiple Orders etc | [optional] 12 | **disclosedQuantity** | **int** | Quantity to be disclosed in order | [optional] 13 | **triggerPrice** | **float** | Trigger price, required for stoploss or supermultiple order | [optional] 14 | **tag** | **str** | Tag for this order | [optional] 15 | 16 | [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 17 | 18 | 19 | -------------------------------------------------------------------------------- /docs/NewSOROrder.md: -------------------------------------------------------------------------------- 1 | # NewSOROrder 2 | 3 | ## Properties 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **instrumentToken** | **int** | Instrument token of the scrip to be traded | [optional] 7 | **transactionType** | **str** | Transaction Type - BUY or SELL | [optional] 8 | **quantity** | **int** | Order quantity - specified in same unit as quoted in market depth | [optional] 9 | **price** | **float** | Order Price for SOR order is always zero i.e. Market Order | [optional] 10 | **validity** | **str** | Validity of the order - GFD for SOR by default | [optional] 11 | **variety** | **str** | Variety of the SOR order - REGULAR by Default. | [optional] 12 | **disclosedQuantity** | **int** | Quantity to be disclosed in order | [optional] 13 | **triggerPrice** | **float** | Trigger price, required for stoploss or supermultiple order | [optional] 14 | **tag** | **str** | Tag for this order | [optional] 15 | 16 | [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 17 | 18 | 19 | -------------------------------------------------------------------------------- /docs/OrderInfo.md: -------------------------------------------------------------------------------- 1 | # OrderInfo 2 | 3 | Order info for Margin Details 4 | ## Properties 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **instrumentToken** | **int** | Instrument token of the scrip to be traded | [optional] 8 | **quantity** | **int** | Order quantity - specified in same unit as quoted in market depth | [optional] 9 | **price** | **float** | Order Price, non zero positive for limit order and zero for market order | [optional] 10 | **amount** | **int** | Order Amount | [optional] 11 | **triggerPrice** | **float** | Trigger price, required for stoploss or supermultiple order | [optional] 12 | 13 | [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 14 | 15 | 16 | -------------------------------------------------------------------------------- /docs/PositionsApi.md: -------------------------------------------------------------------------------- 1 | # ks_api_client.PositionsApi 2 | 3 | All URIs are relative to *https://tradeapi.kotaksecurities.com/apim* 4 | 5 | Method | Description 6 | ------------- | ------------- 7 | [**positions**](PositionsApi.md#positions) | Get's positions. 8 | 9 | # **positions** 10 | > object positions(position_type) 11 | 12 | Get's positions. 13 | 14 | Return positions of provided position type. 15 | 16 | ### Example 17 | 18 | 19 | ```python 20 | 21 | from ks_api_client import ks_api 22 | 23 | client = ks_api.KSTradeApi(access_token = "access_token", userid = "userid", \ 24 | consumer_key = "consumer_key", ip = "IP", app_id = "app_id") 25 | 26 | #First initialize session and generate session token 27 | 28 | try: 29 | # Get's position by position_type. 30 | client.positions(position_type = "TODAYS") 31 | except Exception as e: 32 | print("Exception when calling PositionsApi->positions: %s\n" % e) 33 | ``` 34 | 35 | 36 | ### Parameters 37 | 38 | Name | Type | Description | Notes 39 | ------------- | ------------- | ------------- | ------------- 40 | **position_type** | **str**| Type of position - TODAYS, STOCKS, OPEN | 41 | 42 | ### Return type 43 | 44 | **object** 45 | 46 | 47 | ### HTTP request headers 48 | 49 | - **Accept**: application/json 50 | 51 | ### HTTP response details 52 | | Status code | Description | Response headers | 53 | |-------------|-------------|------------------| 54 | **200** | Gets the Positoin data for a client account. | - | 55 | **400** | Invalid or missing input parameters | - | 56 | **403** | Invalid session, please re-login to continue | - | 57 | **429** | Too many requests to the API | - | 58 | **500** | Unexpected error | - | 59 | **502** | Not able to communicate with OMS | - | 60 | **503** | Trade API service is unavailable | - | 61 | **504** | Gateway timeout, trade API is unreachable | - | 62 | 63 | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 64 | -------------------------------------------------------------------------------- /docs/QuoteApi.md: -------------------------------------------------------------------------------- 1 | # ks_api_client.QuoteApi 2 | 3 | All URIs are relative to *https://tradeapi.kotaksecurities.com/apim* 4 | 5 | Method | Description 6 | ------------- | ------------- 7 | [**quote**](QuoteApi.md#quote_details) | Get's Quotes. 8 | 9 | 10 | # **quote_details** 11 | > object quote(instrument_token, quote_type) 12 | 13 | Get Quote Details 14 | 15 | Returns full quote details in case quote_type is not provided 16 | else returns quote details of provided quote_type. 17 | 18 | ### Example 19 | 20 | 21 | ```python 22 | from ks_api_client import ks_api 23 | 24 | client = ks_api.KSTradeApi(access_token = "access_token", userid = "userid", \ 25 | consumer_key = "consumer_key", ip = "IP", app_id = "app_id") 26 | 27 | #First initialize session and generate session token 28 | 29 | try: 30 | # Get full quote details 31 | client.quote(instrument_token = 110) 32 | 33 | # Get quote details by quote_type 34 | client.quote(instrument_token = 110, quote_type = "LTP") 35 | except Exception as e: 36 | print("Exception when calling QuoteApi->quote_details: %s\n" % e) 37 | ``` 38 | 39 | ### Parameters 40 | 41 | Name | Type | Description | Notes 42 | ------------- | ------------- | ------------- | ------------- 43 | **instrument_token** | **str**| | 44 | **quote_type** | **str** | Type of Quote details - LTP, DEPTH, OHLC | [optional] 45 | 46 | ### Return type 47 | 48 | object 49 | 50 | 51 | ### HTTP request headers 52 | 53 | - **Accept**: application/json 54 | 55 | ### HTTP response details 56 | | Status code | Description | Response headers | 57 | |-------------|-------------|------------------| 58 | **200** | Quote fetched successfully | - | 59 | **400** | Invalid or missing input parameters | - | 60 | **403** | Invalid session, please re-login to continue | - | 61 | **429** | Too many requests to the API | - | 62 | **500** | Unexpected error | - | 63 | **502** | Not able to communicate with OMS | - | 64 | **503** | Trade API service is unavailable | - | 65 | **504** | Gateway timeout, trade API is unreachable | - | 66 | 67 | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 68 | 69 | -------------------------------------------------------------------------------- /docs/ReqMargin.md: -------------------------------------------------------------------------------- 1 | # ReqMargin 2 | 3 | ## Properties 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **transactionType** | **str** | Transaction Type - BUY or SELL | [optional] 7 | **orderInfo** | [**list[OrderInfo]**](OrderInfo.md) | | [optional] 8 | 9 | [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 10 | 11 | 12 | -------------------------------------------------------------------------------- /docs/Tslomodify.md: -------------------------------------------------------------------------------- 1 | # Tslomodify 2 | 3 | TSLO Order parmaeter for Product TSLO 4 | ## Properties 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **orderIndicator** | **int** | Order Indicator to modify Order | [optional] 8 | **spread** | **float** | Spread of the order | [optional] 9 | **trailingPrice** | **float** | Triling price of TSLO Order. | [optional] 10 | 11 | [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 12 | 13 | 14 | -------------------------------------------------------------------------------- /docs/Tsloplace.md: -------------------------------------------------------------------------------- 1 | # Tsloplace 2 | 3 | TSLO Order parmaeter for Product TSLO 4 | ## Properties 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **spread** | **float** | Spread of the order | [optional] 8 | **trailingPrice** | **float** | Triling price of TSLO Order. | [optional] 9 | 10 | [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 11 | 12 | 13 | -------------------------------------------------------------------------------- /docs/UserCredentials.md: -------------------------------------------------------------------------------- 1 | # UserCredentials 2 | 3 | ## Properties 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **userid** | **str** | Your KSEC userID | [optional] 7 | **password** | **str** | Your KSEC password | [optional] 8 | 9 | [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 10 | 11 | 12 | -------------------------------------------------------------------------------- /docs/UserDetails.md: -------------------------------------------------------------------------------- 1 | # UserDetails 2 | 3 | ## Properties 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **userid** | **str** | Userid for which access code validation | [optional] 7 | **accessCode** | **str** | Login access code received on email and mobile no | [optional] 8 | 9 | [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 10 | 11 | 12 | -------------------------------------------------------------------------------- /git_push.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ 3 | # 4 | # Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update" "gitlab.com" 5 | 6 | git_user_id=$1 7 | git_repo_id=$2 8 | release_note=$3 9 | git_host=$4 10 | 11 | if [ "$git_host" = "" ]; then 12 | git_host="github.com" 13 | echo "[INFO] No command line input provided. Set \$git_host to $git_host" 14 | fi 15 | 16 | if [ "$git_user_id" = "" ]; then 17 | git_user_id="GIT_USER_ID" 18 | echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" 19 | fi 20 | 21 | if [ "$git_repo_id" = "" ]; then 22 | git_repo_id="GIT_REPO_ID" 23 | echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" 24 | fi 25 | 26 | if [ "$release_note" = "" ]; then 27 | release_note="Minor update" 28 | echo "[INFO] No command line input provided. Set \$release_note to $release_note" 29 | fi 30 | 31 | # Initialize the local directory as a Git repository 32 | git init 33 | 34 | # Adds the files in the local repository and stages them for commit. 35 | git add . 36 | 37 | # Commits the tracked changes and prepares them to be pushed to a remote repository. 38 | git commit -m "$release_note" 39 | 40 | # Sets the new remote 41 | git_remote=`git remote` 42 | if [ "$git_remote" = "" ]; then # git remote not defined 43 | 44 | if [ "$GIT_TOKEN" = "" ]; then 45 | echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." 46 | git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git 47 | else 48 | git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git 49 | fi 50 | 51 | fi 52 | 53 | git pull origin master 54 | 55 | # Pushes (Forces) the changes in the local repository up to the remote repository 56 | echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" 57 | git push origin master 2>&1 | grep -v 'To https' 58 | 59 | -------------------------------------------------------------------------------- /ks_api_client/__init__.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | # flake8: noqa 4 | 5 | from __future__ import absolute_import 6 | 7 | __version__ = "1.0.0" 8 | 9 | # import apis into sdk package 10 | from ks_api_client.api.historical_api import HistoricalApi 11 | from ks_api_client.api.mis_order_api import MISOrderApi 12 | from ks_api_client.api.margin_api import MarginApi 13 | from ks_api_client.api.margin_trading_api import MarginTradingApi 14 | from ks_api_client.api.normal_order_api import NormalOrderApi 15 | from ks_api_client.api.order_api import OrderApi 16 | from ks_api_client.api.positions_api import PositionsApi 17 | from ks_api_client.api.quote_api import QuoteApi 18 | from ks_api_client.api.reports_api import ReportsApi 19 | from ks_api_client.api.session_api import SessionApi 20 | from ks_api_client.api.smart_order_routing_api import SmartOrderRoutingApi 21 | from ks_api_client.api.super_multiple_order_api import SuperMultipleOrderApi 22 | 23 | # import ApiClient 24 | from ks_api_client.api_client import ApiClient 25 | from ks_api_client.configuration import Configuration 26 | from ks_api_client.exceptions import OpenApiException 27 | from ks_api_client.exceptions import ApiTypeError 28 | from ks_api_client.exceptions import ApiValueError 29 | from ks_api_client.exceptions import ApiKeyError 30 | from ks_api_client.exceptions import ApiAttributeError 31 | from ks_api_client.exceptions import ApiException 32 | # import models into sdk package 33 | from ks_api_client.models.bracketmodify import Bracketmodify 34 | from ks_api_client.models.bracketplace import Bracketplace 35 | from ks_api_client.models.codmodify import Codmodify 36 | from ks_api_client.models.codplace import Codplace 37 | from ks_api_client.models.ctdmodify import Ctdmodify 38 | from ks_api_client.models.ctdplace import Ctdplace 39 | from ks_api_client.models.existing_mis_order import ExistingMISOrder 40 | from ks_api_client.models.existing_mtf_order import ExistingMTFOrder 41 | from ks_api_client.models.existing_normal_order import ExistingNormalOrder 42 | from ks_api_client.models.existing_order import ExistingOrder 43 | from ks_api_client.models.existing_sm_order import ExistingSMOrder 44 | from ks_api_client.models.existing_sor_order import ExistingSOROrder 45 | from ks_api_client.models.fault import Fault 46 | from ks_api_client.models.gtcmodify import Gtcmodify 47 | from ks_api_client.models.gtcplace import Gtcplace 48 | from ks_api_client.models.new_mis_order import NewMISOrder 49 | from ks_api_client.models.new_mtf_order import NewMTFOrder 50 | from ks_api_client.models.new_normal_order import NewNormalOrder 51 | from ks_api_client.models.new_order import NewOrder 52 | from ks_api_client.models.new_sm_order import NewSMOrder 53 | from ks_api_client.models.new_sor_order import NewSOROrder 54 | from ks_api_client.models.order_info import OrderInfo 55 | from ks_api_client.models.req_margin import ReqMargin 56 | from ks_api_client.models.tslomodify import Tslomodify 57 | from ks_api_client.models.tsloplace import Tsloplace 58 | from ks_api_client.models.user_credentials import UserCredentials 59 | from ks_api_client.models.user_details import UserDetails 60 | 61 | -------------------------------------------------------------------------------- /ks_api_client/api/__init__.py: -------------------------------------------------------------------------------- 1 | from __future__ import absolute_import 2 | 3 | # flake8: noqa 4 | 5 | # import apis into api package 6 | from ks_api_client.api.historical_api import HistoricalApi 7 | from ks_api_client.api.mis_order_api import MISOrderApi 8 | from ks_api_client.api.margin_api import MarginApi 9 | from ks_api_client.api.margin_trading_api import MarginTradingApi 10 | from ks_api_client.api.normal_order_api import NormalOrderApi 11 | from ks_api_client.api.order_api import OrderApi 12 | from ks_api_client.api.positions_api import PositionsApi 13 | from ks_api_client.api.quote_api import QuoteApi 14 | from ks_api_client.api.reports_api import ReportsApi 15 | from ks_api_client.api.session_api import SessionApi 16 | from ks_api_client.api.smart_order_routing_api import SmartOrderRoutingApi 17 | from ks_api_client.api.super_multiple_order_api import SuperMultipleOrderApi 18 | -------------------------------------------------------------------------------- /ks_api_client/models/__init__.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | # flake8: noqa 4 | 5 | from __future__ import absolute_import 6 | 7 | # import models into model package 8 | from ks_api_client.models.bracketmodify import Bracketmodify 9 | from ks_api_client.models.bracketplace import Bracketplace 10 | from ks_api_client.models.codmodify import Codmodify 11 | from ks_api_client.models.codplace import Codplace 12 | from ks_api_client.models.ctdmodify import Ctdmodify 13 | from ks_api_client.models.ctdplace import Ctdplace 14 | from ks_api_client.models.existing_mis_order import ExistingMISOrder 15 | from ks_api_client.models.existing_mtf_order import ExistingMTFOrder 16 | from ks_api_client.models.existing_normal_order import ExistingNormalOrder 17 | from ks_api_client.models.existing_order import ExistingOrder 18 | from ks_api_client.models.existing_sm_order import ExistingSMOrder 19 | from ks_api_client.models.existing_sor_order import ExistingSOROrder 20 | from ks_api_client.models.fault import Fault 21 | from ks_api_client.models.gtcmodify import Gtcmodify 22 | from ks_api_client.models.gtcplace import Gtcplace 23 | from ks_api_client.models.new_mis_order import NewMISOrder 24 | from ks_api_client.models.new_mtf_order import NewMTFOrder 25 | from ks_api_client.models.new_normal_order import NewNormalOrder 26 | from ks_api_client.models.new_order import NewOrder 27 | from ks_api_client.models.new_sm_order import NewSMOrder 28 | from ks_api_client.models.new_sor_order import NewSOROrder 29 | from ks_api_client.models.order_info import OrderInfo 30 | from ks_api_client.models.req_margin import ReqMargin 31 | from ks_api_client.models.tslomodify import Tslomodify 32 | from ks_api_client.models.tsloplace import Tsloplace 33 | from ks_api_client.models.user_credentials import UserCredentials 34 | from ks_api_client.models.user_details import UserDetails 35 | -------------------------------------------------------------------------------- /ks_api_client/models/codmodify.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | import pprint 4 | import re # noqa: F401 5 | 6 | import six 7 | 8 | from ks_api_client.configuration import Configuration 9 | 10 | 11 | class Codmodify(object): 12 | """ 13 | """ 14 | 15 | """ 16 | Attributes: 17 | openapi_types (dict): The key is attribute name 18 | and the value is attribute type. 19 | attribute_map (dict): The key is attribute name 20 | and the value is json key in definition. 21 | """ 22 | openapi_types = { 23 | 'orderNo': 'str' 24 | } 25 | 26 | attribute_map = { 27 | 'orderNo': 'orderNo' 28 | } 29 | 30 | def __init__(self, orderNo=None, local_vars_configuration=None): # noqa: E501 31 | """Codmodify - a model defined in OpenAPI""" # noqa: E501 32 | if local_vars_configuration is None: 33 | local_vars_configuration = Configuration() 34 | self.local_vars_configuration = local_vars_configuration 35 | 36 | self._orderNo = None 37 | self.discriminator = None 38 | 39 | if orderNo is not None: 40 | self.orderNo = orderNo 41 | 42 | @property 43 | def orderNo(self): 44 | """Gets the orderNo of this Codmodify. # noqa: E501 45 | 46 | Order Number to modify # noqa: E501 47 | 48 | :return: The orderNo of this Codmodify. # noqa: E501 49 | :rtype: str 50 | """ 51 | return self._orderNo 52 | 53 | @orderNo.setter 54 | def orderNo(self, orderNo): 55 | """Sets the orderNo of this Codmodify. 56 | 57 | Order Number to modify # noqa: E501 58 | 59 | :param orderNo: The orderNo of this Codmodify. # noqa: E501 60 | :type orderNo: str 61 | """ 62 | 63 | self._orderNo = orderNo 64 | 65 | def to_dict(self): 66 | """Returns the model properties as a dict""" 67 | result = {} 68 | 69 | for attr, _ in six.iteritems(self.openapi_types): 70 | value = getattr(self, attr) 71 | if isinstance(value, list): 72 | result[attr] = list(map( 73 | lambda x: x.to_dict() if hasattr(x, "to_dict") else x, 74 | value 75 | )) 76 | elif hasattr(value, "to_dict"): 77 | result[attr] = value.to_dict() 78 | elif isinstance(value, dict): 79 | result[attr] = dict(map( 80 | lambda item: (item[0], item[1].to_dict()) 81 | if hasattr(item[1], "to_dict") else item, 82 | value.items() 83 | )) 84 | else: 85 | result[attr] = value 86 | 87 | return result 88 | 89 | def to_str(self): 90 | """Returns the string representation of the model""" 91 | return pprint.pformat(self.to_dict()) 92 | 93 | def __repr__(self): 94 | """For `print` and `pprint`""" 95 | return self.to_str() 96 | 97 | def __eq__(self, other): 98 | """Returns true if both objects are equal""" 99 | if not isinstance(other, Codmodify): 100 | return False 101 | 102 | return self.to_dict() == other.to_dict() 103 | 104 | def __ne__(self, other): 105 | """Returns true if both objects are not equal""" 106 | if not isinstance(other, Codmodify): 107 | return True 108 | 109 | return self.to_dict() != other.to_dict() 110 | -------------------------------------------------------------------------------- /ks_api_client/models/codplace.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | import pprint 4 | import re # noqa: F401 5 | 6 | import six 7 | 8 | from ks_api_client.configuration import Configuration 9 | 10 | 11 | class Codplace(object): 12 | """ 13 | """ 14 | 15 | """ 16 | Attributes: 17 | openapi_types (dict): The key is attribute name 18 | and the value is attribute type. 19 | attribute_map (dict): The key is attribute name 20 | and the value is json key in definition. 21 | """ 22 | openapi_types = { 23 | 'squareOffFlag': 'int' 24 | } 25 | 26 | attribute_map = { 27 | 'squareOffFlag': 'squareOffFlag' 28 | } 29 | 30 | def __init__(self, squareOffFlag=None, local_vars_configuration=None): # noqa: E501 31 | """Codplace - a model defined in OpenAPI""" # noqa: E501 32 | if local_vars_configuration is None: 33 | local_vars_configuration = Configuration() 34 | self.local_vars_configuration = local_vars_configuration 35 | 36 | self._squareOffFlag = None 37 | self.discriminator = None 38 | 39 | if squareOffFlag is not None: 40 | self.squareOffFlag = squareOffFlag 41 | 42 | @property 43 | def squareOffFlag(self): 44 | """Gets the squareOffFlag of this Codplace. # noqa: E501 45 | 46 | Square off flag for COD order, 1 to auto square off order. 0 - for no auto Square off by system. # noqa: E501 47 | 48 | :return: The squareOffFlag of this Codplace. # noqa: E501 49 | :rtype: int 50 | """ 51 | return self._squareOffFlag 52 | 53 | @squareOffFlag.setter 54 | def squareOffFlag(self, squareOffFlag): 55 | """Sets the squareOffFlag of this Codplace. 56 | 57 | Square off flag for COD order, 1 to auto square off order. 0 - for no auto Square off by system. # noqa: E501 58 | 59 | :param squareOffFlag: The squareOffFlag of this Codplace. # noqa: E501 60 | :type squareOffFlag: int 61 | """ 62 | 63 | self._squareOffFlag = squareOffFlag 64 | 65 | def to_dict(self): 66 | """Returns the model properties as a dict""" 67 | result = {} 68 | 69 | for attr, _ in six.iteritems(self.openapi_types): 70 | value = getattr(self, attr) 71 | if isinstance(value, list): 72 | result[attr] = list(map( 73 | lambda x: x.to_dict() if hasattr(x, "to_dict") else x, 74 | value 75 | )) 76 | elif hasattr(value, "to_dict"): 77 | result[attr] = value.to_dict() 78 | elif isinstance(value, dict): 79 | result[attr] = dict(map( 80 | lambda item: (item[0], item[1].to_dict()) 81 | if hasattr(item[1], "to_dict") else item, 82 | value.items() 83 | )) 84 | else: 85 | result[attr] = value 86 | 87 | return result 88 | 89 | def to_str(self): 90 | """Returns the string representation of the model""" 91 | return pprint.pformat(self.to_dict()) 92 | 93 | def __repr__(self): 94 | """For `print` and `pprint`""" 95 | return self.to_str() 96 | 97 | def __eq__(self, other): 98 | """Returns true if both objects are equal""" 99 | if not isinstance(other, Codplace): 100 | return False 101 | 102 | return self.to_dict() == other.to_dict() 103 | 104 | def __ne__(self, other): 105 | """Returns true if both objects are not equal""" 106 | if not isinstance(other, Codplace): 107 | return True 108 | 109 | return self.to_dict() != other.to_dict() 110 | -------------------------------------------------------------------------------- /ks_api_client/models/ctdmodify.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | import pprint 4 | import re # noqa: F401 5 | 6 | import six 7 | 8 | from ks_api_client.configuration import Configuration 9 | 10 | 11 | class Ctdmodify(object): 12 | """ 13 | """ 14 | 15 | """ 16 | Attributes: 17 | openapi_types (dict): The key is attribute name 18 | and the value is attribute type. 19 | attribute_map (dict): The key is attribute name 20 | and the value is json key in definition. 21 | """ 22 | openapi_types = { 23 | 'ConvertQuantity': 'int' 24 | } 25 | 26 | attribute_map = { 27 | 'ConvertQuantity': 'ConvertQuantity' 28 | } 29 | 30 | def __init__(self, ConvertQuantity=None, local_vars_configuration=None): # noqa: E501 31 | """Ctdmodify - a model defined in OpenAPI""" # noqa: E501 32 | if local_vars_configuration is None: 33 | local_vars_configuration = Configuration() 34 | self.local_vars_configuration = local_vars_configuration 35 | 36 | self._ConvertQuantity = None 37 | self.discriminator = None 38 | 39 | if ConvertQuantity is not None: 40 | self.ConvertQuantity = ConvertQuantity 41 | 42 | @property 43 | def ConvertQuantity(self): 44 | """Gets the ConvertQuantity of this Ctdmodify. # noqa: E501 45 | 46 | Quantity to convert to delivery # noqa: E501 47 | 48 | :return: The ConvertQuantity of this Ctdmodify. # noqa: E501 49 | :rtype: int 50 | """ 51 | return self._ConvertQuantity 52 | 53 | @ConvertQuantity.setter 54 | def ConvertQuantity(self, ConvertQuantity): 55 | """Sets the ConvertQuantity of this Ctdmodify. 56 | 57 | Quantity to convert to delivery # noqa: E501 58 | 59 | :param ConvertQuantity: The ConvertQuantity of this Ctdmodify. # noqa: E501 60 | :type ConvertQuantity: int 61 | """ 62 | 63 | self._ConvertQuantity = ConvertQuantity 64 | 65 | def to_dict(self): 66 | """Returns the model properties as a dict""" 67 | result = {} 68 | 69 | for attr, _ in six.iteritems(self.openapi_types): 70 | value = getattr(self, attr) 71 | if isinstance(value, list): 72 | result[attr] = list(map( 73 | lambda x: x.to_dict() if hasattr(x, "to_dict") else x, 74 | value 75 | )) 76 | elif hasattr(value, "to_dict"): 77 | result[attr] = value.to_dict() 78 | elif isinstance(value, dict): 79 | result[attr] = dict(map( 80 | lambda item: (item[0], item[1].to_dict()) 81 | if hasattr(item[1], "to_dict") else item, 82 | value.items() 83 | )) 84 | else: 85 | result[attr] = value 86 | 87 | return result 88 | 89 | def to_str(self): 90 | """Returns the string representation of the model""" 91 | return pprint.pformat(self.to_dict()) 92 | 93 | def __repr__(self): 94 | """For `print` and `pprint`""" 95 | return self.to_str() 96 | 97 | def __eq__(self, other): 98 | """Returns true if both objects are equal""" 99 | if not isinstance(other, Ctdmodify): 100 | return False 101 | 102 | return self.to_dict() == other.to_dict() 103 | 104 | def __ne__(self, other): 105 | """Returns true if both objects are not equal""" 106 | if not isinstance(other, Ctdmodify): 107 | return True 108 | 109 | return self.to_dict() != other.to_dict() 110 | -------------------------------------------------------------------------------- /ks_api_client/models/ctdplace.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | import pprint 4 | import re # noqa: F401 5 | 6 | import six 7 | 8 | from ks_api_client.configuration import Configuration 9 | 10 | 11 | class Ctdplace(object): 12 | """ 13 | """ 14 | 15 | """ 16 | Attributes: 17 | openapi_types (dict): The key is attribute name 18 | and the value is attribute type. 19 | attribute_map (dict): The key is attribute name 20 | and the value is json key in definition. 21 | """ 22 | openapi_types = { 23 | 'ConvertQuantity': 'int' 24 | } 25 | 26 | attribute_map = { 27 | 'ConvertQuantity': 'ConvertQuantity' 28 | } 29 | 30 | def __init__(self, ConvertQuantity=None, local_vars_configuration=None): # noqa: E501 31 | """Ctdplace - a model defined in OpenAPI""" # noqa: E501 32 | if local_vars_configuration is None: 33 | local_vars_configuration = Configuration() 34 | self.local_vars_configuration = local_vars_configuration 35 | 36 | self._ConvertQuantity = None 37 | self.discriminator = None 38 | 39 | if ConvertQuantity is not None: 40 | self.ConvertQuantity = ConvertQuantity 41 | 42 | @property 43 | def ConvertQuantity(self): 44 | """Gets the ConvertQuantity of this Ctdplace. # noqa: E501 45 | 46 | Quantity to convert to delivery # noqa: E501 47 | 48 | :return: The ConvertQuantity of this Ctdplace. # noqa: E501 49 | :rtype: int 50 | """ 51 | return self._ConvertQuantity 52 | 53 | @ConvertQuantity.setter 54 | def ConvertQuantity(self, ConvertQuantity): 55 | """Sets the ConvertQuantity of this Ctdplace. 56 | 57 | Quantity to convert to delivery # noqa: E501 58 | 59 | :param ConvertQuantity: The ConvertQuantity of this Ctdplace. # noqa: E501 60 | :type ConvertQuantity: int 61 | """ 62 | 63 | self._ConvertQuantity = ConvertQuantity 64 | 65 | def to_dict(self): 66 | """Returns the model properties as a dict""" 67 | result = {} 68 | 69 | for attr, _ in six.iteritems(self.openapi_types): 70 | value = getattr(self, attr) 71 | if isinstance(value, list): 72 | result[attr] = list(map( 73 | lambda x: x.to_dict() if hasattr(x, "to_dict") else x, 74 | value 75 | )) 76 | elif hasattr(value, "to_dict"): 77 | result[attr] = value.to_dict() 78 | elif isinstance(value, dict): 79 | result[attr] = dict(map( 80 | lambda item: (item[0], item[1].to_dict()) 81 | if hasattr(item[1], "to_dict") else item, 82 | value.items() 83 | )) 84 | else: 85 | result[attr] = value 86 | 87 | return result 88 | 89 | def to_str(self): 90 | """Returns the string representation of the model""" 91 | return pprint.pformat(self.to_dict()) 92 | 93 | def __repr__(self): 94 | """For `print` and `pprint`""" 95 | return self.to_str() 96 | 97 | def __eq__(self, other): 98 | """Returns true if both objects are equal""" 99 | if not isinstance(other, Ctdplace): 100 | return False 101 | 102 | return self.to_dict() == other.to_dict() 103 | 104 | def __ne__(self, other): 105 | """Returns true if both objects are not equal""" 106 | if not isinstance(other, Ctdplace): 107 | return True 108 | 109 | return self.to_dict() != other.to_dict() 110 | -------------------------------------------------------------------------------- /ks_api_client/models/gtcmodify.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | import pprint 4 | import re # noqa: F401 5 | 6 | import six 7 | 8 | from ks_api_client.configuration import Configuration 9 | 10 | 11 | class Gtcmodify(object): 12 | """ 13 | """ 14 | 15 | """ 16 | Attributes: 17 | openapi_types (dict): The key is attribute name 18 | and the value is attribute type. 19 | attribute_map (dict): The key is attribute name 20 | and the value is json key in definition. 21 | """ 22 | openapi_types = { 23 | 'gtcOrderNo': 'str' 24 | } 25 | 26 | attribute_map = { 27 | 'gtcOrderNo': 'gtcOrderNo' 28 | } 29 | 30 | def __init__(self, gtcOrderNo=None, local_vars_configuration=None): # noqa: E501 31 | """Gtcmodify - a model defined in OpenAPI""" # noqa: E501 32 | if local_vars_configuration is None: 33 | local_vars_configuration = Configuration() 34 | self.local_vars_configuration = local_vars_configuration 35 | 36 | self._gtcOrderNo = None 37 | self.discriminator = None 38 | 39 | if gtcOrderNo is not None: 40 | self.gtcOrderNo = gtcOrderNo 41 | 42 | @property 43 | def gtcOrderNo(self): 44 | """Gets the gtcOrderNo of this Gtcmodify. # noqa: E501 45 | 46 | Order Number to modify # noqa: E501 47 | 48 | :return: The gtcOrderNo of this Gtcmodify. # noqa: E501 49 | :rtype: str 50 | """ 51 | return self._gtcOrderNo 52 | 53 | @gtcOrderNo.setter 54 | def gtcOrderNo(self, gtcOrderNo): 55 | """Sets the gtcOrderNo of this Gtcmodify. 56 | 57 | Order Number to modify # noqa: E501 58 | 59 | :param gtcOrderNo: The gtcOrderNo of this Gtcmodify. # noqa: E501 60 | :type gtcOrderNo: str 61 | """ 62 | 63 | self._gtcOrderNo = gtcOrderNo 64 | 65 | def to_dict(self): 66 | """Returns the model properties as a dict""" 67 | result = {} 68 | 69 | for attr, _ in six.iteritems(self.openapi_types): 70 | value = getattr(self, attr) 71 | if isinstance(value, list): 72 | result[attr] = list(map( 73 | lambda x: x.to_dict() if hasattr(x, "to_dict") else x, 74 | value 75 | )) 76 | elif hasattr(value, "to_dict"): 77 | result[attr] = value.to_dict() 78 | elif isinstance(value, dict): 79 | result[attr] = dict(map( 80 | lambda item: (item[0], item[1].to_dict()) 81 | if hasattr(item[1], "to_dict") else item, 82 | value.items() 83 | )) 84 | else: 85 | result[attr] = value 86 | 87 | return result 88 | 89 | def to_str(self): 90 | """Returns the string representation of the model""" 91 | return pprint.pformat(self.to_dict()) 92 | 93 | def __repr__(self): 94 | """For `print` and `pprint`""" 95 | return self.to_str() 96 | 97 | def __eq__(self, other): 98 | """Returns true if both objects are equal""" 99 | if not isinstance(other, Gtcmodify): 100 | return False 101 | 102 | return self.to_dict() == other.to_dict() 103 | 104 | def __ne__(self, other): 105 | """Returns true if both objects are not equal""" 106 | if not isinstance(other, Gtcmodify): 107 | return True 108 | 109 | return self.to_dict() != other.to_dict() 110 | -------------------------------------------------------------------------------- /ks_api_client/models/gtcplace.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | import pprint 4 | import re # noqa: F401 5 | 6 | import six 7 | 8 | from ks_api_client.configuration import Configuration 9 | 10 | 11 | class Gtcplace(object): 12 | """ 13 | """ 14 | 15 | """ 16 | Attributes: 17 | openapi_types (dict): The key is attribute name 18 | and the value is attribute type. 19 | attribute_map (dict): The key is attribute name 20 | and the value is json key in definition. 21 | """ 22 | openapi_types = { 23 | 'closeDate': 'str' 24 | } 25 | 26 | attribute_map = { 27 | 'closeDate': 'closeDate' 28 | } 29 | 30 | def __init__(self, closeDate=None, local_vars_configuration=None): # noqa: E501 31 | """Gtcplace - a model defined in OpenAPI""" # noqa: E501 32 | if local_vars_configuration is None: 33 | local_vars_configuration = Configuration() 34 | self.local_vars_configuration = local_vars_configuration 35 | 36 | self._closeDate = None 37 | self.discriminator = None 38 | 39 | if closeDate is not None: 40 | self.closeDate = closeDate 41 | 42 | @property 43 | def closeDate(self): 44 | """Gets the closeDate of this Gtcplace. # noqa: E501 45 | 46 | Close date for GTC order till which order to be placed in exchange by system. # noqa: E501 47 | 48 | :return: The closeDate of this Gtcplace. # noqa: E501 49 | :rtype: str 50 | """ 51 | return self._closeDate 52 | 53 | @closeDate.setter 54 | def closeDate(self, closeDate): 55 | """Sets the closeDate of this Gtcplace. 56 | 57 | Close date for GTC order till which order to be placed in exchange by system. # noqa: E501 58 | 59 | :param closeDate: The closeDate of this Gtcplace. # noqa: E501 60 | :type closeDate: str 61 | """ 62 | 63 | self._closeDate = closeDate 64 | 65 | def to_dict(self): 66 | """Returns the model properties as a dict""" 67 | result = {} 68 | 69 | for attr, _ in six.iteritems(self.openapi_types): 70 | value = getattr(self, attr) 71 | if isinstance(value, list): 72 | result[attr] = list(map( 73 | lambda x: x.to_dict() if hasattr(x, "to_dict") else x, 74 | value 75 | )) 76 | elif hasattr(value, "to_dict"): 77 | result[attr] = value.to_dict() 78 | elif isinstance(value, dict): 79 | result[attr] = dict(map( 80 | lambda item: (item[0], item[1].to_dict()) 81 | if hasattr(item[1], "to_dict") else item, 82 | value.items() 83 | )) 84 | else: 85 | result[attr] = value 86 | 87 | return result 88 | 89 | def to_str(self): 90 | """Returns the string representation of the model""" 91 | return pprint.pformat(self.to_dict()) 92 | 93 | def __repr__(self): 94 | """For `print` and `pprint`""" 95 | return self.to_str() 96 | 97 | def __eq__(self, other): 98 | """Returns true if both objects are equal""" 99 | if not isinstance(other, Gtcplace): 100 | return False 101 | 102 | return self.to_dict() == other.to_dict() 103 | 104 | def __ne__(self, other): 105 | """Returns true if both objects are not equal""" 106 | if not isinstance(other, Gtcplace): 107 | return True 108 | 109 | return self.to_dict() != other.to_dict() 110 | -------------------------------------------------------------------------------- /ks_api_client/settings.py: -------------------------------------------------------------------------------- 1 | host = "https://sbx.kotaksecurities.com/apim" 2 | access_token = "" 3 | userid = ""; 4 | consumer_key = ""; 5 | ip = "127.0.0.1"; 6 | app_id = ""; 7 | password = "@1" 8 | access_code = "" -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | certifi >= 14.05.14 2 | future; python_version<="2.7" 3 | six >= 1.10 4 | python_dateutil >= 2.5.3 5 | setuptools >= 21.0.0 6 | urllib3 >= 1.15.1 7 | -------------------------------------------------------------------------------- /setup.cfg: -------------------------------------------------------------------------------- 1 | [flake8] 2 | max-line-length=99 3 | -------------------------------------------------------------------------------- /setup.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | from setuptools import setup, find_packages # noqa: H301 4 | 5 | NAME = "ks-api-client" 6 | VERSION = "1.0.26" 7 | # To install the library, run the following 8 | # 9 | # python setup.py install 10 | # 11 | # prerequisite: setuptools 12 | # http://pypi.python.org/pypi/setuptools 13 | 14 | REQUIRES = ["urllib3 >= 1.15", "six >= 1.10", "certifi", "python-dateutil"] 15 | 16 | setup( 17 | name=NAME, 18 | version=VERSION, 19 | description="KS Trade API's", 20 | author="KS-Trade API", 21 | author_email="team@xyz.org", 22 | url="", 23 | keywords=["KS-Trade API", "KS Trade API's"], 24 | install_requires=REQUIRES, 25 | packages=find_packages(exclude=["test", "tests"]), 26 | include_package_data=True, 27 | long_description="""\ 28 | """ 29 | ) 30 | -------------------------------------------------------------------------------- /test-requirements.txt: -------------------------------------------------------------------------------- 1 | pytest~=4.6.7 # needed for python 2.7+3.4 2 | pytest-cov>=2.8.1 3 | pytest-randomly==1.2.3 # needed for python 2.7+3.4 4 | -------------------------------------------------------------------------------- /test/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/osparamatrix/ks-orderapi-python/6e7a516f8a029393b2cbf0fec7cfeeeefae84cc3/test/__init__.py -------------------------------------------------------------------------------- /test/test_bracketcancel.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Session-Order-Margin-API 5 | 6 | No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 7 | 8 | The version of the OpenAPI document: 1.0 9 | Generated by: https://openapi-generator.tech 10 | """ 11 | 12 | 13 | from __future__ import absolute_import 14 | 15 | import unittest 16 | import datetime 17 | 18 | import openapi_client 19 | from openapi_client.models.bracketcancel import Bracketcancel # noqa: E501 20 | from openapi_client.rest import ApiException 21 | 22 | class TestBracketcancel(unittest.TestCase): 23 | """Bracketcancel unit test stubs""" 24 | 25 | def setUp(self): 26 | pass 27 | 28 | def tearDown(self): 29 | pass 30 | 31 | def make_instance(self, include_optional): 32 | """Test Bracketcancel 33 | include_option is a boolean, when False only required 34 | params are included, when True both required and 35 | optional params are included """ 36 | # model = openapi_client.models.bracketcancel.Bracketcancel() # noqa: E501 37 | if include_optional : 38 | return Bracketcancel( 39 | orderIndicator = 56 40 | ) 41 | else : 42 | return Bracketcancel( 43 | ) 44 | 45 | def testBracketcancel(self): 46 | """Test Bracketcancel""" 47 | inst_req_only = self.make_instance(include_optional=False) 48 | inst_req_and_optional = self.make_instance(include_optional=True) 49 | 50 | 51 | if __name__ == '__main__': 52 | unittest.main() 53 | -------------------------------------------------------------------------------- /test/test_bracketmodify.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Session-Order-Margin-API 5 | 6 | No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 7 | 8 | The version of the OpenAPI document: 1.0 9 | Generated by: https://openapi-generator.tech 10 | """ 11 | 12 | 13 | from __future__ import absolute_import 14 | 15 | import unittest 16 | import datetime 17 | 18 | import openapi_client 19 | from openapi_client.models.bracketmodify import Bracketmodify # noqa: E501 20 | from openapi_client.rest import ApiException 21 | 22 | class TestBracketmodify(unittest.TestCase): 23 | """Bracketmodify unit test stubs""" 24 | 25 | def setUp(self): 26 | pass 27 | 28 | def tearDown(self): 29 | pass 30 | 31 | def make_instance(self, include_optional): 32 | """Test Bracketmodify 33 | include_option is a boolean, when False only required 34 | params are included, when True both required and 35 | optional params are included """ 36 | # model = openapi_client.models.bracketmodify.Bracketmodify() # noqa: E501 37 | if include_optional : 38 | return Bracketmodify( 39 | orderIndicator = 56, 40 | Spread = 1.337, 41 | trailingPrice = 1.337, 42 | bookProfit = 1.337, 43 | bookDisclosedQty = 56 44 | ) 45 | else : 46 | return Bracketmodify( 47 | ) 48 | 49 | def testBracketmodify(self): 50 | """Test Bracketmodify""" 51 | inst_req_only = self.make_instance(include_optional=False) 52 | inst_req_and_optional = self.make_instance(include_optional=True) 53 | 54 | 55 | if __name__ == '__main__': 56 | unittest.main() 57 | -------------------------------------------------------------------------------- /test/test_bracketplace.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Session-Order-Margin-API 5 | 6 | No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 7 | 8 | The version of the OpenAPI document: 1.0 9 | Generated by: https://openapi-generator.tech 10 | """ 11 | 12 | 13 | from __future__ import absolute_import 14 | 15 | import unittest 16 | import datetime 17 | 18 | import openapi_client 19 | from openapi_client.models.bracketplace import Bracketplace # noqa: E501 20 | from openapi_client.rest import ApiException 21 | 22 | class TestBracketplace(unittest.TestCase): 23 | """Bracketplace unit test stubs""" 24 | 25 | def setUp(self): 26 | pass 27 | 28 | def tearDown(self): 29 | pass 30 | 31 | def make_instance(self, include_optional): 32 | """Test Bracketplace 33 | include_option is a boolean, when False only required 34 | params are included, when True both required and 35 | optional params are included """ 36 | # model = openapi_client.models.bracketplace.Bracketplace() # noqa: E501 37 | if include_optional : 38 | return Bracketplace( 39 | Spread = 1.337, 40 | trailingPrice = 1.337, 41 | bookProfit = 1.337, 42 | bookDisclosedQty = 56 43 | ) 44 | else : 45 | return Bracketplace( 46 | ) 47 | 48 | def testBracketplace(self): 49 | """Test Bracketplace""" 50 | inst_req_only = self.make_instance(include_optional=False) 51 | inst_req_and_optional = self.make_instance(include_optional=True) 52 | 53 | 54 | if __name__ == '__main__': 55 | unittest.main() 56 | -------------------------------------------------------------------------------- /test/test_buy.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | KS Trade API's 5 | 6 | No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 7 | 8 | The version of the OpenAPI document: 1.0 9 | Generated by: https://openapi-generator.tech 10 | """ 11 | 12 | 13 | from __future__ import absolute_import 14 | 15 | import unittest 16 | import datetime 17 | 18 | import openapi_client 19 | from openapi_client.models.buy import Buy # noqa: E501 20 | from openapi_client.rest import ApiException 21 | 22 | class TestBuy(unittest.TestCase): 23 | """Buy unit test stubs""" 24 | 25 | def setUp(self): 26 | pass 27 | 28 | def tearDown(self): 29 | pass 30 | 31 | def make_instance(self, include_optional): 32 | """Test Buy 33 | include_option is a boolean, when False only required 34 | params are included, when True both required and 35 | optional params are included """ 36 | # model = openapi_client.models.buy.Buy() # noqa: E501 37 | if include_optional : 38 | return Buy( 39 | price = 1.337, 40 | quantity = 56, 41 | orders = 56 42 | ) 43 | else : 44 | return Buy( 45 | ) 46 | 47 | def testBuy(self): 48 | """Test Buy""" 49 | inst_req_only = self.make_instance(include_optional=False) 50 | inst_req_and_optional = self.make_instance(include_optional=True) 51 | 52 | 53 | if __name__ == '__main__': 54 | unittest.main() 55 | -------------------------------------------------------------------------------- /test/test_codcancel.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Session-Order-Margin-API 5 | 6 | No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 7 | 8 | The version of the OpenAPI document: 1.0 9 | Generated by: https://openapi-generator.tech 10 | """ 11 | 12 | 13 | from __future__ import absolute_import 14 | 15 | import unittest 16 | import datetime 17 | 18 | import openapi_client 19 | from openapi_client.models.codcancel import Codcancel # noqa: E501 20 | from openapi_client.rest import ApiException 21 | 22 | class TestCodcancel(unittest.TestCase): 23 | """Codcancel unit test stubs""" 24 | 25 | def setUp(self): 26 | pass 27 | 28 | def tearDown(self): 29 | pass 30 | 31 | def make_instance(self, include_optional): 32 | """Test Codcancel 33 | include_option is a boolean, when False only required 34 | params are included, when True both required and 35 | optional params are included """ 36 | # model = openapi_client.models.codcancel.Codcancel() # noqa: E501 37 | if include_optional : 38 | return Codcancel( 39 | orderNo = '0' 40 | ) 41 | else : 42 | return Codcancel( 43 | ) 44 | 45 | def testCodcancel(self): 46 | """Test Codcancel""" 47 | inst_req_only = self.make_instance(include_optional=False) 48 | inst_req_and_optional = self.make_instance(include_optional=True) 49 | 50 | 51 | if __name__ == '__main__': 52 | unittest.main() 53 | -------------------------------------------------------------------------------- /test/test_codmodify.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Session-Order-Margin-API 5 | 6 | No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 7 | 8 | The version of the OpenAPI document: 1.0 9 | Generated by: https://openapi-generator.tech 10 | """ 11 | 12 | 13 | from __future__ import absolute_import 14 | 15 | import unittest 16 | import datetime 17 | 18 | import openapi_client 19 | from openapi_client.models.codmodify import Codmodify # noqa: E501 20 | from openapi_client.rest import ApiException 21 | 22 | class TestCodmodify(unittest.TestCase): 23 | """Codmodify unit test stubs""" 24 | 25 | def setUp(self): 26 | pass 27 | 28 | def tearDown(self): 29 | pass 30 | 31 | def make_instance(self, include_optional): 32 | """Test Codmodify 33 | include_option is a boolean, when False only required 34 | params are included, when True both required and 35 | optional params are included """ 36 | # model = openapi_client.models.codmodify.Codmodify() # noqa: E501 37 | if include_optional : 38 | return Codmodify( 39 | orderNo = '0' 40 | ) 41 | else : 42 | return Codmodify( 43 | ) 44 | 45 | def testCodmodify(self): 46 | """Test Codmodify""" 47 | inst_req_only = self.make_instance(include_optional=False) 48 | inst_req_and_optional = self.make_instance(include_optional=True) 49 | 50 | 51 | if __name__ == '__main__': 52 | unittest.main() 53 | -------------------------------------------------------------------------------- /test/test_codplace.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Session-Order-Margin-API 5 | 6 | No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 7 | 8 | The version of the OpenAPI document: 1.0 9 | Generated by: https://openapi-generator.tech 10 | """ 11 | 12 | 13 | from __future__ import absolute_import 14 | 15 | import unittest 16 | import datetime 17 | 18 | import openapi_client 19 | from openapi_client.models.codplace import Codplace # noqa: E501 20 | from openapi_client.rest import ApiException 21 | 22 | class TestCodplace(unittest.TestCase): 23 | """Codplace unit test stubs""" 24 | 25 | def setUp(self): 26 | pass 27 | 28 | def tearDown(self): 29 | pass 30 | 31 | def make_instance(self, include_optional): 32 | """Test Codplace 33 | include_option is a boolean, when False only required 34 | params are included, when True both required and 35 | optional params are included """ 36 | # model = openapi_client.models.codplace.Codplace() # noqa: E501 37 | if include_optional : 38 | return Codplace( 39 | squareOffFlag = 56 40 | ) 41 | else : 42 | return Codplace( 43 | ) 44 | 45 | def testCodplace(self): 46 | """Test Codplace""" 47 | inst_req_only = self.make_instance(include_optional=False) 48 | inst_req_and_optional = self.make_instance(include_optional=True) 49 | 50 | 51 | if __name__ == '__main__': 52 | unittest.main() 53 | -------------------------------------------------------------------------------- /test/test_ctdmodify.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Session-Order-Margin-API 5 | 6 | No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 7 | 8 | The version of the OpenAPI document: 1.0 9 | Generated by: https://openapi-generator.tech 10 | """ 11 | 12 | 13 | from __future__ import absolute_import 14 | 15 | import unittest 16 | import datetime 17 | 18 | import openapi_client 19 | from openapi_client.models.ctdmodify import Ctdmodify # noqa: E501 20 | from openapi_client.rest import ApiException 21 | 22 | class TestCtdmodify(unittest.TestCase): 23 | """Ctdmodify unit test stubs""" 24 | 25 | def setUp(self): 26 | pass 27 | 28 | def tearDown(self): 29 | pass 30 | 31 | def make_instance(self, include_optional): 32 | """Test Ctdmodify 33 | include_option is a boolean, when False only required 34 | params are included, when True both required and 35 | optional params are included """ 36 | # model = openapi_client.models.ctdmodify.Ctdmodify() # noqa: E501 37 | if include_optional : 38 | return Ctdmodify( 39 | ConvertQuantity = 56 40 | ) 41 | else : 42 | return Ctdmodify( 43 | ) 44 | 45 | def testCtdmodify(self): 46 | """Test Ctdmodify""" 47 | inst_req_only = self.make_instance(include_optional=False) 48 | inst_req_and_optional = self.make_instance(include_optional=True) 49 | 50 | 51 | if __name__ == '__main__': 52 | unittest.main() 53 | -------------------------------------------------------------------------------- /test/test_ctdplace.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Session-Order-Margin-API 5 | 6 | No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 7 | 8 | The version of the OpenAPI document: 1.0 9 | Generated by: https://openapi-generator.tech 10 | """ 11 | 12 | 13 | from __future__ import absolute_import 14 | 15 | import unittest 16 | import datetime 17 | 18 | import openapi_client 19 | from openapi_client.models.ctdplace import Ctdplace # noqa: E501 20 | from openapi_client.rest import ApiException 21 | 22 | class TestCtdplace(unittest.TestCase): 23 | """Ctdplace unit test stubs""" 24 | 25 | def setUp(self): 26 | pass 27 | 28 | def tearDown(self): 29 | pass 30 | 31 | def make_instance(self, include_optional): 32 | """Test Ctdplace 33 | include_option is a boolean, when False only required 34 | params are included, when True both required and 35 | optional params are included """ 36 | # model = openapi_client.models.ctdplace.Ctdplace() # noqa: E501 37 | if include_optional : 38 | return Ctdplace( 39 | ConvertQuantity = 56 40 | ) 41 | else : 42 | return Ctdplace( 43 | ) 44 | 45 | def testCtdplace(self): 46 | """Test Ctdplace""" 47 | inst_req_only = self.make_instance(include_optional=False) 48 | inst_req_and_optional = self.make_instance(include_optional=True) 49 | 50 | 51 | if __name__ == '__main__': 52 | unittest.main() 53 | -------------------------------------------------------------------------------- /test/test_depth.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | KS Trade API's 5 | 6 | No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 7 | 8 | The version of the OpenAPI document: 1.0 9 | Generated by: https://openapi-generator.tech 10 | """ 11 | 12 | 13 | from __future__ import absolute_import 14 | 15 | import unittest 16 | import datetime 17 | 18 | import openapi_client 19 | from openapi_client.models.depth import Depth # noqa: E501 20 | from openapi_client.rest import ApiException 21 | 22 | class TestDepth(unittest.TestCase): 23 | """Depth unit test stubs""" 24 | 25 | def setUp(self): 26 | pass 27 | 28 | def tearDown(self): 29 | pass 30 | 31 | def make_instance(self, include_optional): 32 | """Test Depth 33 | include_option is a boolean, when False only required 34 | params are included, when True both required and 35 | optional params are included """ 36 | # model = openapi_client.models.depth.Depth() # noqa: E501 37 | if include_optional : 38 | return Depth( 39 | buy = openapi_client.models.depth_buy.DepthBuy( 40 | price = 1.337, 41 | quantity = 56, 42 | orders = 56, ), 43 | sell = openapi_client.models.depth_sell.DepthSell( 44 | price = 1.337, 45 | quantity = 56, 46 | orders = 56, ) 47 | ) 48 | else : 49 | return Depth( 50 | ) 51 | 52 | def testDepth(self): 53 | """Test Depth""" 54 | inst_req_only = self.make_instance(include_optional=False) 55 | inst_req_and_optional = self.make_instance(include_optional=True) 56 | 57 | 58 | if __name__ == '__main__': 59 | unittest.main() 60 | -------------------------------------------------------------------------------- /test/test_depth_buy.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | KS Trade API's 5 | 6 | No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 7 | 8 | The version of the OpenAPI document: 1.0 9 | Generated by: https://openapi-generator.tech 10 | """ 11 | 12 | 13 | from __future__ import absolute_import 14 | 15 | import unittest 16 | import datetime 17 | 18 | import openapi_client 19 | from openapi_client.models.depth_buy import DepthBuy # noqa: E501 20 | from openapi_client.rest import ApiException 21 | 22 | class TestDepthBuy(unittest.TestCase): 23 | """DepthBuy unit test stubs""" 24 | 25 | def setUp(self): 26 | pass 27 | 28 | def tearDown(self): 29 | pass 30 | 31 | def make_instance(self, include_optional): 32 | """Test DepthBuy 33 | include_option is a boolean, when False only required 34 | params are included, when True both required and 35 | optional params are included """ 36 | # model = openapi_client.models.depth_buy.DepthBuy() # noqa: E501 37 | if include_optional : 38 | return DepthBuy( 39 | price = 1.337, 40 | quantity = 56, 41 | orders = 56 42 | ) 43 | else : 44 | return DepthBuy( 45 | ) 46 | 47 | def testDepthBuy(self): 48 | """Test DepthBuy""" 49 | inst_req_only = self.make_instance(include_optional=False) 50 | inst_req_and_optional = self.make_instance(include_optional=True) 51 | 52 | 53 | if __name__ == '__main__': 54 | unittest.main() 55 | -------------------------------------------------------------------------------- /test/test_depth_sell.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | KS Trade API's 5 | 6 | No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 7 | 8 | The version of the OpenAPI document: 1.0 9 | Generated by: https://openapi-generator.tech 10 | """ 11 | 12 | 13 | from __future__ import absolute_import 14 | 15 | import unittest 16 | import datetime 17 | 18 | import openapi_client 19 | from openapi_client.models.depth_sell import DepthSell # noqa: E501 20 | from openapi_client.rest import ApiException 21 | 22 | class TestDepthSell(unittest.TestCase): 23 | """DepthSell unit test stubs""" 24 | 25 | def setUp(self): 26 | pass 27 | 28 | def tearDown(self): 29 | pass 30 | 31 | def make_instance(self, include_optional): 32 | """Test DepthSell 33 | include_option is a boolean, when False only required 34 | params are included, when True both required and 35 | optional params are included """ 36 | # model = openapi_client.models.depth_sell.DepthSell() # noqa: E501 37 | if include_optional : 38 | return DepthSell( 39 | price = 1.337, 40 | quantity = 56, 41 | orders = 56 42 | ) 43 | else : 44 | return DepthSell( 45 | ) 46 | 47 | def testDepthSell(self): 48 | """Test DepthSell""" 49 | inst_req_only = self.make_instance(include_optional=False) 50 | inst_req_and_optional = self.make_instance(include_optional=True) 51 | 52 | 53 | if __name__ == '__main__': 54 | unittest.main() 55 | -------------------------------------------------------------------------------- /test/test_existing_mtf_order.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Session-Order-Margin-API 5 | 6 | No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 7 | 8 | The version of the OpenAPI document: 1.0 9 | Generated by: https://openapi-generator.tech 10 | """ 11 | 12 | 13 | from __future__ import absolute_import 14 | 15 | import unittest 16 | import datetime 17 | 18 | import openapi_client 19 | from openapi_client.models.existing_mtf_order import ExistingMTFOrder # noqa: E501 20 | from openapi_client.rest import ApiException 21 | 22 | class TestExistingMTFOrder(unittest.TestCase): 23 | """ExistingMTFOrder unit test stubs""" 24 | 25 | def setUp(self): 26 | pass 27 | 28 | def tearDown(self): 29 | pass 30 | 31 | def make_instance(self, include_optional): 32 | """Test ExistingMTFOrder 33 | include_option is a boolean, when False only required 34 | params are included, when True both required and 35 | optional params are included """ 36 | # model = openapi_client.models.existing_mtf_order.ExistingMTFOrder() # noqa: E501 37 | if include_optional : 38 | return ExistingMTFOrder( 39 | orderId = '0', 40 | quantity = 56, 41 | price = 1.337, 42 | disclosedQuantity = 56, 43 | triggerPrice = 1.337 44 | ) 45 | else : 46 | return ExistingMTFOrder( 47 | orderId = '0', 48 | ) 49 | 50 | def testExistingMTFOrder(self): 51 | """Test ExistingMTFOrder""" 52 | inst_req_only = self.make_instance(include_optional=False) 53 | inst_req_and_optional = self.make_instance(include_optional=True) 54 | 55 | 56 | if __name__ == '__main__': 57 | unittest.main() 58 | -------------------------------------------------------------------------------- /test/test_existing_normal_order.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Session-Order-Margin-API 5 | 6 | No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 7 | 8 | The version of the OpenAPI document: 1.0 9 | Generated by: https://openapi-generator.tech 10 | """ 11 | 12 | 13 | from __future__ import absolute_import 14 | 15 | import unittest 16 | import datetime 17 | 18 | import openapi_client 19 | from openapi_client.models.existing_normal_order import ExistingNormalOrder # noqa: E501 20 | from openapi_client.rest import ApiException 21 | 22 | class TestExistingNormalOrder(unittest.TestCase): 23 | """ExistingNormalOrder unit test stubs""" 24 | 25 | def setUp(self): 26 | pass 27 | 28 | def tearDown(self): 29 | pass 30 | 31 | def make_instance(self, include_optional): 32 | """Test ExistingNormalOrder 33 | include_option is a boolean, when False only required 34 | params are included, when True both required and 35 | optional params are included """ 36 | # model = openapi_client.models.existing_normal_order.ExistingNormalOrder() # noqa: E501 37 | if include_optional : 38 | return ExistingNormalOrder( 39 | orderId = '0', 40 | quantity = 56, 41 | price = 1.337, 42 | disclosedQuantity = 56, 43 | triggerPrice = 1.337 44 | ) 45 | else : 46 | return ExistingNormalOrder( 47 | orderId = '0', 48 | ) 49 | 50 | def testExistingNormalOrder(self): 51 | """Test ExistingNormalOrder""" 52 | inst_req_only = self.make_instance(include_optional=False) 53 | inst_req_and_optional = self.make_instance(include_optional=True) 54 | 55 | 56 | if __name__ == '__main__': 57 | unittest.main() 58 | -------------------------------------------------------------------------------- /test/test_existing_order.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Session-Order-Margin-API 5 | 6 | No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 7 | 8 | The version of the OpenAPI document: 1.0 9 | Generated by: https://openapi-generator.tech 10 | """ 11 | 12 | 13 | from __future__ import absolute_import 14 | 15 | import unittest 16 | import datetime 17 | 18 | import openapi_client 19 | from openapi_client.models.existing_order import ExistingOrder # noqa: E501 20 | from openapi_client.rest import ApiException 21 | 22 | class TestExistingOrder(unittest.TestCase): 23 | """ExistingOrder unit test stubs""" 24 | 25 | def setUp(self): 26 | pass 27 | 28 | def tearDown(self): 29 | pass 30 | 31 | def make_instance(self, include_optional): 32 | """Test ExistingOrder 33 | include_option is a boolean, when False only required 34 | params are included, when True both required and 35 | optional params are included """ 36 | # model = openapi_client.models.existing_order.ExistingOrder() # noqa: E501 37 | if include_optional : 38 | return ExistingOrder( 39 | orderId = '0', 40 | quantity = 56, 41 | price = 1.337, 42 | disclosedQuantity = 56, 43 | triggerPrice = 1.337, 44 | tslo = openapi_client.models.tslo_parameters.TSLO Parameters( 45 | order_indicator = 56, 46 | spread = 1.337, 47 | trailing_price = 1.337, ), 48 | bracket = openapi_client.models.brakcet_order_parameters.Brakcet Order Parameters( 49 | order_indicator = 56, 50 | spread = 1.337, 51 | trailing_price = 1.337, 52 | book_profit = 1.337, 53 | book_disclosed_qty = 56, ), 54 | tslonew = openapi_client.models.tslo_parameters.TSLO Parameters( 55 | order_indicator = 56, 56 | spread = 1.337, 57 | trailing_price = 1.337, ), 58 | bracketnew = openapi_client.models.brakcet_order_parameters.Brakcet Order Parameters( 59 | order_indicator = 56, 60 | spread = 1.337, 61 | trailing_price = 1.337, 62 | book_profit = 1.337, 63 | book_disclosed_qty = 56, ), 64 | gtc = openapi_client.models.good_till_cancel_order.Good till Cancel Order( 65 | gtc_order_no = '0', ), 66 | ctd = openapi_client.models.convert_to_delivery.Convert to delivery( 67 | convert_quantity = 56, ), 68 | cod = openapi_client.models.call_of_the_day.Call of the Day( 69 | order_no = '0', ) 70 | ) 71 | else : 72 | return ExistingOrder( 73 | orderId = '0', 74 | ) 75 | 76 | def testExistingOrder(self): 77 | """Test ExistingOrder""" 78 | inst_req_only = self.make_instance(include_optional=False) 79 | inst_req_and_optional = self.make_instance(include_optional=True) 80 | 81 | 82 | if __name__ == '__main__': 83 | unittest.main() 84 | -------------------------------------------------------------------------------- /test/test_existing_sm_order.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Session-Order-Margin-API 5 | 6 | No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 7 | 8 | The version of the OpenAPI document: 1.0 9 | Generated by: https://openapi-generator.tech 10 | """ 11 | 12 | 13 | from __future__ import absolute_import 14 | 15 | import unittest 16 | import datetime 17 | 18 | import openapi_client 19 | from openapi_client.models.existing_sm_order import ExistingSMOrder # noqa: E501 20 | from openapi_client.rest import ApiException 21 | 22 | class TestExistingSMOrder(unittest.TestCase): 23 | """ExistingSMOrder unit test stubs""" 24 | 25 | def setUp(self): 26 | pass 27 | 28 | def tearDown(self): 29 | pass 30 | 31 | def make_instance(self, include_optional): 32 | """Test ExistingSMOrder 33 | include_option is a boolean, when False only required 34 | params are included, when True both required and 35 | optional params are included """ 36 | # model = openapi_client.models.existing_sm_order.ExistingSMOrder() # noqa: E501 37 | if include_optional : 38 | return ExistingSMOrder( 39 | orderId = '0', 40 | quantity = 56, 41 | price = 1.337, 42 | disclosedQuantity = 56, 43 | triggerPrice = 1.337 44 | ) 45 | else : 46 | return ExistingSMOrder( 47 | orderId = '0', 48 | ) 49 | 50 | def testExistingSMOrder(self): 51 | """Test ExistingSMOrder""" 52 | inst_req_only = self.make_instance(include_optional=False) 53 | inst_req_and_optional = self.make_instance(include_optional=True) 54 | 55 | 56 | if __name__ == '__main__': 57 | unittest.main() 58 | -------------------------------------------------------------------------------- /test/test_existing_sor_order.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Session-Order-Margin-API 5 | 6 | No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 7 | 8 | The version of the OpenAPI document: 1.0 9 | Generated by: https://openapi-generator.tech 10 | """ 11 | 12 | 13 | from __future__ import absolute_import 14 | 15 | import unittest 16 | import datetime 17 | 18 | import openapi_client 19 | from openapi_client.models.existing_sor_order import ExistingSOROrder # noqa: E501 20 | from openapi_client.rest import ApiException 21 | 22 | class TestExistingSOROrder(unittest.TestCase): 23 | """ExistingSOROrder unit test stubs""" 24 | 25 | def setUp(self): 26 | pass 27 | 28 | def tearDown(self): 29 | pass 30 | 31 | def make_instance(self, include_optional): 32 | """Test ExistingSOROrder 33 | include_option is a boolean, when False only required 34 | params are included, when True both required and 35 | optional params are included """ 36 | # model = openapi_client.models.existing_sor_order.ExistingSOROrder() # noqa: E501 37 | if include_optional : 38 | return ExistingSOROrder( 39 | orderId = '0', 40 | quantity = 56, 41 | price = 1.337, 42 | disclosedQuantity = 56, 43 | triggerPrice = 1.337 44 | ) 45 | else : 46 | return ExistingSOROrder( 47 | orderId = '0', 48 | ) 49 | 50 | def testExistingSOROrder(self): 51 | """Test ExistingSOROrder""" 52 | inst_req_only = self.make_instance(include_optional=False) 53 | inst_req_and_optional = self.make_instance(include_optional=True) 54 | 55 | 56 | if __name__ == '__main__': 57 | unittest.main() 58 | -------------------------------------------------------------------------------- /test/test_fault.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Session-Order-Margin-API 5 | 6 | No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 7 | 8 | The version of the OpenAPI document: 1.0 9 | Generated by: https://openapi-generator.tech 10 | """ 11 | 12 | 13 | from __future__ import absolute_import 14 | 15 | import unittest 16 | import datetime 17 | 18 | import openapi_client 19 | from openapi_client.models.fault import Fault # noqa: E501 20 | from openapi_client.rest import ApiException 21 | 22 | class TestFault(unittest.TestCase): 23 | """Fault unit test stubs""" 24 | 25 | def setUp(self): 26 | pass 27 | 28 | def tearDown(self): 29 | pass 30 | 31 | def make_instance(self, include_optional): 32 | """Test Fault 33 | include_option is a boolean, when False only required 34 | params are included, when True both required and 35 | optional params are included """ 36 | # model = openapi_client.models.fault.Fault() # noqa: E501 37 | if include_optional : 38 | return Fault( 39 | code = 56, 40 | message = '0', 41 | description = '0' 42 | ) 43 | else : 44 | return Fault( 45 | ) 46 | 47 | def testFault(self): 48 | """Test Fault""" 49 | inst_req_only = self.make_instance(include_optional=False) 50 | inst_req_and_optional = self.make_instance(include_optional=True) 51 | 52 | 53 | if __name__ == '__main__': 54 | unittest.main() 55 | -------------------------------------------------------------------------------- /test/test_gtccancel.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Session-Order-Margin-API 5 | 6 | No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 7 | 8 | The version of the OpenAPI document: 1.0 9 | Generated by: https://openapi-generator.tech 10 | """ 11 | 12 | 13 | from __future__ import absolute_import 14 | 15 | import unittest 16 | import datetime 17 | 18 | import openapi_client 19 | from openapi_client.models.gtccancel import Gtccancel # noqa: E501 20 | from openapi_client.rest import ApiException 21 | 22 | class TestGtccancel(unittest.TestCase): 23 | """Gtccancel unit test stubs""" 24 | 25 | def setUp(self): 26 | pass 27 | 28 | def tearDown(self): 29 | pass 30 | 31 | def make_instance(self, include_optional): 32 | """Test Gtccancel 33 | include_option is a boolean, when False only required 34 | params are included, when True both required and 35 | optional params are included """ 36 | # model = openapi_client.models.gtccancel.Gtccancel() # noqa: E501 37 | if include_optional : 38 | return Gtccancel( 39 | gtcOrderNo = '0' 40 | ) 41 | else : 42 | return Gtccancel( 43 | ) 44 | 45 | def testGtccancel(self): 46 | """Test Gtccancel""" 47 | inst_req_only = self.make_instance(include_optional=False) 48 | inst_req_and_optional = self.make_instance(include_optional=True) 49 | 50 | 51 | if __name__ == '__main__': 52 | unittest.main() 53 | -------------------------------------------------------------------------------- /test/test_gtcmodify.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Session-Order-Margin-API 5 | 6 | No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 7 | 8 | The version of the OpenAPI document: 1.0 9 | Generated by: https://openapi-generator.tech 10 | """ 11 | 12 | 13 | from __future__ import absolute_import 14 | 15 | import unittest 16 | import datetime 17 | 18 | import openapi_client 19 | from openapi_client.models.gtcmodify import Gtcmodify # noqa: E501 20 | from openapi_client.rest import ApiException 21 | 22 | class TestGtcmodify(unittest.TestCase): 23 | """Gtcmodify unit test stubs""" 24 | 25 | def setUp(self): 26 | pass 27 | 28 | def tearDown(self): 29 | pass 30 | 31 | def make_instance(self, include_optional): 32 | """Test Gtcmodify 33 | include_option is a boolean, when False only required 34 | params are included, when True both required and 35 | optional params are included """ 36 | # model = openapi_client.models.gtcmodify.Gtcmodify() # noqa: E501 37 | if include_optional : 38 | return Gtcmodify( 39 | gtcOrderNo = '0' 40 | ) 41 | else : 42 | return Gtcmodify( 43 | ) 44 | 45 | def testGtcmodify(self): 46 | """Test Gtcmodify""" 47 | inst_req_only = self.make_instance(include_optional=False) 48 | inst_req_and_optional = self.make_instance(include_optional=True) 49 | 50 | 51 | if __name__ == '__main__': 52 | unittest.main() 53 | -------------------------------------------------------------------------------- /test/test_gtcplace.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Session-Order-Margin-API 5 | 6 | No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 7 | 8 | The version of the OpenAPI document: 1.0 9 | Generated by: https://openapi-generator.tech 10 | """ 11 | 12 | 13 | from __future__ import absolute_import 14 | 15 | import unittest 16 | import datetime 17 | 18 | import openapi_client 19 | from openapi_client.models.gtcplace import Gtcplace # noqa: E501 20 | from openapi_client.rest import ApiException 21 | 22 | class TestGtcplace(unittest.TestCase): 23 | """Gtcplace unit test stubs""" 24 | 25 | def setUp(self): 26 | pass 27 | 28 | def tearDown(self): 29 | pass 30 | 31 | def make_instance(self, include_optional): 32 | """Test Gtcplace 33 | include_option is a boolean, when False only required 34 | params are included, when True both required and 35 | optional params are included """ 36 | # model = openapi_client.models.gtcplace.Gtcplace() # noqa: E501 37 | if include_optional : 38 | return Gtcplace( 39 | closeDate = '0' 40 | ) 41 | else : 42 | return Gtcplace( 43 | ) 44 | 45 | def testGtcplace(self): 46 | """Test Gtcplace""" 47 | inst_req_only = self.make_instance(include_optional=False) 48 | inst_req_and_optional = self.make_instance(include_optional=True) 49 | 50 | 51 | if __name__ == '__main__': 52 | unittest.main() 53 | -------------------------------------------------------------------------------- /test/test_history.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Session-Order-Margin-API 5 | 6 | No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 7 | 8 | The version of the OpenAPI document: 1.0 9 | Generated by: https://openapi-generator.tech 10 | """ 11 | 12 | 13 | from __future__ import absolute_import 14 | 15 | import unittest 16 | import datetime 17 | 18 | import openapi_client 19 | from openapi_client.models.history import History # noqa: E501 20 | from openapi_client.rest import ApiException 21 | 22 | class TestHistory(unittest.TestCase): 23 | """History unit test stubs""" 24 | 25 | def setUp(self): 26 | pass 27 | 28 | def tearDown(self): 29 | pass 30 | 31 | def make_instance(self, include_optional): 32 | """Test History 33 | include_option is a boolean, when False only required 34 | params are included, when True both required and 35 | optional params are included """ 36 | # model = openapi_client.models.history.History() # noqa: E501 37 | if include_optional : 38 | return History( 39 | version = 56, 40 | orderQuantity = 56, 41 | price = 1.337, 42 | filledQuantity = 56, 43 | exchangeStatus = '0', 44 | status = 'placed', 45 | disclosedQuantity = 56, 46 | triggerPrice = 1.337, 47 | validity = 'GFD', 48 | exchOrderId = '0', 49 | exchTradeId = '0', 50 | message = '0', 51 | activityTimestamp = '0' 52 | ) 53 | else : 54 | return History( 55 | ) 56 | 57 | def testHistory(self): 58 | """Test History""" 59 | inst_req_only = self.make_instance(include_optional=False) 60 | inst_req_and_optional = self.make_instance(include_optional=True) 61 | 62 | 63 | if __name__ == '__main__': 64 | unittest.main() 65 | -------------------------------------------------------------------------------- /test/test_inline_response200.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | KS Trade API's 5 | 6 | No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 7 | 8 | The version of the OpenAPI document: 1.0 9 | Generated by: https://openapi-generator.tech 10 | """ 11 | 12 | 13 | from __future__ import absolute_import 14 | 15 | import unittest 16 | import datetime 17 | 18 | import openapi_client 19 | from openapi_client.models.inline_response200 import InlineResponse200 # noqa: E501 20 | from openapi_client.rest import ApiException 21 | 22 | class TestInlineResponse200(unittest.TestCase): 23 | """InlineResponse200 unit test stubs""" 24 | 25 | def setUp(self): 26 | pass 27 | 28 | def tearDown(self): 29 | pass 30 | 31 | def make_instance(self, include_optional): 32 | """Test InlineResponse200 33 | include_option is a boolean, when False only required 34 | params are included, when True both required and 35 | optional params are included """ 36 | # model = openapi_client.models.inline_response200.InlineResponse200() # noqa: E501 37 | if include_optional : 38 | return InlineResponse200( 39 | instrumentName = '0', 40 | instrumentToken = 56, 41 | lastUpdatedTime = 56, 42 | lastTradedTime = 56, 43 | lastPrice = 1.337, 44 | lastTradedQuantity = 56, 45 | totalBuyQuantity = 56, 46 | totalSellQuantity = 56, 47 | averageTradedPrice = 1.337, 48 | openInterest = 56, 49 | netChange = 1.337, 50 | dprLow = 1.337, 51 | dprHigh = 1.337, 52 | ohlc = openapi_client.models.inline_response_200_ohlc.inline_response_200_ohlc( 53 | open = 1.337, 54 | high = 1.337, 55 | low = 1.337, 56 | close = 1.337, ), 57 | depth = openapi_client.models.inline_response_200_depth.inline_response_200_depth( 58 | buy = openapi_client.models.inline_response_200_depth_buy.inline_response_200_depth_buy( 59 | price = 1.337, 60 | quantity = 56, 61 | orders = 56, ), 62 | sell = openapi_client.models.inline_response_200_depth_buy.inline_response_200_depth_buy( 63 | price = 1.337, 64 | quantity = 56, 65 | orders = 56, ), ) 66 | ) 67 | else : 68 | return InlineResponse200( 69 | ) 70 | 71 | def testInlineResponse200(self): 72 | """Test InlineResponse200""" 73 | inst_req_only = self.make_instance(include_optional=False) 74 | inst_req_and_optional = self.make_instance(include_optional=True) 75 | 76 | 77 | if __name__ == '__main__': 78 | unittest.main() 79 | -------------------------------------------------------------------------------- /test/test_inline_response2001.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | KS Trade API's 5 | 6 | No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 7 | 8 | The version of the OpenAPI document: 1.0 9 | Generated by: https://openapi-generator.tech 10 | """ 11 | 12 | 13 | from __future__ import absolute_import 14 | 15 | import unittest 16 | import datetime 17 | 18 | import openapi_client 19 | from openapi_client.models.inline_response2001 import InlineResponse2001 # noqa: E501 20 | from openapi_client.rest import ApiException 21 | 22 | class TestInlineResponse2001(unittest.TestCase): 23 | """InlineResponse2001 unit test stubs""" 24 | 25 | def setUp(self): 26 | pass 27 | 28 | def tearDown(self): 29 | pass 30 | 31 | def make_instance(self, include_optional): 32 | """Test InlineResponse2001 33 | include_option is a boolean, when False only required 34 | params are included, when True both required and 35 | optional params are included """ 36 | # model = openapi_client.models.inline_response2001.InlineResponse2001() # noqa: E501 37 | if include_optional : 38 | return InlineResponse2001( 39 | instrumentName = '0', 40 | instrumentToken = 56, 41 | open = 1.337, 42 | high = 1.337, 43 | low = 1.337, 44 | close = 1.337 45 | ) 46 | else : 47 | return InlineResponse2001( 48 | ) 49 | 50 | def testInlineResponse2001(self): 51 | """Test InlineResponse2001""" 52 | inst_req_only = self.make_instance(include_optional=False) 53 | inst_req_and_optional = self.make_instance(include_optional=True) 54 | 55 | 56 | if __name__ == '__main__': 57 | unittest.main() 58 | -------------------------------------------------------------------------------- /test/test_inline_response2002.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | KS Trade API's 5 | 6 | No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 7 | 8 | The version of the OpenAPI document: 1.0 9 | Generated by: https://openapi-generator.tech 10 | """ 11 | 12 | 13 | from __future__ import absolute_import 14 | 15 | import unittest 16 | import datetime 17 | 18 | import openapi_client 19 | from openapi_client.models.inline_response2002 import InlineResponse2002 # noqa: E501 20 | from openapi_client.rest import ApiException 21 | 22 | class TestInlineResponse2002(unittest.TestCase): 23 | """InlineResponse2002 unit test stubs""" 24 | 25 | def setUp(self): 26 | pass 27 | 28 | def tearDown(self): 29 | pass 30 | 31 | def make_instance(self, include_optional): 32 | """Test InlineResponse2002 33 | include_option is a boolean, when False only required 34 | params are included, when True both required and 35 | optional params are included """ 36 | # model = openapi_client.models.inline_response2002.InlineResponse2002() # noqa: E501 37 | if include_optional : 38 | return InlineResponse2002( 39 | instrumentName = '0', 40 | instrumentToken = 56, 41 | lastPrice = 1.337 42 | ) 43 | else : 44 | return InlineResponse2002( 45 | ) 46 | 47 | def testInlineResponse2002(self): 48 | """Test InlineResponse2002""" 49 | inst_req_only = self.make_instance(include_optional=False) 50 | inst_req_and_optional = self.make_instance(include_optional=True) 51 | 52 | 53 | if __name__ == '__main__': 54 | unittest.main() 55 | -------------------------------------------------------------------------------- /test/test_inline_response200_depth.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | KS Trade API's 5 | 6 | No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 7 | 8 | The version of the OpenAPI document: 1.0 9 | Generated by: https://openapi-generator.tech 10 | """ 11 | 12 | 13 | from __future__ import absolute_import 14 | 15 | import unittest 16 | import datetime 17 | 18 | import openapi_client 19 | from openapi_client.models.inline_response200_depth import InlineResponse200Depth # noqa: E501 20 | from openapi_client.rest import ApiException 21 | 22 | class TestInlineResponse200Depth(unittest.TestCase): 23 | """InlineResponse200Depth unit test stubs""" 24 | 25 | def setUp(self): 26 | pass 27 | 28 | def tearDown(self): 29 | pass 30 | 31 | def make_instance(self, include_optional): 32 | """Test InlineResponse200Depth 33 | include_option is a boolean, when False only required 34 | params are included, when True both required and 35 | optional params are included """ 36 | # model = openapi_client.models.inline_response200_depth.InlineResponse200Depth() # noqa: E501 37 | if include_optional : 38 | return InlineResponse200Depth( 39 | buy = openapi_client.models.inline_response_200_depth_buy.inline_response_200_depth_buy( 40 | price = 1.337, 41 | quantity = 56, 42 | orders = 56, ), 43 | sell = openapi_client.models.inline_response_200_depth_buy.inline_response_200_depth_buy( 44 | price = 1.337, 45 | quantity = 56, 46 | orders = 56, ) 47 | ) 48 | else : 49 | return InlineResponse200Depth( 50 | ) 51 | 52 | def testInlineResponse200Depth(self): 53 | """Test InlineResponse200Depth""" 54 | inst_req_only = self.make_instance(include_optional=False) 55 | inst_req_and_optional = self.make_instance(include_optional=True) 56 | 57 | 58 | if __name__ == '__main__': 59 | unittest.main() 60 | -------------------------------------------------------------------------------- /test/test_inline_response200_depth_buy.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | KS Trade API's 5 | 6 | No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 7 | 8 | The version of the OpenAPI document: 1.0 9 | Generated by: https://openapi-generator.tech 10 | """ 11 | 12 | 13 | from __future__ import absolute_import 14 | 15 | import unittest 16 | import datetime 17 | 18 | import openapi_client 19 | from openapi_client.models.inline_response200_depth_buy import InlineResponse200DepthBuy # noqa: E501 20 | from openapi_client.rest import ApiException 21 | 22 | class TestInlineResponse200DepthBuy(unittest.TestCase): 23 | """InlineResponse200DepthBuy unit test stubs""" 24 | 25 | def setUp(self): 26 | pass 27 | 28 | def tearDown(self): 29 | pass 30 | 31 | def make_instance(self, include_optional): 32 | """Test InlineResponse200DepthBuy 33 | include_option is a boolean, when False only required 34 | params are included, when True both required and 35 | optional params are included """ 36 | # model = openapi_client.models.inline_response200_depth_buy.InlineResponse200DepthBuy() # noqa: E501 37 | if include_optional : 38 | return InlineResponse200DepthBuy( 39 | price = 1.337, 40 | quantity = 56, 41 | orders = 56 42 | ) 43 | else : 44 | return InlineResponse200DepthBuy( 45 | ) 46 | 47 | def testInlineResponse200DepthBuy(self): 48 | """Test InlineResponse200DepthBuy""" 49 | inst_req_only = self.make_instance(include_optional=False) 50 | inst_req_and_optional = self.make_instance(include_optional=True) 51 | 52 | 53 | if __name__ == '__main__': 54 | unittest.main() 55 | -------------------------------------------------------------------------------- /test/test_inline_response200_ohlc.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | KS Trade API's 5 | 6 | No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 7 | 8 | The version of the OpenAPI document: 1.0 9 | Generated by: https://openapi-generator.tech 10 | """ 11 | 12 | 13 | from __future__ import absolute_import 14 | 15 | import unittest 16 | import datetime 17 | 18 | import openapi_client 19 | from openapi_client.models.inline_response200_ohlc import InlineResponse200Ohlc # noqa: E501 20 | from openapi_client.rest import ApiException 21 | 22 | class TestInlineResponse200Ohlc(unittest.TestCase): 23 | """InlineResponse200Ohlc unit test stubs""" 24 | 25 | def setUp(self): 26 | pass 27 | 28 | def tearDown(self): 29 | pass 30 | 31 | def make_instance(self, include_optional): 32 | """Test InlineResponse200Ohlc 33 | include_option is a boolean, when False only required 34 | params are included, when True both required and 35 | optional params are included """ 36 | # model = openapi_client.models.inline_response200_ohlc.InlineResponse200Ohlc() # noqa: E501 37 | if include_optional : 38 | return InlineResponse200Ohlc( 39 | open = 1.337, 40 | high = 1.337, 41 | low = 1.337, 42 | close = 1.337 43 | ) 44 | else : 45 | return InlineResponse200Ohlc( 46 | ) 47 | 48 | def testInlineResponse200Ohlc(self): 49 | """Test InlineResponse200Ohlc""" 50 | inst_req_only = self.make_instance(include_optional=False) 51 | inst_req_and_optional = self.make_instance(include_optional=True) 52 | 53 | 54 | if __name__ == '__main__': 55 | unittest.main() 56 | -------------------------------------------------------------------------------- /test/test_instrument.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | KS Trade API's 5 | 6 | No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 7 | 8 | The version of the OpenAPI document: 1.0 9 | Generated by: https://openapi-generator.tech 10 | """ 11 | 12 | 13 | from __future__ import absolute_import 14 | 15 | import unittest 16 | import datetime 17 | 18 | import openapi_client 19 | from openapi_client.models.instrument import Instrument # noqa: E501 20 | from openapi_client.rest import ApiException 21 | 22 | class TestInstrument(unittest.TestCase): 23 | """Instrument unit test stubs""" 24 | 25 | def setUp(self): 26 | pass 27 | 28 | def tearDown(self): 29 | pass 30 | 31 | def make_instance(self, include_optional): 32 | """Test Instrument 33 | include_option is a boolean, when False only required 34 | params are included, when True both required and 35 | optional params are included """ 36 | # model = openapi_client.models.instrument.Instrument() # noqa: E501 37 | if include_optional : 38 | return Instrument( 39 | instrumentToken = 1.337, 40 | lastPrice = 1.337, 41 | netChange = 1.337, 42 | netChangePercent = 1.337, 43 | averageTradedPrice = 1.337, 44 | lastTradedQuantity = 1.337, 45 | lastTradedTime = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), 46 | openInterest = 1.337, 47 | totalTradeQuantity = 1.337, 48 | exchange = '0', 49 | instrumentName = '0', 50 | segment = '0', 51 | ohlc = openapi_client.models.ohlc_quote.OHLCQuote( 52 | instrument_name = '0', 53 | instrument_token = 56, 54 | open = 1.337, 55 | high = 1.337, 56 | low = 1.337, 57 | close = 1.337, ), 58 | depth = openapi_client.models.depth.depth( 59 | buy = [ 60 | openapi_client.models.depth_buy.DepthBuy( 61 | price = 1.337, 62 | quantity = 56, 63 | orders = 56, ) 64 | ], 65 | sell = [ 66 | openapi_client.models.depth_sell.DepthSell( 67 | price = 1.337, 68 | quantity = 56, 69 | orders = 56, ) 70 | ], ) 71 | ) 72 | else : 73 | return Instrument( 74 | ) 75 | 76 | def testInstrument(self): 77 | """Test Instrument""" 78 | inst_req_only = self.make_instance(include_optional=False) 79 | inst_req_and_optional = self.make_instance(include_optional=True) 80 | 81 | 82 | if __name__ == '__main__': 83 | unittest.main() 84 | -------------------------------------------------------------------------------- /test/test_ltp_quote.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | KS Trade API's 5 | 6 | No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 7 | 8 | The version of the OpenAPI document: 1.0 9 | Generated by: https://openapi-generator.tech 10 | """ 11 | 12 | 13 | from __future__ import absolute_import 14 | 15 | import unittest 16 | import datetime 17 | 18 | import openapi_client 19 | from openapi_client.models.ltp_quote import LTPQuote # noqa: E501 20 | from openapi_client.rest import ApiException 21 | 22 | class TestLTPQuote(unittest.TestCase): 23 | """LTPQuote unit test stubs""" 24 | 25 | def setUp(self): 26 | pass 27 | 28 | def tearDown(self): 29 | pass 30 | 31 | def make_instance(self, include_optional): 32 | """Test LTPQuote 33 | include_option is a boolean, when False only required 34 | params are included, when True both required and 35 | optional params are included """ 36 | # model = openapi_client.models.ltp_quote.LTPQuote() # noqa: E501 37 | if include_optional : 38 | return LTPQuote( 39 | instrumentName = '0', 40 | instrumentToken = 56, 41 | lastPrice = 1.337 42 | ) 43 | else : 44 | return LTPQuote( 45 | ) 46 | 47 | def testLTPQuote(self): 48 | """Test LTPQuote""" 49 | inst_req_only = self.make_instance(include_optional=False) 50 | inst_req_and_optional = self.make_instance(include_optional=True) 51 | 52 | 53 | if __name__ == '__main__': 54 | unittest.main() 55 | -------------------------------------------------------------------------------- /test/test_margin_api.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Session-Order-Margin-API 5 | 6 | No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 7 | 8 | The version of the OpenAPI document: 1.0 9 | Generated by: https://openapi-generator.tech 10 | """ 11 | 12 | 13 | from __future__ import absolute_import 14 | 15 | import unittest 16 | 17 | import openapi_client 18 | from openapi_client.api.margin_api import MarginApi # noqa: E501 19 | from openapi_client.rest import ApiException 20 | 21 | 22 | class TestMarginApi(unittest.TestCase): 23 | """MarginApi unit test stubs""" 24 | 25 | def setUp(self): 26 | self.api = openapi_client.api.margin_api.MarginApi() # noqa: E501 27 | 28 | def tearDown(self): 29 | pass 30 | 31 | def test_margin_required(self): 32 | """Test case for margin_required 33 | 34 | Get Margin Required for an order by amount or quantity. # noqa: E501 35 | """ 36 | pass 37 | 38 | 39 | if __name__ == '__main__': 40 | unittest.main() 41 | -------------------------------------------------------------------------------- /test/test_margin_det.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Session-Order-Margin-API 5 | 6 | No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 7 | 8 | The version of the OpenAPI document: 1.0 9 | Generated by: https://openapi-generator.tech 10 | """ 11 | 12 | 13 | from __future__ import absolute_import 14 | 15 | import unittest 16 | import datetime 17 | 18 | import openapi_client 19 | from openapi_client.models.margin_det import MarginDet # noqa: E501 20 | from openapi_client.rest import ApiException 21 | 22 | class TestMarginDet(unittest.TestCase): 23 | """MarginDet unit test stubs""" 24 | 25 | def setUp(self): 26 | pass 27 | 28 | def tearDown(self): 29 | pass 30 | 31 | def make_instance(self, include_optional): 32 | """Test MarginDet 33 | include_option is a boolean, when False only required 34 | params are included, when True both required and 35 | optional params are included """ 36 | # model = openapi_client.models.margin_det.MarginDet() # noqa: E501 37 | if include_optional : 38 | return MarginDet( 39 | instrumentToken = 56, 40 | normal = 1.337, 41 | supermultiple = 1.337, 42 | mtf = 1.337 43 | ) 44 | else : 45 | return MarginDet( 46 | ) 47 | 48 | def testMarginDet(self): 49 | """Test MarginDet""" 50 | inst_req_only = self.make_instance(include_optional=False) 51 | inst_req_and_optional = self.make_instance(include_optional=True) 52 | 53 | 54 | if __name__ == '__main__': 55 | unittest.main() 56 | -------------------------------------------------------------------------------- /test/test_margin_trading_api.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Session-Order-Margin-API 5 | 6 | No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 7 | 8 | The version of the OpenAPI document: 1.0 9 | Generated by: https://openapi-generator.tech 10 | """ 11 | 12 | 13 | from __future__ import absolute_import 14 | 15 | import unittest 16 | 17 | import openapi_client 18 | from openapi_client.api.margin_trading_api import MarginTradingApi # noqa: E501 19 | from openapi_client.rest import ApiException 20 | 21 | 22 | class TestMarginTradingApi(unittest.TestCase): 23 | """MarginTradingApi unit test stubs""" 24 | 25 | def setUp(self): 26 | self.api = openapi_client.api.margin_trading_api.MarginTradingApi() # noqa: E501 27 | 28 | def tearDown(self): 29 | pass 30 | 31 | def test_cancel_mtf_order(self): 32 | """Test case for cancel_mtf_order 33 | 34 | Cancel an order # noqa: E501 35 | """ 36 | pass 37 | 38 | def test_modify_mtf_order(self): 39 | """Test case for modify_mtf_order 40 | 41 | Modify an existing MTF order # noqa: E501 42 | """ 43 | pass 44 | 45 | def test_place_new_mtf_order(self): 46 | """Test case for place_new_mtf_order 47 | 48 | Place a New MTF order # noqa: E501 49 | """ 50 | pass 51 | 52 | 53 | if __name__ == '__main__': 54 | unittest.main() 55 | -------------------------------------------------------------------------------- /test/test_market_details_quote.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | KS Trade API's 5 | 6 | No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 7 | 8 | The version of the OpenAPI document: 1.0 9 | Generated by: https://openapi-generator.tech 10 | """ 11 | 12 | 13 | from __future__ import absolute_import 14 | 15 | import unittest 16 | import datetime 17 | 18 | import openapi_client 19 | from openapi_client.models.market_details_quote import MarketDetailsQuote # noqa: E501 20 | from openapi_client.rest import ApiException 21 | 22 | class TestMarketDetailsQuote(unittest.TestCase): 23 | """MarketDetailsQuote unit test stubs""" 24 | 25 | def setUp(self): 26 | pass 27 | 28 | def tearDown(self): 29 | pass 30 | 31 | def make_instance(self, include_optional): 32 | """Test MarketDetailsQuote 33 | include_option is a boolean, when False only required 34 | params are included, when True both required and 35 | optional params are included """ 36 | # model = openapi_client.models.market_details_quote.MarketDetailsQuote() # noqa: E501 37 | if include_optional : 38 | return MarketDetailsQuote( 39 | instrumentName = '0', 40 | instrumentToken = 56, 41 | lastUpdatedTime = 56, 42 | lastTradedTime = 56, 43 | lastPrice = 1.337, 44 | lastTradedQuantity = 56, 45 | totalBuyQuantity = 56, 46 | totalSellQuantity = 56, 47 | averageTradedPrice = 1.337, 48 | openInterest = 56, 49 | netChange = 1.337, 50 | dprLow = 1.337, 51 | dprHigh = 1.337, 52 | ohlc = openapi_client.models.ohlc.OHLC( 53 | open = 1.337, 54 | high = 1.337, 55 | low = 1.337, 56 | close = 1.337, ), 57 | depth = openapi_client.models.depth.Depth( 58 | buy = openapi_client.models.depth_buy.DepthBuy( 59 | price = 1.337, 60 | quantity = 56, 61 | orders = 56, ), 62 | sell = openapi_client.models.depth_sell.DepthSell( 63 | price = 1.337, 64 | quantity = 56, 65 | orders = 56, ), ) 66 | ) 67 | else : 68 | return MarketDetailsQuote( 69 | ) 70 | 71 | def testMarketDetailsQuote(self): 72 | """Test MarketDetailsQuote""" 73 | inst_req_only = self.make_instance(include_optional=False) 74 | inst_req_and_optional = self.make_instance(include_optional=True) 75 | 76 | 77 | if __name__ == '__main__': 78 | unittest.main() 79 | -------------------------------------------------------------------------------- /test/test_new_mtf_order.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Session-Order-Margin-API 5 | 6 | No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 7 | 8 | The version of the OpenAPI document: 1.0 9 | Generated by: https://openapi-generator.tech 10 | """ 11 | 12 | 13 | from __future__ import absolute_import 14 | 15 | import unittest 16 | import datetime 17 | 18 | import openapi_client 19 | from openapi_client.models.new_mtf_order import NewMTFOrder # noqa: E501 20 | from openapi_client.rest import ApiException 21 | 22 | class TestNewMTFOrder(unittest.TestCase): 23 | """NewMTFOrder unit test stubs""" 24 | 25 | def setUp(self): 26 | pass 27 | 28 | def tearDown(self): 29 | pass 30 | 31 | def make_instance(self, include_optional): 32 | """Test NewMTFOrder 33 | include_option is a boolean, when False only required 34 | params are included, when True both required and 35 | optional params are included """ 36 | # model = openapi_client.models.new_mtf_order.NewMTFOrder() # noqa: E501 37 | if include_optional : 38 | return NewMTFOrder( 39 | instrumentToken = 56, 40 | transactionType = 'BUY', 41 | quantity = 56, 42 | price = 1.337, 43 | validity = 'GFD', 44 | variety = 'REGULAR', 45 | disclosedQuantity = 56, 46 | triggerPrice = 1.337, 47 | tag = '0' 48 | ) 49 | else : 50 | return NewMTFOrder( 51 | ) 52 | 53 | def testNewMTFOrder(self): 54 | """Test NewMTFOrder""" 55 | inst_req_only = self.make_instance(include_optional=False) 56 | inst_req_and_optional = self.make_instance(include_optional=True) 57 | 58 | 59 | if __name__ == '__main__': 60 | unittest.main() 61 | -------------------------------------------------------------------------------- /test/test_new_normal_order.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Session-Order-Margin-API 5 | 6 | No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 7 | 8 | The version of the OpenAPI document: 1.0 9 | Generated by: https://openapi-generator.tech 10 | """ 11 | 12 | 13 | from __future__ import absolute_import 14 | 15 | import unittest 16 | import datetime 17 | 18 | import openapi_client 19 | from openapi_client.models.new_normal_order import NewNormalOrder # noqa: E501 20 | from openapi_client.rest import ApiException 21 | 22 | class TestNewNormalOrder(unittest.TestCase): 23 | """NewNormalOrder unit test stubs""" 24 | 25 | def setUp(self): 26 | pass 27 | 28 | def tearDown(self): 29 | pass 30 | 31 | def make_instance(self, include_optional): 32 | """Test NewNormalOrder 33 | include_option is a boolean, when False only required 34 | params are included, when True both required and 35 | optional params are included """ 36 | # model = openapi_client.models.new_normal_order.NewNormalOrder() # noqa: E501 37 | if include_optional : 38 | return NewNormalOrder( 39 | instrumentToken = 56, 40 | transactionType = 'BUY', 41 | quantity = 56, 42 | price = 1.337, 43 | validity = 'GFD', 44 | variety = 'REGULAR', 45 | disclosedQuantity = 56, 46 | triggerPrice = 1.337, 47 | tag = '0' 48 | ) 49 | else : 50 | return NewNormalOrder( 51 | ) 52 | 53 | def testNewNormalOrder(self): 54 | """Test NewNormalOrder""" 55 | inst_req_only = self.make_instance(include_optional=False) 56 | inst_req_and_optional = self.make_instance(include_optional=True) 57 | 58 | 59 | if __name__ == '__main__': 60 | unittest.main() 61 | -------------------------------------------------------------------------------- /test/test_new_order.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Session-Order-Margin-API 5 | 6 | No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 7 | 8 | The version of the OpenAPI document: 1.0 9 | Generated by: https://openapi-generator.tech 10 | """ 11 | 12 | 13 | from __future__ import absolute_import 14 | 15 | import unittest 16 | import datetime 17 | 18 | import openapi_client 19 | from openapi_client.models.new_order import NewOrder # noqa: E501 20 | from openapi_client.rest import ApiException 21 | 22 | class TestNewOrder(unittest.TestCase): 23 | """NewOrder unit test stubs""" 24 | 25 | def setUp(self): 26 | pass 27 | 28 | def tearDown(self): 29 | pass 30 | 31 | def make_instance(self, include_optional): 32 | """Test NewOrder 33 | include_option is a boolean, when False only required 34 | params are included, when True both required and 35 | optional params are included """ 36 | # model = openapi_client.models.new_order.NewOrder() # noqa: E501 37 | if include_optional : 38 | return NewOrder( 39 | instrumentToken = 56, 40 | transactionType = 'BUY', 41 | quantity = 56, 42 | price = 1.337, 43 | product = 'NORMAL', 44 | validity = 'GFD', 45 | variety = 'REGULAR', 46 | disclosedQuantity = 56, 47 | triggerPrice = 1.337, 48 | tslo = openapi_client.models.tslo_parameters.TSLO Parameters( 49 | spread = 1.337, 50 | trailing_price = 1.337, ), 51 | bracket = openapi_client.models.brakcet_order_parameters.Brakcet Order Parameters( 52 | spread = 1.337, 53 | trailing_price = 1.337, 54 | book_profit = 1.337, 55 | book_disclosed_qty = 56, ), 56 | tslonew = openapi_client.models.tslo_parameters.TSLO Parameters( 57 | spread = 1.337, 58 | trailing_price = 1.337, ), 59 | bracketnew = openapi_client.models.brakcet_order_parameters.Brakcet Order Parameters( 60 | spread = 1.337, 61 | trailing_price = 1.337, 62 | book_profit = 1.337, 63 | book_disclosed_qty = 56, ), 64 | gtc = openapi_client.models.good_till_cancel_order.Good till Cancel Order( 65 | close_date = '0', ), 66 | ctd = openapi_client.models.convert_to_delivery.Convert to delivery( 67 | convert_quantity = 56, ), 68 | cod = openapi_client.models.call_of_the_day.Call of the Day( 69 | square_off_flag = 56, ), 70 | tag = '0' 71 | ) 72 | else : 73 | return NewOrder( 74 | ) 75 | 76 | def testNewOrder(self): 77 | """Test NewOrder""" 78 | inst_req_only = self.make_instance(include_optional=False) 79 | inst_req_and_optional = self.make_instance(include_optional=True) 80 | 81 | 82 | if __name__ == '__main__': 83 | unittest.main() 84 | -------------------------------------------------------------------------------- /test/test_new_sm_order.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Session-Order-Margin-API 5 | 6 | No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 7 | 8 | The version of the OpenAPI document: 1.0 9 | Generated by: https://openapi-generator.tech 10 | """ 11 | 12 | 13 | from __future__ import absolute_import 14 | 15 | import unittest 16 | import datetime 17 | 18 | import openapi_client 19 | from openapi_client.models.new_sm_order import NewSMOrder # noqa: E501 20 | from openapi_client.rest import ApiException 21 | 22 | class TestNewSMOrder(unittest.TestCase): 23 | """NewSMOrder unit test stubs""" 24 | 25 | def setUp(self): 26 | pass 27 | 28 | def tearDown(self): 29 | pass 30 | 31 | def make_instance(self, include_optional): 32 | """Test NewSMOrder 33 | include_option is a boolean, when False only required 34 | params are included, when True both required and 35 | optional params are included """ 36 | # model = openapi_client.models.new_sm_order.NewSMOrder() # noqa: E501 37 | if include_optional : 38 | return NewSMOrder( 39 | instrumentToken = 56, 40 | transactionType = 'BUY', 41 | quantity = 56, 42 | price = 1.337, 43 | validity = 'GFD', 44 | variety = 'REGULAR', 45 | disclosedQuantity = 56, 46 | triggerPrice = 1.337, 47 | tag = '0' 48 | ) 49 | else : 50 | return NewSMOrder( 51 | ) 52 | 53 | def testNewSMOrder(self): 54 | """Test NewSMOrder""" 55 | inst_req_only = self.make_instance(include_optional=False) 56 | inst_req_and_optional = self.make_instance(include_optional=True) 57 | 58 | 59 | if __name__ == '__main__': 60 | unittest.main() 61 | -------------------------------------------------------------------------------- /test/test_new_sor_order.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Session-Order-Margin-API 5 | 6 | No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 7 | 8 | The version of the OpenAPI document: 1.0 9 | Generated by: https://openapi-generator.tech 10 | """ 11 | 12 | 13 | from __future__ import absolute_import 14 | 15 | import unittest 16 | import datetime 17 | 18 | import openapi_client 19 | from openapi_client.models.new_sor_order import NewSOROrder # noqa: E501 20 | from openapi_client.rest import ApiException 21 | 22 | class TestNewSOROrder(unittest.TestCase): 23 | """NewSOROrder unit test stubs""" 24 | 25 | def setUp(self): 26 | pass 27 | 28 | def tearDown(self): 29 | pass 30 | 31 | def make_instance(self, include_optional): 32 | """Test NewSOROrder 33 | include_option is a boolean, when False only required 34 | params are included, when True both required and 35 | optional params are included """ 36 | # model = openapi_client.models.new_sor_order.NewSOROrder() # noqa: E501 37 | if include_optional : 38 | return NewSOROrder( 39 | instrumentToken = 56, 40 | transactionType = 'BUY', 41 | quantity = 56, 42 | price = 1.337, 43 | validity = 'GFD', 44 | variety = 'REGULAR', 45 | tag = '0' 46 | ) 47 | else : 48 | return NewSOROrder( 49 | ) 50 | 51 | def testNewSOROrder(self): 52 | """Test NewSOROrder""" 53 | inst_req_only = self.make_instance(include_optional=False) 54 | inst_req_and_optional = self.make_instance(include_optional=True) 55 | 56 | 57 | if __name__ == '__main__': 58 | unittest.main() 59 | -------------------------------------------------------------------------------- /test/test_normal_order_api.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Session-Order-Margin-API 5 | 6 | No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 7 | 8 | The version of the OpenAPI document: 1.0 9 | Generated by: https://openapi-generator.tech 10 | """ 11 | 12 | 13 | from __future__ import absolute_import 14 | 15 | import unittest 16 | 17 | import openapi_client 18 | from openapi_client.api.normal_order_api import NormalOrderApi # noqa: E501 19 | from openapi_client.rest import ApiException 20 | 21 | 22 | class TestNormalOrderApi(unittest.TestCase): 23 | """NormalOrderApi unit test stubs""" 24 | 25 | def setUp(self): 26 | self.api = openapi_client.api.normal_order_api.NormalOrderApi() # noqa: E501 27 | 28 | def tearDown(self): 29 | pass 30 | 31 | def test_cancel_normal_order(self): 32 | """Test case for cancel_normal_order 33 | 34 | Cancel a Normal order # noqa: E501 35 | """ 36 | pass 37 | 38 | def test_modify_normal_order(self): 39 | """Test case for modify_normal_order 40 | 41 | Modify an existing normal order # noqa: E501 42 | """ 43 | pass 44 | 45 | def test_place_new_normal_order(self): 46 | """Test case for place_new_normal_order 47 | 48 | Place a New normal order # noqa: E501 49 | """ 50 | pass 51 | 52 | 53 | if __name__ == '__main__': 54 | unittest.main() 55 | -------------------------------------------------------------------------------- /test/test_ohlc.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | KS Trade API's 5 | 6 | No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 7 | 8 | The version of the OpenAPI document: 1.0 9 | Generated by: https://openapi-generator.tech 10 | """ 11 | 12 | 13 | from __future__ import absolute_import 14 | 15 | import unittest 16 | import datetime 17 | 18 | import openapi_client 19 | from openapi_client.models.ohlc import OHLC # noqa: E501 20 | from openapi_client.rest import ApiException 21 | 22 | class TestOHLC(unittest.TestCase): 23 | """OHLC unit test stubs""" 24 | 25 | def setUp(self): 26 | pass 27 | 28 | def tearDown(self): 29 | pass 30 | 31 | def make_instance(self, include_optional): 32 | """Test OHLC 33 | include_option is a boolean, when False only required 34 | params are included, when True both required and 35 | optional params are included """ 36 | # model = openapi_client.models.ohlc.OHLC() # noqa: E501 37 | if include_optional : 38 | return OHLC( 39 | open = 1.337, 40 | high = 1.337, 41 | low = 1.337, 42 | close = 1.337 43 | ) 44 | else : 45 | return OHLC( 46 | ) 47 | 48 | def testOHLC(self): 49 | """Test OHLC""" 50 | inst_req_only = self.make_instance(include_optional=False) 51 | inst_req_and_optional = self.make_instance(include_optional=True) 52 | 53 | 54 | if __name__ == '__main__': 55 | unittest.main() 56 | -------------------------------------------------------------------------------- /test/test_ohlc_quote.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | KS Trade API's 5 | 6 | No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 7 | 8 | The version of the OpenAPI document: 1.0 9 | Generated by: https://openapi-generator.tech 10 | """ 11 | 12 | 13 | from __future__ import absolute_import 14 | 15 | import unittest 16 | import datetime 17 | 18 | import openapi_client 19 | from openapi_client.models.ohlc_quote import OHLCQuote # noqa: E501 20 | from openapi_client.rest import ApiException 21 | 22 | class TestOHLCQuote(unittest.TestCase): 23 | """OHLCQuote unit test stubs""" 24 | 25 | def setUp(self): 26 | pass 27 | 28 | def tearDown(self): 29 | pass 30 | 31 | def make_instance(self, include_optional): 32 | """Test OHLCQuote 33 | include_option is a boolean, when False only required 34 | params are included, when True both required and 35 | optional params are included """ 36 | # model = openapi_client.models.ohlc_quote.OHLCQuote() # noqa: E501 37 | if include_optional : 38 | return OHLCQuote( 39 | instrumentName = '0', 40 | instrumentToken = 56, 41 | open = 1.337, 42 | high = 1.337, 43 | low = 1.337, 44 | close = 1.337 45 | ) 46 | else : 47 | return OHLCQuote( 48 | ) 49 | 50 | def testOHLCQuote(self): 51 | """Test OHLCQuote""" 52 | inst_req_only = self.make_instance(include_optional=False) 53 | inst_req_and_optional = self.make_instance(include_optional=True) 54 | 55 | 56 | if __name__ == '__main__': 57 | unittest.main() 58 | -------------------------------------------------------------------------------- /test/test_open.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Session-Order-Margin-API 5 | 6 | No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 7 | 8 | The version of the OpenAPI document: 1.0 9 | Generated by: https://openapi-generator.tech 10 | """ 11 | 12 | 13 | from __future__ import absolute_import 14 | 15 | import unittest 16 | import datetime 17 | 18 | import openapi_client 19 | from openapi_client.models.open import Open # noqa: E501 20 | from openapi_client.rest import ApiException 21 | 22 | class TestOpen(unittest.TestCase): 23 | """Open unit test stubs""" 24 | 25 | def setUp(self): 26 | pass 27 | 28 | def tearDown(self): 29 | pass 30 | 31 | def make_instance(self, include_optional): 32 | """Test Open 33 | include_option is a boolean, when False only required 34 | params are included, when True both required and 35 | optional params are included """ 36 | # model = openapi_client.models.open.Open() # noqa: E501 37 | if include_optional : 38 | return Open( 39 | instrumentToken = 56, 40 | normal = 1.337, 41 | supermultiple = 1.337, 42 | mtf = 1.337 43 | ) 44 | else : 45 | return Open( 46 | ) 47 | 48 | def testOpen(self): 49 | """Test Open""" 50 | inst_req_only = self.make_instance(include_optional=False) 51 | inst_req_and_optional = self.make_instance(include_optional=True) 52 | 53 | 54 | if __name__ == '__main__': 55 | unittest.main() 56 | -------------------------------------------------------------------------------- /test/test_order_api.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Session-Order-Margin-API 5 | 6 | No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 7 | 8 | The version of the OpenAPI document: 1.0 9 | Generated by: https://openapi-generator.tech 10 | """ 11 | 12 | 13 | from __future__ import absolute_import 14 | 15 | import unittest 16 | 17 | import openapi_client 18 | from openapi_client.api.order_api import OrderApi # noqa: E501 19 | from openapi_client.rest import ApiException 20 | 21 | 22 | class TestOrderApi(unittest.TestCase): 23 | """OrderApi unit test stubs""" 24 | 25 | def setUp(self): 26 | self.api = openapi_client.api.order_api.OrderApi() # noqa: E501 27 | 28 | def tearDown(self): 29 | pass 30 | 31 | def test_cancel_order(self): 32 | """Test case for cancel_order 33 | 34 | Cancel an order # noqa: E501 35 | """ 36 | pass 37 | 38 | def test_modify_order(self): 39 | """Test case for modify_order 40 | 41 | Modify an existing order # noqa: E501 42 | """ 43 | pass 44 | 45 | def test_place_new_order(self): 46 | """Test case for place_new_order 47 | 48 | Place a New order # noqa: E501 49 | """ 50 | pass 51 | 52 | 53 | if __name__ == '__main__': 54 | unittest.main() 55 | -------------------------------------------------------------------------------- /test/test_order_info.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Session-Order-Margin-API 5 | 6 | No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 7 | 8 | The version of the OpenAPI document: 1.0 9 | Generated by: https://openapi-generator.tech 10 | """ 11 | 12 | 13 | from __future__ import absolute_import 14 | 15 | import unittest 16 | import datetime 17 | 18 | import openapi_client 19 | from openapi_client.models.order_info import OrderInfo # noqa: E501 20 | from openapi_client.rest import ApiException 21 | 22 | class TestOrderInfo(unittest.TestCase): 23 | """OrderInfo unit test stubs""" 24 | 25 | def setUp(self): 26 | pass 27 | 28 | def tearDown(self): 29 | pass 30 | 31 | def make_instance(self, include_optional): 32 | """Test OrderInfo 33 | include_option is a boolean, when False only required 34 | params are included, when True both required and 35 | optional params are included """ 36 | # model = openapi_client.models.order_info.OrderInfo() # noqa: E501 37 | if include_optional : 38 | return OrderInfo( 39 | instrumentToken = 56, 40 | quantity = 56, 41 | price = 1.337, 42 | amount = 56, 43 | triggerPrice = 1.337 44 | ) 45 | else : 46 | return OrderInfo( 47 | ) 48 | 49 | def testOrderInfo(self): 50 | """Test OrderInfo""" 51 | inst_req_only = self.make_instance(include_optional=False) 52 | inst_req_and_optional = self.make_instance(include_optional=True) 53 | 54 | 55 | if __name__ == '__main__': 56 | unittest.main() 57 | -------------------------------------------------------------------------------- /test/test_orders.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Session-Order-Margin-API 5 | 6 | No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 7 | 8 | The version of the OpenAPI document: 1.0 9 | Generated by: https://openapi-generator.tech 10 | """ 11 | 12 | 13 | from __future__ import absolute_import 14 | 15 | import unittest 16 | import datetime 17 | 18 | import openapi_client 19 | from openapi_client.models.orders import Orders # noqa: E501 20 | from openapi_client.rest import ApiException 21 | 22 | class TestOrders(unittest.TestCase): 23 | """Orders unit test stubs""" 24 | 25 | def setUp(self): 26 | pass 27 | 28 | def tearDown(self): 29 | pass 30 | 31 | def make_instance(self, include_optional): 32 | """Test Orders 33 | include_option is a boolean, when False only required 34 | params are included, when True both required and 35 | optional params are included """ 36 | # model = openapi_client.models.orders.Orders() # noqa: E501 37 | if include_optional : 38 | return Orders( 39 | orderId = '0', 40 | variety = 'REGULAR', 41 | instrumentName = '0', 42 | instrumentToken = '0', 43 | exchange = 'NSE', 44 | orderQuantity = 56, 45 | pendingQuantity = 56, 46 | cancelledQuantity = 56, 47 | filledQuantity = 56, 48 | disclosedQuantity = 56, 49 | triggerPrice = 1.337, 50 | price = 1.337, 51 | product = 'NORMAL', 52 | transactionType = 'BUY', 53 | orderTimestamp = '0', 54 | validity = 'Good For Day', 55 | statusMessage = '0', 56 | tag = '0', 57 | status = 'CNRF' 58 | ) 59 | else : 60 | return Orders( 61 | ) 62 | 63 | def testOrders(self): 64 | """Test Orders""" 65 | inst_req_only = self.make_instance(include_optional=False) 66 | inst_req_and_optional = self.make_instance(include_optional=True) 67 | 68 | 69 | if __name__ == '__main__': 70 | unittest.main() 71 | -------------------------------------------------------------------------------- /test/test_positions.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Session-Order-Margin-API 5 | 6 | No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 7 | 8 | The version of the OpenAPI document: 1.0 9 | Generated by: https://openapi-generator.tech 10 | """ 11 | 12 | 13 | from __future__ import absolute_import 14 | 15 | import unittest 16 | import datetime 17 | 18 | import openapi_client 19 | from openapi_client.models.positions import Positions # noqa: E501 20 | from openapi_client.rest import ApiException 21 | 22 | class TestPositions(unittest.TestCase): 23 | """Positions unit test stubs""" 24 | 25 | def setUp(self): 26 | pass 27 | 28 | def tearDown(self): 29 | pass 30 | 31 | def make_instance(self, include_optional): 32 | """Test Positions 33 | include_option is a boolean, when False only required 34 | params are included, when True both required and 35 | optional params are included """ 36 | # model = openapi_client.models.positions.Positions() # noqa: E501 37 | if include_optional : 38 | return Positions( 39 | instrumentToken = 56, 40 | quantity = 56, 41 | price = 1.337, 42 | amount = 56, 43 | triggerPrice = 1.337 44 | ) 45 | else : 46 | return Positions( 47 | ) 48 | 49 | def testPositions(self): 50 | """Test Positions""" 51 | inst_req_only = self.make_instance(include_optional=False) 52 | inst_req_and_optional = self.make_instance(include_optional=True) 53 | 54 | 55 | if __name__ == '__main__': 56 | unittest.main() 57 | -------------------------------------------------------------------------------- /test/test_positions_api.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Session-Order-Margin-API 5 | 6 | No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 7 | 8 | The version of the OpenAPI document: 1.0 9 | Generated by: https://openapi-generator.tech 10 | """ 11 | 12 | 13 | from __future__ import absolute_import 14 | 15 | import unittest 16 | 17 | import openapi_client 18 | from openapi_client.api.positions_api import PositionsApi # noqa: E501 19 | from openapi_client.rest import ApiException 20 | 21 | 22 | class TestPositionsApi(unittest.TestCase): 23 | """PositionsApi unit test stubs""" 24 | 25 | def setUp(self): 26 | self.api = openapi_client.api.positions_api.PositionsApi() # noqa: E501 27 | 28 | def tearDown(self): 29 | pass 30 | 31 | def test_positions(self): 32 | """Test case for positions 33 | 34 | Get's raw position from Trading Engine. # noqa: E501 35 | """ 36 | pass 37 | 38 | def test_positions_open(self): 39 | """Test case for positions_open 40 | 41 | Get's Open position. # noqa: E501 42 | """ 43 | pass 44 | 45 | def test_positions_stocks(self): 46 | """Test case for positions_stocks 47 | 48 | Get's Sell from Existing stocks. # noqa: E501 49 | """ 50 | pass 51 | 52 | def test_positions_today(self): 53 | """Test case for positions_today 54 | 55 | Get's Todays position. # noqa: E501 56 | """ 57 | pass 58 | 59 | 60 | if __name__ == '__main__': 61 | unittest.main() 62 | -------------------------------------------------------------------------------- /test/test_quote_api.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | KS Trade API's 5 | 6 | No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 7 | 8 | The version of the OpenAPI document: 1.0 9 | Generated by: https://openapi-generator.tech 10 | """ 11 | 12 | 13 | from __future__ import absolute_import 14 | 15 | import unittest 16 | 17 | import openapi_client 18 | from openapi_client.api.quote_api import QuoteApi # noqa: E501 19 | from openapi_client.rest import ApiException 20 | 21 | 22 | class TestQuoteApi(unittest.TestCase): 23 | """QuoteApi unit test stubs""" 24 | 25 | def setUp(self): 26 | self.api = openapi_client.api.quote_api.QuoteApi() # noqa: E501 27 | 28 | def tearDown(self): 29 | pass 30 | 31 | def test_get_instruments_details(self): 32 | """Test case for get_instruments_details 33 | 34 | Get full details # noqa: E501 35 | """ 36 | pass 37 | 38 | def test_get_ltp_quote(self): 39 | """Test case for get_ltp_quote 40 | 41 | Get LTP quote # noqa: E501 42 | """ 43 | pass 44 | 45 | def test_get_market_details_quote(self): 46 | """Test case for get_market_details_quote 47 | 48 | Get market details quote # noqa: E501 49 | """ 50 | pass 51 | 52 | def test_get_ohlc_quote(self): 53 | """Test case for get_ohlc_quote 54 | 55 | Get OHLC quote # noqa: E501 56 | """ 57 | pass 58 | 59 | 60 | if __name__ == '__main__': 61 | unittest.main() 62 | -------------------------------------------------------------------------------- /test/test_reports_api.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Session-Order-Margin-API 5 | 6 | No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 7 | 8 | The version of the OpenAPI document: 1.0 9 | Generated by: https://openapi-generator.tech 10 | """ 11 | 12 | 13 | from __future__ import absolute_import 14 | 15 | import unittest 16 | 17 | import openapi_client 18 | from openapi_client.api.reports_api import ReportsApi # noqa: E501 19 | from openapi_client.rest import ApiException 20 | 21 | 22 | class TestReportsApi(unittest.TestCase): 23 | """ReportsApi unit test stubs""" 24 | 25 | def setUp(self): 26 | self.api = openapi_client.api.reports_api.ReportsApi() # noqa: E501 27 | 28 | def tearDown(self): 29 | pass 30 | 31 | def test_get_order_report_by_order_id(self): 32 | """Test case for get_order_report_by_order_id 33 | 34 | Get order report by orderId # noqa: E501 35 | """ 36 | pass 37 | 38 | def test_get_order_reports(self): 39 | """Test case for get_order_reports 40 | 41 | Get order report # noqa: E501 42 | """ 43 | pass 44 | 45 | def test_get_trade_report(self): 46 | """Test case for get_trade_report 47 | 48 | Get trade report # noqa: E501 49 | """ 50 | pass 51 | 52 | def test_get_trade_report_by_order_id(self): 53 | """Test case for get_trade_report_by_order_id 54 | 55 | Get trade report by orderId # noqa: E501 56 | """ 57 | pass 58 | 59 | 60 | if __name__ == '__main__': 61 | unittest.main() 62 | -------------------------------------------------------------------------------- /test/test_req_margin.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Session-Order-Margin-API 5 | 6 | No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 7 | 8 | The version of the OpenAPI document: 1.0 9 | Generated by: https://openapi-generator.tech 10 | """ 11 | 12 | 13 | from __future__ import absolute_import 14 | 15 | import unittest 16 | import datetime 17 | 18 | import openapi_client 19 | from openapi_client.models.req_margin import ReqMargin # noqa: E501 20 | from openapi_client.rest import ApiException 21 | 22 | class TestReqMargin(unittest.TestCase): 23 | """ReqMargin unit test stubs""" 24 | 25 | def setUp(self): 26 | pass 27 | 28 | def tearDown(self): 29 | pass 30 | 31 | def make_instance(self, include_optional): 32 | """Test ReqMargin 33 | include_option is a boolean, when False only required 34 | params are included, when True both required and 35 | optional params are included """ 36 | # model = openapi_client.models.req_margin.ReqMargin() # noqa: E501 37 | if include_optional : 38 | return ReqMargin( 39 | transactionType = 'BUY', 40 | orderInfo = [ 41 | openapi_client.models.margi_info/.Margi info.( 42 | instrument_token = 56, 43 | quantity = 56, 44 | price = 1.337, 45 | amount = 56, 46 | trigger_price = 1.337, ) 47 | ] 48 | ) 49 | else : 50 | return ReqMargin( 51 | ) 52 | 53 | def testReqMargin(self): 54 | """Test ReqMargin""" 55 | inst_req_only = self.make_instance(include_optional=False) 56 | inst_req_and_optional = self.make_instance(include_optional=True) 57 | 58 | 59 | if __name__ == '__main__': 60 | unittest.main() 61 | -------------------------------------------------------------------------------- /test/test_res_login.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Session-Order-Margin-API 5 | 6 | No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 7 | 8 | The version of the OpenAPI document: 1.0 9 | Generated by: https://openapi-generator.tech 10 | """ 11 | 12 | 13 | from __future__ import absolute_import 14 | 15 | import unittest 16 | import datetime 17 | 18 | import openapi_client 19 | from openapi_client.models.res_login import ResLogin # noqa: E501 20 | from openapi_client.rest import ApiException 21 | 22 | class TestResLogin(unittest.TestCase): 23 | """ResLogin unit test stubs""" 24 | 25 | def setUp(self): 26 | pass 27 | 28 | def tearDown(self): 29 | pass 30 | 31 | def make_instance(self, include_optional): 32 | """Test ResLogin 33 | include_option is a boolean, when False only required 34 | params are included, when True both required and 35 | optional params are included """ 36 | # model = openapi_client.models.res_login.ResLogin() # noqa: E501 37 | if include_optional : 38 | return ResLogin( 39 | oneTimeToken = '0', 40 | mpin = '0', 41 | biometric = '0', 42 | message = '0' 43 | ) 44 | else : 45 | return ResLogin( 46 | ) 47 | 48 | def testResLogin(self): 49 | """Test ResLogin""" 50 | inst_req_only = self.make_instance(include_optional=False) 51 | inst_req_and_optional = self.make_instance(include_optional=True) 52 | 53 | 54 | if __name__ == '__main__': 55 | unittest.main() 56 | -------------------------------------------------------------------------------- /test/test_res_logout.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Session-Order-Margin-API 5 | 6 | No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 7 | 8 | The version of the OpenAPI document: 1.0 9 | Generated by: https://openapi-generator.tech 10 | """ 11 | 12 | 13 | from __future__ import absolute_import 14 | 15 | import unittest 16 | import datetime 17 | 18 | import openapi_client 19 | from openapi_client.models.res_logout import ResLogout # noqa: E501 20 | from openapi_client.rest import ApiException 21 | 22 | class TestResLogout(unittest.TestCase): 23 | """ResLogout unit test stubs""" 24 | 25 | def setUp(self): 26 | pass 27 | 28 | def tearDown(self): 29 | pass 30 | 31 | def make_instance(self, include_optional): 32 | """Test ResLogout 33 | include_option is a boolean, when False only required 34 | params are included, when True both required and 35 | optional params are included """ 36 | # model = openapi_client.models.res_logout.ResLogout() # noqa: E501 37 | if include_optional : 38 | return ResLogout( 39 | message = '0' 40 | ) 41 | else : 42 | return ResLogout( 43 | ) 44 | 45 | def testResLogout(self): 46 | """Test ResLogout""" 47 | inst_req_only = self.make_instance(include_optional=False) 48 | inst_req_and_optional = self.make_instance(include_optional=True) 49 | 50 | 51 | if __name__ == '__main__': 52 | unittest.main() 53 | -------------------------------------------------------------------------------- /test/test_res_mtf_mod.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Session-Order-Margin-API 5 | 6 | No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 7 | 8 | The version of the OpenAPI document: 1.0 9 | Generated by: https://openapi-generator.tech 10 | """ 11 | 12 | 13 | from __future__ import absolute_import 14 | 15 | import unittest 16 | import datetime 17 | 18 | import openapi_client 19 | from openapi_client.models.res_mtf_mod import ResMTFMod # noqa: E501 20 | from openapi_client.rest import ApiException 21 | 22 | class TestResMTFMod(unittest.TestCase): 23 | """ResMTFMod unit test stubs""" 24 | 25 | def setUp(self): 26 | pass 27 | 28 | def tearDown(self): 29 | pass 30 | 31 | def make_instance(self, include_optional): 32 | """Test ResMTFMod 33 | include_option is a boolean, when False only required 34 | params are included, when True both required and 35 | optional params are included """ 36 | # model = openapi_client.models.res_mtf_mod.ResMTFMod() # noqa: E501 37 | if include_optional : 38 | return ResMTFMod( 39 | orderId = '0', 40 | message = '0' 41 | ) 42 | else : 43 | return ResMTFMod( 44 | ) 45 | 46 | def testResMTFMod(self): 47 | """Test ResMTFMod""" 48 | inst_req_only = self.make_instance(include_optional=False) 49 | inst_req_and_optional = self.make_instance(include_optional=True) 50 | 51 | 52 | if __name__ == '__main__': 53 | unittest.main() 54 | -------------------------------------------------------------------------------- /test/test_res_mtf_order_cancel.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Session-Order-Margin-API 5 | 6 | No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 7 | 8 | The version of the OpenAPI document: 1.0 9 | Generated by: https://openapi-generator.tech 10 | """ 11 | 12 | 13 | from __future__ import absolute_import 14 | 15 | import unittest 16 | import datetime 17 | 18 | import openapi_client 19 | from openapi_client.models.res_mtf_order_cancel import ResMTFOrderCancel # noqa: E501 20 | from openapi_client.rest import ApiException 21 | 22 | class TestResMTFOrderCancel(unittest.TestCase): 23 | """ResMTFOrderCancel unit test stubs""" 24 | 25 | def setUp(self): 26 | pass 27 | 28 | def tearDown(self): 29 | pass 30 | 31 | def make_instance(self, include_optional): 32 | """Test ResMTFOrderCancel 33 | include_option is a boolean, when False only required 34 | params are included, when True both required and 35 | optional params are included """ 36 | # model = openapi_client.models.res_mtf_order_cancel.ResMTFOrderCancel() # noqa: E501 37 | if include_optional : 38 | return ResMTFOrderCancel( 39 | orderId = '0', 40 | message = '0' 41 | ) 42 | else : 43 | return ResMTFOrderCancel( 44 | ) 45 | 46 | def testResMTFOrderCancel(self): 47 | """Test ResMTFOrderCancel""" 48 | inst_req_only = self.make_instance(include_optional=False) 49 | inst_req_and_optional = self.make_instance(include_optional=True) 50 | 51 | 52 | if __name__ == '__main__': 53 | unittest.main() 54 | -------------------------------------------------------------------------------- /test/test_res_new_mtf_order.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Session-Order-Margin-API 5 | 6 | No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 7 | 8 | The version of the OpenAPI document: 1.0 9 | Generated by: https://openapi-generator.tech 10 | """ 11 | 12 | 13 | from __future__ import absolute_import 14 | 15 | import unittest 16 | import datetime 17 | 18 | import openapi_client 19 | from openapi_client.models.res_new_mtf_order import ResNewMTFOrder # noqa: E501 20 | from openapi_client.rest import ApiException 21 | 22 | class TestResNewMTFOrder(unittest.TestCase): 23 | """ResNewMTFOrder unit test stubs""" 24 | 25 | def setUp(self): 26 | pass 27 | 28 | def tearDown(self): 29 | pass 30 | 31 | def make_instance(self, include_optional): 32 | """Test ResNewMTFOrder 33 | include_option is a boolean, when False only required 34 | params are included, when True both required and 35 | optional params are included """ 36 | # model = openapi_client.models.res_new_mtf_order.ResNewMTFOrder() # noqa: E501 37 | if include_optional : 38 | return ResNewMTFOrder( 39 | orderId = '0', 40 | message = '0' 41 | ) 42 | else : 43 | return ResNewMTFOrder( 44 | ) 45 | 46 | def testResNewMTFOrder(self): 47 | """Test ResNewMTFOrder""" 48 | inst_req_only = self.make_instance(include_optional=False) 49 | inst_req_and_optional = self.make_instance(include_optional=True) 50 | 51 | 52 | if __name__ == '__main__': 53 | unittest.main() 54 | -------------------------------------------------------------------------------- /test/test_res_new_normal_order.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Session-Order-Margin-API 5 | 6 | No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 7 | 8 | The version of the OpenAPI document: 1.0 9 | Generated by: https://openapi-generator.tech 10 | """ 11 | 12 | 13 | from __future__ import absolute_import 14 | 15 | import unittest 16 | import datetime 17 | 18 | import openapi_client 19 | from openapi_client.models.res_new_normal_order import ResNewNormalOrder # noqa: E501 20 | from openapi_client.rest import ApiException 21 | 22 | class TestResNewNormalOrder(unittest.TestCase): 23 | """ResNewNormalOrder unit test stubs""" 24 | 25 | def setUp(self): 26 | pass 27 | 28 | def tearDown(self): 29 | pass 30 | 31 | def make_instance(self, include_optional): 32 | """Test ResNewNormalOrder 33 | include_option is a boolean, when False only required 34 | params are included, when True both required and 35 | optional params are included """ 36 | # model = openapi_client.models.res_new_normal_order.ResNewNormalOrder() # noqa: E501 37 | if include_optional : 38 | return ResNewNormalOrder( 39 | orderId = '0', 40 | message = '0' 41 | ) 42 | else : 43 | return ResNewNormalOrder( 44 | ) 45 | 46 | def testResNewNormalOrder(self): 47 | """Test ResNewNormalOrder""" 48 | inst_req_only = self.make_instance(include_optional=False) 49 | inst_req_and_optional = self.make_instance(include_optional=True) 50 | 51 | 52 | if __name__ == '__main__': 53 | unittest.main() 54 | -------------------------------------------------------------------------------- /test/test_res_new_order.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Session-Order-Margin-API 5 | 6 | No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 7 | 8 | The version of the OpenAPI document: 1.0 9 | Generated by: https://openapi-generator.tech 10 | """ 11 | 12 | 13 | from __future__ import absolute_import 14 | 15 | import unittest 16 | import datetime 17 | 18 | import openapi_client 19 | from openapi_client.models.res_new_order import ResNewOrder # noqa: E501 20 | from openapi_client.rest import ApiException 21 | 22 | class TestResNewOrder(unittest.TestCase): 23 | """ResNewOrder unit test stubs""" 24 | 25 | def setUp(self): 26 | pass 27 | 28 | def tearDown(self): 29 | pass 30 | 31 | def make_instance(self, include_optional): 32 | """Test ResNewOrder 33 | include_option is a boolean, when False only required 34 | params are included, when True both required and 35 | optional params are included """ 36 | # model = openapi_client.models.res_new_order.ResNewOrder() # noqa: E501 37 | if include_optional : 38 | return ResNewOrder( 39 | orderId = '0', 40 | message = '0' 41 | ) 42 | else : 43 | return ResNewOrder( 44 | ) 45 | 46 | def testResNewOrder(self): 47 | """Test ResNewOrder""" 48 | inst_req_only = self.make_instance(include_optional=False) 49 | inst_req_and_optional = self.make_instance(include_optional=True) 50 | 51 | 52 | if __name__ == '__main__': 53 | unittest.main() 54 | -------------------------------------------------------------------------------- /test/test_res_new_sm_order.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Session-Order-Margin-API 5 | 6 | No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 7 | 8 | The version of the OpenAPI document: 1.0 9 | Generated by: https://openapi-generator.tech 10 | """ 11 | 12 | 13 | from __future__ import absolute_import 14 | 15 | import unittest 16 | import datetime 17 | 18 | import openapi_client 19 | from openapi_client.models.res_new_sm_order import ResNewSMOrder # noqa: E501 20 | from openapi_client.rest import ApiException 21 | 22 | class TestResNewSMOrder(unittest.TestCase): 23 | """ResNewSMOrder unit test stubs""" 24 | 25 | def setUp(self): 26 | pass 27 | 28 | def tearDown(self): 29 | pass 30 | 31 | def make_instance(self, include_optional): 32 | """Test ResNewSMOrder 33 | include_option is a boolean, when False only required 34 | params are included, when True both required and 35 | optional params are included """ 36 | # model = openapi_client.models.res_new_sm_order.ResNewSMOrder() # noqa: E501 37 | if include_optional : 38 | return ResNewSMOrder( 39 | orderId = '0', 40 | message = '0' 41 | ) 42 | else : 43 | return ResNewSMOrder( 44 | ) 45 | 46 | def testResNewSMOrder(self): 47 | """Test ResNewSMOrder""" 48 | inst_req_only = self.make_instance(include_optional=False) 49 | inst_req_and_optional = self.make_instance(include_optional=True) 50 | 51 | 52 | if __name__ == '__main__': 53 | unittest.main() 54 | -------------------------------------------------------------------------------- /test/test_res_new_sor_order.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Session-Order-Margin-API 5 | 6 | No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 7 | 8 | The version of the OpenAPI document: 1.0 9 | Generated by: https://openapi-generator.tech 10 | """ 11 | 12 | 13 | from __future__ import absolute_import 14 | 15 | import unittest 16 | import datetime 17 | 18 | import openapi_client 19 | from openapi_client.models.res_new_sor_order import ResNewSOROrder # noqa: E501 20 | from openapi_client.rest import ApiException 21 | 22 | class TestResNewSOROrder(unittest.TestCase): 23 | """ResNewSOROrder unit test stubs""" 24 | 25 | def setUp(self): 26 | pass 27 | 28 | def tearDown(self): 29 | pass 30 | 31 | def make_instance(self, include_optional): 32 | """Test ResNewSOROrder 33 | include_option is a boolean, when False only required 34 | params are included, when True both required and 35 | optional params are included """ 36 | # model = openapi_client.models.res_new_sor_order.ResNewSOROrder() # noqa: E501 37 | if include_optional : 38 | return ResNewSOROrder( 39 | bse = openapi_client.models.sor_response.SOR Response( 40 | price = 1.337, 41 | quantity = 1.337, 42 | mesage = '0', 43 | order_id = '0', ), 44 | nse = openapi_client.models.sor_response.SOR Response( 45 | price = 1.337, 46 | quantity = 1.337, 47 | mesage = '0', 48 | order_id = '0', ) 49 | ) 50 | else : 51 | return ResNewSOROrder( 52 | ) 53 | 54 | def testResNewSOROrder(self): 55 | """Test ResNewSOROrder""" 56 | inst_req_only = self.make_instance(include_optional=False) 57 | inst_req_and_optional = self.make_instance(include_optional=True) 58 | 59 | 60 | if __name__ == '__main__': 61 | unittest.main() 62 | -------------------------------------------------------------------------------- /test/test_res_normal_order_cancel.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Session-Order-Margin-API 5 | 6 | No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 7 | 8 | The version of the OpenAPI document: 1.0 9 | Generated by: https://openapi-generator.tech 10 | """ 11 | 12 | 13 | from __future__ import absolute_import 14 | 15 | import unittest 16 | import datetime 17 | 18 | import openapi_client 19 | from openapi_client.models.res_normal_order_cancel import ResNormalOrderCancel # noqa: E501 20 | from openapi_client.rest import ApiException 21 | 22 | class TestResNormalOrderCancel(unittest.TestCase): 23 | """ResNormalOrderCancel unit test stubs""" 24 | 25 | def setUp(self): 26 | pass 27 | 28 | def tearDown(self): 29 | pass 30 | 31 | def make_instance(self, include_optional): 32 | """Test ResNormalOrderCancel 33 | include_option is a boolean, when False only required 34 | params are included, when True both required and 35 | optional params are included """ 36 | # model = openapi_client.models.res_normal_order_cancel.ResNormalOrderCancel() # noqa: E501 37 | if include_optional : 38 | return ResNormalOrderCancel( 39 | orderId = '0', 40 | message = '0' 41 | ) 42 | else : 43 | return ResNormalOrderCancel( 44 | ) 45 | 46 | def testResNormalOrderCancel(self): 47 | """Test ResNormalOrderCancel""" 48 | inst_req_only = self.make_instance(include_optional=False) 49 | inst_req_and_optional = self.make_instance(include_optional=True) 50 | 51 | 52 | if __name__ == '__main__': 53 | unittest.main() 54 | -------------------------------------------------------------------------------- /test/test_res_normal_order_mod.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Session-Order-Margin-API 5 | 6 | No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 7 | 8 | The version of the OpenAPI document: 1.0 9 | Generated by: https://openapi-generator.tech 10 | """ 11 | 12 | 13 | from __future__ import absolute_import 14 | 15 | import unittest 16 | import datetime 17 | 18 | import openapi_client 19 | from openapi_client.models.res_normal_order_mod import ResNormalOrderMod # noqa: E501 20 | from openapi_client.rest import ApiException 21 | 22 | class TestResNormalOrderMod(unittest.TestCase): 23 | """ResNormalOrderMod unit test stubs""" 24 | 25 | def setUp(self): 26 | pass 27 | 28 | def tearDown(self): 29 | pass 30 | 31 | def make_instance(self, include_optional): 32 | """Test ResNormalOrderMod 33 | include_option is a boolean, when False only required 34 | params are included, when True both required and 35 | optional params are included """ 36 | # model = openapi_client.models.res_normal_order_mod.ResNormalOrderMod() # noqa: E501 37 | if include_optional : 38 | return ResNormalOrderMod( 39 | orderId = '0', 40 | message = '0' 41 | ) 42 | else : 43 | return ResNormalOrderMod( 44 | ) 45 | 46 | def testResNormalOrderMod(self): 47 | """Test ResNormalOrderMod""" 48 | inst_req_only = self.make_instance(include_optional=False) 49 | inst_req_and_optional = self.make_instance(include_optional=True) 50 | 51 | 52 | if __name__ == '__main__': 53 | unittest.main() 54 | -------------------------------------------------------------------------------- /test/test_res_order_cancel.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Session-Order-Margin-API 5 | 6 | No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 7 | 8 | The version of the OpenAPI document: 1.0 9 | Generated by: https://openapi-generator.tech 10 | """ 11 | 12 | 13 | from __future__ import absolute_import 14 | 15 | import unittest 16 | import datetime 17 | 18 | import openapi_client 19 | from openapi_client.models.res_order_cancel import ResOrderCancel # noqa: E501 20 | from openapi_client.rest import ApiException 21 | 22 | class TestResOrderCancel(unittest.TestCase): 23 | """ResOrderCancel unit test stubs""" 24 | 25 | def setUp(self): 26 | pass 27 | 28 | def tearDown(self): 29 | pass 30 | 31 | def make_instance(self, include_optional): 32 | """Test ResOrderCancel 33 | include_option is a boolean, when False only required 34 | params are included, when True both required and 35 | optional params are included """ 36 | # model = openapi_client.models.res_order_cancel.ResOrderCancel() # noqa: E501 37 | if include_optional : 38 | return ResOrderCancel( 39 | orderId = '0', 40 | message = '0' 41 | ) 42 | else : 43 | return ResOrderCancel( 44 | ) 45 | 46 | def testResOrderCancel(self): 47 | """Test ResOrderCancel""" 48 | inst_req_only = self.make_instance(include_optional=False) 49 | inst_req_and_optional = self.make_instance(include_optional=True) 50 | 51 | 52 | if __name__ == '__main__': 53 | unittest.main() 54 | -------------------------------------------------------------------------------- /test/test_res_order_mod.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Session-Order-Margin-API 5 | 6 | No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 7 | 8 | The version of the OpenAPI document: 1.0 9 | Generated by: https://openapi-generator.tech 10 | """ 11 | 12 | 13 | from __future__ import absolute_import 14 | 15 | import unittest 16 | import datetime 17 | 18 | import openapi_client 19 | from openapi_client.models.res_order_mod import ResOrderMod # noqa: E501 20 | from openapi_client.rest import ApiException 21 | 22 | class TestResOrderMod(unittest.TestCase): 23 | """ResOrderMod unit test stubs""" 24 | 25 | def setUp(self): 26 | pass 27 | 28 | def tearDown(self): 29 | pass 30 | 31 | def make_instance(self, include_optional): 32 | """Test ResOrderMod 33 | include_option is a boolean, when False only required 34 | params are included, when True both required and 35 | optional params are included """ 36 | # model = openapi_client.models.res_order_mod.ResOrderMod() # noqa: E501 37 | if include_optional : 38 | return ResOrderMod( 39 | orderId = '0', 40 | message = '0' 41 | ) 42 | else : 43 | return ResOrderMod( 44 | ) 45 | 46 | def testResOrderMod(self): 47 | """Test ResOrderMod""" 48 | inst_req_only = self.make_instance(include_optional=False) 49 | inst_req_and_optional = self.make_instance(include_optional=True) 50 | 51 | 52 | if __name__ == '__main__': 53 | unittest.main() 54 | -------------------------------------------------------------------------------- /test/test_res_session2_fa.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Session-Order-Margin-API 5 | 6 | No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 7 | 8 | The version of the OpenAPI document: 1.0 9 | Generated by: https://openapi-generator.tech 10 | """ 11 | 12 | 13 | from __future__ import absolute_import 14 | 15 | import unittest 16 | import datetime 17 | 18 | import openapi_client 19 | from openapi_client.models.res_session2_fa import ResSession2FA # noqa: E501 20 | from openapi_client.rest import ApiException 21 | 22 | class TestResSession2FA(unittest.TestCase): 23 | """ResSession2FA unit test stubs""" 24 | 25 | def setUp(self): 26 | pass 27 | 28 | def tearDown(self): 29 | pass 30 | 31 | def make_instance(self, include_optional): 32 | """Test ResSession2FA 33 | include_option is a boolean, when False only required 34 | params are included, when True both required and 35 | optional params are included """ 36 | # model = openapi_client.models.res_session2_fa.ResSession2FA() # noqa: E501 37 | if include_optional : 38 | return ResSession2FA( 39 | userId = '0', 40 | clientCode = '0', 41 | clientName = '0', 42 | emailId = '0', 43 | phoneNo = '0', 44 | enabledSegments = [ 45 | '0' 46 | ], 47 | enabledProducts = [ 48 | '0' 49 | ], 50 | sessionToken = '0', 51 | publicToken = '0', 52 | loginTime = 56 53 | ) 54 | else : 55 | return ResSession2FA( 56 | ) 57 | 58 | def testResSession2FA(self): 59 | """Test ResSession2FA""" 60 | inst_req_only = self.make_instance(include_optional=False) 61 | inst_req_and_optional = self.make_instance(include_optional=True) 62 | 63 | 64 | if __name__ == '__main__': 65 | unittest.main() 66 | -------------------------------------------------------------------------------- /test/test_res_session_init.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Session-Order-Margin-API 5 | 6 | No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 7 | 8 | The version of the OpenAPI document: 1.0 9 | Generated by: https://openapi-generator.tech 10 | """ 11 | 12 | 13 | from __future__ import absolute_import 14 | 15 | import unittest 16 | import datetime 17 | 18 | import openapi_client 19 | from openapi_client.models.res_session_init import ResSessionInit # noqa: E501 20 | from openapi_client.rest import ApiException 21 | 22 | class TestResSessionInit(unittest.TestCase): 23 | """ResSessionInit unit test stubs""" 24 | 25 | def setUp(self): 26 | pass 27 | 28 | def tearDown(self): 29 | pass 30 | 31 | def make_instance(self, include_optional): 32 | """Test ResSessionInit 33 | include_option is a boolean, when False only required 34 | params are included, when True both required and 35 | optional params are included """ 36 | # model = openapi_client.models.res_session_init.ResSessionInit() # noqa: E501 37 | if include_optional : 38 | return ResSessionInit( 39 | encryption = openapi_client.models.res_session_init_encryption.ResSessionInit_encryption( 40 | type = 'PLAIN', 41 | publick_key = '0', 42 | key_size = 56, ), 43 | redirect = openapi_client.models.res_session_init_redirect.ResSessionInit_redirect( 44 | host = '0', 45 | key_size = 56, ), 46 | weblink = openapi_client.models.res_session_init_weblink.ResSessionInit_weblink( 47 | host = '0', 48 | key_size = 56, ), 49 | message = '0', 50 | userType = 'G', 51 | status = 'Inactive' 52 | ) 53 | else : 54 | return ResSessionInit( 55 | ) 56 | 57 | def testResSessionInit(self): 58 | """Test ResSessionInit""" 59 | inst_req_only = self.make_instance(include_optional=False) 60 | inst_req_and_optional = self.make_instance(include_optional=True) 61 | 62 | 63 | if __name__ == '__main__': 64 | unittest.main() 65 | -------------------------------------------------------------------------------- /test/test_res_session_init_encryption.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Session-Order-Margin-API 5 | 6 | No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 7 | 8 | The version of the OpenAPI document: 1.0 9 | Generated by: https://openapi-generator.tech 10 | """ 11 | 12 | 13 | from __future__ import absolute_import 14 | 15 | import unittest 16 | import datetime 17 | 18 | import openapi_client 19 | from openapi_client.models.res_session_init_encryption import ResSessionInitEncryption # noqa: E501 20 | from openapi_client.rest import ApiException 21 | 22 | class TestResSessionInitEncryption(unittest.TestCase): 23 | """ResSessionInitEncryption unit test stubs""" 24 | 25 | def setUp(self): 26 | pass 27 | 28 | def tearDown(self): 29 | pass 30 | 31 | def make_instance(self, include_optional): 32 | """Test ResSessionInitEncryption 33 | include_option is a boolean, when False only required 34 | params are included, when True both required and 35 | optional params are included """ 36 | # model = openapi_client.models.res_session_init_encryption.ResSessionInitEncryption() # noqa: E501 37 | if include_optional : 38 | return ResSessionInitEncryption( 39 | type = 'PLAIN', 40 | publickKey = '0', 41 | keySize = 56 42 | ) 43 | else : 44 | return ResSessionInitEncryption( 45 | ) 46 | 47 | def testResSessionInitEncryption(self): 48 | """Test ResSessionInitEncryption""" 49 | inst_req_only = self.make_instance(include_optional=False) 50 | inst_req_and_optional = self.make_instance(include_optional=True) 51 | 52 | 53 | if __name__ == '__main__': 54 | unittest.main() 55 | -------------------------------------------------------------------------------- /test/test_res_session_init_redirect.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Session-Order-Margin-API 5 | 6 | No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 7 | 8 | The version of the OpenAPI document: 1.0 9 | Generated by: https://openapi-generator.tech 10 | """ 11 | 12 | 13 | from __future__ import absolute_import 14 | 15 | import unittest 16 | import datetime 17 | 18 | import openapi_client 19 | from openapi_client.models.res_session_init_redirect import ResSessionInitRedirect # noqa: E501 20 | from openapi_client.rest import ApiException 21 | 22 | class TestResSessionInitRedirect(unittest.TestCase): 23 | """ResSessionInitRedirect unit test stubs""" 24 | 25 | def setUp(self): 26 | pass 27 | 28 | def tearDown(self): 29 | pass 30 | 31 | def make_instance(self, include_optional): 32 | """Test ResSessionInitRedirect 33 | include_option is a boolean, when False only required 34 | params are included, when True both required and 35 | optional params are included """ 36 | # model = openapi_client.models.res_session_init_redirect.ResSessionInitRedirect() # noqa: E501 37 | if include_optional : 38 | return ResSessionInitRedirect( 39 | host = '0', 40 | keySize = 56 41 | ) 42 | else : 43 | return ResSessionInitRedirect( 44 | ) 45 | 46 | def testResSessionInitRedirect(self): 47 | """Test ResSessionInitRedirect""" 48 | inst_req_only = self.make_instance(include_optional=False) 49 | inst_req_and_optional = self.make_instance(include_optional=True) 50 | 51 | 52 | if __name__ == '__main__': 53 | unittest.main() 54 | -------------------------------------------------------------------------------- /test/test_res_session_init_weblink.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Session-Order-Margin-API 5 | 6 | No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 7 | 8 | The version of the OpenAPI document: 1.0 9 | Generated by: https://openapi-generator.tech 10 | """ 11 | 12 | 13 | from __future__ import absolute_import 14 | 15 | import unittest 16 | import datetime 17 | 18 | import openapi_client 19 | from openapi_client.models.res_session_init_weblink import ResSessionInitWeblink # noqa: E501 20 | from openapi_client.rest import ApiException 21 | 22 | class TestResSessionInitWeblink(unittest.TestCase): 23 | """ResSessionInitWeblink unit test stubs""" 24 | 25 | def setUp(self): 26 | pass 27 | 28 | def tearDown(self): 29 | pass 30 | 31 | def make_instance(self, include_optional): 32 | """Test ResSessionInitWeblink 33 | include_option is a boolean, when False only required 34 | params are included, when True both required and 35 | optional params are included """ 36 | # model = openapi_client.models.res_session_init_weblink.ResSessionInitWeblink() # noqa: E501 37 | if include_optional : 38 | return ResSessionInitWeblink( 39 | host = '0', 40 | keySize = 56 41 | ) 42 | else : 43 | return ResSessionInitWeblink( 44 | ) 45 | 46 | def testResSessionInitWeblink(self): 47 | """Test ResSessionInitWeblink""" 48 | inst_req_only = self.make_instance(include_optional=False) 49 | inst_req_and_optional = self.make_instance(include_optional=True) 50 | 51 | 52 | if __name__ == '__main__': 53 | unittest.main() 54 | -------------------------------------------------------------------------------- /test/test_res_sm_order_cancel.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Session-Order-Margin-API 5 | 6 | No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 7 | 8 | The version of the OpenAPI document: 1.0 9 | Generated by: https://openapi-generator.tech 10 | """ 11 | 12 | 13 | from __future__ import absolute_import 14 | 15 | import unittest 16 | import datetime 17 | 18 | import openapi_client 19 | from openapi_client.models.res_sm_order_cancel import ResSMOrderCancel # noqa: E501 20 | from openapi_client.rest import ApiException 21 | 22 | class TestResSMOrderCancel(unittest.TestCase): 23 | """ResSMOrderCancel unit test stubs""" 24 | 25 | def setUp(self): 26 | pass 27 | 28 | def tearDown(self): 29 | pass 30 | 31 | def make_instance(self, include_optional): 32 | """Test ResSMOrderCancel 33 | include_option is a boolean, when False only required 34 | params are included, when True both required and 35 | optional params are included """ 36 | # model = openapi_client.models.res_sm_order_cancel.ResSMOrderCancel() # noqa: E501 37 | if include_optional : 38 | return ResSMOrderCancel( 39 | orderId = '0', 40 | message = '0' 41 | ) 42 | else : 43 | return ResSMOrderCancel( 44 | ) 45 | 46 | def testResSMOrderCancel(self): 47 | """Test ResSMOrderCancel""" 48 | inst_req_only = self.make_instance(include_optional=False) 49 | inst_req_and_optional = self.make_instance(include_optional=True) 50 | 51 | 52 | if __name__ == '__main__': 53 | unittest.main() 54 | -------------------------------------------------------------------------------- /test/test_res_sm_order_mod.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Session-Order-Margin-API 5 | 6 | No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 7 | 8 | The version of the OpenAPI document: 1.0 9 | Generated by: https://openapi-generator.tech 10 | """ 11 | 12 | 13 | from __future__ import absolute_import 14 | 15 | import unittest 16 | import datetime 17 | 18 | import openapi_client 19 | from openapi_client.models.res_sm_order_mod import ResSMOrderMod # noqa: E501 20 | from openapi_client.rest import ApiException 21 | 22 | class TestResSMOrderMod(unittest.TestCase): 23 | """ResSMOrderMod unit test stubs""" 24 | 25 | def setUp(self): 26 | pass 27 | 28 | def tearDown(self): 29 | pass 30 | 31 | def make_instance(self, include_optional): 32 | """Test ResSMOrderMod 33 | include_option is a boolean, when False only required 34 | params are included, when True both required and 35 | optional params are included """ 36 | # model = openapi_client.models.res_sm_order_mod.ResSMOrderMod() # noqa: E501 37 | if include_optional : 38 | return ResSMOrderMod( 39 | orderId = '0', 40 | message = '0' 41 | ) 42 | else : 43 | return ResSMOrderMod( 44 | ) 45 | 46 | def testResSMOrderMod(self): 47 | """Test ResSMOrderMod""" 48 | inst_req_only = self.make_instance(include_optional=False) 49 | inst_req_and_optional = self.make_instance(include_optional=True) 50 | 51 | 52 | if __name__ == '__main__': 53 | unittest.main() 54 | -------------------------------------------------------------------------------- /test/test_res_sor_order_cancel.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Session-Order-Margin-API 5 | 6 | No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 7 | 8 | The version of the OpenAPI document: 1.0 9 | Generated by: https://openapi-generator.tech 10 | """ 11 | 12 | 13 | from __future__ import absolute_import 14 | 15 | import unittest 16 | import datetime 17 | 18 | import openapi_client 19 | from openapi_client.models.res_sor_order_cancel import ResSOROrderCancel # noqa: E501 20 | from openapi_client.rest import ApiException 21 | 22 | class TestResSOROrderCancel(unittest.TestCase): 23 | """ResSOROrderCancel unit test stubs""" 24 | 25 | def setUp(self): 26 | pass 27 | 28 | def tearDown(self): 29 | pass 30 | 31 | def make_instance(self, include_optional): 32 | """Test ResSOROrderCancel 33 | include_option is a boolean, when False only required 34 | params are included, when True both required and 35 | optional params are included """ 36 | # model = openapi_client.models.res_sor_order_cancel.ResSOROrderCancel() # noqa: E501 37 | if include_optional : 38 | return ResSOROrderCancel( 39 | orderId = '0', 40 | message = '0' 41 | ) 42 | else : 43 | return ResSOROrderCancel( 44 | ) 45 | 46 | def testResSOROrderCancel(self): 47 | """Test ResSOROrderCancel""" 48 | inst_req_only = self.make_instance(include_optional=False) 49 | inst_req_and_optional = self.make_instance(include_optional=True) 50 | 51 | 52 | if __name__ == '__main__': 53 | unittest.main() 54 | -------------------------------------------------------------------------------- /test/test_res_sor_order_mod.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Session-Order-Margin-API 5 | 6 | No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 7 | 8 | The version of the OpenAPI document: 1.0 9 | Generated by: https://openapi-generator.tech 10 | """ 11 | 12 | 13 | from __future__ import absolute_import 14 | 15 | import unittest 16 | import datetime 17 | 18 | import openapi_client 19 | from openapi_client.models.res_sor_order_mod import ResSOROrderMod # noqa: E501 20 | from openapi_client.rest import ApiException 21 | 22 | class TestResSOROrderMod(unittest.TestCase): 23 | """ResSOROrderMod unit test stubs""" 24 | 25 | def setUp(self): 26 | pass 27 | 28 | def tearDown(self): 29 | pass 30 | 31 | def make_instance(self, include_optional): 32 | """Test ResSOROrderMod 33 | include_option is a boolean, when False only required 34 | params are included, when True both required and 35 | optional params are included """ 36 | # model = openapi_client.models.res_sor_order_mod.ResSOROrderMod() # noqa: E501 37 | if include_optional : 38 | return ResSOROrderMod( 39 | orderId = '0', 40 | message = '0' 41 | ) 42 | else : 43 | return ResSOROrderMod( 44 | ) 45 | 46 | def testResSOROrderMod(self): 47 | """Test ResSOROrderMod""" 48 | inst_req_only = self.make_instance(include_optional=False) 49 | inst_req_and_optional = self.make_instance(include_optional=True) 50 | 51 | 52 | if __name__ == '__main__': 53 | unittest.main() 54 | -------------------------------------------------------------------------------- /test/test_sell.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | KS Trade API's 5 | 6 | No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 7 | 8 | The version of the OpenAPI document: 1.0 9 | Generated by: https://openapi-generator.tech 10 | """ 11 | 12 | 13 | from __future__ import absolute_import 14 | 15 | import unittest 16 | import datetime 17 | 18 | import openapi_client 19 | from openapi_client.models.sell import Sell # noqa: E501 20 | from openapi_client.rest import ApiException 21 | 22 | class TestSell(unittest.TestCase): 23 | """Sell unit test stubs""" 24 | 25 | def setUp(self): 26 | pass 27 | 28 | def tearDown(self): 29 | pass 30 | 31 | def make_instance(self, include_optional): 32 | """Test Sell 33 | include_option is a boolean, when False only required 34 | params are included, when True both required and 35 | optional params are included """ 36 | # model = openapi_client.models.sell.Sell() # noqa: E501 37 | if include_optional : 38 | return Sell( 39 | price = 1.337, 40 | quantity = 56, 41 | orders = 56 42 | ) 43 | else : 44 | return Sell( 45 | ) 46 | 47 | def testSell(self): 48 | """Test Sell""" 49 | inst_req_only = self.make_instance(include_optional=False) 50 | inst_req_and_optional = self.make_instance(include_optional=True) 51 | 52 | 53 | if __name__ == '__main__': 54 | unittest.main() 55 | -------------------------------------------------------------------------------- /test/test_session_api.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Session-Order-Margin-API 5 | 6 | No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 7 | 8 | The version of the OpenAPI document: 1.0 9 | Generated by: https://openapi-generator.tech 10 | """ 11 | 12 | 13 | from __future__ import absolute_import 14 | 15 | import unittest 16 | 17 | import openapi_client 18 | from openapi_client.api.session_api import SessionApi # noqa: E501 19 | from openapi_client.rest import ApiException 20 | 21 | 22 | class TestSessionApi(unittest.TestCase): 23 | """SessionApi unit test stubs""" 24 | 25 | def setUp(self): 26 | self.api = openapi_client.api.session_api.SessionApi() # noqa: E501 27 | 28 | def tearDown(self): 29 | pass 30 | 31 | def test_generate_session2_fa(self): 32 | """Test case for generate_session2_fa 33 | 34 | Generate final Session Token # noqa: E501 35 | """ 36 | pass 37 | 38 | def test_login_with_user_id(self): 39 | """Test case for login_with_user_id 40 | 41 | Login using Userid # noqa: E501 42 | """ 43 | pass 44 | 45 | def test_session_init(self): 46 | """Test case for session_init 47 | 48 | Initialise Session # noqa: E501 49 | """ 50 | pass 51 | 52 | def test_session_logout(self): 53 | """Test case for session_logout 54 | 55 | Invalidate Session Token # noqa: E501 56 | """ 57 | pass 58 | 59 | 60 | if __name__ == '__main__': 61 | unittest.main() 62 | -------------------------------------------------------------------------------- /test/test_smart_order_routing_api.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Session-Order-Margin-API 5 | 6 | No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 7 | 8 | The version of the OpenAPI document: 1.0 9 | Generated by: https://openapi-generator.tech 10 | """ 11 | 12 | 13 | from __future__ import absolute_import 14 | 15 | import unittest 16 | 17 | import openapi_client 18 | from openapi_client.api.smart_order_routing_api import SmartOrderRoutingApi # noqa: E501 19 | from openapi_client.rest import ApiException 20 | 21 | 22 | class TestSmartOrderRoutingApi(unittest.TestCase): 23 | """SmartOrderRoutingApi unit test stubs""" 24 | 25 | def setUp(self): 26 | self.api = openapi_client.api.smart_order_routing_api.SmartOrderRoutingApi() # noqa: E501 27 | 28 | def tearDown(self): 29 | pass 30 | 31 | def test_cancel_sor_order(self): 32 | """Test case for cancel_sor_order 33 | 34 | Cancel an SORorder # noqa: E501 35 | """ 36 | pass 37 | 38 | def test_modify_sor_order(self): 39 | """Test case for modify_sor_order 40 | 41 | Modify an existing SOR order # noqa: E501 42 | """ 43 | pass 44 | 45 | def test_place_new_sor_order(self): 46 | """Test case for place_new_sor_order 47 | 48 | Place a New SOR order # noqa: E501 49 | """ 50 | pass 51 | 52 | 53 | if __name__ == '__main__': 54 | unittest.main() 55 | -------------------------------------------------------------------------------- /test/test_sor.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Session-Order-Margin-API 5 | 6 | No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 7 | 8 | The version of the OpenAPI document: 1.0 9 | Generated by: https://openapi-generator.tech 10 | """ 11 | 12 | 13 | from __future__ import absolute_import 14 | 15 | import unittest 16 | import datetime 17 | 18 | import openapi_client 19 | from openapi_client.models.sor import Sor # noqa: E501 20 | from openapi_client.rest import ApiException 21 | 22 | class TestSor(unittest.TestCase): 23 | """Sor unit test stubs""" 24 | 25 | def setUp(self): 26 | pass 27 | 28 | def tearDown(self): 29 | pass 30 | 31 | def make_instance(self, include_optional): 32 | """Test Sor 33 | include_option is a boolean, when False only required 34 | params are included, when True both required and 35 | optional params are included """ 36 | # model = openapi_client.models.sor.Sor() # noqa: E501 37 | if include_optional : 38 | return Sor( 39 | price = 1.337, 40 | quantity = 1.337, 41 | mesage = '0', 42 | orderId = '0' 43 | ) 44 | else : 45 | return Sor( 46 | ) 47 | 48 | def testSor(self): 49 | """Test Sor""" 50 | inst_req_only = self.make_instance(include_optional=False) 51 | inst_req_and_optional = self.make_instance(include_optional=True) 52 | 53 | 54 | if __name__ == '__main__': 55 | unittest.main() 56 | -------------------------------------------------------------------------------- /test/test_stocks.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Session-Order-Margin-API 5 | 6 | No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 7 | 8 | The version of the OpenAPI document: 1.0 9 | Generated by: https://openapi-generator.tech 10 | """ 11 | 12 | 13 | from __future__ import absolute_import 14 | 15 | import unittest 16 | import datetime 17 | 18 | import openapi_client 19 | from openapi_client.models.stocks import Stocks # noqa: E501 20 | from openapi_client.rest import ApiException 21 | 22 | class TestStocks(unittest.TestCase): 23 | """Stocks unit test stubs""" 24 | 25 | def setUp(self): 26 | pass 27 | 28 | def tearDown(self): 29 | pass 30 | 31 | def make_instance(self, include_optional): 32 | """Test Stocks 33 | include_option is a boolean, when False only required 34 | params are included, when True both required and 35 | optional params are included """ 36 | # model = openapi_client.models.stocks.Stocks() # noqa: E501 37 | if include_optional : 38 | return Stocks( 39 | instrumentToken = 56, 40 | normal = 1.337, 41 | supermultiple = 1.337, 42 | mtf = 1.337 43 | ) 44 | else : 45 | return Stocks( 46 | ) 47 | 48 | def testStocks(self): 49 | """Test Stocks""" 50 | inst_req_only = self.make_instance(include_optional=False) 51 | inst_req_and_optional = self.make_instance(include_optional=True) 52 | 53 | 54 | if __name__ == '__main__': 55 | unittest.main() 56 | -------------------------------------------------------------------------------- /test/test_super_multiple_order_api.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Session-Order-Margin-API 5 | 6 | No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 7 | 8 | The version of the OpenAPI document: 1.0 9 | Generated by: https://openapi-generator.tech 10 | """ 11 | 12 | 13 | from __future__ import absolute_import 14 | 15 | import unittest 16 | 17 | import openapi_client 18 | from openapi_client.api.super_multiple_order_api import SuperMultipleOrderApi # noqa: E501 19 | from openapi_client.rest import ApiException 20 | 21 | 22 | class TestSuperMultipleOrderApi(unittest.TestCase): 23 | """SuperMultipleOrderApi unit test stubs""" 24 | 25 | def setUp(self): 26 | self.api = openapi_client.api.super_multiple_order_api.SuperMultipleOrderApi() # noqa: E501 27 | 28 | def tearDown(self): 29 | pass 30 | 31 | def test_cancel_sm_order(self): 32 | """Test case for cancel_sm_order 33 | 34 | Cancel an Super Multiple order # noqa: E501 35 | """ 36 | pass 37 | 38 | def test_modify_sm_order(self): 39 | """Test case for modify_sm_order 40 | 41 | Modify an existing super multiple order # noqa: E501 42 | """ 43 | pass 44 | 45 | def test_place_new_sm_order(self): 46 | """Test case for place_new_sm_order 47 | 48 | Place a New Super Multiple order # noqa: E501 49 | """ 50 | pass 51 | 52 | 53 | if __name__ == '__main__': 54 | unittest.main() 55 | -------------------------------------------------------------------------------- /test/test_todays.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Session-Order-Margin-API 5 | 6 | No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 7 | 8 | The version of the OpenAPI document: 1.0 9 | Generated by: https://openapi-generator.tech 10 | """ 11 | 12 | 13 | from __future__ import absolute_import 14 | 15 | import unittest 16 | import datetime 17 | 18 | import openapi_client 19 | from openapi_client.models.todays import Todays # noqa: E501 20 | from openapi_client.rest import ApiException 21 | 22 | class TestTodays(unittest.TestCase): 23 | """Todays unit test stubs""" 24 | 25 | def setUp(self): 26 | pass 27 | 28 | def tearDown(self): 29 | pass 30 | 31 | def make_instance(self, include_optional): 32 | """Test Todays 33 | include_option is a boolean, when False only required 34 | params are included, when True both required and 35 | optional params are included """ 36 | # model = openapi_client.models.todays.Todays() # noqa: E501 37 | if include_optional : 38 | return Todays( 39 | instrumentToken = 56, 40 | normal = 1.337, 41 | supermultiple = 1.337, 42 | mtf = 1.337 43 | ) 44 | else : 45 | return Todays( 46 | ) 47 | 48 | def testTodays(self): 49 | """Test Todays""" 50 | inst_req_only = self.make_instance(include_optional=False) 51 | inst_req_and_optional = self.make_instance(include_optional=True) 52 | 53 | 54 | if __name__ == '__main__': 55 | unittest.main() 56 | -------------------------------------------------------------------------------- /test/test_trades.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Session-Order-Margin-API 5 | 6 | No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 7 | 8 | The version of the OpenAPI document: 1.0 9 | Generated by: https://openapi-generator.tech 10 | """ 11 | 12 | 13 | from __future__ import absolute_import 14 | 15 | import unittest 16 | import datetime 17 | 18 | import openapi_client 19 | from openapi_client.models.trades import Trades # noqa: E501 20 | from openapi_client.rest import ApiException 21 | 22 | class TestTrades(unittest.TestCase): 23 | """Trades unit test stubs""" 24 | 25 | def setUp(self): 26 | pass 27 | 28 | def tearDown(self): 29 | pass 30 | 31 | def make_instance(self, include_optional): 32 | """Test Trades 33 | include_option is a boolean, when False only required 34 | params are included, when True both required and 35 | optional params are included """ 36 | # model = openapi_client.models.trades.Trades() # noqa: E501 37 | if include_optional : 38 | return Trades( 39 | tradeId = 1.337, 40 | orderId = '0', 41 | exchangeTradeId = '0', 42 | instrumentName = '0', 43 | instrumentToken = '0', 44 | exchange = 'NSE', 45 | price = 1.337, 46 | quantity = 56, 47 | transactionType = 'BUY', 48 | product = 'NORMAL', 49 | orderTimestamp = '0', 50 | tradeTimestamp = '0' 51 | ) 52 | else : 53 | return Trades( 54 | ) 55 | 56 | def testTrades(self): 57 | """Test Trades""" 58 | inst_req_only = self.make_instance(include_optional=False) 59 | inst_req_and_optional = self.make_instance(include_optional=True) 60 | 61 | 62 | if __name__ == '__main__': 63 | unittest.main() 64 | -------------------------------------------------------------------------------- /test/test_tslocancel.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Session-Order-Margin-API 5 | 6 | No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 7 | 8 | The version of the OpenAPI document: 1.0 9 | Generated by: https://openapi-generator.tech 10 | """ 11 | 12 | 13 | from __future__ import absolute_import 14 | 15 | import unittest 16 | import datetime 17 | 18 | import openapi_client 19 | from openapi_client.models.tslocancel import Tslocancel # noqa: E501 20 | from openapi_client.rest import ApiException 21 | 22 | class TestTslocancel(unittest.TestCase): 23 | """Tslocancel unit test stubs""" 24 | 25 | def setUp(self): 26 | pass 27 | 28 | def tearDown(self): 29 | pass 30 | 31 | def make_instance(self, include_optional): 32 | """Test Tslocancel 33 | include_option is a boolean, when False only required 34 | params are included, when True both required and 35 | optional params are included """ 36 | # model = openapi_client.models.tslocancel.Tslocancel() # noqa: E501 37 | if include_optional : 38 | return Tslocancel( 39 | orderIndicator = 56 40 | ) 41 | else : 42 | return Tslocancel( 43 | ) 44 | 45 | def testTslocancel(self): 46 | """Test Tslocancel""" 47 | inst_req_only = self.make_instance(include_optional=False) 48 | inst_req_and_optional = self.make_instance(include_optional=True) 49 | 50 | 51 | if __name__ == '__main__': 52 | unittest.main() 53 | -------------------------------------------------------------------------------- /test/test_tslomodify.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Session-Order-Margin-API 5 | 6 | No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 7 | 8 | The version of the OpenAPI document: 1.0 9 | Generated by: https://openapi-generator.tech 10 | """ 11 | 12 | 13 | from __future__ import absolute_import 14 | 15 | import unittest 16 | import datetime 17 | 18 | import openapi_client 19 | from openapi_client.models.tslomodify import Tslomodify # noqa: E501 20 | from openapi_client.rest import ApiException 21 | 22 | class TestTslomodify(unittest.TestCase): 23 | """Tslomodify unit test stubs""" 24 | 25 | def setUp(self): 26 | pass 27 | 28 | def tearDown(self): 29 | pass 30 | 31 | def make_instance(self, include_optional): 32 | """Test Tslomodify 33 | include_option is a boolean, when False only required 34 | params are included, when True both required and 35 | optional params are included """ 36 | # model = openapi_client.models.tslomodify.Tslomodify() # noqa: E501 37 | if include_optional : 38 | return Tslomodify( 39 | orderIndicator = 56, 40 | spread = 1.337, 41 | trailingPrice = 1.337 42 | ) 43 | else : 44 | return Tslomodify( 45 | ) 46 | 47 | def testTslomodify(self): 48 | """Test Tslomodify""" 49 | inst_req_only = self.make_instance(include_optional=False) 50 | inst_req_and_optional = self.make_instance(include_optional=True) 51 | 52 | 53 | if __name__ == '__main__': 54 | unittest.main() 55 | -------------------------------------------------------------------------------- /test/test_tsloplace.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Session-Order-Margin-API 5 | 6 | No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 7 | 8 | The version of the OpenAPI document: 1.0 9 | Generated by: https://openapi-generator.tech 10 | """ 11 | 12 | 13 | from __future__ import absolute_import 14 | 15 | import unittest 16 | import datetime 17 | 18 | import openapi_client 19 | from openapi_client.models.tsloplace import Tsloplace # noqa: E501 20 | from openapi_client.rest import ApiException 21 | 22 | class TestTsloplace(unittest.TestCase): 23 | """Tsloplace unit test stubs""" 24 | 25 | def setUp(self): 26 | pass 27 | 28 | def tearDown(self): 29 | pass 30 | 31 | def make_instance(self, include_optional): 32 | """Test Tsloplace 33 | include_option is a boolean, when False only required 34 | params are included, when True both required and 35 | optional params are included """ 36 | # model = openapi_client.models.tsloplace.Tsloplace() # noqa: E501 37 | if include_optional : 38 | return Tsloplace( 39 | spread = 1.337, 40 | trailingPrice = 1.337 41 | ) 42 | else : 43 | return Tsloplace( 44 | ) 45 | 46 | def testTsloplace(self): 47 | """Test Tsloplace""" 48 | inst_req_only = self.make_instance(include_optional=False) 49 | inst_req_and_optional = self.make_instance(include_optional=True) 50 | 51 | 52 | if __name__ == '__main__': 53 | unittest.main() 54 | -------------------------------------------------------------------------------- /test/test_user_credentials.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Session-Order-Margin-API 5 | 6 | No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 7 | 8 | The version of the OpenAPI document: 1.0 9 | Generated by: https://openapi-generator.tech 10 | """ 11 | 12 | 13 | from __future__ import absolute_import 14 | 15 | import unittest 16 | import datetime 17 | 18 | import openapi_client 19 | from openapi_client.models.user_credentials import UserCredentials # noqa: E501 20 | from openapi_client.rest import ApiException 21 | 22 | class TestUserCredentials(unittest.TestCase): 23 | """UserCredentials unit test stubs""" 24 | 25 | def setUp(self): 26 | pass 27 | 28 | def tearDown(self): 29 | pass 30 | 31 | def make_instance(self, include_optional): 32 | """Test UserCredentials 33 | include_option is a boolean, when False only required 34 | params are included, when True both required and 35 | optional params are included """ 36 | # model = openapi_client.models.user_credentials.UserCredentials() # noqa: E501 37 | if include_optional : 38 | return UserCredentials( 39 | userid = '1Y125', 40 | password = 'abc@123' 41 | ) 42 | else : 43 | return UserCredentials( 44 | ) 45 | 46 | def testUserCredentials(self): 47 | """Test UserCredentials""" 48 | inst_req_only = self.make_instance(include_optional=False) 49 | inst_req_and_optional = self.make_instance(include_optional=True) 50 | 51 | 52 | if __name__ == '__main__': 53 | unittest.main() 54 | -------------------------------------------------------------------------------- /test/test_user_details.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Session-Order-Margin-API 5 | 6 | No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 7 | 8 | The version of the OpenAPI document: 1.0 9 | Generated by: https://openapi-generator.tech 10 | """ 11 | 12 | 13 | from __future__ import absolute_import 14 | 15 | import unittest 16 | import datetime 17 | 18 | import openapi_client 19 | from openapi_client.models.user_details import UserDetails # noqa: E501 20 | from openapi_client.rest import ApiException 21 | 22 | class TestUserDetails(unittest.TestCase): 23 | """UserDetails unit test stubs""" 24 | 25 | def setUp(self): 26 | pass 27 | 28 | def tearDown(self): 29 | pass 30 | 31 | def make_instance(self, include_optional): 32 | """Test UserDetails 33 | include_option is a boolean, when False only required 34 | params are included, when True both required and 35 | optional params are included """ 36 | # model = openapi_client.models.user_details.UserDetails() # noqa: E501 37 | if include_optional : 38 | return UserDetails( 39 | userid = '0', 40 | accessCode = '0' 41 | ) 42 | else : 43 | return UserDetails( 44 | ) 45 | 46 | def testUserDetails(self): 47 | """Test UserDetails""" 48 | inst_req_only = self.make_instance(include_optional=False) 49 | inst_req_and_optional = self.make_instance(include_optional=True) 50 | 51 | 52 | if __name__ == '__main__': 53 | unittest.main() 54 | -------------------------------------------------------------------------------- /tox.ini: -------------------------------------------------------------------------------- 1 | [tox] 2 | envlist = py27, py3 3 | 4 | [testenv] 5 | deps=-r{toxinidir}/requirements.txt 6 | -r{toxinidir}/test-requirements.txt 7 | 8 | commands= 9 | pytest --cov=openapi_client 10 | --------------------------------------------------------------------------------