// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.

package directconnect_test

import (
	"bytes"
	"fmt"
	"time"

	"github.com/aws/aws-sdk-go/aws"
	"github.com/aws/aws-sdk-go/aws/session"
	"github.com/aws/aws-sdk-go/service/directconnect"
)

var _ time.Duration
var _ bytes.Buffer

func ExampleDirectConnect_AllocateConnectionOnInterconnect() {
	sess, err := session.NewSession()
	if err != nil {
		fmt.Println("failed to create session,", err)
		return
	}

	svc := directconnect.New(sess)

	params := &directconnect.AllocateConnectionOnInterconnectInput{
		Bandwidth:      aws.String("Bandwidth"),      // Required
		ConnectionName: aws.String("ConnectionName"), // Required
		InterconnectId: aws.String("InterconnectId"), // Required
		OwnerAccount:   aws.String("OwnerAccount"),   // Required
		Vlan:           aws.Int64(1),                 // Required
	}
	resp, err := svc.AllocateConnectionOnInterconnect(params)

	if err != nil {
		// Print the error, cast err to awserr.Error to get the Code and
		// Message from an error.
		fmt.Println(err.Error())
		return
	}

	// Pretty-print the response data.
	fmt.Println(resp)
}

func ExampleDirectConnect_AllocatePrivateVirtualInterface() {
	sess, err := session.NewSession()
	if err != nil {
		fmt.Println("failed to create session,", err)
		return
	}

	svc := directconnect.New(sess)

	params := &directconnect.AllocatePrivateVirtualInterfaceInput{
		ConnectionId: aws.String("ConnectionId"), // Required
		NewPrivateVirtualInterfaceAllocation: &directconnect.NewPrivateVirtualInterfaceAllocation{ // Required
			Asn:                  aws.Int64(1),                       // Required
			VirtualInterfaceName: aws.String("VirtualInterfaceName"), // Required
			Vlan:                 aws.Int64(1),                       // Required
			AddressFamily:        aws.String("AddressFamily"),
			AmazonAddress:        aws.String("AmazonAddress"),
			AuthKey:              aws.String("BGPAuthKey"),
			CustomerAddress:      aws.String("CustomerAddress"),
		},
		OwnerAccount: aws.String("OwnerAccount"), // Required
	}
	resp, err := svc.AllocatePrivateVirtualInterface(params)

	if err != nil {
		// Print the error, cast err to awserr.Error to get the Code and
		// Message from an error.
		fmt.Println(err.Error())
		return
	}

	// Pretty-print the response data.
	fmt.Println(resp)
}

func ExampleDirectConnect_AllocatePublicVirtualInterface() {
	sess, err := session.NewSession()
	if err != nil {
		fmt.Println("failed to create session,", err)
		return
	}

	svc := directconnect.New(sess)

	params := &directconnect.AllocatePublicVirtualInterfaceInput{
		ConnectionId: aws.String("ConnectionId"), // Required
		NewPublicVirtualInterfaceAllocation: &directconnect.NewPublicVirtualInterfaceAllocation{ // Required
			Asn:                  aws.Int64(1),                       // Required
			VirtualInterfaceName: aws.String("VirtualInterfaceName"), // Required
			Vlan:                 aws.Int64(1),                       // Required
			AddressFamily:        aws.String("AddressFamily"),
			AmazonAddress:        aws.String("AmazonAddress"),
			AuthKey:              aws.String("BGPAuthKey"),
			CustomerAddress:      aws.String("CustomerAddress"),
			RouteFilterPrefixes: []*directconnect.RouteFilterPrefix{
				{ // Required
					Cidr: aws.String("CIDR"),
				},
				// More values...
			},
		},
		OwnerAccount: aws.String("OwnerAccount"), // Required
	}
	resp, err := svc.AllocatePublicVirtualInterface(params)

	if err != nil {
		// Print the error, cast err to awserr.Error to get the Code and
		// Message from an error.
		fmt.Println(err.Error())
		return
	}

	// Pretty-print the response data.
	fmt.Println(resp)
}

