// generated from terraform resource schema
import * as cdktf from 'cdktf';
export function apiGatewayMethodSettingsSettingsToTerraform(struct) {
    if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) {
        return struct;
    }
    if (cdktf.isComplexElement(struct)) {
        throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration");
    }
    return {
        cache_data_encrypted: cdktf.booleanToTerraform(struct.cacheDataEncrypted),
        cache_ttl_in_seconds: cdktf.numberToTerraform(struct.cacheTtlInSeconds),
        caching_enabled: cdktf.booleanToTerraform(struct.cachingEnabled),
        data_trace_enabled: cdktf.booleanToTerraform(struct.dataTraceEnabled),
        logging_level: cdktf.stringToTerraform(struct.loggingLevel),
        metrics_enabled: cdktf.booleanToTerraform(struct.metricsEnabled),
        require_authorization_for_cache_control: cdktf.booleanToTerraform(struct.requireAuthorizationForCacheControl),
        throttling_burst_limit: cdktf.numberToTerraform(struct.throttlingBurstLimit),
        throttling_rate_limit: cdktf.numberToTerraform(struct.throttlingRateLimit),
        unauthorized_cache_control_header_strategy: cdktf.stringToTerraform(struct.unauthorizedCacheControlHeaderStrategy),
    };
}
export class ApiGatewayMethodSettingsSettingsOutputReference extends cdktf.ComplexObject {
    isEmptyObject = false;
    /**
    * @param terraformResource The parent resource
    * @param terraformAttribute The attribute on the parent resource this class is referencing
    * @param isSingleItem True if this is a block, false if it's a list
    */
    constructor(terraformResource, terraformAttribute, isSingleItem) {
        super(terraformResource, terraformAttribute, isSingleItem);
    }
    get internalValue() {
        let hasAnyValues = this.isEmptyObject;
        const internalValueResult = {};
        if (this._cacheDataEncrypted !== undefined) {
            hasAnyValues = true;
            internalValueResult.cacheDataEncrypted = this._cacheDataEncrypted;
        }
        if (this._cacheTtlInSeconds !== undefined) {
            hasAnyValues = true;
            internalValueResult.cacheTtlInSeconds = this._cacheTtlInSeconds;
        }
        if (this._cachingEnabled !== undefined) {
            hasAnyValues = true;
            internalValueResult.cachingEnabled = this._cachingEnabled;
        }
        if (this._dataTraceEnabled !== undefined) {
            hasAnyValues = true;
            internalValueResult.dataTraceEnabled = this._dataTraceEnabled;
        }
        if (this._loggingLevel !== undefined) {
            hasAnyValues = true;
            internalValueResult.loggingLevel = this._loggingLevel;
        }
        if (this._metricsEnabled !== undefined) {
            hasAnyValues = true;
            internalValueResult.metricsEnabled = this._metricsEnabled;
        }
        if (this._requireAuthorizationForCacheControl !== undefined) {
            hasAnyValues = true;
            internalValueResult.requireAuthorizationForCacheControl = this._requireAuthorizationForCacheControl;
        }
        if (this._throttlingBurstLimit !== undefined) {
            hasAnyValues = true;
            internalValueResult.throttlingBurstLimit = this._throttlingBurstLimit;
        }
        if (this._throttlingRateLimit !== undefined) {
            hasAnyValues = true;
            internalValueResult.throttlingRateLimit = this._throttlingRateLimit;
        }
        if (this._unauthorizedCacheControlHeaderStrategy !== undefined) {
            hasAnyValues = true;
            internalValueResult.unauthorizedCacheControlHeaderStrategy = this._unauthorizedCacheControlHeaderStrategy;
        }
        return hasAnyValues ? internalValueResult : undefined;
    }
    set internalValue(value) {
        if (value === undefined) {
            this.isEmptyObject = false;
            this._cacheDataEncrypted = undefined;
            this._cacheTtlInSeconds = undefined;
            this._cachingEnabled = undefined;
            this._dataTraceEnabled = undefined;
            this._loggingLevel = undefined;
            this._metricsEnabled = undefined;
            this._requireAuthorizationForCacheControl = undefined;
            this._throttlingBurstLimit = undefined;
            this._throttlingRateLimit = undefined;
            this._unauthorizedCacheControlHeaderStrategy = undefined;
        }
        else {
            this.isEmptyObject = Object.keys(value).length === 0;
            this._cacheDataEncrypted = value.cacheDataEncrypted;
            this._cacheTtlInSeconds = value.cacheTtlInSeconds;
            this._cachingEnabled = value.cachingEnabled;
            this._dataTraceEnabled = value.dataTraceEnabled;
            this._loggingLevel = value.loggingLevel;
            this._metricsEnabled = value.metricsEnabled;
            this._requireAuthorizationForCacheControl = value.requireAuthorizationForCacheControl;
            this._throttlingBurstLimit = value.throttlingBurstLimit;
            this._throttlingRateLimit = value.throttlingRateLimit;
            this._unauthorizedCacheControlHeaderStrategy = value.unauthorizedCacheControlHeaderStrategy;
        }
    }
    // cache_data_encrypted - computed: true, optional: true, required: false
    _cacheDataEncrypted;
    get cacheDataEncrypted() {
        return this.getBooleanAttribute('cache_data_encrypted');
    }
    set cacheDataEncrypted(value) {
        this._cacheDataEncrypted = value;
    }
    resetCacheDataEncrypted() {
        this._cacheDataEncrypted = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get cacheDataEncryptedInput() {
        return this._cacheDataEncrypted;
    }
    // cache_ttl_in_seconds - computed: true, optional: true, required: false
    _cacheTtlInSeconds;
    get cacheTtlInSeconds() {
        return this.getNumberAttribute('cache_ttl_in_seconds');
    }
    set cacheTtlInSeconds(value) {
        this._cacheTtlInSeconds = value;
    }
    resetCacheTtlInSeconds() {
        this._cacheTtlInSeconds = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get cacheTtlInSecondsInput() {
        return this._cacheTtlInSeconds;
    }
    // caching_enabled - computed: true, optional: true, required: false
    _cachingEnabled;
    get cachingEnabled() {
        return this.getBooleanAttribute('caching_enabled');
    }
    set cachingEnabled(value) {
        this._cachingEnabled = value;
    }
    resetCachingEnabled() {
        this._cachingEnabled = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get cachingEnabledInput() {
        return this._cachingEnabled;
    }
    // data_trace_enabled - computed: true, optional: true, required: false
    _dataTraceEnabled;
    get dataTraceEnabled() {
        return this.getBooleanAttribute('data_trace_enabled');
    }
    set dataTraceEnabled(value) {
        this._dataTraceEnabled = value;
    }
    resetDataTraceEnabled() {
        this._dataTraceEnabled = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get dataTraceEnabledInput() {
        return this._dataTraceEnabled;
    }
    // logging_level - computed: true, optional: true, required: false
    _loggingLevel;
    get loggingLevel() {
        return this.getStringAttribute('logging_level');
    }
    set loggingLevel(value) {
        this._loggingLevel = value;
    }
    resetLoggingLevel() {
        this._loggingLevel = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get loggingLevelInput() {
        return this._loggingLevel;
    }
    // metrics_enabled - computed: true, optional: true, required: false
    _metricsEnabled;
    get metricsEnabled() {
        return this.getBooleanAttribute('metrics_enabled');
    }
    set metricsEnabled(value) {
        this._metricsEnabled = value;
    }
    resetMetricsEnabled() {
        this._metricsEnabled = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get metricsEnabledInput() {
        return this._metricsEnabled;
    }
    // require_authorization_for_cache_control - computed: true, optional: true, required: false
    _requireAuthorizationForCacheControl;
    get requireAuthorizationForCacheControl() {
        return this.getBooleanAttribute('require_authorization_for_cache_control');
    }
    set requireAuthorizationForCacheControl(value) {
        this._requireAuthorizationForCacheControl = value;
    }
    resetRequireAuthorizationForCacheControl() {
        this._requireAuthorizationForCacheControl = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get requireAuthorizationForCacheControlInput() {
        return this._requireAuthorizationForCacheControl;
    }
    // throttling_burst_limit - computed: false, optional: true, required: false
    _throttlingBurstLimit;
    get throttlingBurstLimit() {
        return this.getNumberAttribute('throttling_burst_limit');
    }
    set throttlingBurstLimit(value) {
        this._throttlingBurstLimit = value;
    }
    resetThrottlingBurstLimit() {
        this._throttlingBurstLimit = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get throttlingBurstLimitInput() {
        return this._throttlingBurstLimit;
    }
    // throttling_rate_limit - computed: false, optional: true, required: false
    _throttlingRateLimit;
    get throttlingRateLimit() {
        return this.getNumberAttribute('throttling_rate_limit');
    }
    set throttlingRateLimit(value) {
        this._throttlingRateLimit = value;
    }
    resetThrottlingRateLimit() {
        this._throttlingRateLimit = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get throttlingRateLimitInput() {
        return this._throttlingRateLimit;
    }
    // unauthorized_cache_control_header_strategy - computed: true, optional: true, required: false
    _unauthorizedCacheControlHeaderStrategy;
    get unauthorizedCacheControlHeaderStrategy() {
        return this.getStringAttribute('unauthorized_cache_control_header_strategy');
    }
    set unauthorizedCacheControlHeaderStrategy(value) {
        this._unauthorizedCacheControlHeaderStrategy = value;
    }
    resetUnauthorizedCacheControlHeaderStrategy() {
        this._unauthorizedCacheControlHeaderStrategy = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get unauthorizedCacheControlHeaderStrategyInput() {
        return this._unauthorizedCacheControlHeaderStrategy;
    }
}
/**
* Represents a {@link https://www.terraform.io/docs/providers/aws/r/api_gateway_method_settings aws_api_gateway_method_settings}
*/
export class ApiGatewayMethodSettings extends cdktf.TerraformResource {
    // =================
    // STATIC PROPERTIES
    // =================
    static tfResourceType = "aws_api_gateway_method_settings";
    // ===========
    // INITIALIZER
    // ===========
    /**
    * Create a new {@link https://www.terraform.io/docs/providers/aws/r/api_gateway_method_settings aws_api_gateway_method_settings} Resource
    *
    * @param scope The scope in which to define this construct
    * @param id The scoped construct ID. Must be unique amongst siblings in the same scope
    * @param options ApiGatewayMethodSettingsConfig
    */
    constructor(scope, id, config) {
        super(scope, id, {
            terraformResourceType: 'aws_api_gateway_method_settings',
            terraformGeneratorMetadata: {
                providerName: 'aws'
            },
            provider: config.provider,
            dependsOn: config.dependsOn,
            count: config.count,
            lifecycle: config.lifecycle
        });
        this._methodPath = config.methodPath;
        this._restApiId = config.restApiId;
        this._stageName = config.stageName;
        this._settings.internalValue = config.settings;
    }
    // ==========
    // ATTRIBUTES
    // ==========
    // id - computed: true, optional: true, required: false
    get id() {
        return this.getStringAttribute('id');
    }
    // method_path - computed: false, optional: false, required: true
    _methodPath;
    get methodPath() {
        return this.getStringAttribute('method_path');
    }
    set methodPath(value) {
        this._methodPath = value;
    }
    // Temporarily expose input value. Use with caution.
    get methodPathInput() {
        return this._methodPath;
    }
    // rest_api_id - computed: false, optional: false, required: true
    _restApiId;
    get restApiId() {
        return this.getStringAttribute('rest_api_id');
    }
    set restApiId(value) {
        this._restApiId = value;
    }
    // Temporarily expose input value. Use with caution.
    get restApiIdInput() {
        return this._restApiId;
    }
    // stage_name - computed: false, optional: false, required: true
    _stageName;
    get stageName() {
        return this.getStringAttribute('stage_name');
    }
    set stageName(value) {
        this._stageName = value;
    }
    // Temporarily expose input value. Use with caution.
    get stageNameInput() {
        return this._stageName;
    }
    // settings - computed: false, optional: false, required: true
    _settings = new ApiGatewayMethodSettingsSettingsOutputReference(this, "settings", true);
    get settings() {
        return this._settings;
    }
    putSettings(value) {
        this._settings.internalValue = value;
    }
    // Temporarily expose input value. Use with caution.
    get settingsInput() {
        return this._settings.internalValue;
    }
    // =========
    // SYNTHESIS
    // =========
    synthesizeAttributes() {
        return {
            method_path: cdktf.stringToTerraform(this._methodPath),
            rest_api_id: cdktf.stringToTerraform(this._restApiId),
            stage_name: cdktf.stringToTerraform(this._stageName),
            settings: apiGatewayMethodSettingsSettingsToTerraform(this._settings.internalValue),
        };
    }
}
//# sourceMappingURL=api-gateway-method-settings.js.map