package awsec2alpha

import (
	_init_ "github.com/aws/aws-cdk-go/awsec2alpha/v2/jsii"
	_jsii_ "github.com/aws/jsii-runtime-go/runtime"

	"github.com/aws/aws-cdk-go/awscdk/v2"
	"github.com/aws/aws-cdk-go/awscdk/v2/awsec2"
	"github.com/aws/aws-cdk-go/awsec2alpha/v2/internal"
	"github.com/aws/constructs-go/constructs/v10"
)

// Creates a Transit Gateway.
//
// Example:
//   transitGateway := awsec2alpha.NewTransitGateway(this, jsii.String("MyTransitGateway"))
//   routeTable := transitGateway.addRouteTable(jsii.String("CustomRouteTable"))
//   myVpc := awsec2alpha.NewVpcV2(this, jsii.String("Vpc"))
//   subnet := awsec2alpha.NewSubnetV2(this, jsii.String("Subnet"), &SubnetV2Props{
//   	Vpc: myVpc,
//   	AvailabilityZone: jsii.String("eu-west-2a"),
//   	Ipv4CidrBlock: awsec2alpha.NewIpCidr(jsii.String("10.0.0.0/24")),
//   	SubnetType: awscdk.SubnetType_PUBLIC,
//   })
//   attachment := transitGateway.attachVpc(jsii.String("VpcAttachment"), &AttachVpcOptions{
//   	Vpc: myVpc,
//   	Subnets: []iSubnet{
//   		subnet,
//   	},
//   })
//
//   // Associate an attachment with a route table
//   routeTable.AddAssociation(jsii.String("Association"), attachment)
//
//   // Enable route propagation for an attachment
//   routeTable.EnablePropagation(jsii.String("Propagation"), attachment)
//
// Experimental.
type TransitGateway interface {
	awscdk.Resource
	IRouteTarget
	ITransitGateway
	// The default route table associated with the Transit Gateway.
	//
	// This route table is created by the CDK and is used to manage the routes
	// for attachments that do not have an explicitly defined route table association.
	// Experimental.
	DefaultRouteTable() ITransitGatewayRouteTable
	// Indicates whether new attachments are automatically associated with the default route table.
	//
	// If set to `true`, any VPC or VPN attachment will be automatically associated with
	// the default route table unless otherwise specified.
	// Experimental.
	DefaultRouteTableAssociation() *bool
	// Indicates whether route propagation to the default route table is enabled.
	//
	// When set to `true`, routes from attachments will be automatically propagated
	// to the default route table unless propagation is explicitly disabled.
	// Experimental.
	DefaultRouteTablePropagation() *bool
	// Whether or not DNS support is enabled on the Transit Gateway.
	// Experimental.
	DnsSupport() *bool
	// The environment this resource belongs to.
	//
	// For resources that are created and managed by the CDK
	// (generally, those created by creating new class instances like Role, Bucket, etc.),
	// this is always the same as the environment of the stack they belong to;
	// however, for imported resources
	// (those obtained from static methods like fromRoleArn, fromBucketName, etc.),
	// that might be different than the stack they were imported into.
	// Experimental.
	Env() *awscdk.ResourceEnvironment
	// The tree node.
	// Experimental.
	Node() constructs.Node
	// Returns a string-encoded token that resolves to the physical name that should be passed to the CloudFormation resource.
	//
	// This value will resolve to one of the following:
	// - a concrete value (e.g. `"my-awesome-bucket"`)
	// - `undefined`, when a name should be generated by CloudFormation
	// - a concrete name generated automatically during synthesis, in
	//   cross-environment scenarios.
	// Experimental.
	PhysicalName() *string
	// The ID of the route target.
	// Experimental.
	RouterTargetId() *string
	// The type of router used in the route.
	// Experimental.
	RouterType() awsec2.RouterType
	// Whether or not security group referencing support is enabled on the Transit Gateway.
	// Experimental.
	SecurityGroupReferencingSupport() *bool
	// The stack in which this resource is defined.
	// Experimental.
	Stack() awscdk.Stack
	// The Amazon Resource Name (ARN) of the Transit Gateway.
	//
	// The ARN uniquely identifies the Transit Gateway across AWS and is commonly
	// used for permissions and resource tracking.
	// Experimental.
	TransitGatewayArn() *string
	// The unique identifier of the Transit Gateway.
	//
	// This ID is automatically assigned by AWS upon creation of the Transit Gateway
	// and is used to reference it in various configurations and operations.
	// Experimental.
	TransitGatewayId() *string
	// Adds a new route table to the Transit Gateway.
	//
	// Returns: The created Transit Gateway route table.
	// Experimental.
	AddRouteTable(id *string) ITransitGatewayRouteTable
	// Apply the given removal policy to this resource.
	//
	// The Removal Policy controls what happens to this resource when it stops
	// being managed by CloudFormation, either because you've removed it from the
	// CDK application or because you've made a change that requires the resource
	// to be replaced.
	//
	// The resource can be deleted (`RemovalPolicy.DESTROY`), or left in your AWS
	// account for data recovery and cleanup later (`RemovalPolicy.RETAIN`).
	// Experimental.
	ApplyRemovalPolicy(policy awscdk.RemovalPolicy)
	// Attaches a VPC to the Transit Gateway.
	//
	// Returns: The created Transit Gateway VPC attachment.
	// Experimental.
	AttachVpc(id *string, options *AttachVpcOptions) ITransitGatewayVpcAttachment
	// Experimental.
	GeneratePhysicalName() *string
	// Returns an environment-sensitive token that should be used for the resource's "ARN" attribute (e.g. `bucket.bucketArn`).
	//
	// Normally, this token will resolve to `arnAttr`, but if the resource is
	// referenced across environments, `arnComponents` will be used to synthesize
	// a concrete ARN with the resource's physical name. Make sure to reference
	// `this.physicalName` in `arnComponents`.
	// Experimental.
	GetResourceArnAttribute(arnAttr *string, arnComponents *awscdk.ArnComponents) *string
	// Returns an environment-sensitive token that should be used for the resource's "name" attribute (e.g. `bucket.bucketName`).
	//
	// Normally, this token will resolve to `nameAttr`, but if the resource is
	// referenced across environments, it will be resolved to `this.physicalName`,
	// which will be a concrete name.
	// Experimental.
	GetResourceNameAttribute(nameAttr *string) *string
	// Returns a string representation of this construct.
	// Experimental.
	ToString() *string
}