func ExampleDirectConnect_ConfirmConnection() {
	sess, err := session.NewSession()
	if err != nil {
		fmt.Println("failed to create session,", err)
		return
	}

	svc := directconnect.New(sess)

	params := &directconnect.ConfirmConnectionInput{
		ConnectionId: aws.String("ConnectionId"), // Required
	}
	resp, err := svc.ConfirmConnection(params)

	if err != nil {
		// Print the error, cast err to awserr.Error to get the Code and
		// Message from an error.
		fmt.Println(err.Error())
		return
	}

	// Pretty-print the response data.
	fmt.Println(resp)
}

func ExampleDirectConnect_ConfirmPrivateVirtualInterface() {
	sess, err := session.NewSession()
	if err != nil {
		fmt.Println("failed to create session,", err)
		return
	}

	svc := directconnect.New(sess)

	params := &directconnect.ConfirmPrivateVirtualInterfaceInput{
		VirtualGatewayId:   aws.String("VirtualGatewayId"),   // Required
		VirtualInterfaceId: aws.String("VirtualInterfaceId"), // Required
	}
	resp, err := svc.ConfirmPrivateVirtualInterface(params)

	if err != nil {
		// Print the error, cast err to awserr.Error to get the Code and
		// Message from an error.
		fmt.Println(err.Error())
		return
	}

	// Pretty-print the response data.
	fmt.Println(resp)
}

func ExampleDirectConnect_ConfirmPublicVirtualInterface() {
	sess, err := session.NewSession()
	if err != nil {
		fmt.Println("failed to create session,", err)
		return
	}

	svc := directconnect.New(sess)

	params := &directconnect.ConfirmPublicVirtualInterfaceInput{
		VirtualInterfaceId: aws.String("VirtualInterfaceId"), // Required
	}
	resp, err := svc.ConfirmPublicVirtualInterface(params)

	if err != nil {
		// Print the error, cast err to awserr.Error to get the Code and
		// Message from an error.
		fmt.Println(err.Error())
		return
	}

	// Pretty-print the response data.
	fmt.Println(resp)
}

func ExampleDirectConnect_CreateBGPPeer() {
	sess, err := session.NewSession()
	if err != nil {
		fmt.Println("failed to create session,", err)
		return
	}

	svc := directconnect.New(sess)

	params := &directconnect.CreateBGPPeerInput{
		NewBGPPeer: &directconnect.NewBGPPeer{
			AddressFamily:   aws.String("AddressFamily"),
			AmazonAddress:   aws.String("AmazonAddress"),
			Asn:             aws.Int64(1),
			AuthKey:         aws.String("BGPAuthKey"),
			CustomerAddress: aws.String("CustomerAddress"),
		},
		VirtualInterfaceId: aws.String("VirtualInterfaceId"),
	}
	resp, err := svc.CreateBGPPeer(params)

	if err != nil {
		// Print the error, cast err to awserr.Error to get the Code and
		// Message from an error.
		fmt.Println(err.Error())
		return
	}

	// Pretty-print the response data.
	fmt.Println(resp)
}

func ExampleDirectConnect_CreateConnection() {
	sess, err := session.NewSession()
	if err != nil {
		fmt.Println("failed to create session,", err)
		return
	}

	svc := directconnect.New(sess)

	params := &directconnect.CreateConnectionInput{
		Bandwidth:      aws.String("Bandwidth"),      // Required
		ConnectionName: aws.String("ConnectionName"), // Required
		Location:       aws.String("LocationCode"),   // Required
	}
	resp, err := svc.CreateConnection(params)

	if err != nil {
		// Print the error, cast err to awserr.Error to get the Code and
		// Message from an error.
		fmt.Println(err.Error())
		return
	}

	// Pretty-print the response data.
	fmt.Println(resp)
}

func ExampleDirectConnect_CreateInterconnect() {
	sess, err := session.NewSession()
	if err != nil {
		fmt.Println("failed to create session,", err)
		return
	}

	svc := directconnect.New(sess)

	params := &directconnect.CreateInterconnectInput{
		Bandwidth:        aws.String("Bandwidth"),        // Required
		InterconnectName: aws.String("InterconnectName"), // Required
		Location:         aws.String("LocationCode"),     // Required
	}
	resp, err := svc.CreateInterconnect(params)

	if err != nil {
		// Print the error, cast err to awserr.Error to get the Code and
		// Message from an error.
		fmt.Println(err.Error())
		return
	}

	// Pretty-print the response data.
	fmt.Println(resp)
}

