# google.appengine.api.validation.AsValidator

<br />

|---|
| [View source on GitHub](https://github.com/GoogleCloudPlatform/appengine-python-standard/tree/main/src/google/appengine/api/validation.py#L114-L148) |

Wrap various types as instances of a validator.

    google.appengine.api.validation.AsValidator(
        validator
    )

Used to allow shorthand for common validator types. It
converts the following types to the following Validators:

- strings -\> Regex
- type -\> Type
- collection -\> Options
- Validator -\> Itself

<br />

<br />

<br />

| ## Args ||
|---|---|
| `validator` | Object to wrap in a validator. |

<br />

<br />

<br />

<br />

| ## Returns ||
|---|---|
| Validator instance that wraps the given value. ||

<br />

<br />

<br />

<br />

| ## Raises ||
|---|---|
| `AttributeDefinitionError` | If `validator` is not one of the above described types. |

<br />