capo-codeguruprofiler 0.1.0__py3-none-any.whl

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 (180) hide show
  1. capo_codeguruprofiler/__init__.py +74 -0
  2. capo_codeguruprofiler/_async.py +25 -0
  3. capo_codeguruprofiler/_auth/_identity.py +16 -0
  4. capo_codeguruprofiler/_auth/_providers.py +886 -0
  5. capo_codeguruprofiler/_auth/_signers.py +88 -0
  6. capo_codeguruprofiler/_auth/_sigv4.py +434 -0
  7. capo_codeguruprofiler/_auth/_zapros_handler.py +80 -0
  8. capo_codeguruprofiler/_iter.py +113 -0
  9. capo_codeguruprofiler/_operations/code_guru_profiler/add_notification_channels.py +185 -0
  10. capo_codeguruprofiler/_operations/code_guru_profiler/batch_get_frame_metric_data.py +202 -0
  11. capo_codeguruprofiler/_operations/code_guru_profiler/configure_agent.py +177 -0
  12. capo_codeguruprofiler/_operations/code_guru_profiler/create_profiling_group.py +180 -0
  13. capo_codeguruprofiler/_operations/code_guru_profiler/delete_profiling_group.py +165 -0
  14. capo_codeguruprofiler/_operations/code_guru_profiler/describe_profiling_group.py +169 -0
  15. capo_codeguruprofiler/_operations/code_guru_profiler/get_findings_report_account_summary.py +164 -0
  16. capo_codeguruprofiler/_operations/code_guru_profiler/get_notification_configuration.py +168 -0
  17. capo_codeguruprofiler/_operations/code_guru_profiler/get_policy.py +161 -0
  18. capo_codeguruprofiler/_operations/code_guru_profiler/get_profile.py +196 -0
  19. capo_codeguruprofiler/_operations/code_guru_profiler/get_recommendations.py +196 -0
  20. capo_codeguruprofiler/_operations/code_guru_profiler/list_findings_reports.py +197 -0
  21. capo_codeguruprofiler/_operations/code_guru_profiler/list_profile_times.py +196 -0
  22. capo_codeguruprofiler/_operations/code_guru_profiler/list_profiling_groups.py +160 -0
  23. capo_codeguruprofiler/_operations/code_guru_profiler/list_tags_for_resource.py +158 -0
  24. capo_codeguruprofiler/_operations/code_guru_profiler/post_agent_profile.py +168 -0
  25. capo_codeguruprofiler/_operations/code_guru_profiler/put_permission.py +182 -0
  26. capo_codeguruprofiler/_operations/code_guru_profiler/remove_notification_channel.py +169 -0
  27. capo_codeguruprofiler/_operations/code_guru_profiler/remove_permission.py +175 -0
  28. capo_codeguruprofiler/_operations/code_guru_profiler/submit_feedback.py +170 -0
  29. capo_codeguruprofiler/_operations/code_guru_profiler/tag_resource.py +158 -0
  30. capo_codeguruprofiler/_operations/code_guru_profiler/untag_resource.py +156 -0
  31. capo_codeguruprofiler/_operations/code_guru_profiler/update_profiling_group.py +181 -0
  32. capo_codeguruprofiler/_pagination.py +21 -0
  33. capo_codeguruprofiler/_protocol/__init__.py +1 -0
  34. capo_codeguruprofiler/_protocol/errors.py +93 -0
  35. capo_codeguruprofiler/_protocol/eventstream.py +238 -0
  36. capo_codeguruprofiler/_protocol/serialize.py +47 -0
  37. capo_codeguruprofiler/_protocol/xml.py +33 -0
  38. capo_codeguruprofiler/_resources/code_guru_profiler/profiling_group.py +2257 -0
  39. capo_codeguruprofiler/_rule_engine/__init__.py +0 -0
  40. capo_codeguruprofiler/_rule_engine/_aws_partition.py +160 -0
  41. capo_codeguruprofiler/_rule_engine/_endpoint_rule_set.py +138 -0
  42. capo_codeguruprofiler/_rule_engine/_endpoint_runtime.py +389 -0
  43. capo_codeguruprofiler/_services/_aws_config.py +160 -0
  44. capo_codeguruprofiler/_services/_pipeline.py +198 -0
  45. capo_codeguruprofiler/_services/async_code_guru_profiler.py +377 -0
  46. capo_codeguruprofiler/_services/code_guru_profiler.py +373 -0
  47. capo_codeguruprofiler/errors/__init__.py +35 -0
  48. capo_codeguruprofiler/errors/_base.py +94 -0
  49. capo_codeguruprofiler/errors/conflict_exception.py +45 -0
  50. capo_codeguruprofiler/errors/internal_server_exception.py +47 -0
  51. capo_codeguruprofiler/errors/resource_not_found_exception.py +47 -0
  52. capo_codeguruprofiler/errors/service_quota_exceeded_exception.py +49 -0
  53. capo_codeguruprofiler/errors/throttling_exception.py +45 -0
  54. capo_codeguruprofiler/errors/validation_exception.py +45 -0
  55. capo_codeguruprofiler/py.typed +0 -0
  56. capo_codeguruprofiler/types/_prelude/blob.py +12 -0
  57. capo_codeguruprofiler/types/_prelude/timestamp.py +17 -0
  58. capo_codeguruprofiler/types/action_group.py +5 -0
  59. capo_codeguruprofiler/types/add_notification_channels_request.py +44 -0
  60. capo_codeguruprofiler/types/add_notification_channels_response.py +42 -0
  61. capo_codeguruprofiler/types/agent_configuration.py +58 -0
  62. capo_codeguruprofiler/types/agent_orchestration_config.py +28 -0
  63. capo_codeguruprofiler/types/agent_parameter_field.py +5 -0
  64. capo_codeguruprofiler/types/agent_parameters.py +27 -0
  65. capo_codeguruprofiler/types/agent_profile.py +15 -0
  66. capo_codeguruprofiler/types/aggregated_profile.py +15 -0
  67. capo_codeguruprofiler/types/aggregated_profile_time.py +45 -0
  68. capo_codeguruprofiler/types/aggregation_period.py +5 -0
  69. capo_codeguruprofiler/types/anomalies.py +29 -0
  70. capo_codeguruprofiler/types/anomaly.py +62 -0
  71. capo_codeguruprofiler/types/anomaly_instance.py +77 -0
  72. capo_codeguruprofiler/types/anomaly_instance_id.py +5 -0
  73. capo_codeguruprofiler/types/anomaly_instances.py +31 -0
  74. capo_codeguruprofiler/types/batch_get_frame_metric_data_request.py +56 -0
  75. capo_codeguruprofiler/types/batch_get_frame_metric_data_response.py +130 -0
  76. capo_codeguruprofiler/types/channel.py +58 -0
  77. capo_codeguruprofiler/types/channel_id.py +5 -0
  78. capo_codeguruprofiler/types/channel_uri.py +6 -0
  79. capo_codeguruprofiler/types/channels.py +29 -0
  80. capo_codeguruprofiler/types/client_token.py +5 -0
  81. capo_codeguruprofiler/types/compute_platform.py +5 -0
  82. capo_codeguruprofiler/types/configure_agent_request.py +50 -0
  83. capo_codeguruprofiler/types/configure_agent_response.py +43 -0
  84. capo_codeguruprofiler/types/create_profiling_group_request.py +81 -0
  85. capo_codeguruprofiler/types/create_profiling_group_response.py +45 -0
  86. capo_codeguruprofiler/types/delete_profiling_group_request.py +26 -0
  87. capo_codeguruprofiler/types/delete_profiling_group_response.py +18 -0
  88. capo_codeguruprofiler/types/describe_profiling_group_request.py +26 -0
  89. capo_codeguruprofiler/types/describe_profiling_group_response.py +45 -0
  90. capo_codeguruprofiler/types/event_publisher.py +5 -0
  91. capo_codeguruprofiler/types/event_publishers.py +19 -0
  92. capo_codeguruprofiler/types/feedback_type.py +5 -0
  93. capo_codeguruprofiler/types/findings_report_id.py +5 -0
  94. capo_codeguruprofiler/types/findings_report_summaries.py +35 -0
  95. capo_codeguruprofiler/types/findings_report_summary.py +73 -0
  96. capo_codeguruprofiler/types/fleet_instance_id.py +5 -0
  97. capo_codeguruprofiler/types/frame_metric.py +56 -0
  98. capo_codeguruprofiler/types/frame_metric_data.py +33 -0
  99. capo_codeguruprofiler/types/frame_metric_datum.py +56 -0
  100. capo_codeguruprofiler/types/frame_metric_value.py +5 -0
  101. capo_codeguruprofiler/types/frame_metric_values.py +30 -0
  102. capo_codeguruprofiler/types/frame_metrics.py +29 -0
  103. capo_codeguruprofiler/types/get_findings_report_account_summary_request.py +31 -0
  104. capo_codeguruprofiler/types/get_findings_report_account_summary_response.py +56 -0
  105. capo_codeguruprofiler/types/get_notification_configuration_request.py +26 -0
  106. capo_codeguruprofiler/types/get_notification_configuration_response.py +45 -0
  107. capo_codeguruprofiler/types/get_policy_request.py +26 -0
  108. capo_codeguruprofiler/types/get_policy_response.py +38 -0
  109. capo_codeguruprofiler/types/get_profile_request.py +39 -0
  110. capo_codeguruprofiler/types/get_profile_response.py +45 -0
  111. capo_codeguruprofiler/types/get_recommendations_request.py +34 -0
  112. capo_codeguruprofiler/types/get_recommendations_response.py +110 -0
  113. capo_codeguruprofiler/types/list_findings_reports_request.py +41 -0
  114. capo_codeguruprofiler/types/list_findings_reports_response.py +56 -0
  115. capo_codeguruprofiler/types/list_of_timestamps.py +33 -0
  116. capo_codeguruprofiler/types/list_profile_times_request.py +45 -0
  117. capo_codeguruprofiler/types/list_profile_times_response.py +50 -0
  118. capo_codeguruprofiler/types/list_profiling_groups_request.py +31 -0
  119. capo_codeguruprofiler/types/list_profiling_groups_response.py +77 -0
  120. capo_codeguruprofiler/types/list_tags_for_resource_request.py +24 -0
  121. capo_codeguruprofiler/types/list_tags_for_resource_response.py +34 -0
  122. capo_codeguruprofiler/types/locale.py +6 -0
  123. capo_codeguruprofiler/types/match.py +43 -0
  124. capo_codeguruprofiler/types/matches.py +29 -0
  125. capo_codeguruprofiler/types/max_depth.py +5 -0
  126. capo_codeguruprofiler/types/max_results.py +5 -0
  127. capo_codeguruprofiler/types/metadata.py +27 -0
  128. capo_codeguruprofiler/types/metadata_field.py +5 -0
  129. capo_codeguruprofiler/types/metric.py +54 -0
  130. capo_codeguruprofiler/types/metric_type.py +5 -0
  131. capo_codeguruprofiler/types/notification_configuration.py +36 -0
  132. capo_codeguruprofiler/types/order_by.py +5 -0
  133. capo_codeguruprofiler/types/pagination_token.py +5 -0
  134. capo_codeguruprofiler/types/pattern.py +95 -0
  135. capo_codeguruprofiler/types/percentage.py +5 -0
  136. capo_codeguruprofiler/types/period.py +5 -0
  137. capo_codeguruprofiler/types/post_agent_profile_request.py +51 -0
  138. capo_codeguruprofiler/types/post_agent_profile_response.py +18 -0
  139. capo_codeguruprofiler/types/principal.py +5 -0
  140. capo_codeguruprofiler/types/principals.py +17 -0
  141. capo_codeguruprofiler/types/profile_time.py +36 -0
  142. capo_codeguruprofiler/types/profile_times.py +29 -0
  143. capo_codeguruprofiler/types/profiling_group_arn.py +5 -0
  144. capo_codeguruprofiler/types/profiling_group_description.py +132 -0
  145. capo_codeguruprofiler/types/profiling_group_descriptions.py +37 -0
  146. capo_codeguruprofiler/types/profiling_group_name.py +5 -0
  147. capo_codeguruprofiler/types/profiling_group_names.py +19 -0
  148. capo_codeguruprofiler/types/profiling_status.py +83 -0
  149. capo_codeguruprofiler/types/put_permission_request.py +54 -0
  150. capo_codeguruprofiler/types/put_permission_response.py +38 -0
  151. capo_codeguruprofiler/types/recommendation.py +108 -0
  152. capo_codeguruprofiler/types/recommendations.py +31 -0
  153. capo_codeguruprofiler/types/remove_notification_channel_request.py +29 -0
  154. capo_codeguruprofiler/types/remove_notification_channel_response.py +42 -0
  155. capo_codeguruprofiler/types/remove_permission_request.py +32 -0
  156. capo_codeguruprofiler/types/remove_permission_response.py +38 -0
  157. capo_codeguruprofiler/types/revision_id.py +5 -0
  158. capo_codeguruprofiler/types/strings.py +14 -0
  159. capo_codeguruprofiler/types/submit_feedback_request.py +47 -0
  160. capo_codeguruprofiler/types/submit_feedback_response.py +18 -0
  161. capo_codeguruprofiler/types/tag_keys.py +14 -0
  162. capo_codeguruprofiler/types/tag_resource_request.py +40 -0
  163. capo_codeguruprofiler/types/tag_resource_response.py +18 -0
  164. capo_codeguruprofiler/types/tags_map.py +22 -0
  165. capo_codeguruprofiler/types/target_frame.py +14 -0
  166. capo_codeguruprofiler/types/target_frames.py +29 -0
  167. capo_codeguruprofiler/types/thread_states.py +14 -0
  168. capo_codeguruprofiler/types/timestamp.py +20 -0
  169. capo_codeguruprofiler/types/timestamp_structure.py +37 -0
  170. capo_codeguruprofiler/types/unprocessed_end_time_map.py +33 -0
  171. capo_codeguruprofiler/types/untag_resource_request.py +27 -0
  172. capo_codeguruprofiler/types/untag_resource_response.py +18 -0
  173. capo_codeguruprofiler/types/update_profiling_group_request.py +50 -0
  174. capo_codeguruprofiler/types/update_profiling_group_response.py +45 -0
  175. capo_codeguruprofiler/types/user_feedback.py +31 -0
  176. capo_codeguruprofiler-0.1.0.dist-info/METADATA +101 -0
  177. capo_codeguruprofiler-0.1.0.dist-info/RECORD +180 -0
  178. capo_codeguruprofiler-0.1.0.dist-info/WHEEL +5 -0
  179. capo_codeguruprofiler-0.1.0.dist-info/licenses/LICENSE +21 -0
  180. capo_codeguruprofiler-0.1.0.dist-info/top_level.txt +1 -0