func ExampleDirectConnect_CreatePrivateVirtualInterface() {
	sess, err := session.NewSession()
	if err != nil {
		fmt.Println("failed to create session,", err)
		return
	}

	svc := directconnect.New(sess)

	params := &directconnect.CreatePrivateVirtualInterfaceInput{
		ConnectionId: aws.String("ConnectionId"), // Required
		NewPrivateVirtualInterface: &directconnect.NewPrivateVirtualInterface{ // Required
			Asn:                  aws.Int64(1),                       // Required
			VirtualGatewayId:     aws.String("VirtualGatewayId"),     // Required
			VirtualInterfaceName: aws.String("VirtualInterfaceName"), // Required
			Vlan:                 aws.Int64(1),                       // Required
			AddressFamily:        aws.String("AddressFamily"),
			AmazonAddress:        aws.String("AmazonAddress"),
			AuthKey:              aws.String("BGPAuthKey"),
			CustomerAddress:      aws.String("CustomerAddress"),
		},
	}
	resp, err := svc.CreatePrivateVirtualInterface(params)

	if err != nil {
		// Print the error, cast err to awserr.Error to get the Code and
		// Message from an error.
		fmt.Println(err.Error())
		return
	}

	// Pretty-print the response data.
	fmt.Println(resp)
}

func ExampleDirectConnect_CreatePublicVirtualInterface() {
	sess, err := session.NewSession()
	if err != nil {
		fmt.Println("failed to create session,", err)
		return
	}

	svc := directconnect.New(sess)

	params := &directconnect.CreatePublicVirtualInterfaceInput{
		ConnectionId: aws.String("ConnectionId"), // Required
		NewPublicVirtualInterface: &directconnect.NewPublicVirtualInterface{ // Required
			Asn:                  aws.Int64(1),                       // Required
			VirtualInterfaceName: aws.String("VirtualInterfaceName"), // Required
			Vlan:                 aws.Int64(1),                       // Required
			AddressFamily:        aws.String("AddressFamily"),
			AmazonAddress:        aws.String("AmazonAddress"),
			AuthKey:              aws.String("BGPAuthKey"),
			CustomerAddress:      aws.String("CustomerAddress"),
			RouteFilterPrefixes: []*directconnect.RouteFilterPrefix{
				{ // Required
					Cidr: aws.String("CIDR"),
				},
				// More values...
			},
		},
	}
	resp, err := svc.CreatePublicVirtualInterface(params)

	if err != nil {
		// Print the error, cast err to awserr.Error to get the Code and
		// Message from an error.
		fmt.Println(err.Error())
		return
	}

	// Pretty-print the response data.
	fmt.Println(resp)
}

func ExampleDirectConnect_DeleteBGPPeer() {
	sess, err := session.NewSession()
	if err != nil {
		fmt.Println("failed to create session,", err)
		return
	}

	svc := directconnect.New(sess)

	params := &directconnect.DeleteBGPPeerInput{
		Asn:                aws.Int64(1),
		CustomerAddress:    aws.String("CustomerAddress"),
		VirtualInterfaceId: aws.String("VirtualInterfaceId"),
	}
	resp, err := svc.DeleteBGPPeer(params)

	if err != nil {
		// Print the error, cast err to awserr.Error to get the Code and
		// Message from an error.
		fmt.Println(err.Error())
		return
	}

	// Pretty-print the response data.
	fmt.Println(resp)
}

func ExampleDirectConnect_DeleteConnection() {
	sess, err := session.NewSession()
	if err != nil {
		fmt.Println("failed to create session,", err)
		return
	}

	svc := directconnect.New(sess)

	params := &directconnect.DeleteConnectionInput{
		ConnectionId: aws.String("ConnectionId"), // Required
	}
	resp, err := svc.DeleteConnection(params)

	if err != nil {
		// Print the error, cast err to awserr.Error to get the Code and
		// Message from an error.
		fmt.Println(err.Error())
		return
	}

	// Pretty-print the response data.
	fmt.Println(resp)
}