// The jsii proxy struct for TransitGateway
type jsiiProxy_TransitGateway struct {
	internal.Type__awscdkResource
	jsiiProxy_IRouteTarget
	jsiiProxy_ITransitGateway
}

func (j *jsiiProxy_TransitGateway) DefaultRouteTable() ITransitGatewayRouteTable {
	var returns ITransitGatewayRouteTable
	_jsii_.Get(
		j,
		"defaultRouteTable",
		&returns,
	)
	return returns
}

func (j *jsiiProxy_TransitGateway) DefaultRouteTableAssociation() *bool {
	var returns *bool
	_jsii_.Get(
		j,
		"defaultRouteTableAssociation",
		&returns,
	)
	return returns
}

func (j *jsiiProxy_TransitGateway) DefaultRouteTablePropagation() *bool {
	var returns *bool
	_jsii_.Get(
		j,
		"defaultRouteTablePropagation",
		&returns,
	)
	return returns
}

func (j *jsiiProxy_TransitGateway) DnsSupport() *bool {
	var returns *bool
	_jsii_.Get(
		j,
		"dnsSupport",
		&returns,
	)
	return returns
}

func (j *jsiiProxy_TransitGateway) Env() *awscdk.ResourceEnvironment {
	var returns *awscdk.ResourceEnvironment
	_jsii_.Get(
		j,
		"env",
		&returns,
	)
	return returns
}

func (j *jsiiProxy_TransitGateway) Node() constructs.Node {
	var returns constructs.Node
	_jsii_.Get(
		j,
		"node",
		&returns,
	)
	return returns
}

func (j *jsiiProxy_TransitGateway) PhysicalName() *string {
	var returns *string
	_jsii_.Get(
		j,
		"physicalName",
		&returns,
	)
	return returns
}

func (j *jsiiProxy_TransitGateway) RouterTargetId() *string {
	var returns *string
	_jsii_.Get(
		j,
		"routerTargetId",
		&returns,
	)
	return returns
}

func (j *jsiiProxy_TransitGateway) RouterType() awsec2.RouterType {
	var returns awsec2.RouterType
	_jsii_.Get(
		j,
		"routerType",
		&returns,
	)
	return returns
}

func (j *jsiiProxy_TransitGateway) SecurityGroupReferencingSupport() *bool {
	var returns *bool
	_jsii_.Get(
		j,
		"securityGroupReferencingSupport",
		&returns,
	)
	return returns
}

func (j *jsiiProxy_TransitGateway) Stack() awscdk.Stack {
	var returns awscdk.Stack
	_jsii_.Get(
		j,
		"stack",
		&returns,
	)
	return returns
}

func (j *jsiiProxy_TransitGateway) TransitGatewayArn() *string {
	var returns *string
	_jsii_.Get(
		j,
		"transitGatewayArn",
		&returns,
	)
	return returns
}

func (j *jsiiProxy_TransitGateway) TransitGatewayId() *string {
	var returns *string
	_jsii_.Get(
		j,
		"transitGatewayId",
		&returns,
	)
	return returns
}


// Experimental.
func NewTransitGateway(scope constructs.Construct, id *string, props *TransitGatewayProps) TransitGateway {
	_init_.Initialize()

	if err := validateNewTransitGatewayParameters(scope, id, props); err != nil {
		panic(err)
	}
	j := jsiiProxy_TransitGateway{}

	_jsii_.Create(
		"@aws-cdk/aws-ec2-alpha.TransitGateway",
		[]interface{}{scope, id, props},
		&j,
	)

	return &j
}

// Experimental.
func NewTransitGateway_Override(t TransitGateway, scope constructs.Construct, id *string, props *TransitGatewayProps) {
	_init_.Initialize()

	_jsii_.Create(
		"@aws-cdk/aws-ec2-alpha.TransitGateway",
		[]interface{}{scope, id, props},
		t,
	)
}

