@@ -372,29 +372,44 @@ class Provider:
372372 licensor, producer, processor or host.
373373 url : Optional homepage on which the provider describes the dataset
374374 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.
385378 """
386379
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+
387400 def __init__ (
388401 self ,
389402 name : str ,
390403 description : Optional [str ] = None ,
391404 roles : Optional [List [str ]] = None ,
392405 url : Optional [str ] = None ,
406+ extra_fields : Optional [Dict [str , Any ]] = None ,
393407 ):
394408 self .name = name
395409 self .description = description
396410 self .roles = roles
397411 self .url = url
412+ self .extra_fields = extra_fields or {}
398413
399414 def to_dict (self ) -> Dict [str , Any ]:
400415 """Generate a dictionary representing the JSON of this Provider.
@@ -410,20 +425,29 @@ def to_dict(self) -> Dict[str, Any]:
410425 if self .url is not None :
411426 d ["url" ] = self .url
412427
428+ d .update (self .extra_fields )
429+
413430 return d
414431
415432 @staticmethod
416433 def from_dict (d : Dict [str , Any ]) -> "Provider" :
417434 """Constructs an Provider from a dict.
418435
419436 Returns:
420- TemporalExtent : The Provider deserialized from the JSON dict.
437+ Provider : The Provider deserialized from the JSON dict.
421438 """
422439 return Provider (
423440 name = d ["name" ],
424441 description = d .get ("description" ),
425- roles = d .get ("roles" ),
442+ roles = d .get (
443+ "roles" ,
444+ ),
426445 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+ },
427451 )
428452
429453
0 commit comments