Skip to content

Commit

Permalink
Merge pull request #8 from zarbanio/fix/rm-enum-type
Browse files Browse the repository at this point in the history
fix(oapi): remove unnecessary required types
  • Loading branch information
arashalaei authored Dec 17, 2024
2 parents 10db7bc + 8ca1366 commit 3753329
Show file tree
Hide file tree
Showing 9 changed files with 29 additions and 171 deletions.
9 changes: 4 additions & 5 deletions docs/service/ChainActivityStepData.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,14 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**type** | **str** | |
**label** | **dict(str, str)** | |
**gas_use_estimate** | **int** | |
**gas_fee_estimate** | **dict(str, str)** | |
**method_parameters** | [**MethodParameters**](MethodParameters.md) | |
**name** | **str** | The name of the EIP712 signature |
**typed_data** | [**TypedData**](TypedData.md) | |
**hash** | **str** | The hash of the EIP712 signature that needs to be signed |
**message** | **str** | The message that needs to be signed |
**name** | **str** | The name of the EIP712 signature | [optional]
**typed_data** | [**TypedData**](TypedData.md) | | [optional]
**hash** | **str** | The hash of the EIP712 signature that needs to be signed | [optional]
**message** | **str** | The message that needs to be signed | [optional]

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

Expand Down
6 changes: 3 additions & 3 deletions docs/service/EIP712SignRequest.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**name** | **str** | The name of the EIP712 signature |
**typed_data** | [**TypedData**](TypedData.md) | |
**hash** | **str** | The hash of the EIP712 signature that needs to be signed |
**name** | **str** | The name of the EIP712 signature | [optional]
**typed_data** | [**TypedData**](TypedData.md) | | [optional]
**hash** | **str** | The hash of the EIP712 signature that needs to be signed | [optional]

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

Expand Down
2 changes: 1 addition & 1 deletion docs/service/PersonalSignRequest.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**message** | **str** | The message that needs to be signed |
**message** | **str** | The message that needs to be signed | [optional]

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

Expand Down
1 change: 0 additions & 1 deletion docs/service/PreparedTx.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**type** | **str** | |
**label** | **dict(str, str)** | |
**gas_use_estimate** | **int** | |
**gas_fee_estimate** | **dict(str, str)** | |
Expand Down
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.5",
version="0.5.6",
author="Zarban",
author_email="[email protected]",
description="Python SDK for Zarban",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ class ChainActivityStepData(object):
and the value is json key in definition.
"""
openapi_types = {
'type': 'str',
'label': 'dict(str, str)',
'gas_use_estimate': 'int',
'gas_fee_estimate': 'dict(str, str)',
Expand All @@ -46,7 +45,6 @@ class ChainActivityStepData(object):
}

attribute_map = {
'type': 'type',
'label': 'label',
'gas_use_estimate': 'gasUseEstimate',
'gas_fee_estimate': 'gasFeeEstimate',
Expand All @@ -60,13 +58,12 @@ class ChainActivityStepData(object):
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
def __init__(self, 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:
local_vars_configuration = Configuration()
self.local_vars_configuration = local_vars_configuration

self._type = None
self._label = None
self._gas_use_estimate = None
self._gas_fee_estimate = None
Expand All @@ -77,44 +74,18 @@ def __init__(self, type=None, label=None, gas_use_estimate=None, gas_fee_estimat
self._message = None
self.discriminator = 'type'

self.type = type
self.label = label
self.gas_use_estimate = gas_use_estimate
self.gas_fee_estimate = gas_fee_estimate
self.method_parameters = method_parameters
self.name = name
self.typed_data = typed_data
self.hash = hash
self.message = message

@property
def type(self):
"""Gets the type of this ChainActivityStepData. # noqa: E501
:return: The type of this ChainActivityStepData. # noqa: E501
:rtype: str
"""
return self._type

@type.setter
def type(self, type):
"""Sets the type of this ChainActivityStepData.
:param type: The type of this ChainActivityStepData. # noqa: E501
:type: str
"""
if self.local_vars_configuration.client_side_validation and type is None: # noqa: E501
raise ValueError("Invalid value for `type`, must not be `None`") # noqa: E501
allowed_values = ["PersonalSignRequest"] # noqa: E501
if self.local_vars_configuration.client_side_validation and type not in allowed_values: # noqa: E501
raise ValueError(
"Invalid value for `type` ({0}), must be one of {1}" # noqa: E501
.format(type, allowed_values)
)

self._type = type
if name is not None:
self.name = name
if typed_data is not None:
self.typed_data = typed_data
if hash is not None:
self.hash = hash
if message is not None:
self.message = message

@property
def label(self):
Expand Down Expand Up @@ -228,8 +199,6 @@ def name(self, name):
:param name: The name of this ChainActivityStepData. # noqa: E501
:type: str
"""
if self.local_vars_configuration.client_side_validation and name is None: # noqa: E501
raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501

