2023-07-07 19:22:51 -07:00
from typing import Any , Dict , List , Type , TypeVar , Union
import attr
from . . models . storage import Storage
from . . models . system import System
from . . types import UNSET , Unset
2023-08-17 14:30:53 -07:00
OU = TypeVar ( " OU " , bound = " gltf " )
2023-07-07 19:22:51 -07:00
@attr.s ( auto_attribs = True )
2023-08-16 16:31:50 -07:00
class gltf :
2023-07-07 19:22:51 -07:00
""" glTF 2.0. We refer to this as glTF since that is how our customers refer to it, although by default it will be in binary format and thus technically (glb). If you prefer ascii output, you can set that option for the export. """ # noqa: E501
storage : Union [ Unset , Storage ] = UNSET
2023-08-16 16:31:50 -07:00
type : str = " gltf "
2023-07-07 19:22:51 -07:00
additional_properties : Dict [ str , Any ] = attr . ib ( init = False , factory = dict )
def to_dict ( self ) - > Dict [ str , Any ] :
if not isinstance ( self . storage , Unset ) :
storage = self . storage
type = self . type
field_dict : Dict [ str , Any ] = { }
field_dict . update ( self . additional_properties )
field_dict . update ( { } )
if storage is not UNSET :
field_dict [ " storage " ] = storage
2023-08-16 16:31:50 -07:00
field_dict [ " type " ] = type
2023-07-07 19:22:51 -07:00
return field_dict
@classmethod
2023-08-17 14:30:53 -07:00
def from_dict ( cls : Type [ OU ] , src_dict : Dict [ str , Any ] ) - > OU :
2023-07-07 19:22:51 -07:00
d = src_dict . copy ( )
_storage = d . pop ( " storage " , UNSET )
storage : Union [ Unset , Storage ]
if isinstance ( _storage , Unset ) :
storage = UNSET
else :
storage = _storage # type: ignore[arg-type]
type = d . pop ( " type " , UNSET )
gltf = cls (
storage = storage ,
type = type ,
)
gltf . additional_properties = d
return gltf
@property
def additional_keys ( self ) - > List [ str ] :
return list ( self . additional_properties . keys ( ) )
def __getitem__ ( self , key : str ) - > Any :
return self . additional_properties [ key ]
def __setitem__ ( self , key : str , value : Any ) - > None :
self . additional_properties [ key ] = value
def __delitem__ ( self , key : str ) - > None :
del self . additional_properties [ key ]
def __contains__ ( self , key : str ) - > bool :
return key in self . additional_properties
2023-08-17 14:30:53 -07:00
KL = TypeVar ( " KL " , bound = " obj " )
2023-07-07 19:22:51 -07:00
@attr.s ( auto_attribs = True )
2023-08-16 16:31:50 -07:00
class obj :
2023-07-07 19:22:51 -07:00
""" Wavefront OBJ format. """ # noqa: E501
coords : Union [ Unset , System ] = UNSET
2023-08-16 16:31:50 -07:00
type : str = " obj "
2023-07-07 19:22:51 -07:00
additional_properties : Dict [ str , Any ] = attr . ib ( init = False , factory = dict )
def to_dict ( self ) - > Dict [ str , Any ] :
if not isinstance ( self . coords , Unset ) :
coords = self . coords
type = self . type
field_dict : Dict [ str , Any ] = { }
field_dict . update ( self . additional_properties )
field_dict . update ( { } )
if coords is not UNSET :
field_dict [ " coords " ] = coords
2023-08-16 16:31:50 -07:00
field_dict [ " type " ] = type
2023-07-07 19:22:51 -07:00
return field_dict
@classmethod
2023-08-17 14:30:53 -07:00
def from_dict ( cls : Type [ KL ] , src_dict : Dict [ str , Any ] ) - > KL :
2023-07-07 19:22:51 -07:00
d = src_dict . copy ( )
_coords = d . pop ( " coords " , UNSET )
coords : Union [ Unset , System ]
if isinstance ( _coords , Unset ) :
coords = UNSET
else :
2023-07-31 12:50:30 -07:00
coords = _coords # type: ignore[arg-type]
2023-07-07 19:22:51 -07:00
type = d . pop ( " type " , UNSET )
obj = cls (
coords = coords ,
type = type ,
)
obj . additional_properties = d
return obj
@property
def additional_keys ( self ) - > List [ str ] :
return list ( self . additional_properties . keys ( ) )
def __getitem__ ( self , key : str ) - > Any :
return self . additional_properties [ key ]
def __setitem__ ( self , key : str , value : Any ) - > None :
self . additional_properties [ key ] = value
def __delitem__ ( self , key : str ) - > None :
del self . additional_properties [ key ]
def __contains__ ( self , key : str ) - > bool :
return key in self . additional_properties
2023-08-17 14:30:53 -07:00
XI = TypeVar ( " XI " , bound = " ply " )
2023-07-31 12:50:30 -07:00
@attr.s ( auto_attribs = True )
2023-08-16 16:31:50 -07:00
class ply :
2023-07-31 12:50:30 -07:00
""" The PLY Polygon File Format. """ # noqa: E501
coords : Union [ Unset , System ] = UNSET
storage : Union [ Unset , Storage ] = UNSET
2023-08-16 16:31:50 -07:00
type : str = " ply "
2023-07-31 12:50:30 -07:00
additional_properties : Dict [ str , Any ] = attr . ib ( init = False , factory = dict )
def to_dict ( self ) - > Dict [ str , Any ] :
if not isinstance ( self . coords , Unset ) :
coords = self . coords
if not isinstance ( self . storage , Unset ) :
storage = self . storage
type = self . type
field_dict : Dict [ str , Any ] = { }
field_dict . update ( self . additional_properties )
field_dict . update ( { } )
if coords is not UNSET :
field_dict [ " coords " ] = coords
if storage is not UNSET :
field_dict [ " storage " ] = storage
2023-08-16 16:31:50 -07:00
field_dict [ " type " ] = type
2023-07-31 12:50:30 -07:00
return field_dict
@classmethod
2023-08-17 14:30:53 -07:00
def from_dict ( cls : Type [ XI ] , src_dict : Dict [ str , Any ] ) - > XI :
2023-07-31 12:50:30 -07:00
d = src_dict . copy ( )
_coords = d . pop ( " coords " , UNSET )
coords : Union [ Unset , System ]
if isinstance ( _coords , Unset ) :
coords = UNSET
else :
coords = _coords # type: ignore[arg-type]
_storage = d . pop ( " storage " , UNSET )
storage : Union [ Unset , Storage ]
if isinstance ( _storage , Unset ) :
storage = UNSET
else :
storage = _storage # type: ignore[arg-type]
type = d . pop ( " type " , UNSET )
ply = cls (
coords = coords ,
storage = storage ,
type = type ,
)
ply . additional_properties = d
return ply
@property
def additional_keys ( self ) - > List [ str ] :
return list ( self . additional_properties . keys ( ) )
def __getitem__ ( self , key : str ) - > Any :
return self . additional_properties [ key ]
def __setitem__ ( self , key : str , value : Any ) - > None :
self . additional_properties [ key ] = value
def __delitem__ ( self , key : str ) - > None :
del self . additional_properties [ key ]
def __contains__ ( self , key : str ) - > bool :
return key in self . additional_properties
2023-08-17 14:30:53 -07:00
PO = TypeVar ( " PO " , bound = " step " )
2023-07-07 19:22:51 -07:00
@attr.s ( auto_attribs = True )
2023-08-16 16:31:50 -07:00
class step :
2023-07-07 19:22:51 -07:00
""" ISO 10303-21 (STEP) format. """ # noqa: E501
coords : Union [ Unset , System ] = UNSET
2023-08-16 16:31:50 -07:00
type : str = " step "
2023-07-07 19:22:51 -07:00
additional_properties : Dict [ str , Any ] = attr . ib ( init = False , factory = dict )
def to_dict ( self ) - > Dict [ str , Any ] :
if not isinstance ( self . coords , Unset ) :
coords = self . coords
type = self . type
field_dict : Dict [ str , Any ] = { }
field_dict . update ( self . additional_properties )
field_dict . update ( { } )
if coords is not UNSET :
field_dict [ " coords " ] = coords
2023-08-16 16:31:50 -07:00
field_dict [ " type " ] = type
2023-07-07 19:22:51 -07:00
return field_dict
@classmethod
2023-08-17 14:30:53 -07:00
def from_dict ( cls : Type [ PO ] , src_dict : Dict [ str , Any ] ) - > PO :
2023-07-07 19:22:51 -07:00
d = src_dict . copy ( )
_coords = d . pop ( " coords " , UNSET )
coords : Union [ Unset , System ]
if isinstance ( _coords , Unset ) :
coords = UNSET
else :
2023-07-31 12:50:30 -07:00
coords = _coords # type: ignore[arg-type]
2023-07-07 19:22:51 -07:00
type = d . pop ( " type " , UNSET )
step = cls (
coords = coords ,
type = type ,
)
step . additional_properties = d
return step
@property
def additional_keys ( self ) - > List [ str ] :
return list ( self . additional_properties . keys ( ) )
def __getitem__ ( self , key : str ) - > Any :
return self . additional_properties [ key ]
def __setitem__ ( self , key : str , value : Any ) - > None :
self . additional_properties [ key ] = value
def __delitem__ ( self , key : str ) - > None :
del self . additional_properties [ key ]
def __contains__ ( self , key : str ) - > bool :
return key in self . additional_properties
2023-08-17 14:30:53 -07:00
PS = TypeVar ( " PS " , bound = " stl " )
2023-07-07 19:22:51 -07:00
@attr.s ( auto_attribs = True )
2023-08-16 16:31:50 -07:00
class stl :
2023-07-07 19:22:51 -07:00
""" *ST**ereo**L**ithography format. """ # noqa: E501
coords : Union [ Unset , System ] = UNSET
storage : Union [ Unset , Storage ] = UNSET
2023-08-16 16:31:50 -07:00
type : str = " stl "
2023-07-07 19:22:51 -07:00
additional_properties : Dict [ str , Any ] = attr . ib ( init = False , factory = dict )
def to_dict ( self ) - > Dict [ str , Any ] :
if not isinstance ( self . coords , Unset ) :
coords = self . coords
if not isinstance ( self . storage , Unset ) :
storage = self . storage
type = self . type
field_dict : Dict [ str , Any ] = { }
field_dict . update ( self . additional_properties )
field_dict . update ( { } )
if coords is not UNSET :
field_dict [ " coords " ] = coords
if storage is not UNSET :
field_dict [ " storage " ] = storage
2023-08-16 16:31:50 -07:00
field_dict [ " type " ] = type
2023-07-07 19:22:51 -07:00
return field_dict
@classmethod
2023-08-17 14:30:53 -07:00
def from_dict ( cls : Type [ PS ] , src_dict : Dict [ str , Any ] ) - > PS :
2023-07-07 19:22:51 -07:00
d = src_dict . copy ( )
_coords = d . pop ( " coords " , UNSET )
coords : Union [ Unset , System ]
if isinstance ( _coords , Unset ) :
coords = UNSET
else :
2023-07-31 12:50:30 -07:00
coords = _coords # type: ignore[arg-type]
2023-07-07 19:22:51 -07:00
_storage = d . pop ( " storage " , UNSET )
storage : Union [ Unset , Storage ]
if isinstance ( _storage , Unset ) :
storage = UNSET
else :
storage = _storage # type: ignore[arg-type]
type = d . pop ( " type " , UNSET )
stl = cls (
coords = coords ,
storage = storage ,
type = type ,
)
stl . additional_properties = d
return stl
@property
def additional_keys ( self ) - > List [ str ] :
return list ( self . additional_properties . keys ( ) )
def __getitem__ ( self , key : str ) - > Any :
return self . additional_properties [ key ]
def __setitem__ ( self , key : str , value : Any ) - > None :
self . additional_properties [ key ] = value
def __delitem__ ( self , key : str ) - > None :
del self . additional_properties [ key ]
def __contains__ ( self , key : str ) - > bool :
return key in self . additional_properties
2023-08-16 16:31:50 -07:00
OutputFormat = Union [ gltf , obj , ply , step , stl ]