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

package polly_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/polly"
)

var _ time.Duration
var _ bytes.Buffer

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

	svc := polly.New(sess)

	params := &polly.DeleteLexiconInput{
		Name: aws.String("LexiconName"), // Required
	}
	resp, err := svc.DeleteLexicon(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 ExamplePolly_DescribeVoices() {
	sess, err := session.NewSession()
	if err != nil {
		fmt.Println("failed to create session,", err)
		return
	}

	svc := polly.New(sess)

	params := &polly.DescribeVoicesInput{
		LanguageCode: aws.String("LanguageCode"),
		NextToken:    aws.String("NextToken"),
	}
	resp, err := svc.DescribeVoices(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 ExamplePolly_GetLexicon() {
	sess, err := session.NewSession()
	if err != nil {
		fmt.Println("failed to create session,", err)
		return
	}

	svc := polly.New(sess)

	params := &polly.GetLexiconInput{
		Name: aws.String("LexiconName"), // Required
	}
	resp, err := svc.GetLexicon(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 ExamplePolly_ListLexicons() {
	sess, err := session.NewSession()
	if err != nil {
		fmt.Println("failed to create session,", err)
		return
	}

	svc := polly.New(sess)

	params := &polly.ListLexiconsInput{
		NextToken: aws.String("NextToken"),
	}
	resp, err := svc.ListLexicons(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 ExamplePolly_PutLexicon() {
	sess, err := session.NewSession()
	if err != nil {
		fmt.Println("failed to create session,", err)
		return
	}

	svc := polly.New(sess)

	params := &polly.PutLexiconInput{
		Content: aws.String("LexiconContent"), // Required
		Name:    aws.String("LexiconName"),    // Required
	}
	resp, err := svc.PutLexicon(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 ExamplePolly_SynthesizeSpeech() {
	sess, err := session.NewSession()
	if err != nil {
		fmt.Println("failed to create session,", err)
		return
	}

	svc := polly.New(sess)

	params := &polly.SynthesizeSpeechInput{
		OutputFormat: aws.String("OutputFormat"), // Required
		Text:         aws.String("Text"),         // Required
		VoiceId:      aws.String("VoiceId"),      // Required
		LexiconNames: []*string{
			aws.String("LexiconName"), // Required
			// More values...
		},
		SampleRate: aws.String("SampleRate"),
		TextType:   aws.String("TextType"),
	}
	resp, err := svc.SynthesizeSpeech(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)
}
