File tree 2 files changed +14
-4
lines changed 2 files changed +14
-4
lines changed Original file line number Diff line number Diff line change @@ -713,7 +713,7 @@ def list_collections(self) -> CollectionListingResponse:
713
713
# TODO: add caching #383, but reset cache on auth change #254
714
714
# TODO #677 add pagination support?
715
715
data = self .get ("/collections" , expected_status = 200 ).json ()
716
- return CollectionListingResponse (response_data = data )
716
+ return CollectionListingResponse (response_data = data , connection = self )
717
717
718
718
def list_collection_ids (self ) -> List [str ]:
719
719
"""
Original file line number Diff line number Diff line change @@ -43,23 +43,33 @@ class CollectionListingResponse(list):
43
43
but now also provides methods/properties to access additional response data.
44
44
45
45
:param response_data: response data from a ``GET /collections`` request
46
+ :param connection: optional connection object to use for federation extension
46
47
47
48
.. seealso:: :py:meth:`openeo.rest.connection.Connection.list_collections()`
48
49
49
50
.. versionadded:: 0.38.0
50
51
"""
51
52
52
- __slots__ = ["_data" ]
53
+ __slots__ = ["_data" , '_connection' ]
53
54
54
- def __init__ (self , response_data : dict ):
55
+ def __init__ (self , response_data : dict , connection = None ):
55
56
self ._data = response_data
57
+ self ._connection = connection
56
58
# Mimic original list of collection metadata dictionaries
57
59
super ().__init__ (response_data ["collections" ])
58
60
59
61
self .ext_federation_missing (auto_warn = True )
60
62
61
63
def _repr_html_ (self ):
62
- return render_component (component = "collections" , data = self )
64
+ federation = self ._connection .capabilities ().ext_federation_backend_details () if self ._connection else None
65
+ return render_component (
66
+ component = "collections" ,
67
+ data = self ,
68
+ parameters = {
69
+ "missing" : self .ext_federation_missing (),
70
+ "federation" : federation ,
71
+ }
72
+ )
63
73
64
74
@property
65
75
def links (self ) -> List [Link ]:
You can’t perform that action at this time.
0 commit comments