@@ -372,29 +372,44 @@ class Provider:
372
372
licensor, producer, processor or host.
373
373
url : Optional homepage on which the provider describes the dataset
374
374
and publishes contact information.
375
-
376
- Attributes:
377
- name : The name of the organization or the individual.
378
- description : Optional multi-line description to add further provider
379
- information such as processing details for processors and producers,
380
- hosting details for hosts or basic contact information.
381
- roles : Optional roles of the provider. Any of
382
- licensor, producer, processor or host.
383
- url : Optional homepage on which the provider describes the dataset
384
- and publishes contact information.
375
+ extra_fields : Optional dictionary containing additional top-level fields
376
+ defined on the Provider object.
377
+ object.
385
378
"""
386
379
380
+ name : str
381
+ """The name of the organization or the individual."""
382
+
383
+ description : Optional [str ]
384
+ """Optional multi-line description to add further provider
385
+ information such as processing details for processors and producers,
386
+ hosting details for hosts or basic contact information."""
387
+
388
+ roles : Optional [List [str ]]
389
+ """Optional roles of the provider. Any of
390
+ licensor, producer, processor or host."""
391
+
392
+ url : Optional [str ]
393
+ """Optional homepage on which the provider describes the dataset
394
+ and publishes contact information."""
395
+
396
+ extra_fields : Dict [str , Any ]
397
+ """Dictionary containing additional top-level fields defined on the Provider
398
+ object."""
399
+
387
400
def __init__ (
388
401
self ,
389
402
name : str ,
390
403
description : Optional [str ] = None ,
391
404
roles : Optional [List [str ]] = None ,
392
405
url : Optional [str ] = None ,
406
+ extra_fields : Optional [Dict [str , Any ]] = None ,
393
407
):
394
408
self .name = name
395
409
self .description = description
396
410
self .roles = roles
397
411
self .url = url
412
+ self .extra_fields = extra_fields or {}
398
413
399
414
def to_dict (self ) -> Dict [str , Any ]:
400
415
"""Generate a dictionary representing the JSON of this Provider.
@@ -410,20 +425,29 @@ def to_dict(self) -> Dict[str, Any]:
410
425
if self .url is not None :
411
426
d ["url" ] = self .url
412
427
428
+ d .update (self .extra_fields )
429
+
413
430
return d
414
431
415
432
@staticmethod
416
433
def from_dict (d : Dict [str , Any ]) -> "Provider" :
417
434
"""Constructs an Provider from a dict.
418
435
419
436
Returns:
420
- TemporalExtent : The Provider deserialized from the JSON dict.
437
+ Provider : The Provider deserialized from the JSON dict.
421
438
"""
422
439
return Provider (
423
440
name = d ["name" ],
424
441
description = d .get ("description" ),
425
- roles = d .get ("roles" ),
442
+ roles = d .get (
443
+ "roles" ,
444
+ ),
426
445
url = d .get ("url" ),
446
+ extra_fields = {
447
+ k : v
448
+ for k , v in d .items ()
449
+ if k not in {"name" , "description" , "roles" , "url" }
450
+ },
427
451
)
428
452
429
453
0 commit comments