// generated from terraform resource schema import { Construct } from 'constructs'; import * as cdktf from 'cdktf'; /** * API Gateway */ export interface ApiGatewayDocumentationPartConfig extends cdktf.TerraformMetaArguments { /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/api_gateway_documentation_part.html#properties ApiGatewayDocumentationPart#properties} */ readonly properties: string; /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/api_gateway_documentation_part.html#rest_api_id ApiGatewayDocumentationPart#rest_api_id} */ readonly restApiId: string; /** * location block * * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/api_gateway_documentation_part.html#location ApiGatewayDocumentationPart#location} */ readonly location: ApiGatewayDocumentationPartLocation; } export interface ApiGatewayDocumentationPartLocation { /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/api_gateway_documentation_part.html#method ApiGatewayDocumentationPart#method} */ readonly method?: string; /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/api_gateway_documentation_part.html#name ApiGatewayDocumentationPart#name} */ readonly name?: string; /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/api_gateway_documentation_part.html#path ApiGatewayDocumentationPart#path} */ readonly path?: string; /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/api_gateway_documentation_part.html#status_code ApiGatewayDocumentationPart#status_code} */ readonly statusCode?: string; /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/api_gateway_documentation_part.html#type ApiGatewayDocumentationPart#type} */ readonly type: string; } export function apiGatewayDocumentationPartLocationToTerraform(struct?: ApiGatewayDocumentationPartLocationOutputReference | ApiGatewayDocumentationPartLocation): 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 { method: cdktf.stringToTerraform(struct!.method), name: cdktf.stringToTerraform(struct!.name), path: cdktf.stringToTerraform(struct!.path), status_code: cdktf.stringToTerraform(struct!.statusCode), type: cdktf.stringToTerraform(struct!.type), } } export class ApiGatewayDocumentationPartLocationOutputReference 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(): ApiGatewayDocumentationPartLocation | undefined { let hasAnyValues = this.isEmptyObject; const internalValueResult: any = {}; if (this._method !== undefined) { hasAnyValues = true; internalValueResult.method = this._method; } if (this._name !== undefined) { hasAnyValues = true; internalValueResult.name = this._name; } if (this._path !== undefined) { hasAnyValues = true; internalValueResult.path = this._path; } if (this._statusCode !== undefined) { hasAnyValues = true; internalValueResult.statusCode = this._statusCode; } if (this._type !== undefined) { hasAnyValues = true; internalValueResult.type = this._type; } return hasAnyValues ? internalValueResult : undefined; } public set internalValue(value: ApiGatewayDocumentationPartLocation | undefined) { if (value === undefined) { this.isEmptyObject = false; this._method = undefined; this._name = undefined; this._path = undefined; this._statusCode = undefined; this._type = undefined; } else { this.isEmptyObject = Object.keys(value).length === 0; this._method = value.method; this._name = value.name; this._path = value.path; this._statusCode = value.statusCode; this._type = value.type; } } // method - computed: false, optional: true, required: false private _method?: string; public get method() { return this.getStringAttribute('method'); } public set method(value: string) { this._method = value; } public resetMethod() { this._method = undefined; } // Temporarily expose input value. Use with caution. public get methodInput() { return this._method; } // name - computed: false, optional: true, required: false private _name?: string; public get name() { return this.getStringAttribute('name'); } public set name(value: string) { this._name = value; } public resetName() { this._name = undefined; } // Temporarily expose input value. Use with caution. public get nameInput() { return this._name; } // path - computed: false, optional: true, required: false private _path?: string; public get path() { return this.getStringAttribute('path'); } public set path(value: string) { this._path = value; } public resetPath() { this._path = undefined; } // Temporarily expose input value. Use with caution. public get pathInput() { return this._path; } // status_code - computed: false, optional: true, required: false private _statusCode?: string; public get statusCode() { return this.getStringAttribute('status_code'); } public set statusCode(value: string) { this._statusCode = value; } public resetStatusCode() { this._statusCode = undefined; } // Temporarily expose input value. Use with caution. public get statusCodeInput() { return this._statusCode; } // type - computed: false, optional: false, required: true private _type?: string; public get type() { return this.getStringAttribute('type'); } public set type(value: string) { this._type = value; } // Temporarily expose input value. Use with caution. public get typeInput() { return this._type; } } /** * Represents a {@link https://www.terraform.io/docs/providers/aws/r/api_gateway_documentation_part.html aws_api_gateway_documentation_part} */ export class ApiGatewayDocumentationPart extends cdktf.TerraformResource { // ================= // STATIC PROPERTIES // ================= public static readonly tfResourceType: string = "aws_api_gateway_documentation_part"; // =========== // INITIALIZER // =========== /** * Create a new {@link https://www.terraform.io/docs/providers/aws/r/api_gateway_documentation_part.html aws_api_gateway_documentation_part} 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 ApiGatewayDocumentationPartConfig */ public constructor(scope: Construct, id: string, config: ApiGatewayDocumentationPartConfig) { super(scope, id, { terraformResourceType: 'aws_api_gateway_documentation_part', terraformGeneratorMetadata: { providerName: 'aws' }, provider: config.provider, dependsOn: config.dependsOn, count: config.count, lifecycle: config.lifecycle }); this._properties = config.properties; this._restApiId = config.restApiId; this._location.internalValue = config.location; } // ========== // ATTRIBUTES // ========== // id - computed: true, optional: true, required: false public get id() { return this.getStringAttribute('id'); } // properties - computed: false, optional: false, required: true private _properties?: string; public get properties() { return this.getStringAttribute('properties'); } public set properties(value: string) { this._properties = value; } // Temporarily expose input value. Use with caution. public get propertiesInput() { return this._properties; } // rest_api_id - computed: false, optional: false, required: true private _restApiId?: string; public get restApiId() { return this.getStringAttribute('rest_api_id'); } public set restApiId(value: string) { this._restApiId = value; } // Temporarily expose input value. Use with caution. public get restApiIdInput() { return this._restApiId; } // location - computed: false, optional: false, required: true private _location = new ApiGatewayDocumentationPartLocationOutputReference(this as any, "location", true); public get location() { return this._location; } public putLocation(value: ApiGatewayDocumentationPartLocation) { this._location.internalValue = value; } // Temporarily expose input value. Use with caution. public get locationInput() { return this._location.internalValue; } // ========= // SYNTHESIS // ========= protected synthesizeAttributes(): { [name: string]: any } { return { properties: cdktf.stringToTerraform(this._properties), rest_api_id: cdktf.stringToTerraform(this._restApiId), location: apiGatewayDocumentationPartLocationToTerraform(this._location.internalValue), }; } }