// generated from terraform resource schema import { Construct } from 'constructs'; import * as cdktf from 'cdktf'; /** * AWS Connect */ export interface ConnectHoursOfOperationConfig extends cdktf.TerraformMetaArguments { /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/connect_hours_of_operation.html#description ConnectHoursOfOperation#description} */ readonly description?: string; /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/connect_hours_of_operation.html#instance_id ConnectHoursOfOperation#instance_id} */ readonly instanceId: string; /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/connect_hours_of_operation.html#name ConnectHoursOfOperation#name} */ readonly name: string; /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/connect_hours_of_operation.html#tags ConnectHoursOfOperation#tags} */ readonly tags?: { [key: string]: string } | cdktf.IResolvable; /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/connect_hours_of_operation.html#tags_all ConnectHoursOfOperation#tags_all} */ readonly tagsAll?: { [key: string]: string } | cdktf.IResolvable; /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/connect_hours_of_operation.html#time_zone ConnectHoursOfOperation#time_zone} */ readonly timeZone: string; /** * config block * * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/connect_hours_of_operation.html#config ConnectHoursOfOperation#config} */ readonly config: ConnectHoursOfOperationConfigA[]; /** * timeouts block * * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/connect_hours_of_operation.html#timeouts ConnectHoursOfOperation#timeouts} */ readonly timeouts?: ConnectHoursOfOperationTimeouts; } export interface ConnectHoursOfOperationConfigEndTime { /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/connect_hours_of_operation.html#hours ConnectHoursOfOperation#hours} */ readonly hours: number; /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/connect_hours_of_operation.html#minutes ConnectHoursOfOperation#minutes} */ readonly minutes: number; } export function connectHoursOfOperationConfigEndTimeToTerraform(struct?: ConnectHoursOfOperationConfigEndTimeOutputReference | ConnectHoursOfOperationConfigEndTime): any { if (!cdktf.canInspect(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 { hours: cdktf.numberToTerraform(struct!.hours), minutes: cdktf.numberToTerraform(struct!.minutes), } } export class ConnectHoursOfOperationConfigEndTimeOutputReference extends cdktf.ComplexObject { private 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 */ public constructor(terraformResource: cdktf.ITerraformResource, terraformAttribute: string, isSingleItem: boolean) { super(terraformResource, terraformAttribute, isSingleItem); } public get internalValue(): ConnectHoursOfOperationConfigEndTime | undefined { let hasAnyValues = this.isEmptyObject; const internalValueResult: any = {}; if (this._hours !== undefined) { hasAnyValues = true; internalValueResult.hours = this._hours; } if (this._minutes !== undefined) { hasAnyValues = true; internalValueResult.minutes = this._minutes; } return hasAnyValues ? internalValueResult : undefined; } public set internalValue(value: ConnectHoursOfOperationConfigEndTime | undefined) { if (value === undefined) { this.isEmptyObject = false; this._hours = undefined; this._minutes = undefined; } else { this.isEmptyObject = Object.keys(value).length === 0; this._hours = value.hours; this._minutes = value.minutes; } } // hours - computed: false, optional: false, required: true private _hours?: number; public get hours() { return this.getNumberAttribute('hours'); } public set hours(value: number) { this._hours = value; } // Temporarily expose input value. Use with caution. public get hoursInput() { return this._hours; } // minutes - computed: false, optional: false, required: true private _minutes?: number; public get minutes() { return this.getNumberAttribute('minutes'); } public set minutes(value: number) { this._minutes = value; } // Temporarily expose input value. Use with caution. public get minutesInput() { return this._minutes; } } export interface ConnectHoursOfOperationConfigStartTime { /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/connect_hours_of_operation.html#hours ConnectHoursOfOperation#hours} */ readonly hours: number; /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/connect_hours_of_operation.html#minutes ConnectHoursOfOperation#minutes} */ readonly minutes: number; } export function connectHoursOfOperationConfigStartTimeToTerraform(struct?: ConnectHoursOfOperationConfigStartTimeOutputReference | ConnectHoursOfOperationConfigStartTime): any { if (!cdktf.canInspect(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 { hours: cdktf.numberToTerraform(struct!.hours), minutes: cdktf.numberToTerraform(struct!.minutes), } } export class ConnectHoursOfOperationConfigStartTimeOutputReference extends cdktf.ComplexObject { private 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 */ public constructor(terraformResource: cdktf.ITerraformResource, terraformAttribute: string, isSingleItem: boolean) { super(terraformResource, terraformAttribute, isSingleItem); } public get internalValue(): ConnectHoursOfOperationConfigStartTime | undefined { let hasAnyValues = this.isEmptyObject; const internalValueResult: any = {}; if (this._hours !== undefined) { hasAnyValues = true; internalValueResult.hours = this._hours; } if (this._minutes !== undefined) { hasAnyValues = true; internalValueResult.minutes = this._minutes; } return hasAnyValues ? internalValueResult : undefined; } public set internalValue(value: ConnectHoursOfOperationConfigStartTime | undefined) { if (value === undefined) { this.isEmptyObject = false; this._hours = undefined; this._minutes = undefined; } else { this.isEmptyObject = Object.keys(value).length === 0; this._hours = value.hours; this._minutes = value.minutes; } } // hours - computed: false, optional: false, required: true private _hours?: number; public get hours() { return this.getNumberAttribute('hours'); } public set hours(value: number) { this._hours = value; } // Temporarily expose input value. Use with caution. public get hoursInput() { return this._hours; } // minutes - computed: false, optional: false, required: true private _minutes?: number; public get minutes() { return this.getNumberAttribute('minutes'); } public set minutes(value: number) { this._minutes = value; } // Temporarily expose input value. Use with caution. public get minutesInput() { return this._minutes; } } export interface ConnectHoursOfOperationConfigA { /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/connect_hours_of_operation.html#day ConnectHoursOfOperation#day} */ readonly day: string; /** * end_time block * * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/connect_hours_of_operation.html#end_time ConnectHoursOfOperation#end_time} */ readonly endTime: ConnectHoursOfOperationConfigEndTime; /** * start_time block * * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/connect_hours_of_operation.html#start_time ConnectHoursOfOperation#start_time} */ readonly startTime: ConnectHoursOfOperationConfigStartTime; } export function connectHoursOfOperationConfigAToTerraform(struct?: ConnectHoursOfOperationConfigA): any { if (!cdktf.canInspect(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 { day: cdktf.stringToTerraform(struct!.day), end_time: connectHoursOfOperationConfigEndTimeToTerraform(struct!.endTime), start_time: connectHoursOfOperationConfigStartTimeToTerraform(struct!.startTime), } } export interface ConnectHoursOfOperationTimeouts { /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/connect_hours_of_operation.html#create ConnectHoursOfOperation#create} */ readonly create?: string; /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/connect_hours_of_operation.html#delete ConnectHoursOfOperation#delete} */ readonly delete?: string; } export function connectHoursOfOperationTimeoutsToTerraform(struct?: ConnectHoursOfOperationTimeoutsOutputReference | ConnectHoursOfOperationTimeouts): any { if (!cdktf.canInspect(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 { create: cdktf.stringToTerraform(struct!.create), delete: cdktf.stringToTerraform(struct!.delete), } } export class ConnectHoursOfOperationTimeoutsOutputReference extends cdktf.ComplexObject { private 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 */ public constructor(terraformResource: cdktf.ITerraformResource, terraformAttribute: string, isSingleItem: boolean) { super(terraformResource, terraformAttribute, isSingleItem); } public get internalValue(): ConnectHoursOfOperationTimeouts | undefined { let hasAnyValues = this.isEmptyObject; const internalValueResult: any = {}; if (this._create !== undefined) { hasAnyValues = true; internalValueResult.create = this._create; } if (this._delete !== undefined) { hasAnyValues = true; internalValueResult.delete = this._delete; } return hasAnyValues ? internalValueResult : undefined; } public set internalValue(value: ConnectHoursOfOperationTimeouts | undefined) { if (value === undefined) { this.isEmptyObject = false; this._create = undefined; this._delete = undefined; } else { this.isEmptyObject = Object.keys(value).length === 0; this._create = value.create; this._delete = value.delete; } } // create - computed: false, optional: true, required: false private _create?: string; public get create() { return this.getStringAttribute('create'); } public set create(value: string) { this._create = value; } public resetCreate() { this._create = undefined; } // Temporarily expose input value. Use with caution. public get createInput() { return this._create; } // delete - computed: false, optional: true, required: false private _delete?: string; public get delete() { return this.getStringAttribute('delete'); } public set delete(value: string) { this._delete = value; } public resetDelete() { this._delete = undefined; } // Temporarily expose input value. Use with caution. public get deleteInput() { return this._delete; } } /** * Represents a {@link https://www.terraform.io/docs/providers/aws/r/connect_hours_of_operation.html aws_connect_hours_of_operation} */ export class ConnectHoursOfOperation extends cdktf.TerraformResource { // ================= // STATIC PROPERTIES // ================= public static readonly tfResourceType: string = "aws_connect_hours_of_operation"; // =========== // INITIALIZER // =========== /** * Create a new {@link https://www.terraform.io/docs/providers/aws/r/connect_hours_of_operation.html aws_connect_hours_of_operation} 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 ConnectHoursOfOperationConfig */ public constructor(scope: Construct, id: string, config: ConnectHoursOfOperationConfig) { super(scope, id, { terraformResourceType: 'aws_connect_hours_of_operation', terraformGeneratorMetadata: { providerName: 'aws' }, provider: config.provider, dependsOn: config.dependsOn, count: config.count, lifecycle: config.lifecycle }); this._description = config.description; this._instanceId = config.instanceId; this._name = config.name; this._tags = config.tags; this._tagsAll = config.tagsAll; this._timeZone = config.timeZone; this._config = config.config; this._timeouts.internalValue = config.timeouts; } // ========== // ATTRIBUTES // ========== // description - computed: false, optional: true, required: false private _description?: string; public get description() { return this.getStringAttribute('description'); } public set description(value: string) { this._description = value; } public resetDescription() { this._description = undefined; } // Temporarily expose input value. Use with caution. public get descriptionInput() { return this._description; } // hours_of_operation_arn - computed: true, optional: false, required: false public get hoursOfOperationArn() { return this.getStringAttribute('hours_of_operation_arn'); } // hours_of_operation_id - computed: true, optional: false, required: false public get hoursOfOperationId() { return this.getStringAttribute('hours_of_operation_id'); } // id - computed: true, optional: true, required: false public get id() { return this.getStringAttribute('id'); } // instance_id - computed: false, optional: false, required: true private _instanceId?: string; public get instanceId() { return this.getStringAttribute('instance_id'); } public set instanceId(value: string) { this._instanceId = value; } // Temporarily expose input value. Use with caution. public get instanceIdInput() { return this._instanceId; } // name - computed: false, optional: false, required: true private _name?: string; public get name() { return this.getStringAttribute('name'); } public set name(value: string) { this._name = value; } // Temporarily expose input value. Use with caution. public get nameInput() { return this._name; } // tags - computed: false, optional: true, required: false private _tags?: { [key: string]: string } | cdktf.IResolvable; public get tags() { // Getting the computed value is not yet implemented return this.interpolationForAttribute('tags') as any; } public set tags(value: { [key: string]: string } | cdktf.IResolvable) { this._tags = value; } public resetTags() { this._tags = undefined; } // Temporarily expose input value. Use with caution. public get tagsInput() { return this._tags; } // tags_all - computed: true, optional: true, required: false private _tagsAll?: { [key: string]: string } | cdktf.IResolvable; public get tagsAll() { // Getting the computed value is not yet implemented return this.interpolationForAttribute('tags_all') as any; } public set tagsAll(value: { [key: string]: string } | cdktf.IResolvable) { this._tagsAll = value; } public resetTagsAll() { this._tagsAll = undefined; } // Temporarily expose input value. Use with caution. public get tagsAllInput() { return this._tagsAll; } // time_zone - computed: false, optional: false, required: true private _timeZone?: string; public get timeZone() { return this.getStringAttribute('time_zone'); } public set timeZone(value: string) { this._timeZone = value; } // Temporarily expose input value. Use with caution. public get timeZoneInput() { return this._timeZone; } // config - computed: false, optional: false, required: true private _config?: ConnectHoursOfOperationConfigA[]; public get config() { // Getting the computed value is not yet implemented return this.interpolationForAttribute('config') as any; } public set config(value: ConnectHoursOfOperationConfigA[]) { this._config = value; } // Temporarily expose input value. Use with caution. public get configInput() { return this._config; } // timeouts - computed: false, optional: true, required: false private _timeouts = new ConnectHoursOfOperationTimeoutsOutputReference(this as any, "timeouts", true); public get timeouts() { return this._timeouts; } public putTimeouts(value: ConnectHoursOfOperationTimeouts) { this._timeouts.internalValue = value; } public resetTimeouts() { this._timeouts.internalValue = undefined; } // Temporarily expose input value. Use with caution. public get timeoutsInput() { return this._timeouts.internalValue; } // ========= // SYNTHESIS // ========= protected synthesizeAttributes(): { [name: string]: any } { return { description: cdktf.stringToTerraform(this._description), instance_id: cdktf.stringToTerraform(this._instanceId), name: cdktf.stringToTerraform(this._name), tags: cdktf.hashMapper(cdktf.anyToTerraform)(this._tags), tags_all: cdktf.hashMapper(cdktf.anyToTerraform)(this._tagsAll), time_zone: cdktf.stringToTerraform(this._timeZone), config: cdktf.listMapper(connectHoursOfOperationConfigAToTerraform)(this._config), timeouts: connectHoursOfOperationTimeoutsToTerraform(this._timeouts.internalValue), }; } }