self._name = name

Expand All @@ -251,8 +220,6 @@ def typed_data(self, typed_data):
:param typed_data: The typed_data of this ChainActivityStepData. # noqa: E501
:type: TypedData
"""
if self.local_vars_configuration.client_side_validation and typed_data is None: # noqa: E501
raise ValueError("Invalid value for `typed_data`, must not be `None`") # noqa: E501

self._typed_data = typed_data

Expand All @@ -276,8 +243,6 @@ def hash(self, hash):
:param hash: The hash of this ChainActivityStepData. # noqa: E501
:type: str
"""
if self.local_vars_configuration.client_side_validation and hash is None: # noqa: E501
raise ValueError("Invalid value for `hash`, must not be `None`") # noqa: E501
if (self.local_vars_configuration.client_side_validation and
hash is not None and not re.search(r'^(0x)?[0-9a-fA-F]{64}$', hash)): # noqa: E501
raise ValueError(r"Invalid value for `hash`, must be a follow pattern or equal to `/^(0x)?[0-9a-fA-F]{64}$/`") # noqa: E501
Expand All @@ -304,8 +269,6 @@ def message(self, message):
:param message: The message of this ChainActivityStepData. # noqa: E501
:type: str
"""
if self.local_vars_configuration.client_side_validation and message is None: # noqa: E501
raise ValueError("Invalid value for `message`, must not be `None`") # noqa: E501

self._message = message

Expand Down
50 changes: 7 additions & 43 deletions src/zarban/service/openapi_client/models/eip712_sign_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,64 +34,34 @@ class EIP712SignRequest(object):
and the value is json key in definition.
"""
openapi_types = {
'type': 'str',
'name': 'str',
'typed_data': 'TypedData',
'hash': 'str'
}

attribute_map = {
'type': 'type',
'name': 'name',
'typed_data': 'typedData',
'hash': 'hash'
}

def __init__(self, type=None, name=None, typed_data=None, hash=None, local_vars_configuration=None): # noqa: E501
def __init__(self, name=None, typed_data=None, hash=None, local_vars_configuration=None): # noqa: E501
"""EIP712SignRequest - a model defined in OpenAPI""" # noqa: E501
if local_vars_configuration is None:
local_vars_configuration = Configuration()
self.local_vars_configuration = local_vars_configuration

self._type = None
self._name = None
self._typed_data = None
self._hash = None
self.discriminator = None

self.type = type
self.name = name
self.typed_data = typed_data
self.hash = hash

@property
def type(self):
"""Gets the type of this EIP712SignRequest. # noqa: E501
:return: The type of this EIP712SignRequest. # noqa: E501
:rtype: str
"""
return self._type

