Skip to content

Commit

Permalink
Progress...
Browse files Browse the repository at this point in the history
  • Loading branch information
WodansSon committed Dec 29, 2024
1 parent 7fe9e5d commit 5c36ca9
Show file tree
Hide file tree
Showing 128 changed files with 8,907 additions and 725 deletions.
71 changes: 39 additions & 32 deletions internal/services/cdn/cdn_frontdoor_rule_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ import (
"fmt"
"time"

"github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2020-09-01/cdn"
"github.com/hashicorp/go-azure-helpers/lang/pointer"
"github.com/hashicorp/go-azure-helpers/lang/response"
"github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/rules"
"github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/rulesets"
"github.com/hashicorp/terraform-provider-azurerm/helpers/tf"
"github.com/hashicorp/terraform-provider-azurerm/internal/clients"
cdnFrontDoorConditionDiscriminator "github.com/hashicorp/terraform-provider-azurerm/internal/services/cdn/frontdoordeliveryruleconditiondiscriminator"
cdnFrontDoorRuleActions "github.com/hashicorp/terraform-provider-azurerm/internal/services/cdn/frontdoorruleactions"
cdnFrontDoorRuleConditions "github.com/hashicorp/terraform-provider-azurerm/internal/services/cdn/frontdoorruleconditions"
"github.com/hashicorp/terraform-provider-azurerm/internal/services/cdn/validate"
Expand Down Expand Up @@ -652,7 +652,7 @@ func resourceCdnFrontDoorRuleCreate(d *pluginsdk.ResourceData, meta interface{})
Actions: &actions,
Conditions: &conditions,
MatchProcessingBehavior: matchProcessingBehaviorValue,
RuleSetName: &ruleSet.RuleSetName,
RuleSetName: &ruleSetId.RuleSetName,
Order: order,
},
}
Expand Down Expand Up @@ -761,7 +761,7 @@ func resourceCdnFrontDoorRuleUpdate(d *pluginsdk.ResourceData, meta interface{})
params.Properties.Conditions = &conditions
}

err = client.UpdateThenPoll(ctx, id, params)
err = client.UpdateThenPoll(ctx, *id, params)
if err != nil {
return fmt.Errorf("updating %s: %+v", *id, err)
}
Expand All @@ -779,7 +779,7 @@ func resourceCdnFrontDoorRuleDelete(d *pluginsdk.ResourceData, meta interface{})
return err
}

err = client.DeleteThenPoll(ctx, id)
err = client.DeleteThenPoll(ctx, *id)
if err != nil {
return fmt.Errorf("deleting %s: %+v", *id, err)
}
Expand All @@ -788,12 +788,12 @@ func resourceCdnFrontDoorRuleDelete(d *pluginsdk.ResourceData, meta interface{})
}

