1package cdn 2 3// Copyright (c) Microsoft Corporation. All rights reserved. 4// Licensed under the MIT License. See License.txt in the project root for license information. 5// 6// Code generated by Microsoft (R) AutoRest Code Generator. 7// Changes may cause incorrect behavior and will be lost if the code is regenerated. 8 9import ( 10 "context" 11 "encoding/json" 12 "github.com/Azure/go-autorest/autorest" 13 "github.com/Azure/go-autorest/autorest/azure" 14 "github.com/Azure/go-autorest/autorest/to" 15 "github.com/Azure/go-autorest/tracing" 16 "net/http" 17) 18 19// The package's fully qualified name. 20const fqdn = "github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2020-04-15/cdn" 21 22// CacheExpirationActionParameters defines the parameters for the cache expiration action. 23type CacheExpirationActionParameters struct { 24 OdataType *string `json:"@odata.type,omitempty"` 25 // CacheBehavior - Caching behavior for the requests. Possible values include: 'BypassCache', 'Override', 'SetIfMissing' 26 CacheBehavior CacheBehavior `json:"cacheBehavior,omitempty"` 27 // CacheType - The level at which the content needs to be cached. 28 CacheType *string `json:"cacheType,omitempty"` 29 // CacheDuration - The duration for which the content needs to be cached. Allowed format is [d.]hh:mm:ss 30 CacheDuration *string `json:"cacheDuration,omitempty"` 31} 32 33// CacheKeyQueryStringActionParameters defines the parameters for the cache-key query string action. 34type CacheKeyQueryStringActionParameters struct { 35 OdataType *string `json:"@odata.type,omitempty"` 36 // QueryStringBehavior - Caching behavior for the requests. Possible values include: 'Include', 'IncludeAll', 'Exclude', 'ExcludeAll' 37 QueryStringBehavior QueryStringBehavior `json:"queryStringBehavior,omitempty"` 38 // QueryParameters - query parameters to include or exclude (comma separated). 39 QueryParameters *string `json:"queryParameters,omitempty"` 40} 41 42// CertificateSourceParameters defines the parameters for using CDN managed certificate for securing custom 43// domain. 44type CertificateSourceParameters struct { 45 OdataType *string `json:"@odata.type,omitempty"` 46 // CertificateType - Type of certificate used. Possible values include: 'Shared', 'Dedicated' 47 CertificateType CertificateType `json:"certificateType,omitempty"` 48} 49 50// CheckNameAvailabilityInput input of CheckNameAvailability API. 51type CheckNameAvailabilityInput struct { 52 // Name - The resource name to validate. 53 Name *string `json:"name,omitempty"` 54 // Type - The type of the resource whose name is to be validated. 55 Type *string `json:"type,omitempty"` 56} 57 58// CheckNameAvailabilityOutput output of check name availability API. 59type CheckNameAvailabilityOutput struct { 60 autorest.Response `json:"-"` 61 // NameAvailable - READ-ONLY; Indicates whether the name is available. 62 NameAvailable *bool `json:"nameAvailable,omitempty"` 63 // Reason - READ-ONLY; The reason why the name is not available. 64 Reason *string `json:"reason,omitempty"` 65 // Message - READ-ONLY; The detailed error message describing why the name is not available. 66 Message *string `json:"message,omitempty"` 67} 68 69// MarshalJSON is the custom marshaler for CheckNameAvailabilityOutput. 70func (cnao CheckNameAvailabilityOutput) MarshalJSON() ([]byte, error) { 71 objectMap := make(map[string]interface{}) 72 return json.Marshal(objectMap) 73} 74 75// CidrIPAddress CIDR Ip address 76type CidrIPAddress struct { 77 // BaseIPAddress - Ip address itself. 78 BaseIPAddress *string `json:"baseIpAddress,omitempty"` 79 // PrefixLength - The length of the prefix of the ip address. 80 PrefixLength *int32 `json:"prefixLength,omitempty"` 81} 82 83// CookiesMatchConditionParameters defines the parameters for Cookies match conditions 84type CookiesMatchConditionParameters struct { 85 OdataType *string `json:"@odata.type,omitempty"` 86 // Selector - Name of Cookies to be matched 87 Selector *string `json:"selector,omitempty"` 88 // Operator - Describes operator to be matched. Possible values include: 'Any', 'Equal', 'Contains', 'BeginsWith', 'EndsWith', 'LessThan', 'LessThanOrEqual', 'GreaterThan', 'GreaterThanOrEqual' 89 Operator CookiesOperator `json:"operator,omitempty"` 90 // NegateCondition - Describes if this is negate condition or not 91 NegateCondition *bool `json:"negateCondition,omitempty"` 92 // MatchValues - The match value for the condition of the delivery rule 93 MatchValues *[]string `json:"matchValues,omitempty"` 94 // Transforms - List of transforms 95 Transforms *[]Transform `json:"transforms,omitempty"` 96} 97 98// CustomDomain friendly domain name mapping to the endpoint hostname that the customer provides for 99// branding purposes, e.g. www.contoso.com. 100type CustomDomain struct { 101 autorest.Response `json:"-"` 102 *CustomDomainProperties `json:"properties,omitempty"` 103 // ID - READ-ONLY; Resource ID. 104 ID *string `json:"id,omitempty"` 105 // Name - READ-ONLY; Resource name. 106 Name *string `json:"name,omitempty"` 107 // Type - READ-ONLY; Resource type. 108 Type *string `json:"type,omitempty"` 109} 110 111// MarshalJSON is the custom marshaler for CustomDomain. 112func (cd CustomDomain) MarshalJSON() ([]byte, error) { 113 objectMap := make(map[string]interface{}) 114 if cd.CustomDomainProperties != nil { 115 objectMap["properties"] = cd.CustomDomainProperties 116 } 117 return json.Marshal(objectMap) 118} 119 120// UnmarshalJSON is the custom unmarshaler for CustomDomain struct. 121func (cd *CustomDomain) UnmarshalJSON(body []byte) error { 122 var m map[string]*json.RawMessage 123 err := json.Unmarshal(body, &m) 124 if err != nil { 125 return err 126 } 127 for k, v := range m { 128 switch k { 129 case "properties": 130 if v != nil { 131 var customDomainProperties CustomDomainProperties 132 err = json.Unmarshal(*v, &customDomainProperties) 133 if err != nil { 134 return err 135 } 136 cd.CustomDomainProperties = &customDomainProperties 137 } 138 case "id": 139 if v != nil { 140 var ID string 141 err = json.Unmarshal(*v, &ID) 142 if err != nil { 143 return err 144 } 145 cd.ID = &ID 146 } 147 case "name": 148 if v != nil { 149 var name string 150 err = json.Unmarshal(*v, &name) 151 if err != nil { 152 return err 153 } 154 cd.Name = &name 155 } 156 case "type": 157 if v != nil { 158 var typeVar string 159 err = json.Unmarshal(*v, &typeVar) 160 if err != nil { 161 return err 162 } 163 cd.Type = &typeVar 164 } 165 } 166 } 167 168 return nil 169} 170 171// BasicCustomDomainHTTPSParameters the JSON object that contains the properties to secure a custom domain. 172type BasicCustomDomainHTTPSParameters interface { 173 AsManagedHTTPSParameters() (*ManagedHTTPSParameters, bool) 174 AsUserManagedHTTPSParameters() (*UserManagedHTTPSParameters, bool) 175 AsCustomDomainHTTPSParameters() (*CustomDomainHTTPSParameters, bool) 176} 177 178// CustomDomainHTTPSParameters the JSON object that contains the properties to secure a custom domain. 179type CustomDomainHTTPSParameters struct { 180 // ProtocolType - Defines the TLS extension protocol that is used for secure delivery. Possible values include: 'ServerNameIndication', 'IPBased' 181 ProtocolType ProtocolType `json:"protocolType,omitempty"` 182 // MinimumTLSVersion - TLS protocol version that will be used for Https. Possible values include: 'None', 'TLS10', 'TLS12' 183 MinimumTLSVersion MinimumTLSVersion `json:"minimumTlsVersion,omitempty"` 184 // CertificateSource - Possible values include: 'CertificateSourceCustomDomainHTTPSParameters', 'CertificateSourceCdn', 'CertificateSourceAzureKeyVault' 185 CertificateSource CertificateSource `json:"certificateSource,omitempty"` 186} 187 188func unmarshalBasicCustomDomainHTTPSParameters(body []byte) (BasicCustomDomainHTTPSParameters, error) { 189 var m map[string]interface{} 190 err := json.Unmarshal(body, &m) 191 if err != nil { 192 return nil, err 193 } 194 195 switch m["certificateSource"] { 196 case string(CertificateSourceCdn): 197 var mhp ManagedHTTPSParameters 198 err := json.Unmarshal(body, &mhp) 199 return mhp, err 200 case string(CertificateSourceAzureKeyVault): 201 var umhp UserManagedHTTPSParameters 202 err := json.Unmarshal(body, &umhp) 203 return umhp, err 204 default: 205 var cdhp CustomDomainHTTPSParameters 206 err := json.Unmarshal(body, &cdhp) 207 return cdhp, err 208 } 209} 210func unmarshalBasicCustomDomainHTTPSParametersArray(body []byte) ([]BasicCustomDomainHTTPSParameters, error) { 211 var rawMessages []*json.RawMessage 212 err := json.Unmarshal(body, &rawMessages) 213 if err != nil { 214 return nil, err 215 } 216 217 cdhpArray := make([]BasicCustomDomainHTTPSParameters, len(rawMessages)) 218 219 for index, rawMessage := range rawMessages { 220 cdhp, err := unmarshalBasicCustomDomainHTTPSParameters(*rawMessage) 221 if err != nil { 222 return nil, err 223 } 224 cdhpArray[index] = cdhp 225 } 226 return cdhpArray, nil 227} 228 229// MarshalJSON is the custom marshaler for CustomDomainHTTPSParameters. 230func (cdhp CustomDomainHTTPSParameters) MarshalJSON() ([]byte, error) { 231 cdhp.CertificateSource = CertificateSourceCustomDomainHTTPSParameters 232 objectMap := make(map[string]interface{}) 233 if cdhp.ProtocolType != "" { 234 objectMap["protocolType"] = cdhp.ProtocolType 235 } 236 if cdhp.MinimumTLSVersion != "" { 237 objectMap["minimumTlsVersion"] = cdhp.MinimumTLSVersion 238 } 239 if cdhp.CertificateSource != "" { 240 objectMap["certificateSource"] = cdhp.CertificateSource 241 } 242 return json.Marshal(objectMap) 243} 244 245// AsManagedHTTPSParameters is the BasicCustomDomainHTTPSParameters implementation for CustomDomainHTTPSParameters. 246func (cdhp CustomDomainHTTPSParameters) AsManagedHTTPSParameters() (*ManagedHTTPSParameters, bool) { 247 return nil, false 248} 249 250// AsUserManagedHTTPSParameters is the BasicCustomDomainHTTPSParameters implementation for CustomDomainHTTPSParameters. 251func (cdhp CustomDomainHTTPSParameters) AsUserManagedHTTPSParameters() (*UserManagedHTTPSParameters, bool) { 252 return nil, false 253} 254 255// AsCustomDomainHTTPSParameters is the BasicCustomDomainHTTPSParameters implementation for CustomDomainHTTPSParameters. 256func (cdhp CustomDomainHTTPSParameters) AsCustomDomainHTTPSParameters() (*CustomDomainHTTPSParameters, bool) { 257 return &cdhp, true 258} 259 260// AsBasicCustomDomainHTTPSParameters is the BasicCustomDomainHTTPSParameters implementation for CustomDomainHTTPSParameters. 261func (cdhp CustomDomainHTTPSParameters) AsBasicCustomDomainHTTPSParameters() (BasicCustomDomainHTTPSParameters, bool) { 262 return &cdhp, true 263} 264 265// CustomDomainListResult result of the request to list custom domains. It contains a list of custom domain 266// objects and a URL link to get the next set of results. 267type CustomDomainListResult struct { 268 autorest.Response `json:"-"` 269 // Value - READ-ONLY; List of CDN CustomDomains within an endpoint. 270 Value *[]CustomDomain `json:"value,omitempty"` 271 // NextLink - URL to get the next set of custom domain objects if there are any. 272 NextLink *string `json:"nextLink,omitempty"` 273} 274 275// MarshalJSON is the custom marshaler for CustomDomainListResult. 276func (cdlr CustomDomainListResult) MarshalJSON() ([]byte, error) { 277 objectMap := make(map[string]interface{}) 278 if cdlr.NextLink != nil { 279 objectMap["nextLink"] = cdlr.NextLink 280 } 281 return json.Marshal(objectMap) 282} 283 284// CustomDomainListResultIterator provides access to a complete listing of CustomDomain values. 285type CustomDomainListResultIterator struct { 286 i int 287 page CustomDomainListResultPage 288} 289 290// NextWithContext advances to the next value. If there was an error making 291// the request the iterator does not advance and the error is returned. 292func (iter *CustomDomainListResultIterator) NextWithContext(ctx context.Context) (err error) { 293 if tracing.IsEnabled() { 294 ctx = tracing.StartSpan(ctx, fqdn+"/CustomDomainListResultIterator.NextWithContext") 295 defer func() { 296 sc := -1 297 if iter.Response().Response.Response != nil { 298 sc = iter.Response().Response.Response.StatusCode 299 } 300 tracing.EndSpan(ctx, sc, err) 301 }() 302 } 303 iter.i++ 304 if iter.i < len(iter.page.Values()) { 305 return nil 306 } 307 err = iter.page.NextWithContext(ctx) 308 if err != nil { 309 iter.i-- 310 return err 311 } 312 iter.i = 0 313 return nil 314} 315 316// Next advances to the next value. If there was an error making 317// the request the iterator does not advance and the error is returned. 318// Deprecated: Use NextWithContext() instead. 319func (iter *CustomDomainListResultIterator) Next() error { 320 return iter.NextWithContext(context.Background()) 321} 322 323// NotDone returns true if the enumeration should be started or is not yet complete. 324func (iter CustomDomainListResultIterator) NotDone() bool { 325 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 326} 327 328// Response returns the raw server response from the last page request. 329func (iter CustomDomainListResultIterator) Response() CustomDomainListResult { 330 return iter.page.Response() 331} 332 333// Value returns the current value or a zero-initialized value if the 334// iterator has advanced beyond the end of the collection. 335func (iter CustomDomainListResultIterator) Value() CustomDomain { 336 if !iter.page.NotDone() { 337 return CustomDomain{} 338 } 339 return iter.page.Values()[iter.i] 340} 341 342// Creates a new instance of the CustomDomainListResultIterator type. 343func NewCustomDomainListResultIterator(page CustomDomainListResultPage) CustomDomainListResultIterator { 344 return CustomDomainListResultIterator{page: page} 345} 346 347// IsEmpty returns true if the ListResult contains no values. 348func (cdlr CustomDomainListResult) IsEmpty() bool { 349 return cdlr.Value == nil || len(*cdlr.Value) == 0 350} 351 352// hasNextLink returns true if the NextLink is not empty. 353func (cdlr CustomDomainListResult) hasNextLink() bool { 354 return cdlr.NextLink != nil && len(*cdlr.NextLink) != 0 355} 356 357// customDomainListResultPreparer prepares a request to retrieve the next set of results. 358// It returns nil if no more results exist. 359func (cdlr CustomDomainListResult) customDomainListResultPreparer(ctx context.Context) (*http.Request, error) { 360 if !cdlr.hasNextLink() { 361 return nil, nil 362 } 363 return autorest.Prepare((&http.Request{}).WithContext(ctx), 364 autorest.AsJSON(), 365 autorest.AsGet(), 366 autorest.WithBaseURL(to.String(cdlr.NextLink))) 367} 368 369// CustomDomainListResultPage contains a page of CustomDomain values. 370type CustomDomainListResultPage struct { 371 fn func(context.Context, CustomDomainListResult) (CustomDomainListResult, error) 372 cdlr CustomDomainListResult 373} 374 375// NextWithContext advances to the next page of values. If there was an error making 376// the request the page does not advance and the error is returned. 377func (page *CustomDomainListResultPage) NextWithContext(ctx context.Context) (err error) { 378 if tracing.IsEnabled() { 379 ctx = tracing.StartSpan(ctx, fqdn+"/CustomDomainListResultPage.NextWithContext") 380 defer func() { 381 sc := -1 382 if page.Response().Response.Response != nil { 383 sc = page.Response().Response.Response.StatusCode 384 } 385 tracing.EndSpan(ctx, sc, err) 386 }() 387 } 388 for { 389 next, err := page.fn(ctx, page.cdlr) 390 if err != nil { 391 return err 392 } 393 page.cdlr = next 394 if !next.hasNextLink() || !next.IsEmpty() { 395 break 396 } 397 } 398 return nil 399} 400 401// Next advances to the next page of values. If there was an error making 402// the request the page does not advance and the error is returned. 403// Deprecated: Use NextWithContext() instead. 404func (page *CustomDomainListResultPage) Next() error { 405 return page.NextWithContext(context.Background()) 406} 407 408// NotDone returns true if the page enumeration should be started or is not yet complete. 409func (page CustomDomainListResultPage) NotDone() bool { 410 return !page.cdlr.IsEmpty() 411} 412 413// Response returns the raw server response from the last page request. 414func (page CustomDomainListResultPage) Response() CustomDomainListResult { 415 return page.cdlr 416} 417 418// Values returns the slice of values for the current page or nil if there are no values. 419func (page CustomDomainListResultPage) Values() []CustomDomain { 420 if page.cdlr.IsEmpty() { 421 return nil 422 } 423 return *page.cdlr.Value 424} 425 426// Creates a new instance of the CustomDomainListResultPage type. 427func NewCustomDomainListResultPage(cur CustomDomainListResult, getNextPage func(context.Context, CustomDomainListResult) (CustomDomainListResult, error)) CustomDomainListResultPage { 428 return CustomDomainListResultPage{ 429 fn: getNextPage, 430 cdlr: cur, 431 } 432} 433 434// CustomDomainParameters the customDomain JSON object required for custom domain creation or update. 435type CustomDomainParameters struct { 436 *CustomDomainPropertiesParameters `json:"properties,omitempty"` 437} 438 439// MarshalJSON is the custom marshaler for CustomDomainParameters. 440func (cdp CustomDomainParameters) MarshalJSON() ([]byte, error) { 441 objectMap := make(map[string]interface{}) 442 if cdp.CustomDomainPropertiesParameters != nil { 443 objectMap["properties"] = cdp.CustomDomainPropertiesParameters 444 } 445 return json.Marshal(objectMap) 446} 447 448// UnmarshalJSON is the custom unmarshaler for CustomDomainParameters struct. 449func (cdp *CustomDomainParameters) UnmarshalJSON(body []byte) error { 450 var m map[string]*json.RawMessage 451 err := json.Unmarshal(body, &m) 452 if err != nil { 453 return err 454 } 455 for k, v := range m { 456 switch k { 457 case "properties": 458 if v != nil { 459 var customDomainPropertiesParameters CustomDomainPropertiesParameters 460 err = json.Unmarshal(*v, &customDomainPropertiesParameters) 461 if err != nil { 462 return err 463 } 464 cdp.CustomDomainPropertiesParameters = &customDomainPropertiesParameters 465 } 466 } 467 } 468 469 return nil 470} 471 472// CustomDomainProperties the JSON object that contains the properties of the custom domain to create. 473type CustomDomainProperties struct { 474 // HostName - The host name of the custom domain. Must be a domain name. 475 HostName *string `json:"hostName,omitempty"` 476 // ResourceState - READ-ONLY; Resource status of the custom domain. Possible values include: 'Creating', 'Active', 'Deleting' 477 ResourceState CustomDomainResourceState `json:"resourceState,omitempty"` 478 // CustomHTTPSProvisioningState - READ-ONLY; Provisioning status of Custom Https of the custom domain. Possible values include: 'Enabling', 'Enabled', 'Disabling', 'Disabled', 'Failed' 479 CustomHTTPSProvisioningState CustomHTTPSProvisioningState `json:"customHttpsProvisioningState,omitempty"` 480 // CustomHTTPSProvisioningSubstate - READ-ONLY; Provisioning substate shows the progress of custom HTTPS enabling/disabling process step by step. Possible values include: 'SubmittingDomainControlValidationRequest', 'PendingDomainControlValidationREquestApproval', 'DomainControlValidationRequestApproved', 'DomainControlValidationRequestRejected', 'DomainControlValidationRequestTimedOut', 'IssuingCertificate', 'DeployingCertificate', 'CertificateDeployed', 'DeletingCertificate', 'CertificateDeleted' 481 CustomHTTPSProvisioningSubstate CustomHTTPSProvisioningSubstate `json:"customHttpsProvisioningSubstate,omitempty"` 482 // ValidationData - Special validation or data may be required when delivering CDN to some regions due to local compliance reasons. E.g. ICP license number of a custom domain is required to deliver content in China. 483 ValidationData *string `json:"validationData,omitempty"` 484 // ProvisioningState - READ-ONLY; Provisioning status of the custom domain. 485 ProvisioningState *string `json:"provisioningState,omitempty"` 486} 487 488// MarshalJSON is the custom marshaler for CustomDomainProperties. 489func (cdp CustomDomainProperties) MarshalJSON() ([]byte, error) { 490 objectMap := make(map[string]interface{}) 491 if cdp.HostName != nil { 492 objectMap["hostName"] = cdp.HostName 493 } 494 if cdp.ValidationData != nil { 495 objectMap["validationData"] = cdp.ValidationData 496 } 497 return json.Marshal(objectMap) 498} 499 500// CustomDomainPropertiesParameters the JSON object that contains the properties of the custom domain to 501// create. 502type CustomDomainPropertiesParameters struct { 503 // HostName - The host name of the custom domain. Must be a domain name. 504 HostName *string `json:"hostName,omitempty"` 505} 506 507// CustomDomainsCreateFuture an abstraction for monitoring and retrieving the results of a long-running 508// operation. 509type CustomDomainsCreateFuture struct { 510 azure.FutureAPI 511 // Result returns the result of the asynchronous operation. 512 // If the operation has not completed it will return an error. 513 Result func(CustomDomainsClient) (CustomDomain, error) 514} 515 516// UnmarshalJSON is the custom unmarshaller for CreateFuture. 517func (future *CustomDomainsCreateFuture) UnmarshalJSON(body []byte) error { 518 var azFuture azure.Future 519 if err := json.Unmarshal(body, &azFuture); err != nil { 520 return err 521 } 522 future.FutureAPI = &azFuture 523 future.Result = future.result 524 return nil 525} 526 527// result is the default implementation for CustomDomainsCreateFuture.Result. 528func (future *CustomDomainsCreateFuture) result(client CustomDomainsClient) (cd CustomDomain, err error) { 529 var done bool 530 done, err = future.DoneWithContext(context.Background(), client) 531 if err != nil { 532 err = autorest.NewErrorWithError(err, "cdn.CustomDomainsCreateFuture", "Result", future.Response(), "Polling failure") 533 return 534 } 535 if !done { 536 cd.Response.Response = future.Response() 537 err = azure.NewAsyncOpIncompleteError("cdn.CustomDomainsCreateFuture") 538 return 539 } 540 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 541 if cd.Response.Response, err = future.GetResult(sender); err == nil && cd.Response.Response.StatusCode != http.StatusNoContent { 542 cd, err = client.CreateResponder(cd.Response.Response) 543 if err != nil { 544 err = autorest.NewErrorWithError(err, "cdn.CustomDomainsCreateFuture", "Result", cd.Response.Response, "Failure responding to request") 545 } 546 } 547 return 548} 549 550// CustomDomainsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running 551// operation. 552type CustomDomainsDeleteFuture struct { 553 azure.FutureAPI 554 // Result returns the result of the asynchronous operation. 555 // If the operation has not completed it will return an error. 556 Result func(CustomDomainsClient) (CustomDomain, error) 557} 558 559// UnmarshalJSON is the custom unmarshaller for CreateFuture. 560func (future *CustomDomainsDeleteFuture) UnmarshalJSON(body []byte) error { 561 var azFuture azure.Future 562 if err := json.Unmarshal(body, &azFuture); err != nil { 563 return err 564 } 565 future.FutureAPI = &azFuture 566 future.Result = future.result 567 return nil 568} 569 570// result is the default implementation for CustomDomainsDeleteFuture.Result. 571func (future *CustomDomainsDeleteFuture) result(client CustomDomainsClient) (cd CustomDomain, err error) { 572 var done bool 573 done, err = future.DoneWithContext(context.Background(), client) 574 if err != nil { 575 err = autorest.NewErrorWithError(err, "cdn.CustomDomainsDeleteFuture", "Result", future.Response(), "Polling failure") 576 return 577 } 578 if !done { 579 cd.Response.Response = future.Response() 580 err = azure.NewAsyncOpIncompleteError("cdn.CustomDomainsDeleteFuture") 581 return 582 } 583 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 584 if cd.Response.Response, err = future.GetResult(sender); err == nil && cd.Response.Response.StatusCode != http.StatusNoContent { 585 cd, err = client.DeleteResponder(cd.Response.Response) 586 if err != nil { 587 err = autorest.NewErrorWithError(err, "cdn.CustomDomainsDeleteFuture", "Result", cd.Response.Response, "Failure responding to request") 588 } 589 } 590 return 591} 592 593// CustomRule defines the common attributes for a custom rule that can be included in a waf policy 594type CustomRule struct { 595 // Name - Defines the name of the custom rule 596 Name *string `json:"name,omitempty"` 597 // EnabledState - Describes if the custom rule is in enabled or disabled state. Defaults to Enabled if not specified. Possible values include: 'CustomRuleEnabledStateDisabled', 'CustomRuleEnabledStateEnabled' 598 EnabledState CustomRuleEnabledState `json:"enabledState,omitempty"` 599 // Priority - Defines in what order this rule be evaluated in the overall list of custom rules 600 Priority *int32 `json:"priority,omitempty"` 601 // MatchConditions - List of match conditions. 602 MatchConditions *[]MatchCondition `json:"matchConditions,omitempty"` 603 // Action - Describes what action to be applied when rule matches. Possible values include: 'Allow', 'Block', 'Log', 'Redirect' 604 Action ActionType `json:"action,omitempty"` 605} 606 607// CustomRuleList defines contents of custom rules 608type CustomRuleList struct { 609 // Rules - List of rules 610 Rules *[]CustomRule `json:"rules,omitempty"` 611} 612 613// DeepCreatedOrigin the main origin of CDN content which is added when creating a CDN endpoint. 614type DeepCreatedOrigin struct { 615 // Name - Origin name which must be unique within the endpoint. 616 Name *string `json:"name,omitempty"` 617 *DeepCreatedOriginProperties `json:"properties,omitempty"` 618} 619 620// MarshalJSON is the custom marshaler for DeepCreatedOrigin. 621func (dco DeepCreatedOrigin) MarshalJSON() ([]byte, error) { 622 objectMap := make(map[string]interface{}) 623 if dco.Name != nil { 624 objectMap["name"] = dco.Name 625 } 626 if dco.DeepCreatedOriginProperties != nil { 627 objectMap["properties"] = dco.DeepCreatedOriginProperties 628 } 629 return json.Marshal(objectMap) 630} 631 632// UnmarshalJSON is the custom unmarshaler for DeepCreatedOrigin struct. 633func (dco *DeepCreatedOrigin) UnmarshalJSON(body []byte) error { 634 var m map[string]*json.RawMessage 635 err := json.Unmarshal(body, &m) 636 if err != nil { 637 return err 638 } 639 for k, v := range m { 640 switch k { 641 case "name": 642 if v != nil { 643 var name string 644 err = json.Unmarshal(*v, &name) 645 if err != nil { 646 return err 647 } 648 dco.Name = &name 649 } 650 case "properties": 651 if v != nil { 652 var deepCreatedOriginProperties DeepCreatedOriginProperties 653 err = json.Unmarshal(*v, &deepCreatedOriginProperties) 654 if err != nil { 655 return err 656 } 657 dco.DeepCreatedOriginProperties = &deepCreatedOriginProperties 658 } 659 } 660 } 661 662 return nil 663} 664 665// DeepCreatedOriginGroup the origin group for CDN content which is added when creating a CDN endpoint. 666// Traffic is sent to the origins within the origin group based on origin health. 667type DeepCreatedOriginGroup struct { 668 // Name - Origin group name which must be unique within the endpoint. 669 Name *string `json:"name,omitempty"` 670 *DeepCreatedOriginGroupProperties `json:"properties,omitempty"` 671} 672 673// MarshalJSON is the custom marshaler for DeepCreatedOriginGroup. 674func (dcog DeepCreatedOriginGroup) MarshalJSON() ([]byte, error) { 675 objectMap := make(map[string]interface{}) 676 if dcog.Name != nil { 677 objectMap["name"] = dcog.Name 678 } 679 if dcog.DeepCreatedOriginGroupProperties != nil { 680 objectMap["properties"] = dcog.DeepCreatedOriginGroupProperties 681 } 682 return json.Marshal(objectMap) 683} 684 685// UnmarshalJSON is the custom unmarshaler for DeepCreatedOriginGroup struct. 686func (dcog *DeepCreatedOriginGroup) UnmarshalJSON(body []byte) error { 687 var m map[string]*json.RawMessage 688 err := json.Unmarshal(body, &m) 689 if err != nil { 690 return err 691 } 692 for k, v := range m { 693 switch k { 694 case "name": 695 if v != nil { 696 var name string 697 err = json.Unmarshal(*v, &name) 698 if err != nil { 699 return err 700 } 701 dcog.Name = &name 702 } 703 case "properties": 704 if v != nil { 705 var deepCreatedOriginGroupProperties DeepCreatedOriginGroupProperties 706 err = json.Unmarshal(*v, &deepCreatedOriginGroupProperties) 707 if err != nil { 708 return err 709 } 710 dcog.DeepCreatedOriginGroupProperties = &deepCreatedOriginGroupProperties 711 } 712 } 713 } 714 715 return nil 716} 717 718// DeepCreatedOriginGroupProperties properties of the origin group created on the CDN endpoint. 719type DeepCreatedOriginGroupProperties struct { 720 // HealthProbeSettings - Health probe settings to the origin that is used to determine the health of the origin. 721 HealthProbeSettings *HealthProbeParameters `json:"healthProbeSettings,omitempty"` 722 // Origins - The source of the content being delivered via CDN within given origin group. 723 Origins *[]ResourceReference `json:"origins,omitempty"` 724 // TrafficRestorationTimeToHealedOrNewEndpointsInMinutes - Time in minutes to shift the traffic to the endpoint gradually when an unhealthy endpoint comes healthy or a new endpoint is added. Default is 10 mins. This property is currently not supported. 725 TrafficRestorationTimeToHealedOrNewEndpointsInMinutes *int32 `json:"trafficRestorationTimeToHealedOrNewEndpointsInMinutes,omitempty"` 726 // ResponseBasedOriginErrorDetectionSettings - The JSON object that contains the properties to determine origin health using real requests/responses.This property is currently not supported. 727 ResponseBasedOriginErrorDetectionSettings *ResponseBasedOriginErrorDetectionParameters `json:"responseBasedOriginErrorDetectionSettings,omitempty"` 728} 729 730// DeepCreatedOriginProperties properties of the origin created on the CDN endpoint. 731type DeepCreatedOriginProperties struct { 732 // HostName - The address of the origin. It can be a domain name, IPv4 address, or IPv6 address. This should be unique across all origins in an endpoint. 733 HostName *string `json:"hostName,omitempty"` 734 // HTTPPort - The value of the HTTP port. Must be between 1 and 65535. 735 HTTPPort *int32 `json:"httpPort,omitempty"` 736 // HTTPSPort - The value of the HTTPS port. Must be between 1 and 65535. 737 HTTPSPort *int32 `json:"httpsPort,omitempty"` 738 // OriginHostHeader - The host header value sent to the origin with each request. If you leave this blank, the request hostname determines this value. Azure CDN origins, such as Web Apps, Blob Storage, and Cloud Services require this host header value to match the origin hostname by default. 739 OriginHostHeader *string `json:"originHostHeader,omitempty"` 740 // Priority - Priority of origin in given origin group for load balancing. Higher priorities will not be used for load balancing if any lower priority origin is healthy.Must be between 1 and 5. 741 Priority *int32 `json:"priority,omitempty"` 742 // Weight - Weight of the origin in given origin group for load balancing. Must be between 1 and 1000 743 Weight *int32 `json:"weight,omitempty"` 744 // Enabled - Origin is enabled for load balancing or not. By default, origin is always enabled. 745 Enabled *bool `json:"enabled,omitempty"` 746 // PrivateLinkAlias - The Alias of the Private Link resource. Populating this optional field indicates that this origin is 'Private' 747 PrivateLinkAlias *string `json:"privateLinkAlias,omitempty"` 748 // PrivateLinkResourceID - The Resource Id of the Private Link resource. Populating this optional field indicates that this backend is 'Private' 749 PrivateLinkResourceID *string `json:"privateLinkResourceId,omitempty"` 750 // PrivateLinkLocation - The location of the Private Link resource. Required only if 'privateLinkResourceId' is populated 751 PrivateLinkLocation *string `json:"privateLinkLocation,omitempty"` 752 // PrivateLinkApprovalMessage - A custom message to be included in the approval request to connect to the Private Link. 753 PrivateLinkApprovalMessage *string `json:"privateLinkApprovalMessage,omitempty"` 754} 755 756// DeliveryRule a rule that specifies a set of actions and conditions 757type DeliveryRule struct { 758 // Name - Name of the rule 759 Name *string `json:"name,omitempty"` 760 // Order - The order in which the rules are applied for the endpoint. Possible values {0,1,2,3,………}. A rule with a lesser order will be applied before a rule with a greater order. Rule with order 0 is a special rule. It does not require any condition and actions listed in it will always be applied. 761 Order *int32 `json:"order,omitempty"` 762 // Conditions - A list of conditions that must be matched for the actions to be executed 763 Conditions *[]BasicDeliveryRuleCondition `json:"conditions,omitempty"` 764 // Actions - A list of actions that are executed when all the conditions of a rule are satisfied. 765 Actions *[]BasicDeliveryRuleAction `json:"actions,omitempty"` 766} 767 768// UnmarshalJSON is the custom unmarshaler for DeliveryRule struct. 769func (dr *DeliveryRule) UnmarshalJSON(body []byte) error { 770 var m map[string]*json.RawMessage 771 err := json.Unmarshal(body, &m) 772 if err != nil { 773 return err 774 } 775 for k, v := range m { 776 switch k { 777 case "name": 778 if v != nil { 779 var name string 780 err = json.Unmarshal(*v, &name) 781 if err != nil { 782 return err 783 } 784 dr.Name = &name 785 } 786 case "order": 787 if v != nil { 788 var order int32 789 err = json.Unmarshal(*v, &order) 790 if err != nil { 791 return err 792 } 793 dr.Order = &order 794 } 795 case "conditions": 796 if v != nil { 797 conditions, err := unmarshalBasicDeliveryRuleConditionArray(*v) 798 if err != nil { 799 return err 800 } 801 dr.Conditions = &conditions 802 } 803 case "actions": 804 if v != nil { 805 actions, err := unmarshalBasicDeliveryRuleActionArray(*v) 806 if err != nil { 807 return err 808 } 809 dr.Actions = &actions 810 } 811 } 812 } 813 814 return nil 815} 816 817// BasicDeliveryRuleAction an action for the delivery rule. 818type BasicDeliveryRuleAction interface { 819 AsURLRedirectAction() (*URLRedirectAction, bool) 820 AsURLSigningAction() (*URLSigningAction, bool) 821 AsURLRewriteAction() (*URLRewriteAction, bool) 822 AsDeliveryRuleRequestHeaderAction() (*DeliveryRuleRequestHeaderAction, bool) 823 AsDeliveryRuleResponseHeaderAction() (*DeliveryRuleResponseHeaderAction, bool) 824 AsDeliveryRuleCacheExpirationAction() (*DeliveryRuleCacheExpirationAction, bool) 825 AsDeliveryRuleCacheKeyQueryStringAction() (*DeliveryRuleCacheKeyQueryStringAction, bool) 826 AsDeliveryRuleAction() (*DeliveryRuleAction, bool) 827} 828 829// DeliveryRuleAction an action for the delivery rule. 830type DeliveryRuleAction struct { 831 // Name - Possible values include: 'NameDeliveryRuleAction', 'NameURLRedirect', 'NameURLSigning', 'NameURLRewrite', 'NameModifyRequestHeader', 'NameModifyResponseHeader', 'NameCacheExpiration', 'NameCacheKeyQueryString' 832 Name NameBasicDeliveryRuleAction `json:"name,omitempty"` 833} 834 835func unmarshalBasicDeliveryRuleAction(body []byte) (BasicDeliveryRuleAction, error) { 836 var m map[string]interface{} 837 err := json.Unmarshal(body, &m) 838 if err != nil { 839 return nil, err 840 } 841 842 switch m["name"] { 843 case string(NameURLRedirect): 844 var ura URLRedirectAction 845 err := json.Unmarshal(body, &ura) 846 return ura, err 847 case string(NameURLSigning): 848 var usa URLSigningAction 849 err := json.Unmarshal(body, &usa) 850 return usa, err 851 case string(NameURLRewrite): 852 var ura URLRewriteAction 853 err := json.Unmarshal(body, &ura) 854 return ura, err 855 case string(NameModifyRequestHeader): 856 var drrha DeliveryRuleRequestHeaderAction 857 err := json.Unmarshal(body, &drrha) 858 return drrha, err 859 case string(NameModifyResponseHeader): 860 var drrha DeliveryRuleResponseHeaderAction 861 err := json.Unmarshal(body, &drrha) 862 return drrha, err 863 case string(NameCacheExpiration): 864 var drcea DeliveryRuleCacheExpirationAction 865 err := json.Unmarshal(body, &drcea) 866 return drcea, err 867 case string(NameCacheKeyQueryString): 868 var drckqsa DeliveryRuleCacheKeyQueryStringAction 869 err := json.Unmarshal(body, &drckqsa) 870 return drckqsa, err 871 default: 872 var dra DeliveryRuleAction 873 err := json.Unmarshal(body, &dra) 874 return dra, err 875 } 876} 877func unmarshalBasicDeliveryRuleActionArray(body []byte) ([]BasicDeliveryRuleAction, error) { 878 var rawMessages []*json.RawMessage 879 err := json.Unmarshal(body, &rawMessages) 880 if err != nil { 881 return nil, err 882 } 883 884 draArray := make([]BasicDeliveryRuleAction, len(rawMessages)) 885 886 for index, rawMessage := range rawMessages { 887 dra, err := unmarshalBasicDeliveryRuleAction(*rawMessage) 888 if err != nil { 889 return nil, err 890 } 891 draArray[index] = dra 892 } 893 return draArray, nil 894} 895 896// MarshalJSON is the custom marshaler for DeliveryRuleAction. 897func (dra DeliveryRuleAction) MarshalJSON() ([]byte, error) { 898 dra.Name = NameDeliveryRuleAction 899 objectMap := make(map[string]interface{}) 900 if dra.Name != "" { 901 objectMap["name"] = dra.Name 902 } 903 return json.Marshal(objectMap) 904} 905 906// AsURLRedirectAction is the BasicDeliveryRuleAction implementation for DeliveryRuleAction. 907func (dra DeliveryRuleAction) AsURLRedirectAction() (*URLRedirectAction, bool) { 908 return nil, false 909} 910 911// AsURLSigningAction is the BasicDeliveryRuleAction implementation for DeliveryRuleAction. 912func (dra DeliveryRuleAction) AsURLSigningAction() (*URLSigningAction, bool) { 913 return nil, false 914} 915 916// AsURLRewriteAction is the BasicDeliveryRuleAction implementation for DeliveryRuleAction. 917func (dra DeliveryRuleAction) AsURLRewriteAction() (*URLRewriteAction, bool) { 918 return nil, false 919} 920 921// AsDeliveryRuleRequestHeaderAction is the BasicDeliveryRuleAction implementation for DeliveryRuleAction. 922func (dra DeliveryRuleAction) AsDeliveryRuleRequestHeaderAction() (*DeliveryRuleRequestHeaderAction, bool) { 923 return nil, false 924} 925 926// AsDeliveryRuleResponseHeaderAction is the BasicDeliveryRuleAction implementation for DeliveryRuleAction. 927func (dra DeliveryRuleAction) AsDeliveryRuleResponseHeaderAction() (*DeliveryRuleResponseHeaderAction, bool) { 928 return nil, false 929} 930 931// AsDeliveryRuleCacheExpirationAction is the BasicDeliveryRuleAction implementation for DeliveryRuleAction. 932func (dra DeliveryRuleAction) AsDeliveryRuleCacheExpirationAction() (*DeliveryRuleCacheExpirationAction, bool) { 933 return nil, false 934} 935 936// AsDeliveryRuleCacheKeyQueryStringAction is the BasicDeliveryRuleAction implementation for DeliveryRuleAction. 937func (dra DeliveryRuleAction) AsDeliveryRuleCacheKeyQueryStringAction() (*DeliveryRuleCacheKeyQueryStringAction, bool) { 938 return nil, false 939} 940 941// AsDeliveryRuleAction is the BasicDeliveryRuleAction implementation for DeliveryRuleAction. 942func (dra DeliveryRuleAction) AsDeliveryRuleAction() (*DeliveryRuleAction, bool) { 943 return &dra, true 944} 945 946// AsBasicDeliveryRuleAction is the BasicDeliveryRuleAction implementation for DeliveryRuleAction. 947func (dra DeliveryRuleAction) AsBasicDeliveryRuleAction() (BasicDeliveryRuleAction, bool) { 948 return &dra, true 949} 950 951// DeliveryRuleCacheExpirationAction defines the cache expiration action for the delivery rule. 952type DeliveryRuleCacheExpirationAction struct { 953 // Parameters - Defines the parameters for the action. 954 Parameters *CacheExpirationActionParameters `json:"parameters,omitempty"` 955 // Name - Possible values include: 'NameDeliveryRuleAction', 'NameURLRedirect', 'NameURLSigning', 'NameURLRewrite', 'NameModifyRequestHeader', 'NameModifyResponseHeader', 'NameCacheExpiration', 'NameCacheKeyQueryString' 956 Name NameBasicDeliveryRuleAction `json:"name,omitempty"` 957} 958 959// MarshalJSON is the custom marshaler for DeliveryRuleCacheExpirationAction. 960func (drcea DeliveryRuleCacheExpirationAction) MarshalJSON() ([]byte, error) { 961 drcea.Name = NameCacheExpiration 962 objectMap := make(map[string]interface{}) 963 if drcea.Parameters != nil { 964 objectMap["parameters"] = drcea.Parameters 965 } 966 if drcea.Name != "" { 967 objectMap["name"] = drcea.Name 968 } 969 return json.Marshal(objectMap) 970} 971 972// AsURLRedirectAction is the BasicDeliveryRuleAction implementation for DeliveryRuleCacheExpirationAction. 973func (drcea DeliveryRuleCacheExpirationAction) AsURLRedirectAction() (*URLRedirectAction, bool) { 974 return nil, false 975} 976 977// AsURLSigningAction is the BasicDeliveryRuleAction implementation for DeliveryRuleCacheExpirationAction. 978func (drcea DeliveryRuleCacheExpirationAction) AsURLSigningAction() (*URLSigningAction, bool) { 979 return nil, false 980} 981 982// AsURLRewriteAction is the BasicDeliveryRuleAction implementation for DeliveryRuleCacheExpirationAction. 983func (drcea DeliveryRuleCacheExpirationAction) AsURLRewriteAction() (*URLRewriteAction, bool) { 984 return nil, false 985} 986 987// AsDeliveryRuleRequestHeaderAction is the BasicDeliveryRuleAction implementation for DeliveryRuleCacheExpirationAction. 988func (drcea DeliveryRuleCacheExpirationAction) AsDeliveryRuleRequestHeaderAction() (*DeliveryRuleRequestHeaderAction, bool) { 989 return nil, false 990} 991 992// AsDeliveryRuleResponseHeaderAction is the BasicDeliveryRuleAction implementation for DeliveryRuleCacheExpirationAction. 993func (drcea DeliveryRuleCacheExpirationAction) AsDeliveryRuleResponseHeaderAction() (*DeliveryRuleResponseHeaderAction, bool) { 994 return nil, false 995} 996 997// AsDeliveryRuleCacheExpirationAction is the BasicDeliveryRuleAction implementation for DeliveryRuleCacheExpirationAction. 998func (drcea DeliveryRuleCacheExpirationAction) AsDeliveryRuleCacheExpirationAction() (*DeliveryRuleCacheExpirationAction, bool) { 999 return &drcea, true 1000} 1001 1002// AsDeliveryRuleCacheKeyQueryStringAction is the BasicDeliveryRuleAction implementation for DeliveryRuleCacheExpirationAction. 1003func (drcea DeliveryRuleCacheExpirationAction) AsDeliveryRuleCacheKeyQueryStringAction() (*DeliveryRuleCacheKeyQueryStringAction, bool) { 1004 return nil, false 1005} 1006 1007// AsDeliveryRuleAction is the BasicDeliveryRuleAction implementation for DeliveryRuleCacheExpirationAction. 1008func (drcea DeliveryRuleCacheExpirationAction) AsDeliveryRuleAction() (*DeliveryRuleAction, bool) { 1009 return nil, false 1010} 1011 1012// AsBasicDeliveryRuleAction is the BasicDeliveryRuleAction implementation for DeliveryRuleCacheExpirationAction. 1013func (drcea DeliveryRuleCacheExpirationAction) AsBasicDeliveryRuleAction() (BasicDeliveryRuleAction, bool) { 1014 return &drcea, true 1015} 1016 1017// DeliveryRuleCacheKeyQueryStringAction defines the cache-key query string action for the delivery rule. 1018type DeliveryRuleCacheKeyQueryStringAction struct { 1019 // Parameters - Defines the parameters for the action. 1020 Parameters *CacheKeyQueryStringActionParameters `json:"parameters,omitempty"` 1021 // Name - Possible values include: 'NameDeliveryRuleAction', 'NameURLRedirect', 'NameURLSigning', 'NameURLRewrite', 'NameModifyRequestHeader', 'NameModifyResponseHeader', 'NameCacheExpiration', 'NameCacheKeyQueryString' 1022 Name NameBasicDeliveryRuleAction `json:"name,omitempty"` 1023} 1024 1025// MarshalJSON is the custom marshaler for DeliveryRuleCacheKeyQueryStringAction. 1026func (drckqsa DeliveryRuleCacheKeyQueryStringAction) MarshalJSON() ([]byte, error) { 1027 drckqsa.Name = NameCacheKeyQueryString 1028 objectMap := make(map[string]interface{}) 1029 if drckqsa.Parameters != nil { 1030 objectMap["parameters"] = drckqsa.Parameters 1031 } 1032 if drckqsa.Name != "" { 1033 objectMap["name"] = drckqsa.Name 1034 } 1035 return json.Marshal(objectMap) 1036} 1037 1038// AsURLRedirectAction is the BasicDeliveryRuleAction implementation for DeliveryRuleCacheKeyQueryStringAction. 1039func (drckqsa DeliveryRuleCacheKeyQueryStringAction) AsURLRedirectAction() (*URLRedirectAction, bool) { 1040 return nil, false 1041} 1042 1043// AsURLSigningAction is the BasicDeliveryRuleAction implementation for DeliveryRuleCacheKeyQueryStringAction. 1044func (drckqsa DeliveryRuleCacheKeyQueryStringAction) AsURLSigningAction() (*URLSigningAction, bool) { 1045 return nil, false 1046} 1047 1048// AsURLRewriteAction is the BasicDeliveryRuleAction implementation for DeliveryRuleCacheKeyQueryStringAction. 1049func (drckqsa DeliveryRuleCacheKeyQueryStringAction) AsURLRewriteAction() (*URLRewriteAction, bool) { 1050 return nil, false 1051} 1052 1053// AsDeliveryRuleRequestHeaderAction is the BasicDeliveryRuleAction implementation for DeliveryRuleCacheKeyQueryStringAction. 1054func (drckqsa DeliveryRuleCacheKeyQueryStringAction) AsDeliveryRuleRequestHeaderAction() (*DeliveryRuleRequestHeaderAction, bool) { 1055 return nil, false 1056} 1057 1058// AsDeliveryRuleResponseHeaderAction is the BasicDeliveryRuleAction implementation for DeliveryRuleCacheKeyQueryStringAction. 1059func (drckqsa DeliveryRuleCacheKeyQueryStringAction) AsDeliveryRuleResponseHeaderAction() (*DeliveryRuleResponseHeaderAction, bool) { 1060 return nil, false 1061} 1062 1063// AsDeliveryRuleCacheExpirationAction is the BasicDeliveryRuleAction implementation for DeliveryRuleCacheKeyQueryStringAction. 1064func (drckqsa DeliveryRuleCacheKeyQueryStringAction) AsDeliveryRuleCacheExpirationAction() (*DeliveryRuleCacheExpirationAction, bool) { 1065 return nil, false 1066} 1067 1068// AsDeliveryRuleCacheKeyQueryStringAction is the BasicDeliveryRuleAction implementation for DeliveryRuleCacheKeyQueryStringAction. 1069func (drckqsa DeliveryRuleCacheKeyQueryStringAction) AsDeliveryRuleCacheKeyQueryStringAction() (*DeliveryRuleCacheKeyQueryStringAction, bool) { 1070 return &drckqsa, true 1071} 1072 1073// AsDeliveryRuleAction is the BasicDeliveryRuleAction implementation for DeliveryRuleCacheKeyQueryStringAction. 1074func (drckqsa DeliveryRuleCacheKeyQueryStringAction) AsDeliveryRuleAction() (*DeliveryRuleAction, bool) { 1075 return nil, false 1076} 1077 1078// AsBasicDeliveryRuleAction is the BasicDeliveryRuleAction implementation for DeliveryRuleCacheKeyQueryStringAction. 1079func (drckqsa DeliveryRuleCacheKeyQueryStringAction) AsBasicDeliveryRuleAction() (BasicDeliveryRuleAction, bool) { 1080 return &drckqsa, true 1081} 1082 1083// BasicDeliveryRuleCondition a condition for the delivery rule. 1084type BasicDeliveryRuleCondition interface { 1085 AsDeliveryRuleRemoteAddressCondition() (*DeliveryRuleRemoteAddressCondition, bool) 1086 AsDeliveryRuleRequestMethodCondition() (*DeliveryRuleRequestMethodCondition, bool) 1087 AsDeliveryRuleQueryStringCondition() (*DeliveryRuleQueryStringCondition, bool) 1088 AsDeliveryRulePostArgsCondition() (*DeliveryRulePostArgsCondition, bool) 1089 AsDeliveryRuleRequestURICondition() (*DeliveryRuleRequestURICondition, bool) 1090 AsDeliveryRuleRequestHeaderCondition() (*DeliveryRuleRequestHeaderCondition, bool) 1091 AsDeliveryRuleRequestBodyCondition() (*DeliveryRuleRequestBodyCondition, bool) 1092 AsDeliveryRuleRequestSchemeCondition() (*DeliveryRuleRequestSchemeCondition, bool) 1093 AsDeliveryRuleURLPathCondition() (*DeliveryRuleURLPathCondition, bool) 1094 AsDeliveryRuleURLFileExtensionCondition() (*DeliveryRuleURLFileExtensionCondition, bool) 1095 AsDeliveryRuleURLFileNameCondition() (*DeliveryRuleURLFileNameCondition, bool) 1096 AsDeliveryRuleHTTPVersionCondition() (*DeliveryRuleHTTPVersionCondition, bool) 1097 AsDeliveryRuleCookiesCondition() (*DeliveryRuleCookiesCondition, bool) 1098 AsDeliveryRuleIsDeviceCondition() (*DeliveryRuleIsDeviceCondition, bool) 1099 AsDeliveryRuleCondition() (*DeliveryRuleCondition, bool) 1100} 1101 1102// DeliveryRuleCondition a condition for the delivery rule. 1103type DeliveryRuleCondition struct { 1104 // Name - Possible values include: 'NameDeliveryRuleCondition', 'NameRemoteAddress', 'NameRequestMethod', 'NameQueryString', 'NamePostArgs', 'NameRequestURI', 'NameRequestHeader', 'NameRequestBody', 'NameRequestScheme', 'NameURLPath', 'NameURLFileExtension', 'NameURLFileName', 'NameHTTPVersion', 'NameCookies', 'NameIsDevice' 1105 Name Name `json:"name,omitempty"` 1106} 1107 1108func unmarshalBasicDeliveryRuleCondition(body []byte) (BasicDeliveryRuleCondition, error) { 1109 var m map[string]interface{} 1110 err := json.Unmarshal(body, &m) 1111 if err != nil { 1112 return nil, err 1113 } 1114 1115 switch m["name"] { 1116 case string(NameRemoteAddress): 1117 var drrac DeliveryRuleRemoteAddressCondition 1118 err := json.Unmarshal(body, &drrac) 1119 return drrac, err 1120 case string(NameRequestMethod): 1121 var drrmc DeliveryRuleRequestMethodCondition 1122 err := json.Unmarshal(body, &drrmc) 1123 return drrmc, err 1124 case string(NameQueryString): 1125 var drqsc DeliveryRuleQueryStringCondition 1126 err := json.Unmarshal(body, &drqsc) 1127 return drqsc, err 1128 case string(NamePostArgs): 1129 var drpac DeliveryRulePostArgsCondition 1130 err := json.Unmarshal(body, &drpac) 1131 return drpac, err 1132 case string(NameRequestURI): 1133 var drruc DeliveryRuleRequestURICondition 1134 err := json.Unmarshal(body, &drruc) 1135 return drruc, err 1136 case string(NameRequestHeader): 1137 var drrhc DeliveryRuleRequestHeaderCondition 1138 err := json.Unmarshal(body, &drrhc) 1139 return drrhc, err 1140 case string(NameRequestBody): 1141 var drrbc DeliveryRuleRequestBodyCondition 1142 err := json.Unmarshal(body, &drrbc) 1143 return drrbc, err 1144 case string(NameRequestScheme): 1145 var drrsc DeliveryRuleRequestSchemeCondition 1146 err := json.Unmarshal(body, &drrsc) 1147 return drrsc, err 1148 case string(NameURLPath): 1149 var drupc DeliveryRuleURLPathCondition 1150 err := json.Unmarshal(body, &drupc) 1151 return drupc, err 1152 case string(NameURLFileExtension): 1153 var drufec DeliveryRuleURLFileExtensionCondition 1154 err := json.Unmarshal(body, &drufec) 1155 return drufec, err 1156 case string(NameURLFileName): 1157 var drufnc DeliveryRuleURLFileNameCondition 1158 err := json.Unmarshal(body, &drufnc) 1159 return drufnc, err 1160 case string(NameHTTPVersion): 1161 var drhvc DeliveryRuleHTTPVersionCondition 1162 err := json.Unmarshal(body, &drhvc) 1163 return drhvc, err 1164 case string(NameCookies): 1165 var drcc DeliveryRuleCookiesCondition 1166 err := json.Unmarshal(body, &drcc) 1167 return drcc, err 1168 case string(NameIsDevice): 1169 var dridc DeliveryRuleIsDeviceCondition 1170 err := json.Unmarshal(body, &dridc) 1171 return dridc, err 1172 default: 1173 var drc DeliveryRuleCondition 1174 err := json.Unmarshal(body, &drc) 1175 return drc, err 1176 } 1177} 1178func unmarshalBasicDeliveryRuleConditionArray(body []byte) ([]BasicDeliveryRuleCondition, error) { 1179 var rawMessages []*json.RawMessage 1180 err := json.Unmarshal(body, &rawMessages) 1181 if err != nil { 1182 return nil, err 1183 } 1184 1185 drcArray := make([]BasicDeliveryRuleCondition, len(rawMessages)) 1186 1187 for index, rawMessage := range rawMessages { 1188 drc, err := unmarshalBasicDeliveryRuleCondition(*rawMessage) 1189 if err != nil { 1190 return nil, err 1191 } 1192 drcArray[index] = drc 1193 } 1194 return drcArray, nil 1195} 1196 1197// MarshalJSON is the custom marshaler for DeliveryRuleCondition. 1198func (drc DeliveryRuleCondition) MarshalJSON() ([]byte, error) { 1199 drc.Name = NameDeliveryRuleCondition 1200 objectMap := make(map[string]interface{}) 1201 if drc.Name != "" { 1202 objectMap["name"] = drc.Name 1203 } 1204 return json.Marshal(objectMap) 1205} 1206 1207// AsDeliveryRuleRemoteAddressCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleCondition. 1208func (drc DeliveryRuleCondition) AsDeliveryRuleRemoteAddressCondition() (*DeliveryRuleRemoteAddressCondition, bool) { 1209 return nil, false 1210} 1211 1212// AsDeliveryRuleRequestMethodCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleCondition. 1213func (drc DeliveryRuleCondition) AsDeliveryRuleRequestMethodCondition() (*DeliveryRuleRequestMethodCondition, bool) { 1214 return nil, false 1215} 1216 1217// AsDeliveryRuleQueryStringCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleCondition. 1218func (drc DeliveryRuleCondition) AsDeliveryRuleQueryStringCondition() (*DeliveryRuleQueryStringCondition, bool) { 1219 return nil, false 1220} 1221 1222// AsDeliveryRulePostArgsCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleCondition. 1223func (drc DeliveryRuleCondition) AsDeliveryRulePostArgsCondition() (*DeliveryRulePostArgsCondition, bool) { 1224 return nil, false 1225} 1226 1227// AsDeliveryRuleRequestURICondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleCondition. 1228func (drc DeliveryRuleCondition) AsDeliveryRuleRequestURICondition() (*DeliveryRuleRequestURICondition, bool) { 1229 return nil, false 1230} 1231 1232// AsDeliveryRuleRequestHeaderCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleCondition. 1233func (drc DeliveryRuleCondition) AsDeliveryRuleRequestHeaderCondition() (*DeliveryRuleRequestHeaderCondition, bool) { 1234 return nil, false 1235} 1236 1237// AsDeliveryRuleRequestBodyCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleCondition. 1238func (drc DeliveryRuleCondition) AsDeliveryRuleRequestBodyCondition() (*DeliveryRuleRequestBodyCondition, bool) { 1239 return nil, false 1240} 1241 1242// AsDeliveryRuleRequestSchemeCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleCondition. 1243func (drc DeliveryRuleCondition) AsDeliveryRuleRequestSchemeCondition() (*DeliveryRuleRequestSchemeCondition, bool) { 1244 return nil, false 1245} 1246 1247// AsDeliveryRuleURLPathCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleCondition. 1248func (drc DeliveryRuleCondition) AsDeliveryRuleURLPathCondition() (*DeliveryRuleURLPathCondition, bool) { 1249 return nil, false 1250} 1251 1252// AsDeliveryRuleURLFileExtensionCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleCondition. 1253func (drc DeliveryRuleCondition) AsDeliveryRuleURLFileExtensionCondition() (*DeliveryRuleURLFileExtensionCondition, bool) { 1254 return nil, false 1255} 1256 1257// AsDeliveryRuleURLFileNameCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleCondition. 1258func (drc DeliveryRuleCondition) AsDeliveryRuleURLFileNameCondition() (*DeliveryRuleURLFileNameCondition, bool) { 1259 return nil, false 1260} 1261 1262// AsDeliveryRuleHTTPVersionCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleCondition. 1263func (drc DeliveryRuleCondition) AsDeliveryRuleHTTPVersionCondition() (*DeliveryRuleHTTPVersionCondition, bool) { 1264 return nil, false 1265} 1266 1267// AsDeliveryRuleCookiesCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleCondition. 1268func (drc DeliveryRuleCondition) AsDeliveryRuleCookiesCondition() (*DeliveryRuleCookiesCondition, bool) { 1269 return nil, false 1270} 1271 1272// AsDeliveryRuleIsDeviceCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleCondition. 1273func (drc DeliveryRuleCondition) AsDeliveryRuleIsDeviceCondition() (*DeliveryRuleIsDeviceCondition, bool) { 1274 return nil, false 1275} 1276 1277// AsDeliveryRuleCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleCondition. 1278func (drc DeliveryRuleCondition) AsDeliveryRuleCondition() (*DeliveryRuleCondition, bool) { 1279 return &drc, true 1280} 1281 1282// AsBasicDeliveryRuleCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleCondition. 1283func (drc DeliveryRuleCondition) AsBasicDeliveryRuleCondition() (BasicDeliveryRuleCondition, bool) { 1284 return &drc, true 1285} 1286 1287// DeliveryRuleCookiesCondition defines the Cookies condition for the delivery rule. 1288type DeliveryRuleCookiesCondition struct { 1289 // Parameters - Defines the parameters for the condition. 1290 Parameters *CookiesMatchConditionParameters `json:"parameters,omitempty"` 1291 // Name - Possible values include: 'NameDeliveryRuleCondition', 'NameRemoteAddress', 'NameRequestMethod', 'NameQueryString', 'NamePostArgs', 'NameRequestURI', 'NameRequestHeader', 'NameRequestBody', 'NameRequestScheme', 'NameURLPath', 'NameURLFileExtension', 'NameURLFileName', 'NameHTTPVersion', 'NameCookies', 'NameIsDevice' 1292 Name Name `json:"name,omitempty"` 1293} 1294 1295// MarshalJSON is the custom marshaler for DeliveryRuleCookiesCondition. 1296func (drcc DeliveryRuleCookiesCondition) MarshalJSON() ([]byte, error) { 1297 drcc.Name = NameCookies 1298 objectMap := make(map[string]interface{}) 1299 if drcc.Parameters != nil { 1300 objectMap["parameters"] = drcc.Parameters 1301 } 1302 if drcc.Name != "" { 1303 objectMap["name"] = drcc.Name 1304 } 1305 return json.Marshal(objectMap) 1306} 1307 1308// AsDeliveryRuleRemoteAddressCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleCookiesCondition. 1309func (drcc DeliveryRuleCookiesCondition) AsDeliveryRuleRemoteAddressCondition() (*DeliveryRuleRemoteAddressCondition, bool) { 1310 return nil, false 1311} 1312 1313// AsDeliveryRuleRequestMethodCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleCookiesCondition. 1314func (drcc DeliveryRuleCookiesCondition) AsDeliveryRuleRequestMethodCondition() (*DeliveryRuleRequestMethodCondition, bool) { 1315 return nil, false 1316} 1317 1318// AsDeliveryRuleQueryStringCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleCookiesCondition. 1319func (drcc DeliveryRuleCookiesCondition) AsDeliveryRuleQueryStringCondition() (*DeliveryRuleQueryStringCondition, bool) { 1320 return nil, false 1321} 1322 1323// AsDeliveryRulePostArgsCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleCookiesCondition. 1324func (drcc DeliveryRuleCookiesCondition) AsDeliveryRulePostArgsCondition() (*DeliveryRulePostArgsCondition, bool) { 1325 return nil, false 1326} 1327 1328// AsDeliveryRuleRequestURICondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleCookiesCondition. 1329func (drcc DeliveryRuleCookiesCondition) AsDeliveryRuleRequestURICondition() (*DeliveryRuleRequestURICondition, bool) { 1330 return nil, false 1331} 1332 1333// AsDeliveryRuleRequestHeaderCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleCookiesCondition. 1334func (drcc DeliveryRuleCookiesCondition) AsDeliveryRuleRequestHeaderCondition() (*DeliveryRuleRequestHeaderCondition, bool) { 1335 return nil, false 1336} 1337 1338// AsDeliveryRuleRequestBodyCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleCookiesCondition. 1339func (drcc DeliveryRuleCookiesCondition) AsDeliveryRuleRequestBodyCondition() (*DeliveryRuleRequestBodyCondition, bool) { 1340 return nil, false 1341} 1342 1343// AsDeliveryRuleRequestSchemeCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleCookiesCondition. 1344func (drcc DeliveryRuleCookiesCondition) AsDeliveryRuleRequestSchemeCondition() (*DeliveryRuleRequestSchemeCondition, bool) { 1345 return nil, false 1346} 1347 1348// AsDeliveryRuleURLPathCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleCookiesCondition. 1349func (drcc DeliveryRuleCookiesCondition) AsDeliveryRuleURLPathCondition() (*DeliveryRuleURLPathCondition, bool) { 1350 return nil, false 1351} 1352 1353// AsDeliveryRuleURLFileExtensionCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleCookiesCondition. 1354func (drcc DeliveryRuleCookiesCondition) AsDeliveryRuleURLFileExtensionCondition() (*DeliveryRuleURLFileExtensionCondition, bool) { 1355 return nil, false 1356} 1357 1358// AsDeliveryRuleURLFileNameCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleCookiesCondition. 1359func (drcc DeliveryRuleCookiesCondition) AsDeliveryRuleURLFileNameCondition() (*DeliveryRuleURLFileNameCondition, bool) { 1360 return nil, false 1361} 1362 1363// AsDeliveryRuleHTTPVersionCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleCookiesCondition. 1364func (drcc DeliveryRuleCookiesCondition) AsDeliveryRuleHTTPVersionCondition() (*DeliveryRuleHTTPVersionCondition, bool) { 1365 return nil, false 1366} 1367 1368// AsDeliveryRuleCookiesCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleCookiesCondition. 1369func (drcc DeliveryRuleCookiesCondition) AsDeliveryRuleCookiesCondition() (*DeliveryRuleCookiesCondition, bool) { 1370 return &drcc, true 1371} 1372 1373// AsDeliveryRuleIsDeviceCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleCookiesCondition. 1374func (drcc DeliveryRuleCookiesCondition) AsDeliveryRuleIsDeviceCondition() (*DeliveryRuleIsDeviceCondition, bool) { 1375 return nil, false 1376} 1377 1378// AsDeliveryRuleCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleCookiesCondition. 1379func (drcc DeliveryRuleCookiesCondition) AsDeliveryRuleCondition() (*DeliveryRuleCondition, bool) { 1380 return nil, false 1381} 1382 1383// AsBasicDeliveryRuleCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleCookiesCondition. 1384func (drcc DeliveryRuleCookiesCondition) AsBasicDeliveryRuleCondition() (BasicDeliveryRuleCondition, bool) { 1385 return &drcc, true 1386} 1387 1388// DeliveryRuleHTTPVersionCondition defines the HttpVersion condition for the delivery rule. 1389type DeliveryRuleHTTPVersionCondition struct { 1390 // Parameters - Defines the parameters for the condition. 1391 Parameters *HTTPVersionMatchConditionParameters `json:"parameters,omitempty"` 1392 // Name - Possible values include: 'NameDeliveryRuleCondition', 'NameRemoteAddress', 'NameRequestMethod', 'NameQueryString', 'NamePostArgs', 'NameRequestURI', 'NameRequestHeader', 'NameRequestBody', 'NameRequestScheme', 'NameURLPath', 'NameURLFileExtension', 'NameURLFileName', 'NameHTTPVersion', 'NameCookies', 'NameIsDevice' 1393 Name Name `json:"name,omitempty"` 1394} 1395 1396// MarshalJSON is the custom marshaler for DeliveryRuleHTTPVersionCondition. 1397func (drhvc DeliveryRuleHTTPVersionCondition) MarshalJSON() ([]byte, error) { 1398 drhvc.Name = NameHTTPVersion 1399 objectMap := make(map[string]interface{}) 1400 if drhvc.Parameters != nil { 1401 objectMap["parameters"] = drhvc.Parameters 1402 } 1403 if drhvc.Name != "" { 1404 objectMap["name"] = drhvc.Name 1405 } 1406 return json.Marshal(objectMap) 1407} 1408 1409// AsDeliveryRuleRemoteAddressCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleHTTPVersionCondition. 1410func (drhvc DeliveryRuleHTTPVersionCondition) AsDeliveryRuleRemoteAddressCondition() (*DeliveryRuleRemoteAddressCondition, bool) { 1411 return nil, false 1412} 1413 1414// AsDeliveryRuleRequestMethodCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleHTTPVersionCondition. 1415func (drhvc DeliveryRuleHTTPVersionCondition) AsDeliveryRuleRequestMethodCondition() (*DeliveryRuleRequestMethodCondition, bool) { 1416 return nil, false 1417} 1418 1419// AsDeliveryRuleQueryStringCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleHTTPVersionCondition. 1420func (drhvc DeliveryRuleHTTPVersionCondition) AsDeliveryRuleQueryStringCondition() (*DeliveryRuleQueryStringCondition, bool) { 1421 return nil, false 1422} 1423 1424// AsDeliveryRulePostArgsCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleHTTPVersionCondition. 1425func (drhvc DeliveryRuleHTTPVersionCondition) AsDeliveryRulePostArgsCondition() (*DeliveryRulePostArgsCondition, bool) { 1426 return nil, false 1427} 1428 1429// AsDeliveryRuleRequestURICondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleHTTPVersionCondition. 1430func (drhvc DeliveryRuleHTTPVersionCondition) AsDeliveryRuleRequestURICondition() (*DeliveryRuleRequestURICondition, bool) { 1431 return nil, false 1432} 1433 1434// AsDeliveryRuleRequestHeaderCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleHTTPVersionCondition. 1435func (drhvc DeliveryRuleHTTPVersionCondition) AsDeliveryRuleRequestHeaderCondition() (*DeliveryRuleRequestHeaderCondition, bool) { 1436 return nil, false 1437} 1438 1439// AsDeliveryRuleRequestBodyCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleHTTPVersionCondition. 1440func (drhvc DeliveryRuleHTTPVersionCondition) AsDeliveryRuleRequestBodyCondition() (*DeliveryRuleRequestBodyCondition, bool) { 1441 return nil, false 1442} 1443 1444// AsDeliveryRuleRequestSchemeCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleHTTPVersionCondition. 1445func (drhvc DeliveryRuleHTTPVersionCondition) AsDeliveryRuleRequestSchemeCondition() (*DeliveryRuleRequestSchemeCondition, bool) { 1446 return nil, false 1447} 1448 1449// AsDeliveryRuleURLPathCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleHTTPVersionCondition. 1450func (drhvc DeliveryRuleHTTPVersionCondition) AsDeliveryRuleURLPathCondition() (*DeliveryRuleURLPathCondition, bool) { 1451 return nil, false 1452} 1453 1454// AsDeliveryRuleURLFileExtensionCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleHTTPVersionCondition. 1455func (drhvc DeliveryRuleHTTPVersionCondition) AsDeliveryRuleURLFileExtensionCondition() (*DeliveryRuleURLFileExtensionCondition, bool) { 1456 return nil, false 1457} 1458 1459// AsDeliveryRuleURLFileNameCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleHTTPVersionCondition. 1460func (drhvc DeliveryRuleHTTPVersionCondition) AsDeliveryRuleURLFileNameCondition() (*DeliveryRuleURLFileNameCondition, bool) { 1461 return nil, false 1462} 1463 1464// AsDeliveryRuleHTTPVersionCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleHTTPVersionCondition. 1465func (drhvc DeliveryRuleHTTPVersionCondition) AsDeliveryRuleHTTPVersionCondition() (*DeliveryRuleHTTPVersionCondition, bool) { 1466 return &drhvc, true 1467} 1468 1469// AsDeliveryRuleCookiesCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleHTTPVersionCondition. 1470func (drhvc DeliveryRuleHTTPVersionCondition) AsDeliveryRuleCookiesCondition() (*DeliveryRuleCookiesCondition, bool) { 1471 return nil, false 1472} 1473 1474// AsDeliveryRuleIsDeviceCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleHTTPVersionCondition. 1475func (drhvc DeliveryRuleHTTPVersionCondition) AsDeliveryRuleIsDeviceCondition() (*DeliveryRuleIsDeviceCondition, bool) { 1476 return nil, false 1477} 1478 1479// AsDeliveryRuleCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleHTTPVersionCondition. 1480func (drhvc DeliveryRuleHTTPVersionCondition) AsDeliveryRuleCondition() (*DeliveryRuleCondition, bool) { 1481 return nil, false 1482} 1483 1484// AsBasicDeliveryRuleCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleHTTPVersionCondition. 1485func (drhvc DeliveryRuleHTTPVersionCondition) AsBasicDeliveryRuleCondition() (BasicDeliveryRuleCondition, bool) { 1486 return &drhvc, true 1487} 1488 1489// DeliveryRuleIsDeviceCondition defines the IsDevice condition for the delivery rule. 1490type DeliveryRuleIsDeviceCondition struct { 1491 // Parameters - Defines the parameters for the condition. 1492 Parameters *IsDeviceMatchConditionParameters `json:"parameters,omitempty"` 1493 // Name - Possible values include: 'NameDeliveryRuleCondition', 'NameRemoteAddress', 'NameRequestMethod', 'NameQueryString', 'NamePostArgs', 'NameRequestURI', 'NameRequestHeader', 'NameRequestBody', 'NameRequestScheme', 'NameURLPath', 'NameURLFileExtension', 'NameURLFileName', 'NameHTTPVersion', 'NameCookies', 'NameIsDevice' 1494 Name Name `json:"name,omitempty"` 1495} 1496 1497// MarshalJSON is the custom marshaler for DeliveryRuleIsDeviceCondition. 1498func (dridc DeliveryRuleIsDeviceCondition) MarshalJSON() ([]byte, error) { 1499 dridc.Name = NameIsDevice 1500 objectMap := make(map[string]interface{}) 1501 if dridc.Parameters != nil { 1502 objectMap["parameters"] = dridc.Parameters 1503 } 1504 if dridc.Name != "" { 1505 objectMap["name"] = dridc.Name 1506 } 1507 return json.Marshal(objectMap) 1508} 1509 1510// AsDeliveryRuleRemoteAddressCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleIsDeviceCondition. 1511func (dridc DeliveryRuleIsDeviceCondition) AsDeliveryRuleRemoteAddressCondition() (*DeliveryRuleRemoteAddressCondition, bool) { 1512 return nil, false 1513} 1514 1515// AsDeliveryRuleRequestMethodCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleIsDeviceCondition. 1516func (dridc DeliveryRuleIsDeviceCondition) AsDeliveryRuleRequestMethodCondition() (*DeliveryRuleRequestMethodCondition, bool) { 1517 return nil, false 1518} 1519 1520// AsDeliveryRuleQueryStringCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleIsDeviceCondition. 1521func (dridc DeliveryRuleIsDeviceCondition) AsDeliveryRuleQueryStringCondition() (*DeliveryRuleQueryStringCondition, bool) { 1522 return nil, false 1523} 1524 1525// AsDeliveryRulePostArgsCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleIsDeviceCondition. 1526func (dridc DeliveryRuleIsDeviceCondition) AsDeliveryRulePostArgsCondition() (*DeliveryRulePostArgsCondition, bool) { 1527 return nil, false 1528} 1529 1530// AsDeliveryRuleRequestURICondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleIsDeviceCondition. 1531func (dridc DeliveryRuleIsDeviceCondition) AsDeliveryRuleRequestURICondition() (*DeliveryRuleRequestURICondition, bool) { 1532 return nil, false 1533} 1534 1535// AsDeliveryRuleRequestHeaderCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleIsDeviceCondition. 1536func (dridc DeliveryRuleIsDeviceCondition) AsDeliveryRuleRequestHeaderCondition() (*DeliveryRuleRequestHeaderCondition, bool) { 1537 return nil, false 1538} 1539 1540// AsDeliveryRuleRequestBodyCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleIsDeviceCondition. 1541func (dridc DeliveryRuleIsDeviceCondition) AsDeliveryRuleRequestBodyCondition() (*DeliveryRuleRequestBodyCondition, bool) { 1542 return nil, false 1543} 1544 1545// AsDeliveryRuleRequestSchemeCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleIsDeviceCondition. 1546func (dridc DeliveryRuleIsDeviceCondition) AsDeliveryRuleRequestSchemeCondition() (*DeliveryRuleRequestSchemeCondition, bool) { 1547 return nil, false 1548} 1549 1550// AsDeliveryRuleURLPathCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleIsDeviceCondition. 1551func (dridc DeliveryRuleIsDeviceCondition) AsDeliveryRuleURLPathCondition() (*DeliveryRuleURLPathCondition, bool) { 1552 return nil, false 1553} 1554 1555// AsDeliveryRuleURLFileExtensionCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleIsDeviceCondition. 1556func (dridc DeliveryRuleIsDeviceCondition) AsDeliveryRuleURLFileExtensionCondition() (*DeliveryRuleURLFileExtensionCondition, bool) { 1557 return nil, false 1558} 1559 1560// AsDeliveryRuleURLFileNameCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleIsDeviceCondition. 1561func (dridc DeliveryRuleIsDeviceCondition) AsDeliveryRuleURLFileNameCondition() (*DeliveryRuleURLFileNameCondition, bool) { 1562 return nil, false 1563} 1564 1565// AsDeliveryRuleHTTPVersionCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleIsDeviceCondition. 1566func (dridc DeliveryRuleIsDeviceCondition) AsDeliveryRuleHTTPVersionCondition() (*DeliveryRuleHTTPVersionCondition, bool) { 1567 return nil, false 1568} 1569 1570// AsDeliveryRuleCookiesCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleIsDeviceCondition. 1571func (dridc DeliveryRuleIsDeviceCondition) AsDeliveryRuleCookiesCondition() (*DeliveryRuleCookiesCondition, bool) { 1572 return nil, false 1573} 1574 1575// AsDeliveryRuleIsDeviceCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleIsDeviceCondition. 1576func (dridc DeliveryRuleIsDeviceCondition) AsDeliveryRuleIsDeviceCondition() (*DeliveryRuleIsDeviceCondition, bool) { 1577 return &dridc, true 1578} 1579 1580// AsDeliveryRuleCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleIsDeviceCondition. 1581func (dridc DeliveryRuleIsDeviceCondition) AsDeliveryRuleCondition() (*DeliveryRuleCondition, bool) { 1582 return nil, false 1583} 1584 1585// AsBasicDeliveryRuleCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleIsDeviceCondition. 1586func (dridc DeliveryRuleIsDeviceCondition) AsBasicDeliveryRuleCondition() (BasicDeliveryRuleCondition, bool) { 1587 return &dridc, true 1588} 1589 1590// DeliveryRulePostArgsCondition defines the PostArgs condition for the delivery rule. 1591type DeliveryRulePostArgsCondition struct { 1592 // Parameters - Defines the parameters for the condition. 1593 Parameters *PostArgsMatchConditionParameters `json:"parameters,omitempty"` 1594 // Name - Possible values include: 'NameDeliveryRuleCondition', 'NameRemoteAddress', 'NameRequestMethod', 'NameQueryString', 'NamePostArgs', 'NameRequestURI', 'NameRequestHeader', 'NameRequestBody', 'NameRequestScheme', 'NameURLPath', 'NameURLFileExtension', 'NameURLFileName', 'NameHTTPVersion', 'NameCookies', 'NameIsDevice' 1595 Name Name `json:"name,omitempty"` 1596} 1597 1598// MarshalJSON is the custom marshaler for DeliveryRulePostArgsCondition. 1599func (drpac DeliveryRulePostArgsCondition) MarshalJSON() ([]byte, error) { 1600 drpac.Name = NamePostArgs 1601 objectMap := make(map[string]interface{}) 1602 if drpac.Parameters != nil { 1603 objectMap["parameters"] = drpac.Parameters 1604 } 1605 if drpac.Name != "" { 1606 objectMap["name"] = drpac.Name 1607 } 1608 return json.Marshal(objectMap) 1609} 1610 1611// AsDeliveryRuleRemoteAddressCondition is the BasicDeliveryRuleCondition implementation for DeliveryRulePostArgsCondition. 1612func (drpac DeliveryRulePostArgsCondition) AsDeliveryRuleRemoteAddressCondition() (*DeliveryRuleRemoteAddressCondition, bool) { 1613 return nil, false 1614} 1615 1616// AsDeliveryRuleRequestMethodCondition is the BasicDeliveryRuleCondition implementation for DeliveryRulePostArgsCondition. 1617func (drpac DeliveryRulePostArgsCondition) AsDeliveryRuleRequestMethodCondition() (*DeliveryRuleRequestMethodCondition, bool) { 1618 return nil, false 1619} 1620 1621// AsDeliveryRuleQueryStringCondition is the BasicDeliveryRuleCondition implementation for DeliveryRulePostArgsCondition. 1622func (drpac DeliveryRulePostArgsCondition) AsDeliveryRuleQueryStringCondition() (*DeliveryRuleQueryStringCondition, bool) { 1623 return nil, false 1624} 1625 1626// AsDeliveryRulePostArgsCondition is the BasicDeliveryRuleCondition implementation for DeliveryRulePostArgsCondition. 1627func (drpac DeliveryRulePostArgsCondition) AsDeliveryRulePostArgsCondition() (*DeliveryRulePostArgsCondition, bool) { 1628 return &drpac, true 1629} 1630 1631// AsDeliveryRuleRequestURICondition is the BasicDeliveryRuleCondition implementation for DeliveryRulePostArgsCondition. 1632func (drpac DeliveryRulePostArgsCondition) AsDeliveryRuleRequestURICondition() (*DeliveryRuleRequestURICondition, bool) { 1633 return nil, false 1634} 1635 1636// AsDeliveryRuleRequestHeaderCondition is the BasicDeliveryRuleCondition implementation for DeliveryRulePostArgsCondition. 1637func (drpac DeliveryRulePostArgsCondition) AsDeliveryRuleRequestHeaderCondition() (*DeliveryRuleRequestHeaderCondition, bool) { 1638 return nil, false 1639} 1640 1641// AsDeliveryRuleRequestBodyCondition is the BasicDeliveryRuleCondition implementation for DeliveryRulePostArgsCondition. 1642func (drpac DeliveryRulePostArgsCondition) AsDeliveryRuleRequestBodyCondition() (*DeliveryRuleRequestBodyCondition, bool) { 1643 return nil, false 1644} 1645 1646// AsDeliveryRuleRequestSchemeCondition is the BasicDeliveryRuleCondition implementation for DeliveryRulePostArgsCondition. 1647func (drpac DeliveryRulePostArgsCondition) AsDeliveryRuleRequestSchemeCondition() (*DeliveryRuleRequestSchemeCondition, bool) { 1648 return nil, false 1649} 1650 1651// AsDeliveryRuleURLPathCondition is the BasicDeliveryRuleCondition implementation for DeliveryRulePostArgsCondition. 1652func (drpac DeliveryRulePostArgsCondition) AsDeliveryRuleURLPathCondition() (*DeliveryRuleURLPathCondition, bool) { 1653 return nil, false 1654} 1655 1656// AsDeliveryRuleURLFileExtensionCondition is the BasicDeliveryRuleCondition implementation for DeliveryRulePostArgsCondition. 1657func (drpac DeliveryRulePostArgsCondition) AsDeliveryRuleURLFileExtensionCondition() (*DeliveryRuleURLFileExtensionCondition, bool) { 1658 return nil, false 1659} 1660 1661// AsDeliveryRuleURLFileNameCondition is the BasicDeliveryRuleCondition implementation for DeliveryRulePostArgsCondition. 1662func (drpac DeliveryRulePostArgsCondition) AsDeliveryRuleURLFileNameCondition() (*DeliveryRuleURLFileNameCondition, bool) { 1663 return nil, false 1664} 1665 1666// AsDeliveryRuleHTTPVersionCondition is the BasicDeliveryRuleCondition implementation for DeliveryRulePostArgsCondition. 1667func (drpac DeliveryRulePostArgsCondition) AsDeliveryRuleHTTPVersionCondition() (*DeliveryRuleHTTPVersionCondition, bool) { 1668 return nil, false 1669} 1670 1671// AsDeliveryRuleCookiesCondition is the BasicDeliveryRuleCondition implementation for DeliveryRulePostArgsCondition. 1672func (drpac DeliveryRulePostArgsCondition) AsDeliveryRuleCookiesCondition() (*DeliveryRuleCookiesCondition, bool) { 1673 return nil, false 1674} 1675 1676// AsDeliveryRuleIsDeviceCondition is the BasicDeliveryRuleCondition implementation for DeliveryRulePostArgsCondition. 1677func (drpac DeliveryRulePostArgsCondition) AsDeliveryRuleIsDeviceCondition() (*DeliveryRuleIsDeviceCondition, bool) { 1678 return nil, false 1679} 1680 1681// AsDeliveryRuleCondition is the BasicDeliveryRuleCondition implementation for DeliveryRulePostArgsCondition. 1682func (drpac DeliveryRulePostArgsCondition) AsDeliveryRuleCondition() (*DeliveryRuleCondition, bool) { 1683 return nil, false 1684} 1685 1686// AsBasicDeliveryRuleCondition is the BasicDeliveryRuleCondition implementation for DeliveryRulePostArgsCondition. 1687func (drpac DeliveryRulePostArgsCondition) AsBasicDeliveryRuleCondition() (BasicDeliveryRuleCondition, bool) { 1688 return &drpac, true 1689} 1690 1691// DeliveryRuleQueryStringCondition defines the QueryString condition for the delivery rule. 1692type DeliveryRuleQueryStringCondition struct { 1693 // Parameters - Defines the parameters for the condition. 1694 Parameters *QueryStringMatchConditionParameters `json:"parameters,omitempty"` 1695 // Name - Possible values include: 'NameDeliveryRuleCondition', 'NameRemoteAddress', 'NameRequestMethod', 'NameQueryString', 'NamePostArgs', 'NameRequestURI', 'NameRequestHeader', 'NameRequestBody', 'NameRequestScheme', 'NameURLPath', 'NameURLFileExtension', 'NameURLFileName', 'NameHTTPVersion', 'NameCookies', 'NameIsDevice' 1696 Name Name `json:"name,omitempty"` 1697} 1698 1699// MarshalJSON is the custom marshaler for DeliveryRuleQueryStringCondition. 1700func (drqsc DeliveryRuleQueryStringCondition) MarshalJSON() ([]byte, error) { 1701 drqsc.Name = NameQueryString 1702 objectMap := make(map[string]interface{}) 1703 if drqsc.Parameters != nil { 1704 objectMap["parameters"] = drqsc.Parameters 1705 } 1706 if drqsc.Name != "" { 1707 objectMap["name"] = drqsc.Name 1708 } 1709 return json.Marshal(objectMap) 1710} 1711 1712// AsDeliveryRuleRemoteAddressCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleQueryStringCondition. 1713func (drqsc DeliveryRuleQueryStringCondition) AsDeliveryRuleRemoteAddressCondition() (*DeliveryRuleRemoteAddressCondition, bool) { 1714 return nil, false 1715} 1716 1717// AsDeliveryRuleRequestMethodCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleQueryStringCondition. 1718func (drqsc DeliveryRuleQueryStringCondition) AsDeliveryRuleRequestMethodCondition() (*DeliveryRuleRequestMethodCondition, bool) { 1719 return nil, false 1720} 1721 1722// AsDeliveryRuleQueryStringCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleQueryStringCondition. 1723func (drqsc DeliveryRuleQueryStringCondition) AsDeliveryRuleQueryStringCondition() (*DeliveryRuleQueryStringCondition, bool) { 1724 return &drqsc, true 1725} 1726 1727// AsDeliveryRulePostArgsCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleQueryStringCondition. 1728func (drqsc DeliveryRuleQueryStringCondition) AsDeliveryRulePostArgsCondition() (*DeliveryRulePostArgsCondition, bool) { 1729 return nil, false 1730} 1731 1732// AsDeliveryRuleRequestURICondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleQueryStringCondition. 1733func (drqsc DeliveryRuleQueryStringCondition) AsDeliveryRuleRequestURICondition() (*DeliveryRuleRequestURICondition, bool) { 1734 return nil, false 1735} 1736 1737// AsDeliveryRuleRequestHeaderCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleQueryStringCondition. 1738func (drqsc DeliveryRuleQueryStringCondition) AsDeliveryRuleRequestHeaderCondition() (*DeliveryRuleRequestHeaderCondition, bool) { 1739 return nil, false 1740} 1741 1742// AsDeliveryRuleRequestBodyCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleQueryStringCondition. 1743func (drqsc DeliveryRuleQueryStringCondition) AsDeliveryRuleRequestBodyCondition() (*DeliveryRuleRequestBodyCondition, bool) { 1744 return nil, false 1745} 1746 1747// AsDeliveryRuleRequestSchemeCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleQueryStringCondition. 1748func (drqsc DeliveryRuleQueryStringCondition) AsDeliveryRuleRequestSchemeCondition() (*DeliveryRuleRequestSchemeCondition, bool) { 1749 return nil, false 1750} 1751 1752// AsDeliveryRuleURLPathCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleQueryStringCondition. 1753func (drqsc DeliveryRuleQueryStringCondition) AsDeliveryRuleURLPathCondition() (*DeliveryRuleURLPathCondition, bool) { 1754 return nil, false 1755} 1756 1757// AsDeliveryRuleURLFileExtensionCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleQueryStringCondition. 1758func (drqsc DeliveryRuleQueryStringCondition) AsDeliveryRuleURLFileExtensionCondition() (*DeliveryRuleURLFileExtensionCondition, bool) { 1759 return nil, false 1760} 1761 1762// AsDeliveryRuleURLFileNameCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleQueryStringCondition. 1763func (drqsc DeliveryRuleQueryStringCondition) AsDeliveryRuleURLFileNameCondition() (*DeliveryRuleURLFileNameCondition, bool) { 1764 return nil, false 1765} 1766 1767// AsDeliveryRuleHTTPVersionCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleQueryStringCondition. 1768func (drqsc DeliveryRuleQueryStringCondition) AsDeliveryRuleHTTPVersionCondition() (*DeliveryRuleHTTPVersionCondition, bool) { 1769 return nil, false 1770} 1771 1772// AsDeliveryRuleCookiesCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleQueryStringCondition. 1773func (drqsc DeliveryRuleQueryStringCondition) AsDeliveryRuleCookiesCondition() (*DeliveryRuleCookiesCondition, bool) { 1774 return nil, false 1775} 1776 1777// AsDeliveryRuleIsDeviceCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleQueryStringCondition. 1778func (drqsc DeliveryRuleQueryStringCondition) AsDeliveryRuleIsDeviceCondition() (*DeliveryRuleIsDeviceCondition, bool) { 1779 return nil, false 1780} 1781 1782// AsDeliveryRuleCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleQueryStringCondition. 1783func (drqsc DeliveryRuleQueryStringCondition) AsDeliveryRuleCondition() (*DeliveryRuleCondition, bool) { 1784 return nil, false 1785} 1786 1787// AsBasicDeliveryRuleCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleQueryStringCondition. 1788func (drqsc DeliveryRuleQueryStringCondition) AsBasicDeliveryRuleCondition() (BasicDeliveryRuleCondition, bool) { 1789 return &drqsc, true 1790} 1791 1792// DeliveryRuleRemoteAddressCondition defines the RemoteAddress condition for the delivery rule. 1793type DeliveryRuleRemoteAddressCondition struct { 1794 // Parameters - Defines the parameters for the condition. 1795 Parameters *RemoteAddressMatchConditionParameters `json:"parameters,omitempty"` 1796 // Name - Possible values include: 'NameDeliveryRuleCondition', 'NameRemoteAddress', 'NameRequestMethod', 'NameQueryString', 'NamePostArgs', 'NameRequestURI', 'NameRequestHeader', 'NameRequestBody', 'NameRequestScheme', 'NameURLPath', 'NameURLFileExtension', 'NameURLFileName', 'NameHTTPVersion', 'NameCookies', 'NameIsDevice' 1797 Name Name `json:"name,omitempty"` 1798} 1799 1800// MarshalJSON is the custom marshaler for DeliveryRuleRemoteAddressCondition. 1801func (drrac DeliveryRuleRemoteAddressCondition) MarshalJSON() ([]byte, error) { 1802 drrac.Name = NameRemoteAddress 1803 objectMap := make(map[string]interface{}) 1804 if drrac.Parameters != nil { 1805 objectMap["parameters"] = drrac.Parameters 1806 } 1807 if drrac.Name != "" { 1808 objectMap["name"] = drrac.Name 1809 } 1810 return json.Marshal(objectMap) 1811} 1812 1813// AsDeliveryRuleRemoteAddressCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRemoteAddressCondition. 1814func (drrac DeliveryRuleRemoteAddressCondition) AsDeliveryRuleRemoteAddressCondition() (*DeliveryRuleRemoteAddressCondition, bool) { 1815 return &drrac, true 1816} 1817 1818// AsDeliveryRuleRequestMethodCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRemoteAddressCondition. 1819func (drrac DeliveryRuleRemoteAddressCondition) AsDeliveryRuleRequestMethodCondition() (*DeliveryRuleRequestMethodCondition, bool) { 1820 return nil, false 1821} 1822 1823// AsDeliveryRuleQueryStringCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRemoteAddressCondition. 1824func (drrac DeliveryRuleRemoteAddressCondition) AsDeliveryRuleQueryStringCondition() (*DeliveryRuleQueryStringCondition, bool) { 1825 return nil, false 1826} 1827 1828// AsDeliveryRulePostArgsCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRemoteAddressCondition. 1829func (drrac DeliveryRuleRemoteAddressCondition) AsDeliveryRulePostArgsCondition() (*DeliveryRulePostArgsCondition, bool) { 1830 return nil, false 1831} 1832 1833// AsDeliveryRuleRequestURICondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRemoteAddressCondition. 1834func (drrac DeliveryRuleRemoteAddressCondition) AsDeliveryRuleRequestURICondition() (*DeliveryRuleRequestURICondition, bool) { 1835 return nil, false 1836} 1837 1838// AsDeliveryRuleRequestHeaderCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRemoteAddressCondition. 1839func (drrac DeliveryRuleRemoteAddressCondition) AsDeliveryRuleRequestHeaderCondition() (*DeliveryRuleRequestHeaderCondition, bool) { 1840 return nil, false 1841} 1842 1843// AsDeliveryRuleRequestBodyCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRemoteAddressCondition. 1844func (drrac DeliveryRuleRemoteAddressCondition) AsDeliveryRuleRequestBodyCondition() (*DeliveryRuleRequestBodyCondition, bool) { 1845 return nil, false 1846} 1847 1848// AsDeliveryRuleRequestSchemeCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRemoteAddressCondition. 1849func (drrac DeliveryRuleRemoteAddressCondition) AsDeliveryRuleRequestSchemeCondition() (*DeliveryRuleRequestSchemeCondition, bool) { 1850 return nil, false 1851} 1852 1853// AsDeliveryRuleURLPathCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRemoteAddressCondition. 1854func (drrac DeliveryRuleRemoteAddressCondition) AsDeliveryRuleURLPathCondition() (*DeliveryRuleURLPathCondition, bool) { 1855 return nil, false 1856} 1857 1858// AsDeliveryRuleURLFileExtensionCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRemoteAddressCondition. 1859func (drrac DeliveryRuleRemoteAddressCondition) AsDeliveryRuleURLFileExtensionCondition() (*DeliveryRuleURLFileExtensionCondition, bool) { 1860 return nil, false 1861} 1862 1863// AsDeliveryRuleURLFileNameCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRemoteAddressCondition. 1864func (drrac DeliveryRuleRemoteAddressCondition) AsDeliveryRuleURLFileNameCondition() (*DeliveryRuleURLFileNameCondition, bool) { 1865 return nil, false 1866} 1867 1868// AsDeliveryRuleHTTPVersionCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRemoteAddressCondition. 1869func (drrac DeliveryRuleRemoteAddressCondition) AsDeliveryRuleHTTPVersionCondition() (*DeliveryRuleHTTPVersionCondition, bool) { 1870 return nil, false 1871} 1872 1873// AsDeliveryRuleCookiesCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRemoteAddressCondition. 1874func (drrac DeliveryRuleRemoteAddressCondition) AsDeliveryRuleCookiesCondition() (*DeliveryRuleCookiesCondition, bool) { 1875 return nil, false 1876} 1877 1878// AsDeliveryRuleIsDeviceCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRemoteAddressCondition. 1879func (drrac DeliveryRuleRemoteAddressCondition) AsDeliveryRuleIsDeviceCondition() (*DeliveryRuleIsDeviceCondition, bool) { 1880 return nil, false 1881} 1882 1883// AsDeliveryRuleCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRemoteAddressCondition. 1884func (drrac DeliveryRuleRemoteAddressCondition) AsDeliveryRuleCondition() (*DeliveryRuleCondition, bool) { 1885 return nil, false 1886} 1887 1888// AsBasicDeliveryRuleCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRemoteAddressCondition. 1889func (drrac DeliveryRuleRemoteAddressCondition) AsBasicDeliveryRuleCondition() (BasicDeliveryRuleCondition, bool) { 1890 return &drrac, true 1891} 1892 1893// DeliveryRuleRequestBodyCondition defines the RequestBody condition for the delivery rule. 1894type DeliveryRuleRequestBodyCondition struct { 1895 // Parameters - Defines the parameters for the condition. 1896 Parameters *RequestBodyMatchConditionParameters `json:"parameters,omitempty"` 1897 // Name - Possible values include: 'NameDeliveryRuleCondition', 'NameRemoteAddress', 'NameRequestMethod', 'NameQueryString', 'NamePostArgs', 'NameRequestURI', 'NameRequestHeader', 'NameRequestBody', 'NameRequestScheme', 'NameURLPath', 'NameURLFileExtension', 'NameURLFileName', 'NameHTTPVersion', 'NameCookies', 'NameIsDevice' 1898 Name Name `json:"name,omitempty"` 1899} 1900 1901// MarshalJSON is the custom marshaler for DeliveryRuleRequestBodyCondition. 1902func (drrbc DeliveryRuleRequestBodyCondition) MarshalJSON() ([]byte, error) { 1903 drrbc.Name = NameRequestBody 1904 objectMap := make(map[string]interface{}) 1905 if drrbc.Parameters != nil { 1906 objectMap["parameters"] = drrbc.Parameters 1907 } 1908 if drrbc.Name != "" { 1909 objectMap["name"] = drrbc.Name 1910 } 1911 return json.Marshal(objectMap) 1912} 1913 1914// AsDeliveryRuleRemoteAddressCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestBodyCondition. 1915func (drrbc DeliveryRuleRequestBodyCondition) AsDeliveryRuleRemoteAddressCondition() (*DeliveryRuleRemoteAddressCondition, bool) { 1916 return nil, false 1917} 1918 1919// AsDeliveryRuleRequestMethodCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestBodyCondition. 1920func (drrbc DeliveryRuleRequestBodyCondition) AsDeliveryRuleRequestMethodCondition() (*DeliveryRuleRequestMethodCondition, bool) { 1921 return nil, false 1922} 1923 1924// AsDeliveryRuleQueryStringCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestBodyCondition. 1925func (drrbc DeliveryRuleRequestBodyCondition) AsDeliveryRuleQueryStringCondition() (*DeliveryRuleQueryStringCondition, bool) { 1926 return nil, false 1927} 1928 1929// AsDeliveryRulePostArgsCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestBodyCondition. 1930func (drrbc DeliveryRuleRequestBodyCondition) AsDeliveryRulePostArgsCondition() (*DeliveryRulePostArgsCondition, bool) { 1931 return nil, false 1932} 1933 1934// AsDeliveryRuleRequestURICondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestBodyCondition. 1935func (drrbc DeliveryRuleRequestBodyCondition) AsDeliveryRuleRequestURICondition() (*DeliveryRuleRequestURICondition, bool) { 1936 return nil, false 1937} 1938 1939// AsDeliveryRuleRequestHeaderCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestBodyCondition. 1940func (drrbc DeliveryRuleRequestBodyCondition) AsDeliveryRuleRequestHeaderCondition() (*DeliveryRuleRequestHeaderCondition, bool) { 1941 return nil, false 1942} 1943 1944// AsDeliveryRuleRequestBodyCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestBodyCondition. 1945func (drrbc DeliveryRuleRequestBodyCondition) AsDeliveryRuleRequestBodyCondition() (*DeliveryRuleRequestBodyCondition, bool) { 1946 return &drrbc, true 1947} 1948 1949// AsDeliveryRuleRequestSchemeCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestBodyCondition. 1950func (drrbc DeliveryRuleRequestBodyCondition) AsDeliveryRuleRequestSchemeCondition() (*DeliveryRuleRequestSchemeCondition, bool) { 1951 return nil, false 1952} 1953 1954// AsDeliveryRuleURLPathCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestBodyCondition. 1955func (drrbc DeliveryRuleRequestBodyCondition) AsDeliveryRuleURLPathCondition() (*DeliveryRuleURLPathCondition, bool) { 1956 return nil, false 1957} 1958 1959// AsDeliveryRuleURLFileExtensionCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestBodyCondition. 1960func (drrbc DeliveryRuleRequestBodyCondition) AsDeliveryRuleURLFileExtensionCondition() (*DeliveryRuleURLFileExtensionCondition, bool) { 1961 return nil, false 1962} 1963 1964// AsDeliveryRuleURLFileNameCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestBodyCondition. 1965func (drrbc DeliveryRuleRequestBodyCondition) AsDeliveryRuleURLFileNameCondition() (*DeliveryRuleURLFileNameCondition, bool) { 1966 return nil, false 1967} 1968 1969// AsDeliveryRuleHTTPVersionCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestBodyCondition. 1970func (drrbc DeliveryRuleRequestBodyCondition) AsDeliveryRuleHTTPVersionCondition() (*DeliveryRuleHTTPVersionCondition, bool) { 1971 return nil, false 1972} 1973 1974// AsDeliveryRuleCookiesCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestBodyCondition. 1975func (drrbc DeliveryRuleRequestBodyCondition) AsDeliveryRuleCookiesCondition() (*DeliveryRuleCookiesCondition, bool) { 1976 return nil, false 1977} 1978 1979// AsDeliveryRuleIsDeviceCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestBodyCondition. 1980func (drrbc DeliveryRuleRequestBodyCondition) AsDeliveryRuleIsDeviceCondition() (*DeliveryRuleIsDeviceCondition, bool) { 1981 return nil, false 1982} 1983 1984// AsDeliveryRuleCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestBodyCondition. 1985func (drrbc DeliveryRuleRequestBodyCondition) AsDeliveryRuleCondition() (*DeliveryRuleCondition, bool) { 1986 return nil, false 1987} 1988 1989// AsBasicDeliveryRuleCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestBodyCondition. 1990func (drrbc DeliveryRuleRequestBodyCondition) AsBasicDeliveryRuleCondition() (BasicDeliveryRuleCondition, bool) { 1991 return &drrbc, true 1992} 1993 1994// DeliveryRuleRequestHeaderAction defines the request header action for the delivery rule. 1995type DeliveryRuleRequestHeaderAction struct { 1996 // Parameters - Defines the parameters for the action. 1997 Parameters *HeaderActionParameters `json:"parameters,omitempty"` 1998 // Name - Possible values include: 'NameDeliveryRuleAction', 'NameURLRedirect', 'NameURLSigning', 'NameURLRewrite', 'NameModifyRequestHeader', 'NameModifyResponseHeader', 'NameCacheExpiration', 'NameCacheKeyQueryString' 1999 Name NameBasicDeliveryRuleAction `json:"name,omitempty"` 2000} 2001 2002// MarshalJSON is the custom marshaler for DeliveryRuleRequestHeaderAction. 2003func (drrha DeliveryRuleRequestHeaderAction) MarshalJSON() ([]byte, error) { 2004 drrha.Name = NameModifyRequestHeader 2005 objectMap := make(map[string]interface{}) 2006 if drrha.Parameters != nil { 2007 objectMap["parameters"] = drrha.Parameters 2008 } 2009 if drrha.Name != "" { 2010 objectMap["name"] = drrha.Name 2011 } 2012 return json.Marshal(objectMap) 2013} 2014 2015// AsURLRedirectAction is the BasicDeliveryRuleAction implementation for DeliveryRuleRequestHeaderAction. 2016func (drrha DeliveryRuleRequestHeaderAction) AsURLRedirectAction() (*URLRedirectAction, bool) { 2017 return nil, false 2018} 2019 2020// AsURLSigningAction is the BasicDeliveryRuleAction implementation for DeliveryRuleRequestHeaderAction. 2021func (drrha DeliveryRuleRequestHeaderAction) AsURLSigningAction() (*URLSigningAction, bool) { 2022 return nil, false 2023} 2024 2025// AsURLRewriteAction is the BasicDeliveryRuleAction implementation for DeliveryRuleRequestHeaderAction. 2026func (drrha DeliveryRuleRequestHeaderAction) AsURLRewriteAction() (*URLRewriteAction, bool) { 2027 return nil, false 2028} 2029 2030// AsDeliveryRuleRequestHeaderAction is the BasicDeliveryRuleAction implementation for DeliveryRuleRequestHeaderAction. 2031func (drrha DeliveryRuleRequestHeaderAction) AsDeliveryRuleRequestHeaderAction() (*DeliveryRuleRequestHeaderAction, bool) { 2032 return &drrha, true 2033} 2034 2035// AsDeliveryRuleResponseHeaderAction is the BasicDeliveryRuleAction implementation for DeliveryRuleRequestHeaderAction. 2036func (drrha DeliveryRuleRequestHeaderAction) AsDeliveryRuleResponseHeaderAction() (*DeliveryRuleResponseHeaderAction, bool) { 2037 return nil, false 2038} 2039 2040// AsDeliveryRuleCacheExpirationAction is the BasicDeliveryRuleAction implementation for DeliveryRuleRequestHeaderAction. 2041func (drrha DeliveryRuleRequestHeaderAction) AsDeliveryRuleCacheExpirationAction() (*DeliveryRuleCacheExpirationAction, bool) { 2042 return nil, false 2043} 2044 2045// AsDeliveryRuleCacheKeyQueryStringAction is the BasicDeliveryRuleAction implementation for DeliveryRuleRequestHeaderAction. 2046func (drrha DeliveryRuleRequestHeaderAction) AsDeliveryRuleCacheKeyQueryStringAction() (*DeliveryRuleCacheKeyQueryStringAction, bool) { 2047 return nil, false 2048} 2049 2050// AsDeliveryRuleAction is the BasicDeliveryRuleAction implementation for DeliveryRuleRequestHeaderAction. 2051func (drrha DeliveryRuleRequestHeaderAction) AsDeliveryRuleAction() (*DeliveryRuleAction, bool) { 2052 return nil, false 2053} 2054 2055// AsBasicDeliveryRuleAction is the BasicDeliveryRuleAction implementation for DeliveryRuleRequestHeaderAction. 2056func (drrha DeliveryRuleRequestHeaderAction) AsBasicDeliveryRuleAction() (BasicDeliveryRuleAction, bool) { 2057 return &drrha, true 2058} 2059 2060// DeliveryRuleRequestHeaderCondition defines the RequestHeader condition for the delivery rule. 2061type DeliveryRuleRequestHeaderCondition struct { 2062 // Parameters - Defines the parameters for the condition. 2063 Parameters *RequestHeaderMatchConditionParameters `json:"parameters,omitempty"` 2064 // Name - Possible values include: 'NameDeliveryRuleCondition', 'NameRemoteAddress', 'NameRequestMethod', 'NameQueryString', 'NamePostArgs', 'NameRequestURI', 'NameRequestHeader', 'NameRequestBody', 'NameRequestScheme', 'NameURLPath', 'NameURLFileExtension', 'NameURLFileName', 'NameHTTPVersion', 'NameCookies', 'NameIsDevice' 2065 Name Name `json:"name,omitempty"` 2066} 2067 2068// MarshalJSON is the custom marshaler for DeliveryRuleRequestHeaderCondition. 2069func (drrhc DeliveryRuleRequestHeaderCondition) MarshalJSON() ([]byte, error) { 2070 drrhc.Name = NameRequestHeader 2071 objectMap := make(map[string]interface{}) 2072 if drrhc.Parameters != nil { 2073 objectMap["parameters"] = drrhc.Parameters 2074 } 2075 if drrhc.Name != "" { 2076 objectMap["name"] = drrhc.Name 2077 } 2078 return json.Marshal(objectMap) 2079} 2080 2081// AsDeliveryRuleRemoteAddressCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestHeaderCondition. 2082func (drrhc DeliveryRuleRequestHeaderCondition) AsDeliveryRuleRemoteAddressCondition() (*DeliveryRuleRemoteAddressCondition, bool) { 2083 return nil, false 2084} 2085 2086// AsDeliveryRuleRequestMethodCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestHeaderCondition. 2087func (drrhc DeliveryRuleRequestHeaderCondition) AsDeliveryRuleRequestMethodCondition() (*DeliveryRuleRequestMethodCondition, bool) { 2088 return nil, false 2089} 2090 2091// AsDeliveryRuleQueryStringCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestHeaderCondition. 2092func (drrhc DeliveryRuleRequestHeaderCondition) AsDeliveryRuleQueryStringCondition() (*DeliveryRuleQueryStringCondition, bool) { 2093 return nil, false 2094} 2095 2096// AsDeliveryRulePostArgsCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestHeaderCondition. 2097func (drrhc DeliveryRuleRequestHeaderCondition) AsDeliveryRulePostArgsCondition() (*DeliveryRulePostArgsCondition, bool) { 2098 return nil, false 2099} 2100 2101// AsDeliveryRuleRequestURICondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestHeaderCondition. 2102func (drrhc DeliveryRuleRequestHeaderCondition) AsDeliveryRuleRequestURICondition() (*DeliveryRuleRequestURICondition, bool) { 2103 return nil, false 2104} 2105 2106// AsDeliveryRuleRequestHeaderCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestHeaderCondition. 2107func (drrhc DeliveryRuleRequestHeaderCondition) AsDeliveryRuleRequestHeaderCondition() (*DeliveryRuleRequestHeaderCondition, bool) { 2108 return &drrhc, true 2109} 2110 2111// AsDeliveryRuleRequestBodyCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestHeaderCondition. 2112func (drrhc DeliveryRuleRequestHeaderCondition) AsDeliveryRuleRequestBodyCondition() (*DeliveryRuleRequestBodyCondition, bool) { 2113 return nil, false 2114} 2115 2116// AsDeliveryRuleRequestSchemeCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestHeaderCondition. 2117func (drrhc DeliveryRuleRequestHeaderCondition) AsDeliveryRuleRequestSchemeCondition() (*DeliveryRuleRequestSchemeCondition, bool) { 2118 return nil, false 2119} 2120 2121// AsDeliveryRuleURLPathCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestHeaderCondition. 2122func (drrhc DeliveryRuleRequestHeaderCondition) AsDeliveryRuleURLPathCondition() (*DeliveryRuleURLPathCondition, bool) { 2123 return nil, false 2124} 2125 2126// AsDeliveryRuleURLFileExtensionCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestHeaderCondition. 2127func (drrhc DeliveryRuleRequestHeaderCondition) AsDeliveryRuleURLFileExtensionCondition() (*DeliveryRuleURLFileExtensionCondition, bool) { 2128 return nil, false 2129} 2130 2131// AsDeliveryRuleURLFileNameCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestHeaderCondition. 2132func (drrhc DeliveryRuleRequestHeaderCondition) AsDeliveryRuleURLFileNameCondition() (*DeliveryRuleURLFileNameCondition, bool) { 2133 return nil, false 2134} 2135 2136// AsDeliveryRuleHTTPVersionCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestHeaderCondition. 2137func (drrhc DeliveryRuleRequestHeaderCondition) AsDeliveryRuleHTTPVersionCondition() (*DeliveryRuleHTTPVersionCondition, bool) { 2138 return nil, false 2139} 2140 2141// AsDeliveryRuleCookiesCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestHeaderCondition. 2142func (drrhc DeliveryRuleRequestHeaderCondition) AsDeliveryRuleCookiesCondition() (*DeliveryRuleCookiesCondition, bool) { 2143 return nil, false 2144} 2145 2146// AsDeliveryRuleIsDeviceCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestHeaderCondition. 2147func (drrhc DeliveryRuleRequestHeaderCondition) AsDeliveryRuleIsDeviceCondition() (*DeliveryRuleIsDeviceCondition, bool) { 2148 return nil, false 2149} 2150 2151// AsDeliveryRuleCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestHeaderCondition. 2152func (drrhc DeliveryRuleRequestHeaderCondition) AsDeliveryRuleCondition() (*DeliveryRuleCondition, bool) { 2153 return nil, false 2154} 2155 2156// AsBasicDeliveryRuleCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestHeaderCondition. 2157func (drrhc DeliveryRuleRequestHeaderCondition) AsBasicDeliveryRuleCondition() (BasicDeliveryRuleCondition, bool) { 2158 return &drrhc, true 2159} 2160 2161// DeliveryRuleRequestMethodCondition defines the RequestMethod condition for the delivery rule. 2162type DeliveryRuleRequestMethodCondition struct { 2163 // Parameters - Defines the parameters for the condition. 2164 Parameters *RequestMethodMatchConditionParameters `json:"parameters,omitempty"` 2165 // Name - Possible values include: 'NameDeliveryRuleCondition', 'NameRemoteAddress', 'NameRequestMethod', 'NameQueryString', 'NamePostArgs', 'NameRequestURI', 'NameRequestHeader', 'NameRequestBody', 'NameRequestScheme', 'NameURLPath', 'NameURLFileExtension', 'NameURLFileName', 'NameHTTPVersion', 'NameCookies', 'NameIsDevice' 2166 Name Name `json:"name,omitempty"` 2167} 2168 2169// MarshalJSON is the custom marshaler for DeliveryRuleRequestMethodCondition. 2170func (drrmc DeliveryRuleRequestMethodCondition) MarshalJSON() ([]byte, error) { 2171 drrmc.Name = NameRequestMethod 2172 objectMap := make(map[string]interface{}) 2173 if drrmc.Parameters != nil { 2174 objectMap["parameters"] = drrmc.Parameters 2175 } 2176 if drrmc.Name != "" { 2177 objectMap["name"] = drrmc.Name 2178 } 2179 return json.Marshal(objectMap) 2180} 2181 2182// AsDeliveryRuleRemoteAddressCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestMethodCondition. 2183func (drrmc DeliveryRuleRequestMethodCondition) AsDeliveryRuleRemoteAddressCondition() (*DeliveryRuleRemoteAddressCondition, bool) { 2184 return nil, false 2185} 2186 2187// AsDeliveryRuleRequestMethodCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestMethodCondition. 2188func (drrmc DeliveryRuleRequestMethodCondition) AsDeliveryRuleRequestMethodCondition() (*DeliveryRuleRequestMethodCondition, bool) { 2189 return &drrmc, true 2190} 2191 2192// AsDeliveryRuleQueryStringCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestMethodCondition. 2193func (drrmc DeliveryRuleRequestMethodCondition) AsDeliveryRuleQueryStringCondition() (*DeliveryRuleQueryStringCondition, bool) { 2194 return nil, false 2195} 2196 2197// AsDeliveryRulePostArgsCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestMethodCondition. 2198func (drrmc DeliveryRuleRequestMethodCondition) AsDeliveryRulePostArgsCondition() (*DeliveryRulePostArgsCondition, bool) { 2199 return nil, false 2200} 2201 2202// AsDeliveryRuleRequestURICondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestMethodCondition. 2203func (drrmc DeliveryRuleRequestMethodCondition) AsDeliveryRuleRequestURICondition() (*DeliveryRuleRequestURICondition, bool) { 2204 return nil, false 2205} 2206 2207// AsDeliveryRuleRequestHeaderCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestMethodCondition. 2208func (drrmc DeliveryRuleRequestMethodCondition) AsDeliveryRuleRequestHeaderCondition() (*DeliveryRuleRequestHeaderCondition, bool) { 2209 return nil, false 2210} 2211 2212// AsDeliveryRuleRequestBodyCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestMethodCondition. 2213func (drrmc DeliveryRuleRequestMethodCondition) AsDeliveryRuleRequestBodyCondition() (*DeliveryRuleRequestBodyCondition, bool) { 2214 return nil, false 2215} 2216 2217// AsDeliveryRuleRequestSchemeCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestMethodCondition. 2218func (drrmc DeliveryRuleRequestMethodCondition) AsDeliveryRuleRequestSchemeCondition() (*DeliveryRuleRequestSchemeCondition, bool) { 2219 return nil, false 2220} 2221 2222// AsDeliveryRuleURLPathCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestMethodCondition. 2223func (drrmc DeliveryRuleRequestMethodCondition) AsDeliveryRuleURLPathCondition() (*DeliveryRuleURLPathCondition, bool) { 2224 return nil, false 2225} 2226 2227// AsDeliveryRuleURLFileExtensionCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestMethodCondition. 2228func (drrmc DeliveryRuleRequestMethodCondition) AsDeliveryRuleURLFileExtensionCondition() (*DeliveryRuleURLFileExtensionCondition, bool) { 2229 return nil, false 2230} 2231 2232// AsDeliveryRuleURLFileNameCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestMethodCondition. 2233func (drrmc DeliveryRuleRequestMethodCondition) AsDeliveryRuleURLFileNameCondition() (*DeliveryRuleURLFileNameCondition, bool) { 2234 return nil, false 2235} 2236 2237// AsDeliveryRuleHTTPVersionCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestMethodCondition. 2238func (drrmc DeliveryRuleRequestMethodCondition) AsDeliveryRuleHTTPVersionCondition() (*DeliveryRuleHTTPVersionCondition, bool) { 2239 return nil, false 2240} 2241 2242// AsDeliveryRuleCookiesCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestMethodCondition. 2243func (drrmc DeliveryRuleRequestMethodCondition) AsDeliveryRuleCookiesCondition() (*DeliveryRuleCookiesCondition, bool) { 2244 return nil, false 2245} 2246 2247// AsDeliveryRuleIsDeviceCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestMethodCondition. 2248func (drrmc DeliveryRuleRequestMethodCondition) AsDeliveryRuleIsDeviceCondition() (*DeliveryRuleIsDeviceCondition, bool) { 2249 return nil, false 2250} 2251 2252// AsDeliveryRuleCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestMethodCondition. 2253func (drrmc DeliveryRuleRequestMethodCondition) AsDeliveryRuleCondition() (*DeliveryRuleCondition, bool) { 2254 return nil, false 2255} 2256 2257// AsBasicDeliveryRuleCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestMethodCondition. 2258func (drrmc DeliveryRuleRequestMethodCondition) AsBasicDeliveryRuleCondition() (BasicDeliveryRuleCondition, bool) { 2259 return &drrmc, true 2260} 2261 2262// DeliveryRuleRequestSchemeCondition defines the RequestScheme condition for the delivery rule. 2263type DeliveryRuleRequestSchemeCondition struct { 2264 // Parameters - Defines the parameters for the condition. 2265 Parameters *RequestSchemeMatchConditionParameters `json:"parameters,omitempty"` 2266 // Name - Possible values include: 'NameDeliveryRuleCondition', 'NameRemoteAddress', 'NameRequestMethod', 'NameQueryString', 'NamePostArgs', 'NameRequestURI', 'NameRequestHeader', 'NameRequestBody', 'NameRequestScheme', 'NameURLPath', 'NameURLFileExtension', 'NameURLFileName', 'NameHTTPVersion', 'NameCookies', 'NameIsDevice' 2267 Name Name `json:"name,omitempty"` 2268} 2269 2270// MarshalJSON is the custom marshaler for DeliveryRuleRequestSchemeCondition. 2271func (drrsc DeliveryRuleRequestSchemeCondition) MarshalJSON() ([]byte, error) { 2272 drrsc.Name = NameRequestScheme 2273 objectMap := make(map[string]interface{}) 2274 if drrsc.Parameters != nil { 2275 objectMap["parameters"] = drrsc.Parameters 2276 } 2277 if drrsc.Name != "" { 2278 objectMap["name"] = drrsc.Name 2279 } 2280 return json.Marshal(objectMap) 2281} 2282 2283// AsDeliveryRuleRemoteAddressCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestSchemeCondition. 2284func (drrsc DeliveryRuleRequestSchemeCondition) AsDeliveryRuleRemoteAddressCondition() (*DeliveryRuleRemoteAddressCondition, bool) { 2285 return nil, false 2286} 2287 2288// AsDeliveryRuleRequestMethodCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestSchemeCondition. 2289func (drrsc DeliveryRuleRequestSchemeCondition) AsDeliveryRuleRequestMethodCondition() (*DeliveryRuleRequestMethodCondition, bool) { 2290 return nil, false 2291} 2292 2293// AsDeliveryRuleQueryStringCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestSchemeCondition. 2294func (drrsc DeliveryRuleRequestSchemeCondition) AsDeliveryRuleQueryStringCondition() (*DeliveryRuleQueryStringCondition, bool) { 2295 return nil, false 2296} 2297 2298// AsDeliveryRulePostArgsCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestSchemeCondition. 2299func (drrsc DeliveryRuleRequestSchemeCondition) AsDeliveryRulePostArgsCondition() (*DeliveryRulePostArgsCondition, bool) { 2300 return nil, false 2301} 2302 2303// AsDeliveryRuleRequestURICondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestSchemeCondition. 2304func (drrsc DeliveryRuleRequestSchemeCondition) AsDeliveryRuleRequestURICondition() (*DeliveryRuleRequestURICondition, bool) { 2305 return nil, false 2306} 2307 2308// AsDeliveryRuleRequestHeaderCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestSchemeCondition. 2309func (drrsc DeliveryRuleRequestSchemeCondition) AsDeliveryRuleRequestHeaderCondition() (*DeliveryRuleRequestHeaderCondition, bool) { 2310 return nil, false 2311} 2312 2313// AsDeliveryRuleRequestBodyCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestSchemeCondition. 2314func (drrsc DeliveryRuleRequestSchemeCondition) AsDeliveryRuleRequestBodyCondition() (*DeliveryRuleRequestBodyCondition, bool) { 2315 return nil, false 2316} 2317 2318// AsDeliveryRuleRequestSchemeCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestSchemeCondition. 2319func (drrsc DeliveryRuleRequestSchemeCondition) AsDeliveryRuleRequestSchemeCondition() (*DeliveryRuleRequestSchemeCondition, bool) { 2320 return &drrsc, true 2321} 2322 2323// AsDeliveryRuleURLPathCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestSchemeCondition. 2324func (drrsc DeliveryRuleRequestSchemeCondition) AsDeliveryRuleURLPathCondition() (*DeliveryRuleURLPathCondition, bool) { 2325 return nil, false 2326} 2327 2328// AsDeliveryRuleURLFileExtensionCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestSchemeCondition. 2329func (drrsc DeliveryRuleRequestSchemeCondition) AsDeliveryRuleURLFileExtensionCondition() (*DeliveryRuleURLFileExtensionCondition, bool) { 2330 return nil, false 2331} 2332 2333// AsDeliveryRuleURLFileNameCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestSchemeCondition. 2334func (drrsc DeliveryRuleRequestSchemeCondition) AsDeliveryRuleURLFileNameCondition() (*DeliveryRuleURLFileNameCondition, bool) { 2335 return nil, false 2336} 2337 2338// AsDeliveryRuleHTTPVersionCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestSchemeCondition. 2339func (drrsc DeliveryRuleRequestSchemeCondition) AsDeliveryRuleHTTPVersionCondition() (*DeliveryRuleHTTPVersionCondition, bool) { 2340 return nil, false 2341} 2342 2343// AsDeliveryRuleCookiesCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestSchemeCondition. 2344func (drrsc DeliveryRuleRequestSchemeCondition) AsDeliveryRuleCookiesCondition() (*DeliveryRuleCookiesCondition, bool) { 2345 return nil, false 2346} 2347 2348// AsDeliveryRuleIsDeviceCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestSchemeCondition. 2349func (drrsc DeliveryRuleRequestSchemeCondition) AsDeliveryRuleIsDeviceCondition() (*DeliveryRuleIsDeviceCondition, bool) { 2350 return nil, false 2351} 2352 2353// AsDeliveryRuleCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestSchemeCondition. 2354func (drrsc DeliveryRuleRequestSchemeCondition) AsDeliveryRuleCondition() (*DeliveryRuleCondition, bool) { 2355 return nil, false 2356} 2357 2358// AsBasicDeliveryRuleCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestSchemeCondition. 2359func (drrsc DeliveryRuleRequestSchemeCondition) AsBasicDeliveryRuleCondition() (BasicDeliveryRuleCondition, bool) { 2360 return &drrsc, true 2361} 2362 2363// DeliveryRuleRequestURICondition defines the RequestUri condition for the delivery rule. 2364type DeliveryRuleRequestURICondition struct { 2365 // Parameters - Defines the parameters for the condition. 2366 Parameters *RequestURIMatchConditionParameters `json:"parameters,omitempty"` 2367 // Name - Possible values include: 'NameDeliveryRuleCondition', 'NameRemoteAddress', 'NameRequestMethod', 'NameQueryString', 'NamePostArgs', 'NameRequestURI', 'NameRequestHeader', 'NameRequestBody', 'NameRequestScheme', 'NameURLPath', 'NameURLFileExtension', 'NameURLFileName', 'NameHTTPVersion', 'NameCookies', 'NameIsDevice' 2368 Name Name `json:"name,omitempty"` 2369} 2370 2371// MarshalJSON is the custom marshaler for DeliveryRuleRequestURICondition. 2372func (drruc DeliveryRuleRequestURICondition) MarshalJSON() ([]byte, error) { 2373 drruc.Name = NameRequestURI 2374 objectMap := make(map[string]interface{}) 2375 if drruc.Parameters != nil { 2376 objectMap["parameters"] = drruc.Parameters 2377 } 2378 if drruc.Name != "" { 2379 objectMap["name"] = drruc.Name 2380 } 2381 return json.Marshal(objectMap) 2382} 2383 2384// AsDeliveryRuleRemoteAddressCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestURICondition. 2385func (drruc DeliveryRuleRequestURICondition) AsDeliveryRuleRemoteAddressCondition() (*DeliveryRuleRemoteAddressCondition, bool) { 2386 return nil, false 2387} 2388 2389// AsDeliveryRuleRequestMethodCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestURICondition. 2390func (drruc DeliveryRuleRequestURICondition) AsDeliveryRuleRequestMethodCondition() (*DeliveryRuleRequestMethodCondition, bool) { 2391 return nil, false 2392} 2393 2394// AsDeliveryRuleQueryStringCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestURICondition. 2395func (drruc DeliveryRuleRequestURICondition) AsDeliveryRuleQueryStringCondition() (*DeliveryRuleQueryStringCondition, bool) { 2396 return nil, false 2397} 2398 2399// AsDeliveryRulePostArgsCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestURICondition. 2400func (drruc DeliveryRuleRequestURICondition) AsDeliveryRulePostArgsCondition() (*DeliveryRulePostArgsCondition, bool) { 2401 return nil, false 2402} 2403 2404// AsDeliveryRuleRequestURICondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestURICondition. 2405func (drruc DeliveryRuleRequestURICondition) AsDeliveryRuleRequestURICondition() (*DeliveryRuleRequestURICondition, bool) { 2406 return &drruc, true 2407} 2408 2409// AsDeliveryRuleRequestHeaderCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestURICondition. 2410func (drruc DeliveryRuleRequestURICondition) AsDeliveryRuleRequestHeaderCondition() (*DeliveryRuleRequestHeaderCondition, bool) { 2411 return nil, false 2412} 2413 2414// AsDeliveryRuleRequestBodyCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestURICondition. 2415func (drruc DeliveryRuleRequestURICondition) AsDeliveryRuleRequestBodyCondition() (*DeliveryRuleRequestBodyCondition, bool) { 2416 return nil, false 2417} 2418 2419// AsDeliveryRuleRequestSchemeCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestURICondition. 2420func (drruc DeliveryRuleRequestURICondition) AsDeliveryRuleRequestSchemeCondition() (*DeliveryRuleRequestSchemeCondition, bool) { 2421 return nil, false 2422} 2423 2424// AsDeliveryRuleURLPathCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestURICondition. 2425func (drruc DeliveryRuleRequestURICondition) AsDeliveryRuleURLPathCondition() (*DeliveryRuleURLPathCondition, bool) { 2426 return nil, false 2427} 2428 2429// AsDeliveryRuleURLFileExtensionCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestURICondition. 2430func (drruc DeliveryRuleRequestURICondition) AsDeliveryRuleURLFileExtensionCondition() (*DeliveryRuleURLFileExtensionCondition, bool) { 2431 return nil, false 2432} 2433 2434// AsDeliveryRuleURLFileNameCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestURICondition. 2435func (drruc DeliveryRuleRequestURICondition) AsDeliveryRuleURLFileNameCondition() (*DeliveryRuleURLFileNameCondition, bool) { 2436 return nil, false 2437} 2438 2439// AsDeliveryRuleHTTPVersionCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestURICondition. 2440func (drruc DeliveryRuleRequestURICondition) AsDeliveryRuleHTTPVersionCondition() (*DeliveryRuleHTTPVersionCondition, bool) { 2441 return nil, false 2442} 2443 2444// AsDeliveryRuleCookiesCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestURICondition. 2445func (drruc DeliveryRuleRequestURICondition) AsDeliveryRuleCookiesCondition() (*DeliveryRuleCookiesCondition, bool) { 2446 return nil, false 2447} 2448 2449// AsDeliveryRuleIsDeviceCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestURICondition. 2450func (drruc DeliveryRuleRequestURICondition) AsDeliveryRuleIsDeviceCondition() (*DeliveryRuleIsDeviceCondition, bool) { 2451 return nil, false 2452} 2453 2454// AsDeliveryRuleCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestURICondition. 2455func (drruc DeliveryRuleRequestURICondition) AsDeliveryRuleCondition() (*DeliveryRuleCondition, bool) { 2456 return nil, false 2457} 2458 2459// AsBasicDeliveryRuleCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestURICondition. 2460func (drruc DeliveryRuleRequestURICondition) AsBasicDeliveryRuleCondition() (BasicDeliveryRuleCondition, bool) { 2461 return &drruc, true 2462} 2463 2464// DeliveryRuleResponseHeaderAction defines the response header action for the delivery rule. 2465type DeliveryRuleResponseHeaderAction struct { 2466 // Parameters - Defines the parameters for the action. 2467 Parameters *HeaderActionParameters `json:"parameters,omitempty"` 2468 // Name - Possible values include: 'NameDeliveryRuleAction', 'NameURLRedirect', 'NameURLSigning', 'NameURLRewrite', 'NameModifyRequestHeader', 'NameModifyResponseHeader', 'NameCacheExpiration', 'NameCacheKeyQueryString' 2469 Name NameBasicDeliveryRuleAction `json:"name,omitempty"` 2470} 2471 2472// MarshalJSON is the custom marshaler for DeliveryRuleResponseHeaderAction. 2473func (drrha DeliveryRuleResponseHeaderAction) MarshalJSON() ([]byte, error) { 2474 drrha.Name = NameModifyResponseHeader 2475 objectMap := make(map[string]interface{}) 2476 if drrha.Parameters != nil { 2477 objectMap["parameters"] = drrha.Parameters 2478 } 2479 if drrha.Name != "" { 2480 objectMap["name"] = drrha.Name 2481 } 2482 return json.Marshal(objectMap) 2483} 2484 2485// AsURLRedirectAction is the BasicDeliveryRuleAction implementation for DeliveryRuleResponseHeaderAction. 2486func (drrha DeliveryRuleResponseHeaderAction) AsURLRedirectAction() (*URLRedirectAction, bool) { 2487 return nil, false 2488} 2489 2490// AsURLSigningAction is the BasicDeliveryRuleAction implementation for DeliveryRuleResponseHeaderAction. 2491func (drrha DeliveryRuleResponseHeaderAction) AsURLSigningAction() (*URLSigningAction, bool) { 2492 return nil, false 2493} 2494 2495// AsURLRewriteAction is the BasicDeliveryRuleAction implementation for DeliveryRuleResponseHeaderAction. 2496func (drrha DeliveryRuleResponseHeaderAction) AsURLRewriteAction() (*URLRewriteAction, bool) { 2497 return nil, false 2498} 2499 2500// AsDeliveryRuleRequestHeaderAction is the BasicDeliveryRuleAction implementation for DeliveryRuleResponseHeaderAction. 2501func (drrha DeliveryRuleResponseHeaderAction) AsDeliveryRuleRequestHeaderAction() (*DeliveryRuleRequestHeaderAction, bool) { 2502 return nil, false 2503} 2504 2505// AsDeliveryRuleResponseHeaderAction is the BasicDeliveryRuleAction implementation for DeliveryRuleResponseHeaderAction. 2506func (drrha DeliveryRuleResponseHeaderAction) AsDeliveryRuleResponseHeaderAction() (*DeliveryRuleResponseHeaderAction, bool) { 2507 return &drrha, true 2508} 2509 2510// AsDeliveryRuleCacheExpirationAction is the BasicDeliveryRuleAction implementation for DeliveryRuleResponseHeaderAction. 2511func (drrha DeliveryRuleResponseHeaderAction) AsDeliveryRuleCacheExpirationAction() (*DeliveryRuleCacheExpirationAction, bool) { 2512 return nil, false 2513} 2514 2515// AsDeliveryRuleCacheKeyQueryStringAction is the BasicDeliveryRuleAction implementation for DeliveryRuleResponseHeaderAction. 2516func (drrha DeliveryRuleResponseHeaderAction) AsDeliveryRuleCacheKeyQueryStringAction() (*DeliveryRuleCacheKeyQueryStringAction, bool) { 2517 return nil, false 2518} 2519 2520// AsDeliveryRuleAction is the BasicDeliveryRuleAction implementation for DeliveryRuleResponseHeaderAction. 2521func (drrha DeliveryRuleResponseHeaderAction) AsDeliveryRuleAction() (*DeliveryRuleAction, bool) { 2522 return nil, false 2523} 2524 2525// AsBasicDeliveryRuleAction is the BasicDeliveryRuleAction implementation for DeliveryRuleResponseHeaderAction. 2526func (drrha DeliveryRuleResponseHeaderAction) AsBasicDeliveryRuleAction() (BasicDeliveryRuleAction, bool) { 2527 return &drrha, true 2528} 2529 2530// DeliveryRuleURLFileExtensionCondition defines the UrlFileExtension condition for the delivery rule. 2531type DeliveryRuleURLFileExtensionCondition struct { 2532 // Parameters - Defines the parameters for the condition. 2533 Parameters *URLFileExtensionMatchConditionParameters `json:"parameters,omitempty"` 2534 // Name - Possible values include: 'NameDeliveryRuleCondition', 'NameRemoteAddress', 'NameRequestMethod', 'NameQueryString', 'NamePostArgs', 'NameRequestURI', 'NameRequestHeader', 'NameRequestBody', 'NameRequestScheme', 'NameURLPath', 'NameURLFileExtension', 'NameURLFileName', 'NameHTTPVersion', 'NameCookies', 'NameIsDevice' 2535 Name Name `json:"name,omitempty"` 2536} 2537 2538// MarshalJSON is the custom marshaler for DeliveryRuleURLFileExtensionCondition. 2539func (drufec DeliveryRuleURLFileExtensionCondition) MarshalJSON() ([]byte, error) { 2540 drufec.Name = NameURLFileExtension 2541 objectMap := make(map[string]interface{}) 2542 if drufec.Parameters != nil { 2543 objectMap["parameters"] = drufec.Parameters 2544 } 2545 if drufec.Name != "" { 2546 objectMap["name"] = drufec.Name 2547 } 2548 return json.Marshal(objectMap) 2549} 2550 2551// AsDeliveryRuleRemoteAddressCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleURLFileExtensionCondition. 2552func (drufec DeliveryRuleURLFileExtensionCondition) AsDeliveryRuleRemoteAddressCondition() (*DeliveryRuleRemoteAddressCondition, bool) { 2553 return nil, false 2554} 2555 2556// AsDeliveryRuleRequestMethodCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleURLFileExtensionCondition. 2557func (drufec DeliveryRuleURLFileExtensionCondition) AsDeliveryRuleRequestMethodCondition() (*DeliveryRuleRequestMethodCondition, bool) { 2558 return nil, false 2559} 2560 2561// AsDeliveryRuleQueryStringCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleURLFileExtensionCondition. 2562func (drufec DeliveryRuleURLFileExtensionCondition) AsDeliveryRuleQueryStringCondition() (*DeliveryRuleQueryStringCondition, bool) { 2563 return nil, false 2564} 2565 2566// AsDeliveryRulePostArgsCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleURLFileExtensionCondition. 2567func (drufec DeliveryRuleURLFileExtensionCondition) AsDeliveryRulePostArgsCondition() (*DeliveryRulePostArgsCondition, bool) { 2568 return nil, false 2569} 2570 2571// AsDeliveryRuleRequestURICondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleURLFileExtensionCondition. 2572func (drufec DeliveryRuleURLFileExtensionCondition) AsDeliveryRuleRequestURICondition() (*DeliveryRuleRequestURICondition, bool) { 2573 return nil, false 2574} 2575 2576// AsDeliveryRuleRequestHeaderCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleURLFileExtensionCondition. 2577func (drufec DeliveryRuleURLFileExtensionCondition) AsDeliveryRuleRequestHeaderCondition() (*DeliveryRuleRequestHeaderCondition, bool) { 2578 return nil, false 2579} 2580 2581// AsDeliveryRuleRequestBodyCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleURLFileExtensionCondition. 2582func (drufec DeliveryRuleURLFileExtensionCondition) AsDeliveryRuleRequestBodyCondition() (*DeliveryRuleRequestBodyCondition, bool) { 2583 return nil, false 2584} 2585 2586// AsDeliveryRuleRequestSchemeCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleURLFileExtensionCondition. 2587func (drufec DeliveryRuleURLFileExtensionCondition) AsDeliveryRuleRequestSchemeCondition() (*DeliveryRuleRequestSchemeCondition, bool) { 2588 return nil, false 2589} 2590 2591// AsDeliveryRuleURLPathCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleURLFileExtensionCondition. 2592func (drufec DeliveryRuleURLFileExtensionCondition) AsDeliveryRuleURLPathCondition() (*DeliveryRuleURLPathCondition, bool) { 2593 return nil, false 2594} 2595 2596// AsDeliveryRuleURLFileExtensionCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleURLFileExtensionCondition. 2597func (drufec DeliveryRuleURLFileExtensionCondition) AsDeliveryRuleURLFileExtensionCondition() (*DeliveryRuleURLFileExtensionCondition, bool) { 2598 return &drufec, true 2599} 2600 2601// AsDeliveryRuleURLFileNameCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleURLFileExtensionCondition. 2602func (drufec DeliveryRuleURLFileExtensionCondition) AsDeliveryRuleURLFileNameCondition() (*DeliveryRuleURLFileNameCondition, bool) { 2603 return nil, false 2604} 2605 2606// AsDeliveryRuleHTTPVersionCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleURLFileExtensionCondition. 2607func (drufec DeliveryRuleURLFileExtensionCondition) AsDeliveryRuleHTTPVersionCondition() (*DeliveryRuleHTTPVersionCondition, bool) { 2608 return nil, false 2609} 2610 2611// AsDeliveryRuleCookiesCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleURLFileExtensionCondition. 2612func (drufec DeliveryRuleURLFileExtensionCondition) AsDeliveryRuleCookiesCondition() (*DeliveryRuleCookiesCondition, bool) { 2613 return nil, false 2614} 2615 2616// AsDeliveryRuleIsDeviceCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleURLFileExtensionCondition. 2617func (drufec DeliveryRuleURLFileExtensionCondition) AsDeliveryRuleIsDeviceCondition() (*DeliveryRuleIsDeviceCondition, bool) { 2618 return nil, false 2619} 2620 2621// AsDeliveryRuleCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleURLFileExtensionCondition. 2622func (drufec DeliveryRuleURLFileExtensionCondition) AsDeliveryRuleCondition() (*DeliveryRuleCondition, bool) { 2623 return nil, false 2624} 2625 2626// AsBasicDeliveryRuleCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleURLFileExtensionCondition. 2627func (drufec DeliveryRuleURLFileExtensionCondition) AsBasicDeliveryRuleCondition() (BasicDeliveryRuleCondition, bool) { 2628 return &drufec, true 2629} 2630 2631// DeliveryRuleURLFileNameCondition defines the UrlFileName condition for the delivery rule. 2632type DeliveryRuleURLFileNameCondition struct { 2633 // Parameters - Defines the parameters for the condition. 2634 Parameters *URLFileNameMatchConditionParameters `json:"parameters,omitempty"` 2635 // Name - Possible values include: 'NameDeliveryRuleCondition', 'NameRemoteAddress', 'NameRequestMethod', 'NameQueryString', 'NamePostArgs', 'NameRequestURI', 'NameRequestHeader', 'NameRequestBody', 'NameRequestScheme', 'NameURLPath', 'NameURLFileExtension', 'NameURLFileName', 'NameHTTPVersion', 'NameCookies', 'NameIsDevice' 2636 Name Name `json:"name,omitempty"` 2637} 2638 2639// MarshalJSON is the custom marshaler for DeliveryRuleURLFileNameCondition. 2640func (drufnc DeliveryRuleURLFileNameCondition) MarshalJSON() ([]byte, error) { 2641 drufnc.Name = NameURLFileName 2642 objectMap := make(map[string]interface{}) 2643 if drufnc.Parameters != nil { 2644 objectMap["parameters"] = drufnc.Parameters 2645 } 2646 if drufnc.Name != "" { 2647 objectMap["name"] = drufnc.Name 2648 } 2649 return json.Marshal(objectMap) 2650} 2651 2652// AsDeliveryRuleRemoteAddressCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleURLFileNameCondition. 2653func (drufnc DeliveryRuleURLFileNameCondition) AsDeliveryRuleRemoteAddressCondition() (*DeliveryRuleRemoteAddressCondition, bool) { 2654 return nil, false 2655} 2656 2657// AsDeliveryRuleRequestMethodCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleURLFileNameCondition. 2658func (drufnc DeliveryRuleURLFileNameCondition) AsDeliveryRuleRequestMethodCondition() (*DeliveryRuleRequestMethodCondition, bool) { 2659 return nil, false 2660} 2661 2662// AsDeliveryRuleQueryStringCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleURLFileNameCondition. 2663func (drufnc DeliveryRuleURLFileNameCondition) AsDeliveryRuleQueryStringCondition() (*DeliveryRuleQueryStringCondition, bool) { 2664 return nil, false 2665} 2666 2667// AsDeliveryRulePostArgsCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleURLFileNameCondition. 2668func (drufnc DeliveryRuleURLFileNameCondition) AsDeliveryRulePostArgsCondition() (*DeliveryRulePostArgsCondition, bool) { 2669 return nil, false 2670} 2671 2672// AsDeliveryRuleRequestURICondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleURLFileNameCondition. 2673func (drufnc DeliveryRuleURLFileNameCondition) AsDeliveryRuleRequestURICondition() (*DeliveryRuleRequestURICondition, bool) { 2674 return nil, false 2675} 2676 2677// AsDeliveryRuleRequestHeaderCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleURLFileNameCondition. 2678func (drufnc DeliveryRuleURLFileNameCondition) AsDeliveryRuleRequestHeaderCondition() (*DeliveryRuleRequestHeaderCondition, bool) { 2679 return nil, false 2680} 2681 2682// AsDeliveryRuleRequestBodyCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleURLFileNameCondition. 2683func (drufnc DeliveryRuleURLFileNameCondition) AsDeliveryRuleRequestBodyCondition() (*DeliveryRuleRequestBodyCondition, bool) { 2684 return nil, false 2685} 2686 2687// AsDeliveryRuleRequestSchemeCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleURLFileNameCondition. 2688func (drufnc DeliveryRuleURLFileNameCondition) AsDeliveryRuleRequestSchemeCondition() (*DeliveryRuleRequestSchemeCondition, bool) { 2689 return nil, false 2690} 2691 2692// AsDeliveryRuleURLPathCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleURLFileNameCondition. 2693func (drufnc DeliveryRuleURLFileNameCondition) AsDeliveryRuleURLPathCondition() (*DeliveryRuleURLPathCondition, bool) { 2694 return nil, false 2695} 2696 2697// AsDeliveryRuleURLFileExtensionCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleURLFileNameCondition. 2698func (drufnc DeliveryRuleURLFileNameCondition) AsDeliveryRuleURLFileExtensionCondition() (*DeliveryRuleURLFileExtensionCondition, bool) { 2699 return nil, false 2700} 2701 2702// AsDeliveryRuleURLFileNameCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleURLFileNameCondition. 2703func (drufnc DeliveryRuleURLFileNameCondition) AsDeliveryRuleURLFileNameCondition() (*DeliveryRuleURLFileNameCondition, bool) { 2704 return &drufnc, true 2705} 2706 2707// AsDeliveryRuleHTTPVersionCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleURLFileNameCondition. 2708func (drufnc DeliveryRuleURLFileNameCondition) AsDeliveryRuleHTTPVersionCondition() (*DeliveryRuleHTTPVersionCondition, bool) { 2709 return nil, false 2710} 2711 2712// AsDeliveryRuleCookiesCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleURLFileNameCondition. 2713func (drufnc DeliveryRuleURLFileNameCondition) AsDeliveryRuleCookiesCondition() (*DeliveryRuleCookiesCondition, bool) { 2714 return nil, false 2715} 2716 2717// AsDeliveryRuleIsDeviceCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleURLFileNameCondition. 2718func (drufnc DeliveryRuleURLFileNameCondition) AsDeliveryRuleIsDeviceCondition() (*DeliveryRuleIsDeviceCondition, bool) { 2719 return nil, false 2720} 2721 2722// AsDeliveryRuleCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleURLFileNameCondition. 2723func (drufnc DeliveryRuleURLFileNameCondition) AsDeliveryRuleCondition() (*DeliveryRuleCondition, bool) { 2724 return nil, false 2725} 2726 2727// AsBasicDeliveryRuleCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleURLFileNameCondition. 2728func (drufnc DeliveryRuleURLFileNameCondition) AsBasicDeliveryRuleCondition() (BasicDeliveryRuleCondition, bool) { 2729 return &drufnc, true 2730} 2731 2732// DeliveryRuleURLPathCondition defines the UrlPath condition for the delivery rule. 2733type DeliveryRuleURLPathCondition struct { 2734 // Parameters - Defines the parameters for the condition. 2735 Parameters *URLPathMatchConditionParameters `json:"parameters,omitempty"` 2736 // Name - Possible values include: 'NameDeliveryRuleCondition', 'NameRemoteAddress', 'NameRequestMethod', 'NameQueryString', 'NamePostArgs', 'NameRequestURI', 'NameRequestHeader', 'NameRequestBody', 'NameRequestScheme', 'NameURLPath', 'NameURLFileExtension', 'NameURLFileName', 'NameHTTPVersion', 'NameCookies', 'NameIsDevice' 2737 Name Name `json:"name,omitempty"` 2738} 2739 2740// MarshalJSON is the custom marshaler for DeliveryRuleURLPathCondition. 2741func (drupc DeliveryRuleURLPathCondition) MarshalJSON() ([]byte, error) { 2742 drupc.Name = NameURLPath 2743 objectMap := make(map[string]interface{}) 2744 if drupc.Parameters != nil { 2745 objectMap["parameters"] = drupc.Parameters 2746 } 2747 if drupc.Name != "" { 2748 objectMap["name"] = drupc.Name 2749 } 2750 return json.Marshal(objectMap) 2751} 2752 2753// AsDeliveryRuleRemoteAddressCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleURLPathCondition. 2754func (drupc DeliveryRuleURLPathCondition) AsDeliveryRuleRemoteAddressCondition() (*DeliveryRuleRemoteAddressCondition, bool) { 2755 return nil, false 2756} 2757 2758// AsDeliveryRuleRequestMethodCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleURLPathCondition. 2759func (drupc DeliveryRuleURLPathCondition) AsDeliveryRuleRequestMethodCondition() (*DeliveryRuleRequestMethodCondition, bool) { 2760 return nil, false 2761} 2762 2763// AsDeliveryRuleQueryStringCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleURLPathCondition. 2764func (drupc DeliveryRuleURLPathCondition) AsDeliveryRuleQueryStringCondition() (*DeliveryRuleQueryStringCondition, bool) { 2765 return nil, false 2766} 2767 2768// AsDeliveryRulePostArgsCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleURLPathCondition. 2769func (drupc DeliveryRuleURLPathCondition) AsDeliveryRulePostArgsCondition() (*DeliveryRulePostArgsCondition, bool) { 2770 return nil, false 2771} 2772 2773// AsDeliveryRuleRequestURICondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleURLPathCondition. 2774func (drupc DeliveryRuleURLPathCondition) AsDeliveryRuleRequestURICondition() (*DeliveryRuleRequestURICondition, bool) { 2775 return nil, false 2776} 2777 2778// AsDeliveryRuleRequestHeaderCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleURLPathCondition. 2779func (drupc DeliveryRuleURLPathCondition) AsDeliveryRuleRequestHeaderCondition() (*DeliveryRuleRequestHeaderCondition, bool) { 2780 return nil, false 2781} 2782 2783// AsDeliveryRuleRequestBodyCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleURLPathCondition. 2784func (drupc DeliveryRuleURLPathCondition) AsDeliveryRuleRequestBodyCondition() (*DeliveryRuleRequestBodyCondition, bool) { 2785 return nil, false 2786} 2787 2788// AsDeliveryRuleRequestSchemeCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleURLPathCondition. 2789func (drupc DeliveryRuleURLPathCondition) AsDeliveryRuleRequestSchemeCondition() (*DeliveryRuleRequestSchemeCondition, bool) { 2790 return nil, false 2791} 2792 2793// AsDeliveryRuleURLPathCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleURLPathCondition. 2794func (drupc DeliveryRuleURLPathCondition) AsDeliveryRuleURLPathCondition() (*DeliveryRuleURLPathCondition, bool) { 2795 return &drupc, true 2796} 2797 2798// AsDeliveryRuleURLFileExtensionCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleURLPathCondition. 2799func (drupc DeliveryRuleURLPathCondition) AsDeliveryRuleURLFileExtensionCondition() (*DeliveryRuleURLFileExtensionCondition, bool) { 2800 return nil, false 2801} 2802 2803// AsDeliveryRuleURLFileNameCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleURLPathCondition. 2804func (drupc DeliveryRuleURLPathCondition) AsDeliveryRuleURLFileNameCondition() (*DeliveryRuleURLFileNameCondition, bool) { 2805 return nil, false 2806} 2807 2808// AsDeliveryRuleHTTPVersionCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleURLPathCondition. 2809func (drupc DeliveryRuleURLPathCondition) AsDeliveryRuleHTTPVersionCondition() (*DeliveryRuleHTTPVersionCondition, bool) { 2810 return nil, false 2811} 2812 2813// AsDeliveryRuleCookiesCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleURLPathCondition. 2814func (drupc DeliveryRuleURLPathCondition) AsDeliveryRuleCookiesCondition() (*DeliveryRuleCookiesCondition, bool) { 2815 return nil, false 2816} 2817 2818// AsDeliveryRuleIsDeviceCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleURLPathCondition. 2819func (drupc DeliveryRuleURLPathCondition) AsDeliveryRuleIsDeviceCondition() (*DeliveryRuleIsDeviceCondition, bool) { 2820 return nil, false 2821} 2822 2823// AsDeliveryRuleCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleURLPathCondition. 2824func (drupc DeliveryRuleURLPathCondition) AsDeliveryRuleCondition() (*DeliveryRuleCondition, bool) { 2825 return nil, false 2826} 2827 2828// AsBasicDeliveryRuleCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleURLPathCondition. 2829func (drupc DeliveryRuleURLPathCondition) AsBasicDeliveryRuleCondition() (BasicDeliveryRuleCondition, bool) { 2830 return &drupc, true 2831} 2832 2833// EdgeNode edgenode is a global Point of Presence (POP) location used to deliver CDN content to end users. 2834type EdgeNode struct { 2835 *EdgeNodeProperties `json:"properties,omitempty"` 2836 // ID - READ-ONLY; Resource ID. 2837 ID *string `json:"id,omitempty"` 2838 // Name - READ-ONLY; Resource name. 2839 Name *string `json:"name,omitempty"` 2840 // Type - READ-ONLY; Resource type. 2841 Type *string `json:"type,omitempty"` 2842} 2843 2844// MarshalJSON is the custom marshaler for EdgeNode. 2845func (en EdgeNode) MarshalJSON() ([]byte, error) { 2846 objectMap := make(map[string]interface{}) 2847 if en.EdgeNodeProperties != nil { 2848 objectMap["properties"] = en.EdgeNodeProperties 2849 } 2850 return json.Marshal(objectMap) 2851} 2852 2853// UnmarshalJSON is the custom unmarshaler for EdgeNode struct. 2854func (en *EdgeNode) UnmarshalJSON(body []byte) error { 2855 var m map[string]*json.RawMessage 2856 err := json.Unmarshal(body, &m) 2857 if err != nil { 2858 return err 2859 } 2860 for k, v := range m { 2861 switch k { 2862 case "properties": 2863 if v != nil { 2864 var edgeNodeProperties EdgeNodeProperties 2865 err = json.Unmarshal(*v, &edgeNodeProperties) 2866 if err != nil { 2867 return err 2868 } 2869 en.EdgeNodeProperties = &edgeNodeProperties 2870 } 2871 case "id": 2872 if v != nil { 2873 var ID string 2874 err = json.Unmarshal(*v, &ID) 2875 if err != nil { 2876 return err 2877 } 2878 en.ID = &ID 2879 } 2880 case "name": 2881 if v != nil { 2882 var name string 2883 err = json.Unmarshal(*v, &name) 2884 if err != nil { 2885 return err 2886 } 2887 en.Name = &name 2888 } 2889 case "type": 2890 if v != nil { 2891 var typeVar string 2892 err = json.Unmarshal(*v, &typeVar) 2893 if err != nil { 2894 return err 2895 } 2896 en.Type = &typeVar 2897 } 2898 } 2899 } 2900 2901 return nil 2902} 2903 2904// EdgeNodeProperties the JSON object that contains the properties required to create an edgenode. 2905type EdgeNodeProperties struct { 2906 // IPAddressGroups - List of ip address groups. 2907 IPAddressGroups *[]IPAddressGroup `json:"ipAddressGroups,omitempty"` 2908} 2909 2910// EdgenodeResult result of the request to list CDN edgenodes. It contains a list of ip address group and a 2911// URL link to get the next set of results. 2912type EdgenodeResult struct { 2913 autorest.Response `json:"-"` 2914 // Value - READ-ONLY; Edge node of CDN service. 2915 Value *[]EdgeNode `json:"value,omitempty"` 2916 // NextLink - URL to get the next set of edgenode list results if there are any. 2917 NextLink *string `json:"nextLink,omitempty"` 2918} 2919 2920// MarshalJSON is the custom marshaler for EdgenodeResult. 2921func (er EdgenodeResult) MarshalJSON() ([]byte, error) { 2922 objectMap := make(map[string]interface{}) 2923 if er.NextLink != nil { 2924 objectMap["nextLink"] = er.NextLink 2925 } 2926 return json.Marshal(objectMap) 2927} 2928 2929// EdgenodeResultIterator provides access to a complete listing of EdgeNode values. 2930type EdgenodeResultIterator struct { 2931 i int 2932 page EdgenodeResultPage 2933} 2934 2935// NextWithContext advances to the next value. If there was an error making 2936// the request the iterator does not advance and the error is returned. 2937func (iter *EdgenodeResultIterator) NextWithContext(ctx context.Context) (err error) { 2938 if tracing.IsEnabled() { 2939 ctx = tracing.StartSpan(ctx, fqdn+"/EdgenodeResultIterator.NextWithContext") 2940 defer func() { 2941 sc := -1 2942 if iter.Response().Response.Response != nil { 2943 sc = iter.Response().Response.Response.StatusCode 2944 } 2945 tracing.EndSpan(ctx, sc, err) 2946 }() 2947 } 2948 iter.i++ 2949 if iter.i < len(iter.page.Values()) { 2950 return nil 2951 } 2952 err = iter.page.NextWithContext(ctx) 2953 if err != nil { 2954 iter.i-- 2955 return err 2956 } 2957 iter.i = 0 2958 return nil 2959} 2960 2961// Next advances to the next value. If there was an error making 2962// the request the iterator does not advance and the error is returned. 2963// Deprecated: Use NextWithContext() instead. 2964func (iter *EdgenodeResultIterator) Next() error { 2965 return iter.NextWithContext(context.Background()) 2966} 2967 2968// NotDone returns true if the enumeration should be started or is not yet complete. 2969func (iter EdgenodeResultIterator) NotDone() bool { 2970 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 2971} 2972 2973// Response returns the raw server response from the last page request. 2974func (iter EdgenodeResultIterator) Response() EdgenodeResult { 2975 return iter.page.Response() 2976} 2977 2978// Value returns the current value or a zero-initialized value if the 2979// iterator has advanced beyond the end of the collection. 2980func (iter EdgenodeResultIterator) Value() EdgeNode { 2981 if !iter.page.NotDone() { 2982 return EdgeNode{} 2983 } 2984 return iter.page.Values()[iter.i] 2985} 2986 2987// Creates a new instance of the EdgenodeResultIterator type. 2988func NewEdgenodeResultIterator(page EdgenodeResultPage) EdgenodeResultIterator { 2989 return EdgenodeResultIterator{page: page} 2990} 2991 2992// IsEmpty returns true if the ListResult contains no values. 2993func (er EdgenodeResult) IsEmpty() bool { 2994 return er.Value == nil || len(*er.Value) == 0 2995} 2996 2997// hasNextLink returns true if the NextLink is not empty. 2998func (er EdgenodeResult) hasNextLink() bool { 2999 return er.NextLink != nil && len(*er.NextLink) != 0 3000} 3001 3002// edgenodeResultPreparer prepares a request to retrieve the next set of results. 3003// It returns nil if no more results exist. 3004func (er EdgenodeResult) edgenodeResultPreparer(ctx context.Context) (*http.Request, error) { 3005 if !er.hasNextLink() { 3006 return nil, nil 3007 } 3008 return autorest.Prepare((&http.Request{}).WithContext(ctx), 3009 autorest.AsJSON(), 3010 autorest.AsGet(), 3011 autorest.WithBaseURL(to.String(er.NextLink))) 3012} 3013 3014// EdgenodeResultPage contains a page of EdgeNode values. 3015type EdgenodeResultPage struct { 3016 fn func(context.Context, EdgenodeResult) (EdgenodeResult, error) 3017 er EdgenodeResult 3018} 3019 3020// NextWithContext advances to the next page of values. If there was an error making 3021// the request the page does not advance and the error is returned. 3022func (page *EdgenodeResultPage) NextWithContext(ctx context.Context) (err error) { 3023 if tracing.IsEnabled() { 3024 ctx = tracing.StartSpan(ctx, fqdn+"/EdgenodeResultPage.NextWithContext") 3025 defer func() { 3026 sc := -1 3027 if page.Response().Response.Response != nil { 3028 sc = page.Response().Response.Response.StatusCode 3029 } 3030 tracing.EndSpan(ctx, sc, err) 3031 }() 3032 } 3033 for { 3034 next, err := page.fn(ctx, page.er) 3035 if err != nil { 3036 return err 3037 } 3038 page.er = next 3039 if !next.hasNextLink() || !next.IsEmpty() { 3040 break 3041 } 3042 } 3043 return nil 3044} 3045 3046// Next advances to the next page of values. If there was an error making 3047// the request the page does not advance and the error is returned. 3048// Deprecated: Use NextWithContext() instead. 3049func (page *EdgenodeResultPage) Next() error { 3050 return page.NextWithContext(context.Background()) 3051} 3052 3053// NotDone returns true if the page enumeration should be started or is not yet complete. 3054func (page EdgenodeResultPage) NotDone() bool { 3055 return !page.er.IsEmpty() 3056} 3057 3058// Response returns the raw server response from the last page request. 3059func (page EdgenodeResultPage) Response() EdgenodeResult { 3060 return page.er 3061} 3062 3063// Values returns the slice of values for the current page or nil if there are no values. 3064func (page EdgenodeResultPage) Values() []EdgeNode { 3065 if page.er.IsEmpty() { 3066 return nil 3067 } 3068 return *page.er.Value 3069} 3070 3071// Creates a new instance of the EdgenodeResultPage type. 3072func NewEdgenodeResultPage(cur EdgenodeResult, getNextPage func(context.Context, EdgenodeResult) (EdgenodeResult, error)) EdgenodeResultPage { 3073 return EdgenodeResultPage{ 3074 fn: getNextPage, 3075 er: cur, 3076 } 3077} 3078 3079// Endpoint CDN endpoint is the entity within a CDN profile containing configuration information such as 3080// origin, protocol, content caching and delivery behavior. The CDN endpoint uses the URL format 3081// <endpointname>.azureedge.net. 3082type Endpoint struct { 3083 autorest.Response `json:"-"` 3084 *EndpointProperties `json:"properties,omitempty"` 3085 // Location - Resource location. 3086 Location *string `json:"location,omitempty"` 3087 // Tags - Resource tags. 3088 Tags map[string]*string `json:"tags"` 3089 // ID - READ-ONLY; Resource ID. 3090 ID *string `json:"id,omitempty"` 3091 // Name - READ-ONLY; Resource name. 3092 Name *string `json:"name,omitempty"` 3093 // Type - READ-ONLY; Resource type. 3094 Type *string `json:"type,omitempty"` 3095} 3096 3097// MarshalJSON is the custom marshaler for Endpoint. 3098func (e Endpoint) MarshalJSON() ([]byte, error) { 3099 objectMap := make(map[string]interface{}) 3100 if e.EndpointProperties != nil { 3101 objectMap["properties"] = e.EndpointProperties 3102 } 3103 if e.Location != nil { 3104 objectMap["location"] = e.Location 3105 } 3106 if e.Tags != nil { 3107 objectMap["tags"] = e.Tags 3108 } 3109 return json.Marshal(objectMap) 3110} 3111 3112// UnmarshalJSON is the custom unmarshaler for Endpoint struct. 3113func (e *Endpoint) UnmarshalJSON(body []byte) error { 3114 var m map[string]*json.RawMessage 3115 err := json.Unmarshal(body, &m) 3116 if err != nil { 3117 return err 3118 } 3119 for k, v := range m { 3120 switch k { 3121 case "properties": 3122 if v != nil { 3123 var endpointProperties EndpointProperties 3124 err = json.Unmarshal(*v, &endpointProperties) 3125 if err != nil { 3126 return err 3127 } 3128 e.EndpointProperties = &endpointProperties 3129 } 3130 case "location": 3131 if v != nil { 3132 var location string 3133 err = json.Unmarshal(*v, &location) 3134 if err != nil { 3135 return err 3136 } 3137 e.Location = &location 3138 } 3139 case "tags": 3140 if v != nil { 3141 var tags map[string]*string 3142 err = json.Unmarshal(*v, &tags) 3143 if err != nil { 3144 return err 3145 } 3146 e.Tags = tags 3147 } 3148 case "id": 3149 if v != nil { 3150 var ID string 3151 err = json.Unmarshal(*v, &ID) 3152 if err != nil { 3153 return err 3154 } 3155 e.ID = &ID 3156 } 3157 case "name": 3158 if v != nil { 3159 var name string 3160 err = json.Unmarshal(*v, &name) 3161 if err != nil { 3162 return err 3163 } 3164 e.Name = &name 3165 } 3166 case "type": 3167 if v != nil { 3168 var typeVar string 3169 err = json.Unmarshal(*v, &typeVar) 3170 if err != nil { 3171 return err 3172 } 3173 e.Type = &typeVar 3174 } 3175 } 3176 } 3177 3178 return nil 3179} 3180 3181// EndpointListResult result of the request to list endpoints. It contains a list of endpoint objects and a 3182// URL link to get the next set of results. 3183type EndpointListResult struct { 3184 autorest.Response `json:"-"` 3185 // Value - READ-ONLY; List of CDN endpoints within a profile 3186 Value *[]Endpoint `json:"value,omitempty"` 3187 // NextLink - URL to get the next set of endpoint objects if there is any. 3188 NextLink *string `json:"nextLink,omitempty"` 3189} 3190 3191// MarshalJSON is the custom marshaler for EndpointListResult. 3192func (elr EndpointListResult) MarshalJSON() ([]byte, error) { 3193 objectMap := make(map[string]interface{}) 3194 if elr.NextLink != nil { 3195 objectMap["nextLink"] = elr.NextLink 3196 } 3197 return json.Marshal(objectMap) 3198} 3199 3200// EndpointListResultIterator provides access to a complete listing of Endpoint values. 3201type EndpointListResultIterator struct { 3202 i int 3203 page EndpointListResultPage 3204} 3205 3206// NextWithContext advances to the next value. If there was an error making 3207// the request the iterator does not advance and the error is returned. 3208func (iter *EndpointListResultIterator) NextWithContext(ctx context.Context) (err error) { 3209 if tracing.IsEnabled() { 3210 ctx = tracing.StartSpan(ctx, fqdn+"/EndpointListResultIterator.NextWithContext") 3211 defer func() { 3212 sc := -1 3213 if iter.Response().Response.Response != nil { 3214 sc = iter.Response().Response.Response.StatusCode 3215 } 3216 tracing.EndSpan(ctx, sc, err) 3217 }() 3218 } 3219 iter.i++ 3220 if iter.i < len(iter.page.Values()) { 3221 return nil 3222 } 3223 err = iter.page.NextWithContext(ctx) 3224 if err != nil { 3225 iter.i-- 3226 return err 3227 } 3228 iter.i = 0 3229 return nil 3230} 3231 3232// Next advances to the next value. If there was an error making 3233// the request the iterator does not advance and the error is returned. 3234// Deprecated: Use NextWithContext() instead. 3235func (iter *EndpointListResultIterator) Next() error { 3236 return iter.NextWithContext(context.Background()) 3237} 3238 3239// NotDone returns true if the enumeration should be started or is not yet complete. 3240func (iter EndpointListResultIterator) NotDone() bool { 3241 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 3242} 3243 3244// Response returns the raw server response from the last page request. 3245func (iter EndpointListResultIterator) Response() EndpointListResult { 3246 return iter.page.Response() 3247} 3248 3249// Value returns the current value or a zero-initialized value if the 3250// iterator has advanced beyond the end of the collection. 3251func (iter EndpointListResultIterator) Value() Endpoint { 3252 if !iter.page.NotDone() { 3253 return Endpoint{} 3254 } 3255 return iter.page.Values()[iter.i] 3256} 3257 3258// Creates a new instance of the EndpointListResultIterator type. 3259func NewEndpointListResultIterator(page EndpointListResultPage) EndpointListResultIterator { 3260 return EndpointListResultIterator{page: page} 3261} 3262 3263// IsEmpty returns true if the ListResult contains no values. 3264func (elr EndpointListResult) IsEmpty() bool { 3265 return elr.Value == nil || len(*elr.Value) == 0 3266} 3267 3268// hasNextLink returns true if the NextLink is not empty. 3269func (elr EndpointListResult) hasNextLink() bool { 3270 return elr.NextLink != nil && len(*elr.NextLink) != 0 3271} 3272 3273// endpointListResultPreparer prepares a request to retrieve the next set of results. 3274// It returns nil if no more results exist. 3275func (elr EndpointListResult) endpointListResultPreparer(ctx context.Context) (*http.Request, error) { 3276 if !elr.hasNextLink() { 3277 return nil, nil 3278 } 3279 return autorest.Prepare((&http.Request{}).WithContext(ctx), 3280 autorest.AsJSON(), 3281 autorest.AsGet(), 3282 autorest.WithBaseURL(to.String(elr.NextLink))) 3283} 3284 3285// EndpointListResultPage contains a page of Endpoint values. 3286type EndpointListResultPage struct { 3287 fn func(context.Context, EndpointListResult) (EndpointListResult, error) 3288 elr EndpointListResult 3289} 3290 3291// NextWithContext advances to the next page of values. If there was an error making 3292// the request the page does not advance and the error is returned. 3293func (page *EndpointListResultPage) NextWithContext(ctx context.Context) (err error) { 3294 if tracing.IsEnabled() { 3295 ctx = tracing.StartSpan(ctx, fqdn+"/EndpointListResultPage.NextWithContext") 3296 defer func() { 3297 sc := -1 3298 if page.Response().Response.Response != nil { 3299 sc = page.Response().Response.Response.StatusCode 3300 } 3301 tracing.EndSpan(ctx, sc, err) 3302 }() 3303 } 3304 for { 3305 next, err := page.fn(ctx, page.elr) 3306 if err != nil { 3307 return err 3308 } 3309 page.elr = next 3310 if !next.hasNextLink() || !next.IsEmpty() { 3311 break 3312 } 3313 } 3314 return nil 3315} 3316 3317// Next advances to the next page of values. If there was an error making 3318// the request the page does not advance and the error is returned. 3319// Deprecated: Use NextWithContext() instead. 3320func (page *EndpointListResultPage) Next() error { 3321 return page.NextWithContext(context.Background()) 3322} 3323 3324// NotDone returns true if the page enumeration should be started or is not yet complete. 3325func (page EndpointListResultPage) NotDone() bool { 3326 return !page.elr.IsEmpty() 3327} 3328 3329// Response returns the raw server response from the last page request. 3330func (page EndpointListResultPage) Response() EndpointListResult { 3331 return page.elr 3332} 3333 3334// Values returns the slice of values for the current page or nil if there are no values. 3335func (page EndpointListResultPage) Values() []Endpoint { 3336 if page.elr.IsEmpty() { 3337 return nil 3338 } 3339 return *page.elr.Value 3340} 3341 3342// Creates a new instance of the EndpointListResultPage type. 3343func NewEndpointListResultPage(cur EndpointListResult, getNextPage func(context.Context, EndpointListResult) (EndpointListResult, error)) EndpointListResultPage { 3344 return EndpointListResultPage{ 3345 fn: getNextPage, 3346 elr: cur, 3347 } 3348} 3349 3350// EndpointProperties the JSON object that contains the properties required to create an endpoint. 3351type EndpointProperties struct { 3352 // HostName - READ-ONLY; The host name of the endpoint structured as {endpointName}.{DNSZone}, e.g. contoso.azureedge.net 3353 HostName *string `json:"hostName,omitempty"` 3354 // Origins - The source of the content being delivered via CDN. 3355 Origins *[]DeepCreatedOrigin `json:"origins,omitempty"` 3356 // OriginGroups - The origin groups comprising of origins that are used for load balancing the traffic based on availability. 3357 OriginGroups *[]DeepCreatedOriginGroup `json:"originGroups,omitempty"` 3358 // ResourceState - READ-ONLY; Resource status of the endpoint. Possible values include: 'EndpointResourceStateCreating', 'EndpointResourceStateDeleting', 'EndpointResourceStateRunning', 'EndpointResourceStateStarting', 'EndpointResourceStateStopped', 'EndpointResourceStateStopping' 3359 ResourceState EndpointResourceState `json:"resourceState,omitempty"` 3360 // ProvisioningState - READ-ONLY; Provisioning status of the endpoint. 3361 ProvisioningState *string `json:"provisioningState,omitempty"` 3362 // OriginPath - A directory path on the origin that CDN can use to retrieve content from, e.g. contoso.cloudapp.net/originpath. 3363 OriginPath *string `json:"originPath,omitempty"` 3364 // ContentTypesToCompress - List of content types on which compression applies. The value should be a valid MIME type. 3365 ContentTypesToCompress *[]string `json:"contentTypesToCompress,omitempty"` 3366 // OriginHostHeader - The host header value sent to the origin with each request. This property at Endpoint is only allowed when endpoint uses single origin and can be overridden by the same property specified at origin.If you leave this blank, the request hostname determines this value. Azure CDN origins, such as Web Apps, Blob Storage, and Cloud Services require this host header value to match the origin hostname by default. 3367 OriginHostHeader *string `json:"originHostHeader,omitempty"` 3368 // IsCompressionEnabled - Indicates whether content compression is enabled on CDN. Default value is false. If compression is enabled, content will be served as compressed if user requests for a compressed version. Content won't be compressed on CDN when requested content is smaller than 1 byte or larger than 1 MB. 3369 IsCompressionEnabled *bool `json:"isCompressionEnabled,omitempty"` 3370 // IsHTTPAllowed - Indicates whether HTTP traffic is allowed on the endpoint. Default value is true. At least one protocol (HTTP or HTTPS) must be allowed. 3371 IsHTTPAllowed *bool `json:"isHttpAllowed,omitempty"` 3372 // IsHTTPSAllowed - Indicates whether HTTPS traffic is allowed on the endpoint. Default value is true. At least one protocol (HTTP or HTTPS) must be allowed. 3373 IsHTTPSAllowed *bool `json:"isHttpsAllowed,omitempty"` 3374 // QueryStringCachingBehavior - Defines how CDN caches requests that include query strings. You can ignore any query strings when caching, bypass caching to prevent requests that contain query strings from being cached, or cache every request with a unique URL. Possible values include: 'QueryStringCachingBehaviorIgnoreQueryString', 'QueryStringCachingBehaviorBypassCaching', 'QueryStringCachingBehaviorUseQueryString', 'QueryStringCachingBehaviorNotSet' 3375 QueryStringCachingBehavior QueryStringCachingBehavior `json:"queryStringCachingBehavior,omitempty"` 3376 // OptimizationType - Specifies what scenario the customer wants this CDN endpoint to optimize for, e.g. Download, Media services. With this information, CDN can apply scenario driven optimization. Possible values include: 'GeneralWebDelivery', 'GeneralMediaStreaming', 'VideoOnDemandMediaStreaming', 'LargeFileDownload', 'DynamicSiteAcceleration' 3377 OptimizationType OptimizationType `json:"optimizationType,omitempty"` 3378 // ProbePath - Path to a file hosted on the origin which helps accelerate delivery of the dynamic content and calculate the most optimal routes for the CDN. This is relative to the origin path. This property is only relevant when using a single origin. 3379 ProbePath *string `json:"probePath,omitempty"` 3380 // GeoFilters - List of rules defining the user's geo access within a CDN endpoint. Each geo filter defines an access rule to a specified path or content, e.g. block APAC for path /pictures/ 3381 GeoFilters *[]GeoFilter `json:"geoFilters,omitempty"` 3382 // DefaultOriginGroup - A reference to the origin group. 3383 DefaultOriginGroup *ResourceReference `json:"defaultOriginGroup,omitempty"` 3384 // URLSigningKeys - List of keys used to validate the signed URL hashes. 3385 URLSigningKeys *[]URLSigningKey `json:"urlSigningKeys,omitempty"` 3386 // DeliveryPolicy - A policy that specifies the delivery rules to be used for an endpoint. 3387 DeliveryPolicy *EndpointPropertiesUpdateParametersDeliveryPolicy `json:"deliveryPolicy,omitempty"` 3388 // WebApplicationFirewallPolicyLink - Defines the Web Application Firewall policy for the endpoint (if applicable) 3389 WebApplicationFirewallPolicyLink *EndpointPropertiesUpdateParametersWebApplicationFirewallPolicyLink `json:"webApplicationFirewallPolicyLink,omitempty"` 3390} 3391 3392// MarshalJSON is the custom marshaler for EndpointProperties. 3393func (ep EndpointProperties) MarshalJSON() ([]byte, error) { 3394 objectMap := make(map[string]interface{}) 3395 if ep.Origins != nil { 3396 objectMap["origins"] = ep.Origins 3397 } 3398 if ep.OriginGroups != nil { 3399 objectMap["originGroups"] = ep.OriginGroups 3400 } 3401 if ep.OriginPath != nil { 3402 objectMap["originPath"] = ep.OriginPath 3403 } 3404 if ep.ContentTypesToCompress != nil { 3405 objectMap["contentTypesToCompress"] = ep.ContentTypesToCompress 3406 } 3407 if ep.OriginHostHeader != nil { 3408 objectMap["originHostHeader"] = ep.OriginHostHeader 3409 } 3410 if ep.IsCompressionEnabled != nil { 3411 objectMap["isCompressionEnabled"] = ep.IsCompressionEnabled 3412 } 3413 if ep.IsHTTPAllowed != nil { 3414 objectMap["isHttpAllowed"] = ep.IsHTTPAllowed 3415 } 3416 if ep.IsHTTPSAllowed != nil { 3417 objectMap["isHttpsAllowed"] = ep.IsHTTPSAllowed 3418 } 3419 if ep.QueryStringCachingBehavior != "" { 3420 objectMap["queryStringCachingBehavior"] = ep.QueryStringCachingBehavior 3421 } 3422 if ep.OptimizationType != "" { 3423 objectMap["optimizationType"] = ep.OptimizationType 3424 } 3425 if ep.ProbePath != nil { 3426 objectMap["probePath"] = ep.ProbePath 3427 } 3428 if ep.GeoFilters != nil { 3429 objectMap["geoFilters"] = ep.GeoFilters 3430 } 3431 if ep.DefaultOriginGroup != nil { 3432 objectMap["defaultOriginGroup"] = ep.DefaultOriginGroup 3433 } 3434 if ep.URLSigningKeys != nil { 3435 objectMap["urlSigningKeys"] = ep.URLSigningKeys 3436 } 3437 if ep.DeliveryPolicy != nil { 3438 objectMap["deliveryPolicy"] = ep.DeliveryPolicy 3439 } 3440 if ep.WebApplicationFirewallPolicyLink != nil { 3441 objectMap["webApplicationFirewallPolicyLink"] = ep.WebApplicationFirewallPolicyLink 3442 } 3443 return json.Marshal(objectMap) 3444} 3445 3446// EndpointPropertiesUpdateParameters the JSON object containing endpoint update parameters. 3447type EndpointPropertiesUpdateParameters struct { 3448 // OriginPath - A directory path on the origin that CDN can use to retrieve content from, e.g. contoso.cloudapp.net/originpath. 3449 OriginPath *string `json:"originPath,omitempty"` 3450 // ContentTypesToCompress - List of content types on which compression applies. The value should be a valid MIME type. 3451 ContentTypesToCompress *[]string `json:"contentTypesToCompress,omitempty"` 3452 // OriginHostHeader - The host header value sent to the origin with each request. This property at Endpoint is only allowed when endpoint uses single origin and can be overridden by the same property specified at origin.If you leave this blank, the request hostname determines this value. Azure CDN origins, such as Web Apps, Blob Storage, and Cloud Services require this host header value to match the origin hostname by default. 3453 OriginHostHeader *string `json:"originHostHeader,omitempty"` 3454 // IsCompressionEnabled - Indicates whether content compression is enabled on CDN. Default value is false. If compression is enabled, content will be served as compressed if user requests for a compressed version. Content won't be compressed on CDN when requested content is smaller than 1 byte or larger than 1 MB. 3455 IsCompressionEnabled *bool `json:"isCompressionEnabled,omitempty"` 3456 // IsHTTPAllowed - Indicates whether HTTP traffic is allowed on the endpoint. Default value is true. At least one protocol (HTTP or HTTPS) must be allowed. 3457 IsHTTPAllowed *bool `json:"isHttpAllowed,omitempty"` 3458 // IsHTTPSAllowed - Indicates whether HTTPS traffic is allowed on the endpoint. Default value is true. At least one protocol (HTTP or HTTPS) must be allowed. 3459 IsHTTPSAllowed *bool `json:"isHttpsAllowed,omitempty"` 3460 // QueryStringCachingBehavior - Defines how CDN caches requests that include query strings. You can ignore any query strings when caching, bypass caching to prevent requests that contain query strings from being cached, or cache every request with a unique URL. Possible values include: 'QueryStringCachingBehaviorIgnoreQueryString', 'QueryStringCachingBehaviorBypassCaching', 'QueryStringCachingBehaviorUseQueryString', 'QueryStringCachingBehaviorNotSet' 3461 QueryStringCachingBehavior QueryStringCachingBehavior `json:"queryStringCachingBehavior,omitempty"` 3462 // OptimizationType - Specifies what scenario the customer wants this CDN endpoint to optimize for, e.g. Download, Media services. With this information, CDN can apply scenario driven optimization. Possible values include: 'GeneralWebDelivery', 'GeneralMediaStreaming', 'VideoOnDemandMediaStreaming', 'LargeFileDownload', 'DynamicSiteAcceleration' 3463 OptimizationType OptimizationType `json:"optimizationType,omitempty"` 3464 // ProbePath - Path to a file hosted on the origin which helps accelerate delivery of the dynamic content and calculate the most optimal routes for the CDN. This is relative to the origin path. This property is only relevant when using a single origin. 3465 ProbePath *string `json:"probePath,omitempty"` 3466 // GeoFilters - List of rules defining the user's geo access within a CDN endpoint. Each geo filter defines an access rule to a specified path or content, e.g. block APAC for path /pictures/ 3467 GeoFilters *[]GeoFilter `json:"geoFilters,omitempty"` 3468 // DefaultOriginGroup - A reference to the origin group. 3469 DefaultOriginGroup *ResourceReference `json:"defaultOriginGroup,omitempty"` 3470 // URLSigningKeys - List of keys used to validate the signed URL hashes. 3471 URLSigningKeys *[]URLSigningKey `json:"urlSigningKeys,omitempty"` 3472 // DeliveryPolicy - A policy that specifies the delivery rules to be used for an endpoint. 3473 DeliveryPolicy *EndpointPropertiesUpdateParametersDeliveryPolicy `json:"deliveryPolicy,omitempty"` 3474 // WebApplicationFirewallPolicyLink - Defines the Web Application Firewall policy for the endpoint (if applicable) 3475 WebApplicationFirewallPolicyLink *EndpointPropertiesUpdateParametersWebApplicationFirewallPolicyLink `json:"webApplicationFirewallPolicyLink,omitempty"` 3476} 3477 3478// EndpointPropertiesUpdateParametersDeliveryPolicy a policy that specifies the delivery rules to be used 3479// for an endpoint. 3480type EndpointPropertiesUpdateParametersDeliveryPolicy struct { 3481 // Description - User-friendly description of the policy. 3482 Description *string `json:"description,omitempty"` 3483 // Rules - A list of the delivery rules. 3484 Rules *[]DeliveryRule `json:"rules,omitempty"` 3485} 3486 3487// EndpointPropertiesUpdateParametersWebApplicationFirewallPolicyLink defines the Web Application Firewall 3488// policy for the endpoint (if applicable) 3489type EndpointPropertiesUpdateParametersWebApplicationFirewallPolicyLink struct { 3490 // ID - Resource ID. 3491 ID *string `json:"id,omitempty"` 3492} 3493 3494// EndpointsCreateFuture an abstraction for monitoring and retrieving the results of a long-running 3495// operation. 3496type EndpointsCreateFuture struct { 3497 azure.FutureAPI 3498 // Result returns the result of the asynchronous operation. 3499 // If the operation has not completed it will return an error. 3500 Result func(EndpointsClient) (Endpoint, error) 3501} 3502 3503// UnmarshalJSON is the custom unmarshaller for CreateFuture. 3504func (future *EndpointsCreateFuture) UnmarshalJSON(body []byte) error { 3505 var azFuture azure.Future 3506 if err := json.Unmarshal(body, &azFuture); err != nil { 3507 return err 3508 } 3509 future.FutureAPI = &azFuture 3510 future.Result = future.result 3511 return nil 3512} 3513 3514// result is the default implementation for EndpointsCreateFuture.Result. 3515func (future *EndpointsCreateFuture) result(client EndpointsClient) (e Endpoint, err error) { 3516 var done bool 3517 done, err = future.DoneWithContext(context.Background(), client) 3518 if err != nil { 3519 err = autorest.NewErrorWithError(err, "cdn.EndpointsCreateFuture", "Result", future.Response(), "Polling failure") 3520 return 3521 } 3522 if !done { 3523 e.Response.Response = future.Response() 3524 err = azure.NewAsyncOpIncompleteError("cdn.EndpointsCreateFuture") 3525 return 3526 } 3527 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 3528 if e.Response.Response, err = future.GetResult(sender); err == nil && e.Response.Response.StatusCode != http.StatusNoContent { 3529 e, err = client.CreateResponder(e.Response.Response) 3530 if err != nil { 3531 err = autorest.NewErrorWithError(err, "cdn.EndpointsCreateFuture", "Result", e.Response.Response, "Failure responding to request") 3532 } 3533 } 3534 return 3535} 3536 3537// EndpointsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running 3538// operation. 3539type EndpointsDeleteFuture struct { 3540 azure.FutureAPI 3541 // Result returns the result of the asynchronous operation. 3542 // If the operation has not completed it will return an error. 3543 Result func(EndpointsClient) (autorest.Response, error) 3544} 3545 3546// UnmarshalJSON is the custom unmarshaller for CreateFuture. 3547func (future *EndpointsDeleteFuture) UnmarshalJSON(body []byte) error { 3548 var azFuture azure.Future 3549 if err := json.Unmarshal(body, &azFuture); err != nil { 3550 return err 3551 } 3552 future.FutureAPI = &azFuture 3553 future.Result = future.result 3554 return nil 3555} 3556 3557// result is the default implementation for EndpointsDeleteFuture.Result. 3558func (future *EndpointsDeleteFuture) result(client EndpointsClient) (ar autorest.Response, err error) { 3559 var done bool 3560 done, err = future.DoneWithContext(context.Background(), client) 3561 if err != nil { 3562 err = autorest.NewErrorWithError(err, "cdn.EndpointsDeleteFuture", "Result", future.Response(), "Polling failure") 3563 return 3564 } 3565 if !done { 3566 ar.Response = future.Response() 3567 err = azure.NewAsyncOpIncompleteError("cdn.EndpointsDeleteFuture") 3568 return 3569 } 3570 ar.Response = future.Response() 3571 return 3572} 3573 3574// EndpointsLoadContentFuture an abstraction for monitoring and retrieving the results of a long-running 3575// operation. 3576type EndpointsLoadContentFuture struct { 3577 azure.FutureAPI 3578 // Result returns the result of the asynchronous operation. 3579 // If the operation has not completed it will return an error. 3580 Result func(EndpointsClient) (autorest.Response, error) 3581} 3582 3583// UnmarshalJSON is the custom unmarshaller for CreateFuture. 3584func (future *EndpointsLoadContentFuture) UnmarshalJSON(body []byte) error { 3585 var azFuture azure.Future 3586 if err := json.Unmarshal(body, &azFuture); err != nil { 3587 return err 3588 } 3589 future.FutureAPI = &azFuture 3590 future.Result = future.result 3591 return nil 3592} 3593 3594// result is the default implementation for EndpointsLoadContentFuture.Result. 3595func (future *EndpointsLoadContentFuture) result(client EndpointsClient) (ar autorest.Response, err error) { 3596 var done bool 3597 done, err = future.DoneWithContext(context.Background(), client) 3598 if err != nil { 3599 err = autorest.NewErrorWithError(err, "cdn.EndpointsLoadContentFuture", "Result", future.Response(), "Polling failure") 3600 return 3601 } 3602 if !done { 3603 ar.Response = future.Response() 3604 err = azure.NewAsyncOpIncompleteError("cdn.EndpointsLoadContentFuture") 3605 return 3606 } 3607 ar.Response = future.Response() 3608 return 3609} 3610 3611// EndpointsPurgeContentFuture an abstraction for monitoring and retrieving the results of a long-running 3612// operation. 3613type EndpointsPurgeContentFuture struct { 3614 azure.FutureAPI 3615 // Result returns the result of the asynchronous operation. 3616 // If the operation has not completed it will return an error. 3617 Result func(EndpointsClient) (autorest.Response, error) 3618} 3619 3620// UnmarshalJSON is the custom unmarshaller for CreateFuture. 3621func (future *EndpointsPurgeContentFuture) UnmarshalJSON(body []byte) error { 3622 var azFuture azure.Future 3623 if err := json.Unmarshal(body, &azFuture); err != nil { 3624 return err 3625 } 3626 future.FutureAPI = &azFuture 3627 future.Result = future.result 3628 return nil 3629} 3630 3631// result is the default implementation for EndpointsPurgeContentFuture.Result. 3632func (future *EndpointsPurgeContentFuture) result(client EndpointsClient) (ar autorest.Response, err error) { 3633 var done bool 3634 done, err = future.DoneWithContext(context.Background(), client) 3635 if err != nil { 3636 err = autorest.NewErrorWithError(err, "cdn.EndpointsPurgeContentFuture", "Result", future.Response(), "Polling failure") 3637 return 3638 } 3639 if !done { 3640 ar.Response = future.Response() 3641 err = azure.NewAsyncOpIncompleteError("cdn.EndpointsPurgeContentFuture") 3642 return 3643 } 3644 ar.Response = future.Response() 3645 return 3646} 3647 3648// EndpointsStartFuture an abstraction for monitoring and retrieving the results of a long-running 3649// operation. 3650type EndpointsStartFuture struct { 3651 azure.FutureAPI 3652 // Result returns the result of the asynchronous operation. 3653 // If the operation has not completed it will return an error. 3654 Result func(EndpointsClient) (Endpoint, error) 3655} 3656 3657// UnmarshalJSON is the custom unmarshaller for CreateFuture. 3658func (future *EndpointsStartFuture) UnmarshalJSON(body []byte) error { 3659 var azFuture azure.Future 3660 if err := json.Unmarshal(body, &azFuture); err != nil { 3661 return err 3662 } 3663 future.FutureAPI = &azFuture 3664 future.Result = future.result 3665 return nil 3666} 3667 3668// result is the default implementation for EndpointsStartFuture.Result. 3669func (future *EndpointsStartFuture) result(client EndpointsClient) (e Endpoint, err error) { 3670 var done bool 3671 done, err = future.DoneWithContext(context.Background(), client) 3672 if err != nil { 3673 err = autorest.NewErrorWithError(err, "cdn.EndpointsStartFuture", "Result", future.Response(), "Polling failure") 3674 return 3675 } 3676 if !done { 3677 e.Response.Response = future.Response() 3678 err = azure.NewAsyncOpIncompleteError("cdn.EndpointsStartFuture") 3679 return 3680 } 3681 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 3682 if e.Response.Response, err = future.GetResult(sender); err == nil && e.Response.Response.StatusCode != http.StatusNoContent { 3683 e, err = client.StartResponder(e.Response.Response) 3684 if err != nil { 3685 err = autorest.NewErrorWithError(err, "cdn.EndpointsStartFuture", "Result", e.Response.Response, "Failure responding to request") 3686 } 3687 } 3688 return 3689} 3690 3691// EndpointsStopFuture an abstraction for monitoring and retrieving the results of a long-running 3692// operation. 3693type EndpointsStopFuture struct { 3694 azure.FutureAPI 3695 // Result returns the result of the asynchronous operation. 3696 // If the operation has not completed it will return an error. 3697 Result func(EndpointsClient) (Endpoint, error) 3698} 3699 3700// UnmarshalJSON is the custom unmarshaller for CreateFuture. 3701func (future *EndpointsStopFuture) UnmarshalJSON(body []byte) error { 3702 var azFuture azure.Future 3703 if err := json.Unmarshal(body, &azFuture); err != nil { 3704 return err 3705 } 3706 future.FutureAPI = &azFuture 3707 future.Result = future.result 3708 return nil 3709} 3710 3711// result is the default implementation for EndpointsStopFuture.Result. 3712func (future *EndpointsStopFuture) result(client EndpointsClient) (e Endpoint, err error) { 3713 var done bool 3714 done, err = future.DoneWithContext(context.Background(), client) 3715 if err != nil { 3716 err = autorest.NewErrorWithError(err, "cdn.EndpointsStopFuture", "Result", future.Response(), "Polling failure") 3717 return 3718 } 3719 if !done { 3720 e.Response.Response = future.Response() 3721 err = azure.NewAsyncOpIncompleteError("cdn.EndpointsStopFuture") 3722 return 3723 } 3724 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 3725 if e.Response.Response, err = future.GetResult(sender); err == nil && e.Response.Response.StatusCode != http.StatusNoContent { 3726 e, err = client.StopResponder(e.Response.Response) 3727 if err != nil { 3728 err = autorest.NewErrorWithError(err, "cdn.EndpointsStopFuture", "Result", e.Response.Response, "Failure responding to request") 3729 } 3730 } 3731 return 3732} 3733 3734// EndpointsUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 3735// operation. 3736type EndpointsUpdateFuture struct { 3737 azure.FutureAPI 3738 // Result returns the result of the asynchronous operation. 3739 // If the operation has not completed it will return an error. 3740 Result func(EndpointsClient) (Endpoint, error) 3741} 3742 3743// UnmarshalJSON is the custom unmarshaller for CreateFuture. 3744func (future *EndpointsUpdateFuture) UnmarshalJSON(body []byte) error { 3745 var azFuture azure.Future 3746 if err := json.Unmarshal(body, &azFuture); err != nil { 3747 return err 3748 } 3749 future.FutureAPI = &azFuture 3750 future.Result = future.result 3751 return nil 3752} 3753 3754// result is the default implementation for EndpointsUpdateFuture.Result. 3755func (future *EndpointsUpdateFuture) result(client EndpointsClient) (e Endpoint, err error) { 3756 var done bool 3757 done, err = future.DoneWithContext(context.Background(), client) 3758 if err != nil { 3759 err = autorest.NewErrorWithError(err, "cdn.EndpointsUpdateFuture", "Result", future.Response(), "Polling failure") 3760 return 3761 } 3762 if !done { 3763 e.Response.Response = future.Response() 3764 err = azure.NewAsyncOpIncompleteError("cdn.EndpointsUpdateFuture") 3765 return 3766 } 3767 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 3768 if e.Response.Response, err = future.GetResult(sender); err == nil && e.Response.Response.StatusCode != http.StatusNoContent { 3769 e, err = client.UpdateResponder(e.Response.Response) 3770 if err != nil { 3771 err = autorest.NewErrorWithError(err, "cdn.EndpointsUpdateFuture", "Result", e.Response.Response, "Failure responding to request") 3772 } 3773 } 3774 return 3775} 3776 3777// EndpointType defines the ARM Resource ID for the linked endpoints 3778type EndpointType struct { 3779 // ID - ARM Resource ID string. 3780 ID *string `json:"id,omitempty"` 3781} 3782 3783// EndpointUpdateParameters properties required to create or update an endpoint. 3784type EndpointUpdateParameters struct { 3785 // Tags - Endpoint tags. 3786 Tags map[string]*string `json:"tags"` 3787 *EndpointPropertiesUpdateParameters `json:"properties,omitempty"` 3788} 3789 3790// MarshalJSON is the custom marshaler for EndpointUpdateParameters. 3791func (eup EndpointUpdateParameters) MarshalJSON() ([]byte, error) { 3792 objectMap := make(map[string]interface{}) 3793 if eup.Tags != nil { 3794 objectMap["tags"] = eup.Tags 3795 } 3796 if eup.EndpointPropertiesUpdateParameters != nil { 3797 objectMap["properties"] = eup.EndpointPropertiesUpdateParameters 3798 } 3799 return json.Marshal(objectMap) 3800} 3801 3802// UnmarshalJSON is the custom unmarshaler for EndpointUpdateParameters struct. 3803func (eup *EndpointUpdateParameters) UnmarshalJSON(body []byte) error { 3804 var m map[string]*json.RawMessage 3805 err := json.Unmarshal(body, &m) 3806 if err != nil { 3807 return err 3808 } 3809 for k, v := range m { 3810 switch k { 3811 case "tags": 3812 if v != nil { 3813 var tags map[string]*string 3814 err = json.Unmarshal(*v, &tags) 3815 if err != nil { 3816 return err 3817 } 3818 eup.Tags = tags 3819 } 3820 case "properties": 3821 if v != nil { 3822 var endpointPropertiesUpdateParameters EndpointPropertiesUpdateParameters 3823 err = json.Unmarshal(*v, &endpointPropertiesUpdateParameters) 3824 if err != nil { 3825 return err 3826 } 3827 eup.EndpointPropertiesUpdateParameters = &endpointPropertiesUpdateParameters 3828 } 3829 } 3830 } 3831 3832 return nil 3833} 3834 3835// ErrorResponse error response indicates CDN service is not able to process the incoming request. The 3836// reason is provided in the error message. 3837type ErrorResponse struct { 3838 // Code - READ-ONLY; Error code. 3839 Code *string `json:"code,omitempty"` 3840 // Message - READ-ONLY; Error message indicating why the operation failed. 3841 Message *string `json:"message,omitempty"` 3842} 3843 3844// MarshalJSON is the custom marshaler for ErrorResponse. 3845func (er ErrorResponse) MarshalJSON() ([]byte, error) { 3846 objectMap := make(map[string]interface{}) 3847 return json.Marshal(objectMap) 3848} 3849 3850// GeoFilter rules defining user's geo access within a CDN endpoint. 3851type GeoFilter struct { 3852 // RelativePath - Relative path applicable to geo filter. (e.g. '/mypictures', '/mypicture/kitty.jpg', and etc.) 3853 RelativePath *string `json:"relativePath,omitempty"` 3854 // Action - Action of the geo filter, i.e. allow or block access. Possible values include: 'GeoFilterActionsBlock', 'GeoFilterActionsAllow' 3855 Action GeoFilterActions `json:"action,omitempty"` 3856 // CountryCodes - Two letter country codes defining user country access in a geo filter, e.g. AU, MX, US. 3857 CountryCodes *[]string `json:"countryCodes,omitempty"` 3858} 3859 3860// HeaderActionParameters defines the parameters for the request header action. 3861type HeaderActionParameters struct { 3862 OdataType *string `json:"@odata.type,omitempty"` 3863 // HeaderAction - Action to perform. Possible values include: 'Append', 'Overwrite', 'Delete' 3864 HeaderAction HeaderAction `json:"headerAction,omitempty"` 3865 // HeaderName - Name of the header to modify 3866 HeaderName *string `json:"headerName,omitempty"` 3867 // Value - Value for the specified action 3868 Value *string `json:"value,omitempty"` 3869} 3870 3871// HealthProbeParameters the JSON object that contains the properties to send health probes to origin. 3872type HealthProbeParameters struct { 3873 // ProbePath - The path relative to the origin that is used to determine the health of the origin. 3874 ProbePath *string `json:"probePath,omitempty"` 3875 // ProbeRequestType - The type of health probe request that is made. Possible values include: 'NotSet', 'GET', 'HEAD' 3876 ProbeRequestType HealthProbeRequestType `json:"probeRequestType,omitempty"` 3877 // ProbeProtocol - Protocol to use for health probe. Possible values include: 'ProbeProtocolNotSet', 'ProbeProtocolHTTP', 'ProbeProtocolHTTPS' 3878 ProbeProtocol ProbeProtocol `json:"probeProtocol,omitempty"` 3879 // ProbeIntervalInSeconds - The number of seconds between health probes.Default is 240sec. 3880 ProbeIntervalInSeconds *int32 `json:"probeIntervalInSeconds,omitempty"` 3881} 3882 3883// HTTPErrorRangeParameters the JSON object that represents the range for http status codes 3884type HTTPErrorRangeParameters struct { 3885 // Begin - The inclusive start of the http status code range. 3886 Begin *int32 `json:"begin,omitempty"` 3887 // End - The inclusive end of the http status code range. 3888 End *int32 `json:"end,omitempty"` 3889} 3890 3891// HTTPVersionMatchConditionParameters defines the parameters for HttpVersion match conditions 3892type HTTPVersionMatchConditionParameters struct { 3893 OdataType *string `json:"@odata.type,omitempty"` 3894 // Operator - Describes operator to be matched 3895 Operator *string `json:"operator,omitempty"` 3896 // NegateCondition - Describes if this is negate condition or not 3897 NegateCondition *bool `json:"negateCondition,omitempty"` 3898 // MatchValues - The match value for the condition of the delivery rule 3899 MatchValues *[]string `json:"matchValues,omitempty"` 3900} 3901 3902// IPAddressGroup CDN Ip address group 3903type IPAddressGroup struct { 3904 // DeliveryRegion - The delivery region of the ip address group 3905 DeliveryRegion *string `json:"deliveryRegion,omitempty"` 3906 // Ipv4Addresses - The list of ip v4 addresses. 3907 Ipv4Addresses *[]CidrIPAddress `json:"ipv4Addresses,omitempty"` 3908 // Ipv6Addresses - The list of ip v6 addresses. 3909 Ipv6Addresses *[]CidrIPAddress `json:"ipv6Addresses,omitempty"` 3910} 3911 3912// IsDeviceMatchConditionParameters defines the parameters for IsDevice match conditions 3913type IsDeviceMatchConditionParameters struct { 3914 OdataType *string `json:"@odata.type,omitempty"` 3915 // Operator - Describes operator to be matched 3916 Operator *string `json:"operator,omitempty"` 3917 // NegateCondition - Describes if this is negate condition or not 3918 NegateCondition *bool `json:"negateCondition,omitempty"` 3919 // MatchValues - The match value for the condition of the delivery rule 3920 MatchValues *[]string `json:"matchValues,omitempty"` 3921 // Transforms - List of transforms 3922 Transforms *[]Transform `json:"transforms,omitempty"` 3923} 3924 3925// KeyVaultCertificateSourceParameters describes the parameters for using a user's KeyVault certificate for 3926// securing custom domain. 3927type KeyVaultCertificateSourceParameters struct { 3928 OdataType *string `json:"@odata.type,omitempty"` 3929 // SubscriptionID - Subscription Id of the user's Key Vault containing the SSL certificate 3930 SubscriptionID *string `json:"subscriptionId,omitempty"` 3931 // ResourceGroupName - Resource group of the user's Key Vault containing the SSL certificate 3932 ResourceGroupName *string `json:"resourceGroupName,omitempty"` 3933 // VaultName - The name of the user's Key Vault containing the SSL certificate 3934 VaultName *string `json:"vaultName,omitempty"` 3935 // SecretName - The name of Key Vault Secret (representing the full certificate PFX) in Key Vault. 3936 SecretName *string `json:"secretName,omitempty"` 3937 // SecretVersion - The version(GUID) of Key Vault Secret in Key Vault. 3938 SecretVersion *string `json:"secretVersion,omitempty"` 3939 // UpdateRule - Describes the action that shall be taken when the certificate is updated in Key Vault. 3940 UpdateRule *string `json:"updateRule,omitempty"` 3941 // DeleteRule - Describes the action that shall be taken when the certificate is removed from Key Vault. 3942 DeleteRule *string `json:"deleteRule,omitempty"` 3943} 3944 3945// KeyVaultSigningKeyParameters describes the parameters for using a user's KeyVault for URL Signing Key. 3946type KeyVaultSigningKeyParameters struct { 3947 OdataType *string `json:"@odata.type,omitempty"` 3948 // SubscriptionID - Subscription Id of the user's Key Vault containing the secret 3949 SubscriptionID *string `json:"subscriptionId,omitempty"` 3950 // ResourceGroupName - Resource group of the user's Key Vault containing the secret 3951 ResourceGroupName *string `json:"resourceGroupName,omitempty"` 3952 // VaultName - The name of the user's Key Vault containing the secret 3953 VaultName *string `json:"vaultName,omitempty"` 3954 // SecretName - The name of secret in Key Vault. 3955 SecretName *string `json:"secretName,omitempty"` 3956 // SecretVersion - The version(GUID) of secret in Key Vault. 3957 SecretVersion *string `json:"secretVersion,omitempty"` 3958} 3959 3960// LoadParameters parameters required for content load. 3961type LoadParameters struct { 3962 // ContentPaths - The path to the content to be loaded. Path should be a relative file URL of the origin. 3963 ContentPaths *[]string `json:"contentPaths,omitempty"` 3964} 3965 3966// ManagedHTTPSParameters defines the certificate source parameters using CDN managed certificate for 3967// enabling SSL. 3968type ManagedHTTPSParameters struct { 3969 // CertificateSourceParameters - Defines the certificate source parameters using CDN managed certificate for enabling SSL. 3970 CertificateSourceParameters *CertificateSourceParameters `json:"certificateSourceParameters,omitempty"` 3971 // ProtocolType - Defines the TLS extension protocol that is used for secure delivery. Possible values include: 'ServerNameIndication', 'IPBased' 3972 ProtocolType ProtocolType `json:"protocolType,omitempty"` 3973 // MinimumTLSVersion - TLS protocol version that will be used for Https. Possible values include: 'None', 'TLS10', 'TLS12' 3974 MinimumTLSVersion MinimumTLSVersion `json:"minimumTlsVersion,omitempty"` 3975 // CertificateSource - Possible values include: 'CertificateSourceCustomDomainHTTPSParameters', 'CertificateSourceCdn', 'CertificateSourceAzureKeyVault' 3976 CertificateSource CertificateSource `json:"certificateSource,omitempty"` 3977} 3978 3979// MarshalJSON is the custom marshaler for ManagedHTTPSParameters. 3980func (mhp ManagedHTTPSParameters) MarshalJSON() ([]byte, error) { 3981 mhp.CertificateSource = CertificateSourceCdn 3982 objectMap := make(map[string]interface{}) 3983 if mhp.CertificateSourceParameters != nil { 3984 objectMap["certificateSourceParameters"] = mhp.CertificateSourceParameters 3985 } 3986 if mhp.ProtocolType != "" { 3987 objectMap["protocolType"] = mhp.ProtocolType 3988 } 3989 if mhp.MinimumTLSVersion != "" { 3990 objectMap["minimumTlsVersion"] = mhp.MinimumTLSVersion 3991 } 3992 if mhp.CertificateSource != "" { 3993 objectMap["certificateSource"] = mhp.CertificateSource 3994 } 3995 return json.Marshal(objectMap) 3996} 3997 3998// AsManagedHTTPSParameters is the BasicCustomDomainHTTPSParameters implementation for ManagedHTTPSParameters. 3999func (mhp ManagedHTTPSParameters) AsManagedHTTPSParameters() (*ManagedHTTPSParameters, bool) { 4000 return &mhp, true 4001} 4002 4003// AsUserManagedHTTPSParameters is the BasicCustomDomainHTTPSParameters implementation for ManagedHTTPSParameters. 4004func (mhp ManagedHTTPSParameters) AsUserManagedHTTPSParameters() (*UserManagedHTTPSParameters, bool) { 4005 return nil, false 4006} 4007 4008// AsCustomDomainHTTPSParameters is the BasicCustomDomainHTTPSParameters implementation for ManagedHTTPSParameters. 4009func (mhp ManagedHTTPSParameters) AsCustomDomainHTTPSParameters() (*CustomDomainHTTPSParameters, bool) { 4010 return nil, false 4011} 4012 4013// AsBasicCustomDomainHTTPSParameters is the BasicCustomDomainHTTPSParameters implementation for ManagedHTTPSParameters. 4014func (mhp ManagedHTTPSParameters) AsBasicCustomDomainHTTPSParameters() (BasicCustomDomainHTTPSParameters, bool) { 4015 return &mhp, true 4016} 4017 4018// ManagedRuleDefinition describes a managed rule definition. 4019type ManagedRuleDefinition struct { 4020 // RuleID - READ-ONLY; Identifier for the managed rule. 4021 RuleID *string `json:"ruleId,omitempty"` 4022 // Description - READ-ONLY; Describes the functionality of the managed rule. 4023 Description *string `json:"description,omitempty"` 4024} 4025 4026// MarshalJSON is the custom marshaler for ManagedRuleDefinition. 4027func (mrd ManagedRuleDefinition) MarshalJSON() ([]byte, error) { 4028 objectMap := make(map[string]interface{}) 4029 return json.Marshal(objectMap) 4030} 4031 4032// ManagedRuleGroupDefinition describes a managed rule group. 4033type ManagedRuleGroupDefinition struct { 4034 // RuleGroupName - READ-ONLY; Name of the managed rule group. 4035 RuleGroupName *string `json:"ruleGroupName,omitempty"` 4036 // Description - READ-ONLY; Description of the managed rule group. 4037 Description *string `json:"description,omitempty"` 4038 // Rules - READ-ONLY; List of rules within the managed rule group. 4039 Rules *[]ManagedRuleDefinition `json:"rules,omitempty"` 4040} 4041 4042// MarshalJSON is the custom marshaler for ManagedRuleGroupDefinition. 4043func (mrgd ManagedRuleGroupDefinition) MarshalJSON() ([]byte, error) { 4044 objectMap := make(map[string]interface{}) 4045 return json.Marshal(objectMap) 4046} 4047 4048// ManagedRuleGroupOverride defines a managed rule group override setting. 4049type ManagedRuleGroupOverride struct { 4050 // RuleGroupName - Describes the managed rule group within the rule set to override 4051 RuleGroupName *string `json:"ruleGroupName,omitempty"` 4052 // Rules - List of rules that will be disabled. If none specified, all rules in the group will be disabled. 4053 Rules *[]ManagedRuleOverride `json:"rules,omitempty"` 4054} 4055 4056// ManagedRuleOverride defines a managed rule group override setting. 4057type ManagedRuleOverride struct { 4058 // RuleID - Identifier for the managed rule. 4059 RuleID *string `json:"ruleId,omitempty"` 4060 // EnabledState - Describes if the managed rule is in enabled or disabled state. Defaults to Disabled if not specified. Possible values include: 'ManagedRuleEnabledStateDisabled', 'ManagedRuleEnabledStateEnabled' 4061 EnabledState ManagedRuleEnabledState `json:"enabledState,omitempty"` 4062 // Action - Describes the override action to be applied when rule matches. Possible values include: 'Allow', 'Block', 'Log', 'Redirect' 4063 Action ActionType `json:"action,omitempty"` 4064} 4065 4066// ManagedRuleSet defines a managed rule set. 4067type ManagedRuleSet struct { 4068 // RuleSetType - Defines the rule set type to use. 4069 RuleSetType *string `json:"ruleSetType,omitempty"` 4070 // RuleSetVersion - Defines the version of the rule set to use. 4071 RuleSetVersion *string `json:"ruleSetVersion,omitempty"` 4072 // AnomalyScore - Verizon only : If the rule set supports anomaly detection mode, this describes the threshold for blocking requests. 4073 AnomalyScore *int32 `json:"anomalyScore,omitempty"` 4074 // RuleGroupOverrides - Defines the rule overrides to apply to the rule set. 4075 RuleGroupOverrides *[]ManagedRuleGroupOverride `json:"ruleGroupOverrides,omitempty"` 4076} 4077 4078// ManagedRuleSetDefinition describes a managed rule set definition. 4079type ManagedRuleSetDefinition struct { 4080 // ManagedRuleSetDefinitionProperties - Describes managed rule set definition properties. 4081 *ManagedRuleSetDefinitionProperties `json:"properties,omitempty"` 4082 // Sku - The pricing tier (defines a CDN provider, feature list and rate) of the CdnWebApplicationFirewallPolicy. 4083 Sku *Sku `json:"sku,omitempty"` 4084 // ID - READ-ONLY; Resource ID. 4085 ID *string `json:"id,omitempty"` 4086 // Name - READ-ONLY; Resource name. 4087 Name *string `json:"name,omitempty"` 4088 // Type - READ-ONLY; Resource type. 4089 Type *string `json:"type,omitempty"` 4090} 4091 4092// MarshalJSON is the custom marshaler for ManagedRuleSetDefinition. 4093func (mrsd ManagedRuleSetDefinition) MarshalJSON() ([]byte, error) { 4094 objectMap := make(map[string]interface{}) 4095 if mrsd.ManagedRuleSetDefinitionProperties != nil { 4096 objectMap["properties"] = mrsd.ManagedRuleSetDefinitionProperties 4097 } 4098 if mrsd.Sku != nil { 4099 objectMap["sku"] = mrsd.Sku 4100 } 4101 return json.Marshal(objectMap) 4102} 4103 4104// UnmarshalJSON is the custom unmarshaler for ManagedRuleSetDefinition struct. 4105func (mrsd *ManagedRuleSetDefinition) UnmarshalJSON(body []byte) error { 4106 var m map[string]*json.RawMessage 4107 err := json.Unmarshal(body, &m) 4108 if err != nil { 4109 return err 4110 } 4111 for k, v := range m { 4112 switch k { 4113 case "properties": 4114 if v != nil { 4115 var managedRuleSetDefinitionProperties ManagedRuleSetDefinitionProperties 4116 err = json.Unmarshal(*v, &managedRuleSetDefinitionProperties) 4117 if err != nil { 4118 return err 4119 } 4120 mrsd.ManagedRuleSetDefinitionProperties = &managedRuleSetDefinitionProperties 4121 } 4122 case "sku": 4123 if v != nil { 4124 var sku Sku 4125 err = json.Unmarshal(*v, &sku) 4126 if err != nil { 4127 return err 4128 } 4129 mrsd.Sku = &sku 4130 } 4131 case "id": 4132 if v != nil { 4133 var ID string 4134 err = json.Unmarshal(*v, &ID) 4135 if err != nil { 4136 return err 4137 } 4138 mrsd.ID = &ID 4139 } 4140 case "name": 4141 if v != nil { 4142 var name string 4143 err = json.Unmarshal(*v, &name) 4144 if err != nil { 4145 return err 4146 } 4147 mrsd.Name = &name 4148 } 4149 case "type": 4150 if v != nil { 4151 var typeVar string 4152 err = json.Unmarshal(*v, &typeVar) 4153 if err != nil { 4154 return err 4155 } 4156 mrsd.Type = &typeVar 4157 } 4158 } 4159 } 4160 4161 return nil 4162} 4163 4164// ManagedRuleSetDefinitionList list of managed rule set definitions available for use in a policy. 4165type ManagedRuleSetDefinitionList struct { 4166 autorest.Response `json:"-"` 4167 // Value - READ-ONLY; List of managed rule set definitions. 4168 Value *[]ManagedRuleSetDefinition `json:"value,omitempty"` 4169 // NextLink - URL to retrieve next set of managed rule set definitions. 4170 NextLink *string `json:"nextLink,omitempty"` 4171} 4172 4173// MarshalJSON is the custom marshaler for ManagedRuleSetDefinitionList. 4174func (mrsdl ManagedRuleSetDefinitionList) MarshalJSON() ([]byte, error) { 4175 objectMap := make(map[string]interface{}) 4176 if mrsdl.NextLink != nil { 4177 objectMap["nextLink"] = mrsdl.NextLink 4178 } 4179 return json.Marshal(objectMap) 4180} 4181 4182// ManagedRuleSetDefinitionListIterator provides access to a complete listing of ManagedRuleSetDefinition 4183// values. 4184type ManagedRuleSetDefinitionListIterator struct { 4185 i int 4186 page ManagedRuleSetDefinitionListPage 4187} 4188 4189// NextWithContext advances to the next value. If there was an error making 4190// the request the iterator does not advance and the error is returned. 4191func (iter *ManagedRuleSetDefinitionListIterator) NextWithContext(ctx context.Context) (err error) { 4192 if tracing.IsEnabled() { 4193 ctx = tracing.StartSpan(ctx, fqdn+"/ManagedRuleSetDefinitionListIterator.NextWithContext") 4194 defer func() { 4195 sc := -1 4196 if iter.Response().Response.Response != nil { 4197 sc = iter.Response().Response.Response.StatusCode 4198 } 4199 tracing.EndSpan(ctx, sc, err) 4200 }() 4201 } 4202 iter.i++ 4203 if iter.i < len(iter.page.Values()) { 4204 return nil 4205 } 4206 err = iter.page.NextWithContext(ctx) 4207 if err != nil { 4208 iter.i-- 4209 return err 4210 } 4211 iter.i = 0 4212 return nil 4213} 4214 4215// Next advances to the next value. If there was an error making 4216// the request the iterator does not advance and the error is returned. 4217// Deprecated: Use NextWithContext() instead. 4218func (iter *ManagedRuleSetDefinitionListIterator) Next() error { 4219 return iter.NextWithContext(context.Background()) 4220} 4221 4222// NotDone returns true if the enumeration should be started or is not yet complete. 4223func (iter ManagedRuleSetDefinitionListIterator) NotDone() bool { 4224 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 4225} 4226 4227// Response returns the raw server response from the last page request. 4228func (iter ManagedRuleSetDefinitionListIterator) Response() ManagedRuleSetDefinitionList { 4229 return iter.page.Response() 4230} 4231 4232// Value returns the current value or a zero-initialized value if the 4233// iterator has advanced beyond the end of the collection. 4234func (iter ManagedRuleSetDefinitionListIterator) Value() ManagedRuleSetDefinition { 4235 if !iter.page.NotDone() { 4236 return ManagedRuleSetDefinition{} 4237 } 4238 return iter.page.Values()[iter.i] 4239} 4240 4241// Creates a new instance of the ManagedRuleSetDefinitionListIterator type. 4242func NewManagedRuleSetDefinitionListIterator(page ManagedRuleSetDefinitionListPage) ManagedRuleSetDefinitionListIterator { 4243 return ManagedRuleSetDefinitionListIterator{page: page} 4244} 4245 4246// IsEmpty returns true if the ListResult contains no values. 4247func (mrsdl ManagedRuleSetDefinitionList) IsEmpty() bool { 4248 return mrsdl.Value == nil || len(*mrsdl.Value) == 0 4249} 4250 4251// hasNextLink returns true if the NextLink is not empty. 4252func (mrsdl ManagedRuleSetDefinitionList) hasNextLink() bool { 4253 return mrsdl.NextLink != nil && len(*mrsdl.NextLink) != 0 4254} 4255 4256// managedRuleSetDefinitionListPreparer prepares a request to retrieve the next set of results. 4257// It returns nil if no more results exist. 4258func (mrsdl ManagedRuleSetDefinitionList) managedRuleSetDefinitionListPreparer(ctx context.Context) (*http.Request, error) { 4259 if !mrsdl.hasNextLink() { 4260 return nil, nil 4261 } 4262 return autorest.Prepare((&http.Request{}).WithContext(ctx), 4263 autorest.AsJSON(), 4264 autorest.AsGet(), 4265 autorest.WithBaseURL(to.String(mrsdl.NextLink))) 4266} 4267 4268// ManagedRuleSetDefinitionListPage contains a page of ManagedRuleSetDefinition values. 4269type ManagedRuleSetDefinitionListPage struct { 4270 fn func(context.Context, ManagedRuleSetDefinitionList) (ManagedRuleSetDefinitionList, error) 4271 mrsdl ManagedRuleSetDefinitionList 4272} 4273 4274// NextWithContext advances to the next page of values. If there was an error making 4275// the request the page does not advance and the error is returned. 4276func (page *ManagedRuleSetDefinitionListPage) NextWithContext(ctx context.Context) (err error) { 4277 if tracing.IsEnabled() { 4278 ctx = tracing.StartSpan(ctx, fqdn+"/ManagedRuleSetDefinitionListPage.NextWithContext") 4279 defer func() { 4280 sc := -1 4281 if page.Response().Response.Response != nil { 4282 sc = page.Response().Response.Response.StatusCode 4283 } 4284 tracing.EndSpan(ctx, sc, err) 4285 }() 4286 } 4287 for { 4288 next, err := page.fn(ctx, page.mrsdl) 4289 if err != nil { 4290 return err 4291 } 4292 page.mrsdl = next 4293 if !next.hasNextLink() || !next.IsEmpty() { 4294 break 4295 } 4296 } 4297 return nil 4298} 4299 4300// Next advances to the next page of values. If there was an error making 4301// the request the page does not advance and the error is returned. 4302// Deprecated: Use NextWithContext() instead. 4303func (page *ManagedRuleSetDefinitionListPage) Next() error { 4304 return page.NextWithContext(context.Background()) 4305} 4306 4307// NotDone returns true if the page enumeration should be started or is not yet complete. 4308func (page ManagedRuleSetDefinitionListPage) NotDone() bool { 4309 return !page.mrsdl.IsEmpty() 4310} 4311 4312// Response returns the raw server response from the last page request. 4313func (page ManagedRuleSetDefinitionListPage) Response() ManagedRuleSetDefinitionList { 4314 return page.mrsdl 4315} 4316 4317// Values returns the slice of values for the current page or nil if there are no values. 4318func (page ManagedRuleSetDefinitionListPage) Values() []ManagedRuleSetDefinition { 4319 if page.mrsdl.IsEmpty() { 4320 return nil 4321 } 4322 return *page.mrsdl.Value 4323} 4324 4325// Creates a new instance of the ManagedRuleSetDefinitionListPage type. 4326func NewManagedRuleSetDefinitionListPage(cur ManagedRuleSetDefinitionList, getNextPage func(context.Context, ManagedRuleSetDefinitionList) (ManagedRuleSetDefinitionList, error)) ManagedRuleSetDefinitionListPage { 4327 return ManagedRuleSetDefinitionListPage{ 4328 fn: getNextPage, 4329 mrsdl: cur, 4330 } 4331} 4332 4333// ManagedRuleSetDefinitionProperties properties for a managed rule set definition. 4334type ManagedRuleSetDefinitionProperties struct { 4335 // ProvisioningState - READ-ONLY; Provisioning state of the managed rule set. 4336 ProvisioningState *string `json:"provisioningState,omitempty"` 4337 // RuleSetType - READ-ONLY; Type of the managed rule set. 4338 RuleSetType *string `json:"ruleSetType,omitempty"` 4339 // RuleSetVersion - READ-ONLY; Version of the managed rule set type. 4340 RuleSetVersion *string `json:"ruleSetVersion,omitempty"` 4341 // RuleGroups - READ-ONLY; Rule groups of the managed rule set. 4342 RuleGroups *[]ManagedRuleGroupDefinition `json:"ruleGroups,omitempty"` 4343} 4344 4345// MarshalJSON is the custom marshaler for ManagedRuleSetDefinitionProperties. 4346func (mrsdp ManagedRuleSetDefinitionProperties) MarshalJSON() ([]byte, error) { 4347 objectMap := make(map[string]interface{}) 4348 return json.Marshal(objectMap) 4349} 4350 4351// ManagedRuleSetList defines the list of managed rule sets for the policy. 4352type ManagedRuleSetList struct { 4353 // ManagedRuleSets - List of rule sets. 4354 ManagedRuleSets *[]ManagedRuleSet `json:"managedRuleSets,omitempty"` 4355} 4356 4357// MatchCondition define match conditions 4358type MatchCondition struct { 4359 // MatchVariable - Match variable to compare against. Possible values include: 'RemoteAddr', 'SocketAddr', 'RequestMethod', 'RequestHeader', 'RequestURI', 'QueryString', 'RequestBody', 'Cookies', 'PostArgs' 4360 MatchVariable MatchVariable `json:"matchVariable,omitempty"` 4361 // Selector - Selector can used to match a specific key for QueryString, Cookies, RequestHeader or PostArgs. 4362 Selector *string `json:"selector,omitempty"` 4363 // Operator - Describes operator to be matched. Possible values include: 'OperatorAny', 'OperatorIPMatch', 'OperatorGeoMatch', 'OperatorEqual', 'OperatorContains', 'OperatorLessThan', 'OperatorGreaterThan', 'OperatorLessThanOrEqual', 'OperatorGreaterThanOrEqual', 'OperatorBeginsWith', 'OperatorEndsWith', 'OperatorRegEx' 4364 Operator Operator `json:"operator,omitempty"` 4365 // NegateCondition - Describes if the result of this condition should be negated. 4366 NegateCondition *bool `json:"negateCondition,omitempty"` 4367 // MatchValue - List of possible match values. 4368 MatchValue *[]string `json:"matchValue,omitempty"` 4369 // Transforms - List of transforms. 4370 Transforms *[]TransformType `json:"transforms,omitempty"` 4371} 4372 4373// Operation CDN REST API operation 4374type Operation struct { 4375 // Name - READ-ONLY; Operation name: {provider}/{resource}/{operation} 4376 Name *string `json:"name,omitempty"` 4377 // Display - The object that represents the operation. 4378 Display *OperationDisplay `json:"display,omitempty"` 4379} 4380 4381// MarshalJSON is the custom marshaler for Operation. 4382func (o Operation) MarshalJSON() ([]byte, error) { 4383 objectMap := make(map[string]interface{}) 4384 if o.Display != nil { 4385 objectMap["display"] = o.Display 4386 } 4387 return json.Marshal(objectMap) 4388} 4389 4390// OperationDisplay the object that represents the operation. 4391type OperationDisplay struct { 4392 // Provider - READ-ONLY; Service provider: Microsoft.Cdn 4393 Provider *string `json:"provider,omitempty"` 4394 // Resource - READ-ONLY; Resource on which the operation is performed: Profile, endpoint, etc. 4395 Resource *string `json:"resource,omitempty"` 4396 // Operation - READ-ONLY; Operation type: Read, write, delete, etc. 4397 Operation *string `json:"operation,omitempty"` 4398} 4399 4400// MarshalJSON is the custom marshaler for OperationDisplay. 4401func (o OperationDisplay) MarshalJSON() ([]byte, error) { 4402 objectMap := make(map[string]interface{}) 4403 return json.Marshal(objectMap) 4404} 4405 4406// OperationsListResult result of the request to list CDN operations. It contains a list of operations and 4407// a URL link to get the next set of results. 4408type OperationsListResult struct { 4409 autorest.Response `json:"-"` 4410 // Value - READ-ONLY; List of CDN operations supported by the CDN resource provider. 4411 Value *[]Operation `json:"value,omitempty"` 4412 // NextLink - URL to get the next set of operation list results if there are any. 4413 NextLink *string `json:"nextLink,omitempty"` 4414} 4415 4416// MarshalJSON is the custom marshaler for OperationsListResult. 4417func (olr OperationsListResult) MarshalJSON() ([]byte, error) { 4418 objectMap := make(map[string]interface{}) 4419 if olr.NextLink != nil { 4420 objectMap["nextLink"] = olr.NextLink 4421 } 4422 return json.Marshal(objectMap) 4423} 4424 4425// OperationsListResultIterator provides access to a complete listing of Operation values. 4426type OperationsListResultIterator struct { 4427 i int 4428 page OperationsListResultPage 4429} 4430 4431// NextWithContext advances to the next value. If there was an error making 4432// the request the iterator does not advance and the error is returned. 4433func (iter *OperationsListResultIterator) NextWithContext(ctx context.Context) (err error) { 4434 if tracing.IsEnabled() { 4435 ctx = tracing.StartSpan(ctx, fqdn+"/OperationsListResultIterator.NextWithContext") 4436 defer func() { 4437 sc := -1 4438 if iter.Response().Response.Response != nil { 4439 sc = iter.Response().Response.Response.StatusCode 4440 } 4441 tracing.EndSpan(ctx, sc, err) 4442 }() 4443 } 4444 iter.i++ 4445 if iter.i < len(iter.page.Values()) { 4446 return nil 4447 } 4448 err = iter.page.NextWithContext(ctx) 4449 if err != nil { 4450 iter.i-- 4451 return err 4452 } 4453 iter.i = 0 4454 return nil 4455} 4456 4457// Next advances to the next value. If there was an error making 4458// the request the iterator does not advance and the error is returned. 4459// Deprecated: Use NextWithContext() instead. 4460func (iter *OperationsListResultIterator) Next() error { 4461 return iter.NextWithContext(context.Background()) 4462} 4463 4464// NotDone returns true if the enumeration should be started or is not yet complete. 4465func (iter OperationsListResultIterator) NotDone() bool { 4466 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 4467} 4468 4469// Response returns the raw server response from the last page request. 4470func (iter OperationsListResultIterator) Response() OperationsListResult { 4471 return iter.page.Response() 4472} 4473 4474// Value returns the current value or a zero-initialized value if the 4475// iterator has advanced beyond the end of the collection. 4476func (iter OperationsListResultIterator) Value() Operation { 4477 if !iter.page.NotDone() { 4478 return Operation{} 4479 } 4480 return iter.page.Values()[iter.i] 4481} 4482 4483// Creates a new instance of the OperationsListResultIterator type. 4484func NewOperationsListResultIterator(page OperationsListResultPage) OperationsListResultIterator { 4485 return OperationsListResultIterator{page: page} 4486} 4487 4488// IsEmpty returns true if the ListResult contains no values. 4489func (olr OperationsListResult) IsEmpty() bool { 4490 return olr.Value == nil || len(*olr.Value) == 0 4491} 4492 4493// hasNextLink returns true if the NextLink is not empty. 4494func (olr OperationsListResult) hasNextLink() bool { 4495 return olr.NextLink != nil && len(*olr.NextLink) != 0 4496} 4497 4498// operationsListResultPreparer prepares a request to retrieve the next set of results. 4499// It returns nil if no more results exist. 4500func (olr OperationsListResult) operationsListResultPreparer(ctx context.Context) (*http.Request, error) { 4501 if !olr.hasNextLink() { 4502 return nil, nil 4503 } 4504 return autorest.Prepare((&http.Request{}).WithContext(ctx), 4505 autorest.AsJSON(), 4506 autorest.AsGet(), 4507 autorest.WithBaseURL(to.String(olr.NextLink))) 4508} 4509 4510// OperationsListResultPage contains a page of Operation values. 4511type OperationsListResultPage struct { 4512 fn func(context.Context, OperationsListResult) (OperationsListResult, error) 4513 olr OperationsListResult 4514} 4515 4516// NextWithContext advances to the next page of values. If there was an error making 4517// the request the page does not advance and the error is returned. 4518func (page *OperationsListResultPage) NextWithContext(ctx context.Context) (err error) { 4519 if tracing.IsEnabled() { 4520 ctx = tracing.StartSpan(ctx, fqdn+"/OperationsListResultPage.NextWithContext") 4521 defer func() { 4522 sc := -1 4523 if page.Response().Response.Response != nil { 4524 sc = page.Response().Response.Response.StatusCode 4525 } 4526 tracing.EndSpan(ctx, sc, err) 4527 }() 4528 } 4529 for { 4530 next, err := page.fn(ctx, page.olr) 4531 if err != nil { 4532 return err 4533 } 4534 page.olr = next 4535 if !next.hasNextLink() || !next.IsEmpty() { 4536 break 4537 } 4538 } 4539 return nil 4540} 4541 4542// Next advances to the next page of values. If there was an error making 4543// the request the page does not advance and the error is returned. 4544// Deprecated: Use NextWithContext() instead. 4545func (page *OperationsListResultPage) Next() error { 4546 return page.NextWithContext(context.Background()) 4547} 4548 4549// NotDone returns true if the page enumeration should be started or is not yet complete. 4550func (page OperationsListResultPage) NotDone() bool { 4551 return !page.olr.IsEmpty() 4552} 4553 4554// Response returns the raw server response from the last page request. 4555func (page OperationsListResultPage) Response() OperationsListResult { 4556 return page.olr 4557} 4558 4559// Values returns the slice of values for the current page or nil if there are no values. 4560func (page OperationsListResultPage) Values() []Operation { 4561 if page.olr.IsEmpty() { 4562 return nil 4563 } 4564 return *page.olr.Value 4565} 4566 4567// Creates a new instance of the OperationsListResultPage type. 4568func NewOperationsListResultPage(cur OperationsListResult, getNextPage func(context.Context, OperationsListResult) (OperationsListResult, error)) OperationsListResultPage { 4569 return OperationsListResultPage{ 4570 fn: getNextPage, 4571 olr: cur, 4572 } 4573} 4574 4575// Origin CDN origin is the source of the content being delivered via CDN. When the edge nodes represented 4576// by an endpoint do not have the requested content cached, they attempt to fetch it from one or more of 4577// the configured origins. 4578type Origin struct { 4579 autorest.Response `json:"-"` 4580 *OriginProperties `json:"properties,omitempty"` 4581 // ID - READ-ONLY; Resource ID. 4582 ID *string `json:"id,omitempty"` 4583 // Name - READ-ONLY; Resource name. 4584 Name *string `json:"name,omitempty"` 4585 // Type - READ-ONLY; Resource type. 4586 Type *string `json:"type,omitempty"` 4587} 4588 4589// MarshalJSON is the custom marshaler for Origin. 4590func (o Origin) MarshalJSON() ([]byte, error) { 4591 objectMap := make(map[string]interface{}) 4592 if o.OriginProperties != nil { 4593 objectMap["properties"] = o.OriginProperties 4594 } 4595 return json.Marshal(objectMap) 4596} 4597 4598// UnmarshalJSON is the custom unmarshaler for Origin struct. 4599func (o *Origin) UnmarshalJSON(body []byte) error { 4600 var m map[string]*json.RawMessage 4601 err := json.Unmarshal(body, &m) 4602 if err != nil { 4603 return err 4604 } 4605 for k, v := range m { 4606 switch k { 4607 case "properties": 4608 if v != nil { 4609 var originProperties OriginProperties 4610 err = json.Unmarshal(*v, &originProperties) 4611 if err != nil { 4612 return err 4613 } 4614 o.OriginProperties = &originProperties 4615 } 4616 case "id": 4617 if v != nil { 4618 var ID string 4619 err = json.Unmarshal(*v, &ID) 4620 if err != nil { 4621 return err 4622 } 4623 o.ID = &ID 4624 } 4625 case "name": 4626 if v != nil { 4627 var name string 4628 err = json.Unmarshal(*v, &name) 4629 if err != nil { 4630 return err 4631 } 4632 o.Name = &name 4633 } 4634 case "type": 4635 if v != nil { 4636 var typeVar string 4637 err = json.Unmarshal(*v, &typeVar) 4638 if err != nil { 4639 return err 4640 } 4641 o.Type = &typeVar 4642 } 4643 } 4644 } 4645 4646 return nil 4647} 4648 4649// OriginGroup origin group comprising of origins is used for load balancing to origins when the content 4650// cannot be served from CDN. 4651type OriginGroup struct { 4652 autorest.Response `json:"-"` 4653 *OriginGroupProperties `json:"properties,omitempty"` 4654 // ID - READ-ONLY; Resource ID. 4655 ID *string `json:"id,omitempty"` 4656 // Name - READ-ONLY; Resource name. 4657 Name *string `json:"name,omitempty"` 4658 // Type - READ-ONLY; Resource type. 4659 Type *string `json:"type,omitempty"` 4660} 4661 4662// MarshalJSON is the custom marshaler for OriginGroup. 4663func (og OriginGroup) MarshalJSON() ([]byte, error) { 4664 objectMap := make(map[string]interface{}) 4665 if og.OriginGroupProperties != nil { 4666 objectMap["properties"] = og.OriginGroupProperties 4667 } 4668 return json.Marshal(objectMap) 4669} 4670 4671// UnmarshalJSON is the custom unmarshaler for OriginGroup struct. 4672func (og *OriginGroup) UnmarshalJSON(body []byte) error { 4673 var m map[string]*json.RawMessage 4674 err := json.Unmarshal(body, &m) 4675 if err != nil { 4676 return err 4677 } 4678 for k, v := range m { 4679 switch k { 4680 case "properties": 4681 if v != nil { 4682 var originGroupProperties OriginGroupProperties 4683 err = json.Unmarshal(*v, &originGroupProperties) 4684 if err != nil { 4685 return err 4686 } 4687 og.OriginGroupProperties = &originGroupProperties 4688 } 4689 case "id": 4690 if v != nil { 4691 var ID string 4692 err = json.Unmarshal(*v, &ID) 4693 if err != nil { 4694 return err 4695 } 4696 og.ID = &ID 4697 } 4698 case "name": 4699 if v != nil { 4700 var name string 4701 err = json.Unmarshal(*v, &name) 4702 if err != nil { 4703 return err 4704 } 4705 og.Name = &name 4706 } 4707 case "type": 4708 if v != nil { 4709 var typeVar string 4710 err = json.Unmarshal(*v, &typeVar) 4711 if err != nil { 4712 return err 4713 } 4714 og.Type = &typeVar 4715 } 4716 } 4717 } 4718 4719 return nil 4720} 4721 4722// OriginGroupListResult result of the request to list origin groups. It contains a list of origin groups 4723// objects and a URL link to get the next set of results. 4724type OriginGroupListResult struct { 4725 autorest.Response `json:"-"` 4726 // Value - READ-ONLY; List of CDN origin groups within an endpoint 4727 Value *[]OriginGroup `json:"value,omitempty"` 4728 // NextLink - URL to get the next set of origin objects if there are any. 4729 NextLink *string `json:"nextLink,omitempty"` 4730} 4731 4732// MarshalJSON is the custom marshaler for OriginGroupListResult. 4733func (oglr OriginGroupListResult) MarshalJSON() ([]byte, error) { 4734 objectMap := make(map[string]interface{}) 4735 if oglr.NextLink != nil { 4736 objectMap["nextLink"] = oglr.NextLink 4737 } 4738 return json.Marshal(objectMap) 4739} 4740 4741// OriginGroupListResultIterator provides access to a complete listing of OriginGroup values. 4742type OriginGroupListResultIterator struct { 4743 i int 4744 page OriginGroupListResultPage 4745} 4746 4747// NextWithContext advances to the next value. If there was an error making 4748// the request the iterator does not advance and the error is returned. 4749func (iter *OriginGroupListResultIterator) NextWithContext(ctx context.Context) (err error) { 4750 if tracing.IsEnabled() { 4751 ctx = tracing.StartSpan(ctx, fqdn+"/OriginGroupListResultIterator.NextWithContext") 4752 defer func() { 4753 sc := -1 4754 if iter.Response().Response.Response != nil { 4755 sc = iter.Response().Response.Response.StatusCode 4756 } 4757 tracing.EndSpan(ctx, sc, err) 4758 }() 4759 } 4760 iter.i++ 4761 if iter.i < len(iter.page.Values()) { 4762 return nil 4763 } 4764 err = iter.page.NextWithContext(ctx) 4765 if err != nil { 4766 iter.i-- 4767 return err 4768 } 4769 iter.i = 0 4770 return nil 4771} 4772 4773// Next advances to the next value. If there was an error making 4774// the request the iterator does not advance and the error is returned. 4775// Deprecated: Use NextWithContext() instead. 4776func (iter *OriginGroupListResultIterator) Next() error { 4777 return iter.NextWithContext(context.Background()) 4778} 4779 4780// NotDone returns true if the enumeration should be started or is not yet complete. 4781func (iter OriginGroupListResultIterator) NotDone() bool { 4782 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 4783} 4784 4785// Response returns the raw server response from the last page request. 4786func (iter OriginGroupListResultIterator) Response() OriginGroupListResult { 4787 return iter.page.Response() 4788} 4789 4790// Value returns the current value or a zero-initialized value if the 4791// iterator has advanced beyond the end of the collection. 4792func (iter OriginGroupListResultIterator) Value() OriginGroup { 4793 if !iter.page.NotDone() { 4794 return OriginGroup{} 4795 } 4796 return iter.page.Values()[iter.i] 4797} 4798 4799// Creates a new instance of the OriginGroupListResultIterator type. 4800func NewOriginGroupListResultIterator(page OriginGroupListResultPage) OriginGroupListResultIterator { 4801 return OriginGroupListResultIterator{page: page} 4802} 4803 4804// IsEmpty returns true if the ListResult contains no values. 4805func (oglr OriginGroupListResult) IsEmpty() bool { 4806 return oglr.Value == nil || len(*oglr.Value) == 0 4807} 4808 4809// hasNextLink returns true if the NextLink is not empty. 4810func (oglr OriginGroupListResult) hasNextLink() bool { 4811 return oglr.NextLink != nil && len(*oglr.NextLink) != 0 4812} 4813 4814// originGroupListResultPreparer prepares a request to retrieve the next set of results. 4815// It returns nil if no more results exist. 4816func (oglr OriginGroupListResult) originGroupListResultPreparer(ctx context.Context) (*http.Request, error) { 4817 if !oglr.hasNextLink() { 4818 return nil, nil 4819 } 4820 return autorest.Prepare((&http.Request{}).WithContext(ctx), 4821 autorest.AsJSON(), 4822 autorest.AsGet(), 4823 autorest.WithBaseURL(to.String(oglr.NextLink))) 4824} 4825 4826// OriginGroupListResultPage contains a page of OriginGroup values. 4827type OriginGroupListResultPage struct { 4828 fn func(context.Context, OriginGroupListResult) (OriginGroupListResult, error) 4829 oglr OriginGroupListResult 4830} 4831 4832// NextWithContext advances to the next page of values. If there was an error making 4833// the request the page does not advance and the error is returned. 4834func (page *OriginGroupListResultPage) NextWithContext(ctx context.Context) (err error) { 4835 if tracing.IsEnabled() { 4836 ctx = tracing.StartSpan(ctx, fqdn+"/OriginGroupListResultPage.NextWithContext") 4837 defer func() { 4838 sc := -1 4839 if page.Response().Response.Response != nil { 4840 sc = page.Response().Response.Response.StatusCode 4841 } 4842 tracing.EndSpan(ctx, sc, err) 4843 }() 4844 } 4845 for { 4846 next, err := page.fn(ctx, page.oglr) 4847 if err != nil { 4848 return err 4849 } 4850 page.oglr = next 4851 if !next.hasNextLink() || !next.IsEmpty() { 4852 break 4853 } 4854 } 4855 return nil 4856} 4857 4858// Next advances to the next page of values. If there was an error making 4859// the request the page does not advance and the error is returned. 4860// Deprecated: Use NextWithContext() instead. 4861func (page *OriginGroupListResultPage) Next() error { 4862 return page.NextWithContext(context.Background()) 4863} 4864 4865// NotDone returns true if the page enumeration should be started or is not yet complete. 4866func (page OriginGroupListResultPage) NotDone() bool { 4867 return !page.oglr.IsEmpty() 4868} 4869 4870// Response returns the raw server response from the last page request. 4871func (page OriginGroupListResultPage) Response() OriginGroupListResult { 4872 return page.oglr 4873} 4874 4875// Values returns the slice of values for the current page or nil if there are no values. 4876func (page OriginGroupListResultPage) Values() []OriginGroup { 4877 if page.oglr.IsEmpty() { 4878 return nil 4879 } 4880 return *page.oglr.Value 4881} 4882 4883// Creates a new instance of the OriginGroupListResultPage type. 4884func NewOriginGroupListResultPage(cur OriginGroupListResult, getNextPage func(context.Context, OriginGroupListResult) (OriginGroupListResult, error)) OriginGroupListResultPage { 4885 return OriginGroupListResultPage{ 4886 fn: getNextPage, 4887 oglr: cur, 4888 } 4889} 4890 4891// OriginGroupProperties the JSON object that contains the properties of the origin group. 4892type OriginGroupProperties struct { 4893 // ResourceState - READ-ONLY; Resource status of the origin group. Possible values include: 'OriginGroupResourceStateCreating', 'OriginGroupResourceStateActive', 'OriginGroupResourceStateDeleting' 4894 ResourceState OriginGroupResourceState `json:"resourceState,omitempty"` 4895 // ProvisioningState - READ-ONLY; Provisioning status of the origin group. 4896 ProvisioningState *string `json:"provisioningState,omitempty"` 4897 // HealthProbeSettings - Health probe settings to the origin that is used to determine the health of the origin. 4898 HealthProbeSettings *HealthProbeParameters `json:"healthProbeSettings,omitempty"` 4899 // Origins - The source of the content being delivered via CDN within given origin group. 4900 Origins *[]ResourceReference `json:"origins,omitempty"` 4901 // TrafficRestorationTimeToHealedOrNewEndpointsInMinutes - Time in minutes to shift the traffic to the endpoint gradually when an unhealthy endpoint comes healthy or a new endpoint is added. Default is 10 mins. This property is currently not supported. 4902 TrafficRestorationTimeToHealedOrNewEndpointsInMinutes *int32 `json:"trafficRestorationTimeToHealedOrNewEndpointsInMinutes,omitempty"` 4903 // ResponseBasedOriginErrorDetectionSettings - The JSON object that contains the properties to determine origin health using real requests/responses. This property is currently not supported. 4904 ResponseBasedOriginErrorDetectionSettings *ResponseBasedOriginErrorDetectionParameters `json:"responseBasedOriginErrorDetectionSettings,omitempty"` 4905} 4906 4907// MarshalJSON is the custom marshaler for OriginGroupProperties. 4908func (ogp OriginGroupProperties) MarshalJSON() ([]byte, error) { 4909 objectMap := make(map[string]interface{}) 4910 if ogp.HealthProbeSettings != nil { 4911 objectMap["healthProbeSettings"] = ogp.HealthProbeSettings 4912 } 4913 if ogp.Origins != nil { 4914 objectMap["origins"] = ogp.Origins 4915 } 4916 if ogp.TrafficRestorationTimeToHealedOrNewEndpointsInMinutes != nil { 4917 objectMap["trafficRestorationTimeToHealedOrNewEndpointsInMinutes"] = ogp.TrafficRestorationTimeToHealedOrNewEndpointsInMinutes 4918 } 4919 if ogp.ResponseBasedOriginErrorDetectionSettings != nil { 4920 objectMap["responseBasedOriginErrorDetectionSettings"] = ogp.ResponseBasedOriginErrorDetectionSettings 4921 } 4922 return json.Marshal(objectMap) 4923} 4924 4925// OriginGroupsCreateFuture an abstraction for monitoring and retrieving the results of a long-running 4926// operation. 4927type OriginGroupsCreateFuture struct { 4928 azure.FutureAPI 4929 // Result returns the result of the asynchronous operation. 4930 // If the operation has not completed it will return an error. 4931 Result func(OriginGroupsClient) (OriginGroup, error) 4932} 4933 4934// UnmarshalJSON is the custom unmarshaller for CreateFuture. 4935func (future *OriginGroupsCreateFuture) UnmarshalJSON(body []byte) error { 4936 var azFuture azure.Future 4937 if err := json.Unmarshal(body, &azFuture); err != nil { 4938 return err 4939 } 4940 future.FutureAPI = &azFuture 4941 future.Result = future.result 4942 return nil 4943} 4944 4945// result is the default implementation for OriginGroupsCreateFuture.Result. 4946func (future *OriginGroupsCreateFuture) result(client OriginGroupsClient) (og OriginGroup, err error) { 4947 var done bool 4948 done, err = future.DoneWithContext(context.Background(), client) 4949 if err != nil { 4950 err = autorest.NewErrorWithError(err, "cdn.OriginGroupsCreateFuture", "Result", future.Response(), "Polling failure") 4951 return 4952 } 4953 if !done { 4954 og.Response.Response = future.Response() 4955 err = azure.NewAsyncOpIncompleteError("cdn.OriginGroupsCreateFuture") 4956 return 4957 } 4958 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 4959 if og.Response.Response, err = future.GetResult(sender); err == nil && og.Response.Response.StatusCode != http.StatusNoContent { 4960 og, err = client.CreateResponder(og.Response.Response) 4961 if err != nil { 4962 err = autorest.NewErrorWithError(err, "cdn.OriginGroupsCreateFuture", "Result", og.Response.Response, "Failure responding to request") 4963 } 4964 } 4965 return 4966} 4967 4968// OriginGroupsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running 4969// operation. 4970type OriginGroupsDeleteFuture struct { 4971 azure.FutureAPI 4972 // Result returns the result of the asynchronous operation. 4973 // If the operation has not completed it will return an error. 4974 Result func(OriginGroupsClient) (autorest.Response, error) 4975} 4976 4977// UnmarshalJSON is the custom unmarshaller for CreateFuture. 4978func (future *OriginGroupsDeleteFuture) UnmarshalJSON(body []byte) error { 4979 var azFuture azure.Future 4980 if err := json.Unmarshal(body, &azFuture); err != nil { 4981 return err 4982 } 4983 future.FutureAPI = &azFuture 4984 future.Result = future.result 4985 return nil 4986} 4987 4988// result is the default implementation for OriginGroupsDeleteFuture.Result. 4989func (future *OriginGroupsDeleteFuture) result(client OriginGroupsClient) (ar autorest.Response, err error) { 4990 var done bool 4991 done, err = future.DoneWithContext(context.Background(), client) 4992 if err != nil { 4993 err = autorest.NewErrorWithError(err, "cdn.OriginGroupsDeleteFuture", "Result", future.Response(), "Polling failure") 4994 return 4995 } 4996 if !done { 4997 ar.Response = future.Response() 4998 err = azure.NewAsyncOpIncompleteError("cdn.OriginGroupsDeleteFuture") 4999 return 5000 } 5001 ar.Response = future.Response() 5002 return 5003} 5004 5005// OriginGroupsUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 5006// operation. 5007type OriginGroupsUpdateFuture struct { 5008 azure.FutureAPI 5009 // Result returns the result of the asynchronous operation. 5010 // If the operation has not completed it will return an error. 5011 Result func(OriginGroupsClient) (OriginGroup, error) 5012} 5013 5014// UnmarshalJSON is the custom unmarshaller for CreateFuture. 5015func (future *OriginGroupsUpdateFuture) UnmarshalJSON(body []byte) error { 5016 var azFuture azure.Future 5017 if err := json.Unmarshal(body, &azFuture); err != nil { 5018 return err 5019 } 5020 future.FutureAPI = &azFuture 5021 future.Result = future.result 5022 return nil 5023} 5024 5025// result is the default implementation for OriginGroupsUpdateFuture.Result. 5026func (future *OriginGroupsUpdateFuture) result(client OriginGroupsClient) (og OriginGroup, err error) { 5027 var done bool 5028 done, err = future.DoneWithContext(context.Background(), client) 5029 if err != nil { 5030 err = autorest.NewErrorWithError(err, "cdn.OriginGroupsUpdateFuture", "Result", future.Response(), "Polling failure") 5031 return 5032 } 5033 if !done { 5034 og.Response.Response = future.Response() 5035 err = azure.NewAsyncOpIncompleteError("cdn.OriginGroupsUpdateFuture") 5036 return 5037 } 5038 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 5039 if og.Response.Response, err = future.GetResult(sender); err == nil && og.Response.Response.StatusCode != http.StatusNoContent { 5040 og, err = client.UpdateResponder(og.Response.Response) 5041 if err != nil { 5042 err = autorest.NewErrorWithError(err, "cdn.OriginGroupsUpdateFuture", "Result", og.Response.Response, "Failure responding to request") 5043 } 5044 } 5045 return 5046} 5047 5048// OriginGroupUpdateParameters origin group properties needed for origin group creation or update. 5049type OriginGroupUpdateParameters struct { 5050 *OriginGroupUpdatePropertiesParameters `json:"properties,omitempty"` 5051} 5052 5053// MarshalJSON is the custom marshaler for OriginGroupUpdateParameters. 5054func (ogup OriginGroupUpdateParameters) MarshalJSON() ([]byte, error) { 5055 objectMap := make(map[string]interface{}) 5056 if ogup.OriginGroupUpdatePropertiesParameters != nil { 5057 objectMap["properties"] = ogup.OriginGroupUpdatePropertiesParameters 5058 } 5059 return json.Marshal(objectMap) 5060} 5061 5062// UnmarshalJSON is the custom unmarshaler for OriginGroupUpdateParameters struct. 5063func (ogup *OriginGroupUpdateParameters) UnmarshalJSON(body []byte) error { 5064 var m map[string]*json.RawMessage 5065 err := json.Unmarshal(body, &m) 5066 if err != nil { 5067 return err 5068 } 5069 for k, v := range m { 5070 switch k { 5071 case "properties": 5072 if v != nil { 5073 var originGroupUpdatePropertiesParameters OriginGroupUpdatePropertiesParameters 5074 err = json.Unmarshal(*v, &originGroupUpdatePropertiesParameters) 5075 if err != nil { 5076 return err 5077 } 5078 ogup.OriginGroupUpdatePropertiesParameters = &originGroupUpdatePropertiesParameters 5079 } 5080 } 5081 } 5082 5083 return nil 5084} 5085 5086// OriginGroupUpdatePropertiesParameters the JSON object that contains the properties of the origin group. 5087type OriginGroupUpdatePropertiesParameters struct { 5088 // HealthProbeSettings - Health probe settings to the origin that is used to determine the health of the origin. 5089 HealthProbeSettings *HealthProbeParameters `json:"healthProbeSettings,omitempty"` 5090 // Origins - The source of the content being delivered via CDN within given origin group. 5091 Origins *[]ResourceReference `json:"origins,omitempty"` 5092 // TrafficRestorationTimeToHealedOrNewEndpointsInMinutes - Time in minutes to shift the traffic to the endpoint gradually when an unhealthy endpoint comes healthy or a new endpoint is added. Default is 10 mins. This property is currently not supported. 5093 TrafficRestorationTimeToHealedOrNewEndpointsInMinutes *int32 `json:"trafficRestorationTimeToHealedOrNewEndpointsInMinutes,omitempty"` 5094 // ResponseBasedOriginErrorDetectionSettings - The JSON object that contains the properties to determine origin health using real requests/responses. This property is currently not supported. 5095 ResponseBasedOriginErrorDetectionSettings *ResponseBasedOriginErrorDetectionParameters `json:"responseBasedOriginErrorDetectionSettings,omitempty"` 5096} 5097 5098// OriginListResult result of the request to list origins. It contains a list of origin objects and a URL 5099// link to get the next set of results. 5100type OriginListResult struct { 5101 autorest.Response `json:"-"` 5102 // Value - READ-ONLY; List of CDN origins within an endpoint 5103 Value *[]Origin `json:"value,omitempty"` 5104 // NextLink - URL to get the next set of origin objects if there are any. 5105 NextLink *string `json:"nextLink,omitempty"` 5106} 5107 5108// MarshalJSON is the custom marshaler for OriginListResult. 5109func (olr OriginListResult) MarshalJSON() ([]byte, error) { 5110 objectMap := make(map[string]interface{}) 5111 if olr.NextLink != nil { 5112 objectMap["nextLink"] = olr.NextLink 5113 } 5114 return json.Marshal(objectMap) 5115} 5116 5117// OriginListResultIterator provides access to a complete listing of Origin values. 5118type OriginListResultIterator struct { 5119 i int 5120 page OriginListResultPage 5121} 5122 5123// NextWithContext advances to the next value. If there was an error making 5124// the request the iterator does not advance and the error is returned. 5125func (iter *OriginListResultIterator) NextWithContext(ctx context.Context) (err error) { 5126 if tracing.IsEnabled() { 5127 ctx = tracing.StartSpan(ctx, fqdn+"/OriginListResultIterator.NextWithContext") 5128 defer func() { 5129 sc := -1 5130 if iter.Response().Response.Response != nil { 5131 sc = iter.Response().Response.Response.StatusCode 5132 } 5133 tracing.EndSpan(ctx, sc, err) 5134 }() 5135 } 5136 iter.i++ 5137 if iter.i < len(iter.page.Values()) { 5138 return nil 5139 } 5140 err = iter.page.NextWithContext(ctx) 5141 if err != nil { 5142 iter.i-- 5143 return err 5144 } 5145 iter.i = 0 5146 return nil 5147} 5148 5149// Next advances to the next value. If there was an error making 5150// the request the iterator does not advance and the error is returned. 5151// Deprecated: Use NextWithContext() instead. 5152func (iter *OriginListResultIterator) Next() error { 5153 return iter.NextWithContext(context.Background()) 5154} 5155 5156// NotDone returns true if the enumeration should be started or is not yet complete. 5157func (iter OriginListResultIterator) NotDone() bool { 5158 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 5159} 5160 5161// Response returns the raw server response from the last page request. 5162func (iter OriginListResultIterator) Response() OriginListResult { 5163 return iter.page.Response() 5164} 5165 5166// Value returns the current value or a zero-initialized value if the 5167// iterator has advanced beyond the end of the collection. 5168func (iter OriginListResultIterator) Value() Origin { 5169 if !iter.page.NotDone() { 5170 return Origin{} 5171 } 5172 return iter.page.Values()[iter.i] 5173} 5174 5175// Creates a new instance of the OriginListResultIterator type. 5176func NewOriginListResultIterator(page OriginListResultPage) OriginListResultIterator { 5177 return OriginListResultIterator{page: page} 5178} 5179 5180// IsEmpty returns true if the ListResult contains no values. 5181func (olr OriginListResult) IsEmpty() bool { 5182 return olr.Value == nil || len(*olr.Value) == 0 5183} 5184 5185// hasNextLink returns true if the NextLink is not empty. 5186func (olr OriginListResult) hasNextLink() bool { 5187 return olr.NextLink != nil && len(*olr.NextLink) != 0 5188} 5189 5190// originListResultPreparer prepares a request to retrieve the next set of results. 5191// It returns nil if no more results exist. 5192func (olr OriginListResult) originListResultPreparer(ctx context.Context) (*http.Request, error) { 5193 if !olr.hasNextLink() { 5194 return nil, nil 5195 } 5196 return autorest.Prepare((&http.Request{}).WithContext(ctx), 5197 autorest.AsJSON(), 5198 autorest.AsGet(), 5199 autorest.WithBaseURL(to.String(olr.NextLink))) 5200} 5201 5202// OriginListResultPage contains a page of Origin values. 5203type OriginListResultPage struct { 5204 fn func(context.Context, OriginListResult) (OriginListResult, error) 5205 olr OriginListResult 5206} 5207 5208// NextWithContext advances to the next page of values. If there was an error making 5209// the request the page does not advance and the error is returned. 5210func (page *OriginListResultPage) NextWithContext(ctx context.Context) (err error) { 5211 if tracing.IsEnabled() { 5212 ctx = tracing.StartSpan(ctx, fqdn+"/OriginListResultPage.NextWithContext") 5213 defer func() { 5214 sc := -1 5215 if page.Response().Response.Response != nil { 5216 sc = page.Response().Response.Response.StatusCode 5217 } 5218 tracing.EndSpan(ctx, sc, err) 5219 }() 5220 } 5221 for { 5222 next, err := page.fn(ctx, page.olr) 5223 if err != nil { 5224 return err 5225 } 5226 page.olr = next 5227 if !next.hasNextLink() || !next.IsEmpty() { 5228 break 5229 } 5230 } 5231 return nil 5232} 5233 5234// Next advances to the next page of values. If there was an error making 5235// the request the page does not advance and the error is returned. 5236// Deprecated: Use NextWithContext() instead. 5237func (page *OriginListResultPage) Next() error { 5238 return page.NextWithContext(context.Background()) 5239} 5240 5241// NotDone returns true if the page enumeration should be started or is not yet complete. 5242func (page OriginListResultPage) NotDone() bool { 5243 return !page.olr.IsEmpty() 5244} 5245 5246// Response returns the raw server response from the last page request. 5247func (page OriginListResultPage) Response() OriginListResult { 5248 return page.olr 5249} 5250 5251// Values returns the slice of values for the current page or nil if there are no values. 5252func (page OriginListResultPage) Values() []Origin { 5253 if page.olr.IsEmpty() { 5254 return nil 5255 } 5256 return *page.olr.Value 5257} 5258 5259// Creates a new instance of the OriginListResultPage type. 5260func NewOriginListResultPage(cur OriginListResult, getNextPage func(context.Context, OriginListResult) (OriginListResult, error)) OriginListResultPage { 5261 return OriginListResultPage{ 5262 fn: getNextPage, 5263 olr: cur, 5264 } 5265} 5266 5267// OriginProperties the JSON object that contains the properties of the origin. 5268type OriginProperties struct { 5269 // ResourceState - READ-ONLY; Resource status of the origin. Possible values include: 'OriginResourceStateCreating', 'OriginResourceStateActive', 'OriginResourceStateDeleting' 5270 ResourceState OriginResourceState `json:"resourceState,omitempty"` 5271 // ProvisioningState - READ-ONLY; Provisioning status of the origin. 5272 ProvisioningState *string `json:"provisioningState,omitempty"` 5273 // PrivateEndpointStatus - READ-ONLY; The approval status for the connection to the Private Link. Possible values include: 'Pending', 'Approved', 'Rejected', 'Disconnected', 'Timeout' 5274 PrivateEndpointStatus PrivateEndpointStatus `json:"privateEndpointStatus,omitempty"` 5275 // HostName - The address of the origin. Domain names, IPv4 addresses, and IPv6 addresses are supported.This should be unique across all origins in an endpoint. 5276 HostName *string `json:"hostName,omitempty"` 5277 // HTTPPort - The value of the HTTP port. Must be between 1 and 65535. 5278 HTTPPort *int32 `json:"httpPort,omitempty"` 5279 // HTTPSPort - The value of the HTTPS port. Must be between 1 and 65535. 5280 HTTPSPort *int32 `json:"httpsPort,omitempty"` 5281 // OriginHostHeader - The host header value sent to the origin with each request. If you leave this blank, the request hostname determines this value. Azure CDN origins, such as Web Apps, Blob Storage, and Cloud Services require this host header value to match the origin hostname by default. This overrides the host header defined at Endpoint 5282 OriginHostHeader *string `json:"originHostHeader,omitempty"` 5283 // Priority - Priority of origin in given origin group for load balancing. Higher priorities will not be used for load balancing if any lower priority origin is healthy.Must be between 1 and 5 5284 Priority *int32 `json:"priority,omitempty"` 5285 // Weight - Weight of the origin in given origin group for load balancing. Must be between 1 and 1000 5286 Weight *int32 `json:"weight,omitempty"` 5287 // Enabled - Origin is enabled for load balancing or not 5288 Enabled *bool `json:"enabled,omitempty"` 5289 // PrivateLinkAlias - The Alias of the Private Link resource. Populating this optional field indicates that this origin is 'Private' 5290 PrivateLinkAlias *string `json:"privateLinkAlias,omitempty"` 5291 // PrivateLinkResourceID - The Resource Id of the Private Link resource. Populating this optional field indicates that this backend is 'Private' 5292 PrivateLinkResourceID *string `json:"privateLinkResourceId,omitempty"` 5293 // PrivateLinkLocation - The location of the Private Link resource. Required only if 'privateLinkResourceId' is populated 5294 PrivateLinkLocation *string `json:"privateLinkLocation,omitempty"` 5295 // PrivateLinkApprovalMessage - A custom message to be included in the approval request to connect to the Private Link. 5296 PrivateLinkApprovalMessage *string `json:"privateLinkApprovalMessage,omitempty"` 5297} 5298 5299// MarshalJSON is the custom marshaler for OriginProperties. 5300func (op OriginProperties) MarshalJSON() ([]byte, error) { 5301 objectMap := make(map[string]interface{}) 5302 if op.HostName != nil { 5303 objectMap["hostName"] = op.HostName 5304 } 5305 if op.HTTPPort != nil { 5306 objectMap["httpPort"] = op.HTTPPort 5307 } 5308 if op.HTTPSPort != nil { 5309 objectMap["httpsPort"] = op.HTTPSPort 5310 } 5311 if op.OriginHostHeader != nil { 5312 objectMap["originHostHeader"] = op.OriginHostHeader 5313 } 5314 if op.Priority != nil { 5315 objectMap["priority"] = op.Priority 5316 } 5317 if op.Weight != nil { 5318 objectMap["weight"] = op.Weight 5319 } 5320 if op.Enabled != nil { 5321 objectMap["enabled"] = op.Enabled 5322 } 5323 if op.PrivateLinkAlias != nil { 5324 objectMap["privateLinkAlias"] = op.PrivateLinkAlias 5325 } 5326 if op.PrivateLinkResourceID != nil { 5327 objectMap["privateLinkResourceId"] = op.PrivateLinkResourceID 5328 } 5329 if op.PrivateLinkLocation != nil { 5330 objectMap["privateLinkLocation"] = op.PrivateLinkLocation 5331 } 5332 if op.PrivateLinkApprovalMessage != nil { 5333 objectMap["privateLinkApprovalMessage"] = op.PrivateLinkApprovalMessage 5334 } 5335 return json.Marshal(objectMap) 5336} 5337 5338// OriginsCreateFuture an abstraction for monitoring and retrieving the results of a long-running 5339// operation. 5340type OriginsCreateFuture struct { 5341 azure.FutureAPI 5342 // Result returns the result of the asynchronous operation. 5343 // If the operation has not completed it will return an error. 5344 Result func(OriginsClient) (Origin, error) 5345} 5346 5347// UnmarshalJSON is the custom unmarshaller for CreateFuture. 5348func (future *OriginsCreateFuture) UnmarshalJSON(body []byte) error { 5349 var azFuture azure.Future 5350 if err := json.Unmarshal(body, &azFuture); err != nil { 5351 return err 5352 } 5353 future.FutureAPI = &azFuture 5354 future.Result = future.result 5355 return nil 5356} 5357 5358// result is the default implementation for OriginsCreateFuture.Result. 5359func (future *OriginsCreateFuture) result(client OriginsClient) (o Origin, err error) { 5360 var done bool 5361 done, err = future.DoneWithContext(context.Background(), client) 5362 if err != nil { 5363 err = autorest.NewErrorWithError(err, "cdn.OriginsCreateFuture", "Result", future.Response(), "Polling failure") 5364 return 5365 } 5366 if !done { 5367 o.Response.Response = future.Response() 5368 err = azure.NewAsyncOpIncompleteError("cdn.OriginsCreateFuture") 5369 return 5370 } 5371 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 5372 if o.Response.Response, err = future.GetResult(sender); err == nil && o.Response.Response.StatusCode != http.StatusNoContent { 5373 o, err = client.CreateResponder(o.Response.Response) 5374 if err != nil { 5375 err = autorest.NewErrorWithError(err, "cdn.OriginsCreateFuture", "Result", o.Response.Response, "Failure responding to request") 5376 } 5377 } 5378 return 5379} 5380 5381// OriginsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running 5382// operation. 5383type OriginsDeleteFuture struct { 5384 azure.FutureAPI 5385 // Result returns the result of the asynchronous operation. 5386 // If the operation has not completed it will return an error. 5387 Result func(OriginsClient) (autorest.Response, error) 5388} 5389 5390// UnmarshalJSON is the custom unmarshaller for CreateFuture. 5391func (future *OriginsDeleteFuture) UnmarshalJSON(body []byte) error { 5392 var azFuture azure.Future 5393 if err := json.Unmarshal(body, &azFuture); err != nil { 5394 return err 5395 } 5396 future.FutureAPI = &azFuture 5397 future.Result = future.result 5398 return nil 5399} 5400 5401// result is the default implementation for OriginsDeleteFuture.Result. 5402func (future *OriginsDeleteFuture) result(client OriginsClient) (ar autorest.Response, err error) { 5403 var done bool 5404 done, err = future.DoneWithContext(context.Background(), client) 5405 if err != nil { 5406 err = autorest.NewErrorWithError(err, "cdn.OriginsDeleteFuture", "Result", future.Response(), "Polling failure") 5407 return 5408 } 5409 if !done { 5410 ar.Response = future.Response() 5411 err = azure.NewAsyncOpIncompleteError("cdn.OriginsDeleteFuture") 5412 return 5413 } 5414 ar.Response = future.Response() 5415 return 5416} 5417 5418// OriginsUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 5419// operation. 5420type OriginsUpdateFuture struct { 5421 azure.FutureAPI 5422 // Result returns the result of the asynchronous operation. 5423 // If the operation has not completed it will return an error. 5424 Result func(OriginsClient) (Origin, error) 5425} 5426 5427// UnmarshalJSON is the custom unmarshaller for CreateFuture. 5428func (future *OriginsUpdateFuture) UnmarshalJSON(body []byte) error { 5429 var azFuture azure.Future 5430 if err := json.Unmarshal(body, &azFuture); err != nil { 5431 return err 5432 } 5433 future.FutureAPI = &azFuture 5434 future.Result = future.result 5435 return nil 5436} 5437 5438// result is the default implementation for OriginsUpdateFuture.Result. 5439func (future *OriginsUpdateFuture) result(client OriginsClient) (o Origin, err error) { 5440 var done bool 5441 done, err = future.DoneWithContext(context.Background(), client) 5442 if err != nil { 5443 err = autorest.NewErrorWithError(err, "cdn.OriginsUpdateFuture", "Result", future.Response(), "Polling failure") 5444 return 5445 } 5446 if !done { 5447 o.Response.Response = future.Response() 5448 err = azure.NewAsyncOpIncompleteError("cdn.OriginsUpdateFuture") 5449 return 5450 } 5451 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 5452 if o.Response.Response, err = future.GetResult(sender); err == nil && o.Response.Response.StatusCode != http.StatusNoContent { 5453 o, err = client.UpdateResponder(o.Response.Response) 5454 if err != nil { 5455 err = autorest.NewErrorWithError(err, "cdn.OriginsUpdateFuture", "Result", o.Response.Response, "Failure responding to request") 5456 } 5457 } 5458 return 5459} 5460 5461// OriginUpdateParameters origin properties needed for origin update. 5462type OriginUpdateParameters struct { 5463 *OriginUpdatePropertiesParameters `json:"properties,omitempty"` 5464} 5465 5466// MarshalJSON is the custom marshaler for OriginUpdateParameters. 5467func (oup OriginUpdateParameters) MarshalJSON() ([]byte, error) { 5468 objectMap := make(map[string]interface{}) 5469 if oup.OriginUpdatePropertiesParameters != nil { 5470 objectMap["properties"] = oup.OriginUpdatePropertiesParameters 5471 } 5472 return json.Marshal(objectMap) 5473} 5474 5475// UnmarshalJSON is the custom unmarshaler for OriginUpdateParameters struct. 5476func (oup *OriginUpdateParameters) UnmarshalJSON(body []byte) error { 5477 var m map[string]*json.RawMessage 5478 err := json.Unmarshal(body, &m) 5479 if err != nil { 5480 return err 5481 } 5482 for k, v := range m { 5483 switch k { 5484 case "properties": 5485 if v != nil { 5486 var originUpdatePropertiesParameters OriginUpdatePropertiesParameters 5487 err = json.Unmarshal(*v, &originUpdatePropertiesParameters) 5488 if err != nil { 5489 return err 5490 } 5491 oup.OriginUpdatePropertiesParameters = &originUpdatePropertiesParameters 5492 } 5493 } 5494 } 5495 5496 return nil 5497} 5498 5499// OriginUpdatePropertiesParameters the JSON object that contains the properties of the origin. 5500type OriginUpdatePropertiesParameters struct { 5501 // HostName - The address of the origin. Domain names, IPv4 addresses, and IPv6 addresses are supported.This should be unique across all origins in an endpoint. 5502 HostName *string `json:"hostName,omitempty"` 5503 // HTTPPort - The value of the HTTP port. Must be between 1 and 65535. 5504 HTTPPort *int32 `json:"httpPort,omitempty"` 5505 // HTTPSPort - The value of the HTTPS port. Must be between 1 and 65535. 5506 HTTPSPort *int32 `json:"httpsPort,omitempty"` 5507 // OriginHostHeader - The host header value sent to the origin with each request. If you leave this blank, the request hostname determines this value. Azure CDN origins, such as Web Apps, Blob Storage, and Cloud Services require this host header value to match the origin hostname by default. This overrides the host header defined at Endpoint 5508 OriginHostHeader *string `json:"originHostHeader,omitempty"` 5509 // Priority - Priority of origin in given origin group for load balancing. Higher priorities will not be used for load balancing if any lower priority origin is healthy.Must be between 1 and 5 5510 Priority *int32 `json:"priority,omitempty"` 5511 // Weight - Weight of the origin in given origin group for load balancing. Must be between 1 and 1000 5512 Weight *int32 `json:"weight,omitempty"` 5513 // Enabled - Origin is enabled for load balancing or not 5514 Enabled *bool `json:"enabled,omitempty"` 5515 // PrivateLinkAlias - The Alias of the Private Link resource. Populating this optional field indicates that this origin is 'Private' 5516 PrivateLinkAlias *string `json:"privateLinkAlias,omitempty"` 5517 // PrivateLinkResourceID - The Resource Id of the Private Link resource. Populating this optional field indicates that this backend is 'Private' 5518 PrivateLinkResourceID *string `json:"privateLinkResourceId,omitempty"` 5519 // PrivateLinkLocation - The location of the Private Link resource. Required only if 'privateLinkResourceId' is populated 5520 PrivateLinkLocation *string `json:"privateLinkLocation,omitempty"` 5521 // PrivateLinkApprovalMessage - A custom message to be included in the approval request to connect to the Private Link. 5522 PrivateLinkApprovalMessage *string `json:"privateLinkApprovalMessage,omitempty"` 5523} 5524 5525// PoliciesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 5526// operation. 5527type PoliciesCreateOrUpdateFuture struct { 5528 azure.FutureAPI 5529 // Result returns the result of the asynchronous operation. 5530 // If the operation has not completed it will return an error. 5531 Result func(PoliciesClient) (WebApplicationFirewallPolicy, error) 5532} 5533 5534// UnmarshalJSON is the custom unmarshaller for CreateFuture. 5535func (future *PoliciesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 5536 var azFuture azure.Future 5537 if err := json.Unmarshal(body, &azFuture); err != nil { 5538 return err 5539 } 5540 future.FutureAPI = &azFuture 5541 future.Result = future.result 5542 return nil 5543} 5544 5545// result is the default implementation for PoliciesCreateOrUpdateFuture.Result. 5546func (future *PoliciesCreateOrUpdateFuture) result(client PoliciesClient) (wafp WebApplicationFirewallPolicy, err error) { 5547 var done bool 5548 done, err = future.DoneWithContext(context.Background(), client) 5549 if err != nil { 5550 err = autorest.NewErrorWithError(err, "cdn.PoliciesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 5551 return 5552 } 5553 if !done { 5554 wafp.Response.Response = future.Response() 5555 err = azure.NewAsyncOpIncompleteError("cdn.PoliciesCreateOrUpdateFuture") 5556 return 5557 } 5558 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 5559 if wafp.Response.Response, err = future.GetResult(sender); err == nil && wafp.Response.Response.StatusCode != http.StatusNoContent { 5560 wafp, err = client.CreateOrUpdateResponder(wafp.Response.Response) 5561 if err != nil { 5562 err = autorest.NewErrorWithError(err, "cdn.PoliciesCreateOrUpdateFuture", "Result", wafp.Response.Response, "Failure responding to request") 5563 } 5564 } 5565 return 5566} 5567 5568// PoliciesUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 5569// operation. 5570type PoliciesUpdateFuture struct { 5571 azure.FutureAPI 5572 // Result returns the result of the asynchronous operation. 5573 // If the operation has not completed it will return an error. 5574 Result func(PoliciesClient) (WebApplicationFirewallPolicy, error) 5575} 5576 5577// UnmarshalJSON is the custom unmarshaller for CreateFuture. 5578func (future *PoliciesUpdateFuture) UnmarshalJSON(body []byte) error { 5579 var azFuture azure.Future 5580 if err := json.Unmarshal(body, &azFuture); err != nil { 5581 return err 5582 } 5583 future.FutureAPI = &azFuture 5584 future.Result = future.result 5585 return nil 5586} 5587 5588// result is the default implementation for PoliciesUpdateFuture.Result. 5589func (future *PoliciesUpdateFuture) result(client PoliciesClient) (wafp WebApplicationFirewallPolicy, err error) { 5590 var done bool 5591 done, err = future.DoneWithContext(context.Background(), client) 5592 if err != nil { 5593 err = autorest.NewErrorWithError(err, "cdn.PoliciesUpdateFuture", "Result", future.Response(), "Polling failure") 5594 return 5595 } 5596 if !done { 5597 wafp.Response.Response = future.Response() 5598 err = azure.NewAsyncOpIncompleteError("cdn.PoliciesUpdateFuture") 5599 return 5600 } 5601 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 5602 if wafp.Response.Response, err = future.GetResult(sender); err == nil && wafp.Response.Response.StatusCode != http.StatusNoContent { 5603 wafp, err = client.UpdateResponder(wafp.Response.Response) 5604 if err != nil { 5605 err = autorest.NewErrorWithError(err, "cdn.PoliciesUpdateFuture", "Result", wafp.Response.Response, "Failure responding to request") 5606 } 5607 } 5608 return 5609} 5610 5611// PolicySettings defines contents of a web application firewall global configuration 5612type PolicySettings struct { 5613 // EnabledState - describes if the policy is in enabled state or disabled state. Possible values include: 'PolicyEnabledStateDisabled', 'PolicyEnabledStateEnabled' 5614 EnabledState PolicyEnabledState `json:"enabledState,omitempty"` 5615 // Mode - Describes if it is in detection mode or prevention mode at policy level. Possible values include: 'Prevention', 'Detection' 5616 Mode PolicyMode `json:"mode,omitempty"` 5617 // DefaultRedirectURL - If action type is redirect, this field represents the default redirect URL for the client. 5618 DefaultRedirectURL *string `json:"defaultRedirectUrl,omitempty"` 5619 // DefaultCustomBlockResponseStatusCode - If the action type is block, this field defines the default customer overridable http response status code. 5620 DefaultCustomBlockResponseStatusCode *int32 `json:"defaultCustomBlockResponseStatusCode,omitempty"` 5621 // DefaultCustomBlockResponseBody - If the action type is block, customer can override the response body. The body must be specified in base64 encoding. 5622 DefaultCustomBlockResponseBody *string `json:"defaultCustomBlockResponseBody,omitempty"` 5623} 5624 5625// PostArgsMatchConditionParameters defines the parameters for PostArgs match conditions 5626type PostArgsMatchConditionParameters struct { 5627 OdataType *string `json:"@odata.type,omitempty"` 5628 // Selector - Name of PostArg to be matched 5629 Selector *string `json:"selector,omitempty"` 5630 // Operator - Describes operator to be matched. Possible values include: 'PostArgsOperatorAny', 'PostArgsOperatorEqual', 'PostArgsOperatorContains', 'PostArgsOperatorBeginsWith', 'PostArgsOperatorEndsWith', 'PostArgsOperatorLessThan', 'PostArgsOperatorLessThanOrEqual', 'PostArgsOperatorGreaterThan', 'PostArgsOperatorGreaterThanOrEqual' 5631 Operator PostArgsOperator `json:"operator,omitempty"` 5632 // NegateCondition - Describes if this is negate condition or not 5633 NegateCondition *bool `json:"negateCondition,omitempty"` 5634 // MatchValues - The match value for the condition of the delivery rule 5635 MatchValues *[]string `json:"matchValues,omitempty"` 5636 // Transforms - List of transforms 5637 Transforms *[]Transform `json:"transforms,omitempty"` 5638} 5639 5640// Profile CDN profile is a logical grouping of endpoints that share the same settings, such as CDN 5641// provider and pricing tier. 5642type Profile struct { 5643 autorest.Response `json:"-"` 5644 // Sku - The pricing tier (defines a CDN provider, feature list and rate) of the CDN profile. 5645 Sku *Sku `json:"sku,omitempty"` 5646 *ProfileProperties `json:"properties,omitempty"` 5647 // Location - Resource location. 5648 Location *string `json:"location,omitempty"` 5649 // Tags - Resource tags. 5650 Tags map[string]*string `json:"tags"` 5651 // ID - READ-ONLY; Resource ID. 5652 ID *string `json:"id,omitempty"` 5653 // Name - READ-ONLY; Resource name. 5654 Name *string `json:"name,omitempty"` 5655 // Type - READ-ONLY; Resource type. 5656 Type *string `json:"type,omitempty"` 5657} 5658 5659// MarshalJSON is the custom marshaler for Profile. 5660func (p Profile) MarshalJSON() ([]byte, error) { 5661 objectMap := make(map[string]interface{}) 5662 if p.Sku != nil { 5663 objectMap["sku"] = p.Sku 5664 } 5665 if p.ProfileProperties != nil { 5666 objectMap["properties"] = p.ProfileProperties 5667 } 5668 if p.Location != nil { 5669 objectMap["location"] = p.Location 5670 } 5671 if p.Tags != nil { 5672 objectMap["tags"] = p.Tags 5673 } 5674 return json.Marshal(objectMap) 5675} 5676 5677// UnmarshalJSON is the custom unmarshaler for Profile struct. 5678func (p *Profile) UnmarshalJSON(body []byte) error { 5679 var m map[string]*json.RawMessage 5680 err := json.Unmarshal(body, &m) 5681 if err != nil { 5682 return err 5683 } 5684 for k, v := range m { 5685 switch k { 5686 case "sku": 5687 if v != nil { 5688 var sku Sku 5689 err = json.Unmarshal(*v, &sku) 5690 if err != nil { 5691 return err 5692 } 5693 p.Sku = &sku 5694 } 5695 case "properties": 5696 if v != nil { 5697 var profileProperties ProfileProperties 5698 err = json.Unmarshal(*v, &profileProperties) 5699 if err != nil { 5700 return err 5701 } 5702 p.ProfileProperties = &profileProperties 5703 } 5704 case "location": 5705 if v != nil { 5706 var location string 5707 err = json.Unmarshal(*v, &location) 5708 if err != nil { 5709 return err 5710 } 5711 p.Location = &location 5712 } 5713 case "tags": 5714 if v != nil { 5715 var tags map[string]*string 5716 err = json.Unmarshal(*v, &tags) 5717 if err != nil { 5718 return err 5719 } 5720 p.Tags = tags 5721 } 5722 case "id": 5723 if v != nil { 5724 var ID string 5725 err = json.Unmarshal(*v, &ID) 5726 if err != nil { 5727 return err 5728 } 5729 p.ID = &ID 5730 } 5731 case "name": 5732 if v != nil { 5733 var name string 5734 err = json.Unmarshal(*v, &name) 5735 if err != nil { 5736 return err 5737 } 5738 p.Name = &name 5739 } 5740 case "type": 5741 if v != nil { 5742 var typeVar string 5743 err = json.Unmarshal(*v, &typeVar) 5744 if err != nil { 5745 return err 5746 } 5747 p.Type = &typeVar 5748 } 5749 } 5750 } 5751 5752 return nil 5753} 5754 5755// ProfileListResult result of the request to list profiles. It contains a list of profile objects and a 5756// URL link to get the next set of results. 5757type ProfileListResult struct { 5758 autorest.Response `json:"-"` 5759 // Value - READ-ONLY; List of CDN profiles within a resource group. 5760 Value *[]Profile `json:"value,omitempty"` 5761 // NextLink - URL to get the next set of profile objects if there are any. 5762 NextLink *string `json:"nextLink,omitempty"` 5763} 5764 5765// MarshalJSON is the custom marshaler for ProfileListResult. 5766func (plr ProfileListResult) MarshalJSON() ([]byte, error) { 5767 objectMap := make(map[string]interface{}) 5768 if plr.NextLink != nil { 5769 objectMap["nextLink"] = plr.NextLink 5770 } 5771 return json.Marshal(objectMap) 5772} 5773 5774// ProfileListResultIterator provides access to a complete listing of Profile values. 5775type ProfileListResultIterator struct { 5776 i int 5777 page ProfileListResultPage 5778} 5779 5780// NextWithContext advances to the next value. If there was an error making 5781// the request the iterator does not advance and the error is returned. 5782func (iter *ProfileListResultIterator) NextWithContext(ctx context.Context) (err error) { 5783 if tracing.IsEnabled() { 5784 ctx = tracing.StartSpan(ctx, fqdn+"/ProfileListResultIterator.NextWithContext") 5785 defer func() { 5786 sc := -1 5787 if iter.Response().Response.Response != nil { 5788 sc = iter.Response().Response.Response.StatusCode 5789 } 5790 tracing.EndSpan(ctx, sc, err) 5791 }() 5792 } 5793 iter.i++ 5794 if iter.i < len(iter.page.Values()) { 5795 return nil 5796 } 5797 err = iter.page.NextWithContext(ctx) 5798 if err != nil { 5799 iter.i-- 5800 return err 5801 } 5802 iter.i = 0 5803 return nil 5804} 5805 5806// Next advances to the next value. If there was an error making 5807// the request the iterator does not advance and the error is returned. 5808// Deprecated: Use NextWithContext() instead. 5809func (iter *ProfileListResultIterator) Next() error { 5810 return iter.NextWithContext(context.Background()) 5811} 5812 5813// NotDone returns true if the enumeration should be started or is not yet complete. 5814func (iter ProfileListResultIterator) NotDone() bool { 5815 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 5816} 5817 5818// Response returns the raw server response from the last page request. 5819func (iter ProfileListResultIterator) Response() ProfileListResult { 5820 return iter.page.Response() 5821} 5822 5823// Value returns the current value or a zero-initialized value if the 5824// iterator has advanced beyond the end of the collection. 5825func (iter ProfileListResultIterator) Value() Profile { 5826 if !iter.page.NotDone() { 5827 return Profile{} 5828 } 5829 return iter.page.Values()[iter.i] 5830} 5831 5832// Creates a new instance of the ProfileListResultIterator type. 5833func NewProfileListResultIterator(page ProfileListResultPage) ProfileListResultIterator { 5834 return ProfileListResultIterator{page: page} 5835} 5836 5837// IsEmpty returns true if the ListResult contains no values. 5838func (plr ProfileListResult) IsEmpty() bool { 5839 return plr.Value == nil || len(*plr.Value) == 0 5840} 5841 5842// hasNextLink returns true if the NextLink is not empty. 5843func (plr ProfileListResult) hasNextLink() bool { 5844 return plr.NextLink != nil && len(*plr.NextLink) != 0 5845} 5846 5847// profileListResultPreparer prepares a request to retrieve the next set of results. 5848// It returns nil if no more results exist. 5849func (plr ProfileListResult) profileListResultPreparer(ctx context.Context) (*http.Request, error) { 5850 if !plr.hasNextLink() { 5851 return nil, nil 5852 } 5853 return autorest.Prepare((&http.Request{}).WithContext(ctx), 5854 autorest.AsJSON(), 5855 autorest.AsGet(), 5856 autorest.WithBaseURL(to.String(plr.NextLink))) 5857} 5858 5859// ProfileListResultPage contains a page of Profile values. 5860type ProfileListResultPage struct { 5861 fn func(context.Context, ProfileListResult) (ProfileListResult, error) 5862 plr ProfileListResult 5863} 5864 5865// NextWithContext advances to the next page of values. If there was an error making 5866// the request the page does not advance and the error is returned. 5867func (page *ProfileListResultPage) NextWithContext(ctx context.Context) (err error) { 5868 if tracing.IsEnabled() { 5869 ctx = tracing.StartSpan(ctx, fqdn+"/ProfileListResultPage.NextWithContext") 5870 defer func() { 5871 sc := -1 5872 if page.Response().Response.Response != nil { 5873 sc = page.Response().Response.Response.StatusCode 5874 } 5875 tracing.EndSpan(ctx, sc, err) 5876 }() 5877 } 5878 for { 5879 next, err := page.fn(ctx, page.plr) 5880 if err != nil { 5881 return err 5882 } 5883 page.plr = next 5884 if !next.hasNextLink() || !next.IsEmpty() { 5885 break 5886 } 5887 } 5888 return nil 5889} 5890 5891// Next advances to the next page of values. If there was an error making 5892// the request the page does not advance and the error is returned. 5893// Deprecated: Use NextWithContext() instead. 5894func (page *ProfileListResultPage) Next() error { 5895 return page.NextWithContext(context.Background()) 5896} 5897 5898// NotDone returns true if the page enumeration should be started or is not yet complete. 5899func (page ProfileListResultPage) NotDone() bool { 5900 return !page.plr.IsEmpty() 5901} 5902 5903// Response returns the raw server response from the last page request. 5904func (page ProfileListResultPage) Response() ProfileListResult { 5905 return page.plr 5906} 5907 5908// Values returns the slice of values for the current page or nil if there are no values. 5909func (page ProfileListResultPage) Values() []Profile { 5910 if page.plr.IsEmpty() { 5911 return nil 5912 } 5913 return *page.plr.Value 5914} 5915 5916// Creates a new instance of the ProfileListResultPage type. 5917func NewProfileListResultPage(cur ProfileListResult, getNextPage func(context.Context, ProfileListResult) (ProfileListResult, error)) ProfileListResultPage { 5918 return ProfileListResultPage{ 5919 fn: getNextPage, 5920 plr: cur, 5921 } 5922} 5923 5924// ProfileProperties the JSON object that contains the properties required to create a profile. 5925type ProfileProperties struct { 5926 // ResourceState - READ-ONLY; Resource status of the profile. Possible values include: 'ProfileResourceStateCreating', 'ProfileResourceStateActive', 'ProfileResourceStateDeleting', 'ProfileResourceStateDisabled' 5927 ResourceState ProfileResourceState `json:"resourceState,omitempty"` 5928 // ProvisioningState - READ-ONLY; Provisioning status of the profile. 5929 ProvisioningState *string `json:"provisioningState,omitempty"` 5930} 5931 5932// MarshalJSON is the custom marshaler for ProfileProperties. 5933func (pp ProfileProperties) MarshalJSON() ([]byte, error) { 5934 objectMap := make(map[string]interface{}) 5935 return json.Marshal(objectMap) 5936} 5937 5938// ProfilesCreateFuture an abstraction for monitoring and retrieving the results of a long-running 5939// operation. 5940type ProfilesCreateFuture struct { 5941 azure.FutureAPI 5942 // Result returns the result of the asynchronous operation. 5943 // If the operation has not completed it will return an error. 5944 Result func(ProfilesClient) (Profile, error) 5945} 5946 5947// UnmarshalJSON is the custom unmarshaller for CreateFuture. 5948func (future *ProfilesCreateFuture) UnmarshalJSON(body []byte) error { 5949 var azFuture azure.Future 5950 if err := json.Unmarshal(body, &azFuture); err != nil { 5951 return err 5952 } 5953 future.FutureAPI = &azFuture 5954 future.Result = future.result 5955 return nil 5956} 5957 5958// result is the default implementation for ProfilesCreateFuture.Result. 5959func (future *ProfilesCreateFuture) result(client ProfilesClient) (p Profile, err error) { 5960 var done bool 5961 done, err = future.DoneWithContext(context.Background(), client) 5962 if err != nil { 5963 err = autorest.NewErrorWithError(err, "cdn.ProfilesCreateFuture", "Result", future.Response(), "Polling failure") 5964 return 5965 } 5966 if !done { 5967 p.Response.Response = future.Response() 5968 err = azure.NewAsyncOpIncompleteError("cdn.ProfilesCreateFuture") 5969 return 5970 } 5971 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 5972 if p.Response.Response, err = future.GetResult(sender); err == nil && p.Response.Response.StatusCode != http.StatusNoContent { 5973 p, err = client.CreateResponder(p.Response.Response) 5974 if err != nil { 5975 err = autorest.NewErrorWithError(err, "cdn.ProfilesCreateFuture", "Result", p.Response.Response, "Failure responding to request") 5976 } 5977 } 5978 return 5979} 5980 5981// ProfilesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running 5982// operation. 5983type ProfilesDeleteFuture struct { 5984 azure.FutureAPI 5985 // Result returns the result of the asynchronous operation. 5986 // If the operation has not completed it will return an error. 5987 Result func(ProfilesClient) (autorest.Response, error) 5988} 5989 5990// UnmarshalJSON is the custom unmarshaller for CreateFuture. 5991func (future *ProfilesDeleteFuture) UnmarshalJSON(body []byte) error { 5992 var azFuture azure.Future 5993 if err := json.Unmarshal(body, &azFuture); err != nil { 5994 return err 5995 } 5996 future.FutureAPI = &azFuture 5997 future.Result = future.result 5998 return nil 5999} 6000 6001// result is the default implementation for ProfilesDeleteFuture.Result. 6002func (future *ProfilesDeleteFuture) result(client ProfilesClient) (ar autorest.Response, err error) { 6003 var done bool 6004 done, err = future.DoneWithContext(context.Background(), client) 6005 if err != nil { 6006 err = autorest.NewErrorWithError(err, "cdn.ProfilesDeleteFuture", "Result", future.Response(), "Polling failure") 6007 return 6008 } 6009 if !done { 6010 ar.Response = future.Response() 6011 err = azure.NewAsyncOpIncompleteError("cdn.ProfilesDeleteFuture") 6012 return 6013 } 6014 ar.Response = future.Response() 6015 return 6016} 6017 6018// ProfilesUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 6019// operation. 6020type ProfilesUpdateFuture struct { 6021 azure.FutureAPI 6022 // Result returns the result of the asynchronous operation. 6023 // If the operation has not completed it will return an error. 6024 Result func(ProfilesClient) (Profile, error) 6025} 6026 6027// UnmarshalJSON is the custom unmarshaller for CreateFuture. 6028func (future *ProfilesUpdateFuture) UnmarshalJSON(body []byte) error { 6029 var azFuture azure.Future 6030 if err := json.Unmarshal(body, &azFuture); err != nil { 6031 return err 6032 } 6033 future.FutureAPI = &azFuture 6034 future.Result = future.result 6035 return nil 6036} 6037 6038// result is the default implementation for ProfilesUpdateFuture.Result. 6039func (future *ProfilesUpdateFuture) result(client ProfilesClient) (p Profile, err error) { 6040 var done bool 6041 done, err = future.DoneWithContext(context.Background(), client) 6042 if err != nil { 6043 err = autorest.NewErrorWithError(err, "cdn.ProfilesUpdateFuture", "Result", future.Response(), "Polling failure") 6044 return 6045 } 6046 if !done { 6047 p.Response.Response = future.Response() 6048 err = azure.NewAsyncOpIncompleteError("cdn.ProfilesUpdateFuture") 6049 return 6050 } 6051 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 6052 if p.Response.Response, err = future.GetResult(sender); err == nil && p.Response.Response.StatusCode != http.StatusNoContent { 6053 p, err = client.UpdateResponder(p.Response.Response) 6054 if err != nil { 6055 err = autorest.NewErrorWithError(err, "cdn.ProfilesUpdateFuture", "Result", p.Response.Response, "Failure responding to request") 6056 } 6057 } 6058 return 6059} 6060 6061// ProfileUpdateParameters properties required to update a profile. 6062type ProfileUpdateParameters struct { 6063 // Tags - Profile tags 6064 Tags map[string]*string `json:"tags"` 6065} 6066 6067// MarshalJSON is the custom marshaler for ProfileUpdateParameters. 6068func (pup ProfileUpdateParameters) MarshalJSON() ([]byte, error) { 6069 objectMap := make(map[string]interface{}) 6070 if pup.Tags != nil { 6071 objectMap["tags"] = pup.Tags 6072 } 6073 return json.Marshal(objectMap) 6074} 6075 6076// ProxyResource the resource model definition for a ARM proxy resource. It will have everything other than 6077// required location and tags 6078type ProxyResource struct { 6079 // ID - READ-ONLY; Resource ID. 6080 ID *string `json:"id,omitempty"` 6081 // Name - READ-ONLY; Resource name. 6082 Name *string `json:"name,omitempty"` 6083 // Type - READ-ONLY; Resource type. 6084 Type *string `json:"type,omitempty"` 6085} 6086 6087// MarshalJSON is the custom marshaler for ProxyResource. 6088func (pr ProxyResource) MarshalJSON() ([]byte, error) { 6089 objectMap := make(map[string]interface{}) 6090 return json.Marshal(objectMap) 6091} 6092 6093// PurgeParameters parameters required for content purge. 6094type PurgeParameters struct { 6095 // ContentPaths - The path to the content to be purged. Can describe a file path or a wild card directory. 6096 ContentPaths *[]string `json:"contentPaths,omitempty"` 6097} 6098 6099// QueryStringMatchConditionParameters defines the parameters for QueryString match conditions 6100type QueryStringMatchConditionParameters struct { 6101 OdataType *string `json:"@odata.type,omitempty"` 6102 // Operator - Describes operator to be matched. Possible values include: 'QueryStringOperatorAny', 'QueryStringOperatorEqual', 'QueryStringOperatorContains', 'QueryStringOperatorBeginsWith', 'QueryStringOperatorEndsWith', 'QueryStringOperatorLessThan', 'QueryStringOperatorLessThanOrEqual', 'QueryStringOperatorGreaterThan', 'QueryStringOperatorGreaterThanOrEqual' 6103 Operator QueryStringOperator `json:"operator,omitempty"` 6104 // NegateCondition - Describes if this is negate condition or not 6105 NegateCondition *bool `json:"negateCondition,omitempty"` 6106 // MatchValues - The match value for the condition of the delivery rule 6107 MatchValues *[]string `json:"matchValues,omitempty"` 6108 // Transforms - List of transforms 6109 Transforms *[]Transform `json:"transforms,omitempty"` 6110} 6111 6112// RateLimitRule defines a rate limiting rule that can be included in a waf policy 6113type RateLimitRule struct { 6114 // RateLimitThreshold - Defines rate limit threshold. 6115 RateLimitThreshold *int32 `json:"rateLimitThreshold,omitempty"` 6116 // RateLimitDurationInMinutes - Defines rate limit duration. Default is 1 minute. 6117 RateLimitDurationInMinutes *int32 `json:"rateLimitDurationInMinutes,omitempty"` 6118 // Name - Defines the name of the custom rule 6119 Name *string `json:"name,omitempty"` 6120 // EnabledState - Describes if the custom rule is in enabled or disabled state. Defaults to Enabled if not specified. Possible values include: 'CustomRuleEnabledStateDisabled', 'CustomRuleEnabledStateEnabled' 6121 EnabledState CustomRuleEnabledState `json:"enabledState,omitempty"` 6122 // Priority - Defines in what order this rule be evaluated in the overall list of custom rules 6123 Priority *int32 `json:"priority,omitempty"` 6124 // MatchConditions - List of match conditions. 6125 MatchConditions *[]MatchCondition `json:"matchConditions,omitempty"` 6126 // Action - Describes what action to be applied when rule matches. Possible values include: 'Allow', 'Block', 'Log', 'Redirect' 6127 Action ActionType `json:"action,omitempty"` 6128} 6129 6130// RateLimitRuleList defines contents of rate limit rules 6131type RateLimitRuleList struct { 6132 // Rules - List of rules 6133 Rules *[]RateLimitRule `json:"rules,omitempty"` 6134} 6135 6136// RemoteAddressMatchConditionParameters defines the parameters for RemoteAddress match conditions 6137type RemoteAddressMatchConditionParameters struct { 6138 OdataType *string `json:"@odata.type,omitempty"` 6139 // Operator - Describes operator to be matched. Possible values include: 'RemoteAddressOperatorAny', 'RemoteAddressOperatorIPMatch', 'RemoteAddressOperatorGeoMatch' 6140 Operator RemoteAddressOperator `json:"operator,omitempty"` 6141 // NegateCondition - Describes if this is negate condition or not 6142 NegateCondition *bool `json:"negateCondition,omitempty"` 6143 // MatchValues - Match values to match against. The operator will apply to each value in here with OR semantics. If any of them match the variable with the given operator this match condition is considered a match. 6144 MatchValues *[]string `json:"matchValues,omitempty"` 6145 // Transforms - List of transforms 6146 Transforms *[]Transform `json:"transforms,omitempty"` 6147} 6148 6149// RequestBodyMatchConditionParameters defines the parameters for RequestBody match conditions 6150type RequestBodyMatchConditionParameters struct { 6151 OdataType *string `json:"@odata.type,omitempty"` 6152 // Operator - Describes operator to be matched. Possible values include: 'RequestBodyOperatorAny', 'RequestBodyOperatorEqual', 'RequestBodyOperatorContains', 'RequestBodyOperatorBeginsWith', 'RequestBodyOperatorEndsWith', 'RequestBodyOperatorLessThan', 'RequestBodyOperatorLessThanOrEqual', 'RequestBodyOperatorGreaterThan', 'RequestBodyOperatorGreaterThanOrEqual' 6153 Operator RequestBodyOperator `json:"operator,omitempty"` 6154 // NegateCondition - Describes if this is negate condition or not 6155 NegateCondition *bool `json:"negateCondition,omitempty"` 6156 // MatchValues - The match value for the condition of the delivery rule 6157 MatchValues *[]string `json:"matchValues,omitempty"` 6158 // Transforms - List of transforms 6159 Transforms *[]Transform `json:"transforms,omitempty"` 6160} 6161 6162// RequestHeaderMatchConditionParameters defines the parameters for RequestHeader match conditions 6163type RequestHeaderMatchConditionParameters struct { 6164 OdataType *string `json:"@odata.type,omitempty"` 6165 // Selector - Name of Header to be matched 6166 Selector *string `json:"selector,omitempty"` 6167 // Operator - Describes operator to be matched. Possible values include: 'RequestHeaderOperatorAny', 'RequestHeaderOperatorEqual', 'RequestHeaderOperatorContains', 'RequestHeaderOperatorBeginsWith', 'RequestHeaderOperatorEndsWith', 'RequestHeaderOperatorLessThan', 'RequestHeaderOperatorLessThanOrEqual', 'RequestHeaderOperatorGreaterThan', 'RequestHeaderOperatorGreaterThanOrEqual' 6168 Operator RequestHeaderOperator `json:"operator,omitempty"` 6169 // NegateCondition - Describes if this is negate condition or not 6170 NegateCondition *bool `json:"negateCondition,omitempty"` 6171 // MatchValues - The match value for the condition of the delivery rule 6172 MatchValues *[]string `json:"matchValues,omitempty"` 6173 // Transforms - List of transforms 6174 Transforms *[]Transform `json:"transforms,omitempty"` 6175} 6176 6177// RequestMethodMatchConditionParameters defines the parameters for RequestMethod match conditions 6178type RequestMethodMatchConditionParameters struct { 6179 OdataType *string `json:"@odata.type,omitempty"` 6180 // Operator - Describes operator to be matched 6181 Operator *string `json:"operator,omitempty"` 6182 // NegateCondition - Describes if this is negate condition or not 6183 NegateCondition *bool `json:"negateCondition,omitempty"` 6184 // MatchValues - The match value for the condition of the delivery rule 6185 MatchValues *[]string `json:"matchValues,omitempty"` 6186} 6187 6188// RequestSchemeMatchConditionParameters defines the parameters for RequestScheme match conditions 6189type RequestSchemeMatchConditionParameters struct { 6190 OdataType *string `json:"@odata.type,omitempty"` 6191 // Operator - Describes operator to be matched 6192 Operator *string `json:"operator,omitempty"` 6193 // NegateCondition - Describes if this is negate condition or not 6194 NegateCondition *bool `json:"negateCondition,omitempty"` 6195 // MatchValues - The match value for the condition of the delivery rule 6196 MatchValues *[]string `json:"matchValues,omitempty"` 6197} 6198 6199// RequestURIMatchConditionParameters defines the parameters for RequestUri match conditions 6200type RequestURIMatchConditionParameters struct { 6201 OdataType *string `json:"@odata.type,omitempty"` 6202 // Operator - Describes operator to be matched. Possible values include: 'RequestURIOperatorAny', 'RequestURIOperatorEqual', 'RequestURIOperatorContains', 'RequestURIOperatorBeginsWith', 'RequestURIOperatorEndsWith', 'RequestURIOperatorLessThan', 'RequestURIOperatorLessThanOrEqual', 'RequestURIOperatorGreaterThan', 'RequestURIOperatorGreaterThanOrEqual' 6203 Operator RequestURIOperator `json:"operator,omitempty"` 6204 // NegateCondition - Describes if this is negate condition or not 6205 NegateCondition *bool `json:"negateCondition,omitempty"` 6206 // MatchValues - The match value for the condition of the delivery rule 6207 MatchValues *[]string `json:"matchValues,omitempty"` 6208 // Transforms - List of transforms 6209 Transforms *[]Transform `json:"transforms,omitempty"` 6210} 6211 6212// Resource the core properties of ARM resources 6213type Resource struct { 6214 // ID - READ-ONLY; Resource ID. 6215 ID *string `json:"id,omitempty"` 6216 // Name - READ-ONLY; Resource name. 6217 Name *string `json:"name,omitempty"` 6218 // Type - READ-ONLY; Resource type. 6219 Type *string `json:"type,omitempty"` 6220} 6221 6222// MarshalJSON is the custom marshaler for Resource. 6223func (r Resource) MarshalJSON() ([]byte, error) { 6224 objectMap := make(map[string]interface{}) 6225 return json.Marshal(objectMap) 6226} 6227 6228// ResourceReference reference to another resource. 6229type ResourceReference struct { 6230 // ID - Resource ID. 6231 ID *string `json:"id,omitempty"` 6232} 6233 6234// ResourceUsage output of check resource usage API. 6235type ResourceUsage struct { 6236 // ResourceType - READ-ONLY; Resource type for which the usage is provided. 6237 ResourceType *string `json:"resourceType,omitempty"` 6238 // Unit - READ-ONLY; Unit of the usage. e.g. Count. 6239 Unit *string `json:"unit,omitempty"` 6240 // CurrentValue - READ-ONLY; Actual value of usage on the specified resource type. 6241 CurrentValue *int32 `json:"currentValue,omitempty"` 6242 // Limit - READ-ONLY; Quota of the specified resource type. 6243 Limit *int32 `json:"limit,omitempty"` 6244} 6245 6246// MarshalJSON is the custom marshaler for ResourceUsage. 6247func (ru ResourceUsage) MarshalJSON() ([]byte, error) { 6248 objectMap := make(map[string]interface{}) 6249 return json.Marshal(objectMap) 6250} 6251 6252// ResourceUsageListResult output of check resource usage API. 6253type ResourceUsageListResult struct { 6254 autorest.Response `json:"-"` 6255 // Value - READ-ONLY; List of resource usages. 6256 Value *[]ResourceUsage `json:"value,omitempty"` 6257 // NextLink - URL to get the next set of custom domain objects if there are any. 6258 NextLink *string `json:"nextLink,omitempty"` 6259} 6260 6261// MarshalJSON is the custom marshaler for ResourceUsageListResult. 6262func (rulr ResourceUsageListResult) MarshalJSON() ([]byte, error) { 6263 objectMap := make(map[string]interface{}) 6264 if rulr.NextLink != nil { 6265 objectMap["nextLink"] = rulr.NextLink 6266 } 6267 return json.Marshal(objectMap) 6268} 6269 6270// ResourceUsageListResultIterator provides access to a complete listing of ResourceUsage values. 6271type ResourceUsageListResultIterator struct { 6272 i int 6273 page ResourceUsageListResultPage 6274} 6275 6276// NextWithContext advances to the next value. If there was an error making 6277// the request the iterator does not advance and the error is returned. 6278func (iter *ResourceUsageListResultIterator) NextWithContext(ctx context.Context) (err error) { 6279 if tracing.IsEnabled() { 6280 ctx = tracing.StartSpan(ctx, fqdn+"/ResourceUsageListResultIterator.NextWithContext") 6281 defer func() { 6282 sc := -1 6283 if iter.Response().Response.Response != nil { 6284 sc = iter.Response().Response.Response.StatusCode 6285 } 6286 tracing.EndSpan(ctx, sc, err) 6287 }() 6288 } 6289 iter.i++ 6290 if iter.i < len(iter.page.Values()) { 6291 return nil 6292 } 6293 err = iter.page.NextWithContext(ctx) 6294 if err != nil { 6295 iter.i-- 6296 return err 6297 } 6298 iter.i = 0 6299 return nil 6300} 6301 6302// Next advances to the next value. If there was an error making 6303// the request the iterator does not advance and the error is returned. 6304// Deprecated: Use NextWithContext() instead. 6305func (iter *ResourceUsageListResultIterator) Next() error { 6306 return iter.NextWithContext(context.Background()) 6307} 6308 6309// NotDone returns true if the enumeration should be started or is not yet complete. 6310func (iter ResourceUsageListResultIterator) NotDone() bool { 6311 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 6312} 6313 6314// Response returns the raw server response from the last page request. 6315func (iter ResourceUsageListResultIterator) Response() ResourceUsageListResult { 6316 return iter.page.Response() 6317} 6318 6319// Value returns the current value or a zero-initialized value if the 6320// iterator has advanced beyond the end of the collection. 6321func (iter ResourceUsageListResultIterator) Value() ResourceUsage { 6322 if !iter.page.NotDone() { 6323 return ResourceUsage{} 6324 } 6325 return iter.page.Values()[iter.i] 6326} 6327 6328// Creates a new instance of the ResourceUsageListResultIterator type. 6329func NewResourceUsageListResultIterator(page ResourceUsageListResultPage) ResourceUsageListResultIterator { 6330 return ResourceUsageListResultIterator{page: page} 6331} 6332 6333// IsEmpty returns true if the ListResult contains no values. 6334func (rulr ResourceUsageListResult) IsEmpty() bool { 6335 return rulr.Value == nil || len(*rulr.Value) == 0 6336} 6337 6338// hasNextLink returns true if the NextLink is not empty. 6339func (rulr ResourceUsageListResult) hasNextLink() bool { 6340 return rulr.NextLink != nil && len(*rulr.NextLink) != 0 6341} 6342 6343// resourceUsageListResultPreparer prepares a request to retrieve the next set of results. 6344// It returns nil if no more results exist. 6345func (rulr ResourceUsageListResult) resourceUsageListResultPreparer(ctx context.Context) (*http.Request, error) { 6346 if !rulr.hasNextLink() { 6347 return nil, nil 6348 } 6349 return autorest.Prepare((&http.Request{}).WithContext(ctx), 6350 autorest.AsJSON(), 6351 autorest.AsGet(), 6352 autorest.WithBaseURL(to.String(rulr.NextLink))) 6353} 6354 6355// ResourceUsageListResultPage contains a page of ResourceUsage values. 6356type ResourceUsageListResultPage struct { 6357 fn func(context.Context, ResourceUsageListResult) (ResourceUsageListResult, error) 6358 rulr ResourceUsageListResult 6359} 6360 6361// NextWithContext advances to the next page of values. If there was an error making 6362// the request the page does not advance and the error is returned. 6363func (page *ResourceUsageListResultPage) NextWithContext(ctx context.Context) (err error) { 6364 if tracing.IsEnabled() { 6365 ctx = tracing.StartSpan(ctx, fqdn+"/ResourceUsageListResultPage.NextWithContext") 6366 defer func() { 6367 sc := -1 6368 if page.Response().Response.Response != nil { 6369 sc = page.Response().Response.Response.StatusCode 6370 } 6371 tracing.EndSpan(ctx, sc, err) 6372 }() 6373 } 6374 for { 6375 next, err := page.fn(ctx, page.rulr) 6376 if err != nil { 6377 return err 6378 } 6379 page.rulr = next 6380 if !next.hasNextLink() || !next.IsEmpty() { 6381 break 6382 } 6383 } 6384 return nil 6385} 6386 6387// Next advances to the next page of values. If there was an error making 6388// the request the page does not advance and the error is returned. 6389// Deprecated: Use NextWithContext() instead. 6390func (page *ResourceUsageListResultPage) Next() error { 6391 return page.NextWithContext(context.Background()) 6392} 6393 6394// NotDone returns true if the page enumeration should be started or is not yet complete. 6395func (page ResourceUsageListResultPage) NotDone() bool { 6396 return !page.rulr.IsEmpty() 6397} 6398 6399// Response returns the raw server response from the last page request. 6400func (page ResourceUsageListResultPage) Response() ResourceUsageListResult { 6401 return page.rulr 6402} 6403 6404// Values returns the slice of values for the current page or nil if there are no values. 6405func (page ResourceUsageListResultPage) Values() []ResourceUsage { 6406 if page.rulr.IsEmpty() { 6407 return nil 6408 } 6409 return *page.rulr.Value 6410} 6411 6412// Creates a new instance of the ResourceUsageListResultPage type. 6413func NewResourceUsageListResultPage(cur ResourceUsageListResult, getNextPage func(context.Context, ResourceUsageListResult) (ResourceUsageListResult, error)) ResourceUsageListResultPage { 6414 return ResourceUsageListResultPage{ 6415 fn: getNextPage, 6416 rulr: cur, 6417 } 6418} 6419 6420// ResponseBasedOriginErrorDetectionParameters the JSON object that contains the properties to determine 6421// origin health using real requests/responses. 6422type ResponseBasedOriginErrorDetectionParameters struct { 6423 // ResponseBasedDetectedErrorTypes - Type of response errors for real user requests for which origin will be deemed unhealthy. Possible values include: 'ResponseBasedDetectedErrorTypesNone', 'ResponseBasedDetectedErrorTypesTCPErrorsOnly', 'ResponseBasedDetectedErrorTypesTCPAndHTTPErrors' 6424 ResponseBasedDetectedErrorTypes ResponseBasedDetectedErrorTypes `json:"responseBasedDetectedErrorTypes,omitempty"` 6425 // ResponseBasedFailoverThresholdPercentage - The percentage of failed requests in the sample where failover should trigger. 6426 ResponseBasedFailoverThresholdPercentage *int32 `json:"responseBasedFailoverThresholdPercentage,omitempty"` 6427 // HTTPErrorRanges - The list of Http status code ranges that are considered as server errors for origin and it is marked as unhealthy. 6428 HTTPErrorRanges *[]HTTPErrorRangeParameters `json:"httpErrorRanges,omitempty"` 6429} 6430 6431// Sku the pricing tier (defines a CDN provider, feature list and rate) of the CDN profile. 6432type Sku struct { 6433 // Name - Name of the pricing tier. Possible values include: 'StandardVerizon', 'PremiumVerizon', 'CustomVerizon', 'StandardAkamai', 'StandardChinaCdn', 'StandardMicrosoft', 'PremiumChinaCdn' 6434 Name SkuName `json:"name,omitempty"` 6435} 6436 6437// SsoURI the URI required to login to the supplemental portal from the Azure portal. 6438type SsoURI struct { 6439 autorest.Response `json:"-"` 6440 // SsoURIValue - READ-ONLY; The URI used to login to the supplemental portal. 6441 SsoURIValue *string `json:"ssoUriValue,omitempty"` 6442} 6443 6444// MarshalJSON is the custom marshaler for SsoURI. 6445func (su SsoURI) MarshalJSON() ([]byte, error) { 6446 objectMap := make(map[string]interface{}) 6447 return json.Marshal(objectMap) 6448} 6449 6450// SupportedOptimizationTypesListResult the result of the GetSupportedOptimizationTypes API 6451type SupportedOptimizationTypesListResult struct { 6452 autorest.Response `json:"-"` 6453 // SupportedOptimizationTypes - READ-ONLY; Supported optimization types for a profile. 6454 SupportedOptimizationTypes *[]OptimizationType `json:"supportedOptimizationTypes,omitempty"` 6455} 6456 6457// MarshalJSON is the custom marshaler for SupportedOptimizationTypesListResult. 6458func (sotlr SupportedOptimizationTypesListResult) MarshalJSON() ([]byte, error) { 6459 objectMap := make(map[string]interface{}) 6460 return json.Marshal(objectMap) 6461} 6462 6463// TrackedResource the resource model definition for a ARM tracked top level resource. 6464type TrackedResource struct { 6465 // Location - Resource location. 6466 Location *string `json:"location,omitempty"` 6467 // Tags - Resource tags. 6468 Tags map[string]*string `json:"tags"` 6469 // ID - READ-ONLY; Resource ID. 6470 ID *string `json:"id,omitempty"` 6471 // Name - READ-ONLY; Resource name. 6472 Name *string `json:"name,omitempty"` 6473 // Type - READ-ONLY; Resource type. 6474 Type *string `json:"type,omitempty"` 6475} 6476 6477// MarshalJSON is the custom marshaler for TrackedResource. 6478func (tr TrackedResource) MarshalJSON() ([]byte, error) { 6479 objectMap := make(map[string]interface{}) 6480 if tr.Location != nil { 6481 objectMap["location"] = tr.Location 6482 } 6483 if tr.Tags != nil { 6484 objectMap["tags"] = tr.Tags 6485 } 6486 return json.Marshal(objectMap) 6487} 6488 6489// URLFileExtensionMatchConditionParameters defines the parameters for UrlFileExtension match conditions 6490type URLFileExtensionMatchConditionParameters struct { 6491 OdataType *string `json:"@odata.type,omitempty"` 6492 // Operator - Describes operator to be matched. Possible values include: 'URLFileExtensionOperatorAny', 'URLFileExtensionOperatorEqual', 'URLFileExtensionOperatorContains', 'URLFileExtensionOperatorBeginsWith', 'URLFileExtensionOperatorEndsWith', 'URLFileExtensionOperatorLessThan', 'URLFileExtensionOperatorLessThanOrEqual', 'URLFileExtensionOperatorGreaterThan', 'URLFileExtensionOperatorGreaterThanOrEqual' 6493 Operator URLFileExtensionOperator `json:"operator,omitempty"` 6494 // NegateCondition - Describes if this is negate condition or not 6495 NegateCondition *bool `json:"negateCondition,omitempty"` 6496 // MatchValues - The match value for the condition of the delivery rule 6497 MatchValues *[]string `json:"matchValues,omitempty"` 6498 // Transforms - List of transforms 6499 Transforms *[]Transform `json:"transforms,omitempty"` 6500} 6501 6502// URLFileNameMatchConditionParameters defines the parameters for UrlFilename match conditions 6503type URLFileNameMatchConditionParameters struct { 6504 OdataType *string `json:"@odata.type,omitempty"` 6505 // Operator - Describes operator to be matched. Possible values include: 'URLFileNameOperatorAny', 'URLFileNameOperatorEqual', 'URLFileNameOperatorContains', 'URLFileNameOperatorBeginsWith', 'URLFileNameOperatorEndsWith', 'URLFileNameOperatorLessThan', 'URLFileNameOperatorLessThanOrEqual', 'URLFileNameOperatorGreaterThan', 'URLFileNameOperatorGreaterThanOrEqual' 6506 Operator URLFileNameOperator `json:"operator,omitempty"` 6507 // NegateCondition - Describes if this is negate condition or not 6508 NegateCondition *bool `json:"negateCondition,omitempty"` 6509 // MatchValues - The match value for the condition of the delivery rule 6510 MatchValues *[]string `json:"matchValues,omitempty"` 6511 // Transforms - List of transforms 6512 Transforms *[]Transform `json:"transforms,omitempty"` 6513} 6514 6515// URLPathMatchConditionParameters defines the parameters for UrlPath match conditions 6516type URLPathMatchConditionParameters struct { 6517 OdataType *string `json:"@odata.type,omitempty"` 6518 // Operator - Describes operator to be matched. Possible values include: 'URLPathOperatorAny', 'URLPathOperatorEqual', 'URLPathOperatorContains', 'URLPathOperatorBeginsWith', 'URLPathOperatorEndsWith', 'URLPathOperatorLessThan', 'URLPathOperatorLessThanOrEqual', 'URLPathOperatorGreaterThan', 'URLPathOperatorGreaterThanOrEqual', 'URLPathOperatorWildcard' 6519 Operator URLPathOperator `json:"operator,omitempty"` 6520 // NegateCondition - Describes if this is negate condition or not 6521 NegateCondition *bool `json:"negateCondition,omitempty"` 6522 // MatchValues - The match value for the condition of the delivery rule 6523 MatchValues *[]string `json:"matchValues,omitempty"` 6524 // Transforms - List of transforms 6525 Transforms *[]Transform `json:"transforms,omitempty"` 6526} 6527 6528// URLRedirectAction defines the url redirect action for the delivery rule. 6529type URLRedirectAction struct { 6530 // Parameters - Defines the parameters for the action. 6531 Parameters *URLRedirectActionParameters `json:"parameters,omitempty"` 6532 // Name - Possible values include: 'NameDeliveryRuleAction', 'NameURLRedirect', 'NameURLSigning', 'NameURLRewrite', 'NameModifyRequestHeader', 'NameModifyResponseHeader', 'NameCacheExpiration', 'NameCacheKeyQueryString' 6533 Name NameBasicDeliveryRuleAction `json:"name,omitempty"` 6534} 6535 6536// MarshalJSON is the custom marshaler for URLRedirectAction. 6537func (ura URLRedirectAction) MarshalJSON() ([]byte, error) { 6538 ura.Name = NameURLRedirect 6539 objectMap := make(map[string]interface{}) 6540 if ura.Parameters != nil { 6541 objectMap["parameters"] = ura.Parameters 6542 } 6543 if ura.Name != "" { 6544 objectMap["name"] = ura.Name 6545 } 6546 return json.Marshal(objectMap) 6547} 6548 6549// AsURLRedirectAction is the BasicDeliveryRuleAction implementation for URLRedirectAction. 6550func (ura URLRedirectAction) AsURLRedirectAction() (*URLRedirectAction, bool) { 6551 return &ura, true 6552} 6553 6554// AsURLSigningAction is the BasicDeliveryRuleAction implementation for URLRedirectAction. 6555func (ura URLRedirectAction) AsURLSigningAction() (*URLSigningAction, bool) { 6556 return nil, false 6557} 6558 6559// AsURLRewriteAction is the BasicDeliveryRuleAction implementation for URLRedirectAction. 6560func (ura URLRedirectAction) AsURLRewriteAction() (*URLRewriteAction, bool) { 6561 return nil, false 6562} 6563 6564// AsDeliveryRuleRequestHeaderAction is the BasicDeliveryRuleAction implementation for URLRedirectAction. 6565func (ura URLRedirectAction) AsDeliveryRuleRequestHeaderAction() (*DeliveryRuleRequestHeaderAction, bool) { 6566 return nil, false 6567} 6568 6569// AsDeliveryRuleResponseHeaderAction is the BasicDeliveryRuleAction implementation for URLRedirectAction. 6570func (ura URLRedirectAction) AsDeliveryRuleResponseHeaderAction() (*DeliveryRuleResponseHeaderAction, bool) { 6571 return nil, false 6572} 6573 6574// AsDeliveryRuleCacheExpirationAction is the BasicDeliveryRuleAction implementation for URLRedirectAction. 6575func (ura URLRedirectAction) AsDeliveryRuleCacheExpirationAction() (*DeliveryRuleCacheExpirationAction, bool) { 6576 return nil, false 6577} 6578 6579// AsDeliveryRuleCacheKeyQueryStringAction is the BasicDeliveryRuleAction implementation for URLRedirectAction. 6580func (ura URLRedirectAction) AsDeliveryRuleCacheKeyQueryStringAction() (*DeliveryRuleCacheKeyQueryStringAction, bool) { 6581 return nil, false 6582} 6583 6584// AsDeliveryRuleAction is the BasicDeliveryRuleAction implementation for URLRedirectAction. 6585func (ura URLRedirectAction) AsDeliveryRuleAction() (*DeliveryRuleAction, bool) { 6586 return nil, false 6587} 6588 6589// AsBasicDeliveryRuleAction is the BasicDeliveryRuleAction implementation for URLRedirectAction. 6590func (ura URLRedirectAction) AsBasicDeliveryRuleAction() (BasicDeliveryRuleAction, bool) { 6591 return &ura, true 6592} 6593 6594// URLRedirectActionParameters defines the parameters for the url redirect action. 6595type URLRedirectActionParameters struct { 6596 OdataType *string `json:"@odata.type,omitempty"` 6597 // RedirectType - The redirect type the rule will use when redirecting traffic. Possible values include: 'Moved', 'Found', 'TemporaryRedirect', 'PermanentRedirect' 6598 RedirectType RedirectType `json:"redirectType,omitempty"` 6599 // DestinationProtocol - Protocol to use for the redirect. The default value is MatchRequest. Possible values include: 'MatchRequest', 'HTTP', 'HTTPS' 6600 DestinationProtocol DestinationProtocol `json:"destinationProtocol,omitempty"` 6601 // CustomPath - The full path to redirect. Path cannot be empty and must start with /. Leave empty to use the incoming path as destination path. 6602 CustomPath *string `json:"customPath,omitempty"` 6603 // CustomHostname - Host to redirect. Leave empty to use the incoming host as the destination host. 6604 CustomHostname *string `json:"customHostname,omitempty"` 6605 // CustomQueryString - The set of query strings to be placed in the redirect URL. Setting this value would replace any existing query string; leave empty to preserve the incoming query string. Query string must be in <key>=<value> format. ? and & will be added automatically so do not include them. 6606 CustomQueryString *string `json:"customQueryString,omitempty"` 6607 // CustomFragment - Fragment to add to the redirect URL. Fragment is the part of the URL that comes after #. Do not include the #. 6608 CustomFragment *string `json:"customFragment,omitempty"` 6609} 6610 6611// URLRewriteAction defines the url rewrite action for the delivery rule. 6612type URLRewriteAction struct { 6613 // Parameters - Defines the parameters for the action. 6614 Parameters *URLRewriteActionParameters `json:"parameters,omitempty"` 6615 // Name - Possible values include: 'NameDeliveryRuleAction', 'NameURLRedirect', 'NameURLSigning', 'NameURLRewrite', 'NameModifyRequestHeader', 'NameModifyResponseHeader', 'NameCacheExpiration', 'NameCacheKeyQueryString' 6616 Name NameBasicDeliveryRuleAction `json:"name,omitempty"` 6617} 6618 6619// MarshalJSON is the custom marshaler for URLRewriteAction. 6620func (ura URLRewriteAction) MarshalJSON() ([]byte, error) { 6621 ura.Name = NameURLRewrite 6622 objectMap := make(map[string]interface{}) 6623 if ura.Parameters != nil { 6624 objectMap["parameters"] = ura.Parameters 6625 } 6626 if ura.Name != "" { 6627 objectMap["name"] = ura.Name 6628 } 6629 return json.Marshal(objectMap) 6630} 6631 6632// AsURLRedirectAction is the BasicDeliveryRuleAction implementation for URLRewriteAction. 6633func (ura URLRewriteAction) AsURLRedirectAction() (*URLRedirectAction, bool) { 6634 return nil, false 6635} 6636 6637// AsURLSigningAction is the BasicDeliveryRuleAction implementation for URLRewriteAction. 6638func (ura URLRewriteAction) AsURLSigningAction() (*URLSigningAction, bool) { 6639 return nil, false 6640} 6641 6642// AsURLRewriteAction is the BasicDeliveryRuleAction implementation for URLRewriteAction. 6643func (ura URLRewriteAction) AsURLRewriteAction() (*URLRewriteAction, bool) { 6644 return &ura, true 6645} 6646 6647// AsDeliveryRuleRequestHeaderAction is the BasicDeliveryRuleAction implementation for URLRewriteAction. 6648func (ura URLRewriteAction) AsDeliveryRuleRequestHeaderAction() (*DeliveryRuleRequestHeaderAction, bool) { 6649 return nil, false 6650} 6651 6652// AsDeliveryRuleResponseHeaderAction is the BasicDeliveryRuleAction implementation for URLRewriteAction. 6653func (ura URLRewriteAction) AsDeliveryRuleResponseHeaderAction() (*DeliveryRuleResponseHeaderAction, bool) { 6654 return nil, false 6655} 6656 6657// AsDeliveryRuleCacheExpirationAction is the BasicDeliveryRuleAction implementation for URLRewriteAction. 6658func (ura URLRewriteAction) AsDeliveryRuleCacheExpirationAction() (*DeliveryRuleCacheExpirationAction, bool) { 6659 return nil, false 6660} 6661 6662// AsDeliveryRuleCacheKeyQueryStringAction is the BasicDeliveryRuleAction implementation for URLRewriteAction. 6663func (ura URLRewriteAction) AsDeliveryRuleCacheKeyQueryStringAction() (*DeliveryRuleCacheKeyQueryStringAction, bool) { 6664 return nil, false 6665} 6666 6667// AsDeliveryRuleAction is the BasicDeliveryRuleAction implementation for URLRewriteAction. 6668func (ura URLRewriteAction) AsDeliveryRuleAction() (*DeliveryRuleAction, bool) { 6669 return nil, false 6670} 6671 6672// AsBasicDeliveryRuleAction is the BasicDeliveryRuleAction implementation for URLRewriteAction. 6673func (ura URLRewriteAction) AsBasicDeliveryRuleAction() (BasicDeliveryRuleAction, bool) { 6674 return &ura, true 6675} 6676 6677// URLRewriteActionParameters defines the parameters for the url rewrite action. 6678type URLRewriteActionParameters struct { 6679 OdataType *string `json:"@odata.type,omitempty"` 6680 // SourcePattern - define a request URI pattern that identifies the type of requests that may be rewritten. If value is blank, all strings are matched. 6681 SourcePattern *string `json:"sourcePattern,omitempty"` 6682 // Destination - Define the relative URL to which the above requests will be rewritten by. 6683 Destination *string `json:"destination,omitempty"` 6684 // PreserveUnmatchedPath - Whether to preserve unmatched path. Default value is true. 6685 PreserveUnmatchedPath *bool `json:"preserveUnmatchedPath,omitempty"` 6686} 6687 6688// URLSigningAction defines the url signing action for the delivery rule. 6689type URLSigningAction struct { 6690 // Parameters - Defines the parameters for the action. 6691 Parameters *URLSigningActionParameters `json:"parameters,omitempty"` 6692 // Name - Possible values include: 'NameDeliveryRuleAction', 'NameURLRedirect', 'NameURLSigning', 'NameURLRewrite', 'NameModifyRequestHeader', 'NameModifyResponseHeader', 'NameCacheExpiration', 'NameCacheKeyQueryString' 6693 Name NameBasicDeliveryRuleAction `json:"name,omitempty"` 6694} 6695 6696// MarshalJSON is the custom marshaler for URLSigningAction. 6697func (usa URLSigningAction) MarshalJSON() ([]byte, error) { 6698 usa.Name = NameURLSigning 6699 objectMap := make(map[string]interface{}) 6700 if usa.Parameters != nil { 6701 objectMap["parameters"] = usa.Parameters 6702 } 6703 if usa.Name != "" { 6704 objectMap["name"] = usa.Name 6705 } 6706 return json.Marshal(objectMap) 6707} 6708 6709// AsURLRedirectAction is the BasicDeliveryRuleAction implementation for URLSigningAction. 6710func (usa URLSigningAction) AsURLRedirectAction() (*URLRedirectAction, bool) { 6711 return nil, false 6712} 6713 6714// AsURLSigningAction is the BasicDeliveryRuleAction implementation for URLSigningAction. 6715func (usa URLSigningAction) AsURLSigningAction() (*URLSigningAction, bool) { 6716 return &usa, true 6717} 6718 6719// AsURLRewriteAction is the BasicDeliveryRuleAction implementation for URLSigningAction. 6720func (usa URLSigningAction) AsURLRewriteAction() (*URLRewriteAction, bool) { 6721 return nil, false 6722} 6723 6724// AsDeliveryRuleRequestHeaderAction is the BasicDeliveryRuleAction implementation for URLSigningAction. 6725func (usa URLSigningAction) AsDeliveryRuleRequestHeaderAction() (*DeliveryRuleRequestHeaderAction, bool) { 6726 return nil, false 6727} 6728 6729// AsDeliveryRuleResponseHeaderAction is the BasicDeliveryRuleAction implementation for URLSigningAction. 6730func (usa URLSigningAction) AsDeliveryRuleResponseHeaderAction() (*DeliveryRuleResponseHeaderAction, bool) { 6731 return nil, false 6732} 6733 6734// AsDeliveryRuleCacheExpirationAction is the BasicDeliveryRuleAction implementation for URLSigningAction. 6735func (usa URLSigningAction) AsDeliveryRuleCacheExpirationAction() (*DeliveryRuleCacheExpirationAction, bool) { 6736 return nil, false 6737} 6738 6739// AsDeliveryRuleCacheKeyQueryStringAction is the BasicDeliveryRuleAction implementation for URLSigningAction. 6740func (usa URLSigningAction) AsDeliveryRuleCacheKeyQueryStringAction() (*DeliveryRuleCacheKeyQueryStringAction, bool) { 6741 return nil, false 6742} 6743 6744// AsDeliveryRuleAction is the BasicDeliveryRuleAction implementation for URLSigningAction. 6745func (usa URLSigningAction) AsDeliveryRuleAction() (*DeliveryRuleAction, bool) { 6746 return nil, false 6747} 6748 6749// AsBasicDeliveryRuleAction is the BasicDeliveryRuleAction implementation for URLSigningAction. 6750func (usa URLSigningAction) AsBasicDeliveryRuleAction() (BasicDeliveryRuleAction, bool) { 6751 return &usa, true 6752} 6753 6754// URLSigningActionParameters defines the parameters for the Url Signing action. 6755type URLSigningActionParameters struct { 6756 // OdataType - Possible values include: 'MicrosoftAzureCdnModelsDeliveryRuleURLSigningActionParameters' 6757 OdataType OdataType `json:"@odata.type,omitempty"` 6758 // KeyID - Id reference of the key to be used to verify the hash and should be defined in UrlSigningKeys 6759 KeyID *string `json:"keyId,omitempty"` 6760 // Algorithm - Algorithm to use for URL signing. Possible values include: 'SHA256' 6761 Algorithm Algorithm `json:"algorithm,omitempty"` 6762 // ParameterNameOverride - Defines which query string parameters in the url to be considered for expires, key id etc. 6763 ParameterNameOverride *[]URLSigningParamIdentifier `json:"parameterNameOverride,omitempty"` 6764 // IPSubnets - Match values to match against. Supports CIDR ranges (both IPv4 and IPv6). 6765 IPSubnets *[]string `json:"ipSubnets,omitempty"` 6766} 6767 6768// URLSigningKey url signing key 6769type URLSigningKey struct { 6770 // KeyID - Defines the customer defined key Id. This id will exist in the incoming request to indicate the key used to form the hash. 6771 KeyID *string `json:"keyId,omitempty"` 6772 // KeySourceParameters - Defines the parameters for using customer key vault for Url Signing Key. 6773 KeySourceParameters *KeyVaultSigningKeyParameters `json:"keySourceParameters,omitempty"` 6774} 6775 6776// URLSigningParamIdentifier defines how to identify a parameter for a specific purpose e.g. expires 6777type URLSigningParamIdentifier struct { 6778 // ParamIndicator - Indicates the purpose of the parameter. Possible values include: 'Expires', 'KeyID', 'Signature' 6779 ParamIndicator ParamIndicator `json:"paramIndicator,omitempty"` 6780 // ParamName - Parameter name 6781 ParamName *string `json:"paramName,omitempty"` 6782} 6783 6784// UserManagedHTTPSParameters defines the certificate source parameters using user's keyvault certificate 6785// for enabling SSL. 6786type UserManagedHTTPSParameters struct { 6787 // CertificateSourceParameters - Defines the certificate source parameters using user's keyvault certificate for enabling SSL. 6788 CertificateSourceParameters *KeyVaultCertificateSourceParameters `json:"certificateSourceParameters,omitempty"` 6789 // ProtocolType - Defines the TLS extension protocol that is used for secure delivery. Possible values include: 'ServerNameIndication', 'IPBased' 6790 ProtocolType ProtocolType `json:"protocolType,omitempty"` 6791 // MinimumTLSVersion - TLS protocol version that will be used for Https. Possible values include: 'None', 'TLS10', 'TLS12' 6792 MinimumTLSVersion MinimumTLSVersion `json:"minimumTlsVersion,omitempty"` 6793 // CertificateSource - Possible values include: 'CertificateSourceCustomDomainHTTPSParameters', 'CertificateSourceCdn', 'CertificateSourceAzureKeyVault' 6794 CertificateSource CertificateSource `json:"certificateSource,omitempty"` 6795} 6796 6797// MarshalJSON is the custom marshaler for UserManagedHTTPSParameters. 6798func (umhp UserManagedHTTPSParameters) MarshalJSON() ([]byte, error) { 6799 umhp.CertificateSource = CertificateSourceAzureKeyVault 6800 objectMap := make(map[string]interface{}) 6801 if umhp.CertificateSourceParameters != nil { 6802 objectMap["certificateSourceParameters"] = umhp.CertificateSourceParameters 6803 } 6804 if umhp.ProtocolType != "" { 6805 objectMap["protocolType"] = umhp.ProtocolType 6806 } 6807 if umhp.MinimumTLSVersion != "" { 6808 objectMap["minimumTlsVersion"] = umhp.MinimumTLSVersion 6809 } 6810 if umhp.CertificateSource != "" { 6811 objectMap["certificateSource"] = umhp.CertificateSource 6812 } 6813 return json.Marshal(objectMap) 6814} 6815 6816// AsManagedHTTPSParameters is the BasicCustomDomainHTTPSParameters implementation for UserManagedHTTPSParameters. 6817func (umhp UserManagedHTTPSParameters) AsManagedHTTPSParameters() (*ManagedHTTPSParameters, bool) { 6818 return nil, false 6819} 6820 6821// AsUserManagedHTTPSParameters is the BasicCustomDomainHTTPSParameters implementation for UserManagedHTTPSParameters. 6822func (umhp UserManagedHTTPSParameters) AsUserManagedHTTPSParameters() (*UserManagedHTTPSParameters, bool) { 6823 return &umhp, true 6824} 6825 6826// AsCustomDomainHTTPSParameters is the BasicCustomDomainHTTPSParameters implementation for UserManagedHTTPSParameters. 6827func (umhp UserManagedHTTPSParameters) AsCustomDomainHTTPSParameters() (*CustomDomainHTTPSParameters, bool) { 6828 return nil, false 6829} 6830 6831// AsBasicCustomDomainHTTPSParameters is the BasicCustomDomainHTTPSParameters implementation for UserManagedHTTPSParameters. 6832func (umhp UserManagedHTTPSParameters) AsBasicCustomDomainHTTPSParameters() (BasicCustomDomainHTTPSParameters, bool) { 6833 return &umhp, true 6834} 6835 6836// ValidateCustomDomainInput input of the custom domain to be validated for DNS mapping. 6837type ValidateCustomDomainInput struct { 6838 // HostName - The host name of the custom domain. Must be a domain name. 6839 HostName *string `json:"hostName,omitempty"` 6840} 6841 6842// ValidateCustomDomainOutput output of custom domain validation. 6843type ValidateCustomDomainOutput struct { 6844 autorest.Response `json:"-"` 6845 // CustomDomainValidated - READ-ONLY; Indicates whether the custom domain is valid or not. 6846 CustomDomainValidated *bool `json:"customDomainValidated,omitempty"` 6847 // Reason - READ-ONLY; The reason why the custom domain is not valid. 6848 Reason *string `json:"reason,omitempty"` 6849 // Message - READ-ONLY; Error message describing why the custom domain is not valid. 6850 Message *string `json:"message,omitempty"` 6851} 6852 6853// MarshalJSON is the custom marshaler for ValidateCustomDomainOutput. 6854func (vcdo ValidateCustomDomainOutput) MarshalJSON() ([]byte, error) { 6855 objectMap := make(map[string]interface{}) 6856 return json.Marshal(objectMap) 6857} 6858 6859// ValidateProbeInput input of the validate probe API. 6860type ValidateProbeInput struct { 6861 // ProbeURL - The probe URL to validate. 6862 ProbeURL *string `json:"probeURL,omitempty"` 6863} 6864 6865// ValidateProbeOutput output of the validate probe API. 6866type ValidateProbeOutput struct { 6867 autorest.Response `json:"-"` 6868 // IsValid - READ-ONLY; Indicates whether the probe URL is accepted or not. 6869 IsValid *bool `json:"isValid,omitempty"` 6870 // ErrorCode - READ-ONLY; Specifies the error code when the probe url is not accepted. 6871 ErrorCode *string `json:"errorCode,omitempty"` 6872 // Message - READ-ONLY; The detailed error message describing why the probe URL is not accepted. 6873 Message *string `json:"message,omitempty"` 6874} 6875 6876// MarshalJSON is the custom marshaler for ValidateProbeOutput. 6877func (vpo ValidateProbeOutput) MarshalJSON() ([]byte, error) { 6878 objectMap := make(map[string]interface{}) 6879 return json.Marshal(objectMap) 6880} 6881 6882// WebApplicationFirewallPolicy defines web application firewall policy for Azure CDN. 6883type WebApplicationFirewallPolicy struct { 6884 autorest.Response `json:"-"` 6885 // WebApplicationFirewallPolicyProperties - Properties of the web application firewall policy. 6886 *WebApplicationFirewallPolicyProperties `json:"properties,omitempty"` 6887 // Etag - Gets a unique read-only string that changes whenever the resource is updated. 6888 Etag *string `json:"etag,omitempty"` 6889 // Sku - The pricing tier (defines a CDN provider, feature list and rate) of the CdnWebApplicationFirewallPolicy. 6890 Sku *Sku `json:"sku,omitempty"` 6891 // Location - Resource location. 6892 Location *string `json:"location,omitempty"` 6893 // Tags - Resource tags. 6894 Tags map[string]*string `json:"tags"` 6895 // ID - READ-ONLY; Resource ID. 6896 ID *string `json:"id,omitempty"` 6897 // Name - READ-ONLY; Resource name. 6898 Name *string `json:"name,omitempty"` 6899 // Type - READ-ONLY; Resource type. 6900 Type *string `json:"type,omitempty"` 6901} 6902 6903// MarshalJSON is the custom marshaler for WebApplicationFirewallPolicy. 6904func (wafp WebApplicationFirewallPolicy) MarshalJSON() ([]byte, error) { 6905 objectMap := make(map[string]interface{}) 6906 if wafp.WebApplicationFirewallPolicyProperties != nil { 6907 objectMap["properties"] = wafp.WebApplicationFirewallPolicyProperties 6908 } 6909 if wafp.Etag != nil { 6910 objectMap["etag"] = wafp.Etag 6911 } 6912 if wafp.Sku != nil { 6913 objectMap["sku"] = wafp.Sku 6914 } 6915 if wafp.Location != nil { 6916 objectMap["location"] = wafp.Location 6917 } 6918 if wafp.Tags != nil { 6919 objectMap["tags"] = wafp.Tags 6920 } 6921 return json.Marshal(objectMap) 6922} 6923 6924// UnmarshalJSON is the custom unmarshaler for WebApplicationFirewallPolicy struct. 6925func (wafp *WebApplicationFirewallPolicy) UnmarshalJSON(body []byte) error { 6926 var m map[string]*json.RawMessage 6927 err := json.Unmarshal(body, &m) 6928 if err != nil { 6929 return err 6930 } 6931 for k, v := range m { 6932 switch k { 6933 case "properties": 6934 if v != nil { 6935 var webApplicationFirewallPolicyProperties WebApplicationFirewallPolicyProperties 6936 err = json.Unmarshal(*v, &webApplicationFirewallPolicyProperties) 6937 if err != nil { 6938 return err 6939 } 6940 wafp.WebApplicationFirewallPolicyProperties = &webApplicationFirewallPolicyProperties 6941 } 6942 case "etag": 6943 if v != nil { 6944 var etag string 6945 err = json.Unmarshal(*v, &etag) 6946 if err != nil { 6947 return err 6948 } 6949 wafp.Etag = &etag 6950 } 6951 case "sku": 6952 if v != nil { 6953 var sku Sku 6954 err = json.Unmarshal(*v, &sku) 6955 if err != nil { 6956 return err 6957 } 6958 wafp.Sku = &sku 6959 } 6960 case "location": 6961 if v != nil { 6962 var location string 6963 err = json.Unmarshal(*v, &location) 6964 if err != nil { 6965 return err 6966 } 6967 wafp.Location = &location 6968 } 6969 case "tags": 6970 if v != nil { 6971 var tags map[string]*string 6972 err = json.Unmarshal(*v, &tags) 6973 if err != nil { 6974 return err 6975 } 6976 wafp.Tags = tags 6977 } 6978 case "id": 6979 if v != nil { 6980 var ID string 6981 err = json.Unmarshal(*v, &ID) 6982 if err != nil { 6983 return err 6984 } 6985 wafp.ID = &ID 6986 } 6987 case "name": 6988 if v != nil { 6989 var name string 6990 err = json.Unmarshal(*v, &name) 6991 if err != nil { 6992 return err 6993 } 6994 wafp.Name = &name 6995 } 6996 case "type": 6997 if v != nil { 6998 var typeVar string 6999 err = json.Unmarshal(*v, &typeVar) 7000 if err != nil { 7001 return err 7002 } 7003 wafp.Type = &typeVar 7004 } 7005 } 7006 } 7007 7008 return nil 7009} 7010 7011// WebApplicationFirewallPolicyList defines a list of WebApplicationFirewallPolicies for Azure CDN. It 7012// contains a list of WebApplicationFirewallPolicy objects and a URL link to get the next set of results. 7013type WebApplicationFirewallPolicyList struct { 7014 autorest.Response `json:"-"` 7015 // Value - READ-ONLY; List of Azure CDN WebApplicationFirewallPolicies within a resource group. 7016 Value *[]WebApplicationFirewallPolicy `json:"value,omitempty"` 7017 // NextLink - URL to get the next set of WebApplicationFirewallPolicy objects if there are any. 7018 NextLink *string `json:"nextLink,omitempty"` 7019} 7020 7021// MarshalJSON is the custom marshaler for WebApplicationFirewallPolicyList. 7022func (wafpl WebApplicationFirewallPolicyList) MarshalJSON() ([]byte, error) { 7023 objectMap := make(map[string]interface{}) 7024 if wafpl.NextLink != nil { 7025 objectMap["nextLink"] = wafpl.NextLink 7026 } 7027 return json.Marshal(objectMap) 7028} 7029 7030// WebApplicationFirewallPolicyListIterator provides access to a complete listing of 7031// WebApplicationFirewallPolicy values. 7032type WebApplicationFirewallPolicyListIterator struct { 7033 i int 7034 page WebApplicationFirewallPolicyListPage 7035} 7036 7037// NextWithContext advances to the next value. If there was an error making 7038// the request the iterator does not advance and the error is returned. 7039func (iter *WebApplicationFirewallPolicyListIterator) NextWithContext(ctx context.Context) (err error) { 7040 if tracing.IsEnabled() { 7041 ctx = tracing.StartSpan(ctx, fqdn+"/WebApplicationFirewallPolicyListIterator.NextWithContext") 7042 defer func() { 7043 sc := -1 7044 if iter.Response().Response.Response != nil { 7045 sc = iter.Response().Response.Response.StatusCode 7046 } 7047 tracing.EndSpan(ctx, sc, err) 7048 }() 7049 } 7050 iter.i++ 7051 if iter.i < len(iter.page.Values()) { 7052 return nil 7053 } 7054 err = iter.page.NextWithContext(ctx) 7055 if err != nil { 7056 iter.i-- 7057 return err 7058 } 7059 iter.i = 0 7060 return nil 7061} 7062 7063// Next advances to the next value. If there was an error making 7064// the request the iterator does not advance and the error is returned. 7065// Deprecated: Use NextWithContext() instead. 7066func (iter *WebApplicationFirewallPolicyListIterator) Next() error { 7067 return iter.NextWithContext(context.Background()) 7068} 7069 7070// NotDone returns true if the enumeration should be started or is not yet complete. 7071func (iter WebApplicationFirewallPolicyListIterator) NotDone() bool { 7072 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 7073} 7074 7075// Response returns the raw server response from the last page request. 7076func (iter WebApplicationFirewallPolicyListIterator) Response() WebApplicationFirewallPolicyList { 7077 return iter.page.Response() 7078} 7079 7080// Value returns the current value or a zero-initialized value if the 7081// iterator has advanced beyond the end of the collection. 7082func (iter WebApplicationFirewallPolicyListIterator) Value() WebApplicationFirewallPolicy { 7083 if !iter.page.NotDone() { 7084 return WebApplicationFirewallPolicy{} 7085 } 7086 return iter.page.Values()[iter.i] 7087} 7088 7089// Creates a new instance of the WebApplicationFirewallPolicyListIterator type. 7090func NewWebApplicationFirewallPolicyListIterator(page WebApplicationFirewallPolicyListPage) WebApplicationFirewallPolicyListIterator { 7091 return WebApplicationFirewallPolicyListIterator{page: page} 7092} 7093 7094// IsEmpty returns true if the ListResult contains no values. 7095func (wafpl WebApplicationFirewallPolicyList) IsEmpty() bool { 7096 return wafpl.Value == nil || len(*wafpl.Value) == 0 7097} 7098 7099// hasNextLink returns true if the NextLink is not empty. 7100func (wafpl WebApplicationFirewallPolicyList) hasNextLink() bool { 7101 return wafpl.NextLink != nil && len(*wafpl.NextLink) != 0 7102} 7103 7104// webApplicationFirewallPolicyListPreparer prepares a request to retrieve the next set of results. 7105// It returns nil if no more results exist. 7106func (wafpl WebApplicationFirewallPolicyList) webApplicationFirewallPolicyListPreparer(ctx context.Context) (*http.Request, error) { 7107 if !wafpl.hasNextLink() { 7108 return nil, nil 7109 } 7110 return autorest.Prepare((&http.Request{}).WithContext(ctx), 7111 autorest.AsJSON(), 7112 autorest.AsGet(), 7113 autorest.WithBaseURL(to.String(wafpl.NextLink))) 7114} 7115 7116// WebApplicationFirewallPolicyListPage contains a page of WebApplicationFirewallPolicy values. 7117type WebApplicationFirewallPolicyListPage struct { 7118 fn func(context.Context, WebApplicationFirewallPolicyList) (WebApplicationFirewallPolicyList, error) 7119 wafpl WebApplicationFirewallPolicyList 7120} 7121 7122// NextWithContext advances to the next page of values. If there was an error making 7123// the request the page does not advance and the error is returned. 7124func (page *WebApplicationFirewallPolicyListPage) NextWithContext(ctx context.Context) (err error) { 7125 if tracing.IsEnabled() { 7126 ctx = tracing.StartSpan(ctx, fqdn+"/WebApplicationFirewallPolicyListPage.NextWithContext") 7127 defer func() { 7128 sc := -1 7129 if page.Response().Response.Response != nil { 7130 sc = page.Response().Response.Response.StatusCode 7131 } 7132 tracing.EndSpan(ctx, sc, err) 7133 }() 7134 } 7135 for { 7136 next, err := page.fn(ctx, page.wafpl) 7137 if err != nil { 7138 return err 7139 } 7140 page.wafpl = next 7141 if !next.hasNextLink() || !next.IsEmpty() { 7142 break 7143 } 7144 } 7145 return nil 7146} 7147 7148// Next advances to the next page of values. If there was an error making 7149// the request the page does not advance and the error is returned. 7150// Deprecated: Use NextWithContext() instead. 7151func (page *WebApplicationFirewallPolicyListPage) Next() error { 7152 return page.NextWithContext(context.Background()) 7153} 7154 7155// NotDone returns true if the page enumeration should be started or is not yet complete. 7156func (page WebApplicationFirewallPolicyListPage) NotDone() bool { 7157 return !page.wafpl.IsEmpty() 7158} 7159 7160// Response returns the raw server response from the last page request. 7161func (page WebApplicationFirewallPolicyListPage) Response() WebApplicationFirewallPolicyList { 7162 return page.wafpl 7163} 7164 7165// Values returns the slice of values for the current page or nil if there are no values. 7166func (page WebApplicationFirewallPolicyListPage) Values() []WebApplicationFirewallPolicy { 7167 if page.wafpl.IsEmpty() { 7168 return nil 7169 } 7170 return *page.wafpl.Value 7171} 7172 7173// Creates a new instance of the WebApplicationFirewallPolicyListPage type. 7174func NewWebApplicationFirewallPolicyListPage(cur WebApplicationFirewallPolicyList, getNextPage func(context.Context, WebApplicationFirewallPolicyList) (WebApplicationFirewallPolicyList, error)) WebApplicationFirewallPolicyListPage { 7175 return WebApplicationFirewallPolicyListPage{ 7176 fn: getNextPage, 7177 wafpl: cur, 7178 } 7179} 7180 7181// WebApplicationFirewallPolicyPatchParameters properties required to update a 7182// CdnWebApplicationFirewallPolicy. 7183type WebApplicationFirewallPolicyPatchParameters struct { 7184 // Tags - CdnWebApplicationFirewallPolicy tags 7185 Tags map[string]*string `json:"tags"` 7186} 7187 7188// MarshalJSON is the custom marshaler for WebApplicationFirewallPolicyPatchParameters. 7189func (wafppp WebApplicationFirewallPolicyPatchParameters) MarshalJSON() ([]byte, error) { 7190 objectMap := make(map[string]interface{}) 7191 if wafppp.Tags != nil { 7192 objectMap["tags"] = wafppp.Tags 7193 } 7194 return json.Marshal(objectMap) 7195} 7196 7197// WebApplicationFirewallPolicyProperties defines CDN web application firewall policy properties. 7198type WebApplicationFirewallPolicyProperties struct { 7199 // PolicySettings - Describes policySettings for policy 7200 PolicySettings *PolicySettings `json:"policySettings,omitempty"` 7201 // RateLimitRules - Describes rate limit rules inside the policy. 7202 RateLimitRules *RateLimitRuleList `json:"rateLimitRules,omitempty"` 7203 // CustomRules - Describes custom rules inside the policy. 7204 CustomRules *CustomRuleList `json:"customRules,omitempty"` 7205 // ManagedRules - Describes managed rules inside the policy. 7206 ManagedRules *ManagedRuleSetList `json:"managedRules,omitempty"` 7207 // EndpointLinks - READ-ONLY; Describes Azure CDN endpoints associated with this Web Application Firewall policy. 7208 EndpointLinks *[]EndpointType `json:"endpointLinks,omitempty"` 7209 // ProvisioningState - READ-ONLY; Provisioning state of the WebApplicationFirewallPolicy. Possible values include: 'ProvisioningStateCreating', 'ProvisioningStateSucceeded', 'ProvisioningStateFailed' 7210 ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` 7211 // ResourceState - READ-ONLY; Possible values include: 'PolicyResourceStateCreating', 'PolicyResourceStateEnabling', 'PolicyResourceStateEnabled', 'PolicyResourceStateDisabling', 'PolicyResourceStateDisabled', 'PolicyResourceStateDeleting' 7212 ResourceState PolicyResourceState `json:"resourceState,omitempty"` 7213} 7214 7215// MarshalJSON is the custom marshaler for WebApplicationFirewallPolicyProperties. 7216func (wafpp WebApplicationFirewallPolicyProperties) MarshalJSON() ([]byte, error) { 7217 objectMap := make(map[string]interface{}) 7218 if wafpp.PolicySettings != nil { 7219 objectMap["policySettings"] = wafpp.PolicySettings 7220 } 7221 if wafpp.RateLimitRules != nil { 7222 objectMap["rateLimitRules"] = wafpp.RateLimitRules 7223 } 7224 if wafpp.CustomRules != nil { 7225 objectMap["customRules"] = wafpp.CustomRules 7226 } 7227 if wafpp.ManagedRules != nil { 7228 objectMap["managedRules"] = wafpp.ManagedRules 7229 } 7230 return json.Marshal(objectMap) 7231} 7232