7
7
import pystac
8
8
from pystac .extensions .base import ExtensionManagementMixin
9
9
from pystac .extensions .hooks import ExtensionHooks
10
- from pystac .item_assets import (
11
- ItemAssetDefinition as AssetDefinition ,
12
- )
10
+ from pystac .item_assets import ItemAssetDefinition
13
11
from pystac .serialization .identify import STACJSONDescription , STACVersionID
14
12
from pystac .utils import get_required
15
13
21
19
ITEM_ASSETS_PROP = "item_assets"
22
20
23
21
22
+ class AssetDefinition (ItemAssetDefinition ):
23
+ def __init__ (cls , * args : Any , ** kwargs : Any ) -> None :
24
+ # TODO: deprecation warning in here.
25
+ super ().__init__ (* args , ** kwargs )
26
+
27
+
24
28
class ItemAssetsExtension (ExtensionManagementMixin [pystac .Collection ]):
25
29
name : Literal ["item_assets" ] = "item_assets"
26
30
collection : pystac .Collection
@@ -29,16 +33,16 @@ def __init__(self, collection: pystac.Collection) -> None:
29
33
self .collection = collection
30
34
31
35
@property
32
- def item_assets (self ) -> dict [str , AssetDefinition ]:
36
+ def item_assets (self ) -> dict [str , ItemAssetDefinition ]:
33
37
"""Gets or sets a dictionary of assets that can be found in member Items. Maps
34
38
the asset key to an :class:`AssetDefinition` instance."""
35
39
result : dict [str , Any ] = get_required (
36
40
self .collection .extra_fields .get (ITEM_ASSETS_PROP ), self , ITEM_ASSETS_PROP
37
41
)
38
- return {k : AssetDefinition (v , self .collection ) for k , v in result .items ()}
42
+ return {k : ItemAssetDefinition (v , self .collection ) for k , v in result .items ()}
39
43
40
44
@item_assets .setter
41
- def item_assets (self , v : dict [str , AssetDefinition ]) -> None :
45
+ def item_assets (self , v : dict [str , ItemAssetDefinition ]) -> None :
42
46
self .collection .extra_fields [ITEM_ASSETS_PROP ] = {
43
47
k : asset_def .properties for k , asset_def in v .items ()
44
48
}
0 commit comments