func expandFrontdoorDeliveryRuleActions(input []interface{}) ([]rules.DeliveryRuleAction, error) {
results := make([]cdn.BasicDeliveryRuleAction, 0)
results := make([]rules.DeliveryRuleAction, 0)
if len(input) == 0 {
return results, nil
}

type expandfunc func(input []interface{}) (*[]cdn.BasicDeliveryRuleAction, error)
type expandfunc func(input []interface{}) (*[]rules.DeliveryRuleAction, error)

m := *cdnFrontDoorRuleActions.InitializeCdnFrontDoorActionMappings()

Expand Down Expand Up @@ -842,13 +842,13 @@ func expandFrontdoorDeliveryRuleActions(input []interface{}) ([]rules.DeliveryRu
return results, nil
}

func expandFrontdoorDeliveryRuleConditions(input []interface{}) ([]cdn.BasicDeliveryRuleCondition, error) {
results := make([]cdn.BasicDeliveryRuleCondition, 0)
func expandFrontdoorDeliveryRuleConditions(input []interface{}) ([]rules.DeliveryRuleCondition, error) {
results := make([]rules.DeliveryRuleCondition, 0)
if len(input) == 0 || input[0] == nil {
return results, nil
}

type expandfunc func(input []interface{}) (*[]cdn.BasicDeliveryRuleCondition, error)
type expandfunc func(input []interface{}) (*[]rules.DeliveryRuleCondition, error)
m := cdnFrontDoorRuleConditions.InitializeCdnFrontDoorConditionMappings()

conditions := map[string]expandfunc{
Expand All @@ -873,10 +873,10 @@ func expandFrontdoorDeliveryRuleConditions(input []interface{}) ([]cdn.BasicDeli
m.UrlPath.ConfigName: cdnFrontDoorRuleConditions.ExpandCdnFrontDoorUrlPathCondition,
}

basicDeliveryRuleCondition := input[0].(map[string]interface{})
deliveryRuleCondition := input[0].(map[string]interface{})

for conditionName, expand := range conditions {
raw := basicDeliveryRuleCondition[conditionName].([]interface{})
raw := deliveryRuleCondition[conditionName].([]interface{})
if len(raw) > 0 {
expanded, err := expand(raw)
if err != nil {
Expand Down Expand Up @@ -924,9 +924,16 @@ func flattenFrontdoorDeliveryRuleConditions(input *[]rules.DeliveryRuleCondition
urlFilenameCondition := make([]interface{}, 0)
urlPathCondition := make([]interface{}, 0)

for _, BasicDeliveryRuleCondition := range *input {
if condition, ok := BasicDeliveryRuleCondition.AsDeliveryRuleClientPortCondition(); ok {
flattened, err := cdnFrontDoorRuleConditions.FlattenFrontdoorClientPortCondition(condition)
// input here is the base wrapper object that has all of the data from the model...
for _, deliveryRuleCondition := range *input {

if params, ok := cdnFrontDoorConditionDiscriminator.AsDeliveryRuleClientPortCondition(deliveryRuleCondition); ok {

condition := rules.DeliveryRuleClientPortCondition{
Name: rules.MatchVariableClientPort,
}

flattened, err := cdnFrontDoorRuleConditions.FlattenFrontdoorClientPortCondition(deliveryRuleCondition)

Check failure on line 936 in internal/services/cdn/cdn_frontdoor_rule_resource.go

View workflow job for this annotation

GitHub Actions / tflint

cannot use deliveryRuleCondition (variable of type "github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/rules".DeliveryRuleCondition) as *"github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/rules".DeliveryRuleClientPortCondition value in argument to cdnFrontDoorRuleConditions.FlattenFrontdoorClientPortCondition: need type assertion

Check failure on line 936 in internal/services/cdn/cdn_frontdoor_rule_resource.go

View workflow job for this annotation

GitHub Actions / detect

cannot use deliveryRuleCondition (variable of type "github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/rules".DeliveryRuleCondition) as *"github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/rules".DeliveryRuleClientPortCondition value in argument to cdnFrontDoorRuleConditions.FlattenFrontdoorClientPortCondition: need type assertion

Check failure on line 936 in internal/services/cdn/cdn_frontdoor_rule_resource.go

View workflow job for this annotation

GitHub Actions / golint

cannot use deliveryRuleCondition (variable of type "github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/rules".DeliveryRuleCondition) as *"github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/rules".DeliveryRuleClientPortCondition value in argument to cdnFrontDoorRuleConditions.FlattenFrontdoorClientPortCondition: need type assertion

Check failure on line 936 in internal/services/cdn/cdn_frontdoor_rule_resource.go

View workflow job for this annotation

GitHub Actions / document-lint

cannot use deliveryRuleCondition (variable of type "github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/rules".DeliveryRuleCondition) as *"github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/rules".DeliveryRuleClientPortCondition value in argument to cdnFrontDoorRuleConditions.FlattenFrontdoorClientPortCondition: need type assertion

Check failure on line 936 in internal/services/cdn/cdn_frontdoor_rule_resource.go

View workflow job for this annotation

GitHub Actions / compatibility-32bit-test

cannot use deliveryRuleCondition (variable of type "github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/rules".DeliveryRuleCondition) as *"github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/rules".DeliveryRuleClientPortCondition value in argument to cdnFrontDoorRuleConditions.FlattenFrontdoorClientPortCondition: need type assertion
if err != nil {
return nil, err
}
Expand All @@ -935,7 +942,7 @@ func flattenFrontdoorDeliveryRuleConditions(input *[]rules.DeliveryRuleCondition
continue
}

if condition, ok := BasicDeliveryRuleCondition.AsDeliveryRuleCookiesCondition(); ok {
if condition, ok := cdnFrontDoorConditionDiscriminator.AsDeliveryRuleCookiesCondition(deliveryRuleCondition); ok {
flattened, err := cdnFrontDoorRuleConditions.FlattenFrontdoorCookiesCondition(condition)

Check failure on line 946 in internal/services/cdn/cdn_frontdoor_rule_resource.go

View workflow job for this annotation

GitHub Actions / tflint

cannot use condition (variable of type *"github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/rules".CookiesMatchConditionParameters) as "github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/rules".DeliveryRuleCondition value in argument to cdnFrontDoorRuleConditions.FlattenFrontdoorCookiesCondition: *"github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/rules".CookiesMatchConditionParameters does not implement "github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/rules".DeliveryRuleCondition (missing method DeliveryRuleCondition)

Check failure on line 946 in internal/services/cdn/cdn_frontdoor_rule_resource.go

View workflow job for this annotation

GitHub Actions / detect

cannot use condition (variable of type *"github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/rules".CookiesMatchConditionParameters) as "github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/rules".DeliveryRuleCondition value in argument to cdnFrontDoorRuleConditions.FlattenFrontdoorCookiesCondition: *"github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/rules".CookiesMatchConditionParameters does not implement "github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/rules".DeliveryRuleCondition (missing method DeliveryRuleCondition)

Check failure on line 946 in internal/services/cdn/cdn_frontdoor_rule_resource.go

View workflow job for this annotation

GitHub Actions / golint

cannot use condition (variable of type *"github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/rules".CookiesMatchConditionParameters) as "github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/rules".DeliveryRuleCondition value in argument to cdnFrontDoorRuleConditions.FlattenFrontdoorCookiesCondition: *"github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/rules".CookiesMatchConditionParameters does not implement "github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/rules".DeliveryRuleCondition (missing method DeliveryRuleCondition)

Check failure on line 946 in internal/services/cdn/cdn_frontdoor_rule_resource.go

View workflow job for this annotation

GitHub Actions / document-lint

cannot use condition (variable of type *"github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/rules".CookiesMatchConditionParameters) as "github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/rules".DeliveryRuleCondition value in argument to cdnFrontDoorRuleConditions.FlattenFrontdoorCookiesCondition: *"github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/rules".CookiesMatchConditionParameters does not implement "github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/rules".DeliveryRuleCondition (missing method DeliveryRuleCondition)

Check failure on line 946 in internal/services/cdn/cdn_frontdoor_rule_resource.go

View workflow job for this annotation

GitHub Actions / compatibility-32bit-test

cannot use condition (variable of type *"github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/rules".CookiesMatchConditionParameters) as "github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/rules".DeliveryRuleCondition value in argument to cdnFrontDoorRuleConditions.FlattenFrontdoorCookiesCondition: *"github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/rules".CookiesMatchConditionParameters does not implement "github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/rules".DeliveryRuleCondition (missing method DeliveryRuleCondition)
if err != nil {
return nil, err
Expand All @@ -945,7 +952,7 @@ func flattenFrontdoorDeliveryRuleConditions(input *[]rules.DeliveryRuleCondition
continue
}

if condition, ok := BasicDeliveryRuleCondition.AsDeliveryRuleHostNameCondition(); ok {
if condition, ok := cdnFrontDoorConditionDiscriminator.AsDeliveryRuleHostNameCondition(deliveryRuleCondition); ok {
flattened, err := cdnFrontDoorRuleConditions.FlattenFrontdoorHostNameCondition(condition)

Check failure on line 956 in internal/services/cdn/cdn_frontdoor_rule_resource.go

View workflow job for this annotation

GitHub Actions / tflint

cannot use condition (variable of type *"github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/rules".HostNameMatchConditionParameters) as "github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/rules".DeliveryRuleCondition value in argument to cdnFrontDoorRuleConditions.FlattenFrontdoorHostNameCondition: *"github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/rules".HostNameMatchConditionParameters does not implement "github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/rules".DeliveryRuleCondition (missing method DeliveryRuleCondition)

Check failure on line 956 in internal/services/cdn/cdn_frontdoor_rule_resource.go

View workflow job for this annotation

GitHub Actions / detect

cannot use condition (variable of type *"github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/rules".HostNameMatchConditionParameters) as "github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/rules".DeliveryRuleCondition value in argument to cdnFrontDoorRuleConditions.FlattenFrontdoorHostNameCondition: *"github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/rules".HostNameMatchConditionParameters does not implement "github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/rules".DeliveryRuleCondition (missing method DeliveryRuleCondition)

Check failure on line 956 in internal/services/cdn/cdn_frontdoor_rule_resource.go

View workflow job for this annotation

GitHub Actions / golint

cannot use condition (variable of type *"github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/rules".HostNameMatchConditionParameters) as "github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/rules".DeliveryRuleCondition value in argument to cdnFrontDoorRuleConditions.FlattenFrontdoorHostNameCondition: *"github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/rules".HostNameMatchConditionParameters does not implement "github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/rules".DeliveryRuleCondition (missing method DeliveryRuleCondition)

Check failure on line 956 in internal/services/cdn/cdn_frontdoor_rule_resource.go

View workflow job for this annotation

GitHub Actions / document-lint

cannot use condition (variable of type *"github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/rules".HostNameMatchConditionParameters) as "github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/rules".DeliveryRuleCondition value in argument to cdnFrontDoorRuleConditions.FlattenFrontdoorHostNameCondition: *"github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/rules".HostNameMatchConditionParameters does not implement "github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/rules".DeliveryRuleCondition (missing method DeliveryRuleCondition)

Check failure on line 956 in internal/services/cdn/cdn_frontdoor_rule_resource.go

View workflow job for this annotation

GitHub Actions / compatibility-32bit-test

cannot use condition (variable of type *"github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/rules".HostNameMatchConditionParameters) as "github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/rules".DeliveryRuleCondition value in argument to cdnFrontDoorRuleConditions.FlattenFrontdoorHostNameCondition: *"github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/rules".HostNameMatchConditionParameters does not implement "github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/rules".DeliveryRuleCondition (missing method DeliveryRuleCondition)
if err != nil {
return nil, err
Expand All @@ -955,7 +962,7 @@ func flattenFrontdoorDeliveryRuleConditions(input *[]rules.DeliveryRuleCondition
continue
}

if condition, ok := BasicDeliveryRuleCondition.AsDeliveryRuleHTTPVersionCondition(); ok {
if condition, ok := cdnFrontDoorConditionDiscriminator.AsDeliveryRuleHTTPVersionCondition(deliveryRuleCondition); ok {
flattened, err := cdnFrontDoorRuleConditions.FlattenFrontdoorHttpVersionCondition(condition)

Check failure on line 966 in internal/services/cdn/cdn_frontdoor_rule_resource.go

View workflow job for this annotation

GitHub Actions / tflint

cannot use condition (variable of type *"github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/rules".HTTPVersionMatchConditionParameters) as "github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/rules".DeliveryRuleCondition value in argument to cdnFrontDoorRuleConditions.FlattenFrontdoorHttpVersionCondition: *"github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/rules".HTTPVersionMatchConditionParameters does not implement "github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/rules".DeliveryRuleCondition (missing method DeliveryRuleCondition)

Check failure on line 966 in internal/services/cdn/cdn_frontdoor_rule_resource.go

View workflow job for this annotation

GitHub Actions / detect

cannot use condition (variable of type *"github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/rules".HTTPVersionMatchConditionParameters) as "github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/rules".DeliveryRuleCondition value in argument to cdnFrontDoorRuleConditions.FlattenFrontdoorHttpVersionCondition: *"github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/rules".HTTPVersionMatchConditionParameters does not implement "github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/rules".DeliveryRuleCondition (missing method DeliveryRuleCondition)

Check failure on line 966 in internal/services/cdn/cdn_frontdoor_rule_resource.go

View workflow job for this annotation

GitHub Actions / golint

cannot use condition (variable of type *"github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/rules".HTTPVersionMatchConditionParameters) as "github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/rules".DeliveryRuleCondition value in argument to cdnFrontDoorRuleConditions.FlattenFrontdoorHttpVersionCondition: *"github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/rules".HTTPVersionMatchConditionParameters does not implement "github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/rules".DeliveryRuleCondition (missing method DeliveryRuleCondition)

Check failure on line 966 in internal/services/cdn/cdn_frontdoor_rule_resource.go

View workflow job for this annotation

GitHub Actions / document-lint

cannot use condition (variable of type *"github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/rules".HTTPVersionMatchConditionParameters) as "github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/rules".DeliveryRuleCondition value in argument to cdnFrontDoorRuleConditions.FlattenFrontdoorHttpVersionCondition: *"github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/rules".HTTPVersionMatchConditionParameters does not implement "github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/rules".DeliveryRuleCondition (missing method DeliveryRuleCondition)

Check failure on line 966 in internal/services/cdn/cdn_frontdoor_rule_resource.go

View workflow job for this annotation

GitHub Actions / compatibility-32bit-test

cannot use condition (variable of type *"github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/rules".HTTPVersionMatchConditionParameters) as "github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/rules".DeliveryRuleCondition value in argument to cdnFrontDoorRuleConditions.FlattenFrontdoorHttpVersionCondition: *"github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/rules".HTTPVersionMatchConditionParameters does not implement "github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/rules".DeliveryRuleCondition (missing method DeliveryRuleCondition)
if err != nil {
return nil, err
Expand All @@ -964,7 +971,7 @@ func flattenFrontdoorDeliveryRuleConditions(input *[]rules.DeliveryRuleCondition
continue
}

if condition, ok := BasicDeliveryRuleCondition.AsDeliveryRuleIsDeviceCondition(); ok {
if condition, ok := cdnFrontDoorConditionDiscriminator.AsDeliveryRuleIsDeviceCondition(deliveryRuleCondition); ok {
flattened, err := cdnFrontDoorRuleConditions.FlattenFrontdoorIsDeviceCondition(condition)

Check failure on line 975 in internal/services/cdn/cdn_frontdoor_rule_resource.go

View workflow job for this annotation

GitHub Actions / tflint

cannot use condition (variable of type *"github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/rules".IsDeviceMatchConditionParameters) as "github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/rules".DeliveryRuleCondition value in argument to cdnFrontDoorRuleConditions.FlattenFrontdoorIsDeviceCondition: *"github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/rules".IsDeviceMatchConditionParameters does not implement "github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/rules".DeliveryRuleCondition (missing method DeliveryRuleCondition)

Check failure on line 975 in internal/services/cdn/cdn_frontdoor_rule_resource.go

View workflow job for this annotation

GitHub Actions / detect

cannot use condition (variable of type *"github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/rules".IsDeviceMatchConditionParameters) as "github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/rules".DeliveryRuleCondition value in argument to cdnFrontDoorRuleConditions.FlattenFrontdoorIsDeviceCondition: *"github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/rules".IsDeviceMatchConditionParameters does not implement "github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/rules".DeliveryRuleCondition (missing method DeliveryRuleCondition)

Check failure on line 975 in internal/services/cdn/cdn_frontdoor_rule_resource.go

View workflow job for this annotation

GitHub Actions / golint

cannot use condition (variable of type *"github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/rules".IsDeviceMatchConditionParameters) as "github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/rules".DeliveryRuleCondition value in argument to cdnFrontDoorRuleConditions.FlattenFrontdoorIsDeviceCondition: *"github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/rules".IsDeviceMatchConditionParameters does not implement "github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/rules".DeliveryRuleCondition (missing method DeliveryRuleCondition)

Check failure on line 975 in internal/services/cdn/cdn_frontdoor_rule_resource.go

View workflow job for this annotation

GitHub Actions / document-lint

cannot use condition (variable of type *"github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/rules".IsDeviceMatchConditionParameters) as "github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/rules".DeliveryRuleCondition value in argument to cdnFrontDoorRuleConditions.FlattenFrontdoorIsDeviceCondition: *"github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/rules".IsDeviceMatchConditionParameters does not implement "github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/rules".DeliveryRuleCondition (missing method DeliveryRuleCondition)

Check failure on line 975 in internal/services/cdn/cdn_frontdoor_rule_resource.go

View workflow job for this annotation

GitHub Actions / compatibility-32bit-test

cannot use condition (variable of type *"github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/rules".IsDeviceMatchConditionParameters) as "github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/rules".DeliveryRuleCondition value in argument to cdnFrontDoorRuleConditions.FlattenFrontdoorIsDeviceCondition: *"github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/rules".IsDeviceMatchConditionParameters does not implement "github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/rules".DeliveryRuleCondition (missing method DeliveryRuleCondition)
if err != nil {
return nil, err
Expand All @@ -974,7 +981,7 @@ func flattenFrontdoorDeliveryRuleConditions(input *[]rules.DeliveryRuleCondition
continue
}

if condition, ok := BasicDeliveryRuleCondition.AsDeliveryRulePostArgsCondition(); ok {
if condition, ok := cdnFrontDoorConditionDiscriminator.AsDeliveryRulePostArgsCondition(deliveryRuleCondition); ok {
flattened, err := cdnFrontDoorRuleConditions.FlattenFrontdoorPostArgsCondition(condition)

Check failure on line 985 in internal/services/cdn/cdn_frontdoor_rule_resource.go

View workflow job for this annotation

GitHub Actions / tflint

cannot use condition (variable of type *"github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/rules".PostArgsMatchConditionParameters) as "github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/rules".DeliveryRuleCondition value in argument to cdnFrontDoorRuleConditions.FlattenFrontdoorPostArgsCondition: *"github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/rules".PostArgsMatchConditionParameters does not implement "github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/rules".DeliveryRuleCondition (missing method DeliveryRuleCondition)

Check failure on line 985 in internal/services/cdn/cdn_frontdoor_rule_resource.go

View workflow job for this annotation

GitHub Actions / detect

cannot use condition (variable of type *"github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/rules".PostArgsMatchConditionParameters) as "github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/rules".DeliveryRuleCondition value in argument to cdnFrontDoorRuleConditions.FlattenFrontdoorPostArgsCondition: *"github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/rules".PostArgsMatchConditionParameters does not implement "github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/rules".DeliveryRuleCondition (missing method DeliveryRuleCondition)

Check failure on line 985 in internal/services/cdn/cdn_frontdoor_rule_resource.go

View workflow job for this annotation

GitHub Actions / golint

cannot use condition (variable of type *"github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/rules".PostArgsMatchConditionParameters) as "github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/rules".DeliveryRuleCondition value in argument to cdnFrontDoorRuleConditions.FlattenFrontdoorPostArgsCondition: *"github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/rules".PostArgsMatchConditionParameters does not implement "github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/rules".DeliveryRuleCondition (missing method DeliveryRuleCondition)

Check failure on line 985 in internal/services/cdn/cdn_frontdoor_rule_resource.go

View workflow job for this annotation

GitHub Actions / document-lint

cannot use condition (variable of type *"github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/rules".PostArgsMatchConditionParameters) as "github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/rules".DeliveryRuleCondition value in argument to cdnFrontDoorRuleConditions.FlattenFrontdoorPostArgsCondition: *"github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/rules".PostArgsMatchConditionParameters does not implement "github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/rules".DeliveryRuleCondition (missing method DeliveryRuleCondition)

Check failure on line 985 in internal/services/cdn/cdn_frontdoor_rule_resource.go

View workflow job for this annotation

GitHub Actions / compatibility-32bit-test

cannot use condition (variable of type *"github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/rules".PostArgsMatchConditionParameters) as "github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/rules".DeliveryRuleCondition value in argument to cdnFrontDoorRuleConditions.FlattenFrontdoorPostArgsCondition: *"github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/rules".PostArgsMatchConditionParameters does not implement "github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/rules".DeliveryRuleCondition (missing method DeliveryRuleCondition)
if err != nil {
return nil, err
Expand All @@ -984,7 +991,7 @@ func flattenFrontdoorDeliveryRuleConditions(input *[]rules.DeliveryRuleCondition
continue
}

if condition, ok := BasicDeliveryRuleCondition.AsDeliveryRuleQueryStringCondition(); ok {
if condition, ok := cdnFrontDoorConditionDiscriminator.AsDeliveryRuleQueryStringCondition(deliveryRuleCondition); ok {
flattened, err := cdnFrontDoorRuleConditions.FlattenFrontdoorQueryStringCondition(condition)

Check failure on line 995 in internal/services/cdn/cdn_frontdoor_rule_resource.go

View workflow job for this annotation

GitHub Actions / tflint

cannot use condition (variable of type *"github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/rules".QueryStringMatchConditionParameters) as "github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/rules".DeliveryRuleCondition value in argument to cdnFrontDoorRuleConditions.FlattenFrontdoorQueryStringCondition: *"github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/rules".QueryStringMatchConditionParameters does not implement "github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/rules".DeliveryRuleCondition (missing method DeliveryRuleCondition)

Check failure on line 995 in internal/services/cdn/cdn_frontdoor_rule_resource.go

View workflow job for this annotation

GitHub Actions / detect

cannot use condition (variable of type *"github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/rules".QueryStringMatchConditionParameters) as "github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/rules".DeliveryRuleCondition value in argument to cdnFrontDoorRuleConditions.FlattenFrontdoorQueryStringCondition: *"github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/rules".QueryStringMatchConditionParameters does not implement "github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/rules".DeliveryRuleCondition (missing method DeliveryRuleCondition)

Check failure on line 995 in internal/services/cdn/cdn_frontdoor_rule_resource.go

View workflow job for this annotation

GitHub Actions / golint

cannot use condition (variable of type *"github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/rules".QueryStringMatchConditionParameters) as "github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/rules".DeliveryRuleCondition value in argument to cdnFrontDoorRuleConditions.FlattenFrontdoorQueryStringCondition: *"github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/rules".QueryStringMatchConditionParameters does not implement "github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/rules".DeliveryRuleCondition (missing method DeliveryRuleCondition)

Check failure on line 995 in internal/services/cdn/cdn_frontdoor_rule_resource.go

View workflow job for this annotation

GitHub Actions / document-lint

cannot use condition (variable of type *"github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/rules".QueryStringMatchConditionParameters) as "github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/rules".DeliveryRuleCondition value in argument to cdnFrontDoorRuleConditions.FlattenFrontdoorQueryStringCondition: *"github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/rules".QueryStringMatchConditionParameters does not implement "github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/rules".DeliveryRuleCondition (missing method DeliveryRuleCondition)

Check failure on line 995 in internal/services/cdn/cdn_frontdoor_rule_resource.go

View workflow job for this annotation

GitHub Actions / compatibility-32bit-test

cannot use condition (variable of type *"github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/rules".QueryStringMatchConditionParameters) as "github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/rules".DeliveryRuleCondition value in argument to cdnFrontDoorRuleConditions.FlattenFrontdoorQueryStringCondition: *"github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/rules".QueryStringMatchConditionParameters does not implement "github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/rules".DeliveryRuleCondition (missing method DeliveryRuleCondition)
if err != nil {
return nil, err
Expand All @@ -994,7 +1001,7 @@ func flattenFrontdoorDeliveryRuleConditions(input *[]rules.DeliveryRuleCondition
continue
}

if condition, ok := BasicDeliveryRuleCondition.AsDeliveryRuleRemoteAddressCondition(); ok {
if condition, ok := cdnFrontDoorConditionDiscriminator.AsDeliveryRuleRemoteAddressCondition(deliveryRuleCondition); ok {
flattened, err := cdnFrontDoorRuleConditions.FlattenFrontdoorRemoteAddressCondition(condition)

Check failure on line 1005 in internal/services/cdn/cdn_frontdoor_rule_resource.go

View workflow job for this annotation

GitHub Actions / tflint

cannot use condition (variable of type *"github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/rules".RemoteAddressMatchConditionParameters) as "github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/rules".DeliveryRuleCondition value in argument to cdnFrontDoorRuleConditions.FlattenFrontdoorRemoteAddressCondition: *"github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/rules".RemoteAddressMatchConditionParameters does not implement "github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/rules".DeliveryRuleCondition (missing method DeliveryRuleCondition)

Check failure on line 1005 in internal/services/cdn/cdn_frontdoor_rule_resource.go

View workflow job for this annotation

GitHub Actions / detect

cannot use condition (variable of type *"github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/rules".RemoteAddressMatchConditionParameters) as "github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/rules".DeliveryRuleCondition value in argument to cdnFrontDoorRuleConditions.FlattenFrontdoorRemoteAddressCondition: *"github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/rules".RemoteAddressMatchConditionParameters does not implement "github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/rules".DeliveryRuleCondition (missing method DeliveryRuleCondition)

Check failure on line 1005 in internal/services/cdn/cdn_frontdoor_rule_resource.go

View workflow job for this annotation

GitHub Actions / golint

cannot use condition (variable of type *"github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/rules".RemoteAddressMatchConditionParameters) as "github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/rules".DeliveryRuleCondition value in argument to cdnFrontDoorRuleConditions.FlattenFrontdoorRemoteAddressCondition: *"github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/rules".RemoteAddressMatchConditionParameters does not implement "github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/rules".DeliveryRuleCondition (missing method DeliveryRuleCondition)

Check failure on line 1005 in internal/services/cdn/cdn_frontdoor_rule_resource.go

View workflow job for this annotation

GitHub Actions / document-lint

cannot use condition (variable of type *"github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/rules".RemoteAddressMatchConditionParameters) as "github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/rules".DeliveryRuleCondition value in argument to cdnFrontDoorRuleConditions.FlattenFrontdoorRemoteAddressCondition: *"github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/rules".RemoteAddressMatchConditionParameters does not implement "github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/rules".DeliveryRuleCondition (missing method DeliveryRuleCondition)

Check failure on line 1005 in internal/services/cdn/cdn_frontdoor_rule_resource.go

View workflow job for this annotation

GitHub Actions / compatibility-32bit-test

cannot use condition (variable of type *"github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/rules".RemoteAddressMatchConditionParameters) as "github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/rules".DeliveryRuleCondition value in argument to cdnFrontDoorRuleConditions.FlattenFrontdoorRemoteAddressCondition: *"github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/rules".RemoteAddressMatchConditionParameters does not implement "github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/rules".DeliveryRuleCondition (missing method DeliveryRuleCondition)
if err != nil {
return nil, err
Expand All @@ -1004,7 +1011,7 @@ func flattenFrontdoorDeliveryRuleConditions(input *[]rules.DeliveryRuleCondition
continue
}

if condition, ok := BasicDeliveryRuleCondition.AsDeliveryRuleRequestBodyCondition(); ok {
if condition, ok := cdnFrontDoorConditionDiscriminator.AsDeliveryRuleRequestBodyCondition(deliveryRuleCondition); ok {
flattened, err := cdnFrontDoorRuleConditions.FlattenFrontdoorRequestBodyCondition(condition)

Check failure on line 1015 in internal/services/cdn/cdn_frontdoor_rule_resource.go

View workflow job for this annotation

GitHub Actions / tflint

cannot use condition (variable of type *"github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/rules".RequestBodyMatchConditionParameters) as "github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/rules".DeliveryRuleCondition value in argument to cdnFrontDoorRuleConditions.FlattenFrontdoorRequestBodyCondition: *"github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/rules".RequestBodyMatchConditionParameters does not implement "github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/rules".DeliveryRuleCondition (missing method DeliveryRuleCondition)

Check failure on line 1015 in internal/services/cdn/cdn_frontdoor_rule_resource.go

View workflow job for this annotation

GitHub Actions / detect

cannot use condition (variable of type *"github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/rules".RequestBodyMatchConditionParameters) as "github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/rules".DeliveryRuleCondition value in argument to cdnFrontDoorRuleConditions.FlattenFrontdoorRequestBodyCondition: *"github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/rules".RequestBodyMatchConditionParameters does not implement "github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/rules".DeliveryRuleCondition (missing method DeliveryRuleCondition)

Check failure on line 1015 in internal/services/cdn/cdn_frontdoor_rule_resource.go

View workflow job for this annotation

GitHub Actions / golint

cannot use condition (variable of type *"github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/rules".RequestBodyMatchConditionParameters) as "github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/rules".DeliveryRuleCondition value in argument to cdnFrontDoorRuleConditions.FlattenFrontdoorRequestBodyCondition: *"github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/rules".RequestBodyMatchConditionParameters does not implement "github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/rules".DeliveryRuleCondition (missing method DeliveryRuleCondition)

Check failure on line 1015 in internal/services/cdn/cdn_frontdoor_rule_resource.go

View workflow job for this annotation

GitHub Actions / document-lint

cannot use condition (variable of type *"github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/rules".RequestBodyMatchConditionParameters) as "github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/rules".DeliveryRuleCondition value in argument to cdnFrontDoorRuleConditions.FlattenFrontdoorRequestBodyCondition: *"github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/rules".RequestBodyMatchConditionParameters does not implement "github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/rules".DeliveryRuleCondition (missing method DeliveryRuleCondition)

Check failure on line 1015 in internal/services/cdn/cdn_frontdoor_rule_resource.go

View workflow job for this annotation

GitHub Actions / compatibility-32bit-test

cannot use condition (variable of type *"github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/rules".RequestBodyMatchConditionParameters) as "github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/rules".DeliveryRuleCondition value in argument to cdnFrontDoorRuleConditions.FlattenFrontdoorRequestBodyCondition: *"github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/rules".RequestBodyMatchConditionParameters does not implement "github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/rules".DeliveryRuleCondition (missing method DeliveryRuleCondition)
if err != nil {
return nil, err
Expand All @@ -1014,7 +1021,7 @@ func flattenFrontdoorDeliveryRuleConditions(input *[]rules.DeliveryRuleCondition
continue
}

if condition, ok := BasicDeliveryRuleCondition.AsDeliveryRuleRequestHeaderCondition(); ok {
if condition, ok := cdnFrontDoorConditionDiscriminator.AsDeliveryRuleRequestHeaderCondition(deliveryRuleCondition); ok {
flattened, err := cdnFrontDoorRuleConditions.FlattenFrontdoorRequestHeaderCondition(condition)

Check failure on line 1025 in internal/services/cdn/cdn_frontdoor_rule_resource.go

View workflow job for this annotation

GitHub Actions / tflint

cannot use condition (variable of type *"github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/rules".RequestHeaderMatchConditionParameters) as "github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/rules".DeliveryRuleCondition value in argument to cdnFrontDoorRuleConditions.FlattenFrontdoorRequestHeaderCondition: *"github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/rules".RequestHeaderMatchConditionParameters does not implement "github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/rules".DeliveryRuleCondition (missing method DeliveryRuleCondition)

Check failure on line 1025 in internal/services/cdn/cdn_frontdoor_rule_resource.go

View workflow job for this annotation

GitHub Actions / detect

cannot use condition (variable of type *"github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/rules".RequestHeaderMatchConditionParameters) as "github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/rules".DeliveryRuleCondition value in argument to cdnFrontDoorRuleConditions.FlattenFrontdoorRequestHeaderCondition: *"github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/rules".RequestHeaderMatchConditionParameters does not implement "github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/rules".DeliveryRuleCondition (missing method DeliveryRuleCondition)

Check failure on line 1025 in internal/services/cdn/cdn_frontdoor_rule_resource.go

View workflow job for this annotation

GitHub Actions / golint

cannot use condition (variable of type *"github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/rules".RequestHeaderMatchConditionParameters) as "github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/rules".DeliveryRuleCondition value in argument to cdnFrontDoorRuleConditions.FlattenFrontdoorRequestHeaderCondition: *"github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/rules".RequestHeaderMatchConditionParameters does not implement "github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/rules".DeliveryRuleCondition (missing method DeliveryRuleCondition)

Check failure on line 1025 in internal/services/cdn/cdn_frontdoor_rule_resource.go

View workflow job for this annotation

GitHub Actions / document-lint

cannot use condition (variable of type *"github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/rules".RequestHeaderMatchConditionParameters) as "github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/rules".DeliveryRuleCondition value in argument to cdnFrontDoorRuleConditions.FlattenFrontdoorRequestHeaderCondition: *"github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/rules".RequestHeaderMatchConditionParameters does not implement "github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/rules".DeliveryRuleCondition (missing method DeliveryRuleCondition)

Check failure on line 1025 in internal/services/cdn/cdn_frontdoor_rule_resource.go

View workflow job for this annotation

GitHub Actions / compatibility-32bit-test

cannot use condition (variable of type *"github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/rules".RequestHeaderMatchConditionParameters) as "github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/rules".DeliveryRuleCondition value in argument to cdnFrontDoorRuleConditions.FlattenFrontdoorRequestHeaderCondition: *"github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/rules".RequestHeaderMatchConditionParameters does not implement "github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/rules".DeliveryRuleCondition (missing method DeliveryRuleCondition)
if err != nil {
return nil, err
Expand All @@ -1024,7 +1031,7 @@ func flattenFrontdoorDeliveryRuleConditions(input *[]rules.DeliveryRuleCondition
continue
}

if condition, ok := BasicDeliveryRuleCondition.AsDeliveryRuleRequestMethodCondition(); ok {
if condition, ok := cdnFrontDoorConditionDiscriminator.AsDeliveryRuleRequestMethodCondition(deliveryRuleCondition); ok {
flattened, err := cdnFrontDoorRuleConditions.FlattenFrontdoorRequestMethodCondition(condition)
if err != nil {
return nil, err
Expand All @@ -1034,7 +1041,7 @@ func flattenFrontdoorDeliveryRuleConditions(input *[]rules.DeliveryRuleCondition
continue
}

if condition, ok := BasicDeliveryRuleCondition.AsDeliveryRuleRequestSchemeCondition(); ok {
if condition, ok := cdnFrontDoorConditionDiscriminator.AsDeliveryRuleRequestSchemeCondition(deliveryRuleCondition); ok {
flattened, err := cdnFrontDoorRuleConditions.FlattenFrontdoorRequestSchemeCondition(condition)
if err != nil {
return nil, err
Expand All @@ -1044,7 +1051,7 @@ func flattenFrontdoorDeliveryRuleConditions(input *[]rules.DeliveryRuleCondition
continue
}

if condition, ok := BasicDeliveryRuleCondition.AsDeliveryRuleRequestURICondition(); ok {
if condition, ok := cdnFrontDoorConditionDiscriminator.AsDeliveryRuleRequestURICondition(deliveryRuleCondition); ok {
flattened, err := cdnFrontDoorRuleConditions.FlattenFrontdoorRequestUriCondition(condition)
if err != nil {
return nil, err
Expand All @@ -1054,7 +1061,7 @@ func flattenFrontdoorDeliveryRuleConditions(input *[]rules.DeliveryRuleCondition
continue
}

if condition, ok := BasicDeliveryRuleCondition.AsDeliveryRuleServerPortCondition(); ok {
if condition, ok := cdnFrontDoorConditionDiscriminator.AsDeliveryRuleServerPortCondition(deliveryRuleCondition); ok {
flattened, err := cdnFrontDoorRuleConditions.FlattenFrontdoorServerPortCondition(condition)
if err != nil {
return nil, err
Expand All @@ -1064,7 +1071,7 @@ func flattenFrontdoorDeliveryRuleConditions(input *[]rules.DeliveryRuleCondition
continue
}

if condition, ok := BasicDeliveryRuleCondition.AsDeliveryRuleSocketAddrCondition(); ok {
if condition, ok := cdnFrontDoorConditionDiscriminator.AsDeliveryRuleSocketAddrCondition(deliveryRuleCondition); ok {
flattened, err := cdnFrontDoorRuleConditions.FlattenFrontdoorSocketAddressCondition(condition)
if err != nil {
return nil, err
Expand All @@ -1074,7 +1081,7 @@ func flattenFrontdoorDeliveryRuleConditions(input *[]rules.DeliveryRuleCondition
continue
}

if condition, ok := BasicDeliveryRuleCondition.AsDeliveryRuleSslProtocolCondition(); ok {
if condition, ok := cdnFrontDoorConditionDiscriminator.AsDeliveryRuleSslProtocolCondition(deliveryRuleCondition); ok {
flattened, err := cdnFrontDoorRuleConditions.FlattenFrontdoorSslProtocolCondition(condition)
if err != nil {
return nil, err
Expand All @@ -1084,7 +1091,7 @@ func flattenFrontdoorDeliveryRuleConditions(input *[]rules.DeliveryRuleCondition
continue
}

if condition, ok := BasicDeliveryRuleCondition.AsDeliveryRuleURLFileExtensionCondition(); ok {
if condition, ok := cdnFrontDoorConditionDiscriminator.AsDeliveryRuleURLFileExtensionCondition(deliveryRuleCondition); ok {
flattened, err := cdnFrontDoorRuleConditions.FlattenFrontdoorUrlFileExtensionCondition(condition)
if err != nil {
return nil, err
Expand All @@ -1094,7 +1101,7 @@ func flattenFrontdoorDeliveryRuleConditions(input *[]rules.DeliveryRuleCondition
continue
}

if condition, ok := BasicDeliveryRuleCondition.AsDeliveryRuleURLFileNameCondition(); ok {
if condition, ok := cdnFrontDoorConditionDiscriminator.AsDeliveryRuleURLFileNameCondition(deliveryRuleCondition); ok {
flattened, err := cdnFrontDoorRuleConditions.FlattenFrontdoorUrlFileNameCondition(condition)
if err != nil {
return nil, err
Expand All @@ -1104,7 +1111,7 @@ func flattenFrontdoorDeliveryRuleConditions(input *[]rules.DeliveryRuleCondition
continue
}

if condition, ok := BasicDeliveryRuleCondition.AsDeliveryRuleURLPathCondition(); ok {
if condition, ok := cdnFrontDoorConditionDiscriminator.AsDeliveryRuleURLPathCondition(deliveryRuleCondition); ok {
flattened, err := cdnFrontDoorRuleConditions.FlattenFrontdoorUrlPathCondition(condition)
if err != nil {
return nil, err
Expand Down
62 changes: 39 additions & 23 deletions internal/services/cdn/deliveryruleconditions/cookies.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ package deliveryruleconditions
import (
"fmt"

"github.com/hashicorp/go-azure-helpers/lang/pointer"
"github.com/hashicorp/go-azure-sdk/resource-manager/cdn/2024-02-01/rules"
"github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2020-09-01/cdn" // nolint: staticcheck
"github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk"
"github.com/hashicorp/terraform-provider-azurerm/internal/tf/validation"
"github.com/hashicorp/terraform-provider-azurerm/utils"
Expand All @@ -25,8 +24,17 @@ func Cookies() *pluginsdk.Resource {
"operator": {
Type: pluginsdk.TypeString,
Required: true,
ValidateFunc: validation.StringInSlice(rules.PossibleValuesForCookiesOperator(),
false),
ValidateFunc: validation.StringInSlice([]string{
string(cdn.OperatorAny),
string(cdn.OperatorBeginsWith),
string(cdn.OperatorContains),
string(cdn.OperatorEndsWith),
string(cdn.OperatorEqual),
string(cdn.OperatorGreaterThan),
string(cdn.OperatorGreaterThanOrEqual),
string(cdn.OperatorLessThan),
string(cdn.OperatorLessThanOrEqual),
}, false),
},

"negate_condition": {
Expand All @@ -51,40 +59,46 @@ func Cookies() *pluginsdk.Resource {
Elem: &pluginsdk.Schema{
Type: pluginsdk.TypeString,
ValidateFunc: validation.StringInSlice([]string{
string(rules.TransformLowercase),
string(rules.TransformUppercase),
string(cdn.TransformLowercase),
string(cdn.TransformUppercase),
}, false),
},
},
},
}
}

func ExpandArmCdnEndpointConditionCookies(input []interface{}) []rules.DeliveryRuleCondition {
output := make([]rules.DeliveryRuleCondition, 0)
func ExpandArmCdnEndpointConditionCookies(input []interface{}) []cdn.BasicDeliveryRuleCondition {
output := make([]cdn.BasicDeliveryRuleCondition, 0)
for _, v := range input {
item := v.(map[string]interface{})

cookiesCondition := rules.DeliveryRuleCookiesCondition{
Name: rules.MatchVariableCookies,
Parameters: rules.CookiesMatchConditionParameters{
TypeName: rules.DeliveryRuleConditionParametersTypeDeliveryRuleCookiesConditionParameters,
Selector: pointer.To(item["selector"].(string)),
Operator: rules.CookiesOperator(item["operator"].(string)),
NegateCondition: pointer.To(item["negate_condition"].(bool)),
cookiesCondition := cdn.DeliveryRuleCookiesCondition{
Name: cdn.NameCookies,
Parameters: &cdn.CookiesMatchConditionParameters{
OdataType: utils.String("Microsoft.Azure.Cdn.Models.DeliveryRuleCookiesConditionParameters"),
Selector: utils.String(item["selector"].(string)),
Operator: cdn.CookiesOperator(item["operator"].(string)),
NegateCondition: utils.Bool(item["negate_condition"].(bool)),
MatchValues: utils.ExpandStringSlice(item["match_values"].(*pluginsdk.Set).List()),
Transforms: expandTransforms(item["transforms"].([]interface{})),
},
}

if rawTransforms := item["transforms"].([]interface{}); len(rawTransforms) != 0 {
transforms := make([]cdn.Transform, 0)
for _, t := range rawTransforms {
transforms = append(transforms, cdn.Transform(t.(string)))
}
cookiesCondition.Parameters.Transforms = &transforms
}

output = append(output, cookiesCondition)
}

return output
}

func FlattenArmCdnEndpointConditionCookies(input rules.DeliveryRuleCondition) (*map[string]interface{}, error) {
condition, ok := AsDeliveryRuleCookiesCondition(input)
func FlattenArmCdnEndpointConditionCookies(input cdn.BasicDeliveryRuleCondition) (*map[string]interface{}, error) {
condition, ok := input.AsDeliveryRuleCookiesCondition()
if !ok {
return nil, fmt.Errorf("expected a delivery rule cookie condition")
}
Expand All @@ -95,13 +109,13 @@ func FlattenArmCdnEndpointConditionCookies(input rules.DeliveryRuleCondition) (*
matchValues := make([]interface{}, 0)
transforms := make([]string, 0)

if params := condition; params != nil {
operator = string(params.Operator)

if params := condition.Parameters; params != nil {
if params.Selector != nil {
selector = *params.Selector
}

operator = string(params.Operator)

if params.NegateCondition != nil {
negateCondition = *params.NegateCondition
}
Expand All @@ -111,7 +125,9 @@ func FlattenArmCdnEndpointConditionCookies(input rules.DeliveryRuleCondition) (*
}

if params.Transforms != nil {
transforms = flattenTransforms(params.Transforms)
for _, transform := range *params.Transforms {
transforms = append(transforms, string(transform))
}
}
}

Expand Down
Loading

0 comments on commit 5c36ca9

Please sign in to comment.