capo-codeguruprofiler 0.3.0__tar.gz → 0.5.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (188) hide show
  1. {capo_codeguruprofiler-0.3.0/src/capo_codeguruprofiler.egg-info → capo_codeguruprofiler-0.5.0}/PKG-INFO +2 -2
  2. {capo_codeguruprofiler-0.3.0 → capo_codeguruprofiler-0.5.0}/pyproject.toml +2 -2
  3. {capo_codeguruprofiler-0.3.0 → capo_codeguruprofiler-0.5.0}/src/capo_codeguruprofiler/_auth/_signers.py +54 -17
  4. {capo_codeguruprofiler-0.3.0 → capo_codeguruprofiler-0.5.0}/src/capo_codeguruprofiler/_auth/_sigv4.py +164 -19
  5. {capo_codeguruprofiler-0.3.0 → capo_codeguruprofiler-0.5.0}/src/capo_codeguruprofiler/_operations/code_guru_profiler/add_notification_channels.py +3 -2
  6. {capo_codeguruprofiler-0.3.0 → capo_codeguruprofiler-0.5.0}/src/capo_codeguruprofiler/_operations/code_guru_profiler/batch_get_frame_metric_data.py +3 -2
  7. {capo_codeguruprofiler-0.3.0 → capo_codeguruprofiler-0.5.0}/src/capo_codeguruprofiler/_operations/code_guru_profiler/configure_agent.py +3 -2
  8. {capo_codeguruprofiler-0.3.0 → capo_codeguruprofiler-0.5.0}/src/capo_codeguruprofiler/_operations/code_guru_profiler/create_profiling_group.py +3 -2
  9. {capo_codeguruprofiler-0.3.0 → capo_codeguruprofiler-0.5.0}/src/capo_codeguruprofiler/_operations/code_guru_profiler/delete_profiling_group.py +3 -2
  10. {capo_codeguruprofiler-0.3.0 → capo_codeguruprofiler-0.5.0}/src/capo_codeguruprofiler/_operations/code_guru_profiler/describe_profiling_group.py +3 -2
  11. {capo_codeguruprofiler-0.3.0 → capo_codeguruprofiler-0.5.0}/src/capo_codeguruprofiler/_operations/code_guru_profiler/get_findings_report_account_summary.py +3 -2
  12. {capo_codeguruprofiler-0.3.0 → capo_codeguruprofiler-0.5.0}/src/capo_codeguruprofiler/_operations/code_guru_profiler/get_notification_configuration.py +3 -2
  13. {capo_codeguruprofiler-0.3.0 → capo_codeguruprofiler-0.5.0}/src/capo_codeguruprofiler/_operations/code_guru_profiler/get_policy.py +3 -2
  14. {capo_codeguruprofiler-0.3.0 → capo_codeguruprofiler-0.5.0}/src/capo_codeguruprofiler/_operations/code_guru_profiler/get_profile.py +3 -2
  15. {capo_codeguruprofiler-0.3.0 → capo_codeguruprofiler-0.5.0}/src/capo_codeguruprofiler/_operations/code_guru_profiler/get_recommendations.py +3 -2
  16. {capo_codeguruprofiler-0.3.0 → capo_codeguruprofiler-0.5.0}/src/capo_codeguruprofiler/_operations/code_guru_profiler/list_findings_reports.py +3 -2
  17. {capo_codeguruprofiler-0.3.0 → capo_codeguruprofiler-0.5.0}/src/capo_codeguruprofiler/_operations/code_guru_profiler/list_profile_times.py +3 -2
  18. {capo_codeguruprofiler-0.3.0 → capo_codeguruprofiler-0.5.0}/src/capo_codeguruprofiler/_operations/code_guru_profiler/list_profiling_groups.py +3 -2
  19. {capo_codeguruprofiler-0.3.0 → capo_codeguruprofiler-0.5.0}/src/capo_codeguruprofiler/_operations/code_guru_profiler/list_tags_for_resource.py +3 -2
  20. {capo_codeguruprofiler-0.3.0 → capo_codeguruprofiler-0.5.0}/src/capo_codeguruprofiler/_operations/code_guru_profiler/post_agent_profile.py +3 -2
  21. {capo_codeguruprofiler-0.3.0 → capo_codeguruprofiler-0.5.0}/src/capo_codeguruprofiler/_operations/code_guru_profiler/put_permission.py +3 -2
  22. {capo_codeguruprofiler-0.3.0 → capo_codeguruprofiler-0.5.0}/src/capo_codeguruprofiler/_operations/code_guru_profiler/remove_notification_channel.py +3 -2
  23. {capo_codeguruprofiler-0.3.0 → capo_codeguruprofiler-0.5.0}/src/capo_codeguruprofiler/_operations/code_guru_profiler/remove_permission.py +3 -2
  24. {capo_codeguruprofiler-0.3.0 → capo_codeguruprofiler-0.5.0}/src/capo_codeguruprofiler/_operations/code_guru_profiler/submit_feedback.py +3 -2
  25. {capo_codeguruprofiler-0.3.0 → capo_codeguruprofiler-0.5.0}/src/capo_codeguruprofiler/_operations/code_guru_profiler/tag_resource.py +3 -2
  26. {capo_codeguruprofiler-0.3.0 → capo_codeguruprofiler-0.5.0}/src/capo_codeguruprofiler/_operations/code_guru_profiler/untag_resource.py +3 -2
  27. {capo_codeguruprofiler-0.3.0 → capo_codeguruprofiler-0.5.0}/src/capo_codeguruprofiler/_operations/code_guru_profiler/update_profiling_group.py +3 -2
  28. {capo_codeguruprofiler-0.3.0 → capo_codeguruprofiler-0.5.0}/src/capo_codeguruprofiler/_protocol/eventstream.py +15 -13
  29. {capo_codeguruprofiler-0.3.0 → capo_codeguruprofiler-0.5.0}/src/capo_codeguruprofiler/_services/_pipeline.py +17 -0
  30. {capo_codeguruprofiler-0.3.0 → capo_codeguruprofiler-0.5.0/src/capo_codeguruprofiler.egg-info}/PKG-INFO +2 -2
  31. {capo_codeguruprofiler-0.3.0 → capo_codeguruprofiler-0.5.0}/tests/test_sigv4.py +217 -16
  32. {capo_codeguruprofiler-0.3.0 → capo_codeguruprofiler-0.5.0}/LICENSE +0 -0
  33. {capo_codeguruprofiler-0.3.0 → capo_codeguruprofiler-0.5.0}/README.md +0 -0
  34. {capo_codeguruprofiler-0.3.0 → capo_codeguruprofiler-0.5.0}/setup.cfg +0 -0
  35. {capo_codeguruprofiler-0.3.0 → capo_codeguruprofiler-0.5.0}/src/capo_codeguruprofiler/__init__.py +0 -0
  36. {capo_codeguruprofiler-0.3.0 → capo_codeguruprofiler-0.5.0}/src/capo_codeguruprofiler/_async.py +0 -0
  37. {capo_codeguruprofiler-0.3.0 → capo_codeguruprofiler-0.5.0}/src/capo_codeguruprofiler/_auth/_identity.py +0 -0
  38. {capo_codeguruprofiler-0.3.0 → capo_codeguruprofiler-0.5.0}/src/capo_codeguruprofiler/_auth/_providers.py +0 -0
  39. {capo_codeguruprofiler-0.3.0 → capo_codeguruprofiler-0.5.0}/src/capo_codeguruprofiler/_auth/_zapros_handler.py +0 -0
  40. {capo_codeguruprofiler-0.3.0 → capo_codeguruprofiler-0.5.0}/src/capo_codeguruprofiler/_body.py +0 -0
  41. {capo_codeguruprofiler-0.3.0 → capo_codeguruprofiler-0.5.0}/src/capo_codeguruprofiler/_iter.py +0 -0
  42. {capo_codeguruprofiler-0.3.0 → capo_codeguruprofiler-0.5.0}/src/capo_codeguruprofiler/_pagination.py +0 -0
  43. {capo_codeguruprofiler-0.3.0 → capo_codeguruprofiler-0.5.0}/src/capo_codeguruprofiler/_protocol/__init__.py +0 -0
  44. {capo_codeguruprofiler-0.3.0 → capo_codeguruprofiler-0.5.0}/src/capo_codeguruprofiler/_protocol/errors.py +0 -0
  45. {capo_codeguruprofiler-0.3.0 → capo_codeguruprofiler-0.5.0}/src/capo_codeguruprofiler/_protocol/serialize.py +0 -0
  46. {capo_codeguruprofiler-0.3.0 → capo_codeguruprofiler-0.5.0}/src/capo_codeguruprofiler/_protocol/xml.py +0 -0
  47. {capo_codeguruprofiler-0.3.0 → capo_codeguruprofiler-0.5.0}/src/capo_codeguruprofiler/_resources/code_guru_profiler/profiling_group.py +0 -0
  48. {capo_codeguruprofiler-0.3.0 → capo_codeguruprofiler-0.5.0}/src/capo_codeguruprofiler/_rule_engine/__init__.py +0 -0
  49. {capo_codeguruprofiler-0.3.0 → capo_codeguruprofiler-0.5.0}/src/capo_codeguruprofiler/_rule_engine/_aws_partition.py +0 -0
  50. {capo_codeguruprofiler-0.3.0 → capo_codeguruprofiler-0.5.0}/src/capo_codeguruprofiler/_rule_engine/_endpoint_rule_set.py +0 -0
  51. {capo_codeguruprofiler-0.3.0 → capo_codeguruprofiler-0.5.0}/src/capo_codeguruprofiler/_rule_engine/_endpoint_runtime.py +0 -0
  52. {capo_codeguruprofiler-0.3.0 → capo_codeguruprofiler-0.5.0}/src/capo_codeguruprofiler/_services/_aws_config.py +0 -0
  53. {capo_codeguruprofiler-0.3.0 → capo_codeguruprofiler-0.5.0}/src/capo_codeguruprofiler/_services/async_code_guru_profiler.py +0 -0
  54. {capo_codeguruprofiler-0.3.0 → capo_codeguruprofiler-0.5.0}/src/capo_codeguruprofiler/_services/code_guru_profiler.py +0 -0
  55. {capo_codeguruprofiler-0.3.0 → capo_codeguruprofiler-0.5.0}/src/capo_codeguruprofiler/errors/__init__.py +0 -0
  56. {capo_codeguruprofiler-0.3.0 → capo_codeguruprofiler-0.5.0}/src/capo_codeguruprofiler/errors/_base.py +0 -0
  57. {capo_codeguruprofiler-0.3.0 → capo_codeguruprofiler-0.5.0}/src/capo_codeguruprofiler/errors/conflict_exception.py +0 -0
  58. {capo_codeguruprofiler-0.3.0 → capo_codeguruprofiler-0.5.0}/src/capo_codeguruprofiler/errors/internal_server_exception.py +0 -0
  59. {capo_codeguruprofiler-0.3.0 → capo_codeguruprofiler-0.5.0}/src/capo_codeguruprofiler/errors/resource_not_found_exception.py +0 -0
  60. {capo_codeguruprofiler-0.3.0 → capo_codeguruprofiler-0.5.0}/src/capo_codeguruprofiler/errors/service_quota_exceeded_exception.py +0 -0
  61. {capo_codeguruprofiler-0.3.0 → capo_codeguruprofiler-0.5.0}/src/capo_codeguruprofiler/errors/throttling_exception.py +0 -0
  62. {capo_codeguruprofiler-0.3.0 → capo_codeguruprofiler-0.5.0}/src/capo_codeguruprofiler/errors/validation_exception.py +0 -0
  63. {capo_codeguruprofiler-0.3.0 → capo_codeguruprofiler-0.5.0}/src/capo_codeguruprofiler/py.typed +0 -0
  64. {capo_codeguruprofiler-0.3.0 → capo_codeguruprofiler-0.5.0}/src/capo_codeguruprofiler/types/_prelude/blob.py +0 -0
  65. {capo_codeguruprofiler-0.3.0 → capo_codeguruprofiler-0.5.0}/src/capo_codeguruprofiler/types/_prelude/timestamp.py +0 -0
  66. {capo_codeguruprofiler-0.3.0 → capo_codeguruprofiler-0.5.0}/src/capo_codeguruprofiler/types/action_group.py +0 -0
  67. {capo_codeguruprofiler-0.3.0 → capo_codeguruprofiler-0.5.0}/src/capo_codeguruprofiler/types/add_notification_channels_request.py +0 -0
  68. {capo_codeguruprofiler-0.3.0 → capo_codeguruprofiler-0.5.0}/src/capo_codeguruprofiler/types/add_notification_channels_response.py +0 -0
  69. {capo_codeguruprofiler-0.3.0 → capo_codeguruprofiler-0.5.0}/src/capo_codeguruprofiler/types/agent_configuration.py +0 -0
  70. {capo_codeguruprofiler-0.3.0 → capo_codeguruprofiler-0.5.0}/src/capo_codeguruprofiler/types/agent_orchestration_config.py +0 -0
  71. {capo_codeguruprofiler-0.3.0 → capo_codeguruprofiler-0.5.0}/src/capo_codeguruprofiler/types/agent_parameter_field.py +0 -0
  72. {capo_codeguruprofiler-0.3.0 → capo_codeguruprofiler-0.5.0}/src/capo_codeguruprofiler/types/agent_parameters.py +0 -0
  73. {capo_codeguruprofiler-0.3.0 → capo_codeguruprofiler-0.5.0}/src/capo_codeguruprofiler/types/agent_profile.py +0 -0
  74. {capo_codeguruprofiler-0.3.0 → capo_codeguruprofiler-0.5.0}/src/capo_codeguruprofiler/types/aggregated_profile.py +0 -0
  75. {capo_codeguruprofiler-0.3.0 → capo_codeguruprofiler-0.5.0}/src/capo_codeguruprofiler/types/aggregated_profile_time.py +0 -0
  76. {capo_codeguruprofiler-0.3.0 → capo_codeguruprofiler-0.5.0}/src/capo_codeguruprofiler/types/aggregation_period.py +0 -0
  77. {capo_codeguruprofiler-0.3.0 → capo_codeguruprofiler-0.5.0}/src/capo_codeguruprofiler/types/anomalies.py +0 -0
  78. {capo_codeguruprofiler-0.3.0 → capo_codeguruprofiler-0.5.0}/src/capo_codeguruprofiler/types/anomaly.py +0 -0
  79. {capo_codeguruprofiler-0.3.0 → capo_codeguruprofiler-0.5.0}/src/capo_codeguruprofiler/types/anomaly_instance.py +0 -0
  80. {capo_codeguruprofiler-0.3.0 → capo_codeguruprofiler-0.5.0}/src/capo_codeguruprofiler/types/anomaly_instance_id.py +0 -0
  81. {capo_codeguruprofiler-0.3.0 → capo_codeguruprofiler-0.5.0}/src/capo_codeguruprofiler/types/anomaly_instances.py +0 -0
  82. {capo_codeguruprofiler-0.3.0 → capo_codeguruprofiler-0.5.0}/src/capo_codeguruprofiler/types/batch_get_frame_metric_data_request.py +0 -0
  83. {capo_codeguruprofiler-0.3.0 → capo_codeguruprofiler-0.5.0}/src/capo_codeguruprofiler/types/batch_get_frame_metric_data_response.py +0 -0
  84. {capo_codeguruprofiler-0.3.0 → capo_codeguruprofiler-0.5.0}/src/capo_codeguruprofiler/types/channel.py +0 -0
  85. {capo_codeguruprofiler-0.3.0 → capo_codeguruprofiler-0.5.0}/src/capo_codeguruprofiler/types/channel_id.py +0 -0
  86. {capo_codeguruprofiler-0.3.0 → capo_codeguruprofiler-0.5.0}/src/capo_codeguruprofiler/types/channel_uri.py +0 -0
  87. {capo_codeguruprofiler-0.3.0 → capo_codeguruprofiler-0.5.0}/src/capo_codeguruprofiler/types/channels.py +0 -0
  88. {capo_codeguruprofiler-0.3.0 → capo_codeguruprofiler-0.5.0}/src/capo_codeguruprofiler/types/client_token.py +0 -0
  89. {capo_codeguruprofiler-0.3.0 → capo_codeguruprofiler-0.5.0}/src/capo_codeguruprofiler/types/compute_platform.py +0 -0
  90. {capo_codeguruprofiler-0.3.0 → capo_codeguruprofiler-0.5.0}/src/capo_codeguruprofiler/types/configure_agent_request.py +0 -0
  91. {capo_codeguruprofiler-0.3.0 → capo_codeguruprofiler-0.5.0}/src/capo_codeguruprofiler/types/configure_agent_response.py +0 -0
  92. {capo_codeguruprofiler-0.3.0 → capo_codeguruprofiler-0.5.0}/src/capo_codeguruprofiler/types/create_profiling_group_request.py +0 -0
  93. {capo_codeguruprofiler-0.3.0 → capo_codeguruprofiler-0.5.0}/src/capo_codeguruprofiler/types/create_profiling_group_response.py +0 -0
  94. {capo_codeguruprofiler-0.3.0 → capo_codeguruprofiler-0.5.0}/src/capo_codeguruprofiler/types/delete_profiling_group_request.py +0 -0
  95. {capo_codeguruprofiler-0.3.0 → capo_codeguruprofiler-0.5.0}/src/capo_codeguruprofiler/types/delete_profiling_group_response.py +0 -0
  96. {capo_codeguruprofiler-0.3.0 → capo_codeguruprofiler-0.5.0}/src/capo_codeguruprofiler/types/describe_profiling_group_request.py +0 -0
  97. {capo_codeguruprofiler-0.3.0 → capo_codeguruprofiler-0.5.0}/src/capo_codeguruprofiler/types/describe_profiling_group_response.py +0 -0
  98. {capo_codeguruprofiler-0.3.0 → capo_codeguruprofiler-0.5.0}/src/capo_codeguruprofiler/types/event_publisher.py +0 -0
  99. {capo_codeguruprofiler-0.3.0 → capo_codeguruprofiler-0.5.0}/src/capo_codeguruprofiler/types/event_publishers.py +0 -0
  100. {capo_codeguruprofiler-0.3.0 → capo_codeguruprofiler-0.5.0}/src/capo_codeguruprofiler/types/feedback_type.py +0 -0
  101. {capo_codeguruprofiler-0.3.0 → capo_codeguruprofiler-0.5.0}/src/capo_codeguruprofiler/types/findings_report_id.py +0 -0
  102. {capo_codeguruprofiler-0.3.0 → capo_codeguruprofiler-0.5.0}/src/capo_codeguruprofiler/types/findings_report_summaries.py +0 -0
  103. {capo_codeguruprofiler-0.3.0 → capo_codeguruprofiler-0.5.0}/src/capo_codeguruprofiler/types/findings_report_summary.py +0 -0
  104. {capo_codeguruprofiler-0.3.0 → capo_codeguruprofiler-0.5.0}/src/capo_codeguruprofiler/types/fleet_instance_id.py +0 -0
  105. {capo_codeguruprofiler-0.3.0 → capo_codeguruprofiler-0.5.0}/src/capo_codeguruprofiler/types/frame_metric.py +0 -0
  106. {capo_codeguruprofiler-0.3.0 → capo_codeguruprofiler-0.5.0}/src/capo_codeguruprofiler/types/frame_metric_data.py +0 -0
  107. {capo_codeguruprofiler-0.3.0 → capo_codeguruprofiler-0.5.0}/src/capo_codeguruprofiler/types/frame_metric_datum.py +0 -0
  108. {capo_codeguruprofiler-0.3.0 → capo_codeguruprofiler-0.5.0}/src/capo_codeguruprofiler/types/frame_metric_value.py +0 -0
  109. {capo_codeguruprofiler-0.3.0 → capo_codeguruprofiler-0.5.0}/src/capo_codeguruprofiler/types/frame_metric_values.py +0 -0
  110. {capo_codeguruprofiler-0.3.0 → capo_codeguruprofiler-0.5.0}/src/capo_codeguruprofiler/types/frame_metrics.py +0 -0
  111. {capo_codeguruprofiler-0.3.0 → capo_codeguruprofiler-0.5.0}/src/capo_codeguruprofiler/types/get_findings_report_account_summary_request.py +0 -0
  112. {capo_codeguruprofiler-0.3.0 → capo_codeguruprofiler-0.5.0}/src/capo_codeguruprofiler/types/get_findings_report_account_summary_response.py +0 -0
  113. {capo_codeguruprofiler-0.3.0 → capo_codeguruprofiler-0.5.0}/src/capo_codeguruprofiler/types/get_notification_configuration_request.py +0 -0
  114. {capo_codeguruprofiler-0.3.0 → capo_codeguruprofiler-0.5.0}/src/capo_codeguruprofiler/types/get_notification_configuration_response.py +0 -0
  115. {capo_codeguruprofiler-0.3.0 → capo_codeguruprofiler-0.5.0}/src/capo_codeguruprofiler/types/get_policy_request.py +0 -0
  116. {capo_codeguruprofiler-0.3.0 → capo_codeguruprofiler-0.5.0}/src/capo_codeguruprofiler/types/get_policy_response.py +0 -0
  117. {capo_codeguruprofiler-0.3.0 → capo_codeguruprofiler-0.5.0}/src/capo_codeguruprofiler/types/get_profile_request.py +0 -0
  118. {capo_codeguruprofiler-0.3.0 → capo_codeguruprofiler-0.5.0}/src/capo_codeguruprofiler/types/get_profile_response.py +0 -0
  119. {capo_codeguruprofiler-0.3.0 → capo_codeguruprofiler-0.5.0}/src/capo_codeguruprofiler/types/get_recommendations_request.py +0 -0
  120. {capo_codeguruprofiler-0.3.0 → capo_codeguruprofiler-0.5.0}/src/capo_codeguruprofiler/types/get_recommendations_response.py +0 -0
  121. {capo_codeguruprofiler-0.3.0 → capo_codeguruprofiler-0.5.0}/src/capo_codeguruprofiler/types/list_findings_reports_request.py +0 -0
  122. {capo_codeguruprofiler-0.3.0 → capo_codeguruprofiler-0.5.0}/src/capo_codeguruprofiler/types/list_findings_reports_response.py +0 -0
  123. {capo_codeguruprofiler-0.3.0 → capo_codeguruprofiler-0.5.0}/src/capo_codeguruprofiler/types/list_of_timestamps.py +0 -0
  124. {capo_codeguruprofiler-0.3.0 → capo_codeguruprofiler-0.5.0}/src/capo_codeguruprofiler/types/list_profile_times_request.py +0 -0
  125. {capo_codeguruprofiler-0.3.0 → capo_codeguruprofiler-0.5.0}/src/capo_codeguruprofiler/types/list_profile_times_response.py +0 -0
  126. {capo_codeguruprofiler-0.3.0 → capo_codeguruprofiler-0.5.0}/src/capo_codeguruprofiler/types/list_profiling_groups_request.py +0 -0
  127. {capo_codeguruprofiler-0.3.0 → capo_codeguruprofiler-0.5.0}/src/capo_codeguruprofiler/types/list_profiling_groups_response.py +0 -0
  128. {capo_codeguruprofiler-0.3.0 → capo_codeguruprofiler-0.5.0}/src/capo_codeguruprofiler/types/list_tags_for_resource_request.py +0 -0
  129. {capo_codeguruprofiler-0.3.0 → capo_codeguruprofiler-0.5.0}/src/capo_codeguruprofiler/types/list_tags_for_resource_response.py +0 -0
  130. {capo_codeguruprofiler-0.3.0 → capo_codeguruprofiler-0.5.0}/src/capo_codeguruprofiler/types/locale.py +0 -0
  131. {capo_codeguruprofiler-0.3.0 → capo_codeguruprofiler-0.5.0}/src/capo_codeguruprofiler/types/match.py +0 -0
  132. {capo_codeguruprofiler-0.3.0 → capo_codeguruprofiler-0.5.0}/src/capo_codeguruprofiler/types/matches.py +0 -0
  133. {capo_codeguruprofiler-0.3.0 → capo_codeguruprofiler-0.5.0}/src/capo_codeguruprofiler/types/max_depth.py +0 -0
  134. {capo_codeguruprofiler-0.3.0 → capo_codeguruprofiler-0.5.0}/src/capo_codeguruprofiler/types/max_results.py +0 -0
  135. {capo_codeguruprofiler-0.3.0 → capo_codeguruprofiler-0.5.0}/src/capo_codeguruprofiler/types/metadata.py +0 -0
  136. {capo_codeguruprofiler-0.3.0 → capo_codeguruprofiler-0.5.0}/src/capo_codeguruprofiler/types/metadata_field.py +0 -0
  137. {capo_codeguruprofiler-0.3.0 → capo_codeguruprofiler-0.5.0}/src/capo_codeguruprofiler/types/metric.py +0 -0
  138. {capo_codeguruprofiler-0.3.0 → capo_codeguruprofiler-0.5.0}/src/capo_codeguruprofiler/types/metric_type.py +0 -0
  139. {capo_codeguruprofiler-0.3.0 → capo_codeguruprofiler-0.5.0}/src/capo_codeguruprofiler/types/notification_configuration.py +0 -0
  140. {capo_codeguruprofiler-0.3.0 → capo_codeguruprofiler-0.5.0}/src/capo_codeguruprofiler/types/order_by.py +0 -0
  141. {capo_codeguruprofiler-0.3.0 → capo_codeguruprofiler-0.5.0}/src/capo_codeguruprofiler/types/pagination_token.py +0 -0
  142. {capo_codeguruprofiler-0.3.0 → capo_codeguruprofiler-0.5.0}/src/capo_codeguruprofiler/types/pattern.py +0 -0
  143. {capo_codeguruprofiler-0.3.0 → capo_codeguruprofiler-0.5.0}/src/capo_codeguruprofiler/types/percentage.py +0 -0
  144. {capo_codeguruprofiler-0.3.0 → capo_codeguruprofiler-0.5.0}/src/capo_codeguruprofiler/types/period.py +0 -0
  145. {capo_codeguruprofiler-0.3.0 → capo_codeguruprofiler-0.5.0}/src/capo_codeguruprofiler/types/post_agent_profile_request.py +0 -0
  146. {capo_codeguruprofiler-0.3.0 → capo_codeguruprofiler-0.5.0}/src/capo_codeguruprofiler/types/post_agent_profile_response.py +0 -0
  147. {capo_codeguruprofiler-0.3.0 → capo_codeguruprofiler-0.5.0}/src/capo_codeguruprofiler/types/principal.py +0 -0
  148. {capo_codeguruprofiler-0.3.0 → capo_codeguruprofiler-0.5.0}/src/capo_codeguruprofiler/types/principals.py +0 -0
  149. {capo_codeguruprofiler-0.3.0 → capo_codeguruprofiler-0.5.0}/src/capo_codeguruprofiler/types/profile_time.py +0 -0
  150. {capo_codeguruprofiler-0.3.0 → capo_codeguruprofiler-0.5.0}/src/capo_codeguruprofiler/types/profile_times.py +0 -0
  151. {capo_codeguruprofiler-0.3.0 → capo_codeguruprofiler-0.5.0}/src/capo_codeguruprofiler/types/profiling_group_arn.py +0 -0
  152. {capo_codeguruprofiler-0.3.0 → capo_codeguruprofiler-0.5.0}/src/capo_codeguruprofiler/types/profiling_group_description.py +0 -0
  153. {capo_codeguruprofiler-0.3.0 → capo_codeguruprofiler-0.5.0}/src/capo_codeguruprofiler/types/profiling_group_descriptions.py +0 -0
  154. {capo_codeguruprofiler-0.3.0 → capo_codeguruprofiler-0.5.0}/src/capo_codeguruprofiler/types/profiling_group_name.py +0 -0
  155. {capo_codeguruprofiler-0.3.0 → capo_codeguruprofiler-0.5.0}/src/capo_codeguruprofiler/types/profiling_group_names.py +0 -0
  156. {capo_codeguruprofiler-0.3.0 → capo_codeguruprofiler-0.5.0}/src/capo_codeguruprofiler/types/profiling_status.py +0 -0
  157. {capo_codeguruprofiler-0.3.0 → capo_codeguruprofiler-0.5.0}/src/capo_codeguruprofiler/types/put_permission_request.py +0 -0
  158. {capo_codeguruprofiler-0.3.0 → capo_codeguruprofiler-0.5.0}/src/capo_codeguruprofiler/types/put_permission_response.py +0 -0
  159. {capo_codeguruprofiler-0.3.0 → capo_codeguruprofiler-0.5.0}/src/capo_codeguruprofiler/types/recommendation.py +0 -0
  160. {capo_codeguruprofiler-0.3.0 → capo_codeguruprofiler-0.5.0}/src/capo_codeguruprofiler/types/recommendations.py +0 -0
  161. {capo_codeguruprofiler-0.3.0 → capo_codeguruprofiler-0.5.0}/src/capo_codeguruprofiler/types/remove_notification_channel_request.py +0 -0
  162. {capo_codeguruprofiler-0.3.0 → capo_codeguruprofiler-0.5.0}/src/capo_codeguruprofiler/types/remove_notification_channel_response.py +0 -0
  163. {capo_codeguruprofiler-0.3.0 → capo_codeguruprofiler-0.5.0}/src/capo_codeguruprofiler/types/remove_permission_request.py +0 -0
  164. {capo_codeguruprofiler-0.3.0 → capo_codeguruprofiler-0.5.0}/src/capo_codeguruprofiler/types/remove_permission_response.py +0 -0
  165. {capo_codeguruprofiler-0.3.0 → capo_codeguruprofiler-0.5.0}/src/capo_codeguruprofiler/types/revision_id.py +0 -0
  166. {capo_codeguruprofiler-0.3.0 → capo_codeguruprofiler-0.5.0}/src/capo_codeguruprofiler/types/strings.py +0 -0
  167. {capo_codeguruprofiler-0.3.0 → capo_codeguruprofiler-0.5.0}/src/capo_codeguruprofiler/types/submit_feedback_request.py +0 -0
  168. {capo_codeguruprofiler-0.3.0 → capo_codeguruprofiler-0.5.0}/src/capo_codeguruprofiler/types/submit_feedback_response.py +0 -0
  169. {capo_codeguruprofiler-0.3.0 → capo_codeguruprofiler-0.5.0}/src/capo_codeguruprofiler/types/tag_keys.py +0 -0
  170. {capo_codeguruprofiler-0.3.0 → capo_codeguruprofiler-0.5.0}/src/capo_codeguruprofiler/types/tag_resource_request.py +0 -0
  171. {capo_codeguruprofiler-0.3.0 → capo_codeguruprofiler-0.5.0}/src/capo_codeguruprofiler/types/tag_resource_response.py +0 -0
  172. {capo_codeguruprofiler-0.3.0 → capo_codeguruprofiler-0.5.0}/src/capo_codeguruprofiler/types/tags_map.py +0 -0
  173. {capo_codeguruprofiler-0.3.0 → capo_codeguruprofiler-0.5.0}/src/capo_codeguruprofiler/types/target_frame.py +0 -0
  174. {capo_codeguruprofiler-0.3.0 → capo_codeguruprofiler-0.5.0}/src/capo_codeguruprofiler/types/target_frames.py +0 -0
  175. {capo_codeguruprofiler-0.3.0 → capo_codeguruprofiler-0.5.0}/src/capo_codeguruprofiler/types/thread_states.py +0 -0
  176. {capo_codeguruprofiler-0.3.0 → capo_codeguruprofiler-0.5.0}/src/capo_codeguruprofiler/types/timestamp.py +0 -0
  177. {capo_codeguruprofiler-0.3.0 → capo_codeguruprofiler-0.5.0}/src/capo_codeguruprofiler/types/timestamp_structure.py +0 -0
  178. {capo_codeguruprofiler-0.3.0 → capo_codeguruprofiler-0.5.0}/src/capo_codeguruprofiler/types/unprocessed_end_time_map.py +0 -0
  179. {capo_codeguruprofiler-0.3.0 → capo_codeguruprofiler-0.5.0}/src/capo_codeguruprofiler/types/untag_resource_request.py +0 -0
  180. {capo_codeguruprofiler-0.3.0 → capo_codeguruprofiler-0.5.0}/src/capo_codeguruprofiler/types/untag_resource_response.py +0 -0
  181. {capo_codeguruprofiler-0.3.0 → capo_codeguruprofiler-0.5.0}/src/capo_codeguruprofiler/types/update_profiling_group_request.py +0 -0
  182. {capo_codeguruprofiler-0.3.0 → capo_codeguruprofiler-0.5.0}/src/capo_codeguruprofiler/types/update_profiling_group_response.py +0 -0
  183. {capo_codeguruprofiler-0.3.0 → capo_codeguruprofiler-0.5.0}/src/capo_codeguruprofiler/types/user_feedback.py +0 -0
  184. {capo_codeguruprofiler-0.3.0 → capo_codeguruprofiler-0.5.0}/src/capo_codeguruprofiler.egg-info/SOURCES.txt +0 -0
  185. {capo_codeguruprofiler-0.3.0 → capo_codeguruprofiler-0.5.0}/src/capo_codeguruprofiler.egg-info/dependency_links.txt +0 -0
  186. {capo_codeguruprofiler-0.3.0 → capo_codeguruprofiler-0.5.0}/src/capo_codeguruprofiler.egg-info/requires.txt +0 -0
  187. {capo_codeguruprofiler-0.3.0 → capo_codeguruprofiler-0.5.0}/src/capo_codeguruprofiler.egg-info/top_level.txt +0 -0
  188. {capo_codeguruprofiler-0.3.0 → capo_codeguruprofiler-0.5.0}/tests/test_body.py +0 -0
