HEX
Server: Apache
System: Linux pdx1-shared-a1-38 6.6.104-grsec-jammy+ #3 SMP Tue Sep 16 00:28:11 UTC 2025 x86_64
User: mmickelson (3396398)
PHP: 8.1.31
Disabled: NONE
Upload Files
File: //lib/python3/dist-packages/awscli/customizations/__pycache__/putmetricdata.cpython-310.pyc
o

.&�a�@s\dZddlZddlmZddlmZddlmZdd�Zdd	�Z	d
d�Z
Gdd
�d
e�ZdS)z�
This customization adds the following scalar parameters to the
cloudwatch put-metric-data operation:

* --metric-name
* --dimensions
* --timestamp
* --value
* --statistic-values
* --unit
* --storage-resolution

�N)�CustomArgument)�split_on_commas)�#validate_mutually_exclusive_handlercCs(|�dt�|�dtdggd���dS)Nz2building-argument-table.cloudwatch.put-metric-dataz0operation-args-parsed.cloudwatch.put-metric-data�metric_data)�metric_name�	timestamp�unit�value�
dimensions�statistic_values)�register�
_promote_argsr)�
event_handler�r�E/usr/lib/python3/dist-packages/awscli/customizations/putmetricdata.py�register_put_metric_data!s�
��rcKs�d|d_tddd�|d<tddd�|d<tdd	d�|d<td
dd�|d
<tdd
d�|d<tddd�|d<|jjdj}|jd}td|jd�|d<dS)NFzmetric-datazmetric-namezThe name of the metric.)�	help_textrzyThe time stamp used for the metric.  If not specified, the default value is set to the time the metric data was received.rzThe unit of metric.r	a=The value for the metric.  Although the --value parameter accepts numbers of type Double, Amazon CloudWatch truncates values with very large exponents.  Values with base-10 exponents greater than 126 (1 x 10^126) are truncated.  Likewise, values with base-10 exponents less than -130 (1 x 10^-130) are also truncated.r
a�The --dimensions argument further expands on the identity of a metric using a Name=Value pair, separated by commas, for example: <code>--dimensions InstanceID=1-23456789,InstanceType=m1.small</code>. Note that the <code>--dimensions</code> argument has a different format when used in <code>get-metric-data</code>, where for the same example you would use the format <code>--dimensions Name=InstanceID,Value=i-aaba32d4 Name=InstanceType,value=m1.small </code>.zstatistic-valuesz2A set of statistical values describing the metric.�
MetricData�StorageResolutionzstorage-resolution)�required�PutMetricArgument�input_shape�members�member�
documentation)�argument_table�operation_model�kwargsr�storage_resolutionrrrr
+s2

�
�
�
�	
�

�
�r
cs�fdd�}|S)Ncs��fdd�}|S)Ncs6|durdS�|vrig|�<|�d}�|||�S)Nrr)�self�
parametersr	�
first_element)�func�namerr�_add_to_params^s
zIinsert_first_element.<locals>._wrap_add_to_params.<locals>._add_to_paramsr)r"r$�r#)r"r�_wrap_add_to_params]sz1insert_first_element.<locals>._wrap_add_to_paramsr)r#r&rr%r�insert_first_element\sr'c@s�eZdZdd�Zed�dd��Zed�dd��Zed�dd	��Zed�d
d��Zed�dd
��Z	ed�dd��Z
ed�dd��ZdS)rcCs"d|j�dd�}t||�||�S)Nz
_add_param_%s�-�_)r#�replace�getattr)rr r	�method_namerrr�
add_to_paramsoszPutMetricArgument.add_to_paramsrcC�||d<dS)N�
MetricNamer�rr!r	rrr�_add_param_metric_names�z(PutMetricArgument._add_param_metric_namecCr.)N�Unitrr0rrr�_add_param_unitwr2z!PutMetricArgument._add_param_unitcCr.)N�	Timestamprr0rrr�_add_param_timestamp{r2z&PutMetricArgument._add_param_timestampcCst�|�|d<dS)N�Value)�decimal�Decimalr0rrr�_add_param_valuesz"PutMetricArgument._add_param_valuecCs<g}t|�D]}|�d�\}}|�||d��q||d<dS)N�=)�Namer7�
Dimensions)r�split�append)rr!r	r
�pair�keyrrr�_add_param_dimensions�s
z'PutMetricArgument._add_param_dimensionscCs:i}t|�D]}|�d�\}}t�|�||<q||d<dS)Nr;�StatisticValues)rr>r8r9)rr!r	�
statisticsr@rArrr�_add_param_statistic_values�s
z-PutMetricArgument._add_param_statistic_valuescCst|�|d<dS)Nr)�intr0rrr�_add_param_storage_resolution�sz/PutMetricArgument._add_param_storage_resolutionN)�__name__�
__module__�__qualname__r-r'r1r4r6r:rBrErGrrrrrns 






r)�__doc__r8�awscli.argumentsr�awscli.utilsr�awscli.customizations.utilsrrr
r'rrrrr�<module>s

1