@@ -0,0 +1,43 @@
1
+ """Generated from Smithy shape ``com.amazonaws.codeguruprofiler#Match``."""
2
+
3
+ from typing_extensions import NotRequired, TypedDict
4
+
5
+
6
+ class Match(TypedDict, closed=True):
7
+ target_frames_index: NotRequired["int"]
8
+ """<p>The target frame that triggered a match.</p>"""
9
+ frame_address: NotRequired["str"]
10
+ """<p>The location in the profiling graph that contains a recommendation found during analysis.</p>"""
11
+ threshold_breach_value: NotRequired["float"]
12
+ """<p>The value in the profile data that exceeded the recommendation threshold.</p>"""
13
+
14
+
15
+ # --- restJson1 ser/de ---
16
+ def serialize_json(value: Match) -> dict:
17
+ out: dict = {}
18
+ if "target_frames_index" in value:
19
+ out["targetFramesIndex"] = value["target_frames_index"]
20
+ if "frame_address" in value:
21
+ out["frameAddress"] = value["frame_address"]
22
+ if "threshold_breach_value" in value:
23
+ out["thresholdBreachValue"] = (
24
+ "NaN"
25
+ if value["threshold_breach_value"] != value["threshold_breach_value"]
26
+ else "Infinity"
27
+ if value["threshold_breach_value"] == float("inf")
28
+ else "-Infinity"
29
+ if value["threshold_breach_value"] == float("-inf")
30
+ else value["threshold_breach_value"]
31
+ )
32
+ return out
33
+
34
+
35
+ def deserialize_json(data: dict) -> Match:
36
+ out: Match = {} # type: ignore[typeddict-item]
37
+ if data.get("targetFramesIndex") is not None:
38
+ out["target_frames_index"] = data["targetFramesIndex"]
39
+ if data.get("frameAddress") is not None:
40
+ out["frame_address"] = data["frameAddress"]
41
+ if data.get("thresholdBreachValue") is not None:
42
+ out["threshold_breach_value"] = float(data["thresholdBreachValue"])
43
+ return out
@@ -0,0 +1,29 @@
1
+ """Generated from Smithy shape ``com.amazonaws.codeguruprofiler#Matches``."""
2
+
3
+ from typing import TYPE_CHECKING, TypeAlias
4
+
5
+ if TYPE_CHECKING:
6
+ import capo_codeguruprofiler.types.match
7
+
8
+ Matches: TypeAlias = list["capo_codeguruprofiler.types.match.Match"]
9
+
10
+
11
+ # --- restJson1 ser/de ---
12
+ def serialize_json(value: Matches) -> list:
13
+ import capo_codeguruprofiler.types.match
14
+
15
+ out: list = []
16
+ for item in value:
17
+ out.append(capo_codeguruprofiler.types.match.serialize_json(item))
18
+ return out
19
+
20
+
21
+ def deserialize_json(data: list) -> Matches:
22
+ import capo_codeguruprofiler.types.match
23
+
24
+ out: Matches = []
25
+ for item in data:
26
+ if item is None:
27
+ continue
28
+ out.append(capo_codeguruprofiler.types.match.deserialize_json(item))
29
+ return out
@@ -0,0 +1,5 @@
1
+ """Generated from Smithy shape ``com.amazonaws.codeguruprofiler#MaxDepth``."""
2
+
3
+ from typing import TypeAlias
4
+
5
+ MaxDepth: TypeAlias = int
@@ -0,0 +1,5 @@
1
+ """Generated from Smithy shape ``com.amazonaws.codeguruprofiler#MaxResults``."""
2
+
3
+ from typing import TypeAlias
4
+
5
+ MaxResults: TypeAlias = int
@@ -0,0 +1,27 @@
1
+ """Generated from Smithy shape ``com.amazonaws.codeguruprofiler#Metadata``."""
2
+
3
+ from typing import TYPE_CHECKING, TypeAlias
4
+
5
+ if TYPE_CHECKING:
6
+ import capo_codeguruprofiler.types.metadata_field
7
+
8
+ Metadata: TypeAlias = dict[
9
+ "capo_codeguruprofiler.types.metadata_field.MetadataField", "str"
10
+ ]
11
+
12
+
13
+ # --- restJson1 ser/de ---
14
+ def serialize_json(input_to_serialize: Metadata) -> dict:
15
+ out: dict = {}
16
+ for key, value in input_to_serialize.items():
17
+ out[key] = value
18
+ return out
19
+
20
+
21
+ def deserialize_json(data: dict) -> Metadata:
22
+ out: Metadata = {}
23
+ for key, value in data.items():
24
+ if value is None:
25
+ continue
26
+ out[key] = value
27
+ return out
@@ -0,0 +1,5 @@
1
+ """Generated from Smithy shape ``com.amazonaws.codeguruprofiler#MetadataField``."""
2
+
3
+ from typing import TypeAlias
4
+
5
+ MetadataField: TypeAlias = str
@@ -0,0 +1,54 @@
1
+ """Generated from Smithy shape ``com.amazonaws.codeguruprofiler#Metric``."""
2
+
3
+ from typing import TYPE_CHECKING
4
+
5
+ from typing_extensions import TypedDict
6
+
7
+ from capo_codeguruprofiler.errors import DeserializationError
8
+
9
+ if TYPE_CHECKING:
10
+ import capo_codeguruprofiler.types.metric_type
11
+ import capo_codeguruprofiler.types.strings
12
+
13
+
14
+ class Metric(TypedDict, closed=True):
15
+ frame_name: "str"
16
+ """<p> The name of the method that appears as a frame in any stack in a profile. </p>"""
17
+ type: "capo_codeguruprofiler.types.metric_type.MetricType"
18
+ """<p> A type that specifies how a metric for a frame is analyzed. The supported value <code>AggregatedRelativeTotalTime</code> is an aggregation of the metric value for one frame that is calculated across the occurences of all frames in a profile.</p>"""
19
+ thread_states: "capo_codeguruprofiler.types.strings.Strings"
20
+ """<p> The list of application runtime thread states that is used to calculate the metric value for the frame. </p>"""
21
+
22
+
23
+ # --- restJson1 ser/de ---
24
+ def serialize_json(value: Metric) -> dict:
25
+ out: dict = {}
26
+ out["frameName"] = value["frame_name"]
27
+ out["type"] = value["type"]
28
+ import capo_codeguruprofiler.types.strings
29
+
30
+ out["threadStates"] = capo_codeguruprofiler.types.strings.serialize_json(
31
+ value["thread_states"]
32
+ )
33
+ return out
34
+
35
+
36
+ def deserialize_json(data: dict) -> Metric:
37
+ out: Metric = {} # type: ignore[typeddict-item]
38
+ if data.get("frameName") is not None:
39
+ out["frame_name"] = data["frameName"]
40
+ else:
41
+ raise DeserializationError("Metric.frame_name required")
42
+ if data.get("type") is not None:
43
+ out["type"] = data["type"]
44
+ else:
45
+ raise DeserializationError("Metric.type required")
46
+ if data.get("threadStates") is not None:
47
+ import capo_codeguruprofiler.types.strings
48
+
49
+ out["thread_states"] = capo_codeguruprofiler.types.strings.deserialize_json(
50
+ data["threadStates"]
51
+ )
52
+ else:
53
+ raise DeserializationError("Metric.thread_states required")
54
+ return out
@@ -0,0 +1,5 @@
1
+ """Generated from Smithy shape ``com.amazonaws.codeguruprofiler#MetricType``."""
2
+
3
+ from typing import TypeAlias
4
+
5
+ MetricType: TypeAlias = str
@@ -0,0 +1,36 @@
1
+ """Generated from Smithy shape ``com.amazonaws.codeguruprofiler#NotificationConfiguration``."""
2
+
3
+ from typing import TYPE_CHECKING
4
+
5
+ from typing_extensions import NotRequired, TypedDict
6
+
7
+ if TYPE_CHECKING:
8
+ import capo_codeguruprofiler.types.channels
9
+
10
+
11
+ class NotificationConfiguration(TypedDict, closed=True):
12
+ channels: NotRequired["capo_codeguruprofiler.types.channels.Channels"]
13
+ """<p>List of up to two channels to be used for sending notifications for events detected from the application profile.</p>"""
14
+
15
+
16
+ # --- restJson1 ser/de ---
17
+ def serialize_json(value: NotificationConfiguration) -> dict:
18
+ out: dict = {}
19
+ if "channels" in value:
20
+ import capo_codeguruprofiler.types.channels
21
+
22
+ out["channels"] = capo_codeguruprofiler.types.channels.serialize_json(
23
+ value["channels"]
24
+ )
25
+ return out
26
+
27
+
28
+ def deserialize_json(data: dict) -> NotificationConfiguration:
29
+ out: NotificationConfiguration = {} # type: ignore[typeddict-item]
30
+ if data.get("channels") is not None:
31
+ import capo_codeguruprofiler.types.channels
32
+
33
+ out["channels"] = capo_codeguruprofiler.types.channels.deserialize_json(
34
+ data["channels"]
35
+ )
36
+ return out
@@ -0,0 +1,5 @@
1
+ """Generated from Smithy shape ``com.amazonaws.codeguruprofiler#OrderBy``."""
2
+
3
+ from typing import TypeAlias
4
+
5
+ OrderBy: TypeAlias = str
@@ -0,0 +1,5 @@
1
+ """Generated from Smithy shape ``com.amazonaws.codeguruprofiler#PaginationToken``."""
2
+
3
+ from typing import TypeAlias
4
+
5
+ PaginationToken: TypeAlias = str
@@ -0,0 +1,95 @@
1
+ """Generated from Smithy shape ``com.amazonaws.codeguruprofiler#Pattern``."""
2
+
3
+ from typing import TYPE_CHECKING
4
+
5
+ from typing_extensions import NotRequired, TypedDict
6
+
7
+ if TYPE_CHECKING:
8
+ import capo_codeguruprofiler.types.percentage
9
+ import capo_codeguruprofiler.types.strings
10
+ import capo_codeguruprofiler.types.target_frames
11
+
12
+
13
+ class Pattern(TypedDict, closed=True):
14
+ id: NotRequired["str"]
15
+ """<p>The universally unique identifier (UUID) of this pattern.</p>"""
16
+ name: NotRequired["str"]
17
+ """<p>The name for this pattern.</p>"""
18
+ description: NotRequired["str"]
19
+ """<p>The description of the recommendation. This explains a potential inefficiency in a profiled application.</p>"""
20
+ resolution_steps: NotRequired["str"]
21
+ """<p> A string that contains the steps recommended to address the potential inefficiency. </p>"""
22
+ target_frames: NotRequired["capo_codeguruprofiler.types.target_frames.TargetFrames"]
23
+ """<p>A list of frame names that were searched during the analysis that generated a recommendation.</p>"""
24
+ threshold_percent: "capo_codeguruprofiler.types.percentage.Percentage"
25
+ """<p> The percentage of time an application spends in one method that triggers a recommendation. The percentage of time is the same as the percentage of the total gathered sample counts during analysis. </p>"""
26
+ counters_to_aggregate: NotRequired["capo_codeguruprofiler.types.strings.Strings"]
27
+ """<p> A list of the different counters used to determine if there is a match. </p>"""
28
+
29
+
30
+ # --- restJson1 ser/de ---
31
+ def serialize_json(value: Pattern) -> dict:
32
+ out: dict = {}
33
+ if "id" in value:
34
+ out["id"] = value["id"]
35
+ if "name" in value:
36
+ out["name"] = value["name"]
37
+ if "description" in value:
38
+ out["description"] = value["description"]
39
+ if "resolution_steps" in value:
40
+ out["resolutionSteps"] = value["resolution_steps"]
41
+ if "target_frames" in value:
42
+ import capo_codeguruprofiler.types.target_frames
43
+
44
+ out["targetFrames"] = capo_codeguruprofiler.types.target_frames.serialize_json(
45
+ value["target_frames"]
46
+ )
47
+ out["thresholdPercent"] = (
48
+ "NaN"
49
+ if value.get("threshold_percent", 0) != value.get("threshold_percent", 0)
50
+ else "Infinity"
51
+ if value.get("threshold_percent", 0) == float("inf")
52
+ else "-Infinity"
53
+ if value.get("threshold_percent", 0) == float("-inf")
54
+ else value.get("threshold_percent", 0)
55
+ )
56
+ if "counters_to_aggregate" in value:
57
+ import capo_codeguruprofiler.types.strings
58
+
59
+ out["countersToAggregate"] = capo_codeguruprofiler.types.strings.serialize_json(
60
+ value["counters_to_aggregate"]
61
+ )
62
+ return out
63
+
64
+
65
+ def deserialize_json(data: dict) -> Pattern:
66
+ out: Pattern = {} # type: ignore[typeddict-item]
67
+ if data.get("id") is not None:
68
+ out["id"] = data["id"]
69
+ if data.get("name") is not None:
70
+ out["name"] = data["name"]
71
+ if data.get("description") is not None:
72
+ out["description"] = data["description"]
73
+ if data.get("resolutionSteps") is not None:
74
+ out["resolution_steps"] = data["resolutionSteps"]
75
+ if data.get("targetFrames") is not None:
76
+ import capo_codeguruprofiler.types.target_frames
77
+
78
+ out["target_frames"] = (
79
+ capo_codeguruprofiler.types.target_frames.deserialize_json(
80
+ data["targetFrames"]
81
+ )
82
+ )
83
+ if data.get("thresholdPercent") is not None:
84
+ out["threshold_percent"] = float(data["thresholdPercent"])
85
+ else:
86
+ out["threshold_percent"] = 0
87
+ if data.get("countersToAggregate") is not None:
88
+ import capo_codeguruprofiler.types.strings
89
+
90
+ out["counters_to_aggregate"] = (
91
+ capo_codeguruprofiler.types.strings.deserialize_json(
92
+ data["countersToAggregate"]
93
+ )
94
+ )
95
+ return out
@@ -0,0 +1,5 @@
1
+ """Generated from Smithy shape ``com.amazonaws.codeguruprofiler#Percentage``."""
2
+
3
+ from typing import TypeAlias
4
+
5
+ Percentage: TypeAlias = float
@@ -0,0 +1,5 @@
1
+ """Generated from Smithy shape ``com.amazonaws.codeguruprofiler#Period``."""
2
+
3
+ from typing import TypeAlias
4
+
5
+ Period: TypeAlias = str
@@ -0,0 +1,51 @@
1
+ """Generated from Smithy shape ``com.amazonaws.codeguruprofiler#PostAgentProfileRequest``."""
2
+
3
+ from typing import TYPE_CHECKING
4
+
5
+ from typing_extensions import NotRequired, TypedDict
6
+
7
+ from capo_codeguruprofiler.errors import DeserializationError
8
+
9
+ if TYPE_CHECKING:
10
+ import capo_codeguruprofiler.types.agent_profile
11
+ import capo_codeguruprofiler.types.client_token
12
+ import capo_codeguruprofiler.types.profiling_group_name
13
+
14
+
15
+ class PostAgentProfileRequest(TypedDict, closed=True):
16
+ profiling_group_name: (
17
+ "capo_codeguruprofiler.types.profiling_group_name.ProfilingGroupName"
18
+ )
19
+ """<p> The name of the profiling group with the aggregated profile that receives the submitted profiling data. </p>"""
20
+ agent_profile: "capo_codeguruprofiler.types.agent_profile.AgentProfile"
21
+ """<p> The submitted profiling data. </p>"""
22
+ profile_token: NotRequired["capo_codeguruprofiler.types.client_token.ClientToken"]
23
+ """<p> Amazon CodeGuru Profiler uses this universally unique identifier (UUID) to prevent the accidental submission of duplicate profiling data if there are failures and retries. </p>"""
24
+ content_type: "str"
25
+ r"""<p> The format of the submitted profiling data. The format maps to the <code>Accept</code> and <code>Content-Type</code> headers of the HTTP request. You can specify one of the following: or the default . </p> <ul> <li> <p> <code>application/json</code> — standard JSON format </p> </li> <li> <p> <code>application/x-amzn-ion</code> — the Amazon Ion data format. For more information, see <a href=\"http://amzn.github.io/ion-docs/\">Amazon Ion</a>. </p> </li> </ul>"""
26
+
27
+
28
+ # --- restJson1 ser/de ---
29
+ def serialize_json(value: PostAgentProfileRequest) -> dict:
30
+ out: dict = {}
31
+ import capo_codeguruprofiler.types.agent_profile
32
+
33
+ out["agentProfile"] = capo_codeguruprofiler.types.agent_profile.serialize_json(
34
+ value["agent_profile"]
35
+ )
36
+ return out
37
+
38
+
39
+ def deserialize_json(data: dict) -> PostAgentProfileRequest:
40
+ out: PostAgentProfileRequest = {} # type: ignore[typeddict-item]
41
+ if data.get("agentProfile") is not None:
42
+ import capo_codeguruprofiler.types.agent_profile
43
+
44
+ out["agent_profile"] = (
45
+ capo_codeguruprofiler.types.agent_profile.deserialize_json(
46
+ data["agentProfile"]
47
+ )
48
+ )
49
+ else:
50
+ raise DeserializationError("PostAgentProfileRequest.agent_profile required")
51
+ return out
@@ -0,0 +1,18 @@
1
+ """Generated from Smithy shape ``com.amazonaws.codeguruprofiler#PostAgentProfileResponse``."""
2
+
3
+ from typing_extensions import TypedDict
4
+
5
+
6
+ class PostAgentProfileResponse(TypedDict, closed=True):
7
+ pass
8
+
9
+
10
+ # --- restJson1 ser/de ---
11
+ def serialize_json(value: PostAgentProfileResponse) -> dict:
12
+ out: dict = {}
13
+ return out
14
+
15
+
16
+ def deserialize_json(data: dict) -> PostAgentProfileResponse:
17
+ out: PostAgentProfileResponse = {} # type: ignore[typeddict-item]
18
+ return out
@@ -0,0 +1,5 @@
1
+ """Generated from Smithy shape ``com.amazonaws.codeguruprofiler#Principal``."""
2
+
3
+ from typing import TypeAlias
4
+
5
+ Principal: TypeAlias = str
@@ -0,0 +1,17 @@
1
+ """Generated from Smithy shape ``com.amazonaws.codeguruprofiler#Principals``."""
2
+
3
+ from typing import TYPE_CHECKING, TypeAlias
4
+
5
+ if TYPE_CHECKING:
6
+ import capo_codeguruprofiler.types.principal
7
+
8
+ Principals: TypeAlias = list["capo_codeguruprofiler.types.principal.Principal"]
9
+
10
+
11
+ # --- restJson1 ser/de ---
12
+ def serialize_json(value: Principals) -> list:
13
+ return list(value)
14
+
15
+
16
+ def deserialize_json(data: list) -> Principals:
17
+ return [item for item in data if item is not None]
@@ -0,0 +1,36 @@
1
+ """Generated from Smithy shape ``com.amazonaws.codeguruprofiler#ProfileTime``."""
2
+
3
+ from typing import TYPE_CHECKING
4
+
5
+ from typing_extensions import NotRequired, TypedDict
6
+
7
+ if TYPE_CHECKING:
8
+ import capo_codeguruprofiler.types.timestamp
9
+
10
+
11
+ class ProfileTime(TypedDict, closed=True):
12
+ start: NotRequired["capo_codeguruprofiler.types.timestamp.Timestamp"]
13
+ """<p>The start time of a profile. It is specified using the ISO 8601 format. For example, 2020-06-01T13:15:02.001Z represents 1 millisecond past June 1, 2020 1:15:02 PM UTC.</p>"""
14
+
15
+
16
+ # --- restJson1 ser/de ---
17
+ def serialize_json(value: ProfileTime) -> dict:
18
+ out: dict = {}
19
+ if "start" in value:
20
+ import capo_codeguruprofiler.types.timestamp
21
+
22
+ out["start"] = capo_codeguruprofiler.types.timestamp.serialize_json(
23
+ value["start"]
24
+ )
25
+ return out
26
+
27
+
28
+ def deserialize_json(data: dict) -> ProfileTime:
29
+ out: ProfileTime = {} # type: ignore[typeddict-item]
30
+ if data.get("start") is not None:
31
+ import capo_codeguruprofiler.types.timestamp
32
+
33
+ out["start"] = capo_codeguruprofiler.types.timestamp.deserialize_json(
34
+ data["start"]
35
+ )
36
+ return out
@@ -0,0 +1,29 @@
1
+ """Generated from Smithy shape ``com.amazonaws.codeguruprofiler#ProfileTimes``."""
2
+
3
+ from typing import TYPE_CHECKING, TypeAlias
4
+
5
+ if TYPE_CHECKING:
6
+ import capo_codeguruprofiler.types.profile_time
7
+
8
+ ProfileTimes: TypeAlias = list["capo_codeguruprofiler.types.profile_time.ProfileTime"]
9
+
10
+
11
+ # --- restJson1 ser/de ---
12
+ def serialize_json(value: ProfileTimes) -> list:
13
+ import capo_codeguruprofiler.types.profile_time
14
+
15
+ out: list = []
16
+ for item in value:
17
+ out.append(capo_codeguruprofiler.types.profile_time.serialize_json(item))
18
+ return out
19
+
20
+
21
+ def deserialize_json(data: list) -> ProfileTimes:
22
+ import capo_codeguruprofiler.types.profile_time
23
+
24
+ out: ProfileTimes = []
25
+ for item in data:
26
+ if item is None:
27
+ continue
28
+ out.append(capo_codeguruprofiler.types.profile_time.deserialize_json(item))
29
+ return out
@@ -0,0 +1,5 @@
1
+ """Generated from Smithy shape ``com.amazonaws.codeguruprofiler#ProfilingGroupArn``."""
2
+
3
+ from typing import TypeAlias
4
+
5
+ ProfilingGroupArn: TypeAlias = str
@@ -0,0 +1,132 @@
1
+ """Generated from Smithy shape ``com.amazonaws.codeguruprofiler#ProfilingGroupDescription``."""
2
+
3
+ from typing import TYPE_CHECKING
4
+
5
+ from typing_extensions import NotRequired, TypedDict
6
+
7
+ if TYPE_CHECKING:
8
+ import capo_codeguruprofiler.types.agent_orchestration_config
9
+ import capo_codeguruprofiler.types.compute_platform
10
+ import capo_codeguruprofiler.types.profiling_group_arn
11
+ import capo_codeguruprofiler.types.profiling_group_name
12
+ import capo_codeguruprofiler.types.profiling_status
13
+ import capo_codeguruprofiler.types.tags_map
14
+ import capo_codeguruprofiler.types.timestamp
15
+
16
+
17
+ class ProfilingGroupDescription(TypedDict, closed=True):
18
+ name: NotRequired[
19
+ "capo_codeguruprofiler.types.profiling_group_name.ProfilingGroupName"
20
+ ]
21
+ """<p>The name of the profiling group.</p>"""
22
+ agent_orchestration_config: NotRequired[
23
+ "capo_codeguruprofiler.types.agent_orchestration_config.AgentOrchestrationConfig"
24
+ ]
25
+ r"""<p> An <a href=\"https://docs.aws.amazon.com/codeguru/latest/profiler-api/API_AgentOrchestrationConfig.html\"> <code>AgentOrchestrationConfig</code> </a> object that indicates if the profiling group is enabled for profiled or not. </p>"""
26
+ arn: NotRequired[
27
+ "capo_codeguruprofiler.types.profiling_group_arn.ProfilingGroupArn"
28
+ ]
29
+ """<p>The Amazon Resource Name (ARN) identifying the profiling group resource.</p>"""
30
+ created_at: NotRequired["capo_codeguruprofiler.types.timestamp.Timestamp"]
31
+ """<p>The time when the profiling group was created. Specify using the ISO 8601 format. For example, 2020-06-01T13:15:02.001Z represents 1 millisecond past June 1, 2020 1:15:02 PM UTC. </p>"""
32
+ updated_at: NotRequired["capo_codeguruprofiler.types.timestamp.Timestamp"]
33
+ """<p> The date and time when the profiling group was last updated. Specify using the ISO 8601 format. For example, 2020-06-01T13:15:02.001Z represents 1 millisecond past June 1, 2020 1:15:02 PM UTC. </p>"""
34
+ profiling_status: NotRequired[
35
+ "capo_codeguruprofiler.types.profiling_status.ProfilingStatus"
36
+ ]
37
+ r"""<p> A <a href=\"https://docs.aws.amazon.com/codeguru/latest/profiler-api/API_ProfilingStatus.html\"> <code>ProfilingStatus</code> </a> object that includes information about the last time a profile agent pinged back, the last time a profile was received, and the aggregation period and start time for the most recent aggregated profile. </p>"""
38
+ compute_platform: NotRequired[
39
+ "capo_codeguruprofiler.types.compute_platform.ComputePlatform"
40
+ ]
41
+ """<p> The compute platform of the profiling group. If it is set to <code>AWSLambda</code>, then the profiled application runs on AWS Lambda. If it is set to <code>Default</code>, then the profiled application runs on a compute platform that is not AWS Lambda, such an Amazon EC2 instance, an on-premises server, or a different platform. The default is <code>Default</code>. </p>"""
42
+ tags: NotRequired["capo_codeguruprofiler.types.tags_map.TagsMap"]
43
+ """<p> A list of the tags that belong to this profiling group. </p>"""
44
+
45
+
46
+ # --- restJson1 ser/de ---
47
+ def serialize_json(value: ProfilingGroupDescription) -> dict:
48
+ out: dict = {}
49
+ if "name" in value:
50
+ out["name"] = value["name"]
51
+ if "agent_orchestration_config" in value:
52
+ import capo_codeguruprofiler.types.agent_orchestration_config
53
+
54
+ out["agentOrchestrationConfig"] = (
55
+ capo_codeguruprofiler.types.agent_orchestration_config.serialize_json(
56
+ value["agent_orchestration_config"]
57
+ )
58
+ )
59
+ if "arn" in value:
60
+ out["arn"] = value["arn"]
61
+ if "created_at" in value:
62
+ import capo_codeguruprofiler.types.timestamp
63
+
64
+ out["createdAt"] = capo_codeguruprofiler.types.timestamp.serialize_json(
65
+ value["created_at"]
66
+ )
67
+ if "updated_at" in value:
68
+ import capo_codeguruprofiler.types.timestamp
69
+
70
+ out["updatedAt"] = capo_codeguruprofiler.types.timestamp.serialize_json(
71
+ value["updated_at"]
72
+ )
73
+ if "profiling_status" in value:
74
+ import capo_codeguruprofiler.types.profiling_status
75
+
76
+ out["profilingStatus"] = (
77
+ capo_codeguruprofiler.types.profiling_status.serialize_json(
78
+ value["profiling_status"]
79
+ )
80
+ )
81
+ if "compute_platform" in value:
82
+ out["computePlatform"] = value["compute_platform"]
83
+ if "tags" in value:
84
+ import capo_codeguruprofiler.types.tags_map
85
+
86
+ out["tags"] = capo_codeguruprofiler.types.tags_map.serialize_json(value["tags"])
87
+ return out
88
+
89
+
90
+ def deserialize_json(data: dict) -> ProfilingGroupDescription:
91
+ out: ProfilingGroupDescription = {} # type: ignore[typeddict-item]
92
+ if data.get("name") is not None:
93
+ out["name"] = data["name"]
94
+ if data.get("agentOrchestrationConfig") is not None:
95
+ import capo_codeguruprofiler.types.agent_orchestration_config
96
+
97
+ out["agent_orchestration_config"] = (
98
+ capo_codeguruprofiler.types.agent_orchestration_config.deserialize_json(
99
+ data["agentOrchestrationConfig"]
100
+ )
101
+ )
102
+ if data.get("arn") is not None:
103
+ out["arn"] = data["arn"]
104
+ if data.get("createdAt") is not None:
105
+ import capo_codeguruprofiler.types.timestamp
106
+
107
+ out["created_at"] = capo_codeguruprofiler.types.timestamp.deserialize_json(
108
+ data["createdAt"]
109
+ )
110
+ if data.get("updatedAt") is not None:
111
+ import capo_codeguruprofiler.types.timestamp
112
+
113
+ out["updated_at"] = capo_codeguruprofiler.types.timestamp.deserialize_json(
114
+ data["updatedAt"]
115
+ )
116
+ if data.get("profilingStatus") is not None:
117
+ import capo_codeguruprofiler.types.profiling_status
118
+
119
+ out["profiling_status"] = (
120
+ capo_codeguruprofiler.types.profiling_status.deserialize_json(
121
+ data["profilingStatus"]
122
+ )
123
+ )
124
+ if data.get("computePlatform") is not None:
125
+ out["compute_platform"] = data["computePlatform"]
126
+ if data.get("tags") is not None:
127
+ import capo_codeguruprofiler.types.tags_map
128
+
129
+ out["tags"] = capo_codeguruprofiler.types.tags_map.deserialize_json(
130
+ data["tags"]
131
+ )
132
+ return out