func ExampleDirectConnect_DeleteInterconnect() {
	sess, err := session.NewSession()
	if err != nil {
		fmt.Println("failed to create session,", err)
		return
	}

	svc := directconnect.New(sess)

	params := &directconnect.DeleteInterconnectInput{
		InterconnectId: aws.String("InterconnectId"), // Required
	}
	resp, err := svc.DeleteInterconnect(params)

	if err != nil {
		// Print the error, cast err to awserr.Error to get the Code and
		// Message from an error.
		fmt.Println(err.Error())
		return
	}

	// Pretty-print the response data.
	fmt.Println(resp)
}

func ExampleDirectConnect_DeleteVirtualInterface() {
	sess, err := session.NewSession()
	if err != nil {
		fmt.Println("failed to create session,", err)
		return
	}

	svc := directconnect.New(sess)

	params := &directconnect.DeleteVirtualInterfaceInput{
		VirtualInterfaceId: aws.String("VirtualInterfaceId"), // Required
	}
	resp, err := svc.DeleteVirtualInterface(params)

	if err != nil {
		// Print the error, cast err to awserr.Error to get the Code and
		// Message from an error.
		fmt.Println(err.Error())
		return
	}

	// Pretty-print the response data.
	fmt.Println(resp)
}

func ExampleDirectConnect_DescribeConnectionLoa() {
	sess, err := session.NewSession()
	if err != nil {
		fmt.Println("failed to create session,", err)
		return
	}

	svc := directconnect.New(sess)

	params := &directconnect.DescribeConnectionLoaInput{
		ConnectionId:   aws.String("ConnectionId"), // Required
		LoaContentType: aws.String("LoaContentType"),
		ProviderName:   aws.String("ProviderName"),
	}
	resp, err := svc.DescribeConnectionLoa(params)

	if err != nil {
		// Print the error, cast err to awserr.Error to get the Code and
		// Message from an error.
		fmt.Println(err.Error())
		return
	}

	// Pretty-print the response data.
	fmt.Println(resp)
}

func ExampleDirectConnect_DescribeConnections() {
	sess, err := session.NewSession()
	if err != nil {
		fmt.Println("failed to create session,", err)
		return
	}

	svc := directconnect.New(sess)

	params := &directconnect.DescribeConnectionsInput{
		ConnectionId: aws.String("ConnectionId"),
	}
	resp, err := svc.DescribeConnections(params)

	if err != nil {
		// Print the error, cast err to awserr.Error to get the Code and
		// Message from an error.
		fmt.Println(err.Error())
		return
	}

	// Pretty-print the response data.
	fmt.Println(resp)
}

func ExampleDirectConnect_DescribeConnectionsOnInterconnect() {
	sess, err := session.NewSession()
	if err != nil {
		fmt.Println("failed to create session,", err)
		return
	}

	svc := directconnect.New(sess)

	params := &directconnect.DescribeConnectionsOnInterconnectInput{
		InterconnectId: aws.String("InterconnectId"), // Required
	}
	resp, err := svc.DescribeConnectionsOnInterconnect(params)

	if err != nil {
		// Print the error, cast err to awserr.Error to get the Code and
		// Message from an error.
		fmt.Println(err.Error())
		return
	}

	// Pretty-print the response data.
	fmt.Println(resp)
}

func ExampleDirectConnect_DescribeInterconnectLoa() {
	sess, err := session.NewSession()
	if err != nil {
		fmt.Println("failed to create session,", err)
		return
	}

	svc := directconnect.New(sess)

	params := &directconnect.DescribeInterconnectLoaInput{
		InterconnectId: aws.String("InterconnectId"), // Required
		LoaContentType: aws.String("LoaContentType"),
		ProviderName:   aws.String("ProviderName"),
	}
	resp, err := svc.DescribeInterconnectLoa(params)

	if err != nil {
		// Print the error, cast err to awserr.Error to get the Code and
		// Message from an error.
		fmt.Println(err.Error())
		return
	}

	// Pretty-print the response data.
	fmt.Println(resp)
}

func ExampleDirectConnect_DescribeInterconnects() {
	sess, err := session.NewSession()
	if err != nil {
		fmt.Println("failed to create session,", err)
		return
	}

	svc := directconnect.New(sess)

	params := &directconnect.DescribeInterconnectsInput{
		InterconnectId: aws.String("InterconnectId"),
	}
	resp, err := svc.DescribeInterconnects(params)

	if err != nil {
		// Print the error, cast err to awserr.Error to get the Code and
		// Message from an error.
		fmt.Println(err.Error())
		return
	}

	// Pretty-print the response data.
	fmt.Println(resp)
}

