@@ -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 ]:
@@ -94,24 +104,34 @@ class ProcessListingResponse(list):
94
104
but now also provides methods/properties to access additional response data.
95
105
96
106
:param response_data: response data from a ``GET /processes`` request
107
+ :param connection: optional connection object to use for federation extension
97
108
98
109
.. seealso:: :py:meth:`openeo.rest.connection.Connection.list_processes()`
99
110
100
111
.. versionadded:: 0.38.0
101
112
"""
102
113
103
- __slots__ = ["_data" ]
114
+ __slots__ = ["_data" , "_connection" ]
104
115
105
- def __init__ (self , response_data : dict ):
116
+ def __init__ (self , response_data : dict , connection = None ):
106
117
self ._data = response_data
118
+ self ._connection = connection
107
119
# Mimic original list of process metadata dictionaries
108
120
super ().__init__ (response_data ["processes" ])
109
121
110
122
self .ext_federation_missing (auto_warn = True )
111
123
112
124
def _repr_html_ (self ):
125
+ federation = self ._connection .capabilities ().ext_federation_backend_details () if self ._connection else None
113
126
return render_component (
114
- component = "processes" , data = self , parameters = {"show-graph" : True , "provide-download" : False }
127
+ component = "processes" ,
128
+ data = self ,
129
+ parameters = {
130
+ "show-graph" : True ,
131
+ "provide-download" : False ,
132
+ "missing" : self .ext_federation_missing (),
133
+ "federation" : federation ,
134
+ }
115
135
)
116
136
117
137
@property
@@ -148,23 +168,34 @@ class JobListingResponse(list):
148
168
but now also provides methods/properties to access additional response data.
149
169
150
170
:param response_data: response data from a ``GET /jobs`` request
171
+ :param connection: optional connection object to use for federation extension
151
172
152
173
.. seealso:: :py:meth:`openeo.rest.connection.Connection.list_jobs()`
153
174
154
175
.. versionadded:: 0.38.0
155
176
"""
156
177
157
- __slots__ = ["_data" ]
178
+ __slots__ = ["_data" , "_connection" ]
158
179
159
- def __init__ (self , response_data : dict ):
180
+ def __init__ (self , response_data : dict , connection = None ):
160
181
self ._data = response_data
182
+ self ._connection = connection
161
183
# Mimic original list of process metadata dictionaries
162
184
super ().__init__ (response_data ["jobs" ])
163
185
164
186
self .ext_federation_missing (auto_warn = True )
165
187
166
188
def _repr_html_ (self ):
167
- return render_component (component = "data-table" , data = self , parameters = {"columns" : "jobs" })
189
+ federation = self ._connection .capabilities ().ext_federation_backend_details () if self ._connection else None
190
+ return render_component (
191
+ component = "data-table" ,
192
+ data = self ,
193
+ parameters = {
194
+ "columns" : "jobs" ,
195
+ "missing" : self .ext_federation_missing (),
196
+ "federation" : federation ,
197
+ }
198
+ )
168
199
169
200
@property
170
201
def links (self ) -> List [Link ]:
0 commit comments