1package cdn 2 3// Copyright (c) Microsoft and contributors. All rights reserved. 4// 5// Licensed under the Apache License, Version 2.0 (the "License"); 6// you may not use this file except in compliance with the License. 7// You may obtain a copy of the License at 8// http://www.apache.org/licenses/LICENSE-2.0 9// 10// Unless required by applicable law or agreed to in writing, software 11// distributed under the License is distributed on an "AS IS" BASIS, 12// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13// 14// See the License for the specific language governing permissions and 15// limitations under the License. 16// 17// Code generated by Microsoft (R) AutoRest Code Generator. 18// Changes may cause incorrect behavior and will be lost if the code is regenerated. 19 20import ( 21 "context" 22 "encoding/json" 23 "github.com/Azure/go-autorest/autorest" 24 "github.com/Azure/go-autorest/autorest/azure" 25 "github.com/Azure/go-autorest/autorest/date" 26 "github.com/Azure/go-autorest/autorest/to" 27 "github.com/Azure/go-autorest/tracing" 28 "net/http" 29) 30 31// The package's fully qualified name. 32const fqdn = "github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2020-09-01/cdn" 33 34// AFDCustomDomainsCreateFuture an abstraction for monitoring and retrieving the results of a long-running 35// operation. 36type AFDCustomDomainsCreateFuture struct { 37 azure.FutureAPI 38 // Result returns the result of the asynchronous operation. 39 // If the operation has not completed it will return an error. 40 Result func(AFDCustomDomainsClient) (AFDDomain, error) 41} 42 43// AFDCustomDomainsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running 44// operation. 45type AFDCustomDomainsDeleteFuture struct { 46 azure.FutureAPI 47 // Result returns the result of the asynchronous operation. 48 // If the operation has not completed it will return an error. 49 Result func(AFDCustomDomainsClient) (autorest.Response, error) 50} 51 52// AFDCustomDomainsRefreshValidationTokenFuture an abstraction for monitoring and retrieving the results of 53// a long-running operation. 54type AFDCustomDomainsRefreshValidationTokenFuture struct { 55 azure.FutureAPI 56 // Result returns the result of the asynchronous operation. 57 // If the operation has not completed it will return an error. 58 Result func(AFDCustomDomainsClient) (ValidationToken, error) 59} 60 61// AFDCustomDomainsUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 62// operation. 63type AFDCustomDomainsUpdateFuture struct { 64 azure.FutureAPI 65 // Result returns the result of the asynchronous operation. 66 // If the operation has not completed it will return an error. 67 Result func(AFDCustomDomainsClient) (AFDDomain, error) 68} 69 70// AFDDomain friendly domain name mapping to the endpoint hostname that the customer provides for branding 71// purposes, e.g. www.contoso.com. 72type AFDDomain struct { 73 autorest.Response `json:"-"` 74 *AFDDomainProperties `json:"properties,omitempty"` 75 // SystemData - READ-ONLY 76 SystemData *SystemData `json:"systemData,omitempty"` 77 // ID - READ-ONLY; Resource ID. 78 ID *string `json:"id,omitempty"` 79 // Name - READ-ONLY; Resource name. 80 Name *string `json:"name,omitempty"` 81 // Type - READ-ONLY; Resource type. 82 Type *string `json:"type,omitempty"` 83} 84 85// MarshalJSON is the custom marshaler for AFDDomain. 86func (ad AFDDomain) MarshalJSON() ([]byte, error) { 87 objectMap := make(map[string]interface{}) 88 if ad.AFDDomainProperties != nil { 89 objectMap["properties"] = ad.AFDDomainProperties 90 } 91 return json.Marshal(objectMap) 92} 93 94// UnmarshalJSON is the custom unmarshaler for AFDDomain struct. 95func (ad *AFDDomain) UnmarshalJSON(body []byte) error { 96 var m map[string]*json.RawMessage 97 err := json.Unmarshal(body, &m) 98 if err != nil { 99 return err 100 } 101 for k, v := range m { 102 switch k { 103 case "properties": 104 if v != nil { 105 var aFDDomainProperties AFDDomainProperties 106 err = json.Unmarshal(*v, &aFDDomainProperties) 107 if err != nil { 108 return err 109 } 110 ad.AFDDomainProperties = &aFDDomainProperties 111 } 112 case "systemData": 113 if v != nil { 114 var systemData SystemData 115 err = json.Unmarshal(*v, &systemData) 116 if err != nil { 117 return err 118 } 119 ad.SystemData = &systemData 120 } 121 case "id": 122 if v != nil { 123 var ID string 124 err = json.Unmarshal(*v, &ID) 125 if err != nil { 126 return err 127 } 128 ad.ID = &ID 129 } 130 case "name": 131 if v != nil { 132 var name string 133 err = json.Unmarshal(*v, &name) 134 if err != nil { 135 return err 136 } 137 ad.Name = &name 138 } 139 case "type": 140 if v != nil { 141 var typeVar string 142 err = json.Unmarshal(*v, &typeVar) 143 if err != nil { 144 return err 145 } 146 ad.Type = &typeVar 147 } 148 } 149 } 150 151 return nil 152} 153 154// AFDDomainHTTPSParameters the JSON object that contains the properties to secure a domain. 155type AFDDomainHTTPSParameters struct { 156 // CertificateType - Defines the source of the SSL certificate. Possible values include: 'AfdCertificateTypeCustomerCertificate', 'AfdCertificateTypeManagedCertificate' 157 CertificateType AfdCertificateType `json:"certificateType,omitempty"` 158 // MinimumTLSVersion - TLS protocol version that will be used for Https. Possible values include: 'TLS10', 'TLS12' 159 MinimumTLSVersion AfdMinimumTLSVersion `json:"minimumTlsVersion,omitempty"` 160 // Secret - Resource reference to the secret. ie. subs/rg/profile/secret 161 Secret *ResourceReference `json:"secret,omitempty"` 162} 163 164// AFDDomainListResult result of the request to list domains. It contains a list of domain objects and a 165// URL link to get the next set of results. 166type AFDDomainListResult struct { 167 autorest.Response `json:"-"` 168 // Value - READ-ONLY; List of AzureFrontDoor domains within a profile. 169 Value *[]AFDDomain `json:"value,omitempty"` 170 // NextLink - URL to get the next set of domain objects if there are any. 171 NextLink *string `json:"nextLink,omitempty"` 172} 173 174// MarshalJSON is the custom marshaler for AFDDomainListResult. 175func (adlr AFDDomainListResult) MarshalJSON() ([]byte, error) { 176 objectMap := make(map[string]interface{}) 177 if adlr.NextLink != nil { 178 objectMap["nextLink"] = adlr.NextLink 179 } 180 return json.Marshal(objectMap) 181} 182 183// AFDDomainListResultIterator provides access to a complete listing of AFDDomain values. 184type AFDDomainListResultIterator struct { 185 i int 186 page AFDDomainListResultPage 187} 188 189// NextWithContext advances to the next value. If there was an error making 190// the request the iterator does not advance and the error is returned. 191func (iter *AFDDomainListResultIterator) NextWithContext(ctx context.Context) (err error) { 192 if tracing.IsEnabled() { 193 ctx = tracing.StartSpan(ctx, fqdn+"/AFDDomainListResultIterator.NextWithContext") 194 defer func() { 195 sc := -1 196 if iter.Response().Response.Response != nil { 197 sc = iter.Response().Response.Response.StatusCode 198 } 199 tracing.EndSpan(ctx, sc, err) 200 }() 201 } 202 iter.i++ 203 if iter.i < len(iter.page.Values()) { 204 return nil 205 } 206 err = iter.page.NextWithContext(ctx) 207 if err != nil { 208 iter.i-- 209 return err 210 } 211 iter.i = 0 212 return nil 213} 214 215// Next advances to the next value. If there was an error making 216// the request the iterator does not advance and the error is returned. 217// Deprecated: Use NextWithContext() instead. 218func (iter *AFDDomainListResultIterator) Next() error { 219 return iter.NextWithContext(context.Background()) 220} 221 222// NotDone returns true if the enumeration should be started or is not yet complete. 223func (iter AFDDomainListResultIterator) NotDone() bool { 224 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 225} 226 227// Response returns the raw server response from the last page request. 228func (iter AFDDomainListResultIterator) Response() AFDDomainListResult { 229 return iter.page.Response() 230} 231 232// Value returns the current value or a zero-initialized value if the 233// iterator has advanced beyond the end of the collection. 234func (iter AFDDomainListResultIterator) Value() AFDDomain { 235 if !iter.page.NotDone() { 236 return AFDDomain{} 237 } 238 return iter.page.Values()[iter.i] 239} 240 241// Creates a new instance of the AFDDomainListResultIterator type. 242func NewAFDDomainListResultIterator(page AFDDomainListResultPage) AFDDomainListResultIterator { 243 return AFDDomainListResultIterator{page: page} 244} 245 246// IsEmpty returns true if the ListResult contains no values. 247func (adlr AFDDomainListResult) IsEmpty() bool { 248 return adlr.Value == nil || len(*adlr.Value) == 0 249} 250 251// hasNextLink returns true if the NextLink is not empty. 252func (adlr AFDDomainListResult) hasNextLink() bool { 253 return adlr.NextLink != nil && len(*adlr.NextLink) != 0 254} 255 256// aFDDomainListResultPreparer prepares a request to retrieve the next set of results. 257// It returns nil if no more results exist. 258func (adlr AFDDomainListResult) aFDDomainListResultPreparer(ctx context.Context) (*http.Request, error) { 259 if !adlr.hasNextLink() { 260 return nil, nil 261 } 262 return autorest.Prepare((&http.Request{}).WithContext(ctx), 263 autorest.AsJSON(), 264 autorest.AsGet(), 265 autorest.WithBaseURL(to.String(adlr.NextLink))) 266} 267 268// AFDDomainListResultPage contains a page of AFDDomain values. 269type AFDDomainListResultPage struct { 270 fn func(context.Context, AFDDomainListResult) (AFDDomainListResult, error) 271 adlr AFDDomainListResult 272} 273 274// NextWithContext advances to the next page of values. If there was an error making 275// the request the page does not advance and the error is returned. 276func (page *AFDDomainListResultPage) NextWithContext(ctx context.Context) (err error) { 277 if tracing.IsEnabled() { 278 ctx = tracing.StartSpan(ctx, fqdn+"/AFDDomainListResultPage.NextWithContext") 279 defer func() { 280 sc := -1 281 if page.Response().Response.Response != nil { 282 sc = page.Response().Response.Response.StatusCode 283 } 284 tracing.EndSpan(ctx, sc, err) 285 }() 286 } 287 for { 288 next, err := page.fn(ctx, page.adlr) 289 if err != nil { 290 return err 291 } 292 page.adlr = next 293 if !next.hasNextLink() || !next.IsEmpty() { 294 break 295 } 296 } 297 return nil 298} 299 300// Next advances to the next page of values. If there was an error making 301// the request the page does not advance and the error is returned. 302// Deprecated: Use NextWithContext() instead. 303func (page *AFDDomainListResultPage) Next() error { 304 return page.NextWithContext(context.Background()) 305} 306 307// NotDone returns true if the page enumeration should be started or is not yet complete. 308func (page AFDDomainListResultPage) NotDone() bool { 309 return !page.adlr.IsEmpty() 310} 311 312// Response returns the raw server response from the last page request. 313func (page AFDDomainListResultPage) Response() AFDDomainListResult { 314 return page.adlr 315} 316 317// Values returns the slice of values for the current page or nil if there are no values. 318func (page AFDDomainListResultPage) Values() []AFDDomain { 319 if page.adlr.IsEmpty() { 320 return nil 321 } 322 return *page.adlr.Value 323} 324 325// Creates a new instance of the AFDDomainListResultPage type. 326func NewAFDDomainListResultPage(cur AFDDomainListResult, getNextPage func(context.Context, AFDDomainListResult) (AFDDomainListResult, error)) AFDDomainListResultPage { 327 return AFDDomainListResultPage{ 328 fn: getNextPage, 329 adlr: cur, 330 } 331} 332 333// AFDDomainProperties the JSON object that contains the properties of the domain to create. 334type AFDDomainProperties struct { 335 // TLSSettings - The configuration specifying how to enable HTTPS for the domain - using AzureFrontDoor managed certificate or user's own certificate. If not specified, enabling ssl uses AzureFrontDoor managed certificate by default. 336 TLSSettings *AFDDomainHTTPSParameters `json:"tlsSettings,omitempty"` 337 // AzureDNSZone - Resource reference to the Azure DNS zone 338 AzureDNSZone *ResourceReference `json:"azureDnsZone,omitempty"` 339 // ProvisioningState - READ-ONLY; Provisioning status. Possible values include: 'Succeeded', 'Failed', 'Updating', 'Deleting', 'Creating' 340 ProvisioningState AfdProvisioningState `json:"provisioningState,omitempty"` 341 // DeploymentStatus - READ-ONLY; Possible values include: 'DeploymentStatusNotStarted', 'DeploymentStatusInProgress', 'DeploymentStatusSucceeded', 'DeploymentStatusFailed' 342 DeploymentStatus DeploymentStatus `json:"deploymentStatus,omitempty"` 343 // DomainValidationState - READ-ONLY; Provisioning substate shows the progress of custom HTTPS enabling/disabling process step by step. DCV stands for DomainControlValidation. Possible values include: 'Unknown', 'Submitting', 'Pending', 'TimedOut', 'PendingRevalidation', 'Approved' 344 DomainValidationState DomainValidationState `json:"domainValidationState,omitempty"` 345 // HostName - The host name of the domain. Must be a domain name. 346 HostName *string `json:"hostName,omitempty"` 347 // ValidationProperties - READ-ONLY; Values the customer needs to validate domain ownership 348 ValidationProperties *DomainValidationProperties `json:"validationProperties,omitempty"` 349} 350 351// MarshalJSON is the custom marshaler for AFDDomainProperties. 352func (adp AFDDomainProperties) MarshalJSON() ([]byte, error) { 353 objectMap := make(map[string]interface{}) 354 if adp.TLSSettings != nil { 355 objectMap["tlsSettings"] = adp.TLSSettings 356 } 357 if adp.AzureDNSZone != nil { 358 objectMap["azureDnsZone"] = adp.AzureDNSZone 359 } 360 if adp.HostName != nil { 361 objectMap["hostName"] = adp.HostName 362 } 363 return json.Marshal(objectMap) 364} 365 366// AFDDomainUpdateParameters the domain JSON object required for domain creation or update. 367type AFDDomainUpdateParameters struct { 368 *AFDDomainUpdatePropertiesParameters `json:"properties,omitempty"` 369} 370 371// MarshalJSON is the custom marshaler for AFDDomainUpdateParameters. 372func (adup AFDDomainUpdateParameters) MarshalJSON() ([]byte, error) { 373 objectMap := make(map[string]interface{}) 374 if adup.AFDDomainUpdatePropertiesParameters != nil { 375 objectMap["properties"] = adup.AFDDomainUpdatePropertiesParameters 376 } 377 return json.Marshal(objectMap) 378} 379 380// UnmarshalJSON is the custom unmarshaler for AFDDomainUpdateParameters struct. 381func (adup *AFDDomainUpdateParameters) UnmarshalJSON(body []byte) error { 382 var m map[string]*json.RawMessage 383 err := json.Unmarshal(body, &m) 384 if err != nil { 385 return err 386 } 387 for k, v := range m { 388 switch k { 389 case "properties": 390 if v != nil { 391 var aFDDomainUpdatePropertiesParameters AFDDomainUpdatePropertiesParameters 392 err = json.Unmarshal(*v, &aFDDomainUpdatePropertiesParameters) 393 if err != nil { 394 return err 395 } 396 adup.AFDDomainUpdatePropertiesParameters = &aFDDomainUpdatePropertiesParameters 397 } 398 } 399 } 400 401 return nil 402} 403 404// AFDDomainUpdatePropertiesParameters the JSON object that contains the properties of the domain to 405// create. 406type AFDDomainUpdatePropertiesParameters struct { 407 // TLSSettings - The configuration specifying how to enable HTTPS for the domain - using AzureFrontDoor managed certificate or user's own certificate. If not specified, enabling ssl uses AzureFrontDoor managed certificate by default. 408 TLSSettings *AFDDomainHTTPSParameters `json:"tlsSettings,omitempty"` 409 // AzureDNSZone - Resource reference to the Azure DNS zone 410 AzureDNSZone *ResourceReference `json:"azureDnsZone,omitempty"` 411} 412 413// AFDEndpoint CDN endpoint is the entity within a CDN profile containing configuration information such as 414// origin, protocol, content caching and delivery behavior. The AzureFrontDoor endpoint uses the URL format 415// <endpointname>.azureedge.net. 416type AFDEndpoint struct { 417 autorest.Response `json:"-"` 418 *AFDEndpointProperties `json:"properties,omitempty"` 419 // Location - Resource location. 420 Location *string `json:"location,omitempty"` 421 // Tags - Resource tags. 422 Tags map[string]*string `json:"tags"` 423 // SystemData - READ-ONLY 424 SystemData *SystemData `json:"systemData,omitempty"` 425 // ID - READ-ONLY; Resource ID. 426 ID *string `json:"id,omitempty"` 427 // Name - READ-ONLY; Resource name. 428 Name *string `json:"name,omitempty"` 429 // Type - READ-ONLY; Resource type. 430 Type *string `json:"type,omitempty"` 431} 432 433// MarshalJSON is the custom marshaler for AFDEndpoint. 434func (ae AFDEndpoint) MarshalJSON() ([]byte, error) { 435 objectMap := make(map[string]interface{}) 436 if ae.AFDEndpointProperties != nil { 437 objectMap["properties"] = ae.AFDEndpointProperties 438 } 439 if ae.Location != nil { 440 objectMap["location"] = ae.Location 441 } 442 if ae.Tags != nil { 443 objectMap["tags"] = ae.Tags 444 } 445 return json.Marshal(objectMap) 446} 447 448// UnmarshalJSON is the custom unmarshaler for AFDEndpoint struct. 449func (ae *AFDEndpoint) 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 aFDEndpointProperties AFDEndpointProperties 460 err = json.Unmarshal(*v, &aFDEndpointProperties) 461 if err != nil { 462 return err 463 } 464 ae.AFDEndpointProperties = &aFDEndpointProperties 465 } 466 case "location": 467 if v != nil { 468 var location string 469 err = json.Unmarshal(*v, &location) 470 if err != nil { 471 return err 472 } 473 ae.Location = &location 474 } 475 case "tags": 476 if v != nil { 477 var tags map[string]*string 478 err = json.Unmarshal(*v, &tags) 479 if err != nil { 480 return err 481 } 482 ae.Tags = tags 483 } 484 case "systemData": 485 if v != nil { 486 var systemData SystemData 487 err = json.Unmarshal(*v, &systemData) 488 if err != nil { 489 return err 490 } 491 ae.SystemData = &systemData 492 } 493 case "id": 494 if v != nil { 495 var ID string 496 err = json.Unmarshal(*v, &ID) 497 if err != nil { 498 return err 499 } 500 ae.ID = &ID 501 } 502 case "name": 503 if v != nil { 504 var name string 505 err = json.Unmarshal(*v, &name) 506 if err != nil { 507 return err 508 } 509 ae.Name = &name 510 } 511 case "type": 512 if v != nil { 513 var typeVar string 514 err = json.Unmarshal(*v, &typeVar) 515 if err != nil { 516 return err 517 } 518 ae.Type = &typeVar 519 } 520 } 521 } 522 523 return nil 524} 525 526// AFDEndpointListResult result of the request to list endpoints. It contains a list of endpoint objects 527// and a URL link to get the next set of results. 528type AFDEndpointListResult struct { 529 autorest.Response `json:"-"` 530 // Value - READ-ONLY; List of AzureFrontDoor endpoints within a profile 531 Value *[]AFDEndpoint `json:"value,omitempty"` 532 // NextLink - URL to get the next set of endpoint objects if there is any. 533 NextLink *string `json:"nextLink,omitempty"` 534} 535 536// MarshalJSON is the custom marshaler for AFDEndpointListResult. 537func (aelr AFDEndpointListResult) MarshalJSON() ([]byte, error) { 538 objectMap := make(map[string]interface{}) 539 if aelr.NextLink != nil { 540 objectMap["nextLink"] = aelr.NextLink 541 } 542 return json.Marshal(objectMap) 543} 544 545// AFDEndpointListResultIterator provides access to a complete listing of AFDEndpoint values. 546type AFDEndpointListResultIterator struct { 547 i int 548 page AFDEndpointListResultPage 549} 550 551// NextWithContext advances to the next value. If there was an error making 552// the request the iterator does not advance and the error is returned. 553func (iter *AFDEndpointListResultIterator) NextWithContext(ctx context.Context) (err error) { 554 if tracing.IsEnabled() { 555 ctx = tracing.StartSpan(ctx, fqdn+"/AFDEndpointListResultIterator.NextWithContext") 556 defer func() { 557 sc := -1 558 if iter.Response().Response.Response != nil { 559 sc = iter.Response().Response.Response.StatusCode 560 } 561 tracing.EndSpan(ctx, sc, err) 562 }() 563 } 564 iter.i++ 565 if iter.i < len(iter.page.Values()) { 566 return nil 567 } 568 err = iter.page.NextWithContext(ctx) 569 if err != nil { 570 iter.i-- 571 return err 572 } 573 iter.i = 0 574 return nil 575} 576 577// Next advances to the next value. If there was an error making 578// the request the iterator does not advance and the error is returned. 579// Deprecated: Use NextWithContext() instead. 580func (iter *AFDEndpointListResultIterator) Next() error { 581 return iter.NextWithContext(context.Background()) 582} 583 584// NotDone returns true if the enumeration should be started or is not yet complete. 585func (iter AFDEndpointListResultIterator) NotDone() bool { 586 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 587} 588 589// Response returns the raw server response from the last page request. 590func (iter AFDEndpointListResultIterator) Response() AFDEndpointListResult { 591 return iter.page.Response() 592} 593 594// Value returns the current value or a zero-initialized value if the 595// iterator has advanced beyond the end of the collection. 596func (iter AFDEndpointListResultIterator) Value() AFDEndpoint { 597 if !iter.page.NotDone() { 598 return AFDEndpoint{} 599 } 600 return iter.page.Values()[iter.i] 601} 602 603// Creates a new instance of the AFDEndpointListResultIterator type. 604func NewAFDEndpointListResultIterator(page AFDEndpointListResultPage) AFDEndpointListResultIterator { 605 return AFDEndpointListResultIterator{page: page} 606} 607 608// IsEmpty returns true if the ListResult contains no values. 609func (aelr AFDEndpointListResult) IsEmpty() bool { 610 return aelr.Value == nil || len(*aelr.Value) == 0 611} 612 613// hasNextLink returns true if the NextLink is not empty. 614func (aelr AFDEndpointListResult) hasNextLink() bool { 615 return aelr.NextLink != nil && len(*aelr.NextLink) != 0 616} 617 618// aFDEndpointListResultPreparer prepares a request to retrieve the next set of results. 619// It returns nil if no more results exist. 620func (aelr AFDEndpointListResult) aFDEndpointListResultPreparer(ctx context.Context) (*http.Request, error) { 621 if !aelr.hasNextLink() { 622 return nil, nil 623 } 624 return autorest.Prepare((&http.Request{}).WithContext(ctx), 625 autorest.AsJSON(), 626 autorest.AsGet(), 627 autorest.WithBaseURL(to.String(aelr.NextLink))) 628} 629 630// AFDEndpointListResultPage contains a page of AFDEndpoint values. 631type AFDEndpointListResultPage struct { 632 fn func(context.Context, AFDEndpointListResult) (AFDEndpointListResult, error) 633 aelr AFDEndpointListResult 634} 635 636// NextWithContext advances to the next page of values. If there was an error making 637// the request the page does not advance and the error is returned. 638func (page *AFDEndpointListResultPage) NextWithContext(ctx context.Context) (err error) { 639 if tracing.IsEnabled() { 640 ctx = tracing.StartSpan(ctx, fqdn+"/AFDEndpointListResultPage.NextWithContext") 641 defer func() { 642 sc := -1 643 if page.Response().Response.Response != nil { 644 sc = page.Response().Response.Response.StatusCode 645 } 646 tracing.EndSpan(ctx, sc, err) 647 }() 648 } 649 for { 650 next, err := page.fn(ctx, page.aelr) 651 if err != nil { 652 return err 653 } 654 page.aelr = next 655 if !next.hasNextLink() || !next.IsEmpty() { 656 break 657 } 658 } 659 return nil 660} 661 662// Next advances to the next page of values. If there was an error making 663// the request the page does not advance and the error is returned. 664// Deprecated: Use NextWithContext() instead. 665func (page *AFDEndpointListResultPage) Next() error { 666 return page.NextWithContext(context.Background()) 667} 668 669// NotDone returns true if the page enumeration should be started or is not yet complete. 670func (page AFDEndpointListResultPage) NotDone() bool { 671 return !page.aelr.IsEmpty() 672} 673 674// Response returns the raw server response from the last page request. 675func (page AFDEndpointListResultPage) Response() AFDEndpointListResult { 676 return page.aelr 677} 678 679// Values returns the slice of values for the current page or nil if there are no values. 680func (page AFDEndpointListResultPage) Values() []AFDEndpoint { 681 if page.aelr.IsEmpty() { 682 return nil 683 } 684 return *page.aelr.Value 685} 686 687// Creates a new instance of the AFDEndpointListResultPage type. 688func NewAFDEndpointListResultPage(cur AFDEndpointListResult, getNextPage func(context.Context, AFDEndpointListResult) (AFDEndpointListResult, error)) AFDEndpointListResultPage { 689 return AFDEndpointListResultPage{ 690 fn: getNextPage, 691 aelr: cur, 692 } 693} 694 695// AFDEndpointProperties the JSON object that contains the properties required to create an endpoint. 696type AFDEndpointProperties struct { 697 // OriginResponseTimeoutSeconds - Send and receive timeout on forwarding request to the origin. When timeout is reached, the request fails and returns. 698 OriginResponseTimeoutSeconds *int32 `json:"originResponseTimeoutSeconds,omitempty"` 699 // EnabledState - Whether to enable use of this rule. Permitted values are 'Enabled' or 'Disabled'. Possible values include: 'EnabledStateEnabled', 'EnabledStateDisabled' 700 EnabledState EnabledState `json:"enabledState,omitempty"` 701 // ProvisioningState - READ-ONLY; Provisioning status. Possible values include: 'Succeeded', 'Failed', 'Updating', 'Deleting', 'Creating' 702 ProvisioningState AfdProvisioningState `json:"provisioningState,omitempty"` 703 // DeploymentStatus - READ-ONLY; Possible values include: 'DeploymentStatusNotStarted', 'DeploymentStatusInProgress', 'DeploymentStatusSucceeded', 'DeploymentStatusFailed' 704 DeploymentStatus DeploymentStatus `json:"deploymentStatus,omitempty"` 705 // HostName - READ-ONLY; The host name of the endpoint structured as {endpointName}.{DNSZone}, e.g. contoso.azureedge.net 706 HostName *string `json:"hostName,omitempty"` 707} 708 709// MarshalJSON is the custom marshaler for AFDEndpointProperties. 710func (aep AFDEndpointProperties) MarshalJSON() ([]byte, error) { 711 objectMap := make(map[string]interface{}) 712 if aep.OriginResponseTimeoutSeconds != nil { 713 objectMap["originResponseTimeoutSeconds"] = aep.OriginResponseTimeoutSeconds 714 } 715 if aep.EnabledState != "" { 716 objectMap["enabledState"] = aep.EnabledState 717 } 718 return json.Marshal(objectMap) 719} 720 721// AFDEndpointPropertiesUpdateParameters the JSON object containing endpoint update parameters. 722type AFDEndpointPropertiesUpdateParameters struct { 723 // OriginResponseTimeoutSeconds - Send and receive timeout on forwarding request to the origin. When timeout is reached, the request fails and returns. 724 OriginResponseTimeoutSeconds *int32 `json:"originResponseTimeoutSeconds,omitempty"` 725 // EnabledState - Whether to enable use of this rule. Permitted values are 'Enabled' or 'Disabled'. Possible values include: 'EnabledStateEnabled', 'EnabledStateDisabled' 726 EnabledState EnabledState `json:"enabledState,omitempty"` 727} 728 729// AFDEndpointsCreateFuture an abstraction for monitoring and retrieving the results of a long-running 730// operation. 731type AFDEndpointsCreateFuture struct { 732 azure.FutureAPI 733 // Result returns the result of the asynchronous operation. 734 // If the operation has not completed it will return an error. 735 Result func(AFDEndpointsClient) (AFDEndpoint, error) 736} 737 738// AFDEndpointsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running 739// operation. 740type AFDEndpointsDeleteFuture struct { 741 azure.FutureAPI 742 // Result returns the result of the asynchronous operation. 743 // If the operation has not completed it will return an error. 744 Result func(AFDEndpointsClient) (autorest.Response, error) 745} 746 747// AFDEndpointsPurgeContentFuture an abstraction for monitoring and retrieving the results of a 748// long-running operation. 749type AFDEndpointsPurgeContentFuture struct { 750 azure.FutureAPI 751 // Result returns the result of the asynchronous operation. 752 // If the operation has not completed it will return an error. 753 Result func(AFDEndpointsClient) (autorest.Response, error) 754} 755 756// AFDEndpointsUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 757// operation. 758type AFDEndpointsUpdateFuture struct { 759 azure.FutureAPI 760 // Result returns the result of the asynchronous operation. 761 // If the operation has not completed it will return an error. 762 Result func(AFDEndpointsClient) (AFDEndpoint, error) 763} 764 765// AFDEndpointUpdateParameters properties required to create or update an endpoint. 766type AFDEndpointUpdateParameters struct { 767 // Tags - Endpoint tags. 768 Tags map[string]*string `json:"tags"` 769 *AFDEndpointPropertiesUpdateParameters `json:"properties,omitempty"` 770} 771 772// MarshalJSON is the custom marshaler for AFDEndpointUpdateParameters. 773func (aeup AFDEndpointUpdateParameters) MarshalJSON() ([]byte, error) { 774 objectMap := make(map[string]interface{}) 775 if aeup.Tags != nil { 776 objectMap["tags"] = aeup.Tags 777 } 778 if aeup.AFDEndpointPropertiesUpdateParameters != nil { 779 objectMap["properties"] = aeup.AFDEndpointPropertiesUpdateParameters 780 } 781 return json.Marshal(objectMap) 782} 783 784// UnmarshalJSON is the custom unmarshaler for AFDEndpointUpdateParameters struct. 785func (aeup *AFDEndpointUpdateParameters) UnmarshalJSON(body []byte) error { 786 var m map[string]*json.RawMessage 787 err := json.Unmarshal(body, &m) 788 if err != nil { 789 return err 790 } 791 for k, v := range m { 792 switch k { 793 case "tags": 794 if v != nil { 795 var tags map[string]*string 796 err = json.Unmarshal(*v, &tags) 797 if err != nil { 798 return err 799 } 800 aeup.Tags = tags 801 } 802 case "properties": 803 if v != nil { 804 var aFDEndpointPropertiesUpdateParameters AFDEndpointPropertiesUpdateParameters 805 err = json.Unmarshal(*v, &aFDEndpointPropertiesUpdateParameters) 806 if err != nil { 807 return err 808 } 809 aeup.AFDEndpointPropertiesUpdateParameters = &aFDEndpointPropertiesUpdateParameters 810 } 811 } 812 } 813 814 return nil 815} 816 817// AfdErrorResponse common error response for all Azure Resource Manager APIs to return error details for 818// failed operations. (This also follows the OData error response format.). 819type AfdErrorResponse struct { 820 // Error - The error object. 821 Error *ErrorResponse `json:"error,omitempty"` 822} 823 824// AFDOrigin CDN origin is the source of the content being delivered via CDN. When the edge nodes 825// represented by an endpoint do not have the requested content cached, they attempt to fetch it from one 826// or more of the configured origins. 827type AFDOrigin struct { 828 autorest.Response `json:"-"` 829 *AFDOriginProperties `json:"properties,omitempty"` 830 // SystemData - READ-ONLY 831 SystemData *SystemData `json:"systemData,omitempty"` 832 // ID - READ-ONLY; Resource ID. 833 ID *string `json:"id,omitempty"` 834 // Name - READ-ONLY; Resource name. 835 Name *string `json:"name,omitempty"` 836 // Type - READ-ONLY; Resource type. 837 Type *string `json:"type,omitempty"` 838} 839 840// MarshalJSON is the custom marshaler for AFDOrigin. 841func (ao AFDOrigin) MarshalJSON() ([]byte, error) { 842 objectMap := make(map[string]interface{}) 843 if ao.AFDOriginProperties != nil { 844 objectMap["properties"] = ao.AFDOriginProperties 845 } 846 return json.Marshal(objectMap) 847} 848 849// UnmarshalJSON is the custom unmarshaler for AFDOrigin struct. 850func (ao *AFDOrigin) UnmarshalJSON(body []byte) error { 851 var m map[string]*json.RawMessage 852 err := json.Unmarshal(body, &m) 853 if err != nil { 854 return err 855 } 856 for k, v := range m { 857 switch k { 858 case "properties": 859 if v != nil { 860 var aFDOriginProperties AFDOriginProperties 861 err = json.Unmarshal(*v, &aFDOriginProperties) 862 if err != nil { 863 return err 864 } 865 ao.AFDOriginProperties = &aFDOriginProperties 866 } 867 case "systemData": 868 if v != nil { 869 var systemData SystemData 870 err = json.Unmarshal(*v, &systemData) 871 if err != nil { 872 return err 873 } 874 ao.SystemData = &systemData 875 } 876 case "id": 877 if v != nil { 878 var ID string 879 err = json.Unmarshal(*v, &ID) 880 if err != nil { 881 return err 882 } 883 ao.ID = &ID 884 } 885 case "name": 886 if v != nil { 887 var name string 888 err = json.Unmarshal(*v, &name) 889 if err != nil { 890 return err 891 } 892 ao.Name = &name 893 } 894 case "type": 895 if v != nil { 896 var typeVar string 897 err = json.Unmarshal(*v, &typeVar) 898 if err != nil { 899 return err 900 } 901 ao.Type = &typeVar 902 } 903 } 904 } 905 906 return nil 907} 908 909// AFDOriginGroup aFDOrigin group comprising of origins is used for load balancing to origins when the 910// content cannot be served from CDN. 911type AFDOriginGroup struct { 912 autorest.Response `json:"-"` 913 *AFDOriginGroupProperties `json:"properties,omitempty"` 914 // SystemData - READ-ONLY 915 SystemData *SystemData `json:"systemData,omitempty"` 916 // ID - READ-ONLY; Resource ID. 917 ID *string `json:"id,omitempty"` 918 // Name - READ-ONLY; Resource name. 919 Name *string `json:"name,omitempty"` 920 // Type - READ-ONLY; Resource type. 921 Type *string `json:"type,omitempty"` 922} 923 924// MarshalJSON is the custom marshaler for AFDOriginGroup. 925func (aog AFDOriginGroup) MarshalJSON() ([]byte, error) { 926 objectMap := make(map[string]interface{}) 927 if aog.AFDOriginGroupProperties != nil { 928 objectMap["properties"] = aog.AFDOriginGroupProperties 929 } 930 return json.Marshal(objectMap) 931} 932 933// UnmarshalJSON is the custom unmarshaler for AFDOriginGroup struct. 934func (aog *AFDOriginGroup) UnmarshalJSON(body []byte) error { 935 var m map[string]*json.RawMessage 936 err := json.Unmarshal(body, &m) 937 if err != nil { 938 return err 939 } 940 for k, v := range m { 941 switch k { 942 case "properties": 943 if v != nil { 944 var aFDOriginGroupProperties AFDOriginGroupProperties 945 err = json.Unmarshal(*v, &aFDOriginGroupProperties) 946 if err != nil { 947 return err 948 } 949 aog.AFDOriginGroupProperties = &aFDOriginGroupProperties 950 } 951 case "systemData": 952 if v != nil { 953 var systemData SystemData 954 err = json.Unmarshal(*v, &systemData) 955 if err != nil { 956 return err 957 } 958 aog.SystemData = &systemData 959 } 960 case "id": 961 if v != nil { 962 var ID string 963 err = json.Unmarshal(*v, &ID) 964 if err != nil { 965 return err 966 } 967 aog.ID = &ID 968 } 969 case "name": 970 if v != nil { 971 var name string 972 err = json.Unmarshal(*v, &name) 973 if err != nil { 974 return err 975 } 976 aog.Name = &name 977 } 978 case "type": 979 if v != nil { 980 var typeVar string 981 err = json.Unmarshal(*v, &typeVar) 982 if err != nil { 983 return err 984 } 985 aog.Type = &typeVar 986 } 987 } 988 } 989 990 return nil 991} 992 993// AFDOriginGroupListResult result of the request to list origin groups. It contains a list of origin 994// groups objects and a URL link to get the next set of results. 995type AFDOriginGroupListResult struct { 996 autorest.Response `json:"-"` 997 // Value - READ-ONLY; List of CDN origin groups within an endpoint 998 Value *[]AFDOriginGroup `json:"value,omitempty"` 999 // NextLink - URL to get the next set of origin objects if there are any. 1000 NextLink *string `json:"nextLink,omitempty"` 1001} 1002 1003// MarshalJSON is the custom marshaler for AFDOriginGroupListResult. 1004func (aoglr AFDOriginGroupListResult) MarshalJSON() ([]byte, error) { 1005 objectMap := make(map[string]interface{}) 1006 if aoglr.NextLink != nil { 1007 objectMap["nextLink"] = aoglr.NextLink 1008 } 1009 return json.Marshal(objectMap) 1010} 1011 1012// AFDOriginGroupListResultIterator provides access to a complete listing of AFDOriginGroup values. 1013type AFDOriginGroupListResultIterator struct { 1014 i int 1015 page AFDOriginGroupListResultPage 1016} 1017 1018// NextWithContext advances to the next value. If there was an error making 1019// the request the iterator does not advance and the error is returned. 1020func (iter *AFDOriginGroupListResultIterator) NextWithContext(ctx context.Context) (err error) { 1021 if tracing.IsEnabled() { 1022 ctx = tracing.StartSpan(ctx, fqdn+"/AFDOriginGroupListResultIterator.NextWithContext") 1023 defer func() { 1024 sc := -1 1025 if iter.Response().Response.Response != nil { 1026 sc = iter.Response().Response.Response.StatusCode 1027 } 1028 tracing.EndSpan(ctx, sc, err) 1029 }() 1030 } 1031 iter.i++ 1032 if iter.i < len(iter.page.Values()) { 1033 return nil 1034 } 1035 err = iter.page.NextWithContext(ctx) 1036 if err != nil { 1037 iter.i-- 1038 return err 1039 } 1040 iter.i = 0 1041 return nil 1042} 1043 1044// Next advances to the next value. If there was an error making 1045// the request the iterator does not advance and the error is returned. 1046// Deprecated: Use NextWithContext() instead. 1047func (iter *AFDOriginGroupListResultIterator) Next() error { 1048 return iter.NextWithContext(context.Background()) 1049} 1050 1051// NotDone returns true if the enumeration should be started or is not yet complete. 1052func (iter AFDOriginGroupListResultIterator) NotDone() bool { 1053 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 1054} 1055 1056// Response returns the raw server response from the last page request. 1057func (iter AFDOriginGroupListResultIterator) Response() AFDOriginGroupListResult { 1058 return iter.page.Response() 1059} 1060 1061// Value returns the current value or a zero-initialized value if the 1062// iterator has advanced beyond the end of the collection. 1063func (iter AFDOriginGroupListResultIterator) Value() AFDOriginGroup { 1064 if !iter.page.NotDone() { 1065 return AFDOriginGroup{} 1066 } 1067 return iter.page.Values()[iter.i] 1068} 1069 1070// Creates a new instance of the AFDOriginGroupListResultIterator type. 1071func NewAFDOriginGroupListResultIterator(page AFDOriginGroupListResultPage) AFDOriginGroupListResultIterator { 1072 return AFDOriginGroupListResultIterator{page: page} 1073} 1074 1075// IsEmpty returns true if the ListResult contains no values. 1076func (aoglr AFDOriginGroupListResult) IsEmpty() bool { 1077 return aoglr.Value == nil || len(*aoglr.Value) == 0 1078} 1079 1080// hasNextLink returns true if the NextLink is not empty. 1081func (aoglr AFDOriginGroupListResult) hasNextLink() bool { 1082 return aoglr.NextLink != nil && len(*aoglr.NextLink) != 0 1083} 1084 1085// aFDOriginGroupListResultPreparer prepares a request to retrieve the next set of results. 1086// It returns nil if no more results exist. 1087func (aoglr AFDOriginGroupListResult) aFDOriginGroupListResultPreparer(ctx context.Context) (*http.Request, error) { 1088 if !aoglr.hasNextLink() { 1089 return nil, nil 1090 } 1091 return autorest.Prepare((&http.Request{}).WithContext(ctx), 1092 autorest.AsJSON(), 1093 autorest.AsGet(), 1094 autorest.WithBaseURL(to.String(aoglr.NextLink))) 1095} 1096 1097// AFDOriginGroupListResultPage contains a page of AFDOriginGroup values. 1098type AFDOriginGroupListResultPage struct { 1099 fn func(context.Context, AFDOriginGroupListResult) (AFDOriginGroupListResult, error) 1100 aoglr AFDOriginGroupListResult 1101} 1102 1103// NextWithContext advances to the next page of values. If there was an error making 1104// the request the page does not advance and the error is returned. 1105func (page *AFDOriginGroupListResultPage) NextWithContext(ctx context.Context) (err error) { 1106 if tracing.IsEnabled() { 1107 ctx = tracing.StartSpan(ctx, fqdn+"/AFDOriginGroupListResultPage.NextWithContext") 1108 defer func() { 1109 sc := -1 1110 if page.Response().Response.Response != nil { 1111 sc = page.Response().Response.Response.StatusCode 1112 } 1113 tracing.EndSpan(ctx, sc, err) 1114 }() 1115 } 1116 for { 1117 next, err := page.fn(ctx, page.aoglr) 1118 if err != nil { 1119 return err 1120 } 1121 page.aoglr = next 1122 if !next.hasNextLink() || !next.IsEmpty() { 1123 break 1124 } 1125 } 1126 return nil 1127} 1128 1129// Next advances to the next page of values. If there was an error making 1130// the request the page does not advance and the error is returned. 1131// Deprecated: Use NextWithContext() instead. 1132func (page *AFDOriginGroupListResultPage) Next() error { 1133 return page.NextWithContext(context.Background()) 1134} 1135 1136// NotDone returns true if the page enumeration should be started or is not yet complete. 1137func (page AFDOriginGroupListResultPage) NotDone() bool { 1138 return !page.aoglr.IsEmpty() 1139} 1140 1141// Response returns the raw server response from the last page request. 1142func (page AFDOriginGroupListResultPage) Response() AFDOriginGroupListResult { 1143 return page.aoglr 1144} 1145 1146// Values returns the slice of values for the current page or nil if there are no values. 1147func (page AFDOriginGroupListResultPage) Values() []AFDOriginGroup { 1148 if page.aoglr.IsEmpty() { 1149 return nil 1150 } 1151 return *page.aoglr.Value 1152} 1153 1154// Creates a new instance of the AFDOriginGroupListResultPage type. 1155func NewAFDOriginGroupListResultPage(cur AFDOriginGroupListResult, getNextPage func(context.Context, AFDOriginGroupListResult) (AFDOriginGroupListResult, error)) AFDOriginGroupListResultPage { 1156 return AFDOriginGroupListResultPage{ 1157 fn: getNextPage, 1158 aoglr: cur, 1159 } 1160} 1161 1162// AFDOriginGroupProperties the JSON object that contains the properties of the origin group. 1163type AFDOriginGroupProperties struct { 1164 // LoadBalancingSettings - Load balancing settings for a backend pool 1165 LoadBalancingSettings *LoadBalancingSettingsParameters `json:"loadBalancingSettings,omitempty"` 1166 // HealthProbeSettings - Health probe settings to the origin that is used to determine the health of the origin. 1167 HealthProbeSettings *HealthProbeParameters `json:"healthProbeSettings,omitempty"` 1168 // TrafficRestorationTimeToHealedOrNewEndpointsInMinutes - Time in minutes to shift the traffic to the endpoint gradually when an unhealthy endpoint comes healthy or a new endpoint is added. Default is 10 mins. This property is currently not supported. 1169 TrafficRestorationTimeToHealedOrNewEndpointsInMinutes *int32 `json:"trafficRestorationTimeToHealedOrNewEndpointsInMinutes,omitempty"` 1170 // ResponseBasedAfdOriginErrorDetectionSettings - The JSON object that contains the properties to determine origin health using real requests/responses. This property is currently not supported. 1171 ResponseBasedAfdOriginErrorDetectionSettings *ResponseBasedOriginErrorDetectionParameters `json:"responseBasedAfdOriginErrorDetectionSettings,omitempty"` 1172 // SessionAffinityState - Whether to allow session affinity on this host. Valid options are 'Enabled' or 'Disabled'. Possible values include: 'EnabledStateEnabled', 'EnabledStateDisabled' 1173 SessionAffinityState EnabledState `json:"sessionAffinityState,omitempty"` 1174 // ProvisioningState - READ-ONLY; Provisioning status. Possible values include: 'Succeeded', 'Failed', 'Updating', 'Deleting', 'Creating' 1175 ProvisioningState AfdProvisioningState `json:"provisioningState,omitempty"` 1176 // DeploymentStatus - READ-ONLY; Possible values include: 'DeploymentStatusNotStarted', 'DeploymentStatusInProgress', 'DeploymentStatusSucceeded', 'DeploymentStatusFailed' 1177 DeploymentStatus DeploymentStatus `json:"deploymentStatus,omitempty"` 1178} 1179 1180// MarshalJSON is the custom marshaler for AFDOriginGroupProperties. 1181func (aogp AFDOriginGroupProperties) MarshalJSON() ([]byte, error) { 1182 objectMap := make(map[string]interface{}) 1183 if aogp.LoadBalancingSettings != nil { 1184 objectMap["loadBalancingSettings"] = aogp.LoadBalancingSettings 1185 } 1186 if aogp.HealthProbeSettings != nil { 1187 objectMap["healthProbeSettings"] = aogp.HealthProbeSettings 1188 } 1189 if aogp.TrafficRestorationTimeToHealedOrNewEndpointsInMinutes != nil { 1190 objectMap["trafficRestorationTimeToHealedOrNewEndpointsInMinutes"] = aogp.TrafficRestorationTimeToHealedOrNewEndpointsInMinutes 1191 } 1192 if aogp.ResponseBasedAfdOriginErrorDetectionSettings != nil { 1193 objectMap["responseBasedAfdOriginErrorDetectionSettings"] = aogp.ResponseBasedAfdOriginErrorDetectionSettings 1194 } 1195 if aogp.SessionAffinityState != "" { 1196 objectMap["sessionAffinityState"] = aogp.SessionAffinityState 1197 } 1198 return json.Marshal(objectMap) 1199} 1200 1201// AFDOriginGroupsCreateFuture an abstraction for monitoring and retrieving the results of a long-running 1202// operation. 1203type AFDOriginGroupsCreateFuture struct { 1204 azure.FutureAPI 1205 // Result returns the result of the asynchronous operation. 1206 // If the operation has not completed it will return an error. 1207 Result func(AFDOriginGroupsClient) (AFDOriginGroup, error) 1208} 1209 1210// AFDOriginGroupsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running 1211// operation. 1212type AFDOriginGroupsDeleteFuture struct { 1213 azure.FutureAPI 1214 // Result returns the result of the asynchronous operation. 1215 // If the operation has not completed it will return an error. 1216 Result func(AFDOriginGroupsClient) (autorest.Response, error) 1217} 1218 1219// AFDOriginGroupsUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 1220// operation. 1221type AFDOriginGroupsUpdateFuture struct { 1222 azure.FutureAPI 1223 // Result returns the result of the asynchronous operation. 1224 // If the operation has not completed it will return an error. 1225 Result func(AFDOriginGroupsClient) (AFDOriginGroup, error) 1226} 1227 1228// AFDOriginGroupUpdateParameters aFDOrigin group properties needed for origin group creation or update. 1229type AFDOriginGroupUpdateParameters struct { 1230 *AFDOriginGroupUpdatePropertiesParameters `json:"properties,omitempty"` 1231} 1232 1233// MarshalJSON is the custom marshaler for AFDOriginGroupUpdateParameters. 1234func (aogup AFDOriginGroupUpdateParameters) MarshalJSON() ([]byte, error) { 1235 objectMap := make(map[string]interface{}) 1236 if aogup.AFDOriginGroupUpdatePropertiesParameters != nil { 1237 objectMap["properties"] = aogup.AFDOriginGroupUpdatePropertiesParameters 1238 } 1239 return json.Marshal(objectMap) 1240} 1241 1242// UnmarshalJSON is the custom unmarshaler for AFDOriginGroupUpdateParameters struct. 1243func (aogup *AFDOriginGroupUpdateParameters) UnmarshalJSON(body []byte) error { 1244 var m map[string]*json.RawMessage 1245 err := json.Unmarshal(body, &m) 1246 if err != nil { 1247 return err 1248 } 1249 for k, v := range m { 1250 switch k { 1251 case "properties": 1252 if v != nil { 1253 var aFDOriginGroupUpdatePropertiesParameters AFDOriginGroupUpdatePropertiesParameters 1254 err = json.Unmarshal(*v, &aFDOriginGroupUpdatePropertiesParameters) 1255 if err != nil { 1256 return err 1257 } 1258 aogup.AFDOriginGroupUpdatePropertiesParameters = &aFDOriginGroupUpdatePropertiesParameters 1259 } 1260 } 1261 } 1262 1263 return nil 1264} 1265 1266// AFDOriginGroupUpdatePropertiesParameters the JSON object that contains the properties of the origin 1267// group. 1268type AFDOriginGroupUpdatePropertiesParameters struct { 1269 // LoadBalancingSettings - Load balancing settings for a backend pool 1270 LoadBalancingSettings *LoadBalancingSettingsParameters `json:"loadBalancingSettings,omitempty"` 1271 // HealthProbeSettings - Health probe settings to the origin that is used to determine the health of the origin. 1272 HealthProbeSettings *HealthProbeParameters `json:"healthProbeSettings,omitempty"` 1273 // TrafficRestorationTimeToHealedOrNewEndpointsInMinutes - Time in minutes to shift the traffic to the endpoint gradually when an unhealthy endpoint comes healthy or a new endpoint is added. Default is 10 mins. This property is currently not supported. 1274 TrafficRestorationTimeToHealedOrNewEndpointsInMinutes *int32 `json:"trafficRestorationTimeToHealedOrNewEndpointsInMinutes,omitempty"` 1275 // ResponseBasedAfdOriginErrorDetectionSettings - The JSON object that contains the properties to determine origin health using real requests/responses. This property is currently not supported. 1276 ResponseBasedAfdOriginErrorDetectionSettings *ResponseBasedOriginErrorDetectionParameters `json:"responseBasedAfdOriginErrorDetectionSettings,omitempty"` 1277 // SessionAffinityState - Whether to allow session affinity on this host. Valid options are 'Enabled' or 'Disabled'. Possible values include: 'EnabledStateEnabled', 'EnabledStateDisabled' 1278 SessionAffinityState EnabledState `json:"sessionAffinityState,omitempty"` 1279} 1280 1281// AFDOriginListResult result of the request to list origins. It contains a list of origin objects and a 1282// URL link to get the next set of results. 1283type AFDOriginListResult struct { 1284 autorest.Response `json:"-"` 1285 // Value - READ-ONLY; List of CDN origins within an endpoint 1286 Value *[]AFDOrigin `json:"value,omitempty"` 1287 // NextLink - URL to get the next set of origin objects if there are any. 1288 NextLink *string `json:"nextLink,omitempty"` 1289} 1290 1291// MarshalJSON is the custom marshaler for AFDOriginListResult. 1292func (aolr AFDOriginListResult) MarshalJSON() ([]byte, error) { 1293 objectMap := make(map[string]interface{}) 1294 if aolr.NextLink != nil { 1295 objectMap["nextLink"] = aolr.NextLink 1296 } 1297 return json.Marshal(objectMap) 1298} 1299 1300// AFDOriginListResultIterator provides access to a complete listing of AFDOrigin values. 1301type AFDOriginListResultIterator struct { 1302 i int 1303 page AFDOriginListResultPage 1304} 1305 1306// NextWithContext advances to the next value. If there was an error making 1307// the request the iterator does not advance and the error is returned. 1308func (iter *AFDOriginListResultIterator) NextWithContext(ctx context.Context) (err error) { 1309 if tracing.IsEnabled() { 1310 ctx = tracing.StartSpan(ctx, fqdn+"/AFDOriginListResultIterator.NextWithContext") 1311 defer func() { 1312 sc := -1 1313 if iter.Response().Response.Response != nil { 1314 sc = iter.Response().Response.Response.StatusCode 1315 } 1316 tracing.EndSpan(ctx, sc, err) 1317 }() 1318 } 1319 iter.i++ 1320 if iter.i < len(iter.page.Values()) { 1321 return nil 1322 } 1323 err = iter.page.NextWithContext(ctx) 1324 if err != nil { 1325 iter.i-- 1326 return err 1327 } 1328 iter.i = 0 1329 return nil 1330} 1331 1332// Next advances to the next value. If there was an error making 1333// the request the iterator does not advance and the error is returned. 1334// Deprecated: Use NextWithContext() instead. 1335func (iter *AFDOriginListResultIterator) Next() error { 1336 return iter.NextWithContext(context.Background()) 1337} 1338 1339// NotDone returns true if the enumeration should be started or is not yet complete. 1340func (iter AFDOriginListResultIterator) NotDone() bool { 1341 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 1342} 1343 1344// Response returns the raw server response from the last page request. 1345func (iter AFDOriginListResultIterator) Response() AFDOriginListResult { 1346 return iter.page.Response() 1347} 1348 1349// Value returns the current value or a zero-initialized value if the 1350// iterator has advanced beyond the end of the collection. 1351func (iter AFDOriginListResultIterator) Value() AFDOrigin { 1352 if !iter.page.NotDone() { 1353 return AFDOrigin{} 1354 } 1355 return iter.page.Values()[iter.i] 1356} 1357 1358// Creates a new instance of the AFDOriginListResultIterator type. 1359func NewAFDOriginListResultIterator(page AFDOriginListResultPage) AFDOriginListResultIterator { 1360 return AFDOriginListResultIterator{page: page} 1361} 1362 1363// IsEmpty returns true if the ListResult contains no values. 1364func (aolr AFDOriginListResult) IsEmpty() bool { 1365 return aolr.Value == nil || len(*aolr.Value) == 0 1366} 1367 1368// hasNextLink returns true if the NextLink is not empty. 1369func (aolr AFDOriginListResult) hasNextLink() bool { 1370 return aolr.NextLink != nil && len(*aolr.NextLink) != 0 1371} 1372 1373// aFDOriginListResultPreparer prepares a request to retrieve the next set of results. 1374// It returns nil if no more results exist. 1375func (aolr AFDOriginListResult) aFDOriginListResultPreparer(ctx context.Context) (*http.Request, error) { 1376 if !aolr.hasNextLink() { 1377 return nil, nil 1378 } 1379 return autorest.Prepare((&http.Request{}).WithContext(ctx), 1380 autorest.AsJSON(), 1381 autorest.AsGet(), 1382 autorest.WithBaseURL(to.String(aolr.NextLink))) 1383} 1384 1385// AFDOriginListResultPage contains a page of AFDOrigin values. 1386type AFDOriginListResultPage struct { 1387 fn func(context.Context, AFDOriginListResult) (AFDOriginListResult, error) 1388 aolr AFDOriginListResult 1389} 1390 1391// NextWithContext advances to the next page of values. If there was an error making 1392// the request the page does not advance and the error is returned. 1393func (page *AFDOriginListResultPage) NextWithContext(ctx context.Context) (err error) { 1394 if tracing.IsEnabled() { 1395 ctx = tracing.StartSpan(ctx, fqdn+"/AFDOriginListResultPage.NextWithContext") 1396 defer func() { 1397 sc := -1 1398 if page.Response().Response.Response != nil { 1399 sc = page.Response().Response.Response.StatusCode 1400 } 1401 tracing.EndSpan(ctx, sc, err) 1402 }() 1403 } 1404 for { 1405 next, err := page.fn(ctx, page.aolr) 1406 if err != nil { 1407 return err 1408 } 1409 page.aolr = next 1410 if !next.hasNextLink() || !next.IsEmpty() { 1411 break 1412 } 1413 } 1414 return nil 1415} 1416 1417// Next advances to the next page of values. If there was an error making 1418// the request the page does not advance and the error is returned. 1419// Deprecated: Use NextWithContext() instead. 1420func (page *AFDOriginListResultPage) Next() error { 1421 return page.NextWithContext(context.Background()) 1422} 1423 1424// NotDone returns true if the page enumeration should be started or is not yet complete. 1425func (page AFDOriginListResultPage) NotDone() bool { 1426 return !page.aolr.IsEmpty() 1427} 1428 1429// Response returns the raw server response from the last page request. 1430func (page AFDOriginListResultPage) Response() AFDOriginListResult { 1431 return page.aolr 1432} 1433 1434// Values returns the slice of values for the current page or nil if there are no values. 1435func (page AFDOriginListResultPage) Values() []AFDOrigin { 1436 if page.aolr.IsEmpty() { 1437 return nil 1438 } 1439 return *page.aolr.Value 1440} 1441 1442// Creates a new instance of the AFDOriginListResultPage type. 1443func NewAFDOriginListResultPage(cur AFDOriginListResult, getNextPage func(context.Context, AFDOriginListResult) (AFDOriginListResult, error)) AFDOriginListResultPage { 1444 return AFDOriginListResultPage{ 1445 fn: getNextPage, 1446 aolr: cur, 1447 } 1448} 1449 1450// AFDOriginProperties the JSON object that contains the properties of the origin. 1451type AFDOriginProperties struct { 1452 // AzureOrigin - Resource reference to the Azure origin resource. 1453 AzureOrigin *ResourceReference `json:"azureOrigin,omitempty"` 1454 // HostName - The address of the origin. Domain names, IPv4 addresses, and IPv6 addresses are supported.This should be unique across all origins in an endpoint. 1455 HostName *string `json:"hostName,omitempty"` 1456 // HTTPPort - The value of the HTTP port. Must be between 1 and 65535. 1457 HTTPPort *int32 `json:"httpPort,omitempty"` 1458 // HTTPSPort - The value of the HTTPS port. Must be between 1 and 65535. 1459 HTTPSPort *int32 `json:"httpsPort,omitempty"` 1460 // OriginHostHeader - The host header value sent to the origin with each request. If you leave this blank, the request hostname determines this value. Azure CDN origins, such as Web Apps, Blob Storage, and Cloud Services require this host header value to match the origin hostname by default. This overrides the host header defined at Endpoint 1461 OriginHostHeader *string `json:"originHostHeader,omitempty"` 1462 // Priority - Priority of origin in given origin group for load balancing. Higher priorities will not be used for load balancing if any lower priority origin is healthy.Must be between 1 and 5 1463 Priority *int32 `json:"priority,omitempty"` 1464 // Weight - Weight of the origin in given origin group for load balancing. Must be between 1 and 1000 1465 Weight *int32 `json:"weight,omitempty"` 1466 // SharedPrivateLinkResource - The properties of the private link resource for private origin. 1467 SharedPrivateLinkResource interface{} `json:"sharedPrivateLinkResource,omitempty"` 1468 // EnabledState - Whether to enable health probes to be made against backends defined under backendPools. Health probes can only be disabled if there is a single enabled backend in single enabled backend pool. Possible values include: 'EnabledStateEnabled', 'EnabledStateDisabled' 1469 EnabledState EnabledState `json:"enabledState,omitempty"` 1470 // ProvisioningState - READ-ONLY; Provisioning status. Possible values include: 'Succeeded', 'Failed', 'Updating', 'Deleting', 'Creating' 1471 ProvisioningState AfdProvisioningState `json:"provisioningState,omitempty"` 1472 // DeploymentStatus - READ-ONLY; Possible values include: 'DeploymentStatusNotStarted', 'DeploymentStatusInProgress', 'DeploymentStatusSucceeded', 'DeploymentStatusFailed' 1473 DeploymentStatus DeploymentStatus `json:"deploymentStatus,omitempty"` 1474} 1475 1476// MarshalJSON is the custom marshaler for AFDOriginProperties. 1477func (aop AFDOriginProperties) MarshalJSON() ([]byte, error) { 1478 objectMap := make(map[string]interface{}) 1479 if aop.AzureOrigin != nil { 1480 objectMap["azureOrigin"] = aop.AzureOrigin 1481 } 1482 if aop.HostName != nil { 1483 objectMap["hostName"] = aop.HostName 1484 } 1485 if aop.HTTPPort != nil { 1486 objectMap["httpPort"] = aop.HTTPPort 1487 } 1488 if aop.HTTPSPort != nil { 1489 objectMap["httpsPort"] = aop.HTTPSPort 1490 } 1491 if aop.OriginHostHeader != nil { 1492 objectMap["originHostHeader"] = aop.OriginHostHeader 1493 } 1494 if aop.Priority != nil { 1495 objectMap["priority"] = aop.Priority 1496 } 1497 if aop.Weight != nil { 1498 objectMap["weight"] = aop.Weight 1499 } 1500 if aop.SharedPrivateLinkResource != nil { 1501 objectMap["sharedPrivateLinkResource"] = aop.SharedPrivateLinkResource 1502 } 1503 if aop.EnabledState != "" { 1504 objectMap["enabledState"] = aop.EnabledState 1505 } 1506 return json.Marshal(objectMap) 1507} 1508 1509// AFDOriginsCreateFuture an abstraction for monitoring and retrieving the results of a long-running 1510// operation. 1511type AFDOriginsCreateFuture struct { 1512 azure.FutureAPI 1513 // Result returns the result of the asynchronous operation. 1514 // If the operation has not completed it will return an error. 1515 Result func(AFDOriginsClient) (AFDOrigin, error) 1516} 1517 1518// AFDOriginsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running 1519// operation. 1520type AFDOriginsDeleteFuture struct { 1521 azure.FutureAPI 1522 // Result returns the result of the asynchronous operation. 1523 // If the operation has not completed it will return an error. 1524 Result func(AFDOriginsClient) (autorest.Response, error) 1525} 1526 1527// AFDOriginsUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 1528// operation. 1529type AFDOriginsUpdateFuture struct { 1530 azure.FutureAPI 1531 // Result returns the result of the asynchronous operation. 1532 // If the operation has not completed it will return an error. 1533 Result func(AFDOriginsClient) (AFDOrigin, error) 1534} 1535 1536// AFDOriginUpdateParameters aFDOrigin properties needed for origin update. 1537type AFDOriginUpdateParameters struct { 1538 *AFDOriginUpdatePropertiesParameters `json:"properties,omitempty"` 1539} 1540 1541// MarshalJSON is the custom marshaler for AFDOriginUpdateParameters. 1542func (aoup AFDOriginUpdateParameters) MarshalJSON() ([]byte, error) { 1543 objectMap := make(map[string]interface{}) 1544 if aoup.AFDOriginUpdatePropertiesParameters != nil { 1545 objectMap["properties"] = aoup.AFDOriginUpdatePropertiesParameters 1546 } 1547 return json.Marshal(objectMap) 1548} 1549 1550// UnmarshalJSON is the custom unmarshaler for AFDOriginUpdateParameters struct. 1551func (aoup *AFDOriginUpdateParameters) UnmarshalJSON(body []byte) error { 1552 var m map[string]*json.RawMessage 1553 err := json.Unmarshal(body, &m) 1554 if err != nil { 1555 return err 1556 } 1557 for k, v := range m { 1558 switch k { 1559 case "properties": 1560 if v != nil { 1561 var aFDOriginUpdatePropertiesParameters AFDOriginUpdatePropertiesParameters 1562 err = json.Unmarshal(*v, &aFDOriginUpdatePropertiesParameters) 1563 if err != nil { 1564 return err 1565 } 1566 aoup.AFDOriginUpdatePropertiesParameters = &aFDOriginUpdatePropertiesParameters 1567 } 1568 } 1569 } 1570 1571 return nil 1572} 1573 1574// AFDOriginUpdatePropertiesParameters the JSON object that contains the properties of the origin. 1575type AFDOriginUpdatePropertiesParameters struct { 1576 // AzureOrigin - Resource reference to the Azure origin resource. 1577 AzureOrigin *ResourceReference `json:"azureOrigin,omitempty"` 1578 // HostName - The address of the origin. Domain names, IPv4 addresses, and IPv6 addresses are supported.This should be unique across all origins in an endpoint. 1579 HostName *string `json:"hostName,omitempty"` 1580 // HTTPPort - The value of the HTTP port. Must be between 1 and 65535. 1581 HTTPPort *int32 `json:"httpPort,omitempty"` 1582 // HTTPSPort - The value of the HTTPS port. Must be between 1 and 65535. 1583 HTTPSPort *int32 `json:"httpsPort,omitempty"` 1584 // OriginHostHeader - The host header value sent to the origin with each request. If you leave this blank, the request hostname determines this value. Azure CDN origins, such as Web Apps, Blob Storage, and Cloud Services require this host header value to match the origin hostname by default. This overrides the host header defined at Endpoint 1585 OriginHostHeader *string `json:"originHostHeader,omitempty"` 1586 // Priority - Priority of origin in given origin group for load balancing. Higher priorities will not be used for load balancing if any lower priority origin is healthy.Must be between 1 and 5 1587 Priority *int32 `json:"priority,omitempty"` 1588 // Weight - Weight of the origin in given origin group for load balancing. Must be between 1 and 1000 1589 Weight *int32 `json:"weight,omitempty"` 1590 // SharedPrivateLinkResource - The properties of the private link resource for private origin. 1591 SharedPrivateLinkResource interface{} `json:"sharedPrivateLinkResource,omitempty"` 1592 // EnabledState - Whether to enable health probes to be made against backends defined under backendPools. Health probes can only be disabled if there is a single enabled backend in single enabled backend pool. Possible values include: 'EnabledStateEnabled', 'EnabledStateDisabled' 1593 EnabledState EnabledState `json:"enabledState,omitempty"` 1594} 1595 1596// AfdPurgeParameters parameters required for content purge. 1597type AfdPurgeParameters struct { 1598 // ContentPaths - The path to the content to be purged. Can describe a file path or a wild card directory. 1599 ContentPaths *[]string `json:"contentPaths,omitempty"` 1600 // Domains - List of domains. 1601 Domains *[]string `json:"domains,omitempty"` 1602} 1603 1604// AFDStateProperties the tracking states for afd resources. 1605type AFDStateProperties struct { 1606 // ProvisioningState - READ-ONLY; Provisioning status. Possible values include: 'Succeeded', 'Failed', 'Updating', 'Deleting', 'Creating' 1607 ProvisioningState AfdProvisioningState `json:"provisioningState,omitempty"` 1608 // DeploymentStatus - READ-ONLY; Possible values include: 'DeploymentStatusNotStarted', 'DeploymentStatusInProgress', 'DeploymentStatusSucceeded', 'DeploymentStatusFailed' 1609 DeploymentStatus DeploymentStatus `json:"deploymentStatus,omitempty"` 1610} 1611 1612// CacheExpirationActionParameters defines the parameters for the cache expiration action. 1613type CacheExpirationActionParameters struct { 1614 OdataType *string `json:"@odata.type,omitempty"` 1615 // CacheBehavior - Caching behavior for the requests. Possible values include: 'BypassCache', 'Override', 'SetIfMissing' 1616 CacheBehavior CacheBehavior `json:"cacheBehavior,omitempty"` 1617 // CacheType - The level at which the content needs to be cached. 1618 CacheType *string `json:"cacheType,omitempty"` 1619 // CacheDuration - The duration for which the content needs to be cached. Allowed format is [d.]hh:mm:ss 1620 CacheDuration *string `json:"cacheDuration,omitempty"` 1621} 1622 1623// CacheKeyQueryStringActionParameters defines the parameters for the cache-key query string action. 1624type CacheKeyQueryStringActionParameters struct { 1625 OdataType *string `json:"@odata.type,omitempty"` 1626 // QueryStringBehavior - Caching behavior for the requests. Possible values include: 'Include', 'IncludeAll', 'Exclude', 'ExcludeAll' 1627 QueryStringBehavior QueryStringBehavior `json:"queryStringBehavior,omitempty"` 1628 // QueryParameters - query parameters to include or exclude (comma separated). 1629 QueryParameters *string `json:"queryParameters,omitempty"` 1630} 1631 1632// Certificate certificate used for https 1633type Certificate struct { 1634 // Subject - Subject name in the certificate. 1635 Subject *string `json:"subject,omitempty"` 1636 // ExpirationDate - Certificate expiration date. 1637 ExpirationDate *string `json:"expirationDate,omitempty"` 1638 // Thumbprint - Certificate thumbprint. 1639 Thumbprint *string `json:"thumbprint,omitempty"` 1640} 1641 1642// CertificateSourceParameters defines the parameters for using CDN managed certificate for securing custom 1643// domain. 1644type CertificateSourceParameters struct { 1645 OdataType *string `json:"@odata.type,omitempty"` 1646 // CertificateType - Type of certificate used. Possible values include: 'Shared', 'Dedicated' 1647 CertificateType CertificateType `json:"certificateType,omitempty"` 1648} 1649 1650// CheckNameAvailabilityInput input of CheckNameAvailability API. 1651type CheckNameAvailabilityInput struct { 1652 // Name - The resource name to validate. 1653 Name *string `json:"name,omitempty"` 1654 // Type - The type of the resource whose name is to be validated. 1655 Type *string `json:"type,omitempty"` 1656} 1657 1658// CheckNameAvailabilityOutput output of check name availability API. 1659type CheckNameAvailabilityOutput struct { 1660 autorest.Response `json:"-"` 1661 // NameAvailable - READ-ONLY; Indicates whether the name is available. 1662 NameAvailable *bool `json:"nameAvailable,omitempty"` 1663 // Reason - READ-ONLY; The reason why the name is not available. 1664 Reason *string `json:"reason,omitempty"` 1665 // Message - READ-ONLY; The detailed error message describing why the name is not available. 1666 Message *string `json:"message,omitempty"` 1667} 1668 1669// CidrIPAddress CIDR Ip address 1670type CidrIPAddress struct { 1671 // BaseIPAddress - Ip address itself. 1672 BaseIPAddress *string `json:"baseIpAddress,omitempty"` 1673 // PrefixLength - The length of the prefix of the ip address. 1674 PrefixLength *int32 `json:"prefixLength,omitempty"` 1675} 1676 1677// CompressionSettings settings for compression. 1678type CompressionSettings struct { 1679 // ContentTypesToCompress - List of content types on which compression applies. The value should be a valid MIME type. 1680 ContentTypesToCompress *[]string `json:"contentTypesToCompress,omitempty"` 1681 // IsCompressionEnabled - Indicates whether content compression is enabled on AzureFrontDoor. 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 AzureFrontDoor when requested content is smaller than 1 byte or larger than 1 MB. 1682 IsCompressionEnabled *bool `json:"isCompressionEnabled,omitempty"` 1683} 1684 1685// ContinentsResponse continents Response 1686type ContinentsResponse struct { 1687 autorest.Response `json:"-"` 1688 Continents *[]ContinentsResponseContinentsItem `json:"continents,omitempty"` 1689 CountryOrRegions *[]ContinentsResponseCountryOrRegionsItem `json:"countryOrRegions,omitempty"` 1690} 1691 1692// ContinentsResponseContinentsItem ... 1693type ContinentsResponseContinentsItem struct { 1694 ID *string `json:"id,omitempty"` 1695} 1696 1697// ContinentsResponseCountryOrRegionsItem ... 1698type ContinentsResponseCountryOrRegionsItem struct { 1699 ID *string `json:"id,omitempty"` 1700 ContinentID *string `json:"continentId,omitempty"` 1701} 1702 1703// CookiesMatchConditionParameters defines the parameters for Cookies match conditions 1704type CookiesMatchConditionParameters struct { 1705 OdataType *string `json:"@odata.type,omitempty"` 1706 // Selector - Name of Cookies to be matched 1707 Selector *string `json:"selector,omitempty"` 1708 // Operator - Describes operator to be matched. Possible values include: 'Any', 'Equal', 'Contains', 'BeginsWith', 'EndsWith', 'LessThan', 'LessThanOrEqual', 'GreaterThan', 'GreaterThanOrEqual', 'RegEx' 1709 Operator CookiesOperator `json:"operator,omitempty"` 1710 // NegateCondition - Describes if this is negate condition or not 1711 NegateCondition *bool `json:"negateCondition,omitempty"` 1712 // MatchValues - The match value for the condition of the delivery rule 1713 MatchValues *[]string `json:"matchValues,omitempty"` 1714 // Transforms - List of transforms 1715 Transforms *[]Transform `json:"transforms,omitempty"` 1716} 1717 1718// CustomDomain friendly domain name mapping to the endpoint hostname that the customer provides for 1719// branding purposes, e.g. www.contoso.com. 1720type CustomDomain struct { 1721 autorest.Response `json:"-"` 1722 *CustomDomainProperties `json:"properties,omitempty"` 1723 // SystemData - READ-ONLY 1724 SystemData *SystemData `json:"systemData,omitempty"` 1725 // ID - READ-ONLY; Resource ID. 1726 ID *string `json:"id,omitempty"` 1727 // Name - READ-ONLY; Resource name. 1728 Name *string `json:"name,omitempty"` 1729 // Type - READ-ONLY; Resource type. 1730 Type *string `json:"type,omitempty"` 1731} 1732 1733// MarshalJSON is the custom marshaler for CustomDomain. 1734func (cd CustomDomain) MarshalJSON() ([]byte, error) { 1735 objectMap := make(map[string]interface{}) 1736 if cd.CustomDomainProperties != nil { 1737 objectMap["properties"] = cd.CustomDomainProperties 1738 } 1739 return json.Marshal(objectMap) 1740} 1741 1742// UnmarshalJSON is the custom unmarshaler for CustomDomain struct. 1743func (cd *CustomDomain) UnmarshalJSON(body []byte) error { 1744 var m map[string]*json.RawMessage 1745 err := json.Unmarshal(body, &m) 1746 if err != nil { 1747 return err 1748 } 1749 for k, v := range m { 1750 switch k { 1751 case "properties": 1752 if v != nil { 1753 var customDomainProperties CustomDomainProperties 1754 err = json.Unmarshal(*v, &customDomainProperties) 1755 if err != nil { 1756 return err 1757 } 1758 cd.CustomDomainProperties = &customDomainProperties 1759 } 1760 case "systemData": 1761 if v != nil { 1762 var systemData SystemData 1763 err = json.Unmarshal(*v, &systemData) 1764 if err != nil { 1765 return err 1766 } 1767 cd.SystemData = &systemData 1768 } 1769 case "id": 1770 if v != nil { 1771 var ID string 1772 err = json.Unmarshal(*v, &ID) 1773 if err != nil { 1774 return err 1775 } 1776 cd.ID = &ID 1777 } 1778 case "name": 1779 if v != nil { 1780 var name string 1781 err = json.Unmarshal(*v, &name) 1782 if err != nil { 1783 return err 1784 } 1785 cd.Name = &name 1786 } 1787 case "type": 1788 if v != nil { 1789 var typeVar string 1790 err = json.Unmarshal(*v, &typeVar) 1791 if err != nil { 1792 return err 1793 } 1794 cd.Type = &typeVar 1795 } 1796 } 1797 } 1798 1799 return nil 1800} 1801 1802// BasicCustomDomainHTTPSParameters the JSON object that contains the properties to secure a custom domain. 1803type BasicCustomDomainHTTPSParameters interface { 1804 AsManagedHTTPSParameters() (*ManagedHTTPSParameters, bool) 1805 AsUserManagedHTTPSParameters() (*UserManagedHTTPSParameters, bool) 1806 AsCustomDomainHTTPSParameters() (*CustomDomainHTTPSParameters, bool) 1807} 1808 1809// CustomDomainHTTPSParameters the JSON object that contains the properties to secure a custom domain. 1810type CustomDomainHTTPSParameters struct { 1811 // ProtocolType - Defines the TLS extension protocol that is used for secure delivery. Possible values include: 'ServerNameIndication', 'IPBased' 1812 ProtocolType ProtocolType `json:"protocolType,omitempty"` 1813 // MinimumTLSVersion - TLS protocol version that will be used for Https. Possible values include: 'MinimumTLSVersionNone', 'MinimumTLSVersionTLS10', 'MinimumTLSVersionTLS12' 1814 MinimumTLSVersion MinimumTLSVersion `json:"minimumTlsVersion,omitempty"` 1815 // CertificateSource - Possible values include: 'CertificateSourceCustomDomainHTTPSParameters', 'CertificateSourceCdn', 'CertificateSourceAzureKeyVault' 1816 CertificateSource CertificateSource `json:"certificateSource,omitempty"` 1817} 1818 1819func unmarshalBasicCustomDomainHTTPSParameters(body []byte) (BasicCustomDomainHTTPSParameters, error) { 1820 var m map[string]interface{} 1821 err := json.Unmarshal(body, &m) 1822 if err != nil { 1823 return nil, err 1824 } 1825 1826 switch m["certificateSource"] { 1827 case string(CertificateSourceCdn): 1828 var mhp ManagedHTTPSParameters 1829 err := json.Unmarshal(body, &mhp) 1830 return mhp, err 1831 case string(CertificateSourceAzureKeyVault): 1832 var umhp UserManagedHTTPSParameters 1833 err := json.Unmarshal(body, &umhp) 1834 return umhp, err 1835 default: 1836 var cdhp CustomDomainHTTPSParameters 1837 err := json.Unmarshal(body, &cdhp) 1838 return cdhp, err 1839 } 1840} 1841func unmarshalBasicCustomDomainHTTPSParametersArray(body []byte) ([]BasicCustomDomainHTTPSParameters, error) { 1842 var rawMessages []*json.RawMessage 1843 err := json.Unmarshal(body, &rawMessages) 1844 if err != nil { 1845 return nil, err 1846 } 1847 1848 cdhpArray := make([]BasicCustomDomainHTTPSParameters, len(rawMessages)) 1849 1850 for index, rawMessage := range rawMessages { 1851 cdhp, err := unmarshalBasicCustomDomainHTTPSParameters(*rawMessage) 1852 if err != nil { 1853 return nil, err 1854 } 1855 cdhpArray[index] = cdhp 1856 } 1857 return cdhpArray, nil 1858} 1859 1860// MarshalJSON is the custom marshaler for CustomDomainHTTPSParameters. 1861func (cdhp CustomDomainHTTPSParameters) MarshalJSON() ([]byte, error) { 1862 cdhp.CertificateSource = CertificateSourceCustomDomainHTTPSParameters 1863 objectMap := make(map[string]interface{}) 1864 if cdhp.ProtocolType != "" { 1865 objectMap["protocolType"] = cdhp.ProtocolType 1866 } 1867 if cdhp.MinimumTLSVersion != "" { 1868 objectMap["minimumTlsVersion"] = cdhp.MinimumTLSVersion 1869 } 1870 if cdhp.CertificateSource != "" { 1871 objectMap["certificateSource"] = cdhp.CertificateSource 1872 } 1873 return json.Marshal(objectMap) 1874} 1875 1876// AsManagedHTTPSParameters is the BasicCustomDomainHTTPSParameters implementation for CustomDomainHTTPSParameters. 1877func (cdhp CustomDomainHTTPSParameters) AsManagedHTTPSParameters() (*ManagedHTTPSParameters, bool) { 1878 return nil, false 1879} 1880 1881// AsUserManagedHTTPSParameters is the BasicCustomDomainHTTPSParameters implementation for CustomDomainHTTPSParameters. 1882func (cdhp CustomDomainHTTPSParameters) AsUserManagedHTTPSParameters() (*UserManagedHTTPSParameters, bool) { 1883 return nil, false 1884} 1885 1886// AsCustomDomainHTTPSParameters is the BasicCustomDomainHTTPSParameters implementation for CustomDomainHTTPSParameters. 1887func (cdhp CustomDomainHTTPSParameters) AsCustomDomainHTTPSParameters() (*CustomDomainHTTPSParameters, bool) { 1888 return &cdhp, true 1889} 1890 1891// AsBasicCustomDomainHTTPSParameters is the BasicCustomDomainHTTPSParameters implementation for CustomDomainHTTPSParameters. 1892func (cdhp CustomDomainHTTPSParameters) AsBasicCustomDomainHTTPSParameters() (BasicCustomDomainHTTPSParameters, bool) { 1893 return &cdhp, true 1894} 1895 1896// CustomDomainListResult result of the request to list custom domains. It contains a list of custom domain 1897// objects and a URL link to get the next set of results. 1898type CustomDomainListResult struct { 1899 autorest.Response `json:"-"` 1900 // Value - READ-ONLY; List of CDN CustomDomains within an endpoint. 1901 Value *[]CustomDomain `json:"value,omitempty"` 1902 // NextLink - URL to get the next set of custom domain objects if there are any. 1903 NextLink *string `json:"nextLink,omitempty"` 1904} 1905 1906// MarshalJSON is the custom marshaler for CustomDomainListResult. 1907func (cdlr CustomDomainListResult) MarshalJSON() ([]byte, error) { 1908 objectMap := make(map[string]interface{}) 1909 if cdlr.NextLink != nil { 1910 objectMap["nextLink"] = cdlr.NextLink 1911 } 1912 return json.Marshal(objectMap) 1913} 1914 1915// CustomDomainListResultIterator provides access to a complete listing of CustomDomain values. 1916type CustomDomainListResultIterator struct { 1917 i int 1918 page CustomDomainListResultPage 1919} 1920 1921// NextWithContext advances to the next value. If there was an error making 1922// the request the iterator does not advance and the error is returned. 1923func (iter *CustomDomainListResultIterator) NextWithContext(ctx context.Context) (err error) { 1924 if tracing.IsEnabled() { 1925 ctx = tracing.StartSpan(ctx, fqdn+"/CustomDomainListResultIterator.NextWithContext") 1926 defer func() { 1927 sc := -1 1928 if iter.Response().Response.Response != nil { 1929 sc = iter.Response().Response.Response.StatusCode 1930 } 1931 tracing.EndSpan(ctx, sc, err) 1932 }() 1933 } 1934 iter.i++ 1935 if iter.i < len(iter.page.Values()) { 1936 return nil 1937 } 1938 err = iter.page.NextWithContext(ctx) 1939 if err != nil { 1940 iter.i-- 1941 return err 1942 } 1943 iter.i = 0 1944 return nil 1945} 1946 1947// Next advances to the next value. If there was an error making 1948// the request the iterator does not advance and the error is returned. 1949// Deprecated: Use NextWithContext() instead. 1950func (iter *CustomDomainListResultIterator) Next() error { 1951 return iter.NextWithContext(context.Background()) 1952} 1953 1954// NotDone returns true if the enumeration should be started or is not yet complete. 1955func (iter CustomDomainListResultIterator) NotDone() bool { 1956 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 1957} 1958 1959// Response returns the raw server response from the last page request. 1960func (iter CustomDomainListResultIterator) Response() CustomDomainListResult { 1961 return iter.page.Response() 1962} 1963 1964// Value returns the current value or a zero-initialized value if the 1965// iterator has advanced beyond the end of the collection. 1966func (iter CustomDomainListResultIterator) Value() CustomDomain { 1967 if !iter.page.NotDone() { 1968 return CustomDomain{} 1969 } 1970 return iter.page.Values()[iter.i] 1971} 1972 1973// Creates a new instance of the CustomDomainListResultIterator type. 1974func NewCustomDomainListResultIterator(page CustomDomainListResultPage) CustomDomainListResultIterator { 1975 return CustomDomainListResultIterator{page: page} 1976} 1977 1978// IsEmpty returns true if the ListResult contains no values. 1979func (cdlr CustomDomainListResult) IsEmpty() bool { 1980 return cdlr.Value == nil || len(*cdlr.Value) == 0 1981} 1982 1983// hasNextLink returns true if the NextLink is not empty. 1984func (cdlr CustomDomainListResult) hasNextLink() bool { 1985 return cdlr.NextLink != nil && len(*cdlr.NextLink) != 0 1986} 1987 1988// customDomainListResultPreparer prepares a request to retrieve the next set of results. 1989// It returns nil if no more results exist. 1990func (cdlr CustomDomainListResult) customDomainListResultPreparer(ctx context.Context) (*http.Request, error) { 1991 if !cdlr.hasNextLink() { 1992 return nil, nil 1993 } 1994 return autorest.Prepare((&http.Request{}).WithContext(ctx), 1995 autorest.AsJSON(), 1996 autorest.AsGet(), 1997 autorest.WithBaseURL(to.String(cdlr.NextLink))) 1998} 1999 2000// CustomDomainListResultPage contains a page of CustomDomain values. 2001type CustomDomainListResultPage struct { 2002 fn func(context.Context, CustomDomainListResult) (CustomDomainListResult, error) 2003 cdlr CustomDomainListResult 2004} 2005 2006// NextWithContext advances to the next page of values. If there was an error making 2007// the request the page does not advance and the error is returned. 2008func (page *CustomDomainListResultPage) NextWithContext(ctx context.Context) (err error) { 2009 if tracing.IsEnabled() { 2010 ctx = tracing.StartSpan(ctx, fqdn+"/CustomDomainListResultPage.NextWithContext") 2011 defer func() { 2012 sc := -1 2013 if page.Response().Response.Response != nil { 2014 sc = page.Response().Response.Response.StatusCode 2015 } 2016 tracing.EndSpan(ctx, sc, err) 2017 }() 2018 } 2019 for { 2020 next, err := page.fn(ctx, page.cdlr) 2021 if err != nil { 2022 return err 2023 } 2024 page.cdlr = next 2025 if !next.hasNextLink() || !next.IsEmpty() { 2026 break 2027 } 2028 } 2029 return nil 2030} 2031 2032// Next advances to the next page of values. If there was an error making 2033// the request the page does not advance and the error is returned. 2034// Deprecated: Use NextWithContext() instead. 2035func (page *CustomDomainListResultPage) Next() error { 2036 return page.NextWithContext(context.Background()) 2037} 2038 2039// NotDone returns true if the page enumeration should be started or is not yet complete. 2040func (page CustomDomainListResultPage) NotDone() bool { 2041 return !page.cdlr.IsEmpty() 2042} 2043 2044// Response returns the raw server response from the last page request. 2045func (page CustomDomainListResultPage) Response() CustomDomainListResult { 2046 return page.cdlr 2047} 2048 2049// Values returns the slice of values for the current page or nil if there are no values. 2050func (page CustomDomainListResultPage) Values() []CustomDomain { 2051 if page.cdlr.IsEmpty() { 2052 return nil 2053 } 2054 return *page.cdlr.Value 2055} 2056 2057// Creates a new instance of the CustomDomainListResultPage type. 2058func NewCustomDomainListResultPage(cur CustomDomainListResult, getNextPage func(context.Context, CustomDomainListResult) (CustomDomainListResult, error)) CustomDomainListResultPage { 2059 return CustomDomainListResultPage{ 2060 fn: getNextPage, 2061 cdlr: cur, 2062 } 2063} 2064 2065// CustomDomainParameters the customDomain JSON object required for custom domain creation or update. 2066type CustomDomainParameters struct { 2067 *CustomDomainPropertiesParameters `json:"properties,omitempty"` 2068} 2069 2070// MarshalJSON is the custom marshaler for CustomDomainParameters. 2071func (cdp CustomDomainParameters) MarshalJSON() ([]byte, error) { 2072 objectMap := make(map[string]interface{}) 2073 if cdp.CustomDomainPropertiesParameters != nil { 2074 objectMap["properties"] = cdp.CustomDomainPropertiesParameters 2075 } 2076 return json.Marshal(objectMap) 2077} 2078 2079// UnmarshalJSON is the custom unmarshaler for CustomDomainParameters struct. 2080func (cdp *CustomDomainParameters) UnmarshalJSON(body []byte) error { 2081 var m map[string]*json.RawMessage 2082 err := json.Unmarshal(body, &m) 2083 if err != nil { 2084 return err 2085 } 2086 for k, v := range m { 2087 switch k { 2088 case "properties": 2089 if v != nil { 2090 var customDomainPropertiesParameters CustomDomainPropertiesParameters 2091 err = json.Unmarshal(*v, &customDomainPropertiesParameters) 2092 if err != nil { 2093 return err 2094 } 2095 cdp.CustomDomainPropertiesParameters = &customDomainPropertiesParameters 2096 } 2097 } 2098 } 2099 2100 return nil 2101} 2102 2103// CustomDomainProperties the JSON object that contains the properties of the custom domain to create. 2104type CustomDomainProperties struct { 2105 // HostName - The host name of the custom domain. Must be a domain name. 2106 HostName *string `json:"hostName,omitempty"` 2107 // ResourceState - READ-ONLY; Resource status of the custom domain. Possible values include: 'CustomDomainResourceStateCreating', 'CustomDomainResourceStateActive', 'CustomDomainResourceStateDeleting' 2108 ResourceState CustomDomainResourceState `json:"resourceState,omitempty"` 2109 // CustomHTTPSProvisioningState - READ-ONLY; Provisioning status of Custom Https of the custom domain. Possible values include: 'CustomHTTPSProvisioningStateEnabling', 'CustomHTTPSProvisioningStateEnabled', 'CustomHTTPSProvisioningStateDisabling', 'CustomHTTPSProvisioningStateDisabled', 'CustomHTTPSProvisioningStateFailed' 2110 CustomHTTPSProvisioningState CustomHTTPSProvisioningState `json:"customHttpsProvisioningState,omitempty"` 2111 // 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' 2112 CustomHTTPSProvisioningSubstate CustomHTTPSProvisioningSubstate `json:"customHttpsProvisioningSubstate,omitempty"` 2113 // 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. 2114 ValidationData *string `json:"validationData,omitempty"` 2115 // ProvisioningState - READ-ONLY; Provisioning status of the custom domain. 2116 ProvisioningState *string `json:"provisioningState,omitempty"` 2117} 2118 2119// MarshalJSON is the custom marshaler for CustomDomainProperties. 2120func (cdp CustomDomainProperties) MarshalJSON() ([]byte, error) { 2121 objectMap := make(map[string]interface{}) 2122 if cdp.HostName != nil { 2123 objectMap["hostName"] = cdp.HostName 2124 } 2125 if cdp.ValidationData != nil { 2126 objectMap["validationData"] = cdp.ValidationData 2127 } 2128 return json.Marshal(objectMap) 2129} 2130 2131// CustomDomainPropertiesParameters the JSON object that contains the properties of the custom domain to 2132// create. 2133type CustomDomainPropertiesParameters struct { 2134 // HostName - The host name of the custom domain. Must be a domain name. 2135 HostName *string `json:"hostName,omitempty"` 2136} 2137 2138// CustomDomainsCreateFuture an abstraction for monitoring and retrieving the results of a long-running 2139// operation. 2140type CustomDomainsCreateFuture struct { 2141 azure.FutureAPI 2142 // Result returns the result of the asynchronous operation. 2143 // If the operation has not completed it will return an error. 2144 Result func(CustomDomainsClient) (CustomDomain, error) 2145} 2146 2147// CustomDomainsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running 2148// operation. 2149type CustomDomainsDeleteFuture struct { 2150 azure.FutureAPI 2151 // Result returns the result of the asynchronous operation. 2152 // If the operation has not completed it will return an error. 2153 Result func(CustomDomainsClient) (CustomDomain, error) 2154} 2155 2156// CustomerCertificate customer Certificate used for https 2157type CustomerCertificate struct { 2158 // Version - Certificate version. 2159 Version *string `json:"version,omitempty"` 2160 // CertificateAuthority - Certificate issuing authority. 2161 CertificateAuthority *string `json:"certificateAuthority,omitempty"` 2162 // CertificateURL - Complete Url to the certificate 2163 CertificateURL *string `json:"certificateUrl,omitempty"` 2164 // UseLatestVersion - Whether to use the latest version for the certificate 2165 UseLatestVersion *bool `json:"useLatestVersion,omitempty"` 2166 // SubjectAlternativeNames - The list of SANs. 2167 SubjectAlternativeNames *[]string `json:"subjectAlternativeNames,omitempty"` 2168 // Subject - Subject name in the certificate. 2169 Subject *string `json:"subject,omitempty"` 2170 // ExpirationDate - Certificate expiration date. 2171 ExpirationDate *string `json:"expirationDate,omitempty"` 2172 // Thumbprint - Certificate thumbprint. 2173 Thumbprint *string `json:"thumbprint,omitempty"` 2174} 2175 2176// CustomerCertificateParameters customer Certificate used for https 2177type CustomerCertificateParameters struct { 2178 // SecretSource - Resource reference to the KV secret 2179 SecretSource *ResourceReference `json:"secretSource,omitempty"` 2180 // SecretVersion - Version of the secret to be used 2181 SecretVersion *string `json:"secretVersion,omitempty"` 2182 // CertificateAuthority - Certificate issuing authority. 2183 CertificateAuthority *string `json:"certificateAuthority,omitempty"` 2184 // UseLatestVersion - Whether to use the latest version for the certificate 2185 UseLatestVersion *bool `json:"useLatestVersion,omitempty"` 2186 // SubjectAlternativeNames - The list of SANs. 2187 SubjectAlternativeNames *[]string `json:"subjectAlternativeNames,omitempty"` 2188 // Type - Possible values include: 'TypeSecretParameters', 'TypeURLSigningKey', 'TypeManagedCertificate', 'TypeCustomerCertificate' 2189 Type TypeBasicSecretParameters `json:"type,omitempty"` 2190} 2191 2192// MarshalJSON is the custom marshaler for CustomerCertificateParameters. 2193func (ccp CustomerCertificateParameters) MarshalJSON() ([]byte, error) { 2194 ccp.Type = TypeCustomerCertificate 2195 objectMap := make(map[string]interface{}) 2196 if ccp.SecretSource != nil { 2197 objectMap["secretSource"] = ccp.SecretSource 2198 } 2199 if ccp.SecretVersion != nil { 2200 objectMap["secretVersion"] = ccp.SecretVersion 2201 } 2202 if ccp.CertificateAuthority != nil { 2203 objectMap["certificateAuthority"] = ccp.CertificateAuthority 2204 } 2205 if ccp.UseLatestVersion != nil { 2206 objectMap["useLatestVersion"] = ccp.UseLatestVersion 2207 } 2208 if ccp.SubjectAlternativeNames != nil { 2209 objectMap["subjectAlternativeNames"] = ccp.SubjectAlternativeNames 2210 } 2211 if ccp.Type != "" { 2212 objectMap["type"] = ccp.Type 2213 } 2214 return json.Marshal(objectMap) 2215} 2216 2217// AsURLSigningKeyParameters is the BasicSecretParameters implementation for CustomerCertificateParameters. 2218func (ccp CustomerCertificateParameters) AsURLSigningKeyParameters() (*URLSigningKeyParameters, bool) { 2219 return nil, false 2220} 2221 2222// AsManagedCertificateParameters is the BasicSecretParameters implementation for CustomerCertificateParameters. 2223func (ccp CustomerCertificateParameters) AsManagedCertificateParameters() (*ManagedCertificateParameters, bool) { 2224 return nil, false 2225} 2226 2227// AsCustomerCertificateParameters is the BasicSecretParameters implementation for CustomerCertificateParameters. 2228func (ccp CustomerCertificateParameters) AsCustomerCertificateParameters() (*CustomerCertificateParameters, bool) { 2229 return &ccp, true 2230} 2231 2232// AsSecretParameters is the BasicSecretParameters implementation for CustomerCertificateParameters. 2233func (ccp CustomerCertificateParameters) AsSecretParameters() (*SecretParameters, bool) { 2234 return nil, false 2235} 2236 2237// AsBasicSecretParameters is the BasicSecretParameters implementation for CustomerCertificateParameters. 2238func (ccp CustomerCertificateParameters) AsBasicSecretParameters() (BasicSecretParameters, bool) { 2239 return &ccp, true 2240} 2241 2242// CustomRule defines the common attributes for a custom rule that can be included in a waf policy 2243type CustomRule struct { 2244 // Name - Defines the name of the custom rule 2245 Name *string `json:"name,omitempty"` 2246 // EnabledState - Describes if the custom rule is in enabled or disabled state. Defaults to Enabled if not specified. Possible values include: 'Disabled', 'Enabled' 2247 EnabledState CustomRuleEnabledState `json:"enabledState,omitempty"` 2248 // Priority - Defines in what order this rule be evaluated in the overall list of custom rules 2249 Priority *int32 `json:"priority,omitempty"` 2250 // MatchConditions - List of match conditions. 2251 MatchConditions *[]MatchCondition `json:"matchConditions,omitempty"` 2252 // Action - Describes what action to be applied when rule matches. Possible values include: 'Allow', 'Block', 'Log', 'Redirect' 2253 Action ActionType `json:"action,omitempty"` 2254} 2255 2256// CustomRuleList defines contents of custom rules 2257type CustomRuleList struct { 2258 // Rules - List of rules 2259 Rules *[]CustomRule `json:"rules,omitempty"` 2260} 2261 2262// DeepCreatedOrigin the main origin of CDN content which is added when creating a CDN endpoint. 2263type DeepCreatedOrigin struct { 2264 // Name - Origin name which must be unique within the endpoint. 2265 Name *string `json:"name,omitempty"` 2266 *DeepCreatedOriginProperties `json:"properties,omitempty"` 2267} 2268 2269// MarshalJSON is the custom marshaler for DeepCreatedOrigin. 2270func (dco DeepCreatedOrigin) MarshalJSON() ([]byte, error) { 2271 objectMap := make(map[string]interface{}) 2272 if dco.Name != nil { 2273 objectMap["name"] = dco.Name 2274 } 2275 if dco.DeepCreatedOriginProperties != nil { 2276 objectMap["properties"] = dco.DeepCreatedOriginProperties 2277 } 2278 return json.Marshal(objectMap) 2279} 2280 2281// UnmarshalJSON is the custom unmarshaler for DeepCreatedOrigin struct. 2282func (dco *DeepCreatedOrigin) UnmarshalJSON(body []byte) error { 2283 var m map[string]*json.RawMessage 2284 err := json.Unmarshal(body, &m) 2285 if err != nil { 2286 return err 2287 } 2288 for k, v := range m { 2289 switch k { 2290 case "name": 2291 if v != nil { 2292 var name string 2293 err = json.Unmarshal(*v, &name) 2294 if err != nil { 2295 return err 2296 } 2297 dco.Name = &name 2298 } 2299 case "properties": 2300 if v != nil { 2301 var deepCreatedOriginProperties DeepCreatedOriginProperties 2302 err = json.Unmarshal(*v, &deepCreatedOriginProperties) 2303 if err != nil { 2304 return err 2305 } 2306 dco.DeepCreatedOriginProperties = &deepCreatedOriginProperties 2307 } 2308 } 2309 } 2310 2311 return nil 2312} 2313 2314// DeepCreatedOriginGroup the origin group for CDN content which is added when creating a CDN endpoint. 2315// Traffic is sent to the origins within the origin group based on origin health. 2316type DeepCreatedOriginGroup struct { 2317 // Name - Origin group name which must be unique within the endpoint. 2318 Name *string `json:"name,omitempty"` 2319 *DeepCreatedOriginGroupProperties `json:"properties,omitempty"` 2320} 2321 2322// MarshalJSON is the custom marshaler for DeepCreatedOriginGroup. 2323func (dcog DeepCreatedOriginGroup) MarshalJSON() ([]byte, error) { 2324 objectMap := make(map[string]interface{}) 2325 if dcog.Name != nil { 2326 objectMap["name"] = dcog.Name 2327 } 2328 if dcog.DeepCreatedOriginGroupProperties != nil { 2329 objectMap["properties"] = dcog.DeepCreatedOriginGroupProperties 2330 } 2331 return json.Marshal(objectMap) 2332} 2333 2334// UnmarshalJSON is the custom unmarshaler for DeepCreatedOriginGroup struct. 2335func (dcog *DeepCreatedOriginGroup) UnmarshalJSON(body []byte) error { 2336 var m map[string]*json.RawMessage 2337 err := json.Unmarshal(body, &m) 2338 if err != nil { 2339 return err 2340 } 2341 for k, v := range m { 2342 switch k { 2343 case "name": 2344 if v != nil { 2345 var name string 2346 err = json.Unmarshal(*v, &name) 2347 if err != nil { 2348 return err 2349 } 2350 dcog.Name = &name 2351 } 2352 case "properties": 2353 if v != nil { 2354 var deepCreatedOriginGroupProperties DeepCreatedOriginGroupProperties 2355 err = json.Unmarshal(*v, &deepCreatedOriginGroupProperties) 2356 if err != nil { 2357 return err 2358 } 2359 dcog.DeepCreatedOriginGroupProperties = &deepCreatedOriginGroupProperties 2360 } 2361 } 2362 } 2363 2364 return nil 2365} 2366 2367// DeepCreatedOriginGroupProperties properties of the origin group created on the CDN endpoint. 2368type DeepCreatedOriginGroupProperties struct { 2369 // HealthProbeSettings - Health probe settings to the origin that is used to determine the health of the origin. 2370 HealthProbeSettings *HealthProbeParameters `json:"healthProbeSettings,omitempty"` 2371 // Origins - The source of the content being delivered via CDN within given origin group. 2372 Origins *[]ResourceReference `json:"origins,omitempty"` 2373 // TrafficRestorationTimeToHealedOrNewEndpointsInMinutes - Time in minutes to shift the traffic to the endpoint gradually when an unhealthy endpoint comes healthy or a new endpoint is added. Default is 10 mins. This property is currently not supported. 2374 TrafficRestorationTimeToHealedOrNewEndpointsInMinutes *int32 `json:"trafficRestorationTimeToHealedOrNewEndpointsInMinutes,omitempty"` 2375 // ResponseBasedOriginErrorDetectionSettings - The JSON object that contains the properties to determine origin health using real requests/responses.This property is currently not supported. 2376 ResponseBasedOriginErrorDetectionSettings *ResponseBasedOriginErrorDetectionParameters `json:"responseBasedOriginErrorDetectionSettings,omitempty"` 2377} 2378 2379// DeepCreatedOriginProperties properties of the origin created on the CDN endpoint. 2380type DeepCreatedOriginProperties struct { 2381 // HostName - The address of the origin. It can be a domain name, IPv4 address, or IPv6 address. This should be unique across all origins in an endpoint. 2382 HostName *string `json:"hostName,omitempty"` 2383 // HTTPPort - The value of the HTTP port. Must be between 1 and 65535. 2384 HTTPPort *int32 `json:"httpPort,omitempty"` 2385 // HTTPSPort - The value of the HTTPS port. Must be between 1 and 65535. 2386 HTTPSPort *int32 `json:"httpsPort,omitempty"` 2387 // 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. 2388 OriginHostHeader *string `json:"originHostHeader,omitempty"` 2389 // Priority - Priority of origin in given origin group for load balancing. Higher priorities will not be used for load balancing if any lower priority origin is healthy.Must be between 1 and 5. 2390 Priority *int32 `json:"priority,omitempty"` 2391 // Weight - Weight of the origin in given origin group for load balancing. Must be between 1 and 1000 2392 Weight *int32 `json:"weight,omitempty"` 2393 // Enabled - Origin is enabled for load balancing or not. By default, origin is always enabled. 2394 Enabled *bool `json:"enabled,omitempty"` 2395 // PrivateLinkAlias - The Alias of the Private Link resource. Populating this optional field indicates that this origin is 'Private' 2396 PrivateLinkAlias *string `json:"privateLinkAlias,omitempty"` 2397 // PrivateLinkResourceID - The Resource Id of the Private Link resource. Populating this optional field indicates that this backend is 'Private' 2398 PrivateLinkResourceID *string `json:"privateLinkResourceId,omitempty"` 2399 // PrivateLinkLocation - The location of the Private Link resource. Required only if 'privateLinkResourceId' is populated 2400 PrivateLinkLocation *string `json:"privateLinkLocation,omitempty"` 2401 // PrivateLinkApprovalMessage - A custom message to be included in the approval request to connect to the Private Link. 2402 PrivateLinkApprovalMessage *string `json:"privateLinkApprovalMessage,omitempty"` 2403} 2404 2405// DeliveryRule a rule that specifies a set of actions and conditions 2406type DeliveryRule struct { 2407 // Name - Name of the rule 2408 Name *string `json:"name,omitempty"` 2409 // 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. 2410 Order *int32 `json:"order,omitempty"` 2411 // Conditions - A list of conditions that must be matched for the actions to be executed 2412 Conditions *[]BasicDeliveryRuleCondition `json:"conditions,omitempty"` 2413 // Actions - A list of actions that are executed when all the conditions of a rule are satisfied. 2414 Actions *[]BasicDeliveryRuleAction `json:"actions,omitempty"` 2415} 2416 2417// UnmarshalJSON is the custom unmarshaler for DeliveryRule struct. 2418func (dr *DeliveryRule) UnmarshalJSON(body []byte) error { 2419 var m map[string]*json.RawMessage 2420 err := json.Unmarshal(body, &m) 2421 if err != nil { 2422 return err 2423 } 2424 for k, v := range m { 2425 switch k { 2426 case "name": 2427 if v != nil { 2428 var name string 2429 err = json.Unmarshal(*v, &name) 2430 if err != nil { 2431 return err 2432 } 2433 dr.Name = &name 2434 } 2435 case "order": 2436 if v != nil { 2437 var order int32 2438 err = json.Unmarshal(*v, &order) 2439 if err != nil { 2440 return err 2441 } 2442 dr.Order = &order 2443 } 2444 case "conditions": 2445 if v != nil { 2446 conditions, err := unmarshalBasicDeliveryRuleConditionArray(*v) 2447 if err != nil { 2448 return err 2449 } 2450 dr.Conditions = &conditions 2451 } 2452 case "actions": 2453 if v != nil { 2454 actions, err := unmarshalBasicDeliveryRuleActionArray(*v) 2455 if err != nil { 2456 return err 2457 } 2458 dr.Actions = &actions 2459 } 2460 } 2461 } 2462 2463 return nil 2464} 2465 2466// BasicDeliveryRuleAction an action for the delivery rule. 2467type BasicDeliveryRuleAction interface { 2468 AsURLRedirectAction() (*URLRedirectAction, bool) 2469 AsURLSigningAction() (*URLSigningAction, bool) 2470 AsOriginGroupOverrideAction() (*OriginGroupOverrideAction, bool) 2471 AsURLRewriteAction() (*URLRewriteAction, bool) 2472 AsDeliveryRuleRequestHeaderAction() (*DeliveryRuleRequestHeaderAction, bool) 2473 AsDeliveryRuleResponseHeaderAction() (*DeliveryRuleResponseHeaderAction, bool) 2474 AsDeliveryRuleCacheExpirationAction() (*DeliveryRuleCacheExpirationAction, bool) 2475 AsDeliveryRuleCacheKeyQueryStringAction() (*DeliveryRuleCacheKeyQueryStringAction, bool) 2476 AsDeliveryRuleAction() (*DeliveryRuleAction, bool) 2477} 2478 2479// DeliveryRuleAction an action for the delivery rule. 2480type DeliveryRuleAction struct { 2481 // Name - Possible values include: 'NameDeliveryRuleAction', 'NameURLRedirect', 'NameURLSigning', 'NameOriginGroupOverride', 'NameURLRewrite', 'NameModifyRequestHeader', 'NameModifyResponseHeader', 'NameCacheExpiration', 'NameCacheKeyQueryString' 2482 Name NameBasicDeliveryRuleAction `json:"name,omitempty"` 2483} 2484 2485func unmarshalBasicDeliveryRuleAction(body []byte) (BasicDeliveryRuleAction, error) { 2486 var m map[string]interface{} 2487 err := json.Unmarshal(body, &m) 2488 if err != nil { 2489 return nil, err 2490 } 2491 2492 switch m["name"] { 2493 case string(NameURLRedirect): 2494 var ura URLRedirectAction 2495 err := json.Unmarshal(body, &ura) 2496 return ura, err 2497 case string(NameURLSigning): 2498 var usa URLSigningAction 2499 err := json.Unmarshal(body, &usa) 2500 return usa, err 2501 case string(NameOriginGroupOverride): 2502 var ogoa OriginGroupOverrideAction 2503 err := json.Unmarshal(body, &ogoa) 2504 return ogoa, err 2505 case string(NameURLRewrite): 2506 var ura URLRewriteAction 2507 err := json.Unmarshal(body, &ura) 2508 return ura, err 2509 case string(NameModifyRequestHeader): 2510 var drrha DeliveryRuleRequestHeaderAction 2511 err := json.Unmarshal(body, &drrha) 2512 return drrha, err 2513 case string(NameModifyResponseHeader): 2514 var drrha DeliveryRuleResponseHeaderAction 2515 err := json.Unmarshal(body, &drrha) 2516 return drrha, err 2517 case string(NameCacheExpiration): 2518 var drcea DeliveryRuleCacheExpirationAction 2519 err := json.Unmarshal(body, &drcea) 2520 return drcea, err 2521 case string(NameCacheKeyQueryString): 2522 var drckqsa DeliveryRuleCacheKeyQueryStringAction 2523 err := json.Unmarshal(body, &drckqsa) 2524 return drckqsa, err 2525 default: 2526 var dra DeliveryRuleAction 2527 err := json.Unmarshal(body, &dra) 2528 return dra, err 2529 } 2530} 2531func unmarshalBasicDeliveryRuleActionArray(body []byte) ([]BasicDeliveryRuleAction, error) { 2532 var rawMessages []*json.RawMessage 2533 err := json.Unmarshal(body, &rawMessages) 2534 if err != nil { 2535 return nil, err 2536 } 2537 2538 draArray := make([]BasicDeliveryRuleAction, len(rawMessages)) 2539 2540 for index, rawMessage := range rawMessages { 2541 dra, err := unmarshalBasicDeliveryRuleAction(*rawMessage) 2542 if err != nil { 2543 return nil, err 2544 } 2545 draArray[index] = dra 2546 } 2547 return draArray, nil 2548} 2549 2550// MarshalJSON is the custom marshaler for DeliveryRuleAction. 2551func (dra DeliveryRuleAction) MarshalJSON() ([]byte, error) { 2552 dra.Name = NameDeliveryRuleAction 2553 objectMap := make(map[string]interface{}) 2554 if dra.Name != "" { 2555 objectMap["name"] = dra.Name 2556 } 2557 return json.Marshal(objectMap) 2558} 2559 2560// AsURLRedirectAction is the BasicDeliveryRuleAction implementation for DeliveryRuleAction. 2561func (dra DeliveryRuleAction) AsURLRedirectAction() (*URLRedirectAction, bool) { 2562 return nil, false 2563} 2564 2565// AsURLSigningAction is the BasicDeliveryRuleAction implementation for DeliveryRuleAction. 2566func (dra DeliveryRuleAction) AsURLSigningAction() (*URLSigningAction, bool) { 2567 return nil, false 2568} 2569 2570// AsOriginGroupOverrideAction is the BasicDeliveryRuleAction implementation for DeliveryRuleAction. 2571func (dra DeliveryRuleAction) AsOriginGroupOverrideAction() (*OriginGroupOverrideAction, bool) { 2572 return nil, false 2573} 2574 2575// AsURLRewriteAction is the BasicDeliveryRuleAction implementation for DeliveryRuleAction. 2576func (dra DeliveryRuleAction) AsURLRewriteAction() (*URLRewriteAction, bool) { 2577 return nil, false 2578} 2579 2580// AsDeliveryRuleRequestHeaderAction is the BasicDeliveryRuleAction implementation for DeliveryRuleAction. 2581func (dra DeliveryRuleAction) AsDeliveryRuleRequestHeaderAction() (*DeliveryRuleRequestHeaderAction, bool) { 2582 return nil, false 2583} 2584 2585// AsDeliveryRuleResponseHeaderAction is the BasicDeliveryRuleAction implementation for DeliveryRuleAction. 2586func (dra DeliveryRuleAction) AsDeliveryRuleResponseHeaderAction() (*DeliveryRuleResponseHeaderAction, bool) { 2587 return nil, false 2588} 2589 2590// AsDeliveryRuleCacheExpirationAction is the BasicDeliveryRuleAction implementation for DeliveryRuleAction. 2591func (dra DeliveryRuleAction) AsDeliveryRuleCacheExpirationAction() (*DeliveryRuleCacheExpirationAction, bool) { 2592 return nil, false 2593} 2594 2595// AsDeliveryRuleCacheKeyQueryStringAction is the BasicDeliveryRuleAction implementation for DeliveryRuleAction. 2596func (dra DeliveryRuleAction) AsDeliveryRuleCacheKeyQueryStringAction() (*DeliveryRuleCacheKeyQueryStringAction, bool) { 2597 return nil, false 2598} 2599 2600// AsDeliveryRuleAction is the BasicDeliveryRuleAction implementation for DeliveryRuleAction. 2601func (dra DeliveryRuleAction) AsDeliveryRuleAction() (*DeliveryRuleAction, bool) { 2602 return &dra, true 2603} 2604 2605// AsBasicDeliveryRuleAction is the BasicDeliveryRuleAction implementation for DeliveryRuleAction. 2606func (dra DeliveryRuleAction) AsBasicDeliveryRuleAction() (BasicDeliveryRuleAction, bool) { 2607 return &dra, true 2608} 2609 2610// DeliveryRuleCacheExpirationAction defines the cache expiration action for the delivery rule. 2611type DeliveryRuleCacheExpirationAction struct { 2612 // Parameters - Defines the parameters for the action. 2613 Parameters *CacheExpirationActionParameters `json:"parameters,omitempty"` 2614 // Name - Possible values include: 'NameDeliveryRuleAction', 'NameURLRedirect', 'NameURLSigning', 'NameOriginGroupOverride', 'NameURLRewrite', 'NameModifyRequestHeader', 'NameModifyResponseHeader', 'NameCacheExpiration', 'NameCacheKeyQueryString' 2615 Name NameBasicDeliveryRuleAction `json:"name,omitempty"` 2616} 2617 2618// MarshalJSON is the custom marshaler for DeliveryRuleCacheExpirationAction. 2619func (drcea DeliveryRuleCacheExpirationAction) MarshalJSON() ([]byte, error) { 2620 drcea.Name = NameCacheExpiration 2621 objectMap := make(map[string]interface{}) 2622 if drcea.Parameters != nil { 2623 objectMap["parameters"] = drcea.Parameters 2624 } 2625 if drcea.Name != "" { 2626 objectMap["name"] = drcea.Name 2627 } 2628 return json.Marshal(objectMap) 2629} 2630 2631// AsURLRedirectAction is the BasicDeliveryRuleAction implementation for DeliveryRuleCacheExpirationAction. 2632func (drcea DeliveryRuleCacheExpirationAction) AsURLRedirectAction() (*URLRedirectAction, bool) { 2633 return nil, false 2634} 2635 2636// AsURLSigningAction is the BasicDeliveryRuleAction implementation for DeliveryRuleCacheExpirationAction. 2637func (drcea DeliveryRuleCacheExpirationAction) AsURLSigningAction() (*URLSigningAction, bool) { 2638 return nil, false 2639} 2640 2641// AsOriginGroupOverrideAction is the BasicDeliveryRuleAction implementation for DeliveryRuleCacheExpirationAction. 2642func (drcea DeliveryRuleCacheExpirationAction) AsOriginGroupOverrideAction() (*OriginGroupOverrideAction, bool) { 2643 return nil, false 2644} 2645 2646// AsURLRewriteAction is the BasicDeliveryRuleAction implementation for DeliveryRuleCacheExpirationAction. 2647func (drcea DeliveryRuleCacheExpirationAction) AsURLRewriteAction() (*URLRewriteAction, bool) { 2648 return nil, false 2649} 2650 2651// AsDeliveryRuleRequestHeaderAction is the BasicDeliveryRuleAction implementation for DeliveryRuleCacheExpirationAction. 2652func (drcea DeliveryRuleCacheExpirationAction) AsDeliveryRuleRequestHeaderAction() (*DeliveryRuleRequestHeaderAction, bool) { 2653 return nil, false 2654} 2655 2656// AsDeliveryRuleResponseHeaderAction is the BasicDeliveryRuleAction implementation for DeliveryRuleCacheExpirationAction. 2657func (drcea DeliveryRuleCacheExpirationAction) AsDeliveryRuleResponseHeaderAction() (*DeliveryRuleResponseHeaderAction, bool) { 2658 return nil, false 2659} 2660 2661// AsDeliveryRuleCacheExpirationAction is the BasicDeliveryRuleAction implementation for DeliveryRuleCacheExpirationAction. 2662func (drcea DeliveryRuleCacheExpirationAction) AsDeliveryRuleCacheExpirationAction() (*DeliveryRuleCacheExpirationAction, bool) { 2663 return &drcea, true 2664} 2665 2666// AsDeliveryRuleCacheKeyQueryStringAction is the BasicDeliveryRuleAction implementation for DeliveryRuleCacheExpirationAction. 2667func (drcea DeliveryRuleCacheExpirationAction) AsDeliveryRuleCacheKeyQueryStringAction() (*DeliveryRuleCacheKeyQueryStringAction, bool) { 2668 return nil, false 2669} 2670 2671// AsDeliveryRuleAction is the BasicDeliveryRuleAction implementation for DeliveryRuleCacheExpirationAction. 2672func (drcea DeliveryRuleCacheExpirationAction) AsDeliveryRuleAction() (*DeliveryRuleAction, bool) { 2673 return nil, false 2674} 2675 2676// AsBasicDeliveryRuleAction is the BasicDeliveryRuleAction implementation for DeliveryRuleCacheExpirationAction. 2677func (drcea DeliveryRuleCacheExpirationAction) AsBasicDeliveryRuleAction() (BasicDeliveryRuleAction, bool) { 2678 return &drcea, true 2679} 2680 2681// DeliveryRuleCacheKeyQueryStringAction defines the cache-key query string action for the delivery rule. 2682type DeliveryRuleCacheKeyQueryStringAction struct { 2683 // Parameters - Defines the parameters for the action. 2684 Parameters *CacheKeyQueryStringActionParameters `json:"parameters,omitempty"` 2685 // Name - Possible values include: 'NameDeliveryRuleAction', 'NameURLRedirect', 'NameURLSigning', 'NameOriginGroupOverride', 'NameURLRewrite', 'NameModifyRequestHeader', 'NameModifyResponseHeader', 'NameCacheExpiration', 'NameCacheKeyQueryString' 2686 Name NameBasicDeliveryRuleAction `json:"name,omitempty"` 2687} 2688 2689// MarshalJSON is the custom marshaler for DeliveryRuleCacheKeyQueryStringAction. 2690func (drckqsa DeliveryRuleCacheKeyQueryStringAction) MarshalJSON() ([]byte, error) { 2691 drckqsa.Name = NameCacheKeyQueryString 2692 objectMap := make(map[string]interface{}) 2693 if drckqsa.Parameters != nil { 2694 objectMap["parameters"] = drckqsa.Parameters 2695 } 2696 if drckqsa.Name != "" { 2697 objectMap["name"] = drckqsa.Name 2698 } 2699 return json.Marshal(objectMap) 2700} 2701 2702// AsURLRedirectAction is the BasicDeliveryRuleAction implementation for DeliveryRuleCacheKeyQueryStringAction. 2703func (drckqsa DeliveryRuleCacheKeyQueryStringAction) AsURLRedirectAction() (*URLRedirectAction, bool) { 2704 return nil, false 2705} 2706 2707// AsURLSigningAction is the BasicDeliveryRuleAction implementation for DeliveryRuleCacheKeyQueryStringAction. 2708func (drckqsa DeliveryRuleCacheKeyQueryStringAction) AsURLSigningAction() (*URLSigningAction, bool) { 2709 return nil, false 2710} 2711 2712// AsOriginGroupOverrideAction is the BasicDeliveryRuleAction implementation for DeliveryRuleCacheKeyQueryStringAction. 2713func (drckqsa DeliveryRuleCacheKeyQueryStringAction) AsOriginGroupOverrideAction() (*OriginGroupOverrideAction, bool) { 2714 return nil, false 2715} 2716 2717// AsURLRewriteAction is the BasicDeliveryRuleAction implementation for DeliveryRuleCacheKeyQueryStringAction. 2718func (drckqsa DeliveryRuleCacheKeyQueryStringAction) AsURLRewriteAction() (*URLRewriteAction, bool) { 2719 return nil, false 2720} 2721 2722// AsDeliveryRuleRequestHeaderAction is the BasicDeliveryRuleAction implementation for DeliveryRuleCacheKeyQueryStringAction. 2723func (drckqsa DeliveryRuleCacheKeyQueryStringAction) AsDeliveryRuleRequestHeaderAction() (*DeliveryRuleRequestHeaderAction, bool) { 2724 return nil, false 2725} 2726 2727// AsDeliveryRuleResponseHeaderAction is the BasicDeliveryRuleAction implementation for DeliveryRuleCacheKeyQueryStringAction. 2728func (drckqsa DeliveryRuleCacheKeyQueryStringAction) AsDeliveryRuleResponseHeaderAction() (*DeliveryRuleResponseHeaderAction, bool) { 2729 return nil, false 2730} 2731 2732// AsDeliveryRuleCacheExpirationAction is the BasicDeliveryRuleAction implementation for DeliveryRuleCacheKeyQueryStringAction. 2733func (drckqsa DeliveryRuleCacheKeyQueryStringAction) AsDeliveryRuleCacheExpirationAction() (*DeliveryRuleCacheExpirationAction, bool) { 2734 return nil, false 2735} 2736 2737// AsDeliveryRuleCacheKeyQueryStringAction is the BasicDeliveryRuleAction implementation for DeliveryRuleCacheKeyQueryStringAction. 2738func (drckqsa DeliveryRuleCacheKeyQueryStringAction) AsDeliveryRuleCacheKeyQueryStringAction() (*DeliveryRuleCacheKeyQueryStringAction, bool) { 2739 return &drckqsa, true 2740} 2741 2742// AsDeliveryRuleAction is the BasicDeliveryRuleAction implementation for DeliveryRuleCacheKeyQueryStringAction. 2743func (drckqsa DeliveryRuleCacheKeyQueryStringAction) AsDeliveryRuleAction() (*DeliveryRuleAction, bool) { 2744 return nil, false 2745} 2746 2747// AsBasicDeliveryRuleAction is the BasicDeliveryRuleAction implementation for DeliveryRuleCacheKeyQueryStringAction. 2748func (drckqsa DeliveryRuleCacheKeyQueryStringAction) AsBasicDeliveryRuleAction() (BasicDeliveryRuleAction, bool) { 2749 return &drckqsa, true 2750} 2751 2752// BasicDeliveryRuleCondition a condition for the delivery rule. 2753type BasicDeliveryRuleCondition interface { 2754 AsDeliveryRuleRemoteAddressCondition() (*DeliveryRuleRemoteAddressCondition, bool) 2755 AsDeliveryRuleRequestMethodCondition() (*DeliveryRuleRequestMethodCondition, bool) 2756 AsDeliveryRuleQueryStringCondition() (*DeliveryRuleQueryStringCondition, bool) 2757 AsDeliveryRulePostArgsCondition() (*DeliveryRulePostArgsCondition, bool) 2758 AsDeliveryRuleRequestURICondition() (*DeliveryRuleRequestURICondition, bool) 2759 AsDeliveryRuleRequestHeaderCondition() (*DeliveryRuleRequestHeaderCondition, bool) 2760 AsDeliveryRuleRequestBodyCondition() (*DeliveryRuleRequestBodyCondition, bool) 2761 AsDeliveryRuleRequestSchemeCondition() (*DeliveryRuleRequestSchemeCondition, bool) 2762 AsDeliveryRuleURLPathCondition() (*DeliveryRuleURLPathCondition, bool) 2763 AsDeliveryRuleURLFileExtensionCondition() (*DeliveryRuleURLFileExtensionCondition, bool) 2764 AsDeliveryRuleURLFileNameCondition() (*DeliveryRuleURLFileNameCondition, bool) 2765 AsDeliveryRuleHTTPVersionCondition() (*DeliveryRuleHTTPVersionCondition, bool) 2766 AsDeliveryRuleCookiesCondition() (*DeliveryRuleCookiesCondition, bool) 2767 AsDeliveryRuleIsDeviceCondition() (*DeliveryRuleIsDeviceCondition, bool) 2768 AsDeliveryRuleCondition() (*DeliveryRuleCondition, bool) 2769} 2770 2771// DeliveryRuleCondition a condition for the delivery rule. 2772type DeliveryRuleCondition struct { 2773 // Name - Possible values include: 'NameDeliveryRuleCondition', 'NameRemoteAddress', 'NameRequestMethod', 'NameQueryString', 'NamePostArgs', 'NameRequestURI', 'NameRequestHeader', 'NameRequestBody', 'NameRequestScheme', 'NameURLPath', 'NameURLFileExtension', 'NameURLFileName', 'NameHTTPVersion', 'NameCookies', 'NameIsDevice' 2774 Name Name `json:"name,omitempty"` 2775} 2776 2777func unmarshalBasicDeliveryRuleCondition(body []byte) (BasicDeliveryRuleCondition, error) { 2778 var m map[string]interface{} 2779 err := json.Unmarshal(body, &m) 2780 if err != nil { 2781 return nil, err 2782 } 2783 2784 switch m["name"] { 2785 case string(NameRemoteAddress): 2786 var drrac DeliveryRuleRemoteAddressCondition 2787 err := json.Unmarshal(body, &drrac) 2788 return drrac, err 2789 case string(NameRequestMethod): 2790 var drrmc DeliveryRuleRequestMethodCondition 2791 err := json.Unmarshal(body, &drrmc) 2792 return drrmc, err 2793 case string(NameQueryString): 2794 var drqsc DeliveryRuleQueryStringCondition 2795 err := json.Unmarshal(body, &drqsc) 2796 return drqsc, err 2797 case string(NamePostArgs): 2798 var drpac DeliveryRulePostArgsCondition 2799 err := json.Unmarshal(body, &drpac) 2800 return drpac, err 2801 case string(NameRequestURI): 2802 var drruc DeliveryRuleRequestURICondition 2803 err := json.Unmarshal(body, &drruc) 2804 return drruc, err 2805 case string(NameRequestHeader): 2806 var drrhc DeliveryRuleRequestHeaderCondition 2807 err := json.Unmarshal(body, &drrhc) 2808 return drrhc, err 2809 case string(NameRequestBody): 2810 var drrbc DeliveryRuleRequestBodyCondition 2811 err := json.Unmarshal(body, &drrbc) 2812 return drrbc, err 2813 case string(NameRequestScheme): 2814 var drrsc DeliveryRuleRequestSchemeCondition 2815 err := json.Unmarshal(body, &drrsc) 2816 return drrsc, err 2817 case string(NameURLPath): 2818 var drupc DeliveryRuleURLPathCondition 2819 err := json.Unmarshal(body, &drupc) 2820 return drupc, err 2821 case string(NameURLFileExtension): 2822 var drufec DeliveryRuleURLFileExtensionCondition 2823 err := json.Unmarshal(body, &drufec) 2824 return drufec, err 2825 case string(NameURLFileName): 2826 var drufnc DeliveryRuleURLFileNameCondition 2827 err := json.Unmarshal(body, &drufnc) 2828 return drufnc, err 2829 case string(NameHTTPVersion): 2830 var drhvc DeliveryRuleHTTPVersionCondition 2831 err := json.Unmarshal(body, &drhvc) 2832 return drhvc, err 2833 case string(NameCookies): 2834 var drcc DeliveryRuleCookiesCondition 2835 err := json.Unmarshal(body, &drcc) 2836 return drcc, err 2837 case string(NameIsDevice): 2838 var dridc DeliveryRuleIsDeviceCondition 2839 err := json.Unmarshal(body, &dridc) 2840 return dridc, err 2841 default: 2842 var drc DeliveryRuleCondition 2843 err := json.Unmarshal(body, &drc) 2844 return drc, err 2845 } 2846} 2847func unmarshalBasicDeliveryRuleConditionArray(body []byte) ([]BasicDeliveryRuleCondition, error) { 2848 var rawMessages []*json.RawMessage 2849 err := json.Unmarshal(body, &rawMessages) 2850 if err != nil { 2851 return nil, err 2852 } 2853 2854 drcArray := make([]BasicDeliveryRuleCondition, len(rawMessages)) 2855 2856 for index, rawMessage := range rawMessages { 2857 drc, err := unmarshalBasicDeliveryRuleCondition(*rawMessage) 2858 if err != nil { 2859 return nil, err 2860 } 2861 drcArray[index] = drc 2862 } 2863 return drcArray, nil 2864} 2865 2866// MarshalJSON is the custom marshaler for DeliveryRuleCondition. 2867func (drc DeliveryRuleCondition) MarshalJSON() ([]byte, error) { 2868 drc.Name = NameDeliveryRuleCondition 2869 objectMap := make(map[string]interface{}) 2870 if drc.Name != "" { 2871 objectMap["name"] = drc.Name 2872 } 2873 return json.Marshal(objectMap) 2874} 2875 2876// AsDeliveryRuleRemoteAddressCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleCondition. 2877func (drc DeliveryRuleCondition) AsDeliveryRuleRemoteAddressCondition() (*DeliveryRuleRemoteAddressCondition, bool) { 2878 return nil, false 2879} 2880 2881// AsDeliveryRuleRequestMethodCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleCondition. 2882func (drc DeliveryRuleCondition) AsDeliveryRuleRequestMethodCondition() (*DeliveryRuleRequestMethodCondition, bool) { 2883 return nil, false 2884} 2885 2886// AsDeliveryRuleQueryStringCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleCondition. 2887func (drc DeliveryRuleCondition) AsDeliveryRuleQueryStringCondition() (*DeliveryRuleQueryStringCondition, bool) { 2888 return nil, false 2889} 2890 2891// AsDeliveryRulePostArgsCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleCondition. 2892func (drc DeliveryRuleCondition) AsDeliveryRulePostArgsCondition() (*DeliveryRulePostArgsCondition, bool) { 2893 return nil, false 2894} 2895 2896// AsDeliveryRuleRequestURICondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleCondition. 2897func (drc DeliveryRuleCondition) AsDeliveryRuleRequestURICondition() (*DeliveryRuleRequestURICondition, bool) { 2898 return nil, false 2899} 2900 2901// AsDeliveryRuleRequestHeaderCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleCondition. 2902func (drc DeliveryRuleCondition) AsDeliveryRuleRequestHeaderCondition() (*DeliveryRuleRequestHeaderCondition, bool) { 2903 return nil, false 2904} 2905 2906// AsDeliveryRuleRequestBodyCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleCondition. 2907func (drc DeliveryRuleCondition) AsDeliveryRuleRequestBodyCondition() (*DeliveryRuleRequestBodyCondition, bool) { 2908 return nil, false 2909} 2910 2911// AsDeliveryRuleRequestSchemeCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleCondition. 2912func (drc DeliveryRuleCondition) AsDeliveryRuleRequestSchemeCondition() (*DeliveryRuleRequestSchemeCondition, bool) { 2913 return nil, false 2914} 2915 2916// AsDeliveryRuleURLPathCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleCondition. 2917func (drc DeliveryRuleCondition) AsDeliveryRuleURLPathCondition() (*DeliveryRuleURLPathCondition, bool) { 2918 return nil, false 2919} 2920 2921// AsDeliveryRuleURLFileExtensionCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleCondition. 2922func (drc DeliveryRuleCondition) AsDeliveryRuleURLFileExtensionCondition() (*DeliveryRuleURLFileExtensionCondition, bool) { 2923 return nil, false 2924} 2925 2926// AsDeliveryRuleURLFileNameCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleCondition. 2927func (drc DeliveryRuleCondition) AsDeliveryRuleURLFileNameCondition() (*DeliveryRuleURLFileNameCondition, bool) { 2928 return nil, false 2929} 2930 2931// AsDeliveryRuleHTTPVersionCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleCondition. 2932func (drc DeliveryRuleCondition) AsDeliveryRuleHTTPVersionCondition() (*DeliveryRuleHTTPVersionCondition, bool) { 2933 return nil, false 2934} 2935 2936// AsDeliveryRuleCookiesCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleCondition. 2937func (drc DeliveryRuleCondition) AsDeliveryRuleCookiesCondition() (*DeliveryRuleCookiesCondition, bool) { 2938 return nil, false 2939} 2940 2941// AsDeliveryRuleIsDeviceCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleCondition. 2942func (drc DeliveryRuleCondition) AsDeliveryRuleIsDeviceCondition() (*DeliveryRuleIsDeviceCondition, bool) { 2943 return nil, false 2944} 2945 2946// AsDeliveryRuleCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleCondition. 2947func (drc DeliveryRuleCondition) AsDeliveryRuleCondition() (*DeliveryRuleCondition, bool) { 2948 return &drc, true 2949} 2950 2951// AsBasicDeliveryRuleCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleCondition. 2952func (drc DeliveryRuleCondition) AsBasicDeliveryRuleCondition() (BasicDeliveryRuleCondition, bool) { 2953 return &drc, true 2954} 2955 2956// DeliveryRuleCookiesCondition defines the Cookies condition for the delivery rule. 2957type DeliveryRuleCookiesCondition struct { 2958 // Parameters - Defines the parameters for the condition. 2959 Parameters *CookiesMatchConditionParameters `json:"parameters,omitempty"` 2960 // Name - Possible values include: 'NameDeliveryRuleCondition', 'NameRemoteAddress', 'NameRequestMethod', 'NameQueryString', 'NamePostArgs', 'NameRequestURI', 'NameRequestHeader', 'NameRequestBody', 'NameRequestScheme', 'NameURLPath', 'NameURLFileExtension', 'NameURLFileName', 'NameHTTPVersion', 'NameCookies', 'NameIsDevice' 2961 Name Name `json:"name,omitempty"` 2962} 2963 2964// MarshalJSON is the custom marshaler for DeliveryRuleCookiesCondition. 2965func (drcc DeliveryRuleCookiesCondition) MarshalJSON() ([]byte, error) { 2966 drcc.Name = NameCookies 2967 objectMap := make(map[string]interface{}) 2968 if drcc.Parameters != nil { 2969 objectMap["parameters"] = drcc.Parameters 2970 } 2971 if drcc.Name != "" { 2972 objectMap["name"] = drcc.Name 2973 } 2974 return json.Marshal(objectMap) 2975} 2976 2977// AsDeliveryRuleRemoteAddressCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleCookiesCondition. 2978func (drcc DeliveryRuleCookiesCondition) AsDeliveryRuleRemoteAddressCondition() (*DeliveryRuleRemoteAddressCondition, bool) { 2979 return nil, false 2980} 2981 2982// AsDeliveryRuleRequestMethodCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleCookiesCondition. 2983func (drcc DeliveryRuleCookiesCondition) AsDeliveryRuleRequestMethodCondition() (*DeliveryRuleRequestMethodCondition, bool) { 2984 return nil, false 2985} 2986 2987// AsDeliveryRuleQueryStringCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleCookiesCondition. 2988func (drcc DeliveryRuleCookiesCondition) AsDeliveryRuleQueryStringCondition() (*DeliveryRuleQueryStringCondition, bool) { 2989 return nil, false 2990} 2991 2992// AsDeliveryRulePostArgsCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleCookiesCondition. 2993func (drcc DeliveryRuleCookiesCondition) AsDeliveryRulePostArgsCondition() (*DeliveryRulePostArgsCondition, bool) { 2994 return nil, false 2995} 2996 2997// AsDeliveryRuleRequestURICondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleCookiesCondition. 2998func (drcc DeliveryRuleCookiesCondition) AsDeliveryRuleRequestURICondition() (*DeliveryRuleRequestURICondition, bool) { 2999 return nil, false 3000} 3001 3002// AsDeliveryRuleRequestHeaderCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleCookiesCondition. 3003func (drcc DeliveryRuleCookiesCondition) AsDeliveryRuleRequestHeaderCondition() (*DeliveryRuleRequestHeaderCondition, bool) { 3004 return nil, false 3005} 3006 3007// AsDeliveryRuleRequestBodyCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleCookiesCondition. 3008func (drcc DeliveryRuleCookiesCondition) AsDeliveryRuleRequestBodyCondition() (*DeliveryRuleRequestBodyCondition, bool) { 3009 return nil, false 3010} 3011 3012// AsDeliveryRuleRequestSchemeCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleCookiesCondition. 3013func (drcc DeliveryRuleCookiesCondition) AsDeliveryRuleRequestSchemeCondition() (*DeliveryRuleRequestSchemeCondition, bool) { 3014 return nil, false 3015} 3016 3017// AsDeliveryRuleURLPathCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleCookiesCondition. 3018func (drcc DeliveryRuleCookiesCondition) AsDeliveryRuleURLPathCondition() (*DeliveryRuleURLPathCondition, bool) { 3019 return nil, false 3020} 3021 3022// AsDeliveryRuleURLFileExtensionCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleCookiesCondition. 3023func (drcc DeliveryRuleCookiesCondition) AsDeliveryRuleURLFileExtensionCondition() (*DeliveryRuleURLFileExtensionCondition, bool) { 3024 return nil, false 3025} 3026 3027// AsDeliveryRuleURLFileNameCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleCookiesCondition. 3028func (drcc DeliveryRuleCookiesCondition) AsDeliveryRuleURLFileNameCondition() (*DeliveryRuleURLFileNameCondition, bool) { 3029 return nil, false 3030} 3031 3032// AsDeliveryRuleHTTPVersionCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleCookiesCondition. 3033func (drcc DeliveryRuleCookiesCondition) AsDeliveryRuleHTTPVersionCondition() (*DeliveryRuleHTTPVersionCondition, bool) { 3034 return nil, false 3035} 3036 3037// AsDeliveryRuleCookiesCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleCookiesCondition. 3038func (drcc DeliveryRuleCookiesCondition) AsDeliveryRuleCookiesCondition() (*DeliveryRuleCookiesCondition, bool) { 3039 return &drcc, true 3040} 3041 3042// AsDeliveryRuleIsDeviceCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleCookiesCondition. 3043func (drcc DeliveryRuleCookiesCondition) AsDeliveryRuleIsDeviceCondition() (*DeliveryRuleIsDeviceCondition, bool) { 3044 return nil, false 3045} 3046 3047// AsDeliveryRuleCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleCookiesCondition. 3048func (drcc DeliveryRuleCookiesCondition) AsDeliveryRuleCondition() (*DeliveryRuleCondition, bool) { 3049 return nil, false 3050} 3051 3052// AsBasicDeliveryRuleCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleCookiesCondition. 3053func (drcc DeliveryRuleCookiesCondition) AsBasicDeliveryRuleCondition() (BasicDeliveryRuleCondition, bool) { 3054 return &drcc, true 3055} 3056 3057// DeliveryRuleHTTPVersionCondition defines the HttpVersion condition for the delivery rule. 3058type DeliveryRuleHTTPVersionCondition struct { 3059 // Parameters - Defines the parameters for the condition. 3060 Parameters *HTTPVersionMatchConditionParameters `json:"parameters,omitempty"` 3061 // Name - Possible values include: 'NameDeliveryRuleCondition', 'NameRemoteAddress', 'NameRequestMethod', 'NameQueryString', 'NamePostArgs', 'NameRequestURI', 'NameRequestHeader', 'NameRequestBody', 'NameRequestScheme', 'NameURLPath', 'NameURLFileExtension', 'NameURLFileName', 'NameHTTPVersion', 'NameCookies', 'NameIsDevice' 3062 Name Name `json:"name,omitempty"` 3063} 3064 3065// MarshalJSON is the custom marshaler for DeliveryRuleHTTPVersionCondition. 3066func (drhvc DeliveryRuleHTTPVersionCondition) MarshalJSON() ([]byte, error) { 3067 drhvc.Name = NameHTTPVersion 3068 objectMap := make(map[string]interface{}) 3069 if drhvc.Parameters != nil { 3070 objectMap["parameters"] = drhvc.Parameters 3071 } 3072 if drhvc.Name != "" { 3073 objectMap["name"] = drhvc.Name 3074 } 3075 return json.Marshal(objectMap) 3076} 3077 3078// AsDeliveryRuleRemoteAddressCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleHTTPVersionCondition. 3079func (drhvc DeliveryRuleHTTPVersionCondition) AsDeliveryRuleRemoteAddressCondition() (*DeliveryRuleRemoteAddressCondition, bool) { 3080 return nil, false 3081} 3082 3083// AsDeliveryRuleRequestMethodCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleHTTPVersionCondition. 3084func (drhvc DeliveryRuleHTTPVersionCondition) AsDeliveryRuleRequestMethodCondition() (*DeliveryRuleRequestMethodCondition, bool) { 3085 return nil, false 3086} 3087 3088// AsDeliveryRuleQueryStringCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleHTTPVersionCondition. 3089func (drhvc DeliveryRuleHTTPVersionCondition) AsDeliveryRuleQueryStringCondition() (*DeliveryRuleQueryStringCondition, bool) { 3090 return nil, false 3091} 3092 3093// AsDeliveryRulePostArgsCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleHTTPVersionCondition. 3094func (drhvc DeliveryRuleHTTPVersionCondition) AsDeliveryRulePostArgsCondition() (*DeliveryRulePostArgsCondition, bool) { 3095 return nil, false 3096} 3097 3098// AsDeliveryRuleRequestURICondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleHTTPVersionCondition. 3099func (drhvc DeliveryRuleHTTPVersionCondition) AsDeliveryRuleRequestURICondition() (*DeliveryRuleRequestURICondition, bool) { 3100 return nil, false 3101} 3102 3103// AsDeliveryRuleRequestHeaderCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleHTTPVersionCondition. 3104func (drhvc DeliveryRuleHTTPVersionCondition) AsDeliveryRuleRequestHeaderCondition() (*DeliveryRuleRequestHeaderCondition, bool) { 3105 return nil, false 3106} 3107 3108// AsDeliveryRuleRequestBodyCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleHTTPVersionCondition. 3109func (drhvc DeliveryRuleHTTPVersionCondition) AsDeliveryRuleRequestBodyCondition() (*DeliveryRuleRequestBodyCondition, bool) { 3110 return nil, false 3111} 3112 3113// AsDeliveryRuleRequestSchemeCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleHTTPVersionCondition. 3114func (drhvc DeliveryRuleHTTPVersionCondition) AsDeliveryRuleRequestSchemeCondition() (*DeliveryRuleRequestSchemeCondition, bool) { 3115 return nil, false 3116} 3117 3118// AsDeliveryRuleURLPathCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleHTTPVersionCondition. 3119func (drhvc DeliveryRuleHTTPVersionCondition) AsDeliveryRuleURLPathCondition() (*DeliveryRuleURLPathCondition, bool) { 3120 return nil, false 3121} 3122 3123// AsDeliveryRuleURLFileExtensionCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleHTTPVersionCondition. 3124func (drhvc DeliveryRuleHTTPVersionCondition) AsDeliveryRuleURLFileExtensionCondition() (*DeliveryRuleURLFileExtensionCondition, bool) { 3125 return nil, false 3126} 3127 3128// AsDeliveryRuleURLFileNameCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleHTTPVersionCondition. 3129func (drhvc DeliveryRuleHTTPVersionCondition) AsDeliveryRuleURLFileNameCondition() (*DeliveryRuleURLFileNameCondition, bool) { 3130 return nil, false 3131} 3132 3133// AsDeliveryRuleHTTPVersionCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleHTTPVersionCondition. 3134func (drhvc DeliveryRuleHTTPVersionCondition) AsDeliveryRuleHTTPVersionCondition() (*DeliveryRuleHTTPVersionCondition, bool) { 3135 return &drhvc, true 3136} 3137 3138// AsDeliveryRuleCookiesCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleHTTPVersionCondition. 3139func (drhvc DeliveryRuleHTTPVersionCondition) AsDeliveryRuleCookiesCondition() (*DeliveryRuleCookiesCondition, bool) { 3140 return nil, false 3141} 3142 3143// AsDeliveryRuleIsDeviceCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleHTTPVersionCondition. 3144func (drhvc DeliveryRuleHTTPVersionCondition) AsDeliveryRuleIsDeviceCondition() (*DeliveryRuleIsDeviceCondition, bool) { 3145 return nil, false 3146} 3147 3148// AsDeliveryRuleCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleHTTPVersionCondition. 3149func (drhvc DeliveryRuleHTTPVersionCondition) AsDeliveryRuleCondition() (*DeliveryRuleCondition, bool) { 3150 return nil, false 3151} 3152 3153// AsBasicDeliveryRuleCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleHTTPVersionCondition. 3154func (drhvc DeliveryRuleHTTPVersionCondition) AsBasicDeliveryRuleCondition() (BasicDeliveryRuleCondition, bool) { 3155 return &drhvc, true 3156} 3157 3158// DeliveryRuleIsDeviceCondition defines the IsDevice condition for the delivery rule. 3159type DeliveryRuleIsDeviceCondition struct { 3160 // Parameters - Defines the parameters for the condition. 3161 Parameters *IsDeviceMatchConditionParameters `json:"parameters,omitempty"` 3162 // Name - Possible values include: 'NameDeliveryRuleCondition', 'NameRemoteAddress', 'NameRequestMethod', 'NameQueryString', 'NamePostArgs', 'NameRequestURI', 'NameRequestHeader', 'NameRequestBody', 'NameRequestScheme', 'NameURLPath', 'NameURLFileExtension', 'NameURLFileName', 'NameHTTPVersion', 'NameCookies', 'NameIsDevice' 3163 Name Name `json:"name,omitempty"` 3164} 3165 3166// MarshalJSON is the custom marshaler for DeliveryRuleIsDeviceCondition. 3167func (dridc DeliveryRuleIsDeviceCondition) MarshalJSON() ([]byte, error) { 3168 dridc.Name = NameIsDevice 3169 objectMap := make(map[string]interface{}) 3170 if dridc.Parameters != nil { 3171 objectMap["parameters"] = dridc.Parameters 3172 } 3173 if dridc.Name != "" { 3174 objectMap["name"] = dridc.Name 3175 } 3176 return json.Marshal(objectMap) 3177} 3178 3179// AsDeliveryRuleRemoteAddressCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleIsDeviceCondition. 3180func (dridc DeliveryRuleIsDeviceCondition) AsDeliveryRuleRemoteAddressCondition() (*DeliveryRuleRemoteAddressCondition, bool) { 3181 return nil, false 3182} 3183 3184// AsDeliveryRuleRequestMethodCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleIsDeviceCondition. 3185func (dridc DeliveryRuleIsDeviceCondition) AsDeliveryRuleRequestMethodCondition() (*DeliveryRuleRequestMethodCondition, bool) { 3186 return nil, false 3187} 3188 3189// AsDeliveryRuleQueryStringCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleIsDeviceCondition. 3190func (dridc DeliveryRuleIsDeviceCondition) AsDeliveryRuleQueryStringCondition() (*DeliveryRuleQueryStringCondition, bool) { 3191 return nil, false 3192} 3193 3194// AsDeliveryRulePostArgsCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleIsDeviceCondition. 3195func (dridc DeliveryRuleIsDeviceCondition) AsDeliveryRulePostArgsCondition() (*DeliveryRulePostArgsCondition, bool) { 3196 return nil, false 3197} 3198 3199// AsDeliveryRuleRequestURICondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleIsDeviceCondition. 3200func (dridc DeliveryRuleIsDeviceCondition) AsDeliveryRuleRequestURICondition() (*DeliveryRuleRequestURICondition, bool) { 3201 return nil, false 3202} 3203 3204// AsDeliveryRuleRequestHeaderCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleIsDeviceCondition. 3205func (dridc DeliveryRuleIsDeviceCondition) AsDeliveryRuleRequestHeaderCondition() (*DeliveryRuleRequestHeaderCondition, bool) { 3206 return nil, false 3207} 3208 3209// AsDeliveryRuleRequestBodyCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleIsDeviceCondition. 3210func (dridc DeliveryRuleIsDeviceCondition) AsDeliveryRuleRequestBodyCondition() (*DeliveryRuleRequestBodyCondition, bool) { 3211 return nil, false 3212} 3213 3214// AsDeliveryRuleRequestSchemeCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleIsDeviceCondition. 3215func (dridc DeliveryRuleIsDeviceCondition) AsDeliveryRuleRequestSchemeCondition() (*DeliveryRuleRequestSchemeCondition, bool) { 3216 return nil, false 3217} 3218 3219// AsDeliveryRuleURLPathCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleIsDeviceCondition. 3220func (dridc DeliveryRuleIsDeviceCondition) AsDeliveryRuleURLPathCondition() (*DeliveryRuleURLPathCondition, bool) { 3221 return nil, false 3222} 3223 3224// AsDeliveryRuleURLFileExtensionCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleIsDeviceCondition. 3225func (dridc DeliveryRuleIsDeviceCondition) AsDeliveryRuleURLFileExtensionCondition() (*DeliveryRuleURLFileExtensionCondition, bool) { 3226 return nil, false 3227} 3228 3229// AsDeliveryRuleURLFileNameCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleIsDeviceCondition. 3230func (dridc DeliveryRuleIsDeviceCondition) AsDeliveryRuleURLFileNameCondition() (*DeliveryRuleURLFileNameCondition, bool) { 3231 return nil, false 3232} 3233 3234// AsDeliveryRuleHTTPVersionCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleIsDeviceCondition. 3235func (dridc DeliveryRuleIsDeviceCondition) AsDeliveryRuleHTTPVersionCondition() (*DeliveryRuleHTTPVersionCondition, bool) { 3236 return nil, false 3237} 3238 3239// AsDeliveryRuleCookiesCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleIsDeviceCondition. 3240func (dridc DeliveryRuleIsDeviceCondition) AsDeliveryRuleCookiesCondition() (*DeliveryRuleCookiesCondition, bool) { 3241 return nil, false 3242} 3243 3244// AsDeliveryRuleIsDeviceCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleIsDeviceCondition. 3245func (dridc DeliveryRuleIsDeviceCondition) AsDeliveryRuleIsDeviceCondition() (*DeliveryRuleIsDeviceCondition, bool) { 3246 return &dridc, true 3247} 3248 3249// AsDeliveryRuleCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleIsDeviceCondition. 3250func (dridc DeliveryRuleIsDeviceCondition) AsDeliveryRuleCondition() (*DeliveryRuleCondition, bool) { 3251 return nil, false 3252} 3253 3254// AsBasicDeliveryRuleCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleIsDeviceCondition. 3255func (dridc DeliveryRuleIsDeviceCondition) AsBasicDeliveryRuleCondition() (BasicDeliveryRuleCondition, bool) { 3256 return &dridc, true 3257} 3258 3259// DeliveryRulePostArgsCondition defines the PostArgs condition for the delivery rule. 3260type DeliveryRulePostArgsCondition struct { 3261 // Parameters - Defines the parameters for the condition. 3262 Parameters *PostArgsMatchConditionParameters `json:"parameters,omitempty"` 3263 // Name - Possible values include: 'NameDeliveryRuleCondition', 'NameRemoteAddress', 'NameRequestMethod', 'NameQueryString', 'NamePostArgs', 'NameRequestURI', 'NameRequestHeader', 'NameRequestBody', 'NameRequestScheme', 'NameURLPath', 'NameURLFileExtension', 'NameURLFileName', 'NameHTTPVersion', 'NameCookies', 'NameIsDevice' 3264 Name Name `json:"name,omitempty"` 3265} 3266 3267// MarshalJSON is the custom marshaler for DeliveryRulePostArgsCondition. 3268func (drpac DeliveryRulePostArgsCondition) MarshalJSON() ([]byte, error) { 3269 drpac.Name = NamePostArgs 3270 objectMap := make(map[string]interface{}) 3271 if drpac.Parameters != nil { 3272 objectMap["parameters"] = drpac.Parameters 3273 } 3274 if drpac.Name != "" { 3275 objectMap["name"] = drpac.Name 3276 } 3277 return json.Marshal(objectMap) 3278} 3279 3280// AsDeliveryRuleRemoteAddressCondition is the BasicDeliveryRuleCondition implementation for DeliveryRulePostArgsCondition. 3281func (drpac DeliveryRulePostArgsCondition) AsDeliveryRuleRemoteAddressCondition() (*DeliveryRuleRemoteAddressCondition, bool) { 3282 return nil, false 3283} 3284 3285// AsDeliveryRuleRequestMethodCondition is the BasicDeliveryRuleCondition implementation for DeliveryRulePostArgsCondition. 3286func (drpac DeliveryRulePostArgsCondition) AsDeliveryRuleRequestMethodCondition() (*DeliveryRuleRequestMethodCondition, bool) { 3287 return nil, false 3288} 3289 3290// AsDeliveryRuleQueryStringCondition is the BasicDeliveryRuleCondition implementation for DeliveryRulePostArgsCondition. 3291func (drpac DeliveryRulePostArgsCondition) AsDeliveryRuleQueryStringCondition() (*DeliveryRuleQueryStringCondition, bool) { 3292 return nil, false 3293} 3294 3295// AsDeliveryRulePostArgsCondition is the BasicDeliveryRuleCondition implementation for DeliveryRulePostArgsCondition. 3296func (drpac DeliveryRulePostArgsCondition) AsDeliveryRulePostArgsCondition() (*DeliveryRulePostArgsCondition, bool) { 3297 return &drpac, true 3298} 3299 3300// AsDeliveryRuleRequestURICondition is the BasicDeliveryRuleCondition implementation for DeliveryRulePostArgsCondition. 3301func (drpac DeliveryRulePostArgsCondition) AsDeliveryRuleRequestURICondition() (*DeliveryRuleRequestURICondition, bool) { 3302 return nil, false 3303} 3304 3305// AsDeliveryRuleRequestHeaderCondition is the BasicDeliveryRuleCondition implementation for DeliveryRulePostArgsCondition. 3306func (drpac DeliveryRulePostArgsCondition) AsDeliveryRuleRequestHeaderCondition() (*DeliveryRuleRequestHeaderCondition, bool) { 3307 return nil, false 3308} 3309 3310// AsDeliveryRuleRequestBodyCondition is the BasicDeliveryRuleCondition implementation for DeliveryRulePostArgsCondition. 3311func (drpac DeliveryRulePostArgsCondition) AsDeliveryRuleRequestBodyCondition() (*DeliveryRuleRequestBodyCondition, bool) { 3312 return nil, false 3313} 3314 3315// AsDeliveryRuleRequestSchemeCondition is the BasicDeliveryRuleCondition implementation for DeliveryRulePostArgsCondition. 3316func (drpac DeliveryRulePostArgsCondition) AsDeliveryRuleRequestSchemeCondition() (*DeliveryRuleRequestSchemeCondition, bool) { 3317 return nil, false 3318} 3319 3320// AsDeliveryRuleURLPathCondition is the BasicDeliveryRuleCondition implementation for DeliveryRulePostArgsCondition. 3321func (drpac DeliveryRulePostArgsCondition) AsDeliveryRuleURLPathCondition() (*DeliveryRuleURLPathCondition, bool) { 3322 return nil, false 3323} 3324 3325// AsDeliveryRuleURLFileExtensionCondition is the BasicDeliveryRuleCondition implementation for DeliveryRulePostArgsCondition. 3326func (drpac DeliveryRulePostArgsCondition) AsDeliveryRuleURLFileExtensionCondition() (*DeliveryRuleURLFileExtensionCondition, bool) { 3327 return nil, false 3328} 3329 3330// AsDeliveryRuleURLFileNameCondition is the BasicDeliveryRuleCondition implementation for DeliveryRulePostArgsCondition. 3331func (drpac DeliveryRulePostArgsCondition) AsDeliveryRuleURLFileNameCondition() (*DeliveryRuleURLFileNameCondition, bool) { 3332 return nil, false 3333} 3334 3335// AsDeliveryRuleHTTPVersionCondition is the BasicDeliveryRuleCondition implementation for DeliveryRulePostArgsCondition. 3336func (drpac DeliveryRulePostArgsCondition) AsDeliveryRuleHTTPVersionCondition() (*DeliveryRuleHTTPVersionCondition, bool) { 3337 return nil, false 3338} 3339 3340// AsDeliveryRuleCookiesCondition is the BasicDeliveryRuleCondition implementation for DeliveryRulePostArgsCondition. 3341func (drpac DeliveryRulePostArgsCondition) AsDeliveryRuleCookiesCondition() (*DeliveryRuleCookiesCondition, bool) { 3342 return nil, false 3343} 3344 3345// AsDeliveryRuleIsDeviceCondition is the BasicDeliveryRuleCondition implementation for DeliveryRulePostArgsCondition. 3346func (drpac DeliveryRulePostArgsCondition) AsDeliveryRuleIsDeviceCondition() (*DeliveryRuleIsDeviceCondition, bool) { 3347 return nil, false 3348} 3349 3350// AsDeliveryRuleCondition is the BasicDeliveryRuleCondition implementation for DeliveryRulePostArgsCondition. 3351func (drpac DeliveryRulePostArgsCondition) AsDeliveryRuleCondition() (*DeliveryRuleCondition, bool) { 3352 return nil, false 3353} 3354 3355// AsBasicDeliveryRuleCondition is the BasicDeliveryRuleCondition implementation for DeliveryRulePostArgsCondition. 3356func (drpac DeliveryRulePostArgsCondition) AsBasicDeliveryRuleCondition() (BasicDeliveryRuleCondition, bool) { 3357 return &drpac, true 3358} 3359 3360// DeliveryRuleQueryStringCondition defines the QueryString condition for the delivery rule. 3361type DeliveryRuleQueryStringCondition struct { 3362 // Parameters - Defines the parameters for the condition. 3363 Parameters *QueryStringMatchConditionParameters `json:"parameters,omitempty"` 3364 // Name - Possible values include: 'NameDeliveryRuleCondition', 'NameRemoteAddress', 'NameRequestMethod', 'NameQueryString', 'NamePostArgs', 'NameRequestURI', 'NameRequestHeader', 'NameRequestBody', 'NameRequestScheme', 'NameURLPath', 'NameURLFileExtension', 'NameURLFileName', 'NameHTTPVersion', 'NameCookies', 'NameIsDevice' 3365 Name Name `json:"name,omitempty"` 3366} 3367 3368// MarshalJSON is the custom marshaler for DeliveryRuleQueryStringCondition. 3369func (drqsc DeliveryRuleQueryStringCondition) MarshalJSON() ([]byte, error) { 3370 drqsc.Name = NameQueryString 3371 objectMap := make(map[string]interface{}) 3372 if drqsc.Parameters != nil { 3373 objectMap["parameters"] = drqsc.Parameters 3374 } 3375 if drqsc.Name != "" { 3376 objectMap["name"] = drqsc.Name 3377 } 3378 return json.Marshal(objectMap) 3379} 3380 3381// AsDeliveryRuleRemoteAddressCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleQueryStringCondition. 3382func (drqsc DeliveryRuleQueryStringCondition) AsDeliveryRuleRemoteAddressCondition() (*DeliveryRuleRemoteAddressCondition, bool) { 3383 return nil, false 3384} 3385 3386// AsDeliveryRuleRequestMethodCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleQueryStringCondition. 3387func (drqsc DeliveryRuleQueryStringCondition) AsDeliveryRuleRequestMethodCondition() (*DeliveryRuleRequestMethodCondition, bool) { 3388 return nil, false 3389} 3390 3391// AsDeliveryRuleQueryStringCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleQueryStringCondition. 3392func (drqsc DeliveryRuleQueryStringCondition) AsDeliveryRuleQueryStringCondition() (*DeliveryRuleQueryStringCondition, bool) { 3393 return &drqsc, true 3394} 3395 3396// AsDeliveryRulePostArgsCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleQueryStringCondition. 3397func (drqsc DeliveryRuleQueryStringCondition) AsDeliveryRulePostArgsCondition() (*DeliveryRulePostArgsCondition, bool) { 3398 return nil, false 3399} 3400 3401// AsDeliveryRuleRequestURICondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleQueryStringCondition. 3402func (drqsc DeliveryRuleQueryStringCondition) AsDeliveryRuleRequestURICondition() (*DeliveryRuleRequestURICondition, bool) { 3403 return nil, false 3404} 3405 3406// AsDeliveryRuleRequestHeaderCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleQueryStringCondition. 3407func (drqsc DeliveryRuleQueryStringCondition) AsDeliveryRuleRequestHeaderCondition() (*DeliveryRuleRequestHeaderCondition, bool) { 3408 return nil, false 3409} 3410 3411// AsDeliveryRuleRequestBodyCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleQueryStringCondition. 3412func (drqsc DeliveryRuleQueryStringCondition) AsDeliveryRuleRequestBodyCondition() (*DeliveryRuleRequestBodyCondition, bool) { 3413 return nil, false 3414} 3415 3416// AsDeliveryRuleRequestSchemeCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleQueryStringCondition. 3417func (drqsc DeliveryRuleQueryStringCondition) AsDeliveryRuleRequestSchemeCondition() (*DeliveryRuleRequestSchemeCondition, bool) { 3418 return nil, false 3419} 3420 3421// AsDeliveryRuleURLPathCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleQueryStringCondition. 3422func (drqsc DeliveryRuleQueryStringCondition) AsDeliveryRuleURLPathCondition() (*DeliveryRuleURLPathCondition, bool) { 3423 return nil, false 3424} 3425 3426// AsDeliveryRuleURLFileExtensionCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleQueryStringCondition. 3427func (drqsc DeliveryRuleQueryStringCondition) AsDeliveryRuleURLFileExtensionCondition() (*DeliveryRuleURLFileExtensionCondition, bool) { 3428 return nil, false 3429} 3430 3431// AsDeliveryRuleURLFileNameCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleQueryStringCondition. 3432func (drqsc DeliveryRuleQueryStringCondition) AsDeliveryRuleURLFileNameCondition() (*DeliveryRuleURLFileNameCondition, bool) { 3433 return nil, false 3434} 3435 3436// AsDeliveryRuleHTTPVersionCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleQueryStringCondition. 3437func (drqsc DeliveryRuleQueryStringCondition) AsDeliveryRuleHTTPVersionCondition() (*DeliveryRuleHTTPVersionCondition, bool) { 3438 return nil, false 3439} 3440 3441// AsDeliveryRuleCookiesCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleQueryStringCondition. 3442func (drqsc DeliveryRuleQueryStringCondition) AsDeliveryRuleCookiesCondition() (*DeliveryRuleCookiesCondition, bool) { 3443 return nil, false 3444} 3445 3446// AsDeliveryRuleIsDeviceCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleQueryStringCondition. 3447func (drqsc DeliveryRuleQueryStringCondition) AsDeliveryRuleIsDeviceCondition() (*DeliveryRuleIsDeviceCondition, bool) { 3448 return nil, false 3449} 3450 3451// AsDeliveryRuleCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleQueryStringCondition. 3452func (drqsc DeliveryRuleQueryStringCondition) AsDeliveryRuleCondition() (*DeliveryRuleCondition, bool) { 3453 return nil, false 3454} 3455 3456// AsBasicDeliveryRuleCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleQueryStringCondition. 3457func (drqsc DeliveryRuleQueryStringCondition) AsBasicDeliveryRuleCondition() (BasicDeliveryRuleCondition, bool) { 3458 return &drqsc, true 3459} 3460 3461// DeliveryRuleRemoteAddressCondition defines the RemoteAddress condition for the delivery rule. 3462type DeliveryRuleRemoteAddressCondition struct { 3463 // Parameters - Defines the parameters for the condition. 3464 Parameters *RemoteAddressMatchConditionParameters `json:"parameters,omitempty"` 3465 // Name - Possible values include: 'NameDeliveryRuleCondition', 'NameRemoteAddress', 'NameRequestMethod', 'NameQueryString', 'NamePostArgs', 'NameRequestURI', 'NameRequestHeader', 'NameRequestBody', 'NameRequestScheme', 'NameURLPath', 'NameURLFileExtension', 'NameURLFileName', 'NameHTTPVersion', 'NameCookies', 'NameIsDevice' 3466 Name Name `json:"name,omitempty"` 3467} 3468 3469// MarshalJSON is the custom marshaler for DeliveryRuleRemoteAddressCondition. 3470func (drrac DeliveryRuleRemoteAddressCondition) MarshalJSON() ([]byte, error) { 3471 drrac.Name = NameRemoteAddress 3472 objectMap := make(map[string]interface{}) 3473 if drrac.Parameters != nil { 3474 objectMap["parameters"] = drrac.Parameters 3475 } 3476 if drrac.Name != "" { 3477 objectMap["name"] = drrac.Name 3478 } 3479 return json.Marshal(objectMap) 3480} 3481 3482// AsDeliveryRuleRemoteAddressCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRemoteAddressCondition. 3483func (drrac DeliveryRuleRemoteAddressCondition) AsDeliveryRuleRemoteAddressCondition() (*DeliveryRuleRemoteAddressCondition, bool) { 3484 return &drrac, true 3485} 3486 3487// AsDeliveryRuleRequestMethodCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRemoteAddressCondition. 3488func (drrac DeliveryRuleRemoteAddressCondition) AsDeliveryRuleRequestMethodCondition() (*DeliveryRuleRequestMethodCondition, bool) { 3489 return nil, false 3490} 3491 3492// AsDeliveryRuleQueryStringCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRemoteAddressCondition. 3493func (drrac DeliveryRuleRemoteAddressCondition) AsDeliveryRuleQueryStringCondition() (*DeliveryRuleQueryStringCondition, bool) { 3494 return nil, false 3495} 3496 3497// AsDeliveryRulePostArgsCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRemoteAddressCondition. 3498func (drrac DeliveryRuleRemoteAddressCondition) AsDeliveryRulePostArgsCondition() (*DeliveryRulePostArgsCondition, bool) { 3499 return nil, false 3500} 3501 3502// AsDeliveryRuleRequestURICondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRemoteAddressCondition. 3503func (drrac DeliveryRuleRemoteAddressCondition) AsDeliveryRuleRequestURICondition() (*DeliveryRuleRequestURICondition, bool) { 3504 return nil, false 3505} 3506 3507// AsDeliveryRuleRequestHeaderCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRemoteAddressCondition. 3508func (drrac DeliveryRuleRemoteAddressCondition) AsDeliveryRuleRequestHeaderCondition() (*DeliveryRuleRequestHeaderCondition, bool) { 3509 return nil, false 3510} 3511 3512// AsDeliveryRuleRequestBodyCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRemoteAddressCondition. 3513func (drrac DeliveryRuleRemoteAddressCondition) AsDeliveryRuleRequestBodyCondition() (*DeliveryRuleRequestBodyCondition, bool) { 3514 return nil, false 3515} 3516 3517// AsDeliveryRuleRequestSchemeCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRemoteAddressCondition. 3518func (drrac DeliveryRuleRemoteAddressCondition) AsDeliveryRuleRequestSchemeCondition() (*DeliveryRuleRequestSchemeCondition, bool) { 3519 return nil, false 3520} 3521 3522// AsDeliveryRuleURLPathCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRemoteAddressCondition. 3523func (drrac DeliveryRuleRemoteAddressCondition) AsDeliveryRuleURLPathCondition() (*DeliveryRuleURLPathCondition, bool) { 3524 return nil, false 3525} 3526 3527// AsDeliveryRuleURLFileExtensionCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRemoteAddressCondition. 3528func (drrac DeliveryRuleRemoteAddressCondition) AsDeliveryRuleURLFileExtensionCondition() (*DeliveryRuleURLFileExtensionCondition, bool) { 3529 return nil, false 3530} 3531 3532// AsDeliveryRuleURLFileNameCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRemoteAddressCondition. 3533func (drrac DeliveryRuleRemoteAddressCondition) AsDeliveryRuleURLFileNameCondition() (*DeliveryRuleURLFileNameCondition, bool) { 3534 return nil, false 3535} 3536 3537// AsDeliveryRuleHTTPVersionCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRemoteAddressCondition. 3538func (drrac DeliveryRuleRemoteAddressCondition) AsDeliveryRuleHTTPVersionCondition() (*DeliveryRuleHTTPVersionCondition, bool) { 3539 return nil, false 3540} 3541 3542// AsDeliveryRuleCookiesCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRemoteAddressCondition. 3543func (drrac DeliveryRuleRemoteAddressCondition) AsDeliveryRuleCookiesCondition() (*DeliveryRuleCookiesCondition, bool) { 3544 return nil, false 3545} 3546 3547// AsDeliveryRuleIsDeviceCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRemoteAddressCondition. 3548func (drrac DeliveryRuleRemoteAddressCondition) AsDeliveryRuleIsDeviceCondition() (*DeliveryRuleIsDeviceCondition, bool) { 3549 return nil, false 3550} 3551 3552// AsDeliveryRuleCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRemoteAddressCondition. 3553func (drrac DeliveryRuleRemoteAddressCondition) AsDeliveryRuleCondition() (*DeliveryRuleCondition, bool) { 3554 return nil, false 3555} 3556 3557// AsBasicDeliveryRuleCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRemoteAddressCondition. 3558func (drrac DeliveryRuleRemoteAddressCondition) AsBasicDeliveryRuleCondition() (BasicDeliveryRuleCondition, bool) { 3559 return &drrac, true 3560} 3561 3562// DeliveryRuleRequestBodyCondition defines the RequestBody condition for the delivery rule. 3563type DeliveryRuleRequestBodyCondition struct { 3564 // Parameters - Defines the parameters for the condition. 3565 Parameters *RequestBodyMatchConditionParameters `json:"parameters,omitempty"` 3566 // Name - Possible values include: 'NameDeliveryRuleCondition', 'NameRemoteAddress', 'NameRequestMethod', 'NameQueryString', 'NamePostArgs', 'NameRequestURI', 'NameRequestHeader', 'NameRequestBody', 'NameRequestScheme', 'NameURLPath', 'NameURLFileExtension', 'NameURLFileName', 'NameHTTPVersion', 'NameCookies', 'NameIsDevice' 3567 Name Name `json:"name,omitempty"` 3568} 3569 3570// MarshalJSON is the custom marshaler for DeliveryRuleRequestBodyCondition. 3571func (drrbc DeliveryRuleRequestBodyCondition) MarshalJSON() ([]byte, error) { 3572 drrbc.Name = NameRequestBody 3573 objectMap := make(map[string]interface{}) 3574 if drrbc.Parameters != nil { 3575 objectMap["parameters"] = drrbc.Parameters 3576 } 3577 if drrbc.Name != "" { 3578 objectMap["name"] = drrbc.Name 3579 } 3580 return json.Marshal(objectMap) 3581} 3582 3583// AsDeliveryRuleRemoteAddressCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestBodyCondition. 3584func (drrbc DeliveryRuleRequestBodyCondition) AsDeliveryRuleRemoteAddressCondition() (*DeliveryRuleRemoteAddressCondition, bool) { 3585 return nil, false 3586} 3587 3588// AsDeliveryRuleRequestMethodCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestBodyCondition. 3589func (drrbc DeliveryRuleRequestBodyCondition) AsDeliveryRuleRequestMethodCondition() (*DeliveryRuleRequestMethodCondition, bool) { 3590 return nil, false 3591} 3592 3593// AsDeliveryRuleQueryStringCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestBodyCondition. 3594func (drrbc DeliveryRuleRequestBodyCondition) AsDeliveryRuleQueryStringCondition() (*DeliveryRuleQueryStringCondition, bool) { 3595 return nil, false 3596} 3597 3598// AsDeliveryRulePostArgsCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestBodyCondition. 3599func (drrbc DeliveryRuleRequestBodyCondition) AsDeliveryRulePostArgsCondition() (*DeliveryRulePostArgsCondition, bool) { 3600 return nil, false 3601} 3602 3603// AsDeliveryRuleRequestURICondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestBodyCondition. 3604func (drrbc DeliveryRuleRequestBodyCondition) AsDeliveryRuleRequestURICondition() (*DeliveryRuleRequestURICondition, bool) { 3605 return nil, false 3606} 3607 3608// AsDeliveryRuleRequestHeaderCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestBodyCondition. 3609func (drrbc DeliveryRuleRequestBodyCondition) AsDeliveryRuleRequestHeaderCondition() (*DeliveryRuleRequestHeaderCondition, bool) { 3610 return nil, false 3611} 3612 3613// AsDeliveryRuleRequestBodyCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestBodyCondition. 3614func (drrbc DeliveryRuleRequestBodyCondition) AsDeliveryRuleRequestBodyCondition() (*DeliveryRuleRequestBodyCondition, bool) { 3615 return &drrbc, true 3616} 3617 3618// AsDeliveryRuleRequestSchemeCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestBodyCondition. 3619func (drrbc DeliveryRuleRequestBodyCondition) AsDeliveryRuleRequestSchemeCondition() (*DeliveryRuleRequestSchemeCondition, bool) { 3620 return nil, false 3621} 3622 3623// AsDeliveryRuleURLPathCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestBodyCondition. 3624func (drrbc DeliveryRuleRequestBodyCondition) AsDeliveryRuleURLPathCondition() (*DeliveryRuleURLPathCondition, bool) { 3625 return nil, false 3626} 3627 3628// AsDeliveryRuleURLFileExtensionCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestBodyCondition. 3629func (drrbc DeliveryRuleRequestBodyCondition) AsDeliveryRuleURLFileExtensionCondition() (*DeliveryRuleURLFileExtensionCondition, bool) { 3630 return nil, false 3631} 3632 3633// AsDeliveryRuleURLFileNameCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestBodyCondition. 3634func (drrbc DeliveryRuleRequestBodyCondition) AsDeliveryRuleURLFileNameCondition() (*DeliveryRuleURLFileNameCondition, bool) { 3635 return nil, false 3636} 3637 3638// AsDeliveryRuleHTTPVersionCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestBodyCondition. 3639func (drrbc DeliveryRuleRequestBodyCondition) AsDeliveryRuleHTTPVersionCondition() (*DeliveryRuleHTTPVersionCondition, bool) { 3640 return nil, false 3641} 3642 3643// AsDeliveryRuleCookiesCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestBodyCondition. 3644func (drrbc DeliveryRuleRequestBodyCondition) AsDeliveryRuleCookiesCondition() (*DeliveryRuleCookiesCondition, bool) { 3645 return nil, false 3646} 3647 3648// AsDeliveryRuleIsDeviceCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestBodyCondition. 3649func (drrbc DeliveryRuleRequestBodyCondition) AsDeliveryRuleIsDeviceCondition() (*DeliveryRuleIsDeviceCondition, bool) { 3650 return nil, false 3651} 3652 3653// AsDeliveryRuleCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestBodyCondition. 3654func (drrbc DeliveryRuleRequestBodyCondition) AsDeliveryRuleCondition() (*DeliveryRuleCondition, bool) { 3655 return nil, false 3656} 3657 3658// AsBasicDeliveryRuleCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestBodyCondition. 3659func (drrbc DeliveryRuleRequestBodyCondition) AsBasicDeliveryRuleCondition() (BasicDeliveryRuleCondition, bool) { 3660 return &drrbc, true 3661} 3662 3663// DeliveryRuleRequestHeaderAction defines the request header action for the delivery rule. 3664type DeliveryRuleRequestHeaderAction struct { 3665 // Parameters - Defines the parameters for the action. 3666 Parameters *HeaderActionParameters `json:"parameters,omitempty"` 3667 // Name - Possible values include: 'NameDeliveryRuleAction', 'NameURLRedirect', 'NameURLSigning', 'NameOriginGroupOverride', 'NameURLRewrite', 'NameModifyRequestHeader', 'NameModifyResponseHeader', 'NameCacheExpiration', 'NameCacheKeyQueryString' 3668 Name NameBasicDeliveryRuleAction `json:"name,omitempty"` 3669} 3670 3671// MarshalJSON is the custom marshaler for DeliveryRuleRequestHeaderAction. 3672func (drrha DeliveryRuleRequestHeaderAction) MarshalJSON() ([]byte, error) { 3673 drrha.Name = NameModifyRequestHeader 3674 objectMap := make(map[string]interface{}) 3675 if drrha.Parameters != nil { 3676 objectMap["parameters"] = drrha.Parameters 3677 } 3678 if drrha.Name != "" { 3679 objectMap["name"] = drrha.Name 3680 } 3681 return json.Marshal(objectMap) 3682} 3683 3684// AsURLRedirectAction is the BasicDeliveryRuleAction implementation for DeliveryRuleRequestHeaderAction. 3685func (drrha DeliveryRuleRequestHeaderAction) AsURLRedirectAction() (*URLRedirectAction, bool) { 3686 return nil, false 3687} 3688 3689// AsURLSigningAction is the BasicDeliveryRuleAction implementation for DeliveryRuleRequestHeaderAction. 3690func (drrha DeliveryRuleRequestHeaderAction) AsURLSigningAction() (*URLSigningAction, bool) { 3691 return nil, false 3692} 3693 3694// AsOriginGroupOverrideAction is the BasicDeliveryRuleAction implementation for DeliveryRuleRequestHeaderAction. 3695func (drrha DeliveryRuleRequestHeaderAction) AsOriginGroupOverrideAction() (*OriginGroupOverrideAction, bool) { 3696 return nil, false 3697} 3698 3699// AsURLRewriteAction is the BasicDeliveryRuleAction implementation for DeliveryRuleRequestHeaderAction. 3700func (drrha DeliveryRuleRequestHeaderAction) AsURLRewriteAction() (*URLRewriteAction, bool) { 3701 return nil, false 3702} 3703 3704// AsDeliveryRuleRequestHeaderAction is the BasicDeliveryRuleAction implementation for DeliveryRuleRequestHeaderAction. 3705func (drrha DeliveryRuleRequestHeaderAction) AsDeliveryRuleRequestHeaderAction() (*DeliveryRuleRequestHeaderAction, bool) { 3706 return &drrha, true 3707} 3708 3709// AsDeliveryRuleResponseHeaderAction is the BasicDeliveryRuleAction implementation for DeliveryRuleRequestHeaderAction. 3710func (drrha DeliveryRuleRequestHeaderAction) AsDeliveryRuleResponseHeaderAction() (*DeliveryRuleResponseHeaderAction, bool) { 3711 return nil, false 3712} 3713 3714// AsDeliveryRuleCacheExpirationAction is the BasicDeliveryRuleAction implementation for DeliveryRuleRequestHeaderAction. 3715func (drrha DeliveryRuleRequestHeaderAction) AsDeliveryRuleCacheExpirationAction() (*DeliveryRuleCacheExpirationAction, bool) { 3716 return nil, false 3717} 3718 3719// AsDeliveryRuleCacheKeyQueryStringAction is the BasicDeliveryRuleAction implementation for DeliveryRuleRequestHeaderAction. 3720func (drrha DeliveryRuleRequestHeaderAction) AsDeliveryRuleCacheKeyQueryStringAction() (*DeliveryRuleCacheKeyQueryStringAction, bool) { 3721 return nil, false 3722} 3723 3724// AsDeliveryRuleAction is the BasicDeliveryRuleAction implementation for DeliveryRuleRequestHeaderAction. 3725func (drrha DeliveryRuleRequestHeaderAction) AsDeliveryRuleAction() (*DeliveryRuleAction, bool) { 3726 return nil, false 3727} 3728 3729// AsBasicDeliveryRuleAction is the BasicDeliveryRuleAction implementation for DeliveryRuleRequestHeaderAction. 3730func (drrha DeliveryRuleRequestHeaderAction) AsBasicDeliveryRuleAction() (BasicDeliveryRuleAction, bool) { 3731 return &drrha, true 3732} 3733 3734// DeliveryRuleRequestHeaderCondition defines the RequestHeader condition for the delivery rule. 3735type DeliveryRuleRequestHeaderCondition struct { 3736 // Parameters - Defines the parameters for the condition. 3737 Parameters *RequestHeaderMatchConditionParameters `json:"parameters,omitempty"` 3738 // Name - Possible values include: 'NameDeliveryRuleCondition', 'NameRemoteAddress', 'NameRequestMethod', 'NameQueryString', 'NamePostArgs', 'NameRequestURI', 'NameRequestHeader', 'NameRequestBody', 'NameRequestScheme', 'NameURLPath', 'NameURLFileExtension', 'NameURLFileName', 'NameHTTPVersion', 'NameCookies', 'NameIsDevice' 3739 Name Name `json:"name,omitempty"` 3740} 3741 3742// MarshalJSON is the custom marshaler for DeliveryRuleRequestHeaderCondition. 3743func (drrhc DeliveryRuleRequestHeaderCondition) MarshalJSON() ([]byte, error) { 3744 drrhc.Name = NameRequestHeader 3745 objectMap := make(map[string]interface{}) 3746 if drrhc.Parameters != nil { 3747 objectMap["parameters"] = drrhc.Parameters 3748 } 3749 if drrhc.Name != "" { 3750 objectMap["name"] = drrhc.Name 3751 } 3752 return json.Marshal(objectMap) 3753} 3754 3755// AsDeliveryRuleRemoteAddressCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestHeaderCondition. 3756func (drrhc DeliveryRuleRequestHeaderCondition) AsDeliveryRuleRemoteAddressCondition() (*DeliveryRuleRemoteAddressCondition, bool) { 3757 return nil, false 3758} 3759 3760// AsDeliveryRuleRequestMethodCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestHeaderCondition. 3761func (drrhc DeliveryRuleRequestHeaderCondition) AsDeliveryRuleRequestMethodCondition() (*DeliveryRuleRequestMethodCondition, bool) { 3762 return nil, false 3763} 3764 3765// AsDeliveryRuleQueryStringCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestHeaderCondition. 3766func (drrhc DeliveryRuleRequestHeaderCondition) AsDeliveryRuleQueryStringCondition() (*DeliveryRuleQueryStringCondition, bool) { 3767 return nil, false 3768} 3769 3770// AsDeliveryRulePostArgsCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestHeaderCondition. 3771func (drrhc DeliveryRuleRequestHeaderCondition) AsDeliveryRulePostArgsCondition() (*DeliveryRulePostArgsCondition, bool) { 3772 return nil, false 3773} 3774 3775// AsDeliveryRuleRequestURICondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestHeaderCondition. 3776func (drrhc DeliveryRuleRequestHeaderCondition) AsDeliveryRuleRequestURICondition() (*DeliveryRuleRequestURICondition, bool) { 3777 return nil, false 3778} 3779 3780// AsDeliveryRuleRequestHeaderCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestHeaderCondition. 3781func (drrhc DeliveryRuleRequestHeaderCondition) AsDeliveryRuleRequestHeaderCondition() (*DeliveryRuleRequestHeaderCondition, bool) { 3782 return &drrhc, true 3783} 3784 3785// AsDeliveryRuleRequestBodyCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestHeaderCondition. 3786func (drrhc DeliveryRuleRequestHeaderCondition) AsDeliveryRuleRequestBodyCondition() (*DeliveryRuleRequestBodyCondition, bool) { 3787 return nil, false 3788} 3789 3790// AsDeliveryRuleRequestSchemeCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestHeaderCondition. 3791func (drrhc DeliveryRuleRequestHeaderCondition) AsDeliveryRuleRequestSchemeCondition() (*DeliveryRuleRequestSchemeCondition, bool) { 3792 return nil, false 3793} 3794 3795// AsDeliveryRuleURLPathCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestHeaderCondition. 3796func (drrhc DeliveryRuleRequestHeaderCondition) AsDeliveryRuleURLPathCondition() (*DeliveryRuleURLPathCondition, bool) { 3797 return nil, false 3798} 3799 3800// AsDeliveryRuleURLFileExtensionCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestHeaderCondition. 3801func (drrhc DeliveryRuleRequestHeaderCondition) AsDeliveryRuleURLFileExtensionCondition() (*DeliveryRuleURLFileExtensionCondition, bool) { 3802 return nil, false 3803} 3804 3805// AsDeliveryRuleURLFileNameCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestHeaderCondition. 3806func (drrhc DeliveryRuleRequestHeaderCondition) AsDeliveryRuleURLFileNameCondition() (*DeliveryRuleURLFileNameCondition, bool) { 3807 return nil, false 3808} 3809 3810// AsDeliveryRuleHTTPVersionCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestHeaderCondition. 3811func (drrhc DeliveryRuleRequestHeaderCondition) AsDeliveryRuleHTTPVersionCondition() (*DeliveryRuleHTTPVersionCondition, bool) { 3812 return nil, false 3813} 3814 3815// AsDeliveryRuleCookiesCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestHeaderCondition. 3816func (drrhc DeliveryRuleRequestHeaderCondition) AsDeliveryRuleCookiesCondition() (*DeliveryRuleCookiesCondition, bool) { 3817 return nil, false 3818} 3819 3820// AsDeliveryRuleIsDeviceCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestHeaderCondition. 3821func (drrhc DeliveryRuleRequestHeaderCondition) AsDeliveryRuleIsDeviceCondition() (*DeliveryRuleIsDeviceCondition, bool) { 3822 return nil, false 3823} 3824 3825// AsDeliveryRuleCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestHeaderCondition. 3826func (drrhc DeliveryRuleRequestHeaderCondition) AsDeliveryRuleCondition() (*DeliveryRuleCondition, bool) { 3827 return nil, false 3828} 3829 3830// AsBasicDeliveryRuleCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestHeaderCondition. 3831func (drrhc DeliveryRuleRequestHeaderCondition) AsBasicDeliveryRuleCondition() (BasicDeliveryRuleCondition, bool) { 3832 return &drrhc, true 3833} 3834 3835// DeliveryRuleRequestMethodCondition defines the RequestMethod condition for the delivery rule. 3836type DeliveryRuleRequestMethodCondition struct { 3837 // Parameters - Defines the parameters for the condition. 3838 Parameters *RequestMethodMatchConditionParameters `json:"parameters,omitempty"` 3839 // Name - Possible values include: 'NameDeliveryRuleCondition', 'NameRemoteAddress', 'NameRequestMethod', 'NameQueryString', 'NamePostArgs', 'NameRequestURI', 'NameRequestHeader', 'NameRequestBody', 'NameRequestScheme', 'NameURLPath', 'NameURLFileExtension', 'NameURLFileName', 'NameHTTPVersion', 'NameCookies', 'NameIsDevice' 3840 Name Name `json:"name,omitempty"` 3841} 3842 3843// MarshalJSON is the custom marshaler for DeliveryRuleRequestMethodCondition. 3844func (drrmc DeliveryRuleRequestMethodCondition) MarshalJSON() ([]byte, error) { 3845 drrmc.Name = NameRequestMethod 3846 objectMap := make(map[string]interface{}) 3847 if drrmc.Parameters != nil { 3848 objectMap["parameters"] = drrmc.Parameters 3849 } 3850 if drrmc.Name != "" { 3851 objectMap["name"] = drrmc.Name 3852 } 3853 return json.Marshal(objectMap) 3854} 3855 3856// AsDeliveryRuleRemoteAddressCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestMethodCondition. 3857func (drrmc DeliveryRuleRequestMethodCondition) AsDeliveryRuleRemoteAddressCondition() (*DeliveryRuleRemoteAddressCondition, bool) { 3858 return nil, false 3859} 3860 3861// AsDeliveryRuleRequestMethodCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestMethodCondition. 3862func (drrmc DeliveryRuleRequestMethodCondition) AsDeliveryRuleRequestMethodCondition() (*DeliveryRuleRequestMethodCondition, bool) { 3863 return &drrmc, true 3864} 3865 3866// AsDeliveryRuleQueryStringCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestMethodCondition. 3867func (drrmc DeliveryRuleRequestMethodCondition) AsDeliveryRuleQueryStringCondition() (*DeliveryRuleQueryStringCondition, bool) { 3868 return nil, false 3869} 3870 3871// AsDeliveryRulePostArgsCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestMethodCondition. 3872func (drrmc DeliveryRuleRequestMethodCondition) AsDeliveryRulePostArgsCondition() (*DeliveryRulePostArgsCondition, bool) { 3873 return nil, false 3874} 3875 3876// AsDeliveryRuleRequestURICondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestMethodCondition. 3877func (drrmc DeliveryRuleRequestMethodCondition) AsDeliveryRuleRequestURICondition() (*DeliveryRuleRequestURICondition, bool) { 3878 return nil, false 3879} 3880 3881// AsDeliveryRuleRequestHeaderCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestMethodCondition. 3882func (drrmc DeliveryRuleRequestMethodCondition) AsDeliveryRuleRequestHeaderCondition() (*DeliveryRuleRequestHeaderCondition, bool) { 3883 return nil, false 3884} 3885 3886// AsDeliveryRuleRequestBodyCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestMethodCondition. 3887func (drrmc DeliveryRuleRequestMethodCondition) AsDeliveryRuleRequestBodyCondition() (*DeliveryRuleRequestBodyCondition, bool) { 3888 return nil, false 3889} 3890 3891// AsDeliveryRuleRequestSchemeCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestMethodCondition. 3892func (drrmc DeliveryRuleRequestMethodCondition) AsDeliveryRuleRequestSchemeCondition() (*DeliveryRuleRequestSchemeCondition, bool) { 3893 return nil, false 3894} 3895 3896// AsDeliveryRuleURLPathCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestMethodCondition. 3897func (drrmc DeliveryRuleRequestMethodCondition) AsDeliveryRuleURLPathCondition() (*DeliveryRuleURLPathCondition, bool) { 3898 return nil, false 3899} 3900 3901// AsDeliveryRuleURLFileExtensionCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestMethodCondition. 3902func (drrmc DeliveryRuleRequestMethodCondition) AsDeliveryRuleURLFileExtensionCondition() (*DeliveryRuleURLFileExtensionCondition, bool) { 3903 return nil, false 3904} 3905 3906// AsDeliveryRuleURLFileNameCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestMethodCondition. 3907func (drrmc DeliveryRuleRequestMethodCondition) AsDeliveryRuleURLFileNameCondition() (*DeliveryRuleURLFileNameCondition, bool) { 3908 return nil, false 3909} 3910 3911// AsDeliveryRuleHTTPVersionCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestMethodCondition. 3912func (drrmc DeliveryRuleRequestMethodCondition) AsDeliveryRuleHTTPVersionCondition() (*DeliveryRuleHTTPVersionCondition, bool) { 3913 return nil, false 3914} 3915 3916// AsDeliveryRuleCookiesCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestMethodCondition. 3917func (drrmc DeliveryRuleRequestMethodCondition) AsDeliveryRuleCookiesCondition() (*DeliveryRuleCookiesCondition, bool) { 3918 return nil, false 3919} 3920 3921// AsDeliveryRuleIsDeviceCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestMethodCondition. 3922func (drrmc DeliveryRuleRequestMethodCondition) AsDeliveryRuleIsDeviceCondition() (*DeliveryRuleIsDeviceCondition, bool) { 3923 return nil, false 3924} 3925 3926// AsDeliveryRuleCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestMethodCondition. 3927func (drrmc DeliveryRuleRequestMethodCondition) AsDeliveryRuleCondition() (*DeliveryRuleCondition, bool) { 3928 return nil, false 3929} 3930 3931// AsBasicDeliveryRuleCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestMethodCondition. 3932func (drrmc DeliveryRuleRequestMethodCondition) AsBasicDeliveryRuleCondition() (BasicDeliveryRuleCondition, bool) { 3933 return &drrmc, true 3934} 3935 3936// DeliveryRuleRequestSchemeCondition defines the RequestScheme condition for the delivery rule. 3937type DeliveryRuleRequestSchemeCondition struct { 3938 // Parameters - Defines the parameters for the condition. 3939 Parameters *RequestSchemeMatchConditionParameters `json:"parameters,omitempty"` 3940 // Name - Possible values include: 'NameDeliveryRuleCondition', 'NameRemoteAddress', 'NameRequestMethod', 'NameQueryString', 'NamePostArgs', 'NameRequestURI', 'NameRequestHeader', 'NameRequestBody', 'NameRequestScheme', 'NameURLPath', 'NameURLFileExtension', 'NameURLFileName', 'NameHTTPVersion', 'NameCookies', 'NameIsDevice' 3941 Name Name `json:"name,omitempty"` 3942} 3943 3944// MarshalJSON is the custom marshaler for DeliveryRuleRequestSchemeCondition. 3945func (drrsc DeliveryRuleRequestSchemeCondition) MarshalJSON() ([]byte, error) { 3946 drrsc.Name = NameRequestScheme 3947 objectMap := make(map[string]interface{}) 3948 if drrsc.Parameters != nil { 3949 objectMap["parameters"] = drrsc.Parameters 3950 } 3951 if drrsc.Name != "" { 3952 objectMap["name"] = drrsc.Name 3953 } 3954 return json.Marshal(objectMap) 3955} 3956 3957// AsDeliveryRuleRemoteAddressCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestSchemeCondition. 3958func (drrsc DeliveryRuleRequestSchemeCondition) AsDeliveryRuleRemoteAddressCondition() (*DeliveryRuleRemoteAddressCondition, bool) { 3959 return nil, false 3960} 3961 3962// AsDeliveryRuleRequestMethodCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestSchemeCondition. 3963func (drrsc DeliveryRuleRequestSchemeCondition) AsDeliveryRuleRequestMethodCondition() (*DeliveryRuleRequestMethodCondition, bool) { 3964 return nil, false 3965} 3966 3967// AsDeliveryRuleQueryStringCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestSchemeCondition. 3968func (drrsc DeliveryRuleRequestSchemeCondition) AsDeliveryRuleQueryStringCondition() (*DeliveryRuleQueryStringCondition, bool) { 3969 return nil, false 3970} 3971 3972// AsDeliveryRulePostArgsCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestSchemeCondition. 3973func (drrsc DeliveryRuleRequestSchemeCondition) AsDeliveryRulePostArgsCondition() (*DeliveryRulePostArgsCondition, bool) { 3974 return nil, false 3975} 3976 3977// AsDeliveryRuleRequestURICondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestSchemeCondition. 3978func (drrsc DeliveryRuleRequestSchemeCondition) AsDeliveryRuleRequestURICondition() (*DeliveryRuleRequestURICondition, bool) { 3979 return nil, false 3980} 3981 3982// AsDeliveryRuleRequestHeaderCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestSchemeCondition. 3983func (drrsc DeliveryRuleRequestSchemeCondition) AsDeliveryRuleRequestHeaderCondition() (*DeliveryRuleRequestHeaderCondition, bool) { 3984 return nil, false 3985} 3986 3987// AsDeliveryRuleRequestBodyCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestSchemeCondition. 3988func (drrsc DeliveryRuleRequestSchemeCondition) AsDeliveryRuleRequestBodyCondition() (*DeliveryRuleRequestBodyCondition, bool) { 3989 return nil, false 3990} 3991 3992// AsDeliveryRuleRequestSchemeCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestSchemeCondition. 3993func (drrsc DeliveryRuleRequestSchemeCondition) AsDeliveryRuleRequestSchemeCondition() (*DeliveryRuleRequestSchemeCondition, bool) { 3994 return &drrsc, true 3995} 3996 3997// AsDeliveryRuleURLPathCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestSchemeCondition. 3998func (drrsc DeliveryRuleRequestSchemeCondition) AsDeliveryRuleURLPathCondition() (*DeliveryRuleURLPathCondition, bool) { 3999 return nil, false 4000} 4001 4002// AsDeliveryRuleURLFileExtensionCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestSchemeCondition. 4003func (drrsc DeliveryRuleRequestSchemeCondition) AsDeliveryRuleURLFileExtensionCondition() (*DeliveryRuleURLFileExtensionCondition, bool) { 4004 return nil, false 4005} 4006 4007// AsDeliveryRuleURLFileNameCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestSchemeCondition. 4008func (drrsc DeliveryRuleRequestSchemeCondition) AsDeliveryRuleURLFileNameCondition() (*DeliveryRuleURLFileNameCondition, bool) { 4009 return nil, false 4010} 4011 4012// AsDeliveryRuleHTTPVersionCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestSchemeCondition. 4013func (drrsc DeliveryRuleRequestSchemeCondition) AsDeliveryRuleHTTPVersionCondition() (*DeliveryRuleHTTPVersionCondition, bool) { 4014 return nil, false 4015} 4016 4017// AsDeliveryRuleCookiesCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestSchemeCondition. 4018func (drrsc DeliveryRuleRequestSchemeCondition) AsDeliveryRuleCookiesCondition() (*DeliveryRuleCookiesCondition, bool) { 4019 return nil, false 4020} 4021 4022// AsDeliveryRuleIsDeviceCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestSchemeCondition. 4023func (drrsc DeliveryRuleRequestSchemeCondition) AsDeliveryRuleIsDeviceCondition() (*DeliveryRuleIsDeviceCondition, bool) { 4024 return nil, false 4025} 4026 4027// AsDeliveryRuleCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestSchemeCondition. 4028func (drrsc DeliveryRuleRequestSchemeCondition) AsDeliveryRuleCondition() (*DeliveryRuleCondition, bool) { 4029 return nil, false 4030} 4031 4032// AsBasicDeliveryRuleCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestSchemeCondition. 4033func (drrsc DeliveryRuleRequestSchemeCondition) AsBasicDeliveryRuleCondition() (BasicDeliveryRuleCondition, bool) { 4034 return &drrsc, true 4035} 4036 4037// DeliveryRuleRequestURICondition defines the RequestUri condition for the delivery rule. 4038type DeliveryRuleRequestURICondition struct { 4039 // Parameters - Defines the parameters for the condition. 4040 Parameters *RequestURIMatchConditionParameters `json:"parameters,omitempty"` 4041 // Name - Possible values include: 'NameDeliveryRuleCondition', 'NameRemoteAddress', 'NameRequestMethod', 'NameQueryString', 'NamePostArgs', 'NameRequestURI', 'NameRequestHeader', 'NameRequestBody', 'NameRequestScheme', 'NameURLPath', 'NameURLFileExtension', 'NameURLFileName', 'NameHTTPVersion', 'NameCookies', 'NameIsDevice' 4042 Name Name `json:"name,omitempty"` 4043} 4044 4045// MarshalJSON is the custom marshaler for DeliveryRuleRequestURICondition. 4046func (drruc DeliveryRuleRequestURICondition) MarshalJSON() ([]byte, error) { 4047 drruc.Name = NameRequestURI 4048 objectMap := make(map[string]interface{}) 4049 if drruc.Parameters != nil { 4050 objectMap["parameters"] = drruc.Parameters 4051 } 4052 if drruc.Name != "" { 4053 objectMap["name"] = drruc.Name 4054 } 4055 return json.Marshal(objectMap) 4056} 4057 4058// AsDeliveryRuleRemoteAddressCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestURICondition. 4059func (drruc DeliveryRuleRequestURICondition) AsDeliveryRuleRemoteAddressCondition() (*DeliveryRuleRemoteAddressCondition, bool) { 4060 return nil, false 4061} 4062 4063// AsDeliveryRuleRequestMethodCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestURICondition. 4064func (drruc DeliveryRuleRequestURICondition) AsDeliveryRuleRequestMethodCondition() (*DeliveryRuleRequestMethodCondition, bool) { 4065 return nil, false 4066} 4067 4068// AsDeliveryRuleQueryStringCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestURICondition. 4069func (drruc DeliveryRuleRequestURICondition) AsDeliveryRuleQueryStringCondition() (*DeliveryRuleQueryStringCondition, bool) { 4070 return nil, false 4071} 4072 4073// AsDeliveryRulePostArgsCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestURICondition. 4074func (drruc DeliveryRuleRequestURICondition) AsDeliveryRulePostArgsCondition() (*DeliveryRulePostArgsCondition, bool) { 4075 return nil, false 4076} 4077 4078// AsDeliveryRuleRequestURICondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestURICondition. 4079func (drruc DeliveryRuleRequestURICondition) AsDeliveryRuleRequestURICondition() (*DeliveryRuleRequestURICondition, bool) { 4080 return &drruc, true 4081} 4082 4083// AsDeliveryRuleRequestHeaderCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestURICondition. 4084func (drruc DeliveryRuleRequestURICondition) AsDeliveryRuleRequestHeaderCondition() (*DeliveryRuleRequestHeaderCondition, bool) { 4085 return nil, false 4086} 4087 4088// AsDeliveryRuleRequestBodyCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestURICondition. 4089func (drruc DeliveryRuleRequestURICondition) AsDeliveryRuleRequestBodyCondition() (*DeliveryRuleRequestBodyCondition, bool) { 4090 return nil, false 4091} 4092 4093// AsDeliveryRuleRequestSchemeCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestURICondition. 4094func (drruc DeliveryRuleRequestURICondition) AsDeliveryRuleRequestSchemeCondition() (*DeliveryRuleRequestSchemeCondition, bool) { 4095 return nil, false 4096} 4097 4098// AsDeliveryRuleURLPathCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestURICondition. 4099func (drruc DeliveryRuleRequestURICondition) AsDeliveryRuleURLPathCondition() (*DeliveryRuleURLPathCondition, bool) { 4100 return nil, false 4101} 4102 4103// AsDeliveryRuleURLFileExtensionCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestURICondition. 4104func (drruc DeliveryRuleRequestURICondition) AsDeliveryRuleURLFileExtensionCondition() (*DeliveryRuleURLFileExtensionCondition, bool) { 4105 return nil, false 4106} 4107 4108// AsDeliveryRuleURLFileNameCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestURICondition. 4109func (drruc DeliveryRuleRequestURICondition) AsDeliveryRuleURLFileNameCondition() (*DeliveryRuleURLFileNameCondition, bool) { 4110 return nil, false 4111} 4112 4113// AsDeliveryRuleHTTPVersionCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestURICondition. 4114func (drruc DeliveryRuleRequestURICondition) AsDeliveryRuleHTTPVersionCondition() (*DeliveryRuleHTTPVersionCondition, bool) { 4115 return nil, false 4116} 4117 4118// AsDeliveryRuleCookiesCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestURICondition. 4119func (drruc DeliveryRuleRequestURICondition) AsDeliveryRuleCookiesCondition() (*DeliveryRuleCookiesCondition, bool) { 4120 return nil, false 4121} 4122 4123// AsDeliveryRuleIsDeviceCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestURICondition. 4124func (drruc DeliveryRuleRequestURICondition) AsDeliveryRuleIsDeviceCondition() (*DeliveryRuleIsDeviceCondition, bool) { 4125 return nil, false 4126} 4127 4128// AsDeliveryRuleCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestURICondition. 4129func (drruc DeliveryRuleRequestURICondition) AsDeliveryRuleCondition() (*DeliveryRuleCondition, bool) { 4130 return nil, false 4131} 4132 4133// AsBasicDeliveryRuleCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestURICondition. 4134func (drruc DeliveryRuleRequestURICondition) AsBasicDeliveryRuleCondition() (BasicDeliveryRuleCondition, bool) { 4135 return &drruc, true 4136} 4137 4138// DeliveryRuleResponseHeaderAction defines the response header action for the delivery rule. 4139type DeliveryRuleResponseHeaderAction struct { 4140 // Parameters - Defines the parameters for the action. 4141 Parameters *HeaderActionParameters `json:"parameters,omitempty"` 4142 // Name - Possible values include: 'NameDeliveryRuleAction', 'NameURLRedirect', 'NameURLSigning', 'NameOriginGroupOverride', 'NameURLRewrite', 'NameModifyRequestHeader', 'NameModifyResponseHeader', 'NameCacheExpiration', 'NameCacheKeyQueryString' 4143 Name NameBasicDeliveryRuleAction `json:"name,omitempty"` 4144} 4145 4146// MarshalJSON is the custom marshaler for DeliveryRuleResponseHeaderAction. 4147func (drrha DeliveryRuleResponseHeaderAction) MarshalJSON() ([]byte, error) { 4148 drrha.Name = NameModifyResponseHeader 4149 objectMap := make(map[string]interface{}) 4150 if drrha.Parameters != nil { 4151 objectMap["parameters"] = drrha.Parameters 4152 } 4153 if drrha.Name != "" { 4154 objectMap["name"] = drrha.Name 4155 } 4156 return json.Marshal(objectMap) 4157} 4158 4159// AsURLRedirectAction is the BasicDeliveryRuleAction implementation for DeliveryRuleResponseHeaderAction. 4160func (drrha DeliveryRuleResponseHeaderAction) AsURLRedirectAction() (*URLRedirectAction, bool) { 4161 return nil, false 4162} 4163 4164// AsURLSigningAction is the BasicDeliveryRuleAction implementation for DeliveryRuleResponseHeaderAction. 4165func (drrha DeliveryRuleResponseHeaderAction) AsURLSigningAction() (*URLSigningAction, bool) { 4166 return nil, false 4167} 4168 4169// AsOriginGroupOverrideAction is the BasicDeliveryRuleAction implementation for DeliveryRuleResponseHeaderAction. 4170func (drrha DeliveryRuleResponseHeaderAction) AsOriginGroupOverrideAction() (*OriginGroupOverrideAction, bool) { 4171 return nil, false 4172} 4173 4174// AsURLRewriteAction is the BasicDeliveryRuleAction implementation for DeliveryRuleResponseHeaderAction. 4175func (drrha DeliveryRuleResponseHeaderAction) AsURLRewriteAction() (*URLRewriteAction, bool) { 4176 return nil, false 4177} 4178 4179// AsDeliveryRuleRequestHeaderAction is the BasicDeliveryRuleAction implementation for DeliveryRuleResponseHeaderAction. 4180func (drrha DeliveryRuleResponseHeaderAction) AsDeliveryRuleRequestHeaderAction() (*DeliveryRuleRequestHeaderAction, bool) { 4181 return nil, false 4182} 4183 4184// AsDeliveryRuleResponseHeaderAction is the BasicDeliveryRuleAction implementation for DeliveryRuleResponseHeaderAction. 4185func (drrha DeliveryRuleResponseHeaderAction) AsDeliveryRuleResponseHeaderAction() (*DeliveryRuleResponseHeaderAction, bool) { 4186 return &drrha, true 4187} 4188 4189// AsDeliveryRuleCacheExpirationAction is the BasicDeliveryRuleAction implementation for DeliveryRuleResponseHeaderAction. 4190func (drrha DeliveryRuleResponseHeaderAction) AsDeliveryRuleCacheExpirationAction() (*DeliveryRuleCacheExpirationAction, bool) { 4191 return nil, false 4192} 4193 4194// AsDeliveryRuleCacheKeyQueryStringAction is the BasicDeliveryRuleAction implementation for DeliveryRuleResponseHeaderAction. 4195func (drrha DeliveryRuleResponseHeaderAction) AsDeliveryRuleCacheKeyQueryStringAction() (*DeliveryRuleCacheKeyQueryStringAction, bool) { 4196 return nil, false 4197} 4198 4199// AsDeliveryRuleAction is the BasicDeliveryRuleAction implementation for DeliveryRuleResponseHeaderAction. 4200func (drrha DeliveryRuleResponseHeaderAction) AsDeliveryRuleAction() (*DeliveryRuleAction, bool) { 4201 return nil, false 4202} 4203 4204// AsBasicDeliveryRuleAction is the BasicDeliveryRuleAction implementation for DeliveryRuleResponseHeaderAction. 4205func (drrha DeliveryRuleResponseHeaderAction) AsBasicDeliveryRuleAction() (BasicDeliveryRuleAction, bool) { 4206 return &drrha, true 4207} 4208 4209// DeliveryRuleURLFileExtensionCondition defines the UrlFileExtension condition for the delivery rule. 4210type DeliveryRuleURLFileExtensionCondition struct { 4211 // Parameters - Defines the parameters for the condition. 4212 Parameters *URLFileExtensionMatchConditionParameters `json:"parameters,omitempty"` 4213 // Name - Possible values include: 'NameDeliveryRuleCondition', 'NameRemoteAddress', 'NameRequestMethod', 'NameQueryString', 'NamePostArgs', 'NameRequestURI', 'NameRequestHeader', 'NameRequestBody', 'NameRequestScheme', 'NameURLPath', 'NameURLFileExtension', 'NameURLFileName', 'NameHTTPVersion', 'NameCookies', 'NameIsDevice' 4214 Name Name `json:"name,omitempty"` 4215} 4216 4217// MarshalJSON is the custom marshaler for DeliveryRuleURLFileExtensionCondition. 4218func (drufec DeliveryRuleURLFileExtensionCondition) MarshalJSON() ([]byte, error) { 4219 drufec.Name = NameURLFileExtension 4220 objectMap := make(map[string]interface{}) 4221 if drufec.Parameters != nil { 4222 objectMap["parameters"] = drufec.Parameters 4223 } 4224 if drufec.Name != "" { 4225 objectMap["name"] = drufec.Name 4226 } 4227 return json.Marshal(objectMap) 4228} 4229 4230// AsDeliveryRuleRemoteAddressCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleURLFileExtensionCondition. 4231func (drufec DeliveryRuleURLFileExtensionCondition) AsDeliveryRuleRemoteAddressCondition() (*DeliveryRuleRemoteAddressCondition, bool) { 4232 return nil, false 4233} 4234 4235// AsDeliveryRuleRequestMethodCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleURLFileExtensionCondition. 4236func (drufec DeliveryRuleURLFileExtensionCondition) AsDeliveryRuleRequestMethodCondition() (*DeliveryRuleRequestMethodCondition, bool) { 4237 return nil, false 4238} 4239 4240// AsDeliveryRuleQueryStringCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleURLFileExtensionCondition. 4241func (drufec DeliveryRuleURLFileExtensionCondition) AsDeliveryRuleQueryStringCondition() (*DeliveryRuleQueryStringCondition, bool) { 4242 return nil, false 4243} 4244 4245// AsDeliveryRulePostArgsCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleURLFileExtensionCondition. 4246func (drufec DeliveryRuleURLFileExtensionCondition) AsDeliveryRulePostArgsCondition() (*DeliveryRulePostArgsCondition, bool) { 4247 return nil, false 4248} 4249 4250// AsDeliveryRuleRequestURICondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleURLFileExtensionCondition. 4251func (drufec DeliveryRuleURLFileExtensionCondition) AsDeliveryRuleRequestURICondition() (*DeliveryRuleRequestURICondition, bool) { 4252 return nil, false 4253} 4254 4255// AsDeliveryRuleRequestHeaderCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleURLFileExtensionCondition. 4256func (drufec DeliveryRuleURLFileExtensionCondition) AsDeliveryRuleRequestHeaderCondition() (*DeliveryRuleRequestHeaderCondition, bool) { 4257 return nil, false 4258} 4259 4260// AsDeliveryRuleRequestBodyCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleURLFileExtensionCondition. 4261func (drufec DeliveryRuleURLFileExtensionCondition) AsDeliveryRuleRequestBodyCondition() (*DeliveryRuleRequestBodyCondition, bool) { 4262 return nil, false 4263} 4264 4265// AsDeliveryRuleRequestSchemeCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleURLFileExtensionCondition. 4266func (drufec DeliveryRuleURLFileExtensionCondition) AsDeliveryRuleRequestSchemeCondition() (*DeliveryRuleRequestSchemeCondition, bool) { 4267 return nil, false 4268} 4269 4270// AsDeliveryRuleURLPathCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleURLFileExtensionCondition. 4271func (drufec DeliveryRuleURLFileExtensionCondition) AsDeliveryRuleURLPathCondition() (*DeliveryRuleURLPathCondition, bool) { 4272 return nil, false 4273} 4274 4275// AsDeliveryRuleURLFileExtensionCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleURLFileExtensionCondition. 4276func (drufec DeliveryRuleURLFileExtensionCondition) AsDeliveryRuleURLFileExtensionCondition() (*DeliveryRuleURLFileExtensionCondition, bool) { 4277 return &drufec, true 4278} 4279 4280// AsDeliveryRuleURLFileNameCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleURLFileExtensionCondition. 4281func (drufec DeliveryRuleURLFileExtensionCondition) AsDeliveryRuleURLFileNameCondition() (*DeliveryRuleURLFileNameCondition, bool) { 4282 return nil, false 4283} 4284 4285// AsDeliveryRuleHTTPVersionCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleURLFileExtensionCondition. 4286func (drufec DeliveryRuleURLFileExtensionCondition) AsDeliveryRuleHTTPVersionCondition() (*DeliveryRuleHTTPVersionCondition, bool) { 4287 return nil, false 4288} 4289 4290// AsDeliveryRuleCookiesCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleURLFileExtensionCondition. 4291func (drufec DeliveryRuleURLFileExtensionCondition) AsDeliveryRuleCookiesCondition() (*DeliveryRuleCookiesCondition, bool) { 4292 return nil, false 4293} 4294 4295// AsDeliveryRuleIsDeviceCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleURLFileExtensionCondition. 4296func (drufec DeliveryRuleURLFileExtensionCondition) AsDeliveryRuleIsDeviceCondition() (*DeliveryRuleIsDeviceCondition, bool) { 4297 return nil, false 4298} 4299 4300// AsDeliveryRuleCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleURLFileExtensionCondition. 4301func (drufec DeliveryRuleURLFileExtensionCondition) AsDeliveryRuleCondition() (*DeliveryRuleCondition, bool) { 4302 return nil, false 4303} 4304 4305// AsBasicDeliveryRuleCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleURLFileExtensionCondition. 4306func (drufec DeliveryRuleURLFileExtensionCondition) AsBasicDeliveryRuleCondition() (BasicDeliveryRuleCondition, bool) { 4307 return &drufec, true 4308} 4309 4310// DeliveryRuleURLFileNameCondition defines the UrlFileName condition for the delivery rule. 4311type DeliveryRuleURLFileNameCondition struct { 4312 // Parameters - Defines the parameters for the condition. 4313 Parameters *URLFileNameMatchConditionParameters `json:"parameters,omitempty"` 4314 // Name - Possible values include: 'NameDeliveryRuleCondition', 'NameRemoteAddress', 'NameRequestMethod', 'NameQueryString', 'NamePostArgs', 'NameRequestURI', 'NameRequestHeader', 'NameRequestBody', 'NameRequestScheme', 'NameURLPath', 'NameURLFileExtension', 'NameURLFileName', 'NameHTTPVersion', 'NameCookies', 'NameIsDevice' 4315 Name Name `json:"name,omitempty"` 4316} 4317 4318// MarshalJSON is the custom marshaler for DeliveryRuleURLFileNameCondition. 4319func (drufnc DeliveryRuleURLFileNameCondition) MarshalJSON() ([]byte, error) { 4320 drufnc.Name = NameURLFileName 4321 objectMap := make(map[string]interface{}) 4322 if drufnc.Parameters != nil { 4323 objectMap["parameters"] = drufnc.Parameters 4324 } 4325 if drufnc.Name != "" { 4326 objectMap["name"] = drufnc.Name 4327 } 4328 return json.Marshal(objectMap) 4329} 4330 4331// AsDeliveryRuleRemoteAddressCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleURLFileNameCondition. 4332func (drufnc DeliveryRuleURLFileNameCondition) AsDeliveryRuleRemoteAddressCondition() (*DeliveryRuleRemoteAddressCondition, bool) { 4333 return nil, false 4334} 4335 4336// AsDeliveryRuleRequestMethodCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleURLFileNameCondition. 4337func (drufnc DeliveryRuleURLFileNameCondition) AsDeliveryRuleRequestMethodCondition() (*DeliveryRuleRequestMethodCondition, bool) { 4338 return nil, false 4339} 4340 4341// AsDeliveryRuleQueryStringCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleURLFileNameCondition. 4342func (drufnc DeliveryRuleURLFileNameCondition) AsDeliveryRuleQueryStringCondition() (*DeliveryRuleQueryStringCondition, bool) { 4343 return nil, false 4344} 4345 4346// AsDeliveryRulePostArgsCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleURLFileNameCondition. 4347func (drufnc DeliveryRuleURLFileNameCondition) AsDeliveryRulePostArgsCondition() (*DeliveryRulePostArgsCondition, bool) { 4348 return nil, false 4349} 4350 4351// AsDeliveryRuleRequestURICondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleURLFileNameCondition. 4352func (drufnc DeliveryRuleURLFileNameCondition) AsDeliveryRuleRequestURICondition() (*DeliveryRuleRequestURICondition, bool) { 4353 return nil, false 4354} 4355 4356// AsDeliveryRuleRequestHeaderCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleURLFileNameCondition. 4357func (drufnc DeliveryRuleURLFileNameCondition) AsDeliveryRuleRequestHeaderCondition() (*DeliveryRuleRequestHeaderCondition, bool) { 4358 return nil, false 4359} 4360 4361// AsDeliveryRuleRequestBodyCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleURLFileNameCondition. 4362func (drufnc DeliveryRuleURLFileNameCondition) AsDeliveryRuleRequestBodyCondition() (*DeliveryRuleRequestBodyCondition, bool) { 4363 return nil, false 4364} 4365 4366// AsDeliveryRuleRequestSchemeCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleURLFileNameCondition. 4367func (drufnc DeliveryRuleURLFileNameCondition) AsDeliveryRuleRequestSchemeCondition() (*DeliveryRuleRequestSchemeCondition, bool) { 4368 return nil, false 4369} 4370 4371// AsDeliveryRuleURLPathCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleURLFileNameCondition. 4372func (drufnc DeliveryRuleURLFileNameCondition) AsDeliveryRuleURLPathCondition() (*DeliveryRuleURLPathCondition, bool) { 4373 return nil, false 4374} 4375 4376// AsDeliveryRuleURLFileExtensionCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleURLFileNameCondition. 4377func (drufnc DeliveryRuleURLFileNameCondition) AsDeliveryRuleURLFileExtensionCondition() (*DeliveryRuleURLFileExtensionCondition, bool) { 4378 return nil, false 4379} 4380 4381// AsDeliveryRuleURLFileNameCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleURLFileNameCondition. 4382func (drufnc DeliveryRuleURLFileNameCondition) AsDeliveryRuleURLFileNameCondition() (*DeliveryRuleURLFileNameCondition, bool) { 4383 return &drufnc, true 4384} 4385 4386// AsDeliveryRuleHTTPVersionCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleURLFileNameCondition. 4387func (drufnc DeliveryRuleURLFileNameCondition) AsDeliveryRuleHTTPVersionCondition() (*DeliveryRuleHTTPVersionCondition, bool) { 4388 return nil, false 4389} 4390 4391// AsDeliveryRuleCookiesCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleURLFileNameCondition. 4392func (drufnc DeliveryRuleURLFileNameCondition) AsDeliveryRuleCookiesCondition() (*DeliveryRuleCookiesCondition, bool) { 4393 return nil, false 4394} 4395 4396// AsDeliveryRuleIsDeviceCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleURLFileNameCondition. 4397func (drufnc DeliveryRuleURLFileNameCondition) AsDeliveryRuleIsDeviceCondition() (*DeliveryRuleIsDeviceCondition, bool) { 4398 return nil, false 4399} 4400 4401// AsDeliveryRuleCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleURLFileNameCondition. 4402func (drufnc DeliveryRuleURLFileNameCondition) AsDeliveryRuleCondition() (*DeliveryRuleCondition, bool) { 4403 return nil, false 4404} 4405 4406// AsBasicDeliveryRuleCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleURLFileNameCondition. 4407func (drufnc DeliveryRuleURLFileNameCondition) AsBasicDeliveryRuleCondition() (BasicDeliveryRuleCondition, bool) { 4408 return &drufnc, true 4409} 4410 4411// DeliveryRuleURLPathCondition defines the UrlPath condition for the delivery rule. 4412type DeliveryRuleURLPathCondition struct { 4413 // Parameters - Defines the parameters for the condition. 4414 Parameters *URLPathMatchConditionParameters `json:"parameters,omitempty"` 4415 // Name - Possible values include: 'NameDeliveryRuleCondition', 'NameRemoteAddress', 'NameRequestMethod', 'NameQueryString', 'NamePostArgs', 'NameRequestURI', 'NameRequestHeader', 'NameRequestBody', 'NameRequestScheme', 'NameURLPath', 'NameURLFileExtension', 'NameURLFileName', 'NameHTTPVersion', 'NameCookies', 'NameIsDevice' 4416 Name Name `json:"name,omitempty"` 4417} 4418 4419// MarshalJSON is the custom marshaler for DeliveryRuleURLPathCondition. 4420func (drupc DeliveryRuleURLPathCondition) MarshalJSON() ([]byte, error) { 4421 drupc.Name = NameURLPath 4422 objectMap := make(map[string]interface{}) 4423 if drupc.Parameters != nil { 4424 objectMap["parameters"] = drupc.Parameters 4425 } 4426 if drupc.Name != "" { 4427 objectMap["name"] = drupc.Name 4428 } 4429 return json.Marshal(objectMap) 4430} 4431 4432// AsDeliveryRuleRemoteAddressCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleURLPathCondition. 4433func (drupc DeliveryRuleURLPathCondition) AsDeliveryRuleRemoteAddressCondition() (*DeliveryRuleRemoteAddressCondition, bool) { 4434 return nil, false 4435} 4436 4437// AsDeliveryRuleRequestMethodCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleURLPathCondition. 4438func (drupc DeliveryRuleURLPathCondition) AsDeliveryRuleRequestMethodCondition() (*DeliveryRuleRequestMethodCondition, bool) { 4439 return nil, false 4440} 4441 4442// AsDeliveryRuleQueryStringCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleURLPathCondition. 4443func (drupc DeliveryRuleURLPathCondition) AsDeliveryRuleQueryStringCondition() (*DeliveryRuleQueryStringCondition, bool) { 4444 return nil, false 4445} 4446 4447// AsDeliveryRulePostArgsCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleURLPathCondition. 4448func (drupc DeliveryRuleURLPathCondition) AsDeliveryRulePostArgsCondition() (*DeliveryRulePostArgsCondition, bool) { 4449 return nil, false 4450} 4451 4452// AsDeliveryRuleRequestURICondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleURLPathCondition. 4453func (drupc DeliveryRuleURLPathCondition) AsDeliveryRuleRequestURICondition() (*DeliveryRuleRequestURICondition, bool) { 4454 return nil, false 4455} 4456 4457// AsDeliveryRuleRequestHeaderCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleURLPathCondition. 4458func (drupc DeliveryRuleURLPathCondition) AsDeliveryRuleRequestHeaderCondition() (*DeliveryRuleRequestHeaderCondition, bool) { 4459 return nil, false 4460} 4461 4462// AsDeliveryRuleRequestBodyCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleURLPathCondition. 4463func (drupc DeliveryRuleURLPathCondition) AsDeliveryRuleRequestBodyCondition() (*DeliveryRuleRequestBodyCondition, bool) { 4464 return nil, false 4465} 4466 4467// AsDeliveryRuleRequestSchemeCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleURLPathCondition. 4468func (drupc DeliveryRuleURLPathCondition) AsDeliveryRuleRequestSchemeCondition() (*DeliveryRuleRequestSchemeCondition, bool) { 4469 return nil, false 4470} 4471 4472// AsDeliveryRuleURLPathCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleURLPathCondition. 4473func (drupc DeliveryRuleURLPathCondition) AsDeliveryRuleURLPathCondition() (*DeliveryRuleURLPathCondition, bool) { 4474 return &drupc, true 4475} 4476 4477// AsDeliveryRuleURLFileExtensionCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleURLPathCondition. 4478func (drupc DeliveryRuleURLPathCondition) AsDeliveryRuleURLFileExtensionCondition() (*DeliveryRuleURLFileExtensionCondition, bool) { 4479 return nil, false 4480} 4481 4482// AsDeliveryRuleURLFileNameCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleURLPathCondition. 4483func (drupc DeliveryRuleURLPathCondition) AsDeliveryRuleURLFileNameCondition() (*DeliveryRuleURLFileNameCondition, bool) { 4484 return nil, false 4485} 4486 4487// AsDeliveryRuleHTTPVersionCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleURLPathCondition. 4488func (drupc DeliveryRuleURLPathCondition) AsDeliveryRuleHTTPVersionCondition() (*DeliveryRuleHTTPVersionCondition, bool) { 4489 return nil, false 4490} 4491 4492// AsDeliveryRuleCookiesCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleURLPathCondition. 4493func (drupc DeliveryRuleURLPathCondition) AsDeliveryRuleCookiesCondition() (*DeliveryRuleCookiesCondition, bool) { 4494 return nil, false 4495} 4496 4497// AsDeliveryRuleIsDeviceCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleURLPathCondition. 4498func (drupc DeliveryRuleURLPathCondition) AsDeliveryRuleIsDeviceCondition() (*DeliveryRuleIsDeviceCondition, bool) { 4499 return nil, false 4500} 4501 4502// AsDeliveryRuleCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleURLPathCondition. 4503func (drupc DeliveryRuleURLPathCondition) AsDeliveryRuleCondition() (*DeliveryRuleCondition, bool) { 4504 return nil, false 4505} 4506 4507// AsBasicDeliveryRuleCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleURLPathCondition. 4508func (drupc DeliveryRuleURLPathCondition) AsBasicDeliveryRuleCondition() (BasicDeliveryRuleCondition, bool) { 4509 return &drupc, true 4510} 4511 4512// DomainValidationProperties the JSON object that contains the properties to validate a domain. 4513type DomainValidationProperties struct { 4514 // ValidationToken - READ-ONLY; Challenge used for DNS TXT record or file based validation 4515 ValidationToken *string `json:"validationToken,omitempty"` 4516 // ExpirationDate - READ-ONLY; The date time that the token expires 4517 ExpirationDate *string `json:"expirationDate,omitempty"` 4518} 4519 4520// EdgeNode edgenode is a global Point of Presence (POP) location used to deliver CDN content to end users. 4521type EdgeNode struct { 4522 *EdgeNodeProperties `json:"properties,omitempty"` 4523 // SystemData - READ-ONLY 4524 SystemData *SystemData `json:"systemData,omitempty"` 4525 // ID - READ-ONLY; Resource ID. 4526 ID *string `json:"id,omitempty"` 4527 // Name - READ-ONLY; Resource name. 4528 Name *string `json:"name,omitempty"` 4529 // Type - READ-ONLY; Resource type. 4530 Type *string `json:"type,omitempty"` 4531} 4532 4533// MarshalJSON is the custom marshaler for EdgeNode. 4534func (en EdgeNode) MarshalJSON() ([]byte, error) { 4535 objectMap := make(map[string]interface{}) 4536 if en.EdgeNodeProperties != nil { 4537 objectMap["properties"] = en.EdgeNodeProperties 4538 } 4539 return json.Marshal(objectMap) 4540} 4541 4542// UnmarshalJSON is the custom unmarshaler for EdgeNode struct. 4543func (en *EdgeNode) UnmarshalJSON(body []byte) error { 4544 var m map[string]*json.RawMessage 4545 err := json.Unmarshal(body, &m) 4546 if err != nil { 4547 return err 4548 } 4549 for k, v := range m { 4550 switch k { 4551 case "properties": 4552 if v != nil { 4553 var edgeNodeProperties EdgeNodeProperties 4554 err = json.Unmarshal(*v, &edgeNodeProperties) 4555 if err != nil { 4556 return err 4557 } 4558 en.EdgeNodeProperties = &edgeNodeProperties 4559 } 4560 case "systemData": 4561 if v != nil { 4562 var systemData SystemData 4563 err = json.Unmarshal(*v, &systemData) 4564 if err != nil { 4565 return err 4566 } 4567 en.SystemData = &systemData 4568 } 4569 case "id": 4570 if v != nil { 4571 var ID string 4572 err = json.Unmarshal(*v, &ID) 4573 if err != nil { 4574 return err 4575 } 4576 en.ID = &ID 4577 } 4578 case "name": 4579 if v != nil { 4580 var name string 4581 err = json.Unmarshal(*v, &name) 4582 if err != nil { 4583 return err 4584 } 4585 en.Name = &name 4586 } 4587 case "type": 4588 if v != nil { 4589 var typeVar string 4590 err = json.Unmarshal(*v, &typeVar) 4591 if err != nil { 4592 return err 4593 } 4594 en.Type = &typeVar 4595 } 4596 } 4597 } 4598 4599 return nil 4600} 4601 4602// EdgeNodeProperties the JSON object that contains the properties required to create an edgenode. 4603type EdgeNodeProperties struct { 4604 // IPAddressGroups - List of ip address groups. 4605 IPAddressGroups *[]IPAddressGroup `json:"ipAddressGroups,omitempty"` 4606} 4607 4608// EdgenodeResult result of the request to list CDN edgenodes. It contains a list of ip address group and a 4609// URL link to get the next set of results. 4610type EdgenodeResult struct { 4611 autorest.Response `json:"-"` 4612 // Value - READ-ONLY; Edge node of CDN service. 4613 Value *[]EdgeNode `json:"value,omitempty"` 4614 // NextLink - URL to get the next set of edgenode list results if there are any. 4615 NextLink *string `json:"nextLink,omitempty"` 4616} 4617 4618// MarshalJSON is the custom marshaler for EdgenodeResult. 4619func (er EdgenodeResult) MarshalJSON() ([]byte, error) { 4620 objectMap := make(map[string]interface{}) 4621 if er.NextLink != nil { 4622 objectMap["nextLink"] = er.NextLink 4623 } 4624 return json.Marshal(objectMap) 4625} 4626 4627// EdgenodeResultIterator provides access to a complete listing of EdgeNode values. 4628type EdgenodeResultIterator struct { 4629 i int 4630 page EdgenodeResultPage 4631} 4632 4633// NextWithContext advances to the next value. If there was an error making 4634// the request the iterator does not advance and the error is returned. 4635func (iter *EdgenodeResultIterator) NextWithContext(ctx context.Context) (err error) { 4636 if tracing.IsEnabled() { 4637 ctx = tracing.StartSpan(ctx, fqdn+"/EdgenodeResultIterator.NextWithContext") 4638 defer func() { 4639 sc := -1 4640 if iter.Response().Response.Response != nil { 4641 sc = iter.Response().Response.Response.StatusCode 4642 } 4643 tracing.EndSpan(ctx, sc, err) 4644 }() 4645 } 4646 iter.i++ 4647 if iter.i < len(iter.page.Values()) { 4648 return nil 4649 } 4650 err = iter.page.NextWithContext(ctx) 4651 if err != nil { 4652 iter.i-- 4653 return err 4654 } 4655 iter.i = 0 4656 return nil 4657} 4658 4659// Next advances to the next value. If there was an error making 4660// the request the iterator does not advance and the error is returned. 4661// Deprecated: Use NextWithContext() instead. 4662func (iter *EdgenodeResultIterator) Next() error { 4663 return iter.NextWithContext(context.Background()) 4664} 4665 4666// NotDone returns true if the enumeration should be started or is not yet complete. 4667func (iter EdgenodeResultIterator) NotDone() bool { 4668 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 4669} 4670 4671// Response returns the raw server response from the last page request. 4672func (iter EdgenodeResultIterator) Response() EdgenodeResult { 4673 return iter.page.Response() 4674} 4675 4676// Value returns the current value or a zero-initialized value if the 4677// iterator has advanced beyond the end of the collection. 4678func (iter EdgenodeResultIterator) Value() EdgeNode { 4679 if !iter.page.NotDone() { 4680 return EdgeNode{} 4681 } 4682 return iter.page.Values()[iter.i] 4683} 4684 4685// Creates a new instance of the EdgenodeResultIterator type. 4686func NewEdgenodeResultIterator(page EdgenodeResultPage) EdgenodeResultIterator { 4687 return EdgenodeResultIterator{page: page} 4688} 4689 4690// IsEmpty returns true if the ListResult contains no values. 4691func (er EdgenodeResult) IsEmpty() bool { 4692 return er.Value == nil || len(*er.Value) == 0 4693} 4694 4695// hasNextLink returns true if the NextLink is not empty. 4696func (er EdgenodeResult) hasNextLink() bool { 4697 return er.NextLink != nil && len(*er.NextLink) != 0 4698} 4699 4700// edgenodeResultPreparer prepares a request to retrieve the next set of results. 4701// It returns nil if no more results exist. 4702func (er EdgenodeResult) edgenodeResultPreparer(ctx context.Context) (*http.Request, error) { 4703 if !er.hasNextLink() { 4704 return nil, nil 4705 } 4706 return autorest.Prepare((&http.Request{}).WithContext(ctx), 4707 autorest.AsJSON(), 4708 autorest.AsGet(), 4709 autorest.WithBaseURL(to.String(er.NextLink))) 4710} 4711 4712// EdgenodeResultPage contains a page of EdgeNode values. 4713type EdgenodeResultPage struct { 4714 fn func(context.Context, EdgenodeResult) (EdgenodeResult, error) 4715 er EdgenodeResult 4716} 4717 4718// NextWithContext advances to the next page of values. If there was an error making 4719// the request the page does not advance and the error is returned. 4720func (page *EdgenodeResultPage) NextWithContext(ctx context.Context) (err error) { 4721 if tracing.IsEnabled() { 4722 ctx = tracing.StartSpan(ctx, fqdn+"/EdgenodeResultPage.NextWithContext") 4723 defer func() { 4724 sc := -1 4725 if page.Response().Response.Response != nil { 4726 sc = page.Response().Response.Response.StatusCode 4727 } 4728 tracing.EndSpan(ctx, sc, err) 4729 }() 4730 } 4731 for { 4732 next, err := page.fn(ctx, page.er) 4733 if err != nil { 4734 return err 4735 } 4736 page.er = next 4737 if !next.hasNextLink() || !next.IsEmpty() { 4738 break 4739 } 4740 } 4741 return nil 4742} 4743 4744// Next advances to the next page of values. If there was an error making 4745// the request the page does not advance and the error is returned. 4746// Deprecated: Use NextWithContext() instead. 4747func (page *EdgenodeResultPage) Next() error { 4748 return page.NextWithContext(context.Background()) 4749} 4750 4751// NotDone returns true if the page enumeration should be started or is not yet complete. 4752func (page EdgenodeResultPage) NotDone() bool { 4753 return !page.er.IsEmpty() 4754} 4755 4756// Response returns the raw server response from the last page request. 4757func (page EdgenodeResultPage) Response() EdgenodeResult { 4758 return page.er 4759} 4760 4761// Values returns the slice of values for the current page or nil if there are no values. 4762func (page EdgenodeResultPage) Values() []EdgeNode { 4763 if page.er.IsEmpty() { 4764 return nil 4765 } 4766 return *page.er.Value 4767} 4768 4769// Creates a new instance of the EdgenodeResultPage type. 4770func NewEdgenodeResultPage(cur EdgenodeResult, getNextPage func(context.Context, EdgenodeResult) (EdgenodeResult, error)) EdgenodeResultPage { 4771 return EdgenodeResultPage{ 4772 fn: getNextPage, 4773 er: cur, 4774 } 4775} 4776 4777// Endpoint CDN endpoint is the entity within a CDN profile containing configuration information such as 4778// origin, protocol, content caching and delivery behavior. The CDN endpoint uses the URL format 4779// <endpointname>.azureedge.net. 4780type Endpoint struct { 4781 autorest.Response `json:"-"` 4782 *EndpointProperties `json:"properties,omitempty"` 4783 // Location - Resource location. 4784 Location *string `json:"location,omitempty"` 4785 // Tags - Resource tags. 4786 Tags map[string]*string `json:"tags"` 4787 // SystemData - READ-ONLY 4788 SystemData *SystemData `json:"systemData,omitempty"` 4789 // ID - READ-ONLY; Resource ID. 4790 ID *string `json:"id,omitempty"` 4791 // Name - READ-ONLY; Resource name. 4792 Name *string `json:"name,omitempty"` 4793 // Type - READ-ONLY; Resource type. 4794 Type *string `json:"type,omitempty"` 4795} 4796 4797// MarshalJSON is the custom marshaler for Endpoint. 4798func (e Endpoint) MarshalJSON() ([]byte, error) { 4799 objectMap := make(map[string]interface{}) 4800 if e.EndpointProperties != nil { 4801 objectMap["properties"] = e.EndpointProperties 4802 } 4803 if e.Location != nil { 4804 objectMap["location"] = e.Location 4805 } 4806 if e.Tags != nil { 4807 objectMap["tags"] = e.Tags 4808 } 4809 return json.Marshal(objectMap) 4810} 4811 4812// UnmarshalJSON is the custom unmarshaler for Endpoint struct. 4813func (e *Endpoint) UnmarshalJSON(body []byte) error { 4814 var m map[string]*json.RawMessage 4815 err := json.Unmarshal(body, &m) 4816 if err != nil { 4817 return err 4818 } 4819 for k, v := range m { 4820 switch k { 4821 case "properties": 4822 if v != nil { 4823 var endpointProperties EndpointProperties 4824 err = json.Unmarshal(*v, &endpointProperties) 4825 if err != nil { 4826 return err 4827 } 4828 e.EndpointProperties = &endpointProperties 4829 } 4830 case "location": 4831 if v != nil { 4832 var location string 4833 err = json.Unmarshal(*v, &location) 4834 if err != nil { 4835 return err 4836 } 4837 e.Location = &location 4838 } 4839 case "tags": 4840 if v != nil { 4841 var tags map[string]*string 4842 err = json.Unmarshal(*v, &tags) 4843 if err != nil { 4844 return err 4845 } 4846 e.Tags = tags 4847 } 4848 case "systemData": 4849 if v != nil { 4850 var systemData SystemData 4851 err = json.Unmarshal(*v, &systemData) 4852 if err != nil { 4853 return err 4854 } 4855 e.SystemData = &systemData 4856 } 4857 case "id": 4858 if v != nil { 4859 var ID string 4860 err = json.Unmarshal(*v, &ID) 4861 if err != nil { 4862 return err 4863 } 4864 e.ID = &ID 4865 } 4866 case "name": 4867 if v != nil { 4868 var name string 4869 err = json.Unmarshal(*v, &name) 4870 if err != nil { 4871 return err 4872 } 4873 e.Name = &name 4874 } 4875 case "type": 4876 if v != nil { 4877 var typeVar string 4878 err = json.Unmarshal(*v, &typeVar) 4879 if err != nil { 4880 return err 4881 } 4882 e.Type = &typeVar 4883 } 4884 } 4885 } 4886 4887 return nil 4888} 4889 4890// EndpointListResult result of the request to list endpoints. It contains a list of endpoint objects and a 4891// URL link to get the next set of results. 4892type EndpointListResult struct { 4893 autorest.Response `json:"-"` 4894 // Value - READ-ONLY; List of CDN endpoints within a profile 4895 Value *[]Endpoint `json:"value,omitempty"` 4896 // NextLink - URL to get the next set of endpoint objects if there is any. 4897 NextLink *string `json:"nextLink,omitempty"` 4898} 4899 4900// MarshalJSON is the custom marshaler for EndpointListResult. 4901func (elr EndpointListResult) MarshalJSON() ([]byte, error) { 4902 objectMap := make(map[string]interface{}) 4903 if elr.NextLink != nil { 4904 objectMap["nextLink"] = elr.NextLink 4905 } 4906 return json.Marshal(objectMap) 4907} 4908 4909// EndpointListResultIterator provides access to a complete listing of Endpoint values. 4910type EndpointListResultIterator struct { 4911 i int 4912 page EndpointListResultPage 4913} 4914 4915// NextWithContext advances to the next value. If there was an error making 4916// the request the iterator does not advance and the error is returned. 4917func (iter *EndpointListResultIterator) NextWithContext(ctx context.Context) (err error) { 4918 if tracing.IsEnabled() { 4919 ctx = tracing.StartSpan(ctx, fqdn+"/EndpointListResultIterator.NextWithContext") 4920 defer func() { 4921 sc := -1 4922 if iter.Response().Response.Response != nil { 4923 sc = iter.Response().Response.Response.StatusCode 4924 } 4925 tracing.EndSpan(ctx, sc, err) 4926 }() 4927 } 4928 iter.i++ 4929 if iter.i < len(iter.page.Values()) { 4930 return nil 4931 } 4932 err = iter.page.NextWithContext(ctx) 4933 if err != nil { 4934 iter.i-- 4935 return err 4936 } 4937 iter.i = 0 4938 return nil 4939} 4940 4941// Next advances to the next value. If there was an error making 4942// the request the iterator does not advance and the error is returned. 4943// Deprecated: Use NextWithContext() instead. 4944func (iter *EndpointListResultIterator) Next() error { 4945 return iter.NextWithContext(context.Background()) 4946} 4947 4948// NotDone returns true if the enumeration should be started or is not yet complete. 4949func (iter EndpointListResultIterator) NotDone() bool { 4950 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 4951} 4952 4953// Response returns the raw server response from the last page request. 4954func (iter EndpointListResultIterator) Response() EndpointListResult { 4955 return iter.page.Response() 4956} 4957 4958// Value returns the current value or a zero-initialized value if the 4959// iterator has advanced beyond the end of the collection. 4960func (iter EndpointListResultIterator) Value() Endpoint { 4961 if !iter.page.NotDone() { 4962 return Endpoint{} 4963 } 4964 return iter.page.Values()[iter.i] 4965} 4966 4967// Creates a new instance of the EndpointListResultIterator type. 4968func NewEndpointListResultIterator(page EndpointListResultPage) EndpointListResultIterator { 4969 return EndpointListResultIterator{page: page} 4970} 4971 4972// IsEmpty returns true if the ListResult contains no values. 4973func (elr EndpointListResult) IsEmpty() bool { 4974 return elr.Value == nil || len(*elr.Value) == 0 4975} 4976 4977// hasNextLink returns true if the NextLink is not empty. 4978func (elr EndpointListResult) hasNextLink() bool { 4979 return elr.NextLink != nil && len(*elr.NextLink) != 0 4980} 4981 4982// endpointListResultPreparer prepares a request to retrieve the next set of results. 4983// It returns nil if no more results exist. 4984func (elr EndpointListResult) endpointListResultPreparer(ctx context.Context) (*http.Request, error) { 4985 if !elr.hasNextLink() { 4986 return nil, nil 4987 } 4988 return autorest.Prepare((&http.Request{}).WithContext(ctx), 4989 autorest.AsJSON(), 4990 autorest.AsGet(), 4991 autorest.WithBaseURL(to.String(elr.NextLink))) 4992} 4993 4994// EndpointListResultPage contains a page of Endpoint values. 4995type EndpointListResultPage struct { 4996 fn func(context.Context, EndpointListResult) (EndpointListResult, error) 4997 elr EndpointListResult 4998} 4999 5000// NextWithContext advances to the next page of values. If there was an error making 5001// the request the page does not advance and the error is returned. 5002func (page *EndpointListResultPage) NextWithContext(ctx context.Context) (err error) { 5003 if tracing.IsEnabled() { 5004 ctx = tracing.StartSpan(ctx, fqdn+"/EndpointListResultPage.NextWithContext") 5005 defer func() { 5006 sc := -1 5007 if page.Response().Response.Response != nil { 5008 sc = page.Response().Response.Response.StatusCode 5009 } 5010 tracing.EndSpan(ctx, sc, err) 5011 }() 5012 } 5013 for { 5014 next, err := page.fn(ctx, page.elr) 5015 if err != nil { 5016 return err 5017 } 5018 page.elr = next 5019 if !next.hasNextLink() || !next.IsEmpty() { 5020 break 5021 } 5022 } 5023 return nil 5024} 5025 5026// Next advances to the next page of values. If there was an error making 5027// the request the page does not advance and the error is returned. 5028// Deprecated: Use NextWithContext() instead. 5029func (page *EndpointListResultPage) Next() error { 5030 return page.NextWithContext(context.Background()) 5031} 5032 5033// NotDone returns true if the page enumeration should be started or is not yet complete. 5034func (page EndpointListResultPage) NotDone() bool { 5035 return !page.elr.IsEmpty() 5036} 5037 5038// Response returns the raw server response from the last page request. 5039func (page EndpointListResultPage) Response() EndpointListResult { 5040 return page.elr 5041} 5042 5043// Values returns the slice of values for the current page or nil if there are no values. 5044func (page EndpointListResultPage) Values() []Endpoint { 5045 if page.elr.IsEmpty() { 5046 return nil 5047 } 5048 return *page.elr.Value 5049} 5050 5051// Creates a new instance of the EndpointListResultPage type. 5052func NewEndpointListResultPage(cur EndpointListResult, getNextPage func(context.Context, EndpointListResult) (EndpointListResult, error)) EndpointListResultPage { 5053 return EndpointListResultPage{ 5054 fn: getNextPage, 5055 elr: cur, 5056 } 5057} 5058 5059// EndpointProperties the JSON object that contains the properties required to create an endpoint. 5060type EndpointProperties struct { 5061 // HostName - READ-ONLY; The host name of the endpoint structured as {endpointName}.{DNSZone}, e.g. contoso.azureedge.net 5062 HostName *string `json:"hostName,omitempty"` 5063 // Origins - The source of the content being delivered via CDN. 5064 Origins *[]DeepCreatedOrigin `json:"origins,omitempty"` 5065 // OriginGroups - The origin groups comprising of origins that are used for load balancing the traffic based on availability. 5066 OriginGroups *[]DeepCreatedOriginGroup `json:"originGroups,omitempty"` 5067 // ResourceState - READ-ONLY; Resource status of the endpoint. Possible values include: 'EndpointResourceStateCreating', 'EndpointResourceStateDeleting', 'EndpointResourceStateRunning', 'EndpointResourceStateStarting', 'EndpointResourceStateStopped', 'EndpointResourceStateStopping' 5068 ResourceState EndpointResourceState `json:"resourceState,omitempty"` 5069 // ProvisioningState - READ-ONLY; Provisioning status of the endpoint. 5070 ProvisioningState *string `json:"provisioningState,omitempty"` 5071 // OriginPath - A directory path on the origin that CDN can use to retrieve content from, e.g. contoso.cloudapp.net/originpath. 5072 OriginPath *string `json:"originPath,omitempty"` 5073 // ContentTypesToCompress - List of content types on which compression applies. The value should be a valid MIME type. 5074 ContentTypesToCompress *[]string `json:"contentTypesToCompress,omitempty"` 5075 // OriginHostHeader - The host header value sent to the origin with each request. This property at Endpoint is only allowed when endpoint uses single origin and can be overridden by the same property specified at origin.If you leave this blank, the request hostname determines this value. Azure CDN origins, such as Web Apps, Blob Storage, and Cloud Services require this host header value to match the origin hostname by default. 5076 OriginHostHeader *string `json:"originHostHeader,omitempty"` 5077 // 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. 5078 IsCompressionEnabled *bool `json:"isCompressionEnabled,omitempty"` 5079 // IsHTTPAllowed - Indicates whether HTTP traffic is allowed on the endpoint. Default value is true. At least one protocol (HTTP or HTTPS) must be allowed. 5080 IsHTTPAllowed *bool `json:"isHttpAllowed,omitempty"` 5081 // IsHTTPSAllowed - Indicates whether HTTPS traffic is allowed on the endpoint. Default value is true. At least one protocol (HTTP or HTTPS) must be allowed. 5082 IsHTTPSAllowed *bool `json:"isHttpsAllowed,omitempty"` 5083 // QueryStringCachingBehavior - Defines how CDN caches requests that include query strings. You can ignore any query strings when caching, bypass caching to prevent requests that contain query strings from being cached, or cache every request with a unique URL. Possible values include: 'QueryStringCachingBehaviorIgnoreQueryString', 'QueryStringCachingBehaviorBypassCaching', 'QueryStringCachingBehaviorUseQueryString', 'QueryStringCachingBehaviorNotSet' 5084 QueryStringCachingBehavior QueryStringCachingBehavior `json:"queryStringCachingBehavior,omitempty"` 5085 // 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' 5086 OptimizationType OptimizationType `json:"optimizationType,omitempty"` 5087 // ProbePath - Path to a file hosted on the origin which helps accelerate delivery of the dynamic content and calculate the most optimal routes for the CDN. This is relative to the origin path. This property is only relevant when using a single origin. 5088 ProbePath *string `json:"probePath,omitempty"` 5089 // 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/ 5090 GeoFilters *[]GeoFilter `json:"geoFilters,omitempty"` 5091 // DefaultOriginGroup - A reference to the origin group. 5092 DefaultOriginGroup *ResourceReference `json:"defaultOriginGroup,omitempty"` 5093 // URLSigningKeys - List of keys used to validate the signed URL hashes. 5094 URLSigningKeys *[]URLSigningKey `json:"urlSigningKeys,omitempty"` 5095 // DeliveryPolicy - A policy that specifies the delivery rules to be used for an endpoint. 5096 DeliveryPolicy *EndpointPropertiesUpdateParametersDeliveryPolicy `json:"deliveryPolicy,omitempty"` 5097 // WebApplicationFirewallPolicyLink - Defines the Web Application Firewall policy for the endpoint (if applicable) 5098 WebApplicationFirewallPolicyLink *EndpointPropertiesUpdateParametersWebApplicationFirewallPolicyLink `json:"webApplicationFirewallPolicyLink,omitempty"` 5099} 5100 5101// MarshalJSON is the custom marshaler for EndpointProperties. 5102func (ep EndpointProperties) MarshalJSON() ([]byte, error) { 5103 objectMap := make(map[string]interface{}) 5104 if ep.Origins != nil { 5105 objectMap["origins"] = ep.Origins 5106 } 5107 if ep.OriginGroups != nil { 5108 objectMap["originGroups"] = ep.OriginGroups 5109 } 5110 if ep.OriginPath != nil { 5111 objectMap["originPath"] = ep.OriginPath 5112 } 5113 if ep.ContentTypesToCompress != nil { 5114 objectMap["contentTypesToCompress"] = ep.ContentTypesToCompress 5115 } 5116 if ep.OriginHostHeader != nil { 5117 objectMap["originHostHeader"] = ep.OriginHostHeader 5118 } 5119 if ep.IsCompressionEnabled != nil { 5120 objectMap["isCompressionEnabled"] = ep.IsCompressionEnabled 5121 } 5122 if ep.IsHTTPAllowed != nil { 5123 objectMap["isHttpAllowed"] = ep.IsHTTPAllowed 5124 } 5125 if ep.IsHTTPSAllowed != nil { 5126 objectMap["isHttpsAllowed"] = ep.IsHTTPSAllowed 5127 } 5128 if ep.QueryStringCachingBehavior != "" { 5129 objectMap["queryStringCachingBehavior"] = ep.QueryStringCachingBehavior 5130 } 5131 if ep.OptimizationType != "" { 5132 objectMap["optimizationType"] = ep.OptimizationType 5133 } 5134 if ep.ProbePath != nil { 5135 objectMap["probePath"] = ep.ProbePath 5136 } 5137 if ep.GeoFilters != nil { 5138 objectMap["geoFilters"] = ep.GeoFilters 5139 } 5140 if ep.DefaultOriginGroup != nil { 5141 objectMap["defaultOriginGroup"] = ep.DefaultOriginGroup 5142 } 5143 if ep.URLSigningKeys != nil { 5144 objectMap["urlSigningKeys"] = ep.URLSigningKeys 5145 } 5146 if ep.DeliveryPolicy != nil { 5147 objectMap["deliveryPolicy"] = ep.DeliveryPolicy 5148 } 5149 if ep.WebApplicationFirewallPolicyLink != nil { 5150 objectMap["webApplicationFirewallPolicyLink"] = ep.WebApplicationFirewallPolicyLink 5151 } 5152 return json.Marshal(objectMap) 5153} 5154 5155// EndpointPropertiesUpdateParameters the JSON object containing endpoint update parameters. 5156type EndpointPropertiesUpdateParameters struct { 5157 // OriginPath - A directory path on the origin that CDN can use to retrieve content from, e.g. contoso.cloudapp.net/originpath. 5158 OriginPath *string `json:"originPath,omitempty"` 5159 // ContentTypesToCompress - List of content types on which compression applies. The value should be a valid MIME type. 5160 ContentTypesToCompress *[]string `json:"contentTypesToCompress,omitempty"` 5161 // OriginHostHeader - The host header value sent to the origin with each request. This property at Endpoint is only allowed when endpoint uses single origin and can be overridden by the same property specified at origin.If you leave this blank, the request hostname determines this value. Azure CDN origins, such as Web Apps, Blob Storage, and Cloud Services require this host header value to match the origin hostname by default. 5162 OriginHostHeader *string `json:"originHostHeader,omitempty"` 5163 // 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. 5164 IsCompressionEnabled *bool `json:"isCompressionEnabled,omitempty"` 5165 // IsHTTPAllowed - Indicates whether HTTP traffic is allowed on the endpoint. Default value is true. At least one protocol (HTTP or HTTPS) must be allowed. 5166 IsHTTPAllowed *bool `json:"isHttpAllowed,omitempty"` 5167 // IsHTTPSAllowed - Indicates whether HTTPS traffic is allowed on the endpoint. Default value is true. At least one protocol (HTTP or HTTPS) must be allowed. 5168 IsHTTPSAllowed *bool `json:"isHttpsAllowed,omitempty"` 5169 // QueryStringCachingBehavior - Defines how CDN caches requests that include query strings. You can ignore any query strings when caching, bypass caching to prevent requests that contain query strings from being cached, or cache every request with a unique URL. Possible values include: 'QueryStringCachingBehaviorIgnoreQueryString', 'QueryStringCachingBehaviorBypassCaching', 'QueryStringCachingBehaviorUseQueryString', 'QueryStringCachingBehaviorNotSet' 5170 QueryStringCachingBehavior QueryStringCachingBehavior `json:"queryStringCachingBehavior,omitempty"` 5171 // 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' 5172 OptimizationType OptimizationType `json:"optimizationType,omitempty"` 5173 // ProbePath - Path to a file hosted on the origin which helps accelerate delivery of the dynamic content and calculate the most optimal routes for the CDN. This is relative to the origin path. This property is only relevant when using a single origin. 5174 ProbePath *string `json:"probePath,omitempty"` 5175 // 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/ 5176 GeoFilters *[]GeoFilter `json:"geoFilters,omitempty"` 5177 // DefaultOriginGroup - A reference to the origin group. 5178 DefaultOriginGroup *ResourceReference `json:"defaultOriginGroup,omitempty"` 5179 // URLSigningKeys - List of keys used to validate the signed URL hashes. 5180 URLSigningKeys *[]URLSigningKey `json:"urlSigningKeys,omitempty"` 5181 // DeliveryPolicy - A policy that specifies the delivery rules to be used for an endpoint. 5182 DeliveryPolicy *EndpointPropertiesUpdateParametersDeliveryPolicy `json:"deliveryPolicy,omitempty"` 5183 // WebApplicationFirewallPolicyLink - Defines the Web Application Firewall policy for the endpoint (if applicable) 5184 WebApplicationFirewallPolicyLink *EndpointPropertiesUpdateParametersWebApplicationFirewallPolicyLink `json:"webApplicationFirewallPolicyLink,omitempty"` 5185} 5186 5187// EndpointPropertiesUpdateParametersDeliveryPolicy a policy that specifies the delivery rules to be used 5188// for an endpoint. 5189type EndpointPropertiesUpdateParametersDeliveryPolicy struct { 5190 // Description - User-friendly description of the policy. 5191 Description *string `json:"description,omitempty"` 5192 // Rules - A list of the delivery rules. 5193 Rules *[]DeliveryRule `json:"rules,omitempty"` 5194} 5195 5196// EndpointPropertiesUpdateParametersWebApplicationFirewallPolicyLink defines the Web Application Firewall 5197// policy for the endpoint (if applicable) 5198type EndpointPropertiesUpdateParametersWebApplicationFirewallPolicyLink struct { 5199 // ID - Resource ID. 5200 ID *string `json:"id,omitempty"` 5201} 5202 5203// EndpointsCreateFuture an abstraction for monitoring and retrieving the results of a long-running 5204// operation. 5205type EndpointsCreateFuture struct { 5206 azure.FutureAPI 5207 // Result returns the result of the asynchronous operation. 5208 // If the operation has not completed it will return an error. 5209 Result func(EndpointsClient) (Endpoint, error) 5210} 5211 5212// EndpointsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running 5213// operation. 5214type EndpointsDeleteFuture struct { 5215 azure.FutureAPI 5216 // Result returns the result of the asynchronous operation. 5217 // If the operation has not completed it will return an error. 5218 Result func(EndpointsClient) (autorest.Response, error) 5219} 5220 5221// EndpointsLoadContentFuture an abstraction for monitoring and retrieving the results of a long-running 5222// operation. 5223type EndpointsLoadContentFuture struct { 5224 azure.FutureAPI 5225 // Result returns the result of the asynchronous operation. 5226 // If the operation has not completed it will return an error. 5227 Result func(EndpointsClient) (autorest.Response, error) 5228} 5229 5230// EndpointsPurgeContentFuture an abstraction for monitoring and retrieving the results of a long-running 5231// operation. 5232type EndpointsPurgeContentFuture struct { 5233 azure.FutureAPI 5234 // Result returns the result of the asynchronous operation. 5235 // If the operation has not completed it will return an error. 5236 Result func(EndpointsClient) (autorest.Response, error) 5237} 5238 5239// EndpointsStartFuture an abstraction for monitoring and retrieving the results of a long-running 5240// operation. 5241type EndpointsStartFuture struct { 5242 azure.FutureAPI 5243 // Result returns the result of the asynchronous operation. 5244 // If the operation has not completed it will return an error. 5245 Result func(EndpointsClient) (Endpoint, error) 5246} 5247 5248// EndpointsStopFuture an abstraction for monitoring and retrieving the results of a long-running 5249// operation. 5250type EndpointsStopFuture struct { 5251 azure.FutureAPI 5252 // Result returns the result of the asynchronous operation. 5253 // If the operation has not completed it will return an error. 5254 Result func(EndpointsClient) (Endpoint, error) 5255} 5256 5257// EndpointsUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 5258// operation. 5259type EndpointsUpdateFuture struct { 5260 azure.FutureAPI 5261 // Result returns the result of the asynchronous operation. 5262 // If the operation has not completed it will return an error. 5263 Result func(EndpointsClient) (Endpoint, error) 5264} 5265 5266// EndpointType defines the ARM Resource ID for the linked endpoints 5267type EndpointType struct { 5268 // ID - ARM Resource ID string. 5269 ID *string `json:"id,omitempty"` 5270} 5271 5272// EndpointUpdateParameters properties required to create or update an endpoint. 5273type EndpointUpdateParameters struct { 5274 // Tags - Endpoint tags. 5275 Tags map[string]*string `json:"tags"` 5276 *EndpointPropertiesUpdateParameters `json:"properties,omitempty"` 5277} 5278 5279// MarshalJSON is the custom marshaler for EndpointUpdateParameters. 5280func (eup EndpointUpdateParameters) MarshalJSON() ([]byte, error) { 5281 objectMap := make(map[string]interface{}) 5282 if eup.Tags != nil { 5283 objectMap["tags"] = eup.Tags 5284 } 5285 if eup.EndpointPropertiesUpdateParameters != nil { 5286 objectMap["properties"] = eup.EndpointPropertiesUpdateParameters 5287 } 5288 return json.Marshal(objectMap) 5289} 5290 5291// UnmarshalJSON is the custom unmarshaler for EndpointUpdateParameters struct. 5292func (eup *EndpointUpdateParameters) UnmarshalJSON(body []byte) error { 5293 var m map[string]*json.RawMessage 5294 err := json.Unmarshal(body, &m) 5295 if err != nil { 5296 return err 5297 } 5298 for k, v := range m { 5299 switch k { 5300 case "tags": 5301 if v != nil { 5302 var tags map[string]*string 5303 err = json.Unmarshal(*v, &tags) 5304 if err != nil { 5305 return err 5306 } 5307 eup.Tags = tags 5308 } 5309 case "properties": 5310 if v != nil { 5311 var endpointPropertiesUpdateParameters EndpointPropertiesUpdateParameters 5312 err = json.Unmarshal(*v, &endpointPropertiesUpdateParameters) 5313 if err != nil { 5314 return err 5315 } 5316 eup.EndpointPropertiesUpdateParameters = &endpointPropertiesUpdateParameters 5317 } 5318 } 5319 } 5320 5321 return nil 5322} 5323 5324// ErrorResponse error response indicates CDN service is not able to process the incoming request. The 5325// reason is provided in the error message. 5326type ErrorResponse struct { 5327 // Code - READ-ONLY; Error code. 5328 Code *string `json:"code,omitempty"` 5329 // Message - READ-ONLY; Error message indicating why the operation failed. 5330 Message *string `json:"message,omitempty"` 5331} 5332 5333// GeoFilter rules defining user's geo access within a CDN endpoint. 5334type GeoFilter struct { 5335 // RelativePath - Relative path applicable to geo filter. (e.g. '/mypictures', '/mypicture/kitty.jpg', and etc.) 5336 RelativePath *string `json:"relativePath,omitempty"` 5337 // Action - Action of the geo filter, i.e. allow or block access. Possible values include: 'GeoFilterActionsBlock', 'GeoFilterActionsAllow' 5338 Action GeoFilterActions `json:"action,omitempty"` 5339 // CountryCodes - Two letter country codes defining user country access in a geo filter, e.g. AU, MX, US. 5340 CountryCodes *[]string `json:"countryCodes,omitempty"` 5341} 5342 5343// HeaderActionParameters defines the parameters for the request header action. 5344type HeaderActionParameters struct { 5345 OdataType *string `json:"@odata.type,omitempty"` 5346 // HeaderAction - Action to perform. Possible values include: 'Append', 'Overwrite', 'Delete' 5347 HeaderAction HeaderAction `json:"headerAction,omitempty"` 5348 // HeaderName - Name of the header to modify 5349 HeaderName *string `json:"headerName,omitempty"` 5350 // Value - Value for the specified action 5351 Value *string `json:"value,omitempty"` 5352} 5353 5354// HealthProbeParameters the JSON object that contains the properties to send health probes to origin. 5355type HealthProbeParameters struct { 5356 // ProbePath - The path relative to the origin that is used to determine the health of the origin. 5357 ProbePath *string `json:"probePath,omitempty"` 5358 // ProbeRequestType - The type of health probe request that is made. Possible values include: 'HealthProbeRequestTypeNotSet', 'HealthProbeRequestTypeGET', 'HealthProbeRequestTypeHEAD' 5359 ProbeRequestType HealthProbeRequestType `json:"probeRequestType,omitempty"` 5360 // ProbeProtocol - Protocol to use for health probe. Possible values include: 'ProbeProtocolNotSet', 'ProbeProtocolHTTP', 'ProbeProtocolHTTPS' 5361 ProbeProtocol ProbeProtocol `json:"probeProtocol,omitempty"` 5362 // ProbeIntervalInSeconds - The number of seconds between health probes.Default is 240sec. 5363 ProbeIntervalInSeconds *int32 `json:"probeIntervalInSeconds,omitempty"` 5364} 5365 5366// HTTPErrorRangeParameters the JSON object that represents the range for http status codes 5367type HTTPErrorRangeParameters struct { 5368 // Begin - The inclusive start of the http status code range. 5369 Begin *int32 `json:"begin,omitempty"` 5370 // End - The inclusive end of the http status code range. 5371 End *int32 `json:"end,omitempty"` 5372} 5373 5374// HTTPVersionMatchConditionParameters defines the parameters for HttpVersion match conditions 5375type HTTPVersionMatchConditionParameters struct { 5376 OdataType *string `json:"@odata.type,omitempty"` 5377 // Operator - Describes operator to be matched 5378 Operator *string `json:"operator,omitempty"` 5379 // NegateCondition - Describes if this is negate condition or not 5380 NegateCondition *bool `json:"negateCondition,omitempty"` 5381 // MatchValues - The match value for the condition of the delivery rule 5382 MatchValues *[]string `json:"matchValues,omitempty"` 5383} 5384 5385// IPAddressGroup CDN Ip address group 5386type IPAddressGroup struct { 5387 // DeliveryRegion - The delivery region of the ip address group 5388 DeliveryRegion *string `json:"deliveryRegion,omitempty"` 5389 // Ipv4Addresses - The list of ip v4 addresses. 5390 Ipv4Addresses *[]CidrIPAddress `json:"ipv4Addresses,omitempty"` 5391 // Ipv6Addresses - The list of ip v6 addresses. 5392 Ipv6Addresses *[]CidrIPAddress `json:"ipv6Addresses,omitempty"` 5393} 5394 5395// IsDeviceMatchConditionParameters defines the parameters for IsDevice match conditions 5396type IsDeviceMatchConditionParameters struct { 5397 OdataType *string `json:"@odata.type,omitempty"` 5398 // Operator - Describes operator to be matched 5399 Operator *string `json:"operator,omitempty"` 5400 // NegateCondition - Describes if this is negate condition or not 5401 NegateCondition *bool `json:"negateCondition,omitempty"` 5402 // MatchValues - The match value for the condition of the delivery rule 5403 MatchValues *[]string `json:"matchValues,omitempty"` 5404 // Transforms - List of transforms 5405 Transforms *[]Transform `json:"transforms,omitempty"` 5406} 5407 5408// KeyVaultCertificateSourceParameters describes the parameters for using a user's KeyVault certificate for 5409// securing custom domain. 5410type KeyVaultCertificateSourceParameters struct { 5411 OdataType *string `json:"@odata.type,omitempty"` 5412 // SubscriptionID - Subscription Id of the user's Key Vault containing the SSL certificate 5413 SubscriptionID *string `json:"subscriptionId,omitempty"` 5414 // ResourceGroupName - Resource group of the user's Key Vault containing the SSL certificate 5415 ResourceGroupName *string `json:"resourceGroupName,omitempty"` 5416 // VaultName - The name of the user's Key Vault containing the SSL certificate 5417 VaultName *string `json:"vaultName,omitempty"` 5418 // SecretName - The name of Key Vault Secret (representing the full certificate PFX) in Key Vault. 5419 SecretName *string `json:"secretName,omitempty"` 5420 // SecretVersion - The version(GUID) of Key Vault Secret in Key Vault. 5421 SecretVersion *string `json:"secretVersion,omitempty"` 5422 // UpdateRule - Describes the action that shall be taken when the certificate is updated in Key Vault. 5423 UpdateRule *string `json:"updateRule,omitempty"` 5424 // DeleteRule - Describes the action that shall be taken when the certificate is removed from Key Vault. 5425 DeleteRule *string `json:"deleteRule,omitempty"` 5426} 5427 5428// KeyVaultSigningKeyParameters describes the parameters for using a user's KeyVault for URL Signing Key. 5429type KeyVaultSigningKeyParameters struct { 5430 OdataType *string `json:"@odata.type,omitempty"` 5431 // SubscriptionID - Subscription Id of the user's Key Vault containing the secret 5432 SubscriptionID *string `json:"subscriptionId,omitempty"` 5433 // ResourceGroupName - Resource group of the user's Key Vault containing the secret 5434 ResourceGroupName *string `json:"resourceGroupName,omitempty"` 5435 // VaultName - The name of the user's Key Vault containing the secret 5436 VaultName *string `json:"vaultName,omitempty"` 5437 // SecretName - The name of secret in Key Vault. 5438 SecretName *string `json:"secretName,omitempty"` 5439 // SecretVersion - The version(GUID) of secret in Key Vault. 5440 SecretVersion *string `json:"secretVersion,omitempty"` 5441} 5442 5443// LoadBalancingSettingsParameters round-Robin load balancing settings for a backend pool 5444type LoadBalancingSettingsParameters struct { 5445 // SampleSize - The number of samples to consider for load balancing decisions 5446 SampleSize *int32 `json:"sampleSize,omitempty"` 5447 // SuccessfulSamplesRequired - The number of samples within the sample period that must succeed 5448 SuccessfulSamplesRequired *int32 `json:"successfulSamplesRequired,omitempty"` 5449 // AdditionalLatencyInMilliseconds - The additional latency in milliseconds for probes to fall into the lowest latency bucket 5450 AdditionalLatencyInMilliseconds *int32 `json:"additionalLatencyInMilliseconds,omitempty"` 5451} 5452 5453// LoadParameters parameters required for content load. 5454type LoadParameters struct { 5455 // ContentPaths - The path to the content to be loaded. Path should be a relative file URL of the origin. 5456 ContentPaths *[]string `json:"contentPaths,omitempty"` 5457} 5458 5459// ManagedCertificate managed Certificate used for https 5460type ManagedCertificate struct { 5461 // Subject - Subject name in the certificate. 5462 Subject *string `json:"subject,omitempty"` 5463 // ExpirationDate - Certificate expiration date. 5464 ExpirationDate *string `json:"expirationDate,omitempty"` 5465 // Thumbprint - Certificate thumbprint. 5466 Thumbprint *string `json:"thumbprint,omitempty"` 5467} 5468 5469// ManagedCertificateParameters managed Certificate used for https 5470type ManagedCertificateParameters struct { 5471 // Type - Possible values include: 'TypeSecretParameters', 'TypeURLSigningKey', 'TypeManagedCertificate', 'TypeCustomerCertificate' 5472 Type TypeBasicSecretParameters `json:"type,omitempty"` 5473} 5474 5475// MarshalJSON is the custom marshaler for ManagedCertificateParameters. 5476func (mcp ManagedCertificateParameters) MarshalJSON() ([]byte, error) { 5477 mcp.Type = TypeManagedCertificate 5478 objectMap := make(map[string]interface{}) 5479 if mcp.Type != "" { 5480 objectMap["type"] = mcp.Type 5481 } 5482 return json.Marshal(objectMap) 5483} 5484 5485// AsURLSigningKeyParameters is the BasicSecretParameters implementation for ManagedCertificateParameters. 5486func (mcp ManagedCertificateParameters) AsURLSigningKeyParameters() (*URLSigningKeyParameters, bool) { 5487 return nil, false 5488} 5489 5490// AsManagedCertificateParameters is the BasicSecretParameters implementation for ManagedCertificateParameters. 5491func (mcp ManagedCertificateParameters) AsManagedCertificateParameters() (*ManagedCertificateParameters, bool) { 5492 return &mcp, true 5493} 5494 5495// AsCustomerCertificateParameters is the BasicSecretParameters implementation for ManagedCertificateParameters. 5496func (mcp ManagedCertificateParameters) AsCustomerCertificateParameters() (*CustomerCertificateParameters, bool) { 5497 return nil, false 5498} 5499 5500// AsSecretParameters is the BasicSecretParameters implementation for ManagedCertificateParameters. 5501func (mcp ManagedCertificateParameters) AsSecretParameters() (*SecretParameters, bool) { 5502 return nil, false 5503} 5504 5505// AsBasicSecretParameters is the BasicSecretParameters implementation for ManagedCertificateParameters. 5506func (mcp ManagedCertificateParameters) AsBasicSecretParameters() (BasicSecretParameters, bool) { 5507 return &mcp, true 5508} 5509 5510// ManagedHTTPSParameters defines the certificate source parameters using CDN managed certificate for 5511// enabling SSL. 5512type ManagedHTTPSParameters struct { 5513 // CertificateSourceParameters - Defines the certificate source parameters using CDN managed certificate for enabling SSL. 5514 CertificateSourceParameters *CertificateSourceParameters `json:"certificateSourceParameters,omitempty"` 5515 // ProtocolType - Defines the TLS extension protocol that is used for secure delivery. Possible values include: 'ServerNameIndication', 'IPBased' 5516 ProtocolType ProtocolType `json:"protocolType,omitempty"` 5517 // MinimumTLSVersion - TLS protocol version that will be used for Https. Possible values include: 'MinimumTLSVersionNone', 'MinimumTLSVersionTLS10', 'MinimumTLSVersionTLS12' 5518 MinimumTLSVersion MinimumTLSVersion `json:"minimumTlsVersion,omitempty"` 5519 // CertificateSource - Possible values include: 'CertificateSourceCustomDomainHTTPSParameters', 'CertificateSourceCdn', 'CertificateSourceAzureKeyVault' 5520 CertificateSource CertificateSource `json:"certificateSource,omitempty"` 5521} 5522 5523// MarshalJSON is the custom marshaler for ManagedHTTPSParameters. 5524func (mhp ManagedHTTPSParameters) MarshalJSON() ([]byte, error) { 5525 mhp.CertificateSource = CertificateSourceCdn 5526 objectMap := make(map[string]interface{}) 5527 if mhp.CertificateSourceParameters != nil { 5528 objectMap["certificateSourceParameters"] = mhp.CertificateSourceParameters 5529 } 5530 if mhp.ProtocolType != "" { 5531 objectMap["protocolType"] = mhp.ProtocolType 5532 } 5533 if mhp.MinimumTLSVersion != "" { 5534 objectMap["minimumTlsVersion"] = mhp.MinimumTLSVersion 5535 } 5536 if mhp.CertificateSource != "" { 5537 objectMap["certificateSource"] = mhp.CertificateSource 5538 } 5539 return json.Marshal(objectMap) 5540} 5541 5542// AsManagedHTTPSParameters is the BasicCustomDomainHTTPSParameters implementation for ManagedHTTPSParameters. 5543func (mhp ManagedHTTPSParameters) AsManagedHTTPSParameters() (*ManagedHTTPSParameters, bool) { 5544 return &mhp, true 5545} 5546 5547// AsUserManagedHTTPSParameters is the BasicCustomDomainHTTPSParameters implementation for ManagedHTTPSParameters. 5548func (mhp ManagedHTTPSParameters) AsUserManagedHTTPSParameters() (*UserManagedHTTPSParameters, bool) { 5549 return nil, false 5550} 5551 5552// AsCustomDomainHTTPSParameters is the BasicCustomDomainHTTPSParameters implementation for ManagedHTTPSParameters. 5553func (mhp ManagedHTTPSParameters) AsCustomDomainHTTPSParameters() (*CustomDomainHTTPSParameters, bool) { 5554 return nil, false 5555} 5556 5557// AsBasicCustomDomainHTTPSParameters is the BasicCustomDomainHTTPSParameters implementation for ManagedHTTPSParameters. 5558func (mhp ManagedHTTPSParameters) AsBasicCustomDomainHTTPSParameters() (BasicCustomDomainHTTPSParameters, bool) { 5559 return &mhp, true 5560} 5561 5562// ManagedRuleDefinition describes a managed rule definition. 5563type ManagedRuleDefinition struct { 5564 // RuleID - READ-ONLY; Identifier for the managed rule. 5565 RuleID *string `json:"ruleId,omitempty"` 5566 // Description - READ-ONLY; Describes the functionality of the managed rule. 5567 Description *string `json:"description,omitempty"` 5568} 5569 5570// ManagedRuleGroupDefinition describes a managed rule group. 5571type ManagedRuleGroupDefinition struct { 5572 // RuleGroupName - READ-ONLY; Name of the managed rule group. 5573 RuleGroupName *string `json:"ruleGroupName,omitempty"` 5574 // Description - READ-ONLY; Description of the managed rule group. 5575 Description *string `json:"description,omitempty"` 5576 // Rules - READ-ONLY; List of rules within the managed rule group. 5577 Rules *[]ManagedRuleDefinition `json:"rules,omitempty"` 5578} 5579 5580// ManagedRuleGroupOverride defines a managed rule group override setting. 5581type ManagedRuleGroupOverride struct { 5582 // RuleGroupName - Describes the managed rule group within the rule set to override 5583 RuleGroupName *string `json:"ruleGroupName,omitempty"` 5584 // Rules - List of rules that will be disabled. If none specified, all rules in the group will be disabled. 5585 Rules *[]ManagedRuleOverride `json:"rules,omitempty"` 5586} 5587 5588// ManagedRuleOverride defines a managed rule group override setting. 5589type ManagedRuleOverride struct { 5590 // RuleID - Identifier for the managed rule. 5591 RuleID *string `json:"ruleId,omitempty"` 5592 // EnabledState - Describes if the managed rule is in enabled or disabled state. Defaults to Disabled if not specified. Possible values include: 'ManagedRuleEnabledStateDisabled', 'ManagedRuleEnabledStateEnabled' 5593 EnabledState ManagedRuleEnabledState `json:"enabledState,omitempty"` 5594 // Action - Describes the override action to be applied when rule matches. Possible values include: 'Allow', 'Block', 'Log', 'Redirect' 5595 Action ActionType `json:"action,omitempty"` 5596} 5597 5598// ManagedRuleSet defines a managed rule set. 5599type ManagedRuleSet struct { 5600 // RuleSetType - Defines the rule set type to use. 5601 RuleSetType *string `json:"ruleSetType,omitempty"` 5602 // RuleSetVersion - Defines the version of the rule set to use. 5603 RuleSetVersion *string `json:"ruleSetVersion,omitempty"` 5604 // AnomalyScore - Verizon only : If the rule set supports anomaly detection mode, this describes the threshold for blocking requests. 5605 AnomalyScore *int32 `json:"anomalyScore,omitempty"` 5606 // RuleGroupOverrides - Defines the rule overrides to apply to the rule set. 5607 RuleGroupOverrides *[]ManagedRuleGroupOverride `json:"ruleGroupOverrides,omitempty"` 5608} 5609 5610// ManagedRuleSetDefinition describes a managed rule set definition. 5611type ManagedRuleSetDefinition struct { 5612 // ManagedRuleSetDefinitionProperties - Describes managed rule set definition properties. 5613 *ManagedRuleSetDefinitionProperties `json:"properties,omitempty"` 5614 // Sku - The pricing tier (defines a CDN provider, feature list and rate) of the CdnWebApplicationFirewallPolicy. 5615 Sku *Sku `json:"sku,omitempty"` 5616 // ID - READ-ONLY; Resource ID. 5617 ID *string `json:"id,omitempty"` 5618 // Name - READ-ONLY; Resource name. 5619 Name *string `json:"name,omitempty"` 5620 // Type - READ-ONLY; Resource type. 5621 Type *string `json:"type,omitempty"` 5622} 5623 5624// MarshalJSON is the custom marshaler for ManagedRuleSetDefinition. 5625func (mrsd ManagedRuleSetDefinition) MarshalJSON() ([]byte, error) { 5626 objectMap := make(map[string]interface{}) 5627 if mrsd.ManagedRuleSetDefinitionProperties != nil { 5628 objectMap["properties"] = mrsd.ManagedRuleSetDefinitionProperties 5629 } 5630 if mrsd.Sku != nil { 5631 objectMap["sku"] = mrsd.Sku 5632 } 5633 return json.Marshal(objectMap) 5634} 5635 5636// UnmarshalJSON is the custom unmarshaler for ManagedRuleSetDefinition struct. 5637func (mrsd *ManagedRuleSetDefinition) UnmarshalJSON(body []byte) error { 5638 var m map[string]*json.RawMessage 5639 err := json.Unmarshal(body, &m) 5640 if err != nil { 5641 return err 5642 } 5643 for k, v := range m { 5644 switch k { 5645 case "properties": 5646 if v != nil { 5647 var managedRuleSetDefinitionProperties ManagedRuleSetDefinitionProperties 5648 err = json.Unmarshal(*v, &managedRuleSetDefinitionProperties) 5649 if err != nil { 5650 return err 5651 } 5652 mrsd.ManagedRuleSetDefinitionProperties = &managedRuleSetDefinitionProperties 5653 } 5654 case "sku": 5655 if v != nil { 5656 var sku Sku 5657 err = json.Unmarshal(*v, &sku) 5658 if err != nil { 5659 return err 5660 } 5661 mrsd.Sku = &sku 5662 } 5663 case "id": 5664 if v != nil { 5665 var ID string 5666 err = json.Unmarshal(*v, &ID) 5667 if err != nil { 5668 return err 5669 } 5670 mrsd.ID = &ID 5671 } 5672 case "name": 5673 if v != nil { 5674 var name string 5675 err = json.Unmarshal(*v, &name) 5676 if err != nil { 5677 return err 5678 } 5679 mrsd.Name = &name 5680 } 5681 case "type": 5682 if v != nil { 5683 var typeVar string 5684 err = json.Unmarshal(*v, &typeVar) 5685 if err != nil { 5686 return err 5687 } 5688 mrsd.Type = &typeVar 5689 } 5690 } 5691 } 5692 5693 return nil 5694} 5695 5696// ManagedRuleSetDefinitionList list of managed rule set definitions available for use in a policy. 5697type ManagedRuleSetDefinitionList struct { 5698 autorest.Response `json:"-"` 5699 // Value - READ-ONLY; List of managed rule set definitions. 5700 Value *[]ManagedRuleSetDefinition `json:"value,omitempty"` 5701 // NextLink - URL to retrieve next set of managed rule set definitions. 5702 NextLink *string `json:"nextLink,omitempty"` 5703} 5704 5705// MarshalJSON is the custom marshaler for ManagedRuleSetDefinitionList. 5706func (mrsdl ManagedRuleSetDefinitionList) MarshalJSON() ([]byte, error) { 5707 objectMap := make(map[string]interface{}) 5708 if mrsdl.NextLink != nil { 5709 objectMap["nextLink"] = mrsdl.NextLink 5710 } 5711 return json.Marshal(objectMap) 5712} 5713 5714// ManagedRuleSetDefinitionListIterator provides access to a complete listing of ManagedRuleSetDefinition 5715// values. 5716type ManagedRuleSetDefinitionListIterator struct { 5717 i int 5718 page ManagedRuleSetDefinitionListPage 5719} 5720 5721// NextWithContext advances to the next value. If there was an error making 5722// the request the iterator does not advance and the error is returned. 5723func (iter *ManagedRuleSetDefinitionListIterator) NextWithContext(ctx context.Context) (err error) { 5724 if tracing.IsEnabled() { 5725 ctx = tracing.StartSpan(ctx, fqdn+"/ManagedRuleSetDefinitionListIterator.NextWithContext") 5726 defer func() { 5727 sc := -1 5728 if iter.Response().Response.Response != nil { 5729 sc = iter.Response().Response.Response.StatusCode 5730 } 5731 tracing.EndSpan(ctx, sc, err) 5732 }() 5733 } 5734 iter.i++ 5735 if iter.i < len(iter.page.Values()) { 5736 return nil 5737 } 5738 err = iter.page.NextWithContext(ctx) 5739 if err != nil { 5740 iter.i-- 5741 return err 5742 } 5743 iter.i = 0 5744 return nil 5745} 5746 5747// Next advances to the next value. If there was an error making 5748// the request the iterator does not advance and the error is returned. 5749// Deprecated: Use NextWithContext() instead. 5750func (iter *ManagedRuleSetDefinitionListIterator) Next() error { 5751 return iter.NextWithContext(context.Background()) 5752} 5753 5754// NotDone returns true if the enumeration should be started or is not yet complete. 5755func (iter ManagedRuleSetDefinitionListIterator) NotDone() bool { 5756 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 5757} 5758 5759// Response returns the raw server response from the last page request. 5760func (iter ManagedRuleSetDefinitionListIterator) Response() ManagedRuleSetDefinitionList { 5761 return iter.page.Response() 5762} 5763 5764// Value returns the current value or a zero-initialized value if the 5765// iterator has advanced beyond the end of the collection. 5766func (iter ManagedRuleSetDefinitionListIterator) Value() ManagedRuleSetDefinition { 5767 if !iter.page.NotDone() { 5768 return ManagedRuleSetDefinition{} 5769 } 5770 return iter.page.Values()[iter.i] 5771} 5772 5773// Creates a new instance of the ManagedRuleSetDefinitionListIterator type. 5774func NewManagedRuleSetDefinitionListIterator(page ManagedRuleSetDefinitionListPage) ManagedRuleSetDefinitionListIterator { 5775 return ManagedRuleSetDefinitionListIterator{page: page} 5776} 5777 5778// IsEmpty returns true if the ListResult contains no values. 5779func (mrsdl ManagedRuleSetDefinitionList) IsEmpty() bool { 5780 return mrsdl.Value == nil || len(*mrsdl.Value) == 0 5781} 5782 5783// hasNextLink returns true if the NextLink is not empty. 5784func (mrsdl ManagedRuleSetDefinitionList) hasNextLink() bool { 5785 return mrsdl.NextLink != nil && len(*mrsdl.NextLink) != 0 5786} 5787 5788// managedRuleSetDefinitionListPreparer prepares a request to retrieve the next set of results. 5789// It returns nil if no more results exist. 5790func (mrsdl ManagedRuleSetDefinitionList) managedRuleSetDefinitionListPreparer(ctx context.Context) (*http.Request, error) { 5791 if !mrsdl.hasNextLink() { 5792 return nil, nil 5793 } 5794 return autorest.Prepare((&http.Request{}).WithContext(ctx), 5795 autorest.AsJSON(), 5796 autorest.AsGet(), 5797 autorest.WithBaseURL(to.String(mrsdl.NextLink))) 5798} 5799 5800// ManagedRuleSetDefinitionListPage contains a page of ManagedRuleSetDefinition values. 5801type ManagedRuleSetDefinitionListPage struct { 5802 fn func(context.Context, ManagedRuleSetDefinitionList) (ManagedRuleSetDefinitionList, error) 5803 mrsdl ManagedRuleSetDefinitionList 5804} 5805 5806// NextWithContext advances to the next page of values. If there was an error making 5807// the request the page does not advance and the error is returned. 5808func (page *ManagedRuleSetDefinitionListPage) NextWithContext(ctx context.Context) (err error) { 5809 if tracing.IsEnabled() { 5810 ctx = tracing.StartSpan(ctx, fqdn+"/ManagedRuleSetDefinitionListPage.NextWithContext") 5811 defer func() { 5812 sc := -1 5813 if page.Response().Response.Response != nil { 5814 sc = page.Response().Response.Response.StatusCode 5815 } 5816 tracing.EndSpan(ctx, sc, err) 5817 }() 5818 } 5819 for { 5820 next, err := page.fn(ctx, page.mrsdl) 5821 if err != nil { 5822 return err 5823 } 5824 page.mrsdl = next 5825 if !next.hasNextLink() || !next.IsEmpty() { 5826 break 5827 } 5828 } 5829 return nil 5830} 5831 5832// Next advances to the next page of values. If there was an error making 5833// the request the page does not advance and the error is returned. 5834// Deprecated: Use NextWithContext() instead. 5835func (page *ManagedRuleSetDefinitionListPage) Next() error { 5836 return page.NextWithContext(context.Background()) 5837} 5838 5839// NotDone returns true if the page enumeration should be started or is not yet complete. 5840func (page ManagedRuleSetDefinitionListPage) NotDone() bool { 5841 return !page.mrsdl.IsEmpty() 5842} 5843 5844// Response returns the raw server response from the last page request. 5845func (page ManagedRuleSetDefinitionListPage) Response() ManagedRuleSetDefinitionList { 5846 return page.mrsdl 5847} 5848 5849// Values returns the slice of values for the current page or nil if there are no values. 5850func (page ManagedRuleSetDefinitionListPage) Values() []ManagedRuleSetDefinition { 5851 if page.mrsdl.IsEmpty() { 5852 return nil 5853 } 5854 return *page.mrsdl.Value 5855} 5856 5857// Creates a new instance of the ManagedRuleSetDefinitionListPage type. 5858func NewManagedRuleSetDefinitionListPage(cur ManagedRuleSetDefinitionList, getNextPage func(context.Context, ManagedRuleSetDefinitionList) (ManagedRuleSetDefinitionList, error)) ManagedRuleSetDefinitionListPage { 5859 return ManagedRuleSetDefinitionListPage{ 5860 fn: getNextPage, 5861 mrsdl: cur, 5862 } 5863} 5864 5865// ManagedRuleSetDefinitionProperties properties for a managed rule set definition. 5866type ManagedRuleSetDefinitionProperties struct { 5867 // ProvisioningState - READ-ONLY; Provisioning state of the managed rule set. 5868 ProvisioningState *string `json:"provisioningState,omitempty"` 5869 // RuleSetType - READ-ONLY; Type of the managed rule set. 5870 RuleSetType *string `json:"ruleSetType,omitempty"` 5871 // RuleSetVersion - READ-ONLY; Version of the managed rule set type. 5872 RuleSetVersion *string `json:"ruleSetVersion,omitempty"` 5873 // RuleGroups - READ-ONLY; Rule groups of the managed rule set. 5874 RuleGroups *[]ManagedRuleGroupDefinition `json:"ruleGroups,omitempty"` 5875} 5876 5877// ManagedRuleSetList defines the list of managed rule sets for the policy. 5878type ManagedRuleSetList struct { 5879 // ManagedRuleSets - List of rule sets. 5880 ManagedRuleSets *[]ManagedRuleSet `json:"managedRuleSets,omitempty"` 5881} 5882 5883// MatchCondition define match conditions 5884type MatchCondition struct { 5885 // MatchVariable - Match variable to compare against. Possible values include: 'RemoteAddr', 'SocketAddr', 'RequestMethod', 'RequestHeader', 'RequestURI', 'QueryString', 'RequestBody', 'Cookies', 'PostArgs' 5886 MatchVariable MatchVariable `json:"matchVariable,omitempty"` 5887 // Selector - Selector can used to match a specific key for QueryString, Cookies, RequestHeader or PostArgs. 5888 Selector *string `json:"selector,omitempty"` 5889 // Operator - Describes operator to be matched. Possible values include: 'OperatorAny', 'OperatorIPMatch', 'OperatorGeoMatch', 'OperatorEqual', 'OperatorContains', 'OperatorLessThan', 'OperatorGreaterThan', 'OperatorLessThanOrEqual', 'OperatorGreaterThanOrEqual', 'OperatorBeginsWith', 'OperatorEndsWith', 'OperatorRegEx' 5890 Operator Operator `json:"operator,omitempty"` 5891 // NegateCondition - Describes if the result of this condition should be negated. 5892 NegateCondition *bool `json:"negateCondition,omitempty"` 5893 // MatchValue - List of possible match values. 5894 MatchValue *[]string `json:"matchValue,omitempty"` 5895 // Transforms - List of transforms. 5896 Transforms *[]TransformType `json:"transforms,omitempty"` 5897} 5898 5899// MetricsResponse metrics Response 5900type MetricsResponse struct { 5901 autorest.Response `json:"-"` 5902 DateTimeBegin *date.Time `json:"dateTimeBegin,omitempty"` 5903 DateTimeEnd *date.Time `json:"dateTimeEnd,omitempty"` 5904 // Granularity - Possible values include: 'PT5M', 'PT1H', 'P1D' 5905 Granularity Granularity `json:"granularity,omitempty"` 5906 Series *[]MetricsResponseSeriesItem `json:"series,omitempty"` 5907} 5908 5909// MetricsResponseSeriesItem ... 5910type MetricsResponseSeriesItem struct { 5911 Metric *string `json:"metric,omitempty"` 5912 // Unit - Possible values include: 'Count', 'Bytes', 'BitsPerSecond' 5913 Unit Unit `json:"unit,omitempty"` 5914 Groups *[]MetricsResponseSeriesItemGroupsItem `json:"groups,omitempty"` 5915 Data *[]MetricsResponseSeriesItemDataItem `json:"data,omitempty"` 5916} 5917 5918// MetricsResponseSeriesItemDataItem ... 5919type MetricsResponseSeriesItemDataItem struct { 5920 DateTime *date.Time `json:"dateTime,omitempty"` 5921 Value *float64 `json:"value,omitempty"` 5922} 5923 5924// MetricsResponseSeriesItemGroupsItem ... 5925type MetricsResponseSeriesItemGroupsItem struct { 5926 Name *string `json:"name,omitempty"` 5927 Value *string `json:"value,omitempty"` 5928} 5929 5930// Operation CDN REST API operation 5931type Operation struct { 5932 // Name - READ-ONLY; Operation name: {provider}/{resource}/{operation} 5933 Name *string `json:"name,omitempty"` 5934 // Display - The object that represents the operation. 5935 Display *OperationDisplay `json:"display,omitempty"` 5936} 5937 5938// MarshalJSON is the custom marshaler for Operation. 5939func (o Operation) MarshalJSON() ([]byte, error) { 5940 objectMap := make(map[string]interface{}) 5941 if o.Display != nil { 5942 objectMap["display"] = o.Display 5943 } 5944 return json.Marshal(objectMap) 5945} 5946 5947// OperationDisplay the object that represents the operation. 5948type OperationDisplay struct { 5949 // Provider - READ-ONLY; Service provider: Microsoft.Cdn 5950 Provider *string `json:"provider,omitempty"` 5951 // Resource - READ-ONLY; Resource on which the operation is performed: Profile, endpoint, etc. 5952 Resource *string `json:"resource,omitempty"` 5953 // Operation - READ-ONLY; Operation type: Read, write, delete, etc. 5954 Operation *string `json:"operation,omitempty"` 5955} 5956 5957// OperationsListResult result of the request to list CDN operations. It contains a list of operations and 5958// a URL link to get the next set of results. 5959type OperationsListResult struct { 5960 autorest.Response `json:"-"` 5961 // Value - READ-ONLY; List of CDN operations supported by the CDN resource provider. 5962 Value *[]Operation `json:"value,omitempty"` 5963 // NextLink - URL to get the next set of operation list results if there are any. 5964 NextLink *string `json:"nextLink,omitempty"` 5965} 5966 5967// MarshalJSON is the custom marshaler for OperationsListResult. 5968func (olr OperationsListResult) MarshalJSON() ([]byte, error) { 5969 objectMap := make(map[string]interface{}) 5970 if olr.NextLink != nil { 5971 objectMap["nextLink"] = olr.NextLink 5972 } 5973 return json.Marshal(objectMap) 5974} 5975 5976// OperationsListResultIterator provides access to a complete listing of Operation values. 5977type OperationsListResultIterator struct { 5978 i int 5979 page OperationsListResultPage 5980} 5981 5982// NextWithContext advances to the next value. If there was an error making 5983// the request the iterator does not advance and the error is returned. 5984func (iter *OperationsListResultIterator) NextWithContext(ctx context.Context) (err error) { 5985 if tracing.IsEnabled() { 5986 ctx = tracing.StartSpan(ctx, fqdn+"/OperationsListResultIterator.NextWithContext") 5987 defer func() { 5988 sc := -1 5989 if iter.Response().Response.Response != nil { 5990 sc = iter.Response().Response.Response.StatusCode 5991 } 5992 tracing.EndSpan(ctx, sc, err) 5993 }() 5994 } 5995 iter.i++ 5996 if iter.i < len(iter.page.Values()) { 5997 return nil 5998 } 5999 err = iter.page.NextWithContext(ctx) 6000 if err != nil { 6001 iter.i-- 6002 return err 6003 } 6004 iter.i = 0 6005 return nil 6006} 6007 6008// Next advances to the next value. If there was an error making 6009// the request the iterator does not advance and the error is returned. 6010// Deprecated: Use NextWithContext() instead. 6011func (iter *OperationsListResultIterator) Next() error { 6012 return iter.NextWithContext(context.Background()) 6013} 6014 6015// NotDone returns true if the enumeration should be started or is not yet complete. 6016func (iter OperationsListResultIterator) NotDone() bool { 6017 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 6018} 6019 6020// Response returns the raw server response from the last page request. 6021func (iter OperationsListResultIterator) Response() OperationsListResult { 6022 return iter.page.Response() 6023} 6024 6025// Value returns the current value or a zero-initialized value if the 6026// iterator has advanced beyond the end of the collection. 6027func (iter OperationsListResultIterator) Value() Operation { 6028 if !iter.page.NotDone() { 6029 return Operation{} 6030 } 6031 return iter.page.Values()[iter.i] 6032} 6033 6034// Creates a new instance of the OperationsListResultIterator type. 6035func NewOperationsListResultIterator(page OperationsListResultPage) OperationsListResultIterator { 6036 return OperationsListResultIterator{page: page} 6037} 6038 6039// IsEmpty returns true if the ListResult contains no values. 6040func (olr OperationsListResult) IsEmpty() bool { 6041 return olr.Value == nil || len(*olr.Value) == 0 6042} 6043 6044// hasNextLink returns true if the NextLink is not empty. 6045func (olr OperationsListResult) hasNextLink() bool { 6046 return olr.NextLink != nil && len(*olr.NextLink) != 0 6047} 6048 6049// operationsListResultPreparer prepares a request to retrieve the next set of results. 6050// It returns nil if no more results exist. 6051func (olr OperationsListResult) operationsListResultPreparer(ctx context.Context) (*http.Request, error) { 6052 if !olr.hasNextLink() { 6053 return nil, nil 6054 } 6055 return autorest.Prepare((&http.Request{}).WithContext(ctx), 6056 autorest.AsJSON(), 6057 autorest.AsGet(), 6058 autorest.WithBaseURL(to.String(olr.NextLink))) 6059} 6060 6061// OperationsListResultPage contains a page of Operation values. 6062type OperationsListResultPage struct { 6063 fn func(context.Context, OperationsListResult) (OperationsListResult, error) 6064 olr OperationsListResult 6065} 6066 6067// NextWithContext advances to the next page of values. If there was an error making 6068// the request the page does not advance and the error is returned. 6069func (page *OperationsListResultPage) NextWithContext(ctx context.Context) (err error) { 6070 if tracing.IsEnabled() { 6071 ctx = tracing.StartSpan(ctx, fqdn+"/OperationsListResultPage.NextWithContext") 6072 defer func() { 6073 sc := -1 6074 if page.Response().Response.Response != nil { 6075 sc = page.Response().Response.Response.StatusCode 6076 } 6077 tracing.EndSpan(ctx, sc, err) 6078 }() 6079 } 6080 for { 6081 next, err := page.fn(ctx, page.olr) 6082 if err != nil { 6083 return err 6084 } 6085 page.olr = next 6086 if !next.hasNextLink() || !next.IsEmpty() { 6087 break 6088 } 6089 } 6090 return nil 6091} 6092 6093// Next advances to the next page of values. If there was an error making 6094// the request the page does not advance and the error is returned. 6095// Deprecated: Use NextWithContext() instead. 6096func (page *OperationsListResultPage) Next() error { 6097 return page.NextWithContext(context.Background()) 6098} 6099 6100// NotDone returns true if the page enumeration should be started or is not yet complete. 6101func (page OperationsListResultPage) NotDone() bool { 6102 return !page.olr.IsEmpty() 6103} 6104 6105// Response returns the raw server response from the last page request. 6106func (page OperationsListResultPage) Response() OperationsListResult { 6107 return page.olr 6108} 6109 6110// Values returns the slice of values for the current page or nil if there are no values. 6111func (page OperationsListResultPage) Values() []Operation { 6112 if page.olr.IsEmpty() { 6113 return nil 6114 } 6115 return *page.olr.Value 6116} 6117 6118// Creates a new instance of the OperationsListResultPage type. 6119func NewOperationsListResultPage(cur OperationsListResult, getNextPage func(context.Context, OperationsListResult) (OperationsListResult, error)) OperationsListResultPage { 6120 return OperationsListResultPage{ 6121 fn: getNextPage, 6122 olr: cur, 6123 } 6124} 6125 6126// Origin CDN origin is the source of the content being delivered via CDN. When the edge nodes represented 6127// by an endpoint do not have the requested content cached, they attempt to fetch it from one or more of 6128// the configured origins. 6129type Origin struct { 6130 autorest.Response `json:"-"` 6131 *OriginProperties `json:"properties,omitempty"` 6132 // SystemData - READ-ONLY 6133 SystemData *SystemData `json:"systemData,omitempty"` 6134 // ID - READ-ONLY; Resource ID. 6135 ID *string `json:"id,omitempty"` 6136 // Name - READ-ONLY; Resource name. 6137 Name *string `json:"name,omitempty"` 6138 // Type - READ-ONLY; Resource type. 6139 Type *string `json:"type,omitempty"` 6140} 6141 6142// MarshalJSON is the custom marshaler for Origin. 6143func (o Origin) MarshalJSON() ([]byte, error) { 6144 objectMap := make(map[string]interface{}) 6145 if o.OriginProperties != nil { 6146 objectMap["properties"] = o.OriginProperties 6147 } 6148 return json.Marshal(objectMap) 6149} 6150 6151// UnmarshalJSON is the custom unmarshaler for Origin struct. 6152func (o *Origin) UnmarshalJSON(body []byte) error { 6153 var m map[string]*json.RawMessage 6154 err := json.Unmarshal(body, &m) 6155 if err != nil { 6156 return err 6157 } 6158 for k, v := range m { 6159 switch k { 6160 case "properties": 6161 if v != nil { 6162 var originProperties OriginProperties 6163 err = json.Unmarshal(*v, &originProperties) 6164 if err != nil { 6165 return err 6166 } 6167 o.OriginProperties = &originProperties 6168 } 6169 case "systemData": 6170 if v != nil { 6171 var systemData SystemData 6172 err = json.Unmarshal(*v, &systemData) 6173 if err != nil { 6174 return err 6175 } 6176 o.SystemData = &systemData 6177 } 6178 case "id": 6179 if v != nil { 6180 var ID string 6181 err = json.Unmarshal(*v, &ID) 6182 if err != nil { 6183 return err 6184 } 6185 o.ID = &ID 6186 } 6187 case "name": 6188 if v != nil { 6189 var name string 6190 err = json.Unmarshal(*v, &name) 6191 if err != nil { 6192 return err 6193 } 6194 o.Name = &name 6195 } 6196 case "type": 6197 if v != nil { 6198 var typeVar string 6199 err = json.Unmarshal(*v, &typeVar) 6200 if err != nil { 6201 return err 6202 } 6203 o.Type = &typeVar 6204 } 6205 } 6206 } 6207 6208 return nil 6209} 6210 6211// OriginGroup origin group comprising of origins is used for load balancing to origins when the content 6212// cannot be served from CDN. 6213type OriginGroup struct { 6214 autorest.Response `json:"-"` 6215 *OriginGroupProperties `json:"properties,omitempty"` 6216 // SystemData - READ-ONLY 6217 SystemData *SystemData `json:"systemData,omitempty"` 6218 // ID - READ-ONLY; Resource ID. 6219 ID *string `json:"id,omitempty"` 6220 // Name - READ-ONLY; Resource name. 6221 Name *string `json:"name,omitempty"` 6222 // Type - READ-ONLY; Resource type. 6223 Type *string `json:"type,omitempty"` 6224} 6225 6226// MarshalJSON is the custom marshaler for OriginGroup. 6227func (og OriginGroup) MarshalJSON() ([]byte, error) { 6228 objectMap := make(map[string]interface{}) 6229 if og.OriginGroupProperties != nil { 6230 objectMap["properties"] = og.OriginGroupProperties 6231 } 6232 return json.Marshal(objectMap) 6233} 6234 6235// UnmarshalJSON is the custom unmarshaler for OriginGroup struct. 6236func (og *OriginGroup) UnmarshalJSON(body []byte) error { 6237 var m map[string]*json.RawMessage 6238 err := json.Unmarshal(body, &m) 6239 if err != nil { 6240 return err 6241 } 6242 for k, v := range m { 6243 switch k { 6244 case "properties": 6245 if v != nil { 6246 var originGroupProperties OriginGroupProperties 6247 err = json.Unmarshal(*v, &originGroupProperties) 6248 if err != nil { 6249 return err 6250 } 6251 og.OriginGroupProperties = &originGroupProperties 6252 } 6253 case "systemData": 6254 if v != nil { 6255 var systemData SystemData 6256 err = json.Unmarshal(*v, &systemData) 6257 if err != nil { 6258 return err 6259 } 6260 og.SystemData = &systemData 6261 } 6262 case "id": 6263 if v != nil { 6264 var ID string 6265 err = json.Unmarshal(*v, &ID) 6266 if err != nil { 6267 return err 6268 } 6269 og.ID = &ID 6270 } 6271 case "name": 6272 if v != nil { 6273 var name string 6274 err = json.Unmarshal(*v, &name) 6275 if err != nil { 6276 return err 6277 } 6278 og.Name = &name 6279 } 6280 case "type": 6281 if v != nil { 6282 var typeVar string 6283 err = json.Unmarshal(*v, &typeVar) 6284 if err != nil { 6285 return err 6286 } 6287 og.Type = &typeVar 6288 } 6289 } 6290 } 6291 6292 return nil 6293} 6294 6295// OriginGroupListResult result of the request to list origin groups. It contains a list of origin groups 6296// objects and a URL link to get the next set of results. 6297type OriginGroupListResult struct { 6298 autorest.Response `json:"-"` 6299 // Value - READ-ONLY; List of CDN origin groups within an endpoint 6300 Value *[]OriginGroup `json:"value,omitempty"` 6301 // NextLink - URL to get the next set of origin objects if there are any. 6302 NextLink *string `json:"nextLink,omitempty"` 6303} 6304 6305// MarshalJSON is the custom marshaler for OriginGroupListResult. 6306func (oglr OriginGroupListResult) MarshalJSON() ([]byte, error) { 6307 objectMap := make(map[string]interface{}) 6308 if oglr.NextLink != nil { 6309 objectMap["nextLink"] = oglr.NextLink 6310 } 6311 return json.Marshal(objectMap) 6312} 6313 6314// OriginGroupListResultIterator provides access to a complete listing of OriginGroup values. 6315type OriginGroupListResultIterator struct { 6316 i int 6317 page OriginGroupListResultPage 6318} 6319 6320// NextWithContext advances to the next value. If there was an error making 6321// the request the iterator does not advance and the error is returned. 6322func (iter *OriginGroupListResultIterator) NextWithContext(ctx context.Context) (err error) { 6323 if tracing.IsEnabled() { 6324 ctx = tracing.StartSpan(ctx, fqdn+"/OriginGroupListResultIterator.NextWithContext") 6325 defer func() { 6326 sc := -1 6327 if iter.Response().Response.Response != nil { 6328 sc = iter.Response().Response.Response.StatusCode 6329 } 6330 tracing.EndSpan(ctx, sc, err) 6331 }() 6332 } 6333 iter.i++ 6334 if iter.i < len(iter.page.Values()) { 6335 return nil 6336 } 6337 err = iter.page.NextWithContext(ctx) 6338 if err != nil { 6339 iter.i-- 6340 return err 6341 } 6342 iter.i = 0 6343 return nil 6344} 6345 6346// Next advances to the next value. If there was an error making 6347// the request the iterator does not advance and the error is returned. 6348// Deprecated: Use NextWithContext() instead. 6349func (iter *OriginGroupListResultIterator) Next() error { 6350 return iter.NextWithContext(context.Background()) 6351} 6352 6353// NotDone returns true if the enumeration should be started or is not yet complete. 6354func (iter OriginGroupListResultIterator) NotDone() bool { 6355 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 6356} 6357 6358// Response returns the raw server response from the last page request. 6359func (iter OriginGroupListResultIterator) Response() OriginGroupListResult { 6360 return iter.page.Response() 6361} 6362 6363// Value returns the current value or a zero-initialized value if the 6364// iterator has advanced beyond the end of the collection. 6365func (iter OriginGroupListResultIterator) Value() OriginGroup { 6366 if !iter.page.NotDone() { 6367 return OriginGroup{} 6368 } 6369 return iter.page.Values()[iter.i] 6370} 6371 6372// Creates a new instance of the OriginGroupListResultIterator type. 6373func NewOriginGroupListResultIterator(page OriginGroupListResultPage) OriginGroupListResultIterator { 6374 return OriginGroupListResultIterator{page: page} 6375} 6376 6377// IsEmpty returns true if the ListResult contains no values. 6378func (oglr OriginGroupListResult) IsEmpty() bool { 6379 return oglr.Value == nil || len(*oglr.Value) == 0 6380} 6381 6382// hasNextLink returns true if the NextLink is not empty. 6383func (oglr OriginGroupListResult) hasNextLink() bool { 6384 return oglr.NextLink != nil && len(*oglr.NextLink) != 0 6385} 6386 6387// originGroupListResultPreparer prepares a request to retrieve the next set of results. 6388// It returns nil if no more results exist. 6389func (oglr OriginGroupListResult) originGroupListResultPreparer(ctx context.Context) (*http.Request, error) { 6390 if !oglr.hasNextLink() { 6391 return nil, nil 6392 } 6393 return autorest.Prepare((&http.Request{}).WithContext(ctx), 6394 autorest.AsJSON(), 6395 autorest.AsGet(), 6396 autorest.WithBaseURL(to.String(oglr.NextLink))) 6397} 6398 6399// OriginGroupListResultPage contains a page of OriginGroup values. 6400type OriginGroupListResultPage struct { 6401 fn func(context.Context, OriginGroupListResult) (OriginGroupListResult, error) 6402 oglr OriginGroupListResult 6403} 6404 6405// NextWithContext advances to the next page of values. If there was an error making 6406// the request the page does not advance and the error is returned. 6407func (page *OriginGroupListResultPage) NextWithContext(ctx context.Context) (err error) { 6408 if tracing.IsEnabled() { 6409 ctx = tracing.StartSpan(ctx, fqdn+"/OriginGroupListResultPage.NextWithContext") 6410 defer func() { 6411 sc := -1 6412 if page.Response().Response.Response != nil { 6413 sc = page.Response().Response.Response.StatusCode 6414 } 6415 tracing.EndSpan(ctx, sc, err) 6416 }() 6417 } 6418 for { 6419 next, err := page.fn(ctx, page.oglr) 6420 if err != nil { 6421 return err 6422 } 6423 page.oglr = next 6424 if !next.hasNextLink() || !next.IsEmpty() { 6425 break 6426 } 6427 } 6428 return nil 6429} 6430 6431// Next advances to the next page of values. If there was an error making 6432// the request the page does not advance and the error is returned. 6433// Deprecated: Use NextWithContext() instead. 6434func (page *OriginGroupListResultPage) Next() error { 6435 return page.NextWithContext(context.Background()) 6436} 6437 6438// NotDone returns true if the page enumeration should be started or is not yet complete. 6439func (page OriginGroupListResultPage) NotDone() bool { 6440 return !page.oglr.IsEmpty() 6441} 6442 6443// Response returns the raw server response from the last page request. 6444func (page OriginGroupListResultPage) Response() OriginGroupListResult { 6445 return page.oglr 6446} 6447 6448// Values returns the slice of values for the current page or nil if there are no values. 6449func (page OriginGroupListResultPage) Values() []OriginGroup { 6450 if page.oglr.IsEmpty() { 6451 return nil 6452 } 6453 return *page.oglr.Value 6454} 6455 6456// Creates a new instance of the OriginGroupListResultPage type. 6457func NewOriginGroupListResultPage(cur OriginGroupListResult, getNextPage func(context.Context, OriginGroupListResult) (OriginGroupListResult, error)) OriginGroupListResultPage { 6458 return OriginGroupListResultPage{ 6459 fn: getNextPage, 6460 oglr: cur, 6461 } 6462} 6463 6464// OriginGroupOverrideAction defines the origin group override action for the delivery rule. 6465type OriginGroupOverrideAction struct { 6466 // Parameters - Defines the parameters for the action. 6467 Parameters *OriginGroupOverrideActionParameters `json:"parameters,omitempty"` 6468 // Name - Possible values include: 'NameDeliveryRuleAction', 'NameURLRedirect', 'NameURLSigning', 'NameOriginGroupOverride', 'NameURLRewrite', 'NameModifyRequestHeader', 'NameModifyResponseHeader', 'NameCacheExpiration', 'NameCacheKeyQueryString' 6469 Name NameBasicDeliveryRuleAction `json:"name,omitempty"` 6470} 6471 6472// MarshalJSON is the custom marshaler for OriginGroupOverrideAction. 6473func (ogoa OriginGroupOverrideAction) MarshalJSON() ([]byte, error) { 6474 ogoa.Name = NameOriginGroupOverride 6475 objectMap := make(map[string]interface{}) 6476 if ogoa.Parameters != nil { 6477 objectMap["parameters"] = ogoa.Parameters 6478 } 6479 if ogoa.Name != "" { 6480 objectMap["name"] = ogoa.Name 6481 } 6482 return json.Marshal(objectMap) 6483} 6484 6485// AsURLRedirectAction is the BasicDeliveryRuleAction implementation for OriginGroupOverrideAction. 6486func (ogoa OriginGroupOverrideAction) AsURLRedirectAction() (*URLRedirectAction, bool) { 6487 return nil, false 6488} 6489 6490// AsURLSigningAction is the BasicDeliveryRuleAction implementation for OriginGroupOverrideAction. 6491func (ogoa OriginGroupOverrideAction) AsURLSigningAction() (*URLSigningAction, bool) { 6492 return nil, false 6493} 6494 6495// AsOriginGroupOverrideAction is the BasicDeliveryRuleAction implementation for OriginGroupOverrideAction. 6496func (ogoa OriginGroupOverrideAction) AsOriginGroupOverrideAction() (*OriginGroupOverrideAction, bool) { 6497 return &ogoa, true 6498} 6499 6500// AsURLRewriteAction is the BasicDeliveryRuleAction implementation for OriginGroupOverrideAction. 6501func (ogoa OriginGroupOverrideAction) AsURLRewriteAction() (*URLRewriteAction, bool) { 6502 return nil, false 6503} 6504 6505// AsDeliveryRuleRequestHeaderAction is the BasicDeliveryRuleAction implementation for OriginGroupOverrideAction. 6506func (ogoa OriginGroupOverrideAction) AsDeliveryRuleRequestHeaderAction() (*DeliveryRuleRequestHeaderAction, bool) { 6507 return nil, false 6508} 6509 6510// AsDeliveryRuleResponseHeaderAction is the BasicDeliveryRuleAction implementation for OriginGroupOverrideAction. 6511func (ogoa OriginGroupOverrideAction) AsDeliveryRuleResponseHeaderAction() (*DeliveryRuleResponseHeaderAction, bool) { 6512 return nil, false 6513} 6514 6515// AsDeliveryRuleCacheExpirationAction is the BasicDeliveryRuleAction implementation for OriginGroupOverrideAction. 6516func (ogoa OriginGroupOverrideAction) AsDeliveryRuleCacheExpirationAction() (*DeliveryRuleCacheExpirationAction, bool) { 6517 return nil, false 6518} 6519 6520// AsDeliveryRuleCacheKeyQueryStringAction is the BasicDeliveryRuleAction implementation for OriginGroupOverrideAction. 6521func (ogoa OriginGroupOverrideAction) AsDeliveryRuleCacheKeyQueryStringAction() (*DeliveryRuleCacheKeyQueryStringAction, bool) { 6522 return nil, false 6523} 6524 6525// AsDeliveryRuleAction is the BasicDeliveryRuleAction implementation for OriginGroupOverrideAction. 6526func (ogoa OriginGroupOverrideAction) AsDeliveryRuleAction() (*DeliveryRuleAction, bool) { 6527 return nil, false 6528} 6529 6530// AsBasicDeliveryRuleAction is the BasicDeliveryRuleAction implementation for OriginGroupOverrideAction. 6531func (ogoa OriginGroupOverrideAction) AsBasicDeliveryRuleAction() (BasicDeliveryRuleAction, bool) { 6532 return &ogoa, true 6533} 6534 6535// OriginGroupOverrideActionParameters defines the parameters for the origin group override action. 6536type OriginGroupOverrideActionParameters struct { 6537 OdataType *string `json:"@odata.type,omitempty"` 6538 // OriginGroup - defines the OriginGroup that would override the DefaultOriginGroup. 6539 OriginGroup *ResourceReference `json:"originGroup,omitempty"` 6540} 6541 6542// OriginGroupProperties the JSON object that contains the properties of the origin group. 6543type OriginGroupProperties struct { 6544 // ResourceState - READ-ONLY; Resource status of the origin group. Possible values include: 'OriginGroupResourceStateCreating', 'OriginGroupResourceStateActive', 'OriginGroupResourceStateDeleting' 6545 ResourceState OriginGroupResourceState `json:"resourceState,omitempty"` 6546 // ProvisioningState - READ-ONLY; Provisioning status of the origin group. 6547 ProvisioningState *string `json:"provisioningState,omitempty"` 6548 // HealthProbeSettings - Health probe settings to the origin that is used to determine the health of the origin. 6549 HealthProbeSettings *HealthProbeParameters `json:"healthProbeSettings,omitempty"` 6550 // Origins - The source of the content being delivered via CDN within given origin group. 6551 Origins *[]ResourceReference `json:"origins,omitempty"` 6552 // TrafficRestorationTimeToHealedOrNewEndpointsInMinutes - Time in minutes to shift the traffic to the endpoint gradually when an unhealthy endpoint comes healthy or a new endpoint is added. Default is 10 mins. This property is currently not supported. 6553 TrafficRestorationTimeToHealedOrNewEndpointsInMinutes *int32 `json:"trafficRestorationTimeToHealedOrNewEndpointsInMinutes,omitempty"` 6554 // ResponseBasedOriginErrorDetectionSettings - The JSON object that contains the properties to determine origin health using real requests/responses. This property is currently not supported. 6555 ResponseBasedOriginErrorDetectionSettings *ResponseBasedOriginErrorDetectionParameters `json:"responseBasedOriginErrorDetectionSettings,omitempty"` 6556} 6557 6558// MarshalJSON is the custom marshaler for OriginGroupProperties. 6559func (ogp OriginGroupProperties) MarshalJSON() ([]byte, error) { 6560 objectMap := make(map[string]interface{}) 6561 if ogp.HealthProbeSettings != nil { 6562 objectMap["healthProbeSettings"] = ogp.HealthProbeSettings 6563 } 6564 if ogp.Origins != nil { 6565 objectMap["origins"] = ogp.Origins 6566 } 6567 if ogp.TrafficRestorationTimeToHealedOrNewEndpointsInMinutes != nil { 6568 objectMap["trafficRestorationTimeToHealedOrNewEndpointsInMinutes"] = ogp.TrafficRestorationTimeToHealedOrNewEndpointsInMinutes 6569 } 6570 if ogp.ResponseBasedOriginErrorDetectionSettings != nil { 6571 objectMap["responseBasedOriginErrorDetectionSettings"] = ogp.ResponseBasedOriginErrorDetectionSettings 6572 } 6573 return json.Marshal(objectMap) 6574} 6575 6576// OriginGroupsCreateFuture an abstraction for monitoring and retrieving the results of a long-running 6577// operation. 6578type OriginGroupsCreateFuture struct { 6579 azure.FutureAPI 6580 // Result returns the result of the asynchronous operation. 6581 // If the operation has not completed it will return an error. 6582 Result func(OriginGroupsClient) (OriginGroup, error) 6583} 6584 6585// OriginGroupsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running 6586// operation. 6587type OriginGroupsDeleteFuture struct { 6588 azure.FutureAPI 6589 // Result returns the result of the asynchronous operation. 6590 // If the operation has not completed it will return an error. 6591 Result func(OriginGroupsClient) (autorest.Response, error) 6592} 6593 6594// OriginGroupsUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 6595// operation. 6596type OriginGroupsUpdateFuture struct { 6597 azure.FutureAPI 6598 // Result returns the result of the asynchronous operation. 6599 // If the operation has not completed it will return an error. 6600 Result func(OriginGroupsClient) (OriginGroup, error) 6601} 6602 6603// OriginGroupUpdateParameters origin group properties needed for origin group creation or update. 6604type OriginGroupUpdateParameters struct { 6605 *OriginGroupUpdatePropertiesParameters `json:"properties,omitempty"` 6606} 6607 6608// MarshalJSON is the custom marshaler for OriginGroupUpdateParameters. 6609func (ogup OriginGroupUpdateParameters) MarshalJSON() ([]byte, error) { 6610 objectMap := make(map[string]interface{}) 6611 if ogup.OriginGroupUpdatePropertiesParameters != nil { 6612 objectMap["properties"] = ogup.OriginGroupUpdatePropertiesParameters 6613 } 6614 return json.Marshal(objectMap) 6615} 6616 6617// UnmarshalJSON is the custom unmarshaler for OriginGroupUpdateParameters struct. 6618func (ogup *OriginGroupUpdateParameters) UnmarshalJSON(body []byte) error { 6619 var m map[string]*json.RawMessage 6620 err := json.Unmarshal(body, &m) 6621 if err != nil { 6622 return err 6623 } 6624 for k, v := range m { 6625 switch k { 6626 case "properties": 6627 if v != nil { 6628 var originGroupUpdatePropertiesParameters OriginGroupUpdatePropertiesParameters 6629 err = json.Unmarshal(*v, &originGroupUpdatePropertiesParameters) 6630 if err != nil { 6631 return err 6632 } 6633 ogup.OriginGroupUpdatePropertiesParameters = &originGroupUpdatePropertiesParameters 6634 } 6635 } 6636 } 6637 6638 return nil 6639} 6640 6641// OriginGroupUpdatePropertiesParameters the JSON object that contains the properties of the origin group. 6642type OriginGroupUpdatePropertiesParameters struct { 6643 // HealthProbeSettings - Health probe settings to the origin that is used to determine the health of the origin. 6644 HealthProbeSettings *HealthProbeParameters `json:"healthProbeSettings,omitempty"` 6645 // Origins - The source of the content being delivered via CDN within given origin group. 6646 Origins *[]ResourceReference `json:"origins,omitempty"` 6647 // TrafficRestorationTimeToHealedOrNewEndpointsInMinutes - Time in minutes to shift the traffic to the endpoint gradually when an unhealthy endpoint comes healthy or a new endpoint is added. Default is 10 mins. This property is currently not supported. 6648 TrafficRestorationTimeToHealedOrNewEndpointsInMinutes *int32 `json:"trafficRestorationTimeToHealedOrNewEndpointsInMinutes,omitempty"` 6649 // ResponseBasedOriginErrorDetectionSettings - The JSON object that contains the properties to determine origin health using real requests/responses. This property is currently not supported. 6650 ResponseBasedOriginErrorDetectionSettings *ResponseBasedOriginErrorDetectionParameters `json:"responseBasedOriginErrorDetectionSettings,omitempty"` 6651} 6652 6653// OriginListResult result of the request to list origins. It contains a list of origin objects and a URL 6654// link to get the next set of results. 6655type OriginListResult struct { 6656 autorest.Response `json:"-"` 6657 // Value - READ-ONLY; List of CDN origins within an endpoint 6658 Value *[]Origin `json:"value,omitempty"` 6659 // NextLink - URL to get the next set of origin objects if there are any. 6660 NextLink *string `json:"nextLink,omitempty"` 6661} 6662 6663// MarshalJSON is the custom marshaler for OriginListResult. 6664func (olr OriginListResult) MarshalJSON() ([]byte, error) { 6665 objectMap := make(map[string]interface{}) 6666 if olr.NextLink != nil { 6667 objectMap["nextLink"] = olr.NextLink 6668 } 6669 return json.Marshal(objectMap) 6670} 6671 6672// OriginListResultIterator provides access to a complete listing of Origin values. 6673type OriginListResultIterator struct { 6674 i int 6675 page OriginListResultPage 6676} 6677 6678// NextWithContext advances to the next value. If there was an error making 6679// the request the iterator does not advance and the error is returned. 6680func (iter *OriginListResultIterator) NextWithContext(ctx context.Context) (err error) { 6681 if tracing.IsEnabled() { 6682 ctx = tracing.StartSpan(ctx, fqdn+"/OriginListResultIterator.NextWithContext") 6683 defer func() { 6684 sc := -1 6685 if iter.Response().Response.Response != nil { 6686 sc = iter.Response().Response.Response.StatusCode 6687 } 6688 tracing.EndSpan(ctx, sc, err) 6689 }() 6690 } 6691 iter.i++ 6692 if iter.i < len(iter.page.Values()) { 6693 return nil 6694 } 6695 err = iter.page.NextWithContext(ctx) 6696 if err != nil { 6697 iter.i-- 6698 return err 6699 } 6700 iter.i = 0 6701 return nil 6702} 6703 6704// Next advances to the next value. If there was an error making 6705// the request the iterator does not advance and the error is returned. 6706// Deprecated: Use NextWithContext() instead. 6707func (iter *OriginListResultIterator) Next() error { 6708 return iter.NextWithContext(context.Background()) 6709} 6710 6711// NotDone returns true if the enumeration should be started or is not yet complete. 6712func (iter OriginListResultIterator) NotDone() bool { 6713 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 6714} 6715 6716// Response returns the raw server response from the last page request. 6717func (iter OriginListResultIterator) Response() OriginListResult { 6718 return iter.page.Response() 6719} 6720 6721// Value returns the current value or a zero-initialized value if the 6722// iterator has advanced beyond the end of the collection. 6723func (iter OriginListResultIterator) Value() Origin { 6724 if !iter.page.NotDone() { 6725 return Origin{} 6726 } 6727 return iter.page.Values()[iter.i] 6728} 6729 6730// Creates a new instance of the OriginListResultIterator type. 6731func NewOriginListResultIterator(page OriginListResultPage) OriginListResultIterator { 6732 return OriginListResultIterator{page: page} 6733} 6734 6735// IsEmpty returns true if the ListResult contains no values. 6736func (olr OriginListResult) IsEmpty() bool { 6737 return olr.Value == nil || len(*olr.Value) == 0 6738} 6739 6740// hasNextLink returns true if the NextLink is not empty. 6741func (olr OriginListResult) hasNextLink() bool { 6742 return olr.NextLink != nil && len(*olr.NextLink) != 0 6743} 6744 6745// originListResultPreparer prepares a request to retrieve the next set of results. 6746// It returns nil if no more results exist. 6747func (olr OriginListResult) originListResultPreparer(ctx context.Context) (*http.Request, error) { 6748 if !olr.hasNextLink() { 6749 return nil, nil 6750 } 6751 return autorest.Prepare((&http.Request{}).WithContext(ctx), 6752 autorest.AsJSON(), 6753 autorest.AsGet(), 6754 autorest.WithBaseURL(to.String(olr.NextLink))) 6755} 6756 6757// OriginListResultPage contains a page of Origin values. 6758type OriginListResultPage struct { 6759 fn func(context.Context, OriginListResult) (OriginListResult, error) 6760 olr OriginListResult 6761} 6762 6763// NextWithContext advances to the next page of values. If there was an error making 6764// the request the page does not advance and the error is returned. 6765func (page *OriginListResultPage) NextWithContext(ctx context.Context) (err error) { 6766 if tracing.IsEnabled() { 6767 ctx = tracing.StartSpan(ctx, fqdn+"/OriginListResultPage.NextWithContext") 6768 defer func() { 6769 sc := -1 6770 if page.Response().Response.Response != nil { 6771 sc = page.Response().Response.Response.StatusCode 6772 } 6773 tracing.EndSpan(ctx, sc, err) 6774 }() 6775 } 6776 for { 6777 next, err := page.fn(ctx, page.olr) 6778 if err != nil { 6779 return err 6780 } 6781 page.olr = next 6782 if !next.hasNextLink() || !next.IsEmpty() { 6783 break 6784 } 6785 } 6786 return nil 6787} 6788 6789// Next advances to the next page of values. If there was an error making 6790// the request the page does not advance and the error is returned. 6791// Deprecated: Use NextWithContext() instead. 6792func (page *OriginListResultPage) Next() error { 6793 return page.NextWithContext(context.Background()) 6794} 6795 6796// NotDone returns true if the page enumeration should be started or is not yet complete. 6797func (page OriginListResultPage) NotDone() bool { 6798 return !page.olr.IsEmpty() 6799} 6800 6801// Response returns the raw server response from the last page request. 6802func (page OriginListResultPage) Response() OriginListResult { 6803 return page.olr 6804} 6805 6806// Values returns the slice of values for the current page or nil if there are no values. 6807func (page OriginListResultPage) Values() []Origin { 6808 if page.olr.IsEmpty() { 6809 return nil 6810 } 6811 return *page.olr.Value 6812} 6813 6814// Creates a new instance of the OriginListResultPage type. 6815func NewOriginListResultPage(cur OriginListResult, getNextPage func(context.Context, OriginListResult) (OriginListResult, error)) OriginListResultPage { 6816 return OriginListResultPage{ 6817 fn: getNextPage, 6818 olr: cur, 6819 } 6820} 6821 6822// OriginProperties the JSON object that contains the properties of the origin. 6823type OriginProperties struct { 6824 // ResourceState - READ-ONLY; Resource status of the origin. Possible values include: 'OriginResourceStateCreating', 'OriginResourceStateActive', 'OriginResourceStateDeleting' 6825 ResourceState OriginResourceState `json:"resourceState,omitempty"` 6826 // ProvisioningState - READ-ONLY; Provisioning status of the origin. 6827 ProvisioningState *string `json:"provisioningState,omitempty"` 6828 // PrivateEndpointStatus - READ-ONLY; The approval status for the connection to the Private Link. Possible values include: 'PrivateEndpointStatusPending', 'PrivateEndpointStatusApproved', 'PrivateEndpointStatusRejected', 'PrivateEndpointStatusDisconnected', 'PrivateEndpointStatusTimeout' 6829 PrivateEndpointStatus PrivateEndpointStatus `json:"privateEndpointStatus,omitempty"` 6830 // HostName - The address of the origin. Domain names, IPv4 addresses, and IPv6 addresses are supported.This should be unique across all origins in an endpoint. 6831 HostName *string `json:"hostName,omitempty"` 6832 // HTTPPort - The value of the HTTP port. Must be between 1 and 65535. 6833 HTTPPort *int32 `json:"httpPort,omitempty"` 6834 // HTTPSPort - The value of the HTTPS port. Must be between 1 and 65535. 6835 HTTPSPort *int32 `json:"httpsPort,omitempty"` 6836 // OriginHostHeader - The host header value sent to the origin with each request. If you leave this blank, the request hostname determines this value. Azure CDN origins, such as Web Apps, Blob Storage, and Cloud Services require this host header value to match the origin hostname by default. This overrides the host header defined at Endpoint 6837 OriginHostHeader *string `json:"originHostHeader,omitempty"` 6838 // Priority - Priority of origin in given origin group for load balancing. Higher priorities will not be used for load balancing if any lower priority origin is healthy.Must be between 1 and 5 6839 Priority *int32 `json:"priority,omitempty"` 6840 // Weight - Weight of the origin in given origin group for load balancing. Must be between 1 and 1000 6841 Weight *int32 `json:"weight,omitempty"` 6842 // Enabled - Origin is enabled for load balancing or not 6843 Enabled *bool `json:"enabled,omitempty"` 6844 // PrivateLinkAlias - The Alias of the Private Link resource. Populating this optional field indicates that this origin is 'Private' 6845 PrivateLinkAlias *string `json:"privateLinkAlias,omitempty"` 6846 // PrivateLinkResourceID - The Resource Id of the Private Link resource. Populating this optional field indicates that this backend is 'Private' 6847 PrivateLinkResourceID *string `json:"privateLinkResourceId,omitempty"` 6848 // PrivateLinkLocation - The location of the Private Link resource. Required only if 'privateLinkResourceId' is populated 6849 PrivateLinkLocation *string `json:"privateLinkLocation,omitempty"` 6850 // PrivateLinkApprovalMessage - A custom message to be included in the approval request to connect to the Private Link. 6851 PrivateLinkApprovalMessage *string `json:"privateLinkApprovalMessage,omitempty"` 6852} 6853 6854// MarshalJSON is the custom marshaler for OriginProperties. 6855func (op OriginProperties) MarshalJSON() ([]byte, error) { 6856 objectMap := make(map[string]interface{}) 6857 if op.HostName != nil { 6858 objectMap["hostName"] = op.HostName 6859 } 6860 if op.HTTPPort != nil { 6861 objectMap["httpPort"] = op.HTTPPort 6862 } 6863 if op.HTTPSPort != nil { 6864 objectMap["httpsPort"] = op.HTTPSPort 6865 } 6866 if op.OriginHostHeader != nil { 6867 objectMap["originHostHeader"] = op.OriginHostHeader 6868 } 6869 if op.Priority != nil { 6870 objectMap["priority"] = op.Priority 6871 } 6872 if op.Weight != nil { 6873 objectMap["weight"] = op.Weight 6874 } 6875 if op.Enabled != nil { 6876 objectMap["enabled"] = op.Enabled 6877 } 6878 if op.PrivateLinkAlias != nil { 6879 objectMap["privateLinkAlias"] = op.PrivateLinkAlias 6880 } 6881 if op.PrivateLinkResourceID != nil { 6882 objectMap["privateLinkResourceId"] = op.PrivateLinkResourceID 6883 } 6884 if op.PrivateLinkLocation != nil { 6885 objectMap["privateLinkLocation"] = op.PrivateLinkLocation 6886 } 6887 if op.PrivateLinkApprovalMessage != nil { 6888 objectMap["privateLinkApprovalMessage"] = op.PrivateLinkApprovalMessage 6889 } 6890 return json.Marshal(objectMap) 6891} 6892 6893// OriginsCreateFuture an abstraction for monitoring and retrieving the results of a long-running 6894// operation. 6895type OriginsCreateFuture struct { 6896 azure.FutureAPI 6897 // Result returns the result of the asynchronous operation. 6898 // If the operation has not completed it will return an error. 6899 Result func(OriginsClient) (Origin, error) 6900} 6901 6902// OriginsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running 6903// operation. 6904type OriginsDeleteFuture struct { 6905 azure.FutureAPI 6906 // Result returns the result of the asynchronous operation. 6907 // If the operation has not completed it will return an error. 6908 Result func(OriginsClient) (autorest.Response, error) 6909} 6910 6911// OriginsUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 6912// operation. 6913type OriginsUpdateFuture struct { 6914 azure.FutureAPI 6915 // Result returns the result of the asynchronous operation. 6916 // If the operation has not completed it will return an error. 6917 Result func(OriginsClient) (Origin, error) 6918} 6919 6920// OriginUpdateParameters origin properties needed for origin update. 6921type OriginUpdateParameters struct { 6922 *OriginUpdatePropertiesParameters `json:"properties,omitempty"` 6923} 6924 6925// MarshalJSON is the custom marshaler for OriginUpdateParameters. 6926func (oup OriginUpdateParameters) MarshalJSON() ([]byte, error) { 6927 objectMap := make(map[string]interface{}) 6928 if oup.OriginUpdatePropertiesParameters != nil { 6929 objectMap["properties"] = oup.OriginUpdatePropertiesParameters 6930 } 6931 return json.Marshal(objectMap) 6932} 6933 6934// UnmarshalJSON is the custom unmarshaler for OriginUpdateParameters struct. 6935func (oup *OriginUpdateParameters) UnmarshalJSON(body []byte) error { 6936 var m map[string]*json.RawMessage 6937 err := json.Unmarshal(body, &m) 6938 if err != nil { 6939 return err 6940 } 6941 for k, v := range m { 6942 switch k { 6943 case "properties": 6944 if v != nil { 6945 var originUpdatePropertiesParameters OriginUpdatePropertiesParameters 6946 err = json.Unmarshal(*v, &originUpdatePropertiesParameters) 6947 if err != nil { 6948 return err 6949 } 6950 oup.OriginUpdatePropertiesParameters = &originUpdatePropertiesParameters 6951 } 6952 } 6953 } 6954 6955 return nil 6956} 6957 6958// OriginUpdatePropertiesParameters the JSON object that contains the properties of the origin. 6959type OriginUpdatePropertiesParameters struct { 6960 // HostName - The address of the origin. Domain names, IPv4 addresses, and IPv6 addresses are supported.This should be unique across all origins in an endpoint. 6961 HostName *string `json:"hostName,omitempty"` 6962 // HTTPPort - The value of the HTTP port. Must be between 1 and 65535. 6963 HTTPPort *int32 `json:"httpPort,omitempty"` 6964 // HTTPSPort - The value of the HTTPS port. Must be between 1 and 65535. 6965 HTTPSPort *int32 `json:"httpsPort,omitempty"` 6966 // OriginHostHeader - The host header value sent to the origin with each request. If you leave this blank, the request hostname determines this value. Azure CDN origins, such as Web Apps, Blob Storage, and Cloud Services require this host header value to match the origin hostname by default. This overrides the host header defined at Endpoint 6967 OriginHostHeader *string `json:"originHostHeader,omitempty"` 6968 // Priority - Priority of origin in given origin group for load balancing. Higher priorities will not be used for load balancing if any lower priority origin is healthy.Must be between 1 and 5 6969 Priority *int32 `json:"priority,omitempty"` 6970 // Weight - Weight of the origin in given origin group for load balancing. Must be between 1 and 1000 6971 Weight *int32 `json:"weight,omitempty"` 6972 // Enabled - Origin is enabled for load balancing or not 6973 Enabled *bool `json:"enabled,omitempty"` 6974 // PrivateLinkAlias - The Alias of the Private Link resource. Populating this optional field indicates that this origin is 'Private' 6975 PrivateLinkAlias *string `json:"privateLinkAlias,omitempty"` 6976 // PrivateLinkResourceID - The Resource Id of the Private Link resource. Populating this optional field indicates that this backend is 'Private' 6977 PrivateLinkResourceID *string `json:"privateLinkResourceId,omitempty"` 6978 // PrivateLinkLocation - The location of the Private Link resource. Required only if 'privateLinkResourceId' is populated 6979 PrivateLinkLocation *string `json:"privateLinkLocation,omitempty"` 6980 // PrivateLinkApprovalMessage - A custom message to be included in the approval request to connect to the Private Link. 6981 PrivateLinkApprovalMessage *string `json:"privateLinkApprovalMessage,omitempty"` 6982} 6983 6984// PoliciesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 6985// operation. 6986type PoliciesCreateOrUpdateFuture struct { 6987 azure.FutureAPI 6988 // Result returns the result of the asynchronous operation. 6989 // If the operation has not completed it will return an error. 6990 Result func(PoliciesClient) (WebApplicationFirewallPolicy, error) 6991} 6992 6993// PoliciesUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 6994// operation. 6995type PoliciesUpdateFuture struct { 6996 azure.FutureAPI 6997 // Result returns the result of the asynchronous operation. 6998 // If the operation has not completed it will return an error. 6999 Result func(PoliciesClient) (WebApplicationFirewallPolicy, error) 7000} 7001 7002// PolicySettings defines contents of a web application firewall global configuration 7003type PolicySettings struct { 7004 // EnabledState - describes if the policy is in enabled state or disabled state. Possible values include: 'PolicyEnabledStateDisabled', 'PolicyEnabledStateEnabled' 7005 EnabledState PolicyEnabledState `json:"enabledState,omitempty"` 7006 // Mode - Describes if it is in detection mode or prevention mode at policy level. Possible values include: 'Prevention', 'Detection' 7007 Mode PolicyMode `json:"mode,omitempty"` 7008 // DefaultRedirectURL - If action type is redirect, this field represents the default redirect URL for the client. 7009 DefaultRedirectURL *string `json:"defaultRedirectUrl,omitempty"` 7010 // DefaultCustomBlockResponseStatusCode - If the action type is block, this field defines the default customer overridable http response status code. 7011 DefaultCustomBlockResponseStatusCode *int32 `json:"defaultCustomBlockResponseStatusCode,omitempty"` 7012 // DefaultCustomBlockResponseBody - If the action type is block, customer can override the response body. The body must be specified in base64 encoding. 7013 DefaultCustomBlockResponseBody *string `json:"defaultCustomBlockResponseBody,omitempty"` 7014} 7015 7016// PostArgsMatchConditionParameters defines the parameters for PostArgs match conditions 7017type PostArgsMatchConditionParameters struct { 7018 OdataType *string `json:"@odata.type,omitempty"` 7019 // Selector - Name of PostArg to be matched 7020 Selector *string `json:"selector,omitempty"` 7021 // Operator - Describes operator to be matched. Possible values include: 'PostArgsOperatorAny', 'PostArgsOperatorEqual', 'PostArgsOperatorContains', 'PostArgsOperatorBeginsWith', 'PostArgsOperatorEndsWith', 'PostArgsOperatorLessThan', 'PostArgsOperatorLessThanOrEqual', 'PostArgsOperatorGreaterThan', 'PostArgsOperatorGreaterThanOrEqual', 'PostArgsOperatorRegEx' 7022 Operator PostArgsOperator `json:"operator,omitempty"` 7023 // NegateCondition - Describes if this is negate condition or not 7024 NegateCondition *bool `json:"negateCondition,omitempty"` 7025 // MatchValues - The match value for the condition of the delivery rule 7026 MatchValues *[]string `json:"matchValues,omitempty"` 7027 // Transforms - List of transforms 7028 Transforms *[]Transform `json:"transforms,omitempty"` 7029} 7030 7031// Profile CDN profile is a logical grouping of endpoints that share the same settings, such as CDN 7032// provider and pricing tier. 7033type Profile struct { 7034 autorest.Response `json:"-"` 7035 // Sku - The pricing tier (defines a CDN provider, feature list and rate) of the CDN profile. 7036 Sku *Sku `json:"sku,omitempty"` 7037 *ProfileProperties `json:"properties,omitempty"` 7038 // Location - Resource location. 7039 Location *string `json:"location,omitempty"` 7040 // Tags - Resource tags. 7041 Tags map[string]*string `json:"tags"` 7042 // SystemData - READ-ONLY 7043 SystemData *SystemData `json:"systemData,omitempty"` 7044 // ID - READ-ONLY; Resource ID. 7045 ID *string `json:"id,omitempty"` 7046 // Name - READ-ONLY; Resource name. 7047 Name *string `json:"name,omitempty"` 7048 // Type - READ-ONLY; Resource type. 7049 Type *string `json:"type,omitempty"` 7050} 7051 7052// MarshalJSON is the custom marshaler for Profile. 7053func (p Profile) MarshalJSON() ([]byte, error) { 7054 objectMap := make(map[string]interface{}) 7055 if p.Sku != nil { 7056 objectMap["sku"] = p.Sku 7057 } 7058 if p.ProfileProperties != nil { 7059 objectMap["properties"] = p.ProfileProperties 7060 } 7061 if p.Location != nil { 7062 objectMap["location"] = p.Location 7063 } 7064 if p.Tags != nil { 7065 objectMap["tags"] = p.Tags 7066 } 7067 return json.Marshal(objectMap) 7068} 7069 7070// UnmarshalJSON is the custom unmarshaler for Profile struct. 7071func (p *Profile) UnmarshalJSON(body []byte) error { 7072 var m map[string]*json.RawMessage 7073 err := json.Unmarshal(body, &m) 7074 if err != nil { 7075 return err 7076 } 7077 for k, v := range m { 7078 switch k { 7079 case "sku": 7080 if v != nil { 7081 var sku Sku 7082 err = json.Unmarshal(*v, &sku) 7083 if err != nil { 7084 return err 7085 } 7086 p.Sku = &sku 7087 } 7088 case "properties": 7089 if v != nil { 7090 var profileProperties ProfileProperties 7091 err = json.Unmarshal(*v, &profileProperties) 7092 if err != nil { 7093 return err 7094 } 7095 p.ProfileProperties = &profileProperties 7096 } 7097 case "location": 7098 if v != nil { 7099 var location string 7100 err = json.Unmarshal(*v, &location) 7101 if err != nil { 7102 return err 7103 } 7104 p.Location = &location 7105 } 7106 case "tags": 7107 if v != nil { 7108 var tags map[string]*string 7109 err = json.Unmarshal(*v, &tags) 7110 if err != nil { 7111 return err 7112 } 7113 p.Tags = tags 7114 } 7115 case "systemData": 7116 if v != nil { 7117 var systemData SystemData 7118 err = json.Unmarshal(*v, &systemData) 7119 if err != nil { 7120 return err 7121 } 7122 p.SystemData = &systemData 7123 } 7124 case "id": 7125 if v != nil { 7126 var ID string 7127 err = json.Unmarshal(*v, &ID) 7128 if err != nil { 7129 return err 7130 } 7131 p.ID = &ID 7132 } 7133 case "name": 7134 if v != nil { 7135 var name string 7136 err = json.Unmarshal(*v, &name) 7137 if err != nil { 7138 return err 7139 } 7140 p.Name = &name 7141 } 7142 case "type": 7143 if v != nil { 7144 var typeVar string 7145 err = json.Unmarshal(*v, &typeVar) 7146 if err != nil { 7147 return err 7148 } 7149 p.Type = &typeVar 7150 } 7151 } 7152 } 7153 7154 return nil 7155} 7156 7157// ProfileListResult result of the request to list profiles. It contains a list of profile objects and a 7158// URL link to get the next set of results. 7159type ProfileListResult struct { 7160 autorest.Response `json:"-"` 7161 // Value - READ-ONLY; List of CDN profiles within a resource group. 7162 Value *[]Profile `json:"value,omitempty"` 7163 // NextLink - URL to get the next set of profile objects if there are any. 7164 NextLink *string `json:"nextLink,omitempty"` 7165} 7166 7167// MarshalJSON is the custom marshaler for ProfileListResult. 7168func (plr ProfileListResult) MarshalJSON() ([]byte, error) { 7169 objectMap := make(map[string]interface{}) 7170 if plr.NextLink != nil { 7171 objectMap["nextLink"] = plr.NextLink 7172 } 7173 return json.Marshal(objectMap) 7174} 7175 7176// ProfileListResultIterator provides access to a complete listing of Profile values. 7177type ProfileListResultIterator struct { 7178 i int 7179 page ProfileListResultPage 7180} 7181 7182// NextWithContext advances to the next value. If there was an error making 7183// the request the iterator does not advance and the error is returned. 7184func (iter *ProfileListResultIterator) NextWithContext(ctx context.Context) (err error) { 7185 if tracing.IsEnabled() { 7186 ctx = tracing.StartSpan(ctx, fqdn+"/ProfileListResultIterator.NextWithContext") 7187 defer func() { 7188 sc := -1 7189 if iter.Response().Response.Response != nil { 7190 sc = iter.Response().Response.Response.StatusCode 7191 } 7192 tracing.EndSpan(ctx, sc, err) 7193 }() 7194 } 7195 iter.i++ 7196 if iter.i < len(iter.page.Values()) { 7197 return nil 7198 } 7199 err = iter.page.NextWithContext(ctx) 7200 if err != nil { 7201 iter.i-- 7202 return err 7203 } 7204 iter.i = 0 7205 return nil 7206} 7207 7208// Next advances to the next value. If there was an error making 7209// the request the iterator does not advance and the error is returned. 7210// Deprecated: Use NextWithContext() instead. 7211func (iter *ProfileListResultIterator) Next() error { 7212 return iter.NextWithContext(context.Background()) 7213} 7214 7215// NotDone returns true if the enumeration should be started or is not yet complete. 7216func (iter ProfileListResultIterator) NotDone() bool { 7217 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 7218} 7219 7220// Response returns the raw server response from the last page request. 7221func (iter ProfileListResultIterator) Response() ProfileListResult { 7222 return iter.page.Response() 7223} 7224 7225// Value returns the current value or a zero-initialized value if the 7226// iterator has advanced beyond the end of the collection. 7227func (iter ProfileListResultIterator) Value() Profile { 7228 if !iter.page.NotDone() { 7229 return Profile{} 7230 } 7231 return iter.page.Values()[iter.i] 7232} 7233 7234// Creates a new instance of the ProfileListResultIterator type. 7235func NewProfileListResultIterator(page ProfileListResultPage) ProfileListResultIterator { 7236 return ProfileListResultIterator{page: page} 7237} 7238 7239// IsEmpty returns true if the ListResult contains no values. 7240func (plr ProfileListResult) IsEmpty() bool { 7241 return plr.Value == nil || len(*plr.Value) == 0 7242} 7243 7244// hasNextLink returns true if the NextLink is not empty. 7245func (plr ProfileListResult) hasNextLink() bool { 7246 return plr.NextLink != nil && len(*plr.NextLink) != 0 7247} 7248 7249// profileListResultPreparer prepares a request to retrieve the next set of results. 7250// It returns nil if no more results exist. 7251func (plr ProfileListResult) profileListResultPreparer(ctx context.Context) (*http.Request, error) { 7252 if !plr.hasNextLink() { 7253 return nil, nil 7254 } 7255 return autorest.Prepare((&http.Request{}).WithContext(ctx), 7256 autorest.AsJSON(), 7257 autorest.AsGet(), 7258 autorest.WithBaseURL(to.String(plr.NextLink))) 7259} 7260 7261// ProfileListResultPage contains a page of Profile values. 7262type ProfileListResultPage struct { 7263 fn func(context.Context, ProfileListResult) (ProfileListResult, error) 7264 plr ProfileListResult 7265} 7266 7267// NextWithContext advances to the next page of values. If there was an error making 7268// the request the page does not advance and the error is returned. 7269func (page *ProfileListResultPage) NextWithContext(ctx context.Context) (err error) { 7270 if tracing.IsEnabled() { 7271 ctx = tracing.StartSpan(ctx, fqdn+"/ProfileListResultPage.NextWithContext") 7272 defer func() { 7273 sc := -1 7274 if page.Response().Response.Response != nil { 7275 sc = page.Response().Response.Response.StatusCode 7276 } 7277 tracing.EndSpan(ctx, sc, err) 7278 }() 7279 } 7280 for { 7281 next, err := page.fn(ctx, page.plr) 7282 if err != nil { 7283 return err 7284 } 7285 page.plr = next 7286 if !next.hasNextLink() || !next.IsEmpty() { 7287 break 7288 } 7289 } 7290 return nil 7291} 7292 7293// Next advances to the next page of values. If there was an error making 7294// the request the page does not advance and the error is returned. 7295// Deprecated: Use NextWithContext() instead. 7296func (page *ProfileListResultPage) Next() error { 7297 return page.NextWithContext(context.Background()) 7298} 7299 7300// NotDone returns true if the page enumeration should be started or is not yet complete. 7301func (page ProfileListResultPage) NotDone() bool { 7302 return !page.plr.IsEmpty() 7303} 7304 7305// Response returns the raw server response from the last page request. 7306func (page ProfileListResultPage) Response() ProfileListResult { 7307 return page.plr 7308} 7309 7310// Values returns the slice of values for the current page or nil if there are no values. 7311func (page ProfileListResultPage) Values() []Profile { 7312 if page.plr.IsEmpty() { 7313 return nil 7314 } 7315 return *page.plr.Value 7316} 7317 7318// Creates a new instance of the ProfileListResultPage type. 7319func NewProfileListResultPage(cur ProfileListResult, getNextPage func(context.Context, ProfileListResult) (ProfileListResult, error)) ProfileListResultPage { 7320 return ProfileListResultPage{ 7321 fn: getNextPage, 7322 plr: cur, 7323 } 7324} 7325 7326// ProfileProperties the JSON object that contains the properties required to create a profile. 7327type ProfileProperties struct { 7328 // ResourceState - READ-ONLY; Resource status of the profile. Possible values include: 'ProfileResourceStateCreating', 'ProfileResourceStateActive', 'ProfileResourceStateDeleting', 'ProfileResourceStateDisabled' 7329 ResourceState ProfileResourceState `json:"resourceState,omitempty"` 7330 // ProvisioningState - READ-ONLY; Provisioning status of the profile. 7331 ProvisioningState *string `json:"provisioningState,omitempty"` 7332 // FrontdoorID - READ-ONLY; The Id of the frontdoor. 7333 FrontdoorID *string `json:"frontdoorId,omitempty"` 7334} 7335 7336// ProfilesCreateFuture an abstraction for monitoring and retrieving the results of a long-running 7337// operation. 7338type ProfilesCreateFuture struct { 7339 azure.FutureAPI 7340 // Result returns the result of the asynchronous operation. 7341 // If the operation has not completed it will return an error. 7342 Result func(ProfilesClient) (Profile, error) 7343} 7344 7345// ProfilesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running 7346// operation. 7347type ProfilesDeleteFuture struct { 7348 azure.FutureAPI 7349 // Result returns the result of the asynchronous operation. 7350 // If the operation has not completed it will return an error. 7351 Result func(ProfilesClient) (autorest.Response, error) 7352} 7353 7354// ProfilesUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 7355// operation. 7356type ProfilesUpdateFuture struct { 7357 azure.FutureAPI 7358 // Result returns the result of the asynchronous operation. 7359 // If the operation has not completed it will return an error. 7360 Result func(ProfilesClient) (Profile, error) 7361} 7362 7363// ProfileUpdateParameters properties required to update a profile. 7364type ProfileUpdateParameters struct { 7365 // Tags - Profile tags 7366 Tags map[string]*string `json:"tags"` 7367} 7368 7369// MarshalJSON is the custom marshaler for ProfileUpdateParameters. 7370func (pup ProfileUpdateParameters) MarshalJSON() ([]byte, error) { 7371 objectMap := make(map[string]interface{}) 7372 if pup.Tags != nil { 7373 objectMap["tags"] = pup.Tags 7374 } 7375 return json.Marshal(objectMap) 7376} 7377 7378// ProxyResource the resource model definition for a ARM proxy resource. It will have everything other than 7379// required location and tags 7380type ProxyResource struct { 7381 // SystemData - READ-ONLY 7382 SystemData *SystemData `json:"systemData,omitempty"` 7383 // ID - READ-ONLY; Resource ID. 7384 ID *string `json:"id,omitempty"` 7385 // Name - READ-ONLY; Resource name. 7386 Name *string `json:"name,omitempty"` 7387 // Type - READ-ONLY; Resource type. 7388 Type *string `json:"type,omitempty"` 7389} 7390 7391// PurgeParameters parameters required for content purge. 7392type PurgeParameters struct { 7393 // ContentPaths - The path to the content to be purged. Can describe a file path or a wild card directory. 7394 ContentPaths *[]string `json:"contentPaths,omitempty"` 7395} 7396 7397// QueryStringMatchConditionParameters defines the parameters for QueryString match conditions 7398type QueryStringMatchConditionParameters struct { 7399 OdataType *string `json:"@odata.type,omitempty"` 7400 // Operator - Describes operator to be matched. Possible values include: 'QueryStringOperatorAny', 'QueryStringOperatorEqual', 'QueryStringOperatorContains', 'QueryStringOperatorBeginsWith', 'QueryStringOperatorEndsWith', 'QueryStringOperatorLessThan', 'QueryStringOperatorLessThanOrEqual', 'QueryStringOperatorGreaterThan', 'QueryStringOperatorGreaterThanOrEqual', 'QueryStringOperatorRegEx' 7401 Operator QueryStringOperator `json:"operator,omitempty"` 7402 // NegateCondition - Describes if this is negate condition or not 7403 NegateCondition *bool `json:"negateCondition,omitempty"` 7404 // MatchValues - The match value for the condition of the delivery rule 7405 MatchValues *[]string `json:"matchValues,omitempty"` 7406 // Transforms - List of transforms 7407 Transforms *[]Transform `json:"transforms,omitempty"` 7408} 7409 7410// RankingsResponse rankings Response 7411type RankingsResponse struct { 7412 autorest.Response `json:"-"` 7413 DateTimeBegin *date.Time `json:"dateTimeBegin,omitempty"` 7414 DateTimeEnd *date.Time `json:"dateTimeEnd,omitempty"` 7415 Tables *[]RankingsResponseTablesItem `json:"tables,omitempty"` 7416} 7417 7418// RankingsResponseTablesItem ... 7419type RankingsResponseTablesItem struct { 7420 Ranking *string `json:"ranking,omitempty"` 7421 Data *[]RankingsResponseTablesItemDataItem `json:"data,omitempty"` 7422} 7423 7424// RankingsResponseTablesItemDataItem ... 7425type RankingsResponseTablesItemDataItem struct { 7426 Name *string `json:"name,omitempty"` 7427 Metrics *[]RankingsResponseTablesItemDataItemMetricsItem `json:"metrics,omitempty"` 7428} 7429 7430// RankingsResponseTablesItemDataItemMetricsItem ... 7431type RankingsResponseTablesItemDataItemMetricsItem struct { 7432 Metric *string `json:"metric,omitempty"` 7433 Value *int64 `json:"value,omitempty"` 7434 Percentage *float64 `json:"percentage,omitempty"` 7435} 7436 7437// RateLimitRule defines a rate limiting rule that can be included in a waf policy 7438type RateLimitRule struct { 7439 // RateLimitThreshold - Defines rate limit threshold. 7440 RateLimitThreshold *int32 `json:"rateLimitThreshold,omitempty"` 7441 // RateLimitDurationInMinutes - Defines rate limit duration. Default is 1 minute. 7442 RateLimitDurationInMinutes *int32 `json:"rateLimitDurationInMinutes,omitempty"` 7443 // Name - Defines the name of the custom rule 7444 Name *string `json:"name,omitempty"` 7445 // EnabledState - Describes if the custom rule is in enabled or disabled state. Defaults to Enabled if not specified. Possible values include: 'Disabled', 'Enabled' 7446 EnabledState CustomRuleEnabledState `json:"enabledState,omitempty"` 7447 // Priority - Defines in what order this rule be evaluated in the overall list of custom rules 7448 Priority *int32 `json:"priority,omitempty"` 7449 // MatchConditions - List of match conditions. 7450 MatchConditions *[]MatchCondition `json:"matchConditions,omitempty"` 7451 // Action - Describes what action to be applied when rule matches. Possible values include: 'Allow', 'Block', 'Log', 'Redirect' 7452 Action ActionType `json:"action,omitempty"` 7453} 7454 7455// RateLimitRuleList defines contents of rate limit rules 7456type RateLimitRuleList struct { 7457 // Rules - List of rules 7458 Rules *[]RateLimitRule `json:"rules,omitempty"` 7459} 7460 7461// RemoteAddressMatchConditionParameters defines the parameters for RemoteAddress match conditions 7462type RemoteAddressMatchConditionParameters struct { 7463 OdataType *string `json:"@odata.type,omitempty"` 7464 // Operator - Describes operator to be matched. Possible values include: 'RemoteAddressOperatorAny', 'RemoteAddressOperatorIPMatch', 'RemoteAddressOperatorGeoMatch' 7465 Operator RemoteAddressOperator `json:"operator,omitempty"` 7466 // NegateCondition - Describes if this is negate condition or not 7467 NegateCondition *bool `json:"negateCondition,omitempty"` 7468 // 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. 7469 MatchValues *[]string `json:"matchValues,omitempty"` 7470 // Transforms - List of transforms 7471 Transforms *[]Transform `json:"transforms,omitempty"` 7472} 7473 7474// RequestBodyMatchConditionParameters defines the parameters for RequestBody match conditions 7475type RequestBodyMatchConditionParameters struct { 7476 OdataType *string `json:"@odata.type,omitempty"` 7477 // Operator - Describes operator to be matched. Possible values include: 'RequestBodyOperatorAny', 'RequestBodyOperatorEqual', 'RequestBodyOperatorContains', 'RequestBodyOperatorBeginsWith', 'RequestBodyOperatorEndsWith', 'RequestBodyOperatorLessThan', 'RequestBodyOperatorLessThanOrEqual', 'RequestBodyOperatorGreaterThan', 'RequestBodyOperatorGreaterThanOrEqual', 'RequestBodyOperatorRegEx' 7478 Operator RequestBodyOperator `json:"operator,omitempty"` 7479 // NegateCondition - Describes if this is negate condition or not 7480 NegateCondition *bool `json:"negateCondition,omitempty"` 7481 // MatchValues - The match value for the condition of the delivery rule 7482 MatchValues *[]string `json:"matchValues,omitempty"` 7483 // Transforms - List of transforms 7484 Transforms *[]Transform `json:"transforms,omitempty"` 7485} 7486 7487// RequestHeaderMatchConditionParameters defines the parameters for RequestHeader match conditions 7488type RequestHeaderMatchConditionParameters struct { 7489 OdataType *string `json:"@odata.type,omitempty"` 7490 // Selector - Name of Header to be matched 7491 Selector *string `json:"selector,omitempty"` 7492 // Operator - Describes operator to be matched. Possible values include: 'RequestHeaderOperatorAny', 'RequestHeaderOperatorEqual', 'RequestHeaderOperatorContains', 'RequestHeaderOperatorBeginsWith', 'RequestHeaderOperatorEndsWith', 'RequestHeaderOperatorLessThan', 'RequestHeaderOperatorLessThanOrEqual', 'RequestHeaderOperatorGreaterThan', 'RequestHeaderOperatorGreaterThanOrEqual', 'RequestHeaderOperatorRegEx' 7493 Operator RequestHeaderOperator `json:"operator,omitempty"` 7494 // NegateCondition - Describes if this is negate condition or not 7495 NegateCondition *bool `json:"negateCondition,omitempty"` 7496 // MatchValues - The match value for the condition of the delivery rule 7497 MatchValues *[]string `json:"matchValues,omitempty"` 7498 // Transforms - List of transforms 7499 Transforms *[]Transform `json:"transforms,omitempty"` 7500} 7501 7502// RequestMethodMatchConditionParameters defines the parameters for RequestMethod match conditions 7503type RequestMethodMatchConditionParameters struct { 7504 OdataType *string `json:"@odata.type,omitempty"` 7505 // Operator - Describes operator to be matched 7506 Operator *string `json:"operator,omitempty"` 7507 // NegateCondition - Describes if this is negate condition or not 7508 NegateCondition *bool `json:"negateCondition,omitempty"` 7509 // MatchValues - The match value for the condition of the delivery rule 7510 MatchValues *[]string `json:"matchValues,omitempty"` 7511} 7512 7513// RequestSchemeMatchConditionParameters defines the parameters for RequestScheme match conditions 7514type RequestSchemeMatchConditionParameters struct { 7515 OdataType *string `json:"@odata.type,omitempty"` 7516 // Operator - Describes operator to be matched 7517 Operator *string `json:"operator,omitempty"` 7518 // NegateCondition - Describes if this is negate condition or not 7519 NegateCondition *bool `json:"negateCondition,omitempty"` 7520 // MatchValues - The match value for the condition of the delivery rule 7521 MatchValues *[]string `json:"matchValues,omitempty"` 7522} 7523 7524// RequestURIMatchConditionParameters defines the parameters for RequestUri match conditions 7525type RequestURIMatchConditionParameters struct { 7526 OdataType *string `json:"@odata.type,omitempty"` 7527 // Operator - Describes operator to be matched. Possible values include: 'RequestURIOperatorAny', 'RequestURIOperatorEqual', 'RequestURIOperatorContains', 'RequestURIOperatorBeginsWith', 'RequestURIOperatorEndsWith', 'RequestURIOperatorLessThan', 'RequestURIOperatorLessThanOrEqual', 'RequestURIOperatorGreaterThan', 'RequestURIOperatorGreaterThanOrEqual', 'RequestURIOperatorRegEx' 7528 Operator RequestURIOperator `json:"operator,omitempty"` 7529 // NegateCondition - Describes if this is negate condition or not 7530 NegateCondition *bool `json:"negateCondition,omitempty"` 7531 // MatchValues - The match value for the condition of the delivery rule 7532 MatchValues *[]string `json:"matchValues,omitempty"` 7533 // Transforms - List of transforms 7534 Transforms *[]Transform `json:"transforms,omitempty"` 7535} 7536 7537// Resource the core properties of ARM resources 7538type Resource struct { 7539 // ID - READ-ONLY; Resource ID. 7540 ID *string `json:"id,omitempty"` 7541 // Name - READ-ONLY; Resource name. 7542 Name *string `json:"name,omitempty"` 7543 // Type - READ-ONLY; Resource type. 7544 Type *string `json:"type,omitempty"` 7545} 7546 7547// ResourceReference reference to another resource. 7548type ResourceReference struct { 7549 // ID - Resource ID. 7550 ID *string `json:"id,omitempty"` 7551} 7552 7553// ResourcesResponse resources Response 7554type ResourcesResponse struct { 7555 autorest.Response `json:"-"` 7556 Endpoints *[]ResourcesResponseEndpointsItem `json:"endpoints,omitempty"` 7557 CustomDomains *[]ResourcesResponseCustomDomainsItem `json:"customDomains,omitempty"` 7558} 7559 7560// ResourcesResponseCustomDomainsItem ... 7561type ResourcesResponseCustomDomainsItem struct { 7562 ID *string `json:"id,omitempty"` 7563 Name *string `json:"name,omitempty"` 7564 EndpointID *string `json:"endpointId,omitempty"` 7565 History *bool `json:"history,omitempty"` 7566} 7567 7568// ResourcesResponseEndpointsItem ... 7569type ResourcesResponseEndpointsItem struct { 7570 ID *string `json:"id,omitempty"` 7571 Name *string `json:"name,omitempty"` 7572 History *bool `json:"history,omitempty"` 7573 CustomDomains *[]ResourcesResponseEndpointsItemCustomDomainsItem `json:"customDomains,omitempty"` 7574} 7575 7576// ResourcesResponseEndpointsItemCustomDomainsItem ... 7577type ResourcesResponseEndpointsItemCustomDomainsItem struct { 7578 ID *string `json:"id,omitempty"` 7579 Name *string `json:"name,omitempty"` 7580 EndpointID *string `json:"endpointId,omitempty"` 7581 History *bool `json:"history,omitempty"` 7582} 7583 7584// ResourceUsage output of check resource usage API. 7585type ResourceUsage struct { 7586 // ResourceType - READ-ONLY; Resource type for which the usage is provided. 7587 ResourceType *string `json:"resourceType,omitempty"` 7588 // Unit - READ-ONLY; Unit of the usage. e.g. Count. 7589 Unit *string `json:"unit,omitempty"` 7590 // CurrentValue - READ-ONLY; Actual value of usage on the specified resource type. 7591 CurrentValue *int32 `json:"currentValue,omitempty"` 7592 // Limit - READ-ONLY; Quota of the specified resource type. 7593 Limit *int32 `json:"limit,omitempty"` 7594} 7595 7596// ResourceUsageListResult output of check resource usage API. 7597type ResourceUsageListResult struct { 7598 autorest.Response `json:"-"` 7599 // Value - READ-ONLY; List of resource usages. 7600 Value *[]ResourceUsage `json:"value,omitempty"` 7601 // NextLink - URL to get the next set of custom domain objects if there are any. 7602 NextLink *string `json:"nextLink,omitempty"` 7603} 7604 7605// MarshalJSON is the custom marshaler for ResourceUsageListResult. 7606func (rulr ResourceUsageListResult) MarshalJSON() ([]byte, error) { 7607 objectMap := make(map[string]interface{}) 7608 if rulr.NextLink != nil { 7609 objectMap["nextLink"] = rulr.NextLink 7610 } 7611 return json.Marshal(objectMap) 7612} 7613 7614// ResourceUsageListResultIterator provides access to a complete listing of ResourceUsage values. 7615type ResourceUsageListResultIterator struct { 7616 i int 7617 page ResourceUsageListResultPage 7618} 7619 7620// NextWithContext advances to the next value. If there was an error making 7621// the request the iterator does not advance and the error is returned. 7622func (iter *ResourceUsageListResultIterator) NextWithContext(ctx context.Context) (err error) { 7623 if tracing.IsEnabled() { 7624 ctx = tracing.StartSpan(ctx, fqdn+"/ResourceUsageListResultIterator.NextWithContext") 7625 defer func() { 7626 sc := -1 7627 if iter.Response().Response.Response != nil { 7628 sc = iter.Response().Response.Response.StatusCode 7629 } 7630 tracing.EndSpan(ctx, sc, err) 7631 }() 7632 } 7633 iter.i++ 7634 if iter.i < len(iter.page.Values()) { 7635 return nil 7636 } 7637 err = iter.page.NextWithContext(ctx) 7638 if err != nil { 7639 iter.i-- 7640 return err 7641 } 7642 iter.i = 0 7643 return nil 7644} 7645 7646// Next advances to the next value. If there was an error making 7647// the request the iterator does not advance and the error is returned. 7648// Deprecated: Use NextWithContext() instead. 7649func (iter *ResourceUsageListResultIterator) Next() error { 7650 return iter.NextWithContext(context.Background()) 7651} 7652 7653// NotDone returns true if the enumeration should be started or is not yet complete. 7654func (iter ResourceUsageListResultIterator) NotDone() bool { 7655 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 7656} 7657 7658// Response returns the raw server response from the last page request. 7659func (iter ResourceUsageListResultIterator) Response() ResourceUsageListResult { 7660 return iter.page.Response() 7661} 7662 7663// Value returns the current value or a zero-initialized value if the 7664// iterator has advanced beyond the end of the collection. 7665func (iter ResourceUsageListResultIterator) Value() ResourceUsage { 7666 if !iter.page.NotDone() { 7667 return ResourceUsage{} 7668 } 7669 return iter.page.Values()[iter.i] 7670} 7671 7672// Creates a new instance of the ResourceUsageListResultIterator type. 7673func NewResourceUsageListResultIterator(page ResourceUsageListResultPage) ResourceUsageListResultIterator { 7674 return ResourceUsageListResultIterator{page: page} 7675} 7676 7677// IsEmpty returns true if the ListResult contains no values. 7678func (rulr ResourceUsageListResult) IsEmpty() bool { 7679 return rulr.Value == nil || len(*rulr.Value) == 0 7680} 7681 7682// hasNextLink returns true if the NextLink is not empty. 7683func (rulr ResourceUsageListResult) hasNextLink() bool { 7684 return rulr.NextLink != nil && len(*rulr.NextLink) != 0 7685} 7686 7687// resourceUsageListResultPreparer prepares a request to retrieve the next set of results. 7688// It returns nil if no more results exist. 7689func (rulr ResourceUsageListResult) resourceUsageListResultPreparer(ctx context.Context) (*http.Request, error) { 7690 if !rulr.hasNextLink() { 7691 return nil, nil 7692 } 7693 return autorest.Prepare((&http.Request{}).WithContext(ctx), 7694 autorest.AsJSON(), 7695 autorest.AsGet(), 7696 autorest.WithBaseURL(to.String(rulr.NextLink))) 7697} 7698 7699// ResourceUsageListResultPage contains a page of ResourceUsage values. 7700type ResourceUsageListResultPage struct { 7701 fn func(context.Context, ResourceUsageListResult) (ResourceUsageListResult, error) 7702 rulr ResourceUsageListResult 7703} 7704 7705// NextWithContext advances to the next page of values. If there was an error making 7706// the request the page does not advance and the error is returned. 7707func (page *ResourceUsageListResultPage) NextWithContext(ctx context.Context) (err error) { 7708 if tracing.IsEnabled() { 7709 ctx = tracing.StartSpan(ctx, fqdn+"/ResourceUsageListResultPage.NextWithContext") 7710 defer func() { 7711 sc := -1 7712 if page.Response().Response.Response != nil { 7713 sc = page.Response().Response.Response.StatusCode 7714 } 7715 tracing.EndSpan(ctx, sc, err) 7716 }() 7717 } 7718 for { 7719 next, err := page.fn(ctx, page.rulr) 7720 if err != nil { 7721 return err 7722 } 7723 page.rulr = next 7724 if !next.hasNextLink() || !next.IsEmpty() { 7725 break 7726 } 7727 } 7728 return nil 7729} 7730 7731// Next advances to the next page of values. If there was an error making 7732// the request the page does not advance and the error is returned. 7733// Deprecated: Use NextWithContext() instead. 7734func (page *ResourceUsageListResultPage) Next() error { 7735 return page.NextWithContext(context.Background()) 7736} 7737 7738// NotDone returns true if the page enumeration should be started or is not yet complete. 7739func (page ResourceUsageListResultPage) NotDone() bool { 7740 return !page.rulr.IsEmpty() 7741} 7742 7743// Response returns the raw server response from the last page request. 7744func (page ResourceUsageListResultPage) Response() ResourceUsageListResult { 7745 return page.rulr 7746} 7747 7748// Values returns the slice of values for the current page or nil if there are no values. 7749func (page ResourceUsageListResultPage) Values() []ResourceUsage { 7750 if page.rulr.IsEmpty() { 7751 return nil 7752 } 7753 return *page.rulr.Value 7754} 7755 7756// Creates a new instance of the ResourceUsageListResultPage type. 7757func NewResourceUsageListResultPage(cur ResourceUsageListResult, getNextPage func(context.Context, ResourceUsageListResult) (ResourceUsageListResult, error)) ResourceUsageListResultPage { 7758 return ResourceUsageListResultPage{ 7759 fn: getNextPage, 7760 rulr: cur, 7761 } 7762} 7763 7764// ResponseBasedOriginErrorDetectionParameters the JSON object that contains the properties to determine 7765// origin health using real requests/responses. 7766type ResponseBasedOriginErrorDetectionParameters struct { 7767 // ResponseBasedDetectedErrorTypes - Type of response errors for real user requests for which origin will be deemed unhealthy. Possible values include: 'None', 'TCPErrorsOnly', 'TCPAndHTTPErrors' 7768 ResponseBasedDetectedErrorTypes ResponseBasedDetectedErrorTypes `json:"responseBasedDetectedErrorTypes,omitempty"` 7769 // ResponseBasedFailoverThresholdPercentage - The percentage of failed requests in the sample where failover should trigger. 7770 ResponseBasedFailoverThresholdPercentage *int32 `json:"responseBasedFailoverThresholdPercentage,omitempty"` 7771 // HTTPErrorRanges - The list of Http status code ranges that are considered as server errors for origin and it is marked as unhealthy. 7772 HTTPErrorRanges *[]HTTPErrorRangeParameters `json:"httpErrorRanges,omitempty"` 7773} 7774 7775// Route friendly Routes name mapping to the any Routes or secret related information. 7776type Route struct { 7777 autorest.Response `json:"-"` 7778 *RouteProperties `json:"properties,omitempty"` 7779 // SystemData - READ-ONLY 7780 SystemData *SystemData `json:"systemData,omitempty"` 7781 // ID - READ-ONLY; Resource ID. 7782 ID *string `json:"id,omitempty"` 7783 // Name - READ-ONLY; Resource name. 7784 Name *string `json:"name,omitempty"` 7785 // Type - READ-ONLY; Resource type. 7786 Type *string `json:"type,omitempty"` 7787} 7788 7789// MarshalJSON is the custom marshaler for Route. 7790func (r Route) MarshalJSON() ([]byte, error) { 7791 objectMap := make(map[string]interface{}) 7792 if r.RouteProperties != nil { 7793 objectMap["properties"] = r.RouteProperties 7794 } 7795 return json.Marshal(objectMap) 7796} 7797 7798// UnmarshalJSON is the custom unmarshaler for Route struct. 7799func (r *Route) UnmarshalJSON(body []byte) error { 7800 var m map[string]*json.RawMessage 7801 err := json.Unmarshal(body, &m) 7802 if err != nil { 7803 return err 7804 } 7805 for k, v := range m { 7806 switch k { 7807 case "properties": 7808 if v != nil { 7809 var routeProperties RouteProperties 7810 err = json.Unmarshal(*v, &routeProperties) 7811 if err != nil { 7812 return err 7813 } 7814 r.RouteProperties = &routeProperties 7815 } 7816 case "systemData": 7817 if v != nil { 7818 var systemData SystemData 7819 err = json.Unmarshal(*v, &systemData) 7820 if err != nil { 7821 return err 7822 } 7823 r.SystemData = &systemData 7824 } 7825 case "id": 7826 if v != nil { 7827 var ID string 7828 err = json.Unmarshal(*v, &ID) 7829 if err != nil { 7830 return err 7831 } 7832 r.ID = &ID 7833 } 7834 case "name": 7835 if v != nil { 7836 var name string 7837 err = json.Unmarshal(*v, &name) 7838 if err != nil { 7839 return err 7840 } 7841 r.Name = &name 7842 } 7843 case "type": 7844 if v != nil { 7845 var typeVar string 7846 err = json.Unmarshal(*v, &typeVar) 7847 if err != nil { 7848 return err 7849 } 7850 r.Type = &typeVar 7851 } 7852 } 7853 } 7854 7855 return nil 7856} 7857 7858// RouteListResult result of the request to list routes. It contains a list of route objects and a URL link 7859// to get the next set of results. 7860type RouteListResult struct { 7861 autorest.Response `json:"-"` 7862 // Value - READ-ONLY; List of AzureFrontDoor routes within a profile. 7863 Value *[]Route `json:"value,omitempty"` 7864 // NextLink - URL to get the next set of route objects if there are any. 7865 NextLink *string `json:"nextLink,omitempty"` 7866} 7867 7868// MarshalJSON is the custom marshaler for RouteListResult. 7869func (rlr RouteListResult) MarshalJSON() ([]byte, error) { 7870 objectMap := make(map[string]interface{}) 7871 if rlr.NextLink != nil { 7872 objectMap["nextLink"] = rlr.NextLink 7873 } 7874 return json.Marshal(objectMap) 7875} 7876 7877// RouteListResultIterator provides access to a complete listing of Route values. 7878type RouteListResultIterator struct { 7879 i int 7880 page RouteListResultPage 7881} 7882 7883// NextWithContext advances to the next value. If there was an error making 7884// the request the iterator does not advance and the error is returned. 7885func (iter *RouteListResultIterator) NextWithContext(ctx context.Context) (err error) { 7886 if tracing.IsEnabled() { 7887 ctx = tracing.StartSpan(ctx, fqdn+"/RouteListResultIterator.NextWithContext") 7888 defer func() { 7889 sc := -1 7890 if iter.Response().Response.Response != nil { 7891 sc = iter.Response().Response.Response.StatusCode 7892 } 7893 tracing.EndSpan(ctx, sc, err) 7894 }() 7895 } 7896 iter.i++ 7897 if iter.i < len(iter.page.Values()) { 7898 return nil 7899 } 7900 err = iter.page.NextWithContext(ctx) 7901 if err != nil { 7902 iter.i-- 7903 return err 7904 } 7905 iter.i = 0 7906 return nil 7907} 7908 7909// Next advances to the next value. If there was an error making 7910// the request the iterator does not advance and the error is returned. 7911// Deprecated: Use NextWithContext() instead. 7912func (iter *RouteListResultIterator) Next() error { 7913 return iter.NextWithContext(context.Background()) 7914} 7915 7916// NotDone returns true if the enumeration should be started or is not yet complete. 7917func (iter RouteListResultIterator) NotDone() bool { 7918 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 7919} 7920 7921// Response returns the raw server response from the last page request. 7922func (iter RouteListResultIterator) Response() RouteListResult { 7923 return iter.page.Response() 7924} 7925 7926// Value returns the current value or a zero-initialized value if the 7927// iterator has advanced beyond the end of the collection. 7928func (iter RouteListResultIterator) Value() Route { 7929 if !iter.page.NotDone() { 7930 return Route{} 7931 } 7932 return iter.page.Values()[iter.i] 7933} 7934 7935// Creates a new instance of the RouteListResultIterator type. 7936func NewRouteListResultIterator(page RouteListResultPage) RouteListResultIterator { 7937 return RouteListResultIterator{page: page} 7938} 7939 7940// IsEmpty returns true if the ListResult contains no values. 7941func (rlr RouteListResult) IsEmpty() bool { 7942 return rlr.Value == nil || len(*rlr.Value) == 0 7943} 7944 7945// hasNextLink returns true if the NextLink is not empty. 7946func (rlr RouteListResult) hasNextLink() bool { 7947 return rlr.NextLink != nil && len(*rlr.NextLink) != 0 7948} 7949 7950// routeListResultPreparer prepares a request to retrieve the next set of results. 7951// It returns nil if no more results exist. 7952func (rlr RouteListResult) routeListResultPreparer(ctx context.Context) (*http.Request, error) { 7953 if !rlr.hasNextLink() { 7954 return nil, nil 7955 } 7956 return autorest.Prepare((&http.Request{}).WithContext(ctx), 7957 autorest.AsJSON(), 7958 autorest.AsGet(), 7959 autorest.WithBaseURL(to.String(rlr.NextLink))) 7960} 7961 7962// RouteListResultPage contains a page of Route values. 7963type RouteListResultPage struct { 7964 fn func(context.Context, RouteListResult) (RouteListResult, error) 7965 rlr RouteListResult 7966} 7967 7968// NextWithContext advances to the next page of values. If there was an error making 7969// the request the page does not advance and the error is returned. 7970func (page *RouteListResultPage) NextWithContext(ctx context.Context) (err error) { 7971 if tracing.IsEnabled() { 7972 ctx = tracing.StartSpan(ctx, fqdn+"/RouteListResultPage.NextWithContext") 7973 defer func() { 7974 sc := -1 7975 if page.Response().Response.Response != nil { 7976 sc = page.Response().Response.Response.StatusCode 7977 } 7978 tracing.EndSpan(ctx, sc, err) 7979 }() 7980 } 7981 for { 7982 next, err := page.fn(ctx, page.rlr) 7983 if err != nil { 7984 return err 7985 } 7986 page.rlr = next 7987 if !next.hasNextLink() || !next.IsEmpty() { 7988 break 7989 } 7990 } 7991 return nil 7992} 7993 7994// Next advances to the next page of values. If there was an error making 7995// the request the page does not advance and the error is returned. 7996// Deprecated: Use NextWithContext() instead. 7997func (page *RouteListResultPage) Next() error { 7998 return page.NextWithContext(context.Background()) 7999} 8000 8001// NotDone returns true if the page enumeration should be started or is not yet complete. 8002func (page RouteListResultPage) NotDone() bool { 8003 return !page.rlr.IsEmpty() 8004} 8005 8006// Response returns the raw server response from the last page request. 8007func (page RouteListResultPage) Response() RouteListResult { 8008 return page.rlr 8009} 8010 8011// Values returns the slice of values for the current page or nil if there are no values. 8012func (page RouteListResultPage) Values() []Route { 8013 if page.rlr.IsEmpty() { 8014 return nil 8015 } 8016 return *page.rlr.Value 8017} 8018 8019// Creates a new instance of the RouteListResultPage type. 8020func NewRouteListResultPage(cur RouteListResult, getNextPage func(context.Context, RouteListResult) (RouteListResult, error)) RouteListResultPage { 8021 return RouteListResultPage{ 8022 fn: getNextPage, 8023 rlr: cur, 8024 } 8025} 8026 8027// RouteProperties the JSON object that contains the properties of the Routes to create. 8028type RouteProperties struct { 8029 // CustomDomains - Domains referenced by this endpoint. 8030 CustomDomains *[]ResourceReference `json:"customDomains,omitempty"` 8031 // OriginGroup - A reference to the origin group. 8032 OriginGroup *ResourceReference `json:"originGroup,omitempty"` 8033 // OriginPath - A directory path on the origin that AzureFrontDoor can use to retrieve content from, e.g. contoso.cloudapp.net/originpath. 8034 OriginPath *string `json:"originPath,omitempty"` 8035 // RuleSets - rule sets referenced by this endpoint. 8036 RuleSets *[]ResourceReference `json:"ruleSets,omitempty"` 8037 // SupportedProtocols - List of supported protocols for this route. 8038 SupportedProtocols *[]AFDEndpointProtocols `json:"supportedProtocols,omitempty"` 8039 // PatternsToMatch - The route patterns of the rule. 8040 PatternsToMatch *[]string `json:"patternsToMatch,omitempty"` 8041 // CompressionSettings - compression settings. 8042 CompressionSettings interface{} `json:"compressionSettings,omitempty"` 8043 // 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', 'UseQueryString', 'NotSet' 8044 QueryStringCachingBehavior AfdQueryStringCachingBehavior `json:"queryStringCachingBehavior,omitempty"` 8045 // ForwardingProtocol - Protocol this rule will use when forwarding traffic to backends. Possible values include: 'HTTPOnly', 'HTTPSOnly', 'MatchRequest' 8046 ForwardingProtocol ForwardingProtocol `json:"forwardingProtocol,omitempty"` 8047 // LinkToDefaultDomain - whether this route will be linked to the default endpoint domain. Possible values include: 'LinkToDefaultDomainEnabled', 'LinkToDefaultDomainDisabled' 8048 LinkToDefaultDomain LinkToDefaultDomain `json:"linkToDefaultDomain,omitempty"` 8049 // HTTPSRedirect - Whether to automatically redirect HTTP traffic to HTTPS traffic. Note that this is a easy way to set up this rule and it will be the first rule that gets executed. Possible values include: 'HTTPSRedirectEnabled', 'HTTPSRedirectDisabled' 8050 HTTPSRedirect HTTPSRedirect `json:"httpsRedirect,omitempty"` 8051 // EnabledState - Whether to enable use of this rule. Permitted values are 'Enabled' or 'Disabled'. Possible values include: 'EnabledStateEnabled', 'EnabledStateDisabled' 8052 EnabledState EnabledState `json:"enabledState,omitempty"` 8053 // ProvisioningState - READ-ONLY; Provisioning status. Possible values include: 'Succeeded', 'Failed', 'Updating', 'Deleting', 'Creating' 8054 ProvisioningState AfdProvisioningState `json:"provisioningState,omitempty"` 8055 // DeploymentStatus - READ-ONLY; Possible values include: 'DeploymentStatusNotStarted', 'DeploymentStatusInProgress', 'DeploymentStatusSucceeded', 'DeploymentStatusFailed' 8056 DeploymentStatus DeploymentStatus `json:"deploymentStatus,omitempty"` 8057} 8058 8059// MarshalJSON is the custom marshaler for RouteProperties. 8060func (rp RouteProperties) MarshalJSON() ([]byte, error) { 8061 objectMap := make(map[string]interface{}) 8062 if rp.CustomDomains != nil { 8063 objectMap["customDomains"] = rp.CustomDomains 8064 } 8065 if rp.OriginGroup != nil { 8066 objectMap["originGroup"] = rp.OriginGroup 8067 } 8068 if rp.OriginPath != nil { 8069 objectMap["originPath"] = rp.OriginPath 8070 } 8071 if rp.RuleSets != nil { 8072 objectMap["ruleSets"] = rp.RuleSets 8073 } 8074 if rp.SupportedProtocols != nil { 8075 objectMap["supportedProtocols"] = rp.SupportedProtocols 8076 } 8077 if rp.PatternsToMatch != nil { 8078 objectMap["patternsToMatch"] = rp.PatternsToMatch 8079 } 8080 if rp.CompressionSettings != nil { 8081 objectMap["compressionSettings"] = rp.CompressionSettings 8082 } 8083 if rp.QueryStringCachingBehavior != "" { 8084 objectMap["queryStringCachingBehavior"] = rp.QueryStringCachingBehavior 8085 } 8086 if rp.ForwardingProtocol != "" { 8087 objectMap["forwardingProtocol"] = rp.ForwardingProtocol 8088 } 8089 if rp.LinkToDefaultDomain != "" { 8090 objectMap["linkToDefaultDomain"] = rp.LinkToDefaultDomain 8091 } 8092 if rp.HTTPSRedirect != "" { 8093 objectMap["httpsRedirect"] = rp.HTTPSRedirect 8094 } 8095 if rp.EnabledState != "" { 8096 objectMap["enabledState"] = rp.EnabledState 8097 } 8098 return json.Marshal(objectMap) 8099} 8100 8101// RoutesCreateFuture an abstraction for monitoring and retrieving the results of a long-running operation. 8102type RoutesCreateFuture struct { 8103 azure.FutureAPI 8104 // Result returns the result of the asynchronous operation. 8105 // If the operation has not completed it will return an error. 8106 Result func(RoutesClient) (Route, error) 8107} 8108 8109// RoutesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running operation. 8110type RoutesDeleteFuture struct { 8111 azure.FutureAPI 8112 // Result returns the result of the asynchronous operation. 8113 // If the operation has not completed it will return an error. 8114 Result func(RoutesClient) (autorest.Response, error) 8115} 8116 8117// RoutesUpdateFuture an abstraction for monitoring and retrieving the results of a long-running operation. 8118type RoutesUpdateFuture struct { 8119 azure.FutureAPI 8120 // Result returns the result of the asynchronous operation. 8121 // If the operation has not completed it will return an error. 8122 Result func(RoutesClient) (Route, error) 8123} 8124 8125// RouteUpdateParameters the domain JSON object required for domain creation or update. 8126type RouteUpdateParameters struct { 8127 *RouteUpdatePropertiesParameters `json:"properties,omitempty"` 8128} 8129 8130// MarshalJSON is the custom marshaler for RouteUpdateParameters. 8131func (rup RouteUpdateParameters) MarshalJSON() ([]byte, error) { 8132 objectMap := make(map[string]interface{}) 8133 if rup.RouteUpdatePropertiesParameters != nil { 8134 objectMap["properties"] = rup.RouteUpdatePropertiesParameters 8135 } 8136 return json.Marshal(objectMap) 8137} 8138 8139// UnmarshalJSON is the custom unmarshaler for RouteUpdateParameters struct. 8140func (rup *RouteUpdateParameters) UnmarshalJSON(body []byte) error { 8141 var m map[string]*json.RawMessage 8142 err := json.Unmarshal(body, &m) 8143 if err != nil { 8144 return err 8145 } 8146 for k, v := range m { 8147 switch k { 8148 case "properties": 8149 if v != nil { 8150 var routeUpdatePropertiesParameters RouteUpdatePropertiesParameters 8151 err = json.Unmarshal(*v, &routeUpdatePropertiesParameters) 8152 if err != nil { 8153 return err 8154 } 8155 rup.RouteUpdatePropertiesParameters = &routeUpdatePropertiesParameters 8156 } 8157 } 8158 } 8159 8160 return nil 8161} 8162 8163// RouteUpdatePropertiesParameters the JSON object that contains the properties of the domain to create. 8164type RouteUpdatePropertiesParameters struct { 8165 // CustomDomains - Domains referenced by this endpoint. 8166 CustomDomains *[]ResourceReference `json:"customDomains,omitempty"` 8167 // OriginGroup - A reference to the origin group. 8168 OriginGroup *ResourceReference `json:"originGroup,omitempty"` 8169 // OriginPath - A directory path on the origin that AzureFrontDoor can use to retrieve content from, e.g. contoso.cloudapp.net/originpath. 8170 OriginPath *string `json:"originPath,omitempty"` 8171 // RuleSets - rule sets referenced by this endpoint. 8172 RuleSets *[]ResourceReference `json:"ruleSets,omitempty"` 8173 // SupportedProtocols - List of supported protocols for this route. 8174 SupportedProtocols *[]AFDEndpointProtocols `json:"supportedProtocols,omitempty"` 8175 // PatternsToMatch - The route patterns of the rule. 8176 PatternsToMatch *[]string `json:"patternsToMatch,omitempty"` 8177 // CompressionSettings - compression settings. 8178 CompressionSettings interface{} `json:"compressionSettings,omitempty"` 8179 // 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', 'UseQueryString', 'NotSet' 8180 QueryStringCachingBehavior AfdQueryStringCachingBehavior `json:"queryStringCachingBehavior,omitempty"` 8181 // ForwardingProtocol - Protocol this rule will use when forwarding traffic to backends. Possible values include: 'HTTPOnly', 'HTTPSOnly', 'MatchRequest' 8182 ForwardingProtocol ForwardingProtocol `json:"forwardingProtocol,omitempty"` 8183 // LinkToDefaultDomain - whether this route will be linked to the default endpoint domain. Possible values include: 'LinkToDefaultDomainEnabled', 'LinkToDefaultDomainDisabled' 8184 LinkToDefaultDomain LinkToDefaultDomain `json:"linkToDefaultDomain,omitempty"` 8185 // HTTPSRedirect - Whether to automatically redirect HTTP traffic to HTTPS traffic. Note that this is a easy way to set up this rule and it will be the first rule that gets executed. Possible values include: 'HTTPSRedirectEnabled', 'HTTPSRedirectDisabled' 8186 HTTPSRedirect HTTPSRedirect `json:"httpsRedirect,omitempty"` 8187 // EnabledState - Whether to enable use of this rule. Permitted values are 'Enabled' or 'Disabled'. Possible values include: 'EnabledStateEnabled', 'EnabledStateDisabled' 8188 EnabledState EnabledState `json:"enabledState,omitempty"` 8189} 8190 8191// Rule friendly Rules name mapping to the any Rules or secret related information. 8192type Rule struct { 8193 autorest.Response `json:"-"` 8194 *RuleProperties `json:"properties,omitempty"` 8195 // SystemData - READ-ONLY 8196 SystemData *SystemData `json:"systemData,omitempty"` 8197 // ID - READ-ONLY; Resource ID. 8198 ID *string `json:"id,omitempty"` 8199 // Name - READ-ONLY; Resource name. 8200 Name *string `json:"name,omitempty"` 8201 // Type - READ-ONLY; Resource type. 8202 Type *string `json:"type,omitempty"` 8203} 8204 8205// MarshalJSON is the custom marshaler for Rule. 8206func (r Rule) MarshalJSON() ([]byte, error) { 8207 objectMap := make(map[string]interface{}) 8208 if r.RuleProperties != nil { 8209 objectMap["properties"] = r.RuleProperties 8210 } 8211 return json.Marshal(objectMap) 8212} 8213 8214// UnmarshalJSON is the custom unmarshaler for Rule struct. 8215func (r *Rule) UnmarshalJSON(body []byte) error { 8216 var m map[string]*json.RawMessage 8217 err := json.Unmarshal(body, &m) 8218 if err != nil { 8219 return err 8220 } 8221 for k, v := range m { 8222 switch k { 8223 case "properties": 8224 if v != nil { 8225 var ruleProperties RuleProperties 8226 err = json.Unmarshal(*v, &ruleProperties) 8227 if err != nil { 8228 return err 8229 } 8230 r.RuleProperties = &ruleProperties 8231 } 8232 case "systemData": 8233 if v != nil { 8234 var systemData SystemData 8235 err = json.Unmarshal(*v, &systemData) 8236 if err != nil { 8237 return err 8238 } 8239 r.SystemData = &systemData 8240 } 8241 case "id": 8242 if v != nil { 8243 var ID string 8244 err = json.Unmarshal(*v, &ID) 8245 if err != nil { 8246 return err 8247 } 8248 r.ID = &ID 8249 } 8250 case "name": 8251 if v != nil { 8252 var name string 8253 err = json.Unmarshal(*v, &name) 8254 if err != nil { 8255 return err 8256 } 8257 r.Name = &name 8258 } 8259 case "type": 8260 if v != nil { 8261 var typeVar string 8262 err = json.Unmarshal(*v, &typeVar) 8263 if err != nil { 8264 return err 8265 } 8266 r.Type = &typeVar 8267 } 8268 } 8269 } 8270 8271 return nil 8272} 8273 8274// RuleListResult result of the request to list rules. It contains a list of rule objects and a URL link to 8275// get the next set of results. 8276type RuleListResult struct { 8277 autorest.Response `json:"-"` 8278 // Value - READ-ONLY; List of AzureFrontDoor rules within a rule set. 8279 Value *[]Rule `json:"value,omitempty"` 8280 // NextLink - URL to get the next set of rule objects if there are any. 8281 NextLink *string `json:"nextLink,omitempty"` 8282} 8283 8284// MarshalJSON is the custom marshaler for RuleListResult. 8285func (rlr RuleListResult) MarshalJSON() ([]byte, error) { 8286 objectMap := make(map[string]interface{}) 8287 if rlr.NextLink != nil { 8288 objectMap["nextLink"] = rlr.NextLink 8289 } 8290 return json.Marshal(objectMap) 8291} 8292 8293// RuleListResultIterator provides access to a complete listing of Rule values. 8294type RuleListResultIterator struct { 8295 i int 8296 page RuleListResultPage 8297} 8298 8299// NextWithContext advances to the next value. If there was an error making 8300// the request the iterator does not advance and the error is returned. 8301func (iter *RuleListResultIterator) NextWithContext(ctx context.Context) (err error) { 8302 if tracing.IsEnabled() { 8303 ctx = tracing.StartSpan(ctx, fqdn+"/RuleListResultIterator.NextWithContext") 8304 defer func() { 8305 sc := -1 8306 if iter.Response().Response.Response != nil { 8307 sc = iter.Response().Response.Response.StatusCode 8308 } 8309 tracing.EndSpan(ctx, sc, err) 8310 }() 8311 } 8312 iter.i++ 8313 if iter.i < len(iter.page.Values()) { 8314 return nil 8315 } 8316 err = iter.page.NextWithContext(ctx) 8317 if err != nil { 8318 iter.i-- 8319 return err 8320 } 8321 iter.i = 0 8322 return nil 8323} 8324 8325// Next advances to the next value. If there was an error making 8326// the request the iterator does not advance and the error is returned. 8327// Deprecated: Use NextWithContext() instead. 8328func (iter *RuleListResultIterator) Next() error { 8329 return iter.NextWithContext(context.Background()) 8330} 8331 8332// NotDone returns true if the enumeration should be started or is not yet complete. 8333func (iter RuleListResultIterator) NotDone() bool { 8334 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 8335} 8336 8337// Response returns the raw server response from the last page request. 8338func (iter RuleListResultIterator) Response() RuleListResult { 8339 return iter.page.Response() 8340} 8341 8342// Value returns the current value or a zero-initialized value if the 8343// iterator has advanced beyond the end of the collection. 8344func (iter RuleListResultIterator) Value() Rule { 8345 if !iter.page.NotDone() { 8346 return Rule{} 8347 } 8348 return iter.page.Values()[iter.i] 8349} 8350 8351// Creates a new instance of the RuleListResultIterator type. 8352func NewRuleListResultIterator(page RuleListResultPage) RuleListResultIterator { 8353 return RuleListResultIterator{page: page} 8354} 8355 8356// IsEmpty returns true if the ListResult contains no values. 8357func (rlr RuleListResult) IsEmpty() bool { 8358 return rlr.Value == nil || len(*rlr.Value) == 0 8359} 8360 8361// hasNextLink returns true if the NextLink is not empty. 8362func (rlr RuleListResult) hasNextLink() bool { 8363 return rlr.NextLink != nil && len(*rlr.NextLink) != 0 8364} 8365 8366// ruleListResultPreparer prepares a request to retrieve the next set of results. 8367// It returns nil if no more results exist. 8368func (rlr RuleListResult) ruleListResultPreparer(ctx context.Context) (*http.Request, error) { 8369 if !rlr.hasNextLink() { 8370 return nil, nil 8371 } 8372 return autorest.Prepare((&http.Request{}).WithContext(ctx), 8373 autorest.AsJSON(), 8374 autorest.AsGet(), 8375 autorest.WithBaseURL(to.String(rlr.NextLink))) 8376} 8377 8378// RuleListResultPage contains a page of Rule values. 8379type RuleListResultPage struct { 8380 fn func(context.Context, RuleListResult) (RuleListResult, error) 8381 rlr RuleListResult 8382} 8383 8384// NextWithContext advances to the next page of values. If there was an error making 8385// the request the page does not advance and the error is returned. 8386func (page *RuleListResultPage) NextWithContext(ctx context.Context) (err error) { 8387 if tracing.IsEnabled() { 8388 ctx = tracing.StartSpan(ctx, fqdn+"/RuleListResultPage.NextWithContext") 8389 defer func() { 8390 sc := -1 8391 if page.Response().Response.Response != nil { 8392 sc = page.Response().Response.Response.StatusCode 8393 } 8394 tracing.EndSpan(ctx, sc, err) 8395 }() 8396 } 8397 for { 8398 next, err := page.fn(ctx, page.rlr) 8399 if err != nil { 8400 return err 8401 } 8402 page.rlr = next 8403 if !next.hasNextLink() || !next.IsEmpty() { 8404 break 8405 } 8406 } 8407 return nil 8408} 8409 8410// Next advances to the next page of values. If there was an error making 8411// the request the page does not advance and the error is returned. 8412// Deprecated: Use NextWithContext() instead. 8413func (page *RuleListResultPage) Next() error { 8414 return page.NextWithContext(context.Background()) 8415} 8416 8417// NotDone returns true if the page enumeration should be started or is not yet complete. 8418func (page RuleListResultPage) NotDone() bool { 8419 return !page.rlr.IsEmpty() 8420} 8421 8422// Response returns the raw server response from the last page request. 8423func (page RuleListResultPage) Response() RuleListResult { 8424 return page.rlr 8425} 8426 8427// Values returns the slice of values for the current page or nil if there are no values. 8428func (page RuleListResultPage) Values() []Rule { 8429 if page.rlr.IsEmpty() { 8430 return nil 8431 } 8432 return *page.rlr.Value 8433} 8434 8435// Creates a new instance of the RuleListResultPage type. 8436func NewRuleListResultPage(cur RuleListResult, getNextPage func(context.Context, RuleListResult) (RuleListResult, error)) RuleListResultPage { 8437 return RuleListResultPage{ 8438 fn: getNextPage, 8439 rlr: cur, 8440 } 8441} 8442 8443// RuleProperties the JSON object that contains the properties of the Rules to create. 8444type RuleProperties struct { 8445 // 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. 8446 Order *int32 `json:"order,omitempty"` 8447 // Conditions - A list of conditions that must be matched for the actions to be executed 8448 Conditions *[]BasicDeliveryRuleCondition `json:"conditions,omitempty"` 8449 // Actions - A list of actions that are executed when all the conditions of a rule are satisfied. 8450 Actions *[]BasicDeliveryRuleAction `json:"actions,omitempty"` 8451 // MatchProcessingBehavior - If this rule is a match should the rules engine continue running the remaining rules or stop. If not present, defaults to Continue. Possible values include: 'Continue', 'Stop' 8452 MatchProcessingBehavior MatchProcessingBehavior `json:"matchProcessingBehavior,omitempty"` 8453 // ProvisioningState - READ-ONLY; Provisioning status. Possible values include: 'Succeeded', 'Failed', 'Updating', 'Deleting', 'Creating' 8454 ProvisioningState AfdProvisioningState `json:"provisioningState,omitempty"` 8455 // DeploymentStatus - READ-ONLY; Possible values include: 'DeploymentStatusNotStarted', 'DeploymentStatusInProgress', 'DeploymentStatusSucceeded', 'DeploymentStatusFailed' 8456 DeploymentStatus DeploymentStatus `json:"deploymentStatus,omitempty"` 8457} 8458 8459// MarshalJSON is the custom marshaler for RuleProperties. 8460func (rp RuleProperties) MarshalJSON() ([]byte, error) { 8461 objectMap := make(map[string]interface{}) 8462 if rp.Order != nil { 8463 objectMap["order"] = rp.Order 8464 } 8465 if rp.Conditions != nil { 8466 objectMap["conditions"] = rp.Conditions 8467 } 8468 if rp.Actions != nil { 8469 objectMap["actions"] = rp.Actions 8470 } 8471 if rp.MatchProcessingBehavior != "" { 8472 objectMap["matchProcessingBehavior"] = rp.MatchProcessingBehavior 8473 } 8474 return json.Marshal(objectMap) 8475} 8476 8477// UnmarshalJSON is the custom unmarshaler for RuleProperties struct. 8478func (rp *RuleProperties) UnmarshalJSON(body []byte) error { 8479 var m map[string]*json.RawMessage 8480 err := json.Unmarshal(body, &m) 8481 if err != nil { 8482 return err 8483 } 8484 for k, v := range m { 8485 switch k { 8486 case "order": 8487 if v != nil { 8488 var order int32 8489 err = json.Unmarshal(*v, &order) 8490 if err != nil { 8491 return err 8492 } 8493 rp.Order = &order 8494 } 8495 case "conditions": 8496 if v != nil { 8497 conditions, err := unmarshalBasicDeliveryRuleConditionArray(*v) 8498 if err != nil { 8499 return err 8500 } 8501 rp.Conditions = &conditions 8502 } 8503 case "actions": 8504 if v != nil { 8505 actions, err := unmarshalBasicDeliveryRuleActionArray(*v) 8506 if err != nil { 8507 return err 8508 } 8509 rp.Actions = &actions 8510 } 8511 case "matchProcessingBehavior": 8512 if v != nil { 8513 var matchProcessingBehavior MatchProcessingBehavior 8514 err = json.Unmarshal(*v, &matchProcessingBehavior) 8515 if err != nil { 8516 return err 8517 } 8518 rp.MatchProcessingBehavior = matchProcessingBehavior 8519 } 8520 case "provisioningState": 8521 if v != nil { 8522 var provisioningState AfdProvisioningState 8523 err = json.Unmarshal(*v, &provisioningState) 8524 if err != nil { 8525 return err 8526 } 8527 rp.ProvisioningState = provisioningState 8528 } 8529 case "deploymentStatus": 8530 if v != nil { 8531 var deploymentStatus DeploymentStatus 8532 err = json.Unmarshal(*v, &deploymentStatus) 8533 if err != nil { 8534 return err 8535 } 8536 rp.DeploymentStatus = deploymentStatus 8537 } 8538 } 8539 } 8540 8541 return nil 8542} 8543 8544// RulesCreateFuture an abstraction for monitoring and retrieving the results of a long-running operation. 8545type RulesCreateFuture struct { 8546 azure.FutureAPI 8547 // Result returns the result of the asynchronous operation. 8548 // If the operation has not completed it will return an error. 8549 Result func(RulesClient) (Rule, error) 8550} 8551 8552// RulesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running operation. 8553type RulesDeleteFuture struct { 8554 azure.FutureAPI 8555 // Result returns the result of the asynchronous operation. 8556 // If the operation has not completed it will return an error. 8557 Result func(RulesClient) (autorest.Response, error) 8558} 8559 8560// RuleSet friendly RuleSet name mapping to the any RuleSet or secret related information. 8561type RuleSet struct { 8562 autorest.Response `json:"-"` 8563 *RuleSetProperties `json:"properties,omitempty"` 8564 // SystemData - READ-ONLY 8565 SystemData *SystemData `json:"systemData,omitempty"` 8566 // ID - READ-ONLY; Resource ID. 8567 ID *string `json:"id,omitempty"` 8568 // Name - READ-ONLY; Resource name. 8569 Name *string `json:"name,omitempty"` 8570 // Type - READ-ONLY; Resource type. 8571 Type *string `json:"type,omitempty"` 8572} 8573 8574// MarshalJSON is the custom marshaler for RuleSet. 8575func (rs RuleSet) MarshalJSON() ([]byte, error) { 8576 objectMap := make(map[string]interface{}) 8577 if rs.RuleSetProperties != nil { 8578 objectMap["properties"] = rs.RuleSetProperties 8579 } 8580 return json.Marshal(objectMap) 8581} 8582 8583// UnmarshalJSON is the custom unmarshaler for RuleSet struct. 8584func (rs *RuleSet) UnmarshalJSON(body []byte) error { 8585 var m map[string]*json.RawMessage 8586 err := json.Unmarshal(body, &m) 8587 if err != nil { 8588 return err 8589 } 8590 for k, v := range m { 8591 switch k { 8592 case "properties": 8593 if v != nil { 8594 var ruleSetProperties RuleSetProperties 8595 err = json.Unmarshal(*v, &ruleSetProperties) 8596 if err != nil { 8597 return err 8598 } 8599 rs.RuleSetProperties = &ruleSetProperties 8600 } 8601 case "systemData": 8602 if v != nil { 8603 var systemData SystemData 8604 err = json.Unmarshal(*v, &systemData) 8605 if err != nil { 8606 return err 8607 } 8608 rs.SystemData = &systemData 8609 } 8610 case "id": 8611 if v != nil { 8612 var ID string 8613 err = json.Unmarshal(*v, &ID) 8614 if err != nil { 8615 return err 8616 } 8617 rs.ID = &ID 8618 } 8619 case "name": 8620 if v != nil { 8621 var name string 8622 err = json.Unmarshal(*v, &name) 8623 if err != nil { 8624 return err 8625 } 8626 rs.Name = &name 8627 } 8628 case "type": 8629 if v != nil { 8630 var typeVar string 8631 err = json.Unmarshal(*v, &typeVar) 8632 if err != nil { 8633 return err 8634 } 8635 rs.Type = &typeVar 8636 } 8637 } 8638 } 8639 8640 return nil 8641} 8642 8643// RuleSetListResult result of the request to list rule sets. It contains a list of rule set objects and a 8644// URL link to get the next set of results. 8645type RuleSetListResult struct { 8646 autorest.Response `json:"-"` 8647 // Value - READ-ONLY; List of AzureFrontDoor rule sets within a profile. 8648 Value *[]RuleSet `json:"value,omitempty"` 8649 // NextLink - URL to get the next set of rule set objects if there are any. 8650 NextLink *string `json:"nextLink,omitempty"` 8651} 8652 8653// MarshalJSON is the custom marshaler for RuleSetListResult. 8654func (rslr RuleSetListResult) MarshalJSON() ([]byte, error) { 8655 objectMap := make(map[string]interface{}) 8656 if rslr.NextLink != nil { 8657 objectMap["nextLink"] = rslr.NextLink 8658 } 8659 return json.Marshal(objectMap) 8660} 8661 8662// RuleSetListResultIterator provides access to a complete listing of RuleSet values. 8663type RuleSetListResultIterator struct { 8664 i int 8665 page RuleSetListResultPage 8666} 8667 8668// NextWithContext advances to the next value. If there was an error making 8669// the request the iterator does not advance and the error is returned. 8670func (iter *RuleSetListResultIterator) NextWithContext(ctx context.Context) (err error) { 8671 if tracing.IsEnabled() { 8672 ctx = tracing.StartSpan(ctx, fqdn+"/RuleSetListResultIterator.NextWithContext") 8673 defer func() { 8674 sc := -1 8675 if iter.Response().Response.Response != nil { 8676 sc = iter.Response().Response.Response.StatusCode 8677 } 8678 tracing.EndSpan(ctx, sc, err) 8679 }() 8680 } 8681 iter.i++ 8682 if iter.i < len(iter.page.Values()) { 8683 return nil 8684 } 8685 err = iter.page.NextWithContext(ctx) 8686 if err != nil { 8687 iter.i-- 8688 return err 8689 } 8690 iter.i = 0 8691 return nil 8692} 8693 8694// Next advances to the next value. If there was an error making 8695// the request the iterator does not advance and the error is returned. 8696// Deprecated: Use NextWithContext() instead. 8697func (iter *RuleSetListResultIterator) Next() error { 8698 return iter.NextWithContext(context.Background()) 8699} 8700 8701// NotDone returns true if the enumeration should be started or is not yet complete. 8702func (iter RuleSetListResultIterator) NotDone() bool { 8703 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 8704} 8705 8706// Response returns the raw server response from the last page request. 8707func (iter RuleSetListResultIterator) Response() RuleSetListResult { 8708 return iter.page.Response() 8709} 8710 8711// Value returns the current value or a zero-initialized value if the 8712// iterator has advanced beyond the end of the collection. 8713func (iter RuleSetListResultIterator) Value() RuleSet { 8714 if !iter.page.NotDone() { 8715 return RuleSet{} 8716 } 8717 return iter.page.Values()[iter.i] 8718} 8719 8720// Creates a new instance of the RuleSetListResultIterator type. 8721func NewRuleSetListResultIterator(page RuleSetListResultPage) RuleSetListResultIterator { 8722 return RuleSetListResultIterator{page: page} 8723} 8724 8725// IsEmpty returns true if the ListResult contains no values. 8726func (rslr RuleSetListResult) IsEmpty() bool { 8727 return rslr.Value == nil || len(*rslr.Value) == 0 8728} 8729 8730// hasNextLink returns true if the NextLink is not empty. 8731func (rslr RuleSetListResult) hasNextLink() bool { 8732 return rslr.NextLink != nil && len(*rslr.NextLink) != 0 8733} 8734 8735// ruleSetListResultPreparer prepares a request to retrieve the next set of results. 8736// It returns nil if no more results exist. 8737func (rslr RuleSetListResult) ruleSetListResultPreparer(ctx context.Context) (*http.Request, error) { 8738 if !rslr.hasNextLink() { 8739 return nil, nil 8740 } 8741 return autorest.Prepare((&http.Request{}).WithContext(ctx), 8742 autorest.AsJSON(), 8743 autorest.AsGet(), 8744 autorest.WithBaseURL(to.String(rslr.NextLink))) 8745} 8746 8747// RuleSetListResultPage contains a page of RuleSet values. 8748type RuleSetListResultPage struct { 8749 fn func(context.Context, RuleSetListResult) (RuleSetListResult, error) 8750 rslr RuleSetListResult 8751} 8752 8753// NextWithContext advances to the next page of values. If there was an error making 8754// the request the page does not advance and the error is returned. 8755func (page *RuleSetListResultPage) NextWithContext(ctx context.Context) (err error) { 8756 if tracing.IsEnabled() { 8757 ctx = tracing.StartSpan(ctx, fqdn+"/RuleSetListResultPage.NextWithContext") 8758 defer func() { 8759 sc := -1 8760 if page.Response().Response.Response != nil { 8761 sc = page.Response().Response.Response.StatusCode 8762 } 8763 tracing.EndSpan(ctx, sc, err) 8764 }() 8765 } 8766 for { 8767 next, err := page.fn(ctx, page.rslr) 8768 if err != nil { 8769 return err 8770 } 8771 page.rslr = next 8772 if !next.hasNextLink() || !next.IsEmpty() { 8773 break 8774 } 8775 } 8776 return nil 8777} 8778 8779// Next advances to the next page of values. If there was an error making 8780// the request the page does not advance and the error is returned. 8781// Deprecated: Use NextWithContext() instead. 8782func (page *RuleSetListResultPage) Next() error { 8783 return page.NextWithContext(context.Background()) 8784} 8785 8786// NotDone returns true if the page enumeration should be started or is not yet complete. 8787func (page RuleSetListResultPage) NotDone() bool { 8788 return !page.rslr.IsEmpty() 8789} 8790 8791// Response returns the raw server response from the last page request. 8792func (page RuleSetListResultPage) Response() RuleSetListResult { 8793 return page.rslr 8794} 8795 8796// Values returns the slice of values for the current page or nil if there are no values. 8797func (page RuleSetListResultPage) Values() []RuleSet { 8798 if page.rslr.IsEmpty() { 8799 return nil 8800 } 8801 return *page.rslr.Value 8802} 8803 8804// Creates a new instance of the RuleSetListResultPage type. 8805func NewRuleSetListResultPage(cur RuleSetListResult, getNextPage func(context.Context, RuleSetListResult) (RuleSetListResult, error)) RuleSetListResultPage { 8806 return RuleSetListResultPage{ 8807 fn: getNextPage, 8808 rslr: cur, 8809 } 8810} 8811 8812// RuleSetProperties the JSON object that contains the properties of the Rule Set to create. 8813type RuleSetProperties struct { 8814 // ProvisioningState - READ-ONLY; Provisioning status. Possible values include: 'Succeeded', 'Failed', 'Updating', 'Deleting', 'Creating' 8815 ProvisioningState AfdProvisioningState `json:"provisioningState,omitempty"` 8816 // DeploymentStatus - READ-ONLY; Possible values include: 'DeploymentStatusNotStarted', 'DeploymentStatusInProgress', 'DeploymentStatusSucceeded', 'DeploymentStatusFailed' 8817 DeploymentStatus DeploymentStatus `json:"deploymentStatus,omitempty"` 8818} 8819 8820// RuleSetsCreateFuture an abstraction for monitoring and retrieving the results of a long-running 8821// operation. 8822type RuleSetsCreateFuture struct { 8823 azure.FutureAPI 8824 // Result returns the result of the asynchronous operation. 8825 // If the operation has not completed it will return an error. 8826 Result func(RuleSetsClient) (RuleSet, error) 8827} 8828 8829// RuleSetsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running 8830// operation. 8831type RuleSetsDeleteFuture struct { 8832 azure.FutureAPI 8833 // Result returns the result of the asynchronous operation. 8834 // If the operation has not completed it will return an error. 8835 Result func(RuleSetsClient) (autorest.Response, error) 8836} 8837 8838// RulesUpdateFuture an abstraction for monitoring and retrieving the results of a long-running operation. 8839type RulesUpdateFuture struct { 8840 azure.FutureAPI 8841 // Result returns the result of the asynchronous operation. 8842 // If the operation has not completed it will return an error. 8843 Result func(RulesClient) (Rule, error) 8844} 8845 8846// RuleUpdateParameters the domain JSON object required for domain creation or update. 8847type RuleUpdateParameters struct { 8848 *RuleUpdatePropertiesParameters `json:"properties,omitempty"` 8849} 8850 8851// MarshalJSON is the custom marshaler for RuleUpdateParameters. 8852func (rup RuleUpdateParameters) MarshalJSON() ([]byte, error) { 8853 objectMap := make(map[string]interface{}) 8854 if rup.RuleUpdatePropertiesParameters != nil { 8855 objectMap["properties"] = rup.RuleUpdatePropertiesParameters 8856 } 8857 return json.Marshal(objectMap) 8858} 8859 8860// UnmarshalJSON is the custom unmarshaler for RuleUpdateParameters struct. 8861func (rup *RuleUpdateParameters) UnmarshalJSON(body []byte) error { 8862 var m map[string]*json.RawMessage 8863 err := json.Unmarshal(body, &m) 8864 if err != nil { 8865 return err 8866 } 8867 for k, v := range m { 8868 switch k { 8869 case "properties": 8870 if v != nil { 8871 var ruleUpdatePropertiesParameters RuleUpdatePropertiesParameters 8872 err = json.Unmarshal(*v, &ruleUpdatePropertiesParameters) 8873 if err != nil { 8874 return err 8875 } 8876 rup.RuleUpdatePropertiesParameters = &ruleUpdatePropertiesParameters 8877 } 8878 } 8879 } 8880 8881 return nil 8882} 8883 8884// RuleUpdatePropertiesParameters the JSON object that contains the properties of the domain to create. 8885type RuleUpdatePropertiesParameters struct { 8886 // 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. 8887 Order *int32 `json:"order,omitempty"` 8888 // Conditions - A list of conditions that must be matched for the actions to be executed 8889 Conditions *[]BasicDeliveryRuleCondition `json:"conditions,omitempty"` 8890 // Actions - A list of actions that are executed when all the conditions of a rule are satisfied. 8891 Actions *[]BasicDeliveryRuleAction `json:"actions,omitempty"` 8892 // MatchProcessingBehavior - If this rule is a match should the rules engine continue running the remaining rules or stop. If not present, defaults to Continue. Possible values include: 'Continue', 'Stop' 8893 MatchProcessingBehavior MatchProcessingBehavior `json:"matchProcessingBehavior,omitempty"` 8894} 8895 8896// UnmarshalJSON is the custom unmarshaler for RuleUpdatePropertiesParameters struct. 8897func (rupp *RuleUpdatePropertiesParameters) UnmarshalJSON(body []byte) error { 8898 var m map[string]*json.RawMessage 8899 err := json.Unmarshal(body, &m) 8900 if err != nil { 8901 return err 8902 } 8903 for k, v := range m { 8904 switch k { 8905 case "order": 8906 if v != nil { 8907 var order int32 8908 err = json.Unmarshal(*v, &order) 8909 if err != nil { 8910 return err 8911 } 8912 rupp.Order = &order 8913 } 8914 case "conditions": 8915 if v != nil { 8916 conditions, err := unmarshalBasicDeliveryRuleConditionArray(*v) 8917 if err != nil { 8918 return err 8919 } 8920 rupp.Conditions = &conditions 8921 } 8922 case "actions": 8923 if v != nil { 8924 actions, err := unmarshalBasicDeliveryRuleActionArray(*v) 8925 if err != nil { 8926 return err 8927 } 8928 rupp.Actions = &actions 8929 } 8930 case "matchProcessingBehavior": 8931 if v != nil { 8932 var matchProcessingBehavior MatchProcessingBehavior 8933 err = json.Unmarshal(*v, &matchProcessingBehavior) 8934 if err != nil { 8935 return err 8936 } 8937 rupp.MatchProcessingBehavior = matchProcessingBehavior 8938 } 8939 } 8940 } 8941 8942 return nil 8943} 8944 8945// Secret friendly Secret name mapping to the any Secret or secret related information. 8946type Secret struct { 8947 autorest.Response `json:"-"` 8948 *SecretProperties `json:"properties,omitempty"` 8949 // SystemData - READ-ONLY 8950 SystemData *SystemData `json:"systemData,omitempty"` 8951 // ID - READ-ONLY; Resource ID. 8952 ID *string `json:"id,omitempty"` 8953 // Name - READ-ONLY; Resource name. 8954 Name *string `json:"name,omitempty"` 8955 // Type - READ-ONLY; Resource type. 8956 Type *string `json:"type,omitempty"` 8957} 8958 8959// MarshalJSON is the custom marshaler for Secret. 8960func (s Secret) MarshalJSON() ([]byte, error) { 8961 objectMap := make(map[string]interface{}) 8962 if s.SecretProperties != nil { 8963 objectMap["properties"] = s.SecretProperties 8964 } 8965 return json.Marshal(objectMap) 8966} 8967 8968// UnmarshalJSON is the custom unmarshaler for Secret struct. 8969func (s *Secret) UnmarshalJSON(body []byte) error { 8970 var m map[string]*json.RawMessage 8971 err := json.Unmarshal(body, &m) 8972 if err != nil { 8973 return err 8974 } 8975 for k, v := range m { 8976 switch k { 8977 case "properties": 8978 if v != nil { 8979 var secretProperties SecretProperties 8980 err = json.Unmarshal(*v, &secretProperties) 8981 if err != nil { 8982 return err 8983 } 8984 s.SecretProperties = &secretProperties 8985 } 8986 case "systemData": 8987 if v != nil { 8988 var systemData SystemData 8989 err = json.Unmarshal(*v, &systemData) 8990 if err != nil { 8991 return err 8992 } 8993 s.SystemData = &systemData 8994 } 8995 case "id": 8996 if v != nil { 8997 var ID string 8998 err = json.Unmarshal(*v, &ID) 8999 if err != nil { 9000 return err 9001 } 9002 s.ID = &ID 9003 } 9004 case "name": 9005 if v != nil { 9006 var name string 9007 err = json.Unmarshal(*v, &name) 9008 if err != nil { 9009 return err 9010 } 9011 s.Name = &name 9012 } 9013 case "type": 9014 if v != nil { 9015 var typeVar string 9016 err = json.Unmarshal(*v, &typeVar) 9017 if err != nil { 9018 return err 9019 } 9020 s.Type = &typeVar 9021 } 9022 } 9023 } 9024 9025 return nil 9026} 9027 9028// SecretListResult result of the request to list secrets. It contains a list of Secret objects and a URL 9029// link to get the next set of results. 9030type SecretListResult struct { 9031 autorest.Response `json:"-"` 9032 // Value - READ-ONLY; List of AzureFrontDoor secrets within a profile. 9033 Value *[]Secret `json:"value,omitempty"` 9034 // NextLink - URL to get the next set of Secret objects if there are any. 9035 NextLink *string `json:"nextLink,omitempty"` 9036} 9037 9038// MarshalJSON is the custom marshaler for SecretListResult. 9039func (slr SecretListResult) MarshalJSON() ([]byte, error) { 9040 objectMap := make(map[string]interface{}) 9041 if slr.NextLink != nil { 9042 objectMap["nextLink"] = slr.NextLink 9043 } 9044 return json.Marshal(objectMap) 9045} 9046 9047// SecretListResultIterator provides access to a complete listing of Secret values. 9048type SecretListResultIterator struct { 9049 i int 9050 page SecretListResultPage 9051} 9052 9053// NextWithContext advances to the next value. If there was an error making 9054// the request the iterator does not advance and the error is returned. 9055func (iter *SecretListResultIterator) NextWithContext(ctx context.Context) (err error) { 9056 if tracing.IsEnabled() { 9057 ctx = tracing.StartSpan(ctx, fqdn+"/SecretListResultIterator.NextWithContext") 9058 defer func() { 9059 sc := -1 9060 if iter.Response().Response.Response != nil { 9061 sc = iter.Response().Response.Response.StatusCode 9062 } 9063 tracing.EndSpan(ctx, sc, err) 9064 }() 9065 } 9066 iter.i++ 9067 if iter.i < len(iter.page.Values()) { 9068 return nil 9069 } 9070 err = iter.page.NextWithContext(ctx) 9071 if err != nil { 9072 iter.i-- 9073 return err 9074 } 9075 iter.i = 0 9076 return nil 9077} 9078 9079// Next advances to the next value. If there was an error making 9080// the request the iterator does not advance and the error is returned. 9081// Deprecated: Use NextWithContext() instead. 9082func (iter *SecretListResultIterator) Next() error { 9083 return iter.NextWithContext(context.Background()) 9084} 9085 9086// NotDone returns true if the enumeration should be started or is not yet complete. 9087func (iter SecretListResultIterator) NotDone() bool { 9088 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 9089} 9090 9091// Response returns the raw server response from the last page request. 9092func (iter SecretListResultIterator) Response() SecretListResult { 9093 return iter.page.Response() 9094} 9095 9096// Value returns the current value or a zero-initialized value if the 9097// iterator has advanced beyond the end of the collection. 9098func (iter SecretListResultIterator) Value() Secret { 9099 if !iter.page.NotDone() { 9100 return Secret{} 9101 } 9102 return iter.page.Values()[iter.i] 9103} 9104 9105// Creates a new instance of the SecretListResultIterator type. 9106func NewSecretListResultIterator(page SecretListResultPage) SecretListResultIterator { 9107 return SecretListResultIterator{page: page} 9108} 9109 9110// IsEmpty returns true if the ListResult contains no values. 9111func (slr SecretListResult) IsEmpty() bool { 9112 return slr.Value == nil || len(*slr.Value) == 0 9113} 9114 9115// hasNextLink returns true if the NextLink is not empty. 9116func (slr SecretListResult) hasNextLink() bool { 9117 return slr.NextLink != nil && len(*slr.NextLink) != 0 9118} 9119 9120// secretListResultPreparer prepares a request to retrieve the next set of results. 9121// It returns nil if no more results exist. 9122func (slr SecretListResult) secretListResultPreparer(ctx context.Context) (*http.Request, error) { 9123 if !slr.hasNextLink() { 9124 return nil, nil 9125 } 9126 return autorest.Prepare((&http.Request{}).WithContext(ctx), 9127 autorest.AsJSON(), 9128 autorest.AsGet(), 9129 autorest.WithBaseURL(to.String(slr.NextLink))) 9130} 9131 9132// SecretListResultPage contains a page of Secret values. 9133type SecretListResultPage struct { 9134 fn func(context.Context, SecretListResult) (SecretListResult, error) 9135 slr SecretListResult 9136} 9137 9138// NextWithContext advances to the next page of values. If there was an error making 9139// the request the page does not advance and the error is returned. 9140func (page *SecretListResultPage) NextWithContext(ctx context.Context) (err error) { 9141 if tracing.IsEnabled() { 9142 ctx = tracing.StartSpan(ctx, fqdn+"/SecretListResultPage.NextWithContext") 9143 defer func() { 9144 sc := -1 9145 if page.Response().Response.Response != nil { 9146 sc = page.Response().Response.Response.StatusCode 9147 } 9148 tracing.EndSpan(ctx, sc, err) 9149 }() 9150 } 9151 for { 9152 next, err := page.fn(ctx, page.slr) 9153 if err != nil { 9154 return err 9155 } 9156 page.slr = next 9157 if !next.hasNextLink() || !next.IsEmpty() { 9158 break 9159 } 9160 } 9161 return nil 9162} 9163 9164// Next advances to the next page of values. If there was an error making 9165// the request the page does not advance and the error is returned. 9166// Deprecated: Use NextWithContext() instead. 9167func (page *SecretListResultPage) Next() error { 9168 return page.NextWithContext(context.Background()) 9169} 9170 9171// NotDone returns true if the page enumeration should be started or is not yet complete. 9172func (page SecretListResultPage) NotDone() bool { 9173 return !page.slr.IsEmpty() 9174} 9175 9176// Response returns the raw server response from the last page request. 9177func (page SecretListResultPage) Response() SecretListResult { 9178 return page.slr 9179} 9180 9181// Values returns the slice of values for the current page or nil if there are no values. 9182func (page SecretListResultPage) Values() []Secret { 9183 if page.slr.IsEmpty() { 9184 return nil 9185 } 9186 return *page.slr.Value 9187} 9188 9189// Creates a new instance of the SecretListResultPage type. 9190func NewSecretListResultPage(cur SecretListResult, getNextPage func(context.Context, SecretListResult) (SecretListResult, error)) SecretListResultPage { 9191 return SecretListResultPage{ 9192 fn: getNextPage, 9193 slr: cur, 9194 } 9195} 9196 9197// BasicSecretParameters the json object containing secret parameters 9198type BasicSecretParameters interface { 9199 AsURLSigningKeyParameters() (*URLSigningKeyParameters, bool) 9200 AsManagedCertificateParameters() (*ManagedCertificateParameters, bool) 9201 AsCustomerCertificateParameters() (*CustomerCertificateParameters, bool) 9202 AsSecretParameters() (*SecretParameters, bool) 9203} 9204 9205// SecretParameters the json object containing secret parameters 9206type SecretParameters struct { 9207 // Type - Possible values include: 'TypeSecretParameters', 'TypeURLSigningKey', 'TypeManagedCertificate', 'TypeCustomerCertificate' 9208 Type TypeBasicSecretParameters `json:"type,omitempty"` 9209} 9210 9211func unmarshalBasicSecretParameters(body []byte) (BasicSecretParameters, error) { 9212 var m map[string]interface{} 9213 err := json.Unmarshal(body, &m) 9214 if err != nil { 9215 return nil, err 9216 } 9217 9218 switch m["type"] { 9219 case string(TypeURLSigningKey): 9220 var uskp URLSigningKeyParameters 9221 err := json.Unmarshal(body, &uskp) 9222 return uskp, err 9223 case string(TypeManagedCertificate): 9224 var mcp ManagedCertificateParameters 9225 err := json.Unmarshal(body, &mcp) 9226 return mcp, err 9227 case string(TypeCustomerCertificate): 9228 var ccp CustomerCertificateParameters 9229 err := json.Unmarshal(body, &ccp) 9230 return ccp, err 9231 default: 9232 var sp SecretParameters 9233 err := json.Unmarshal(body, &sp) 9234 return sp, err 9235 } 9236} 9237func unmarshalBasicSecretParametersArray(body []byte) ([]BasicSecretParameters, error) { 9238 var rawMessages []*json.RawMessage 9239 err := json.Unmarshal(body, &rawMessages) 9240 if err != nil { 9241 return nil, err 9242 } 9243 9244 spArray := make([]BasicSecretParameters, len(rawMessages)) 9245 9246 for index, rawMessage := range rawMessages { 9247 sp, err := unmarshalBasicSecretParameters(*rawMessage) 9248 if err != nil { 9249 return nil, err 9250 } 9251 spArray[index] = sp 9252 } 9253 return spArray, nil 9254} 9255 9256// MarshalJSON is the custom marshaler for SecretParameters. 9257func (sp SecretParameters) MarshalJSON() ([]byte, error) { 9258 sp.Type = TypeSecretParameters 9259 objectMap := make(map[string]interface{}) 9260 if sp.Type != "" { 9261 objectMap["type"] = sp.Type 9262 } 9263 return json.Marshal(objectMap) 9264} 9265 9266// AsURLSigningKeyParameters is the BasicSecretParameters implementation for SecretParameters. 9267func (sp SecretParameters) AsURLSigningKeyParameters() (*URLSigningKeyParameters, bool) { 9268 return nil, false 9269} 9270 9271// AsManagedCertificateParameters is the BasicSecretParameters implementation for SecretParameters. 9272func (sp SecretParameters) AsManagedCertificateParameters() (*ManagedCertificateParameters, bool) { 9273 return nil, false 9274} 9275 9276// AsCustomerCertificateParameters is the BasicSecretParameters implementation for SecretParameters. 9277func (sp SecretParameters) AsCustomerCertificateParameters() (*CustomerCertificateParameters, bool) { 9278 return nil, false 9279} 9280 9281// AsSecretParameters is the BasicSecretParameters implementation for SecretParameters. 9282func (sp SecretParameters) AsSecretParameters() (*SecretParameters, bool) { 9283 return &sp, true 9284} 9285 9286// AsBasicSecretParameters is the BasicSecretParameters implementation for SecretParameters. 9287func (sp SecretParameters) AsBasicSecretParameters() (BasicSecretParameters, bool) { 9288 return &sp, true 9289} 9290 9291// SecretProperties the JSON object that contains the properties of the Secret to create. 9292type SecretProperties struct { 9293 // Parameters - object which contains secret parameters 9294 Parameters BasicSecretParameters `json:"parameters,omitempty"` 9295 // ProvisioningState - READ-ONLY; Provisioning status. Possible values include: 'Succeeded', 'Failed', 'Updating', 'Deleting', 'Creating' 9296 ProvisioningState AfdProvisioningState `json:"provisioningState,omitempty"` 9297 // DeploymentStatus - READ-ONLY; Possible values include: 'DeploymentStatusNotStarted', 'DeploymentStatusInProgress', 'DeploymentStatusSucceeded', 'DeploymentStatusFailed' 9298 DeploymentStatus DeploymentStatus `json:"deploymentStatus,omitempty"` 9299} 9300 9301// MarshalJSON is the custom marshaler for SecretProperties. 9302func (sp SecretProperties) MarshalJSON() ([]byte, error) { 9303 objectMap := make(map[string]interface{}) 9304 objectMap["parameters"] = sp.Parameters 9305 return json.Marshal(objectMap) 9306} 9307 9308// UnmarshalJSON is the custom unmarshaler for SecretProperties struct. 9309func (sp *SecretProperties) UnmarshalJSON(body []byte) error { 9310 var m map[string]*json.RawMessage 9311 err := json.Unmarshal(body, &m) 9312 if err != nil { 9313 return err 9314 } 9315 for k, v := range m { 9316 switch k { 9317 case "parameters": 9318 if v != nil { 9319 parameters, err := unmarshalBasicSecretParameters(*v) 9320 if err != nil { 9321 return err 9322 } 9323 sp.Parameters = parameters 9324 } 9325 case "provisioningState": 9326 if v != nil { 9327 var provisioningState AfdProvisioningState 9328 err = json.Unmarshal(*v, &provisioningState) 9329 if err != nil { 9330 return err 9331 } 9332 sp.ProvisioningState = provisioningState 9333 } 9334 case "deploymentStatus": 9335 if v != nil { 9336 var deploymentStatus DeploymentStatus 9337 err = json.Unmarshal(*v, &deploymentStatus) 9338 if err != nil { 9339 return err 9340 } 9341 sp.DeploymentStatus = deploymentStatus 9342 } 9343 } 9344 } 9345 9346 return nil 9347} 9348 9349// SecretsCreateFuture an abstraction for monitoring and retrieving the results of a long-running 9350// operation. 9351type SecretsCreateFuture struct { 9352 azure.FutureAPI 9353 // Result returns the result of the asynchronous operation. 9354 // If the operation has not completed it will return an error. 9355 Result func(SecretsClient) (Secret, error) 9356} 9357 9358// SecretsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running 9359// operation. 9360type SecretsDeleteFuture struct { 9361 azure.FutureAPI 9362 // Result returns the result of the asynchronous operation. 9363 // If the operation has not completed it will return an error. 9364 Result func(SecretsClient) (autorest.Response, error) 9365} 9366 9367// SecretsUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 9368// operation. 9369type SecretsUpdateFuture struct { 9370 azure.FutureAPI 9371 // Result returns the result of the asynchronous operation. 9372 // If the operation has not completed it will return an error. 9373 Result func(SecretsClient) (Secret, error) 9374} 9375 9376// SecurityPoliciesCreateFuture an abstraction for monitoring and retrieving the results of a long-running 9377// operation. 9378type SecurityPoliciesCreateFuture struct { 9379 azure.FutureAPI 9380 // Result returns the result of the asynchronous operation. 9381 // If the operation has not completed it will return an error. 9382 Result func(SecurityPoliciesClient) (SecurityPolicy, error) 9383} 9384 9385// SecurityPoliciesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running 9386// operation. 9387type SecurityPoliciesDeleteFuture struct { 9388 azure.FutureAPI 9389 // Result returns the result of the asynchronous operation. 9390 // If the operation has not completed it will return an error. 9391 Result func(SecurityPoliciesClient) (autorest.Response, error) 9392} 9393 9394// SecurityPoliciesPatchFuture an abstraction for monitoring and retrieving the results of a long-running 9395// operation. 9396type SecurityPoliciesPatchFuture struct { 9397 azure.FutureAPI 9398 // Result returns the result of the asynchronous operation. 9399 // If the operation has not completed it will return an error. 9400 Result func(SecurityPoliciesClient) (SecurityPolicy, error) 9401} 9402 9403// SecurityPolicy securityPolicy association for AzureFrontDoor profile 9404type SecurityPolicy struct { 9405 autorest.Response `json:"-"` 9406 *SecurityPolicyProperties `json:"properties,omitempty"` 9407 // SystemData - READ-ONLY 9408 SystemData *SystemData `json:"systemData,omitempty"` 9409 // ID - READ-ONLY; Resource ID. 9410 ID *string `json:"id,omitempty"` 9411 // Name - READ-ONLY; Resource name. 9412 Name *string `json:"name,omitempty"` 9413 // Type - READ-ONLY; Resource type. 9414 Type *string `json:"type,omitempty"` 9415} 9416 9417// MarshalJSON is the custom marshaler for SecurityPolicy. 9418func (sp SecurityPolicy) MarshalJSON() ([]byte, error) { 9419 objectMap := make(map[string]interface{}) 9420 if sp.SecurityPolicyProperties != nil { 9421 objectMap["properties"] = sp.SecurityPolicyProperties 9422 } 9423 return json.Marshal(objectMap) 9424} 9425 9426// UnmarshalJSON is the custom unmarshaler for SecurityPolicy struct. 9427func (sp *SecurityPolicy) UnmarshalJSON(body []byte) error { 9428 var m map[string]*json.RawMessage 9429 err := json.Unmarshal(body, &m) 9430 if err != nil { 9431 return err 9432 } 9433 for k, v := range m { 9434 switch k { 9435 case "properties": 9436 if v != nil { 9437 var securityPolicyProperties SecurityPolicyProperties 9438 err = json.Unmarshal(*v, &securityPolicyProperties) 9439 if err != nil { 9440 return err 9441 } 9442 sp.SecurityPolicyProperties = &securityPolicyProperties 9443 } 9444 case "systemData": 9445 if v != nil { 9446 var systemData SystemData 9447 err = json.Unmarshal(*v, &systemData) 9448 if err != nil { 9449 return err 9450 } 9451 sp.SystemData = &systemData 9452 } 9453 case "id": 9454 if v != nil { 9455 var ID string 9456 err = json.Unmarshal(*v, &ID) 9457 if err != nil { 9458 return err 9459 } 9460 sp.ID = &ID 9461 } 9462 case "name": 9463 if v != nil { 9464 var name string 9465 err = json.Unmarshal(*v, &name) 9466 if err != nil { 9467 return err 9468 } 9469 sp.Name = &name 9470 } 9471 case "type": 9472 if v != nil { 9473 var typeVar string 9474 err = json.Unmarshal(*v, &typeVar) 9475 if err != nil { 9476 return err 9477 } 9478 sp.Type = &typeVar 9479 } 9480 } 9481 } 9482 9483 return nil 9484} 9485 9486// SecurityPolicyListResult result of the request to list security policies. It contains a list of security 9487// policy objects and a URL link to get the next set of results. 9488type SecurityPolicyListResult struct { 9489 autorest.Response `json:"-"` 9490 // Value - READ-ONLY; List of Security policies within a profile 9491 Value *[]SecurityPolicy `json:"value,omitempty"` 9492 // NextLink - URL to get the next set of security policy objects if there is any. 9493 NextLink *string `json:"nextLink,omitempty"` 9494} 9495 9496// MarshalJSON is the custom marshaler for SecurityPolicyListResult. 9497func (splr SecurityPolicyListResult) MarshalJSON() ([]byte, error) { 9498 objectMap := make(map[string]interface{}) 9499 if splr.NextLink != nil { 9500 objectMap["nextLink"] = splr.NextLink 9501 } 9502 return json.Marshal(objectMap) 9503} 9504 9505// SecurityPolicyListResultIterator provides access to a complete listing of SecurityPolicy values. 9506type SecurityPolicyListResultIterator struct { 9507 i int 9508 page SecurityPolicyListResultPage 9509} 9510 9511// NextWithContext advances to the next value. If there was an error making 9512// the request the iterator does not advance and the error is returned. 9513func (iter *SecurityPolicyListResultIterator) NextWithContext(ctx context.Context) (err error) { 9514 if tracing.IsEnabled() { 9515 ctx = tracing.StartSpan(ctx, fqdn+"/SecurityPolicyListResultIterator.NextWithContext") 9516 defer func() { 9517 sc := -1 9518 if iter.Response().Response.Response != nil { 9519 sc = iter.Response().Response.Response.StatusCode 9520 } 9521 tracing.EndSpan(ctx, sc, err) 9522 }() 9523 } 9524 iter.i++ 9525 if iter.i < len(iter.page.Values()) { 9526 return nil 9527 } 9528 err = iter.page.NextWithContext(ctx) 9529 if err != nil { 9530 iter.i-- 9531 return err 9532 } 9533 iter.i = 0 9534 return nil 9535} 9536 9537// Next advances to the next value. If there was an error making 9538// the request the iterator does not advance and the error is returned. 9539// Deprecated: Use NextWithContext() instead. 9540func (iter *SecurityPolicyListResultIterator) Next() error { 9541 return iter.NextWithContext(context.Background()) 9542} 9543 9544// NotDone returns true if the enumeration should be started or is not yet complete. 9545func (iter SecurityPolicyListResultIterator) NotDone() bool { 9546 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 9547} 9548 9549// Response returns the raw server response from the last page request. 9550func (iter SecurityPolicyListResultIterator) Response() SecurityPolicyListResult { 9551 return iter.page.Response() 9552} 9553 9554// Value returns the current value or a zero-initialized value if the 9555// iterator has advanced beyond the end of the collection. 9556func (iter SecurityPolicyListResultIterator) Value() SecurityPolicy { 9557 if !iter.page.NotDone() { 9558 return SecurityPolicy{} 9559 } 9560 return iter.page.Values()[iter.i] 9561} 9562 9563// Creates a new instance of the SecurityPolicyListResultIterator type. 9564func NewSecurityPolicyListResultIterator(page SecurityPolicyListResultPage) SecurityPolicyListResultIterator { 9565 return SecurityPolicyListResultIterator{page: page} 9566} 9567 9568// IsEmpty returns true if the ListResult contains no values. 9569func (splr SecurityPolicyListResult) IsEmpty() bool { 9570 return splr.Value == nil || len(*splr.Value) == 0 9571} 9572 9573// hasNextLink returns true if the NextLink is not empty. 9574func (splr SecurityPolicyListResult) hasNextLink() bool { 9575 return splr.NextLink != nil && len(*splr.NextLink) != 0 9576} 9577 9578// securityPolicyListResultPreparer prepares a request to retrieve the next set of results. 9579// It returns nil if no more results exist. 9580func (splr SecurityPolicyListResult) securityPolicyListResultPreparer(ctx context.Context) (*http.Request, error) { 9581 if !splr.hasNextLink() { 9582 return nil, nil 9583 } 9584 return autorest.Prepare((&http.Request{}).WithContext(ctx), 9585 autorest.AsJSON(), 9586 autorest.AsGet(), 9587 autorest.WithBaseURL(to.String(splr.NextLink))) 9588} 9589 9590// SecurityPolicyListResultPage contains a page of SecurityPolicy values. 9591type SecurityPolicyListResultPage struct { 9592 fn func(context.Context, SecurityPolicyListResult) (SecurityPolicyListResult, error) 9593 splr SecurityPolicyListResult 9594} 9595 9596// NextWithContext advances to the next page of values. If there was an error making 9597// the request the page does not advance and the error is returned. 9598func (page *SecurityPolicyListResultPage) NextWithContext(ctx context.Context) (err error) { 9599 if tracing.IsEnabled() { 9600 ctx = tracing.StartSpan(ctx, fqdn+"/SecurityPolicyListResultPage.NextWithContext") 9601 defer func() { 9602 sc := -1 9603 if page.Response().Response.Response != nil { 9604 sc = page.Response().Response.Response.StatusCode 9605 } 9606 tracing.EndSpan(ctx, sc, err) 9607 }() 9608 } 9609 for { 9610 next, err := page.fn(ctx, page.splr) 9611 if err != nil { 9612 return err 9613 } 9614 page.splr = next 9615 if !next.hasNextLink() || !next.IsEmpty() { 9616 break 9617 } 9618 } 9619 return nil 9620} 9621 9622// Next advances to the next page of values. If there was an error making 9623// the request the page does not advance and the error is returned. 9624// Deprecated: Use NextWithContext() instead. 9625func (page *SecurityPolicyListResultPage) Next() error { 9626 return page.NextWithContext(context.Background()) 9627} 9628 9629// NotDone returns true if the page enumeration should be started or is not yet complete. 9630func (page SecurityPolicyListResultPage) NotDone() bool { 9631 return !page.splr.IsEmpty() 9632} 9633 9634// Response returns the raw server response from the last page request. 9635func (page SecurityPolicyListResultPage) Response() SecurityPolicyListResult { 9636 return page.splr 9637} 9638 9639// Values returns the slice of values for the current page or nil if there are no values. 9640func (page SecurityPolicyListResultPage) Values() []SecurityPolicy { 9641 if page.splr.IsEmpty() { 9642 return nil 9643 } 9644 return *page.splr.Value 9645} 9646 9647// Creates a new instance of the SecurityPolicyListResultPage type. 9648func NewSecurityPolicyListResultPage(cur SecurityPolicyListResult, getNextPage func(context.Context, SecurityPolicyListResult) (SecurityPolicyListResult, error)) SecurityPolicyListResultPage { 9649 return SecurityPolicyListResultPage{ 9650 fn: getNextPage, 9651 splr: cur, 9652 } 9653} 9654 9655// BasicSecurityPolicyParameters the json object containing security policy parameters 9656type BasicSecurityPolicyParameters interface { 9657 AsSecurityPolicyWebApplicationFirewallParameters() (*SecurityPolicyWebApplicationFirewallParameters, bool) 9658 AsSecurityPolicyParameters() (*SecurityPolicyParameters, bool) 9659} 9660 9661// SecurityPolicyParameters the json object containing security policy parameters 9662type SecurityPolicyParameters struct { 9663 // Type - Possible values include: 'TypeSecurityPolicyParameters', 'TypeWebApplicationFirewall' 9664 Type Type `json:"type,omitempty"` 9665} 9666 9667func unmarshalBasicSecurityPolicyParameters(body []byte) (BasicSecurityPolicyParameters, error) { 9668 var m map[string]interface{} 9669 err := json.Unmarshal(body, &m) 9670 if err != nil { 9671 return nil, err 9672 } 9673 9674 switch m["type"] { 9675 case string(TypeWebApplicationFirewall): 9676 var spwafp SecurityPolicyWebApplicationFirewallParameters 9677 err := json.Unmarshal(body, &spwafp) 9678 return spwafp, err 9679 default: 9680 var spp SecurityPolicyParameters 9681 err := json.Unmarshal(body, &spp) 9682 return spp, err 9683 } 9684} 9685func unmarshalBasicSecurityPolicyParametersArray(body []byte) ([]BasicSecurityPolicyParameters, error) { 9686 var rawMessages []*json.RawMessage 9687 err := json.Unmarshal(body, &rawMessages) 9688 if err != nil { 9689 return nil, err 9690 } 9691 9692 sppArray := make([]BasicSecurityPolicyParameters, len(rawMessages)) 9693 9694 for index, rawMessage := range rawMessages { 9695 spp, err := unmarshalBasicSecurityPolicyParameters(*rawMessage) 9696 if err != nil { 9697 return nil, err 9698 } 9699 sppArray[index] = spp 9700 } 9701 return sppArray, nil 9702} 9703 9704// MarshalJSON is the custom marshaler for SecurityPolicyParameters. 9705func (spp SecurityPolicyParameters) MarshalJSON() ([]byte, error) { 9706 spp.Type = TypeSecurityPolicyParameters 9707 objectMap := make(map[string]interface{}) 9708 if spp.Type != "" { 9709 objectMap["type"] = spp.Type 9710 } 9711 return json.Marshal(objectMap) 9712} 9713 9714// AsSecurityPolicyWebApplicationFirewallParameters is the BasicSecurityPolicyParameters implementation for SecurityPolicyParameters. 9715func (spp SecurityPolicyParameters) AsSecurityPolicyWebApplicationFirewallParameters() (*SecurityPolicyWebApplicationFirewallParameters, bool) { 9716 return nil, false 9717} 9718 9719// AsSecurityPolicyParameters is the BasicSecurityPolicyParameters implementation for SecurityPolicyParameters. 9720func (spp SecurityPolicyParameters) AsSecurityPolicyParameters() (*SecurityPolicyParameters, bool) { 9721 return &spp, true 9722} 9723 9724// AsBasicSecurityPolicyParameters is the BasicSecurityPolicyParameters implementation for SecurityPolicyParameters. 9725func (spp SecurityPolicyParameters) AsBasicSecurityPolicyParameters() (BasicSecurityPolicyParameters, bool) { 9726 return &spp, true 9727} 9728 9729// SecurityPolicyProperties the json object that contains properties required to create a security policy 9730type SecurityPolicyProperties struct { 9731 // Parameters - object which contains security policy parameters 9732 Parameters BasicSecurityPolicyParameters `json:"parameters,omitempty"` 9733 // ProvisioningState - READ-ONLY; Provisioning status. Possible values include: 'Succeeded', 'Failed', 'Updating', 'Deleting', 'Creating' 9734 ProvisioningState AfdProvisioningState `json:"provisioningState,omitempty"` 9735 // DeploymentStatus - READ-ONLY; Possible values include: 'DeploymentStatusNotStarted', 'DeploymentStatusInProgress', 'DeploymentStatusSucceeded', 'DeploymentStatusFailed' 9736 DeploymentStatus DeploymentStatus `json:"deploymentStatus,omitempty"` 9737} 9738 9739// MarshalJSON is the custom marshaler for SecurityPolicyProperties. 9740func (spp SecurityPolicyProperties) MarshalJSON() ([]byte, error) { 9741 objectMap := make(map[string]interface{}) 9742 objectMap["parameters"] = spp.Parameters 9743 return json.Marshal(objectMap) 9744} 9745 9746// UnmarshalJSON is the custom unmarshaler for SecurityPolicyProperties struct. 9747func (spp *SecurityPolicyProperties) UnmarshalJSON(body []byte) error { 9748 var m map[string]*json.RawMessage 9749 err := json.Unmarshal(body, &m) 9750 if err != nil { 9751 return err 9752 } 9753 for k, v := range m { 9754 switch k { 9755 case "parameters": 9756 if v != nil { 9757 parameters, err := unmarshalBasicSecurityPolicyParameters(*v) 9758 if err != nil { 9759 return err 9760 } 9761 spp.Parameters = parameters 9762 } 9763 case "provisioningState": 9764 if v != nil { 9765 var provisioningState AfdProvisioningState 9766 err = json.Unmarshal(*v, &provisioningState) 9767 if err != nil { 9768 return err 9769 } 9770 spp.ProvisioningState = provisioningState 9771 } 9772 case "deploymentStatus": 9773 if v != nil { 9774 var deploymentStatus DeploymentStatus 9775 err = json.Unmarshal(*v, &deploymentStatus) 9776 if err != nil { 9777 return err 9778 } 9779 spp.DeploymentStatus = deploymentStatus 9780 } 9781 } 9782 } 9783 9784 return nil 9785} 9786 9787// SecurityPolicyWebApplicationFirewallAssociation settings for security policy patterns to match 9788type SecurityPolicyWebApplicationFirewallAssociation struct { 9789 // Domains - List of domains. 9790 Domains *[]ResourceReference `json:"domains,omitempty"` 9791 // PatternsToMatch - List of paths 9792 PatternsToMatch *[]string `json:"patternsToMatch,omitempty"` 9793} 9794 9795// SecurityPolicyWebApplicationFirewallParameters the json object containing security policy waf parameters 9796type SecurityPolicyWebApplicationFirewallParameters struct { 9797 // WafPolicy - Resource ID. 9798 WafPolicy *ResourceReference `json:"wafPolicy,omitempty"` 9799 // Associations - Waf associations 9800 Associations *[]SecurityPolicyWebApplicationFirewallAssociation `json:"associations,omitempty"` 9801 // Type - Possible values include: 'TypeSecurityPolicyParameters', 'TypeWebApplicationFirewall' 9802 Type Type `json:"type,omitempty"` 9803} 9804 9805// MarshalJSON is the custom marshaler for SecurityPolicyWebApplicationFirewallParameters. 9806func (spwafp SecurityPolicyWebApplicationFirewallParameters) MarshalJSON() ([]byte, error) { 9807 spwafp.Type = TypeWebApplicationFirewall 9808 objectMap := make(map[string]interface{}) 9809 if spwafp.WafPolicy != nil { 9810 objectMap["wafPolicy"] = spwafp.WafPolicy 9811 } 9812 if spwafp.Associations != nil { 9813 objectMap["associations"] = spwafp.Associations 9814 } 9815 if spwafp.Type != "" { 9816 objectMap["type"] = spwafp.Type 9817 } 9818 return json.Marshal(objectMap) 9819} 9820 9821// AsSecurityPolicyWebApplicationFirewallParameters is the BasicSecurityPolicyParameters implementation for SecurityPolicyWebApplicationFirewallParameters. 9822func (spwafp SecurityPolicyWebApplicationFirewallParameters) AsSecurityPolicyWebApplicationFirewallParameters() (*SecurityPolicyWebApplicationFirewallParameters, bool) { 9823 return &spwafp, true 9824} 9825 9826// AsSecurityPolicyParameters is the BasicSecurityPolicyParameters implementation for SecurityPolicyWebApplicationFirewallParameters. 9827func (spwafp SecurityPolicyWebApplicationFirewallParameters) AsSecurityPolicyParameters() (*SecurityPolicyParameters, bool) { 9828 return nil, false 9829} 9830 9831// AsBasicSecurityPolicyParameters is the BasicSecurityPolicyParameters implementation for SecurityPolicyWebApplicationFirewallParameters. 9832func (spwafp SecurityPolicyWebApplicationFirewallParameters) AsBasicSecurityPolicyParameters() (BasicSecurityPolicyParameters, bool) { 9833 return &spwafp, true 9834} 9835 9836// SharedPrivateLinkResourceProperties describes the properties of an existing Shared Private Link Resource 9837// to use when connecting to a private origin. 9838type SharedPrivateLinkResourceProperties struct { 9839 // PrivateLink - The resource id of the resource the shared private link resource is for. 9840 PrivateLink *ResourceReference `json:"privateLink,omitempty"` 9841 // PrivateLinkLocation - The location of the shared private link resource 9842 PrivateLinkLocation *string `json:"privateLinkLocation,omitempty"` 9843 // GroupID - The group id from the provider of resource the shared private link resource is for. 9844 GroupID *string `json:"groupId,omitempty"` 9845 // RequestMessage - The request message for requesting approval of the shared private link resource. 9846 RequestMessage *string `json:"requestMessage,omitempty"` 9847 // Status - Status of the shared private link resource. Can be Pending, Approved, Rejected, Disconnected, or Timeout. Possible values include: 'SharedPrivateLinkResourceStatusPending', 'SharedPrivateLinkResourceStatusApproved', 'SharedPrivateLinkResourceStatusRejected', 'SharedPrivateLinkResourceStatusDisconnected', 'SharedPrivateLinkResourceStatusTimeout' 9848 Status SharedPrivateLinkResourceStatus `json:"status,omitempty"` 9849} 9850 9851// Sku the pricing tier (defines a CDN provider, feature list and rate) of the CDN profile. 9852type Sku struct { 9853 // Name - Name of the pricing tier. Possible values include: 'StandardVerizon', 'PremiumVerizon', 'CustomVerizon', 'StandardAkamai', 'StandardChinaCdn', 'StandardMicrosoft', 'PremiumChinaCdn', 'StandardAzureFrontDoor', 'PremiumAzureFrontDoor', 'Standard955BandWidthChinaCdn', 'StandardAvgBandWidthChinaCdn', 'StandardPlusChinaCdn', 'StandardPlus955BandWidthChinaCdn', 'StandardPlusAvgBandWidthChinaCdn' 9854 Name SkuName `json:"name,omitempty"` 9855} 9856 9857// SsoURI the URI required to login to the supplemental portal from the Azure portal. 9858type SsoURI struct { 9859 autorest.Response `json:"-"` 9860 // SsoURIValue - READ-ONLY; The URI used to login to the supplemental portal. 9861 SsoURIValue *string `json:"ssoUriValue,omitempty"` 9862} 9863 9864// SupportedOptimizationTypesListResult the result of the GetSupportedOptimizationTypes API 9865type SupportedOptimizationTypesListResult struct { 9866 autorest.Response `json:"-"` 9867 // SupportedOptimizationTypes - READ-ONLY; Supported optimization types for a profile. 9868 SupportedOptimizationTypes *[]OptimizationType `json:"supportedOptimizationTypes,omitempty"` 9869} 9870 9871// SystemData read only system data 9872type SystemData struct { 9873 // CreatedBy - An identifier for the identity that created the resource 9874 CreatedBy *string `json:"createdBy,omitempty"` 9875 // CreatedByType - The type of identity that created the resource. Possible values include: 'User', 'Application', 'ManagedIdentity', 'Key' 9876 CreatedByType IdentityType `json:"createdByType,omitempty"` 9877 // CreatedAt - The timestamp of resource creation (UTC) 9878 CreatedAt *date.Time `json:"createdAt,omitempty"` 9879 // LastModifiedBy - An identifier for the identity that last modified the resource 9880 LastModifiedBy *string `json:"lastModifiedBy,omitempty"` 9881 // LastModifiedByType - The type of identity that last modified the resource. Possible values include: 'User', 'Application', 'ManagedIdentity', 'Key' 9882 LastModifiedByType IdentityType `json:"lastModifiedByType,omitempty"` 9883 // LastModifiedAt - The timestamp of resource last modification (UTC) 9884 LastModifiedAt *date.Time `json:"lastModifiedAt,omitempty"` 9885} 9886 9887// TrackedResource the resource model definition for a ARM tracked top level resource. 9888type TrackedResource struct { 9889 // Location - Resource location. 9890 Location *string `json:"location,omitempty"` 9891 // Tags - Resource tags. 9892 Tags map[string]*string `json:"tags"` 9893 // SystemData - READ-ONLY 9894 SystemData *SystemData `json:"systemData,omitempty"` 9895 // ID - READ-ONLY; Resource ID. 9896 ID *string `json:"id,omitempty"` 9897 // Name - READ-ONLY; Resource name. 9898 Name *string `json:"name,omitempty"` 9899 // Type - READ-ONLY; Resource type. 9900 Type *string `json:"type,omitempty"` 9901} 9902 9903// MarshalJSON is the custom marshaler for TrackedResource. 9904func (tr TrackedResource) MarshalJSON() ([]byte, error) { 9905 objectMap := make(map[string]interface{}) 9906 if tr.Location != nil { 9907 objectMap["location"] = tr.Location 9908 } 9909 if tr.Tags != nil { 9910 objectMap["tags"] = tr.Tags 9911 } 9912 return json.Marshal(objectMap) 9913} 9914 9915// URLFileExtensionMatchConditionParameters defines the parameters for UrlFileExtension match conditions 9916type URLFileExtensionMatchConditionParameters struct { 9917 OdataType *string `json:"@odata.type,omitempty"` 9918 // Operator - Describes operator to be matched. Possible values include: 'URLFileExtensionOperatorAny', 'URLFileExtensionOperatorEqual', 'URLFileExtensionOperatorContains', 'URLFileExtensionOperatorBeginsWith', 'URLFileExtensionOperatorEndsWith', 'URLFileExtensionOperatorLessThan', 'URLFileExtensionOperatorLessThanOrEqual', 'URLFileExtensionOperatorGreaterThan', 'URLFileExtensionOperatorGreaterThanOrEqual', 'URLFileExtensionOperatorRegEx' 9919 Operator URLFileExtensionOperator `json:"operator,omitempty"` 9920 // NegateCondition - Describes if this is negate condition or not 9921 NegateCondition *bool `json:"negateCondition,omitempty"` 9922 // MatchValues - The match value for the condition of the delivery rule 9923 MatchValues *[]string `json:"matchValues,omitempty"` 9924 // Transforms - List of transforms 9925 Transforms *[]Transform `json:"transforms,omitempty"` 9926} 9927 9928// URLFileNameMatchConditionParameters defines the parameters for UrlFilename match conditions 9929type URLFileNameMatchConditionParameters struct { 9930 OdataType *string `json:"@odata.type,omitempty"` 9931 // Operator - Describes operator to be matched. Possible values include: 'URLFileNameOperatorAny', 'URLFileNameOperatorEqual', 'URLFileNameOperatorContains', 'URLFileNameOperatorBeginsWith', 'URLFileNameOperatorEndsWith', 'URLFileNameOperatorLessThan', 'URLFileNameOperatorLessThanOrEqual', 'URLFileNameOperatorGreaterThan', 'URLFileNameOperatorGreaterThanOrEqual', 'URLFileNameOperatorRegEx' 9932 Operator URLFileNameOperator `json:"operator,omitempty"` 9933 // NegateCondition - Describes if this is negate condition or not 9934 NegateCondition *bool `json:"negateCondition,omitempty"` 9935 // MatchValues - The match value for the condition of the delivery rule 9936 MatchValues *[]string `json:"matchValues,omitempty"` 9937 // Transforms - List of transforms 9938 Transforms *[]Transform `json:"transforms,omitempty"` 9939} 9940 9941// URLPathMatchConditionParameters defines the parameters for UrlPath match conditions 9942type URLPathMatchConditionParameters struct { 9943 OdataType *string `json:"@odata.type,omitempty"` 9944 // Operator - Describes operator to be matched. Possible values include: 'URLPathOperatorAny', 'URLPathOperatorEqual', 'URLPathOperatorContains', 'URLPathOperatorBeginsWith', 'URLPathOperatorEndsWith', 'URLPathOperatorLessThan', 'URLPathOperatorLessThanOrEqual', 'URLPathOperatorGreaterThan', 'URLPathOperatorGreaterThanOrEqual', 'URLPathOperatorWildcard', 'URLPathOperatorRegEx' 9945 Operator URLPathOperator `json:"operator,omitempty"` 9946 // NegateCondition - Describes if this is negate condition or not 9947 NegateCondition *bool `json:"negateCondition,omitempty"` 9948 // MatchValues - The match value for the condition of the delivery rule 9949 MatchValues *[]string `json:"matchValues,omitempty"` 9950 // Transforms - List of transforms 9951 Transforms *[]Transform `json:"transforms,omitempty"` 9952} 9953 9954// URLRedirectAction defines the url redirect action for the delivery rule. 9955type URLRedirectAction struct { 9956 // Parameters - Defines the parameters for the action. 9957 Parameters *URLRedirectActionParameters `json:"parameters,omitempty"` 9958 // Name - Possible values include: 'NameDeliveryRuleAction', 'NameURLRedirect', 'NameURLSigning', 'NameOriginGroupOverride', 'NameURLRewrite', 'NameModifyRequestHeader', 'NameModifyResponseHeader', 'NameCacheExpiration', 'NameCacheKeyQueryString' 9959 Name NameBasicDeliveryRuleAction `json:"name,omitempty"` 9960} 9961 9962// MarshalJSON is the custom marshaler for URLRedirectAction. 9963func (ura URLRedirectAction) MarshalJSON() ([]byte, error) { 9964 ura.Name = NameURLRedirect 9965 objectMap := make(map[string]interface{}) 9966 if ura.Parameters != nil { 9967 objectMap["parameters"] = ura.Parameters 9968 } 9969 if ura.Name != "" { 9970 objectMap["name"] = ura.Name 9971 } 9972 return json.Marshal(objectMap) 9973} 9974 9975// AsURLRedirectAction is the BasicDeliveryRuleAction implementation for URLRedirectAction. 9976func (ura URLRedirectAction) AsURLRedirectAction() (*URLRedirectAction, bool) { 9977 return &ura, true 9978} 9979 9980// AsURLSigningAction is the BasicDeliveryRuleAction implementation for URLRedirectAction. 9981func (ura URLRedirectAction) AsURLSigningAction() (*URLSigningAction, bool) { 9982 return nil, false 9983} 9984 9985// AsOriginGroupOverrideAction is the BasicDeliveryRuleAction implementation for URLRedirectAction. 9986func (ura URLRedirectAction) AsOriginGroupOverrideAction() (*OriginGroupOverrideAction, bool) { 9987 return nil, false 9988} 9989 9990// AsURLRewriteAction is the BasicDeliveryRuleAction implementation for URLRedirectAction. 9991func (ura URLRedirectAction) AsURLRewriteAction() (*URLRewriteAction, bool) { 9992 return nil, false 9993} 9994 9995// AsDeliveryRuleRequestHeaderAction is the BasicDeliveryRuleAction implementation for URLRedirectAction. 9996func (ura URLRedirectAction) AsDeliveryRuleRequestHeaderAction() (*DeliveryRuleRequestHeaderAction, bool) { 9997 return nil, false 9998} 9999 10000// AsDeliveryRuleResponseHeaderAction is the BasicDeliveryRuleAction implementation for URLRedirectAction. 10001func (ura URLRedirectAction) AsDeliveryRuleResponseHeaderAction() (*DeliveryRuleResponseHeaderAction, bool) { 10002 return nil, false 10003} 10004 10005// AsDeliveryRuleCacheExpirationAction is the BasicDeliveryRuleAction implementation for URLRedirectAction. 10006func (ura URLRedirectAction) AsDeliveryRuleCacheExpirationAction() (*DeliveryRuleCacheExpirationAction, bool) { 10007 return nil, false 10008} 10009 10010// AsDeliveryRuleCacheKeyQueryStringAction is the BasicDeliveryRuleAction implementation for URLRedirectAction. 10011func (ura URLRedirectAction) AsDeliveryRuleCacheKeyQueryStringAction() (*DeliveryRuleCacheKeyQueryStringAction, bool) { 10012 return nil, false 10013} 10014 10015// AsDeliveryRuleAction is the BasicDeliveryRuleAction implementation for URLRedirectAction. 10016func (ura URLRedirectAction) AsDeliveryRuleAction() (*DeliveryRuleAction, bool) { 10017 return nil, false 10018} 10019 10020// AsBasicDeliveryRuleAction is the BasicDeliveryRuleAction implementation for URLRedirectAction. 10021func (ura URLRedirectAction) AsBasicDeliveryRuleAction() (BasicDeliveryRuleAction, bool) { 10022 return &ura, true 10023} 10024 10025// URLRedirectActionParameters defines the parameters for the url redirect action. 10026type URLRedirectActionParameters struct { 10027 OdataType *string `json:"@odata.type,omitempty"` 10028 // RedirectType - The redirect type the rule will use when redirecting traffic. Possible values include: 'Moved', 'Found', 'TemporaryRedirect', 'PermanentRedirect' 10029 RedirectType RedirectType `json:"redirectType,omitempty"` 10030 // DestinationProtocol - Protocol to use for the redirect. The default value is MatchRequest. Possible values include: 'DestinationProtocolMatchRequest', 'DestinationProtocolHTTP', 'DestinationProtocolHTTPS' 10031 DestinationProtocol DestinationProtocol `json:"destinationProtocol,omitempty"` 10032 // CustomPath - The full path to redirect. Path cannot be empty and must start with /. Leave empty to use the incoming path as destination path. 10033 CustomPath *string `json:"customPath,omitempty"` 10034 // CustomHostname - Host to redirect. Leave empty to use the incoming host as the destination host. 10035 CustomHostname *string `json:"customHostname,omitempty"` 10036 // 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. 10037 CustomQueryString *string `json:"customQueryString,omitempty"` 10038 // CustomFragment - Fragment to add to the redirect URL. Fragment is the part of the URL that comes after #. Do not include the #. 10039 CustomFragment *string `json:"customFragment,omitempty"` 10040} 10041 10042// URLRewriteAction defines the url rewrite action for the delivery rule. 10043type URLRewriteAction struct { 10044 // Parameters - Defines the parameters for the action. 10045 Parameters *URLRewriteActionParameters `json:"parameters,omitempty"` 10046 // Name - Possible values include: 'NameDeliveryRuleAction', 'NameURLRedirect', 'NameURLSigning', 'NameOriginGroupOverride', 'NameURLRewrite', 'NameModifyRequestHeader', 'NameModifyResponseHeader', 'NameCacheExpiration', 'NameCacheKeyQueryString' 10047 Name NameBasicDeliveryRuleAction `json:"name,omitempty"` 10048} 10049 10050// MarshalJSON is the custom marshaler for URLRewriteAction. 10051func (ura URLRewriteAction) MarshalJSON() ([]byte, error) { 10052 ura.Name = NameURLRewrite 10053 objectMap := make(map[string]interface{}) 10054 if ura.Parameters != nil { 10055 objectMap["parameters"] = ura.Parameters 10056 } 10057 if ura.Name != "" { 10058 objectMap["name"] = ura.Name 10059 } 10060 return json.Marshal(objectMap) 10061} 10062 10063// AsURLRedirectAction is the BasicDeliveryRuleAction implementation for URLRewriteAction. 10064func (ura URLRewriteAction) AsURLRedirectAction() (*URLRedirectAction, bool) { 10065 return nil, false 10066} 10067 10068// AsURLSigningAction is the BasicDeliveryRuleAction implementation for URLRewriteAction. 10069func (ura URLRewriteAction) AsURLSigningAction() (*URLSigningAction, bool) { 10070 return nil, false 10071} 10072 10073// AsOriginGroupOverrideAction is the BasicDeliveryRuleAction implementation for URLRewriteAction. 10074func (ura URLRewriteAction) AsOriginGroupOverrideAction() (*OriginGroupOverrideAction, bool) { 10075 return nil, false 10076} 10077 10078// AsURLRewriteAction is the BasicDeliveryRuleAction implementation for URLRewriteAction. 10079func (ura URLRewriteAction) AsURLRewriteAction() (*URLRewriteAction, bool) { 10080 return &ura, true 10081} 10082 10083// AsDeliveryRuleRequestHeaderAction is the BasicDeliveryRuleAction implementation for URLRewriteAction. 10084func (ura URLRewriteAction) AsDeliveryRuleRequestHeaderAction() (*DeliveryRuleRequestHeaderAction, bool) { 10085 return nil, false 10086} 10087 10088// AsDeliveryRuleResponseHeaderAction is the BasicDeliveryRuleAction implementation for URLRewriteAction. 10089func (ura URLRewriteAction) AsDeliveryRuleResponseHeaderAction() (*DeliveryRuleResponseHeaderAction, bool) { 10090 return nil, false 10091} 10092 10093// AsDeliveryRuleCacheExpirationAction is the BasicDeliveryRuleAction implementation for URLRewriteAction. 10094func (ura URLRewriteAction) AsDeliveryRuleCacheExpirationAction() (*DeliveryRuleCacheExpirationAction, bool) { 10095 return nil, false 10096} 10097 10098// AsDeliveryRuleCacheKeyQueryStringAction is the BasicDeliveryRuleAction implementation for URLRewriteAction. 10099func (ura URLRewriteAction) AsDeliveryRuleCacheKeyQueryStringAction() (*DeliveryRuleCacheKeyQueryStringAction, bool) { 10100 return nil, false 10101} 10102 10103// AsDeliveryRuleAction is the BasicDeliveryRuleAction implementation for URLRewriteAction. 10104func (ura URLRewriteAction) AsDeliveryRuleAction() (*DeliveryRuleAction, bool) { 10105 return nil, false 10106} 10107 10108// AsBasicDeliveryRuleAction is the BasicDeliveryRuleAction implementation for URLRewriteAction. 10109func (ura URLRewriteAction) AsBasicDeliveryRuleAction() (BasicDeliveryRuleAction, bool) { 10110 return &ura, true 10111} 10112 10113// URLRewriteActionParameters defines the parameters for the url rewrite action. 10114type URLRewriteActionParameters struct { 10115 OdataType *string `json:"@odata.type,omitempty"` 10116 // SourcePattern - define a request URI pattern that identifies the type of requests that may be rewritten. If value is blank, all strings are matched. 10117 SourcePattern *string `json:"sourcePattern,omitempty"` 10118 // Destination - Define the relative URL to which the above requests will be rewritten by. 10119 Destination *string `json:"destination,omitempty"` 10120 // PreserveUnmatchedPath - Whether to preserve unmatched path. Default value is true. 10121 PreserveUnmatchedPath *bool `json:"preserveUnmatchedPath,omitempty"` 10122} 10123 10124// URLSigningAction defines the url signing action for the delivery rule. 10125type URLSigningAction struct { 10126 // Parameters - Defines the parameters for the action. 10127 Parameters *URLSigningActionParameters `json:"parameters,omitempty"` 10128 // Name - Possible values include: 'NameDeliveryRuleAction', 'NameURLRedirect', 'NameURLSigning', 'NameOriginGroupOverride', 'NameURLRewrite', 'NameModifyRequestHeader', 'NameModifyResponseHeader', 'NameCacheExpiration', 'NameCacheKeyQueryString' 10129 Name NameBasicDeliveryRuleAction `json:"name,omitempty"` 10130} 10131 10132// MarshalJSON is the custom marshaler for URLSigningAction. 10133func (usa URLSigningAction) MarshalJSON() ([]byte, error) { 10134 usa.Name = NameURLSigning 10135 objectMap := make(map[string]interface{}) 10136 if usa.Parameters != nil { 10137 objectMap["parameters"] = usa.Parameters 10138 } 10139 if usa.Name != "" { 10140 objectMap["name"] = usa.Name 10141 } 10142 return json.Marshal(objectMap) 10143} 10144 10145// AsURLRedirectAction is the BasicDeliveryRuleAction implementation for URLSigningAction. 10146func (usa URLSigningAction) AsURLRedirectAction() (*URLRedirectAction, bool) { 10147 return nil, false 10148} 10149 10150// AsURLSigningAction is the BasicDeliveryRuleAction implementation for URLSigningAction. 10151func (usa URLSigningAction) AsURLSigningAction() (*URLSigningAction, bool) { 10152 return &usa, true 10153} 10154 10155// AsOriginGroupOverrideAction is the BasicDeliveryRuleAction implementation for URLSigningAction. 10156func (usa URLSigningAction) AsOriginGroupOverrideAction() (*OriginGroupOverrideAction, bool) { 10157 return nil, false 10158} 10159 10160// AsURLRewriteAction is the BasicDeliveryRuleAction implementation for URLSigningAction. 10161func (usa URLSigningAction) AsURLRewriteAction() (*URLRewriteAction, bool) { 10162 return nil, false 10163} 10164 10165// AsDeliveryRuleRequestHeaderAction is the BasicDeliveryRuleAction implementation for URLSigningAction. 10166func (usa URLSigningAction) AsDeliveryRuleRequestHeaderAction() (*DeliveryRuleRequestHeaderAction, bool) { 10167 return nil, false 10168} 10169 10170// AsDeliveryRuleResponseHeaderAction is the BasicDeliveryRuleAction implementation for URLSigningAction. 10171func (usa URLSigningAction) AsDeliveryRuleResponseHeaderAction() (*DeliveryRuleResponseHeaderAction, bool) { 10172 return nil, false 10173} 10174 10175// AsDeliveryRuleCacheExpirationAction is the BasicDeliveryRuleAction implementation for URLSigningAction. 10176func (usa URLSigningAction) AsDeliveryRuleCacheExpirationAction() (*DeliveryRuleCacheExpirationAction, bool) { 10177 return nil, false 10178} 10179 10180// AsDeliveryRuleCacheKeyQueryStringAction is the BasicDeliveryRuleAction implementation for URLSigningAction. 10181func (usa URLSigningAction) AsDeliveryRuleCacheKeyQueryStringAction() (*DeliveryRuleCacheKeyQueryStringAction, bool) { 10182 return nil, false 10183} 10184 10185// AsDeliveryRuleAction is the BasicDeliveryRuleAction implementation for URLSigningAction. 10186func (usa URLSigningAction) AsDeliveryRuleAction() (*DeliveryRuleAction, bool) { 10187 return nil, false 10188} 10189 10190// AsBasicDeliveryRuleAction is the BasicDeliveryRuleAction implementation for URLSigningAction. 10191func (usa URLSigningAction) AsBasicDeliveryRuleAction() (BasicDeliveryRuleAction, bool) { 10192 return &usa, true 10193} 10194 10195// URLSigningActionParameters defines the parameters for the Url Signing action. 10196type URLSigningActionParameters struct { 10197 OdataType *string `json:"@odata.type,omitempty"` 10198 // Algorithm - Algorithm to use for URL signing. Possible values include: 'SHA256' 10199 Algorithm Algorithm `json:"algorithm,omitempty"` 10200 // ParameterNameOverride - Defines which query string parameters in the url to be considered for expires, key id etc. 10201 ParameterNameOverride *[]URLSigningParamIdentifier `json:"parameterNameOverride,omitempty"` 10202} 10203 10204// URLSigningKey url signing key 10205type URLSigningKey struct { 10206 // KeyID - Defines the customer defined key Id. This id will exist in the incoming request to indicate the key used to form the hash. 10207 KeyID *string `json:"keyId,omitempty"` 10208 // KeySourceParameters - Defines the parameters for using customer key vault for Url Signing Key. 10209 KeySourceParameters *KeyVaultSigningKeyParameters `json:"keySourceParameters,omitempty"` 10210} 10211 10212// URLSigningKeyParameters url signing key parameters 10213type URLSigningKeyParameters struct { 10214 // KeyID - Defines the customer defined key Id. This id will exist in the incoming request to indicate the key used to form the hash. 10215 KeyID *string `json:"keyId,omitempty"` 10216 // SecretSource - Resource reference to the KV secret 10217 SecretSource *ResourceReference `json:"secretSource,omitempty"` 10218 // SecretVersion - Version of the secret to be used 10219 SecretVersion *string `json:"secretVersion,omitempty"` 10220 // Type - Possible values include: 'TypeSecretParameters', 'TypeURLSigningKey', 'TypeManagedCertificate', 'TypeCustomerCertificate' 10221 Type TypeBasicSecretParameters `json:"type,omitempty"` 10222} 10223 10224// MarshalJSON is the custom marshaler for URLSigningKeyParameters. 10225func (uskp URLSigningKeyParameters) MarshalJSON() ([]byte, error) { 10226 uskp.Type = TypeURLSigningKey 10227 objectMap := make(map[string]interface{}) 10228 if uskp.KeyID != nil { 10229 objectMap["keyId"] = uskp.KeyID 10230 } 10231 if uskp.SecretSource != nil { 10232 objectMap["secretSource"] = uskp.SecretSource 10233 } 10234 if uskp.SecretVersion != nil { 10235 objectMap["secretVersion"] = uskp.SecretVersion 10236 } 10237 if uskp.Type != "" { 10238 objectMap["type"] = uskp.Type 10239 } 10240 return json.Marshal(objectMap) 10241} 10242 10243// AsURLSigningKeyParameters is the BasicSecretParameters implementation for URLSigningKeyParameters. 10244func (uskp URLSigningKeyParameters) AsURLSigningKeyParameters() (*URLSigningKeyParameters, bool) { 10245 return &uskp, true 10246} 10247 10248// AsManagedCertificateParameters is the BasicSecretParameters implementation for URLSigningKeyParameters. 10249func (uskp URLSigningKeyParameters) AsManagedCertificateParameters() (*ManagedCertificateParameters, bool) { 10250 return nil, false 10251} 10252 10253// AsCustomerCertificateParameters is the BasicSecretParameters implementation for URLSigningKeyParameters. 10254func (uskp URLSigningKeyParameters) AsCustomerCertificateParameters() (*CustomerCertificateParameters, bool) { 10255 return nil, false 10256} 10257 10258// AsSecretParameters is the BasicSecretParameters implementation for URLSigningKeyParameters. 10259func (uskp URLSigningKeyParameters) AsSecretParameters() (*SecretParameters, bool) { 10260 return nil, false 10261} 10262 10263// AsBasicSecretParameters is the BasicSecretParameters implementation for URLSigningKeyParameters. 10264func (uskp URLSigningKeyParameters) AsBasicSecretParameters() (BasicSecretParameters, bool) { 10265 return &uskp, true 10266} 10267 10268// URLSigningParamIdentifier defines how to identify a parameter for a specific purpose e.g. expires 10269type URLSigningParamIdentifier struct { 10270 // ParamIndicator - Indicates the purpose of the parameter. Possible values include: 'Expires', 'KeyID', 'Signature' 10271 ParamIndicator ParamIndicator `json:"paramIndicator,omitempty"` 10272 // ParamName - Parameter name 10273 ParamName *string `json:"paramName,omitempty"` 10274} 10275 10276// Usage describes resource usage. 10277type Usage struct { 10278 // ID - READ-ONLY; Resource identifier. 10279 ID *string `json:"id,omitempty"` 10280 // Unit - An enum describing the unit of measurement. 10281 Unit *string `json:"unit,omitempty"` 10282 // CurrentValue - The current value of the usage. 10283 CurrentValue *int64 `json:"currentValue,omitempty"` 10284 // Limit - The limit of usage. 10285 Limit *int64 `json:"limit,omitempty"` 10286 // Name - The name of the type of usage. 10287 Name *UsageName `json:"name,omitempty"` 10288} 10289 10290// MarshalJSON is the custom marshaler for Usage. 10291func (u Usage) MarshalJSON() ([]byte, error) { 10292 objectMap := make(map[string]interface{}) 10293 if u.Unit != nil { 10294 objectMap["unit"] = u.Unit 10295 } 10296 if u.CurrentValue != nil { 10297 objectMap["currentValue"] = u.CurrentValue 10298 } 10299 if u.Limit != nil { 10300 objectMap["limit"] = u.Limit 10301 } 10302 if u.Name != nil { 10303 objectMap["name"] = u.Name 10304 } 10305 return json.Marshal(objectMap) 10306} 10307 10308// UsageName the usage names. 10309type UsageName struct { 10310 // Value - A string describing the resource name. 10311 Value *string `json:"value,omitempty"` 10312 // LocalizedValue - A localized string describing the resource name. 10313 LocalizedValue *string `json:"localizedValue,omitempty"` 10314} 10315 10316// UsagesListResult the list usages operation response. 10317type UsagesListResult struct { 10318 autorest.Response `json:"-"` 10319 // Value - The list of resource usages. 10320 Value *[]Usage `json:"value,omitempty"` 10321 // NextLink - URL to get the next set of results. 10322 NextLink *string `json:"nextLink,omitempty"` 10323} 10324 10325// UsagesListResultIterator provides access to a complete listing of Usage values. 10326type UsagesListResultIterator struct { 10327 i int 10328 page UsagesListResultPage 10329} 10330 10331// NextWithContext advances to the next value. If there was an error making 10332// the request the iterator does not advance and the error is returned. 10333func (iter *UsagesListResultIterator) NextWithContext(ctx context.Context) (err error) { 10334 if tracing.IsEnabled() { 10335 ctx = tracing.StartSpan(ctx, fqdn+"/UsagesListResultIterator.NextWithContext") 10336 defer func() { 10337 sc := -1 10338 if iter.Response().Response.Response != nil { 10339 sc = iter.Response().Response.Response.StatusCode 10340 } 10341 tracing.EndSpan(ctx, sc, err) 10342 }() 10343 } 10344 iter.i++ 10345 if iter.i < len(iter.page.Values()) { 10346 return nil 10347 } 10348 err = iter.page.NextWithContext(ctx) 10349 if err != nil { 10350 iter.i-- 10351 return err 10352 } 10353 iter.i = 0 10354 return nil 10355} 10356 10357// Next advances to the next value. If there was an error making 10358// the request the iterator does not advance and the error is returned. 10359// Deprecated: Use NextWithContext() instead. 10360func (iter *UsagesListResultIterator) Next() error { 10361 return iter.NextWithContext(context.Background()) 10362} 10363 10364// NotDone returns true if the enumeration should be started or is not yet complete. 10365func (iter UsagesListResultIterator) NotDone() bool { 10366 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 10367} 10368 10369// Response returns the raw server response from the last page request. 10370func (iter UsagesListResultIterator) Response() UsagesListResult { 10371 return iter.page.Response() 10372} 10373 10374// Value returns the current value or a zero-initialized value if the 10375// iterator has advanced beyond the end of the collection. 10376func (iter UsagesListResultIterator) Value() Usage { 10377 if !iter.page.NotDone() { 10378 return Usage{} 10379 } 10380 return iter.page.Values()[iter.i] 10381} 10382 10383// Creates a new instance of the UsagesListResultIterator type. 10384func NewUsagesListResultIterator(page UsagesListResultPage) UsagesListResultIterator { 10385 return UsagesListResultIterator{page: page} 10386} 10387 10388// IsEmpty returns true if the ListResult contains no values. 10389func (ulr UsagesListResult) IsEmpty() bool { 10390 return ulr.Value == nil || len(*ulr.Value) == 0 10391} 10392 10393// hasNextLink returns true if the NextLink is not empty. 10394func (ulr UsagesListResult) hasNextLink() bool { 10395 return ulr.NextLink != nil && len(*ulr.NextLink) != 0 10396} 10397 10398// usagesListResultPreparer prepares a request to retrieve the next set of results. 10399// It returns nil if no more results exist. 10400func (ulr UsagesListResult) usagesListResultPreparer(ctx context.Context) (*http.Request, error) { 10401 if !ulr.hasNextLink() { 10402 return nil, nil 10403 } 10404 return autorest.Prepare((&http.Request{}).WithContext(ctx), 10405 autorest.AsJSON(), 10406 autorest.AsGet(), 10407 autorest.WithBaseURL(to.String(ulr.NextLink))) 10408} 10409 10410// UsagesListResultPage contains a page of Usage values. 10411type UsagesListResultPage struct { 10412 fn func(context.Context, UsagesListResult) (UsagesListResult, error) 10413 ulr UsagesListResult 10414} 10415 10416// NextWithContext advances to the next page of values. If there was an error making 10417// the request the page does not advance and the error is returned. 10418func (page *UsagesListResultPage) NextWithContext(ctx context.Context) (err error) { 10419 if tracing.IsEnabled() { 10420 ctx = tracing.StartSpan(ctx, fqdn+"/UsagesListResultPage.NextWithContext") 10421 defer func() { 10422 sc := -1 10423 if page.Response().Response.Response != nil { 10424 sc = page.Response().Response.Response.StatusCode 10425 } 10426 tracing.EndSpan(ctx, sc, err) 10427 }() 10428 } 10429 for { 10430 next, err := page.fn(ctx, page.ulr) 10431 if err != nil { 10432 return err 10433 } 10434 page.ulr = next 10435 if !next.hasNextLink() || !next.IsEmpty() { 10436 break 10437 } 10438 } 10439 return nil 10440} 10441 10442// Next advances to the next page of values. If there was an error making 10443// the request the page does not advance and the error is returned. 10444// Deprecated: Use NextWithContext() instead. 10445func (page *UsagesListResultPage) Next() error { 10446 return page.NextWithContext(context.Background()) 10447} 10448 10449// NotDone returns true if the page enumeration should be started or is not yet complete. 10450func (page UsagesListResultPage) NotDone() bool { 10451 return !page.ulr.IsEmpty() 10452} 10453 10454// Response returns the raw server response from the last page request. 10455func (page UsagesListResultPage) Response() UsagesListResult { 10456 return page.ulr 10457} 10458 10459// Values returns the slice of values for the current page or nil if there are no values. 10460func (page UsagesListResultPage) Values() []Usage { 10461 if page.ulr.IsEmpty() { 10462 return nil 10463 } 10464 return *page.ulr.Value 10465} 10466 10467// Creates a new instance of the UsagesListResultPage type. 10468func NewUsagesListResultPage(cur UsagesListResult, getNextPage func(context.Context, UsagesListResult) (UsagesListResult, error)) UsagesListResultPage { 10469 return UsagesListResultPage{ 10470 fn: getNextPage, 10471 ulr: cur, 10472 } 10473} 10474 10475// UserManagedHTTPSParameters defines the certificate source parameters using user's keyvault certificate 10476// for enabling SSL. 10477type UserManagedHTTPSParameters struct { 10478 // CertificateSourceParameters - Defines the certificate source parameters using user's keyvault certificate for enabling SSL. 10479 CertificateSourceParameters *KeyVaultCertificateSourceParameters `json:"certificateSourceParameters,omitempty"` 10480 // ProtocolType - Defines the TLS extension protocol that is used for secure delivery. Possible values include: 'ServerNameIndication', 'IPBased' 10481 ProtocolType ProtocolType `json:"protocolType,omitempty"` 10482 // MinimumTLSVersion - TLS protocol version that will be used for Https. Possible values include: 'MinimumTLSVersionNone', 'MinimumTLSVersionTLS10', 'MinimumTLSVersionTLS12' 10483 MinimumTLSVersion MinimumTLSVersion `json:"minimumTlsVersion,omitempty"` 10484 // CertificateSource - Possible values include: 'CertificateSourceCustomDomainHTTPSParameters', 'CertificateSourceCdn', 'CertificateSourceAzureKeyVault' 10485 CertificateSource CertificateSource `json:"certificateSource,omitempty"` 10486} 10487 10488// MarshalJSON is the custom marshaler for UserManagedHTTPSParameters. 10489func (umhp UserManagedHTTPSParameters) MarshalJSON() ([]byte, error) { 10490 umhp.CertificateSource = CertificateSourceAzureKeyVault 10491 objectMap := make(map[string]interface{}) 10492 if umhp.CertificateSourceParameters != nil { 10493 objectMap["certificateSourceParameters"] = umhp.CertificateSourceParameters 10494 } 10495 if umhp.ProtocolType != "" { 10496 objectMap["protocolType"] = umhp.ProtocolType 10497 } 10498 if umhp.MinimumTLSVersion != "" { 10499 objectMap["minimumTlsVersion"] = umhp.MinimumTLSVersion 10500 } 10501 if umhp.CertificateSource != "" { 10502 objectMap["certificateSource"] = umhp.CertificateSource 10503 } 10504 return json.Marshal(objectMap) 10505} 10506 10507// AsManagedHTTPSParameters is the BasicCustomDomainHTTPSParameters implementation for UserManagedHTTPSParameters. 10508func (umhp UserManagedHTTPSParameters) AsManagedHTTPSParameters() (*ManagedHTTPSParameters, bool) { 10509 return nil, false 10510} 10511 10512// AsUserManagedHTTPSParameters is the BasicCustomDomainHTTPSParameters implementation for UserManagedHTTPSParameters. 10513func (umhp UserManagedHTTPSParameters) AsUserManagedHTTPSParameters() (*UserManagedHTTPSParameters, bool) { 10514 return &umhp, true 10515} 10516 10517// AsCustomDomainHTTPSParameters is the BasicCustomDomainHTTPSParameters implementation for UserManagedHTTPSParameters. 10518func (umhp UserManagedHTTPSParameters) AsCustomDomainHTTPSParameters() (*CustomDomainHTTPSParameters, bool) { 10519 return nil, false 10520} 10521 10522// AsBasicCustomDomainHTTPSParameters is the BasicCustomDomainHTTPSParameters implementation for UserManagedHTTPSParameters. 10523func (umhp UserManagedHTTPSParameters) AsBasicCustomDomainHTTPSParameters() (BasicCustomDomainHTTPSParameters, bool) { 10524 return &umhp, true 10525} 10526 10527// ValidateCustomDomainInput input of the custom domain to be validated for DNS mapping. 10528type ValidateCustomDomainInput struct { 10529 // HostName - The host name of the custom domain. Must be a domain name. 10530 HostName *string `json:"hostName,omitempty"` 10531} 10532 10533// ValidateCustomDomainOutput output of custom domain validation. 10534type ValidateCustomDomainOutput struct { 10535 autorest.Response `json:"-"` 10536 // CustomDomainValidated - READ-ONLY; Indicates whether the custom domain is valid or not. 10537 CustomDomainValidated *bool `json:"customDomainValidated,omitempty"` 10538 // Reason - READ-ONLY; The reason why the custom domain is not valid. 10539 Reason *string `json:"reason,omitempty"` 10540 // Message - READ-ONLY; Error message describing why the custom domain is not valid. 10541 Message *string `json:"message,omitempty"` 10542} 10543 10544// ValidateProbeInput input of the validate probe API. 10545type ValidateProbeInput struct { 10546 // ProbeURL - The probe URL to validate. 10547 ProbeURL *string `json:"probeURL,omitempty"` 10548} 10549 10550// ValidateProbeOutput output of the validate probe API. 10551type ValidateProbeOutput struct { 10552 autorest.Response `json:"-"` 10553 // IsValid - READ-ONLY; Indicates whether the probe URL is accepted or not. 10554 IsValid *bool `json:"isValid,omitempty"` 10555 // ErrorCode - READ-ONLY; Specifies the error code when the probe url is not accepted. 10556 ErrorCode *string `json:"errorCode,omitempty"` 10557 // Message - READ-ONLY; The detailed error message describing why the probe URL is not accepted. 10558 Message *string `json:"message,omitempty"` 10559} 10560 10561// ValidateSecretInput input of the secret to be validated. 10562type ValidateSecretInput struct { 10563 // SecretSource - The secret source. 10564 SecretSource *ResourceReference `json:"secretSource,omitempty"` 10565 // SecretType - The secret type. Possible values include: 'ValidateSecretTypeURLSigningKey', 'ValidateSecretTypeManagedCertificate', 'ValidateSecretTypeCustomerCertificate' 10566 SecretType ValidateSecretType `json:"secretType,omitempty"` 10567} 10568 10569// ValidateSecretOutput output of the validated secret. 10570type ValidateSecretOutput struct { 10571 autorest.Response `json:"-"` 10572 // Status - The validation status. Possible values include: 'Valid', 'Invalid', 'AccessDenied', 'CertificateExpired' 10573 Status Status `json:"status,omitempty"` 10574 // Message - Detailed error message 10575 Message *string `json:"message,omitempty"` 10576} 10577 10578// ValidationToken the validation token. 10579type ValidationToken struct { 10580 autorest.Response `json:"-"` 10581 // Token - READ-ONLY 10582 Token *string `json:"token,omitempty"` 10583} 10584 10585// WafMetricsResponse waf Metrics Response 10586type WafMetricsResponse struct { 10587 autorest.Response `json:"-"` 10588 DateTimeBegin *date.Time `json:"dateTimeBegin,omitempty"` 10589 DateTimeEnd *date.Time `json:"dateTimeEnd,omitempty"` 10590 // Granularity - Possible values include: 'Granularity1PT5M', 'Granularity1PT1H', 'Granularity1P1D' 10591 Granularity Granularity1 `json:"granularity,omitempty"` 10592 Series *[]WafMetricsResponseSeriesItem `json:"series,omitempty"` 10593} 10594 10595// WafMetricsResponseSeriesItem ... 10596type WafMetricsResponseSeriesItem struct { 10597 Metric *string `json:"metric,omitempty"` 10598 // Unit - Possible values include: 'Unit1Count' 10599 Unit Unit1 `json:"unit,omitempty"` 10600 Groups *[]WafMetricsResponseSeriesItemGroupsItem `json:"groups,omitempty"` 10601 Data *[]WafMetricsResponseSeriesItemDataItem `json:"data,omitempty"` 10602} 10603 10604// WafMetricsResponseSeriesItemDataItem ... 10605type WafMetricsResponseSeriesItemDataItem struct { 10606 DateTime *date.Time `json:"dateTime,omitempty"` 10607 Value *float64 `json:"value,omitempty"` 10608} 10609 10610// WafMetricsResponseSeriesItemGroupsItem ... 10611type WafMetricsResponseSeriesItemGroupsItem struct { 10612 Name *string `json:"name,omitempty"` 10613 Value *string `json:"value,omitempty"` 10614} 10615 10616// WafRankingsResponse waf Rankings Response 10617type WafRankingsResponse struct { 10618 autorest.Response `json:"-"` 10619 DateTimeBegin *date.Time `json:"dateTimeBegin,omitempty"` 10620 DateTimeEnd *date.Time `json:"dateTimeEnd,omitempty"` 10621 Groups *[]string `json:"groups,omitempty"` 10622 Data *[]WafRankingsResponseDataItem `json:"data,omitempty"` 10623} 10624 10625// WafRankingsResponseDataItem ... 10626type WafRankingsResponseDataItem struct { 10627 GroupValues *[]string `json:"groupValues,omitempty"` 10628 Metrics *[]WafRankingsResponseDataItemMetricsItem `json:"metrics,omitempty"` 10629} 10630 10631// WafRankingsResponseDataItemMetricsItem ... 10632type WafRankingsResponseDataItemMetricsItem struct { 10633 Metric *string `json:"metric,omitempty"` 10634 Value *int64 `json:"value,omitempty"` 10635 Percentage *float64 `json:"percentage,omitempty"` 10636} 10637 10638// WebApplicationFirewallPolicy defines web application firewall policy for Azure CDN. 10639type WebApplicationFirewallPolicy struct { 10640 autorest.Response `json:"-"` 10641 // WebApplicationFirewallPolicyProperties - Properties of the web application firewall policy. 10642 *WebApplicationFirewallPolicyProperties `json:"properties,omitempty"` 10643 // Etag - Gets a unique read-only string that changes whenever the resource is updated. 10644 Etag *string `json:"etag,omitempty"` 10645 // Sku - The pricing tier (defines a CDN provider, feature list and rate) of the CdnWebApplicationFirewallPolicy. 10646 Sku *Sku `json:"sku,omitempty"` 10647 // Location - Resource location. 10648 Location *string `json:"location,omitempty"` 10649 // Tags - Resource tags. 10650 Tags map[string]*string `json:"tags"` 10651 // SystemData - READ-ONLY 10652 SystemData *SystemData `json:"systemData,omitempty"` 10653 // ID - READ-ONLY; Resource ID. 10654 ID *string `json:"id,omitempty"` 10655 // Name - READ-ONLY; Resource name. 10656 Name *string `json:"name,omitempty"` 10657 // Type - READ-ONLY; Resource type. 10658 Type *string `json:"type,omitempty"` 10659} 10660 10661// MarshalJSON is the custom marshaler for WebApplicationFirewallPolicy. 10662func (wafp WebApplicationFirewallPolicy) MarshalJSON() ([]byte, error) { 10663 objectMap := make(map[string]interface{}) 10664 if wafp.WebApplicationFirewallPolicyProperties != nil { 10665 objectMap["properties"] = wafp.WebApplicationFirewallPolicyProperties 10666 } 10667 if wafp.Etag != nil { 10668 objectMap["etag"] = wafp.Etag 10669 } 10670 if wafp.Sku != nil { 10671 objectMap["sku"] = wafp.Sku 10672 } 10673 if wafp.Location != nil { 10674 objectMap["location"] = wafp.Location 10675 } 10676 if wafp.Tags != nil { 10677 objectMap["tags"] = wafp.Tags 10678 } 10679 return json.Marshal(objectMap) 10680} 10681 10682// UnmarshalJSON is the custom unmarshaler for WebApplicationFirewallPolicy struct. 10683func (wafp *WebApplicationFirewallPolicy) UnmarshalJSON(body []byte) error { 10684 var m map[string]*json.RawMessage 10685 err := json.Unmarshal(body, &m) 10686 if err != nil { 10687 return err 10688 } 10689 for k, v := range m { 10690 switch k { 10691 case "properties": 10692 if v != nil { 10693 var webApplicationFirewallPolicyProperties WebApplicationFirewallPolicyProperties 10694 err = json.Unmarshal(*v, &webApplicationFirewallPolicyProperties) 10695 if err != nil { 10696 return err 10697 } 10698 wafp.WebApplicationFirewallPolicyProperties = &webApplicationFirewallPolicyProperties 10699 } 10700 case "etag": 10701 if v != nil { 10702 var etag string 10703 err = json.Unmarshal(*v, &etag) 10704 if err != nil { 10705 return err 10706 } 10707 wafp.Etag = &etag 10708 } 10709 case "sku": 10710 if v != nil { 10711 var sku Sku 10712 err = json.Unmarshal(*v, &sku) 10713 if err != nil { 10714 return err 10715 } 10716 wafp.Sku = &sku 10717 } 10718 case "location": 10719 if v != nil { 10720 var location string 10721 err = json.Unmarshal(*v, &location) 10722 if err != nil { 10723 return err 10724 } 10725 wafp.Location = &location 10726 } 10727 case "tags": 10728 if v != nil { 10729 var tags map[string]*string 10730 err = json.Unmarshal(*v, &tags) 10731 if err != nil { 10732 return err 10733 } 10734 wafp.Tags = tags 10735 } 10736 case "systemData": 10737 if v != nil { 10738 var systemData SystemData 10739 err = json.Unmarshal(*v, &systemData) 10740 if err != nil { 10741 return err 10742 } 10743 wafp.SystemData = &systemData 10744 } 10745 case "id": 10746 if v != nil { 10747 var ID string 10748 err = json.Unmarshal(*v, &ID) 10749 if err != nil { 10750 return err 10751 } 10752 wafp.ID = &ID 10753 } 10754 case "name": 10755 if v != nil { 10756 var name string 10757 err = json.Unmarshal(*v, &name) 10758 if err != nil { 10759 return err 10760 } 10761 wafp.Name = &name 10762 } 10763 case "type": 10764 if v != nil { 10765 var typeVar string 10766 err = json.Unmarshal(*v, &typeVar) 10767 if err != nil { 10768 return err 10769 } 10770 wafp.Type = &typeVar 10771 } 10772 } 10773 } 10774 10775 return nil 10776} 10777 10778// WebApplicationFirewallPolicyList defines a list of WebApplicationFirewallPolicies for Azure CDN. It 10779// contains a list of WebApplicationFirewallPolicy objects and a URL link to get the next set of results. 10780type WebApplicationFirewallPolicyList struct { 10781 autorest.Response `json:"-"` 10782 // Value - READ-ONLY; List of Azure CDN WebApplicationFirewallPolicies within a resource group. 10783 Value *[]WebApplicationFirewallPolicy `json:"value,omitempty"` 10784 // NextLink - URL to get the next set of WebApplicationFirewallPolicy objects if there are any. 10785 NextLink *string `json:"nextLink,omitempty"` 10786} 10787 10788// MarshalJSON is the custom marshaler for WebApplicationFirewallPolicyList. 10789func (wafpl WebApplicationFirewallPolicyList) MarshalJSON() ([]byte, error) { 10790 objectMap := make(map[string]interface{}) 10791 if wafpl.NextLink != nil { 10792 objectMap["nextLink"] = wafpl.NextLink 10793 } 10794 return json.Marshal(objectMap) 10795} 10796 10797// WebApplicationFirewallPolicyListIterator provides access to a complete listing of 10798// WebApplicationFirewallPolicy values. 10799type WebApplicationFirewallPolicyListIterator struct { 10800 i int 10801 page WebApplicationFirewallPolicyListPage 10802} 10803 10804// NextWithContext advances to the next value. If there was an error making 10805// the request the iterator does not advance and the error is returned. 10806func (iter *WebApplicationFirewallPolicyListIterator) NextWithContext(ctx context.Context) (err error) { 10807 if tracing.IsEnabled() { 10808 ctx = tracing.StartSpan(ctx, fqdn+"/WebApplicationFirewallPolicyListIterator.NextWithContext") 10809 defer func() { 10810 sc := -1 10811 if iter.Response().Response.Response != nil { 10812 sc = iter.Response().Response.Response.StatusCode 10813 } 10814 tracing.EndSpan(ctx, sc, err) 10815 }() 10816 } 10817 iter.i++ 10818 if iter.i < len(iter.page.Values()) { 10819 return nil 10820 } 10821 err = iter.page.NextWithContext(ctx) 10822 if err != nil { 10823 iter.i-- 10824 return err 10825 } 10826 iter.i = 0 10827 return nil 10828} 10829 10830// Next advances to the next value. If there was an error making 10831// the request the iterator does not advance and the error is returned. 10832// Deprecated: Use NextWithContext() instead. 10833func (iter *WebApplicationFirewallPolicyListIterator) Next() error { 10834 return iter.NextWithContext(context.Background()) 10835} 10836 10837// NotDone returns true if the enumeration should be started or is not yet complete. 10838func (iter WebApplicationFirewallPolicyListIterator) NotDone() bool { 10839 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 10840} 10841 10842// Response returns the raw server response from the last page request. 10843func (iter WebApplicationFirewallPolicyListIterator) Response() WebApplicationFirewallPolicyList { 10844 return iter.page.Response() 10845} 10846 10847// Value returns the current value or a zero-initialized value if the 10848// iterator has advanced beyond the end of the collection. 10849func (iter WebApplicationFirewallPolicyListIterator) Value() WebApplicationFirewallPolicy { 10850 if !iter.page.NotDone() { 10851 return WebApplicationFirewallPolicy{} 10852 } 10853 return iter.page.Values()[iter.i] 10854} 10855 10856// Creates a new instance of the WebApplicationFirewallPolicyListIterator type. 10857func NewWebApplicationFirewallPolicyListIterator(page WebApplicationFirewallPolicyListPage) WebApplicationFirewallPolicyListIterator { 10858 return WebApplicationFirewallPolicyListIterator{page: page} 10859} 10860 10861// IsEmpty returns true if the ListResult contains no values. 10862func (wafpl WebApplicationFirewallPolicyList) IsEmpty() bool { 10863 return wafpl.Value == nil || len(*wafpl.Value) == 0 10864} 10865 10866// hasNextLink returns true if the NextLink is not empty. 10867func (wafpl WebApplicationFirewallPolicyList) hasNextLink() bool { 10868 return wafpl.NextLink != nil && len(*wafpl.NextLink) != 0 10869} 10870 10871// webApplicationFirewallPolicyListPreparer prepares a request to retrieve the next set of results. 10872// It returns nil if no more results exist. 10873func (wafpl WebApplicationFirewallPolicyList) webApplicationFirewallPolicyListPreparer(ctx context.Context) (*http.Request, error) { 10874 if !wafpl.hasNextLink() { 10875 return nil, nil 10876 } 10877 return autorest.Prepare((&http.Request{}).WithContext(ctx), 10878 autorest.AsJSON(), 10879 autorest.AsGet(), 10880 autorest.WithBaseURL(to.String(wafpl.NextLink))) 10881} 10882 10883// WebApplicationFirewallPolicyListPage contains a page of WebApplicationFirewallPolicy values. 10884type WebApplicationFirewallPolicyListPage struct { 10885 fn func(context.Context, WebApplicationFirewallPolicyList) (WebApplicationFirewallPolicyList, error) 10886 wafpl WebApplicationFirewallPolicyList 10887} 10888 10889// NextWithContext advances to the next page of values. If there was an error making 10890// the request the page does not advance and the error is returned. 10891func (page *WebApplicationFirewallPolicyListPage) NextWithContext(ctx context.Context) (err error) { 10892 if tracing.IsEnabled() { 10893 ctx = tracing.StartSpan(ctx, fqdn+"/WebApplicationFirewallPolicyListPage.NextWithContext") 10894 defer func() { 10895 sc := -1 10896 if page.Response().Response.Response != nil { 10897 sc = page.Response().Response.Response.StatusCode 10898 } 10899 tracing.EndSpan(ctx, sc, err) 10900 }() 10901 } 10902 for { 10903 next, err := page.fn(ctx, page.wafpl) 10904 if err != nil { 10905 return err 10906 } 10907 page.wafpl = next 10908 if !next.hasNextLink() || !next.IsEmpty() { 10909 break 10910 } 10911 } 10912 return nil 10913} 10914 10915// Next advances to the next page of values. If there was an error making 10916// the request the page does not advance and the error is returned. 10917// Deprecated: Use NextWithContext() instead. 10918func (page *WebApplicationFirewallPolicyListPage) Next() error { 10919 return page.NextWithContext(context.Background()) 10920} 10921 10922// NotDone returns true if the page enumeration should be started or is not yet complete. 10923func (page WebApplicationFirewallPolicyListPage) NotDone() bool { 10924 return !page.wafpl.IsEmpty() 10925} 10926 10927// Response returns the raw server response from the last page request. 10928func (page WebApplicationFirewallPolicyListPage) Response() WebApplicationFirewallPolicyList { 10929 return page.wafpl 10930} 10931 10932// Values returns the slice of values for the current page or nil if there are no values. 10933func (page WebApplicationFirewallPolicyListPage) Values() []WebApplicationFirewallPolicy { 10934 if page.wafpl.IsEmpty() { 10935 return nil 10936 } 10937 return *page.wafpl.Value 10938} 10939 10940// Creates a new instance of the WebApplicationFirewallPolicyListPage type. 10941func NewWebApplicationFirewallPolicyListPage(cur WebApplicationFirewallPolicyList, getNextPage func(context.Context, WebApplicationFirewallPolicyList) (WebApplicationFirewallPolicyList, error)) WebApplicationFirewallPolicyListPage { 10942 return WebApplicationFirewallPolicyListPage{ 10943 fn: getNextPage, 10944 wafpl: cur, 10945 } 10946} 10947 10948// WebApplicationFirewallPolicyPatchParameters properties required to update a 10949// CdnWebApplicationFirewallPolicy. 10950type WebApplicationFirewallPolicyPatchParameters struct { 10951 // Tags - CdnWebApplicationFirewallPolicy tags 10952 Tags map[string]*string `json:"tags"` 10953} 10954 10955// MarshalJSON is the custom marshaler for WebApplicationFirewallPolicyPatchParameters. 10956func (wafppp WebApplicationFirewallPolicyPatchParameters) MarshalJSON() ([]byte, error) { 10957 objectMap := make(map[string]interface{}) 10958 if wafppp.Tags != nil { 10959 objectMap["tags"] = wafppp.Tags 10960 } 10961 return json.Marshal(objectMap) 10962} 10963 10964// WebApplicationFirewallPolicyProperties defines CDN web application firewall policy properties. 10965type WebApplicationFirewallPolicyProperties struct { 10966 // PolicySettings - Describes policySettings for policy 10967 PolicySettings *PolicySettings `json:"policySettings,omitempty"` 10968 // RateLimitRules - Describes rate limit rules inside the policy. 10969 RateLimitRules *RateLimitRuleList `json:"rateLimitRules,omitempty"` 10970 // CustomRules - Describes custom rules inside the policy. 10971 CustomRules *CustomRuleList `json:"customRules,omitempty"` 10972 // ManagedRules - Describes managed rules inside the policy. 10973 ManagedRules *ManagedRuleSetList `json:"managedRules,omitempty"` 10974 // EndpointLinks - READ-ONLY; Describes Azure CDN endpoints associated with this Web Application Firewall policy. 10975 EndpointLinks *[]EndpointType `json:"endpointLinks,omitempty"` 10976 // ProvisioningState - READ-ONLY; Provisioning state of the WebApplicationFirewallPolicy. Possible values include: 'ProvisioningStateCreating', 'ProvisioningStateSucceeded', 'ProvisioningStateFailed' 10977 ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` 10978 // ResourceState - READ-ONLY; Possible values include: 'PolicyResourceStateCreating', 'PolicyResourceStateEnabling', 'PolicyResourceStateEnabled', 'PolicyResourceStateDisabling', 'PolicyResourceStateDisabled', 'PolicyResourceStateDeleting' 10979 ResourceState PolicyResourceState `json:"resourceState,omitempty"` 10980} 10981 10982// MarshalJSON is the custom marshaler for WebApplicationFirewallPolicyProperties. 10983func (wafpp WebApplicationFirewallPolicyProperties) MarshalJSON() ([]byte, error) { 10984 objectMap := make(map[string]interface{}) 10985 if wafpp.PolicySettings != nil { 10986 objectMap["policySettings"] = wafpp.PolicySettings 10987 } 10988 if wafpp.RateLimitRules != nil { 10989 objectMap["rateLimitRules"] = wafpp.RateLimitRules 10990 } 10991 if wafpp.CustomRules != nil { 10992 objectMap["customRules"] = wafpp.CustomRules 10993 } 10994 if wafpp.ManagedRules != nil { 10995 objectMap["managedRules"] = wafpp.ManagedRules 10996 } 10997 return json.Marshal(objectMap) 10998} 10999