func ExampleDirectConnect_DescribeLocations() {
	sess, err := session.NewSession()
	if err != nil {
		fmt.Println("failed to create session,", err)
		return
	}

	svc := directconnect.New(sess)

	var params *directconnect.DescribeLocationsInput
	resp, err := svc.DescribeLocations(params)

	if err != nil {
		// Print the error, cast err to awserr.Error to get the Code and
		// Message from an error.
		fmt.Println(err.Error())
		return
	}

	// Pretty-print the response data.
	fmt.Println(resp)
}

func ExampleDirectConnect_DescribeTags() {
	sess, err := session.NewSession()
	if err != nil {
		fmt.Println("failed to create session,", err)
		return
	}

	svc := directconnect.New(sess)

	params := &directconnect.DescribeTagsInput{
		ResourceArns: []*string{ // Required
			aws.String("ResourceArn"), // Required
			// More values...
		},
	}
	resp, err := svc.DescribeTags(params)

	if err != nil {
		// Print the error, cast err to awserr.Error to get the Code and
		// Message from an error.
		fmt.Println(err.Error())
		return
	}

	// Pretty-print the response data.
	fmt.Println(resp)
}

func ExampleDirectConnect_DescribeVirtualGateways() {
	sess, err := session.NewSession()
	if err != nil {
		fmt.Println("failed to create session,", err)
		return
	}

	svc := directconnect.New(sess)

	var params *directconnect.DescribeVirtualGatewaysInput
	resp, err := svc.DescribeVirtualGateways(params)

	if err != nil {
		// Print the error, cast err to awserr.Error to get the Code and
		// Message from an error.
		fmt.Println(err.Error())
		return
	}

	// Pretty-print the response data.
	fmt.Println(resp)
}

func ExampleDirectConnect_DescribeVirtualInterfaces() {
	sess, err := session.NewSession()
	if err != nil {
		fmt.Println("failed to create session,", err)
		return
	}

	svc := directconnect.New(sess)

	params := &directconnect.DescribeVirtualInterfacesInput{
		ConnectionId:       aws.String("ConnectionId"),
		VirtualInterfaceId: aws.String("VirtualInterfaceId"),
	}
	resp, err := svc.DescribeVirtualInterfaces(params)

	if err != nil {
		// Print the error, cast err to awserr.Error to get the Code and
		// Message from an error.
		fmt.Println(err.Error())
		return
	}

	// Pretty-print the response data.
	fmt.Println(resp)
}

func ExampleDirectConnect_TagResource() {
	sess, err := session.NewSession()
	if err != nil {
		fmt.Println("failed to create session,", err)
		return
	}

	svc := directconnect.New(sess)

	params := &directconnect.TagResourceInput{
		ResourceArn: aws.String("ResourceArn"), // Required
		Tags: []*directconnect.Tag{ // Required
			{ // Required
				Key:   aws.String("TagKey"), // Required
				Value: aws.String("TagValue"),
			},
			// More values...
		},
	}
	resp, err := svc.TagResource(params)

	if err != nil {
		// Print the error, cast err to awserr.Error to get the Code and
		// Message from an error.
		fmt.Println(err.Error())
		return
	}

	// Pretty-print the response data.
	fmt.Println(resp)
}

func ExampleDirectConnect_UntagResource() {
	sess, err := session.NewSession()
	if err != nil {
		fmt.Println("failed to create session,", err)
		return
	}

	svc := directconnect.New(sess)

	params := &directconnect.UntagResourceInput{
		ResourceArn: aws.String("ResourceArn"), // Required
		TagKeys: []*string{ // Required
			aws.String("TagKey"), // Required
			// More values...
		},
	}
	resp, err := svc.UntagResource(params)

	if err != nil {
		// Print the error, cast err to awserr.Error to get the Code and
		// Message from an error.
		fmt.Println(err.Error())
		return
	}

	// Pretty-print the response data.
	fmt.Println(resp)
}
