shotstack / shotstack-sdk-python

Python SDK for Shotstack, the cloud video editing API
https://shotstack.io/product/sdk/python/
22 stars 2 forks source link

KeyError: 'asset' when get_render #14

Closed teleworker-andy closed 3 months ago

teleworker-andy commented 3 months ago

Hi support,

I got an error when call get_render method on sdk version 0.2.7 It works fine on sdk version 0.2.6

error message as below:

from shotstack_sdk.api import edit_api
api_instance = edit_api.EditApi(client)
api_response = api_instance.get_render(render_id, data=False, merged=False)

  File "/layers/google.python.pip/pip/lib/python3.10/site-packages/shotstack_sdk/api/edit_api.py", line 702, in get_render
    return self.get_render_endpoint.call_with_http_info(**kwargs)
  File "/layers/google.python.pip/pip/lib/python3.10/site-packages/shotstack_sdk/api_client.py", line 851, in call_with_http_info
    return self.api_client.call_api(
  File "/layers/google.python.pip/pip/lib/python3.10/site-packages/shotstack_sdk/api_client.py", line 410, in call_api
    return self.__call_api(resource_path, method,
  File "/layers/google.python.pip/pip/lib/python3.10/site-packages/shotstack_sdk/api_client.py", line 225, in __call_api
    return_data = self.deserialize(
  File "/layers/google.python.pip/pip/lib/python3.10/site-packages/shotstack_sdk/api_client.py", line 326, in deserialize
    deserialized_data = validate_and_convert_types(
  File "/layers/google.python.pip/pip/lib/python3.10/site-packages/shotstack_sdk/model_utils.py", line 1570, in validate_and_convert_types
    converted_instance = attempt_convert_item(
  File "/layers/google.python.pip/pip/lib/python3.10/site-packages/shotstack_sdk/model_utils.py", line 1454, in attempt_convert_item
    return deserialize_model(input_value, valid_class,
  File "/layers/google.python.pip/pip/lib/python3.10/site-packages/shotstack_sdk/model_utils.py", line 1374, in deserialize_model
    return model_class._new_from_openapi_data(**kw_args)
  File "/layers/google.python.pip/pip/lib/python3.10/site-packages/shotstack_sdk/model_utils.py", line 46, in wrapped_init
    return fn(_self, *args, **kwargs)
  File "/layers/google.python.pip/pip/lib/python3.10/site-packages/shotstack_sdk/model_utils.py", line 370, in _new_from_openapi_data
    return cls._from_openapi_data(*args, **kwargs)
  File "/layers/google.python.pip/pip/lib/python3.10/site-packages/shotstack_sdk/model_utils.py", line 46, in wrapped_init
    return fn(_self, *args, **kwargs)
  File "/layers/google.python.pip/pip/lib/python3.10/site-packages/shotstack_sdk/model/render_response.py", line 182, in _from_openapi_data
    self.response = response
  File "/layers/google.python.pip/pip/lib/python3.10/site-packages/shotstack_sdk/model_utils.py", line 185, in __setattr__
    self[attr] = value
  File "/layers/google.python.pip/pip/lib/python3.10/site-packages/shotstack_sdk/model_utils.py", line 510, in __setitem__
    self.set_attribute(name, value)
  File "/layers/google.python.pip/pip/lib/python3.10/site-packages/shotstack_sdk/model_utils.py", line 157, in set_attribute
    value = validate_and_convert_types(
  File "/layers/google.python.pip/pip/lib/python3.10/site-packages/shotstack_sdk/model_utils.py", line 1570, in validate_and_convert_types
    converted_instance = attempt_convert_item(
  File "/layers/google.python.pip/pip/lib/python3.10/site-packages/shotstack_sdk/model_utils.py", line 1454, in attempt_convert_item
    return deserialize_model(input_value, valid_class,
  File "/layers/google.python.pip/pip/lib/python3.10/site-packages/shotstack_sdk/model_utils.py", line 1374, in deserialize_model
    return model_class._new_from_openapi_data(**kw_args)
  File "/layers/google.python.pip/pip/lib/python3.10/site-packages/shotstack_sdk/model_utils.py", line 46, in wrapped_init
    return fn(_self, *args, **kwargs)
  File "/layers/google.python.pip/pip/lib/python3.10/site-packages/shotstack_sdk/model_utils.py", line 370, in _new_from_openapi_data
    return cls._from_openapi_data(*args, **kwargs)
  File "/layers/google.python.pip/pip/lib/python3.10/site-packages/shotstack_sdk/model_utils.py", line 46, in wrapped_init
    return fn(_self, *args, **kwargs)
  File "/layers/google.python.pip/pip/lib/python3.10/site-packages/shotstack_sdk/model/render_response_data.py", line 228, in _from_openapi_data
    setattr(self, var_name, var_value)
  File "/layers/google.python.pip/pip/lib/python3.10/site-packages/shotstack_sdk/model_utils.py", line 185, in __setattr__
    self[attr] = value
  File "/layers/google.python.pip/pip/lib/python3.10/site-packages/shotstack_sdk/model_utils.py", line 510, in __setitem__
    self.set_attribute(name, value)
  File "/layers/google.python.pip/pip/lib/python3.10/site-packages/shotstack_sdk/model_utils.py", line 157, in set_attribute
    value = validate_and_convert_types(
  File "/layers/google.python.pip/pip/lib/python3.10/site-packages/shotstack_sdk/model_utils.py", line 1570, in validate_and_convert_types
    converted_instance = attempt_convert_item(
  File "/layers/google.python.pip/pip/lib/python3.10/site-packages/shotstack_sdk/model_utils.py", line 1454, in attempt_convert_item
    return deserialize_model(input_value, valid_class,
  File "/layers/google.python.pip/pip/lib/python3.10/site-packages/shotstack_sdk/model_utils.py", line 1374, in deserialize_model
    return model_class._new_from_openapi_data(**kw_args)
  File "/layers/google.python.pip/pip/lib/python3.10/site-packages/shotstack_sdk/model_utils.py", line 46, in wrapped_init
    return fn(_self, *args, **kwargs)
  File "/layers/google.python.pip/pip/lib/python3.10/site-packages/shotstack_sdk/model_utils.py", line 370, in _new_from_openapi_data
    return cls._from_openapi_data(*args, **kwargs)
  File "/layers/google.python.pip/pip/lib/python3.10/site-packages/shotstack_sdk/model_utils.py", line 46, in wrapped_init
    return fn(_self, *args, **kwargs)
  File "/layers/google.python.pip/pip/lib/python3.10/site-packages/shotstack_sdk/model/edit.py", line 194, in _from_openapi_data
    self.timeline = timeline
  File "/layers/google.python.pip/pip/lib/python3.10/site-packages/shotstack_sdk/model_utils.py", line 185, in __setattr__
    self[attr] = value
  File "/layers/google.python.pip/pip/lib/python3.10/site-packages/shotstack_sdk/model_utils.py", line 510, in __setitem__
    self.set_attribute(name, value)
  File "/layers/google.python.pip/pip/lib/python3.10/site-packages/shotstack_sdk/model_utils.py", line 157, in set_attribute
    value = validate_and_convert_types(
  File "/layers/google.python.pip/pip/lib/python3.10/site-packages/shotstack_sdk/model_utils.py", line 1570, in validate_and_convert_types
    converted_instance = attempt_convert_item(
  File "/layers/google.python.pip/pip/lib/python3.10/site-packages/shotstack_sdk/model_utils.py", line 1454, in attempt_convert_item
    return deserialize_model(input_value, valid_class,
  File "/layers/google.python.pip/pip/lib/python3.10/site-packages/shotstack_sdk/model_utils.py", line 1374, in deserialize_model
    return model_class._new_from_openapi_data(**kw_args)
  File "/layers/google.python.pip/pip/lib/python3.10/site-packages/shotstack_sdk/model_utils.py", line 46, in wrapped_init
    return fn(_self, *args, **kwargs)
  File "/layers/google.python.pip/pip/lib/python3.10/site-packages/shotstack_sdk/model_utils.py", line 370, in _new_from_openapi_data
    return cls._from_openapi_data(*args, **kwargs)
  File "/layers/google.python.pip/pip/lib/python3.10/site-packages/shotstack_sdk/model_utils.py", line 46, in wrapped_init
    return fn(_self, *args, **kwargs)
  File "/layers/google.python.pip/pip/lib/python3.10/site-packages/shotstack_sdk/model/timeline.py", line 190, in _from_openapi_data
    self.tracks = tracks
  File "/layers/google.python.pip/pip/lib/python3.10/site-packages/shotstack_sdk/model_utils.py", line 185, in __setattr__
    self[attr] = value
  File "/layers/google.python.pip/pip/lib/python3.10/site-packages/shotstack_sdk/model_utils.py", line 510, in __setitem__
    self.set_attribute(name, value)
  File "/layers/google.python.pip/pip/lib/python3.10/site-packages/shotstack_sdk/model_utils.py", line 157, in set_attribute
    value = validate_and_convert_types(
  File "/layers/google.python.pip/pip/lib/python3.10/site-packages/shotstack_sdk/model_utils.py", line 1620, in validate_and_convert_types
    input_value[index] = validate_and_convert_types(
  File "/layers/google.python.pip/pip/lib/python3.10/site-packages/shotstack_sdk/model_utils.py", line 1570, in validate_and_convert_types
    converted_instance = attempt_convert_item(
  File "/layers/google.python.pip/pip/lib/python3.10/site-packages/shotstack_sdk/model_utils.py", line 1454, in attempt_convert_item
    return deserialize_model(input_value, valid_class,
  File "/layers/google.python.pip/pip/lib/python3.10/site-packages/shotstack_sdk/model_utils.py", line 1374, in deserialize_model
    return model_class._new_from_openapi_data(**kw_args)
  File "/layers/google.python.pip/pip/lib/python3.10/site-packages/shotstack_sdk/model_utils.py", line 46, in wrapped_init
    return fn(_self, *args, **kwargs)
  File "/layers/google.python.pip/pip/lib/python3.10/site-packages/shotstack_sdk/model_utils.py", line 370, in _new_from_openapi_data
    return cls._from_openapi_data(*args, **kwargs)
  File "/layers/google.python.pip/pip/lib/python3.10/site-packages/shotstack_sdk/model_utils.py", line 46, in wrapped_init
    return fn(_self, *args, **kwargs)
  File "/layers/google.python.pip/pip/lib/python3.10/site-packages/shotstack_sdk/model/track.py", line 174, in _from_openapi_data
    self.clips = clips
  File "/layers/google.python.pip/pip/lib/python3.10/site-packages/shotstack_sdk/model_utils.py", line 185, in __setattr__
    self[attr] = value
  File "/layers/google.python.pip/pip/lib/python3.10/site-packages/shotstack_sdk/model_utils.py", line 510, in __setitem__
    self.set_attribute(name, value)
  File "/layers/google.python.pip/pip/lib/python3.10/site-packages/shotstack_sdk/model_utils.py", line 157, in set_attribute
    value = validate_and_convert_types(
  File "/layers/google.python.pip/pip/lib/python3.10/site-packages/shotstack_sdk/model_utils.py", line 1620, in validate_and_convert_types
    input_value[index] = validate_and_convert_types(
  File "/layers/google.python.pip/pip/lib/python3.10/site-packages/shotstack_sdk/model_utils.py", line 1570, in validate_and_convert_types
    converted_instance = attempt_convert_item(
  File "/layers/google.python.pip/pip/lib/python3.10/site-packages/shotstack_sdk/model_utils.py", line 1454, in attempt_convert_item
    return deserialize_model(input_value, valid_class,
  File "/layers/google.python.pip/pip/lib/python3.10/site-packages/shotstack_sdk/model_utils.py", line 1374, in deserialize_model
    return model_class._new_from_openapi_data(**kw_args)
  File "/layers/google.python.pip/pip/lib/python3.10/site-packages/shotstack_sdk/model_utils.py", line 46, in wrapped_init
    return fn(_self, *args, **kwargs)
  File "/layers/google.python.pip/pip/lib/python3.10/site-packages/shotstack_sdk/model_utils.py", line 370, in _new_from_openapi_data
    return cls._from_openapi_data(*args, **kwargs)
  File "/layers/google.python.pip/pip/lib/python3.10/site-packages/shotstack_sdk/model_utils.py", line 46, in wrapped_init
    return fn(_self, *args, **kwargs)
  File "/layers/google.python.pip/pip/lib/python3.10/site-packages/shotstack_sdk/model/clip.py", line 260, in _from_openapi_data
    self.asset = asset
  File "/layers/google.python.pip/pip/lib/python3.10/site-packages/shotstack_sdk/model_utils.py", line 185, in __setattr__
    self[attr] = value
  File "/layers/google.python.pip/pip/lib/python3.10/site-packages/shotstack_sdk/model_utils.py", line 510, in __setitem__
    self.set_attribute(name, value)
  File "/layers/google.python.pip/pip/lib/python3.10/site-packages/shotstack_sdk/model_utils.py", line 157, in set_attribute
    value = validate_and_convert_types(
  File "/layers/google.python.pip/pip/lib/python3.10/site-packages/shotstack_sdk/model_utils.py", line 1570, in validate_and_convert_types
    converted_instance = attempt_convert_item(
  File "/layers/google.python.pip/pip/lib/python3.10/site-packages/shotstack_sdk/model_utils.py", line 1454, in attempt_convert_item
    return deserialize_model(input_value, valid_class,
  File "/layers/google.python.pip/pip/lib/python3.10/site-packages/shotstack_sdk/model_utils.py", line 1374, in deserialize_model
    return model_class._new_from_openapi_data(**kw_args)
  File "/layers/google.python.pip/pip/lib/python3.10/site-packages/shotstack_sdk/model_utils.py", line 46, in wrapped_init
    return fn(_self, *args, **kwargs)
  File "/layers/google.python.pip/pip/lib/python3.10/site-packages/shotstack_sdk/model_utils.py", line 376, in _new_from_openapi_data
    discr_propertyname_js = cls.attribute_map[discr_propertyname_py]
KeyError: 'asset'
jeffski commented 3 months ago

Please try again, this should now be resolved with update #15 . Some custom updates got overwritten by the SDK generator but that should now also be fixed here: https://github.com/shotstack/oas-api-definition/commit/08c230e14ca6a8317ce8cf410a2d7d81c8b88c24

teleworker-andy commented 3 months ago

It works now. Thanks Jeff !!