MCPcopy Create free account
hub / github.com/aws/aws-cli / UserAgentComponentSizeConfig

Class UserAgentComponentSizeConfig

awscli/botocore/useragent.py:159–175  ·  view source on GitHub ↗

Configures the max size of a built user agent string component and the delimiter used to truncate the string if the size is above the max.

Source from the content-addressed store, hash-verified

157
158
159class UserAgentComponentSizeConfig:
160 """
161 Configures the max size of a built user agent string component and the
162 delimiter used to truncate the string if the size is above the max.
163 """
164
165 def __init__(self, max_size_in_bytes: int, delimiter: str):
166 self.max_size_in_bytes = max_size_in_bytes
167 self.delimiter = delimiter
168 self._validate_input()
169
170 def _validate_input(self):
171 if self.max_size_in_bytes < 1:
172 raise ValueError(
173 f'Invalid `max_size_in_bytes`: {self.max_size_in_bytes}. '
174 'Value must be a positive integer.'
175 )
176
177
178class UserAgentComponent(NamedTuple):

Calls

no outgoing calls