diff --git a/CHANGELOG.rst b/CHANGELOG.rst
index 1cc9b3e..aca4e55 100644
--- a/CHANGELOG.rst
+++ b/CHANGELOG.rst
@@ -1,3 +1,14 @@
+**2023-12-28: Version 5.2.0:**
+
+* Expanded use of type hints in place of ``:rtype`` Sphinx directive
+* Remove unused dependency ``deprecation``
+* Fix bug: path ``/tags/{id}/{entity_type}`` breaks entity wrapping logic (`issue #130 2023-12-28: Version 5.2.0: Expanded use of type hints in place of Remove unused dependency Fix bug: path 2023-11-15: Version 5.1.3: Remove deprecated escape sequences, which were causing downstream linter/unit test errors, from docstrings Remove references to removed properties from the module reference that were causing Sphinx warnings 2023-09-12: Version 5.1.2: Address issue #115 by adding default values to API Key property getter. Returns the _api_key attribute’s value. Generates the header with the API credential used for authentication. Modify the user-supplied parameters. Modify the user-supplied parameters to ease implementation Current behavior: If a parameter’s value is of type list, and the parameter name does
@@ -122,11 +122,16 @@ The query parameters after modification Compose the URL whether it is a path or an already-complete URL Append special additional per-request headers. The final list of headers to use in the request Printing debug flag If set to True, the logging level of Make a generic PagerDuty API request. Randomizing factor for wait times between retries during rate limiting. If set to number greater than 0, the sleep time for rate limiting will
(for each successive sleep) be adjusted by a factor of one plus a
@@ -283,7 +288,7 @@ Truncated key for secure display/identification purposes. PagerDuty REST API v2 session object class. Implements the most generic and oft-implemented aspects of PagerDuty’s REST
API v2 as an opinionated wrapper of requests.Session. Memoized API key access type getter. Will be “user” if the API key is a user-level token (all users should
have permission to create an API key with the same permissions as they
@@ -336,7 +341,7 @@ Defines the method of API authentication. By default this is “token”; if “oauth2”, the API key will be used. Returns a dictionary of all objects from a given index endpoint. Dictionary representation of resource collection results With the exception of Finds an object of a given resource type exactly matching a query. Returns a dict if a result is found. The structure will be that of an
-entry in the index endpoint schema’s array of results. Otherwise, it
-will return Works by querying a given resource index endpoint using the dict The dictionary representation of the result, if found; Iterator for the contents of an index endpoint or query. Automatically paginates and yields the results in each page, until all
matching results have been yielded or a HTTP error response is received. Iterator for results from an endpoint using cursor-based pagination. Returns a list of all objects from a given index endpoint. All keyword arguments passed to this function are also passed directly
to Dictionary representation of the object. dict Dictionary representation of the requested object Dictionary representation of the created object dict Dictionary representation of the updated object dict Subdomain of the PagerDuty account of the API access token. The total number of API calls made by this instance. Truncated token for secure display/identification purposes.Changelog¶
+
+
+:rtype
Sphinx directivedeprecation
/tags/{id}/{entity_type}
breaks entity wrapping logic (issue #130)
+
pdpyras.PDSession.retry
for Events and Change Events API client classesAPI Client Classes
@@ -113,8 +113,8 @@ API Client Classes
API Client Classes
+
@@ -157,7 +162,7 @@ API Client Classes
API Client ClassesReturns:
+
@@ -249,7 +254,7 @@ log
is set to
logging.DEBUG
and all log messages are emitted to sys.stderr
.
@@ -185,7 +193,7 @@ API Client Classes
API Client Classes
API Client Classes
API Client Classes
API Client Classes
API Client Classes
API Client Classes
by
, all keyword arguments passed to this
method are also passed to iter_all
; see the documentation on
that method for further details.API Client Classes
None
if no result is found or an error is encountered.query
parameter. To use this function on any given resource, the resource’s
index must support the query
parameter; otherwise, the function may
@@ -402,15 +404,16 @@ API Client ClassesReturn type:
-
None
will
+be returned if there is no exact match result.
@@ -597,9 +597,6 @@ API Client Classes
API Client Classes
iter_all
; see the documentation on that method for details.API Client ClassesReturns:
-
API Client ClassesReturns:
API Client ClassesReturns:
API Client Classes
@@ -674,36 +668,42 @@ API Client Classes
PDSession
.
Acknowledge an alert via Events API.
dedup_key – The deduplication key of the alert to set to the acknowledged state.
The deduplication key
+Override of requests.Session.post
Adds the routing_key
parameter to the body before sending.
Add user agent and content type headers for Events API requests.
user_headers – User-supplied headers that will override defaults
The final list of headers to use in the request
+Resolve an alert via Events API.
Send an event to the v2 Events API.
See: https://v2.developer.pagerduty.com/docs/send-an-event-events-api-v2
The deduplication key of the incident, if any.
+The deduplication key of the incident
Trigger an incident
str
+The deduplication key of the incident, if any.
Session class for submitting change events to the PagerDuty v2 Change Events API.
+Session class for submitting events to the PagerDuty v2 Change Events API.
Implements methods for submitting change events to PagerDuty’s change events API. See the Change Events API documentation for more details.
Inherits from PDSession
.
Add user agent and content type headers for Change Events API requests.
+user_headers – User-supplied headers that will override defaults
+The final list of headers to use in the request
+Submit an incident change
str
+The response ID
Returns the canonical REST API path corresponding to a URL.
+pdpyras.canonical_path(base_url: str, url: str) str¶ +The canonical path from the API documentation corresponding to a URL
This is used to identify and classify URLs according to which particular API within REST API v2 it belongs to.
Explicitly supported canonical paths are defined in the list @@ -985,16 +993,16 @@
str
+The canonical REST API v2 path corresponding to a URL.
Returns true if a method and path match an endpoint pattern.
+pdpyras.endpoint_matches(endpoint_pattern: str, method: str, path: str) bool¶ +Whether an endpoint (method and canonical path) matches a given pattern
This is the filtering logic used for finding the appropriate entry in
ENTITY_WRAPPER_CONFIG
to use for a given method and API path.
canonical_path()
)
boolean
+True or False based on whether the pattern matches the endpoint
Returns true if a given node in a canonical path represents a parameter.
+pdpyras.is_path_param(path_node: str) bool¶ +Whether a part of a canonical path represents a variable parameter
path_node – The node (value between slashes) in the path
bool
+True if the node is an arbitrary variable, False if it is a fixed value
Normalize a URL to a complete API URL.
The url
argument may be a path relative to the base URL or a full URL.
The full API endpoint URL
str
-Obtains entity wrapping information for a given endpoint (path and method)
-Returns a 2-tuple. The first element is the wrapper name that should be used
-for the request body, and the second is the wrapper name to be used for the
-response body. For either elements, if None
is returned, that signals to
-disable wrapping and pass the user-supplied request body or API response
-body object unmodified.
tuple
+A 2-tuple. The first element is the wrapper name that should be used for
+the request body, and the second is the wrapper name to be used for the
+response body. For either elements, if None
is returned, that
+signals to disable wrapping and pass the user-supplied request body or
+API response body object unmodified.
Infer the entity wrapper name from the endpoint using orthodox patterns.
This is based on patterns that are broadly applicable but not universal in the v2 REST API, where the wrapper name is predictable from the path and @@ -1091,16 +1095,13 @@
str
-Unwraps and returns a wrapped entity.
+pdpyras.unwrap(response: Response, wrapper) Union[dict, list]¶ +Unwraps a wrapped entity.
The value associated with the wrapper key in the JSON-decoded body of +the response, which is expected to be a dictionary (map).
+Formats a message describing a HTTP error.
The message to include in the HTTP error
+Returns an abbreviation of the input
+pdpyras.last_4(secret: str) str¶ +Truncate a sensitive value to its last 4 characters
+secret – text to truncate
+The truncated text
+Pluralizes a name, i.e. the API name from the type
property
The name of the resource, i.e. the last part of the URL for the resource’s index URL
str
-Truncates a string longer than TEXT_LEN_LIMIT
JSON-decode a response body
Returns the decoded body if successful; raises PDServerError
otherwise.