# Path: async_v20/endpoints/base.py
# class EndPoint(object):
#     """Base object representation of an endpoint"""
# 
#     # Default host to use unless otherwise specified by a derived class
#     host = 'REST'
# 
#     # Path needs to be a Path object
#     path = ()
# 
#     # the HTTP verb to use for this endpoint
#     method = ''
# 
#     # description of endpoint
#     description = ''
# 
#     # parameters required to send to endpoint
#     parameters = {}
# 
#     # valid responses
#     responses = {}
# 
#     # error msgs'
#     error = ()
# 
#     # json format the data body as per the response_schema below
#     request_schema = {}
# 
# HEADER = 'header'
# 
# PATH = 'path'
# 
# QUERY = 'query'


from .annotations import *
from .base import EndPoint, HEADER, PATH, QUERY
from ..definitions.primitives import *
from ..definitions.types import *
class PUTTradeSpecifierClose(EndPoint):
    # the HTTP verb to use for this endpoint
    method = 'PUT'

    # path to endpoint
    path = ('/v3/accounts/', AccountID, '/trades/', TradeSpecifier, '/close')

    # description of endpoint
    description = 'Close (partially or fully) a specific open Trade in an Account'

    # parameters required to send to endpoint
    parameters = {Authorization: (HEADER, 'Authorization'), AcceptDatetimeFormat: (HEADER, 'Accept-Datetime-Format'),
                  AccountID: (PATH, 'accountID'), TradeSpecifier: (PATH, 'tradeSpecifier')}

    # valid responses
    responses = {200: {'orderCreateTransaction': MarketOrderTransaction, 'orderFillTransaction': OrderFillTransaction,
                       'orderCancelTransaction': OrderCancelTransaction, 'relatedTransactionIDs': ArrayTransactionID,
                       'lastTransactionID': TransactionID},
                 400: {'orderRejectTransaction': MarketOrderRejectTransaction, 'errorCode': str,
                       'errorMessage': str},
                 404: {'orderRejectTransaction': MarketOrderRejectTransaction, 'lastTransactionID': TransactionID,
                       'relatedTransactionIDs': ArrayTransactionID, 'errorCode': str, 'errorMessage': str}}

    # error msgs'
    error = (401, 405)

    # json schema representation
    request_schema = {Units: 'units'}



# Path: async_v20/endpoints/base.py
# class EndPoint(object):
#     """Base object representation of an endpoint"""
# 
#     # Default host to use unless otherwise specified by a derived class
#     host = 'REST'
# 
#     # Path needs to be a Path object
#     path = ()
# 
#     # the HTTP verb to use for this endpoint
#     method = ''
# 
#     # description of endpoint
#     description = ''
# 
#     # parameters required to send to endpoint
#     parameters = {}
# 
#     # valid responses
#     responses = {}
# 
#     # error msgs'
#     error = ()
# 
#     # json format the data body as per the response_schema below
#     request_schema = {}
# 
# HEADER = 'header'
# 
# PATH = 'path'
# 
# QUERY = 'query'


# Path: async_v20/endpoints/trade.py
from .annotations import *
from .base import EndPoint, HEADER, PATH, QUERY
from ..definitions.primitives import *
from ..definitions.types import *

class PUTTradeSpecifierClose(EndPoint):
    # the HTTP verb to use for this endpoint
    method = 'PUT'

    # path to endpoint
    path = ('/v3/accounts/', AccountID, '/trades/', TradeSpecifier, '/close')

    # description of endpoint
    description = 'Close (partially or fully) a specific open Trade in an Account'

    # parameters required to send to endpoint
    parameters = {Authorization: (HEADER, 'Authorization'), AcceptDatetimeFormat: (HEADER, 'Accept-Datetime-Format'),
                  AccountID: (PATH, 'accountID'), TradeSpecifier: (PATH, 'tradeSpecifier')}

    # valid responses
    responses = {200: {'orderCreateTransaction': MarketOrderTransaction, 'orderFillTransaction': OrderFillTransaction,
                       'orderCancelTransaction': OrderCancelTransaction, 'relatedTransactionIDs': ArrayTransactionID,
                       'lastTransactionID': TransactionID},
                 400: {'orderRejectTransaction': MarketOrderRejectTransaction, 'errorCode': str,
                       'errorMessage': str},
                 404: {'orderRejectTransaction': MarketOrderRejectTransaction, 'lastTransactionID': TransactionID,
                       'relatedTransactionIDs': ArrayTransactionID, 'errorCode': str, 'errorMessage': str}}

    # error msgs'
    error = (401, 405)

    # json schema representation
    request_schema = {Units: 'units'}



class PUTTradeSpecifierClientExtensions(EndPoint):