本文整理汇总了Golang中github.com/gunosy/aws-sdk-go/aws/awsutil.Prettify函数的典型用法代码示例。如果您正苦于以下问题:Golang Prettify函数的具体用法?Golang Prettify怎么用?Golang Prettify使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了Prettify函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: compareObjects
func compareObjects(t *testing.T, expected interface{}, actual interface{}) {
if !reflect.DeepEqual(expected, actual) {
t.Errorf("\nExpected %s:\n%s\nActual %s:\n%s\n",
reflect.ValueOf(expected).Kind(),
awsutil.Prettify(expected),
reflect.ValueOf(actual).Kind(),
awsutil.Prettify(actual))
}
}
示例2: ExampleCognitoIdentity_GetOpenIDTokenForDeveloperIdentity
func ExampleCognitoIdentity_GetOpenIDTokenForDeveloperIdentity() {
svc := cognitoidentity.New(nil)
params := &cognitoidentity.GetOpenIDTokenForDeveloperIdentityInput{
IdentityPoolID: aws.String("IdentityPoolId"), // Required
Logins: map[string]*string{ // Required
"Key": aws.String("IdentityProviderToken"), // Required
// More values...
},
IdentityID: aws.String("IdentityId"),
TokenDuration: aws.Int64(1),
}
resp, err := svc.GetOpenIDTokenForDeveloperIdentity(params)
if err != nil {
if awsErr, ok := err.(awserr.Error); ok {
// Generic AWS error with Code, Message, and original error (if any)
fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr())
if reqErr, ok := err.(awserr.RequestFailure); ok {
// A service error occurred
fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID())
}
} else {
// This case should never be hit, the SDK should always return an
// error which satisfies the awserr.Error interface.
fmt.Println(err.Error())
}
}
// Pretty-print the response data.
fmt.Println(awsutil.Prettify(resp))
}
示例3: ExampleRoute53Domains_UpdateTagsForDomain
func ExampleRoute53Domains_UpdateTagsForDomain() {
svc := route53domains.New(nil)
params := &route53domains.UpdateTagsForDomainInput{
DomainName: aws.String("DomainName"), // Required
TagsToUpdate: []*route53domains.Tag{
{ // Required
Key: aws.String("TagKey"),
Value: aws.String("TagValue"),
},
// More values...
},
}
resp, err := svc.UpdateTagsForDomain(params)
if err != nil {
if awsErr, ok := err.(awserr.Error); ok {
// Generic AWS error with Code, Message, and original error (if any)
fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr())
if reqErr, ok := err.(awserr.RequestFailure); ok {
// A service error occurred
fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID())
}
} else {
// This case should never be hit, the SDK should always return an
// error which satisfies the awserr.Error interface.
fmt.Println(err.Error())
}
}
// Pretty-print the response data.
fmt.Println(awsutil.Prettify(resp))
}
示例4: ExampleCodePipeline_StartPipelineExecution
func ExampleCodePipeline_StartPipelineExecution() {
svc := codepipeline.New(nil)
params := &codepipeline.StartPipelineExecutionInput{
Name: aws.String("PipelineName"), // Required
}
resp, err := svc.StartPipelineExecution(params)
if err != nil {
if awsErr, ok := err.(awserr.Error); ok {
// Generic AWS error with Code, Message, and original error (if any)
fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr())
if reqErr, ok := err.(awserr.RequestFailure); ok {
// A service error occurred
fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID())
}
} else {
// This case should never be hit, the SDK should always return an
// error which satisfies the awserr.Error interface.
fmt.Println(err.Error())
}
}
// Pretty-print the response data.
fmt.Println(awsutil.Prettify(resp))
}
示例5: ExampleCodePipeline_PollForThirdPartyJobs
func ExampleCodePipeline_PollForThirdPartyJobs() {
svc := codepipeline.New(nil)
params := &codepipeline.PollForThirdPartyJobsInput{
ActionTypeID: &codepipeline.ActionTypeID{ // Required
Category: aws.String("ActionCategory"), // Required
Owner: aws.String("ActionOwner"), // Required
Provider: aws.String("ActionProvider"), // Required
Version: aws.String("Version"), // Required
},
MaxBatchSize: aws.Int64(1),
}
resp, err := svc.PollForThirdPartyJobs(params)
if err != nil {
if awsErr, ok := err.(awserr.Error); ok {
// Generic AWS error with Code, Message, and original error (if any)
fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr())
if reqErr, ok := err.(awserr.RequestFailure); ok {
// A service error occurred
fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID())
}
} else {
// This case should never be hit, the SDK should always return an
// error which satisfies the awserr.Error interface.
fmt.Println(err.Error())
}
}
// Pretty-print the response data.
fmt.Println(awsutil.Prettify(resp))
}
示例6: ExampleCloudSearch_UpdateScalingParameters
func ExampleCloudSearch_UpdateScalingParameters() {
svc := cloudsearch.New(nil)
params := &cloudsearch.UpdateScalingParametersInput{
DomainName: aws.String("DomainName"), // Required
ScalingParameters: &cloudsearch.ScalingParameters{ // Required
DesiredInstanceType: aws.String("PartitionInstanceType"),
DesiredPartitionCount: aws.Int64(1),
DesiredReplicationCount: aws.Int64(1),
},
}
resp, err := svc.UpdateScalingParameters(params)
if err != nil {
if awsErr, ok := err.(awserr.Error); ok {
// Generic AWS error with Code, Message, and original error (if any)
fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr())
if reqErr, ok := err.(awserr.RequestFailure); ok {
// A service error occurred
fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID())
}
} else {
// This case should never be hit, the SDK should always return an
// error which satisfies the awserr.Error interface.
fmt.Println(err.Error())
}
}
// Pretty-print the response data.
fmt.Println(awsutil.Prettify(resp))
}
示例7: ExampleCloudSearch_DefineSuggester
func ExampleCloudSearch_DefineSuggester() {
svc := cloudsearch.New(nil)
params := &cloudsearch.DefineSuggesterInput{
DomainName: aws.String("DomainName"), // Required
Suggester: &cloudsearch.Suggester{ // Required
DocumentSuggesterOptions: &cloudsearch.DocumentSuggesterOptions{ // Required
SourceField: aws.String("FieldName"), // Required
FuzzyMatching: aws.String("SuggesterFuzzyMatching"),
SortExpression: aws.String("String"),
},
SuggesterName: aws.String("StandardName"), // Required
},
}
resp, err := svc.DefineSuggester(params)
if err != nil {
if awsErr, ok := err.(awserr.Error); ok {
// Generic AWS error with Code, Message, and original error (if any)
fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr())
if reqErr, ok := err.(awserr.RequestFailure); ok {
// A service error occurred
fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID())
}
} else {
// This case should never be hit, the SDK should always return an
// error which satisfies the awserr.Error interface.
fmt.Println(err.Error())
}
}
// Pretty-print the response data.
fmt.Println(awsutil.Prettify(resp))
}
示例8: ExampleEMR_ListInstances
func ExampleEMR_ListInstances() {
svc := emr.New(nil)
params := &emr.ListInstancesInput{
ClusterID: aws.String("ClusterId"), // Required
InstanceGroupID: aws.String("InstanceGroupId"),
InstanceGroupTypes: []*string{
aws.String("InstanceGroupType"), // Required
// More values...
},
Marker: aws.String("Marker"),
}
resp, err := svc.ListInstances(params)
if err != nil {
if awsErr, ok := err.(awserr.Error); ok {
// Generic AWS error with Code, Message, and original error (if any)
fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr())
if reqErr, ok := err.(awserr.RequestFailure); ok {
// A service error occurred
fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID())
}
} else {
// This case should never be hit, the SDK should always return an
// error which satisfies the awserr.Error interface.
fmt.Println(err.Error())
}
}
// Pretty-print the response data.
fmt.Println(awsutil.Prettify(resp))
}
示例9: ExampleStorageGateway_ActivateGateway
func ExampleStorageGateway_ActivateGateway() {
svc := storagegateway.New(nil)
params := &storagegateway.ActivateGatewayInput{
ActivationKey: aws.String("ActivationKey"), // Required
GatewayName: aws.String("GatewayName"), // Required
GatewayRegion: aws.String("RegionId"), // Required
GatewayTimezone: aws.String("GatewayTimezone"), // Required
GatewayType: aws.String("GatewayType"),
MediumChangerType: aws.String("MediumChangerType"),
TapeDriveType: aws.String("TapeDriveType"),
}
resp, err := svc.ActivateGateway(params)
if err != nil {
if awsErr, ok := err.(awserr.Error); ok {
// Generic AWS error with Code, Message, and original error (if any)
fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr())
if reqErr, ok := err.(awserr.RequestFailure); ok {
// A service error occurred
fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID())
}
} else {
// This case should never be hit, the SDK should always return an
// error which satisfies the awserr.Error interface.
fmt.Println(err.Error())
}
}
// Pretty-print the response data.
fmt.Println(awsutil.Prettify(resp))
}
示例10: ExampleStorageGateway_UpdateMaintenanceStartTime
func ExampleStorageGateway_UpdateMaintenanceStartTime() {
svc := storagegateway.New(nil)
params := &storagegateway.UpdateMaintenanceStartTimeInput{
DayOfWeek: aws.Int64(1), // Required
GatewayARN: aws.String("GatewayARN"), // Required
HourOfDay: aws.Int64(1), // Required
MinuteOfHour: aws.Int64(1), // Required
}
resp, err := svc.UpdateMaintenanceStartTime(params)
if err != nil {
if awsErr, ok := err.(awserr.Error); ok {
// Generic AWS error with Code, Message, and original error (if any)
fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr())
if reqErr, ok := err.(awserr.RequestFailure); ok {
// A service error occurred
fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID())
}
} else {
// This case should never be hit, the SDK should always return an
// error which satisfies the awserr.Error interface.
fmt.Println(err.Error())
}
}
// Pretty-print the response data.
fmt.Println(awsutil.Prettify(resp))
}
示例11: ExampleStorageGateway_UpdateChapCredentials
func ExampleStorageGateway_UpdateChapCredentials() {
svc := storagegateway.New(nil)
params := &storagegateway.UpdateChapCredentialsInput{
InitiatorName: aws.String("IqnName"), // Required
SecretToAuthenticateInitiator: aws.String("ChapSecret"), // Required
TargetARN: aws.String("TargetARN"), // Required
SecretToAuthenticateTarget: aws.String("ChapSecret"),
}
resp, err := svc.UpdateChapCredentials(params)
if err != nil {
if awsErr, ok := err.(awserr.Error); ok {
// Generic AWS error with Code, Message, and original error (if any)
fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr())
if reqErr, ok := err.(awserr.RequestFailure); ok {
// A service error occurred
fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID())
}
} else {
// This case should never be hit, the SDK should always return an
// error which satisfies the awserr.Error interface.
fmt.Println(err.Error())
}
}
// Pretty-print the response data.
fmt.Println(awsutil.Prettify(resp))
}
示例12: ExampleStorageGateway_UpdateBandwidthRateLimit
func ExampleStorageGateway_UpdateBandwidthRateLimit() {
svc := storagegateway.New(nil)
params := &storagegateway.UpdateBandwidthRateLimitInput{
GatewayARN: aws.String("GatewayARN"), // Required
AverageDownloadRateLimitInBitsPerSec: aws.Int64(1),
AverageUploadRateLimitInBitsPerSec: aws.Int64(1),
}
resp, err := svc.UpdateBandwidthRateLimit(params)
if err != nil {
if awsErr, ok := err.(awserr.Error); ok {
// Generic AWS error with Code, Message, and original error (if any)
fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr())
if reqErr, ok := err.(awserr.RequestFailure); ok {
// A service error occurred
fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID())
}
} else {
// This case should never be hit, the SDK should always return an
// error which satisfies the awserr.Error interface.
fmt.Println(err.Error())
}
}
// Pretty-print the response data.
fmt.Println(awsutil.Prettify(resp))
}
示例13: ExampleCognitoIdentity_DeleteIdentities
func ExampleCognitoIdentity_DeleteIdentities() {
svc := cognitoidentity.New(nil)
params := &cognitoidentity.DeleteIdentitiesInput{
IdentityIDsToDelete: []*string{ // Required
aws.String("IdentityId"), // Required
// More values...
},
}
resp, err := svc.DeleteIdentities(params)
if err != nil {
if awsErr, ok := err.(awserr.Error); ok {
// Generic AWS error with Code, Message, and original error (if any)
fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr())
if reqErr, ok := err.(awserr.RequestFailure); ok {
// A service error occurred
fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID())
}
} else {
// This case should never be hit, the SDK should always return an
// error which satisfies the awserr.Error interface.
fmt.Println(err.Error())
}
}
// Pretty-print the response data.
fmt.Println(awsutil.Prettify(resp))
}
示例14: ExampleCognitoIdentity_UnlinkDeveloperIdentity
func ExampleCognitoIdentity_UnlinkDeveloperIdentity() {
svc := cognitoidentity.New(nil)
params := &cognitoidentity.UnlinkDeveloperIdentityInput{
DeveloperProviderName: aws.String("DeveloperProviderName"), // Required
DeveloperUserIdentifier: aws.String("DeveloperUserIdentifier"), // Required
IdentityID: aws.String("IdentityId"), // Required
IdentityPoolID: aws.String("IdentityPoolId"), // Required
}
resp, err := svc.UnlinkDeveloperIdentity(params)
if err != nil {
if awsErr, ok := err.(awserr.Error); ok {
// Generic AWS error with Code, Message, and original error (if any)
fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr())
if reqErr, ok := err.(awserr.RequestFailure); ok {
// A service error occurred
fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID())
}
} else {
// This case should never be hit, the SDK should always return an
// error which satisfies the awserr.Error interface.
fmt.Println(err.Error())
}
}
// Pretty-print the response data.
fmt.Println(awsutil.Prettify(resp))
}
示例15: ExampleCognitoIdentity_ListIdentityPools
func ExampleCognitoIdentity_ListIdentityPools() {
svc := cognitoidentity.New(nil)
params := &cognitoidentity.ListIdentityPoolsInput{
MaxResults: aws.Int64(1), // Required
NextToken: aws.String("PaginationKey"),
}
resp, err := svc.ListIdentityPools(params)
if err != nil {
if awsErr, ok := err.(awserr.Error); ok {
// Generic AWS error with Code, Message, and original error (if any)
fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr())
if reqErr, ok := err.(awserr.RequestFailure); ok {
// A service error occurred
fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID())
}
} else {
// This case should never be hit, the SDK should always return an
// error which satisfies the awserr.Error interface.
fmt.Println(err.Error())
}
}
// Pretty-print the response data.
fmt.Println(awsutil.Prettify(resp))
}