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