// Checks if `x` is a construct.
//
// Use this method instead of `instanceof` to properly detect `Construct`
// instances, even when the construct library is symlinked.
//
// Explanation: in JavaScript, multiple copies of the `constructs` library on
// disk are seen as independent, completely different libraries. As a
// consequence, the class `Construct` in each copy of the `constructs` library
// is seen as a different class, and an instance of one class will not test as
// `instanceof` the other class. `npm install` will not create installations
// like this, but users may manually symlink construct libraries together or
// use a monorepo tool: in those cases, multiple copies of the `constructs`
// library can be accidentally installed, and `instanceof` will behave
// unpredictably. It is safest to avoid using `instanceof`, and using
// this type-testing method instead.
//
// Returns: true if `x` is an object created from a class which extends `Construct`.
// Experimental.
func TransitGateway_IsConstruct(x interface{}) *bool {
	_init_.Initialize()

	if err := validateTransitGateway_IsConstructParameters(x); err != nil {
		panic(err)
	}
	var returns *bool

	_jsii_.StaticInvoke(
		"@aws-cdk/aws-ec2-alpha.TransitGateway",
		"isConstruct",
		[]interface{}{x},
		&returns,
	)

	return returns
}

// Returns true if the construct was created by CDK, and false otherwise.
// Experimental.
func TransitGateway_IsOwnedResource(construct constructs.IConstruct) *bool {
	_init_.Initialize()

	if err := validateTransitGateway_IsOwnedResourceParameters(construct); err != nil {
		panic(err)
	}
	var returns *bool

	_jsii_.StaticInvoke(
		"@aws-cdk/aws-ec2-alpha.TransitGateway",
		"isOwnedResource",
		[]interface{}{construct},
		&returns,
	)

	return returns
}

// Check whether the given construct is a Resource.
// Experimental.
func TransitGateway_IsResource(construct constructs.IConstruct) *bool {
	_init_.Initialize()

	if err := validateTransitGateway_IsResourceParameters(construct); err != nil {
		panic(err)
	}
	var returns *bool

	_jsii_.StaticInvoke(
		"@aws-cdk/aws-ec2-alpha.TransitGateway",
		"isResource",
		[]interface{}{construct},
		&returns,
	)

	return returns
}

func TransitGateway_PROPERTY_INJECTION_ID() *string {
	_init_.Initialize()
	var returns *string
	_jsii_.StaticGet(
		"@aws-cdk/aws-ec2-alpha.TransitGateway",
		"PROPERTY_INJECTION_ID",
		&returns,
	)
	return returns
}

func (t *jsiiProxy_TransitGateway) AddRouteTable(id *string) ITransitGatewayRouteTable {
	if err := t.validateAddRouteTableParameters(id); err != nil {
		panic(err)
	}
	var returns ITransitGatewayRouteTable

	_jsii_.Invoke(
		t,
		"addRouteTable",
		[]interface{}{id},
		&returns,
	)

	return returns
}

func (t *jsiiProxy_TransitGateway) ApplyRemovalPolicy(policy awscdk.RemovalPolicy) {
	if err := t.validateApplyRemovalPolicyParameters(policy); err != nil {
		panic(err)
	}
	_jsii_.InvokeVoid(
		t,
		"applyRemovalPolicy",
		[]interface{}{policy},
	)
}

func (t *jsiiProxy_TransitGateway) AttachVpc(id *string, options *AttachVpcOptions) ITransitGatewayVpcAttachment {
	if err := t.validateAttachVpcParameters(id, options); err != nil {
		panic(err)
	}
	var returns ITransitGatewayVpcAttachment

	_jsii_.Invoke(
		t,
		"attachVpc",
		[]interface{}{id, options},
		&returns,
	)

	return returns
}

func (t *jsiiProxy_TransitGateway) GeneratePhysicalName() *string {
	var returns *string

	_jsii_.Invoke(
		t,
		"generatePhysicalName",
		nil, // no parameters
		&returns,
	)

	return returns
}

func (t *jsiiProxy_TransitGateway) GetResourceArnAttribute(arnAttr *string, arnComponents *awscdk.ArnComponents) *string {
	if err := t.validateGetResourceArnAttributeParameters(arnAttr, arnComponents); err != nil {
		panic(err)
	}
	var returns *string

	_jsii_.Invoke(
		t,
		"getResourceArnAttribute",
		[]interface{}{arnAttr, arnComponents},
		&returns,
	)

	return returns
}

func (t *jsiiProxy_TransitGateway) GetResourceNameAttribute(nameAttr *string) *string {
	if err := t.validateGetResourceNameAttributeParameters(nameAttr); err != nil {
		panic(err)
	}
	var returns *string

	_jsii_.Invoke(
		t,
		"getResourceNameAttribute",
		[]interface{}{nameAttr},
		&returns,
	)

	return returns
}

func (t *jsiiProxy_TransitGateway) ToString() *string {
	var returns *string

	_jsii_.Invoke(
		t,
		"toString",
		nil, // no parameters
		&returns,
	)

	return returns
}

