From 5f3d5ffa9ca1ae401d3e402c4c8d903788fa2eec Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Tue, 16 Jul 2019 15:11:57 -0700 Subject: [PATCH] Generated from 537e9475d4ec21dcc8ede20cd45ec73f3f20c729 (#5236) Move changes to 2019-04-15 version. --- profiles/latest/cdn/mgmt/cdn/models.go | 18 ++ profiles/preview/cdn/mgmt/cdn/models.go | 18 ++ services/cdn/mgmt/2019-04-15/cdn/models.go | 237 ++++++++++++++++++++- 3 files changed, 267 insertions(+), 6 deletions(-) diff --git a/profiles/latest/cdn/mgmt/cdn/models.go b/profiles/latest/cdn/mgmt/cdn/models.go index 21de8a41510f..27689e718e1e 100644 --- a/profiles/latest/cdn/mgmt/cdn/models.go +++ b/profiles/latest/cdn/mgmt/cdn/models.go @@ -141,10 +141,12 @@ type NameBasicDeliveryRuleAction = original.NameBasicDeliveryRuleAction const ( NameCacheExpiration NameBasicDeliveryRuleAction = original.NameCacheExpiration + NameCacheKeyQueryString NameBasicDeliveryRuleAction = original.NameCacheKeyQueryString NameDeliveryRuleAction NameBasicDeliveryRuleAction = original.NameDeliveryRuleAction NameModifyRequestHeader NameBasicDeliveryRuleAction = original.NameModifyRequestHeader NameModifyResponseHeader NameBasicDeliveryRuleAction = original.NameModifyResponseHeader NameURLRedirect NameBasicDeliveryRuleAction = original.NameURLRedirect + NameURLRewrite NameBasicDeliveryRuleAction = original.NameURLRewrite ) type OptimizationType = original.OptimizationType @@ -195,6 +197,15 @@ const ( ServerNameIndication ProtocolType = original.ServerNameIndication ) +type QueryStringBehavior = original.QueryStringBehavior + +const ( + Exclude QueryStringBehavior = original.Exclude + ExcludeAll QueryStringBehavior = original.ExcludeAll + Include QueryStringBehavior = original.Include + IncludeAll QueryStringBehavior = original.IncludeAll +) + type QueryStringCachingBehavior = original.QueryStringCachingBehavior const ( @@ -350,6 +361,7 @@ type BasicCustomDomainHTTPSParameters = original.BasicCustomDomainHTTPSParameter type BasicDeliveryRuleAction = original.BasicDeliveryRuleAction type BasicDeliveryRuleCondition = original.BasicDeliveryRuleCondition type CacheExpirationActionParameters = original.CacheExpirationActionParameters +type CacheKeyQueryStringActionParameters = original.CacheKeyQueryStringActionParameters type CertificateSourceParameters = original.CertificateSourceParameters type CheckNameAvailabilityInput = original.CheckNameAvailabilityInput type CheckNameAvailabilityOutput = original.CheckNameAvailabilityOutput @@ -370,6 +382,7 @@ type DeepCreatedOriginProperties = original.DeepCreatedOriginProperties type DeliveryRule = original.DeliveryRule type DeliveryRuleAction = original.DeliveryRuleAction type DeliveryRuleCacheExpirationAction = original.DeliveryRuleCacheExpirationAction +type DeliveryRuleCacheKeyQueryStringAction = original.DeliveryRuleCacheKeyQueryStringAction type DeliveryRuleCondition = original.DeliveryRuleCondition type DeliveryRuleIsDeviceCondition = original.DeliveryRuleIsDeviceCondition type DeliveryRulePostArgsCondition = original.DeliveryRulePostArgsCondition @@ -465,6 +478,8 @@ type URLFileNameMatchConditionParameters = original.URLFileNameMatchConditionPar type URLPathMatchConditionParameters = original.URLPathMatchConditionParameters type URLRedirectAction = original.URLRedirectAction type URLRedirectActionParameters = original.URLRedirectActionParameters +type URLRewriteAction = original.URLRewriteAction +type URLRewriteActionParameters = original.URLRewriteActionParameters type UserManagedHTTPSParameters = original.UserManagedHTTPSParameters type ValidateCustomDomainInput = original.ValidateCustomDomainInput type ValidateCustomDomainOutput = original.ValidateCustomDomainOutput @@ -612,6 +627,9 @@ func PossibleProfileResourceStateValues() []ProfileResourceState { func PossibleProtocolTypeValues() []ProtocolType { return original.PossibleProtocolTypeValues() } +func PossibleQueryStringBehaviorValues() []QueryStringBehavior { + return original.PossibleQueryStringBehaviorValues() +} func PossibleQueryStringCachingBehaviorValues() []QueryStringCachingBehavior { return original.PossibleQueryStringCachingBehaviorValues() } diff --git a/profiles/preview/cdn/mgmt/cdn/models.go b/profiles/preview/cdn/mgmt/cdn/models.go index 259c4ff5042f..e191eb867583 100644 --- a/profiles/preview/cdn/mgmt/cdn/models.go +++ b/profiles/preview/cdn/mgmt/cdn/models.go @@ -141,10 +141,12 @@ type NameBasicDeliveryRuleAction = original.NameBasicDeliveryRuleAction const ( NameCacheExpiration NameBasicDeliveryRuleAction = original.NameCacheExpiration + NameCacheKeyQueryString NameBasicDeliveryRuleAction = original.NameCacheKeyQueryString NameDeliveryRuleAction NameBasicDeliveryRuleAction = original.NameDeliveryRuleAction NameModifyRequestHeader NameBasicDeliveryRuleAction = original.NameModifyRequestHeader NameModifyResponseHeader NameBasicDeliveryRuleAction = original.NameModifyResponseHeader NameURLRedirect NameBasicDeliveryRuleAction = original.NameURLRedirect + NameURLRewrite NameBasicDeliveryRuleAction = original.NameURLRewrite ) type OptimizationType = original.OptimizationType @@ -195,6 +197,15 @@ const ( ServerNameIndication ProtocolType = original.ServerNameIndication ) +type QueryStringBehavior = original.QueryStringBehavior + +const ( + Exclude QueryStringBehavior = original.Exclude + ExcludeAll QueryStringBehavior = original.ExcludeAll + Include QueryStringBehavior = original.Include + IncludeAll QueryStringBehavior = original.IncludeAll +) + type QueryStringCachingBehavior = original.QueryStringCachingBehavior const ( @@ -350,6 +361,7 @@ type BasicCustomDomainHTTPSParameters = original.BasicCustomDomainHTTPSParameter type BasicDeliveryRuleAction = original.BasicDeliveryRuleAction type BasicDeliveryRuleCondition = original.BasicDeliveryRuleCondition type CacheExpirationActionParameters = original.CacheExpirationActionParameters +type CacheKeyQueryStringActionParameters = original.CacheKeyQueryStringActionParameters type CertificateSourceParameters = original.CertificateSourceParameters type CheckNameAvailabilityInput = original.CheckNameAvailabilityInput type CheckNameAvailabilityOutput = original.CheckNameAvailabilityOutput @@ -370,6 +382,7 @@ type DeepCreatedOriginProperties = original.DeepCreatedOriginProperties type DeliveryRule = original.DeliveryRule type DeliveryRuleAction = original.DeliveryRuleAction type DeliveryRuleCacheExpirationAction = original.DeliveryRuleCacheExpirationAction +type DeliveryRuleCacheKeyQueryStringAction = original.DeliveryRuleCacheKeyQueryStringAction type DeliveryRuleCondition = original.DeliveryRuleCondition type DeliveryRuleIsDeviceCondition = original.DeliveryRuleIsDeviceCondition type DeliveryRulePostArgsCondition = original.DeliveryRulePostArgsCondition @@ -465,6 +478,8 @@ type URLFileNameMatchConditionParameters = original.URLFileNameMatchConditionPar type URLPathMatchConditionParameters = original.URLPathMatchConditionParameters type URLRedirectAction = original.URLRedirectAction type URLRedirectActionParameters = original.URLRedirectActionParameters +type URLRewriteAction = original.URLRewriteAction +type URLRewriteActionParameters = original.URLRewriteActionParameters type UserManagedHTTPSParameters = original.UserManagedHTTPSParameters type ValidateCustomDomainInput = original.ValidateCustomDomainInput type ValidateCustomDomainOutput = original.ValidateCustomDomainOutput @@ -612,6 +627,9 @@ func PossibleProfileResourceStateValues() []ProfileResourceState { func PossibleProtocolTypeValues() []ProtocolType { return original.PossibleProtocolTypeValues() } +func PossibleQueryStringBehaviorValues() []QueryStringBehavior { + return original.PossibleQueryStringBehaviorValues() +} func PossibleQueryStringCachingBehaviorValues() []QueryStringCachingBehavior { return original.PossibleQueryStringCachingBehaviorValues() } diff --git a/services/cdn/mgmt/2019-04-15/cdn/models.go b/services/cdn/mgmt/2019-04-15/cdn/models.go index 58143c7b0919..504a6cac16d5 100644 --- a/services/cdn/mgmt/2019-04-15/cdn/models.go +++ b/services/cdn/mgmt/2019-04-15/cdn/models.go @@ -263,6 +263,8 @@ type NameBasicDeliveryRuleAction string const ( // NameCacheExpiration ... NameCacheExpiration NameBasicDeliveryRuleAction = "CacheExpiration" + // NameCacheKeyQueryString ... + NameCacheKeyQueryString NameBasicDeliveryRuleAction = "CacheKeyQueryString" // NameDeliveryRuleAction ... NameDeliveryRuleAction NameBasicDeliveryRuleAction = "DeliveryRuleAction" // NameModifyRequestHeader ... @@ -271,11 +273,13 @@ const ( NameModifyResponseHeader NameBasicDeliveryRuleAction = "ModifyResponseHeader" // NameURLRedirect ... NameURLRedirect NameBasicDeliveryRuleAction = "UrlRedirect" + // NameURLRewrite ... + NameURLRewrite NameBasicDeliveryRuleAction = "UrlRewrite" ) // PossibleNameBasicDeliveryRuleActionValues returns an array of possible values for the NameBasicDeliveryRuleAction const type. func PossibleNameBasicDeliveryRuleActionValues() []NameBasicDeliveryRuleAction { - return []NameBasicDeliveryRuleAction{NameCacheExpiration, NameDeliveryRuleAction, NameModifyRequestHeader, NameModifyResponseHeader, NameURLRedirect} + return []NameBasicDeliveryRuleAction{NameCacheExpiration, NameCacheKeyQueryString, NameDeliveryRuleAction, NameModifyRequestHeader, NameModifyResponseHeader, NameURLRedirect, NameURLRewrite} } // OptimizationType enumerates the values for optimization type. @@ -379,6 +383,25 @@ func PossibleProtocolTypeValues() []ProtocolType { return []ProtocolType{IPBased, ServerNameIndication} } +// QueryStringBehavior enumerates the values for query string behavior. +type QueryStringBehavior string + +const ( + // Exclude ... + Exclude QueryStringBehavior = "Exclude" + // ExcludeAll ... + ExcludeAll QueryStringBehavior = "ExcludeAll" + // Include ... + Include QueryStringBehavior = "Include" + // IncludeAll ... + IncludeAll QueryStringBehavior = "IncludeAll" +) + +// PossibleQueryStringBehaviorValues returns an array of possible values for the QueryStringBehavior const type. +func PossibleQueryStringBehaviorValues() []QueryStringBehavior { + return []QueryStringBehavior{Exclude, ExcludeAll, Include, IncludeAll} +} + // QueryStringCachingBehavior enumerates the values for query string caching behavior. type QueryStringCachingBehavior string @@ -703,6 +726,15 @@ type CacheExpirationActionParameters struct { CacheDuration *string `json:"cacheDuration,omitempty"` } +// CacheKeyQueryStringActionParameters defines the parameters for the cache-key query string action. +type CacheKeyQueryStringActionParameters struct { + OdataType *string `json:"@odata.type,omitempty"` + // QueryStringBehavior - Caching behavior for the requests. Possible values include: 'Include', 'IncludeAll', 'Exclude', 'ExcludeAll' + QueryStringBehavior QueryStringBehavior `json:"queryStringBehavior,omitempty"` + // QueryParameters - query parameters to include or exclude (comma separated). + QueryParameters *string `json:"queryParameters,omitempty"` +} + // CertificateSourceParameters defines the parameters for using CDN managed certificate for securing custom // domain. type CertificateSourceParameters struct { @@ -1292,15 +1324,17 @@ func (dr *DeliveryRule) UnmarshalJSON(body []byte) error { // BasicDeliveryRuleAction an action for the delivery rule. type BasicDeliveryRuleAction interface { AsURLRedirectAction() (*URLRedirectAction, bool) + AsURLRewriteAction() (*URLRewriteAction, bool) AsDeliveryRuleRequestHeaderAction() (*DeliveryRuleRequestHeaderAction, bool) AsDeliveryRuleResponseHeaderAction() (*DeliveryRuleResponseHeaderAction, bool) AsDeliveryRuleCacheExpirationAction() (*DeliveryRuleCacheExpirationAction, bool) + AsDeliveryRuleCacheKeyQueryStringAction() (*DeliveryRuleCacheKeyQueryStringAction, bool) AsDeliveryRuleAction() (*DeliveryRuleAction, bool) } // DeliveryRuleAction an action for the delivery rule. type DeliveryRuleAction struct { - // Name - Possible values include: 'NameDeliveryRuleAction', 'NameURLRedirect', 'NameModifyRequestHeader', 'NameModifyResponseHeader', 'NameCacheExpiration' + // Name - Possible values include: 'NameDeliveryRuleAction', 'NameURLRedirect', 'NameURLRewrite', 'NameModifyRequestHeader', 'NameModifyResponseHeader', 'NameCacheExpiration', 'NameCacheKeyQueryString' Name NameBasicDeliveryRuleAction `json:"name,omitempty"` } @@ -1316,6 +1350,10 @@ func unmarshalBasicDeliveryRuleAction(body []byte) (BasicDeliveryRuleAction, err var ura URLRedirectAction err := json.Unmarshal(body, &ura) return ura, err + case string(NameURLRewrite): + var ura URLRewriteAction + err := json.Unmarshal(body, &ura) + return ura, err case string(NameModifyRequestHeader): var drrha DeliveryRuleRequestHeaderAction err := json.Unmarshal(body, &drrha) @@ -1328,6 +1366,10 @@ func unmarshalBasicDeliveryRuleAction(body []byte) (BasicDeliveryRuleAction, err var drcea DeliveryRuleCacheExpirationAction err := json.Unmarshal(body, &drcea) return drcea, err + case string(NameCacheKeyQueryString): + var drckqsa DeliveryRuleCacheKeyQueryStringAction + err := json.Unmarshal(body, &drckqsa) + return drckqsa, err default: var dra DeliveryRuleAction err := json.Unmarshal(body, &dra) @@ -1368,6 +1410,11 @@ func (dra DeliveryRuleAction) AsURLRedirectAction() (*URLRedirectAction, bool) { return nil, false } +// AsURLRewriteAction is the BasicDeliveryRuleAction implementation for DeliveryRuleAction. +func (dra DeliveryRuleAction) AsURLRewriteAction() (*URLRewriteAction, bool) { + return nil, false +} + // AsDeliveryRuleRequestHeaderAction is the BasicDeliveryRuleAction implementation for DeliveryRuleAction. func (dra DeliveryRuleAction) AsDeliveryRuleRequestHeaderAction() (*DeliveryRuleRequestHeaderAction, bool) { return nil, false @@ -1383,6 +1430,11 @@ func (dra DeliveryRuleAction) AsDeliveryRuleCacheExpirationAction() (*DeliveryRu return nil, false } +// AsDeliveryRuleCacheKeyQueryStringAction is the BasicDeliveryRuleAction implementation for DeliveryRuleAction. +func (dra DeliveryRuleAction) AsDeliveryRuleCacheKeyQueryStringAction() (*DeliveryRuleCacheKeyQueryStringAction, bool) { + return nil, false +} + // AsDeliveryRuleAction is the BasicDeliveryRuleAction implementation for DeliveryRuleAction. func (dra DeliveryRuleAction) AsDeliveryRuleAction() (*DeliveryRuleAction, bool) { return &dra, true @@ -1397,7 +1449,7 @@ func (dra DeliveryRuleAction) AsBasicDeliveryRuleAction() (BasicDeliveryRuleActi type DeliveryRuleCacheExpirationAction struct { // Parameters - Defines the parameters for the action. Parameters *CacheExpirationActionParameters `json:"parameters,omitempty"` - // Name - Possible values include: 'NameDeliveryRuleAction', 'NameURLRedirect', 'NameModifyRequestHeader', 'NameModifyResponseHeader', 'NameCacheExpiration' + // Name - Possible values include: 'NameDeliveryRuleAction', 'NameURLRedirect', 'NameURLRewrite', 'NameModifyRequestHeader', 'NameModifyResponseHeader', 'NameCacheExpiration', 'NameCacheKeyQueryString' Name NameBasicDeliveryRuleAction `json:"name,omitempty"` } @@ -1419,6 +1471,11 @@ func (drcea DeliveryRuleCacheExpirationAction) AsURLRedirectAction() (*URLRedire return nil, false } +// AsURLRewriteAction is the BasicDeliveryRuleAction implementation for DeliveryRuleCacheExpirationAction. +func (drcea DeliveryRuleCacheExpirationAction) AsURLRewriteAction() (*URLRewriteAction, bool) { + return nil, false +} + // AsDeliveryRuleRequestHeaderAction is the BasicDeliveryRuleAction implementation for DeliveryRuleCacheExpirationAction. func (drcea DeliveryRuleCacheExpirationAction) AsDeliveryRuleRequestHeaderAction() (*DeliveryRuleRequestHeaderAction, bool) { return nil, false @@ -1434,6 +1491,11 @@ func (drcea DeliveryRuleCacheExpirationAction) AsDeliveryRuleCacheExpirationActi return &drcea, true } +// AsDeliveryRuleCacheKeyQueryStringAction is the BasicDeliveryRuleAction implementation for DeliveryRuleCacheExpirationAction. +func (drcea DeliveryRuleCacheExpirationAction) AsDeliveryRuleCacheKeyQueryStringAction() (*DeliveryRuleCacheKeyQueryStringAction, bool) { + return nil, false +} + // AsDeliveryRuleAction is the BasicDeliveryRuleAction implementation for DeliveryRuleCacheExpirationAction. func (drcea DeliveryRuleCacheExpirationAction) AsDeliveryRuleAction() (*DeliveryRuleAction, bool) { return nil, false @@ -1444,6 +1506,67 @@ func (drcea DeliveryRuleCacheExpirationAction) AsBasicDeliveryRuleAction() (Basi return &drcea, true } +// DeliveryRuleCacheKeyQueryStringAction defines the cache-key query string action for the delivery rule. +type DeliveryRuleCacheKeyQueryStringAction struct { + // Parameters - Defines the parameters for the action. + Parameters *CacheKeyQueryStringActionParameters `json:"parameters,omitempty"` + // Name - Possible values include: 'NameDeliveryRuleAction', 'NameURLRedirect', 'NameURLRewrite', 'NameModifyRequestHeader', 'NameModifyResponseHeader', 'NameCacheExpiration', 'NameCacheKeyQueryString' + Name NameBasicDeliveryRuleAction `json:"name,omitempty"` +} + +// MarshalJSON is the custom marshaler for DeliveryRuleCacheKeyQueryStringAction. +func (drckqsa DeliveryRuleCacheKeyQueryStringAction) MarshalJSON() ([]byte, error) { + drckqsa.Name = NameCacheKeyQueryString + objectMap := make(map[string]interface{}) + if drckqsa.Parameters != nil { + objectMap["parameters"] = drckqsa.Parameters + } + if drckqsa.Name != "" { + objectMap["name"] = drckqsa.Name + } + return json.Marshal(objectMap) +} + +// AsURLRedirectAction is the BasicDeliveryRuleAction implementation for DeliveryRuleCacheKeyQueryStringAction. +func (drckqsa DeliveryRuleCacheKeyQueryStringAction) AsURLRedirectAction() (*URLRedirectAction, bool) { + return nil, false +} + +// AsURLRewriteAction is the BasicDeliveryRuleAction implementation for DeliveryRuleCacheKeyQueryStringAction. +func (drckqsa DeliveryRuleCacheKeyQueryStringAction) AsURLRewriteAction() (*URLRewriteAction, bool) { + return nil, false +} + +// AsDeliveryRuleRequestHeaderAction is the BasicDeliveryRuleAction implementation for DeliveryRuleCacheKeyQueryStringAction. +func (drckqsa DeliveryRuleCacheKeyQueryStringAction) AsDeliveryRuleRequestHeaderAction() (*DeliveryRuleRequestHeaderAction, bool) { + return nil, false +} + +// AsDeliveryRuleResponseHeaderAction is the BasicDeliveryRuleAction implementation for DeliveryRuleCacheKeyQueryStringAction. +func (drckqsa DeliveryRuleCacheKeyQueryStringAction) AsDeliveryRuleResponseHeaderAction() (*DeliveryRuleResponseHeaderAction, bool) { + return nil, false +} + +// AsDeliveryRuleCacheExpirationAction is the BasicDeliveryRuleAction implementation for DeliveryRuleCacheKeyQueryStringAction. +func (drckqsa DeliveryRuleCacheKeyQueryStringAction) AsDeliveryRuleCacheExpirationAction() (*DeliveryRuleCacheExpirationAction, bool) { + return nil, false +} + +// AsDeliveryRuleCacheKeyQueryStringAction is the BasicDeliveryRuleAction implementation for DeliveryRuleCacheKeyQueryStringAction. +func (drckqsa DeliveryRuleCacheKeyQueryStringAction) AsDeliveryRuleCacheKeyQueryStringAction() (*DeliveryRuleCacheKeyQueryStringAction, bool) { + return &drckqsa, true +} + +// AsDeliveryRuleAction is the BasicDeliveryRuleAction implementation for DeliveryRuleCacheKeyQueryStringAction. +func (drckqsa DeliveryRuleCacheKeyQueryStringAction) AsDeliveryRuleAction() (*DeliveryRuleAction, bool) { + return nil, false +} + +// AsBasicDeliveryRuleAction is the BasicDeliveryRuleAction implementation for DeliveryRuleCacheKeyQueryStringAction. +func (drckqsa DeliveryRuleCacheKeyQueryStringAction) AsBasicDeliveryRuleAction() (BasicDeliveryRuleAction, bool) { + return &drckqsa, true +} + // BasicDeliveryRuleCondition a condition for the delivery rule. type BasicDeliveryRuleCondition interface { AsDeliveryRuleRemoteAddressCondition() (*DeliveryRuleRemoteAddressCondition, bool) @@ -2087,7 +2210,7 @@ func (drrbc DeliveryRuleRequestBodyCondition) AsBasicDeliveryRuleCondition() (Ba type DeliveryRuleRequestHeaderAction struct { // Parameters - Defines the parameters for the action. Parameters *HeaderActionParameters `json:"parameters,omitempty"` - // Name - Possible values include: 'NameDeliveryRuleAction', 'NameURLRedirect', 'NameModifyRequestHeader', 'NameModifyResponseHeader', 'NameCacheExpiration' + // Name - Possible values include: 'NameDeliveryRuleAction', 'NameURLRedirect', 'NameURLRewrite', 'NameModifyRequestHeader', 'NameModifyResponseHeader', 'NameCacheExpiration', 'NameCacheKeyQueryString' Name NameBasicDeliveryRuleAction `json:"name,omitempty"` } @@ -2109,6 +2232,11 @@ func (drrha DeliveryRuleRequestHeaderAction) AsURLRedirectAction() (*URLRedirect return nil, false } +// AsURLRewriteAction is the BasicDeliveryRuleAction implementation for DeliveryRuleRequestHeaderAction. +func (drrha DeliveryRuleRequestHeaderAction) AsURLRewriteAction() (*URLRewriteAction, bool) { + return nil, false +} + // AsDeliveryRuleRequestHeaderAction is the BasicDeliveryRuleAction implementation for DeliveryRuleRequestHeaderAction. func (drrha DeliveryRuleRequestHeaderAction) AsDeliveryRuleRequestHeaderAction() (*DeliveryRuleRequestHeaderAction, bool) { return &drrha, true @@ -2124,6 +2252,11 @@ func (drrha DeliveryRuleRequestHeaderAction) AsDeliveryRuleCacheExpirationAction return nil, false } +// AsDeliveryRuleCacheKeyQueryStringAction is the BasicDeliveryRuleAction implementation for DeliveryRuleRequestHeaderAction. +func (drrha DeliveryRuleRequestHeaderAction) AsDeliveryRuleCacheKeyQueryStringAction() (*DeliveryRuleCacheKeyQueryStringAction, bool) { + return nil, false +} + // AsDeliveryRuleAction is the BasicDeliveryRuleAction implementation for DeliveryRuleRequestHeaderAction. func (drrha DeliveryRuleRequestHeaderAction) AsDeliveryRuleAction() (*DeliveryRuleAction, bool) { return nil, false @@ -2502,7 +2635,7 @@ func (drruc DeliveryRuleRequestURICondition) AsBasicDeliveryRuleCondition() (Bas type DeliveryRuleResponseHeaderAction struct { // Parameters - Defines the parameters for the action. Parameters *HeaderActionParameters `json:"parameters,omitempty"` - // Name - Possible values include: 'NameDeliveryRuleAction', 'NameURLRedirect', 'NameModifyRequestHeader', 'NameModifyResponseHeader', 'NameCacheExpiration' + // Name - Possible values include: 'NameDeliveryRuleAction', 'NameURLRedirect', 'NameURLRewrite', 'NameModifyRequestHeader', 'NameModifyResponseHeader', 'NameCacheExpiration', 'NameCacheKeyQueryString' Name NameBasicDeliveryRuleAction `json:"name,omitempty"` } @@ -2524,6 +2657,11 @@ func (drrha DeliveryRuleResponseHeaderAction) AsURLRedirectAction() (*URLRedirec return nil, false } +// AsURLRewriteAction is the BasicDeliveryRuleAction implementation for DeliveryRuleResponseHeaderAction. +func (drrha DeliveryRuleResponseHeaderAction) AsURLRewriteAction() (*URLRewriteAction, bool) { + return nil, false +} + // AsDeliveryRuleRequestHeaderAction is the BasicDeliveryRuleAction implementation for DeliveryRuleResponseHeaderAction. func (drrha DeliveryRuleResponseHeaderAction) AsDeliveryRuleRequestHeaderAction() (*DeliveryRuleRequestHeaderAction, bool) { return nil, false @@ -2539,6 +2677,11 @@ func (drrha DeliveryRuleResponseHeaderAction) AsDeliveryRuleCacheExpirationActio return nil, false } +// AsDeliveryRuleCacheKeyQueryStringAction is the BasicDeliveryRuleAction implementation for DeliveryRuleResponseHeaderAction. +func (drrha DeliveryRuleResponseHeaderAction) AsDeliveryRuleCacheKeyQueryStringAction() (*DeliveryRuleCacheKeyQueryStringAction, bool) { + return nil, false +} + // AsDeliveryRuleAction is the BasicDeliveryRuleAction implementation for DeliveryRuleResponseHeaderAction. func (drrha DeliveryRuleResponseHeaderAction) AsDeliveryRuleAction() (*DeliveryRuleAction, bool) { return nil, false @@ -4976,7 +5119,7 @@ type URLPathMatchConditionParameters struct { type URLRedirectAction struct { // Parameters - Defines the parameters for the action. Parameters *URLRedirectActionParameters `json:"parameters,omitempty"` - // Name - Possible values include: 'NameDeliveryRuleAction', 'NameURLRedirect', 'NameModifyRequestHeader', 'NameModifyResponseHeader', 'NameCacheExpiration' + // Name - Possible values include: 'NameDeliveryRuleAction', 'NameURLRedirect', 'NameURLRewrite', 'NameModifyRequestHeader', 'NameModifyResponseHeader', 'NameCacheExpiration', 'NameCacheKeyQueryString' Name NameBasicDeliveryRuleAction `json:"name,omitempty"` } @@ -4998,6 +5141,11 @@ func (ura URLRedirectAction) AsURLRedirectAction() (*URLRedirectAction, bool) { return &ura, true } +// AsURLRewriteAction is the BasicDeliveryRuleAction implementation for URLRedirectAction. +func (ura URLRedirectAction) AsURLRewriteAction() (*URLRewriteAction, bool) { + return nil, false +} + // AsDeliveryRuleRequestHeaderAction is the BasicDeliveryRuleAction implementation for URLRedirectAction. func (ura URLRedirectAction) AsDeliveryRuleRequestHeaderAction() (*DeliveryRuleRequestHeaderAction, bool) { return nil, false @@ -5013,6 +5161,11 @@ func (ura URLRedirectAction) AsDeliveryRuleCacheExpirationAction() (*DeliveryRul return nil, false } +// AsDeliveryRuleCacheKeyQueryStringAction is the BasicDeliveryRuleAction implementation for URLRedirectAction. +func (ura URLRedirectAction) AsDeliveryRuleCacheKeyQueryStringAction() (*DeliveryRuleCacheKeyQueryStringAction, bool) { + return nil, false +} + // AsDeliveryRuleAction is the BasicDeliveryRuleAction implementation for URLRedirectAction. func (ura URLRedirectAction) AsDeliveryRuleAction() (*DeliveryRuleAction, bool) { return nil, false @@ -5040,6 +5193,78 @@ type URLRedirectActionParameters struct { CustomFragment *string `json:"customFragment,omitempty"` } +// URLRewriteAction defines the url rewrite action for the delivery rule. +type URLRewriteAction struct { + // Parameters - Defines the parameters for the action. + Parameters *URLRewriteActionParameters `json:"parameters,omitempty"` + // Name - Possible values include: 'NameDeliveryRuleAction', 'NameURLRedirect', 'NameURLRewrite', 'NameModifyRequestHeader', 'NameModifyResponseHeader', 'NameCacheExpiration', 'NameCacheKeyQueryString' + Name NameBasicDeliveryRuleAction `json:"name,omitempty"` +} + +// MarshalJSON is the custom marshaler for URLRewriteAction. +func (ura URLRewriteAction) MarshalJSON() ([]byte, error) { + ura.Name = NameURLRewrite + objectMap := make(map[string]interface{}) + if ura.Parameters != nil { + objectMap["parameters"] = ura.Parameters + } + if ura.Name != "" { + objectMap["name"] = ura.Name + } + return json.Marshal(objectMap) +} + +// AsURLRedirectAction is the BasicDeliveryRuleAction implementation for URLRewriteAction. +func (ura URLRewriteAction) AsURLRedirectAction() (*URLRedirectAction, bool) { + return nil, false +} + +// AsURLRewriteAction is the BasicDeliveryRuleAction implementation for URLRewriteAction. +func (ura URLRewriteAction) AsURLRewriteAction() (*URLRewriteAction, bool) { + return &ura, true +} + +// AsDeliveryRuleRequestHeaderAction is the BasicDeliveryRuleAction implementation for URLRewriteAction. +func (ura URLRewriteAction) AsDeliveryRuleRequestHeaderAction() (*DeliveryRuleRequestHeaderAction, bool) { + return nil, false +} + +// AsDeliveryRuleResponseHeaderAction is the BasicDeliveryRuleAction implementation for URLRewriteAction. +func (ura URLRewriteAction) AsDeliveryRuleResponseHeaderAction() (*DeliveryRuleResponseHeaderAction, bool) { + return nil, false +} + +// AsDeliveryRuleCacheExpirationAction is the BasicDeliveryRuleAction implementation for URLRewriteAction. +func (ura URLRewriteAction) AsDeliveryRuleCacheExpirationAction() (*DeliveryRuleCacheExpirationAction, bool) { + return nil, false +} + +// AsDeliveryRuleCacheKeyQueryStringAction is the BasicDeliveryRuleAction implementation for URLRewriteAction. +func (ura URLRewriteAction) AsDeliveryRuleCacheKeyQueryStringAction() (*DeliveryRuleCacheKeyQueryStringAction, bool) { + return nil, false +} + +// AsDeliveryRuleAction is the BasicDeliveryRuleAction implementation for URLRewriteAction. +func (ura URLRewriteAction) AsDeliveryRuleAction() (*DeliveryRuleAction, bool) { + return nil, false +} + +// AsBasicDeliveryRuleAction is the BasicDeliveryRuleAction implementation for URLRewriteAction. +func (ura URLRewriteAction) AsBasicDeliveryRuleAction() (BasicDeliveryRuleAction, bool) { + return &ura, true +} + +// URLRewriteActionParameters defines the parameters for the url rewrite action. +type URLRewriteActionParameters struct { + OdataType *string `json:"@odata.type,omitempty"` + // SourcePattern - define a request URI pattern that identifies the type of requests that may be rewritten. If value is blank, all strings are matched. + SourcePattern *string `json:"sourcePattern,omitempty"` + // Destination - Define the relative URL to which the above requests will be rewritten by. + Destination *string `json:"destination,omitempty"` + // PreserveUnmatchedPath - Whether to preserve unmatched path. Default value is true. + PreserveUnmatchedPath *bool `json:"preserveUnmatchedPath,omitempty"` +} + // UserManagedHTTPSParameters defines the certificate source parameters using user's keyvault certificate // for enabling SSL. type UserManagedHTTPSParameters struct {