123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496 |
- // THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
- package ses_test
- import (
- "bytes"
- "fmt"
- "time"
- "github.com/aws/aws-sdk-go/aws"
- "github.com/aws/aws-sdk-go/service/ses"
- )
- var _ time.Duration
- var _ bytes.Buffer
- func ExampleSES_DeleteIdentity() {
- svc := ses.New(nil)
- params := &ses.DeleteIdentityInput{
- Identity: aws.String("Identity"), // Required
- }
- resp, err := svc.DeleteIdentity(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 ExampleSES_DeleteIdentityPolicy() {
- svc := ses.New(nil)
- params := &ses.DeleteIdentityPolicyInput{
- Identity: aws.String("Identity"), // Required
- PolicyName: aws.String("PolicyName"), // Required
- }
- resp, err := svc.DeleteIdentityPolicy(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 ExampleSES_DeleteVerifiedEmailAddress() {
- svc := ses.New(nil)
- params := &ses.DeleteVerifiedEmailAddressInput{
- EmailAddress: aws.String("Address"), // Required
- }
- resp, err := svc.DeleteVerifiedEmailAddress(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 ExampleSES_GetIdentityDkimAttributes() {
- svc := ses.New(nil)
- params := &ses.GetIdentityDkimAttributesInput{
- Identities: []*string{ // Required
- aws.String("Identity"), // Required
- // More values...
- },
- }
- resp, err := svc.GetIdentityDkimAttributes(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 ExampleSES_GetIdentityNotificationAttributes() {
- svc := ses.New(nil)
- params := &ses.GetIdentityNotificationAttributesInput{
- Identities: []*string{ // Required
- aws.String("Identity"), // Required
- // More values...
- },
- }
- resp, err := svc.GetIdentityNotificationAttributes(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 ExampleSES_GetIdentityPolicies() {
- svc := ses.New(nil)
- params := &ses.GetIdentityPoliciesInput{
- Identity: aws.String("Identity"), // Required
- PolicyNames: []*string{ // Required
- aws.String("PolicyName"), // Required
- // More values...
- },
- }
- resp, err := svc.GetIdentityPolicies(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 ExampleSES_GetIdentityVerificationAttributes() {
- svc := ses.New(nil)
- params := &ses.GetIdentityVerificationAttributesInput{
- Identities: []*string{ // Required
- aws.String("Identity"), // Required
- // More values...
- },
- }
- resp, err := svc.GetIdentityVerificationAttributes(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 ExampleSES_GetSendQuota() {
- svc := ses.New(nil)
- var params *ses.GetSendQuotaInput
- resp, err := svc.GetSendQuota(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 ExampleSES_GetSendStatistics() {
- svc := ses.New(nil)
- var params *ses.GetSendStatisticsInput
- resp, err := svc.GetSendStatistics(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 ExampleSES_ListIdentities() {
- svc := ses.New(nil)
- params := &ses.ListIdentitiesInput{
- IdentityType: aws.String("IdentityType"),
- MaxItems: aws.Int64(1),
- NextToken: aws.String("NextToken"),
- }
- resp, err := svc.ListIdentities(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 ExampleSES_ListIdentityPolicies() {
- svc := ses.New(nil)
- params := &ses.ListIdentityPoliciesInput{
- Identity: aws.String("Identity"), // Required
- }
- resp, err := svc.ListIdentityPolicies(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 ExampleSES_ListVerifiedEmailAddresses() {
- svc := ses.New(nil)
- var params *ses.ListVerifiedEmailAddressesInput
- resp, err := svc.ListVerifiedEmailAddresses(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 ExampleSES_PutIdentityPolicy() {
- svc := ses.New(nil)
- params := &ses.PutIdentityPolicyInput{
- Identity: aws.String("Identity"), // Required
- Policy: aws.String("Policy"), // Required
- PolicyName: aws.String("PolicyName"), // Required
- }
- resp, err := svc.PutIdentityPolicy(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 ExampleSES_SendEmail() {
- svc := ses.New(nil)
- params := &ses.SendEmailInput{
- Destination: &ses.Destination{ // Required
- BccAddresses: []*string{
- aws.String("Address"), // Required
- // More values...
- },
- CcAddresses: []*string{
- aws.String("Address"), // Required
- // More values...
- },
- ToAddresses: []*string{
- aws.String("Address"), // Required
- // More values...
- },
- },
- Message: &ses.Message{ // Required
- Body: &ses.Body{ // Required
- Html: &ses.Content{
- Data: aws.String("MessageData"), // Required
- Charset: aws.String("Charset"),
- },
- Text: &ses.Content{
- Data: aws.String("MessageData"), // Required
- Charset: aws.String("Charset"),
- },
- },
- Subject: &ses.Content{ // Required
- Data: aws.String("MessageData"), // Required
- Charset: aws.String("Charset"),
- },
- },
- Source: aws.String("Address"), // Required
- ReplyToAddresses: []*string{
- aws.String("Address"), // Required
- // More values...
- },
- ReturnPath: aws.String("Address"),
- ReturnPathArn: aws.String("AmazonResourceName"),
- SourceArn: aws.String("AmazonResourceName"),
- }
- resp, err := svc.SendEmail(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 ExampleSES_SendRawEmail() {
- svc := ses.New(nil)
- params := &ses.SendRawEmailInput{
- RawMessage: &ses.RawMessage{ // Required
- Data: []byte("PAYLOAD"), // Required
- },
- Destinations: []*string{
- aws.String("Address"), // Required
- // More values...
- },
- FromArn: aws.String("AmazonResourceName"),
- ReturnPathArn: aws.String("AmazonResourceName"),
- Source: aws.String("Address"),
- SourceArn: aws.String("AmazonResourceName"),
- }
- resp, err := svc.SendRawEmail(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 ExampleSES_SetIdentityDkimEnabled() {
- svc := ses.New(nil)
- params := &ses.SetIdentityDkimEnabledInput{
- DkimEnabled: aws.Bool(true), // Required
- Identity: aws.String("Identity"), // Required
- }
- resp, err := svc.SetIdentityDkimEnabled(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 ExampleSES_SetIdentityFeedbackForwardingEnabled() {
- svc := ses.New(nil)
- params := &ses.SetIdentityFeedbackForwardingEnabledInput{
- ForwardingEnabled: aws.Bool(true), // Required
- Identity: aws.String("Identity"), // Required
- }
- resp, err := svc.SetIdentityFeedbackForwardingEnabled(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 ExampleSES_SetIdentityNotificationTopic() {
- svc := ses.New(nil)
- params := &ses.SetIdentityNotificationTopicInput{
- Identity: aws.String("Identity"), // Required
- NotificationType: aws.String("NotificationType"), // Required
- SnsTopic: aws.String("NotificationTopic"),
- }
- resp, err := svc.SetIdentityNotificationTopic(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 ExampleSES_VerifyDomainDkim() {
- svc := ses.New(nil)
- params := &ses.VerifyDomainDkimInput{
- Domain: aws.String("Domain"), // Required
- }
- resp, err := svc.VerifyDomainDkim(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 ExampleSES_VerifyDomainIdentity() {
- svc := ses.New(nil)
- params := &ses.VerifyDomainIdentityInput{
- Domain: aws.String("Domain"), // Required
- }
- resp, err := svc.VerifyDomainIdentity(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 ExampleSES_VerifyEmailAddress() {
- svc := ses.New(nil)
- params := &ses.VerifyEmailAddressInput{
- EmailAddress: aws.String("Address"), // Required
- }
- resp, err := svc.VerifyEmailAddress(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 ExampleSES_VerifyEmailIdentity() {
- svc := ses.New(nil)
- params := &ses.VerifyEmailIdentityInput{
- EmailAddress: aws.String("Address"), // Required
- }
- resp, err := svc.VerifyEmailIdentity(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)
- }
|