diff --git a/CHANGELOG.rst b/CHANGELOG.rst index cba640e..617af56 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -1,3 +1,20 @@ +**2025-05-19: Bug fixes for iter_cursor and HTTP 204 response handling** + +* Allow ``try_decoding`` to return ``None`` for empty input; fixes GitHub issue #46. +* Non-breaking changes to ``RestApiV2Client.iter_cursor``, to fix GitHub issue #45: + + - It now uses the ``default_page_size`` client setting as the ``limit`` parameter. + - It accepts a ``page_size`` parameter that can override said default (and ``params`` can also override this default), similar to ``iter_all``. + - When called indirectly via ``iter_all``, the ``item_hook`` keyword argument is passed through to it, along with ``page_size``. + +**2025-05-14: Bug fix - Version 2.1.1** + +* The "main" method in the entry script is expected to receive no arguments, but in v2.1.0, it requires one positional argument. + +**2025-05-13: Command line interface - Version 2.1.0** + +* Add a basic command line interface for Events API v2, for feature parity with the legacy library that is used in the `Monit Integration Guide `_. + **2025-04-08: Multi-file refactor - Version 2.0.0** This release introduces major structural changes to the module and how it is built and tested. These changes were made for long-term maintainability of the codebase. Previously, it was all contained within a monolithic ``.py`` file (with a single Python script for all unit tests); now it is organized into smaller, appropriately-named Python files. diff --git a/Makefile b/Makefile index 065d3bc..45ceedd 100644 --- a/Makefile +++ b/Makefile @@ -3,7 +3,7 @@ build: pagerduty/* pyproject.toml rm -f dist/* && python3 -m build -docs/index.html: pagerduty/* README.rst CHANGELOG.rst sphinx/source/* +docs/index.html: build pyproject.toml pagerduty/* CHANGELOG.rst sphinx/source/* rm -fr ./docs && cd sphinx && make html && cd .. && mv sphinx/build/html ./docs && touch ./docs/.nojekyll docs: docs/index.html pagerduty/__pycache__ diff --git a/README.rst b/README.rst index 0cd752a..990590b 100644 --- a/README.rst +++ b/README.rst @@ -16,8 +16,8 @@ This library is available on the Python Package Index as `pagerduty - Changelog — python-pagerduty 2.1.0 documentation + Changelog — python-pagerduty 2.1.2 documentation - + @@ -76,6 +76,27 @@

Changelog

+

2025-05-19: Bug fixes for iter_cursor and HTTP 204 response handling

+
    +
  • Allow try_decoding to return None for empty input; fixes GitHub issue #46.

  • +
  • Non-breaking changes to RestApiV2Client.iter_cursor, to fix GitHub issue #45:

    +
    +
      +
    • It now uses the default_page_size client setting as the limit parameter.

    • +
    • It accepts a page_size parameter that can override said default (and params can also override this default), similar to iter_all.

    • +
    • When called indirectly via iter_all, the item_hook keyword argument is passed through to it, along with page_size.

    • +
    +
    +
  • +
+

2025-05-14: Bug fix - Version 2.1.1

+
    +
  • The “main” method in the entry script is expected to receive no arguments, but in v2.1.0, it requires one positional argument.

  • +
+

2025-05-13: Command line interface - Version 2.1.0

+
    +
  • Add a basic command line interface for Events API v2, for feature parity with the legacy library that is used in the Monit Integration Guide.

  • +

2025-04-08: Multi-file refactor - Version 2.0.0

This release introduces major structural changes to the module and how it is built and tested. These changes were made for long-term maintainability of the codebase. Previously, it was all contained within a monolithic .py file (with a single Python script for all unit tests); now it is organized into smaller, appropriately-named Python files.

Some lesser changes are also included:

diff --git a/docs/contributing.html b/docs/contributing.html index ef58181..ba5d823 100644 --- a/docs/contributing.html +++ b/docs/contributing.html @@ -6,14 +6,14 @@ - Contribution Guide — python-pagerduty 2.1.0 documentation + Contribution Guide — python-pagerduty 2.1.2 documentation - + diff --git a/docs/genindex.html b/docs/genindex.html index 24be32c..4d0209c 100644 --- a/docs/genindex.html +++ b/docs/genindex.html @@ -5,14 +5,14 @@ - Index — python-pagerduty 2.1.0 documentation + Index — python-pagerduty 2.1.2 documentation - + diff --git a/docs/index.html b/docs/index.html index af52d45..a2e7d0c 100644 --- a/docs/index.html +++ b/docs/index.html @@ -6,14 +6,14 @@ - python-pagerduty: Clients for PagerDuty’s APIs — python-pagerduty 2.1.0 documentation + python-pagerduty: Clients for PagerDuty’s APIs — python-pagerduty 2.1.2 documentation - + diff --git a/docs/module_reference.html b/docs/module_reference.html index c6619b6..9fc7302 100644 --- a/docs/module_reference.html +++ b/docs/module_reference.html @@ -6,14 +6,14 @@ - Module Reference — python-pagerduty 2.1.0 documentation + Module Reference — python-pagerduty 2.1.2 documentation - + @@ -615,7 +615,7 @@

API Client Classes
-iter_cursor(url, params=None, item_hook=None) Iterator[dict]
+iter_cursor(url, params=None, item_hook=None, page_size=None) Iterator[dict]

Iterator for results from an endpoint using cursor-based pagination.

Parameters:
@@ -624,6 +624,8 @@

API Client Classesiter_all for details on how this argument is used.

