func ExampleELBV2_ModifyRule_shared00() {
	svc := elbv2.New(session.New())
	input := &elbv2.ModifyRuleInput{
		Conditions: []*elbv2.RuleCondition{
			{
				Field: aws.String("path-pattern"),
				Values: []*string{
					aws.String("/images/*"),
				},
			},
		},
		RuleArn: aws.String("arn:aws:elasticloadbalancing:us-west-2:123456789012:listener-rule/app/my-load-balancer/50dc6c495c0c9188/f2f7dc8efc522ab2/9683b2d02a6cabee"),
	}

	result, err := svc.ModifyRule(input)
	if err != nil {
		if aerr, ok := err.(awserr.Error); ok {
			switch aerr.Code() {
			case elbv2.ErrCodeTargetGroupAssociationLimitException:
				fmt.Println(elbv2.ErrCodeTargetGroupAssociationLimitException, aerr.Error())
			case elbv2.ErrCodeIncompatibleProtocolsException:
				fmt.Println(elbv2.ErrCodeIncompatibleProtocolsException, aerr.Error())
			case elbv2.ErrCodeRuleNotFoundException:
				fmt.Println(elbv2.ErrCodeRuleNotFoundException, aerr.Error())
			case elbv2.ErrCodeOperationNotPermittedException:
				fmt.Println(elbv2.ErrCodeOperationNotPermittedException, aerr.Error())
			case elbv2.ErrCodeTooManyRegistrationsForTargetIdException:
				fmt.Println(elbv2.ErrCodeTooManyRegistrationsForTargetIdException, aerr.Error())
			case elbv2.ErrCodeTooManyTargetsException:
				fmt.Println(elbv2.ErrCodeTooManyTargetsException, aerr.Error())
			case elbv2.ErrCodeTargetGroupNotFoundException:
				fmt.Println(elbv2.ErrCodeTargetGroupNotFoundException, aerr.Error())
			case elbv2.ErrCodeUnsupportedProtocolException:
				fmt.Println(elbv2.ErrCodeUnsupportedProtocolException, aerr.Error())
			case elbv2.ErrCodeTooManyActionsException:
				fmt.Println(elbv2.ErrCodeTooManyActionsException, aerr.Error())
			case elbv2.ErrCodeInvalidLoadBalancerActionException:
				fmt.Println(elbv2.ErrCodeInvalidLoadBalancerActionException, aerr.Error())
			case elbv2.ErrCodeTooManyUniqueTargetGroupsPerLoadBalancerException:
				fmt.Println(elbv2.ErrCodeTooManyUniqueTargetGroupsPerLoadBalancerException, aerr.Error())
			default:
				fmt.Println(aerr.Error())
			}
		} else {
			// Print the error, cast err to awserr.Error to get the Code and
			// Message from an error.
			fmt.Println(err.Error())
		}
		return
	}

	fmt.Println(result)
}
// To modify a rule
//
// This example modifies the condition for the specified rule.
To modify a rule