@@ -1,7 +1,7 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: capo-codeguruprofiler
3
- Version: 0.3.0
4
- Summary: Python SDK for Codeguruprofiler.
3
+ Version: 0.5.0
4
+ Summary: Python SDK for AWS Codeguruprofiler.
5
5
  Classifier: Development Status :: 4 - Beta
6
6
  Classifier: Intended Audience :: Developers
7
7
  Classifier: License :: OSI Approved :: MIT License
@@ -1,7 +1,7 @@
1
1
  [project]
2
2
  name = "capo-codeguruprofiler"
3
- version = "0.3.0"
4
- description = "Python SDK for Codeguruprofiler."
3
+ version = "0.5.0"
4
+ description = "Python SDK for AWS Codeguruprofiler."
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.10"
7
7
  classifiers = [
@@ -7,7 +7,11 @@ from zapros import Request
7
7
 
8
8
  from capo_codeguruprofiler._auth._identity import Credentials, Identity
9
9
  from capo_codeguruprofiler._auth._providers import IdentityProvider
10
- from capo_codeguruprofiler._auth._sigv4 import SigV4AuthContext, sign_sigv4
10
+ from capo_codeguruprofiler._auth._sigv4 import (
11
+ S3_SIGNING_NAMES,
12
+ SigV4AuthContext,
13
+ sign_sigv4,
14
+ )
11
15
 
12
16
  IdentityT = TypeVar("IdentityT", bound="Identity")
13
17
 
@@ -30,14 +34,25 @@ class SigV4Signer(Signer[Credentials]):
30
34
  The full auth scheme (``name`` variant, ``signingName``, ``signingRegion``,
31
35
  encoding/normalization flags) is provided by the caller — either from the
32
36
  endpoint rule-set's ``authSchemes`` property or built by the generated
33
- ``get_signer`` from operation defaults.
37
+ ``get_signer`` from operation defaults. ``unsigned_payload`` mirrors the
38
+ operation's ``aws.auth#unsignedPayload`` trait: the body is sent but left
39
+ out of the signature. ``event_stream`` marks a request event stream: the
40
+ request is signed with the ``STREAMING-AWS4-HMAC-SHA256-EVENTS`` payload
41
+ marker and every event with a signature chained from it.
34
42
  """
35
43
 
36
44
  def __init__(
37
- self, provider: IdentityProvider[Credentials], *, auth_scheme: dict[str, Any]
45
+ self,
46
+ provider: IdentityProvider[Credentials],
47
+ *,
48
+ auth_scheme: dict[str, Any],
49
+ unsigned_payload: bool = False,
50
+ event_stream: bool = False,
38
51
  ) -> None:
39
52
  super().__init__(provider)
40
53
  self._auth_scheme = auth_scheme
54
+ self._unsigned_payload = unsigned_payload
55
+ self._event_stream = event_stream
41
56
 
42
57
  async def asign(self, req: Request) -> Request:
43
58
  creds = await self.provider.aresolve_identity()
@@ -55,13 +70,24 @@ class SigV4Signer(Signer[Credentials]):
55
70
  "disableNormalizePath", False
56
71
  ),
57
72
  }
58
- if req.body is None:
59
- body: bytes | None = b""
60
- elif isinstance(req.body, bytes):
61
- body = req.body
62
- else:
63
- body = None
64
- return sign_sigv4(req, ctx, body)
73
+ unsigned_payload = self._unsigned_payload
74
+ if (
75
+ not unsigned_payload
76
+ and not self._event_stream
77
+ and req.body is not None
78
+ and not isinstance(req.body, bytes)
79
+ ):
80
+ if self._auth_scheme["signingName"] in S3_SIGNING_NAMES:
81
+ # S3 accepts UNSIGNED-PAYLOAD for any operation; streamed bodies rely on it.
82
+ unsigned_payload = True
83
+ else:
84
+ raise NotImplementedError(
85
+ "Currently we don't support signed chunked payloads, so buffer the body and "
86
+ "pass bytes as a workaround; chunked signed implementation coming soon"
87
+ )
88
+ return sign_sigv4(
89
+ req, ctx, unsigned_payload=unsigned_payload, event_stream=self._event_stream
90
+ )
65
91
 
66
92
  def sign(self, req: Request) -> Request:
67
93
  creds = self.provider.resolve_identity()
@@ -79,10 +105,21 @@ class SigV4Signer(Signer[Credentials]):
79
105
  "disableNormalizePath", False
80
106
  ),
81
107
  }
82
- if req.body is None:
83
- body: bytes | None = b""
84
- elif isinstance(req.body, bytes):
85
- body = req.body
86
- else:
87
- body = None
88
- return sign_sigv4(req, ctx, body)
108
+ unsigned_payload = self._unsigned_payload
109
+ if (
110
+ not unsigned_payload
111
+ and not self._event_stream
112
+ and req.body is not None
113
+ and not isinstance(req.body, bytes)
114
+ ):
115
+ if self._auth_scheme["signingName"] in S3_SIGNING_NAMES:
116
+ # S3 accepts UNSIGNED-PAYLOAD for any operation; streamed bodies rely on it.
117
+ unsigned_payload = True
118
+ else:
119
+ raise NotImplementedError(
120
+ "Currently we don't support signed chunked payloads, so buffer the body and "
121
+ "pass bytes as a workaround; chunked signed implementation coming soon"
122
+ )
123
+ return sign_sigv4(
124
+ req, ctx, unsigned_payload=unsigned_payload, event_stream=self._event_stream
125
+ )
@@ -1,4 +1,4 @@
1
- """AWS Signature Version 4 — single-chunk signing.
1
+ """AWS Signature Version 4 — single-chunk and event-stream signing.
2
2
 
3
3
  Reference:
4
4
  https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_sigv-create-signed-request.html
@@ -15,7 +15,8 @@ import functools
15
15
  import hashlib
16
16
  import hmac
17
17
  import re
18
- from typing import Any, Literal, TypedDict
18
+ from collections.abc import AsyncIterator, Iterator
19
+ from typing import Any, Literal, TypedDict, cast
19
20
  from urllib.parse import quote, unquote
20
21
 
21
22
  import zapros
@@ -23,6 +24,9 @@ from pywhatwgurl import URLSearchParams
23
24
  from zapros import Headers, Request
24
25
  from zapros._utils import get_host_header_value
25
26
 
27
+ from .._iter import AnyIterator
28
+ from .._protocol.eventstream import HeaderValue, Message, encode_headers
29
+
26
30
 
27
31
  def build_sigv4_auth_scheme(
28
32
  signing_name: str, region: str | None, endpoint_scheme: dict[str, Any] | None = None
@@ -65,6 +69,10 @@ class SigV4AuthContext(TypedDict):
65
69
 
66
70
 
67
71
  _SIGV4_ALGORITHM = "AWS4-HMAC-SHA256"
72
+ # Per-event algorithm and request payload marker of a signed event stream.
73
+ _EVENT_ALGORITHM = "AWS4-HMAC-SHA256-PAYLOAD"
74
+ _EVENT_STREAM_PAYLOAD = "STREAMING-AWS4-HMAC-SHA256-EVENTS"
75
+ _AMZ_DATE_FORMAT = "%Y%m%dT%H%M%SZ"
68
76
  _EMPTY_PAYLOAD_SHA256 = hashlib.sha256(b"").hexdigest()
69
77
 
70
78
  # Headers excluded from the signed-headers set. Mirrors botocore's denylist:
@@ -95,9 +103,11 @@ _UNSIGNED_HEADERS = frozenset(
95
103
 
96
104
  _MULTI_SPACE = re.compile(r" +")
97
105
 
98
- # Services that require the payload hash to travel in ``x-amz-content-sha256``.
99
- # Other services sign the hash into the canonical request without sending it.
100
- _S3_SIGNING_NAMES = frozenset({"s3", "s3express", "s3-outposts", "s3-object-lambda"})
106
+ # Services that require the payload hash to travel in ``x-amz-content-sha256``
107
+ # on every request, and that accept ``UNSIGNED-PAYLOAD`` for any operation.
108
+ # Other services sign the hash into the canonical request without sending it,
109
+ # and only see the header when the payload is left unsigned.
110
+ S3_SIGNING_NAMES = frozenset({"s3", "s3express", "s3-outposts", "s3-object-lambda"})
101
111
 
102
112
 
103
113
  def _uri_encode(value: str) -> str:
@@ -231,12 +241,20 @@ def _canonical_query_from_pairs(pairs: list[tuple[str, str]]) -> str:
231
241
  def sign_sigv4(
232
242
  request: Request,
233
243
  ctx: SigV4AuthContext,
234
- body: bytes | None,
244
+ *,
245
+ unsigned_payload: bool = False,
246
+ event_stream: bool = False,
235
247
  ) -> Request:
236
248
  """Return a new ``Request`` carrying SigV4 single-chunk auth headers.
237
249
 
238
- Pass ``body=None`` to sign with ``UNSIGNED-PAYLOAD`` (streaming requests).
239
- The original ``request.body`` is forwarded unchanged in that case.
250
+ The payload hash covers ``request.body``, which must be ``bytes`` or
251
+ ``None``. ``unsigned_payload`` signs ``UNSIGNED-PAYLOAD`` instead and
252
+ forwards any body unchanged (streaming S3 requests and operations carrying
253
+ ``aws.auth#unsignedPayload``). ``event_stream`` signs a request event
254
+ stream: the ``STREAMING-AWS4-HMAC-SHA256-EVENTS`` marker stands in for the
255
+ payload hash and the body — an iterator of encoded event messages — is
256
+ wrapped in an :class:`EventStreamIterator` that signs every event with a
257
+ signature chained from this request's.
240
258
  """
241
259
  service = ctx["signing_name"]
242
260
  region = ctx["signing_region"]
@@ -250,21 +268,31 @@ def sign_sigv4(
250
268
  date_stamp = amz_date[:8]
251
269
  else:
252
270
  now = _amz_now()
253
- amz_date = now.strftime("%Y%m%dT%H%M%SZ")
271
+ amz_date = now.strftime(_AMZ_DATE_FORMAT)
254
272
  date_stamp = now.strftime("%Y%m%d")
255
273
  headers["X-Amz-Date"] = amz_date
256
274
 
257
- # Payload hash. For S3-family services, x-amz-content-sha256 is mandatory
258
- # and must be set BEFORE computing the canonical request (it gets signed).
275
+ # Payload hash. For S3-family services, x-amz-content-sha256 is mandatory;
276
+ # for every service it is the only way to announce an unsigned payload or
277
+ # an event stream.
278
+ # Either way it must be set BEFORE computing the canonical request (it
279
+ # gets signed).
259
280
  payload_hash = headers.get("X-Amz-Content-SHA256")
260
281
  if payload_hash is None:
261
- if body is None:
282
+ if event_stream:
283
+ payload_hash = _EVENT_STREAM_PAYLOAD
284
+ elif unsigned_payload:
262
285
  payload_hash = "UNSIGNED-PAYLOAD"
286
+ elif request.body is None:
287
+ payload_hash = _EMPTY_PAYLOAD_SHA256
288
+ elif isinstance(request.body, bytes):
289
+ payload_hash = hashlib.sha256(request.body).hexdigest()
263
290
  else:
264
- payload_hash = (
265
- hashlib.sha256(body).hexdigest() if body else _EMPTY_PAYLOAD_SHA256
291
+ raise TypeError(
292
+ "sign_sigv4 hashes a bytes body only; pass unsigned_payload=True "
293
+ "to send a streamed body without a payload hash"
266
294
  )
267
- if service in _S3_SIGNING_NAMES:
295
+ if service in S3_SIGNING_NAMES or unsigned_payload or event_stream:
268
296
  headers["X-Amz-Content-SHA256"] = payload_hash
269
297
 
270
298
  # Session token (STS / assumed-role credentials).
@@ -308,18 +336,135 @@ def sign_sigv4(
308
336
  f"Signature={signature}"
309
337
  )
310
338
 
311
- effective_body = body if body is not None else request.body
312
- if effective_body is not None:
339
+ body = request.body
340
+ if event_stream:
341
+ if not isinstance(body, (Iterator, AsyncIterator)):
342
+ raise TypeError(
343
+ "event_stream requires an iterator of encoded events as the body"
344
+ )
345
+ body = EventStreamIterator(
346
+ cast("Iterator[bytes] | AsyncIterator[bytes]", body), ctx, signature
347
+ )
348
+ if body is not None:
313
349
  return Request(
314
350
  request.url,
315
351
  request.method,
316
352
  headers,
317
- body=effective_body,
353
+ body=body,
318
354
  context=request.context,
319
355
  )
320
356
  return Request(request.url, request.method, headers, context=request.context)
321
357
 
322
358
 
359
+ def _sign_event(
360
+ ctx: SigV4AuthContext, prior_signature: str, payload: bytes
361
+ ) -> tuple[bytes, str]:
362
+ """Wrap one encoded event in a signed outer message.
363
+
364
+ Returns ``(frame, signature)``; the hex signature seeds the next event.
365
+ The string to sign chains every frame to its predecessor — the first one
366
+ to the request's ``Authorization`` signature — so the service can verify
367
+ the stream incrementally::
368
+
369
+ AWS4-HMAC-SHA256-PAYLOAD
370
+ <date, YYYYMMDDTHHMMSSZ>
371
+ <credential scope>
372
+ <prior signature, hex>
373
+ <hex sha256 of the encoded ``:date`` header>
374
+ <hex sha256 of the payload>
375
+
376
+ The AWS SDKs (and the service) use the ``-PAYLOAD`` algorithm name; the
377
+ Transcribe developer guide's pseudocode omits the suffix.
378
+ """
379
+ service = ctx["signing_name"]
380
+ region = ctx["signing_region"]
381
+ now = _amz_now()
382
+ amz_date = now.strftime(_AMZ_DATE_FORMAT)
383
+ date_stamp = amz_date[:8]
384
+ credential_scope = f"{date_stamp}/{region}/{service}/aws4_request"
385
+ date_header: dict[str, HeaderValue] = {":date": now}
386
+ string_to_sign = "\n".join(
387
+ (
388
+ _EVENT_ALGORITHM,
389
+ amz_date,
390
+ credential_scope,
391
+ prior_signature,
392
+ hashlib.sha256(encode_headers(date_header)).hexdigest(),
393
+ hashlib.sha256(payload).hexdigest(),
394
+ )
395
+ )
396
+ signing_key = _derive_signing_key(
397
+ ctx["secret_access_key"], date_stamp, region, service
398
+ )
399
+ signature = hmac.new(
400
+ signing_key, string_to_sign.encode("utf-8"), hashlib.sha256
401
+ ).hexdigest()
402
+ frame = Message(
403
+ {**date_header, ":chunk-signature": bytes.fromhex(signature)}, payload
404
+ ).encode()
405
+ return frame, signature
406
+
407
+
408
+ class EventStreamIterator(AnyIterator[bytes]):
409
+ """Sign a request event stream, one frame per event.
410
+
411
+ Wraps an iterator of encoded event messages (as produced by the generated
412
+ ``serialize_event_*`` functions). Each event becomes the payload of an
413
+ outer message carrying ``:date`` and ``:chunk-signature`` headers, the
414
+ signature chained from the previous frame's and seeded by the request's
415
+ ``Authorization`` signature. Once the events are exhausted, one empty
416
+ signed frame is yielded to mark the end of the stream.
417
+
418
+ Like :class:`~capo._body.Body`, it is both a sync and an async iterator:
419
+ iterate it the way the wrapped source is iterable (``next`` over a sync
420
+ source, ``async for`` over an async one).
421
+
422
+ Reference:
423
+ https://docs.aws.amazon.com/transcribe/latest/dg/streaming-setting-up.html
424
+ """
425
+
426
+ def __init__(
427
+ self,
428
+ events: Iterator[bytes] | AsyncIterator[bytes],
429
+ ctx: SigV4AuthContext,
430
+ seed_signature: str,
431
+ ) -> None:
432
+ self._events = events
433
+ self._ctx = ctx
434
+ self._prior_signature = seed_signature
435
+ self._ended = False
436
+
437
+ def _frame(self, payload: bytes) -> bytes:
438
+ frame, self._prior_signature = _sign_event(
439
+ self._ctx, self._prior_signature, payload
440
+ )
441
+ return frame
442
+
443
+ def __next__(self) -> bytes:
444
+ if self._ended:
445
+ raise StopIteration
446
+ if not isinstance(self._events, Iterator):
447
+ raise TypeError("this event stream wraps an async source; use `async for`")
448
+ try:
449
+ payload = next(cast(Iterator[bytes], self._events))
450
+ except StopIteration:
451
+ self._ended = True
452
+ payload = b""
453
+ return self._frame(payload)
454
+
455
+ async def __anext__(self) -> bytes:
456
+ if self._ended:
457
+ raise StopAsyncIteration
458
+ if not isinstance(self._events, AsyncIterator):
459
+ raise TypeError("this event stream wraps a sync source; use `for`")
460
+ try:
461
+ payload = await cast(AsyncIterator[bytes], self._events).__anext__()
462
+ except StopAsyncIteration:
463
+ self._ended = True
464
+ payload = b""
465
+ return self._frame(payload)
466
+
467
+
323
468
  def presign_sigv4(
324
469
  request: Request,
325
470
  ctx: SigV4AuthContext,
@@ -346,7 +491,7 @@ def presign_sigv4(
346
491
  service = ctx["signing_name"]
347
492
  region = ctx["signing_region"]
348
493
 
349
- amz_date = sign_time.strftime("%Y%m%dT%H%M%SZ")
494
+ amz_date = sign_time.strftime(_AMZ_DATE_FORMAT)
350
495
  date_stamp = sign_time.strftime("%Y%m%d")
351
496
  credential_scope = f"{date_stamp}/{region}/{service}/aws4_request"
352
497
 
@@ -30,6 +30,7 @@ from capo_codeguruprofiler._rule_engine._endpoint_rule_set import (
30
30
  from capo_codeguruprofiler._services._pipeline import (
31
31
  AsyncOperationOptions,
32
32
  OperationOptions,
33
+ raise_error,
33
34
  )
34
35
  from capo_codeguruprofiler.errors import UnknownServiceError
35
36
 
@@ -160,7 +161,7 @@ def add_notification_channels(
160
161
  try:
161
162
  if response.status >= 300:
162
163
  response.read()
163
- handle_error(response)
164
+ raise_error(response, handle_error)
164
165
  return handle_response(response), response
165
166
  except BaseException:
166
167
  response.close()
@@ -178,7 +179,7 @@ async def async_add_notification_channels(
178
179
  try:
179
180
  if response.status >= 300:
180
181
  await response.aread()
181
- handle_error(response)
182
+ raise_error(response, handle_error)
182
183
  return await async_handle_response(response), response
183
184
  except BaseException:
184
185
  await response.aclose()
@@ -31,6 +31,7 @@ from capo_codeguruprofiler._rule_engine._endpoint_rule_set import (
31
31
  from capo_codeguruprofiler._services._pipeline import (
32
32
  AsyncOperationOptions,
33
33
  OperationOptions,
34
+ raise_error,
34
35
  )
35
36
  from capo_codeguruprofiler.errors import UnknownServiceError
36
37
 
@@ -177,7 +178,7 @@ def batch_get_frame_metric_data(
177
178
  try:
178
179
  if response.status >= 300:
179
180
  response.read()
180
- handle_error(response)
181
+ raise_error(response, handle_error)
181
182
  return handle_response(response), response
182
183
  except BaseException:
183
184
  response.close()
@@ -195,7 +196,7 @@ async def async_batch_get_frame_metric_data(
195
196
  try:
196
197
  if response.status >= 300:
197
198
  await response.aread()
198
- handle_error(response)
199
+ raise_error(response, handle_error)
199
200
  return await async_handle_response(response), response
200
201
  except BaseException:
201
202
  await response.aclose()
@@ -28,6 +28,7 @@ from capo_codeguruprofiler._rule_engine._endpoint_rule_set import (
28
28
  from capo_codeguruprofiler._services._pipeline import (
29
29
  AsyncOperationOptions,
30
30
  OperationOptions,
31
+ raise_error,
31
32
  )
32
33
  from capo_codeguruprofiler.errors import UnknownServiceError
33
34
 
@@ -152,7 +153,7 @@ def configure_agent(
152
153
  try:
153
154
  if response.status >= 300:
154
155
  response.read()
155
- handle_error(response)
156
+ raise_error(response, handle_error)
156
157
  return handle_response(response), response
157
158
  except BaseException:
158
159
  response.close()
@@ -170,7 +171,7 @@ async def async_configure_agent(
170
171
  try:
171
172
  if response.status >= 300:
172
173
  await response.aread()
173
- handle_error(response)
174
+ raise_error(response, handle_error)
174
175
  return await async_handle_response(response), response
175
176
  except BaseException:
176
177
  await response.aclose()
@@ -29,6 +29,7 @@ from capo_codeguruprofiler._rule_engine._endpoint_rule_set import (
29
29
  from capo_codeguruprofiler._services._pipeline import (
30
30
  AsyncOperationOptions,
31
31
  OperationOptions,
32
+ raise_error,
32
33
  )
33
34
  from capo_codeguruprofiler.errors import UnknownServiceError
34
35
 
@@ -155,7 +156,7 @@ def create_profiling_group(
155
156
  try:
156
157
  if response.status >= 300:
157
158
  response.read()
158
- handle_error(response)
159
+ raise_error(response, handle_error)
159
160
  return handle_response(response), response
160
161
  except BaseException:
161
162
  response.close()
@@ -173,7 +174,7 @@ async def async_create_profiling_group(
173
174
  try:
174
175
  if response.status >= 300:
175
176
  await response.aread()
176
- handle_error(response)
177
+ raise_error(response, handle_error)
177
178
  return await async_handle_response(response), response
178
179
  except BaseException:
179
180
  await response.aclose()
@@ -27,6 +27,7 @@ from capo_codeguruprofiler._rule_engine._endpoint_rule_set import (
27
27
  from capo_codeguruprofiler._services._pipeline import (
28
28
  AsyncOperationOptions,
29
29
  OperationOptions,
30
+ raise_error,
30
31
  )
31
32
  from capo_codeguruprofiler.errors import UnknownServiceError
32
33
 
@@ -140,7 +141,7 @@ def delete_profiling_group(
140
141
  try:
141
142
  if response.status >= 300:
142
143
  response.read()
143
- handle_error(response)
144
+ raise_error(response, handle_error)
144
145
  return handle_response(response), response
145
146
  except BaseException:
146
147
  response.close()
@@ -158,7 +159,7 @@ async def async_delete_profiling_group(
158
159
  try:
159
160
  if response.status >= 300:
160
161
  await response.aread()
161
- handle_error(response)
162
+ raise_error(response, handle_error)
162
163
  return await async_handle_response(response), response
163
164
  except BaseException:
164
165
  await response.aclose()
@@ -27,6 +27,7 @@ from capo_codeguruprofiler._rule_engine._endpoint_rule_set import (
27
27
  from capo_codeguruprofiler._services._pipeline import (
28
28
  AsyncOperationOptions,
29
29
  OperationOptions,
30
+ raise_error,
30
31
  )
31
32
  from capo_codeguruprofiler.errors import UnknownServiceError
32
33
 
@@ -144,7 +145,7 @@ def describe_profiling_group(
144
145
  try:
145
146
  if response.status >= 300:
146
147
  response.read()
147
- handle_error(response)
148
+ raise_error(response, handle_error)
148
149
  return handle_response(response), response
149
150
  except BaseException:
150
151
  response.close()
@@ -162,7 +163,7 @@ async def async_describe_profiling_group(
162
163
  try:
163
164
  if response.status >= 300:
164
165
  await response.aread()
165
- handle_error(response)
166
+ raise_error(response, handle_error)
166
167
  return await async_handle_response(response), response
167
168
  except BaseException:
168
169
  await response.aclose()
@@ -25,6 +25,7 @@ from capo_codeguruprofiler._rule_engine._endpoint_rule_set import (
25
25
  from capo_codeguruprofiler._services._pipeline import (
26
26
  AsyncOperationOptions,
27
27
  OperationOptions,
28
+ raise_error,
28
29
  )
29
30
  from capo_codeguruprofiler.errors import UnknownServiceError
30
31
 
@@ -139,7 +140,7 @@ def get_findings_report_account_summary(
139
140
  try:
140
141
  if response.status >= 300:
141
142
  response.read()
142
- handle_error(response)
143
+ raise_error(response, handle_error)
143
144
  return handle_response(response), response
144
145
  except BaseException:
145
146
  response.close()
@@ -157,7 +158,7 @@ async def async_get_findings_report_account_summary(
157
158
  try:
158
159
  if response.status >= 300:
159
160
  await response.aread()
160
- handle_error(response)
161
+ raise_error(response, handle_error)
161
162
  return await async_handle_response(response), response
162
163
  except BaseException:
163
164
  await response.aclose()
@@ -27,6 +27,7 @@ from capo_codeguruprofiler._rule_engine._endpoint_rule_set import (
27
27
  from capo_codeguruprofiler._services._pipeline import (
28
28
  AsyncOperationOptions,
29
29
  OperationOptions,
30
+ raise_error,
30
31
  )
31
32
  from capo_codeguruprofiler.errors import UnknownServiceError
32
33
 
@@ -143,7 +144,7 @@ def get_notification_configuration(
143
144
  try:
144
145
  if response.status >= 300:
145
146
  response.read()
146
- handle_error(response)
147
+ raise_error(response, handle_error)
147
148
  return handle_response(response), response
148
149
  except BaseException:
149
150
  response.close()
@@ -161,7 +162,7 @@ async def async_get_notification_configuration(
161
162
  try:
162
163
  if response.status >= 300:
163
164
  await response.aread()
164
- handle_error(response)
165
+ raise_error(response, handle_error)
165
166
  return await async_handle_response(response), response
166
167
  except BaseException:
167
168
  await response.aclose()
@@ -25,6 +25,7 @@ from capo_codeguruprofiler._rule_engine._endpoint_rule_set import (
25
25
  from capo_codeguruprofiler._services._pipeline import (
26
26
  AsyncOperationOptions,
27
27
  OperationOptions,
28
+ raise_error,
28
29
  )
29
30
  from capo_codeguruprofiler.errors import UnknownServiceError
30
31
 
@@ -137,7 +138,7 @@ def get_policy(
137
138
  try:
138
139
  if response.status >= 300:
139
140
  response.read()
140
- handle_error(response)
141
+ raise_error(response, handle_error)
141
142
  return handle_response(response), response
142
143
  except BaseException:
143
144
  response.close()
@@ -154,7 +155,7 @@ async def async_get_policy(
154
155
  try:
155
156
  if response.status >= 300:
156
157
  await response.aread()
157
- handle_error(response)
158
+ raise_error(response, handle_error)
158
159
  return await async_handle_response(response), response
159
160
  except BaseException:
160
161
  await response.aclose()
@@ -28,6 +28,7 @@ from capo_codeguruprofiler._rule_engine._endpoint_rule_set import (
28
28
  from capo_codeguruprofiler._services._pipeline import (
29
29
  AsyncOperationOptions,
30
30
  OperationOptions,
31
+ raise_error,
31
32
  )
32
33
  from capo_codeguruprofiler.errors import UnknownServiceError
33
34
 
@@ -172,7 +173,7 @@ def get_profile(
172
173
  try:
173
174
  if response.status >= 300:
174
175
  response.read()
175
- handle_error(response)
176
+ raise_error(response, handle_error)
176
177
  return handle_response(response), response
177
178
  except BaseException:
178
179
  response.close()
@@ -189,7 +190,7 @@ async def async_get_profile(
189
190
  try:
190
191
  if response.status >= 300:
191
192
  await response.aread()
192
- handle_error(response)
193
+ raise_error(response, handle_error)
193
194
  return await async_handle_response(response), response
194
195
  except BaseException:
195
196
  await response.aclose()
@@ -29,6 +29,7 @@ from capo_codeguruprofiler._rule_engine._endpoint_rule_set import (
29
29
  from capo_codeguruprofiler._services._pipeline import (
30
30
  AsyncOperationOptions,
31
31
  OperationOptions,
32
+ raise_error,
32
33
  )
33
34
  from capo_codeguruprofiler.errors import UnknownServiceError
34
35
 
@@ -171,7 +172,7 @@ def get_recommendations(
171
172
  try:
172
173
  if response.status >= 300:
173
174
  response.read()
174
- handle_error(response)
175
+ raise_error(response, handle_error)
175
176
  return handle_response(response), response
176
177
  except BaseException:
177
178
  response.close()
@@ -189,7 +190,7 @@ async def async_get_recommendations(
189
190
  try:
190
191
  if response.status >= 300:
191
192
  await response.aread()
192
- handle_error(response)
193
+ raise_error(response, handle_error)
193
194
  return await async_handle_response(response), response
194
195
  except BaseException:
195
196
  await response.aclose()