"use strict";
// Copyright 2012-2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
// Generated from the AWS CloudFormation Resource Specification
// See: docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cfn-resource-specification.html
// @cfn2ts:meta@ {"generated":"2018-08-15T13:37:03.258Z","fingerprint":"/BGmR+ty5xUuWS3UGeFDINWDrJJakPCqWfRbL9XyLqE="}
Object.defineProperty(exports, "__esModule", { value: true });
// tslint:disable:max-line-length | This is generated code - line lengths are difficult to control
const cdk = require("@aws-cdk/cdk");
var cloudformation;
(function (cloudformation) {
    /**
     * Determine whether the given properties match those of a ``AccessKeyResourceProps``
     *
     * @param properties the TypeScript properties of a ``AccessKeyResourceProps``
     *
     * @returns the result of the validation.
     */
    function AccessKeyResourcePropsValidator(properties) {
        if (!cdk.canInspect(properties)) {
            return cdk.VALIDATION_SUCCESS;
        }
        const errors = new cdk.ValidationResults();
        errors.collect(cdk.propertyValidator('serial', cdk.validateNumber)(properties.serial));
        errors.collect(cdk.propertyValidator('status', cdk.validateString)(properties.status));
        errors.collect(cdk.propertyValidator('userName', cdk.requiredValidator)(properties.userName));
        errors.collect(cdk.propertyValidator('userName', cdk.validateString)(properties.userName));
        return errors.wrap('supplied properties not correct for "AccessKeyResourceProps"');
    }
    /**
     * Renders the AWS CloudFormation properties of an ``AWS::IAM::AccessKey`` resource
     *
     * @param properties the TypeScript properties of a ``AccessKeyResourceProps``
     *
     * @returns the AWS CloudFormation properties of an ``AWS::IAM::AccessKey`` resource.
     */
    function accessKeyResourcePropsToCloudFormation(properties) {
        if (!cdk.canInspect(properties)) {
            return properties;
        }
        AccessKeyResourcePropsValidator(properties).assertSuccess();
        return {
            UserName: cdk.stringToCloudFormation(properties.userName),
            Serial: cdk.numberToCloudFormation(properties.serial),
            Status: cdk.stringToCloudFormation(properties.status),
        };
    }
    /**
     * @link http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iam-accesskey.html
     */
    class AccessKeyResource extends cdk.Resource {
        /**
         * Creates a new ``AWS::IAM::AccessKey``.
         *
         * @param parent     the ``cdk.Construct`` this ``AccessKeyResource`` is a part of
         * @param name       the name of the resource in the ``cdk.Construct`` tree
         * @param properties the properties of this ``AccessKeyResource``
         */
        constructor(parent, name, properties) {
            super(parent, name, { type: AccessKeyResource.resourceTypeName, properties });
            cdk.requireProperty(properties, 'userName', this);
            this.accessKeySecretAccessKey = new AccessKeySecretAccessKey(this.getAtt('SecretAccessKey'));
        }
        renderProperties() {
            return accessKeyResourcePropsToCloudFormation(cdk.resolve(this.properties));
        }
    }
    /**
     * The CloudFormation resource type name for this resource class.
     */
    AccessKeyResource.resourceTypeName = "AWS::IAM::AccessKey";
    cloudformation.AccessKeyResource = AccessKeyResource;
})(cloudformation = exports.cloudformation || (exports.cloudformation = {}));
class AccessKeySecretAccessKey extends cdk.Token {
}
exports.AccessKeySecretAccessKey = AccessKeySecretAccessKey;
(function (cloudformation) {
    /**
     * Determine whether the given properties match those of a ``GroupResourceProps``
     *
     * @param properties the TypeScript properties of a ``GroupResourceProps``
     *
     * @returns the result of the validation.
     */
    function GroupResourcePropsValidator(properties) {
        if (!cdk.canInspect(properties)) {
            return cdk.VALIDATION_SUCCESS;
        }
        const errors = new cdk.ValidationResults();
        errors.collect(cdk.propertyValidator('groupName', cdk.validateString)(properties.groupName));
        errors.collect(cdk.propertyValidator('managedPolicyArns', cdk.listValidator(cdk.validateString))(properties.managedPolicyArns));
        errors.collect(cdk.propertyValidator('path', cdk.validateString)(properties.path));
        errors.collect(cdk.propertyValidator('policies', cdk.listValidator(GroupResource_PolicyPropertyValidator))(properties.policies));
        return errors.wrap('supplied properties not correct for "GroupResourceProps"');
    }
    /**
     * Renders the AWS CloudFormation properties of an ``AWS::IAM::Group`` resource
     *
     * @param properties the TypeScript properties of a ``GroupResourceProps``
     *
     * @returns the AWS CloudFormation properties of an ``AWS::IAM::Group`` resource.
     */
    function groupResourcePropsToCloudFormation(properties) {
        if (!cdk.canInspect(properties)) {
            return properties;
        }
        GroupResourcePropsValidator(properties).assertSuccess();
        return {
            GroupName: cdk.stringToCloudFormation(properties.groupName),
            ManagedPolicyArns: cdk.listMapper(cdk.stringToCloudFormation)(properties.managedPolicyArns),
            Path: cdk.stringToCloudFormation(properties.path),
            Policies: cdk.listMapper(groupResourcePolicyPropertyToCloudFormation)(properties.policies),
        };
    }
    /**
     * @link http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iam-group.html
     */
    class GroupResource extends cdk.Resource {
        /**
         * Creates a new ``AWS::IAM::Group``.
         *
         * @param parent     the ``cdk.Construct`` this ``GroupResource`` is a part of
         * @param name       the name of the resource in the ``cdk.Construct`` tree
         * @param properties the properties of this ``GroupResource``
         */
        constructor(parent, name, properties) {
            super(parent, name, { type: GroupResource.resourceTypeName, properties });
            this.groupArn = new GroupArn(this.getAtt('Arn'));
        }
        renderProperties() {
            return groupResourcePropsToCloudFormation(cdk.resolve(this.properties));
        }
    }
    /**
     * The CloudFormation resource type name for this resource class.
     */
    GroupResource.resourceTypeName = "AWS::IAM::Group";
    cloudformation.GroupResource = GroupResource;
    /**
     * Determine whether the given properties match those of a ``PolicyProperty``
     *
     * @param properties the TypeScript properties of a ``PolicyProperty``
     *
     * @returns the result of the validation.
     */
    function GroupResource_PolicyPropertyValidator(properties) {
        if (!cdk.canInspect(properties)) {
            return cdk.VALIDATION_SUCCESS;
        }
        const errors = new cdk.ValidationResults();
        errors.collect(cdk.propertyValidator('policyDocument', cdk.requiredValidator)(properties.policyDocument));
        errors.collect(cdk.propertyValidator('policyDocument', cdk.validateObject)(properties.policyDocument));
        errors.collect(cdk.propertyValidator('policyName', cdk.requiredValidator)(properties.policyName));
        errors.collect(cdk.propertyValidator('policyName', cdk.validateString)(properties.policyName));
        return errors.wrap('supplied properties not correct for "PolicyProperty"');
    }
    /**
     * Renders the AWS CloudFormation properties of an ``AWS::IAM::Group.Policy`` resource
     *
     * @param properties the TypeScript properties of a ``PolicyProperty``
     *
     * @returns the AWS CloudFormation properties of an ``AWS::IAM::Group.Policy`` resource.
     */
    function groupResourcePolicyPropertyToCloudFormation(properties) {
        if (!cdk.canInspect(properties)) {
            return properties;
        }
        GroupResource_PolicyPropertyValidator(properties).assertSuccess();
        return {
            PolicyDocument: cdk.objectToCloudFormation(properties.policyDocument),
            PolicyName: cdk.stringToCloudFormation(properties.policyName),
        };
    }
})(cloudformation = exports.cloudformation || (exports.cloudformation = {}));
class GroupArn extends cdk.Arn {
}
exports.GroupArn = GroupArn;
(function (cloudformation) {
    /**
     * Determine whether the given properties match those of a ``InstanceProfileResourceProps``
     *
     * @param properties the TypeScript properties of a ``InstanceProfileResourceProps``
     *
     * @returns the result of the validation.
     */
    function InstanceProfileResourcePropsValidator(properties) {
        if (!cdk.canInspect(properties)) {
            return cdk.VALIDATION_SUCCESS;
        }
        const errors = new cdk.ValidationResults();
        errors.collect(cdk.propertyValidator('instanceProfileName', cdk.validateString)(properties.instanceProfileName));
        errors.collect(cdk.propertyValidator('path', cdk.validateString)(properties.path));
        errors.collect(cdk.propertyValidator('roles', cdk.requiredValidator)(properties.roles));
        errors.collect(cdk.propertyValidator('roles', cdk.listValidator(cdk.validateString))(properties.roles));
        return errors.wrap('supplied properties not correct for "InstanceProfileResourceProps"');
    }
    /**
     * Renders the AWS CloudFormation properties of an ``AWS::IAM::InstanceProfile`` resource
     *
     * @param properties the TypeScript properties of a ``InstanceProfileResourceProps``
     *
     * @returns the AWS CloudFormation properties of an ``AWS::IAM::InstanceProfile`` resource.
     */
    function instanceProfileResourcePropsToCloudFormation(properties) {
        if (!cdk.canInspect(properties)) {
            return properties;
        }
        InstanceProfileResourcePropsValidator(properties).assertSuccess();
        return {
            Roles: cdk.listMapper(cdk.stringToCloudFormation)(properties.roles),
            InstanceProfileName: cdk.stringToCloudFormation(properties.instanceProfileName),
            Path: cdk.stringToCloudFormation(properties.path),
        };
    }
    /**
     * @link http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iam-instanceprofile.html
     */
    class InstanceProfileResource extends cdk.Resource {
        /**
         * Creates a new ``AWS::IAM::InstanceProfile``.
         *
         * @param parent     the ``cdk.Construct`` this ``InstanceProfileResource`` is a part of
         * @param name       the name of the resource in the ``cdk.Construct`` tree
         * @param properties the properties of this ``InstanceProfileResource``
         */
        constructor(parent, name, properties) {
            super(parent, name, { type: InstanceProfileResource.resourceTypeName, properties });
            cdk.requireProperty(properties, 'roles', this);
            this.instanceProfileArn = new InstanceProfileArn(this.getAtt('Arn'));
        }
        renderProperties() {
            return instanceProfileResourcePropsToCloudFormation(cdk.resolve(this.properties));
        }
    }
    /**
     * The CloudFormation resource type name for this resource class.
     */
    InstanceProfileResource.resourceTypeName = "AWS::IAM::InstanceProfile";
    cloudformation.InstanceProfileResource = InstanceProfileResource;
})(cloudformation = exports.cloudformation || (exports.cloudformation = {}));
class InstanceProfileArn extends cdk.Arn {
}
exports.InstanceProfileArn = InstanceProfileArn;
(function (cloudformation) {
    /**
     * Determine whether the given properties match those of a ``ManagedPolicyResourceProps``
     *
     * @param properties the TypeScript properties of a ``ManagedPolicyResourceProps``
     *
     * @returns the result of the validation.
     */
    function ManagedPolicyResourcePropsValidator(properties) {
        if (!cdk.canInspect(properties)) {
            return cdk.VALIDATION_SUCCESS;
        }
        const errors = new cdk.ValidationResults();
        errors.collect(cdk.propertyValidator('description', cdk.validateString)(properties.description));
        errors.collect(cdk.propertyValidator('groups', cdk.listValidator(cdk.validateString))(properties.groups));
        errors.collect(cdk.propertyValidator('managedPolicyName', cdk.validateString)(properties.managedPolicyName));
        errors.collect(cdk.propertyValidator('path', cdk.validateString)(properties.path));
        errors.collect(cdk.propertyValidator('policyDocument', cdk.requiredValidator)(properties.policyDocument));
        errors.collect(cdk.propertyValidator('policyDocument', cdk.validateObject)(properties.policyDocument));
        errors.collect(cdk.propertyValidator('roles', cdk.listValidator(cdk.validateString))(properties.roles));
        errors.collect(cdk.propertyValidator('users', cdk.listValidator(cdk.validateString))(properties.users));
        return errors.wrap('supplied properties not correct for "ManagedPolicyResourceProps"');
    }
    /**
     * Renders the AWS CloudFormation properties of an ``AWS::IAM::ManagedPolicy`` resource
     *
     * @param properties the TypeScript properties of a ``ManagedPolicyResourceProps``
     *
     * @returns the AWS CloudFormation properties of an ``AWS::IAM::ManagedPolicy`` resource.
     */
    function managedPolicyResourcePropsToCloudFormation(properties) {
        if (!cdk.canInspect(properties)) {
            return properties;
        }
        ManagedPolicyResourcePropsValidator(properties).assertSuccess();
        return {
            PolicyDocument: cdk.objectToCloudFormation(properties.policyDocument),
            Description: cdk.stringToCloudFormation(properties.description),
            Groups: cdk.listMapper(cdk.stringToCloudFormation)(properties.groups),
            ManagedPolicyName: cdk.stringToCloudFormation(properties.managedPolicyName),
            Path: cdk.stringToCloudFormation(properties.path),
            Roles: cdk.listMapper(cdk.stringToCloudFormation)(properties.roles),
            Users: cdk.listMapper(cdk.stringToCloudFormation)(properties.users),
        };
    }
    /**
     * @link http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iam-managedpolicy.html
     */
    class ManagedPolicyResource extends cdk.Resource {
        /**
         * Creates a new ``AWS::IAM::ManagedPolicy``.
         *
         * @param parent     the ``cdk.Construct`` this ``ManagedPolicyResource`` is a part of
         * @param name       the name of the resource in the ``cdk.Construct`` tree
         * @param properties the properties of this ``ManagedPolicyResource``
         */
        constructor(parent, name, properties) {
            super(parent, name, { type: ManagedPolicyResource.resourceTypeName, properties });
            cdk.requireProperty(properties, 'policyDocument', this);
        }
        renderProperties() {
            return managedPolicyResourcePropsToCloudFormation(cdk.resolve(this.properties));
        }
    }
    /**
     * The CloudFormation resource type name for this resource class.
     */
    ManagedPolicyResource.resourceTypeName = "AWS::IAM::ManagedPolicy";
    cloudformation.ManagedPolicyResource = ManagedPolicyResource;
})(cloudformation = exports.cloudformation || (exports.cloudformation = {}));
(function (cloudformation) {
    /**
     * Determine whether the given properties match those of a ``PolicyResourceProps``
     *
     * @param properties the TypeScript properties of a ``PolicyResourceProps``
     *
     * @returns the result of the validation.
     */
    function PolicyResourcePropsValidator(properties) {
        if (!cdk.canInspect(properties)) {
            return cdk.VALIDATION_SUCCESS;
        }
        const errors = new cdk.ValidationResults();
        errors.collect(cdk.propertyValidator('groups', cdk.listValidator(cdk.validateString))(properties.groups));
        errors.collect(cdk.propertyValidator('policyDocument', cdk.requiredValidator)(properties.policyDocument));
        errors.collect(cdk.propertyValidator('policyDocument', cdk.validateObject)(properties.policyDocument));
        errors.collect(cdk.propertyValidator('policyName', cdk.requiredValidator)(properties.policyName));
        errors.collect(cdk.propertyValidator('policyName', cdk.validateString)(properties.policyName));
        errors.collect(cdk.propertyValidator('roles', cdk.listValidator(cdk.validateString))(properties.roles));
        errors.collect(cdk.propertyValidator('users', cdk.listValidator(cdk.validateString))(properties.users));
        return errors.wrap('supplied properties not correct for "PolicyResourceProps"');
    }
    /**
     * Renders the AWS CloudFormation properties of an ``AWS::IAM::Policy`` resource
     *
     * @param properties the TypeScript properties of a ``PolicyResourceProps``
     *
     * @returns the AWS CloudFormation properties of an ``AWS::IAM::Policy`` resource.
     */
    function policyResourcePropsToCloudFormation(properties) {
        if (!cdk.canInspect(properties)) {
            return properties;
        }
        PolicyResourcePropsValidator(properties).assertSuccess();
        return {
            PolicyDocument: cdk.objectToCloudFormation(properties.policyDocument),
            PolicyName: cdk.stringToCloudFormation(properties.policyName),
            Groups: cdk.listMapper(cdk.stringToCloudFormation)(properties.groups),
            Roles: cdk.listMapper(cdk.stringToCloudFormation)(properties.roles),
            Users: cdk.listMapper(cdk.stringToCloudFormation)(properties.users),
        };
    }
    /**
     * @link http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iam-policy.html
     */
    class PolicyResource extends cdk.Resource {
        /**
         * Creates a new ``AWS::IAM::Policy``.
         *
         * @param parent     the ``cdk.Construct`` this ``PolicyResource`` is a part of
         * @param name       the name of the resource in the ``cdk.Construct`` tree
         * @param properties the properties of this ``PolicyResource``
         */
        constructor(parent, name, properties) {
            super(parent, name, { type: PolicyResource.resourceTypeName, properties });
            cdk.requireProperty(properties, 'policyDocument', this);
            cdk.requireProperty(properties, 'policyName', this);
        }
        renderProperties() {
            return policyResourcePropsToCloudFormation(cdk.resolve(this.properties));
        }
    }
    /**
     * The CloudFormation resource type name for this resource class.
     */
    PolicyResource.resourceTypeName = "AWS::IAM::Policy";
    cloudformation.PolicyResource = PolicyResource;
})(cloudformation = exports.cloudformation || (exports.cloudformation = {}));
(function (cloudformation) {
    /**
     * Determine whether the given properties match those of a ``RoleResourceProps``
     *
     * @param properties the TypeScript properties of a ``RoleResourceProps``
     *
     * @returns the result of the validation.
     */
    function RoleResourcePropsValidator(properties) {
        if (!cdk.canInspect(properties)) {
            return cdk.VALIDATION_SUCCESS;
        }
        const errors = new cdk.ValidationResults();
        errors.collect(cdk.propertyValidator('assumeRolePolicyDocument', cdk.requiredValidator)(properties.assumeRolePolicyDocument));
        errors.collect(cdk.propertyValidator('assumeRolePolicyDocument', cdk.validateObject)(properties.assumeRolePolicyDocument));
        errors.collect(cdk.propertyValidator('managedPolicyArns', cdk.listValidator(cdk.validateString))(properties.managedPolicyArns));
        errors.collect(cdk.propertyValidator('maxSessionDuration', cdk.validateNumber)(properties.maxSessionDuration));
        errors.collect(cdk.propertyValidator('path', cdk.validateString)(properties.path));
        errors.collect(cdk.propertyValidator('policies', cdk.listValidator(RoleResource_PolicyPropertyValidator))(properties.policies));
        errors.collect(cdk.propertyValidator('roleName', cdk.validateString)(properties.roleName));
        return errors.wrap('supplied properties not correct for "RoleResourceProps"');
    }
    /**
     * Renders the AWS CloudFormation properties of an ``AWS::IAM::Role`` resource
     *
     * @param properties the TypeScript properties of a ``RoleResourceProps``
     *
     * @returns the AWS CloudFormation properties of an ``AWS::IAM::Role`` resource.
     */
    function roleResourcePropsToCloudFormation(properties) {
        if (!cdk.canInspect(properties)) {
            return properties;
        }
        RoleResourcePropsValidator(properties).assertSuccess();
        return {
            AssumeRolePolicyDocument: cdk.objectToCloudFormation(properties.assumeRolePolicyDocument),
            ManagedPolicyArns: cdk.listMapper(cdk.stringToCloudFormation)(properties.managedPolicyArns),
            MaxSessionDuration: cdk.numberToCloudFormation(properties.maxSessionDuration),
            Path: cdk.stringToCloudFormation(properties.path),
            Policies: cdk.listMapper(roleResourcePolicyPropertyToCloudFormation)(properties.policies),
            RoleName: cdk.stringToCloudFormation(properties.roleName),
        };
    }
    /**
     * @link http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iam-role.html
     */
    class RoleResource extends cdk.Resource {
        /**
         * Creates a new ``AWS::IAM::Role``.
         *
         * @param parent     the ``cdk.Construct`` this ``RoleResource`` is a part of
         * @param name       the name of the resource in the ``cdk.Construct`` tree
         * @param properties the properties of this ``RoleResource``
         */
        constructor(parent, name, properties) {
            super(parent, name, { type: RoleResource.resourceTypeName, properties });
            cdk.requireProperty(properties, 'assumeRolePolicyDocument', this);
            this.roleArn = new RoleArn(this.getAtt('Arn'));
            this.roleId = new RoleId(this.getAtt('RoleId'));
        }
        renderProperties() {
            return roleResourcePropsToCloudFormation(cdk.resolve(this.properties));
        }
    }
    /**
     * The CloudFormation resource type name for this resource class.
     */
    RoleResource.resourceTypeName = "AWS::IAM::Role";
    cloudformation.RoleResource = RoleResource;
    /**
     * Determine whether the given properties match those of a ``PolicyProperty``
     *
     * @param properties the TypeScript properties of a ``PolicyProperty``
     *
     * @returns the result of the validation.
     */
    function RoleResource_PolicyPropertyValidator(properties) {
        if (!cdk.canInspect(properties)) {
            return cdk.VALIDATION_SUCCESS;
        }
        const errors = new cdk.ValidationResults();
        errors.collect(cdk.propertyValidator('policyDocument', cdk.requiredValidator)(properties.policyDocument));
        errors.collect(cdk.propertyValidator('policyDocument', cdk.validateObject)(properties.policyDocument));
        errors.collect(cdk.propertyValidator('policyName', cdk.requiredValidator)(properties.policyName));
        errors.collect(cdk.propertyValidator('policyName', cdk.validateString)(properties.policyName));
        return errors.wrap('supplied properties not correct for "PolicyProperty"');
    }
    /**
     * Renders the AWS CloudFormation properties of an ``AWS::IAM::Role.Policy`` resource
     *
     * @param properties the TypeScript properties of a ``PolicyProperty``
     *
     * @returns the AWS CloudFormation properties of an ``AWS::IAM::Role.Policy`` resource.
     */
    function roleResourcePolicyPropertyToCloudFormation(properties) {
        if (!cdk.canInspect(properties)) {
            return properties;
        }
        RoleResource_PolicyPropertyValidator(properties).assertSuccess();
        return {
            PolicyDocument: cdk.objectToCloudFormation(properties.policyDocument),
            PolicyName: cdk.stringToCloudFormation(properties.policyName),
        };
    }
})(cloudformation = exports.cloudformation || (exports.cloudformation = {}));
class RoleArn extends cdk.Arn {
}
exports.RoleArn = RoleArn;
class RoleId extends cdk.Token {
}
exports.RoleId = RoleId;
(function (cloudformation) {
    /**
     * Determine whether the given properties match those of a ``UserResourceProps``
     *
     * @param properties the TypeScript properties of a ``UserResourceProps``
     *
     * @returns the result of the validation.
     */
    function UserResourcePropsValidator(properties) {
        if (!cdk.canInspect(properties)) {
            return cdk.VALIDATION_SUCCESS;
        }
        const errors = new cdk.ValidationResults();
        errors.collect(cdk.propertyValidator('groups', cdk.listValidator(cdk.validateString))(properties.groups));
        errors.collect(cdk.propertyValidator('loginProfile', UserResource_LoginProfilePropertyValidator)(properties.loginProfile));
        errors.collect(cdk.propertyValidator('managedPolicyArns', cdk.listValidator(cdk.validateString))(properties.managedPolicyArns));
        errors.collect(cdk.propertyValidator('path', cdk.validateString)(properties.path));
        errors.collect(cdk.propertyValidator('policies', cdk.listValidator(UserResource_PolicyPropertyValidator))(properties.policies));
        errors.collect(cdk.propertyValidator('userName', cdk.validateString)(properties.userName));
        return errors.wrap('supplied properties not correct for "UserResourceProps"');
    }
    /**
     * Renders the AWS CloudFormation properties of an ``AWS::IAM::User`` resource
     *
     * @param properties the TypeScript properties of a ``UserResourceProps``
     *
     * @returns the AWS CloudFormation properties of an ``AWS::IAM::User`` resource.
     */
    function userResourcePropsToCloudFormation(properties) {
        if (!cdk.canInspect(properties)) {
            return properties;
        }
        UserResourcePropsValidator(properties).assertSuccess();
        return {
            Groups: cdk.listMapper(cdk.stringToCloudFormation)(properties.groups),
            LoginProfile: userResourceLoginProfilePropertyToCloudFormation(properties.loginProfile),
            ManagedPolicyArns: cdk.listMapper(cdk.stringToCloudFormation)(properties.managedPolicyArns),
            Path: cdk.stringToCloudFormation(properties.path),
            Policies: cdk.listMapper(userResourcePolicyPropertyToCloudFormation)(properties.policies),
            UserName: cdk.stringToCloudFormation(properties.userName),
        };
    }
    /**
     * @link http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iam-user.html
     */
    class UserResource extends cdk.Resource {
        /**
         * Creates a new ``AWS::IAM::User``.
         *
         * @param parent     the ``cdk.Construct`` this ``UserResource`` is a part of
         * @param name       the name of the resource in the ``cdk.Construct`` tree
         * @param properties the properties of this ``UserResource``
         */
        constructor(parent, name, properties) {
            super(parent, name, { type: UserResource.resourceTypeName, properties });
            this.userArn = new UserArn(this.getAtt('Arn'));
        }
        renderProperties() {
            return userResourcePropsToCloudFormation(cdk.resolve(this.properties));
        }
    }
    /**
     * The CloudFormation resource type name for this resource class.
     */
    UserResource.resourceTypeName = "AWS::IAM::User";
    cloudformation.UserResource = UserResource;
    /**
     * Determine whether the given properties match those of a ``LoginProfileProperty``
     *
     * @param properties the TypeScript properties of a ``LoginProfileProperty``
     *
     * @returns the result of the validation.
     */
    function UserResource_LoginProfilePropertyValidator(properties) {
        if (!cdk.canInspect(properties)) {
            return cdk.VALIDATION_SUCCESS;
        }
        const errors = new cdk.ValidationResults();
        errors.collect(cdk.propertyValidator('password', cdk.requiredValidator)(properties.password));
        errors.collect(cdk.propertyValidator('password', cdk.validateString)(properties.password));
        errors.collect(cdk.propertyValidator('passwordResetRequired', cdk.validateBoolean)(properties.passwordResetRequired));
        return errors.wrap('supplied properties not correct for "LoginProfileProperty"');
    }
    /**
     * Renders the AWS CloudFormation properties of an ``AWS::IAM::User.LoginProfile`` resource
     *
     * @param properties the TypeScript properties of a ``LoginProfileProperty``
     *
     * @returns the AWS CloudFormation properties of an ``AWS::IAM::User.LoginProfile`` resource.
     */
    function userResourceLoginProfilePropertyToCloudFormation(properties) {
        if (!cdk.canInspect(properties)) {
            return properties;
        }
        UserResource_LoginProfilePropertyValidator(properties).assertSuccess();
        return {
            Password: cdk.stringToCloudFormation(properties.password),
            PasswordResetRequired: cdk.booleanToCloudFormation(properties.passwordResetRequired),
        };
    }
    /**
     * Determine whether the given properties match those of a ``PolicyProperty``
     *
     * @param properties the TypeScript properties of a ``PolicyProperty``
     *
     * @returns the result of the validation.
     */
    function UserResource_PolicyPropertyValidator(properties) {
        if (!cdk.canInspect(properties)) {
            return cdk.VALIDATION_SUCCESS;
        }
        const errors = new cdk.ValidationResults();
        errors.collect(cdk.propertyValidator('policyDocument', cdk.requiredValidator)(properties.policyDocument));
        errors.collect(cdk.propertyValidator('policyDocument', cdk.validateObject)(properties.policyDocument));
        errors.collect(cdk.propertyValidator('policyName', cdk.requiredValidator)(properties.policyName));
        errors.collect(cdk.propertyValidator('policyName', cdk.validateString)(properties.policyName));
        return errors.wrap('supplied properties not correct for "PolicyProperty"');
    }
    /**
     * Renders the AWS CloudFormation properties of an ``AWS::IAM::User.Policy`` resource
     *
     * @param properties the TypeScript properties of a ``PolicyProperty``
     *
     * @returns the AWS CloudFormation properties of an ``AWS::IAM::User.Policy`` resource.
     */
    function userResourcePolicyPropertyToCloudFormation(properties) {
        if (!cdk.canInspect(properties)) {
            return properties;
        }
        UserResource_PolicyPropertyValidator(properties).assertSuccess();
        return {
            PolicyDocument: cdk.objectToCloudFormation(properties.policyDocument),
            PolicyName: cdk.stringToCloudFormation(properties.policyName),
        };
    }
})(cloudformation = exports.cloudformation || (exports.cloudformation = {}));
class UserArn extends cdk.Arn {
}
exports.UserArn = UserArn;
(function (cloudformation) {
    /**
     * Determine whether the given properties match those of a ``UserToGroupAdditionResourceProps``
     *
     * @param properties the TypeScript properties of a ``UserToGroupAdditionResourceProps``
     *
     * @returns the result of the validation.
     */
    function UserToGroupAdditionResourcePropsValidator(properties) {
        if (!cdk.canInspect(properties)) {
            return cdk.VALIDATION_SUCCESS;
        }
        const errors = new cdk.ValidationResults();
        errors.collect(cdk.propertyValidator('groupName', cdk.requiredValidator)(properties.groupName));
        errors.collect(cdk.propertyValidator('groupName', cdk.validateString)(properties.groupName));
        errors.collect(cdk.propertyValidator('users', cdk.requiredValidator)(properties.users));
        errors.collect(cdk.propertyValidator('users', cdk.listValidator(cdk.validateString))(properties.users));
        return errors.wrap('supplied properties not correct for "UserToGroupAdditionResourceProps"');
    }
    /**
     * Renders the AWS CloudFormation properties of an ``AWS::IAM::UserToGroupAddition`` resource
     *
     * @param properties the TypeScript properties of a ``UserToGroupAdditionResourceProps``
     *
     * @returns the AWS CloudFormation properties of an ``AWS::IAM::UserToGroupAddition`` resource.
     */
    function userToGroupAdditionResourcePropsToCloudFormation(properties) {
        if (!cdk.canInspect(properties)) {
            return properties;
        }
        UserToGroupAdditionResourcePropsValidator(properties).assertSuccess();
        return {
            GroupName: cdk.stringToCloudFormation(properties.groupName),
            Users: cdk.listMapper(cdk.stringToCloudFormation)(properties.users),
        };
    }
    /**
     * @link http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iam-addusertogroup.html
     */
    class UserToGroupAdditionResource extends cdk.Resource {
        /**
         * Creates a new ``AWS::IAM::UserToGroupAddition``.
         *
         * @param parent     the ``cdk.Construct`` this ``UserToGroupAdditionResource`` is a part of
         * @param name       the name of the resource in the ``cdk.Construct`` tree
         * @param properties the properties of this ``UserToGroupAdditionResource``
         */
        constructor(parent, name, properties) {
            super(parent, name, { type: UserToGroupAdditionResource.resourceTypeName, properties });
            cdk.requireProperty(properties, 'groupName', this);
            cdk.requireProperty(properties, 'users', this);
        }
        renderProperties() {
            return userToGroupAdditionResourcePropsToCloudFormation(cdk.resolve(this.properties));
        }
    }
    /**
     * The CloudFormation resource type name for this resource class.
     */
    UserToGroupAdditionResource.resourceTypeName = "AWS::IAM::UserToGroupAddition";
    cloudformation.UserToGroupAdditionResource = UserToGroupAdditionResource;
})(cloudformation = exports.cloudformation || (exports.cloudformation = {}));
//# sourceMappingURL=data:application/json;base64, 