func ExampleCloudHSM_CreateLunaClient() { svc := cloudhsm.New(nil) params := &cloudhsm.CreateLunaClientInput{ Certificate: aws.String("Certificate"), // Required Label: aws.String("ClientLabel"), } resp, err := svc.CreateLunaClient(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 alwsy return an // error which satisfies the awserr.Error interface. fmt.Println(err.Error()) } } // Pretty-print the response data. fmt.Println(awsutil.StringValue(resp)) }
func ExampleCloudHSM_ModifyHSM() { svc := cloudhsm.New(nil) params := &cloudhsm.ModifyHSMInput{ HSMARN: aws.String("HsmArn"), // Required ENIIP: aws.String("IpAddress"), ExternalID: aws.String("ExternalId"), IAMRoleARN: aws.String("IamRoleArn"), SubnetID: aws.String("SubnetId"), SyslogIP: aws.String("IpAddress"), } resp, err := svc.ModifyHSM(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 alwsy return an // error which satisfies the awserr.Error interface. fmt.Println(err.Error()) } } // Pretty-print the response data. fmt.Println(awsutil.StringValue(resp)) }
func ExampleCloudHSM_ModifyHAPG() { svc := cloudhsm.New(nil) params := &cloudhsm.ModifyHAPGInput{ HAPGARN: aws.String("HapgArn"), // Required Label: aws.String("Label"), PartitionSerialList: []*string{ aws.String("PartitionSerial"), // Required // More values... }, } resp, err := svc.ModifyHAPG(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 alwsy return an // error which satisfies the awserr.Error interface. fmt.Println(err.Error()) } } // Pretty-print the response data. fmt.Println(awsutil.StringValue(resp)) }
func ExampleCloudHSM_ListHapgs() { svc := cloudhsm.New(nil) params := &cloudhsm.ListHapgsInput{ NextToken: aws.String("PaginationToken"), } resp, err := svc.ListHapgs(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 alwsy return an // error which satisfies the awserr.Error interface. fmt.Println(err.Error()) } } // Pretty-print the response data. fmt.Println(awsutil.StringValue(resp)) }
func init() { Before("@cloudhsm", func() { World["client"] = cloudhsm.New(nil) }) }
func TestInterface(t *testing.T) { assert.Implements(t, (*cloudhsmiface.CloudHSMAPI)(nil), cloudhsm.New(nil)) }