PageRenderTime 36ms CodeModel.GetById 20ms RepoModel.GetById 0ms app.codeStats 0ms

/ubiquity/ubiquity_openapi_client/model/multi_transfer_operation.py

https://gitlab.com/mikelampert924/ubiquity-python-client
Python | 280 lines | 246 code | 1 blank | 33 comment | 4 complexity | 69908a1e958a1b1f0e53471bdfe260c8 MD5 | raw file
  1. """
  2. Ubiquity REST API
  3. Ubiquity provides a RESTful and uniform way to access blockchain resources, with a rich and reusable model across multiple cryptocurrencies. [Documentation](https://app.blockdaemon.com/docs/ubiquity) ### Protocols #### Mainnet The following protocols are currently supported: * bitcoin * ethereum * polkadot * xrp * algorand * stellar * dogecoin * oasis * near * terra * litecoin * bitcoincash * solana #### Testnet * bitcoin/testnet * ethereum/ropsten * dogecoin/testnet * litecoin/testnet * bitcoincash/testnet #### Native Ubiquity provides native access to all Blockchain nodes it supports. To access native functionality, use the protocol without the v2 prefix * bitcoin/(mainnet | testnet) - [RPC Documentation](https://developer.bitcoin.org/reference/rpc/) * ethereum/(mainnet | ropsten) - [RPC Documentation](https://ethereum.org/en/developers/docs/apis/json-rpc/) * polkadot/mainnet - [Sidecar API Documentation](https://paritytech.github.io/substrate-api-sidecar/dist/) * polkadot/mainnet/http-rpc - [Polkadot RPC Documentation](https://polkadot.js.org/docs/substrate/rpc/) * algorand/mainnet - [Algod API Documentation](https://developer.algorand.org/docs/reference/rest-apis/algod/v1/) * stellar/mainnet - [Stellar Horizon API Documentation](https://developers.stellar.org/api) * dogecoin/(mainnet | testnet) - [Dogecoin API Documentaion](https://developer.bitcoin.org/reference/rpc/) * oasis/mainnet - [Oasis Rosetta Gateway Documentation](https://www.rosetta-api.org/docs/api_identifiers.html#network-identifier) * near/mainnet - [NEAR RPC Documentation](https://docs.near.org/docs/api/rpc) * terra/mainnet - [Terra RPC Documentation](https://docs.terra.money/docs/develop/how-to/endpoints.html) * litecoin/mainnet - [Litecoin RPC Documentation](https://litecoin.info/index.php/Litecoin_API) * bitcoincash/mainnet - [Bitcoin Cash RPC Documentation](https://docs.bitcoincashnode.org/doc/json-rpc/) * solana/mainnet - [Solana RPC Documentation](https://docs.solana.com/developing/clients/jsonrpc-api) A full URL example: https://ubiquity.api.blockdaemon.com/bitcoin/mainnet ##### Pagination Certain resources contain a lot of data, more than what's practical to return for a single request. With the help of pagination, the data is split across multiple responses. Each response returns a subset of the items requested, and a continuation token. To get the next batch of items, copy the returned continuation token to the continuation query parameter and repeat the request with the new URL. In case no continuation token is returned, there is no more data available. # noqa: E501
  4. The version of the OpenAPI document: 2.0.0
  5. Contact: support@blockdaemon.com
  6. Generated by: https://openapi-generator.tech
  7. """
  8. import re # noqa: F401
  9. import sys # noqa: F401
  10. from ubiquity.ubiquity_openapi_client.model_utils import ( # noqa: F401
  11. ApiTypeError,
  12. ModelComposed,
  13. ModelNormal,
  14. ModelSimple,
  15. cached_property,
  16. change_keys_js_to_python,
  17. convert_js_args_to_python_args,
  18. date,
  19. datetime,
  20. file_type,
  21. none_type,
  22. validate_get_composed_info,
  23. )
  24. from ..model_utils import OpenApiModel
  25. from ubiquity.ubiquity_openapi_client.exceptions import ApiAttributeError
  26. def lazy_import():
  27. from ubiquity.ubiquity_openapi_client.model.multi_transfer import MultiTransfer
  28. globals()['MultiTransfer'] = MultiTransfer
  29. class MultiTransferOperation(ModelNormal):
  30. """NOTE: This class is auto generated by OpenAPI Generator.
  31. Ref: https://openapi-generator.tech
  32. Do not edit the class manually.
  33. Attributes:
  34. allowed_values (dict): The key is the tuple path to the attribute
  35. and the for var_name this is (var_name,). The value is a dict
  36. with a capitalized key describing the allowed value and an allowed
  37. value. These dicts store the allowed enum values.
  38. attribute_map (dict): The key is attribute name
  39. and the value is json key in definition.
  40. discriminator_value_class_map (dict): A dict to go from the discriminator
  41. variable value to the discriminator class name.
  42. validations (dict): The key is the tuple path to the attribute
  43. and the for var_name this is (var_name,). The value is a dict
  44. that stores validations for max_length, min_length, max_items,
  45. min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum,
  46. inclusive_minimum, and regex.
  47. additional_properties_type (tuple): A tuple of classes accepted
  48. as additional properties values.
  49. """
  50. allowed_values = {
  51. }
  52. validations = {
  53. }
  54. @cached_property
  55. def additional_properties_type():
  56. """
  57. This must be a method because a model may have properties that are
  58. of type self, this must run after the class is loaded
  59. """
  60. lazy_import()
  61. return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501
  62. _nullable = False
  63. @cached_property
  64. def openapi_types():
  65. """
  66. This must be a method because a model may have properties that are
  67. of type self, this must run after the class is loaded
  68. Returns
  69. openapi_types (dict): The key is attribute name
  70. and the value is attribute type.
  71. """
  72. lazy_import()
  73. return {
  74. 'type': (str,), # noqa: E501
  75. 'detail': (MultiTransfer,), # noqa: E501
  76. 'event': (str,), # noqa: E501
  77. }
  78. @cached_property
  79. def discriminator():
  80. return None
  81. attribute_map = {
  82. 'type': 'type', # noqa: E501
  83. 'detail': 'detail', # noqa: E501
  84. 'event': 'event', # noqa: E501
  85. }
  86. read_only_vars = {
  87. }
  88. _composed_schemas = {}
  89. @classmethod
  90. @convert_js_args_to_python_args
  91. def _from_openapi_data(cls, detail, *args, **kwargs): # noqa: E501
  92. """MultiTransferOperation - a model defined in OpenAPI
  93. Args:
  94. detail (MultiTransfer):
  95. Keyword Args:
  96. type (str): defaults to "multi_transfer" # noqa: E501
  97. _check_type (bool): if True, values for parameters in openapi_types
  98. will be type checked and a TypeError will be
  99. raised if the wrong type is input.
  100. Defaults to True
  101. _path_to_item (tuple/list): This is a list of keys or values to
  102. drill down to the model in received_data
  103. when deserializing a response
  104. _spec_property_naming (bool): True if the variable names in the input data
  105. are serialized names, as specified in the OpenAPI document.
  106. False if the variable names in the input data
  107. are pythonic names, e.g. snake case (default)
  108. _configuration (Configuration): the instance to use when
  109. deserializing a file_type parameter.
  110. If passed, type conversion is attempted
  111. If omitted no type conversion is done.
  112. _visited_composed_classes (tuple): This stores a tuple of
  113. classes that we have traveled through so that
  114. if we see that class again we will not use its
  115. discriminator again.
  116. When traveling through a discriminator, the
  117. composed schema that is
  118. is traveled through is added to this set.
  119. For example if Animal has a discriminator
  120. petType and we pass in "Dog", and the class Dog
  121. allOf includes Animal, we move through Animal
  122. once using the discriminator, and pick Dog.
  123. Then in Dog, we will make an instance of the
  124. Animal class but this time we won't travel
  125. through its discriminator because we passed in
  126. _visited_composed_classes = (Animal,)
  127. event (str): [optional] # noqa: E501
  128. """
  129. type = kwargs.get('type', "multi_transfer")
  130. _check_type = kwargs.pop('_check_type', True)
  131. _spec_property_naming = kwargs.pop('_spec_property_naming', False)
  132. _path_to_item = kwargs.pop('_path_to_item', ())
  133. _configuration = kwargs.pop('_configuration', None)
  134. _visited_composed_classes = kwargs.pop('_visited_composed_classes', ())
  135. self = super(OpenApiModel, cls).__new__(cls)
  136. if args:
  137. raise ApiTypeError(
  138. "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % (
  139. args,
  140. self.__class__.__name__,
  141. ),
  142. path_to_item=_path_to_item,
  143. valid_classes=(self.__class__,),
  144. )
  145. self._data_store = {}
  146. self._check_type = _check_type
  147. self._spec_property_naming = _spec_property_naming
  148. self._path_to_item = _path_to_item
  149. self._configuration = _configuration
  150. self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
  151. self.type = type
  152. self.detail = detail
  153. for var_name, var_value in kwargs.items():
  154. if var_name not in self.attribute_map and \
  155. self._configuration is not None and \
  156. self._configuration.discard_unknown_keys and \
  157. self.additional_properties_type is None:
  158. # discard variable.
  159. continue
  160. setattr(self, var_name, var_value)
  161. return self
  162. required_properties = set([
  163. '_data_store',
  164. '_check_type',
  165. '_spec_property_naming',
  166. '_path_to_item',
  167. '_configuration',
  168. '_visited_composed_classes',
  169. ])
  170. @convert_js_args_to_python_args
  171. def __init__(self, detail, *args, **kwargs): # noqa: E501
  172. """MultiTransferOperation - a model defined in OpenAPI
  173. Args:
  174. detail (MultiTransfer):
  175. Keyword Args:
  176. type (str): defaults to "multi_transfer" # noqa: E501
  177. _check_type (bool): if True, values for parameters in openapi_types
  178. will be type checked and a TypeError will be
  179. raised if the wrong type is input.
  180. Defaults to True
  181. _path_to_item (tuple/list): This is a list of keys or values to
  182. drill down to the model in received_data
  183. when deserializing a response
  184. _spec_property_naming (bool): True if the variable names in the input data
  185. are serialized names, as specified in the OpenAPI document.
  186. False if the variable names in the input data
  187. are pythonic names, e.g. snake case (default)
  188. _configuration (Configuration): the instance to use when
  189. deserializing a file_type parameter.
  190. If passed, type conversion is attempted
  191. If omitted no type conversion is done.
  192. _visited_composed_classes (tuple): This stores a tuple of
  193. classes that we have traveled through so that
  194. if we see that class again we will not use its
  195. discriminator again.
  196. When traveling through a discriminator, the
  197. composed schema that is
  198. is traveled through is added to this set.
  199. For example if Animal has a discriminator
  200. petType and we pass in "Dog", and the class Dog
  201. allOf includes Animal, we move through Animal
  202. once using the discriminator, and pick Dog.
  203. Then in Dog, we will make an instance of the
  204. Animal class but this time we won't travel
  205. through its discriminator because we passed in
  206. _visited_composed_classes = (Animal,)
  207. event (str): [optional] # noqa: E501
  208. """
  209. type = kwargs.get('type', "multi_transfer")
  210. _check_type = kwargs.pop('_check_type', True)
  211. _spec_property_naming = kwargs.pop('_spec_property_naming', False)
  212. _path_to_item = kwargs.pop('_path_to_item', ())
  213. _configuration = kwargs.pop('_configuration', None)
  214. _visited_composed_classes = kwargs.pop('_visited_composed_classes', ())
  215. if args:
  216. raise ApiTypeError(
  217. "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % (
  218. args,
  219. self.__class__.__name__,
  220. ),
  221. path_to_item=_path_to_item,
  222. valid_classes=(self.__class__,),
  223. )
  224. self._data_store = {}
  225. self._check_type = _check_type
  226. self._spec_property_naming = _spec_property_naming
  227. self._path_to_item = _path_to_item
  228. self._configuration = _configuration
  229. self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
  230. self.type = type
  231. self.detail = detail
  232. for var_name, var_value in kwargs.items():
  233. if var_name not in self.attribute_map and \
  234. self._configuration is not None and \
  235. self._configuration.discard_unknown_keys and \
  236. self.additional_properties_type is None:
  237. # discard variable.
  238. continue
  239. setattr(self, var_name, var_value)
  240. if var_name in self.read_only_vars:
  241. raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate "
  242. f"class with read only attributes.")