File: //usr/local/CyberCP/lib64/python3.10/site-packages/botocore/__pycache__/validate.cpython-310.pyc
o
�h�5 � @ s� d Z ddlZddlZddlmZ ddlmZ ddlmZmZ dd� Z dd � Z
d
d� ZG dd
� d
�ZG dd� d�Z
G dd� d�ZdS )aQ User input parameter validation.
This module handles user input parameter validation
against a provided input model.
Note that the objects in this module do *not* mutate any
arguments. No type version happens here. It is up to another
layer to properly convert arguments to any required types.
Validation Errors
-----------------
� N)�datetime)�ParamValidationError)�is_json_value_header�parse_to_aware_datetimec C s, t � }|�| |�}|�� rt|�� d��dS )av Validates input parameters against a schema.
This is a convenience function that validates parameters against a schema.
You can also instantiate and use the ParamValidator class directly if you
want more control.
If there are any validation errors then a ParamValidationError
will be raised. If there are no validation errors than no exception
is raised and a value of None is returned.
:param params: The user provided input parameters.
:type shape: botocore.model.Shape
:param shape: The schema which the input parameters should
adhere to.
:raise: ParamValidationError
��reportN)�ParamValidator�validate�
has_errorsr �generate_report)�params�shape� validatorr � r �D/usr/local/CyberCP/lib/python3.10/site-packages/botocore/validate.py�validate_parameters s
�r c s � fdd�}|S )Nc s � �fdd�}�fdd�� |S )Nc s � |||�r�| ||||�S d S �Nr ��self�paramr
�errors�name��_type_check�funcr r �_on_passes_type_check4 s �zKtype_check.<locals>._create_type_check_guard.<locals>._on_passes_type_checkc s2 t | � �sdd� � D �}|j|d| |d� dS dS )Nc S � g | ]}t |��qS r ��str��.0�tr r r �
<listcomp>: � zUtype_check.<locals>._create_type_check_guard.<locals>._type_check.<locals>.<listcomp>�invalid type�r �valid_typesFT)�
isinstancer )r r r �valid_type_names�r&