Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automated update by SDK Generator #80

Merged
merged 3 commits into from
Jul 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion docs/apis/HrisApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -1678,6 +1678,7 @@ with apideck.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = hris_api.HrisApi(api_client)
employee = Employee(
id="12345",
first_name="Elon",
last_name="Musk",
middle_name="D.",
Expand Down Expand Up @@ -2207,6 +2208,7 @@ import apideck
from apideck.api import hris_api
from apideck.model.employees_one_filter import EmployeesOneFilter
from apideck.model.get_employee_response import GetEmployeeResponse
from apideck.model.pass_through_query import PassThroughQuery
from apideck.model.bad_request_response import BadRequestResponse
from apideck.model.payment_required_response import PaymentRequiredResponse
from apideck.model.unexpected_error_response import UnexpectedErrorResponse
Expand Down Expand Up @@ -2244,6 +2246,7 @@ with apideck.ApiClient(configuration) as api_client:
filter = EmployeesOneFilter(
company_id="1234",
) # EmployeesOneFilter | Apply filters (optional)
pass_through = PassThroughQuery() # PassThroughQuery | Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads (optional)

# example passing only required values which don't have defaults set
try:
Expand All @@ -2257,7 +2260,7 @@ with apideck.ApiClient(configuration) as api_client:
# and optional values
try:
# Get Employee
api_response = api_instance.employees_one(id, consumer_id=consumer_id, app_id=app_id, service_id=service_id, raw=raw, fields=fields, filter=filter)
api_response = api_instance.employees_one(id, consumer_id=consumer_id, app_id=app_id, service_id=service_id, raw=raw, fields=fields, filter=filter, pass_through=pass_through)
pprint(api_response)
except apideck.ApiException as e:
print("Exception when calling HrisApi->employees_one: %s\n" % e)
Expand All @@ -2275,6 +2278,7 @@ Name | Type | Description | Notes
**raw** | **bool**| Include raw response. Mostly used for debugging purposes | [optional] if omitted the server will use the default value of False
**fields** | **str, none_type**| The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields \"name\", \"email\" and \"addresses.city\". If any other fields are available, they will be excluded. | [optional]
**filter** | **EmployeesOneFilter**| Apply filters | [optional]
**pass_through** | **PassThroughQuery**| Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads | [optional]

### Return type

Expand Down Expand Up @@ -2351,6 +2355,7 @@ with apideck.ApiClient(configuration) as api_client:
api_instance = hris_api.HrisApi(api_client)
id = "id_example" # str | ID of the record you are acting upon.
employee = Employee(
id="12345",
first_name="Elon",
last_name="Musk",
middle_name="D.",
Expand Down
2 changes: 1 addition & 1 deletion docs/models/Employee.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**id** | **str** | A unique identifier for an object. | [readonly]
**id** | **str, none_type** | A unique identifier for an object. |
**first_name** | **str, none_type** | The first name of the person. | [optional]
**last_name** | **str, none_type** | The last name of the person. | [optional]
**middle_name** | **str, none_type** | Middle name of the person. | [optional]
Expand Down
6 changes: 6 additions & 0 deletions src/apideck/api/hris_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -1372,6 +1372,7 @@ def __init__(self, api_client=None):
'raw',
'fields',
'filter',
'pass_through',
],
'required': [
'id',
Expand Down Expand Up @@ -1404,6 +1405,8 @@ def __init__(self, api_client=None):
(str, none_type,),
'filter':
(EmployeesOneFilter,),
'pass_through':
(PassThroughQuery,),
},
'attribute_map': {
'id': 'id',
Expand All @@ -1413,6 +1416,7 @@ def __init__(self, api_client=None):
'raw': 'raw',
'fields': 'fields',
'filter': 'filter',
'pass_through': 'pass_through',
},
'location_map': {
'id': 'path',
Expand All @@ -1422,6 +1426,7 @@ def __init__(self, api_client=None):
'raw': 'query',
'fields': 'query',
'filter': 'query',
'pass_through': 'query',
},
'collection_format_map': {
}
Expand Down Expand Up @@ -3438,6 +3443,7 @@ def employees_one(
raw (bool): Include raw response. Mostly used for debugging purposes. [optional] if omitted the server will use the default value of False
fields (str, none_type): The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields \"name\", \"email\" and \"addresses.city\". If any other fields are available, they will be excluded.. [optional]
filter (EmployeesOneFilter): Apply filters. [optional]
pass_through (PassThroughQuery): Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads. [optional]
_return_http_data_only (bool): response data without head status
code and headers. Default is True.
_preload_content (bool): if False, the urllib3.HTTPResponse object
Expand Down
11 changes: 7 additions & 4 deletions src/apideck/model/employee.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ def openapi_types():
"""
lazy_import()
return {
'id': (str,), # noqa: E501
'id': (str, none_type,), # noqa: E501
'first_name': (str, none_type,), # noqa: E501
'last_name': (str, none_type,), # noqa: E501
'middle_name': (str, none_type,), # noqa: E501
Expand Down Expand Up @@ -264,7 +264,6 @@ def discriminator():
}

read_only_vars = {
'id', # noqa: E501
'custom_mappings', # noqa: E501
'updated_by', # noqa: E501
'created_by', # noqa: E501
Expand All @@ -280,7 +279,7 @@ def _from_openapi_data(cls, id, *args, **kwargs): # noqa: E501
"""Employee - a model defined in OpenAPI

Args:
id (str): A unique identifier for an object.
id (str, none_type): A unique identifier for an object.

Keyword Args:
_check_type (bool): if True, values for parameters in openapi_types
Expand Down Expand Up @@ -426,9 +425,12 @@ def _from_openapi_data(cls, id, *args, **kwargs): # noqa: E501
])

@convert_js_args_to_python_args
def __init__(self, *args, **kwargs): # noqa: E501
def __init__(self, id, *args, **kwargs): # noqa: E501
"""Employee - a model defined in OpenAPI

Args:
id (str, none_type): A unique identifier for an object.

Keyword Args:
_check_type (bool): if True, values for parameters in openapi_types
will be type checked and a TypeError will be
Expand Down Expand Up @@ -550,6 +552,7 @@ def __init__(self, *args, **kwargs): # noqa: E501
self._configuration = _configuration
self._visited_composed_classes = _visited_composed_classes + (self.__class__,)

self.id = id
for var_name, var_value in kwargs.items():
if var_name not in self.attribute_map and \
self._configuration is not None and \
Expand Down
15 changes: 10 additions & 5 deletions src/apideck/model_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ class OpenApiModel(object):

def set_attribute(self, name, value):
# this is only used to set properties on self
# something here

path_to_item = []
if self._path_to_item:
Expand All @@ -130,11 +131,14 @@ def set_attribute(self, name, value):
if name in self.openapi_types:
required_types_mixed = self.openapi_types[name]
elif self.additional_properties_type is None:
raise ApiAttributeError(
"{0} has no attribute '{1}'".format(
type(self).__name__, name),
path_to_item
)
# This is a custom implementation to handle the case where the attribute is not defined in the model
return

# raise ApiAttributeError(
# "{0} has no attribute '{1}'".format(
# type(self).__name__, name),
# path_to_item
# )
elif self.additional_properties_type is not None:
required_types_mixed = self.additional_properties_type

Expand Down Expand Up @@ -171,6 +175,7 @@ def set_attribute(self, name, value):
)
self.__dict__['_data_store'][name] = value


def __repr__(self):
"""For `print` and `pprint`"""
return self.to_str()
Expand Down
Loading