"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:37.723Z","fingerprint":"Y1n0g7Y3xRpN7eF4IMb9l8mTxSA0lr2LQ4sTZXfbJv8="}
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 ``DestinationResourceProps``
     *
     * @param properties the TypeScript properties of a ``DestinationResourceProps``
     *
     * @returns the result of the validation.
     */
    function DestinationResourcePropsValidator(properties) {
        if (!cdk.canInspect(properties)) {
            return cdk.VALIDATION_SUCCESS;
        }
        const errors = new cdk.ValidationResults();
        errors.collect(cdk.propertyValidator('destinationName', cdk.requiredValidator)(properties.destinationName));
        errors.collect(cdk.propertyValidator('destinationName', cdk.validateString)(properties.destinationName));
        errors.collect(cdk.propertyValidator('destinationPolicy', cdk.requiredValidator)(properties.destinationPolicy));
        errors.collect(cdk.propertyValidator('destinationPolicy', cdk.validateString)(properties.destinationPolicy));
        errors.collect(cdk.propertyValidator('roleArn', cdk.requiredValidator)(properties.roleArn));
        errors.collect(cdk.propertyValidator('roleArn', cdk.validateString)(properties.roleArn));
        errors.collect(cdk.propertyValidator('targetArn', cdk.requiredValidator)(properties.targetArn));
        errors.collect(cdk.propertyValidator('targetArn', cdk.validateString)(properties.targetArn));
        return errors.wrap('supplied properties not correct for "DestinationResourceProps"');
    }
    /**
     * Renders the AWS CloudFormation properties of an ``AWS::Logs::Destination`` resource
     *
     * @param properties the TypeScript properties of a ``DestinationResourceProps``
     *
     * @returns the AWS CloudFormation properties of an ``AWS::Logs::Destination`` resource.
     */
    function destinationResourcePropsToCloudFormation(properties) {
        if (!cdk.canInspect(properties)) {
            return properties;
        }
        DestinationResourcePropsValidator(properties).assertSuccess();
        return {
            DestinationName: cdk.stringToCloudFormation(properties.destinationName),
            DestinationPolicy: cdk.stringToCloudFormation(properties.destinationPolicy),
            RoleArn: cdk.stringToCloudFormation(properties.roleArn),
            TargetArn: cdk.stringToCloudFormation(properties.targetArn),
        };
    }
    /**
     * @link http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-logs-destination.html
     */
    class DestinationResource extends cdk.Resource {
        /**
         * Creates a new ``AWS::Logs::Destination``.
         *
         * @param parent     the ``cdk.Construct`` this ``DestinationResource`` is a part of
         * @param name       the name of the resource in the ``cdk.Construct`` tree
         * @param properties the properties of this ``DestinationResource``
         */
        constructor(parent, name, properties) {
            super(parent, name, { type: DestinationResource.resourceTypeName, properties });
            cdk.requireProperty(properties, 'destinationName', this);
            cdk.requireProperty(properties, 'destinationPolicy', this);
            cdk.requireProperty(properties, 'roleArn', this);
            cdk.requireProperty(properties, 'targetArn', this);
            this.destinationArn = new DestinationArn(this.getAtt('Arn'));
        }
        renderProperties() {
            return destinationResourcePropsToCloudFormation(cdk.resolve(this.properties));
        }
    }
    /**
     * The CloudFormation resource type name for this resource class.
     */
    DestinationResource.resourceTypeName = "AWS::Logs::Destination";
    cloudformation.DestinationResource = DestinationResource;
})(cloudformation = exports.cloudformation || (exports.cloudformation = {}));
class DestinationArn extends cdk.Arn {
}
exports.DestinationArn = DestinationArn;
(function (cloudformation) {
    /**
     * Determine whether the given properties match those of a ``LogGroupResourceProps``
     *
     * @param properties the TypeScript properties of a ``LogGroupResourceProps``
     *
     * @returns the result of the validation.
     */
    function LogGroupResourcePropsValidator(properties) {
        if (!cdk.canInspect(properties)) {
            return cdk.VALIDATION_SUCCESS;
        }
        const errors = new cdk.ValidationResults();
        errors.collect(cdk.propertyValidator('logGroupName', cdk.validateString)(properties.logGroupName));
        errors.collect(cdk.propertyValidator('retentionInDays', cdk.validateNumber)(properties.retentionInDays));
        return errors.wrap('supplied properties not correct for "LogGroupResourceProps"');
    }
    /**
     * Renders the AWS CloudFormation properties of an ``AWS::Logs::LogGroup`` resource
     *
     * @param properties the TypeScript properties of a ``LogGroupResourceProps``
     *
     * @returns the AWS CloudFormation properties of an ``AWS::Logs::LogGroup`` resource.
     */
    function logGroupResourcePropsToCloudFormation(properties) {
        if (!cdk.canInspect(properties)) {
            return properties;
        }
        LogGroupResourcePropsValidator(properties).assertSuccess();
        return {
            LogGroupName: cdk.stringToCloudFormation(properties.logGroupName),
            RetentionInDays: cdk.numberToCloudFormation(properties.retentionInDays),
        };
    }
    /**
     * @link http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-logs-loggroup.html
     */
    class LogGroupResource extends cdk.Resource {
        /**
         * Creates a new ``AWS::Logs::LogGroup``.
         *
         * @param parent     the ``cdk.Construct`` this ``LogGroupResource`` is a part of
         * @param name       the name of the resource in the ``cdk.Construct`` tree
         * @param properties the properties of this ``LogGroupResource``
         */
        constructor(parent, name, properties) {
            super(parent, name, { type: LogGroupResource.resourceTypeName, properties });
            this.logGroupArn = new LogGroupArn(this.getAtt('Arn'));
        }
        renderProperties() {
            return logGroupResourcePropsToCloudFormation(cdk.resolve(this.properties));
        }
    }
    /**
     * The CloudFormation resource type name for this resource class.
     */
    LogGroupResource.resourceTypeName = "AWS::Logs::LogGroup";
    cloudformation.LogGroupResource = LogGroupResource;
})(cloudformation = exports.cloudformation || (exports.cloudformation = {}));
class LogGroupArn extends cdk.Arn {
}
exports.LogGroupArn = LogGroupArn;
(function (cloudformation) {
    /**
     * Determine whether the given properties match those of a ``LogStreamResourceProps``
     *
     * @param properties the TypeScript properties of a ``LogStreamResourceProps``
     *
     * @returns the result of the validation.
     */
    function LogStreamResourcePropsValidator(properties) {
        if (!cdk.canInspect(properties)) {
            return cdk.VALIDATION_SUCCESS;
        }
        const errors = new cdk.ValidationResults();
        errors.collect(cdk.propertyValidator('logGroupName', cdk.requiredValidator)(properties.logGroupName));
        errors.collect(cdk.propertyValidator('logGroupName', cdk.validateString)(properties.logGroupName));
        errors.collect(cdk.propertyValidator('logStreamName', cdk.validateString)(properties.logStreamName));
        return errors.wrap('supplied properties not correct for "LogStreamResourceProps"');
    }
    /**
     * Renders the AWS CloudFormation properties of an ``AWS::Logs::LogStream`` resource
     *
     * @param properties the TypeScript properties of a ``LogStreamResourceProps``
     *
     * @returns the AWS CloudFormation properties of an ``AWS::Logs::LogStream`` resource.
     */
    function logStreamResourcePropsToCloudFormation(properties) {
        if (!cdk.canInspect(properties)) {
            return properties;
        }
        LogStreamResourcePropsValidator(properties).assertSuccess();
        return {
            LogGroupName: cdk.stringToCloudFormation(properties.logGroupName),
            LogStreamName: cdk.stringToCloudFormation(properties.logStreamName),
        };
    }
    /**
     * @link http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-logs-logstream.html
     */
    class LogStreamResource extends cdk.Resource {
        /**
         * Creates a new ``AWS::Logs::LogStream``.
         *
         * @param parent     the ``cdk.Construct`` this ``LogStreamResource`` is a part of
         * @param name       the name of the resource in the ``cdk.Construct`` tree
         * @param properties the properties of this ``LogStreamResource``
         */
        constructor(parent, name, properties) {
            super(parent, name, { type: LogStreamResource.resourceTypeName, properties });
            cdk.requireProperty(properties, 'logGroupName', this);
        }
        renderProperties() {
            return logStreamResourcePropsToCloudFormation(cdk.resolve(this.properties));
        }
    }
    /**
     * The CloudFormation resource type name for this resource class.
     */
    LogStreamResource.resourceTypeName = "AWS::Logs::LogStream";
    cloudformation.LogStreamResource = LogStreamResource;
})(cloudformation = exports.cloudformation || (exports.cloudformation = {}));
(function (cloudformation) {
    /**
     * Determine whether the given properties match those of a ``MetricFilterResourceProps``
     *
     * @param properties the TypeScript properties of a ``MetricFilterResourceProps``
     *
     * @returns the result of the validation.
     */
    function MetricFilterResourcePropsValidator(properties) {
        if (!cdk.canInspect(properties)) {
            return cdk.VALIDATION_SUCCESS;
        }
        const errors = new cdk.ValidationResults();
        errors.collect(cdk.propertyValidator('filterPattern', cdk.requiredValidator)(properties.filterPattern));
        errors.collect(cdk.propertyValidator('filterPattern', cdk.validateString)(properties.filterPattern));
        errors.collect(cdk.propertyValidator('logGroupName', cdk.requiredValidator)(properties.logGroupName));
        errors.collect(cdk.propertyValidator('logGroupName', cdk.validateString)(properties.logGroupName));
        errors.collect(cdk.propertyValidator('metricTransformations', cdk.requiredValidator)(properties.metricTransformations));
        errors.collect(cdk.propertyValidator('metricTransformations', cdk.listValidator(MetricFilterResource_MetricTransformationPropertyValidator))(properties.metricTransformations));
        return errors.wrap('supplied properties not correct for "MetricFilterResourceProps"');
    }
    /**
     * Renders the AWS CloudFormation properties of an ``AWS::Logs::MetricFilter`` resource
     *
     * @param properties the TypeScript properties of a ``MetricFilterResourceProps``
     *
     * @returns the AWS CloudFormation properties of an ``AWS::Logs::MetricFilter`` resource.
     */
    function metricFilterResourcePropsToCloudFormation(properties) {
        if (!cdk.canInspect(properties)) {
            return properties;
        }
        MetricFilterResourcePropsValidator(properties).assertSuccess();
        return {
            FilterPattern: cdk.stringToCloudFormation(properties.filterPattern),
            LogGroupName: cdk.stringToCloudFormation(properties.logGroupName),
            MetricTransformations: cdk.listMapper(metricFilterResourceMetricTransformationPropertyToCloudFormation)(properties.metricTransformations),
        };
    }
    /**
     * @link http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-logs-metricfilter.html
     */
    class MetricFilterResource extends cdk.Resource {
        /**
         * Creates a new ``AWS::Logs::MetricFilter``.
         *
         * @param parent     the ``cdk.Construct`` this ``MetricFilterResource`` is a part of
         * @param name       the name of the resource in the ``cdk.Construct`` tree
         * @param properties the properties of this ``MetricFilterResource``
         */
        constructor(parent, name, properties) {
            super(parent, name, { type: MetricFilterResource.resourceTypeName, properties });
            cdk.requireProperty(properties, 'filterPattern', this);
            cdk.requireProperty(properties, 'logGroupName', this);
            cdk.requireProperty(properties, 'metricTransformations', this);
        }
        renderProperties() {
            return metricFilterResourcePropsToCloudFormation(cdk.resolve(this.properties));
        }
    }
    /**
     * The CloudFormation resource type name for this resource class.
     */
    MetricFilterResource.resourceTypeName = "AWS::Logs::MetricFilter";
    cloudformation.MetricFilterResource = MetricFilterResource;
    /**
     * Determine whether the given properties match those of a ``MetricTransformationProperty``
     *
     * @param properties the TypeScript properties of a ``MetricTransformationProperty``
     *
     * @returns the result of the validation.
     */
    function MetricFilterResource_MetricTransformationPropertyValidator(properties) {
        if (!cdk.canInspect(properties)) {
            return cdk.VALIDATION_SUCCESS;
        }
        const errors = new cdk.ValidationResults();
        errors.collect(cdk.propertyValidator('defaultValue', cdk.validateNumber)(properties.defaultValue));
        errors.collect(cdk.propertyValidator('metricName', cdk.requiredValidator)(properties.metricName));
        errors.collect(cdk.propertyValidator('metricName', cdk.validateString)(properties.metricName));
        errors.collect(cdk.propertyValidator('metricNamespace', cdk.requiredValidator)(properties.metricNamespace));
        errors.collect(cdk.propertyValidator('metricNamespace', cdk.validateString)(properties.metricNamespace));
        errors.collect(cdk.propertyValidator('metricValue', cdk.requiredValidator)(properties.metricValue));
        errors.collect(cdk.propertyValidator('metricValue', cdk.validateString)(properties.metricValue));
        return errors.wrap('supplied properties not correct for "MetricTransformationProperty"');
    }
    /**
     * Renders the AWS CloudFormation properties of an ``AWS::Logs::MetricFilter.MetricTransformation`` resource
     *
     * @param properties the TypeScript properties of a ``MetricTransformationProperty``
     *
     * @returns the AWS CloudFormation properties of an ``AWS::Logs::MetricFilter.MetricTransformation`` resource.
     */
    function metricFilterResourceMetricTransformationPropertyToCloudFormation(properties) {
        if (!cdk.canInspect(properties)) {
            return properties;
        }
        MetricFilterResource_MetricTransformationPropertyValidator(properties).assertSuccess();
        return {
            DefaultValue: cdk.numberToCloudFormation(properties.defaultValue),
            MetricName: cdk.stringToCloudFormation(properties.metricName),
            MetricNamespace: cdk.stringToCloudFormation(properties.metricNamespace),
            MetricValue: cdk.stringToCloudFormation(properties.metricValue),
        };
    }
})(cloudformation = exports.cloudformation || (exports.cloudformation = {}));
(function (cloudformation) {
    /**
     * Determine whether the given properties match those of a ``SubscriptionFilterResourceProps``
     *
     * @param properties the TypeScript properties of a ``SubscriptionFilterResourceProps``
     *
     * @returns the result of the validation.
     */
    function SubscriptionFilterResourcePropsValidator(properties) {
        if (!cdk.canInspect(properties)) {
            return cdk.VALIDATION_SUCCESS;
        }
        const errors = new cdk.ValidationResults();
        errors.collect(cdk.propertyValidator('destinationArn', cdk.requiredValidator)(properties.destinationArn));
        errors.collect(cdk.propertyValidator('destinationArn', cdk.validateString)(properties.destinationArn));
        errors.collect(cdk.propertyValidator('filterPattern', cdk.requiredValidator)(properties.filterPattern));
        errors.collect(cdk.propertyValidator('filterPattern', cdk.validateString)(properties.filterPattern));
        errors.collect(cdk.propertyValidator('logGroupName', cdk.requiredValidator)(properties.logGroupName));
        errors.collect(cdk.propertyValidator('logGroupName', cdk.validateString)(properties.logGroupName));
        errors.collect(cdk.propertyValidator('roleArn', cdk.validateString)(properties.roleArn));
        return errors.wrap('supplied properties not correct for "SubscriptionFilterResourceProps"');
    }
    /**
     * Renders the AWS CloudFormation properties of an ``AWS::Logs::SubscriptionFilter`` resource
     *
     * @param properties the TypeScript properties of a ``SubscriptionFilterResourceProps``
     *
     * @returns the AWS CloudFormation properties of an ``AWS::Logs::SubscriptionFilter`` resource.
     */
    function subscriptionFilterResourcePropsToCloudFormation(properties) {
        if (!cdk.canInspect(properties)) {
            return properties;
        }
        SubscriptionFilterResourcePropsValidator(properties).assertSuccess();
        return {
            DestinationArn: cdk.stringToCloudFormation(properties.destinationArn),
            FilterPattern: cdk.stringToCloudFormation(properties.filterPattern),
            LogGroupName: cdk.stringToCloudFormation(properties.logGroupName),
            RoleArn: cdk.stringToCloudFormation(properties.roleArn),
        };
    }
    /**
     * @link http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-logs-subscriptionfilter.html
     */
    class SubscriptionFilterResource extends cdk.Resource {
        /**
         * Creates a new ``AWS::Logs::SubscriptionFilter``.
         *
         * @param parent     the ``cdk.Construct`` this ``SubscriptionFilterResource`` is a part of
         * @param name       the name of the resource in the ``cdk.Construct`` tree
         * @param properties the properties of this ``SubscriptionFilterResource``
         */
        constructor(parent, name, properties) {
            super(parent, name, { type: SubscriptionFilterResource.resourceTypeName, properties });
            cdk.requireProperty(properties, 'destinationArn', this);
            cdk.requireProperty(properties, 'filterPattern', this);
            cdk.requireProperty(properties, 'logGroupName', this);
        }
        renderProperties() {
            return subscriptionFilterResourcePropsToCloudFormation(cdk.resolve(this.properties));
        }
    }
    /**
     * The CloudFormation resource type name for this resource class.
     */
    SubscriptionFilterResource.resourceTypeName = "AWS::Logs::SubscriptionFilter";
    cloudformation.SubscriptionFilterResource = SubscriptionFilterResource;
})(cloudformation = exports.cloudformation || (exports.cloudformation = {}));
//# sourceMappingURL=data:application/json;base64, 