@@ -46,27 +46,33 @@ class Link:
46
46
properties : Optional, additional properties for this link. This is used
47
47
by extensions as a way to serialize and deserialize properties on link
48
48
object JSON.
49
-
50
- Attributes:
51
- rel : The relation of the link (e.g. 'child', 'item'). Registered rel Types
52
- are preferred. See :class:`~pystac.RelType` for common media types.
53
- target : The target of the link. If the link is
54
- unresolved, or the link is to something that is not a STACObject,
55
- the target is an HREF. If resolved, the target is a STACObject.
56
- media_type : Optional description of the media type.
57
- Registered Media Types are preferred. See
58
- :class:`~pystac.MediaType` for common media types.
59
- title : Optional title for this link.
60
- properties : Optional, additional properties for this link.
61
- This is used by extensions as a way to serialize and deserialize properties
62
- on link object JSON.
63
- owner : The owner of this link. The link will use
64
- its owner's root catalog
65
- :class:`~pystac.resolved_object_cache.ResolvedObjectCache` to resolve
66
- objects, and will create absolute HREFs from relative HREFs against
67
- the owner's self HREF.
68
49
"""
69
50
51
+ rel : Union [str , pystac .RelType ]
52
+ """The relation of the link (e.g. 'child', 'item'). Registered rel Types are
53
+ preferred. See :class:`~pystac.RelType` for common media types."""
54
+
55
+ target : Union [str , "STACObject_Type" ]
56
+ """The target of the link. If the link is unresolved, or the link is to something
57
+ that is not a STACObject, the target is an HREF. If resolved, the target is a
58
+ STACObject."""
59
+
60
+ media_type : Optional [str ]
61
+ """Optional description of the media type. Registered Media Types are preferred.
62
+ See :class:`~pystac.MediaType` for common media types."""
63
+
64
+ title : Optional [str ]
65
+ """Optional title for this link."""
66
+
67
+ properties : Optional [Dict [str , Any ]]
68
+ """Optional, additional properties for this link. This is used by extensions as a
69
+ way to serialize and deserialize properties on link object JSON."""
70
+
71
+ owner : Optional ["STACObject_Type" ]
72
+ """The owner of this link. The link will use its owner's root catalog
73
+ :class:`~pystac.resolved_object_cache.ResolvedObjectCache` to resolve objects, and
74
+ will create absolute HREFs from relative HREFs against the owner's self HREF."""
75
+
70
76
def __init__ (
71
77
self ,
72
78
rel : Union [str , pystac .RelType ],
@@ -76,11 +82,11 @@ def __init__(
76
82
properties : Optional [Dict [str , Any ]] = None ,
77
83
) -> None :
78
84
self .rel = rel
79
- self .target : Union [ str , "STACObject_Type" ] = target # An object or an href
85
+ self .target = target
80
86
self .media_type = media_type
81
87
self .title = title
82
88
self .properties = properties
83
- self .owner : Optional [ "STACObject_Type" ] = None
89
+ self .owner = None
84
90
85
91
def set_owner (self , owner : Optional ["STACObject_Type" ]) -> "Link" :
86
92
"""Sets the owner of this link.
0 commit comments