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.
- capo_codeguruprofiler/__init__.py +74 -0
- capo_codeguruprofiler/_async.py +25 -0
- capo_codeguruprofiler/_auth/_identity.py +16 -0
- capo_codeguruprofiler/_auth/_providers.py +886 -0
- capo_codeguruprofiler/_auth/_signers.py +88 -0
- capo_codeguruprofiler/_auth/_sigv4.py +434 -0
- capo_codeguruprofiler/_auth/_zapros_handler.py +80 -0
- capo_codeguruprofiler/_iter.py +113 -0
- capo_codeguruprofiler/_operations/code_guru_profiler/add_notification_channels.py +185 -0
- capo_codeguruprofiler/_operations/code_guru_profiler/batch_get_frame_metric_data.py +202 -0
- capo_codeguruprofiler/_operations/code_guru_profiler/configure_agent.py +177 -0
- capo_codeguruprofiler/_operations/code_guru_profiler/create_profiling_group.py +180 -0
- capo_codeguruprofiler/_operations/code_guru_profiler/delete_profiling_group.py +165 -0
- capo_codeguruprofiler/_operations/code_guru_profiler/describe_profiling_group.py +169 -0
- capo_codeguruprofiler/_operations/code_guru_profiler/get_findings_report_account_summary.py +164 -0
- capo_codeguruprofiler/_operations/code_guru_profiler/get_notification_configuration.py +168 -0
- capo_codeguruprofiler/_operations/code_guru_profiler/get_policy.py +161 -0
- capo_codeguruprofiler/_operations/code_guru_profiler/get_profile.py +196 -0
- capo_codeguruprofiler/_operations/code_guru_profiler/get_recommendations.py +196 -0
- capo_codeguruprofiler/_operations/code_guru_profiler/list_findings_reports.py +197 -0
- capo_codeguruprofiler/_operations/code_guru_profiler/list_profile_times.py +196 -0
- capo_codeguruprofiler/_operations/code_guru_profiler/list_profiling_groups.py +160 -0
- capo_codeguruprofiler/_operations/code_guru_profiler/list_tags_for_resource.py +158 -0
- capo_codeguruprofiler/_operations/code_guru_profiler/post_agent_profile.py +168 -0
- capo_codeguruprofiler/_operations/code_guru_profiler/put_permission.py +182 -0
- capo_codeguruprofiler/_operations/code_guru_profiler/remove_notification_channel.py +169 -0
- capo_codeguruprofiler/_operations/code_guru_profiler/remove_permission.py +175 -0
- capo_codeguruprofiler/_operations/code_guru_profiler/submit_feedback.py +170 -0
- capo_codeguruprofiler/_operations/code_guru_profiler/tag_resource.py +158 -0
- capo_codeguruprofiler/_operations/code_guru_profiler/untag_resource.py +156 -0
- capo_codeguruprofiler/_operations/code_guru_profiler/update_profiling_group.py +181 -0
- capo_codeguruprofiler/_pagination.py +21 -0
- capo_codeguruprofiler/_protocol/__init__.py +1 -0
- capo_codeguruprofiler/_protocol/errors.py +93 -0
- capo_codeguruprofiler/_protocol/eventstream.py +238 -0
- capo_codeguruprofiler/_protocol/serialize.py +47 -0
- capo_codeguruprofiler/_protocol/xml.py +33 -0
- capo_codeguruprofiler/_resources/code_guru_profiler/profiling_group.py +2257 -0
- capo_codeguruprofiler/_rule_engine/__init__.py +0 -0
- capo_codeguruprofiler/_rule_engine/_aws_partition.py +160 -0
- capo_codeguruprofiler/_rule_engine/_endpoint_rule_set.py +138 -0
- capo_codeguruprofiler/_rule_engine/_endpoint_runtime.py +389 -0
- capo_codeguruprofiler/_services/_aws_config.py +160 -0
- capo_codeguruprofiler/_services/_pipeline.py +198 -0
- capo_codeguruprofiler/_services/async_code_guru_profiler.py +377 -0
- capo_codeguruprofiler/_services/code_guru_profiler.py +373 -0
- capo_codeguruprofiler/errors/__init__.py +35 -0
- capo_codeguruprofiler/errors/_base.py +94 -0
- capo_codeguruprofiler/errors/conflict_exception.py +45 -0
- capo_codeguruprofiler/errors/internal_server_exception.py +47 -0
- capo_codeguruprofiler/errors/resource_not_found_exception.py +47 -0
- capo_codeguruprofiler/errors/service_quota_exceeded_exception.py +49 -0
- capo_codeguruprofiler/errors/throttling_exception.py +45 -0
- capo_codeguruprofiler/errors/validation_exception.py +45 -0
- capo_codeguruprofiler/py.typed +0 -0
- capo_codeguruprofiler/types/_prelude/blob.py +12 -0
- capo_codeguruprofiler/types/_prelude/timestamp.py +17 -0
- capo_codeguruprofiler/types/action_group.py +5 -0
- capo_codeguruprofiler/types/add_notification_channels_request.py +44 -0
- capo_codeguruprofiler/types/add_notification_channels_response.py +42 -0
- capo_codeguruprofiler/types/agent_configuration.py +58 -0
- capo_codeguruprofiler/types/agent_orchestration_config.py +28 -0
- capo_codeguruprofiler/types/agent_parameter_field.py +5 -0
- capo_codeguruprofiler/types/agent_parameters.py +27 -0
- capo_codeguruprofiler/types/agent_profile.py +15 -0
- capo_codeguruprofiler/types/aggregated_profile.py +15 -0
- capo_codeguruprofiler/types/aggregated_profile_time.py +45 -0
- capo_codeguruprofiler/types/aggregation_period.py +5 -0
- capo_codeguruprofiler/types/anomalies.py +29 -0
- capo_codeguruprofiler/types/anomaly.py +62 -0
- capo_codeguruprofiler/types/anomaly_instance.py +77 -0
- capo_codeguruprofiler/types/anomaly_instance_id.py +5 -0
- capo_codeguruprofiler/types/anomaly_instances.py +31 -0
- capo_codeguruprofiler/types/batch_get_frame_metric_data_request.py +56 -0
- capo_codeguruprofiler/types/batch_get_frame_metric_data_response.py +130 -0
- capo_codeguruprofiler/types/channel.py +58 -0
- capo_codeguruprofiler/types/channel_id.py +5 -0
- capo_codeguruprofiler/types/channel_uri.py +6 -0
- capo_codeguruprofiler/types/channels.py +29 -0
- capo_codeguruprofiler/types/client_token.py +5 -0
- capo_codeguruprofiler/types/compute_platform.py +5 -0
- capo_codeguruprofiler/types/configure_agent_request.py +50 -0
- capo_codeguruprofiler/types/configure_agent_response.py +43 -0
- capo_codeguruprofiler/types/create_profiling_group_request.py +81 -0
- capo_codeguruprofiler/types/create_profiling_group_response.py +45 -0
- capo_codeguruprofiler/types/delete_profiling_group_request.py +26 -0
- capo_codeguruprofiler/types/delete_profiling_group_response.py +18 -0
- capo_codeguruprofiler/types/describe_profiling_group_request.py +26 -0
- capo_codeguruprofiler/types/describe_profiling_group_response.py +45 -0
- capo_codeguruprofiler/types/event_publisher.py +5 -0
- capo_codeguruprofiler/types/event_publishers.py +19 -0
- capo_codeguruprofiler/types/feedback_type.py +5 -0
- capo_codeguruprofiler/types/findings_report_id.py +5 -0
- capo_codeguruprofiler/types/findings_report_summaries.py +35 -0
- capo_codeguruprofiler/types/findings_report_summary.py +73 -0
- capo_codeguruprofiler/types/fleet_instance_id.py +5 -0
- capo_codeguruprofiler/types/frame_metric.py +56 -0
- capo_codeguruprofiler/types/frame_metric_data.py +33 -0
- capo_codeguruprofiler/types/frame_metric_datum.py +56 -0
- capo_codeguruprofiler/types/frame_metric_value.py +5 -0
- capo_codeguruprofiler/types/frame_metric_values.py +30 -0
- capo_codeguruprofiler/types/frame_metrics.py +29 -0
- capo_codeguruprofiler/types/get_findings_report_account_summary_request.py +31 -0
- capo_codeguruprofiler/types/get_findings_report_account_summary_response.py +56 -0
- capo_codeguruprofiler/types/get_notification_configuration_request.py +26 -0
- capo_codeguruprofiler/types/get_notification_configuration_response.py +45 -0
- capo_codeguruprofiler/types/get_policy_request.py +26 -0
- capo_codeguruprofiler/types/get_policy_response.py +38 -0
- capo_codeguruprofiler/types/get_profile_request.py +39 -0
- capo_codeguruprofiler/types/get_profile_response.py +45 -0
- capo_codeguruprofiler/types/get_recommendations_request.py +34 -0
- capo_codeguruprofiler/types/get_recommendations_response.py +110 -0
- capo_codeguruprofiler/types/list_findings_reports_request.py +41 -0
- capo_codeguruprofiler/types/list_findings_reports_response.py +56 -0
- capo_codeguruprofiler/types/list_of_timestamps.py +33 -0
- capo_codeguruprofiler/types/list_profile_times_request.py +45 -0
- capo_codeguruprofiler/types/list_profile_times_response.py +50 -0
- capo_codeguruprofiler/types/list_profiling_groups_request.py +31 -0
- capo_codeguruprofiler/types/list_profiling_groups_response.py +77 -0
- capo_codeguruprofiler/types/list_tags_for_resource_request.py +24 -0
- capo_codeguruprofiler/types/list_tags_for_resource_response.py +34 -0
- capo_codeguruprofiler/types/locale.py +6 -0
- capo_codeguruprofiler/types/match.py +43 -0
- capo_codeguruprofiler/types/matches.py +29 -0
- capo_codeguruprofiler/types/max_depth.py +5 -0
- capo_codeguruprofiler/types/max_results.py +5 -0
- capo_codeguruprofiler/types/metadata.py +27 -0
- capo_codeguruprofiler/types/metadata_field.py +5 -0
- capo_codeguruprofiler/types/metric.py +54 -0
- capo_codeguruprofiler/types/metric_type.py +5 -0
- capo_codeguruprofiler/types/notification_configuration.py +36 -0
- capo_codeguruprofiler/types/order_by.py +5 -0
- capo_codeguruprofiler/types/pagination_token.py +5 -0
- capo_codeguruprofiler/types/pattern.py +95 -0
- capo_codeguruprofiler/types/percentage.py +5 -0
- capo_codeguruprofiler/types/period.py +5 -0
- capo_codeguruprofiler/types/post_agent_profile_request.py +51 -0
- capo_codeguruprofiler/types/post_agent_profile_response.py +18 -0
- capo_codeguruprofiler/types/principal.py +5 -0
- capo_codeguruprofiler/types/principals.py +17 -0
- capo_codeguruprofiler/types/profile_time.py +36 -0
- capo_codeguruprofiler/types/profile_times.py +29 -0
- capo_codeguruprofiler/types/profiling_group_arn.py +5 -0
- capo_codeguruprofiler/types/profiling_group_description.py +132 -0
- capo_codeguruprofiler/types/profiling_group_descriptions.py +37 -0
- capo_codeguruprofiler/types/profiling_group_name.py +5 -0
- capo_codeguruprofiler/types/profiling_group_names.py +19 -0
- capo_codeguruprofiler/types/profiling_status.py +83 -0
- capo_codeguruprofiler/types/put_permission_request.py +54 -0
- capo_codeguruprofiler/types/put_permission_response.py +38 -0
- capo_codeguruprofiler/types/recommendation.py +108 -0
- capo_codeguruprofiler/types/recommendations.py +31 -0
- capo_codeguruprofiler/types/remove_notification_channel_request.py +29 -0
- capo_codeguruprofiler/types/remove_notification_channel_response.py +42 -0
- capo_codeguruprofiler/types/remove_permission_request.py +32 -0
- capo_codeguruprofiler/types/remove_permission_response.py +38 -0
- capo_codeguruprofiler/types/revision_id.py +5 -0
- capo_codeguruprofiler/types/strings.py +14 -0
- capo_codeguruprofiler/types/submit_feedback_request.py +47 -0
- capo_codeguruprofiler/types/submit_feedback_response.py +18 -0
- capo_codeguruprofiler/types/tag_keys.py +14 -0
- capo_codeguruprofiler/types/tag_resource_request.py +40 -0
- capo_codeguruprofiler/types/tag_resource_response.py +18 -0
- capo_codeguruprofiler/types/tags_map.py +22 -0
- capo_codeguruprofiler/types/target_frame.py +14 -0
- capo_codeguruprofiler/types/target_frames.py +29 -0
- capo_codeguruprofiler/types/thread_states.py +14 -0
- capo_codeguruprofiler/types/timestamp.py +20 -0
- capo_codeguruprofiler/types/timestamp_structure.py +37 -0
- capo_codeguruprofiler/types/unprocessed_end_time_map.py +33 -0
- capo_codeguruprofiler/types/untag_resource_request.py +27 -0
- capo_codeguruprofiler/types/untag_resource_response.py +18 -0
- capo_codeguruprofiler/types/update_profiling_group_request.py +50 -0
- capo_codeguruprofiler/types/update_profiling_group_response.py +45 -0
- capo_codeguruprofiler/types/user_feedback.py +31 -0
- capo_codeguruprofiler-0.1.0.dist-info/METADATA +101 -0
- capo_codeguruprofiler-0.1.0.dist-info/RECORD +180 -0
- capo_codeguruprofiler-0.1.0.dist-info/WHEEL +5 -0
- capo_codeguruprofiler-0.1.0.dist-info/licenses/LICENSE +21 -0
- capo_codeguruprofiler-0.1.0.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,373 @@
|
|
|
1
|
+
"""Generated from Smithy shape ``com.amazonaws.codeguruprofiler#CodeGuruProfiler``."""
|
|
2
|
+
|
|
3
|
+
import warnings
|
|
4
|
+
from collections.abc import Iterator
|
|
5
|
+
from typing import TYPE_CHECKING, Any, Iterable, Optional
|
|
6
|
+
|
|
7
|
+
from typing_extensions import Self, TypedDict
|
|
8
|
+
from zapros import BaseHandler, Client
|
|
9
|
+
|
|
10
|
+
import capo_codeguruprofiler._auth._signers
|
|
11
|
+
import capo_codeguruprofiler._auth._sigv4
|
|
12
|
+
from capo_codeguruprofiler._auth._identity import Credentials
|
|
13
|
+
from capo_codeguruprofiler._auth._providers import (
|
|
14
|
+
CredentialsProvider,
|
|
15
|
+
IdentityProvider,
|
|
16
|
+
StaticAwsCredentialsProvider,
|
|
17
|
+
default_aws_credentials_chain,
|
|
18
|
+
)
|
|
19
|
+
from capo_codeguruprofiler._auth._zapros_handler import AuthMiddleware
|
|
20
|
+
from capo_codeguruprofiler._pagination import resolve_path as _resolve_path
|
|
21
|
+
from capo_codeguruprofiler._resources.code_guru_profiler.profiling_group import (
|
|
22
|
+
ProfilingGroup,
|
|
23
|
+
)
|
|
24
|
+
from capo_codeguruprofiler._services._aws_config import aws_config
|
|
25
|
+
from capo_codeguruprofiler._services._pipeline import (
|
|
26
|
+
Interceptor,
|
|
27
|
+
OperationOptions,
|
|
28
|
+
OperationRequest,
|
|
29
|
+
OperationResponse,
|
|
30
|
+
execute_pipeline,
|
|
31
|
+
retry,
|
|
32
|
+
)
|
|
33
|
+
|
|
34
|
+
if TYPE_CHECKING:
|
|
35
|
+
import capo_codeguruprofiler.types.get_findings_report_account_summary_request
|
|
36
|
+
import capo_codeguruprofiler.types.get_findings_report_account_summary_response
|
|
37
|
+
import capo_codeguruprofiler.types.list_tags_for_resource_request
|
|
38
|
+
import capo_codeguruprofiler.types.list_tags_for_resource_response
|
|
39
|
+
import capo_codeguruprofiler.types.max_results
|
|
40
|
+
import capo_codeguruprofiler.types.pagination_token
|
|
41
|
+
import capo_codeguruprofiler.types.profiling_group_arn
|
|
42
|
+
import capo_codeguruprofiler.types.tag_keys
|
|
43
|
+
import capo_codeguruprofiler.types.tag_resource_request
|
|
44
|
+
import capo_codeguruprofiler.types.tag_resource_response
|
|
45
|
+
import capo_codeguruprofiler.types.tags_map
|
|
46
|
+
import capo_codeguruprofiler.types.untag_resource_request
|
|
47
|
+
import capo_codeguruprofiler.types.untag_resource_response
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
class CodeGuruProfilerClientConfig(TypedDict, total=False, closed=True):
|
|
51
|
+
operation_interceptors: Iterable[Interceptor[Any, Any]]
|
|
52
|
+
retry_max_attempts: int | None
|
|
53
|
+
region: str | None
|
|
54
|
+
use_dual_stack: bool | None
|
|
55
|
+
use_fips: bool | None
|
|
56
|
+
endpoint: str | None
|
|
57
|
+
credentials_provider: IdentityProvider[Credentials] | None
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
class CodeGuruProfilerClient:
|
|
61
|
+
"""A client for the ``CodeGuruProfiler`` service.
|
|
62
|
+
|
|
63
|
+
Args:
|
|
64
|
+
http_handler: HTTP handler for sending requests. If not provided, creates a default handler.
|
|
65
|
+
operation_interceptors: Interceptors that wrap every operation call. If not provided, defaults to an empty list.
|
|
66
|
+
retry_max_attempts: Maximum number of times to retry a failed operation. Defaults to 3.
|
|
67
|
+
region: The value of the ``AWS::Region`` endpoint parameter.
|
|
68
|
+
use_dual_stack: The value of the ``AWS::UseDualStack`` endpoint parameter.
|
|
69
|
+
use_fips: The value of the ``AWS::UseFIPS`` endpoint parameter.
|
|
70
|
+
endpoint: The value of the ``SDK::Endpoint`` endpoint parameter.
|
|
71
|
+
credentials: AWS credentials for request signing.
|
|
72
|
+
credentials_provider: Provider that resolves AWS credentials. Takes precedence over ``credentials``.
|
|
73
|
+
"""
|
|
74
|
+
|
|
75
|
+
def __init__(
|
|
76
|
+
self,
|
|
77
|
+
http_handler: BaseHandler | None = None,
|
|
78
|
+
operation_interceptors: Iterable[Interceptor[Any, Any]] | None = None,
|
|
79
|
+
retry_max_attempts: int | None = None,
|
|
80
|
+
region: str | None = None,
|
|
81
|
+
use_dual_stack: bool | None = None,
|
|
82
|
+
use_fips: bool | None = None,
|
|
83
|
+
endpoint: str | None = None,
|
|
84
|
+
credentials: Credentials | None = None,
|
|
85
|
+
credentials_provider: CredentialsProvider | None = None,
|
|
86
|
+
):
|
|
87
|
+
self._client = Client(http_handler).wrap_with_middleware(
|
|
88
|
+
lambda next: AuthMiddleware(next)
|
|
89
|
+
)
|
|
90
|
+
if credentials is not None and credentials_provider is not None:
|
|
91
|
+
warnings.warn(
|
|
92
|
+
"Both credentials and credentials_provider given; provider takes precedence"
|
|
93
|
+
)
|
|
94
|
+
resolved_credentials_provider: IdentityProvider[Credentials] | None = (
|
|
95
|
+
credentials_provider
|
|
96
|
+
)
|
|
97
|
+
if resolved_credentials_provider is None and credentials is not None:
|
|
98
|
+
resolved_credentials_provider = StaticAwsCredentialsProvider(credentials)
|
|
99
|
+
if resolved_credentials_provider is None and credentials is None:
|
|
100
|
+
resolved_credentials_provider = default_aws_credentials_chain(
|
|
101
|
+
Client(http_handler)
|
|
102
|
+
)
|
|
103
|
+
self._config = CodeGuruProfilerClientConfig(
|
|
104
|
+
{
|
|
105
|
+
"operation_interceptors": operation_interceptors or [],
|
|
106
|
+
"retry_max_attempts": retry_max_attempts,
|
|
107
|
+
"region": region,
|
|
108
|
+
"use_dual_stack": use_dual_stack,
|
|
109
|
+
"use_fips": use_fips,
|
|
110
|
+
"endpoint": endpoint,
|
|
111
|
+
"credentials_provider": resolved_credentials_provider,
|
|
112
|
+
}
|
|
113
|
+
)
|
|
114
|
+
|
|
115
|
+
# resources
|
|
116
|
+
self.profiling_group = ProfilingGroup(self)
|
|
117
|
+
|
|
118
|
+
def operation_options(
|
|
119
|
+
self, config_overrides: Optional[CodeGuruProfilerClientConfig] = None
|
|
120
|
+
) -> tuple[Iterable[Interceptor[Any, Any]], OperationOptions]:
|
|
121
|
+
overrides: CodeGuruProfilerClientConfig = config_overrides or {}
|
|
122
|
+
interceptors_: list[Interceptor[Any, Any]] = [
|
|
123
|
+
*overrides.get(
|
|
124
|
+
"operation_interceptors", self._config.get("operation_interceptors", [])
|
|
125
|
+
),
|
|
126
|
+
aws_config(),
|
|
127
|
+
retry(),
|
|
128
|
+
]
|
|
129
|
+
options_: OperationOptions = OperationOptions(
|
|
130
|
+
client=self._client,
|
|
131
|
+
retry_max_attempts=overrides.get(
|
|
132
|
+
"retry_max_attempts", self._config.get("retry_max_attempts")
|
|
133
|
+
),
|
|
134
|
+
region=overrides.get("region", self._config.get("region")),
|
|
135
|
+
use_dual_stack=overrides.get(
|
|
136
|
+
"use_dual_stack", self._config.get("use_dual_stack")
|
|
137
|
+
),
|
|
138
|
+
use_fips=overrides.get("use_fips", self._config.get("use_fips")),
|
|
139
|
+
endpoint=overrides.get("endpoint", self._config.get("endpoint")),
|
|
140
|
+
credentials_provider=overrides.get(
|
|
141
|
+
"credentials_provider", self._config.get("credentials_provider")
|
|
142
|
+
),
|
|
143
|
+
)
|
|
144
|
+
return interceptors_, options_
|
|
145
|
+
|
|
146
|
+
def get_findings_report_account_summary(
|
|
147
|
+
self,
|
|
148
|
+
*,
|
|
149
|
+
config_overrides: Optional[CodeGuruProfilerClientConfig] = None,
|
|
150
|
+
next_token: Optional[
|
|
151
|
+
"capo_codeguruprofiler.types.pagination_token.PaginationToken"
|
|
152
|
+
] = None,
|
|
153
|
+
max_results: Optional[
|
|
154
|
+
"capo_codeguruprofiler.types.max_results.MaxResults"
|
|
155
|
+
] = None,
|
|
156
|
+
daily_reports_only: Optional[bool] = None,
|
|
157
|
+
) -> "capo_codeguruprofiler.types.get_findings_report_account_summary_response.GetFindingsReportAccountSummaryResponse":
|
|
158
|
+
r"""<p> Returns a list of <a href=\"https://docs.aws.amazon.com/codeguru/latest/profiler-api/API_FindingsReportSummary.html\"> <code>FindingsReportSummary</code> </a> objects that contain analysis results for all profiling groups in your AWS account. </p>
|
|
159
|
+
|
|
160
|
+
Args:
|
|
161
|
+
next_token: <p>The <code>nextToken</code> value returned from a previous paginated <code>GetFindingsReportAccountSummary</code> request where <code>maxResults</code> was used and the results exceeded the value of that parameter. Pagination continues from the end of the previous results that returned the <code>nextToken</code> value. </p> <note> <p>This token should be treated as an opaque identifier that is only used to retrieve the next items in a list and not for other programmatic purposes.</p> </note>
|
|
162
|
+
max_results: <p>The maximum number of results returned by <code> GetFindingsReportAccountSummary</code> in paginated output. When this parameter is used, <code>GetFindingsReportAccountSummary</code> only returns <code>maxResults</code> results in a single page along with a <code>nextToken</code> response element. The remaining results of the initial request can be seen by sending another <code>GetFindingsReportAccountSummary</code> request with the returned <code>nextToken</code> value.</p>
|
|
163
|
+
daily_reports_only: <p>A <code>Boolean</code> value indicating whether to only return reports from daily profiles. If set to <code>True</code>, only analysis data from daily profiles is returned. If set to <code>False</code>, analysis data is returned from smaller time windows (for example, one hour).</p>
|
|
164
|
+
|
|
165
|
+
Raises:
|
|
166
|
+
capo_codeguruprofiler.errors.internal_server_exception.InternalServerException: <p>The server encountered an internal error and is unable to complete the request.</p>
|
|
167
|
+
capo_codeguruprofiler.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling.</p>
|
|
168
|
+
capo_codeguruprofiler.errors.validation_exception.ValidationException: <p>The parameter is not valid.</p>
|
|
169
|
+
capo_codeguruprofiler.errors.UnknownServiceError: The service returned an error code this client does not model.
|
|
170
|
+
"""
|
|
171
|
+
|
|
172
|
+
def _handler(
|
|
173
|
+
req: "OperationRequest[capo_codeguruprofiler.types.get_findings_report_account_summary_request.GetFindingsReportAccountSummaryRequest]",
|
|
174
|
+
) -> OperationResponse[
|
|
175
|
+
"capo_codeguruprofiler.types.get_findings_report_account_summary_response.GetFindingsReportAccountSummaryResponse"
|
|
176
|
+
]:
|
|
177
|
+
import capo_codeguruprofiler._operations.code_guru_profiler.get_findings_report_account_summary
|
|
178
|
+
|
|
179
|
+
output, http_response = (
|
|
180
|
+
capo_codeguruprofiler._operations.code_guru_profiler.get_findings_report_account_summary.get_findings_report_account_summary(
|
|
181
|
+
req.options, req.input
|
|
182
|
+
)
|
|
183
|
+
)
|
|
184
|
+
return OperationResponse(output=output, response=http_response)
|
|
185
|
+
|
|
186
|
+
interceptors_, options_ = self.operation_options(config_overrides)
|
|
187
|
+
input_: capo_codeguruprofiler.types.get_findings_report_account_summary_request.GetFindingsReportAccountSummaryRequest = {}
|
|
188
|
+
if next_token is not None:
|
|
189
|
+
input_["next_token"] = next_token
|
|
190
|
+
if max_results is not None:
|
|
191
|
+
input_["max_results"] = max_results
|
|
192
|
+
if daily_reports_only is not None:
|
|
193
|
+
input_["daily_reports_only"] = daily_reports_only
|
|
194
|
+
|
|
195
|
+
response = execute_pipeline(
|
|
196
|
+
OperationRequest(input=input_, options=options_),
|
|
197
|
+
handler=_handler,
|
|
198
|
+
interceptors=list(interceptors_),
|
|
199
|
+
)
|
|
200
|
+
response.response.close()
|
|
201
|
+
return response.output
|
|
202
|
+
|
|
203
|
+
def iter_get_findings_report_account_summary(
|
|
204
|
+
self,
|
|
205
|
+
*,
|
|
206
|
+
config_overrides: Optional[CodeGuruProfilerClientConfig] = None,
|
|
207
|
+
next_token: Optional[
|
|
208
|
+
"capo_codeguruprofiler.types.pagination_token.PaginationToken"
|
|
209
|
+
] = None,
|
|
210
|
+
max_results: Optional[
|
|
211
|
+
"capo_codeguruprofiler.types.max_results.MaxResults"
|
|
212
|
+
] = None,
|
|
213
|
+
daily_reports_only: Optional[bool] = None,
|
|
214
|
+
) -> "Iterator[capo_codeguruprofiler.types.get_findings_report_account_summary_response.GetFindingsReportAccountSummaryResponse]":
|
|
215
|
+
_token = next_token
|
|
216
|
+
while True:
|
|
217
|
+
_response = self.get_findings_report_account_summary(
|
|
218
|
+
config_overrides=config_overrides,
|
|
219
|
+
next_token=_token,
|
|
220
|
+
max_results=max_results,
|
|
221
|
+
daily_reports_only=daily_reports_only,
|
|
222
|
+
)
|
|
223
|
+
yield _response
|
|
224
|
+
_token = _resolve_path(_response, ("next_token",))
|
|
225
|
+
if not _token:
|
|
226
|
+
break
|
|
227
|
+
|
|
228
|
+
def list_tags_for_resource(
|
|
229
|
+
self,
|
|
230
|
+
resource_arn: "capo_codeguruprofiler.types.profiling_group_arn.ProfilingGroupArn",
|
|
231
|
+
*,
|
|
232
|
+
config_overrides: Optional[CodeGuruProfilerClientConfig] = None,
|
|
233
|
+
) -> "capo_codeguruprofiler.types.list_tags_for_resource_response.ListTagsForResourceResponse":
|
|
234
|
+
"""<p> Returns a list of the tags that are assigned to a specified resource. </p>
|
|
235
|
+
|
|
236
|
+
Args:
|
|
237
|
+
resource_arn: <p> The Amazon Resource Name (ARN) of the resource that contains the tags to return. </p>
|
|
238
|
+
|
|
239
|
+
Raises:
|
|
240
|
+
capo_codeguruprofiler.errors.internal_server_exception.InternalServerException: <p>The server encountered an internal error and is unable to complete the request.</p>
|
|
241
|
+
capo_codeguruprofiler.errors.resource_not_found_exception.ResourceNotFoundException: <p>The resource specified in the request does not exist.</p>
|
|
242
|
+
capo_codeguruprofiler.errors.validation_exception.ValidationException: <p>The parameter is not valid.</p>
|
|
243
|
+
capo_codeguruprofiler.errors.UnknownServiceError: The service returned an error code this client does not model.
|
|
244
|
+
"""
|
|
245
|
+
|
|
246
|
+
def _handler(
|
|
247
|
+
req: "OperationRequest[capo_codeguruprofiler.types.list_tags_for_resource_request.ListTagsForResourceRequest]",
|
|
248
|
+
) -> OperationResponse[
|
|
249
|
+
"capo_codeguruprofiler.types.list_tags_for_resource_response.ListTagsForResourceResponse"
|
|
250
|
+
]:
|
|
251
|
+
import capo_codeguruprofiler._operations.code_guru_profiler.list_tags_for_resource
|
|
252
|
+
|
|
253
|
+
output, http_response = (
|
|
254
|
+
capo_codeguruprofiler._operations.code_guru_profiler.list_tags_for_resource.list_tags_for_resource(
|
|
255
|
+
req.options, req.input
|
|
256
|
+
)
|
|
257
|
+
)
|
|
258
|
+
return OperationResponse(output=output, response=http_response)
|
|
259
|
+
|
|
260
|
+
interceptors_, options_ = self.operation_options(config_overrides)
|
|
261
|
+
input_: capo_codeguruprofiler.types.list_tags_for_resource_request.ListTagsForResourceRequest = {
|
|
262
|
+
"resource_arn": resource_arn
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
response = execute_pipeline(
|
|
266
|
+
OperationRequest(input=input_, options=options_),
|
|
267
|
+
handler=_handler,
|
|
268
|
+
interceptors=list(interceptors_),
|
|
269
|
+
)
|
|
270
|
+
response.response.close()
|
|
271
|
+
return response.output
|
|
272
|
+
|
|
273
|
+
def tag_resource(
|
|
274
|
+
self,
|
|
275
|
+
resource_arn: "capo_codeguruprofiler.types.profiling_group_arn.ProfilingGroupArn",
|
|
276
|
+
tags: "capo_codeguruprofiler.types.tags_map.TagsMap",
|
|
277
|
+
*,
|
|
278
|
+
config_overrides: Optional[CodeGuruProfilerClientConfig] = None,
|
|
279
|
+
) -> "capo_codeguruprofiler.types.tag_resource_response.TagResourceResponse":
|
|
280
|
+
"""<p> Use to assign one or more tags to a resource. </p>
|
|
281
|
+
|
|
282
|
+
Args:
|
|
283
|
+
resource_arn: <p> The Amazon Resource Name (ARN) of the resource that the tags are added to. </p>
|
|
284
|
+
tags: <p> The list of tags that are added to the specified resource. </p>
|
|
285
|
+
|
|
286
|
+
Raises:
|
|
287
|
+
capo_codeguruprofiler.errors.internal_server_exception.InternalServerException: <p>The server encountered an internal error and is unable to complete the request.</p>
|
|
288
|
+
capo_codeguruprofiler.errors.resource_not_found_exception.ResourceNotFoundException: <p>The resource specified in the request does not exist.</p>
|
|
289
|
+
capo_codeguruprofiler.errors.validation_exception.ValidationException: <p>The parameter is not valid.</p>
|
|
290
|
+
capo_codeguruprofiler.errors.UnknownServiceError: The service returned an error code this client does not model.
|
|
291
|
+
"""
|
|
292
|
+
|
|
293
|
+
def _handler(
|
|
294
|
+
req: "OperationRequest[capo_codeguruprofiler.types.tag_resource_request.TagResourceRequest]",
|
|
295
|
+
) -> OperationResponse[
|
|
296
|
+
"capo_codeguruprofiler.types.tag_resource_response.TagResourceResponse"
|
|
297
|
+
]:
|
|
298
|
+
import capo_codeguruprofiler._operations.code_guru_profiler.tag_resource
|
|
299
|
+
|
|
300
|
+
output, http_response = (
|
|
301
|
+
capo_codeguruprofiler._operations.code_guru_profiler.tag_resource.tag_resource(
|
|
302
|
+
req.options, req.input
|
|
303
|
+
)
|
|
304
|
+
)
|
|
305
|
+
return OperationResponse(output=output, response=http_response)
|
|
306
|
+
|
|
307
|
+
interceptors_, options_ = self.operation_options(config_overrides)
|
|
308
|
+
input_: capo_codeguruprofiler.types.tag_resource_request.TagResourceRequest = {
|
|
309
|
+
"resource_arn": resource_arn,
|
|
310
|
+
"tags": tags,
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
response = execute_pipeline(
|
|
314
|
+
OperationRequest(input=input_, options=options_),
|
|
315
|
+
handler=_handler,
|
|
316
|
+
interceptors=list(interceptors_),
|
|
317
|
+
)
|
|
318
|
+
response.response.close()
|
|
319
|
+
return response.output
|
|
320
|
+
|
|
321
|
+
def untag_resource(
|
|
322
|
+
self,
|
|
323
|
+
resource_arn: "capo_codeguruprofiler.types.profiling_group_arn.ProfilingGroupArn",
|
|
324
|
+
tag_keys: "capo_codeguruprofiler.types.tag_keys.TagKeys",
|
|
325
|
+
*,
|
|
326
|
+
config_overrides: Optional[CodeGuruProfilerClientConfig] = None,
|
|
327
|
+
) -> "capo_codeguruprofiler.types.untag_resource_response.UntagResourceResponse":
|
|
328
|
+
"""<p> Use to remove one or more tags from a resource. </p>
|
|
329
|
+
|
|
330
|
+
Args:
|
|
331
|
+
resource_arn: <p> The Amazon Resource Name (ARN) of the resource that contains the tags to remove. </p>
|
|
332
|
+
tag_keys: <p> A list of tag keys. Existing tags of resources with keys in this list are removed from the specified resource. </p>
|
|
333
|
+
|
|
334
|
+
Raises:
|
|
335
|
+
capo_codeguruprofiler.errors.internal_server_exception.InternalServerException: <p>The server encountered an internal error and is unable to complete the request.</p>
|
|
336
|
+
capo_codeguruprofiler.errors.resource_not_found_exception.ResourceNotFoundException: <p>The resource specified in the request does not exist.</p>
|
|
337
|
+
capo_codeguruprofiler.errors.validation_exception.ValidationException: <p>The parameter is not valid.</p>
|
|
338
|
+
capo_codeguruprofiler.errors.UnknownServiceError: The service returned an error code this client does not model.
|
|
339
|
+
"""
|
|
340
|
+
|
|
341
|
+
def _handler(
|
|
342
|
+
req: "OperationRequest[capo_codeguruprofiler.types.untag_resource_request.UntagResourceRequest]",
|
|
343
|
+
) -> OperationResponse[
|
|
344
|
+
"capo_codeguruprofiler.types.untag_resource_response.UntagResourceResponse"
|
|
345
|
+
]:
|
|
346
|
+
import capo_codeguruprofiler._operations.code_guru_profiler.untag_resource
|
|
347
|
+
|
|
348
|
+
output, http_response = (
|
|
349
|
+
capo_codeguruprofiler._operations.code_guru_profiler.untag_resource.untag_resource(
|
|
350
|
+
req.options, req.input
|
|
351
|
+
)
|
|
352
|
+
)
|
|
353
|
+
return OperationResponse(output=output, response=http_response)
|
|
354
|
+
|
|
355
|
+
interceptors_, options_ = self.operation_options(config_overrides)
|
|
356
|
+
input_: capo_codeguruprofiler.types.untag_resource_request.UntagResourceRequest = {
|
|
357
|
+
"resource_arn": resource_arn,
|
|
358
|
+
"tag_keys": tag_keys,
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
response = execute_pipeline(
|
|
362
|
+
OperationRequest(input=input_, options=options_),
|
|
363
|
+
handler=_handler,
|
|
364
|
+
interceptors=list(interceptors_),
|
|
365
|
+
)
|
|
366
|
+
response.response.close()
|
|
367
|
+
return response.output
|
|
368
|
+
|
|
369
|
+
def __enter__(self) -> Self:
|
|
370
|
+
return self
|
|
371
|
+
|
|
372
|
+
def __exit__(self, exc_type: Any, exc: Any, tb: Any):
|
|
373
|
+
self._client.close()
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from ._base import (
|
|
4
|
+
CodeGuruProfilerError as CodeGuruProfilerError,
|
|
5
|
+
)
|
|
6
|
+
from ._base import (
|
|
7
|
+
DeserializationError as DeserializationError,
|
|
8
|
+
)
|
|
9
|
+
from ._base import (
|
|
10
|
+
SerializationError as SerializationError,
|
|
11
|
+
)
|
|
12
|
+
from ._base import (
|
|
13
|
+
ServiceError as ServiceError,
|
|
14
|
+
)
|
|
15
|
+
from ._base import (
|
|
16
|
+
UnknownServiceError as UnknownServiceError,
|
|
17
|
+
)
|
|
18
|
+
from ._base import (
|
|
19
|
+
WaiterFailedError as WaiterFailedError,
|
|
20
|
+
)
|
|
21
|
+
from ._base import (
|
|
22
|
+
WaiterTimeoutError as WaiterTimeoutError,
|
|
23
|
+
)
|
|
24
|
+
from .conflict_exception import ConflictException as ConflictException
|
|
25
|
+
from .internal_server_exception import (
|
|
26
|
+
InternalServerException as InternalServerException,
|
|
27
|
+
)
|
|
28
|
+
from .resource_not_found_exception import (
|
|
29
|
+
ResourceNotFoundException as ResourceNotFoundException,
|
|
30
|
+
)
|
|
31
|
+
from .service_quota_exceeded_exception import (
|
|
32
|
+
ServiceQuotaExceededException as ServiceQuotaExceededException,
|
|
33
|
+
)
|
|
34
|
+
from .throttling_exception import ThrottlingException as ThrottlingException
|
|
35
|
+
from .validation_exception import ValidationException as ValidationException
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
from typing import Literal
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
class CodeGuruProfilerError(Exception):
|
|
5
|
+
"""Base class for all CodeGuruProfiler service errors."""
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class ServiceError(CodeGuruProfilerError):
|
|
9
|
+
"""Base class for all modeled service errors.
|
|
10
|
+
|
|
11
|
+
Args:
|
|
12
|
+
fault: ``"client"`` or ``"server"``.
|
|
13
|
+
is_throttling_error: Whether this error is a throttling error.
|
|
14
|
+
is_retryable: Whether this error is retryable.
|
|
15
|
+
code: The wire error code, or ``None``.
|
|
16
|
+
message: The error message, or ``None``.
|
|
17
|
+
"""
|
|
18
|
+
|
|
19
|
+
code: str | None = None
|
|
20
|
+
|
|
21
|
+
def __init__(
|
|
22
|
+
self,
|
|
23
|
+
fault: Literal["client", "server"],
|
|
24
|
+
*,
|
|
25
|
+
is_throttling_error: bool,
|
|
26
|
+
is_retryable: bool,
|
|
27
|
+
code: str | None = None,
|
|
28
|
+
message: str | None = None,
|
|
29
|
+
) -> None:
|
|
30
|
+
super().__init__(f"{code or '<no code>'}: {message or '<no message>'}")
|
|
31
|
+
self.fault = fault
|
|
32
|
+
self.is_throttling_error = is_throttling_error
|
|
33
|
+
self.is_retryable = is_retryable
|
|
34
|
+
self.code = code
|
|
35
|
+
self.message = message
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
class SerializationError(CodeGuruProfilerError):
|
|
39
|
+
"""Raised when a value cannot be serialized."""
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
class DeserializationError(CodeGuruProfilerError):
|
|
43
|
+
"""Raised when a value cannot be deserialized or a required member is missing."""
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
class UnknownServiceError(ServiceError):
|
|
47
|
+
"""Raised when the server returns an error code the client does not model.
|
|
48
|
+
|
|
49
|
+
Args:
|
|
50
|
+
code: ``<Code>`` text from the response body, or ``None`` if absent.
|
|
51
|
+
message: ``<Message>`` text from the response body, or ``None``.
|
|
52
|
+
response: The original HTTP response object, for arbitrary inspection.
|
|
53
|
+
"""
|
|
54
|
+
|
|
55
|
+
def __init__(
|
|
56
|
+
self, *, code: str | None, message: str | None, response: object
|
|
57
|
+
) -> None:
|
|
58
|
+
_status = getattr(response, "status", 500)
|
|
59
|
+
_fault: Literal["client", "server"] = "client" if _status < 500 else "server"
|
|
60
|
+
_throttling = _status == 429
|
|
61
|
+
_retryable = _throttling or _status >= 500
|
|
62
|
+
super().__init__(
|
|
63
|
+
_fault,
|
|
64
|
+
is_throttling_error=_throttling,
|
|
65
|
+
is_retryable=_retryable,
|
|
66
|
+
code=code,
|
|
67
|
+
message=message,
|
|
68
|
+
)
|
|
69
|
+
self.response = response
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
class WaiterFailedError(CodeGuruProfilerError):
|
|
73
|
+
"""Raised when a waiter hits an acceptor with ``state="failure"``.
|
|
74
|
+
|
|
75
|
+
Args:
|
|
76
|
+
waiter_name: snake_case waiter name (e.g. ``bucket_exists``).
|
|
77
|
+
reason: Short description of which acceptor fired.
|
|
78
|
+
"""
|
|
79
|
+
|
|
80
|
+
def __init__(self, waiter_name: str, reason: str) -> None:
|
|
81
|
+
super().__init__(f"waiter {waiter_name} failed: {reason}")
|
|
82
|
+
self.waiter_name = waiter_name
|
|
83
|
+
self.reason = reason
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
class WaiterTimeoutError(CodeGuruProfilerError):
|
|
87
|
+
"""Raised when a waiter exhausts ``max_wait_time`` without a terminal acceptor."""
|
|
88
|
+
|
|
89
|
+
def __init__(self, waiter_name: str, max_wait_time: float) -> None:
|
|
90
|
+
super().__init__(
|
|
91
|
+
f"waiter {waiter_name} timed out after {max_wait_time} seconds"
|
|
92
|
+
)
|
|
93
|
+
self.waiter_name = waiter_name
|
|
94
|
+
self.max_wait_time = max_wait_time
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"""Generated from Smithy shape ``com.amazonaws.codeguruprofiler#ConflictException``."""
|
|
2
|
+
|
|
3
|
+
from typing_extensions import TypedDict
|
|
4
|
+
|
|
5
|
+
from capo_codeguruprofiler.errors import DeserializationError, ServiceError
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class ConflictException_(TypedDict, closed=True):
|
|
9
|
+
message: "str"
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
# --- restJson1 ser/de ---
|
|
13
|
+
def serialize_json(value: ConflictException_) -> dict:
|
|
14
|
+
out: dict = {}
|
|
15
|
+
out["message"] = value["message"]
|
|
16
|
+
return out
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
def deserialize_json(data: dict) -> ConflictException_:
|
|
20
|
+
out: ConflictException_ = {} # type: ignore[typeddict-item]
|
|
21
|
+
if data.get("message") is not None:
|
|
22
|
+
out["message"] = data["message"]
|
|
23
|
+
else:
|
|
24
|
+
raise DeserializationError("ConflictException_.message required")
|
|
25
|
+
return out
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
class ConflictException(ServiceError):
|
|
29
|
+
"""Modeled error for Smithy shape ``com.amazonaws.codeguruprofiler#ConflictException``."""
|
|
30
|
+
|
|
31
|
+
code: str | None = "ConflictException"
|
|
32
|
+
|
|
33
|
+
def __init__(self, data: ConflictException_, message: str | None = None):
|
|
34
|
+
super().__init__(
|
|
35
|
+
"client",
|
|
36
|
+
is_throttling_error=False,
|
|
37
|
+
is_retryable=False,
|
|
38
|
+
code="ConflictException",
|
|
39
|
+
message=message,
|
|
40
|
+
)
|
|
41
|
+
self.data = data
|
|
42
|
+
|
|
43
|
+
@classmethod
|
|
44
|
+
def from_json(cls, data: dict, message: str | None = None) -> "ConflictException":
|
|
45
|
+
return cls(deserialize_json(data), message)
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"""Generated from Smithy shape ``com.amazonaws.codeguruprofiler#InternalServerException``."""
|
|
2
|
+
|
|
3
|
+
from typing_extensions import TypedDict
|
|
4
|
+
|
|
5
|
+
from capo_codeguruprofiler.errors import DeserializationError, ServiceError
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class InternalServerException_(TypedDict, closed=True):
|
|
9
|
+
message: "str"
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
# --- restJson1 ser/de ---
|
|
13
|
+
def serialize_json(value: InternalServerException_) -> dict:
|
|
14
|
+
out: dict = {}
|
|
15
|
+
out["message"] = value["message"]
|
|
16
|
+
return out
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
def deserialize_json(data: dict) -> InternalServerException_:
|
|
20
|
+
out: InternalServerException_ = {} # type: ignore[typeddict-item]
|
|
21
|
+
if data.get("message") is not None:
|
|
22
|
+
out["message"] = data["message"]
|
|
23
|
+
else:
|
|
24
|
+
raise DeserializationError("InternalServerException_.message required")
|
|
25
|
+
return out
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
class InternalServerException(ServiceError):
|
|
29
|
+
"""Modeled error for Smithy shape ``com.amazonaws.codeguruprofiler#InternalServerException``."""
|
|
30
|
+
|
|
31
|
+
code: str | None = "InternalServerException"
|
|
32
|
+
|
|
33
|
+
def __init__(self, data: InternalServerException_, message: str | None = None):
|
|
34
|
+
super().__init__(
|
|
35
|
+
"server",
|
|
36
|
+
is_throttling_error=False,
|
|
37
|
+
is_retryable=True,
|
|
38
|
+
code="InternalServerException",
|
|
39
|
+
message=message,
|
|
40
|
+
)
|
|
41
|
+
self.data = data
|
|
42
|
+
|
|
43
|
+
@classmethod
|
|
44
|
+
def from_json(
|
|
45
|
+
cls, data: dict, message: str | None = None
|
|
46
|
+
) -> "InternalServerException":
|
|
47
|
+
return cls(deserialize_json(data), message)
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"""Generated from Smithy shape ``com.amazonaws.codeguruprofiler#ResourceNotFoundException``."""
|
|
2
|
+
|
|
3
|
+
from typing_extensions import TypedDict
|
|
4
|
+
|
|
5
|
+
from capo_codeguruprofiler.errors import DeserializationError, ServiceError
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class ResourceNotFoundException_(TypedDict, closed=True):
|
|
9
|
+
message: "str"
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
# --- restJson1 ser/de ---
|
|
13
|
+
def serialize_json(value: ResourceNotFoundException_) -> dict:
|
|
14
|
+
out: dict = {}
|
|
15
|
+
out["message"] = value["message"]
|
|
16
|
+
return out
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
def deserialize_json(data: dict) -> ResourceNotFoundException_:
|
|
20
|
+
out: ResourceNotFoundException_ = {} # type: ignore[typeddict-item]
|
|
21
|
+
if data.get("message") is not None:
|
|
22
|
+
out["message"] = data["message"]
|
|
23
|
+
else:
|
|
24
|
+
raise DeserializationError("ResourceNotFoundException_.message required")
|
|
25
|
+
return out
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
class ResourceNotFoundException(ServiceError):
|
|
29
|
+
"""Modeled error for Smithy shape ``com.amazonaws.codeguruprofiler#ResourceNotFoundException``."""
|
|
30
|
+
|
|
31
|
+
code: str | None = "ResourceNotFoundException"
|
|
32
|
+
|
|
33
|
+
def __init__(self, data: ResourceNotFoundException_, message: str | None = None):
|
|
34
|
+
super().__init__(
|
|
35
|
+
"client",
|
|
36
|
+
is_throttling_error=False,
|
|
37
|
+
is_retryable=False,
|
|
38
|
+
code="ResourceNotFoundException",
|
|
39
|
+
message=message,
|
|
40
|
+
)
|
|
41
|
+
self.data = data
|
|
42
|
+
|
|
43
|
+
@classmethod
|
|
44
|
+
def from_json(
|
|
45
|
+
cls, data: dict, message: str | None = None
|
|
46
|
+
) -> "ResourceNotFoundException":
|
|
47
|
+
return cls(deserialize_json(data), message)
|