@type.setter
def type(self, type):
"""Sets the type of this EIP712SignRequest.
:param type: The type of this EIP712SignRequest. # noqa: E501
:type: str
"""
if self.local_vars_configuration.client_side_validation and type is None: # noqa: E501
raise ValueError("Invalid value for `type`, must not be `None`") # noqa: E501
allowed_values = ["EIP712SignRequest"] # noqa: E501
if self.local_vars_configuration.client_side_validation and type not in allowed_values: # noqa: E501
raise ValueError(
"Invalid value for `type` ({0}), must be one of {1}" # noqa: E501
.format(type, allowed_values)
)

self._type = type
if name is not None:
self.name = name
if typed_data is not None:
self.typed_data = typed_data
if hash is not None:
self.hash = hash

@property
def name(self):
Expand All @@ -113,8 +83,6 @@ def name(self, name):
:param name: The name of this EIP712SignRequest. # noqa: E501
:type: str
"""
if self.local_vars_configuration.client_side_validation and name is None: # noqa: E501
raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501

self._name = name

Expand All @@ -136,8 +104,6 @@ def typed_data(self, typed_data):
:param typed_data: The typed_data of this EIP712SignRequest. # noqa: E501
:type: TypedData
"""
if self.local_vars_configuration.client_side_validation and typed_data is None: # noqa: E501
raise ValueError("Invalid value for `typed_data`, must not be `None`") # noqa: E501

self._typed_data = typed_data

Expand All @@ -161,8 +127,6 @@ def hash(self, hash):
:param hash: The hash of this EIP712SignRequest. # noqa: E501
:type: str
"""
if self.local_vars_configuration.client_side_validation and hash is None: # noqa: E501
raise ValueError("Invalid value for `hash`, must not be `None`") # noqa: E501
if (self.local_vars_configuration.client_side_validation and
hash is not None and not re.search(r'^(0x)?[0-9a-fA-F]{64}$', hash)): # noqa: E501
raise ValueError(r"Invalid value for `hash`, must be a follow pattern or equal to `/^(0x)?[0-9a-fA-F]{64}$/`") # noqa: E501
Expand Down
40 changes: 3 additions & 37 deletions src/zarban/service/openapi_client/models/personal_sign_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,56 +34,24 @@ class PersonalSignRequest(object):
and the value is json key in definition.
"""
openapi_types = {
'type': 'str',
'message': 'str'
}

attribute_map = {
'type': 'type',
'message': 'message'
}

def __init__(self, type=None, message=None, local_vars_configuration=None): # noqa: E501
def __init__(self, message=None, local_vars_configuration=None): # noqa: E501
"""PersonalSignRequest - a model defined in OpenAPI""" # noqa: E501
if local_vars_configuration is None:
local_vars_configuration = Configuration()
self.local_vars_configuration = local_vars_configuration

self._type = None
self._message = None
self.discriminator = None

self.type = type
self.message = message

@property
def type(self):
"""Gets the type of this PersonalSignRequest. # noqa: E501
:return: The type of this PersonalSignRequest. # noqa: E501
:rtype: str
"""
return self._type

@type.setter
def type(self, type):
"""Sets the type of this PersonalSignRequest.
:param type: The type of this PersonalSignRequest. # noqa: E501
:type: str
"""
if self.local_vars_configuration.client_side_validation and type is None: # noqa: E501
raise ValueError("Invalid value for `type`, must not be `None`") # noqa: E501
allowed_values = ["PersonalSignRequest"] # noqa: E501
if self.local_vars_configuration.client_side_validation and type not in allowed_values: # noqa: E501
raise ValueError(
"Invalid value for `type` ({0}), must be one of {1}" # noqa: E501
.format(type, allowed_values)
)

self._type = type
if message is not None:
self.message = message

@property
def message(self):
Expand All @@ -105,8 +73,6 @@ def message(self, message):
:param message: The message of this PersonalSignRequest. # noqa: E501
:type: str
"""
if self.local_vars_configuration.client_side_validation and message is None: # noqa: E501
raise ValueError("Invalid value for `message`, must not be `None`") # noqa: E501

self._message = message

Expand Down
Loading

0 comments on commit 3753329

Please sign in to comment.