Developer Interface¶
This documentation covers the public interfaces fpdc_client provides.
Note
Documented interfaces follow Semantic Versioning 2.0.0. Any interface not documented here may change at any time without warning.
API entry point¶
This module is where client code can import objects.
Base classes¶
This module contains the base classes that will be built upon to access API endpoints.
-
class
fpdc_client.base.
FPDC
(url='https://fpdc.fedoraproject.org/')[source]¶ Main class handling the connection to an FPDC server.
-
app_id
¶ str – The OpenID Connect application name. You may change it by subclassing or right after instanciation. It needs to be a valid linux filename, without slashes.
Parameters: url (str, optional) – The URL of the FPDC server. -
-
class
fpdc_client.base.
APIObject
(data, server=None)[source]¶ Base class for REST endpoints.
This class behaves like a dictionary: the endpoint’s attributes are available as items. One exception though, if you modify an attribute, you have to call the
save()
method to commit those changes to the server.-
api_endpoint
¶ str – the name of the REST API endpoint (e.g.: “release”). It must be implemented by sub-classes.
-
api_id
¶ str – the endpoint’s property to use as the unique identifier (e.g.: “release_id”). It must be implemented by sub-classes.
Parameters: Raises: NotImplementedError
– raised ifapi_endpoint
orapi_id
have not been implemented and are stillNone
.-
classmethod
all
(server=None)[source]¶ Retrieve all instances of this endpoint from the server.
Parameters: server ( FPDC
, optional) – FPDC server, defaults to the last FPDC server that was connected to.Yields: APIObject
– the next instance of this endpoint available on the server.
-
classmethod
create
(data, server=None)[source]¶ Create an instance of this endpoint on the server.
Parameters: Returns: The newly created instance.
Return type:
-