From 7d3923183013ad0bd70721c8e67ceff14b60f873 Mon Sep 17 00:00:00 2001 From: KETAN GUPTA Date: Thu, 25 Jun 2026 18:13:31 +0530 Subject: [PATCH 01/10] feat(models): add IPO and payout model classes for ipos-smartlist-payout Co-Authored-By: Claude Opus 4.8 (1M context) --- .../models/initiate_payout_request.py | 142 ++++ upstox_client/models/ipo_details_data.py | 760 ++++++++++++++++++ upstox_client/models/ipo_details_response.py | 136 ++++ upstox_client/models/ipo_listing_data.py | 422 ++++++++++ upstox_client/models/ipo_listing_response.py | 162 ++++ upstox_client/models/ipo_meta_data.py | 110 +++ upstox_client/models/ipo_registrar_info.py | 240 ++++++ upstox_client/models/ipo_timeline.py | 292 +++++++ upstox_client/models/modify_payout_request.py | 113 +++ upstox_client/models/payout_details.py | 344 ++++++++ .../models/payout_details_response.py | 138 ++++ upstox_client/models/payout_modes_data.py | 84 ++ upstox_client/models/payout_modes_response.py | 138 ++++ 13 files changed, 3081 insertions(+) create mode 100644 upstox_client/models/initiate_payout_request.py create mode 100644 upstox_client/models/ipo_details_data.py create mode 100644 upstox_client/models/ipo_details_response.py create mode 100644 upstox_client/models/ipo_listing_data.py create mode 100644 upstox_client/models/ipo_listing_response.py create mode 100644 upstox_client/models/ipo_meta_data.py create mode 100644 upstox_client/models/ipo_registrar_info.py create mode 100644 upstox_client/models/ipo_timeline.py create mode 100644 upstox_client/models/modify_payout_request.py create mode 100644 upstox_client/models/payout_details.py create mode 100644 upstox_client/models/payout_details_response.py create mode 100644 upstox_client/models/payout_modes_data.py create mode 100644 upstox_client/models/payout_modes_response.py diff --git a/upstox_client/models/initiate_payout_request.py b/upstox_client/models/initiate_payout_request.py new file mode 100644 index 0000000..f43dfec --- /dev/null +++ b/upstox_client/models/initiate_payout_request.py @@ -0,0 +1,142 @@ +# coding: utf-8 + +""" + OpenAPI definition + + No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 + + OpenAPI spec version: v0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class InitiatePayoutRequest(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'mode': 'object', + 'amount': 'object' + } + + attribute_map = { + 'mode': 'mode', + 'amount': 'amount' + } + + def __init__(self, mode=None, amount=None): # noqa: E501 + """InitiatePayoutRequest - a model defined in Swagger""" # noqa: E501 + self._mode = None + self._amount = None + self.discriminator = None + self.mode = mode + self.amount = amount + + @property + def mode(self): + """Gets the mode of this InitiatePayoutRequest. # noqa: E501 + + Withdrawal mode. NEFT or IMPS # noqa: E501 + + :return: The mode of this InitiatePayoutRequest. # noqa: E501 + :rtype: object + """ + return self._mode + + @mode.setter + def mode(self, mode): + """Sets the mode of this InitiatePayoutRequest. + + Withdrawal mode. NEFT or IMPS # noqa: E501 + + :param mode: The mode of this InitiatePayoutRequest. # noqa: E501 + :type: object + """ + if mode is None: + raise ValueError("Invalid value for `mode`, must not be `None`") # noqa: E501 + + self._mode = mode + + @property + def amount(self): + """Gets the amount of this InitiatePayoutRequest. # noqa: E501 + + Withdrawal amount in INR # noqa: E501 + + :return: The amount of this InitiatePayoutRequest. # noqa: E501 + :rtype: object + """ + return self._amount + + @amount.setter + def amount(self, amount): + """Sets the amount of this InitiatePayoutRequest. + + Withdrawal amount in INR # noqa: E501 + + :param amount: The amount of this InitiatePayoutRequest. # noqa: E501 + :type: object + """ + if amount is None: + raise ValueError("Invalid value for `amount`, must not be `None`") # noqa: E501 + + self._amount = amount + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(InitiatePayoutRequest, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, InitiatePayoutRequest): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/upstox_client/models/ipo_details_data.py b/upstox_client/models/ipo_details_data.py new file mode 100644 index 0000000..5b0c1af --- /dev/null +++ b/upstox_client/models/ipo_details_data.py @@ -0,0 +1,760 @@ +# coding: utf-8 + +""" + OpenAPI definition + + No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 + + OpenAPI spec version: v0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class IpoDetailsData(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'id': 'object', + 'symbol': 'object', + 'name': 'object', + 'status': 'object', + 'isin': 'object', + 'issue_type': 'object', + 'issue_size': 'object', + 'industry': 'object', + 'minimum_price': 'object', + 'maximum_price': 'object', + 'bidding_start_date': 'object', + 'bidding_end_date': 'object', + 'daily_start_time': 'object', + 'daily_end_time': 'object', + 'face_value': 'object', + 'tick_size': 'object', + 'lot_size': 'object', + 'minimum_quantity': 'object', + 'cut_off_price': 'object', + 'listing_price': 'object', + 'listing_exchange': 'object', + 'rhp_url': 'object', + 'drhp_url': 'object', + 'timeline': 'IpoTimeline', + 'registrar_info': 'IpoRegistrarInfo', + 'total_subscription': 'object' + } + + attribute_map = { + 'id': 'id', + 'symbol': 'symbol', + 'name': 'name', + 'status': 'status', + 'isin': 'isin', + 'issue_type': 'issue_type', + 'issue_size': 'issue_size', + 'industry': 'industry', + 'minimum_price': 'minimum_price', + 'maximum_price': 'maximum_price', + 'bidding_start_date': 'bidding_start_date', + 'bidding_end_date': 'bidding_end_date', + 'daily_start_time': 'daily_start_time', + 'daily_end_time': 'daily_end_time', + 'face_value': 'face_value', + 'tick_size': 'tick_size', + 'lot_size': 'lot_size', + 'minimum_quantity': 'minimum_quantity', + 'cut_off_price': 'cut_off_price', + 'listing_price': 'listing_price', + 'listing_exchange': 'listing_exchange', + 'rhp_url': 'rhp_url', + 'drhp_url': 'drhp_url', + 'timeline': 'timeline', + 'registrar_info': 'registrar_info', + 'total_subscription': 'total_subscription' + } + + def __init__(self, id=None, symbol=None, name=None, status=None, isin=None, issue_type=None, issue_size=None, industry=None, minimum_price=None, maximum_price=None, bidding_start_date=None, bidding_end_date=None, daily_start_time=None, daily_end_time=None, face_value=None, tick_size=None, lot_size=None, minimum_quantity=None, cut_off_price=None, listing_price=None, listing_exchange=None, rhp_url=None, drhp_url=None, timeline=None, registrar_info=None, total_subscription=None): # noqa: E501 + """IpoDetailsData - a model defined in Swagger""" # noqa: E501 + self._id = None + self._symbol = None + self._name = None + self._status = None + self._isin = None + self._issue_type = None + self._issue_size = None + self._industry = None + self._minimum_price = None + self._maximum_price = None + self._bidding_start_date = None + self._bidding_end_date = None + self._daily_start_time = None + self._daily_end_time = None + self._face_value = None + self._tick_size = None + self._lot_size = None + self._minimum_quantity = None + self._cut_off_price = None + self._listing_price = None + self._listing_exchange = None + self._rhp_url = None + self._drhp_url = None + self._timeline = None + self._registrar_info = None + self._total_subscription = None + self.discriminator = None + if id is not None: + self.id = id + if symbol is not None: + self.symbol = symbol + if name is not None: + self.name = name + if status is not None: + self.status = status + if isin is not None: + self.isin = isin + if issue_type is not None: + self.issue_type = issue_type + if issue_size is not None: + self.issue_size = issue_size + if industry is not None: + self.industry = industry + if minimum_price is not None: + self.minimum_price = minimum_price + if maximum_price is not None: + self.maximum_price = maximum_price + if bidding_start_date is not None: + self.bidding_start_date = bidding_start_date + if bidding_end_date is not None: + self.bidding_end_date = bidding_end_date + if daily_start_time is not None: + self.daily_start_time = daily_start_time + if daily_end_time is not None: + self.daily_end_time = daily_end_time + if face_value is not None: + self.face_value = face_value + if tick_size is not None: + self.tick_size = tick_size + if lot_size is not None: + self.lot_size = lot_size + if minimum_quantity is not None: + self.minimum_quantity = minimum_quantity + if cut_off_price is not None: + self.cut_off_price = cut_off_price + if listing_price is not None: + self.listing_price = listing_price + if listing_exchange is not None: + self.listing_exchange = listing_exchange + if rhp_url is not None: + self.rhp_url = rhp_url + if drhp_url is not None: + self.drhp_url = drhp_url + if timeline is not None: + self.timeline = timeline + if registrar_info is not None: + self.registrar_info = registrar_info + if total_subscription is not None: + self.total_subscription = total_subscription + + @property + def id(self): + """Gets the id of this IpoDetailsData. # noqa: E501 + + + :return: The id of this IpoDetailsData. # noqa: E501 + :rtype: object + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this IpoDetailsData. + + + :param id: The id of this IpoDetailsData. # noqa: E501 + :type: object + """ + + self._id = id + + @property + def symbol(self): + """Gets the symbol of this IpoDetailsData. # noqa: E501 + + + :return: The symbol of this IpoDetailsData. # noqa: E501 + :rtype: object + """ + return self._symbol + + @symbol.setter + def symbol(self, symbol): + """Sets the symbol of this IpoDetailsData. + + + :param symbol: The symbol of this IpoDetailsData. # noqa: E501 + :type: object + """ + + self._symbol = symbol + + @property + def name(self): + """Gets the name of this IpoDetailsData. # noqa: E501 + + + :return: The name of this IpoDetailsData. # noqa: E501 + :rtype: object + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this IpoDetailsData. + + + :param name: The name of this IpoDetailsData. # noqa: E501 + :type: object + """ + + self._name = name + + @property + def status(self): + """Gets the status of this IpoDetailsData. # noqa: E501 + + + :return: The status of this IpoDetailsData. # noqa: E501 + :rtype: object + """ + return self._status + + @status.setter + def status(self, status): + """Sets the status of this IpoDetailsData. + + + :param status: The status of this IpoDetailsData. # noqa: E501 + :type: object + """ + + self._status = status + + @property + def isin(self): + """Gets the isin of this IpoDetailsData. # noqa: E501 + + + :return: The isin of this IpoDetailsData. # noqa: E501 + :rtype: object + """ + return self._isin + + @isin.setter + def isin(self, isin): + """Sets the isin of this IpoDetailsData. + + + :param isin: The isin of this IpoDetailsData. # noqa: E501 + :type: object + """ + + self._isin = isin + + @property + def issue_type(self): + """Gets the issue_type of this IpoDetailsData. # noqa: E501 + + + :return: The issue_type of this IpoDetailsData. # noqa: E501 + :rtype: object + """ + return self._issue_type + + @issue_type.setter + def issue_type(self, issue_type): + """Sets the issue_type of this IpoDetailsData. + + + :param issue_type: The issue_type of this IpoDetailsData. # noqa: E501 + :type: object + """ + + self._issue_type = issue_type + + @property + def issue_size(self): + """Gets the issue_size of this IpoDetailsData. # noqa: E501 + + + :return: The issue_size of this IpoDetailsData. # noqa: E501 + :rtype: object + """ + return self._issue_size + + @issue_size.setter + def issue_size(self, issue_size): + """Sets the issue_size of this IpoDetailsData. + + + :param issue_size: The issue_size of this IpoDetailsData. # noqa: E501 + :type: object + """ + + self._issue_size = issue_size + + @property + def industry(self): + """Gets the industry of this IpoDetailsData. # noqa: E501 + + + :return: The industry of this IpoDetailsData. # noqa: E501 + :rtype: object + """ + return self._industry + + @industry.setter + def industry(self, industry): + """Sets the industry of this IpoDetailsData. + + + :param industry: The industry of this IpoDetailsData. # noqa: E501 + :type: object + """ + + self._industry = industry + + @property + def minimum_price(self): + """Gets the minimum_price of this IpoDetailsData. # noqa: E501 + + + :return: The minimum_price of this IpoDetailsData. # noqa: E501 + :rtype: object + """ + return self._minimum_price + + @minimum_price.setter + def minimum_price(self, minimum_price): + """Sets the minimum_price of this IpoDetailsData. + + + :param minimum_price: The minimum_price of this IpoDetailsData. # noqa: E501 + :type: object + """ + + self._minimum_price = minimum_price + + @property + def maximum_price(self): + """Gets the maximum_price of this IpoDetailsData. # noqa: E501 + + + :return: The maximum_price of this IpoDetailsData. # noqa: E501 + :rtype: object + """ + return self._maximum_price + + @maximum_price.setter + def maximum_price(self, maximum_price): + """Sets the maximum_price of this IpoDetailsData. + + + :param maximum_price: The maximum_price of this IpoDetailsData. # noqa: E501 + :type: object + """ + + self._maximum_price = maximum_price + + @property + def bidding_start_date(self): + """Gets the bidding_start_date of this IpoDetailsData. # noqa: E501 + + + :return: The bidding_start_date of this IpoDetailsData. # noqa: E501 + :rtype: object + """ + return self._bidding_start_date + + @bidding_start_date.setter + def bidding_start_date(self, bidding_start_date): + """Sets the bidding_start_date of this IpoDetailsData. + + + :param bidding_start_date: The bidding_start_date of this IpoDetailsData. # noqa: E501 + :type: object + """ + + self._bidding_start_date = bidding_start_date + + @property + def bidding_end_date(self): + """Gets the bidding_end_date of this IpoDetailsData. # noqa: E501 + + + :return: The bidding_end_date of this IpoDetailsData. # noqa: E501 + :rtype: object + """ + return self._bidding_end_date + + @bidding_end_date.setter + def bidding_end_date(self, bidding_end_date): + """Sets the bidding_end_date of this IpoDetailsData. + + + :param bidding_end_date: The bidding_end_date of this IpoDetailsData. # noqa: E501 + :type: object + """ + + self._bidding_end_date = bidding_end_date + + @property + def daily_start_time(self): + """Gets the daily_start_time of this IpoDetailsData. # noqa: E501 + + + :return: The daily_start_time of this IpoDetailsData. # noqa: E501 + :rtype: object + """ + return self._daily_start_time + + @daily_start_time.setter + def daily_start_time(self, daily_start_time): + """Sets the daily_start_time of this IpoDetailsData. + + + :param daily_start_time: The daily_start_time of this IpoDetailsData. # noqa: E501 + :type: object + """ + + self._daily_start_time = daily_start_time + + @property + def daily_end_time(self): + """Gets the daily_end_time of this IpoDetailsData. # noqa: E501 + + + :return: The daily_end_time of this IpoDetailsData. # noqa: E501 + :rtype: object + """ + return self._daily_end_time + + @daily_end_time.setter + def daily_end_time(self, daily_end_time): + """Sets the daily_end_time of this IpoDetailsData. + + + :param daily_end_time: The daily_end_time of this IpoDetailsData. # noqa: E501 + :type: object + """ + + self._daily_end_time = daily_end_time + + @property + def face_value(self): + """Gets the face_value of this IpoDetailsData. # noqa: E501 + + + :return: The face_value of this IpoDetailsData. # noqa: E501 + :rtype: object + """ + return self._face_value + + @face_value.setter + def face_value(self, face_value): + """Sets the face_value of this IpoDetailsData. + + + :param face_value: The face_value of this IpoDetailsData. # noqa: E501 + :type: object + """ + + self._face_value = face_value + + @property + def tick_size(self): + """Gets the tick_size of this IpoDetailsData. # noqa: E501 + + + :return: The tick_size of this IpoDetailsData. # noqa: E501 + :rtype: object + """ + return self._tick_size + + @tick_size.setter + def tick_size(self, tick_size): + """Sets the tick_size of this IpoDetailsData. + + + :param tick_size: The tick_size of this IpoDetailsData. # noqa: E501 + :type: object + """ + + self._tick_size = tick_size + + @property + def lot_size(self): + """Gets the lot_size of this IpoDetailsData. # noqa: E501 + + + :return: The lot_size of this IpoDetailsData. # noqa: E501 + :rtype: object + """ + return self._lot_size + + @lot_size.setter + def lot_size(self, lot_size): + """Sets the lot_size of this IpoDetailsData. + + + :param lot_size: The lot_size of this IpoDetailsData. # noqa: E501 + :type: object + """ + + self._lot_size = lot_size + + @property + def minimum_quantity(self): + """Gets the minimum_quantity of this IpoDetailsData. # noqa: E501 + + + :return: The minimum_quantity of this IpoDetailsData. # noqa: E501 + :rtype: object + """ + return self._minimum_quantity + + @minimum_quantity.setter + def minimum_quantity(self, minimum_quantity): + """Sets the minimum_quantity of this IpoDetailsData. + + + :param minimum_quantity: The minimum_quantity of this IpoDetailsData. # noqa: E501 + :type: object + """ + + self._minimum_quantity = minimum_quantity + + @property + def cut_off_price(self): + """Gets the cut_off_price of this IpoDetailsData. # noqa: E501 + + + :return: The cut_off_price of this IpoDetailsData. # noqa: E501 + :rtype: object + """ + return self._cut_off_price + + @cut_off_price.setter + def cut_off_price(self, cut_off_price): + """Sets the cut_off_price of this IpoDetailsData. + + + :param cut_off_price: The cut_off_price of this IpoDetailsData. # noqa: E501 + :type: object + """ + + self._cut_off_price = cut_off_price + + @property + def listing_price(self): + """Gets the listing_price of this IpoDetailsData. # noqa: E501 + + + :return: The listing_price of this IpoDetailsData. # noqa: E501 + :rtype: object + """ + return self._listing_price + + @listing_price.setter + def listing_price(self, listing_price): + """Sets the listing_price of this IpoDetailsData. + + + :param listing_price: The listing_price of this IpoDetailsData. # noqa: E501 + :type: object + """ + + self._listing_price = listing_price + + @property + def listing_exchange(self): + """Gets the listing_exchange of this IpoDetailsData. # noqa: E501 + + + :return: The listing_exchange of this IpoDetailsData. # noqa: E501 + :rtype: object + """ + return self._listing_exchange + + @listing_exchange.setter + def listing_exchange(self, listing_exchange): + """Sets the listing_exchange of this IpoDetailsData. + + + :param listing_exchange: The listing_exchange of this IpoDetailsData. # noqa: E501 + :type: object + """ + + self._listing_exchange = listing_exchange + + @property + def rhp_url(self): + """Gets the rhp_url of this IpoDetailsData. # noqa: E501 + + + :return: The rhp_url of this IpoDetailsData. # noqa: E501 + :rtype: object + """ + return self._rhp_url + + @rhp_url.setter + def rhp_url(self, rhp_url): + """Sets the rhp_url of this IpoDetailsData. + + + :param rhp_url: The rhp_url of this IpoDetailsData. # noqa: E501 + :type: object + """ + + self._rhp_url = rhp_url + + @property + def drhp_url(self): + """Gets the drhp_url of this IpoDetailsData. # noqa: E501 + + + :return: The drhp_url of this IpoDetailsData. # noqa: E501 + :rtype: object + """ + return self._drhp_url + + @drhp_url.setter + def drhp_url(self, drhp_url): + """Sets the drhp_url of this IpoDetailsData. + + + :param drhp_url: The drhp_url of this IpoDetailsData. # noqa: E501 + :type: object + """ + + self._drhp_url = drhp_url + + @property + def timeline(self): + """Gets the timeline of this IpoDetailsData. # noqa: E501 + + + :return: The timeline of this IpoDetailsData. # noqa: E501 + :rtype: IpoTimeline + """ + return self._timeline + + @timeline.setter + def timeline(self, timeline): + """Sets the timeline of this IpoDetailsData. + + + :param timeline: The timeline of this IpoDetailsData. # noqa: E501 + :type: IpoTimeline + """ + + self._timeline = timeline + + @property + def registrar_info(self): + """Gets the registrar_info of this IpoDetailsData. # noqa: E501 + + + :return: The registrar_info of this IpoDetailsData. # noqa: E501 + :rtype: IpoRegistrarInfo + """ + return self._registrar_info + + @registrar_info.setter + def registrar_info(self, registrar_info): + """Sets the registrar_info of this IpoDetailsData. + + + :param registrar_info: The registrar_info of this IpoDetailsData. # noqa: E501 + :type: IpoRegistrarInfo + """ + + self._registrar_info = registrar_info + + @property + def total_subscription(self): + """Gets the total_subscription of this IpoDetailsData. # noqa: E501 + + + :return: The total_subscription of this IpoDetailsData. # noqa: E501 + :rtype: object + """ + return self._total_subscription + + @total_subscription.setter + def total_subscription(self, total_subscription): + """Sets the total_subscription of this IpoDetailsData. + + + :param total_subscription: The total_subscription of this IpoDetailsData. # noqa: E501 + :type: object + """ + + self._total_subscription = total_subscription + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(IpoDetailsData, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, IpoDetailsData): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/upstox_client/models/ipo_details_response.py b/upstox_client/models/ipo_details_response.py new file mode 100644 index 0000000..2fe2e04 --- /dev/null +++ b/upstox_client/models/ipo_details_response.py @@ -0,0 +1,136 @@ +# coding: utf-8 + +""" + OpenAPI definition + + No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 + + OpenAPI spec version: v0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class IpoDetailsResponse(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'status': 'object', + 'data': 'IpoDetailsData' + } + + attribute_map = { + 'status': 'status', + 'data': 'data' + } + + def __init__(self, status=None, data=None): # noqa: E501 + """IpoDetailsResponse - a model defined in Swagger""" # noqa: E501 + self._status = None + self._data = None + self.discriminator = None + if status is not None: + self.status = status + if data is not None: + self.data = data + + @property + def status(self): + """Gets the status of this IpoDetailsResponse. # noqa: E501 + + + :return: The status of this IpoDetailsResponse. # noqa: E501 + :rtype: object + """ + return self._status + + @status.setter + def status(self, status): + """Sets the status of this IpoDetailsResponse. + + + :param status: The status of this IpoDetailsResponse. # noqa: E501 + :type: object + """ + + self._status = status + + @property + def data(self): + """Gets the data of this IpoDetailsResponse. # noqa: E501 + + + :return: The data of this IpoDetailsResponse. # noqa: E501 + :rtype: IpoDetailsData + """ + return self._data + + @data.setter + def data(self, data): + """Sets the data of this IpoDetailsResponse. + + + :param data: The data of this IpoDetailsResponse. # noqa: E501 + :type: IpoDetailsData + """ + + self._data = data + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(IpoDetailsResponse, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, IpoDetailsResponse): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/upstox_client/models/ipo_listing_data.py b/upstox_client/models/ipo_listing_data.py new file mode 100644 index 0000000..cec6e18 --- /dev/null +++ b/upstox_client/models/ipo_listing_data.py @@ -0,0 +1,422 @@ +# coding: utf-8 + +""" + OpenAPI definition + + No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 + + OpenAPI spec version: v0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class IpoListingData(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'id': 'object', + 'symbol': 'object', + 'name': 'object', + 'status': 'object', + 'isin': 'object', + 'issue_type': 'object', + 'issue_size': 'object', + 'industry': 'object', + 'minimum_price': 'object', + 'maximum_price': 'object', + 'bidding_start_date': 'object', + 'bidding_end_date': 'object', + 'total_subscription': 'object' + } + + attribute_map = { + 'id': 'id', + 'symbol': 'symbol', + 'name': 'name', + 'status': 'status', + 'isin': 'isin', + 'issue_type': 'issue_type', + 'issue_size': 'issue_size', + 'industry': 'industry', + 'minimum_price': 'minimum_price', + 'maximum_price': 'maximum_price', + 'bidding_start_date': 'bidding_start_date', + 'bidding_end_date': 'bidding_end_date', + 'total_subscription': 'total_subscription' + } + + def __init__(self, id=None, symbol=None, name=None, status=None, isin=None, issue_type=None, issue_size=None, industry=None, minimum_price=None, maximum_price=None, bidding_start_date=None, bidding_end_date=None, total_subscription=None): # noqa: E501 + """IpoListingData - a model defined in Swagger""" # noqa: E501 + self._id = None + self._symbol = None + self._name = None + self._status = None + self._isin = None + self._issue_type = None + self._issue_size = None + self._industry = None + self._minimum_price = None + self._maximum_price = None + self._bidding_start_date = None + self._bidding_end_date = None + self._total_subscription = None + self.discriminator = None + if id is not None: + self.id = id + if symbol is not None: + self.symbol = symbol + if name is not None: + self.name = name + if status is not None: + self.status = status + if isin is not None: + self.isin = isin + if issue_type is not None: + self.issue_type = issue_type + if issue_size is not None: + self.issue_size = issue_size + if industry is not None: + self.industry = industry + if minimum_price is not None: + self.minimum_price = minimum_price + if maximum_price is not None: + self.maximum_price = maximum_price + if bidding_start_date is not None: + self.bidding_start_date = bidding_start_date + if bidding_end_date is not None: + self.bidding_end_date = bidding_end_date + if total_subscription is not None: + self.total_subscription = total_subscription + + @property + def id(self): + """Gets the id of this IpoListingData. # noqa: E501 + + + :return: The id of this IpoListingData. # noqa: E501 + :rtype: object + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this IpoListingData. + + + :param id: The id of this IpoListingData. # noqa: E501 + :type: object + """ + + self._id = id + + @property + def symbol(self): + """Gets the symbol of this IpoListingData. # noqa: E501 + + + :return: The symbol of this IpoListingData. # noqa: E501 + :rtype: object + """ + return self._symbol + + @symbol.setter + def symbol(self, symbol): + """Sets the symbol of this IpoListingData. + + + :param symbol: The symbol of this IpoListingData. # noqa: E501 + :type: object + """ + + self._symbol = symbol + + @property + def name(self): + """Gets the name of this IpoListingData. # noqa: E501 + + + :return: The name of this IpoListingData. # noqa: E501 + :rtype: object + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this IpoListingData. + + + :param name: The name of this IpoListingData. # noqa: E501 + :type: object + """ + + self._name = name + + @property + def status(self): + """Gets the status of this IpoListingData. # noqa: E501 + + + :return: The status of this IpoListingData. # noqa: E501 + :rtype: object + """ + return self._status + + @status.setter + def status(self, status): + """Sets the status of this IpoListingData. + + + :param status: The status of this IpoListingData. # noqa: E501 + :type: object + """ + + self._status = status + + @property + def isin(self): + """Gets the isin of this IpoListingData. # noqa: E501 + + + :return: The isin of this IpoListingData. # noqa: E501 + :rtype: object + """ + return self._isin + + @isin.setter + def isin(self, isin): + """Sets the isin of this IpoListingData. + + + :param isin: The isin of this IpoListingData. # noqa: E501 + :type: object + """ + + self._isin = isin + + @property + def issue_type(self): + """Gets the issue_type of this IpoListingData. # noqa: E501 + + + :return: The issue_type of this IpoListingData. # noqa: E501 + :rtype: object + """ + return self._issue_type + + @issue_type.setter + def issue_type(self, issue_type): + """Sets the issue_type of this IpoListingData. + + + :param issue_type: The issue_type of this IpoListingData. # noqa: E501 + :type: object + """ + + self._issue_type = issue_type + + @property + def issue_size(self): + """Gets the issue_size of this IpoListingData. # noqa: E501 + + + :return: The issue_size of this IpoListingData. # noqa: E501 + :rtype: object + """ + return self._issue_size + + @issue_size.setter + def issue_size(self, issue_size): + """Sets the issue_size of this IpoListingData. + + + :param issue_size: The issue_size of this IpoListingData. # noqa: E501 + :type: object + """ + + self._issue_size = issue_size + + @property + def industry(self): + """Gets the industry of this IpoListingData. # noqa: E501 + + + :return: The industry of this IpoListingData. # noqa: E501 + :rtype: object + """ + return self._industry + + @industry.setter + def industry(self, industry): + """Sets the industry of this IpoListingData. + + + :param industry: The industry of this IpoListingData. # noqa: E501 + :type: object + """ + + self._industry = industry + + @property + def minimum_price(self): + """Gets the minimum_price of this IpoListingData. # noqa: E501 + + + :return: The minimum_price of this IpoListingData. # noqa: E501 + :rtype: object + """ + return self._minimum_price + + @minimum_price.setter + def minimum_price(self, minimum_price): + """Sets the minimum_price of this IpoListingData. + + + :param minimum_price: The minimum_price of this IpoListingData. # noqa: E501 + :type: object + """ + + self._minimum_price = minimum_price + + @property + def maximum_price(self): + """Gets the maximum_price of this IpoListingData. # noqa: E501 + + + :return: The maximum_price of this IpoListingData. # noqa: E501 + :rtype: object + """ + return self._maximum_price + + @maximum_price.setter + def maximum_price(self, maximum_price): + """Sets the maximum_price of this IpoListingData. + + + :param maximum_price: The maximum_price of this IpoListingData. # noqa: E501 + :type: object + """ + + self._maximum_price = maximum_price + + @property + def bidding_start_date(self): + """Gets the bidding_start_date of this IpoListingData. # noqa: E501 + + + :return: The bidding_start_date of this IpoListingData. # noqa: E501 + :rtype: object + """ + return self._bidding_start_date + + @bidding_start_date.setter + def bidding_start_date(self, bidding_start_date): + """Sets the bidding_start_date of this IpoListingData. + + + :param bidding_start_date: The bidding_start_date of this IpoListingData. # noqa: E501 + :type: object + """ + + self._bidding_start_date = bidding_start_date + + @property + def bidding_end_date(self): + """Gets the bidding_end_date of this IpoListingData. # noqa: E501 + + + :return: The bidding_end_date of this IpoListingData. # noqa: E501 + :rtype: object + """ + return self._bidding_end_date + + @bidding_end_date.setter + def bidding_end_date(self, bidding_end_date): + """Sets the bidding_end_date of this IpoListingData. + + + :param bidding_end_date: The bidding_end_date of this IpoListingData. # noqa: E501 + :type: object + """ + + self._bidding_end_date = bidding_end_date + + @property + def total_subscription(self): + """Gets the total_subscription of this IpoListingData. # noqa: E501 + + + :return: The total_subscription of this IpoListingData. # noqa: E501 + :rtype: object + """ + return self._total_subscription + + @total_subscription.setter + def total_subscription(self, total_subscription): + """Sets the total_subscription of this IpoListingData. + + + :param total_subscription: The total_subscription of this IpoListingData. # noqa: E501 + :type: object + """ + + self._total_subscription = total_subscription + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(IpoListingData, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, IpoListingData): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/upstox_client/models/ipo_listing_response.py b/upstox_client/models/ipo_listing_response.py new file mode 100644 index 0000000..806b520 --- /dev/null +++ b/upstox_client/models/ipo_listing_response.py @@ -0,0 +1,162 @@ +# coding: utf-8 + +""" + OpenAPI definition + + No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 + + OpenAPI spec version: v0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class IpoListingResponse(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'status': 'object', + 'data': 'object', + 'meta_data': 'IpoMetaData' + } + + attribute_map = { + 'status': 'status', + 'data': 'data', + 'meta_data': 'meta_data' + } + + def __init__(self, status=None, data=None, meta_data=None): # noqa: E501 + """IpoListingResponse - a model defined in Swagger""" # noqa: E501 + self._status = None + self._data = None + self._meta_data = None + self.discriminator = None + if status is not None: + self.status = status + if data is not None: + self.data = data + if meta_data is not None: + self.meta_data = meta_data + + @property + def status(self): + """Gets the status of this IpoListingResponse. # noqa: E501 + + + :return: The status of this IpoListingResponse. # noqa: E501 + :rtype: object + """ + return self._status + + @status.setter + def status(self, status): + """Sets the status of this IpoListingResponse. + + + :param status: The status of this IpoListingResponse. # noqa: E501 + :type: object + """ + + self._status = status + + @property + def data(self): + """Gets the data of this IpoListingResponse. # noqa: E501 + + + :return: The data of this IpoListingResponse. # noqa: E501 + :rtype: object + """ + return self._data + + @data.setter + def data(self, data): + """Sets the data of this IpoListingResponse. + + + :param data: The data of this IpoListingResponse. # noqa: E501 + :type: object + """ + + self._data = data + + @property + def meta_data(self): + """Gets the meta_data of this IpoListingResponse. # noqa: E501 + + + :return: The meta_data of this IpoListingResponse. # noqa: E501 + :rtype: IpoMetaData + """ + return self._meta_data + + @meta_data.setter + def meta_data(self, meta_data): + """Sets the meta_data of this IpoListingResponse. + + + :param meta_data: The meta_data of this IpoListingResponse. # noqa: E501 + :type: IpoMetaData + """ + + self._meta_data = meta_data + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(IpoListingResponse, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, IpoListingResponse): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/upstox_client/models/ipo_meta_data.py b/upstox_client/models/ipo_meta_data.py new file mode 100644 index 0000000..c22e4dd --- /dev/null +++ b/upstox_client/models/ipo_meta_data.py @@ -0,0 +1,110 @@ +# coding: utf-8 + +""" + OpenAPI definition + + No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 + + OpenAPI spec version: v0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class IpoMetaData(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'page': 'Pagination' + } + + attribute_map = { + 'page': 'page' + } + + def __init__(self, page=None): # noqa: E501 + """IpoMetaData - a model defined in Swagger""" # noqa: E501 + self._page = None + self.discriminator = None + if page is not None: + self.page = page + + @property + def page(self): + """Gets the page of this IpoMetaData. # noqa: E501 + + + :return: The page of this IpoMetaData. # noqa: E501 + :rtype: Pagination + """ + return self._page + + @page.setter + def page(self, page): + """Sets the page of this IpoMetaData. + + + :param page: The page of this IpoMetaData. # noqa: E501 + :type: Pagination + """ + + self._page = page + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(IpoMetaData, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, IpoMetaData): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/upstox_client/models/ipo_registrar_info.py b/upstox_client/models/ipo_registrar_info.py new file mode 100644 index 0000000..32f0042 --- /dev/null +++ b/upstox_client/models/ipo_registrar_info.py @@ -0,0 +1,240 @@ +# coding: utf-8 + +""" + OpenAPI definition + + No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 + + OpenAPI spec version: v0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class IpoRegistrarInfo(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'name': 'object', + 'email': 'object', + 'contact_name': 'object', + 'contact_number': 'object', + 'website': 'object', + 'registrar': 'object' + } + + attribute_map = { + 'name': 'name', + 'email': 'email', + 'contact_name': 'contact_name', + 'contact_number': 'contact_number', + 'website': 'website', + 'registrar': 'registrar' + } + + def __init__(self, name=None, email=None, contact_name=None, contact_number=None, website=None, registrar=None): # noqa: E501 + """IpoRegistrarInfo - a model defined in Swagger""" # noqa: E501 + self._name = None + self._email = None + self._contact_name = None + self._contact_number = None + self._website = None + self._registrar = None + self.discriminator = None + if name is not None: + self.name = name + if email is not None: + self.email = email + if contact_name is not None: + self.contact_name = contact_name + if contact_number is not None: + self.contact_number = contact_number + if website is not None: + self.website = website + if registrar is not None: + self.registrar = registrar + + @property + def name(self): + """Gets the name of this IpoRegistrarInfo. # noqa: E501 + + + :return: The name of this IpoRegistrarInfo. # noqa: E501 + :rtype: object + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this IpoRegistrarInfo. + + + :param name: The name of this IpoRegistrarInfo. # noqa: E501 + :type: object + """ + + self._name = name + + @property + def email(self): + """Gets the email of this IpoRegistrarInfo. # noqa: E501 + + + :return: The email of this IpoRegistrarInfo. # noqa: E501 + :rtype: object + """ + return self._email + + @email.setter + def email(self, email): + """Sets the email of this IpoRegistrarInfo. + + + :param email: The email of this IpoRegistrarInfo. # noqa: E501 + :type: object + """ + + self._email = email + + @property + def contact_name(self): + """Gets the contact_name of this IpoRegistrarInfo. # noqa: E501 + + + :return: The contact_name of this IpoRegistrarInfo. # noqa: E501 + :rtype: object + """ + return self._contact_name + + @contact_name.setter + def contact_name(self, contact_name): + """Sets the contact_name of this IpoRegistrarInfo. + + + :param contact_name: The contact_name of this IpoRegistrarInfo. # noqa: E501 + :type: object + """ + + self._contact_name = contact_name + + @property + def contact_number(self): + """Gets the contact_number of this IpoRegistrarInfo. # noqa: E501 + + + :return: The contact_number of this IpoRegistrarInfo. # noqa: E501 + :rtype: object + """ + return self._contact_number + + @contact_number.setter + def contact_number(self, contact_number): + """Sets the contact_number of this IpoRegistrarInfo. + + + :param contact_number: The contact_number of this IpoRegistrarInfo. # noqa: E501 + :type: object + """ + + self._contact_number = contact_number + + @property + def website(self): + """Gets the website of this IpoRegistrarInfo. # noqa: E501 + + + :return: The website of this IpoRegistrarInfo. # noqa: E501 + :rtype: object + """ + return self._website + + @website.setter + def website(self, website): + """Sets the website of this IpoRegistrarInfo. + + + :param website: The website of this IpoRegistrarInfo. # noqa: E501 + :type: object + """ + + self._website = website + + @property + def registrar(self): + """Gets the registrar of this IpoRegistrarInfo. # noqa: E501 + + + :return: The registrar of this IpoRegistrarInfo. # noqa: E501 + :rtype: object + """ + return self._registrar + + @registrar.setter + def registrar(self, registrar): + """Sets the registrar of this IpoRegistrarInfo. + + + :param registrar: The registrar of this IpoRegistrarInfo. # noqa: E501 + :type: object + """ + + self._registrar = registrar + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(IpoRegistrarInfo, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, IpoRegistrarInfo): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/upstox_client/models/ipo_timeline.py b/upstox_client/models/ipo_timeline.py new file mode 100644 index 0000000..338ec51 --- /dev/null +++ b/upstox_client/models/ipo_timeline.py @@ -0,0 +1,292 @@ +# coding: utf-8 + +""" + OpenAPI definition + + No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 + + OpenAPI spec version: v0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class IpoTimeline(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'pre_apply_start_date': 'object', + 'application_start_date': 'object', + 'application_end_date': 'object', + 'allotment_start_date': 'object', + 'allotment_date': 'object', + 'refund_initiation_date': 'object', + 'listing_date': 'object', + 'mandate_end_date': 'object' + } + + attribute_map = { + 'pre_apply_start_date': 'pre_apply_start_date', + 'application_start_date': 'application_start_date', + 'application_end_date': 'application_end_date', + 'allotment_start_date': 'allotment_start_date', + 'allotment_date': 'allotment_date', + 'refund_initiation_date': 'refund_initiation_date', + 'listing_date': 'listing_date', + 'mandate_end_date': 'mandate_end_date' + } + + def __init__(self, pre_apply_start_date=None, application_start_date=None, application_end_date=None, allotment_start_date=None, allotment_date=None, refund_initiation_date=None, listing_date=None, mandate_end_date=None): # noqa: E501 + """IpoTimeline - a model defined in Swagger""" # noqa: E501 + self._pre_apply_start_date = None + self._application_start_date = None + self._application_end_date = None + self._allotment_start_date = None + self._allotment_date = None + self._refund_initiation_date = None + self._listing_date = None + self._mandate_end_date = None + self.discriminator = None + if pre_apply_start_date is not None: + self.pre_apply_start_date = pre_apply_start_date + if application_start_date is not None: + self.application_start_date = application_start_date + if application_end_date is not None: + self.application_end_date = application_end_date + if allotment_start_date is not None: + self.allotment_start_date = allotment_start_date + if allotment_date is not None: + self.allotment_date = allotment_date + if refund_initiation_date is not None: + self.refund_initiation_date = refund_initiation_date + if listing_date is not None: + self.listing_date = listing_date + if mandate_end_date is not None: + self.mandate_end_date = mandate_end_date + + @property + def pre_apply_start_date(self): + """Gets the pre_apply_start_date of this IpoTimeline. # noqa: E501 + + + :return: The pre_apply_start_date of this IpoTimeline. # noqa: E501 + :rtype: object + """ + return self._pre_apply_start_date + + @pre_apply_start_date.setter + def pre_apply_start_date(self, pre_apply_start_date): + """Sets the pre_apply_start_date of this IpoTimeline. + + + :param pre_apply_start_date: The pre_apply_start_date of this IpoTimeline. # noqa: E501 + :type: object + """ + + self._pre_apply_start_date = pre_apply_start_date + + @property + def application_start_date(self): + """Gets the application_start_date of this IpoTimeline. # noqa: E501 + + + :return: The application_start_date of this IpoTimeline. # noqa: E501 + :rtype: object + """ + return self._application_start_date + + @application_start_date.setter + def application_start_date(self, application_start_date): + """Sets the application_start_date of this IpoTimeline. + + + :param application_start_date: The application_start_date of this IpoTimeline. # noqa: E501 + :type: object + """ + + self._application_start_date = application_start_date + + @property + def application_end_date(self): + """Gets the application_end_date of this IpoTimeline. # noqa: E501 + + + :return: The application_end_date of this IpoTimeline. # noqa: E501 + :rtype: object + """ + return self._application_end_date + + @application_end_date.setter + def application_end_date(self, application_end_date): + """Sets the application_end_date of this IpoTimeline. + + + :param application_end_date: The application_end_date of this IpoTimeline. # noqa: E501 + :type: object + """ + + self._application_end_date = application_end_date + + @property + def allotment_start_date(self): + """Gets the allotment_start_date of this IpoTimeline. # noqa: E501 + + + :return: The allotment_start_date of this IpoTimeline. # noqa: E501 + :rtype: object + """ + return self._allotment_start_date + + @allotment_start_date.setter + def allotment_start_date(self, allotment_start_date): + """Sets the allotment_start_date of this IpoTimeline. + + + :param allotment_start_date: The allotment_start_date of this IpoTimeline. # noqa: E501 + :type: object + """ + + self._allotment_start_date = allotment_start_date + + @property + def allotment_date(self): + """Gets the allotment_date of this IpoTimeline. # noqa: E501 + + + :return: The allotment_date of this IpoTimeline. # noqa: E501 + :rtype: object + """ + return self._allotment_date + + @allotment_date.setter + def allotment_date(self, allotment_date): + """Sets the allotment_date of this IpoTimeline. + + + :param allotment_date: The allotment_date of this IpoTimeline. # noqa: E501 + :type: object + """ + + self._allotment_date = allotment_date + + @property + def refund_initiation_date(self): + """Gets the refund_initiation_date of this IpoTimeline. # noqa: E501 + + + :return: The refund_initiation_date of this IpoTimeline. # noqa: E501 + :rtype: object + """ + return self._refund_initiation_date + + @refund_initiation_date.setter + def refund_initiation_date(self, refund_initiation_date): + """Sets the refund_initiation_date of this IpoTimeline. + + + :param refund_initiation_date: The refund_initiation_date of this IpoTimeline. # noqa: E501 + :type: object + """ + + self._refund_initiation_date = refund_initiation_date + + @property + def listing_date(self): + """Gets the listing_date of this IpoTimeline. # noqa: E501 + + + :return: The listing_date of this IpoTimeline. # noqa: E501 + :rtype: object + """ + return self._listing_date + + @listing_date.setter + def listing_date(self, listing_date): + """Sets the listing_date of this IpoTimeline. + + + :param listing_date: The listing_date of this IpoTimeline. # noqa: E501 + :type: object + """ + + self._listing_date = listing_date + + @property + def mandate_end_date(self): + """Gets the mandate_end_date of this IpoTimeline. # noqa: E501 + + + :return: The mandate_end_date of this IpoTimeline. # noqa: E501 + :rtype: object + """ + return self._mandate_end_date + + @mandate_end_date.setter + def mandate_end_date(self, mandate_end_date): + """Sets the mandate_end_date of this IpoTimeline. + + + :param mandate_end_date: The mandate_end_date of this IpoTimeline. # noqa: E501 + :type: object + """ + + self._mandate_end_date = mandate_end_date + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(IpoTimeline, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, IpoTimeline): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/upstox_client/models/modify_payout_request.py b/upstox_client/models/modify_payout_request.py new file mode 100644 index 0000000..fc202ef --- /dev/null +++ b/upstox_client/models/modify_payout_request.py @@ -0,0 +1,113 @@ +# coding: utf-8 + +""" + OpenAPI definition + + No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 + + OpenAPI spec version: v0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class ModifyPayoutRequest(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'amount': 'object' + } + + attribute_map = { + 'amount': 'amount' + } + + def __init__(self, amount=None): # noqa: E501 + """ModifyPayoutRequest - a model defined in Swagger""" # noqa: E501 + self._amount = None + self.discriminator = None + self.amount = amount + + @property + def amount(self): + """Gets the amount of this ModifyPayoutRequest. # noqa: E501 + + Withdrawal amount in INR # noqa: E501 + + :return: The amount of this ModifyPayoutRequest. # noqa: E501 + :rtype: object + """ + return self._amount + + @amount.setter + def amount(self, amount): + """Sets the amount of this ModifyPayoutRequest. + + Withdrawal amount in INR # noqa: E501 + + :param amount: The amount of this ModifyPayoutRequest. # noqa: E501 + :type: object + """ + if amount is None: + raise ValueError("Invalid value for `amount`, must not be `None`") # noqa: E501 + + self._amount = amount + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(ModifyPayoutRequest, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ModifyPayoutRequest): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/upstox_client/models/payout_details.py b/upstox_client/models/payout_details.py new file mode 100644 index 0000000..50f0f96 --- /dev/null +++ b/upstox_client/models/payout_details.py @@ -0,0 +1,344 @@ +# coding: utf-8 + +""" + OpenAPI definition + + No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 + + OpenAPI spec version: v0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class PayoutDetails(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'status': 'object', + 'mode': 'object', + 'amount': 'object', + 'currency': 'object', + 'eta': 'object', + 'message': 'object', + 'transaction_id': 'object', + 'created_at': 'object', + 'bank_name': 'object', + 'transaction_fee': 'object' + } + + attribute_map = { + 'status': 'status', + 'mode': 'mode', + 'amount': 'amount', + 'currency': 'currency', + 'eta': 'eta', + 'message': 'message', + 'transaction_id': 'transaction_id', + 'created_at': 'created_at', + 'bank_name': 'bank_name', + 'transaction_fee': 'transaction_fee' + } + + def __init__(self, status=None, mode=None, amount=None, currency=None, eta=None, message=None, transaction_id=None, created_at=None, bank_name=None, transaction_fee=None): # noqa: E501 + """PayoutDetails - a model defined in Swagger""" # noqa: E501 + self._status = None + self._mode = None + self._amount = None + self._currency = None + self._eta = None + self._message = None + self._transaction_id = None + self._created_at = None + self._bank_name = None + self._transaction_fee = None + self.discriminator = None + if status is not None: + self.status = status + if mode is not None: + self.mode = mode + if amount is not None: + self.amount = amount + if currency is not None: + self.currency = currency + if eta is not None: + self.eta = eta + if message is not None: + self.message = message + if transaction_id is not None: + self.transaction_id = transaction_id + if created_at is not None: + self.created_at = created_at + if bank_name is not None: + self.bank_name = bank_name + if transaction_fee is not None: + self.transaction_fee = transaction_fee + + @property + def status(self): + """Gets the status of this PayoutDetails. # noqa: E501 + + + :return: The status of this PayoutDetails. # noqa: E501 + :rtype: object + """ + return self._status + + @status.setter + def status(self, status): + """Sets the status of this PayoutDetails. + + + :param status: The status of this PayoutDetails. # noqa: E501 + :type: object + """ + + self._status = status + + @property + def mode(self): + """Gets the mode of this PayoutDetails. # noqa: E501 + + + :return: The mode of this PayoutDetails. # noqa: E501 + :rtype: object + """ + return self._mode + + @mode.setter + def mode(self, mode): + """Sets the mode of this PayoutDetails. + + + :param mode: The mode of this PayoutDetails. # noqa: E501 + :type: object + """ + + self._mode = mode + + @property + def amount(self): + """Gets the amount of this PayoutDetails. # noqa: E501 + + + :return: The amount of this PayoutDetails. # noqa: E501 + :rtype: object + """ + return self._amount + + @amount.setter + def amount(self, amount): + """Sets the amount of this PayoutDetails. + + + :param amount: The amount of this PayoutDetails. # noqa: E501 + :type: object + """ + + self._amount = amount + + @property + def currency(self): + """Gets the currency of this PayoutDetails. # noqa: E501 + + + :return: The currency of this PayoutDetails. # noqa: E501 + :rtype: object + """ + return self._currency + + @currency.setter + def currency(self, currency): + """Sets the currency of this PayoutDetails. + + + :param currency: The currency of this PayoutDetails. # noqa: E501 + :type: object + """ + + self._currency = currency + + @property + def eta(self): + """Gets the eta of this PayoutDetails. # noqa: E501 + + + :return: The eta of this PayoutDetails. # noqa: E501 + :rtype: object + """ + return self._eta + + @eta.setter + def eta(self, eta): + """Sets the eta of this PayoutDetails. + + + :param eta: The eta of this PayoutDetails. # noqa: E501 + :type: object + """ + + self._eta = eta + + @property + def message(self): + """Gets the message of this PayoutDetails. # noqa: E501 + + + :return: The message of this PayoutDetails. # noqa: E501 + :rtype: object + """ + return self._message + + @message.setter + def message(self, message): + """Sets the message of this PayoutDetails. + + + :param message: The message of this PayoutDetails. # noqa: E501 + :type: object + """ + + self._message = message + + @property + def transaction_id(self): + """Gets the transaction_id of this PayoutDetails. # noqa: E501 + + + :return: The transaction_id of this PayoutDetails. # noqa: E501 + :rtype: object + """ + return self._transaction_id + + @transaction_id.setter + def transaction_id(self, transaction_id): + """Sets the transaction_id of this PayoutDetails. + + + :param transaction_id: The transaction_id of this PayoutDetails. # noqa: E501 + :type: object + """ + + self._transaction_id = transaction_id + + @property + def created_at(self): + """Gets the created_at of this PayoutDetails. # noqa: E501 + + + :return: The created_at of this PayoutDetails. # noqa: E501 + :rtype: object + """ + return self._created_at + + @created_at.setter + def created_at(self, created_at): + """Sets the created_at of this PayoutDetails. + + + :param created_at: The created_at of this PayoutDetails. # noqa: E501 + :type: object + """ + + self._created_at = created_at + + @property + def bank_name(self): + """Gets the bank_name of this PayoutDetails. # noqa: E501 + + + :return: The bank_name of this PayoutDetails. # noqa: E501 + :rtype: object + """ + return self._bank_name + + @bank_name.setter + def bank_name(self, bank_name): + """Sets the bank_name of this PayoutDetails. + + + :param bank_name: The bank_name of this PayoutDetails. # noqa: E501 + :type: object + """ + + self._bank_name = bank_name + + @property + def transaction_fee(self): + """Gets the transaction_fee of this PayoutDetails. # noqa: E501 + + + :return: The transaction_fee of this PayoutDetails. # noqa: E501 + :rtype: object + """ + return self._transaction_fee + + @transaction_fee.setter + def transaction_fee(self, transaction_fee): + """Sets the transaction_fee of this PayoutDetails. + + + :param transaction_fee: The transaction_fee of this PayoutDetails. # noqa: E501 + :type: object + """ + + self._transaction_fee = transaction_fee + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(PayoutDetails, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, PayoutDetails): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/upstox_client/models/payout_details_response.py b/upstox_client/models/payout_details_response.py new file mode 100644 index 0000000..a772788 --- /dev/null +++ b/upstox_client/models/payout_details_response.py @@ -0,0 +1,138 @@ +# coding: utf-8 + +""" + OpenAPI definition + + No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 + + OpenAPI spec version: v0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class PayoutDetailsResponse(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'status': 'object', + 'data': 'PayoutDetails' + } + + attribute_map = { + 'status': 'status', + 'data': 'data' + } + + def __init__(self, status=None, data=None): # noqa: E501 + """PayoutDetailsResponse - a model defined in Swagger""" # noqa: E501 + self._status = None + self._data = None + self.discriminator = None + if status is not None: + self.status = status + if data is not None: + self.data = data + + @property + def status(self): + """Gets the status of this PayoutDetailsResponse. # noqa: E501 + + + :return: The status of this PayoutDetailsResponse. # noqa: E501 + :rtype: object + """ + return self._status + + @status.setter + def status(self, status): + """Sets the status of this PayoutDetailsResponse. + + + :param status: The status of this PayoutDetailsResponse. # noqa: E501 + :type: object + """ + + self._status = status + + @property + def data(self): + """Gets the data of this PayoutDetailsResponse. # noqa: E501 + + Response data for initiate payout request # noqa: E501 + + :return: The data of this PayoutDetailsResponse. # noqa: E501 + :rtype: PayoutDetails + """ + return self._data + + @data.setter + def data(self, data): + """Sets the data of this PayoutDetailsResponse. + + Response data for initiate payout request # noqa: E501 + + :param data: The data of this PayoutDetailsResponse. # noqa: E501 + :type: PayoutDetails + """ + + self._data = data + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(PayoutDetailsResponse, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, PayoutDetailsResponse): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/upstox_client/models/payout_modes_data.py b/upstox_client/models/payout_modes_data.py new file mode 100644 index 0000000..cc24b2b --- /dev/null +++ b/upstox_client/models/payout_modes_data.py @@ -0,0 +1,84 @@ +# coding: utf-8 + +""" + OpenAPI definition + + No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 + + OpenAPI spec version: v0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class PayoutModesData(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + } + + attribute_map = { + } + + def __init__(self): # noqa: E501 + """PayoutModesData - a model defined in Swagger""" # noqa: E501 + self.discriminator = None + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(PayoutModesData, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, PayoutModesData): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/upstox_client/models/payout_modes_response.py b/upstox_client/models/payout_modes_response.py new file mode 100644 index 0000000..02efecb --- /dev/null +++ b/upstox_client/models/payout_modes_response.py @@ -0,0 +1,138 @@ +# coding: utf-8 + +""" + OpenAPI definition + + No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 + + OpenAPI spec version: v0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class PayoutModesResponse(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'status': 'object', + 'data': 'PayoutModesData' + } + + attribute_map = { + 'status': 'status', + 'data': 'data' + } + + def __init__(self, status=None, data=None): # noqa: E501 + """PayoutModesResponse - a model defined in Swagger""" # noqa: E501 + self._status = None + self._data = None + self.discriminator = None + if status is not None: + self.status = status + if data is not None: + self.data = data + + @property + def status(self): + """Gets the status of this PayoutModesResponse. # noqa: E501 + + + :return: The status of this PayoutModesResponse. # noqa: E501 + :rtype: object + """ + return self._status + + @status.setter + def status(self, status): + """Sets the status of this PayoutModesResponse. + + + :param status: The status of this PayoutModesResponse. # noqa: E501 + :type: object + """ + + self._status = status + + @property + def data(self): + """Gets the data of this PayoutModesResponse. # noqa: E501 + + Available payout modes with eligibility details # noqa: E501 + + :return: The data of this PayoutModesResponse. # noqa: E501 + :rtype: PayoutModesData + """ + return self._data + + @data.setter + def data(self, data): + """Sets the data of this PayoutModesResponse. + + Available payout modes with eligibility details # noqa: E501 + + :param data: The data of this PayoutModesResponse. # noqa: E501 + :type: PayoutModesData + """ + + self._data = data + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(PayoutModesResponse, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, PayoutModesResponse): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other From e422c5e65eee52f18b56a169d484a0686ab28462 Mon Sep 17 00:00:00 2001 From: KETAN GUPTA Date: Thu, 25 Jun 2026 18:13:31 +0530 Subject: [PATCH 02/10] feat(api): add IpoApi for IPO endpoints Co-Authored-By: Claude Opus 4.8 (1M context) --- upstox_client/api/ipo_api.py | 231 +++++++++++++++++++++++++++++++++++ 1 file changed, 231 insertions(+) create mode 100644 upstox_client/api/ipo_api.py diff --git a/upstox_client/api/ipo_api.py b/upstox_client/api/ipo_api.py new file mode 100644 index 0000000..2316c54 --- /dev/null +++ b/upstox_client/api/ipo_api.py @@ -0,0 +1,231 @@ +# coding: utf-8 + +""" + OpenAPI definition + + No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 + + OpenAPI spec version: v0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from upstox_client.api_client import ApiClient + + +class IpoApi(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + Ref: https://github.com/swagger-api/swagger-codegen + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def get_ipo_details(self, id, **kwargs): # noqa: E501 + """Get IPO Details # noqa: E501 + + Fetches detailed information for an IPO by its slug ID. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_ipo_details(id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param object id: IPO slug ID (required) + :return: IpoDetailsResponse + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.get_ipo_details_with_http_info(id, **kwargs) # noqa: E501 + else: + (data) = self.get_ipo_details_with_http_info(id, **kwargs) # noqa: E501 + return data + + def get_ipo_details_with_http_info(self, id, **kwargs): # noqa: E501 + """Get IPO Details # noqa: E501 + + Fetches detailed information for an IPO by its slug ID. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_ipo_details_with_http_info(id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param object id: IPO slug ID (required) + :return: IpoDetailsResponse + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_ipo_details" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'id' is set + if ('id' not in params or + params['id'] is None): + raise ValueError("Missing the required parameter `id` when calling `get_ipo_details`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'id' in params: + path_params['id'] = params['id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['*/*', 'application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['OAUTH2'] # noqa: E501 + + return self.api_client.call_api( + '/v2/ipos/{id}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='IpoDetailsResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def get_ipo_listing(self, **kwargs): # noqa: E501 + """Get IPO Listing # noqa: E501 + + Fetches list of IPOs filtered by status. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_ipo_listing(async_req=True) + >>> result = thread.get() + + :param async_req bool + :param object status: IPO status. Allowed values: open, closed, listed, upcoming + :param object issue_type: Issue type filter. Allowed values: regular, sme + :param object page_number: Page number (default: 1) + :param object records: Number of records per page (default: 20, max: 30) + :return: IpoListingResponse + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.get_ipo_listing_with_http_info(**kwargs) # noqa: E501 + else: + (data) = self.get_ipo_listing_with_http_info(**kwargs) # noqa: E501 + return data + + def get_ipo_listing_with_http_info(self, **kwargs): # noqa: E501 + """Get IPO Listing # noqa: E501 + + Fetches list of IPOs filtered by status. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_ipo_listing_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req bool + :param object status: IPO status. Allowed values: open, closed, listed, upcoming + :param object issue_type: Issue type filter. Allowed values: regular, sme + :param object page_number: Page number (default: 1) + :param object records: Number of records per page (default: 20, max: 30) + :return: IpoListingResponse + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['status', 'issue_type', 'page_number', 'records'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_ipo_listing" % key + ) + params[key] = val + del params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if 'status' in params: + query_params.append(('status', params['status'])) # noqa: E501 + if 'issue_type' in params: + query_params.append(('issue_type', params['issue_type'])) # noqa: E501 + if 'page_number' in params: + query_params.append(('page_number', params['page_number'])) # noqa: E501 + if 'records' in params: + query_params.append(('records', params['records'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['*/*', 'application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['OAUTH2'] # noqa: E501 + + return self.api_client.call_api( + '/v2/ipos', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='IpoListingResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) From 850af84172334cd9278e7c45c18916ee60f7190d Mon Sep 17 00:00:00 2001 From: KETAN GUPTA Date: Thu, 25 Jun 2026 18:13:32 +0530 Subject: [PATCH 03/10] feat(api): add smartlist endpoints to MarketApi Co-Authored-By: Claude Opus 4.8 (1M context) --- upstox_client/api/market_api.py | 301 ++++++++++++++++++++++++++++++++ 1 file changed, 301 insertions(+) diff --git a/upstox_client/api/market_api.py b/upstox_client/api/market_api.py index e6c925e..2cf8bd7 100644 --- a/upstox_client/api/market_api.py +++ b/upstox_client/api/market_api.py @@ -713,3 +713,304 @@ def get_pcr_data_with_http_info(self, instrument_key, expiry, _date, bucket_inte _preload_content=params.get('_preload_content', True), _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) + + def get_smartlist_futures(self, **kwargs): # noqa: E501 + """Get Smartlist Futures # noqa: E501 + + Fetches the smartlist of futures for the given asset type and category. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_smartlist_futures(async_req=True) + >>> result = thread.get() + + :param async_req bool + :param object asset_type: Asset type. Allowed values: INDEX, STOCK, COMMODITY + :param object category: Category. Allowed values: TOP_TRADED, MOST_ACTIVE, OI_GAINERS, OI_LOSERS, PRICE_GAINERS, PRICE_LOSERS, PREMIUM, DISCOUNT (COMMODITY supports only: TOP_TRADED, MOST_ACTIVE, OI_GAINERS, OI_LOSERS) + :param object page_number: Page number (optional, 1-indexed) + :param object page_size: Page size (optional, max 50) + :return: AnalyticsResponse + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.get_smartlist_futures_with_http_info(**kwargs) # noqa: E501 + else: + (data) = self.get_smartlist_futures_with_http_info(**kwargs) # noqa: E501 + return data + + def get_smartlist_futures_with_http_info(self, **kwargs): # noqa: E501 + """Get Smartlist Futures # noqa: E501 + + Fetches the smartlist of futures for the given asset type and category. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_smartlist_futures_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req bool + :param object asset_type: Asset type. Allowed values: INDEX, STOCK, COMMODITY + :param object category: Category. Allowed values: TOP_TRADED, MOST_ACTIVE, OI_GAINERS, OI_LOSERS, PRICE_GAINERS, PRICE_LOSERS, PREMIUM, DISCOUNT (COMMODITY supports only: TOP_TRADED, MOST_ACTIVE, OI_GAINERS, OI_LOSERS) + :param object page_number: Page number (optional, 1-indexed) + :param object page_size: Page size (optional, max 50) + :return: AnalyticsResponse + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['asset_type', 'category', 'page_number', 'page_size'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_smartlist_futures" % key + ) + params[key] = val + del params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if 'asset_type' in params: + query_params.append(('asset_type', params['asset_type'])) # noqa: E501 + if 'category' in params: + query_params.append(('category', params['category'])) # noqa: E501 + if 'page_number' in params: + query_params.append(('page_number', params['page_number'])) # noqa: E501 + if 'page_size' in params: + query_params.append(('page_size', params['page_size'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['*/*', 'application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['OAUTH2'] # noqa: E501 + + return self.api_client.call_api( + '/v2/market/smartlist/futures', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='AnalyticsResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def get_smartlist_mtf(self, **kwargs): # noqa: E501 + """Get Smartlist MTF # noqa: E501 + + Fetches the smartlist of MTF (Margin Trade Funding) stocks. Prices are enriched with live LTP data. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_smartlist_mtf(async_req=True) + >>> result = thread.get() + + :param async_req bool + :param object page_number: Page number (optional, 1-indexed) + :param object page_size: Page size (optional, max 50) + :return: AnalyticsResponse + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.get_smartlist_mtf_with_http_info(**kwargs) # noqa: E501 + else: + (data) = self.get_smartlist_mtf_with_http_info(**kwargs) # noqa: E501 + return data + + def get_smartlist_mtf_with_http_info(self, **kwargs): # noqa: E501 + """Get Smartlist MTF # noqa: E501 + + Fetches the smartlist of MTF (Margin Trade Funding) stocks. Prices are enriched with live LTP data. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_smartlist_mtf_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req bool + :param object page_number: Page number (optional, 1-indexed) + :param object page_size: Page size (optional, max 50) + :return: AnalyticsResponse + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['page_number', 'page_size'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_smartlist_mtf" % key + ) + params[key] = val + del params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if 'page_number' in params: + query_params.append(('page_number', params['page_number'])) # noqa: E501 + if 'page_size' in params: + query_params.append(('page_size', params['page_size'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['*/*', 'application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['OAUTH2'] # noqa: E501 + + return self.api_client.call_api( + '/v2/market/smartlist/mtf', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='AnalyticsResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def get_smartlist_options(self, **kwargs): # noqa: E501 + """Get Smartlist Options # noqa: E501 + + Fetches the smartlist of options for the given asset type and category. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_smartlist_options(async_req=True) + >>> result = thread.get() + + :param async_req bool + :param object asset_type: Asset type. Allowed values: INDEX, STOCK, COMMODITY + :param object category: Category. Allowed values: TOP_TRADED, MOST_ACTIVE, OI_GAINERS, OI_LOSERS, PRICE_GAINERS, PRICE_LOSERS, IV_GAINERS, IV_LOSERS, UNDER_5000, UNDER_10000 (COMMODITY supports only: TOP_TRADED, MOST_ACTIVE, OI_GAINERS, OI_LOSERS) + :param object page_number: Page number (optional, 1-indexed) + :param object page_size: Page size (optional, max 50) + :return: AnalyticsResponse + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.get_smartlist_options_with_http_info(**kwargs) # noqa: E501 + else: + (data) = self.get_smartlist_options_with_http_info(**kwargs) # noqa: E501 + return data + + def get_smartlist_options_with_http_info(self, **kwargs): # noqa: E501 + """Get Smartlist Options # noqa: E501 + + Fetches the smartlist of options for the given asset type and category. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_smartlist_options_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req bool + :param object asset_type: Asset type. Allowed values: INDEX, STOCK, COMMODITY + :param object category: Category. Allowed values: TOP_TRADED, MOST_ACTIVE, OI_GAINERS, OI_LOSERS, PRICE_GAINERS, PRICE_LOSERS, IV_GAINERS, IV_LOSERS, UNDER_5000, UNDER_10000 (COMMODITY supports only: TOP_TRADED, MOST_ACTIVE, OI_GAINERS, OI_LOSERS) + :param object page_number: Page number (optional, 1-indexed) + :param object page_size: Page size (optional, max 50) + :return: AnalyticsResponse + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['asset_type', 'category', 'page_number', 'page_size'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_smartlist_options" % key + ) + params[key] = val + del params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if 'asset_type' in params: + query_params.append(('asset_type', params['asset_type'])) # noqa: E501 + if 'category' in params: + query_params.append(('category', params['category'])) # noqa: E501 + if 'page_number' in params: + query_params.append(('page_number', params['page_number'])) # noqa: E501 + if 'page_size' in params: + query_params.append(('page_size', params['page_size'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['*/*', 'application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['OAUTH2'] # noqa: E501 + + return self.api_client.call_api( + '/v2/market/smartlist/options', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='AnalyticsResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) From 63633e29e3412511e734c7a3f052f7d884e9e4cb Mon Sep 17 00:00:00 2001 From: KETAN GUPTA Date: Thu, 25 Jun 2026 18:13:33 +0530 Subject: [PATCH 04/10] feat(api): add payout endpoints to UserApi Co-Authored-By: Claude Opus 4.8 (1M context) --- upstox_client/api/user_api.py | 380 ++++++++++++++++++++++++++++++++++ 1 file changed, 380 insertions(+) diff --git a/upstox_client/api/user_api.py b/upstox_client/api/user_api.py index 2626d6f..8ba8288 100644 --- a/upstox_client/api/user_api.py +++ b/upstox_client/api/user_api.py @@ -850,3 +850,383 @@ def update_user_ip_with_http_info(self, body, **kwargs): # noqa: E501 _preload_content=params.get('_preload_content', True), _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) + + def cancel_payout(self, transaction_id, **kwargs): # noqa: E501 + """cancel_payout # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.cancel_payout(transaction_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param object transaction_id: Payout transaction id (required) + :return: PayoutDetailsResponse + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.cancel_payout_with_http_info(transaction_id, **kwargs) # noqa: E501 + else: + (data) = self.cancel_payout_with_http_info(transaction_id, **kwargs) # noqa: E501 + return data + + def cancel_payout_with_http_info(self, transaction_id, **kwargs): # noqa: E501 + """cancel_payout # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.cancel_payout_with_http_info(transaction_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param object transaction_id: Payout transaction id (required) + :return: PayoutDetailsResponse + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['transaction_id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method cancel_payout" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'transaction_id' is set + if ('transaction_id' not in params or + params['transaction_id'] is None): + raise ValueError("Missing the required parameter `transaction_id` when calling `cancel_payout`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'transaction_id' in params: + path_params['transaction_id'] = params['transaction_id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['*/*']) # noqa: E501 + + # Authentication setting + auth_settings = ['OAUTH2'] # noqa: E501 + + return self.api_client.call_api( + '/v2/user/payments/payout/{transaction_id}', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='PayoutDetailsResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def get_payout_modes(self, **kwargs): # noqa: E501 + """get_payout_modes # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_payout_modes(async_req=True) + >>> result = thread.get() + + :param async_req bool + :return: PayoutModesResponse + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.get_payout_modes_with_http_info(**kwargs) # noqa: E501 + else: + (data) = self.get_payout_modes_with_http_info(**kwargs) # noqa: E501 + return data + + def get_payout_modes_with_http_info(self, **kwargs): # noqa: E501 + """get_payout_modes # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_payout_modes_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req bool + :return: PayoutModesResponse + If the method is called asynchronously, + returns the request thread. + """ + + all_params = [] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_payout_modes" % key + ) + params[key] = val + del params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['*/*']) # noqa: E501 + + # Authentication setting + auth_settings = ['OAUTH2'] # noqa: E501 + + return self.api_client.call_api( + '/v2/user/payments/payout/modes', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='PayoutModesResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def initiate_payout(self, body, **kwargs): # noqa: E501 + """initiate_payout # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.initiate_payout(body, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param InitiatePayoutRequest body: (required) + :return: PayoutDetailsResponse + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.initiate_payout_with_http_info(body, **kwargs) # noqa: E501 + else: + (data) = self.initiate_payout_with_http_info(body, **kwargs) # noqa: E501 + return data + + def initiate_payout_with_http_info(self, body, **kwargs): # noqa: E501 + """initiate_payout # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.initiate_payout_with_http_info(body, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param InitiatePayoutRequest body: (required) + :return: PayoutDetailsResponse + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method initiate_payout" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `initiate_payout`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['*/*']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['OAUTH2'] # noqa: E501 + + return self.api_client.call_api( + '/v2/user/payments/payout', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='PayoutDetailsResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def modify_payout(self, body, transaction_id, **kwargs): # noqa: E501 + """modify_payout # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.modify_payout(body, transaction_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param ModifyPayoutRequest body: (required) + :param object transaction_id: Payout transaction id (required) + :return: PayoutDetailsResponse + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.modify_payout_with_http_info(body, transaction_id, **kwargs) # noqa: E501 + else: + (data) = self.modify_payout_with_http_info(body, transaction_id, **kwargs) # noqa: E501 + return data + + def modify_payout_with_http_info(self, body, transaction_id, **kwargs): # noqa: E501 + """modify_payout # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.modify_payout_with_http_info(body, transaction_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param ModifyPayoutRequest body: (required) + :param object transaction_id: Payout transaction id (required) + :return: PayoutDetailsResponse + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body', 'transaction_id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method modify_payout" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `modify_payout`") # noqa: E501 + # verify the required parameter 'transaction_id' is set + if ('transaction_id' not in params or + params['transaction_id'] is None): + raise ValueError("Missing the required parameter `transaction_id` when calling `modify_payout`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'transaction_id' in params: + path_params['transaction_id'] = params['transaction_id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['*/*']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['OAUTH2'] # noqa: E501 + + return self.api_client.call_api( + '/v2/user/payments/payout/{transaction_id}', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='PayoutDetailsResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) From 3fca92f3c12dcdc652bef027d09352cd9acc9883 Mon Sep 17 00:00:00 2001 From: KETAN GUPTA Date: Thu, 25 Jun 2026 18:13:33 +0530 Subject: [PATCH 05/10] chore(exports): update __init__ for ipos-smartlist-payout Co-Authored-By: Claude Opus 4.8 (1M context) --- upstox_client/__init__.py | 14 ++++++++++++++ upstox_client/api/__init__.py | 1 + upstox_client/models/__init__.py | 13 +++++++++++++ 3 files changed, 28 insertions(+) diff --git a/upstox_client/__init__.py b/upstox_client/__init__.py index 5bcfe5c..3cb26ba 100644 --- a/upstox_client/__init__.py +++ b/upstox_client/__init__.py @@ -21,6 +21,7 @@ from upstox_client.api.history_api import HistoryApi from upstox_client.api.history_v3_api import HistoryV3Api from upstox_client.api.instruments_api import InstrumentsApi +from upstox_client.api.ipo_api import IpoApi from upstox_client.api.login_api import LoginApi from upstox_client.api.market_api import MarketApi from upstox_client.api.market_holidays_and_timings_api import MarketHolidaysAndTimingsApi @@ -136,12 +137,20 @@ from upstox_client.models.indie_user_init_token_data import IndieUserInitTokenData from upstox_client.models.indie_user_init_token_response import IndieUserInitTokenResponse from upstox_client.models.indie_user_token_request import IndieUserTokenRequest +from upstox_client.models.initiate_payout_request import InitiatePayoutRequest from upstox_client.models.instrument import Instrument from upstox_client.models.instrument_data import InstrumentData from upstox_client.models.search_instrument_response import SearchInstrumentResponse from upstox_client.models.search_meta_data import SearchMetaData from upstox_client.models.search_page import SearchPage from upstox_client.models.intra_day_candle_data import IntraDayCandleData +from upstox_client.models.ipo_details_data import IpoDetailsData +from upstox_client.models.ipo_details_response import IpoDetailsResponse +from upstox_client.models.ipo_listing_data import IpoListingData +from upstox_client.models.ipo_listing_response import IpoListingResponse +from upstox_client.models.ipo_meta_data import IpoMetaData +from upstox_client.models.ipo_registrar_info import IpoRegistrarInfo +from upstox_client.models.ipo_timeline import IpoTimeline from upstox_client.models.key_ratio_data import KeyRatioData from upstox_client.models.key_ratios_response import KeyRatiosResponse from upstox_client.models.kill_switch_response import KillSwitchResponse @@ -165,6 +174,7 @@ from upstox_client.models.modify_order_request import ModifyOrderRequest from upstox_client.models.modify_order_response import ModifyOrderResponse from upstox_client.models.modify_order_v3_response import ModifyOrderV3Response +from upstox_client.models.modify_payout_request import ModifyPayoutRequest from upstox_client.models.multi_order_data import MultiOrderData from upstox_client.models.multi_order_error import MultiOrderError from upstox_client.models.multi_order_request import MultiOrderRequest @@ -192,6 +202,10 @@ from upstox_client.models.pagination import Pagination from upstox_client.models.payment_history_data import PaymentHistoryData from upstox_client.models.payment_history_response import PaymentHistoryResponse +from upstox_client.models.payout_details import PayoutDetails +from upstox_client.models.payout_details_response import PayoutDetailsResponse +from upstox_client.models.payout_modes_data import PayoutModesData +from upstox_client.models.payout_modes_response import PayoutModesResponse from upstox_client.models.place_order_data import PlaceOrderData from upstox_client.models.place_order_request import PlaceOrderRequest from upstox_client.models.place_order_response import PlaceOrderResponse diff --git a/upstox_client/api/__init__.py b/upstox_client/api/__init__.py index c68b37a..2fb24a2 100644 --- a/upstox_client/api/__init__.py +++ b/upstox_client/api/__init__.py @@ -9,6 +9,7 @@ from upstox_client.api.history_api import HistoryApi from upstox_client.api.history_v3_api import HistoryV3Api from upstox_client.api.instruments_api import InstrumentsApi +from upstox_client.api.ipo_api import IpoApi from upstox_client.api.login_api import LoginApi from upstox_client.api.market_api import MarketApi from upstox_client.api.market_holidays_and_timings_api import MarketHolidaysAndTimingsApi diff --git a/upstox_client/models/__init__.py b/upstox_client/models/__init__.py index 8db4d3c..01612d7 100644 --- a/upstox_client/models/__init__.py +++ b/upstox_client/models/__init__.py @@ -107,9 +107,17 @@ from upstox_client.models.indie_user_init_token_data import IndieUserInitTokenData from upstox_client.models.indie_user_init_token_response import IndieUserInitTokenResponse from upstox_client.models.indie_user_token_request import IndieUserTokenRequest +from upstox_client.models.initiate_payout_request import InitiatePayoutRequest from upstox_client.models.instrument import Instrument from upstox_client.models.instrument_data import InstrumentData from upstox_client.models.intra_day_candle_data import IntraDayCandleData +from upstox_client.models.ipo_details_data import IpoDetailsData +from upstox_client.models.ipo_details_response import IpoDetailsResponse +from upstox_client.models.ipo_listing_data import IpoListingData +from upstox_client.models.ipo_listing_response import IpoListingResponse +from upstox_client.models.ipo_meta_data import IpoMetaData +from upstox_client.models.ipo_registrar_info import IpoRegistrarInfo +from upstox_client.models.ipo_timeline import IpoTimeline from upstox_client.models.key_ratio_data import KeyRatioData from upstox_client.models.key_ratios_response import KeyRatiosResponse from upstox_client.models.kill_switch_response import KillSwitchResponse @@ -133,6 +141,7 @@ from upstox_client.models.modify_order_request import ModifyOrderRequest from upstox_client.models.modify_order_response import ModifyOrderResponse from upstox_client.models.modify_order_v3_response import ModifyOrderV3Response +from upstox_client.models.modify_payout_request import ModifyPayoutRequest from upstox_client.models.multi_order_data import MultiOrderData from upstox_client.models.multi_order_error import MultiOrderError from upstox_client.models.multi_order_request import MultiOrderRequest @@ -160,6 +169,10 @@ from upstox_client.models.pagination import Pagination from upstox_client.models.payment_history_data import PaymentHistoryData from upstox_client.models.payment_history_response import PaymentHistoryResponse +from upstox_client.models.payout_details import PayoutDetails +from upstox_client.models.payout_details_response import PayoutDetailsResponse +from upstox_client.models.payout_modes_data import PayoutModesData +from upstox_client.models.payout_modes_response import PayoutModesResponse from upstox_client.models.place_order_data import PlaceOrderData from upstox_client.models.place_order_request import PlaceOrderRequest from upstox_client.models.place_order_response import PlaceOrderResponse From 571dc0893ed1968eff1dcb3b759d20869de23e6c Mon Sep 17 00:00:00 2001 From: KETAN GUPTA Date: Thu, 25 Jun 2026 18:13:33 +0530 Subject: [PATCH 06/10] test(ipos-smartlist-payout): add SDK tests for new features Co-Authored-By: Claude Opus 4.8 (1M context) --- test/sdk_tests/sanity.py | 146 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 146 insertions(+) diff --git a/test/sdk_tests/sanity.py b/test/sdk_tests/sanity.py index 30d52cb..435c69a 100644 --- a/test/sdk_tests/sanity.py +++ b/test/sdk_tests/sanity.py @@ -1301,6 +1301,152 @@ def is_within_market_hours(): if share_holdings_response.status != "success": print("error: ShareHoldingsResponse status field not set correctly") +# ---------------------------------------------------------------------------- +# IPO APIs (IpoApi) +# ---------------------------------------------------------------------------- +ipo_api_instance = upstox_client.IpoApi(upstox_client.ApiClient(configuration)) + +try: + # Get IPO Listing + api_response = ipo_api_instance.get_ipo_listing(status="open", issue_type="regular", page_number=1, records=20) + if api_response.status != "success": + print("error in get_ipo_listing API") +except ApiException as e: + print("Exception when calling IpoApi->get_ipo_listing: %s\n" % e) + +try: + # Get IPO Details (in real usage, pass a slug id returned by get_ipo_listing) + api_response = ipo_api_instance.get_ipo_details("sample-ipo-slug") + if api_response.status != "success": + print("error in get_ipo_details API") +except ApiException as e: + print("Exception when calling IpoApi->get_ipo_details: %s\n" % e) + +# ---------------------------------------------------------------------------- +# Smartlist APIs (MarketApi) +# ---------------------------------------------------------------------------- +market_api_instance = upstox_client.MarketApi(upstox_client.ApiClient(configuration)) + +try: + # Get Smartlist Options + api_response = market_api_instance.get_smartlist_options(asset_type="INDEX", category="TOP_TRADED", page_number=1, page_size=50) + if api_response.status != "success": + print("error in get_smartlist_options API") +except ApiException as e: + print("Exception when calling MarketApi->get_smartlist_options: %s\n" % e) + +try: + # Get Smartlist Futures + api_response = market_api_instance.get_smartlist_futures(asset_type="STOCK", category="MOST_ACTIVE", page_number=1, page_size=50) + if api_response.status != "success": + print("error in get_smartlist_futures API") +except ApiException as e: + print("Exception when calling MarketApi->get_smartlist_futures: %s\n" % e) + +try: + # Get Smartlist MTF + api_response = market_api_instance.get_smartlist_mtf(page_number=1, page_size=50) + if api_response.status != "success": + print("error in get_smartlist_mtf API") +except ApiException as e: + print("Exception when calling MarketApi->get_smartlist_mtf: %s\n" % e) + +# ---------------------------------------------------------------------------- +# Payout APIs (UserApi) +# ---------------------------------------------------------------------------- +payout_api_instance = upstox_client.UserApi(upstox_client.ApiClient(configuration)) + +try: + # Get Payout History (read-only) + api_response = payout_api_instance.get_payout_history() + if api_response.status != "success": + print("error in get_payout_history API") +except ApiException as e: + print("Exception when calling UserApi->get_payout_history: %s\n" % e) + +try: + # Get Payout Modes (read-only) + api_response = payout_api_instance.get_payout_modes() + if api_response.status != "success": + print("error in get_payout_modes API") +except ApiException as e: + print("Exception when calling UserApi->get_payout_modes: %s\n" % e) + +# Initiate/Modify/Cancel payout move real funds. Disabled by default; set +# RUN_DESTRUCTIVE_PAYOUT_TESTS = True to exercise them against a real account. +RUN_DESTRUCTIVE_PAYOUT_TESTS = False +if RUN_DESTRUCTIVE_PAYOUT_TESTS: + try: + # Initiate Payout + body = upstox_client.InitiatePayoutRequest(mode="IMPS", amount=1.0) + api_response = payout_api_instance.initiate_payout(body) + transaction_id = api_response.data.transaction_id + + # Modify Payout + modify_body = upstox_client.ModifyPayoutRequest(amount=2.0) + api_response = payout_api_instance.modify_payout(modify_body, transaction_id) + + # Cancel Payout + api_response = payout_api_instance.cancel_payout(transaction_id) + print("payout initiate/modify/cancel cycle:", api_response.status) + except ApiException as e: + print("Exception when calling UserApi payout write ops: %s\n" % e) + +# ---------------------------------------------------------------------------- +# Model instantiation smoke tests (new models) +# ---------------------------------------------------------------------------- +ipo_listing_data = upstox_client.IpoListingData(symbol="XYZ", status="open") +if ipo_listing_data.symbol != "XYZ": + print("error: IpoListingData fields not set correctly") + +ipo_meta_data = upstox_client.IpoMetaData(page=upstox_client.Pagination(page_number=1)) +if ipo_meta_data.page.page_number != 1: + print("error: IpoMetaData fields not set correctly") + +ipo_listing_response = upstox_client.IpoListingResponse(status="success", data=[ipo_listing_data], meta_data=ipo_meta_data) +if ipo_listing_response.status != "success": + print("error: IpoListingResponse status field not set correctly") + +ipo_timeline = upstox_client.IpoTimeline(listing_date="2026-07-01") +if ipo_timeline.listing_date != "2026-07-01": + print("error: IpoTimeline fields not set correctly") + +ipo_registrar_info = upstox_client.IpoRegistrarInfo(name="Registrar Co") +if ipo_registrar_info.name != "Registrar Co": + print("error: IpoRegistrarInfo fields not set correctly") + +ipo_details_data = upstox_client.IpoDetailsData(id="abc", symbol="XYZ", lot_size=10, timeline=ipo_timeline, registrar_info=ipo_registrar_info) +if ipo_details_data.lot_size != 10: + print("error: IpoDetailsData fields not set correctly") + +ipo_details_response = upstox_client.IpoDetailsResponse(status="success", data=ipo_details_data) +if ipo_details_response.status != "success": + print("error: IpoDetailsResponse status field not set correctly") + +initiate_payout_request = upstox_client.InitiatePayoutRequest(mode="IMPS", amount=500.0) +if initiate_payout_request.amount != 500.0: + print("error: InitiatePayoutRequest fields not set correctly") + +modify_payout_request = upstox_client.ModifyPayoutRequest(amount=750.0) +if modify_payout_request.amount != 750.0: + print("error: ModifyPayoutRequest fields not set correctly") + +payout_details = upstox_client.PayoutDetails(status="SUCCESS", transaction_id="T1", amount=500.0) +if payout_details.transaction_id != "T1": + print("error: PayoutDetails fields not set correctly") + +payout_details_response = upstox_client.PayoutDetailsResponse(status="success", data=payout_details) +if payout_details_response.status != "success": + print("error: PayoutDetailsResponse status field not set correctly") + +payout_modes_data = upstox_client.PayoutModesData() +if payout_modes_data is None: + print("error: PayoutModesData instantiation failed") + +payout_modes_response = upstox_client.PayoutModesResponse(status="success", data=payout_modes_data) +if payout_modes_response.status != "success": + print("error: PayoutModesResponse status field not set correctly") + login_api_instance = upstox_client.LoginApi(upstox_client.ApiClient(configuration)) try: # Logout From 13f5a24a225f2327a4dab3269f5964615832c0e1 Mon Sep 17 00:00:00 2001 From: KETAN GUPTA Date: Thu, 25 Jun 2026 18:13:33 +0530 Subject: [PATCH 07/10] docs(ipos-smartlist-payout): add usage examples for new features Co-Authored-By: Claude Opus 4.8 (1M context) --- examples/README.md | 3 + examples/ipo/README.md | 12 +++ examples/ipo/code/get-ipo.md | 63 +++++++++++++++ examples/payout/README.md | 18 +++++ examples/payout/code/payout.md | 97 ++++++++++++++++++++++++ examples/smartlist/README.md | 16 ++++ examples/smartlist/code/get-smartlist.md | 70 +++++++++++++++++ 7 files changed, 279 insertions(+) create mode 100644 examples/ipo/README.md create mode 100644 examples/ipo/code/get-ipo.md create mode 100644 examples/payout/README.md create mode 100644 examples/payout/code/payout.md create mode 100644 examples/smartlist/README.md create mode 100644 examples/smartlist/code/get-smartlist.md diff --git a/examples/README.md b/examples/README.md index acdd4a6..7f3477a 100644 --- a/examples/README.md +++ b/examples/README.md @@ -34,11 +34,14 @@ Samples are grouped by API area. Each `.md` file contains one or more Python sni | [**option-chain/**](option-chain/) | Option contracts, put-call option chain. | | [**expired-instruments/**](expired-instruments/) | Expiries, expired future/option contracts, expired historical candle data. | | [**market-information/**](market-information/) | Exchange status, market timings, market holidays, OI, change in OI, PCR, max pain, FII, and DII. | +| [**smartlist/**](smartlist/) | Analytics-enriched smartlists for options, futures, and MTF stocks. | +| [**ipo/**](ipo/) | IPO listing (by status/issue type) and IPO details by id. | | [**gtt-orders/**](gtt-orders/) | Place, modify, cancel, and get details for GTT (Good Till Triggered) orders. | | [**margins/**](margins/) | Margin details. | | [**charges/**](charges/) | Brokerage details. | | [**mutual-funds-api/**](mutual-funds-api/) | Mutual fund holdings, orders, order details, and SIPs. | | [**payments-api/**](payments-api/) | Payin and payout history. | +| [**payout/**](payout/) | Payout history, payout modes, and initiate/modify/cancel payout. | | [**news/**](news/) | News articles by instrument keys, positions, or holdings. | | [**fundamentals/**](fundamentals/) | Company profile, balance sheet, cash flow, income statement, key ratios, share holdings, corporate actions, and competitors. | | [**trade-profit-and-loss/**](trade-profit-and-loss/) | P&L report, report metadata, trade charges. | diff --git a/examples/ipo/README.md b/examples/ipo/README.md new file mode 100644 index 0000000..af3de16 --- /dev/null +++ b/examples/ipo/README.md @@ -0,0 +1,12 @@ +# IPO – Example code + +Links to all IPO-related examples in the `code/` folder. + +## 1. Get IPO Listing + +- 1.1 [Get IPO listing](code/get-ipo.md#get-ipo-listing) +- 1.2 [Get IPO listing with filters and pagination](code/get-ipo.md#get-ipo-listing-with-filters-and-pagination) + +## 2. Get IPO Details + +- 2.1 [Get IPO details by id](code/get-ipo.md#get-ipo-details-by-id) diff --git a/examples/ipo/code/get-ipo.md b/examples/ipo/code/get-ipo.md new file mode 100644 index 0000000..9811b72 --- /dev/null +++ b/examples/ipo/code/get-ipo.md @@ -0,0 +1,63 @@ +## Get IPO listing + +```python +import upstox_client +from upstox_client.rest import ApiException + +configuration = upstox_client.Configuration() +configuration.access_token = '{your_access_token}' + +api_instance = upstox_client.IpoApi(upstox_client.ApiClient(configuration)) + +try: + api_response = api_instance.get_ipo_listing() + print(api_response) +except ApiException as e: + print("Exception when calling IpoApi->get_ipo_listing: %s\n" % e) +``` + +## Get IPO listing with filters and pagination + +```python +import upstox_client +from upstox_client.rest import ApiException + +configuration = upstox_client.Configuration() +configuration.access_token = '{your_access_token}' + +api_instance = upstox_client.IpoApi(upstox_client.ApiClient(configuration)) + +try: + # status: open | closed | listed | upcoming + # issue_type: regular | sme + api_response = api_instance.get_ipo_listing( + status='open', + issue_type='regular', + page_number=1, + records=20 + ) + print(api_response) +except ApiException as e: + print("Exception when calling IpoApi->get_ipo_listing: %s\n" % e) +``` + +## Get IPO details by id + +```python +import upstox_client +from upstox_client.rest import ApiException + +configuration = upstox_client.Configuration() +configuration.access_token = '{your_access_token}' + +api_instance = upstox_client.IpoApi(upstox_client.ApiClient(configuration)) + +# `id` is the IPO slug id returned by get_ipo_listing +ipo_id = '{ipo_slug_id}' + +try: + api_response = api_instance.get_ipo_details(ipo_id) + print(api_response) +except ApiException as e: + print("Exception when calling IpoApi->get_ipo_details: %s\n" % e) +``` diff --git a/examples/payout/README.md b/examples/payout/README.md new file mode 100644 index 0000000..9e707f9 --- /dev/null +++ b/examples/payout/README.md @@ -0,0 +1,18 @@ +# Payout – Example code + +Links to all payout-related examples in the `code/` folder. Payout endpoints are +exposed on `UserApi`. + +> ⚠️ `initiate_payout`, `modify_payout`, and `cancel_payout` move real funds. Test +> against a sandbox/test account before using in production. + +## 1. Payout History & Modes + +- 1.1 [Get payout history](code/payout.md#get-payout-history) +- 1.2 [Get payout modes](code/payout.md#get-payout-modes) + +## 2. Initiate / Modify / Cancel Payout + +- 2.1 [Initiate payout](code/payout.md#initiate-payout) +- 2.2 [Modify payout](code/payout.md#modify-payout) +- 2.3 [Cancel payout](code/payout.md#cancel-payout) diff --git a/examples/payout/code/payout.md b/examples/payout/code/payout.md new file mode 100644 index 0000000..fc8d4dc --- /dev/null +++ b/examples/payout/code/payout.md @@ -0,0 +1,97 @@ +## Get payout history + +```python +import upstox_client +from upstox_client.rest import ApiException + +configuration = upstox_client.Configuration() +configuration.access_token = '{your_access_token}' + +api_instance = upstox_client.UserApi(upstox_client.ApiClient(configuration)) + +try: + api_response = api_instance.get_payout_history() + print(api_response) +except ApiException as e: + print("Exception when calling UserApi->get_payout_history: %s\n" % e) +``` + +## Get payout modes + +```python +import upstox_client +from upstox_client.rest import ApiException + +configuration = upstox_client.Configuration() +configuration.access_token = '{your_access_token}' + +api_instance = upstox_client.UserApi(upstox_client.ApiClient(configuration)) + +try: + api_response = api_instance.get_payout_modes() + print(api_response) +except ApiException as e: + print("Exception when calling UserApi->get_payout_modes: %s\n" % e) +``` + +## Initiate payout + +```python +import upstox_client +from upstox_client.rest import ApiException + +configuration = upstox_client.Configuration() +configuration.access_token = '{your_access_token}' + +api_instance = upstox_client.UserApi(upstox_client.ApiClient(configuration)) + +# mode is one of the values returned by get_payout_modes (e.g. IMPS) +body = upstox_client.InitiatePayoutRequest(mode='IMPS', amount=1000.0) + +try: + api_response = api_instance.initiate_payout(body) + print(api_response) +except ApiException as e: + print("Exception when calling UserApi->initiate_payout: %s\n" % e) +``` + +## Modify payout + +```python +import upstox_client +from upstox_client.rest import ApiException + +configuration = upstox_client.Configuration() +configuration.access_token = '{your_access_token}' + +api_instance = upstox_client.UserApi(upstox_client.ApiClient(configuration)) + +transaction_id = '{transaction_id}' +body = upstox_client.ModifyPayoutRequest(amount=2000.0) + +try: + api_response = api_instance.modify_payout(body, transaction_id) + print(api_response) +except ApiException as e: + print("Exception when calling UserApi->modify_payout: %s\n" % e) +``` + +## Cancel payout + +```python +import upstox_client +from upstox_client.rest import ApiException + +configuration = upstox_client.Configuration() +configuration.access_token = '{your_access_token}' + +api_instance = upstox_client.UserApi(upstox_client.ApiClient(configuration)) + +transaction_id = '{transaction_id}' + +try: + api_response = api_instance.cancel_payout(transaction_id) + print(api_response) +except ApiException as e: + print("Exception when calling UserApi->cancel_payout: %s\n" % e) +``` diff --git a/examples/smartlist/README.md b/examples/smartlist/README.md new file mode 100644 index 0000000..4fd5572 --- /dev/null +++ b/examples/smartlist/README.md @@ -0,0 +1,16 @@ +# Smartlist – Example code + +Links to all smartlist-related examples in the `code/` folder. Smartlist endpoints +return analytics-enriched lists and are exposed on `MarketApi`. + +## 1. Smartlist Options + +- 1.1 [Get smartlist options](code/get-smartlist.md#get-smartlist-options) + +## 2. Smartlist Futures + +- 2.1 [Get smartlist futures](code/get-smartlist.md#get-smartlist-futures) + +## 3. Smartlist MTF + +- 3.1 [Get smartlist MTF](code/get-smartlist.md#get-smartlist-mtf) diff --git a/examples/smartlist/code/get-smartlist.md b/examples/smartlist/code/get-smartlist.md new file mode 100644 index 0000000..aedbddc --- /dev/null +++ b/examples/smartlist/code/get-smartlist.md @@ -0,0 +1,70 @@ +## Get smartlist options + +```python +import upstox_client +from upstox_client.rest import ApiException + +configuration = upstox_client.Configuration() +configuration.access_token = '{your_access_token}' + +api_instance = upstox_client.MarketApi(upstox_client.ApiClient(configuration)) + +try: + # asset_type: INDEX | STOCK | COMMODITY + # category: TOP_TRADED, MOST_ACTIVE, OI_GAINERS, OI_LOSERS, PRICE_GAINERS, + # PRICE_LOSERS, IV_GAINERS, IV_LOSERS, UNDER_5000, UNDER_10000 + api_response = api_instance.get_smartlist_options( + asset_type='INDEX', + category='TOP_TRADED', + page_number=1, + page_size=50 + ) + print(api_response) +except ApiException as e: + print("Exception when calling MarketApi->get_smartlist_options: %s\n" % e) +``` + +## Get smartlist futures + +```python +import upstox_client +from upstox_client.rest import ApiException + +configuration = upstox_client.Configuration() +configuration.access_token = '{your_access_token}' + +api_instance = upstox_client.MarketApi(upstox_client.ApiClient(configuration)) + +try: + # asset_type: INDEX | STOCK | COMMODITY + # category: TOP_TRADED, MOST_ACTIVE, OI_GAINERS, OI_LOSERS, PRICE_GAINERS, + # PRICE_LOSERS, PREMIUM, DISCOUNT + api_response = api_instance.get_smartlist_futures( + asset_type='STOCK', + category='MOST_ACTIVE', + page_number=1, + page_size=50 + ) + print(api_response) +except ApiException as e: + print("Exception when calling MarketApi->get_smartlist_futures: %s\n" % e) +``` + +## Get smartlist MTF + +```python +import upstox_client +from upstox_client.rest import ApiException + +configuration = upstox_client.Configuration() +configuration.access_token = '{your_access_token}' + +api_instance = upstox_client.MarketApi(upstox_client.ApiClient(configuration)) + +try: + # MTF (Margin Trade Funding) stocks, enriched with live LTP + api_response = api_instance.get_smartlist_mtf(page_number=1, page_size=50) + print(api_response) +except ApiException as e: + print("Exception when calling MarketApi->get_smartlist_mtf: %s\n" % e) +``` From dfb0203e2db601c29f247b23a18ec92f8df31c09 Mon Sep 17 00:00:00 2001 From: KETAN GUPTA Date: Thu, 25 Jun 2026 18:13:33 +0530 Subject: [PATCH 08/10] chore(release): bump version to 2.28.0 Co-Authored-By: Claude Opus 4.8 (1M context) --- setup.py | 2 +- upstox_client/api_client.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 4a4ca32..1877d84 100644 --- a/setup.py +++ b/setup.py @@ -18,7 +18,7 @@ long_description = (this_directory / "README.md").read_text() NAME = "upstox-python-sdk" -VERSION = "2.27.0" +VERSION = "2.28.0" # To install the library, run the following # # python setup.py install diff --git a/upstox_client/api_client.py b/upstox_client/api_client.py index ac4f5b8..3ced975 100644 --- a/upstox_client/api_client.py +++ b/upstox_client/api_client.py @@ -74,7 +74,7 @@ def __init__(self, configuration=None, header_name=None, header_value=None, # Set default User-Agent. self.user_agent = 'Swagger-Codegen/1.0.0/python' self.default_headers["X-Upstox-SDK-Language"] = "python" - self.default_headers["X-Upstox-SDK-Version"] = "2.27.0" + self.default_headers["X-Upstox-SDK-Version"] = "2.28.0" def __del__(self): try: From 015e3a07350a976fff9654e6afc566c4c83ef344 Mon Sep 17 00:00:00 2001 From: KETAN GUPTA Date: Thu, 25 Jun 2026 18:20:43 +0530 Subject: [PATCH 09/10] test(ipos-smartlist-payout): add dedicated sdk_tests for IpoApi, payout, and smartlist Co-Authored-By: Claude Opus 4.8 (1M context) --- test/sdk_tests/test_ipo_api.py | 61 ++++++++++++++++++++++++++++ test/sdk_tests/test_market_api.py | 31 ++++++++++++++ test/sdk_tests/test_payout_api.py | 67 +++++++++++++++++++++++++++++++ 3 files changed, 159 insertions(+) create mode 100644 test/sdk_tests/test_ipo_api.py create mode 100644 test/sdk_tests/test_payout_api.py diff --git a/test/sdk_tests/test_ipo_api.py b/test/sdk_tests/test_ipo_api.py new file mode 100644 index 0000000..9fa9e71 --- /dev/null +++ b/test/sdk_tests/test_ipo_api.py @@ -0,0 +1,61 @@ +import upstox_client +import data_token +from upstox_client.rest import ApiException + +configuration = upstox_client.Configuration() +configuration.access_token = data_token.access_token + +api_instance = upstox_client.IpoApi(upstox_client.ApiClient(configuration)) + +# Get IPO listing (no filters) +try: + api_response = api_instance.get_ipo_listing() + if api_response.status != "success": + print("error in IpoApi->get_ipo_listing") +except ApiException as e: + print("Exception when calling IpoApi->get_ipo_listing: %s\n" % e) + +# Get IPO listing with filters and pagination +try: + api_response = api_instance.get_ipo_listing(status="open", issue_type="regular", page_number=1, records=20) + if api_response.status != "success": + print("error in IpoApi->get_ipo_listing with filters") +except ApiException as e: + print("Exception when calling IpoApi->get_ipo_listing with filters: %s\n" % e) + +# Get IPO details by id (in real usage, pass a slug id from get_ipo_listing) +try: + api_response = api_instance.get_ipo_details("sample-ipo-slug") + if api_response.status != "success": + print("error in IpoApi->get_ipo_details") +except ApiException as e: + print("Exception when calling IpoApi->get_ipo_details: %s\n" % e) + +# Model instantiation tests +ipo_listing_data = upstox_client.IpoListingData(symbol="XYZ", status="open") +if ipo_listing_data.symbol != "XYZ": + print("error: IpoListingData fields not set correctly") + +ipo_meta_data = upstox_client.IpoMetaData(page=upstox_client.Pagination(page_number=1)) +if ipo_meta_data.page.page_number != 1: + print("error: IpoMetaData fields not set correctly") + +ipo_listing_response = upstox_client.IpoListingResponse(status="success", data=[ipo_listing_data], meta_data=ipo_meta_data) +if ipo_listing_response.status != "success": + print("error: IpoListingResponse status field not set correctly") + +ipo_timeline = upstox_client.IpoTimeline(listing_date="2026-07-01") +if ipo_timeline.listing_date != "2026-07-01": + print("error: IpoTimeline fields not set correctly") + +ipo_registrar_info = upstox_client.IpoRegistrarInfo(name="Registrar Co") +if ipo_registrar_info.name != "Registrar Co": + print("error: IpoRegistrarInfo fields not set correctly") + +ipo_details_data = upstox_client.IpoDetailsData(id="abc", symbol="XYZ", lot_size=10, timeline=ipo_timeline, registrar_info=ipo_registrar_info) +if ipo_details_data.lot_size != 10: + print("error: IpoDetailsData fields not set correctly") + +ipo_details_response = upstox_client.IpoDetailsResponse(status="success", data=ipo_details_data) +if ipo_details_response.status != "success": + print("error: IpoDetailsResponse status field not set correctly") diff --git a/test/sdk_tests/test_market_api.py b/test/sdk_tests/test_market_api.py index 246478b..87ee28e 100644 --- a/test/sdk_tests/test_market_api.py +++ b/test/sdk_tests/test_market_api.py @@ -51,3 +51,34 @@ print("MarketApi->get_dii_data not returning success") except ApiException as e: print("Exception when calling MarketApi->get_dii_data: %s\n" % e) + +# Smartlist endpoints +try: + api_response = api_instance.get_smartlist_options(asset_type="INDEX", category="TOP_TRADED", page_number=1, page_size=50) + if api_response.status != "success": + print("MarketApi->get_smartlist_options not returning success") +except ApiException as e: + print("Exception when calling MarketApi->get_smartlist_options: %s\n" % e) + +try: + api_response = api_instance.get_smartlist_futures(asset_type="STOCK", category="MOST_ACTIVE", page_number=1, page_size=50) + if api_response.status != "success": + print("MarketApi->get_smartlist_futures not returning success") +except ApiException as e: + print("Exception when calling MarketApi->get_smartlist_futures: %s\n" % e) + +try: + api_response = api_instance.get_smartlist_mtf(page_number=1, page_size=50) + if api_response.status != "success": + print("MarketApi->get_smartlist_mtf not returning success") +except ApiException as e: + print("Exception when calling MarketApi->get_smartlist_mtf: %s\n" % e) + +# Model instantiation tests (smartlist responses reuse AnalyticsResponse/AnalyticsData) +analytics_data = upstox_client.AnalyticsData(delta=0.5, iv=12.3) +if analytics_data.delta != 0.5: + print("error: AnalyticsData fields not set correctly") + +analytics_response = upstox_client.AnalyticsResponse(status="success", data=[analytics_data]) +if analytics_response.status != "success": + print("error: AnalyticsResponse status field not set correctly") diff --git a/test/sdk_tests/test_payout_api.py b/test/sdk_tests/test_payout_api.py new file mode 100644 index 0000000..5de4e6d --- /dev/null +++ b/test/sdk_tests/test_payout_api.py @@ -0,0 +1,67 @@ +import upstox_client +import data_token +from upstox_client.rest import ApiException + +configuration = upstox_client.Configuration() +configuration.access_token = data_token.access_token + +api_instance = upstox_client.UserApi(upstox_client.ApiClient(configuration)) + +# Get payout history (read-only) +try: + api_response = api_instance.get_payout_history() + if api_response.status != "success": + print("error in UserApi->get_payout_history") +except ApiException as e: + print("Exception when calling UserApi->get_payout_history: %s\n" % e) + +# Get payout modes (read-only) +try: + api_response = api_instance.get_payout_modes() + if api_response.status != "success": + print("error in UserApi->get_payout_modes") +except ApiException as e: + print("Exception when calling UserApi->get_payout_modes: %s\n" % e) + +# Initiate/Modify/Cancel payout move real funds. Disabled by default; set +# RUN_DESTRUCTIVE_PAYOUT_TESTS = True to exercise them against a real account. +RUN_DESTRUCTIVE_PAYOUT_TESTS = False +if RUN_DESTRUCTIVE_PAYOUT_TESTS: + try: + body = upstox_client.InitiatePayoutRequest(mode="IMPS", amount=1.0) + api_response = api_instance.initiate_payout(body) + transaction_id = api_response.data.transaction_id + + modify_body = upstox_client.ModifyPayoutRequest(amount=2.0) + api_response = api_instance.modify_payout(modify_body, transaction_id) + + api_response = api_instance.cancel_payout(transaction_id) + if api_response.status != "success": + print("error in UserApi payout initiate/modify/cancel cycle") + except ApiException as e: + print("Exception when calling UserApi payout write ops: %s\n" % e) + +# Model instantiation tests +initiate_payout_request = upstox_client.InitiatePayoutRequest(mode="IMPS", amount=500.0) +if initiate_payout_request.amount != 500.0: + print("error: InitiatePayoutRequest fields not set correctly") + +modify_payout_request = upstox_client.ModifyPayoutRequest(amount=750.0) +if modify_payout_request.amount != 750.0: + print("error: ModifyPayoutRequest fields not set correctly") + +payout_details = upstox_client.PayoutDetails(status="SUCCESS", transaction_id="T1", amount=500.0) +if payout_details.transaction_id != "T1": + print("error: PayoutDetails fields not set correctly") + +payout_details_response = upstox_client.PayoutDetailsResponse(status="success", data=payout_details) +if payout_details_response.status != "success": + print("error: PayoutDetailsResponse status field not set correctly") + +payout_modes_data = upstox_client.PayoutModesData() +if payout_modes_data is None: + print("error: PayoutModesData instantiation failed") + +payout_modes_response = upstox_client.PayoutModesResponse(status="success", data=payout_modes_data) +if payout_modes_response.status != "success": + print("error: PayoutModesResponse status field not set correctly") From 1d737f182084bd30bfd21bbd896019c3a823a20d Mon Sep 17 00:00:00 2001 From: Anand Sajankar Date: Thu, 25 Jun 2026 20:39:17 +0530 Subject: [PATCH 10/10] fix(models): add currency, eta, created_at fields to PaymentHistoryData --- upstox_client/models/payment_history_data.py | 84 +++++++++++++++++++- 1 file changed, 81 insertions(+), 3 deletions(-) diff --git a/upstox_client/models/payment_history_data.py b/upstox_client/models/payment_history_data.py index 15bdf47..1c084cd 100644 --- a/upstox_client/models/payment_history_data.py +++ b/upstox_client/models/payment_history_data.py @@ -32,11 +32,14 @@ class PaymentHistoryData(object): 'mode': 'object', 'status': 'object', 'reason': 'object', + 'currency': 'object', + 'eta': 'object', 'last_updated_at': 'object', 'bank_name': 'object', 'transaction_id': 'object', 'total_charges': 'object', - 'charges_category': 'object' + 'charges_category': 'object', + 'created_at': 'object' } attribute_map = { @@ -44,24 +47,30 @@ class PaymentHistoryData(object): 'mode': 'mode', 'status': 'status', 'reason': 'reason', + 'currency': 'currency', + 'eta': 'eta', 'last_updated_at': 'last_updated_at', 'bank_name': 'bank_name', 'transaction_id': 'transaction_id', 'total_charges': 'total_charges', - 'charges_category': 'charges_category' + 'charges_category': 'charges_category', + 'created_at': 'created_at' } - def __init__(self, amount=None, mode=None, status=None, reason=None, last_updated_at=None, bank_name=None, transaction_id=None, total_charges=None, charges_category=None): # noqa: E501 + def __init__(self, amount=None, mode=None, status=None, reason=None, currency=None, eta=None, last_updated_at=None, bank_name=None, transaction_id=None, total_charges=None, charges_category=None, created_at=None): # noqa: E501 """PaymentHistoryData - a model defined in Swagger""" # noqa: E501 self._amount = None self._mode = None self._status = None self._reason = None + self._currency = None + self._eta = None self._last_updated_at = None self._bank_name = None self._transaction_id = None self._total_charges = None self._charges_category = None + self._created_at = None self.discriminator = None if amount is not None: self.amount = amount @@ -71,6 +80,10 @@ def __init__(self, amount=None, mode=None, status=None, reason=None, last_update self.status = status if reason is not None: self.reason = reason + if currency is not None: + self.currency = currency + if eta is not None: + self.eta = eta if last_updated_at is not None: self.last_updated_at = last_updated_at if bank_name is not None: @@ -81,6 +94,8 @@ def __init__(self, amount=None, mode=None, status=None, reason=None, last_update self.total_charges = total_charges if charges_category is not None: self.charges_category = charges_category + if created_at is not None: + self.created_at = created_at @property def amount(self): @@ -166,6 +181,48 @@ def reason(self, reason): self._reason = reason + @property + def currency(self): + """Gets the currency of this PaymentHistoryData. # noqa: E501 + + + :return: The currency of this PaymentHistoryData. # noqa: E501 + :rtype: object + """ + return self._currency + + @currency.setter + def currency(self, currency): + """Sets the currency of this PaymentHistoryData. + + + :param currency: The currency of this PaymentHistoryData. # noqa: E501 + :type: object + """ + + self._currency = currency + + @property + def eta(self): + """Gets the eta of this PaymentHistoryData. # noqa: E501 + + + :return: The eta of this PaymentHistoryData. # noqa: E501 + :rtype: object + """ + return self._eta + + @eta.setter + def eta(self, eta): + """Sets the eta of this PaymentHistoryData. + + + :param eta: The eta of this PaymentHistoryData. # noqa: E501 + :type: object + """ + + self._eta = eta + @property def last_updated_at(self): """Gets the last_updated_at of this PaymentHistoryData. # noqa: E501 @@ -271,6 +328,27 @@ def charges_category(self, charges_category): self._charges_category = charges_category + @property + def created_at(self): + """Gets the created_at of this PaymentHistoryData. # noqa: E501 + + + :return: The created_at of this PaymentHistoryData. # noqa: E501 + :rtype: object + """ + return self._created_at + + @created_at.setter + def created_at(self, created_at): + """Sets the created_at of this PaymentHistoryData. + + + :param created_at: The created_at of this PaymentHistoryData. # noqa: E501 + :type: object + """ + + self._created_at = created_at + def to_dict(self): """Returns the model properties as a dict""" result = {}