{{!

  Copyright (c) Meta Platforms, Inc. and affiliates.

  Licensed under the Apache License, Version 2.0 (the "License");
  you may not use this file except in compliance with the License.
  You may obtain a copy of the License at

      http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.

}}{{!

Included in places where a Python object exists and it's underlying C++
representation is required. For most primitives, the conversion can be
done automatically, but for strings, structures, and containers, more
work is required.

By convention, the template assumes that the Python object is in a variable
named item, for use in sets, lists, and map values. If you need to use a map
key, include the parallel CythonPythonToCppKey file instead.

}}{{#type:iobuf?}}{{!
  }}deref((<_fbthrift_iobuf.IOBuf?>item).c_clone()){{!
}}{{/type:iobuf?}}{{!
}}{{#type:iobufRef?}}{{!
  }}(<_fbthrift_iobuf.IOBuf?>item).c_clone(){{!
}}{{/type:iobufRef?}}{{!
}}{{#type:flexibleBinary?}}{{!
  }}{{> types/cython_cpp_type}}(cmove(<string>item)){{!
}}{{/type:flexibleBinary?}}{{!
}}{{^type:hasCustomTypeBehavior?}}{{!
}}{{#type:bool?}}item{{/type:bool?}}{{!
}}{{#type:byte?}}item{{/type:byte?}}{{!
}}{{#type:i16?}}item{{/type:i16?}}{{!
}}{{#type:i32?}}item{{/type:i32?}}{{!
}}{{#type:i64?}}item{{/type:i64?}}{{!
}}{{#type:double?}}item{{/type:double?}}{{!
}}{{#type:float?}}item{{/type:float?}}{{!
}}{{#type:string?}}item.encode('UTF-8'){{/type:string?}}{{!
}}{{#type:binary?}}item{{/type:binary?}}{{!
}}{{#type:struct}}{{!
  }}deref((<{{> types/cython_python_type}}>item).{{> types/cpp_obj}}){{!
}}{{/type:struct}}{{!
}}{{#type:container?}}{{^type:list?}}{{!
  }}deref((<{{> types/cython_python_type}}>item).{{> types/cpp_obj}}){{!
}}{{/type:list?}}{{/type:container?}}{{!
}}{{#type:list?}}{{> types/container_to_cpp }}(item){{/type:list?}}{{!
}}{{#type:enum?}}<{{> types/cython_cpp_type}}><int>item{{/type:enum?}}{{!
}}{{/type:hasCustomTypeBehavior?}}
