123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356 |
- // THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
- package snowball_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/snowball"
- )
- var _ time.Duration
- var _ bytes.Buffer
- func ExampleSnowball_CancelJob() {
- sess, err := session.NewSession()
- if err != nil {
- fmt.Println("failed to create session,", err)
- return
- }
- svc := snowball.New(sess)
- params := &snowball.CancelJobInput{
- JobId: aws.String("JobId"), // Required
- }
- resp, err := svc.CancelJob(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 ExampleSnowball_CreateAddress() {
- sess, err := session.NewSession()
- if err != nil {
- fmt.Println("failed to create session,", err)
- return
- }
- svc := snowball.New(sess)
- params := &snowball.CreateAddressInput{
- Address: &snowball.Address{ // Required
- AddressId: aws.String("AddressId"),
- City: aws.String("String"),
- Company: aws.String("String"),
- Country: aws.String("String"),
- Landmark: aws.String("String"),
- Name: aws.String("String"),
- PhoneNumber: aws.String("String"),
- PostalCode: aws.String("String"),
- PrefectureOrDistrict: aws.String("String"),
- StateOrProvince: aws.String("String"),
- Street1: aws.String("String"),
- Street2: aws.String("String"),
- Street3: aws.String("String"),
- },
- }
- resp, err := svc.CreateAddress(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 ExampleSnowball_CreateJob() {
- sess, err := session.NewSession()
- if err != nil {
- fmt.Println("failed to create session,", err)
- return
- }
- svc := snowball.New(sess)
- params := &snowball.CreateJobInput{
- AddressId: aws.String("AddressId"), // Required
- JobType: aws.String("JobType"), // Required
- Resources: &snowball.JobResource{ // Required
- S3Resources: []*snowball.S3Resource{
- { // Required
- BucketArn: aws.String("ResourceARN"),
- KeyRange: &snowball.KeyRange{
- BeginMarker: aws.String("String"),
- EndMarker: aws.String("String"),
- },
- },
- // More values...
- },
- },
- RoleARN: aws.String("RoleARN"), // Required
- ShippingOption: aws.String("ShippingOption"), // Required
- Description: aws.String("String"),
- KmsKeyARN: aws.String("KmsKeyARN"),
- Notification: &snowball.Notification{
- JobStatesToNotify: []*string{
- aws.String("JobState"), // Required
- // More values...
- },
- NotifyAll: aws.Bool(true),
- SnsTopicARN: aws.String("SnsTopicARN"),
- },
- SnowballCapacityPreference: aws.String("Capacity"),
- }
- resp, err := svc.CreateJob(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 ExampleSnowball_DescribeAddress() {
- sess, err := session.NewSession()
- if err != nil {
- fmt.Println("failed to create session,", err)
- return
- }
- svc := snowball.New(sess)
- params := &snowball.DescribeAddressInput{
- AddressId: aws.String("AddressId"), // Required
- }
- resp, err := svc.DescribeAddress(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 ExampleSnowball_DescribeAddresses() {
- sess, err := session.NewSession()
- if err != nil {
- fmt.Println("failed to create session,", err)
- return
- }
- svc := snowball.New(sess)
- params := &snowball.DescribeAddressesInput{
- MaxResults: aws.Int64(1),
- NextToken: aws.String("String"),
- }
- resp, err := svc.DescribeAddresses(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 ExampleSnowball_DescribeJob() {
- sess, err := session.NewSession()
- if err != nil {
- fmt.Println("failed to create session,", err)
- return
- }
- svc := snowball.New(sess)
- params := &snowball.DescribeJobInput{
- JobId: aws.String("JobId"), // Required
- }
- resp, err := svc.DescribeJob(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 ExampleSnowball_GetJobManifest() {
- sess, err := session.NewSession()
- if err != nil {
- fmt.Println("failed to create session,", err)
- return
- }
- svc := snowball.New(sess)
- params := &snowball.GetJobManifestInput{
- JobId: aws.String("JobId"), // Required
- }
- resp, err := svc.GetJobManifest(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 ExampleSnowball_GetJobUnlockCode() {
- sess, err := session.NewSession()
- if err != nil {
- fmt.Println("failed to create session,", err)
- return
- }
- svc := snowball.New(sess)
- params := &snowball.GetJobUnlockCodeInput{
- JobId: aws.String("JobId"), // Required
- }
- resp, err := svc.GetJobUnlockCode(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 ExampleSnowball_GetSnowballUsage() {
- sess, err := session.NewSession()
- if err != nil {
- fmt.Println("failed to create session,", err)
- return
- }
- svc := snowball.New(sess)
- var params *snowball.GetSnowballUsageInput
- resp, err := svc.GetSnowballUsage(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 ExampleSnowball_ListJobs() {
- sess, err := session.NewSession()
- if err != nil {
- fmt.Println("failed to create session,", err)
- return
- }
- svc := snowball.New(sess)
- params := &snowball.ListJobsInput{
- MaxResults: aws.Int64(1),
- NextToken: aws.String("String"),
- }
- resp, err := svc.ListJobs(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 ExampleSnowball_UpdateJob() {
- sess, err := session.NewSession()
- if err != nil {
- fmt.Println("failed to create session,", err)
- return
- }
- svc := snowball.New(sess)
- params := &snowball.UpdateJobInput{
- JobId: aws.String("JobId"), // Required
- AddressId: aws.String("AddressId"),
- Description: aws.String("String"),
- Notification: &snowball.Notification{
- JobStatesToNotify: []*string{
- aws.String("JobState"), // Required
- // More values...
- },
- NotifyAll: aws.Bool(true),
- SnsTopicARN: aws.String("SnsTopicARN"),
- },
- Resources: &snowball.JobResource{
- S3Resources: []*snowball.S3Resource{
- { // Required
- BucketArn: aws.String("ResourceARN"),
- KeyRange: &snowball.KeyRange{
- BeginMarker: aws.String("String"),
- EndMarker: aws.String("String"),
- },
- },
- // More values...
- },
- },
- RoleARN: aws.String("RoleARN"),
- ShippingOption: aws.String("ShippingOption"),
- SnowballCapacityPreference: aws.String("Capacity"),
- }
- resp, err := svc.UpdateJob(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)
- }
|