Skip to content

Commit

Permalink
Add documentation to get_auth_data
Browse files Browse the repository at this point in the history
  • Loading branch information
AvlWx2014 committed Oct 5, 2021
1 parent 58fbe74 commit e3298ff
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions fastpurge/_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,23 @@ def purge_by_cpcode(self, cpcodes, **kwargs):


def get_auth_dict(value):
"""Get :class:`akamai.edgegrid.EdgeGridAuth` authentication data.
Parameters:
value (dict or str): If ``value`` is a :py:class:`dict`,
then a shallow copy of that dict is returned. Otherwise,
``value`` must be a string representing a filesystem path
to an .edgerc configuration file.
Returns:
dict: a dictionary representing the authentication data needed by
the :class:`akamai.edgegrid.EdgeGridAuth` API.
Raises:
TypeError: if ``value`` is not a :py:class:`dict` or :py:class:`str`.
FastPurgeError: if ``value`` represents a path to an .edgerc
configuration file and that path does not exist.
"""
if isinstance(value, dict):
# shallow copy the auth dict if provided
# to avoid conflicting in-place updates (e.g. pop())
Expand Down

0 comments on commit e3298ff

Please sign in to comment.