This example modifies the condition for the specified rule.
// To modify a rule // // This example modifies the condition for the specified rule .
func ExampleELBV2_ModifyRule_shared00() {
	svc := elbv2.New(session.New())
	input := &elbv2.ModifyRuleInput{
		Conditions: []*elbv2.RuleCondition{
			{
				Field: aws.String("path-pattern"),
				Values: []*string{
					aws.String("/images/*"),
				},
			},
		},
		RuleArn: aws.String("arn:aws:elasticloadbalancing:us-west-2:123456789012:listener-rule/app/my-load-balancer/50dc6c495c0c9188/f2f7dc8efc522ab2/9683b2d02a6cabee"),
	}
	result, err := svc.ModifyRule(input)
	if err != nil {
		if aerr, ok := err.(awserr.Error); ok {
			switch aerr.Code() {
			case elbv2.ErrCodeTargetGroupAssociationLimitException:
				fmt.Println(elbv2.ErrCodeTargetGroupAssociationLimitException, aerr.Error())
			case elbv2.ErrCodeIncompatibleProtocolsException:
				fmt.Println(elbv2.ErrCodeIncompatibleProtocolsException, aerr.Error())
			case elbv2.ErrCodeRuleNotFoundException:
				fmt.Println(elbv2.ErrCodeRuleNotFoundException, aerr.Error())
			case elbv2.ErrCodeOperationNotPermittedException:
				fmt.Println(elbv2.ErrCodeOperationNotPermittedException, aerr.Error())
			case elbv2.ErrCodeTooManyRegistrationsForTargetIdException:
				fmt.Println(elbv2.ErrCodeTooManyRegistrationsForTargetIdException, aerr.Error())
			case elbv2.ErrCodeTooManyTargetsException:
				fmt.Println(elbv2.ErrCodeTooManyTargetsException, aerr.Error())
			case elbv2.ErrCodeTargetGroupNotFoundException:
				fmt.Println(elbv2.ErrCodeTargetGroupNotFoundException, aerr.Error())
			case elbv2.ErrCodeUnsupportedProtocolException:
				fmt.Println(elbv2.ErrCodeUnsupportedProtocolException, aerr.Error())
			case elbv2.ErrCodeTooManyActionsException:
				fmt.Println(elbv2.ErrCodeTooManyActionsException, aerr.Error())
			case elbv2.ErrCodeInvalidLoadBalancerActionException:
				fmt.Println(elbv2.ErrCodeInvalidLoadBalancerActionException, aerr.Error())
			case elbv2.ErrCodeTooManyUniqueTargetGroupsPerLoadBalancerException:
				fmt.Println(elbv2.ErrCodeTooManyUniqueTargetGroupsPerLoadBalancerException, aerr.Error())
			default:
				fmt.Println(aerr.Error())
			}
		} else {
			fmt.Println(err.Error())
		}
		return
	}
	fmt.Println(result)
}
func ExampleELBV2_ModifyRule_shared00 ( ) { svc := elbv2 . New ( session . New ( ) ) input := & elbv2 . ModifyRuleInput { Conditions : [ ] * elbv2 . RuleCondition { { Field : aws . String ( " " ) , Values : [ ] * string { aws . String ( " " ) , } , } , } , RuleArn : aws . String ( " " ) , } result , err := svc . ModifyRule ( input ) if err != nil { if aerr , ok := err . ( awserr . Error ) ; ok { switch aerr . Code ( ) { case elbv2 . ErrCodeTargetGroupAssociationLimitException : fmt . Println ( elbv2 . ErrCodeTargetGroupAssociationLimitException , aerr . Error ( ) ) case elbv2 . ErrCodeIncompatibleProtocolsException : fmt . Println ( elbv2 . ErrCodeIncompatibleProtocolsException , aerr . Error ( ) ) case elbv2 . ErrCodeRuleNotFoundException : fmt . Println ( elbv2 . ErrCodeRuleNotFoundException , aerr . Error ( ) ) case elbv2 . ErrCodeOperationNotPermittedException : fmt . Println ( elbv2 . ErrCodeOperationNotPermittedException , aerr . Error ( ) ) case elbv2 . ErrCodeTooManyRegistrationsForTargetIdException : fmt . Println ( elbv2 . ErrCodeTooManyRegistrationsForTargetIdException , aerr . Error ( ) ) case elbv2 . ErrCodeTooManyTargetsException : fmt . Println ( elbv2 . ErrCodeTooManyTargetsException , aerr . Error ( ) ) case elbv2 . ErrCodeTargetGroupNotFoundException : fmt . Println ( elbv2 . ErrCodeTargetGroupNotFoundException , aerr . Error ( ) ) case elbv2 . ErrCodeUnsupportedProtocolException : fmt . Println ( elbv2 . ErrCodeUnsupportedProtocolException , aerr . Error ( ) ) case elbv2 . ErrCodeTooManyActionsException : fmt . Println ( elbv2 . ErrCodeTooManyActionsException , aerr . Error ( ) ) case elbv2 . ErrCodeInvalidLoadBalancerActionException : fmt . Println ( elbv2 . ErrCodeInvalidLoadBalancerActionException , aerr . Error ( ) ) case elbv2 . ErrCodeTooManyUniqueTargetGroupsPerLoadBalancerException : fmt . Println ( elbv2 . ErrCodeTooManyUniqueTargetGroupsPerLoadBalancerException , aerr . Error ( ) ) default : fmt . Println ( aerr . Error ( ) ) } } else { fmt . Println ( err . Error ( ) ) } return } fmt . Println ( result ) }
To modify a rule
To modify a rule
// Print the error, cast err to awserr.Error to get the Code and // Message from an error.