+
  • page_size – Number of results per page of results (the limit parameter). If +unspecified, default_page_size will be used.

  • diff --git a/docs/objects.inv b/docs/objects.inv index 602b5a9..624444b 100644 Binary files a/docs/objects.inv and b/docs/objects.inv differ diff --git a/docs/pdpyras_migration_guide.html b/docs/pdpyras_migration_guide.html index ceab428..e1ae83a 100644 --- a/docs/pdpyras_migration_guide.html +++ b/docs/pdpyras_migration_guide.html @@ -6,14 +6,14 @@ - PDPYRAS Migration Guide — python-pagerduty 2.1.0 documentation + PDPYRAS Migration Guide — python-pagerduty 2.1.2 documentation - + diff --git a/docs/py-modindex.html b/docs/py-modindex.html index bf1eac3..ee5016e 100644 --- a/docs/py-modindex.html +++ b/docs/py-modindex.html @@ -5,14 +5,14 @@ - Python Module Index — python-pagerduty 2.1.0 documentation + Python Module Index — python-pagerduty 2.1.2 documentation - + diff --git a/docs/search.html b/docs/search.html index b820c75..f50d9a1 100644 --- a/docs/search.html +++ b/docs/search.html @@ -5,7 +5,7 @@ - Search — python-pagerduty 2.1.0 documentation + Search — python-pagerduty 2.1.2 documentation @@ -13,7 +13,7 @@ - + diff --git a/docs/searchindex.js b/docs/searchindex.js index 7453462..50b8492 100644 --- a/docs/searchindex.js +++ b/docs/searchindex.js @@ -1 +1 @@ -Search.setIndex({"alltitles":{"API Client Classes":[[3,"api-client-classes"]],"Adding Support for Non-Conforming Endpoints":[[1,"adding-support-for-non-conforming-endpoints"]],"Authentication":[[5,"authentication"]],"Basic Usage Examples":[[5,"basic-usage-examples"]],"Changelog":[[0,null]],"Client Classes":[[4,"client-classes"]],"Client Defaults":[[3,"client-defaults"]],"Command Line Interface":[[5,"command-line-interface"]],"Configuring Retry Behavior":[[5,"configuring-retry-behavior"]],"Contribution Guide":[[1,null]],"Data types":[[5,"data-types"]],"Default Behavior":[[5,"default-behavior"]],"Entity Wrapping":[[3,"entity-wrapping"],[5,"entity-wrapping"]],"Error Handling":[[5,"error-handling"]],"Errors":[[3,"errors"]],"Evaluating New Endpoints For Support":[[1,"evaluating-new-endpoints-for-support"]],"Events API v2":[[5,"events-api-v2"]],"Examples":[[5,"examples"]],"Exception Classes":[[4,"exception-classes"]],"Exponential Cooldown":[[5,"exponential-cooldown"]],"External Resources":[[2,"external-resources"]],"Function Decorators":[[3,"function-decorators"]],"Functions":[[3,"functions"]],"Generic Client Features":[[5,"generic-client-features"]],"HTTP Retry Configuration":[[5,"http-retry-configuration"]],"Helpers":[[3,"helpers"]],"Identifying Wrapped-entity Endpoints":[[5,"identifying-wrapped-entity-endpoints"]],"Initial Setup":[[1,"initial-setup"]],"Installation":[[5,"installation"]],"Introduction":[[1,"introduction"]],"Limitations":[[1,"limitations"]],"Logging":[[5,"logging"]],"Maintaining Entity Wrapper Configuration":[[1,"maintaining-entity-wrapper-configuration"]],"Merge changes and tag":[[1,"merge-changes-and-tag"]],"Module Reference":[[3,null]],"Multi-updating":[[5,"multi-updating"]],"PDPYRAS Migration Guide":[[4,null]],"Pagination":[[5,"pagination"]],"Perform end-to-end publish and installation testing":[[1,"perform-end-to-end-publish-and-installation-testing"]],"Performance and Completeness of Results":[[5,"performance-and-completeness-of-results"]],"Publishing":[[1,"publishing"]],"Query Parameters":[[5,"query-parameters"]],"REST API v2":[[5,"rest-api-v2"]],"Releasing a New Version":[[1,"releasing-a-new-version"]],"Requests and Responses":[[5,"requests-and-responses"]],"Resource Schemas":[[5,"resource-schemas"]],"Special Cases":[[5,"special-cases"]],"Table of Contents":[[2,"table-of-contents"]],"The From header":[[5,"the-from-header"]],"URL Handling":[[3,"url-handling"]],"URLs":[[5,"urls"]],"Updating Documentation":[[1,"updating-documentation"]],"Updating the Canonical Path Set":[[1,"updating-the-canonical-path-set"]],"Updating, creating or deleting while paginating":[[5,"updating-creating-or-deleting-while-paginating"]],"User Guide":[[5,null]],"Using Non-US Service Regions":[[5,"using-non-us-service-regions"]],"Using a Proxy Server":[[5,"using-a-proxy-server"]],"Wrapped-entity-aware Functions":[[5,"wrapped-entity-aware-functions"]],"python-pagerduty: Clients for PagerDuty\u2019s APIs":[[2,null]]},"docnames":["changelog","contributing","index","module_reference","pdpyras_migration_guide","user_guide"],"envversion":{"sphinx":65,"sphinx.domains.c":3,"sphinx.domains.changeset":1,"sphinx.domains.citation":1,"sphinx.domains.cpp":9,"sphinx.domains.index":1,"sphinx.domains.javascript":3,"sphinx.domains.math":2,"sphinx.domains.python":4,"sphinx.domains.rst":2,"sphinx.domains.std":2,"sphinx.ext.intersphinx":1,"sphinx.ext.todo":2},"filenames":["changelog.rst","contributing.rst","index.rst","module_reference.rst","pdpyras_migration_guide.rst","user_guide.rst"],"indexentries":{"acknowledge() (pagerduty.eventsapiv2client method)":[[3,"pagerduty.EventsApiV2Client.acknowledge",false]],"after_set_api_key() (pagerduty.apiclient method)":[[3,"pagerduty.ApiClient.after_set_api_key",false]],"api_call_counts (pagerduty.restapiv2client attribute)":[[3,"pagerduty.RestApiV2Client.api_call_counts",false]],"api_key (pagerduty.apiclient property)":[[3,"pagerduty.ApiClient.api_key",false]],"api_key_access (pagerduty.restapiv2client property)":[[3,"pagerduty.RestApiV2Client.api_key_access",false]],"api_time (pagerduty.restapiv2client attribute)":[[3,"pagerduty.RestApiV2Client.api_time",false]],"apiclient (class in pagerduty)":[[3,"pagerduty.ApiClient",false]],"auth_header (pagerduty.apiclient property)":[[3,"pagerduty.ApiClient.auth_header",false]],"auth_type (pagerduty.restapiv2client property)":[[3,"pagerduty.RestApiV2Client.auth_type",false]],"auto_json() (in module pagerduty)":[[3,"pagerduty.auto_json",false]],"canonical_path() (in module pagerduty)":[[3,"pagerduty.canonical_path",false]],"canonical_paths (in module pagerduty.rest_api_v2_client)":[[3,"pagerduty.rest_api_v2_client.CANONICAL_PATHS",false]],"cursor_based_pagination_paths (in module pagerduty.rest_api_v2_client)":[[3,"pagerduty.rest_api_v2_client.CURSOR_BASED_PAGINATION_PATHS",false]],"default_from (pagerduty.restapiv2client attribute)":[[3,"pagerduty.RestApiV2Client.default_from",false]],"default_page_size (pagerduty.restapiv2client attribute)":[[3,"pagerduty.RestApiV2Client.default_page_size",false]],"deprecated_kwarg() (in module pagerduty)":[[3,"pagerduty.deprecated_kwarg",false]],"dict_all() (pagerduty.restapiv2client method)":[[3,"pagerduty.RestApiV2Client.dict_all",false]],"endpoint_matches() (in module pagerduty)":[[3,"pagerduty.endpoint_matches",false]],"entity_wrapper_config (in module pagerduty.rest_api_v2_client)":[[3,"pagerduty.rest_api_v2_client.ENTITY_WRAPPER_CONFIG",false]],"entity_wrappers() (in module pagerduty)":[[3,"pagerduty.entity_wrappers",false]],"error (class in pagerduty)":[[3,"pagerduty.Error",false]],"eventsapiv2client (class in pagerduty)":[[3,"pagerduty.EventsApiV2Client",false]],"find() (pagerduty.restapiv2client method)":[[3,"pagerduty.RestApiV2Client.find",false]],"http_error_message() (in module pagerduty)":[[3,"pagerduty.http_error_message",false]],"httperror (class in pagerduty)":[[3,"pagerduty.HttpError",false]],"infer_entity_wrapper() (in module pagerduty)":[[3,"pagerduty.infer_entity_wrapper",false]],"is_path_param() (in module pagerduty)":[[3,"pagerduty.is_path_param",false]],"iter_all() (pagerduty.restapiv2client method)":[[3,"pagerduty.RestApiV2Client.iter_all",false]],"iter_cursor() (pagerduty.restapiv2client method)":[[3,"pagerduty.RestApiV2Client.iter_cursor",false]],"iteration_limit (in module pagerduty.rest_api_v2_client)":[[3,"pagerduty.rest_api_v2_client.ITERATION_LIMIT",false]],"jget() (pagerduty.restapiv2client method)":[[3,"pagerduty.RestApiV2Client.jget",false]],"jpost() (pagerduty.restapiv2client method)":[[3,"pagerduty.RestApiV2Client.jpost",false]],"jput() (pagerduty.restapiv2client method)":[[3,"pagerduty.RestApiV2Client.jput",false]],"last_4() (in module pagerduty)":[[3,"pagerduty.last_4",false]],"list_all() (pagerduty.restapiv2client method)":[[3,"pagerduty.RestApiV2Client.list_all",false]],"log (pagerduty.apiclient attribute)":[[3,"pagerduty.ApiClient.log",false]],"max_http_attempts (pagerduty.apiclient attribute)":[[3,"pagerduty.ApiClient.max_http_attempts",false]],"max_network_attempts (pagerduty.apiclient attribute)":[[3,"pagerduty.ApiClient.max_network_attempts",false]],"module":[[3,"module-0",false],[3,"module-1",false],[3,"module-2",false],[3,"module-pagerduty",false],[3,"module-pagerduty.api_client",false],[3,"module-pagerduty.common",false],[3,"module-pagerduty.rest_api_v2_client",false]],"normalize_params() (pagerduty.apiclient method)":[[3,"pagerduty.ApiClient.normalize_params",false]],"normalize_url() (in module pagerduty)":[[3,"pagerduty.normalize_url",false]],"normalize_url() (pagerduty.apiclient method)":[[3,"pagerduty.ApiClient.normalize_url",false]],"pagerduty":[[3,"module-0",false],[3,"module-1",false],[3,"module-2",false],[3,"module-pagerduty",false]],"pagerduty.api_client":[[3,"module-pagerduty.api_client",false]],"pagerduty.common":[[3,"module-pagerduty.common",false]],"pagerduty.rest_api_v2_client":[[3,"module-pagerduty.rest_api_v2_client",false]],"parent (pagerduty.apiclient attribute)":[[3,"pagerduty.ApiClient.parent",false]],"permitted_methods (pagerduty.apiclient attribute)":[[3,"pagerduty.ApiClient.permitted_methods",false]],"persist() (pagerduty.restapiv2client method)":[[3,"pagerduty.RestApiV2Client.persist",false]],"plural_name() (in module pagerduty)":[[3,"pagerduty.plural_name",false]],"post() (pagerduty.eventsapiv2client method)":[[3,"pagerduty.EventsApiV2Client.post",false]],"postprocess() (pagerduty.apiclient method)":[[3,"pagerduty.ApiClient.postprocess",false]],"postprocess() (pagerduty.restapiv2client method)":[[3,"pagerduty.RestApiV2Client.postprocess",false]],"prepare_headers() (pagerduty.apiclient method)":[[3,"pagerduty.ApiClient.prepare_headers",false]],"prepare_headers() (pagerduty.eventsapiv2client method)":[[3,"pagerduty.EventsApiV2Client.prepare_headers",false]],"print_debug (pagerduty.apiclient property)":[[3,"pagerduty.ApiClient.print_debug",false]],"rdelete() (pagerduty.restapiv2client method)":[[3,"pagerduty.RestApiV2Client.rdelete",false]],"request() (pagerduty.apiclient method)":[[3,"pagerduty.ApiClient.request",false]],"requires_success() (in module pagerduty)":[[3,"pagerduty.requires_success",false]],"resolve() (pagerduty.eventsapiv2client method)":[[3,"pagerduty.EventsApiV2Client.resolve",false]],"resource_url() (in module pagerduty)":[[3,"pagerduty.resource_url",false]],"response (pagerduty.error attribute)":[[3,"pagerduty.Error.response",false]],"restapiv2client (class in pagerduty)":[[3,"pagerduty.RestApiV2Client",false]],"retry (pagerduty.apiclient attribute)":[[3,"pagerduty.ApiClient.retry",false]],"rget() (pagerduty.restapiv2client method)":[[3,"pagerduty.RestApiV2Client.rget",false]],"rpatch() (pagerduty.restapiv2client method)":[[3,"pagerduty.RestApiV2Client.rpatch",false]],"rpost() (pagerduty.restapiv2client method)":[[3,"pagerduty.RestApiV2Client.rpost",false]],"rput() (pagerduty.restapiv2client method)":[[3,"pagerduty.RestApiV2Client.rput",false]],"send_change_event() (pagerduty.eventsapiv2client method)":[[3,"pagerduty.EventsApiV2Client.send_change_event",false]],"send_event() (pagerduty.eventsapiv2client method)":[[3,"pagerduty.EventsApiV2Client.send_event",false]],"serverhttperror (class in pagerduty)":[[3,"pagerduty.ServerHttpError",false]],"sleep_timer (pagerduty.apiclient attribute)":[[3,"pagerduty.ApiClient.sleep_timer",false]],"sleep_timer_base (pagerduty.apiclient attribute)":[[3,"pagerduty.ApiClient.sleep_timer_base",false]],"stagger_cooldown (pagerduty.apiclient property)":[[3,"pagerduty.ApiClient.stagger_cooldown",false]],"subdomain (pagerduty.restapiv2client property)":[[3,"pagerduty.RestApiV2Client.subdomain",false]],"submit() (pagerduty.eventsapiv2client method)":[[3,"pagerduty.EventsApiV2Client.submit",false]],"successful_response() (in module pagerduty)":[[3,"pagerduty.successful_response",false]],"text_len_limit (in module pagerduty.common)":[[3,"pagerduty.common.TEXT_LEN_LIMIT",false]],"timeout (in module pagerduty.api_client)":[[3,"pagerduty.api_client.TIMEOUT",false]],"timeout (pagerduty.apiclient attribute)":[[3,"pagerduty.ApiClient.timeout",false]],"total_call_count (pagerduty.restapiv2client property)":[[3,"pagerduty.RestApiV2Client.total_call_count",false]],"total_call_time (pagerduty.restapiv2client property)":[[3,"pagerduty.RestApiV2Client.total_call_time",false]],"trigger() (pagerduty.eventsapiv2client method)":[[3,"pagerduty.EventsApiV2Client.trigger",false]],"trunc_key (pagerduty.apiclient property)":[[3,"pagerduty.ApiClient.trunc_key",false]],"trunc_token (pagerduty.restapiv2client property)":[[3,"pagerduty.RestApiV2Client.trunc_token",false]],"truncate_text() (in module pagerduty)":[[3,"pagerduty.truncate_text",false]],"try_decoding() (in module pagerduty)":[[3,"pagerduty.try_decoding",false]],"unwrap() (in module pagerduty)":[[3,"pagerduty.unwrap",false]],"url (pagerduty.restapiv2client attribute)":[[3,"pagerduty.RestApiV2Client.url",false]],"urlerror (class in pagerduty)":[[3,"pagerduty.UrlError",false]],"wrapped_entities() (in module pagerduty)":[[3,"pagerduty.wrapped_entities",false]]},"objects":{"":[[3,0,0,"module-2","pagerduty"]],"pagerduty":[[3,1,1,"","ApiClient"],[3,1,1,"","Error"],[3,1,1,"","EventsApiV2Client"],[3,1,1,"","HttpError"],[3,1,1,"","RestApiV2Client"],[3,1,1,"","ServerHttpError"],[3,1,1,"","UrlError"],[3,0,0,"-","api_client"],[3,6,1,"","auto_json"],[3,6,1,"","canonical_path"],[3,0,0,"-","common"],[3,6,1,"","deprecated_kwarg"],[3,6,1,"","endpoint_matches"],[3,6,1,"","entity_wrappers"],[3,6,1,"","http_error_message"],[3,6,1,"","infer_entity_wrapper"],[3,6,1,"","is_path_param"],[3,6,1,"","last_4"],[3,6,1,"","normalize_url"],[3,6,1,"","plural_name"],[3,6,1,"","requires_success"],[3,6,1,"","resource_url"],[3,0,0,"-","rest_api_v2_client"],[3,6,1,"","successful_response"],[3,6,1,"","truncate_text"],[3,6,1,"","try_decoding"],[3,6,1,"","unwrap"],[3,6,1,"","wrapped_entities"]],"pagerduty.ApiClient":[[3,2,1,"","after_set_api_key"],[3,3,1,"","api_key"],[3,3,1,"","auth_header"],[3,4,1,"","log"],[3,4,1,"","max_http_attempts"],[3,4,1,"","max_network_attempts"],[3,2,1,"","normalize_params"],[3,2,1,"","normalize_url"],[3,4,1,"","parent"],[3,4,1,"","permitted_methods"],[3,2,1,"","postprocess"],[3,2,1,"","prepare_headers"],[3,3,1,"","print_debug"],[3,2,1,"","request"],[3,4,1,"","retry"],[3,4,1,"","sleep_timer"],[3,4,1,"","sleep_timer_base"],[3,3,1,"","stagger_cooldown"],[3,4,1,"","timeout"],[3,3,1,"","trunc_key"]],"pagerduty.Error":[[3,4,1,"","response"]],"pagerduty.EventsApiV2Client":[[3,2,1,"","acknowledge"],[3,2,1,"","post"],[3,2,1,"","prepare_headers"],[3,2,1,"","resolve"],[3,2,1,"","send_change_event"],[3,2,1,"","send_event"],[3,2,1,"","submit"],[3,2,1,"","trigger"]],"pagerduty.RestApiV2Client":[[3,4,1,"","api_call_counts"],[3,3,1,"","api_key_access"],[3,4,1,"","api_time"],[3,3,1,"","auth_type"],[3,4,1,"","default_from"],[3,4,1,"","default_page_size"],[3,2,1,"","dict_all"],[3,2,1,"","find"],[3,2,1,"","iter_all"],[3,2,1,"","iter_cursor"],[3,2,1,"","jget"],[3,2,1,"","jpost"],[3,2,1,"","jput"],[3,2,1,"","list_all"],[3,2,1,"","persist"],[3,2,1,"","postprocess"],[3,2,1,"","rdelete"],[3,2,1,"","rget"],[3,2,1,"","rpatch"],[3,2,1,"","rpost"],[3,2,1,"","rput"],[3,3,1,"","subdomain"],[3,3,1,"","total_call_count"],[3,3,1,"","total_call_time"],[3,3,1,"","trunc_token"],[3,4,1,"","url"]],"pagerduty.api_client":[[3,5,1,"","TIMEOUT"]],"pagerduty.common":[[3,5,1,"","TEXT_LEN_LIMIT"]],"pagerduty.rest_api_v2_client":[[3,5,1,"","CANONICAL_PATHS"],[3,5,1,"","CURSOR_BASED_PAGINATION_PATHS"],[3,5,1,"","ENTITY_WRAPPER_CONFIG"],[3,5,1,"","ITERATION_LIMIT"]]},"objnames":{"0":["py","module","Python module"],"1":["py","class","Python class"],"2":["py","method","Python method"],"3":["py","property","Python property"],"4":["py","attribute","Python attribute"],"5":["py","data","Python data"],"6":["py","function","Python function"]},"objtypes":{"0":"py:module","1":"py:class","2":"py:method","3":"py:property","4":"py:attribute","5":"py:data","6":"py:function"},"terms":{"":[1,3,4,5],"0":[0,1,3,4,5],"00":5,"01":[0,5],"01t00":5,"02":0,"02t00":5,"03t00":5,"04":[0,5],"07":5,"08":0,"1":[0,1,3,4,5],"10":[3,5],"100":[3,5],"10000":3,"101st":5,"11":1,"13":1,"16":5,"187":5,"2":[0,1,3,5],"201":5,"201st":5,"2023":5,"2024":5,"2025":[0,5],"2xx":5,"3":[0,1,3,5],"30":5,"4":[3,5],"400":[3,5],"401":[3,5],"4012":5,"404":5,"42":5,"429":[3,5],"4xx":3,"5":[1,3,5],"50":5,"500":5,"5b":5,"5d":5,"5xx":[3,5],"6":5,"60":3,"601":5,"62":5,"700":5,"8":[0,5],"82":5,"A":[1,3],"As":[1,5],"At":5,"By":[3,5],"For":[2,3,5],"If":[1,3,5],"In":[0,1,3,4,5],"It":[1,3,5],"Its":5,"On":5,"One":5,"That":5,"The":[0,1,2,3,4],"Then":1,"There":[1,3,5],"These":[0,3],"To":[1,3,5],"Will":3,"With":3,"__token__":1,"__version__":[0,1],"_test":1,"abc123":5,"abil":5,"abl":1,"about":[3,5],"abov":[1,3,5],"accept":[3,5],"access":[1,3,5],"accord":[1,3,5],"accordingli":5,"account":[1,3,5],"acknowledg":[3,5],"action":[3,5],"actual":[1,3],"ad":[2,3],"add":[1,3,5],"addit":[3,4,5],"address":[3,5],"adjust":3,"admin":5,"administr":[3,5],"advantag":3,"affect":[3,5],"after":[1,3,5],"after_set_api_kei":3,"again":1,"against":3,"agent":[0,3],"airflow":0,"alert":[0,3,5],"all":[0,1,3,4,5],"allow":[3,5],"along":1,"alreadi":[1,3,5],"also":[0,1,3,5],"alter":3,"although":5,"alwai":[0,1,3,5],"amount":3,"an":[1,3,5],"analog":5,"analogu":5,"ani":[1,3,5],"annotate_log_entri":5,"anoth":5,"antipattern":[1,3],"anyon":3,"ap":3,"apart":3,"api":[0,1,4],"api_call_count":3,"api_cli":3,"api_kei":[3,5],"api_key_access":[3,5],"api_tim":3,"apicli":[2,3,4,5],"apisess":4,"append":[3,5],"appli":[1,3],"applic":[1,3,5],"appropri":[0,1,3,5],"approv":1,"ar":[0,1,3,4,5],"arbitrari":3,"arg":3,"argument":[1,3,5],"around":[1,3],"arrai":[3,5],"articl":5,"asdf":1,"aspect":3,"assert":1,"assign":5,"associ":[3,5],"assum":[3,5],"attach":5,"attempt":[3,5],"attr":3,"attribut":[1,3,5],"auth_head":3,"auth_typ":[3,5],"authent":[2,3],"author":3,"auto":3,"auto_json":3,"autom":5,"automat":[1,3,5],"avail":[1,5],"avoid":[3,4],"awar":[2,3],"backend":3,"base":[1,3,5],"base_url":3,"basi":5,"basic":2,"bear":[3,5],"bearer":3,"becaus":[0,1,3,4,5],"becom":5,"been":[0,3,4],"befor":[1,3,5],"behavior":[2,3],"being":[1,3,5],"belong":3,"benefit":3,"between":[1,3,4,5],"bob":5,"bodi":[1,3,5],"bool":3,"both":[1,3,4,5],"bracket":[3,5],"branch":1,"break":0,"brief":[1,3],"broadli":3,"browser":1,"bug":[1,3],"build":[0,1,5],"built":[0,1],"bump":5,"busi":[1,5],"business_servic":[1,5],"c":1,"call":[3,5],"callabl":3,"can":[1,3,5],"cannot":[1,3],"canon":[2,3],"canonical_path":[1,2,3],"capit":3,"carri":5,"case":[1,2,3,4],"catch":[3,5],"categori":1,"caus":[0,3,5],"certain":5,"chang":[0,2,3,4,5],"changeeventsapisess":4,"changelog":[1,2],"charact":3,"check":[1,3],"checkout":1,"child":3,"choos":1,"circuit":3,"class":[0,1,2,5],"classic":[1,3,5],"classifi":3,"clean":1,"cleanli":3,"clear":4,"clearli":4,"cli":5,"client":[0,1],"client_oauth":5,"clone":1,"code":[1,3,4,5],"codebas":0,"codifi":1,"collect":[1,3,5],"collis":4,"com":[3,5],"combin":1,"command":[1,2,3],"commit":1,"common":3,"compar":3,"comparison":3,"complet":[2,3],"compon":[1,4],"compos":[1,3,5],"comput":3,"concurr":3,"condit":5,"confer":3,"configur":[2,3],"conform":2,"conjunct":3,"connect":3,"consequ":3,"consid":5,"consist":3,"constrain":3,"constraint":3,"construct":[3,5],"constructor":5,"contact":3,"contact_method":3,"contain":[0,3,5],"content":[3,5],"context":[3,5],"contribut":2,"convent":[1,3,5],"convert":5,"cooldown":[2,3],"copi":1,"correct":3,"correctli":1,"correspond":[1,3,5],"could":3,"count":[1,3,5],"cover":3,"coverag":1,"creat":[1,2,3],"created_overrid":5,"credenti":[1,3,5],"critic":3,"current":[3,5],"cursor":[1,3,5],"cursor_based_pagination_path":[1,2,3],"custom":[0,3,5],"custom_detail":3,"daili":5,"dan":5,"data":[2,3],"date":3,"dav":5,"dave":5,"david":5,"debug":[3,5],"decod":[3,5],"decor":2,"dedup_kei":[3,5],"dedupl":[3,5],"default":[0,2],"default_from":[3,5],"default_page_s":3,"defer":5,"defin":[3,5],"definit":1,"delai":3,"deleg":0,"delet":[1,2,3],"denot":3,"depend":1,"deprec":3,"deprecated_kwarg":3,"deprecated_nam":3,"depth":5,"deriv":5,"descend":[3,5],"describ":[1,3],"descript":[1,3,5],"design":[3,5],"desir":[1,5],"detail":[1,3,5],"determin":3,"dev001":1,"develop":[2,3],"deviat":1,"dict":[3,5],"dict_al":[3,5],"dictat":3,"dictionari":[1,3,5],"differ":[1,3,4,5],"directli":[3,5],"disabl":[3,5],"discard":[3,5],"discov":[0,1],"discret":5,"displai":[3,5],"distinct":[3,5],"distribut":3,"do":[1,5],"do_appl":5,"doc":[1,3],"docstr":0,"document":[2,3,5],"doe":[1,3,5],"doesn":[1,3,5],"don":1,"done":4,"download":3,"dure":3,"dusti":5,"e":[1,3,4,5],"each":[1,3,5],"earli":3,"eas":3,"easier":3,"edit":5,"effect":[3,4,5],"effici":5,"either":[3,5],"elabor":5,"element":3,"elimin":3,"els":[3,5],"email":[3,5],"emit":3,"enabl":[3,5],"encapsul":5,"encod":[3,5],"encount":[1,3,5],"end":[2,3,5],"endpoint":[2,3],"endpoint_match":3,"endpoint_pattern":3,"enforc":3,"engin":5,"enough":4,"ensur":1,"enter":1,"entiti":2,"entity_wrapp":3,"entity_wrapper_config":[1,2,3],"entri":[1,3,5],"environ":1,"ep":5,"equal":3,"equival":[4,5],"erron":5,"error":[1,2,4],"escal":5,"escalation_delay_in_minut":5,"escalation_polici":[1,3,5],"escalation_rul":5,"essenti":5,"etc":5,"eu":5,"evalu":2,"even":[1,3],"event":[0,2,3,4],"events_cli":5,"eventsapisess":4,"eventsapiv2cli":[0,2,3,4,5],"everi":3,"everyth":5,"exact":3,"exactli":[3,5],"exampl":[1,2,3],"example35":5,"exce":3,"except":[1,2,3,5],"exclud":3,"exist":[1,3,5],"exit":1,"expect":[0,3,5],"experienc":3,"explicit":3,"explicitli":3,"expon":5,"exponenti":2,"express":4,"extend":3,"extract":5,"factor":[3,5],"fail":3,"failur":[0,3],"fals":[3,5],"far":3,"featur":[0,1,2,3],"fetch":5,"few":[3,5],"field":[0,3],"file":[0,1],"fill":1,"filter":[3,5],"final":[1,3,5],"find":[3,5],"finish":5,"fire":5,"first":[1,3,4,5],"first_dan":5,"fix":[1,3],"flag":[3,5],"float":3,"follow":[1,3,4,5],"followup":3,"foo":5,"foo_servic":5,"forc":1,"form":[1,3],"format":[3,4],"former":4,"forward":[1,4],"found":[3,5],"four":5,"from":[0,1,2,3,4],"full":[3,5],"function":[1,2],"further":3,"g":[4,5],"ga":3,"gener":[1,2,3],"get":[1,3,5],"get_path_list":1,"getter":3,"git":1,"github":[1,2],"given":[1,3,5],"global":[1,3],"go":5,"good":1,"greater":3,"group":[0,5],"grow":1,"guarante":3,"guid":[0,2,3],"h":5,"ha":[0,1,3,4,5],"handl":[1,2],"handler":[3,5],"happen":[3,5],"hard":[1,5],"hash":1,"have":[0,1,3,4,5],"head":5,"header":[0,2,3],"help":[1,3],"helper":2,"helptext":5,"herd":3,"hierarchi":4,"high":5,"higher":5,"hoc":3,"hold":3,"hook":3,"host":5,"how":[0,3,5],"howev":[1,5],"href":3,"html":1,"http":[2,3],"http_error_messag":3,"httperror":[2,3,4,5],"httpservererror":5,"human":3,"hundr":5,"i":[0,1,3,4,5],"id":[1,3,5],"idea":1,"idempot":[3,5],"identif":3,"identifi":[1,2,3],"ignor":[3,5],"il":5,"imag":3,"immedi":[1,3,5],"implement":[1,3],"impli":3,"import":[0,1,4,5],"importlib":0,"incid":[0,1,3,5],"incident_refer":5,"incient":5,"includ":[0,1,3,4,5],"increas":[3,5],"index":[1,3,5],"indic":5,"individu":[1,3],"infer":[1,3],"infer_entity_wrapp":[1,3],"inform":3,"inherit":[3,5],"initi":[2,3,5],"input":[3,5],"insenit":3,"insensit":3,"insid":5,"instal":2,"instanc":[3,4,5],"instanti":5,"instead":[3,5],"int":3,"integr":[3,5],"integration_id":3,"intend":3,"interfac":2,"interpret":3,"interv":3,"introduc":0,"introduct":2,"introspect":0,"invalid":5,"investig":1,"invok":3,"involv":5,"is_path_param":3,"isn":3,"iso8601":3,"issu":[1,3,4,5],"item":3,"item_hook":3,"iter":[3,5],"iter_al":[3,5],"iter_cursor":[3,5],"iteration_limit":[2,3],"its":[3,5],"itself":[1,3,5],"j":5,"jane":5,"jget":[3,5],"jpost":3,"jput":3,"json":[3,5],"just":3,"k":[3,5],"keep":[3,5],"kei":[1,3,5],"keyword":[3,5],"knowabl":3,"kw":3,"kwarg":3,"lack":5,"lambda":5,"larg":5,"last":[1,3],"last_4":3,"latenc":5,"later":1,"latest":[1,5],"latter":4,"lead":5,"least":1,"leav":3,"left":5,"length":3,"lesser":0,"let":5,"level":[3,5],"librari":[1,5],"like":[1,5],"limit":[2,3,5],"line":[2,3],"link":3,"list":[1,3,5],"list_al":[3,5],"live":1,"local":1,"log":[2,3],"log_entri":5,"logger":[3,5],"logic":[1,3,5],"login":5,"long":0,"longer":[1,3,5],"longest":3,"look":[1,4,5],"lookup":1,"loop":5,"low":5,"lower":[3,5],"lowercas":3,"m":1,"made":[0,3,4,5],"mai":[1,3,5],"main":[1,5],"maintain":[0,2],"major":[0,1],"make":[1,3,4,5],"malform":[3,5],"manag":5,"mani":3,"manual":[1,5],"map":3,"marshal":3,"match":[3,5],"max_http_attempt":[3,5],"max_network_attempt":[3,5],"maximum":[3,5],"mcuserson":5,"member":3,"memoiz":3,"menu":5,"merg":[2,3,4],"messag":[1,3,5],"metadata":[0,1,3,5],"method":[0,1,3,4,5],"migrat":[0,2],"mind":5,"minim":1,"minor":1,"miscellan":3,"mitig":1,"modif":3,"modifi":[3,5],"modul":[0,2,4,5],"monolith":0,"more":[1,3,4,5],"moreov":5,"most":[1,3,5],"mostli":3,"much":3,"multi":[0,2],"multipl":5,"must":[1,3,5],"n":[3,5],"name":[0,1,3,4,5],"necessari":5,"need":[1,3,5],"net":5,"network":[3,5],"new":[0,2,3,5],"new_rul":5,"next":[1,5],"next_cursor":5,"node":[1,3],"nomenclatur":4,"non":[2,3],"none":[0,1,3,5],"nonzero":[3,5],"normal":[3,5],"normalize_param":3,"normalize_url":3,"note":[1,3,4,5],"notebook":5,"notset":[3,5],"noun":1,"now":0,"number":[0,1,3,5],"numer":[3,5],"oauth":[0,3],"oauth2":[3,5],"oauth_token":5,"obj_typ":3,"object":[3,5],"obtain":[3,5],"offset":[3,5],"oft":3,"ok":5,"old":5,"omit":3,"onc":[1,3,5],"one":[1,3,5],"onli":[3,5],"opaqu":1,"open":[1,5],"oper":5,"opinion":3,"opposit":5,"option":3,"orchestr":0,"order":[1,3,4],"org":1,"organ":0,"origin":[1,4,5],"orthodox":[1,3],"other":[3,5],"otherwis":[1,3,5],"out":[1,5],"output":[3,5],"outsid":5,"over":5,"overal":[3,5],"overlap":4,"overrid":[1,3,5],"own":[1,3],"p":1,"pabc123":[3,5],"packag":[0,1,5],"page":[0,2,3,5],"page_s":3,"pagerduti":[0,1,3,4,5],"pagin":[1,2,3],"pagint":3,"pair":[3,5],"pam4fg":5,"param":[3,5],"paramet":[2,3],"parent":[3,5],"part":3,"partial":5,"particular":[3,5],"pass":[3,5],"password":1,"patch":[1,3],"path":[2,3,5],"path_nod":3,"pattern":[1,3,4],"paus":5,"payload":3,"pdclienterror":4,"pdef456":5,"pdhttperror":4,"pdpyra":[0,1,2],"pdservererror":4,"pdsession":4,"per":[3,5],"perform":[2,3],"period":5,"permiss":3,"permit":3,"permitted_method":3,"persist":[3,5],"peysgva":5,"peysgvf":5,"pghi789":5,"phij789":5,"pi7dh85":5,"pip":[1,5],"pjkl678":5,"place":5,"placehold":1,"plain":5,"pleas":[1,3],"plu":[3,5],"plural":[1,3],"plural_nam":3,"pn1t34m":5,"pnoexst":5,"polici":5,"port":5,"portion":1,"posit":[3,5],"possibl":1,"post":[1,3,5],"postprocess":3,"potenti":3,"power":3,"pre":3,"preced":[3,5],"predict":3,"preexist":[1,3],"prefix":0,"prepare_head":3,"prepend":3,"presenc":5,"present":1,"prevent":3,"previou":3,"previous":0,"print":[1,3,5],"print_debug":[3,5],"prior":[0,5],"priori":1,"privat":1,"process":5,"product":[1,3,5],"profil":5,"progress":3,"project":[1,2],"prompt":1,"properli":3,"properti":[3,4,5],"protocol":5,"provid":3,"proxi":2,"publish":2,"pull":1,"purpos":3,"push":1,"put":[1,3,5],"py":[0,1],"pypi":[1,2],"pyproject":[0,1],"python":[0,1,4,5],"queri":[2,3],"querystr":3,"question":1,"r":[1,3,5],"rais":[3,5],"random":[3,5],"randomli":5,"rang":5,"rate":3,"rather":3,"rdelet":3,"re":3,"reach":5,"read":[3,5],"readabl":3,"real":5,"reason":[1,3],"reattempt":3,"reboot":5,"rebuild":1,"rebuilt":1,"recalcul":5,"receiv":[3,5],"recommend":[1,3,5],"record":[3,5],"reduc":3,"refactor":0,"refer":[1,2,5],"reflect":[0,4],"reform":3,"regard":3,"region":2,"rel":[3,5],"relat":[3,5],"relationship":4,"releas":[0,2],"remov":3,"renam":4,"repeat":5,"replac":[1,3,4],"report":[1,3],"repositori":[1,2],"repres":[3,5],"represent":3,"reproduc":1,"request":[1,2,3],"requir":[0,1,3,5],"requires_success":3,"reshim":1,"resolv":[3,5],"resourc":[1,3],"resource_url":3,"respect":[4,5],"respond":5,"respons":[1,2,3],"rest":[0,1,2,3],"rest_api_v2":3,"rest_api_v2_cli":[1,3],"restapiv2cli":[2,3,4,5],"result":[2,3],"retri":[2,3],"retriev":3,"return":[0,3,5],"review":1,"rget":[3,5],"role":1,"root":[1,3,5],"rotat":5,"rout":3,"routing_kei":[3,5],"rpatch":3,"rpost":[3,5],"rput":[3,5],"rst":1,"rule":5,"run":[1,5],"sai":[1,5],"said":[3,5],"same":[1,3,5],"save":5,"schedul":[1,5],"schedule_refer":5,"schema":[1,2,3],"scope":5,"script":[0,1,5],"search":[3,5],"second":[1,3,5],"secondari":3,"secret":[3,5],"secur":3,"sed":4,"see":[0,1,3,5],"select":[1,5],"self":[3,5],"semant":1,"send":[3,5],"send_change_ev":[0,3],"send_ev":3,"sensit":3,"sent":[3,5],"separ":[1,5],"seri":3,"serial":5,"server":[2,3],"serverhttperror":[2,3,4],"servic":[1,2],"session":[3,5],"set":[0,2,3,5],"setter":3,"setup":2,"sever":3,"sh":1,"shell":1,"shift":5,"short":[3,5],"should":[1,3,4],"shown":[3,4],"side":3,"signal":3,"similar":[3,5],"similarli":5,"simpli":5,"simultan":3,"sinc":5,"singl":[0,4,5],"singular":1,"skip":5,"slash":[1,3,5],"sleep":[3,5],"sleep_tim":[3,5],"sleep_timer_bas":[3,5],"small":3,"smaller":0,"sn":5,"so":[1,3,4,5],"sole":3,"some":[0,1,3,4,5],"someth":3,"sort":5,"sourc":[1,3,4,5],"space":3,"speak":5,"special":[2,3],"specif":5,"specifi":[3,5],"spent":3,"sphinx":1,"squar":[3,5],"stagger_cooldown":[3,5],"standard":1,"start":[3,5],"state":[3,5],"statu":[0,3,5],"status":[3,5],"status_cod":[3,5],"status_upd":5,"stderr":[3,5],"step":[1,3,5],"still":[1,3,5],"str":3,"streamhandl":5,"strictli":3,"string":[1,3,5],"strip":5,"strongli":1,"structur":[0,5],"style":4,"subclass":[3,5],"subdomain":3,"submit":[0,3,5],"subscrib":[1,5],"subscript":[1,5],"substitut":4,"success":[3,5],"successful_respons":3,"successfulli":3,"suffix":[1,3],"suit":1,"summari":[1,3,5],"super":3,"supersed":5,"supplement":3,"suppli":[3,5],"support":[0,2,3,4,5],"sure":1,"switch":4,"sy":[3,5],"synchron":5,"system":[1,3,5],"t":[1,3,5],"tab":5,"tag":2,"take":[1,3,5],"target":[1,3,5],"tcp":3,"team":5,"team_id":5,"tear":5,"temporari":[1,3],"temporarili":1,"term":[0,3],"test":[0,2],"test_pagerduti":1,"testpublish":1,"text":3,"text_len_limit":[2,3],"th":5,"than":[3,5],"thei":[0,1,3,5],"them":[1,3,5],"themselv":1,"therefor":[3,5],"thi":[0,1,3,4,5],"thing":3,"third":3,"those":3,"though":5,"thread":5,"three":[1,3,4,5],"through":[0,3,5],"thu":[3,5],"thunder":3,"time":[0,1,3,5],"time_zon":5,"timeout":[2,3],"timer":[3,5],"timestamp":3,"toggl":3,"token":[1,3,5],"toml":[0,1],"tool":1,"top":3,"topic":5,"total":[3,5],"total_call_count":3,"total_call_tim":3,"touch":1,"toward":5,"traffic":5,"trail":3,"transient":[3,5],"transmit":3,"transport":5,"treat":3,"tree":1,"trigger":[3,5],"trivial":4,"true":[3,5],"trunc_kei":3,"trunc_token":3,"truncat":3,"truncate_text":3,"try":[3,5],"try_decod":3,"tupl":[1,3],"two":[1,4,5],"txt":1,"type":[2,3],"typic":[1,3,5],"u":2,"ui":3,"unauthor":5,"unavail":[0,1],"uncommit":1,"unconfigur":5,"under":[3,5],"underli":[3,5],"unexpect":5,"uniformli":3,"uniqu":[3,5],"unit":[0,1],"unittest":1,"univers":3,"unknown":5,"unless":[3,5],"unlimit":5,"unmarsh":3,"unmodifi":3,"unsuccess":5,"unsupport":[3,5],"until":[3,5],"unusu":5,"unwrap":[1,3,5],"up":[1,3,5],"updat":[0,2,3],"updated_incid":5,"updated_us":5,"upgrad":1,"upload":1,"upper":3,"uppercas":3,"url":[1,2],"urlerror":[2,3,4,5],"us":[1,2,3,4],"usag":[2,3],"user":[0,1,2,3],"user123":5,"user_data":5,"user_head":3,"user_id":5,"user_refer":[3,5],"usernam":1,"usual":5,"utc":5,"uuid":5,"v":1,"v2":[1,2,3,4],"valid":[1,3,5],"valu":[1,3,5],"variabl":[1,3,5],"verb":3,"verbos":3,"veri":[1,5],"versa":5,"version":[0,2,3,4],"via":[3,5],"vice":5,"view":1,"virtu":1,"virtualenv":1,"vm":1,"volum":5,"wa":[0,1,3,4,5],"wai":[1,3,5],"wait":[3,5],"warn":3,"web":[1,3,5],"welcom":1,"well":[1,5],"were":0,"what":[0,3,5],"when":[1,3,5],"where":[1,3,5],"wherea":3,"wherein":3,"whether":[3,5],"which":[1,3,5],"whichev":3,"while":[1,2],"who":3,"wholli":3,"whose":[1,3,5],"wise":5,"within":[0,1,3],"without":[3,5],"won":5,"work":[1,3,5],"workflow":3,"would":[3,5],"wrap":[1,2],"wrapped_ent":3,"wrapper":[2,3,5],"write":[1,3,5],"wrong":3,"x":5,"yaml":1,"yield":[3,5],"you":[1,3],"your":[1,5],"zero":3,"\u03c1":5},"titles":["Changelog","Contribution Guide","python-pagerduty: Clients for PagerDuty\u2019s APIs","Module Reference","PDPYRAS Migration Guide","User Guide"],"titleterms":{"":2,"For":1,"The":5,"ad":1,"api":[2,3,5],"authent":5,"awar":5,"basic":5,"behavior":5,"canon":1,"case":5,"chang":1,"changelog":0,"class":[3,4],"client":[2,3,4,5],"command":5,"complet":5,"configur":[1,5],"conform":1,"content":2,"contribut":1,"cooldown":5,"creat":5,"data":5,"decor":3,"default":[3,5],"delet":5,"document":1,"end":1,"endpoint":[1,5],"entiti":[1,3,5],"error":[3,5],"evalu":1,"event":5,"exampl":5,"except":4,"exponenti":5,"extern":2,"featur":5,"from":5,"function":[3,5],"gener":5,"guid":[1,4,5],"handl":[3,5],"header":5,"helper":3,"http":5,"identifi":5,"initi":1,"instal":[1,5],"interfac":5,"introduct":1,"limit":1,"line":5,"log":5,"maintain":1,"merg":1,"migrat":4,"modul":3,"multi":5,"new":1,"non":[1,5],"pagerduti":2,"pagin":5,"paramet":5,"path":1,"pdpyra":4,"perform":[1,5],"proxi":5,"publish":1,"python":2,"queri":5,"refer":3,"region":5,"releas":1,"request":5,"resourc":[2,5],"respons":5,"rest":5,"result":5,"retri":5,"schema":5,"server":5,"servic":5,"set":1,"setup":1,"special":5,"support":1,"tabl":2,"tag":1,"test":1,"type":5,"u":5,"updat":[1,5],"url":[3,5],"us":5,"usag":5,"user":5,"v2":5,"version":1,"while":5,"wrap":[3,5],"wrapper":1}}) \ No newline at end of file +Search.setIndex({"alltitles":{"API Client Classes":[[3,"api-client-classes"]],"Adding Support for Non-Conforming Endpoints":[[1,"adding-support-for-non-conforming-endpoints"]],"Authentication":[[5,"authentication"]],"Basic Usage Examples":[[5,"basic-usage-examples"]],"Changelog":[[0,null]],"Client Classes":[[4,"client-classes"]],"Client Defaults":[[3,"client-defaults"]],"Command Line Interface":[[5,"command-line-interface"]],"Configuring Retry Behavior":[[5,"configuring-retry-behavior"]],"Contribution Guide":[[1,null]],"Data types":[[5,"data-types"]],"Default Behavior":[[5,"default-behavior"]],"Entity Wrapping":[[3,"entity-wrapping"],[5,"entity-wrapping"]],"Error Handling":[[5,"error-handling"]],"Errors":[[3,"errors"]],"Evaluating New Endpoints For Support":[[1,"evaluating-new-endpoints-for-support"]],"Events API v2":[[5,"events-api-v2"]],"Examples":[[5,"examples"]],"Exception Classes":[[4,"exception-classes"]],"Exponential Cooldown":[[5,"exponential-cooldown"]],"External Resources":[[2,"external-resources"]],"Function Decorators":[[3,"function-decorators"]],"Functions":[[3,"functions"]],"Generic Client Features":[[5,"generic-client-features"]],"HTTP Retry Configuration":[[5,"http-retry-configuration"]],"Helpers":[[3,"helpers"]],"Identifying Wrapped-entity Endpoints":[[5,"identifying-wrapped-entity-endpoints"]],"Initial Setup":[[1,"initial-setup"]],"Installation":[[5,"installation"]],"Introduction":[[1,"introduction"]],"Limitations":[[1,"limitations"]],"Logging":[[5,"logging"]],"Maintaining Entity Wrapper Configuration":[[1,"maintaining-entity-wrapper-configuration"]],"Merge changes and tag":[[1,"merge-changes-and-tag"]],"Module Reference":[[3,null]],"Multi-updating":[[5,"multi-updating"]],"PDPYRAS Migration Guide":[[4,null]],"Pagination":[[5,"pagination"]],"Perform end-to-end publish and installation testing":[[1,"perform-end-to-end-publish-and-installation-testing"]],"Performance and Completeness of Results":[[5,"performance-and-completeness-of-results"]],"Publishing":[[1,"publishing"]],"Query Parameters":[[5,"query-parameters"]],"REST API v2":[[5,"rest-api-v2"]],"Releasing a New Version":[[1,"releasing-a-new-version"]],"Requests and Responses":[[5,"requests-and-responses"]],"Resource Schemas":[[5,"resource-schemas"]],"Special Cases":[[5,"special-cases"]],"Table of Contents":[[2,"table-of-contents"]],"The From header":[[5,"the-from-header"]],"URL Handling":[[3,"url-handling"]],"URLs":[[5,"urls"]],"Updating Documentation":[[1,"updating-documentation"]],"Updating the Canonical Path Set":[[1,"updating-the-canonical-path-set"]],"Updating, creating or deleting while paginating":[[5,"updating-creating-or-deleting-while-paginating"]],"User Guide":[[5,null]],"Using Non-US Service Regions":[[5,"using-non-us-service-regions"]],"Using a Proxy Server":[[5,"using-a-proxy-server"]],"Wrapped-entity-aware Functions":[[5,"wrapped-entity-aware-functions"]],"python-pagerduty: Clients for PagerDuty\u2019s APIs":[[2,null]]},"docnames":["changelog","contributing","index","module_reference","pdpyras_migration_guide","user_guide"],"envversion":{"sphinx":65,"sphinx.domains.c":3,"sphinx.domains.changeset":1,"sphinx.domains.citation":1,"sphinx.domains.cpp":9,"sphinx.domains.index":1,"sphinx.domains.javascript":3,"sphinx.domains.math":2,"sphinx.domains.python":4,"sphinx.domains.rst":2,"sphinx.domains.std":2,"sphinx.ext.intersphinx":1,"sphinx.ext.todo":2},"filenames":["changelog.rst","contributing.rst","index.rst","module_reference.rst","pdpyras_migration_guide.rst","user_guide.rst"],"indexentries":{"acknowledge() (pagerduty.eventsapiv2client method)":[[3,"pagerduty.EventsApiV2Client.acknowledge",false]],"after_set_api_key() (pagerduty.apiclient method)":[[3,"pagerduty.ApiClient.after_set_api_key",false]],"api_call_counts (pagerduty.restapiv2client attribute)":[[3,"pagerduty.RestApiV2Client.api_call_counts",false]],"api_key (pagerduty.apiclient property)":[[3,"pagerduty.ApiClient.api_key",false]],"api_key_access (pagerduty.restapiv2client property)":[[3,"pagerduty.RestApiV2Client.api_key_access",false]],"api_time (pagerduty.restapiv2client attribute)":[[3,"pagerduty.RestApiV2Client.api_time",false]],"apiclient (class in pagerduty)":[[3,"pagerduty.ApiClient",false]],"auth_header (pagerduty.apiclient property)":[[3,"pagerduty.ApiClient.auth_header",false]],"auth_type (pagerduty.restapiv2client property)":[[3,"pagerduty.RestApiV2Client.auth_type",false]],"auto_json() (in module pagerduty)":[[3,"pagerduty.auto_json",false]],"canonical_path() (in module pagerduty)":[[3,"pagerduty.canonical_path",false]],"canonical_paths (in module pagerduty.rest_api_v2_client)":[[3,"pagerduty.rest_api_v2_client.CANONICAL_PATHS",false]],"cursor_based_pagination_paths (in module pagerduty.rest_api_v2_client)":[[3,"pagerduty.rest_api_v2_client.CURSOR_BASED_PAGINATION_PATHS",false]],"default_from (pagerduty.restapiv2client attribute)":[[3,"pagerduty.RestApiV2Client.default_from",false]],"default_page_size (pagerduty.restapiv2client attribute)":[[3,"pagerduty.RestApiV2Client.default_page_size",false]],"deprecated_kwarg() (in module pagerduty)":[[3,"pagerduty.deprecated_kwarg",false]],"dict_all() (pagerduty.restapiv2client method)":[[3,"pagerduty.RestApiV2Client.dict_all",false]],"endpoint_matches() (in module pagerduty)":[[3,"pagerduty.endpoint_matches",false]],"entity_wrapper_config (in module pagerduty.rest_api_v2_client)":[[3,"pagerduty.rest_api_v2_client.ENTITY_WRAPPER_CONFIG",false]],"entity_wrappers() (in module pagerduty)":[[3,"pagerduty.entity_wrappers",false]],"error (class in pagerduty)":[[3,"pagerduty.Error",false]],"eventsapiv2client (class in pagerduty)":[[3,"pagerduty.EventsApiV2Client",false]],"find() (pagerduty.restapiv2client method)":[[3,"pagerduty.RestApiV2Client.find",false]],"http_error_message() (in module pagerduty)":[[3,"pagerduty.http_error_message",false]],"httperror (class in pagerduty)":[[3,"pagerduty.HttpError",false]],"infer_entity_wrapper() (in module pagerduty)":[[3,"pagerduty.infer_entity_wrapper",false]],"is_path_param() (in module pagerduty)":[[3,"pagerduty.is_path_param",false]],"iter_all() (pagerduty.restapiv2client method)":[[3,"pagerduty.RestApiV2Client.iter_all",false]],"iter_cursor() (pagerduty.restapiv2client method)":[[3,"pagerduty.RestApiV2Client.iter_cursor",false]],"iteration_limit (in module pagerduty.rest_api_v2_client)":[[3,"pagerduty.rest_api_v2_client.ITERATION_LIMIT",false]],"jget() (pagerduty.restapiv2client method)":[[3,"pagerduty.RestApiV2Client.jget",false]],"jpost() (pagerduty.restapiv2client method)":[[3,"pagerduty.RestApiV2Client.jpost",false]],"jput() (pagerduty.restapiv2client method)":[[3,"pagerduty.RestApiV2Client.jput",false]],"last_4() (in module pagerduty)":[[3,"pagerduty.last_4",false]],"list_all() (pagerduty.restapiv2client method)":[[3,"pagerduty.RestApiV2Client.list_all",false]],"log (pagerduty.apiclient attribute)":[[3,"pagerduty.ApiClient.log",false]],"max_http_attempts (pagerduty.apiclient attribute)":[[3,"pagerduty.ApiClient.max_http_attempts",false]],"max_network_attempts (pagerduty.apiclient attribute)":[[3,"pagerduty.ApiClient.max_network_attempts",false]],"module":[[3,"module-0",false],[3,"module-1",false],[3,"module-2",false],[3,"module-pagerduty",false],[3,"module-pagerduty.api_client",false],[3,"module-pagerduty.common",false],[3,"module-pagerduty.rest_api_v2_client",false]],"normalize_params() (pagerduty.apiclient method)":[[3,"pagerduty.ApiClient.normalize_params",false]],"normalize_url() (in module pagerduty)":[[3,"pagerduty.normalize_url",false]],"normalize_url() (pagerduty.apiclient method)":[[3,"pagerduty.ApiClient.normalize_url",false]],"pagerduty":[[3,"module-0",false],[3,"module-1",false],[3,"module-2",false],[3,"module-pagerduty",false]],"pagerduty.api_client":[[3,"module-pagerduty.api_client",false]],"pagerduty.common":[[3,"module-pagerduty.common",false]],"pagerduty.rest_api_v2_client":[[3,"module-pagerduty.rest_api_v2_client",false]],"parent (pagerduty.apiclient attribute)":[[3,"pagerduty.ApiClient.parent",false]],"permitted_methods (pagerduty.apiclient attribute)":[[3,"pagerduty.ApiClient.permitted_methods",false]],"persist() (pagerduty.restapiv2client method)":[[3,"pagerduty.RestApiV2Client.persist",false]],"plural_name() (in module pagerduty)":[[3,"pagerduty.plural_name",false]],"post() (pagerduty.eventsapiv2client method)":[[3,"pagerduty.EventsApiV2Client.post",false]],"postprocess() (pagerduty.apiclient method)":[[3,"pagerduty.ApiClient.postprocess",false]],"postprocess() (pagerduty.restapiv2client method)":[[3,"pagerduty.RestApiV2Client.postprocess",false]],"prepare_headers() (pagerduty.apiclient method)":[[3,"pagerduty.ApiClient.prepare_headers",false]],"prepare_headers() (pagerduty.eventsapiv2client method)":[[3,"pagerduty.EventsApiV2Client.prepare_headers",false]],"print_debug (pagerduty.apiclient property)":[[3,"pagerduty.ApiClient.print_debug",false]],"rdelete() (pagerduty.restapiv2client method)":[[3,"pagerduty.RestApiV2Client.rdelete",false]],"request() (pagerduty.apiclient method)":[[3,"pagerduty.ApiClient.request",false]],"requires_success() (in module pagerduty)":[[3,"pagerduty.requires_success",false]],"resolve() (pagerduty.eventsapiv2client method)":[[3,"pagerduty.EventsApiV2Client.resolve",false]],"resource_url() (in module pagerduty)":[[3,"pagerduty.resource_url",false]],"response (pagerduty.error attribute)":[[3,"pagerduty.Error.response",false]],"restapiv2client (class in pagerduty)":[[3,"pagerduty.RestApiV2Client",false]],"retry (pagerduty.apiclient attribute)":[[3,"pagerduty.ApiClient.retry",false]],"rget() (pagerduty.restapiv2client method)":[[3,"pagerduty.RestApiV2Client.rget",false]],"rpatch() (pagerduty.restapiv2client method)":[[3,"pagerduty.RestApiV2Client.rpatch",false]],"rpost() (pagerduty.restapiv2client method)":[[3,"pagerduty.RestApiV2Client.rpost",false]],"rput() (pagerduty.restapiv2client method)":[[3,"pagerduty.RestApiV2Client.rput",false]],"send_change_event() (pagerduty.eventsapiv2client method)":[[3,"pagerduty.EventsApiV2Client.send_change_event",false]],"send_event() (pagerduty.eventsapiv2client method)":[[3,"pagerduty.EventsApiV2Client.send_event",false]],"serverhttperror (class in pagerduty)":[[3,"pagerduty.ServerHttpError",false]],"sleep_timer (pagerduty.apiclient attribute)":[[3,"pagerduty.ApiClient.sleep_timer",false]],"sleep_timer_base (pagerduty.apiclient attribute)":[[3,"pagerduty.ApiClient.sleep_timer_base",false]],"stagger_cooldown (pagerduty.apiclient property)":[[3,"pagerduty.ApiClient.stagger_cooldown",false]],"subdomain (pagerduty.restapiv2client property)":[[3,"pagerduty.RestApiV2Client.subdomain",false]],"submit() (pagerduty.eventsapiv2client method)":[[3,"pagerduty.EventsApiV2Client.submit",false]],"successful_response() (in module pagerduty)":[[3,"pagerduty.successful_response",false]],"text_len_limit (in module pagerduty.common)":[[3,"pagerduty.common.TEXT_LEN_LIMIT",false]],"timeout (in module pagerduty.api_client)":[[3,"pagerduty.api_client.TIMEOUT",false]],"timeout (pagerduty.apiclient attribute)":[[3,"pagerduty.ApiClient.timeout",false]],"total_call_count (pagerduty.restapiv2client property)":[[3,"pagerduty.RestApiV2Client.total_call_count",false]],"total_call_time (pagerduty.restapiv2client property)":[[3,"pagerduty.RestApiV2Client.total_call_time",false]],"trigger() (pagerduty.eventsapiv2client method)":[[3,"pagerduty.EventsApiV2Client.trigger",false]],"trunc_key (pagerduty.apiclient property)":[[3,"pagerduty.ApiClient.trunc_key",false]],"trunc_token (pagerduty.restapiv2client property)":[[3,"pagerduty.RestApiV2Client.trunc_token",false]],"truncate_text() (in module pagerduty)":[[3,"pagerduty.truncate_text",false]],"try_decoding() (in module pagerduty)":[[3,"pagerduty.try_decoding",false]],"unwrap() (in module pagerduty)":[[3,"pagerduty.unwrap",false]],"url (pagerduty.restapiv2client attribute)":[[3,"pagerduty.RestApiV2Client.url",false]],"urlerror (class in pagerduty)":[[3,"pagerduty.UrlError",false]],"wrapped_entities() (in module pagerduty)":[[3,"pagerduty.wrapped_entities",false]]},"objects":{"":[[3,0,0,"module-2","pagerduty"]],"pagerduty":[[3,1,1,"","ApiClient"],[3,1,1,"","Error"],[3,1,1,"","EventsApiV2Client"],[3,1,1,"","HttpError"],[3,1,1,"","RestApiV2Client"],[3,1,1,"","ServerHttpError"],[3,1,1,"","UrlError"],[3,0,0,"-","api_client"],[3,6,1,"","auto_json"],[3,6,1,"","canonical_path"],[3,0,0,"-","common"],[3,6,1,"","deprecated_kwarg"],[3,6,1,"","endpoint_matches"],[3,6,1,"","entity_wrappers"],[3,6,1,"","http_error_message"],[3,6,1,"","infer_entity_wrapper"],[3,6,1,"","is_path_param"],[3,6,1,"","last_4"],[3,6,1,"","normalize_url"],[3,6,1,"","plural_name"],[3,6,1,"","requires_success"],[3,6,1,"","resource_url"],[3,0,0,"-","rest_api_v2_client"],[3,6,1,"","successful_response"],[3,6,1,"","truncate_text"],[3,6,1,"","try_decoding"],[3,6,1,"","unwrap"],[3,6,1,"","wrapped_entities"]],"pagerduty.ApiClient":[[3,2,1,"","after_set_api_key"],[3,3,1,"","api_key"],[3,3,1,"","auth_header"],[3,4,1,"","log"],[3,4,1,"","max_http_attempts"],[3,4,1,"","max_network_attempts"],[3,2,1,"","normalize_params"],[3,2,1,"","normalize_url"],[3,4,1,"","parent"],[3,4,1,"","permitted_methods"],[3,2,1,"","postprocess"],[3,2,1,"","prepare_headers"],[3,3,1,"","print_debug"],[3,2,1,"","request"],[3,4,1,"","retry"],[3,4,1,"","sleep_timer"],[3,4,1,"","sleep_timer_base"],[3,3,1,"","stagger_cooldown"],[3,4,1,"","timeout"],[3,3,1,"","trunc_key"]],"pagerduty.Error":[[3,4,1,"","response"]],"pagerduty.EventsApiV2Client":[[3,2,1,"","acknowledge"],[3,2,1,"","post"],[3,2,1,"","prepare_headers"],[3,2,1,"","resolve"],[3,2,1,"","send_change_event"],[3,2,1,"","send_event"],[3,2,1,"","submit"],[3,2,1,"","trigger"]],"pagerduty.RestApiV2Client":[[3,4,1,"","api_call_counts"],[3,3,1,"","api_key_access"],[3,4,1,"","api_time"],[3,3,1,"","auth_type"],[3,4,1,"","default_from"],[3,4,1,"","default_page_size"],[3,2,1,"","dict_all"],[3,2,1,"","find"],[3,2,1,"","iter_all"],[3,2,1,"","iter_cursor"],[3,2,1,"","jget"],[3,2,1,"","jpost"],[3,2,1,"","jput"],[3,2,1,"","list_all"],[3,2,1,"","persist"],[3,2,1,"","postprocess"],[3,2,1,"","rdelete"],[3,2,1,"","rget"],[3,2,1,"","rpatch"],[3,2,1,"","rpost"],[3,2,1,"","rput"],[3,3,1,"","subdomain"],[3,3,1,"","total_call_count"],[3,3,1,"","total_call_time"],[3,3,1,"","trunc_token"],[3,4,1,"","url"]],"pagerduty.api_client":[[3,5,1,"","TIMEOUT"]],"pagerduty.common":[[3,5,1,"","TEXT_LEN_LIMIT"]],"pagerduty.rest_api_v2_client":[[3,5,1,"","CANONICAL_PATHS"],[3,5,1,"","CURSOR_BASED_PAGINATION_PATHS"],[3,5,1,"","ENTITY_WRAPPER_CONFIG"],[3,5,1,"","ITERATION_LIMIT"]]},"objnames":{"0":["py","module","Python module"],"1":["py","class","Python class"],"2":["py","method","Python method"],"3":["py","property","Python property"],"4":["py","attribute","Python attribute"],"5":["py","data","Python data"],"6":["py","function","Python function"]},"objtypes":{"0":"py:module","1":"py:class","2":"py:method","3":"py:property","4":"py:attribute","5":"py:data","6":"py:function"},"terms":{"":[1,3,4,5],"0":[0,1,3,4,5],"00":5,"01":[0,5],"01t00":5,"02":0,"02t00":5,"03t00":5,"04":[0,5],"05":0,"07":5,"08":0,"1":[0,1,3,4,5],"10":[3,5],"100":[3,5],"10000":3,"101st":5,"11":1,"13":[0,1],"14":0,"16":5,"187":5,"19":0,"2":[0,1,3,5],"201":5,"201st":5,"2023":5,"2024":5,"2025":[0,5],"204":0,"2xx":5,"3":[0,1,3,5],"30":5,"4":[3,5],"400":[3,5],"401":[3,5],"4012":5,"404":5,"42":5,"429":[3,5],"45":0,"46":0,"4xx":3,"5":[1,3,5],"50":5,"500":5,"5b":5,"5d":5,"5xx":[3,5],"6":5,"60":3,"601":5,"62":5,"700":5,"8":[0,5],"82":5,"A":[1,3],"As":[1,5],"At":5,"By":[3,5],"For":[2,3,5],"If":[1,3,5],"In":[0,1,3,4,5],"It":[0,1,3,5],"Its":5,"On":5,"One":5,"That":5,"The":[0,1,2,3,4],"Then":1,"There":[1,3,5],"These":[0,3],"To":[1,3,5],"Will":3,"With":3,"__token__":1,"__version__":[0,1],"_test":1,"abc123":5,"abil":5,"abl":1,"about":[3,5],"abov":[1,3,5],"accept":[0,3,5],"access":[1,3,5],"accord":[1,3,5],"accordingli":5,"account":[1,3,5],"acknowledg":[3,5],"action":[3,5],"actual":[1,3],"ad":[2,3],"add":[0,1,3,5],"addit":[3,4,5],"address":[3,5],"adjust":3,"admin":5,"administr":[3,5],"advantag":3,"affect":[3,5],"after":[1,3,5],"after_set_api_kei":3,"again":1,"against":3,"agent":[0,3],"airflow":0,"alert":[0,3,5],"all":[0,1,3,4,5],"allow":[0,3,5],"along":[0,1],"alreadi":[1,3,5],"also":[0,1,3,5],"alter":3,"although":5,"alwai":[0,1,3,5],"amount":3,"an":[1,3,5],"analog":5,"analogu":5,"ani":[1,3,5],"annotate_log_entri":5,"anoth":5,"antipattern":[1,3],"anyon":3,"ap":3,"apart":3,"api":[0,1,4],"api_call_count":3,"api_cli":3,"api_kei":[3,5],"api_key_access":[3,5],"api_tim":3,"apicli":[2,3,4,5],"apisess":4,"append":[3,5],"appli":[1,3],"applic":[1,3,5],"appropri":[0,1,3,5],"approv":1,"ar":[0,1,3,4,5],"arbitrari":3,"arg":3,"argument":[0,1,3,5],"around":[1,3],"arrai":[3,5],"articl":5,"asdf":1,"aspect":3,"assert":1,"assign":5,"associ":[3,5],"assum":[3,5],"attach":5,"attempt":[3,5],"attr":3,"attribut":[1,3,5],"auth_head":3,"auth_typ":[3,5],"authent":[2,3],"author":3,"auto":3,"auto_json":3,"autom":5,"automat":[1,3,5],"avail":[1,5],"avoid":[3,4],"awar":[2,3],"backend":3,"base":[1,3,5],"base_url":3,"basi":5,"basic":[0,2],"bear":[3,5],"bearer":3,"becaus":[0,1,3,4,5],"becom":5,"been":[0,3,4],"befor":[1,3,5],"behavior":[2,3],"being":[1,3,5],"belong":3,"benefit":3,"between":[1,3,4,5],"bob":5,"bodi":[1,3,5],"bool":3,"both":[1,3,4,5],"bracket":[3,5],"branch":1,"break":0,"brief":[1,3],"broadli":3,"browser":1,"bug":[0,1,3],"build":[0,1,5],"built":[0,1],"bump":5,"busi":[1,5],"business_servic":[1,5],"c":1,"call":[0,3,5],"callabl":3,"can":[0,1,3,5],"cannot":[1,3],"canon":[2,3],"canonical_path":[1,2,3],"capit":3,"carri":5,"case":[1,2,3,4],"catch":[3,5],"categori":1,"caus":[0,3,5],"certain":5,"chang":[0,2,3,4,5],"changeeventsapisess":4,"changelog":[1,2],"charact":3,"check":[1,3],"checkout":1,"child":3,"choos":1,"circuit":3,"class":[0,1,2,5],"classic":[1,3,5],"classifi":3,"clean":1,"cleanli":3,"clear":4,"clearli":4,"cli":5,"client":[0,1],"client_oauth":5,"clone":1,"code":[1,3,4,5],"codebas":0,"codifi":1,"collect":[1,3,5],"collis":4,"com":[3,5],"combin":1,"command":[0,1,2,3],"commit":1,"common":3,"compar":3,"comparison":3,"complet":[2,3],"compon":[1,4],"compos":[1,3,5],"comput":3,"concurr":3,"condit":5,"confer":3,"configur":[2,3],"conform":2,"conjunct":3,"connect":3,"consequ":3,"consid":5,"consist":3,"constrain":3,"constraint":3,"construct":[3,5],"constructor":5,"contact":3,"contact_method":3,"contain":[0,3,5],"content":[3,5],"context":[3,5],"contribut":2,"convent":[1,3,5],"convert":5,"cooldown":[2,3],"copi":1,"correct":3,"correctli":1,"correspond":[1,3,5],"could":3,"count":[1,3,5],"cover":3,"coverag":1,"creat":[1,2,3],"created_overrid":5,"credenti":[1,3,5],"critic":3,"current":[3,5],"cursor":[1,3,5],"cursor_based_pagination_path":[1,2,3],"custom":[0,3,5],"custom_detail":3,"daili":5,"dan":5,"data":[2,3],"date":3,"dav":5,"dave":5,"david":5,"debug":[3,5],"decod":[3,5],"decor":2,"dedup_kei":[3,5],"dedupl":[3,5],"default":[0,2],"default_from":[3,5],"default_page_s":[0,3],"defer":5,"defin":[3,5],"definit":1,"delai":3,"deleg":0,"delet":[1,2,3],"denot":3,"depend":1,"deprec":3,"deprecated_kwarg":3,"deprecated_nam":3,"depth":5,"deriv":5,"descend":[3,5],"describ":[1,3],"descript":[1,3,5],"design":[3,5],"desir":[1,5],"detail":[1,3,5],"determin":3,"dev001":1,"develop":[2,3],"deviat":1,"dict":[3,5],"dict_al":[3,5],"dictat":3,"dictionari":[1,3,5],"differ":[1,3,4,5],"directli":[3,5],"disabl":[3,5],"discard":[3,5],"discov":[0,1],"discret":5,"displai":[3,5],"distinct":[3,5],"distribut":3,"do":[1,5],"do_appl":5,"doc":[1,3],"docstr":0,"document":[2,3,5],"doe":[1,3,5],"doesn":[1,3,5],"don":1,"done":4,"download":3,"dure":3,"dusti":5,"e":[1,3,4,5],"each":[1,3,5],"earli":3,"eas":3,"easier":3,"edit":5,"effect":[3,4,5],"effici":5,"either":[3,5],"elabor":5,"element":3,"elimin":3,"els":[3,5],"email":[3,5],"emit":3,"empti":0,"enabl":[3,5],"encapsul":5,"encod":[3,5],"encount":[1,3,5],"end":[2,3,5],"endpoint":[2,3],"endpoint_match":3,"endpoint_pattern":3,"enforc":3,"engin":5,"enough":4,"ensur":1,"enter":1,"entiti":2,"entity_wrapp":3,"entity_wrapper_config":[1,2,3],"entri":[0,1,3,5],"environ":1,"ep":5,"equal":3,"equival":[4,5],"erron":5,"error":[1,2,4],"escal":5,"escalation_delay_in_minut":5,"escalation_polici":[1,3,5],"escalation_rul":5,"essenti":5,"etc":5,"eu":5,"evalu":2,"even":[1,3],"event":[0,2,3,4],"events_cli":5,"eventsapisess":4,"eventsapiv2cli":[0,2,3,4,5],"everi":3,"everyth":5,"exact":3,"exactli":[3,5],"exampl":[1,2,3],"example35":5,"exce":3,"except":[1,2,3,5],"exclud":3,"exist":[1,3,5],"exit":1,"expect":[0,3,5],"experienc":3,"explicit":3,"explicitli":3,"expon":5,"exponenti":2,"express":4,"extend":3,"extract":5,"factor":[3,5],"fail":3,"failur":[0,3],"fals":[3,5],"far":3,"featur":[0,1,2,3],"fetch":5,"few":[3,5],"field":[0,3],"file":[0,1],"fill":1,"filter":[3,5],"final":[1,3,5],"find":[3,5],"finish":5,"fire":5,"first":[1,3,4,5],"first_dan":5,"fix":[0,1,3],"flag":[3,5],"float":3,"follow":[1,3,4,5],"followup":3,"foo":5,"foo_servic":5,"forc":1,"form":[1,3],"format":[3,4],"former":4,"forward":[1,4],"found":[3,5],"four":5,"from":[0,1,2,3,4],"full":[3,5],"function":[1,2],"further":3,"g":[4,5],"ga":3,"gener":[1,2,3],"get":[1,3,5],"get_path_list":1,"getter":3,"git":1,"github":[0,1,2],"given":[1,3,5],"global":[1,3],"go":5,"good":1,"greater":3,"group":[0,5],"grow":1,"guarante":3,"guid":[0,2,3],"h":5,"ha":[0,1,3,4,5],"handl":[0,1,2],"handler":[3,5],"happen":[3,5],"hard":[1,5],"hash":1,"have":[0,1,3,4,5],"head":5,"header":[0,2,3],"help":[1,3],"helper":2,"helptext":5,"herd":3,"hierarchi":4,"high":5,"higher":5,"hoc":3,"hold":3,"hook":3,"host":5,"how":[0,3,5],"howev":[1,5],"href":3,"html":1,"http":[0,2,3],"http_error_messag":3,"httperror":[2,3,4,5],"httpservererror":5,"human":3,"hundr":5,"i":[0,1,3,4,5],"id":[1,3,5],"idea":1,"idempot":[3,5],"identif":3,"identifi":[1,2,3],"ignor":[3,5],"il":5,"imag":3,"immedi":[1,3,5],"implement":[1,3],"impli":3,"import":[0,1,4,5],"importlib":0,"incid":[0,1,3,5],"incident_refer":5,"incient":5,"includ":[0,1,3,4,5],"increas":[3,5],"index":[1,3,5],"indic":5,"indirectli":0,"individu":[1,3],"infer":[1,3],"infer_entity_wrapp":[1,3],"inform":3,"inherit":[3,5],"initi":[2,3,5],"input":[0,3,5],"insenit":3,"insensit":3,"insid":5,"instal":2,"instanc":[3,4,5],"instanti":5,"instead":[3,5],"int":3,"integr":[0,3,5],"integration_id":3,"intend":3,"interfac":[0,2],"interpret":3,"interv":3,"introduc":0,"introduct":2,"introspect":0,"invalid":5,"investig":1,"invok":3,"involv":5,"is_path_param":3,"isn":3,"iso8601":3,"issu":[0,1,3,4,5],"item":3,"item_hook":[0,3],"iter":[3,5],"iter_al":[0,3,5],"iter_cursor":[0,3,5],"iteration_limit":[2,3],"its":[3,5],"itself":[1,3,5],"j":5,"jane":5,"jget":[3,5],"jpost":3,"jput":3,"json":[3,5],"just":3,"k":[3,5],"keep":[3,5],"kei":[1,3,5],"keyword":[0,3,5],"knowabl":3,"kw":3,"kwarg":3,"lack":5,"lambda":5,"larg":5,"last":[1,3],"last_4":3,"latenc":5,"later":1,"latest":[1,5],"latter":4,"lead":5,"least":1,"leav":3,"left":5,"legaci":0,"length":3,"lesser":0,"let":5,"level":[3,5],"librari":[0,1,5],"like":[1,5],"limit":[0,2,3,5],"line":[0,2,3],"link":3,"list":[1,3,5],"list_al":[3,5],"live":1,"local":1,"log":[2,3],"log_entri":5,"logger":[3,5],"logic":[1,3,5],"login":5,"long":0,"longer":[1,3,5],"longest":3,"look":[1,4,5],"lookup":1,"loop":5,"low":5,"lower":[3,5],"lowercas":3,"m":1,"made":[0,3,4,5],"mai":[1,3,5],"main":[0,1,5],"maintain":[0,2],"major":[0,1],"make":[1,3,4,5],"malform":[3,5],"manag":5,"mani":3,"manual":[1,5],"map":3,"marshal":3,"match":[3,5],"max_http_attempt":[3,5],"max_network_attempt":[3,5],"maximum":[3,5],"mcuserson":5,"member":3,"memoiz":3,"menu":5,"merg":[2,3,4],"messag":[1,3,5],"metadata":[0,1,3,5],"method":[0,1,3,4,5],"migrat":[0,2],"mind":5,"minim":1,"minor":1,"miscellan":3,"mitig":1,"modif":3,"modifi":[3,5],"modul":[0,2,4,5],"monit":0,"monolith":0,"more":[1,3,4,5],"moreov":5,"most":[1,3,5],"mostli":3,"much":3,"multi":[0,2],"multipl":5,"must":[1,3,5],"n":[3,5],"name":[0,1,3,4,5],"necessari":5,"need":[1,3,5],"net":5,"network":[3,5],"new":[0,2,3,5],"new_rul":5,"next":[1,5],"next_cursor":5,"node":[1,3],"nomenclatur":4,"non":[0,2,3],"none":[0,1,3,5],"nonzero":[3,5],"normal":[3,5],"normalize_param":3,"normalize_url":3,"note":[1,3,4,5],"notebook":5,"notset":[3,5],"noun":1,"now":0,"number":[0,1,3,5],"numer":[3,5],"oauth":[0,3],"oauth2":[3,5],"oauth_token":5,"obj_typ":3,"object":[3,5],"obtain":[3,5],"offset":[3,5],"oft":3,"ok":5,"old":5,"omit":3,"onc":[1,3,5],"one":[0,1,3,5],"onli":[3,5],"opaqu":1,"open":[1,5],"oper":5,"opinion":3,"opposit":5,"option":3,"orchestr":0,"order":[1,3,4],"org":1,"organ":0,"origin":[1,4,5],"orthodox":[1,3],"other":[3,5],"otherwis":[1,3,5],"out":[1,5],"output":[3,5],"outsid":5,"over":5,"overal":[3,5],"overlap":4,"overrid":[0,1,3,5],"own":[1,3],"p":1,"pabc123":[3,5],"packag":[0,1,5],"page":[0,2,3,5],"page_s":[0,3],"pagerduti":[0,1,3,4,5],"pagin":[1,2,3],"pagint":3,"pair":[3,5],"pam4fg":5,"param":[0,3,5],"paramet":[0,2,3],"parent":[3,5],"pariti":0,"part":3,"partial":5,"particular":[3,5],"pass":[0,3,5],"password":1,"patch":[1,3],"path":[2,3,5],"path_nod":3,"pattern":[1,3,4],"paus":5,"payload":3,"pdclienterror":4,"pdef456":5,"pdhttperror":4,"pdpyra":[0,1,2],"pdservererror":4,"pdsession":4,"per":[3,5],"perform":[2,3],"period":5,"permiss":3,"permit":3,"permitted_method":3,"persist":[3,5],"peysgva":5,"peysgvf":5,"pghi789":5,"phij789":5,"pi7dh85":5,"pip":[1,5],"pjkl678":5,"place":5,"placehold":1,"plain":5,"pleas":[1,3],"plu":[3,5],"plural":[1,3],"plural_nam":3,"pn1t34m":5,"pnoexst":5,"polici":5,"port":5,"portion":1,"posit":[0,3,5],"possibl":1,"post":[1,3,5],"postprocess":3,"potenti":3,"power":3,"pre":3,"preced":[3,5],"predict":3,"preexist":[1,3],"prefix":0,"prepare_head":3,"prepend":3,"presenc":5,"present":1,"prevent":3,"previou":3,"previous":0,"print":[1,3,5],"print_debug":[3,5],"prior":[0,5],"priori":1,"privat":1,"process":5,"product":[1,3,5],"profil":5,"progress":3,"project":[1,2],"prompt":1,"properli":3,"properti":[3,4,5],"protocol":5,"provid":3,"proxi":2,"publish":2,"pull":1,"purpos":3,"push":1,"put":[1,3,5],"py":[0,1],"pypi":[1,2],"pyproject":[0,1],"python":[0,1,4,5],"queri":[2,3],"querystr":3,"question":1,"r":[1,3,5],"rais":[3,5],"random":[3,5],"randomli":5,"rang":5,"rate":3,"rather":3,"rdelet":3,"re":3,"reach":5,"read":[3,5],"readabl":3,"real":5,"reason":[1,3],"reattempt":3,"reboot":5,"rebuild":1,"rebuilt":1,"recalcul":5,"receiv":[0,3,5],"recommend":[1,3,5],"record":[3,5],"reduc":3,"refactor":0,"refer":[1,2,5],"reflect":[0,4],"reform":3,"regard":3,"region":2,"rel":[3,5],"relat":[3,5],"relationship":4,"releas":[0,2],"remov":3,"renam":4,"repeat":5,"replac":[1,3,4],"report":[1,3],"repositori":[1,2],"repres":[3,5],"represent":3,"reproduc":1,"request":[1,2,3],"requir":[0,1,3,5],"requires_success":3,"reshim":1,"resolv":[3,5],"resourc":[1,3],"resource_url":3,"respect":[4,5],"respond":5,"respons":[0,1,2,3],"rest":[0,1,2,3],"rest_api_v2":3,"rest_api_v2_cli":[1,3],"restapiv2cli":[0,2,3,4,5],"result":[2,3],"retri":[2,3],"retriev":3,"return":[0,3,5],"review":1,"rget":[3,5],"role":1,"root":[1,3,5],"rotat":5,"rout":3,"routing_kei":[3,5],"rpatch":3,"rpost":[3,5],"rput":[3,5],"rst":1,"rule":5,"run":[1,5],"sai":[1,5],"said":[0,3,5],"same":[1,3,5],"save":5,"schedul":[1,5],"schedule_refer":5,"schema":[1,2,3],"scope":5,"script":[0,1,5],"search":[3,5],"second":[1,3,5],"secondari":3,"secret":[3,5],"secur":3,"sed":4,"see":[0,1,3,5],"select":[1,5],"self":[3,5],"semant":1,"send":[3,5],"send_change_ev":[0,3],"send_ev":3,"sensit":3,"sent":[3,5],"separ":[1,5],"seri":3,"serial":5,"server":[2,3],"serverhttperror":[2,3,4],"servic":[1,2],"session":[3,5],"set":[0,2,3,5],"setter":3,"setup":2,"sever":3,"sh":1,"shell":1,"shift":5,"short":[3,5],"should":[1,3,4],"shown":[3,4],"side":3,"signal":3,"similar":[0,3,5],"similarli":5,"simpli":5,"simultan":3,"sinc":5,"singl":[0,4,5],"singular":1,"skip":5,"slash":[1,3,5],"sleep":[3,5],"sleep_tim":[3,5],"sleep_timer_bas":[3,5],"small":3,"smaller":0,"sn":5,"so":[1,3,4,5],"sole":3,"some":[0,1,3,4,5],"someth":3,"sort":5,"sourc":[1,3,4,5],"space":3,"speak":5,"special":[2,3],"specif":5,"specifi":[3,5],"spent":3,"sphinx":1,"squar":[3,5],"stagger_cooldown":[3,5],"standard":1,"start":[3,5],"state":[3,5],"statu":[0,3,5],"status":[3,5],"status_cod":[3,5],"status_upd":5,"stderr":[3,5],"step":[1,3,5],"still":[1,3,5],"str":3,"streamhandl":5,"strictli":3,"string":[1,3,5],"strip":5,"strongli":1,"structur":[0,5],"style":4,"subclass":[3,5],"subdomain":3,"submit":[0,3,5],"subscrib":[1,5],"subscript":[1,5],"substitut":4,"success":[3,5],"successful_respons":3,"successfulli":3,"suffix":[1,3],"suit":1,"summari":[1,3,5],"super":3,"supersed":5,"supplement":3,"suppli":[3,5],"support":[0,2,3,4,5],"sure":1,"switch":4,"sy":[3,5],"synchron":5,"system":[1,3,5],"t":[1,3,5],"tab":5,"tag":2,"take":[1,3,5],"target":[1,3,5],"tcp":3,"team":5,"team_id":5,"tear":5,"temporari":[1,3],"temporarili":1,"term":[0,3],"test":[0,2],"test_pagerduti":1,"testpublish":1,"text":3,"text_len_limit":[2,3],"th":5,"than":[3,5],"thei":[0,1,3,5],"them":[1,3,5],"themselv":1,"therefor":[3,5],"thi":[0,1,3,4,5],"thing":3,"third":3,"those":3,"though":5,"thread":5,"three":[1,3,4,5],"through":[0,3,5],"thu":[3,5],"thunder":3,"time":[0,1,3,5],"time_zon":5,"timeout":[2,3],"timer":[3,5],"timestamp":3,"toggl":3,"token":[1,3,5],"toml":[0,1],"tool":1,"top":3,"topic":5,"total":[3,5],"total_call_count":3,"total_call_tim":3,"touch":1,"toward":5,"traffic":5,"trail":3,"transient":[3,5],"transmit":3,"transport":5,"treat":3,"tree":1,"trigger":[3,5],"trivial":4,"true":[3,5],"trunc_kei":3,"trunc_token":3,"truncat":3,"truncate_text":3,"try":[3,5],"try_decod":[0,3],"tupl":[1,3],"two":[1,4,5],"txt":1,"type":[2,3],"typic":[1,3,5],"u":2,"ui":3,"unauthor":5,"unavail":[0,1],"uncommit":1,"unconfigur":5,"under":[3,5],"underli":[3,5],"unexpect":5,"uniformli":3,"uniqu":[3,5],"unit":[0,1],"unittest":1,"univers":3,"unknown":5,"unless":[3,5],"unlimit":5,"unmarsh":3,"unmodifi":3,"unspecifi":3,"unsuccess":5,"unsupport":[3,5],"until":[3,5],"unusu":5,"unwrap":[1,3,5],"up":[1,3,5],"updat":[0,2,3],"updated_incid":5,"updated_us":5,"upgrad":1,"upload":1,"upper":3,"uppercas":3,"url":[1,2],"urlerror":[2,3,4,5],"us":[0,1,2,3,4],"usag":[2,3],"user":[0,1,2,3],"user123":5,"user_data":5,"user_head":3,"user_id":5,"user_refer":[3,5],"usernam":1,"usual":5,"utc":5,"uuid":5,"v":1,"v2":[0,1,2,3,4],"valid":[1,3,5],"valu":[1,3,5],"variabl":[1,3,5],"verb":3,"verbos":3,"veri":[1,5],"versa":5,"version":[0,2,3,4],"via":[0,3,5],"vice":5,"view":1,"virtu":1,"virtualenv":1,"vm":1,"volum":5,"wa":[0,1,3,4,5],"wai":[1,3,5],"wait":[3,5],"warn":3,"web":[1,3,5],"welcom":1,"well":[1,5],"were":0,"what":[0,3,5],"when":[0,1,3,5],"where":[1,3,5],"wherea":3,"wherein":3,"whether":[3,5],"which":[1,3,5],"whichev":3,"while":[1,2],"who":3,"wholli":3,"whose":[1,3,5],"wise":5,"within":[0,1,3],"without":[3,5],"won":5,"work":[1,3,5],"workflow":3,"would":[3,5],"wrap":[1,2],"wrapped_ent":3,"wrapper":[2,3,5],"write":[1,3,5],"wrong":3,"x":5,"yaml":1,"yield":[3,5],"you":[1,3],"your":[1,5],"zero":3,"\u03c1":5},"titles":["Changelog","Contribution Guide","python-pagerduty: Clients for PagerDuty\u2019s APIs","Module Reference","PDPYRAS Migration Guide","User Guide"],"titleterms":{"":2,"For":1,"The":5,"ad":1,"api":[2,3,5],"authent":5,"awar":5,"basic":5,"behavior":5,"canon":1,"case":5,"chang":1,"changelog":0,"class":[3,4],"client":[2,3,4,5],"command":5,"complet":5,"configur":[1,5],"conform":1,"content":2,"contribut":1,"cooldown":5,"creat":5,"data":5,"decor":3,"default":[3,5],"delet":5,"document":1,"end":1,"endpoint":[1,5],"entiti":[1,3,5],"error":[3,5],"evalu":1,"event":5,"exampl":5,"except":4,"exponenti":5,"extern":2,"featur":5,"from":5,"function":[3,5],"gener":5,"guid":[1,4,5],"handl":[3,5],"header":5,"helper":3,"http":5,"identifi":5,"initi":1,"instal":[1,5],"interfac":5,"introduct":1,"limit":1,"line":5,"log":5,"maintain":1,"merg":1,"migrat":4,"modul":3,"multi":5,"new":1,"non":[1,5],"pagerduti":2,"pagin":5,"paramet":5,"path":1,"pdpyra":4,"perform":[1,5],"proxi":5,"publish":1,"python":2,"queri":5,"refer":3,"region":5,"releas":1,"request":5,"resourc":[2,5],"respons":5,"rest":5,"result":5,"retri":5,"schema":5,"server":5,"servic":5,"set":1,"setup":1,"special":5,"support":1,"tabl":2,"tag":1,"test":1,"type":5,"u":5,"updat":[1,5],"url":[3,5],"us":5,"usag":5,"user":5,"v2":5,"version":1,"while":5,"wrap":[3,5],"wrapper":1}}) \ No newline at end of file diff --git a/docs/user_guide.html b/docs/user_guide.html index 2224666..e57722d 100644 --- a/docs/user_guide.html +++ b/docs/user_guide.html @@ -6,14 +6,14 @@ - User Guide — python-pagerduty 2.1.0 documentation + User Guide — python-pagerduty 2.1.2 documentation - + @@ -131,8 +131,8 @@

    Installation

    Command Line Interface

    -

    This package also includes a basic CLI for triggering incidents using the -PagerDuty Events API V2. For example, to trigger an incident:

    +

    This package also includes a basic CLI for PagerDuty Events API V2. For +example, to trigger an incident:

    pagerduty trigger -k $ROUTING_KEY --description "Network latency is high"
     
    diff --git a/pagerduty/common.py b/pagerduty/common.py index e22d46f..bd04b7e 100644 --- a/pagerduty/common.py +++ b/pagerduty/common.py @@ -2,6 +2,8 @@ from typing import Union from warnings import warn +from json.decoder import JSONDecodeError + # PyPI from requests import Response @@ -164,8 +166,12 @@ def try_decoding(r: Response) -> Union[dict, list, str]: """ try: return r.json() - except ValueError as e: - raise ServerHttpError( - "API responded with invalid JSON: " + truncate_text(r.text), - r, - ) + except (JSONDecodeError, ValueError) as e: + if r.text.strip() == '': + # Some endpoints return HTTP 204 for request types other than delete + return None + else: + raise ServerHttpError( + "API responded with invalid JSON: " + truncate_text(r.text), + r, + ) diff --git a/pagerduty/rest_api_v2_client.py b/pagerduty/rest_api_v2_client.py index 29dc777..3c1e483 100644 --- a/pagerduty/rest_api_v2_client.py +++ b/pagerduty/rest_api_v2_client.py @@ -991,7 +991,8 @@ def iter_all(self, url, params=None, page_size=None, item_hook=None, # Short-circuit to cursor-based pagination if appropriate: if path in CURSOR_BASED_PAGINATION_PATHS: - return self.iter_cursor(url, params=params) + return self.iter_cursor(url, params=params, page_size=page_size, + item_hook=item_hook) nodes = path.split('/') if is_path_param(nodes[-1]): @@ -1009,13 +1010,10 @@ def iter_all(self, url, params=None, page_size=None, item_hook=None, raise UrlError(f"Pagination is not supported for {endpoint}.") # Parameters to send: - data = {} - if page_size is None: - data['limit'] = self.default_page_size - else: - data['limit'] = page_size - if total: - data['total'] = 1 + data = { + 'limit': (self.default_page_size, page_size)[int(bool(page_size))], + 'total': int(bool(total)) + } if isinstance(params, (dict, list)): # Override defaults with values given: data.update(dict(params)) @@ -1085,7 +1083,8 @@ def iter_all(self, url, params=None, page_size=None, item_hook=None, item_hook(result, n, total_count) yield result - def iter_cursor(self, url, params=None, item_hook=None) -> Iterator[dict]: + def iter_cursor(self, url, params=None, item_hook=None, page_size=None) \ + -> Iterator[dict]: """ Iterator for results from an endpoint using cursor-based pagination. @@ -1096,12 +1095,17 @@ def iter_cursor(self, url, params=None, item_hook=None) -> Iterator[dict]: :param item_hook: A callable object that accepts 3 positional arguments; see :attr:`iter_all` for details on how this argument is used. + :param page_size: + Number of results per page of results (the ``limit`` parameter). If + unspecified, :attr:`default_page_size` will be used. """ path = canonical_path(self.url, url) if path not in CURSOR_BASED_PAGINATION_PATHS: raise UrlError(f"{path} does not support cursor-based pagination.") _, wrapper = entity_wrappers('GET', path) - user_params = {} + user_params = { + 'limit': (self.default_page_size, page_size)[int(bool(page_size))] + } if isinstance(params, (dict, list)): # Override defaults with values given: user_params.update(dict(params)) @@ -1127,6 +1131,7 @@ def iter_cursor(self, url, params=None, item_hook=None) -> Iterator[dict]: if hasattr(item_hook, '__call__'): item_hook(result, total, '?') yield result + # Advance to the next page next_cursor = body.get('next_cursor', None) more = bool(next_cursor) diff --git a/pyproject.toml b/pyproject.toml index 615035c..d890893 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "pagerduty" -version = "2.1.1" +version = "2.1.2" description = "Clients for PagerDuty's Public APIs" requires-python = ">=3.6" dependencies = ["certifi", "requests", "urllib3"] diff --git a/sphinx/source/user_guide.rst b/sphinx/source/user_guide.rst index 442ed3d..f3619d5 100644 --- a/sphinx/source/user_guide.rst +++ b/sphinx/source/user_guide.rst @@ -19,8 +19,8 @@ This library is available on the Python Package Index as `pagerduty +500 Internal Server Error + +

    500 Internal Server Error

    +''') + self.assertRaises(pagerduty.ServerHttpError, pagerduty.try_decoding, r) diff --git a/tests/mocks.py b/tests/mocks.py index 4012dd4..5ae9e61 100644 --- a/tests/mocks.py +++ b/tests/mocks.py @@ -1,6 +1,7 @@ import datetime import json from unittest.mock import Mock, MagicMock, patch, call +from json.decoder import JSONDecodeError class Session(object): """ @@ -30,6 +31,7 @@ def __init__(self, code, text, method='GET', url=None): 'x-request-id': 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx'} self.request.method = method self.json = MagicMock() - self.json.return_value = json.loads(text) - - + try: + self.json.return_value = json.loads(text) + except JSONDecodeError as e: + self.json.side_effect = e diff --git a/tests/rest_api_v2_client_test.py b/tests/rest_api_v2_client_test.py index 1adebb0..b7e142f 100644 --- a/tests/rest_api_v2_client_test.py +++ b/tests/rest_api_v2_client_test.py @@ -309,8 +309,16 @@ def test_iter_all(self, get, iter_cursor): cpath in pagerduty.rest_api_v2_client.CURSOR_BASED_PAGINATION_PATHS ) iter_cursor.return_value = [] - self.assertEqual([], list(sess.iter_all('/audit/records'))) - iter_cursor.assert_called_once_with('/audit/records', params=None) + passed_kw = { + 'params': { + "since": "2025-01-01T00:00:00Z", + "until": "2025-05-19T00:00:00Z" + }, + 'item_hook': lambda x, y, z: print(f"{x}: {y}/{z}"), + 'page_size': 42 + } + self.assertEqual([], list(sess.iter_all('/audit/records', **passed_kw))) + iter_cursor.assert_called_once_with('/audit/records', **passed_kw) # Test: user tries to use iter_all on a singular resource, raise error: self.assertRaises(