// To delete a rule
//
// This example deletes the specified rule.
To delete a rule

This example deletes the specified rule.
// To delete a rule // // This example deletes the specified rule .
func ExampleELBV2_DeleteRule_shared00() {
	svc := elbv2.New(session.New())
	input := &elbv2.DeleteRuleInput{
		RuleArn: aws.String("arn:aws:elasticloadbalancing:us-west-2:123456789012:listener-rule/app/my-load-balancer/50dc6c495c0c9188/f2f7dc8efc522ab2/1291d13826f405c3"),
	}
	result, err := svc.DeleteRule(input)
	if err != nil {
		if aerr, ok := err.(awserr.Error); ok {
			switch aerr.Code() {
			case elbv2.ErrCodeRuleNotFoundException:
				fmt.Println(elbv2.ErrCodeRuleNotFoundException, aerr.Error())
			case elbv2.ErrCodeOperationNotPermittedException:
				fmt.Println(elbv2.ErrCodeOperationNotPermittedException, aerr.Error())
			default:
				fmt.Println(aerr.Error())
			}
		} else {
			fmt.Println(err.Error())
		}
		return
	}
	fmt.Println(result)
}
func ExampleELBV2_DeleteRule_shared00 ( ) { svc := elbv2 . New ( session . New ( ) ) input := & elbv2 . DeleteRuleInput { RuleArn : aws . String ( " " ) , } result , err := svc . DeleteRule ( input ) if err != nil { if aerr , ok := err . ( awserr . Error ) ; ok { switch aerr . Code ( ) { case elbv2 . ErrCodeRuleNotFoundException : fmt . Println ( elbv2 . ErrCodeRuleNotFoundException , aerr . Error ( ) ) case elbv2 . ErrCodeOperationNotPermittedException : fmt . Println ( elbv2 . ErrCodeOperationNotPermittedException , aerr . Error ( ) ) default : fmt . Println ( aerr . Error ( ) ) } } else { fmt . Println ( err . Error ( ) ) } return } fmt . Println ( result ) }
To delete a rule
To delete a rule
// Print the error, cast err to awserr.Error to get the Code and // Message from an error.