Skip to content

Commit

Permalink
Merge pull request #6 from zarbanio/fix/chainavtivity-types
Browse files Browse the repository at this point in the history
fix(oapi-cahinactivity): bug fixes
  • Loading branch information
arashalaei authored Dec 17, 2024
2 parents c959032 + 2e3dd1a commit fc5371a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

setup(
name="zarban",
version="0.5.3",
version="0.5.4",
author="Zarban",
author_email="info@zarban.io",
description="Python SDK for Zarban",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ class ChainActivityStepData(object):
'message': 'message'
}

discriminator_value_class_map = {
}

def __init__(self, type=None, label=None, gas_use_estimate=None, gas_fee_estimate=None, method_parameters=None, name=None, typed_data=None, hash=None, message=None, local_vars_configuration=None): # noqa: E501
"""ChainActivityStepData - a model defined in OpenAPI""" # noqa: E501
if local_vars_configuration is None:
Expand All @@ -72,7 +75,7 @@ def __init__(self, type=None, label=None, gas_use_estimate=None, gas_fee_estimat
self._typed_data = None
self._hash = None
self._message = None
self.discriminator = None
self.discriminator = 'type'

self.type = type
self.label = label
Expand Down Expand Up @@ -300,6 +303,12 @@ def message(self, message):

self._message = message

def get_real_child_model(self, data):
"""Returns the real base class specified by the discriminator"""
discriminator_key = self.attribute_map[self.discriminator]
discriminator_value = data[discriminator_key]
return self.discriminator_value_class_map.get(discriminator_value)

def to_dict(self):
"""Returns the model properties as a dict"""
result = {}
Expand Down

0 comments on commit fc5371a

Please sign in to comment.