1package cdn 2 3// Copyright (c) Microsoft Corporation. All rights reserved. 4// Licensed under the MIT License. See License.txt in the project root for license information. 5// 6// Code generated by Microsoft (R) AutoRest Code Generator. 7// Changes may cause incorrect behavior and will be lost if the code is regenerated. 8 9import ( 10 "context" 11 "encoding/json" 12 "github.com/Azure/go-autorest/autorest" 13 "github.com/Azure/go-autorest/autorest/azure" 14 "github.com/Azure/go-autorest/autorest/to" 15 "github.com/Azure/go-autorest/tracing" 16 "net/http" 17) 18 19// The package's fully qualified name. 20const fqdn = "github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2019-04-15/cdn" 21 22// CacheExpirationActionParameters defines the parameters for the cache expiration action. 23type CacheExpirationActionParameters struct { 24 OdataType *string `json:"@odata.type,omitempty"` 25 // CacheBehavior - Caching behavior for the requests. Possible values include: 'BypassCache', 'Override', 'SetIfMissing' 26 CacheBehavior CacheBehavior `json:"cacheBehavior,omitempty"` 27 // CacheType - The level at which the content needs to be cached. 28 CacheType *string `json:"cacheType,omitempty"` 29 // CacheDuration - The duration for which the content needs to be cached. Allowed format is [d.]hh:mm:ss 30 CacheDuration *string `json:"cacheDuration,omitempty"` 31} 32 33// CacheKeyQueryStringActionParameters defines the parameters for the cache-key query string action. 34type CacheKeyQueryStringActionParameters struct { 35 OdataType *string `json:"@odata.type,omitempty"` 36 // QueryStringBehavior - Caching behavior for the requests. Possible values include: 'Include', 'IncludeAll', 'Exclude', 'ExcludeAll' 37 QueryStringBehavior QueryStringBehavior `json:"queryStringBehavior,omitempty"` 38 // QueryParameters - query parameters to include or exclude (comma separated). 39 QueryParameters *string `json:"queryParameters,omitempty"` 40} 41 42// CertificateSourceParameters defines the parameters for using CDN managed certificate for securing custom 43// domain. 44type CertificateSourceParameters struct { 45 OdataType *string `json:"@odata.type,omitempty"` 46 // CertificateType - Type of certificate used. Possible values include: 'Shared', 'Dedicated' 47 CertificateType CertificateType `json:"certificateType,omitempty"` 48} 49 50// CheckNameAvailabilityInput input of CheckNameAvailability API. 51type CheckNameAvailabilityInput struct { 52 // Name - The resource name to validate. 53 Name *string `json:"name,omitempty"` 54 // Type - The type of the resource whose name is to be validated. 55 Type *string `json:"type,omitempty"` 56} 57 58// CheckNameAvailabilityOutput output of check name availability API. 59type CheckNameAvailabilityOutput struct { 60 autorest.Response `json:"-"` 61 // NameAvailable - READ-ONLY; Indicates whether the name is available. 62 NameAvailable *bool `json:"nameAvailable,omitempty"` 63 // Reason - READ-ONLY; The reason why the name is not available. 64 Reason *string `json:"reason,omitempty"` 65 // Message - READ-ONLY; The detailed error message describing why the name is not available. 66 Message *string `json:"message,omitempty"` 67} 68 69// MarshalJSON is the custom marshaler for CheckNameAvailabilityOutput. 70func (cnao CheckNameAvailabilityOutput) MarshalJSON() ([]byte, error) { 71 objectMap := make(map[string]interface{}) 72 return json.Marshal(objectMap) 73} 74 75// CidrIPAddress CIDR Ip address 76type CidrIPAddress struct { 77 // BaseIPAddress - Ip address itself. 78 BaseIPAddress *string `json:"baseIpAddress,omitempty"` 79 // PrefixLength - The length of the prefix of the ip address. 80 PrefixLength *int32 `json:"prefixLength,omitempty"` 81} 82 83// CookiesMatchConditionParameters defines the parameters for Cookies match conditions 84type CookiesMatchConditionParameters struct { 85 OdataType *string `json:"@odata.type,omitempty"` 86 // Selector - Name of Cookies to be matched 87 Selector *string `json:"selector,omitempty"` 88 // Operator - Describes operator to be matched. Possible values include: 'Any', 'Equal', 'Contains', 'BeginsWith', 'EndsWith', 'LessThan', 'LessThanOrEqual', 'GreaterThan', 'GreaterThanOrEqual' 89 Operator CookiesOperator `json:"operator,omitempty"` 90 // NegateCondition - Describes if this is negate condition or not 91 NegateCondition *bool `json:"negateCondition,omitempty"` 92 // MatchValues - The match value for the condition of the delivery rule 93 MatchValues *[]string `json:"matchValues,omitempty"` 94 // Transforms - List of transforms 95 Transforms *[]Transform `json:"transforms,omitempty"` 96} 97 98// CustomDomain friendly domain name mapping to the endpoint hostname that the customer provides for 99// branding purposes, e.g. www.contoso.com. 100type CustomDomain struct { 101 autorest.Response `json:"-"` 102 *CustomDomainProperties `json:"properties,omitempty"` 103 // ID - READ-ONLY; Resource ID. 104 ID *string `json:"id,omitempty"` 105 // Name - READ-ONLY; Resource name. 106 Name *string `json:"name,omitempty"` 107 // Type - READ-ONLY; Resource type. 108 Type *string `json:"type,omitempty"` 109} 110 111// MarshalJSON is the custom marshaler for CustomDomain. 112func (cd CustomDomain) MarshalJSON() ([]byte, error) { 113 objectMap := make(map[string]interface{}) 114 if cd.CustomDomainProperties != nil { 115 objectMap["properties"] = cd.CustomDomainProperties 116 } 117 return json.Marshal(objectMap) 118} 119 120// UnmarshalJSON is the custom unmarshaler for CustomDomain struct. 121func (cd *CustomDomain) UnmarshalJSON(body []byte) error { 122 var m map[string]*json.RawMessage 123 err := json.Unmarshal(body, &m) 124 if err != nil { 125 return err 126 } 127 for k, v := range m { 128 switch k { 129 case "properties": 130 if v != nil { 131 var customDomainProperties CustomDomainProperties 132 err = json.Unmarshal(*v, &customDomainProperties) 133 if err != nil { 134 return err 135 } 136 cd.CustomDomainProperties = &customDomainProperties 137 } 138 case "id": 139 if v != nil { 140 var ID string 141 err = json.Unmarshal(*v, &ID) 142 if err != nil { 143 return err 144 } 145 cd.ID = &ID 146 } 147 case "name": 148 if v != nil { 149 var name string 150 err = json.Unmarshal(*v, &name) 151 if err != nil { 152 return err 153 } 154 cd.Name = &name 155 } 156 case "type": 157 if v != nil { 158 var typeVar string 159 err = json.Unmarshal(*v, &typeVar) 160 if err != nil { 161 return err 162 } 163 cd.Type = &typeVar 164 } 165 } 166 } 167 168 return nil 169} 170 171// BasicCustomDomainHTTPSParameters the JSON object that contains the properties to secure a custom domain. 172type BasicCustomDomainHTTPSParameters interface { 173 AsManagedHTTPSParameters() (*ManagedHTTPSParameters, bool) 174 AsUserManagedHTTPSParameters() (*UserManagedHTTPSParameters, bool) 175 AsCustomDomainHTTPSParameters() (*CustomDomainHTTPSParameters, bool) 176} 177 178// CustomDomainHTTPSParameters the JSON object that contains the properties to secure a custom domain. 179type CustomDomainHTTPSParameters struct { 180 // ProtocolType - Defines the TLS extension protocol that is used for secure delivery. Possible values include: 'ServerNameIndication', 'IPBased' 181 ProtocolType ProtocolType `json:"protocolType,omitempty"` 182 // MinimumTLSVersion - TLS protocol version that will be used for Https. Possible values include: 'None', 'TLS10', 'TLS12' 183 MinimumTLSVersion MinimumTLSVersion `json:"minimumTlsVersion,omitempty"` 184 // CertificateSource - Possible values include: 'CertificateSourceCustomDomainHTTPSParameters', 'CertificateSourceCdn', 'CertificateSourceAzureKeyVault' 185 CertificateSource CertificateSource `json:"certificateSource,omitempty"` 186} 187 188func unmarshalBasicCustomDomainHTTPSParameters(body []byte) (BasicCustomDomainHTTPSParameters, error) { 189 var m map[string]interface{} 190 err := json.Unmarshal(body, &m) 191 if err != nil { 192 return nil, err 193 } 194 195 switch m["certificateSource"] { 196 case string(CertificateSourceCdn): 197 var mhp ManagedHTTPSParameters 198 err := json.Unmarshal(body, &mhp) 199 return mhp, err 200 case string(CertificateSourceAzureKeyVault): 201 var umhp UserManagedHTTPSParameters 202 err := json.Unmarshal(body, &umhp) 203 return umhp, err 204 default: 205 var cdhp CustomDomainHTTPSParameters 206 err := json.Unmarshal(body, &cdhp) 207 return cdhp, err 208 } 209} 210func unmarshalBasicCustomDomainHTTPSParametersArray(body []byte) ([]BasicCustomDomainHTTPSParameters, error) { 211 var rawMessages []*json.RawMessage 212 err := json.Unmarshal(body, &rawMessages) 213 if err != nil { 214 return nil, err 215 } 216 217 cdhpArray := make([]BasicCustomDomainHTTPSParameters, len(rawMessages)) 218 219 for index, rawMessage := range rawMessages { 220 cdhp, err := unmarshalBasicCustomDomainHTTPSParameters(*rawMessage) 221 if err != nil { 222 return nil, err 223 } 224 cdhpArray[index] = cdhp 225 } 226 return cdhpArray, nil 227} 228 229// MarshalJSON is the custom marshaler for CustomDomainHTTPSParameters. 230func (cdhp CustomDomainHTTPSParameters) MarshalJSON() ([]byte, error) { 231 cdhp.CertificateSource = CertificateSourceCustomDomainHTTPSParameters 232 objectMap := make(map[string]interface{}) 233 if cdhp.ProtocolType != "" { 234 objectMap["protocolType"] = cdhp.ProtocolType 235 } 236 if cdhp.MinimumTLSVersion != "" { 237 objectMap["minimumTlsVersion"] = cdhp.MinimumTLSVersion 238 } 239 if cdhp.CertificateSource != "" { 240 objectMap["certificateSource"] = cdhp.CertificateSource 241 } 242 return json.Marshal(objectMap) 243} 244 245// AsManagedHTTPSParameters is the BasicCustomDomainHTTPSParameters implementation for CustomDomainHTTPSParameters. 246func (cdhp CustomDomainHTTPSParameters) AsManagedHTTPSParameters() (*ManagedHTTPSParameters, bool) { 247 return nil, false 248} 249 250// AsUserManagedHTTPSParameters is the BasicCustomDomainHTTPSParameters implementation for CustomDomainHTTPSParameters. 251func (cdhp CustomDomainHTTPSParameters) AsUserManagedHTTPSParameters() (*UserManagedHTTPSParameters, bool) { 252 return nil, false 253} 254 255// AsCustomDomainHTTPSParameters is the BasicCustomDomainHTTPSParameters implementation for CustomDomainHTTPSParameters. 256func (cdhp CustomDomainHTTPSParameters) AsCustomDomainHTTPSParameters() (*CustomDomainHTTPSParameters, bool) { 257 return &cdhp, true 258} 259 260// AsBasicCustomDomainHTTPSParameters is the BasicCustomDomainHTTPSParameters implementation for CustomDomainHTTPSParameters. 261func (cdhp CustomDomainHTTPSParameters) AsBasicCustomDomainHTTPSParameters() (BasicCustomDomainHTTPSParameters, bool) { 262 return &cdhp, true 263} 264 265// CustomDomainListResult result of the request to list custom domains. It contains a list of custom domain 266// objects and a URL link to get the next set of results. 267type CustomDomainListResult struct { 268 autorest.Response `json:"-"` 269 // Value - READ-ONLY; List of CDN CustomDomains within an endpoint. 270 Value *[]CustomDomain `json:"value,omitempty"` 271 // NextLink - URL to get the next set of custom domain objects if there are any. 272 NextLink *string `json:"nextLink,omitempty"` 273} 274 275// MarshalJSON is the custom marshaler for CustomDomainListResult. 276func (cdlr CustomDomainListResult) MarshalJSON() ([]byte, error) { 277 objectMap := make(map[string]interface{}) 278 if cdlr.NextLink != nil { 279 objectMap["nextLink"] = cdlr.NextLink 280 } 281 return json.Marshal(objectMap) 282} 283 284// CustomDomainListResultIterator provides access to a complete listing of CustomDomain values. 285type CustomDomainListResultIterator struct { 286 i int 287 page CustomDomainListResultPage 288} 289 290// NextWithContext advances to the next value. If there was an error making 291// the request the iterator does not advance and the error is returned. 292func (iter *CustomDomainListResultIterator) NextWithContext(ctx context.Context) (err error) { 293 if tracing.IsEnabled() { 294 ctx = tracing.StartSpan(ctx, fqdn+"/CustomDomainListResultIterator.NextWithContext") 295 defer func() { 296 sc := -1 297 if iter.Response().Response.Response != nil { 298 sc = iter.Response().Response.Response.StatusCode 299 } 300 tracing.EndSpan(ctx, sc, err) 301 }() 302 } 303 iter.i++ 304 if iter.i < len(iter.page.Values()) { 305 return nil 306 } 307 err = iter.page.NextWithContext(ctx) 308 if err != nil { 309 iter.i-- 310 return err 311 } 312 iter.i = 0 313 return nil 314} 315 316// Next advances to the next value. If there was an error making 317// the request the iterator does not advance and the error is returned. 318// Deprecated: Use NextWithContext() instead. 319func (iter *CustomDomainListResultIterator) Next() error { 320 return iter.NextWithContext(context.Background()) 321} 322 323// NotDone returns true if the enumeration should be started or is not yet complete. 324func (iter CustomDomainListResultIterator) NotDone() bool { 325 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 326} 327 328// Response returns the raw server response from the last page request. 329func (iter CustomDomainListResultIterator) Response() CustomDomainListResult { 330 return iter.page.Response() 331} 332 333// Value returns the current value or a zero-initialized value if the 334// iterator has advanced beyond the end of the collection. 335func (iter CustomDomainListResultIterator) Value() CustomDomain { 336 if !iter.page.NotDone() { 337 return CustomDomain{} 338 } 339 return iter.page.Values()[iter.i] 340} 341 342// Creates a new instance of the CustomDomainListResultIterator type. 343func NewCustomDomainListResultIterator(page CustomDomainListResultPage) CustomDomainListResultIterator { 344 return CustomDomainListResultIterator{page: page} 345} 346 347// IsEmpty returns true if the ListResult contains no values. 348func (cdlr CustomDomainListResult) IsEmpty() bool { 349 return cdlr.Value == nil || len(*cdlr.Value) == 0 350} 351 352// hasNextLink returns true if the NextLink is not empty. 353func (cdlr CustomDomainListResult) hasNextLink() bool { 354 return cdlr.NextLink != nil && len(*cdlr.NextLink) != 0 355} 356 357// customDomainListResultPreparer prepares a request to retrieve the next set of results. 358// It returns nil if no more results exist. 359func (cdlr CustomDomainListResult) customDomainListResultPreparer(ctx context.Context) (*http.Request, error) { 360 if !cdlr.hasNextLink() { 361 return nil, nil 362 } 363 return autorest.Prepare((&http.Request{}).WithContext(ctx), 364 autorest.AsJSON(), 365 autorest.AsGet(), 366 autorest.WithBaseURL(to.String(cdlr.NextLink))) 367} 368 369// CustomDomainListResultPage contains a page of CustomDomain values. 370type CustomDomainListResultPage struct { 371 fn func(context.Context, CustomDomainListResult) (CustomDomainListResult, error) 372 cdlr CustomDomainListResult 373} 374 375// NextWithContext advances to the next page of values. If there was an error making 376// the request the page does not advance and the error is returned. 377func (page *CustomDomainListResultPage) NextWithContext(ctx context.Context) (err error) { 378 if tracing.IsEnabled() { 379 ctx = tracing.StartSpan(ctx, fqdn+"/CustomDomainListResultPage.NextWithContext") 380 defer func() { 381 sc := -1 382 if page.Response().Response.Response != nil { 383 sc = page.Response().Response.Response.StatusCode 384 } 385 tracing.EndSpan(ctx, sc, err) 386 }() 387 } 388 for { 389 next, err := page.fn(ctx, page.cdlr) 390 if err != nil { 391 return err 392 } 393 page.cdlr = next 394 if !next.hasNextLink() || !next.IsEmpty() { 395 break 396 } 397 } 398 return nil 399} 400 401// Next advances to the next page of values. If there was an error making 402// the request the page does not advance and the error is returned. 403// Deprecated: Use NextWithContext() instead. 404func (page *CustomDomainListResultPage) Next() error { 405 return page.NextWithContext(context.Background()) 406} 407 408// NotDone returns true if the page enumeration should be started or is not yet complete. 409func (page CustomDomainListResultPage) NotDone() bool { 410 return !page.cdlr.IsEmpty() 411} 412 413// Response returns the raw server response from the last page request. 414func (page CustomDomainListResultPage) Response() CustomDomainListResult { 415 return page.cdlr 416} 417 418// Values returns the slice of values for the current page or nil if there are no values. 419func (page CustomDomainListResultPage) Values() []CustomDomain { 420 if page.cdlr.IsEmpty() { 421 return nil 422 } 423 return *page.cdlr.Value 424} 425 426// Creates a new instance of the CustomDomainListResultPage type. 427func NewCustomDomainListResultPage(cur CustomDomainListResult, getNextPage func(context.Context, CustomDomainListResult) (CustomDomainListResult, error)) CustomDomainListResultPage { 428 return CustomDomainListResultPage{ 429 fn: getNextPage, 430 cdlr: cur, 431 } 432} 433 434// CustomDomainParameters the customDomain JSON object required for custom domain creation or update. 435type CustomDomainParameters struct { 436 *CustomDomainPropertiesParameters `json:"properties,omitempty"` 437} 438 439// MarshalJSON is the custom marshaler for CustomDomainParameters. 440func (cdp CustomDomainParameters) MarshalJSON() ([]byte, error) { 441 objectMap := make(map[string]interface{}) 442 if cdp.CustomDomainPropertiesParameters != nil { 443 objectMap["properties"] = cdp.CustomDomainPropertiesParameters 444 } 445 return json.Marshal(objectMap) 446} 447 448// UnmarshalJSON is the custom unmarshaler for CustomDomainParameters struct. 449func (cdp *CustomDomainParameters) UnmarshalJSON(body []byte) error { 450 var m map[string]*json.RawMessage 451 err := json.Unmarshal(body, &m) 452 if err != nil { 453 return err 454 } 455 for k, v := range m { 456 switch k { 457 case "properties": 458 if v != nil { 459 var customDomainPropertiesParameters CustomDomainPropertiesParameters 460 err = json.Unmarshal(*v, &customDomainPropertiesParameters) 461 if err != nil { 462 return err 463 } 464 cdp.CustomDomainPropertiesParameters = &customDomainPropertiesParameters 465 } 466 } 467 } 468 469 return nil 470} 471 472// CustomDomainProperties the JSON object that contains the properties of the custom domain to create. 473type CustomDomainProperties struct { 474 // HostName - The host name of the custom domain. Must be a domain name. 475 HostName *string `json:"hostName,omitempty"` 476 // ResourceState - READ-ONLY; Resource status of the custom domain. Possible values include: 'Creating', 'Active', 'Deleting' 477 ResourceState CustomDomainResourceState `json:"resourceState,omitempty"` 478 // CustomHTTPSProvisioningState - READ-ONLY; Provisioning status of Custom Https of the custom domain. Possible values include: 'Enabling', 'Enabled', 'Disabling', 'Disabled', 'Failed' 479 CustomHTTPSProvisioningState CustomHTTPSProvisioningState `json:"customHttpsProvisioningState,omitempty"` 480 // CustomHTTPSProvisioningSubstate - READ-ONLY; Provisioning substate shows the progress of custom HTTPS enabling/disabling process step by step. Possible values include: 'SubmittingDomainControlValidationRequest', 'PendingDomainControlValidationREquestApproval', 'DomainControlValidationRequestApproved', 'DomainControlValidationRequestRejected', 'DomainControlValidationRequestTimedOut', 'IssuingCertificate', 'DeployingCertificate', 'CertificateDeployed', 'DeletingCertificate', 'CertificateDeleted' 481 CustomHTTPSProvisioningSubstate CustomHTTPSProvisioningSubstate `json:"customHttpsProvisioningSubstate,omitempty"` 482 // CustomHTTPSParameters - Certificate parameters for securing custom HTTPS 483 CustomHTTPSParameters BasicCustomDomainHTTPSParameters `json:"customHttpsParameters,omitempty"` 484 // ValidationData - Special validation or data may be required when delivering CDN to some regions due to local compliance reasons. E.g. ICP license number of a custom domain is required to deliver content in China. 485 ValidationData *string `json:"validationData,omitempty"` 486 // ProvisioningState - READ-ONLY; Provisioning status of the custom domain. 487 ProvisioningState *string `json:"provisioningState,omitempty"` 488} 489 490// MarshalJSON is the custom marshaler for CustomDomainProperties. 491func (cdp CustomDomainProperties) MarshalJSON() ([]byte, error) { 492 objectMap := make(map[string]interface{}) 493 if cdp.HostName != nil { 494 objectMap["hostName"] = cdp.HostName 495 } 496 objectMap["customHttpsParameters"] = cdp.CustomHTTPSParameters 497 if cdp.ValidationData != nil { 498 objectMap["validationData"] = cdp.ValidationData 499 } 500 return json.Marshal(objectMap) 501} 502 503// UnmarshalJSON is the custom unmarshaler for CustomDomainProperties struct. 504func (cdp *CustomDomainProperties) UnmarshalJSON(body []byte) error { 505 var m map[string]*json.RawMessage 506 err := json.Unmarshal(body, &m) 507 if err != nil { 508 return err 509 } 510 for k, v := range m { 511 switch k { 512 case "hostName": 513 if v != nil { 514 var hostName string 515 err = json.Unmarshal(*v, &hostName) 516 if err != nil { 517 return err 518 } 519 cdp.HostName = &hostName 520 } 521 case "resourceState": 522 if v != nil { 523 var resourceState CustomDomainResourceState 524 err = json.Unmarshal(*v, &resourceState) 525 if err != nil { 526 return err 527 } 528 cdp.ResourceState = resourceState 529 } 530 case "customHttpsProvisioningState": 531 if v != nil { 532 var customHTTPSProvisioningState CustomHTTPSProvisioningState 533 err = json.Unmarshal(*v, &customHTTPSProvisioningState) 534 if err != nil { 535 return err 536 } 537 cdp.CustomHTTPSProvisioningState = customHTTPSProvisioningState 538 } 539 case "customHttpsProvisioningSubstate": 540 if v != nil { 541 var customHTTPSProvisioningSubstate CustomHTTPSProvisioningSubstate 542 err = json.Unmarshal(*v, &customHTTPSProvisioningSubstate) 543 if err != nil { 544 return err 545 } 546 cdp.CustomHTTPSProvisioningSubstate = customHTTPSProvisioningSubstate 547 } 548 case "customHttpsParameters": 549 if v != nil { 550 customHTTPSParameters, err := unmarshalBasicCustomDomainHTTPSParameters(*v) 551 if err != nil { 552 return err 553 } 554 cdp.CustomHTTPSParameters = customHTTPSParameters 555 } 556 case "validationData": 557 if v != nil { 558 var validationData string 559 err = json.Unmarshal(*v, &validationData) 560 if err != nil { 561 return err 562 } 563 cdp.ValidationData = &validationData 564 } 565 case "provisioningState": 566 if v != nil { 567 var provisioningState string 568 err = json.Unmarshal(*v, &provisioningState) 569 if err != nil { 570 return err 571 } 572 cdp.ProvisioningState = &provisioningState 573 } 574 } 575 } 576 577 return nil 578} 579 580// CustomDomainPropertiesParameters the JSON object that contains the properties of the custom domain to 581// create. 582type CustomDomainPropertiesParameters struct { 583 // HostName - The host name of the custom domain. Must be a domain name. 584 HostName *string `json:"hostName,omitempty"` 585} 586 587// CustomDomainsCreateFuture an abstraction for monitoring and retrieving the results of a long-running 588// operation. 589type CustomDomainsCreateFuture struct { 590 azure.FutureAPI 591 // Result returns the result of the asynchronous operation. 592 // If the operation has not completed it will return an error. 593 Result func(CustomDomainsClient) (CustomDomain, error) 594} 595 596// UnmarshalJSON is the custom unmarshaller for CreateFuture. 597func (future *CustomDomainsCreateFuture) UnmarshalJSON(body []byte) error { 598 var azFuture azure.Future 599 if err := json.Unmarshal(body, &azFuture); err != nil { 600 return err 601 } 602 future.FutureAPI = &azFuture 603 future.Result = future.result 604 return nil 605} 606 607// result is the default implementation for CustomDomainsCreateFuture.Result. 608func (future *CustomDomainsCreateFuture) result(client CustomDomainsClient) (cd CustomDomain, err error) { 609 var done bool 610 done, err = future.DoneWithContext(context.Background(), client) 611 if err != nil { 612 err = autorest.NewErrorWithError(err, "cdn.CustomDomainsCreateFuture", "Result", future.Response(), "Polling failure") 613 return 614 } 615 if !done { 616 cd.Response.Response = future.Response() 617 err = azure.NewAsyncOpIncompleteError("cdn.CustomDomainsCreateFuture") 618 return 619 } 620 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 621 if cd.Response.Response, err = future.GetResult(sender); err == nil && cd.Response.Response.StatusCode != http.StatusNoContent { 622 cd, err = client.CreateResponder(cd.Response.Response) 623 if err != nil { 624 err = autorest.NewErrorWithError(err, "cdn.CustomDomainsCreateFuture", "Result", cd.Response.Response, "Failure responding to request") 625 } 626 } 627 return 628} 629 630// CustomDomainsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running 631// operation. 632type CustomDomainsDeleteFuture struct { 633 azure.FutureAPI 634 // Result returns the result of the asynchronous operation. 635 // If the operation has not completed it will return an error. 636 Result func(CustomDomainsClient) (CustomDomain, error) 637} 638 639// UnmarshalJSON is the custom unmarshaller for CreateFuture. 640func (future *CustomDomainsDeleteFuture) UnmarshalJSON(body []byte) error { 641 var azFuture azure.Future 642 if err := json.Unmarshal(body, &azFuture); err != nil { 643 return err 644 } 645 future.FutureAPI = &azFuture 646 future.Result = future.result 647 return nil 648} 649 650// result is the default implementation for CustomDomainsDeleteFuture.Result. 651func (future *CustomDomainsDeleteFuture) result(client CustomDomainsClient) (cd CustomDomain, err error) { 652 var done bool 653 done, err = future.DoneWithContext(context.Background(), client) 654 if err != nil { 655 err = autorest.NewErrorWithError(err, "cdn.CustomDomainsDeleteFuture", "Result", future.Response(), "Polling failure") 656 return 657 } 658 if !done { 659 cd.Response.Response = future.Response() 660 err = azure.NewAsyncOpIncompleteError("cdn.CustomDomainsDeleteFuture") 661 return 662 } 663 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 664 if cd.Response.Response, err = future.GetResult(sender); err == nil && cd.Response.Response.StatusCode != http.StatusNoContent { 665 cd, err = client.DeleteResponder(cd.Response.Response) 666 if err != nil { 667 err = autorest.NewErrorWithError(err, "cdn.CustomDomainsDeleteFuture", "Result", cd.Response.Response, "Failure responding to request") 668 } 669 } 670 return 671} 672 673// DeepCreatedOrigin the main origin of CDN content which is added when creating a CDN endpoint. 674type DeepCreatedOrigin struct { 675 // Name - Origin name 676 Name *string `json:"name,omitempty"` 677 *DeepCreatedOriginProperties `json:"properties,omitempty"` 678} 679 680// MarshalJSON is the custom marshaler for DeepCreatedOrigin. 681func (dco DeepCreatedOrigin) MarshalJSON() ([]byte, error) { 682 objectMap := make(map[string]interface{}) 683 if dco.Name != nil { 684 objectMap["name"] = dco.Name 685 } 686 if dco.DeepCreatedOriginProperties != nil { 687 objectMap["properties"] = dco.DeepCreatedOriginProperties 688 } 689 return json.Marshal(objectMap) 690} 691 692// UnmarshalJSON is the custom unmarshaler for DeepCreatedOrigin struct. 693func (dco *DeepCreatedOrigin) UnmarshalJSON(body []byte) error { 694 var m map[string]*json.RawMessage 695 err := json.Unmarshal(body, &m) 696 if err != nil { 697 return err 698 } 699 for k, v := range m { 700 switch k { 701 case "name": 702 if v != nil { 703 var name string 704 err = json.Unmarshal(*v, &name) 705 if err != nil { 706 return err 707 } 708 dco.Name = &name 709 } 710 case "properties": 711 if v != nil { 712 var deepCreatedOriginProperties DeepCreatedOriginProperties 713 err = json.Unmarshal(*v, &deepCreatedOriginProperties) 714 if err != nil { 715 return err 716 } 717 dco.DeepCreatedOriginProperties = &deepCreatedOriginProperties 718 } 719 } 720 } 721 722 return nil 723} 724 725// DeepCreatedOriginProperties properties of the origin created on the CDN endpoint. 726type DeepCreatedOriginProperties struct { 727 // HostName - The address of the origin. It can be a domain name, IPv4 address, or IPv6 address. 728 HostName *string `json:"hostName,omitempty"` 729 // HTTPPort - The value of the HTTP port. Must be between 1 and 65535 730 HTTPPort *int32 `json:"httpPort,omitempty"` 731 // HTTPSPort - The value of the HTTPS port. Must be between 1 and 65535 732 HTTPSPort *int32 `json:"httpsPort,omitempty"` 733} 734 735// DeliveryRule a rule that specifies a set of actions and conditions 736type DeliveryRule struct { 737 // Name - Name of the rule 738 Name *string `json:"name,omitempty"` 739 // 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. 740 Order *int32 `json:"order,omitempty"` 741 // Conditions - A list of conditions that must be matched for the actions to be executed 742 Conditions *[]BasicDeliveryRuleCondition `json:"conditions,omitempty"` 743 // Actions - A list of actions that are executed when all the conditions of a rule are satisfied. 744 Actions *[]BasicDeliveryRuleAction `json:"actions,omitempty"` 745} 746 747// UnmarshalJSON is the custom unmarshaler for DeliveryRule struct. 748func (dr *DeliveryRule) UnmarshalJSON(body []byte) error { 749 var m map[string]*json.RawMessage 750 err := json.Unmarshal(body, &m) 751 if err != nil { 752 return err 753 } 754 for k, v := range m { 755 switch k { 756 case "name": 757 if v != nil { 758 var name string 759 err = json.Unmarshal(*v, &name) 760 if err != nil { 761 return err 762 } 763 dr.Name = &name 764 } 765 case "order": 766 if v != nil { 767 var order int32 768 err = json.Unmarshal(*v, &order) 769 if err != nil { 770 return err 771 } 772 dr.Order = &order 773 } 774 case "conditions": 775 if v != nil { 776 conditions, err := unmarshalBasicDeliveryRuleConditionArray(*v) 777 if err != nil { 778 return err 779 } 780 dr.Conditions = &conditions 781 } 782 case "actions": 783 if v != nil { 784 actions, err := unmarshalBasicDeliveryRuleActionArray(*v) 785 if err != nil { 786 return err 787 } 788 dr.Actions = &actions 789 } 790 } 791 } 792 793 return nil 794} 795 796// BasicDeliveryRuleAction an action for the delivery rule. 797type BasicDeliveryRuleAction interface { 798 AsURLRedirectAction() (*URLRedirectAction, bool) 799 AsURLRewriteAction() (*URLRewriteAction, bool) 800 AsDeliveryRuleRequestHeaderAction() (*DeliveryRuleRequestHeaderAction, bool) 801 AsDeliveryRuleResponseHeaderAction() (*DeliveryRuleResponseHeaderAction, bool) 802 AsDeliveryRuleCacheExpirationAction() (*DeliveryRuleCacheExpirationAction, bool) 803 AsDeliveryRuleCacheKeyQueryStringAction() (*DeliveryRuleCacheKeyQueryStringAction, bool) 804 AsDeliveryRuleAction() (*DeliveryRuleAction, bool) 805} 806 807// DeliveryRuleAction an action for the delivery rule. 808type DeliveryRuleAction struct { 809 // Name - Possible values include: 'NameDeliveryRuleAction', 'NameURLRedirect', 'NameURLRewrite', 'NameModifyRequestHeader', 'NameModifyResponseHeader', 'NameCacheExpiration', 'NameCacheKeyQueryString' 810 Name NameBasicDeliveryRuleAction `json:"name,omitempty"` 811} 812 813func unmarshalBasicDeliveryRuleAction(body []byte) (BasicDeliveryRuleAction, error) { 814 var m map[string]interface{} 815 err := json.Unmarshal(body, &m) 816 if err != nil { 817 return nil, err 818 } 819 820 switch m["name"] { 821 case string(NameURLRedirect): 822 var ura URLRedirectAction 823 err := json.Unmarshal(body, &ura) 824 return ura, err 825 case string(NameURLRewrite): 826 var ura URLRewriteAction 827 err := json.Unmarshal(body, &ura) 828 return ura, err 829 case string(NameModifyRequestHeader): 830 var drrha DeliveryRuleRequestHeaderAction 831 err := json.Unmarshal(body, &drrha) 832 return drrha, err 833 case string(NameModifyResponseHeader): 834 var drrha DeliveryRuleResponseHeaderAction 835 err := json.Unmarshal(body, &drrha) 836 return drrha, err 837 case string(NameCacheExpiration): 838 var drcea DeliveryRuleCacheExpirationAction 839 err := json.Unmarshal(body, &drcea) 840 return drcea, err 841 case string(NameCacheKeyQueryString): 842 var drckqsa DeliveryRuleCacheKeyQueryStringAction 843 err := json.Unmarshal(body, &drckqsa) 844 return drckqsa, err 845 default: 846 var dra DeliveryRuleAction 847 err := json.Unmarshal(body, &dra) 848 return dra, err 849 } 850} 851func unmarshalBasicDeliveryRuleActionArray(body []byte) ([]BasicDeliveryRuleAction, error) { 852 var rawMessages []*json.RawMessage 853 err := json.Unmarshal(body, &rawMessages) 854 if err != nil { 855 return nil, err 856 } 857 858 draArray := make([]BasicDeliveryRuleAction, len(rawMessages)) 859 860 for index, rawMessage := range rawMessages { 861 dra, err := unmarshalBasicDeliveryRuleAction(*rawMessage) 862 if err != nil { 863 return nil, err 864 } 865 draArray[index] = dra 866 } 867 return draArray, nil 868} 869 870// MarshalJSON is the custom marshaler for DeliveryRuleAction. 871func (dra DeliveryRuleAction) MarshalJSON() ([]byte, error) { 872 dra.Name = NameDeliveryRuleAction 873 objectMap := make(map[string]interface{}) 874 if dra.Name != "" { 875 objectMap["name"] = dra.Name 876 } 877 return json.Marshal(objectMap) 878} 879 880// AsURLRedirectAction is the BasicDeliveryRuleAction implementation for DeliveryRuleAction. 881func (dra DeliveryRuleAction) AsURLRedirectAction() (*URLRedirectAction, bool) { 882 return nil, false 883} 884 885// AsURLRewriteAction is the BasicDeliveryRuleAction implementation for DeliveryRuleAction. 886func (dra DeliveryRuleAction) AsURLRewriteAction() (*URLRewriteAction, bool) { 887 return nil, false 888} 889 890// AsDeliveryRuleRequestHeaderAction is the BasicDeliveryRuleAction implementation for DeliveryRuleAction. 891func (dra DeliveryRuleAction) AsDeliveryRuleRequestHeaderAction() (*DeliveryRuleRequestHeaderAction, bool) { 892 return nil, false 893} 894 895// AsDeliveryRuleResponseHeaderAction is the BasicDeliveryRuleAction implementation for DeliveryRuleAction. 896func (dra DeliveryRuleAction) AsDeliveryRuleResponseHeaderAction() (*DeliveryRuleResponseHeaderAction, bool) { 897 return nil, false 898} 899 900// AsDeliveryRuleCacheExpirationAction is the BasicDeliveryRuleAction implementation for DeliveryRuleAction. 901func (dra DeliveryRuleAction) AsDeliveryRuleCacheExpirationAction() (*DeliveryRuleCacheExpirationAction, bool) { 902 return nil, false 903} 904 905// AsDeliveryRuleCacheKeyQueryStringAction is the BasicDeliveryRuleAction implementation for DeliveryRuleAction. 906func (dra DeliveryRuleAction) AsDeliveryRuleCacheKeyQueryStringAction() (*DeliveryRuleCacheKeyQueryStringAction, bool) { 907 return nil, false 908} 909 910// AsDeliveryRuleAction is the BasicDeliveryRuleAction implementation for DeliveryRuleAction. 911func (dra DeliveryRuleAction) AsDeliveryRuleAction() (*DeliveryRuleAction, bool) { 912 return &dra, true 913} 914 915// AsBasicDeliveryRuleAction is the BasicDeliveryRuleAction implementation for DeliveryRuleAction. 916func (dra DeliveryRuleAction) AsBasicDeliveryRuleAction() (BasicDeliveryRuleAction, bool) { 917 return &dra, true 918} 919 920// DeliveryRuleCacheExpirationAction defines the cache expiration action for the delivery rule. 921type DeliveryRuleCacheExpirationAction struct { 922 // Parameters - Defines the parameters for the action. 923 Parameters *CacheExpirationActionParameters `json:"parameters,omitempty"` 924 // Name - Possible values include: 'NameDeliveryRuleAction', 'NameURLRedirect', 'NameURLRewrite', 'NameModifyRequestHeader', 'NameModifyResponseHeader', 'NameCacheExpiration', 'NameCacheKeyQueryString' 925 Name NameBasicDeliveryRuleAction `json:"name,omitempty"` 926} 927 928// MarshalJSON is the custom marshaler for DeliveryRuleCacheExpirationAction. 929func (drcea DeliveryRuleCacheExpirationAction) MarshalJSON() ([]byte, error) { 930 drcea.Name = NameCacheExpiration 931 objectMap := make(map[string]interface{}) 932 if drcea.Parameters != nil { 933 objectMap["parameters"] = drcea.Parameters 934 } 935 if drcea.Name != "" { 936 objectMap["name"] = drcea.Name 937 } 938 return json.Marshal(objectMap) 939} 940 941// AsURLRedirectAction is the BasicDeliveryRuleAction implementation for DeliveryRuleCacheExpirationAction. 942func (drcea DeliveryRuleCacheExpirationAction) AsURLRedirectAction() (*URLRedirectAction, bool) { 943 return nil, false 944} 945 946// AsURLRewriteAction is the BasicDeliveryRuleAction implementation for DeliveryRuleCacheExpirationAction. 947func (drcea DeliveryRuleCacheExpirationAction) AsURLRewriteAction() (*URLRewriteAction, bool) { 948 return nil, false 949} 950 951// AsDeliveryRuleRequestHeaderAction is the BasicDeliveryRuleAction implementation for DeliveryRuleCacheExpirationAction. 952func (drcea DeliveryRuleCacheExpirationAction) AsDeliveryRuleRequestHeaderAction() (*DeliveryRuleRequestHeaderAction, bool) { 953 return nil, false 954} 955 956// AsDeliveryRuleResponseHeaderAction is the BasicDeliveryRuleAction implementation for DeliveryRuleCacheExpirationAction. 957func (drcea DeliveryRuleCacheExpirationAction) AsDeliveryRuleResponseHeaderAction() (*DeliveryRuleResponseHeaderAction, bool) { 958 return nil, false 959} 960 961// AsDeliveryRuleCacheExpirationAction is the BasicDeliveryRuleAction implementation for DeliveryRuleCacheExpirationAction. 962func (drcea DeliveryRuleCacheExpirationAction) AsDeliveryRuleCacheExpirationAction() (*DeliveryRuleCacheExpirationAction, bool) { 963 return &drcea, true 964} 965 966// AsDeliveryRuleCacheKeyQueryStringAction is the BasicDeliveryRuleAction implementation for DeliveryRuleCacheExpirationAction. 967func (drcea DeliveryRuleCacheExpirationAction) AsDeliveryRuleCacheKeyQueryStringAction() (*DeliveryRuleCacheKeyQueryStringAction, bool) { 968 return nil, false 969} 970 971// AsDeliveryRuleAction is the BasicDeliveryRuleAction implementation for DeliveryRuleCacheExpirationAction. 972func (drcea DeliveryRuleCacheExpirationAction) AsDeliveryRuleAction() (*DeliveryRuleAction, bool) { 973 return nil, false 974} 975 976// AsBasicDeliveryRuleAction is the BasicDeliveryRuleAction implementation for DeliveryRuleCacheExpirationAction. 977func (drcea DeliveryRuleCacheExpirationAction) AsBasicDeliveryRuleAction() (BasicDeliveryRuleAction, bool) { 978 return &drcea, true 979} 980 981// DeliveryRuleCacheKeyQueryStringAction defines the cache-key query string action for the delivery rule. 982type DeliveryRuleCacheKeyQueryStringAction struct { 983 // Parameters - Defines the parameters for the action. 984 Parameters *CacheKeyQueryStringActionParameters `json:"parameters,omitempty"` 985 // Name - Possible values include: 'NameDeliveryRuleAction', 'NameURLRedirect', 'NameURLRewrite', 'NameModifyRequestHeader', 'NameModifyResponseHeader', 'NameCacheExpiration', 'NameCacheKeyQueryString' 986 Name NameBasicDeliveryRuleAction `json:"name,omitempty"` 987} 988 989// MarshalJSON is the custom marshaler for DeliveryRuleCacheKeyQueryStringAction. 990func (drckqsa DeliveryRuleCacheKeyQueryStringAction) MarshalJSON() ([]byte, error) { 991 drckqsa.Name = NameCacheKeyQueryString 992 objectMap := make(map[string]interface{}) 993 if drckqsa.Parameters != nil { 994 objectMap["parameters"] = drckqsa.Parameters 995 } 996 if drckqsa.Name != "" { 997 objectMap["name"] = drckqsa.Name 998 } 999 return json.Marshal(objectMap) 1000} 1001 1002// AsURLRedirectAction is the BasicDeliveryRuleAction implementation for DeliveryRuleCacheKeyQueryStringAction. 1003func (drckqsa DeliveryRuleCacheKeyQueryStringAction) AsURLRedirectAction() (*URLRedirectAction, bool) { 1004 return nil, false 1005} 1006 1007// AsURLRewriteAction is the BasicDeliveryRuleAction implementation for DeliveryRuleCacheKeyQueryStringAction. 1008func (drckqsa DeliveryRuleCacheKeyQueryStringAction) AsURLRewriteAction() (*URLRewriteAction, bool) { 1009 return nil, false 1010} 1011 1012// AsDeliveryRuleRequestHeaderAction is the BasicDeliveryRuleAction implementation for DeliveryRuleCacheKeyQueryStringAction. 1013func (drckqsa DeliveryRuleCacheKeyQueryStringAction) AsDeliveryRuleRequestHeaderAction() (*DeliveryRuleRequestHeaderAction, bool) { 1014 return nil, false 1015} 1016 1017// AsDeliveryRuleResponseHeaderAction is the BasicDeliveryRuleAction implementation for DeliveryRuleCacheKeyQueryStringAction. 1018func (drckqsa DeliveryRuleCacheKeyQueryStringAction) AsDeliveryRuleResponseHeaderAction() (*DeliveryRuleResponseHeaderAction, bool) { 1019 return nil, false 1020} 1021 1022// AsDeliveryRuleCacheExpirationAction is the BasicDeliveryRuleAction implementation for DeliveryRuleCacheKeyQueryStringAction. 1023func (drckqsa DeliveryRuleCacheKeyQueryStringAction) AsDeliveryRuleCacheExpirationAction() (*DeliveryRuleCacheExpirationAction, bool) { 1024 return nil, false 1025} 1026 1027// AsDeliveryRuleCacheKeyQueryStringAction is the BasicDeliveryRuleAction implementation for DeliveryRuleCacheKeyQueryStringAction. 1028func (drckqsa DeliveryRuleCacheKeyQueryStringAction) AsDeliveryRuleCacheKeyQueryStringAction() (*DeliveryRuleCacheKeyQueryStringAction, bool) { 1029 return &drckqsa, true 1030} 1031 1032// AsDeliveryRuleAction is the BasicDeliveryRuleAction implementation for DeliveryRuleCacheKeyQueryStringAction. 1033func (drckqsa DeliveryRuleCacheKeyQueryStringAction) AsDeliveryRuleAction() (*DeliveryRuleAction, bool) { 1034 return nil, false 1035} 1036 1037// AsBasicDeliveryRuleAction is the BasicDeliveryRuleAction implementation for DeliveryRuleCacheKeyQueryStringAction. 1038func (drckqsa DeliveryRuleCacheKeyQueryStringAction) AsBasicDeliveryRuleAction() (BasicDeliveryRuleAction, bool) { 1039 return &drckqsa, true 1040} 1041 1042// BasicDeliveryRuleCondition a condition for the delivery rule. 1043type BasicDeliveryRuleCondition interface { 1044 AsDeliveryRuleRemoteAddressCondition() (*DeliveryRuleRemoteAddressCondition, bool) 1045 AsDeliveryRuleRequestMethodCondition() (*DeliveryRuleRequestMethodCondition, bool) 1046 AsDeliveryRuleQueryStringCondition() (*DeliveryRuleQueryStringCondition, bool) 1047 AsDeliveryRulePostArgsCondition() (*DeliveryRulePostArgsCondition, bool) 1048 AsDeliveryRuleRequestURICondition() (*DeliveryRuleRequestURICondition, bool) 1049 AsDeliveryRuleRequestHeaderCondition() (*DeliveryRuleRequestHeaderCondition, bool) 1050 AsDeliveryRuleRequestBodyCondition() (*DeliveryRuleRequestBodyCondition, bool) 1051 AsDeliveryRuleRequestSchemeCondition() (*DeliveryRuleRequestSchemeCondition, bool) 1052 AsDeliveryRuleURLPathCondition() (*DeliveryRuleURLPathCondition, bool) 1053 AsDeliveryRuleURLFileExtensionCondition() (*DeliveryRuleURLFileExtensionCondition, bool) 1054 AsDeliveryRuleURLFileNameCondition() (*DeliveryRuleURLFileNameCondition, bool) 1055 AsDeliveryRuleHTTPVersionCondition() (*DeliveryRuleHTTPVersionCondition, bool) 1056 AsDeliveryRuleCookiesCondition() (*DeliveryRuleCookiesCondition, bool) 1057 AsDeliveryRuleIsDeviceCondition() (*DeliveryRuleIsDeviceCondition, bool) 1058 AsDeliveryRuleCondition() (*DeliveryRuleCondition, bool) 1059} 1060 1061// DeliveryRuleCondition a condition for the delivery rule. 1062type DeliveryRuleCondition struct { 1063 // Name - Possible values include: 'NameDeliveryRuleCondition', 'NameRemoteAddress', 'NameRequestMethod', 'NameQueryString', 'NamePostArgs', 'NameRequestURI', 'NameRequestHeader', 'NameRequestBody', 'NameRequestScheme', 'NameURLPath', 'NameURLFileExtension', 'NameURLFileName', 'NameHTTPVersion', 'NameCookies', 'NameIsDevice' 1064 Name Name `json:"name,omitempty"` 1065} 1066 1067func unmarshalBasicDeliveryRuleCondition(body []byte) (BasicDeliveryRuleCondition, error) { 1068 var m map[string]interface{} 1069 err := json.Unmarshal(body, &m) 1070 if err != nil { 1071 return nil, err 1072 } 1073 1074 switch m["name"] { 1075 case string(NameRemoteAddress): 1076 var drrac DeliveryRuleRemoteAddressCondition 1077 err := json.Unmarshal(body, &drrac) 1078 return drrac, err 1079 case string(NameRequestMethod): 1080 var drrmc DeliveryRuleRequestMethodCondition 1081 err := json.Unmarshal(body, &drrmc) 1082 return drrmc, err 1083 case string(NameQueryString): 1084 var drqsc DeliveryRuleQueryStringCondition 1085 err := json.Unmarshal(body, &drqsc) 1086 return drqsc, err 1087 case string(NamePostArgs): 1088 var drpac DeliveryRulePostArgsCondition 1089 err := json.Unmarshal(body, &drpac) 1090 return drpac, err 1091 case string(NameRequestURI): 1092 var drruc DeliveryRuleRequestURICondition 1093 err := json.Unmarshal(body, &drruc) 1094 return drruc, err 1095 case string(NameRequestHeader): 1096 var drrhc DeliveryRuleRequestHeaderCondition 1097 err := json.Unmarshal(body, &drrhc) 1098 return drrhc, err 1099 case string(NameRequestBody): 1100 var drrbc DeliveryRuleRequestBodyCondition 1101 err := json.Unmarshal(body, &drrbc) 1102 return drrbc, err 1103 case string(NameRequestScheme): 1104 var drrsc DeliveryRuleRequestSchemeCondition 1105 err := json.Unmarshal(body, &drrsc) 1106 return drrsc, err 1107 case string(NameURLPath): 1108 var drupc DeliveryRuleURLPathCondition 1109 err := json.Unmarshal(body, &drupc) 1110 return drupc, err 1111 case string(NameURLFileExtension): 1112 var drufec DeliveryRuleURLFileExtensionCondition 1113 err := json.Unmarshal(body, &drufec) 1114 return drufec, err 1115 case string(NameURLFileName): 1116 var drufnc DeliveryRuleURLFileNameCondition 1117 err := json.Unmarshal(body, &drufnc) 1118 return drufnc, err 1119 case string(NameHTTPVersion): 1120 var drhvc DeliveryRuleHTTPVersionCondition 1121 err := json.Unmarshal(body, &drhvc) 1122 return drhvc, err 1123 case string(NameCookies): 1124 var drcc DeliveryRuleCookiesCondition 1125 err := json.Unmarshal(body, &drcc) 1126 return drcc, err 1127 case string(NameIsDevice): 1128 var dridc DeliveryRuleIsDeviceCondition 1129 err := json.Unmarshal(body, &dridc) 1130 return dridc, err 1131 default: 1132 var drc DeliveryRuleCondition 1133 err := json.Unmarshal(body, &drc) 1134 return drc, err 1135 } 1136} 1137func unmarshalBasicDeliveryRuleConditionArray(body []byte) ([]BasicDeliveryRuleCondition, error) { 1138 var rawMessages []*json.RawMessage 1139 err := json.Unmarshal(body, &rawMessages) 1140 if err != nil { 1141 return nil, err 1142 } 1143 1144 drcArray := make([]BasicDeliveryRuleCondition, len(rawMessages)) 1145 1146 for index, rawMessage := range rawMessages { 1147 drc, err := unmarshalBasicDeliveryRuleCondition(*rawMessage) 1148 if err != nil { 1149 return nil, err 1150 } 1151 drcArray[index] = drc 1152 } 1153 return drcArray, nil 1154} 1155 1156// MarshalJSON is the custom marshaler for DeliveryRuleCondition. 1157func (drc DeliveryRuleCondition) MarshalJSON() ([]byte, error) { 1158 drc.Name = NameDeliveryRuleCondition 1159 objectMap := make(map[string]interface{}) 1160 if drc.Name != "" { 1161 objectMap["name"] = drc.Name 1162 } 1163 return json.Marshal(objectMap) 1164} 1165 1166// AsDeliveryRuleRemoteAddressCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleCondition. 1167func (drc DeliveryRuleCondition) AsDeliveryRuleRemoteAddressCondition() (*DeliveryRuleRemoteAddressCondition, bool) { 1168 return nil, false 1169} 1170 1171// AsDeliveryRuleRequestMethodCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleCondition. 1172func (drc DeliveryRuleCondition) AsDeliveryRuleRequestMethodCondition() (*DeliveryRuleRequestMethodCondition, bool) { 1173 return nil, false 1174} 1175 1176// AsDeliveryRuleQueryStringCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleCondition. 1177func (drc DeliveryRuleCondition) AsDeliveryRuleQueryStringCondition() (*DeliveryRuleQueryStringCondition, bool) { 1178 return nil, false 1179} 1180 1181// AsDeliveryRulePostArgsCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleCondition. 1182func (drc DeliveryRuleCondition) AsDeliveryRulePostArgsCondition() (*DeliveryRulePostArgsCondition, bool) { 1183 return nil, false 1184} 1185 1186// AsDeliveryRuleRequestURICondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleCondition. 1187func (drc DeliveryRuleCondition) AsDeliveryRuleRequestURICondition() (*DeliveryRuleRequestURICondition, bool) { 1188 return nil, false 1189} 1190 1191// AsDeliveryRuleRequestHeaderCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleCondition. 1192func (drc DeliveryRuleCondition) AsDeliveryRuleRequestHeaderCondition() (*DeliveryRuleRequestHeaderCondition, bool) { 1193 return nil, false 1194} 1195 1196// AsDeliveryRuleRequestBodyCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleCondition. 1197func (drc DeliveryRuleCondition) AsDeliveryRuleRequestBodyCondition() (*DeliveryRuleRequestBodyCondition, bool) { 1198 return nil, false 1199} 1200 1201// AsDeliveryRuleRequestSchemeCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleCondition. 1202func (drc DeliveryRuleCondition) AsDeliveryRuleRequestSchemeCondition() (*DeliveryRuleRequestSchemeCondition, bool) { 1203 return nil, false 1204} 1205 1206// AsDeliveryRuleURLPathCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleCondition. 1207func (drc DeliveryRuleCondition) AsDeliveryRuleURLPathCondition() (*DeliveryRuleURLPathCondition, bool) { 1208 return nil, false 1209} 1210 1211// AsDeliveryRuleURLFileExtensionCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleCondition. 1212func (drc DeliveryRuleCondition) AsDeliveryRuleURLFileExtensionCondition() (*DeliveryRuleURLFileExtensionCondition, bool) { 1213 return nil, false 1214} 1215 1216// AsDeliveryRuleURLFileNameCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleCondition. 1217func (drc DeliveryRuleCondition) AsDeliveryRuleURLFileNameCondition() (*DeliveryRuleURLFileNameCondition, bool) { 1218 return nil, false 1219} 1220 1221// AsDeliveryRuleHTTPVersionCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleCondition. 1222func (drc DeliveryRuleCondition) AsDeliveryRuleHTTPVersionCondition() (*DeliveryRuleHTTPVersionCondition, bool) { 1223 return nil, false 1224} 1225 1226// AsDeliveryRuleCookiesCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleCondition. 1227func (drc DeliveryRuleCondition) AsDeliveryRuleCookiesCondition() (*DeliveryRuleCookiesCondition, bool) { 1228 return nil, false 1229} 1230 1231// AsDeliveryRuleIsDeviceCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleCondition. 1232func (drc DeliveryRuleCondition) AsDeliveryRuleIsDeviceCondition() (*DeliveryRuleIsDeviceCondition, bool) { 1233 return nil, false 1234} 1235 1236// AsDeliveryRuleCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleCondition. 1237func (drc DeliveryRuleCondition) AsDeliveryRuleCondition() (*DeliveryRuleCondition, bool) { 1238 return &drc, true 1239} 1240 1241// AsBasicDeliveryRuleCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleCondition. 1242func (drc DeliveryRuleCondition) AsBasicDeliveryRuleCondition() (BasicDeliveryRuleCondition, bool) { 1243 return &drc, true 1244} 1245 1246// DeliveryRuleCookiesCondition defines the Cookies condition for the delivery rule. 1247type DeliveryRuleCookiesCondition struct { 1248 // Parameters - Defines the parameters for the condition. 1249 Parameters *CookiesMatchConditionParameters `json:"parameters,omitempty"` 1250 // Name - Possible values include: 'NameDeliveryRuleCondition', 'NameRemoteAddress', 'NameRequestMethod', 'NameQueryString', 'NamePostArgs', 'NameRequestURI', 'NameRequestHeader', 'NameRequestBody', 'NameRequestScheme', 'NameURLPath', 'NameURLFileExtension', 'NameURLFileName', 'NameHTTPVersion', 'NameCookies', 'NameIsDevice' 1251 Name Name `json:"name,omitempty"` 1252} 1253 1254// MarshalJSON is the custom marshaler for DeliveryRuleCookiesCondition. 1255func (drcc DeliveryRuleCookiesCondition) MarshalJSON() ([]byte, error) { 1256 drcc.Name = NameCookies 1257 objectMap := make(map[string]interface{}) 1258 if drcc.Parameters != nil { 1259 objectMap["parameters"] = drcc.Parameters 1260 } 1261 if drcc.Name != "" { 1262 objectMap["name"] = drcc.Name 1263 } 1264 return json.Marshal(objectMap) 1265} 1266 1267// AsDeliveryRuleRemoteAddressCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleCookiesCondition. 1268func (drcc DeliveryRuleCookiesCondition) AsDeliveryRuleRemoteAddressCondition() (*DeliveryRuleRemoteAddressCondition, bool) { 1269 return nil, false 1270} 1271 1272// AsDeliveryRuleRequestMethodCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleCookiesCondition. 1273func (drcc DeliveryRuleCookiesCondition) AsDeliveryRuleRequestMethodCondition() (*DeliveryRuleRequestMethodCondition, bool) { 1274 return nil, false 1275} 1276 1277// AsDeliveryRuleQueryStringCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleCookiesCondition. 1278func (drcc DeliveryRuleCookiesCondition) AsDeliveryRuleQueryStringCondition() (*DeliveryRuleQueryStringCondition, bool) { 1279 return nil, false 1280} 1281 1282// AsDeliveryRulePostArgsCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleCookiesCondition. 1283func (drcc DeliveryRuleCookiesCondition) AsDeliveryRulePostArgsCondition() (*DeliveryRulePostArgsCondition, bool) { 1284 return nil, false 1285} 1286 1287// AsDeliveryRuleRequestURICondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleCookiesCondition. 1288func (drcc DeliveryRuleCookiesCondition) AsDeliveryRuleRequestURICondition() (*DeliveryRuleRequestURICondition, bool) { 1289 return nil, false 1290} 1291 1292// AsDeliveryRuleRequestHeaderCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleCookiesCondition. 1293func (drcc DeliveryRuleCookiesCondition) AsDeliveryRuleRequestHeaderCondition() (*DeliveryRuleRequestHeaderCondition, bool) { 1294 return nil, false 1295} 1296 1297// AsDeliveryRuleRequestBodyCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleCookiesCondition. 1298func (drcc DeliveryRuleCookiesCondition) AsDeliveryRuleRequestBodyCondition() (*DeliveryRuleRequestBodyCondition, bool) { 1299 return nil, false 1300} 1301 1302// AsDeliveryRuleRequestSchemeCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleCookiesCondition. 1303func (drcc DeliveryRuleCookiesCondition) AsDeliveryRuleRequestSchemeCondition() (*DeliveryRuleRequestSchemeCondition, bool) { 1304 return nil, false 1305} 1306 1307// AsDeliveryRuleURLPathCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleCookiesCondition. 1308func (drcc DeliveryRuleCookiesCondition) AsDeliveryRuleURLPathCondition() (*DeliveryRuleURLPathCondition, bool) { 1309 return nil, false 1310} 1311 1312// AsDeliveryRuleURLFileExtensionCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleCookiesCondition. 1313func (drcc DeliveryRuleCookiesCondition) AsDeliveryRuleURLFileExtensionCondition() (*DeliveryRuleURLFileExtensionCondition, bool) { 1314 return nil, false 1315} 1316 1317// AsDeliveryRuleURLFileNameCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleCookiesCondition. 1318func (drcc DeliveryRuleCookiesCondition) AsDeliveryRuleURLFileNameCondition() (*DeliveryRuleURLFileNameCondition, bool) { 1319 return nil, false 1320} 1321 1322// AsDeliveryRuleHTTPVersionCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleCookiesCondition. 1323func (drcc DeliveryRuleCookiesCondition) AsDeliveryRuleHTTPVersionCondition() (*DeliveryRuleHTTPVersionCondition, bool) { 1324 return nil, false 1325} 1326 1327// AsDeliveryRuleCookiesCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleCookiesCondition. 1328func (drcc DeliveryRuleCookiesCondition) AsDeliveryRuleCookiesCondition() (*DeliveryRuleCookiesCondition, bool) { 1329 return &drcc, true 1330} 1331 1332// AsDeliveryRuleIsDeviceCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleCookiesCondition. 1333func (drcc DeliveryRuleCookiesCondition) AsDeliveryRuleIsDeviceCondition() (*DeliveryRuleIsDeviceCondition, bool) { 1334 return nil, false 1335} 1336 1337// AsDeliveryRuleCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleCookiesCondition. 1338func (drcc DeliveryRuleCookiesCondition) AsDeliveryRuleCondition() (*DeliveryRuleCondition, bool) { 1339 return nil, false 1340} 1341 1342// AsBasicDeliveryRuleCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleCookiesCondition. 1343func (drcc DeliveryRuleCookiesCondition) AsBasicDeliveryRuleCondition() (BasicDeliveryRuleCondition, bool) { 1344 return &drcc, true 1345} 1346 1347// DeliveryRuleHTTPVersionCondition defines the HttpVersion condition for the delivery rule. 1348type DeliveryRuleHTTPVersionCondition struct { 1349 // Parameters - Defines the parameters for the condition. 1350 Parameters *HTTPVersionMatchConditionParameters `json:"parameters,omitempty"` 1351 // Name - Possible values include: 'NameDeliveryRuleCondition', 'NameRemoteAddress', 'NameRequestMethod', 'NameQueryString', 'NamePostArgs', 'NameRequestURI', 'NameRequestHeader', 'NameRequestBody', 'NameRequestScheme', 'NameURLPath', 'NameURLFileExtension', 'NameURLFileName', 'NameHTTPVersion', 'NameCookies', 'NameIsDevice' 1352 Name Name `json:"name,omitempty"` 1353} 1354 1355// MarshalJSON is the custom marshaler for DeliveryRuleHTTPVersionCondition. 1356func (drhvc DeliveryRuleHTTPVersionCondition) MarshalJSON() ([]byte, error) { 1357 drhvc.Name = NameHTTPVersion 1358 objectMap := make(map[string]interface{}) 1359 if drhvc.Parameters != nil { 1360 objectMap["parameters"] = drhvc.Parameters 1361 } 1362 if drhvc.Name != "" { 1363 objectMap["name"] = drhvc.Name 1364 } 1365 return json.Marshal(objectMap) 1366} 1367 1368// AsDeliveryRuleRemoteAddressCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleHTTPVersionCondition. 1369func (drhvc DeliveryRuleHTTPVersionCondition) AsDeliveryRuleRemoteAddressCondition() (*DeliveryRuleRemoteAddressCondition, bool) { 1370 return nil, false 1371} 1372 1373// AsDeliveryRuleRequestMethodCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleHTTPVersionCondition. 1374func (drhvc DeliveryRuleHTTPVersionCondition) AsDeliveryRuleRequestMethodCondition() (*DeliveryRuleRequestMethodCondition, bool) { 1375 return nil, false 1376} 1377 1378// AsDeliveryRuleQueryStringCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleHTTPVersionCondition. 1379func (drhvc DeliveryRuleHTTPVersionCondition) AsDeliveryRuleQueryStringCondition() (*DeliveryRuleQueryStringCondition, bool) { 1380 return nil, false 1381} 1382 1383// AsDeliveryRulePostArgsCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleHTTPVersionCondition. 1384func (drhvc DeliveryRuleHTTPVersionCondition) AsDeliveryRulePostArgsCondition() (*DeliveryRulePostArgsCondition, bool) { 1385 return nil, false 1386} 1387 1388// AsDeliveryRuleRequestURICondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleHTTPVersionCondition. 1389func (drhvc DeliveryRuleHTTPVersionCondition) AsDeliveryRuleRequestURICondition() (*DeliveryRuleRequestURICondition, bool) { 1390 return nil, false 1391} 1392 1393// AsDeliveryRuleRequestHeaderCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleHTTPVersionCondition. 1394func (drhvc DeliveryRuleHTTPVersionCondition) AsDeliveryRuleRequestHeaderCondition() (*DeliveryRuleRequestHeaderCondition, bool) { 1395 return nil, false 1396} 1397 1398// AsDeliveryRuleRequestBodyCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleHTTPVersionCondition. 1399func (drhvc DeliveryRuleHTTPVersionCondition) AsDeliveryRuleRequestBodyCondition() (*DeliveryRuleRequestBodyCondition, bool) { 1400 return nil, false 1401} 1402 1403// AsDeliveryRuleRequestSchemeCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleHTTPVersionCondition. 1404func (drhvc DeliveryRuleHTTPVersionCondition) AsDeliveryRuleRequestSchemeCondition() (*DeliveryRuleRequestSchemeCondition, bool) { 1405 return nil, false 1406} 1407 1408// AsDeliveryRuleURLPathCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleHTTPVersionCondition. 1409func (drhvc DeliveryRuleHTTPVersionCondition) AsDeliveryRuleURLPathCondition() (*DeliveryRuleURLPathCondition, bool) { 1410 return nil, false 1411} 1412 1413// AsDeliveryRuleURLFileExtensionCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleHTTPVersionCondition. 1414func (drhvc DeliveryRuleHTTPVersionCondition) AsDeliveryRuleURLFileExtensionCondition() (*DeliveryRuleURLFileExtensionCondition, bool) { 1415 return nil, false 1416} 1417 1418// AsDeliveryRuleURLFileNameCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleHTTPVersionCondition. 1419func (drhvc DeliveryRuleHTTPVersionCondition) AsDeliveryRuleURLFileNameCondition() (*DeliveryRuleURLFileNameCondition, bool) { 1420 return nil, false 1421} 1422 1423// AsDeliveryRuleHTTPVersionCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleHTTPVersionCondition. 1424func (drhvc DeliveryRuleHTTPVersionCondition) AsDeliveryRuleHTTPVersionCondition() (*DeliveryRuleHTTPVersionCondition, bool) { 1425 return &drhvc, true 1426} 1427 1428// AsDeliveryRuleCookiesCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleHTTPVersionCondition. 1429func (drhvc DeliveryRuleHTTPVersionCondition) AsDeliveryRuleCookiesCondition() (*DeliveryRuleCookiesCondition, bool) { 1430 return nil, false 1431} 1432 1433// AsDeliveryRuleIsDeviceCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleHTTPVersionCondition. 1434func (drhvc DeliveryRuleHTTPVersionCondition) AsDeliveryRuleIsDeviceCondition() (*DeliveryRuleIsDeviceCondition, bool) { 1435 return nil, false 1436} 1437 1438// AsDeliveryRuleCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleHTTPVersionCondition. 1439func (drhvc DeliveryRuleHTTPVersionCondition) AsDeliveryRuleCondition() (*DeliveryRuleCondition, bool) { 1440 return nil, false 1441} 1442 1443// AsBasicDeliveryRuleCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleHTTPVersionCondition. 1444func (drhvc DeliveryRuleHTTPVersionCondition) AsBasicDeliveryRuleCondition() (BasicDeliveryRuleCondition, bool) { 1445 return &drhvc, true 1446} 1447 1448// DeliveryRuleIsDeviceCondition defines the IsDevice condition for the delivery rule. 1449type DeliveryRuleIsDeviceCondition struct { 1450 // Parameters - Defines the parameters for the condition. 1451 Parameters *IsDeviceMatchConditionParameters `json:"parameters,omitempty"` 1452 // Name - Possible values include: 'NameDeliveryRuleCondition', 'NameRemoteAddress', 'NameRequestMethod', 'NameQueryString', 'NamePostArgs', 'NameRequestURI', 'NameRequestHeader', 'NameRequestBody', 'NameRequestScheme', 'NameURLPath', 'NameURLFileExtension', 'NameURLFileName', 'NameHTTPVersion', 'NameCookies', 'NameIsDevice' 1453 Name Name `json:"name,omitempty"` 1454} 1455 1456// MarshalJSON is the custom marshaler for DeliveryRuleIsDeviceCondition. 1457func (dridc DeliveryRuleIsDeviceCondition) MarshalJSON() ([]byte, error) { 1458 dridc.Name = NameIsDevice 1459 objectMap := make(map[string]interface{}) 1460 if dridc.Parameters != nil { 1461 objectMap["parameters"] = dridc.Parameters 1462 } 1463 if dridc.Name != "" { 1464 objectMap["name"] = dridc.Name 1465 } 1466 return json.Marshal(objectMap) 1467} 1468 1469// AsDeliveryRuleRemoteAddressCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleIsDeviceCondition. 1470func (dridc DeliveryRuleIsDeviceCondition) AsDeliveryRuleRemoteAddressCondition() (*DeliveryRuleRemoteAddressCondition, bool) { 1471 return nil, false 1472} 1473 1474// AsDeliveryRuleRequestMethodCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleIsDeviceCondition. 1475func (dridc DeliveryRuleIsDeviceCondition) AsDeliveryRuleRequestMethodCondition() (*DeliveryRuleRequestMethodCondition, bool) { 1476 return nil, false 1477} 1478 1479// AsDeliveryRuleQueryStringCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleIsDeviceCondition. 1480func (dridc DeliveryRuleIsDeviceCondition) AsDeliveryRuleQueryStringCondition() (*DeliveryRuleQueryStringCondition, bool) { 1481 return nil, false 1482} 1483 1484// AsDeliveryRulePostArgsCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleIsDeviceCondition. 1485func (dridc DeliveryRuleIsDeviceCondition) AsDeliveryRulePostArgsCondition() (*DeliveryRulePostArgsCondition, bool) { 1486 return nil, false 1487} 1488 1489// AsDeliveryRuleRequestURICondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleIsDeviceCondition. 1490func (dridc DeliveryRuleIsDeviceCondition) AsDeliveryRuleRequestURICondition() (*DeliveryRuleRequestURICondition, bool) { 1491 return nil, false 1492} 1493 1494// AsDeliveryRuleRequestHeaderCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleIsDeviceCondition. 1495func (dridc DeliveryRuleIsDeviceCondition) AsDeliveryRuleRequestHeaderCondition() (*DeliveryRuleRequestHeaderCondition, bool) { 1496 return nil, false 1497} 1498 1499// AsDeliveryRuleRequestBodyCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleIsDeviceCondition. 1500func (dridc DeliveryRuleIsDeviceCondition) AsDeliveryRuleRequestBodyCondition() (*DeliveryRuleRequestBodyCondition, bool) { 1501 return nil, false 1502} 1503 1504// AsDeliveryRuleRequestSchemeCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleIsDeviceCondition. 1505func (dridc DeliveryRuleIsDeviceCondition) AsDeliveryRuleRequestSchemeCondition() (*DeliveryRuleRequestSchemeCondition, bool) { 1506 return nil, false 1507} 1508 1509// AsDeliveryRuleURLPathCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleIsDeviceCondition. 1510func (dridc DeliveryRuleIsDeviceCondition) AsDeliveryRuleURLPathCondition() (*DeliveryRuleURLPathCondition, bool) { 1511 return nil, false 1512} 1513 1514// AsDeliveryRuleURLFileExtensionCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleIsDeviceCondition. 1515func (dridc DeliveryRuleIsDeviceCondition) AsDeliveryRuleURLFileExtensionCondition() (*DeliveryRuleURLFileExtensionCondition, bool) { 1516 return nil, false 1517} 1518 1519// AsDeliveryRuleURLFileNameCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleIsDeviceCondition. 1520func (dridc DeliveryRuleIsDeviceCondition) AsDeliveryRuleURLFileNameCondition() (*DeliveryRuleURLFileNameCondition, bool) { 1521 return nil, false 1522} 1523 1524// AsDeliveryRuleHTTPVersionCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleIsDeviceCondition. 1525func (dridc DeliveryRuleIsDeviceCondition) AsDeliveryRuleHTTPVersionCondition() (*DeliveryRuleHTTPVersionCondition, bool) { 1526 return nil, false 1527} 1528 1529// AsDeliveryRuleCookiesCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleIsDeviceCondition. 1530func (dridc DeliveryRuleIsDeviceCondition) AsDeliveryRuleCookiesCondition() (*DeliveryRuleCookiesCondition, bool) { 1531 return nil, false 1532} 1533 1534// AsDeliveryRuleIsDeviceCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleIsDeviceCondition. 1535func (dridc DeliveryRuleIsDeviceCondition) AsDeliveryRuleIsDeviceCondition() (*DeliveryRuleIsDeviceCondition, bool) { 1536 return &dridc, true 1537} 1538 1539// AsDeliveryRuleCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleIsDeviceCondition. 1540func (dridc DeliveryRuleIsDeviceCondition) AsDeliveryRuleCondition() (*DeliveryRuleCondition, bool) { 1541 return nil, false 1542} 1543 1544// AsBasicDeliveryRuleCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleIsDeviceCondition. 1545func (dridc DeliveryRuleIsDeviceCondition) AsBasicDeliveryRuleCondition() (BasicDeliveryRuleCondition, bool) { 1546 return &dridc, true 1547} 1548 1549// DeliveryRulePostArgsCondition defines the PostArgs condition for the delivery rule. 1550type DeliveryRulePostArgsCondition struct { 1551 // Parameters - Defines the parameters for the condition. 1552 Parameters *PostArgsMatchConditionParameters `json:"parameters,omitempty"` 1553 // Name - Possible values include: 'NameDeliveryRuleCondition', 'NameRemoteAddress', 'NameRequestMethod', 'NameQueryString', 'NamePostArgs', 'NameRequestURI', 'NameRequestHeader', 'NameRequestBody', 'NameRequestScheme', 'NameURLPath', 'NameURLFileExtension', 'NameURLFileName', 'NameHTTPVersion', 'NameCookies', 'NameIsDevice' 1554 Name Name `json:"name,omitempty"` 1555} 1556 1557// MarshalJSON is the custom marshaler for DeliveryRulePostArgsCondition. 1558func (drpac DeliveryRulePostArgsCondition) MarshalJSON() ([]byte, error) { 1559 drpac.Name = NamePostArgs 1560 objectMap := make(map[string]interface{}) 1561 if drpac.Parameters != nil { 1562 objectMap["parameters"] = drpac.Parameters 1563 } 1564 if drpac.Name != "" { 1565 objectMap["name"] = drpac.Name 1566 } 1567 return json.Marshal(objectMap) 1568} 1569 1570// AsDeliveryRuleRemoteAddressCondition is the BasicDeliveryRuleCondition implementation for DeliveryRulePostArgsCondition. 1571func (drpac DeliveryRulePostArgsCondition) AsDeliveryRuleRemoteAddressCondition() (*DeliveryRuleRemoteAddressCondition, bool) { 1572 return nil, false 1573} 1574 1575// AsDeliveryRuleRequestMethodCondition is the BasicDeliveryRuleCondition implementation for DeliveryRulePostArgsCondition. 1576func (drpac DeliveryRulePostArgsCondition) AsDeliveryRuleRequestMethodCondition() (*DeliveryRuleRequestMethodCondition, bool) { 1577 return nil, false 1578} 1579 1580// AsDeliveryRuleQueryStringCondition is the BasicDeliveryRuleCondition implementation for DeliveryRulePostArgsCondition. 1581func (drpac DeliveryRulePostArgsCondition) AsDeliveryRuleQueryStringCondition() (*DeliveryRuleQueryStringCondition, bool) { 1582 return nil, false 1583} 1584 1585// AsDeliveryRulePostArgsCondition is the BasicDeliveryRuleCondition implementation for DeliveryRulePostArgsCondition. 1586func (drpac DeliveryRulePostArgsCondition) AsDeliveryRulePostArgsCondition() (*DeliveryRulePostArgsCondition, bool) { 1587 return &drpac, true 1588} 1589 1590// AsDeliveryRuleRequestURICondition is the BasicDeliveryRuleCondition implementation for DeliveryRulePostArgsCondition. 1591func (drpac DeliveryRulePostArgsCondition) AsDeliveryRuleRequestURICondition() (*DeliveryRuleRequestURICondition, bool) { 1592 return nil, false 1593} 1594 1595// AsDeliveryRuleRequestHeaderCondition is the BasicDeliveryRuleCondition implementation for DeliveryRulePostArgsCondition. 1596func (drpac DeliveryRulePostArgsCondition) AsDeliveryRuleRequestHeaderCondition() (*DeliveryRuleRequestHeaderCondition, bool) { 1597 return nil, false 1598} 1599 1600// AsDeliveryRuleRequestBodyCondition is the BasicDeliveryRuleCondition implementation for DeliveryRulePostArgsCondition. 1601func (drpac DeliveryRulePostArgsCondition) AsDeliveryRuleRequestBodyCondition() (*DeliveryRuleRequestBodyCondition, bool) { 1602 return nil, false 1603} 1604 1605// AsDeliveryRuleRequestSchemeCondition is the BasicDeliveryRuleCondition implementation for DeliveryRulePostArgsCondition. 1606func (drpac DeliveryRulePostArgsCondition) AsDeliveryRuleRequestSchemeCondition() (*DeliveryRuleRequestSchemeCondition, bool) { 1607 return nil, false 1608} 1609 1610// AsDeliveryRuleURLPathCondition is the BasicDeliveryRuleCondition implementation for DeliveryRulePostArgsCondition. 1611func (drpac DeliveryRulePostArgsCondition) AsDeliveryRuleURLPathCondition() (*DeliveryRuleURLPathCondition, bool) { 1612 return nil, false 1613} 1614 1615// AsDeliveryRuleURLFileExtensionCondition is the BasicDeliveryRuleCondition implementation for DeliveryRulePostArgsCondition. 1616func (drpac DeliveryRulePostArgsCondition) AsDeliveryRuleURLFileExtensionCondition() (*DeliveryRuleURLFileExtensionCondition, bool) { 1617 return nil, false 1618} 1619 1620// AsDeliveryRuleURLFileNameCondition is the BasicDeliveryRuleCondition implementation for DeliveryRulePostArgsCondition. 1621func (drpac DeliveryRulePostArgsCondition) AsDeliveryRuleURLFileNameCondition() (*DeliveryRuleURLFileNameCondition, bool) { 1622 return nil, false 1623} 1624 1625// AsDeliveryRuleHTTPVersionCondition is the BasicDeliveryRuleCondition implementation for DeliveryRulePostArgsCondition. 1626func (drpac DeliveryRulePostArgsCondition) AsDeliveryRuleHTTPVersionCondition() (*DeliveryRuleHTTPVersionCondition, bool) { 1627 return nil, false 1628} 1629 1630// AsDeliveryRuleCookiesCondition is the BasicDeliveryRuleCondition implementation for DeliveryRulePostArgsCondition. 1631func (drpac DeliveryRulePostArgsCondition) AsDeliveryRuleCookiesCondition() (*DeliveryRuleCookiesCondition, bool) { 1632 return nil, false 1633} 1634 1635// AsDeliveryRuleIsDeviceCondition is the BasicDeliveryRuleCondition implementation for DeliveryRulePostArgsCondition. 1636func (drpac DeliveryRulePostArgsCondition) AsDeliveryRuleIsDeviceCondition() (*DeliveryRuleIsDeviceCondition, bool) { 1637 return nil, false 1638} 1639 1640// AsDeliveryRuleCondition is the BasicDeliveryRuleCondition implementation for DeliveryRulePostArgsCondition. 1641func (drpac DeliveryRulePostArgsCondition) AsDeliveryRuleCondition() (*DeliveryRuleCondition, bool) { 1642 return nil, false 1643} 1644 1645// AsBasicDeliveryRuleCondition is the BasicDeliveryRuleCondition implementation for DeliveryRulePostArgsCondition. 1646func (drpac DeliveryRulePostArgsCondition) AsBasicDeliveryRuleCondition() (BasicDeliveryRuleCondition, bool) { 1647 return &drpac, true 1648} 1649 1650// DeliveryRuleQueryStringCondition defines the QueryString condition for the delivery rule. 1651type DeliveryRuleQueryStringCondition struct { 1652 // Parameters - Defines the parameters for the condition. 1653 Parameters *QueryStringMatchConditionParameters `json:"parameters,omitempty"` 1654 // Name - Possible values include: 'NameDeliveryRuleCondition', 'NameRemoteAddress', 'NameRequestMethod', 'NameQueryString', 'NamePostArgs', 'NameRequestURI', 'NameRequestHeader', 'NameRequestBody', 'NameRequestScheme', 'NameURLPath', 'NameURLFileExtension', 'NameURLFileName', 'NameHTTPVersion', 'NameCookies', 'NameIsDevice' 1655 Name Name `json:"name,omitempty"` 1656} 1657 1658// MarshalJSON is the custom marshaler for DeliveryRuleQueryStringCondition. 1659func (drqsc DeliveryRuleQueryStringCondition) MarshalJSON() ([]byte, error) { 1660 drqsc.Name = NameQueryString 1661 objectMap := make(map[string]interface{}) 1662 if drqsc.Parameters != nil { 1663 objectMap["parameters"] = drqsc.Parameters 1664 } 1665 if drqsc.Name != "" { 1666 objectMap["name"] = drqsc.Name 1667 } 1668 return json.Marshal(objectMap) 1669} 1670 1671// AsDeliveryRuleRemoteAddressCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleQueryStringCondition. 1672func (drqsc DeliveryRuleQueryStringCondition) AsDeliveryRuleRemoteAddressCondition() (*DeliveryRuleRemoteAddressCondition, bool) { 1673 return nil, false 1674} 1675 1676// AsDeliveryRuleRequestMethodCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleQueryStringCondition. 1677func (drqsc DeliveryRuleQueryStringCondition) AsDeliveryRuleRequestMethodCondition() (*DeliveryRuleRequestMethodCondition, bool) { 1678 return nil, false 1679} 1680 1681// AsDeliveryRuleQueryStringCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleQueryStringCondition. 1682func (drqsc DeliveryRuleQueryStringCondition) AsDeliveryRuleQueryStringCondition() (*DeliveryRuleQueryStringCondition, bool) { 1683 return &drqsc, true 1684} 1685 1686// AsDeliveryRulePostArgsCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleQueryStringCondition. 1687func (drqsc DeliveryRuleQueryStringCondition) AsDeliveryRulePostArgsCondition() (*DeliveryRulePostArgsCondition, bool) { 1688 return nil, false 1689} 1690 1691// AsDeliveryRuleRequestURICondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleQueryStringCondition. 1692func (drqsc DeliveryRuleQueryStringCondition) AsDeliveryRuleRequestURICondition() (*DeliveryRuleRequestURICondition, bool) { 1693 return nil, false 1694} 1695 1696// AsDeliveryRuleRequestHeaderCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleQueryStringCondition. 1697func (drqsc DeliveryRuleQueryStringCondition) AsDeliveryRuleRequestHeaderCondition() (*DeliveryRuleRequestHeaderCondition, bool) { 1698 return nil, false 1699} 1700 1701// AsDeliveryRuleRequestBodyCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleQueryStringCondition. 1702func (drqsc DeliveryRuleQueryStringCondition) AsDeliveryRuleRequestBodyCondition() (*DeliveryRuleRequestBodyCondition, bool) { 1703 return nil, false 1704} 1705 1706// AsDeliveryRuleRequestSchemeCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleQueryStringCondition. 1707func (drqsc DeliveryRuleQueryStringCondition) AsDeliveryRuleRequestSchemeCondition() (*DeliveryRuleRequestSchemeCondition, bool) { 1708 return nil, false 1709} 1710 1711// AsDeliveryRuleURLPathCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleQueryStringCondition. 1712func (drqsc DeliveryRuleQueryStringCondition) AsDeliveryRuleURLPathCondition() (*DeliveryRuleURLPathCondition, bool) { 1713 return nil, false 1714} 1715 1716// AsDeliveryRuleURLFileExtensionCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleQueryStringCondition. 1717func (drqsc DeliveryRuleQueryStringCondition) AsDeliveryRuleURLFileExtensionCondition() (*DeliveryRuleURLFileExtensionCondition, bool) { 1718 return nil, false 1719} 1720 1721// AsDeliveryRuleURLFileNameCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleQueryStringCondition. 1722func (drqsc DeliveryRuleQueryStringCondition) AsDeliveryRuleURLFileNameCondition() (*DeliveryRuleURLFileNameCondition, bool) { 1723 return nil, false 1724} 1725 1726// AsDeliveryRuleHTTPVersionCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleQueryStringCondition. 1727func (drqsc DeliveryRuleQueryStringCondition) AsDeliveryRuleHTTPVersionCondition() (*DeliveryRuleHTTPVersionCondition, bool) { 1728 return nil, false 1729} 1730 1731// AsDeliveryRuleCookiesCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleQueryStringCondition. 1732func (drqsc DeliveryRuleQueryStringCondition) AsDeliveryRuleCookiesCondition() (*DeliveryRuleCookiesCondition, bool) { 1733 return nil, false 1734} 1735 1736// AsDeliveryRuleIsDeviceCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleQueryStringCondition. 1737func (drqsc DeliveryRuleQueryStringCondition) AsDeliveryRuleIsDeviceCondition() (*DeliveryRuleIsDeviceCondition, bool) { 1738 return nil, false 1739} 1740 1741// AsDeliveryRuleCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleQueryStringCondition. 1742func (drqsc DeliveryRuleQueryStringCondition) AsDeliveryRuleCondition() (*DeliveryRuleCondition, bool) { 1743 return nil, false 1744} 1745 1746// AsBasicDeliveryRuleCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleQueryStringCondition. 1747func (drqsc DeliveryRuleQueryStringCondition) AsBasicDeliveryRuleCondition() (BasicDeliveryRuleCondition, bool) { 1748 return &drqsc, true 1749} 1750 1751// DeliveryRuleRemoteAddressCondition defines the RemoteAddress condition for the delivery rule. 1752type DeliveryRuleRemoteAddressCondition struct { 1753 // Parameters - Defines the parameters for the condition. 1754 Parameters *RemoteAddressMatchConditionParameters `json:"parameters,omitempty"` 1755 // Name - Possible values include: 'NameDeliveryRuleCondition', 'NameRemoteAddress', 'NameRequestMethod', 'NameQueryString', 'NamePostArgs', 'NameRequestURI', 'NameRequestHeader', 'NameRequestBody', 'NameRequestScheme', 'NameURLPath', 'NameURLFileExtension', 'NameURLFileName', 'NameHTTPVersion', 'NameCookies', 'NameIsDevice' 1756 Name Name `json:"name,omitempty"` 1757} 1758 1759// MarshalJSON is the custom marshaler for DeliveryRuleRemoteAddressCondition. 1760func (drrac DeliveryRuleRemoteAddressCondition) MarshalJSON() ([]byte, error) { 1761 drrac.Name = NameRemoteAddress 1762 objectMap := make(map[string]interface{}) 1763 if drrac.Parameters != nil { 1764 objectMap["parameters"] = drrac.Parameters 1765 } 1766 if drrac.Name != "" { 1767 objectMap["name"] = drrac.Name 1768 } 1769 return json.Marshal(objectMap) 1770} 1771 1772// AsDeliveryRuleRemoteAddressCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRemoteAddressCondition. 1773func (drrac DeliveryRuleRemoteAddressCondition) AsDeliveryRuleRemoteAddressCondition() (*DeliveryRuleRemoteAddressCondition, bool) { 1774 return &drrac, true 1775} 1776 1777// AsDeliveryRuleRequestMethodCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRemoteAddressCondition. 1778func (drrac DeliveryRuleRemoteAddressCondition) AsDeliveryRuleRequestMethodCondition() (*DeliveryRuleRequestMethodCondition, bool) { 1779 return nil, false 1780} 1781 1782// AsDeliveryRuleQueryStringCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRemoteAddressCondition. 1783func (drrac DeliveryRuleRemoteAddressCondition) AsDeliveryRuleQueryStringCondition() (*DeliveryRuleQueryStringCondition, bool) { 1784 return nil, false 1785} 1786 1787// AsDeliveryRulePostArgsCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRemoteAddressCondition. 1788func (drrac DeliveryRuleRemoteAddressCondition) AsDeliveryRulePostArgsCondition() (*DeliveryRulePostArgsCondition, bool) { 1789 return nil, false 1790} 1791 1792// AsDeliveryRuleRequestURICondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRemoteAddressCondition. 1793func (drrac DeliveryRuleRemoteAddressCondition) AsDeliveryRuleRequestURICondition() (*DeliveryRuleRequestURICondition, bool) { 1794 return nil, false 1795} 1796 1797// AsDeliveryRuleRequestHeaderCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRemoteAddressCondition. 1798func (drrac DeliveryRuleRemoteAddressCondition) AsDeliveryRuleRequestHeaderCondition() (*DeliveryRuleRequestHeaderCondition, bool) { 1799 return nil, false 1800} 1801 1802// AsDeliveryRuleRequestBodyCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRemoteAddressCondition. 1803func (drrac DeliveryRuleRemoteAddressCondition) AsDeliveryRuleRequestBodyCondition() (*DeliveryRuleRequestBodyCondition, bool) { 1804 return nil, false 1805} 1806 1807// AsDeliveryRuleRequestSchemeCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRemoteAddressCondition. 1808func (drrac DeliveryRuleRemoteAddressCondition) AsDeliveryRuleRequestSchemeCondition() (*DeliveryRuleRequestSchemeCondition, bool) { 1809 return nil, false 1810} 1811 1812// AsDeliveryRuleURLPathCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRemoteAddressCondition. 1813func (drrac DeliveryRuleRemoteAddressCondition) AsDeliveryRuleURLPathCondition() (*DeliveryRuleURLPathCondition, bool) { 1814 return nil, false 1815} 1816 1817// AsDeliveryRuleURLFileExtensionCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRemoteAddressCondition. 1818func (drrac DeliveryRuleRemoteAddressCondition) AsDeliveryRuleURLFileExtensionCondition() (*DeliveryRuleURLFileExtensionCondition, bool) { 1819 return nil, false 1820} 1821 1822// AsDeliveryRuleURLFileNameCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRemoteAddressCondition. 1823func (drrac DeliveryRuleRemoteAddressCondition) AsDeliveryRuleURLFileNameCondition() (*DeliveryRuleURLFileNameCondition, bool) { 1824 return nil, false 1825} 1826 1827// AsDeliveryRuleHTTPVersionCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRemoteAddressCondition. 1828func (drrac DeliveryRuleRemoteAddressCondition) AsDeliveryRuleHTTPVersionCondition() (*DeliveryRuleHTTPVersionCondition, bool) { 1829 return nil, false 1830} 1831 1832// AsDeliveryRuleCookiesCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRemoteAddressCondition. 1833func (drrac DeliveryRuleRemoteAddressCondition) AsDeliveryRuleCookiesCondition() (*DeliveryRuleCookiesCondition, bool) { 1834 return nil, false 1835} 1836 1837// AsDeliveryRuleIsDeviceCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRemoteAddressCondition. 1838func (drrac DeliveryRuleRemoteAddressCondition) AsDeliveryRuleIsDeviceCondition() (*DeliveryRuleIsDeviceCondition, bool) { 1839 return nil, false 1840} 1841 1842// AsDeliveryRuleCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRemoteAddressCondition. 1843func (drrac DeliveryRuleRemoteAddressCondition) AsDeliveryRuleCondition() (*DeliveryRuleCondition, bool) { 1844 return nil, false 1845} 1846 1847// AsBasicDeliveryRuleCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRemoteAddressCondition. 1848func (drrac DeliveryRuleRemoteAddressCondition) AsBasicDeliveryRuleCondition() (BasicDeliveryRuleCondition, bool) { 1849 return &drrac, true 1850} 1851 1852// DeliveryRuleRequestBodyCondition defines the RequestBody condition for the delivery rule. 1853type DeliveryRuleRequestBodyCondition struct { 1854 // Parameters - Defines the parameters for the condition. 1855 Parameters *RequestBodyMatchConditionParameters `json:"parameters,omitempty"` 1856 // Name - Possible values include: 'NameDeliveryRuleCondition', 'NameRemoteAddress', 'NameRequestMethod', 'NameQueryString', 'NamePostArgs', 'NameRequestURI', 'NameRequestHeader', 'NameRequestBody', 'NameRequestScheme', 'NameURLPath', 'NameURLFileExtension', 'NameURLFileName', 'NameHTTPVersion', 'NameCookies', 'NameIsDevice' 1857 Name Name `json:"name,omitempty"` 1858} 1859 1860// MarshalJSON is the custom marshaler for DeliveryRuleRequestBodyCondition. 1861func (drrbc DeliveryRuleRequestBodyCondition) MarshalJSON() ([]byte, error) { 1862 drrbc.Name = NameRequestBody 1863 objectMap := make(map[string]interface{}) 1864 if drrbc.Parameters != nil { 1865 objectMap["parameters"] = drrbc.Parameters 1866 } 1867 if drrbc.Name != "" { 1868 objectMap["name"] = drrbc.Name 1869 } 1870 return json.Marshal(objectMap) 1871} 1872 1873// AsDeliveryRuleRemoteAddressCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestBodyCondition. 1874func (drrbc DeliveryRuleRequestBodyCondition) AsDeliveryRuleRemoteAddressCondition() (*DeliveryRuleRemoteAddressCondition, bool) { 1875 return nil, false 1876} 1877 1878// AsDeliveryRuleRequestMethodCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestBodyCondition. 1879func (drrbc DeliveryRuleRequestBodyCondition) AsDeliveryRuleRequestMethodCondition() (*DeliveryRuleRequestMethodCondition, bool) { 1880 return nil, false 1881} 1882 1883// AsDeliveryRuleQueryStringCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestBodyCondition. 1884func (drrbc DeliveryRuleRequestBodyCondition) AsDeliveryRuleQueryStringCondition() (*DeliveryRuleQueryStringCondition, bool) { 1885 return nil, false 1886} 1887 1888// AsDeliveryRulePostArgsCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestBodyCondition. 1889func (drrbc DeliveryRuleRequestBodyCondition) AsDeliveryRulePostArgsCondition() (*DeliveryRulePostArgsCondition, bool) { 1890 return nil, false 1891} 1892 1893// AsDeliveryRuleRequestURICondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestBodyCondition. 1894func (drrbc DeliveryRuleRequestBodyCondition) AsDeliveryRuleRequestURICondition() (*DeliveryRuleRequestURICondition, bool) { 1895 return nil, false 1896} 1897 1898// AsDeliveryRuleRequestHeaderCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestBodyCondition. 1899func (drrbc DeliveryRuleRequestBodyCondition) AsDeliveryRuleRequestHeaderCondition() (*DeliveryRuleRequestHeaderCondition, bool) { 1900 return nil, false 1901} 1902 1903// AsDeliveryRuleRequestBodyCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestBodyCondition. 1904func (drrbc DeliveryRuleRequestBodyCondition) AsDeliveryRuleRequestBodyCondition() (*DeliveryRuleRequestBodyCondition, bool) { 1905 return &drrbc, true 1906} 1907 1908// AsDeliveryRuleRequestSchemeCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestBodyCondition. 1909func (drrbc DeliveryRuleRequestBodyCondition) AsDeliveryRuleRequestSchemeCondition() (*DeliveryRuleRequestSchemeCondition, bool) { 1910 return nil, false 1911} 1912 1913// AsDeliveryRuleURLPathCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestBodyCondition. 1914func (drrbc DeliveryRuleRequestBodyCondition) AsDeliveryRuleURLPathCondition() (*DeliveryRuleURLPathCondition, bool) { 1915 return nil, false 1916} 1917 1918// AsDeliveryRuleURLFileExtensionCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestBodyCondition. 1919func (drrbc DeliveryRuleRequestBodyCondition) AsDeliveryRuleURLFileExtensionCondition() (*DeliveryRuleURLFileExtensionCondition, bool) { 1920 return nil, false 1921} 1922 1923// AsDeliveryRuleURLFileNameCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestBodyCondition. 1924func (drrbc DeliveryRuleRequestBodyCondition) AsDeliveryRuleURLFileNameCondition() (*DeliveryRuleURLFileNameCondition, bool) { 1925 return nil, false 1926} 1927 1928// AsDeliveryRuleHTTPVersionCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestBodyCondition. 1929func (drrbc DeliveryRuleRequestBodyCondition) AsDeliveryRuleHTTPVersionCondition() (*DeliveryRuleHTTPVersionCondition, bool) { 1930 return nil, false 1931} 1932 1933// AsDeliveryRuleCookiesCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestBodyCondition. 1934func (drrbc DeliveryRuleRequestBodyCondition) AsDeliveryRuleCookiesCondition() (*DeliveryRuleCookiesCondition, bool) { 1935 return nil, false 1936} 1937 1938// AsDeliveryRuleIsDeviceCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestBodyCondition. 1939func (drrbc DeliveryRuleRequestBodyCondition) AsDeliveryRuleIsDeviceCondition() (*DeliveryRuleIsDeviceCondition, bool) { 1940 return nil, false 1941} 1942 1943// AsDeliveryRuleCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestBodyCondition. 1944func (drrbc DeliveryRuleRequestBodyCondition) AsDeliveryRuleCondition() (*DeliveryRuleCondition, bool) { 1945 return nil, false 1946} 1947 1948// AsBasicDeliveryRuleCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestBodyCondition. 1949func (drrbc DeliveryRuleRequestBodyCondition) AsBasicDeliveryRuleCondition() (BasicDeliveryRuleCondition, bool) { 1950 return &drrbc, true 1951} 1952 1953// DeliveryRuleRequestHeaderAction defines the request header action for the delivery rule. 1954type DeliveryRuleRequestHeaderAction struct { 1955 // Parameters - Defines the parameters for the action. 1956 Parameters *HeaderActionParameters `json:"parameters,omitempty"` 1957 // Name - Possible values include: 'NameDeliveryRuleAction', 'NameURLRedirect', 'NameURLRewrite', 'NameModifyRequestHeader', 'NameModifyResponseHeader', 'NameCacheExpiration', 'NameCacheKeyQueryString' 1958 Name NameBasicDeliveryRuleAction `json:"name,omitempty"` 1959} 1960 1961// MarshalJSON is the custom marshaler for DeliveryRuleRequestHeaderAction. 1962func (drrha DeliveryRuleRequestHeaderAction) MarshalJSON() ([]byte, error) { 1963 drrha.Name = NameModifyRequestHeader 1964 objectMap := make(map[string]interface{}) 1965 if drrha.Parameters != nil { 1966 objectMap["parameters"] = drrha.Parameters 1967 } 1968 if drrha.Name != "" { 1969 objectMap["name"] = drrha.Name 1970 } 1971 return json.Marshal(objectMap) 1972} 1973 1974// AsURLRedirectAction is the BasicDeliveryRuleAction implementation for DeliveryRuleRequestHeaderAction. 1975func (drrha DeliveryRuleRequestHeaderAction) AsURLRedirectAction() (*URLRedirectAction, bool) { 1976 return nil, false 1977} 1978 1979// AsURLRewriteAction is the BasicDeliveryRuleAction implementation for DeliveryRuleRequestHeaderAction. 1980func (drrha DeliveryRuleRequestHeaderAction) AsURLRewriteAction() (*URLRewriteAction, bool) { 1981 return nil, false 1982} 1983 1984// AsDeliveryRuleRequestHeaderAction is the BasicDeliveryRuleAction implementation for DeliveryRuleRequestHeaderAction. 1985func (drrha DeliveryRuleRequestHeaderAction) AsDeliveryRuleRequestHeaderAction() (*DeliveryRuleRequestHeaderAction, bool) { 1986 return &drrha, true 1987} 1988 1989// AsDeliveryRuleResponseHeaderAction is the BasicDeliveryRuleAction implementation for DeliveryRuleRequestHeaderAction. 1990func (drrha DeliveryRuleRequestHeaderAction) AsDeliveryRuleResponseHeaderAction() (*DeliveryRuleResponseHeaderAction, bool) { 1991 return nil, false 1992} 1993 1994// AsDeliveryRuleCacheExpirationAction is the BasicDeliveryRuleAction implementation for DeliveryRuleRequestHeaderAction. 1995func (drrha DeliveryRuleRequestHeaderAction) AsDeliveryRuleCacheExpirationAction() (*DeliveryRuleCacheExpirationAction, bool) { 1996 return nil, false 1997} 1998 1999// AsDeliveryRuleCacheKeyQueryStringAction is the BasicDeliveryRuleAction implementation for DeliveryRuleRequestHeaderAction. 2000func (drrha DeliveryRuleRequestHeaderAction) AsDeliveryRuleCacheKeyQueryStringAction() (*DeliveryRuleCacheKeyQueryStringAction, bool) { 2001 return nil, false 2002} 2003 2004// AsDeliveryRuleAction is the BasicDeliveryRuleAction implementation for DeliveryRuleRequestHeaderAction. 2005func (drrha DeliveryRuleRequestHeaderAction) AsDeliveryRuleAction() (*DeliveryRuleAction, bool) { 2006 return nil, false 2007} 2008 2009// AsBasicDeliveryRuleAction is the BasicDeliveryRuleAction implementation for DeliveryRuleRequestHeaderAction. 2010func (drrha DeliveryRuleRequestHeaderAction) AsBasicDeliveryRuleAction() (BasicDeliveryRuleAction, bool) { 2011 return &drrha, true 2012} 2013 2014// DeliveryRuleRequestHeaderCondition defines the RequestHeader condition for the delivery rule. 2015type DeliveryRuleRequestHeaderCondition struct { 2016 // Parameters - Defines the parameters for the condition. 2017 Parameters *RequestHeaderMatchConditionParameters `json:"parameters,omitempty"` 2018 // Name - Possible values include: 'NameDeliveryRuleCondition', 'NameRemoteAddress', 'NameRequestMethod', 'NameQueryString', 'NamePostArgs', 'NameRequestURI', 'NameRequestHeader', 'NameRequestBody', 'NameRequestScheme', 'NameURLPath', 'NameURLFileExtension', 'NameURLFileName', 'NameHTTPVersion', 'NameCookies', 'NameIsDevice' 2019 Name Name `json:"name,omitempty"` 2020} 2021 2022// MarshalJSON is the custom marshaler for DeliveryRuleRequestHeaderCondition. 2023func (drrhc DeliveryRuleRequestHeaderCondition) MarshalJSON() ([]byte, error) { 2024 drrhc.Name = NameRequestHeader 2025 objectMap := make(map[string]interface{}) 2026 if drrhc.Parameters != nil { 2027 objectMap["parameters"] = drrhc.Parameters 2028 } 2029 if drrhc.Name != "" { 2030 objectMap["name"] = drrhc.Name 2031 } 2032 return json.Marshal(objectMap) 2033} 2034 2035// AsDeliveryRuleRemoteAddressCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestHeaderCondition. 2036func (drrhc DeliveryRuleRequestHeaderCondition) AsDeliveryRuleRemoteAddressCondition() (*DeliveryRuleRemoteAddressCondition, bool) { 2037 return nil, false 2038} 2039 2040// AsDeliveryRuleRequestMethodCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestHeaderCondition. 2041func (drrhc DeliveryRuleRequestHeaderCondition) AsDeliveryRuleRequestMethodCondition() (*DeliveryRuleRequestMethodCondition, bool) { 2042 return nil, false 2043} 2044 2045// AsDeliveryRuleQueryStringCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestHeaderCondition. 2046func (drrhc DeliveryRuleRequestHeaderCondition) AsDeliveryRuleQueryStringCondition() (*DeliveryRuleQueryStringCondition, bool) { 2047 return nil, false 2048} 2049 2050// AsDeliveryRulePostArgsCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestHeaderCondition. 2051func (drrhc DeliveryRuleRequestHeaderCondition) AsDeliveryRulePostArgsCondition() (*DeliveryRulePostArgsCondition, bool) { 2052 return nil, false 2053} 2054 2055// AsDeliveryRuleRequestURICondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestHeaderCondition. 2056func (drrhc DeliveryRuleRequestHeaderCondition) AsDeliveryRuleRequestURICondition() (*DeliveryRuleRequestURICondition, bool) { 2057 return nil, false 2058} 2059 2060// AsDeliveryRuleRequestHeaderCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestHeaderCondition. 2061func (drrhc DeliveryRuleRequestHeaderCondition) AsDeliveryRuleRequestHeaderCondition() (*DeliveryRuleRequestHeaderCondition, bool) { 2062 return &drrhc, true 2063} 2064 2065// AsDeliveryRuleRequestBodyCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestHeaderCondition. 2066func (drrhc DeliveryRuleRequestHeaderCondition) AsDeliveryRuleRequestBodyCondition() (*DeliveryRuleRequestBodyCondition, bool) { 2067 return nil, false 2068} 2069 2070// AsDeliveryRuleRequestSchemeCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestHeaderCondition. 2071func (drrhc DeliveryRuleRequestHeaderCondition) AsDeliveryRuleRequestSchemeCondition() (*DeliveryRuleRequestSchemeCondition, bool) { 2072 return nil, false 2073} 2074 2075// AsDeliveryRuleURLPathCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestHeaderCondition. 2076func (drrhc DeliveryRuleRequestHeaderCondition) AsDeliveryRuleURLPathCondition() (*DeliveryRuleURLPathCondition, bool) { 2077 return nil, false 2078} 2079 2080// AsDeliveryRuleURLFileExtensionCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestHeaderCondition. 2081func (drrhc DeliveryRuleRequestHeaderCondition) AsDeliveryRuleURLFileExtensionCondition() (*DeliveryRuleURLFileExtensionCondition, bool) { 2082 return nil, false 2083} 2084 2085// AsDeliveryRuleURLFileNameCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestHeaderCondition. 2086func (drrhc DeliveryRuleRequestHeaderCondition) AsDeliveryRuleURLFileNameCondition() (*DeliveryRuleURLFileNameCondition, bool) { 2087 return nil, false 2088} 2089 2090// AsDeliveryRuleHTTPVersionCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestHeaderCondition. 2091func (drrhc DeliveryRuleRequestHeaderCondition) AsDeliveryRuleHTTPVersionCondition() (*DeliveryRuleHTTPVersionCondition, bool) { 2092 return nil, false 2093} 2094 2095// AsDeliveryRuleCookiesCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestHeaderCondition. 2096func (drrhc DeliveryRuleRequestHeaderCondition) AsDeliveryRuleCookiesCondition() (*DeliveryRuleCookiesCondition, bool) { 2097 return nil, false 2098} 2099 2100// AsDeliveryRuleIsDeviceCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestHeaderCondition. 2101func (drrhc DeliveryRuleRequestHeaderCondition) AsDeliveryRuleIsDeviceCondition() (*DeliveryRuleIsDeviceCondition, bool) { 2102 return nil, false 2103} 2104 2105// AsDeliveryRuleCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestHeaderCondition. 2106func (drrhc DeliveryRuleRequestHeaderCondition) AsDeliveryRuleCondition() (*DeliveryRuleCondition, bool) { 2107 return nil, false 2108} 2109 2110// AsBasicDeliveryRuleCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestHeaderCondition. 2111func (drrhc DeliveryRuleRequestHeaderCondition) AsBasicDeliveryRuleCondition() (BasicDeliveryRuleCondition, bool) { 2112 return &drrhc, true 2113} 2114 2115// DeliveryRuleRequestMethodCondition defines the RequestMethod condition for the delivery rule. 2116type DeliveryRuleRequestMethodCondition struct { 2117 // Parameters - Defines the parameters for the condition. 2118 Parameters *RequestMethodMatchConditionParameters `json:"parameters,omitempty"` 2119 // Name - Possible values include: 'NameDeliveryRuleCondition', 'NameRemoteAddress', 'NameRequestMethod', 'NameQueryString', 'NamePostArgs', 'NameRequestURI', 'NameRequestHeader', 'NameRequestBody', 'NameRequestScheme', 'NameURLPath', 'NameURLFileExtension', 'NameURLFileName', 'NameHTTPVersion', 'NameCookies', 'NameIsDevice' 2120 Name Name `json:"name,omitempty"` 2121} 2122 2123// MarshalJSON is the custom marshaler for DeliveryRuleRequestMethodCondition. 2124func (drrmc DeliveryRuleRequestMethodCondition) MarshalJSON() ([]byte, error) { 2125 drrmc.Name = NameRequestMethod 2126 objectMap := make(map[string]interface{}) 2127 if drrmc.Parameters != nil { 2128 objectMap["parameters"] = drrmc.Parameters 2129 } 2130 if drrmc.Name != "" { 2131 objectMap["name"] = drrmc.Name 2132 } 2133 return json.Marshal(objectMap) 2134} 2135 2136// AsDeliveryRuleRemoteAddressCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestMethodCondition. 2137func (drrmc DeliveryRuleRequestMethodCondition) AsDeliveryRuleRemoteAddressCondition() (*DeliveryRuleRemoteAddressCondition, bool) { 2138 return nil, false 2139} 2140 2141// AsDeliveryRuleRequestMethodCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestMethodCondition. 2142func (drrmc DeliveryRuleRequestMethodCondition) AsDeliveryRuleRequestMethodCondition() (*DeliveryRuleRequestMethodCondition, bool) { 2143 return &drrmc, true 2144} 2145 2146// AsDeliveryRuleQueryStringCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestMethodCondition. 2147func (drrmc DeliveryRuleRequestMethodCondition) AsDeliveryRuleQueryStringCondition() (*DeliveryRuleQueryStringCondition, bool) { 2148 return nil, false 2149} 2150 2151// AsDeliveryRulePostArgsCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestMethodCondition. 2152func (drrmc DeliveryRuleRequestMethodCondition) AsDeliveryRulePostArgsCondition() (*DeliveryRulePostArgsCondition, bool) { 2153 return nil, false 2154} 2155 2156// AsDeliveryRuleRequestURICondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestMethodCondition. 2157func (drrmc DeliveryRuleRequestMethodCondition) AsDeliveryRuleRequestURICondition() (*DeliveryRuleRequestURICondition, bool) { 2158 return nil, false 2159} 2160 2161// AsDeliveryRuleRequestHeaderCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestMethodCondition. 2162func (drrmc DeliveryRuleRequestMethodCondition) AsDeliveryRuleRequestHeaderCondition() (*DeliveryRuleRequestHeaderCondition, bool) { 2163 return nil, false 2164} 2165 2166// AsDeliveryRuleRequestBodyCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestMethodCondition. 2167func (drrmc DeliveryRuleRequestMethodCondition) AsDeliveryRuleRequestBodyCondition() (*DeliveryRuleRequestBodyCondition, bool) { 2168 return nil, false 2169} 2170 2171// AsDeliveryRuleRequestSchemeCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestMethodCondition. 2172func (drrmc DeliveryRuleRequestMethodCondition) AsDeliveryRuleRequestSchemeCondition() (*DeliveryRuleRequestSchemeCondition, bool) { 2173 return nil, false 2174} 2175 2176// AsDeliveryRuleURLPathCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestMethodCondition. 2177func (drrmc DeliveryRuleRequestMethodCondition) AsDeliveryRuleURLPathCondition() (*DeliveryRuleURLPathCondition, bool) { 2178 return nil, false 2179} 2180 2181// AsDeliveryRuleURLFileExtensionCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestMethodCondition. 2182func (drrmc DeliveryRuleRequestMethodCondition) AsDeliveryRuleURLFileExtensionCondition() (*DeliveryRuleURLFileExtensionCondition, bool) { 2183 return nil, false 2184} 2185 2186// AsDeliveryRuleURLFileNameCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestMethodCondition. 2187func (drrmc DeliveryRuleRequestMethodCondition) AsDeliveryRuleURLFileNameCondition() (*DeliveryRuleURLFileNameCondition, bool) { 2188 return nil, false 2189} 2190 2191// AsDeliveryRuleHTTPVersionCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestMethodCondition. 2192func (drrmc DeliveryRuleRequestMethodCondition) AsDeliveryRuleHTTPVersionCondition() (*DeliveryRuleHTTPVersionCondition, bool) { 2193 return nil, false 2194} 2195 2196// AsDeliveryRuleCookiesCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestMethodCondition. 2197func (drrmc DeliveryRuleRequestMethodCondition) AsDeliveryRuleCookiesCondition() (*DeliveryRuleCookiesCondition, bool) { 2198 return nil, false 2199} 2200 2201// AsDeliveryRuleIsDeviceCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestMethodCondition. 2202func (drrmc DeliveryRuleRequestMethodCondition) AsDeliveryRuleIsDeviceCondition() (*DeliveryRuleIsDeviceCondition, bool) { 2203 return nil, false 2204} 2205 2206// AsDeliveryRuleCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestMethodCondition. 2207func (drrmc DeliveryRuleRequestMethodCondition) AsDeliveryRuleCondition() (*DeliveryRuleCondition, bool) { 2208 return nil, false 2209} 2210 2211// AsBasicDeliveryRuleCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestMethodCondition. 2212func (drrmc DeliveryRuleRequestMethodCondition) AsBasicDeliveryRuleCondition() (BasicDeliveryRuleCondition, bool) { 2213 return &drrmc, true 2214} 2215 2216// DeliveryRuleRequestSchemeCondition defines the RequestScheme condition for the delivery rule. 2217type DeliveryRuleRequestSchemeCondition struct { 2218 // Parameters - Defines the parameters for the condition. 2219 Parameters *RequestSchemeMatchConditionParameters `json:"parameters,omitempty"` 2220 // Name - Possible values include: 'NameDeliveryRuleCondition', 'NameRemoteAddress', 'NameRequestMethod', 'NameQueryString', 'NamePostArgs', 'NameRequestURI', 'NameRequestHeader', 'NameRequestBody', 'NameRequestScheme', 'NameURLPath', 'NameURLFileExtension', 'NameURLFileName', 'NameHTTPVersion', 'NameCookies', 'NameIsDevice' 2221 Name Name `json:"name,omitempty"` 2222} 2223 2224// MarshalJSON is the custom marshaler for DeliveryRuleRequestSchemeCondition. 2225func (drrsc DeliveryRuleRequestSchemeCondition) MarshalJSON() ([]byte, error) { 2226 drrsc.Name = NameRequestScheme 2227 objectMap := make(map[string]interface{}) 2228 if drrsc.Parameters != nil { 2229 objectMap["parameters"] = drrsc.Parameters 2230 } 2231 if drrsc.Name != "" { 2232 objectMap["name"] = drrsc.Name 2233 } 2234 return json.Marshal(objectMap) 2235} 2236 2237// AsDeliveryRuleRemoteAddressCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestSchemeCondition. 2238func (drrsc DeliveryRuleRequestSchemeCondition) AsDeliveryRuleRemoteAddressCondition() (*DeliveryRuleRemoteAddressCondition, bool) { 2239 return nil, false 2240} 2241 2242// AsDeliveryRuleRequestMethodCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestSchemeCondition. 2243func (drrsc DeliveryRuleRequestSchemeCondition) AsDeliveryRuleRequestMethodCondition() (*DeliveryRuleRequestMethodCondition, bool) { 2244 return nil, false 2245} 2246 2247// AsDeliveryRuleQueryStringCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestSchemeCondition. 2248func (drrsc DeliveryRuleRequestSchemeCondition) AsDeliveryRuleQueryStringCondition() (*DeliveryRuleQueryStringCondition, bool) { 2249 return nil, false 2250} 2251 2252// AsDeliveryRulePostArgsCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestSchemeCondition. 2253func (drrsc DeliveryRuleRequestSchemeCondition) AsDeliveryRulePostArgsCondition() (*DeliveryRulePostArgsCondition, bool) { 2254 return nil, false 2255} 2256 2257// AsDeliveryRuleRequestURICondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestSchemeCondition. 2258func (drrsc DeliveryRuleRequestSchemeCondition) AsDeliveryRuleRequestURICondition() (*DeliveryRuleRequestURICondition, bool) { 2259 return nil, false 2260} 2261 2262// AsDeliveryRuleRequestHeaderCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestSchemeCondition. 2263func (drrsc DeliveryRuleRequestSchemeCondition) AsDeliveryRuleRequestHeaderCondition() (*DeliveryRuleRequestHeaderCondition, bool) { 2264 return nil, false 2265} 2266 2267// AsDeliveryRuleRequestBodyCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestSchemeCondition. 2268func (drrsc DeliveryRuleRequestSchemeCondition) AsDeliveryRuleRequestBodyCondition() (*DeliveryRuleRequestBodyCondition, bool) { 2269 return nil, false 2270} 2271 2272// AsDeliveryRuleRequestSchemeCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestSchemeCondition. 2273func (drrsc DeliveryRuleRequestSchemeCondition) AsDeliveryRuleRequestSchemeCondition() (*DeliveryRuleRequestSchemeCondition, bool) { 2274 return &drrsc, true 2275} 2276 2277// AsDeliveryRuleURLPathCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestSchemeCondition. 2278func (drrsc DeliveryRuleRequestSchemeCondition) AsDeliveryRuleURLPathCondition() (*DeliveryRuleURLPathCondition, bool) { 2279 return nil, false 2280} 2281 2282// AsDeliveryRuleURLFileExtensionCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestSchemeCondition. 2283func (drrsc DeliveryRuleRequestSchemeCondition) AsDeliveryRuleURLFileExtensionCondition() (*DeliveryRuleURLFileExtensionCondition, bool) { 2284 return nil, false 2285} 2286 2287// AsDeliveryRuleURLFileNameCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestSchemeCondition. 2288func (drrsc DeliveryRuleRequestSchemeCondition) AsDeliveryRuleURLFileNameCondition() (*DeliveryRuleURLFileNameCondition, bool) { 2289 return nil, false 2290} 2291 2292// AsDeliveryRuleHTTPVersionCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestSchemeCondition. 2293func (drrsc DeliveryRuleRequestSchemeCondition) AsDeliveryRuleHTTPVersionCondition() (*DeliveryRuleHTTPVersionCondition, bool) { 2294 return nil, false 2295} 2296 2297// AsDeliveryRuleCookiesCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestSchemeCondition. 2298func (drrsc DeliveryRuleRequestSchemeCondition) AsDeliveryRuleCookiesCondition() (*DeliveryRuleCookiesCondition, bool) { 2299 return nil, false 2300} 2301 2302// AsDeliveryRuleIsDeviceCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestSchemeCondition. 2303func (drrsc DeliveryRuleRequestSchemeCondition) AsDeliveryRuleIsDeviceCondition() (*DeliveryRuleIsDeviceCondition, bool) { 2304 return nil, false 2305} 2306 2307// AsDeliveryRuleCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestSchemeCondition. 2308func (drrsc DeliveryRuleRequestSchemeCondition) AsDeliveryRuleCondition() (*DeliveryRuleCondition, bool) { 2309 return nil, false 2310} 2311 2312// AsBasicDeliveryRuleCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestSchemeCondition. 2313func (drrsc DeliveryRuleRequestSchemeCondition) AsBasicDeliveryRuleCondition() (BasicDeliveryRuleCondition, bool) { 2314 return &drrsc, true 2315} 2316 2317// DeliveryRuleRequestURICondition defines the RequestUri condition for the delivery rule. 2318type DeliveryRuleRequestURICondition struct { 2319 // Parameters - Defines the parameters for the condition. 2320 Parameters *RequestURIMatchConditionParameters `json:"parameters,omitempty"` 2321 // Name - Possible values include: 'NameDeliveryRuleCondition', 'NameRemoteAddress', 'NameRequestMethod', 'NameQueryString', 'NamePostArgs', 'NameRequestURI', 'NameRequestHeader', 'NameRequestBody', 'NameRequestScheme', 'NameURLPath', 'NameURLFileExtension', 'NameURLFileName', 'NameHTTPVersion', 'NameCookies', 'NameIsDevice' 2322 Name Name `json:"name,omitempty"` 2323} 2324 2325// MarshalJSON is the custom marshaler for DeliveryRuleRequestURICondition. 2326func (drruc DeliveryRuleRequestURICondition) MarshalJSON() ([]byte, error) { 2327 drruc.Name = NameRequestURI 2328 objectMap := make(map[string]interface{}) 2329 if drruc.Parameters != nil { 2330 objectMap["parameters"] = drruc.Parameters 2331 } 2332 if drruc.Name != "" { 2333 objectMap["name"] = drruc.Name 2334 } 2335 return json.Marshal(objectMap) 2336} 2337 2338// AsDeliveryRuleRemoteAddressCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestURICondition. 2339func (drruc DeliveryRuleRequestURICondition) AsDeliveryRuleRemoteAddressCondition() (*DeliveryRuleRemoteAddressCondition, bool) { 2340 return nil, false 2341} 2342 2343// AsDeliveryRuleRequestMethodCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestURICondition. 2344func (drruc DeliveryRuleRequestURICondition) AsDeliveryRuleRequestMethodCondition() (*DeliveryRuleRequestMethodCondition, bool) { 2345 return nil, false 2346} 2347 2348// AsDeliveryRuleQueryStringCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestURICondition. 2349func (drruc DeliveryRuleRequestURICondition) AsDeliveryRuleQueryStringCondition() (*DeliveryRuleQueryStringCondition, bool) { 2350 return nil, false 2351} 2352 2353// AsDeliveryRulePostArgsCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestURICondition. 2354func (drruc DeliveryRuleRequestURICondition) AsDeliveryRulePostArgsCondition() (*DeliveryRulePostArgsCondition, bool) { 2355 return nil, false 2356} 2357 2358// AsDeliveryRuleRequestURICondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestURICondition. 2359func (drruc DeliveryRuleRequestURICondition) AsDeliveryRuleRequestURICondition() (*DeliveryRuleRequestURICondition, bool) { 2360 return &drruc, true 2361} 2362 2363// AsDeliveryRuleRequestHeaderCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestURICondition. 2364func (drruc DeliveryRuleRequestURICondition) AsDeliveryRuleRequestHeaderCondition() (*DeliveryRuleRequestHeaderCondition, bool) { 2365 return nil, false 2366} 2367 2368// AsDeliveryRuleRequestBodyCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestURICondition. 2369func (drruc DeliveryRuleRequestURICondition) AsDeliveryRuleRequestBodyCondition() (*DeliveryRuleRequestBodyCondition, bool) { 2370 return nil, false 2371} 2372 2373// AsDeliveryRuleRequestSchemeCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestURICondition. 2374func (drruc DeliveryRuleRequestURICondition) AsDeliveryRuleRequestSchemeCondition() (*DeliveryRuleRequestSchemeCondition, bool) { 2375 return nil, false 2376} 2377 2378// AsDeliveryRuleURLPathCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestURICondition. 2379func (drruc DeliveryRuleRequestURICondition) AsDeliveryRuleURLPathCondition() (*DeliveryRuleURLPathCondition, bool) { 2380 return nil, false 2381} 2382 2383// AsDeliveryRuleURLFileExtensionCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestURICondition. 2384func (drruc DeliveryRuleRequestURICondition) AsDeliveryRuleURLFileExtensionCondition() (*DeliveryRuleURLFileExtensionCondition, bool) { 2385 return nil, false 2386} 2387 2388// AsDeliveryRuleURLFileNameCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestURICondition. 2389func (drruc DeliveryRuleRequestURICondition) AsDeliveryRuleURLFileNameCondition() (*DeliveryRuleURLFileNameCondition, bool) { 2390 return nil, false 2391} 2392 2393// AsDeliveryRuleHTTPVersionCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestURICondition. 2394func (drruc DeliveryRuleRequestURICondition) AsDeliveryRuleHTTPVersionCondition() (*DeliveryRuleHTTPVersionCondition, bool) { 2395 return nil, false 2396} 2397 2398// AsDeliveryRuleCookiesCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestURICondition. 2399func (drruc DeliveryRuleRequestURICondition) AsDeliveryRuleCookiesCondition() (*DeliveryRuleCookiesCondition, bool) { 2400 return nil, false 2401} 2402 2403// AsDeliveryRuleIsDeviceCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestURICondition. 2404func (drruc DeliveryRuleRequestURICondition) AsDeliveryRuleIsDeviceCondition() (*DeliveryRuleIsDeviceCondition, bool) { 2405 return nil, false 2406} 2407 2408// AsDeliveryRuleCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestURICondition. 2409func (drruc DeliveryRuleRequestURICondition) AsDeliveryRuleCondition() (*DeliveryRuleCondition, bool) { 2410 return nil, false 2411} 2412 2413// AsBasicDeliveryRuleCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestURICondition. 2414func (drruc DeliveryRuleRequestURICondition) AsBasicDeliveryRuleCondition() (BasicDeliveryRuleCondition, bool) { 2415 return &drruc, true 2416} 2417 2418// DeliveryRuleResponseHeaderAction defines the response header action for the delivery rule. 2419type DeliveryRuleResponseHeaderAction struct { 2420 // Parameters - Defines the parameters for the action. 2421 Parameters *HeaderActionParameters `json:"parameters,omitempty"` 2422 // Name - Possible values include: 'NameDeliveryRuleAction', 'NameURLRedirect', 'NameURLRewrite', 'NameModifyRequestHeader', 'NameModifyResponseHeader', 'NameCacheExpiration', 'NameCacheKeyQueryString' 2423 Name NameBasicDeliveryRuleAction `json:"name,omitempty"` 2424} 2425 2426// MarshalJSON is the custom marshaler for DeliveryRuleResponseHeaderAction. 2427func (drrha DeliveryRuleResponseHeaderAction) MarshalJSON() ([]byte, error) { 2428 drrha.Name = NameModifyResponseHeader 2429 objectMap := make(map[string]interface{}) 2430 if drrha.Parameters != nil { 2431 objectMap["parameters"] = drrha.Parameters 2432 } 2433 if drrha.Name != "" { 2434 objectMap["name"] = drrha.Name 2435 } 2436 return json.Marshal(objectMap) 2437} 2438 2439// AsURLRedirectAction is the BasicDeliveryRuleAction implementation for DeliveryRuleResponseHeaderAction. 2440func (drrha DeliveryRuleResponseHeaderAction) AsURLRedirectAction() (*URLRedirectAction, bool) { 2441 return nil, false 2442} 2443 2444// AsURLRewriteAction is the BasicDeliveryRuleAction implementation for DeliveryRuleResponseHeaderAction. 2445func (drrha DeliveryRuleResponseHeaderAction) AsURLRewriteAction() (*URLRewriteAction, bool) { 2446 return nil, false 2447} 2448 2449// AsDeliveryRuleRequestHeaderAction is the BasicDeliveryRuleAction implementation for DeliveryRuleResponseHeaderAction. 2450func (drrha DeliveryRuleResponseHeaderAction) AsDeliveryRuleRequestHeaderAction() (*DeliveryRuleRequestHeaderAction, bool) { 2451 return nil, false 2452} 2453 2454// AsDeliveryRuleResponseHeaderAction is the BasicDeliveryRuleAction implementation for DeliveryRuleResponseHeaderAction. 2455func (drrha DeliveryRuleResponseHeaderAction) AsDeliveryRuleResponseHeaderAction() (*DeliveryRuleResponseHeaderAction, bool) { 2456 return &drrha, true 2457} 2458 2459// AsDeliveryRuleCacheExpirationAction is the BasicDeliveryRuleAction implementation for DeliveryRuleResponseHeaderAction. 2460func (drrha DeliveryRuleResponseHeaderAction) AsDeliveryRuleCacheExpirationAction() (*DeliveryRuleCacheExpirationAction, bool) { 2461 return nil, false 2462} 2463 2464// AsDeliveryRuleCacheKeyQueryStringAction is the BasicDeliveryRuleAction implementation for DeliveryRuleResponseHeaderAction. 2465func (drrha DeliveryRuleResponseHeaderAction) AsDeliveryRuleCacheKeyQueryStringAction() (*DeliveryRuleCacheKeyQueryStringAction, bool) { 2466 return nil, false 2467} 2468 2469// AsDeliveryRuleAction is the BasicDeliveryRuleAction implementation for DeliveryRuleResponseHeaderAction. 2470func (drrha DeliveryRuleResponseHeaderAction) AsDeliveryRuleAction() (*DeliveryRuleAction, bool) { 2471 return nil, false 2472} 2473 2474// AsBasicDeliveryRuleAction is the BasicDeliveryRuleAction implementation for DeliveryRuleResponseHeaderAction. 2475func (drrha DeliveryRuleResponseHeaderAction) AsBasicDeliveryRuleAction() (BasicDeliveryRuleAction, bool) { 2476 return &drrha, true 2477} 2478 2479// DeliveryRuleURLFileExtensionCondition defines the UrlFileExtension condition for the delivery rule. 2480type DeliveryRuleURLFileExtensionCondition struct { 2481 // Parameters - Defines the parameters for the condition. 2482 Parameters *URLFileExtensionMatchConditionParameters `json:"parameters,omitempty"` 2483 // Name - Possible values include: 'NameDeliveryRuleCondition', 'NameRemoteAddress', 'NameRequestMethod', 'NameQueryString', 'NamePostArgs', 'NameRequestURI', 'NameRequestHeader', 'NameRequestBody', 'NameRequestScheme', 'NameURLPath', 'NameURLFileExtension', 'NameURLFileName', 'NameHTTPVersion', 'NameCookies', 'NameIsDevice' 2484 Name Name `json:"name,omitempty"` 2485} 2486 2487// MarshalJSON is the custom marshaler for DeliveryRuleURLFileExtensionCondition. 2488func (drufec DeliveryRuleURLFileExtensionCondition) MarshalJSON() ([]byte, error) { 2489 drufec.Name = NameURLFileExtension 2490 objectMap := make(map[string]interface{}) 2491 if drufec.Parameters != nil { 2492 objectMap["parameters"] = drufec.Parameters 2493 } 2494 if drufec.Name != "" { 2495 objectMap["name"] = drufec.Name 2496 } 2497 return json.Marshal(objectMap) 2498} 2499 2500// AsDeliveryRuleRemoteAddressCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleURLFileExtensionCondition. 2501func (drufec DeliveryRuleURLFileExtensionCondition) AsDeliveryRuleRemoteAddressCondition() (*DeliveryRuleRemoteAddressCondition, bool) { 2502 return nil, false 2503} 2504 2505// AsDeliveryRuleRequestMethodCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleURLFileExtensionCondition. 2506func (drufec DeliveryRuleURLFileExtensionCondition) AsDeliveryRuleRequestMethodCondition() (*DeliveryRuleRequestMethodCondition, bool) { 2507 return nil, false 2508} 2509 2510// AsDeliveryRuleQueryStringCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleURLFileExtensionCondition. 2511func (drufec DeliveryRuleURLFileExtensionCondition) AsDeliveryRuleQueryStringCondition() (*DeliveryRuleQueryStringCondition, bool) { 2512 return nil, false 2513} 2514 2515// AsDeliveryRulePostArgsCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleURLFileExtensionCondition. 2516func (drufec DeliveryRuleURLFileExtensionCondition) AsDeliveryRulePostArgsCondition() (*DeliveryRulePostArgsCondition, bool) { 2517 return nil, false 2518} 2519 2520// AsDeliveryRuleRequestURICondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleURLFileExtensionCondition. 2521func (drufec DeliveryRuleURLFileExtensionCondition) AsDeliveryRuleRequestURICondition() (*DeliveryRuleRequestURICondition, bool) { 2522 return nil, false 2523} 2524 2525// AsDeliveryRuleRequestHeaderCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleURLFileExtensionCondition. 2526func (drufec DeliveryRuleURLFileExtensionCondition) AsDeliveryRuleRequestHeaderCondition() (*DeliveryRuleRequestHeaderCondition, bool) { 2527 return nil, false 2528} 2529 2530// AsDeliveryRuleRequestBodyCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleURLFileExtensionCondition. 2531func (drufec DeliveryRuleURLFileExtensionCondition) AsDeliveryRuleRequestBodyCondition() (*DeliveryRuleRequestBodyCondition, bool) { 2532 return nil, false 2533} 2534 2535// AsDeliveryRuleRequestSchemeCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleURLFileExtensionCondition. 2536func (drufec DeliveryRuleURLFileExtensionCondition) AsDeliveryRuleRequestSchemeCondition() (*DeliveryRuleRequestSchemeCondition, bool) { 2537 return nil, false 2538} 2539 2540// AsDeliveryRuleURLPathCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleURLFileExtensionCondition. 2541func (drufec DeliveryRuleURLFileExtensionCondition) AsDeliveryRuleURLPathCondition() (*DeliveryRuleURLPathCondition, bool) { 2542 return nil, false 2543} 2544 2545// AsDeliveryRuleURLFileExtensionCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleURLFileExtensionCondition. 2546func (drufec DeliveryRuleURLFileExtensionCondition) AsDeliveryRuleURLFileExtensionCondition() (*DeliveryRuleURLFileExtensionCondition, bool) { 2547 return &drufec, true 2548} 2549 2550// AsDeliveryRuleURLFileNameCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleURLFileExtensionCondition. 2551func (drufec DeliveryRuleURLFileExtensionCondition) AsDeliveryRuleURLFileNameCondition() (*DeliveryRuleURLFileNameCondition, bool) { 2552 return nil, false 2553} 2554 2555// AsDeliveryRuleHTTPVersionCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleURLFileExtensionCondition. 2556func (drufec DeliveryRuleURLFileExtensionCondition) AsDeliveryRuleHTTPVersionCondition() (*DeliveryRuleHTTPVersionCondition, bool) { 2557 return nil, false 2558} 2559 2560// AsDeliveryRuleCookiesCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleURLFileExtensionCondition. 2561func (drufec DeliveryRuleURLFileExtensionCondition) AsDeliveryRuleCookiesCondition() (*DeliveryRuleCookiesCondition, bool) { 2562 return nil, false 2563} 2564 2565// AsDeliveryRuleIsDeviceCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleURLFileExtensionCondition. 2566func (drufec DeliveryRuleURLFileExtensionCondition) AsDeliveryRuleIsDeviceCondition() (*DeliveryRuleIsDeviceCondition, bool) { 2567 return nil, false 2568} 2569 2570// AsDeliveryRuleCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleURLFileExtensionCondition. 2571func (drufec DeliveryRuleURLFileExtensionCondition) AsDeliveryRuleCondition() (*DeliveryRuleCondition, bool) { 2572 return nil, false 2573} 2574 2575// AsBasicDeliveryRuleCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleURLFileExtensionCondition. 2576func (drufec DeliveryRuleURLFileExtensionCondition) AsBasicDeliveryRuleCondition() (BasicDeliveryRuleCondition, bool) { 2577 return &drufec, true 2578} 2579 2580// DeliveryRuleURLFileNameCondition defines the UrlFileName condition for the delivery rule. 2581type DeliveryRuleURLFileNameCondition struct { 2582 // Parameters - Defines the parameters for the condition. 2583 Parameters *URLFileNameMatchConditionParameters `json:"parameters,omitempty"` 2584 // Name - Possible values include: 'NameDeliveryRuleCondition', 'NameRemoteAddress', 'NameRequestMethod', 'NameQueryString', 'NamePostArgs', 'NameRequestURI', 'NameRequestHeader', 'NameRequestBody', 'NameRequestScheme', 'NameURLPath', 'NameURLFileExtension', 'NameURLFileName', 'NameHTTPVersion', 'NameCookies', 'NameIsDevice' 2585 Name Name `json:"name,omitempty"` 2586} 2587 2588// MarshalJSON is the custom marshaler for DeliveryRuleURLFileNameCondition. 2589func (drufnc DeliveryRuleURLFileNameCondition) MarshalJSON() ([]byte, error) { 2590 drufnc.Name = NameURLFileName 2591 objectMap := make(map[string]interface{}) 2592 if drufnc.Parameters != nil { 2593 objectMap["parameters"] = drufnc.Parameters 2594 } 2595 if drufnc.Name != "" { 2596 objectMap["name"] = drufnc.Name 2597 } 2598 return json.Marshal(objectMap) 2599} 2600 2601// AsDeliveryRuleRemoteAddressCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleURLFileNameCondition. 2602func (drufnc DeliveryRuleURLFileNameCondition) AsDeliveryRuleRemoteAddressCondition() (*DeliveryRuleRemoteAddressCondition, bool) { 2603 return nil, false 2604} 2605 2606// AsDeliveryRuleRequestMethodCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleURLFileNameCondition. 2607func (drufnc DeliveryRuleURLFileNameCondition) AsDeliveryRuleRequestMethodCondition() (*DeliveryRuleRequestMethodCondition, bool) { 2608 return nil, false 2609} 2610 2611// AsDeliveryRuleQueryStringCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleURLFileNameCondition. 2612func (drufnc DeliveryRuleURLFileNameCondition) AsDeliveryRuleQueryStringCondition() (*DeliveryRuleQueryStringCondition, bool) { 2613 return nil, false 2614} 2615 2616// AsDeliveryRulePostArgsCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleURLFileNameCondition. 2617func (drufnc DeliveryRuleURLFileNameCondition) AsDeliveryRulePostArgsCondition() (*DeliveryRulePostArgsCondition, bool) { 2618 return nil, false 2619} 2620 2621// AsDeliveryRuleRequestURICondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleURLFileNameCondition. 2622func (drufnc DeliveryRuleURLFileNameCondition) AsDeliveryRuleRequestURICondition() (*DeliveryRuleRequestURICondition, bool) { 2623 return nil, false 2624} 2625 2626// AsDeliveryRuleRequestHeaderCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleURLFileNameCondition. 2627func (drufnc DeliveryRuleURLFileNameCondition) AsDeliveryRuleRequestHeaderCondition() (*DeliveryRuleRequestHeaderCondition, bool) { 2628 return nil, false 2629} 2630 2631// AsDeliveryRuleRequestBodyCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleURLFileNameCondition. 2632func (drufnc DeliveryRuleURLFileNameCondition) AsDeliveryRuleRequestBodyCondition() (*DeliveryRuleRequestBodyCondition, bool) { 2633 return nil, false 2634} 2635 2636// AsDeliveryRuleRequestSchemeCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleURLFileNameCondition. 2637func (drufnc DeliveryRuleURLFileNameCondition) AsDeliveryRuleRequestSchemeCondition() (*DeliveryRuleRequestSchemeCondition, bool) { 2638 return nil, false 2639} 2640 2641// AsDeliveryRuleURLPathCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleURLFileNameCondition. 2642func (drufnc DeliveryRuleURLFileNameCondition) AsDeliveryRuleURLPathCondition() (*DeliveryRuleURLPathCondition, bool) { 2643 return nil, false 2644} 2645 2646// AsDeliveryRuleURLFileExtensionCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleURLFileNameCondition. 2647func (drufnc DeliveryRuleURLFileNameCondition) AsDeliveryRuleURLFileExtensionCondition() (*DeliveryRuleURLFileExtensionCondition, bool) { 2648 return nil, false 2649} 2650 2651// AsDeliveryRuleURLFileNameCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleURLFileNameCondition. 2652func (drufnc DeliveryRuleURLFileNameCondition) AsDeliveryRuleURLFileNameCondition() (*DeliveryRuleURLFileNameCondition, bool) { 2653 return &drufnc, true 2654} 2655 2656// AsDeliveryRuleHTTPVersionCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleURLFileNameCondition. 2657func (drufnc DeliveryRuleURLFileNameCondition) AsDeliveryRuleHTTPVersionCondition() (*DeliveryRuleHTTPVersionCondition, bool) { 2658 return nil, false 2659} 2660 2661// AsDeliveryRuleCookiesCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleURLFileNameCondition. 2662func (drufnc DeliveryRuleURLFileNameCondition) AsDeliveryRuleCookiesCondition() (*DeliveryRuleCookiesCondition, bool) { 2663 return nil, false 2664} 2665 2666// AsDeliveryRuleIsDeviceCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleURLFileNameCondition. 2667func (drufnc DeliveryRuleURLFileNameCondition) AsDeliveryRuleIsDeviceCondition() (*DeliveryRuleIsDeviceCondition, bool) { 2668 return nil, false 2669} 2670 2671// AsDeliveryRuleCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleURLFileNameCondition. 2672func (drufnc DeliveryRuleURLFileNameCondition) AsDeliveryRuleCondition() (*DeliveryRuleCondition, bool) { 2673 return nil, false 2674} 2675 2676// AsBasicDeliveryRuleCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleURLFileNameCondition. 2677func (drufnc DeliveryRuleURLFileNameCondition) AsBasicDeliveryRuleCondition() (BasicDeliveryRuleCondition, bool) { 2678 return &drufnc, true 2679} 2680 2681// DeliveryRuleURLPathCondition defines the UrlPath condition for the delivery rule. 2682type DeliveryRuleURLPathCondition struct { 2683 // Parameters - Defines the parameters for the condition. 2684 Parameters *URLPathMatchConditionParameters `json:"parameters,omitempty"` 2685 // Name - Possible values include: 'NameDeliveryRuleCondition', 'NameRemoteAddress', 'NameRequestMethod', 'NameQueryString', 'NamePostArgs', 'NameRequestURI', 'NameRequestHeader', 'NameRequestBody', 'NameRequestScheme', 'NameURLPath', 'NameURLFileExtension', 'NameURLFileName', 'NameHTTPVersion', 'NameCookies', 'NameIsDevice' 2686 Name Name `json:"name,omitempty"` 2687} 2688 2689// MarshalJSON is the custom marshaler for DeliveryRuleURLPathCondition. 2690func (drupc DeliveryRuleURLPathCondition) MarshalJSON() ([]byte, error) { 2691 drupc.Name = NameURLPath 2692 objectMap := make(map[string]interface{}) 2693 if drupc.Parameters != nil { 2694 objectMap["parameters"] = drupc.Parameters 2695 } 2696 if drupc.Name != "" { 2697 objectMap["name"] = drupc.Name 2698 } 2699 return json.Marshal(objectMap) 2700} 2701 2702// AsDeliveryRuleRemoteAddressCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleURLPathCondition. 2703func (drupc DeliveryRuleURLPathCondition) AsDeliveryRuleRemoteAddressCondition() (*DeliveryRuleRemoteAddressCondition, bool) { 2704 return nil, false 2705} 2706 2707// AsDeliveryRuleRequestMethodCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleURLPathCondition. 2708func (drupc DeliveryRuleURLPathCondition) AsDeliveryRuleRequestMethodCondition() (*DeliveryRuleRequestMethodCondition, bool) { 2709 return nil, false 2710} 2711 2712// AsDeliveryRuleQueryStringCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleURLPathCondition. 2713func (drupc DeliveryRuleURLPathCondition) AsDeliveryRuleQueryStringCondition() (*DeliveryRuleQueryStringCondition, bool) { 2714 return nil, false 2715} 2716 2717// AsDeliveryRulePostArgsCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleURLPathCondition. 2718func (drupc DeliveryRuleURLPathCondition) AsDeliveryRulePostArgsCondition() (*DeliveryRulePostArgsCondition, bool) { 2719 return nil, false 2720} 2721 2722// AsDeliveryRuleRequestURICondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleURLPathCondition. 2723func (drupc DeliveryRuleURLPathCondition) AsDeliveryRuleRequestURICondition() (*DeliveryRuleRequestURICondition, bool) { 2724 return nil, false 2725} 2726 2727// AsDeliveryRuleRequestHeaderCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleURLPathCondition. 2728func (drupc DeliveryRuleURLPathCondition) AsDeliveryRuleRequestHeaderCondition() (*DeliveryRuleRequestHeaderCondition, bool) { 2729 return nil, false 2730} 2731 2732// AsDeliveryRuleRequestBodyCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleURLPathCondition. 2733func (drupc DeliveryRuleURLPathCondition) AsDeliveryRuleRequestBodyCondition() (*DeliveryRuleRequestBodyCondition, bool) { 2734 return nil, false 2735} 2736 2737// AsDeliveryRuleRequestSchemeCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleURLPathCondition. 2738func (drupc DeliveryRuleURLPathCondition) AsDeliveryRuleRequestSchemeCondition() (*DeliveryRuleRequestSchemeCondition, bool) { 2739 return nil, false 2740} 2741 2742// AsDeliveryRuleURLPathCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleURLPathCondition. 2743func (drupc DeliveryRuleURLPathCondition) AsDeliveryRuleURLPathCondition() (*DeliveryRuleURLPathCondition, bool) { 2744 return &drupc, true 2745} 2746 2747// AsDeliveryRuleURLFileExtensionCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleURLPathCondition. 2748func (drupc DeliveryRuleURLPathCondition) AsDeliveryRuleURLFileExtensionCondition() (*DeliveryRuleURLFileExtensionCondition, bool) { 2749 return nil, false 2750} 2751 2752// AsDeliveryRuleURLFileNameCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleURLPathCondition. 2753func (drupc DeliveryRuleURLPathCondition) AsDeliveryRuleURLFileNameCondition() (*DeliveryRuleURLFileNameCondition, bool) { 2754 return nil, false 2755} 2756 2757// AsDeliveryRuleHTTPVersionCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleURLPathCondition. 2758func (drupc DeliveryRuleURLPathCondition) AsDeliveryRuleHTTPVersionCondition() (*DeliveryRuleHTTPVersionCondition, bool) { 2759 return nil, false 2760} 2761 2762// AsDeliveryRuleCookiesCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleURLPathCondition. 2763func (drupc DeliveryRuleURLPathCondition) AsDeliveryRuleCookiesCondition() (*DeliveryRuleCookiesCondition, bool) { 2764 return nil, false 2765} 2766 2767// AsDeliveryRuleIsDeviceCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleURLPathCondition. 2768func (drupc DeliveryRuleURLPathCondition) AsDeliveryRuleIsDeviceCondition() (*DeliveryRuleIsDeviceCondition, bool) { 2769 return nil, false 2770} 2771 2772// AsDeliveryRuleCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleURLPathCondition. 2773func (drupc DeliveryRuleURLPathCondition) AsDeliveryRuleCondition() (*DeliveryRuleCondition, bool) { 2774 return nil, false 2775} 2776 2777// AsBasicDeliveryRuleCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleURLPathCondition. 2778func (drupc DeliveryRuleURLPathCondition) AsBasicDeliveryRuleCondition() (BasicDeliveryRuleCondition, bool) { 2779 return &drupc, true 2780} 2781 2782// EdgeNode edgenode is a global Point of Presence (POP) location used to deliver CDN content to end users. 2783type EdgeNode struct { 2784 *EdgeNodeProperties `json:"properties,omitempty"` 2785 // ID - READ-ONLY; Resource ID. 2786 ID *string `json:"id,omitempty"` 2787 // Name - READ-ONLY; Resource name. 2788 Name *string `json:"name,omitempty"` 2789 // Type - READ-ONLY; Resource type. 2790 Type *string `json:"type,omitempty"` 2791} 2792 2793// MarshalJSON is the custom marshaler for EdgeNode. 2794func (en EdgeNode) MarshalJSON() ([]byte, error) { 2795 objectMap := make(map[string]interface{}) 2796 if en.EdgeNodeProperties != nil { 2797 objectMap["properties"] = en.EdgeNodeProperties 2798 } 2799 return json.Marshal(objectMap) 2800} 2801 2802// UnmarshalJSON is the custom unmarshaler for EdgeNode struct. 2803func (en *EdgeNode) UnmarshalJSON(body []byte) error { 2804 var m map[string]*json.RawMessage 2805 err := json.Unmarshal(body, &m) 2806 if err != nil { 2807 return err 2808 } 2809 for k, v := range m { 2810 switch k { 2811 case "properties": 2812 if v != nil { 2813 var edgeNodeProperties EdgeNodeProperties 2814 err = json.Unmarshal(*v, &edgeNodeProperties) 2815 if err != nil { 2816 return err 2817 } 2818 en.EdgeNodeProperties = &edgeNodeProperties 2819 } 2820 case "id": 2821 if v != nil { 2822 var ID string 2823 err = json.Unmarshal(*v, &ID) 2824 if err != nil { 2825 return err 2826 } 2827 en.ID = &ID 2828 } 2829 case "name": 2830 if v != nil { 2831 var name string 2832 err = json.Unmarshal(*v, &name) 2833 if err != nil { 2834 return err 2835 } 2836 en.Name = &name 2837 } 2838 case "type": 2839 if v != nil { 2840 var typeVar string 2841 err = json.Unmarshal(*v, &typeVar) 2842 if err != nil { 2843 return err 2844 } 2845 en.Type = &typeVar 2846 } 2847 } 2848 } 2849 2850 return nil 2851} 2852 2853// EdgeNodeProperties the JSON object that contains the properties required to create an edgenode. 2854type EdgeNodeProperties struct { 2855 // IPAddressGroups - List of ip address groups. 2856 IPAddressGroups *[]IPAddressGroup `json:"ipAddressGroups,omitempty"` 2857} 2858 2859// EdgenodeResult result of the request to list CDN edgenodes. It contains a list of ip address group and a 2860// URL link to get the next set of results. 2861type EdgenodeResult struct { 2862 autorest.Response `json:"-"` 2863 // Value - READ-ONLY; Edge node of CDN service. 2864 Value *[]EdgeNode `json:"value,omitempty"` 2865 // NextLink - URL to get the next set of edgenode list results if there are any. 2866 NextLink *string `json:"nextLink,omitempty"` 2867} 2868 2869// MarshalJSON is the custom marshaler for EdgenodeResult. 2870func (er EdgenodeResult) MarshalJSON() ([]byte, error) { 2871 objectMap := make(map[string]interface{}) 2872 if er.NextLink != nil { 2873 objectMap["nextLink"] = er.NextLink 2874 } 2875 return json.Marshal(objectMap) 2876} 2877 2878// EdgenodeResultIterator provides access to a complete listing of EdgeNode values. 2879type EdgenodeResultIterator struct { 2880 i int 2881 page EdgenodeResultPage 2882} 2883 2884// NextWithContext advances to the next value. If there was an error making 2885// the request the iterator does not advance and the error is returned. 2886func (iter *EdgenodeResultIterator) NextWithContext(ctx context.Context) (err error) { 2887 if tracing.IsEnabled() { 2888 ctx = tracing.StartSpan(ctx, fqdn+"/EdgenodeResultIterator.NextWithContext") 2889 defer func() { 2890 sc := -1 2891 if iter.Response().Response.Response != nil { 2892 sc = iter.Response().Response.Response.StatusCode 2893 } 2894 tracing.EndSpan(ctx, sc, err) 2895 }() 2896 } 2897 iter.i++ 2898 if iter.i < len(iter.page.Values()) { 2899 return nil 2900 } 2901 err = iter.page.NextWithContext(ctx) 2902 if err != nil { 2903 iter.i-- 2904 return err 2905 } 2906 iter.i = 0 2907 return nil 2908} 2909 2910// Next advances to the next value. If there was an error making 2911// the request the iterator does not advance and the error is returned. 2912// Deprecated: Use NextWithContext() instead. 2913func (iter *EdgenodeResultIterator) Next() error { 2914 return iter.NextWithContext(context.Background()) 2915} 2916 2917// NotDone returns true if the enumeration should be started or is not yet complete. 2918func (iter EdgenodeResultIterator) NotDone() bool { 2919 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 2920} 2921 2922// Response returns the raw server response from the last page request. 2923func (iter EdgenodeResultIterator) Response() EdgenodeResult { 2924 return iter.page.Response() 2925} 2926 2927// Value returns the current value or a zero-initialized value if the 2928// iterator has advanced beyond the end of the collection. 2929func (iter EdgenodeResultIterator) Value() EdgeNode { 2930 if !iter.page.NotDone() { 2931 return EdgeNode{} 2932 } 2933 return iter.page.Values()[iter.i] 2934} 2935 2936// Creates a new instance of the EdgenodeResultIterator type. 2937func NewEdgenodeResultIterator(page EdgenodeResultPage) EdgenodeResultIterator { 2938 return EdgenodeResultIterator{page: page} 2939} 2940 2941// IsEmpty returns true if the ListResult contains no values. 2942func (er EdgenodeResult) IsEmpty() bool { 2943 return er.Value == nil || len(*er.Value) == 0 2944} 2945 2946// hasNextLink returns true if the NextLink is not empty. 2947func (er EdgenodeResult) hasNextLink() bool { 2948 return er.NextLink != nil && len(*er.NextLink) != 0 2949} 2950 2951// edgenodeResultPreparer prepares a request to retrieve the next set of results. 2952// It returns nil if no more results exist. 2953func (er EdgenodeResult) edgenodeResultPreparer(ctx context.Context) (*http.Request, error) { 2954 if !er.hasNextLink() { 2955 return nil, nil 2956 } 2957 return autorest.Prepare((&http.Request{}).WithContext(ctx), 2958 autorest.AsJSON(), 2959 autorest.AsGet(), 2960 autorest.WithBaseURL(to.String(er.NextLink))) 2961} 2962 2963// EdgenodeResultPage contains a page of EdgeNode values. 2964type EdgenodeResultPage struct { 2965 fn func(context.Context, EdgenodeResult) (EdgenodeResult, error) 2966 er EdgenodeResult 2967} 2968 2969// NextWithContext advances to the next page of values. If there was an error making 2970// the request the page does not advance and the error is returned. 2971func (page *EdgenodeResultPage) NextWithContext(ctx context.Context) (err error) { 2972 if tracing.IsEnabled() { 2973 ctx = tracing.StartSpan(ctx, fqdn+"/EdgenodeResultPage.NextWithContext") 2974 defer func() { 2975 sc := -1 2976 if page.Response().Response.Response != nil { 2977 sc = page.Response().Response.Response.StatusCode 2978 } 2979 tracing.EndSpan(ctx, sc, err) 2980 }() 2981 } 2982 for { 2983 next, err := page.fn(ctx, page.er) 2984 if err != nil { 2985 return err 2986 } 2987 page.er = next 2988 if !next.hasNextLink() || !next.IsEmpty() { 2989 break 2990 } 2991 } 2992 return nil 2993} 2994 2995// Next advances to the next page of values. If there was an error making 2996// the request the page does not advance and the error is returned. 2997// Deprecated: Use NextWithContext() instead. 2998func (page *EdgenodeResultPage) Next() error { 2999 return page.NextWithContext(context.Background()) 3000} 3001 3002// NotDone returns true if the page enumeration should be started or is not yet complete. 3003func (page EdgenodeResultPage) NotDone() bool { 3004 return !page.er.IsEmpty() 3005} 3006 3007// Response returns the raw server response from the last page request. 3008func (page EdgenodeResultPage) Response() EdgenodeResult { 3009 return page.er 3010} 3011 3012// Values returns the slice of values for the current page or nil if there are no values. 3013func (page EdgenodeResultPage) Values() []EdgeNode { 3014 if page.er.IsEmpty() { 3015 return nil 3016 } 3017 return *page.er.Value 3018} 3019 3020// Creates a new instance of the EdgenodeResultPage type. 3021func NewEdgenodeResultPage(cur EdgenodeResult, getNextPage func(context.Context, EdgenodeResult) (EdgenodeResult, error)) EdgenodeResultPage { 3022 return EdgenodeResultPage{ 3023 fn: getNextPage, 3024 er: cur, 3025 } 3026} 3027 3028// Endpoint CDN endpoint is the entity within a CDN profile containing configuration information such as 3029// origin, protocol, content caching and delivery behavior. The CDN endpoint uses the URL format 3030// <endpointname>.azureedge.net. 3031type Endpoint struct { 3032 autorest.Response `json:"-"` 3033 *EndpointProperties `json:"properties,omitempty"` 3034 // Location - Resource location. 3035 Location *string `json:"location,omitempty"` 3036 // Tags - Resource tags. 3037 Tags map[string]*string `json:"tags"` 3038 // ID - READ-ONLY; Resource ID. 3039 ID *string `json:"id,omitempty"` 3040 // Name - READ-ONLY; Resource name. 3041 Name *string `json:"name,omitempty"` 3042 // Type - READ-ONLY; Resource type. 3043 Type *string `json:"type,omitempty"` 3044} 3045 3046// MarshalJSON is the custom marshaler for Endpoint. 3047func (e Endpoint) MarshalJSON() ([]byte, error) { 3048 objectMap := make(map[string]interface{}) 3049 if e.EndpointProperties != nil { 3050 objectMap["properties"] = e.EndpointProperties 3051 } 3052 if e.Location != nil { 3053 objectMap["location"] = e.Location 3054 } 3055 if e.Tags != nil { 3056 objectMap["tags"] = e.Tags 3057 } 3058 return json.Marshal(objectMap) 3059} 3060 3061// UnmarshalJSON is the custom unmarshaler for Endpoint struct. 3062func (e *Endpoint) UnmarshalJSON(body []byte) error { 3063 var m map[string]*json.RawMessage 3064 err := json.Unmarshal(body, &m) 3065 if err != nil { 3066 return err 3067 } 3068 for k, v := range m { 3069 switch k { 3070 case "properties": 3071 if v != nil { 3072 var endpointProperties EndpointProperties 3073 err = json.Unmarshal(*v, &endpointProperties) 3074 if err != nil { 3075 return err 3076 } 3077 e.EndpointProperties = &endpointProperties 3078 } 3079 case "location": 3080 if v != nil { 3081 var location string 3082 err = json.Unmarshal(*v, &location) 3083 if err != nil { 3084 return err 3085 } 3086 e.Location = &location 3087 } 3088 case "tags": 3089 if v != nil { 3090 var tags map[string]*string 3091 err = json.Unmarshal(*v, &tags) 3092 if err != nil { 3093 return err 3094 } 3095 e.Tags = tags 3096 } 3097 case "id": 3098 if v != nil { 3099 var ID string 3100 err = json.Unmarshal(*v, &ID) 3101 if err != nil { 3102 return err 3103 } 3104 e.ID = &ID 3105 } 3106 case "name": 3107 if v != nil { 3108 var name string 3109 err = json.Unmarshal(*v, &name) 3110 if err != nil { 3111 return err 3112 } 3113 e.Name = &name 3114 } 3115 case "type": 3116 if v != nil { 3117 var typeVar string 3118 err = json.Unmarshal(*v, &typeVar) 3119 if err != nil { 3120 return err 3121 } 3122 e.Type = &typeVar 3123 } 3124 } 3125 } 3126 3127 return nil 3128} 3129 3130// EndpointListResult result of the request to list endpoints. It contains a list of endpoint objects and a 3131// URL link to get the next set of results. 3132type EndpointListResult struct { 3133 autorest.Response `json:"-"` 3134 // Value - READ-ONLY; List of CDN endpoints within a profile 3135 Value *[]Endpoint `json:"value,omitempty"` 3136 // NextLink - URL to get the next set of endpoint objects if there is any. 3137 NextLink *string `json:"nextLink,omitempty"` 3138} 3139 3140// MarshalJSON is the custom marshaler for EndpointListResult. 3141func (elr EndpointListResult) MarshalJSON() ([]byte, error) { 3142 objectMap := make(map[string]interface{}) 3143 if elr.NextLink != nil { 3144 objectMap["nextLink"] = elr.NextLink 3145 } 3146 return json.Marshal(objectMap) 3147} 3148 3149// EndpointListResultIterator provides access to a complete listing of Endpoint values. 3150type EndpointListResultIterator struct { 3151 i int 3152 page EndpointListResultPage 3153} 3154 3155// NextWithContext advances to the next value. If there was an error making 3156// the request the iterator does not advance and the error is returned. 3157func (iter *EndpointListResultIterator) NextWithContext(ctx context.Context) (err error) { 3158 if tracing.IsEnabled() { 3159 ctx = tracing.StartSpan(ctx, fqdn+"/EndpointListResultIterator.NextWithContext") 3160 defer func() { 3161 sc := -1 3162 if iter.Response().Response.Response != nil { 3163 sc = iter.Response().Response.Response.StatusCode 3164 } 3165 tracing.EndSpan(ctx, sc, err) 3166 }() 3167 } 3168 iter.i++ 3169 if iter.i < len(iter.page.Values()) { 3170 return nil 3171 } 3172 err = iter.page.NextWithContext(ctx) 3173 if err != nil { 3174 iter.i-- 3175 return err 3176 } 3177 iter.i = 0 3178 return nil 3179} 3180 3181// Next advances to the next value. If there was an error making 3182// the request the iterator does not advance and the error is returned. 3183// Deprecated: Use NextWithContext() instead. 3184func (iter *EndpointListResultIterator) Next() error { 3185 return iter.NextWithContext(context.Background()) 3186} 3187 3188// NotDone returns true if the enumeration should be started or is not yet complete. 3189func (iter EndpointListResultIterator) NotDone() bool { 3190 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 3191} 3192 3193// Response returns the raw server response from the last page request. 3194func (iter EndpointListResultIterator) Response() EndpointListResult { 3195 return iter.page.Response() 3196} 3197 3198// Value returns the current value or a zero-initialized value if the 3199// iterator has advanced beyond the end of the collection. 3200func (iter EndpointListResultIterator) Value() Endpoint { 3201 if !iter.page.NotDone() { 3202 return Endpoint{} 3203 } 3204 return iter.page.Values()[iter.i] 3205} 3206 3207// Creates a new instance of the EndpointListResultIterator type. 3208func NewEndpointListResultIterator(page EndpointListResultPage) EndpointListResultIterator { 3209 return EndpointListResultIterator{page: page} 3210} 3211 3212// IsEmpty returns true if the ListResult contains no values. 3213func (elr EndpointListResult) IsEmpty() bool { 3214 return elr.Value == nil || len(*elr.Value) == 0 3215} 3216 3217// hasNextLink returns true if the NextLink is not empty. 3218func (elr EndpointListResult) hasNextLink() bool { 3219 return elr.NextLink != nil && len(*elr.NextLink) != 0 3220} 3221 3222// endpointListResultPreparer prepares a request to retrieve the next set of results. 3223// It returns nil if no more results exist. 3224func (elr EndpointListResult) endpointListResultPreparer(ctx context.Context) (*http.Request, error) { 3225 if !elr.hasNextLink() { 3226 return nil, nil 3227 } 3228 return autorest.Prepare((&http.Request{}).WithContext(ctx), 3229 autorest.AsJSON(), 3230 autorest.AsGet(), 3231 autorest.WithBaseURL(to.String(elr.NextLink))) 3232} 3233 3234// EndpointListResultPage contains a page of Endpoint values. 3235type EndpointListResultPage struct { 3236 fn func(context.Context, EndpointListResult) (EndpointListResult, error) 3237 elr EndpointListResult 3238} 3239 3240// NextWithContext advances to the next page of values. If there was an error making 3241// the request the page does not advance and the error is returned. 3242func (page *EndpointListResultPage) NextWithContext(ctx context.Context) (err error) { 3243 if tracing.IsEnabled() { 3244 ctx = tracing.StartSpan(ctx, fqdn+"/EndpointListResultPage.NextWithContext") 3245 defer func() { 3246 sc := -1 3247 if page.Response().Response.Response != nil { 3248 sc = page.Response().Response.Response.StatusCode 3249 } 3250 tracing.EndSpan(ctx, sc, err) 3251 }() 3252 } 3253 for { 3254 next, err := page.fn(ctx, page.elr) 3255 if err != nil { 3256 return err 3257 } 3258 page.elr = next 3259 if !next.hasNextLink() || !next.IsEmpty() { 3260 break 3261 } 3262 } 3263 return nil 3264} 3265 3266// Next advances to the next page of values. If there was an error making 3267// the request the page does not advance and the error is returned. 3268// Deprecated: Use NextWithContext() instead. 3269func (page *EndpointListResultPage) Next() error { 3270 return page.NextWithContext(context.Background()) 3271} 3272 3273// NotDone returns true if the page enumeration should be started or is not yet complete. 3274func (page EndpointListResultPage) NotDone() bool { 3275 return !page.elr.IsEmpty() 3276} 3277 3278// Response returns the raw server response from the last page request. 3279func (page EndpointListResultPage) Response() EndpointListResult { 3280 return page.elr 3281} 3282 3283// Values returns the slice of values for the current page or nil if there are no values. 3284func (page EndpointListResultPage) Values() []Endpoint { 3285 if page.elr.IsEmpty() { 3286 return nil 3287 } 3288 return *page.elr.Value 3289} 3290 3291// Creates a new instance of the EndpointListResultPage type. 3292func NewEndpointListResultPage(cur EndpointListResult, getNextPage func(context.Context, EndpointListResult) (EndpointListResult, error)) EndpointListResultPage { 3293 return EndpointListResultPage{ 3294 fn: getNextPage, 3295 elr: cur, 3296 } 3297} 3298 3299// EndpointProperties the JSON object that contains the properties required to create an endpoint. 3300type EndpointProperties struct { 3301 // HostName - READ-ONLY; The host name of the endpoint structured as {endpointName}.{DNSZone}, e.g. contoso.azureedge.net 3302 HostName *string `json:"hostName,omitempty"` 3303 // Origins - The source of the content being delivered via CDN. 3304 Origins *[]DeepCreatedOrigin `json:"origins,omitempty"` 3305 // ResourceState - READ-ONLY; Resource status of the endpoint. Possible values include: 'EndpointResourceStateCreating', 'EndpointResourceStateDeleting', 'EndpointResourceStateRunning', 'EndpointResourceStateStarting', 'EndpointResourceStateStopped', 'EndpointResourceStateStopping' 3306 ResourceState EndpointResourceState `json:"resourceState,omitempty"` 3307 // ProvisioningState - READ-ONLY; Provisioning status of the endpoint. 3308 ProvisioningState *string `json:"provisioningState,omitempty"` 3309 // 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. 3310 OriginHostHeader *string `json:"originHostHeader,omitempty"` 3311 // OriginPath - A directory path on the origin that CDN can use to retrieve content from, e.g. contoso.cloudapp.net/originpath. 3312 OriginPath *string `json:"originPath,omitempty"` 3313 // ContentTypesToCompress - List of content types on which compression applies. The value should be a valid MIME type. 3314 ContentTypesToCompress *[]string `json:"contentTypesToCompress,omitempty"` 3315 // 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. 3316 IsCompressionEnabled *bool `json:"isCompressionEnabled,omitempty"` 3317 // IsHTTPAllowed - Indicates whether HTTP traffic is allowed on the endpoint. Default value is true. At least one protocol (HTTP or HTTPS) must be allowed. 3318 IsHTTPAllowed *bool `json:"isHttpAllowed,omitempty"` 3319 // IsHTTPSAllowed - Indicates whether HTTPS traffic is allowed on the endpoint. Default value is true. At least one protocol (HTTP or HTTPS) must be allowed. 3320 IsHTTPSAllowed *bool `json:"isHttpsAllowed,omitempty"` 3321 // QueryStringCachingBehavior - Defines how CDN caches requests that include query strings. You can ignore any query strings when caching, bypass caching to prevent requests that contain query strings from being cached, or cache every request with a unique URL. Possible values include: 'IgnoreQueryString', 'BypassCaching', 'UseQueryString', 'NotSet' 3322 QueryStringCachingBehavior QueryStringCachingBehavior `json:"queryStringCachingBehavior,omitempty"` 3323 // 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' 3324 OptimizationType OptimizationType `json:"optimizationType,omitempty"` 3325 // 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. 3326 ProbePath *string `json:"probePath,omitempty"` 3327 // 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/ 3328 GeoFilters *[]GeoFilter `json:"geoFilters,omitempty"` 3329 // DeliveryPolicy - A policy that specifies the delivery rules to be used for an endpoint. 3330 DeliveryPolicy *EndpointPropertiesUpdateParametersDeliveryPolicy `json:"deliveryPolicy,omitempty"` 3331} 3332 3333// MarshalJSON is the custom marshaler for EndpointProperties. 3334func (ep EndpointProperties) MarshalJSON() ([]byte, error) { 3335 objectMap := make(map[string]interface{}) 3336 if ep.Origins != nil { 3337 objectMap["origins"] = ep.Origins 3338 } 3339 if ep.OriginHostHeader != nil { 3340 objectMap["originHostHeader"] = ep.OriginHostHeader 3341 } 3342 if ep.OriginPath != nil { 3343 objectMap["originPath"] = ep.OriginPath 3344 } 3345 if ep.ContentTypesToCompress != nil { 3346 objectMap["contentTypesToCompress"] = ep.ContentTypesToCompress 3347 } 3348 if ep.IsCompressionEnabled != nil { 3349 objectMap["isCompressionEnabled"] = ep.IsCompressionEnabled 3350 } 3351 if ep.IsHTTPAllowed != nil { 3352 objectMap["isHttpAllowed"] = ep.IsHTTPAllowed 3353 } 3354 if ep.IsHTTPSAllowed != nil { 3355 objectMap["isHttpsAllowed"] = ep.IsHTTPSAllowed 3356 } 3357 if ep.QueryStringCachingBehavior != "" { 3358 objectMap["queryStringCachingBehavior"] = ep.QueryStringCachingBehavior 3359 } 3360 if ep.OptimizationType != "" { 3361 objectMap["optimizationType"] = ep.OptimizationType 3362 } 3363 if ep.ProbePath != nil { 3364 objectMap["probePath"] = ep.ProbePath 3365 } 3366 if ep.GeoFilters != nil { 3367 objectMap["geoFilters"] = ep.GeoFilters 3368 } 3369 if ep.DeliveryPolicy != nil { 3370 objectMap["deliveryPolicy"] = ep.DeliveryPolicy 3371 } 3372 return json.Marshal(objectMap) 3373} 3374 3375// EndpointPropertiesUpdateParameters the JSON object containing endpoint update parameters. 3376type EndpointPropertiesUpdateParameters struct { 3377 // 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. 3378 OriginHostHeader *string `json:"originHostHeader,omitempty"` 3379 // OriginPath - A directory path on the origin that CDN can use to retrieve content from, e.g. contoso.cloudapp.net/originpath. 3380 OriginPath *string `json:"originPath,omitempty"` 3381 // ContentTypesToCompress - List of content types on which compression applies. The value should be a valid MIME type. 3382 ContentTypesToCompress *[]string `json:"contentTypesToCompress,omitempty"` 3383 // 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. 3384 IsCompressionEnabled *bool `json:"isCompressionEnabled,omitempty"` 3385 // IsHTTPAllowed - Indicates whether HTTP traffic is allowed on the endpoint. Default value is true. At least one protocol (HTTP or HTTPS) must be allowed. 3386 IsHTTPAllowed *bool `json:"isHttpAllowed,omitempty"` 3387 // IsHTTPSAllowed - Indicates whether HTTPS traffic is allowed on the endpoint. Default value is true. At least one protocol (HTTP or HTTPS) must be allowed. 3388 IsHTTPSAllowed *bool `json:"isHttpsAllowed,omitempty"` 3389 // QueryStringCachingBehavior - Defines how CDN caches requests that include query strings. You can ignore any query strings when caching, bypass caching to prevent requests that contain query strings from being cached, or cache every request with a unique URL. Possible values include: 'IgnoreQueryString', 'BypassCaching', 'UseQueryString', 'NotSet' 3390 QueryStringCachingBehavior QueryStringCachingBehavior `json:"queryStringCachingBehavior,omitempty"` 3391 // 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' 3392 OptimizationType OptimizationType `json:"optimizationType,omitempty"` 3393 // 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. 3394 ProbePath *string `json:"probePath,omitempty"` 3395 // 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/ 3396 GeoFilters *[]GeoFilter `json:"geoFilters,omitempty"` 3397 // DeliveryPolicy - A policy that specifies the delivery rules to be used for an endpoint. 3398 DeliveryPolicy *EndpointPropertiesUpdateParametersDeliveryPolicy `json:"deliveryPolicy,omitempty"` 3399} 3400 3401// EndpointPropertiesUpdateParametersDeliveryPolicy a policy that specifies the delivery rules to be used 3402// for an endpoint. 3403type EndpointPropertiesUpdateParametersDeliveryPolicy struct { 3404 // Description - User-friendly description of the policy. 3405 Description *string `json:"description,omitempty"` 3406 // Rules - A list of the delivery rules. 3407 Rules *[]DeliveryRule `json:"rules,omitempty"` 3408} 3409 3410// EndpointsCreateFuture an abstraction for monitoring and retrieving the results of a long-running 3411// operation. 3412type EndpointsCreateFuture struct { 3413 azure.FutureAPI 3414 // Result returns the result of the asynchronous operation. 3415 // If the operation has not completed it will return an error. 3416 Result func(EndpointsClient) (Endpoint, error) 3417} 3418 3419// UnmarshalJSON is the custom unmarshaller for CreateFuture. 3420func (future *EndpointsCreateFuture) UnmarshalJSON(body []byte) error { 3421 var azFuture azure.Future 3422 if err := json.Unmarshal(body, &azFuture); err != nil { 3423 return err 3424 } 3425 future.FutureAPI = &azFuture 3426 future.Result = future.result 3427 return nil 3428} 3429 3430// result is the default implementation for EndpointsCreateFuture.Result. 3431func (future *EndpointsCreateFuture) result(client EndpointsClient) (e Endpoint, err error) { 3432 var done bool 3433 done, err = future.DoneWithContext(context.Background(), client) 3434 if err != nil { 3435 err = autorest.NewErrorWithError(err, "cdn.EndpointsCreateFuture", "Result", future.Response(), "Polling failure") 3436 return 3437 } 3438 if !done { 3439 e.Response.Response = future.Response() 3440 err = azure.NewAsyncOpIncompleteError("cdn.EndpointsCreateFuture") 3441 return 3442 } 3443 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 3444 if e.Response.Response, err = future.GetResult(sender); err == nil && e.Response.Response.StatusCode != http.StatusNoContent { 3445 e, err = client.CreateResponder(e.Response.Response) 3446 if err != nil { 3447 err = autorest.NewErrorWithError(err, "cdn.EndpointsCreateFuture", "Result", e.Response.Response, "Failure responding to request") 3448 } 3449 } 3450 return 3451} 3452 3453// EndpointsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running 3454// operation. 3455type EndpointsDeleteFuture struct { 3456 azure.FutureAPI 3457 // Result returns the result of the asynchronous operation. 3458 // If the operation has not completed it will return an error. 3459 Result func(EndpointsClient) (autorest.Response, error) 3460} 3461 3462// UnmarshalJSON is the custom unmarshaller for CreateFuture. 3463func (future *EndpointsDeleteFuture) UnmarshalJSON(body []byte) error { 3464 var azFuture azure.Future 3465 if err := json.Unmarshal(body, &azFuture); err != nil { 3466 return err 3467 } 3468 future.FutureAPI = &azFuture 3469 future.Result = future.result 3470 return nil 3471} 3472 3473// result is the default implementation for EndpointsDeleteFuture.Result. 3474func (future *EndpointsDeleteFuture) result(client EndpointsClient) (ar autorest.Response, err error) { 3475 var done bool 3476 done, err = future.DoneWithContext(context.Background(), client) 3477 if err != nil { 3478 err = autorest.NewErrorWithError(err, "cdn.EndpointsDeleteFuture", "Result", future.Response(), "Polling failure") 3479 return 3480 } 3481 if !done { 3482 ar.Response = future.Response() 3483 err = azure.NewAsyncOpIncompleteError("cdn.EndpointsDeleteFuture") 3484 return 3485 } 3486 ar.Response = future.Response() 3487 return 3488} 3489 3490// EndpointsLoadContentFuture an abstraction for monitoring and retrieving the results of a long-running 3491// operation. 3492type EndpointsLoadContentFuture struct { 3493 azure.FutureAPI 3494 // Result returns the result of the asynchronous operation. 3495 // If the operation has not completed it will return an error. 3496 Result func(EndpointsClient) (autorest.Response, error) 3497} 3498 3499// UnmarshalJSON is the custom unmarshaller for CreateFuture. 3500func (future *EndpointsLoadContentFuture) UnmarshalJSON(body []byte) error { 3501 var azFuture azure.Future 3502 if err := json.Unmarshal(body, &azFuture); err != nil { 3503 return err 3504 } 3505 future.FutureAPI = &azFuture 3506 future.Result = future.result 3507 return nil 3508} 3509 3510// result is the default implementation for EndpointsLoadContentFuture.Result. 3511func (future *EndpointsLoadContentFuture) result(client EndpointsClient) (ar autorest.Response, err error) { 3512 var done bool 3513 done, err = future.DoneWithContext(context.Background(), client) 3514 if err != nil { 3515 err = autorest.NewErrorWithError(err, "cdn.EndpointsLoadContentFuture", "Result", future.Response(), "Polling failure") 3516 return 3517 } 3518 if !done { 3519 ar.Response = future.Response() 3520 err = azure.NewAsyncOpIncompleteError("cdn.EndpointsLoadContentFuture") 3521 return 3522 } 3523 ar.Response = future.Response() 3524 return 3525} 3526 3527// EndpointsPurgeContentFuture an abstraction for monitoring and retrieving the results of a long-running 3528// operation. 3529type EndpointsPurgeContentFuture struct { 3530 azure.FutureAPI 3531 // Result returns the result of the asynchronous operation. 3532 // If the operation has not completed it will return an error. 3533 Result func(EndpointsClient) (autorest.Response, error) 3534} 3535 3536// UnmarshalJSON is the custom unmarshaller for CreateFuture. 3537func (future *EndpointsPurgeContentFuture) UnmarshalJSON(body []byte) error { 3538 var azFuture azure.Future 3539 if err := json.Unmarshal(body, &azFuture); err != nil { 3540 return err 3541 } 3542 future.FutureAPI = &azFuture 3543 future.Result = future.result 3544 return nil 3545} 3546 3547// result is the default implementation for EndpointsPurgeContentFuture.Result. 3548func (future *EndpointsPurgeContentFuture) result(client EndpointsClient) (ar autorest.Response, err error) { 3549 var done bool 3550 done, err = future.DoneWithContext(context.Background(), client) 3551 if err != nil { 3552 err = autorest.NewErrorWithError(err, "cdn.EndpointsPurgeContentFuture", "Result", future.Response(), "Polling failure") 3553 return 3554 } 3555 if !done { 3556 ar.Response = future.Response() 3557 err = azure.NewAsyncOpIncompleteError("cdn.EndpointsPurgeContentFuture") 3558 return 3559 } 3560 ar.Response = future.Response() 3561 return 3562} 3563 3564// EndpointsStartFuture an abstraction for monitoring and retrieving the results of a long-running 3565// operation. 3566type EndpointsStartFuture struct { 3567 azure.FutureAPI 3568 // Result returns the result of the asynchronous operation. 3569 // If the operation has not completed it will return an error. 3570 Result func(EndpointsClient) (Endpoint, error) 3571} 3572 3573// UnmarshalJSON is the custom unmarshaller for CreateFuture. 3574func (future *EndpointsStartFuture) UnmarshalJSON(body []byte) error { 3575 var azFuture azure.Future 3576 if err := json.Unmarshal(body, &azFuture); err != nil { 3577 return err 3578 } 3579 future.FutureAPI = &azFuture 3580 future.Result = future.result 3581 return nil 3582} 3583 3584// result is the default implementation for EndpointsStartFuture.Result. 3585func (future *EndpointsStartFuture) result(client EndpointsClient) (e Endpoint, err error) { 3586 var done bool 3587 done, err = future.DoneWithContext(context.Background(), client) 3588 if err != nil { 3589 err = autorest.NewErrorWithError(err, "cdn.EndpointsStartFuture", "Result", future.Response(), "Polling failure") 3590 return 3591 } 3592 if !done { 3593 e.Response.Response = future.Response() 3594 err = azure.NewAsyncOpIncompleteError("cdn.EndpointsStartFuture") 3595 return 3596 } 3597 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 3598 if e.Response.Response, err = future.GetResult(sender); err == nil && e.Response.Response.StatusCode != http.StatusNoContent { 3599 e, err = client.StartResponder(e.Response.Response) 3600 if err != nil { 3601 err = autorest.NewErrorWithError(err, "cdn.EndpointsStartFuture", "Result", e.Response.Response, "Failure responding to request") 3602 } 3603 } 3604 return 3605} 3606 3607// EndpointsStopFuture an abstraction for monitoring and retrieving the results of a long-running 3608// operation. 3609type EndpointsStopFuture struct { 3610 azure.FutureAPI 3611 // Result returns the result of the asynchronous operation. 3612 // If the operation has not completed it will return an error. 3613 Result func(EndpointsClient) (Endpoint, error) 3614} 3615 3616// UnmarshalJSON is the custom unmarshaller for CreateFuture. 3617func (future *EndpointsStopFuture) UnmarshalJSON(body []byte) error { 3618 var azFuture azure.Future 3619 if err := json.Unmarshal(body, &azFuture); err != nil { 3620 return err 3621 } 3622 future.FutureAPI = &azFuture 3623 future.Result = future.result 3624 return nil 3625} 3626 3627// result is the default implementation for EndpointsStopFuture.Result. 3628func (future *EndpointsStopFuture) result(client EndpointsClient) (e Endpoint, err error) { 3629 var done bool 3630 done, err = future.DoneWithContext(context.Background(), client) 3631 if err != nil { 3632 err = autorest.NewErrorWithError(err, "cdn.EndpointsStopFuture", "Result", future.Response(), "Polling failure") 3633 return 3634 } 3635 if !done { 3636 e.Response.Response = future.Response() 3637 err = azure.NewAsyncOpIncompleteError("cdn.EndpointsStopFuture") 3638 return 3639 } 3640 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 3641 if e.Response.Response, err = future.GetResult(sender); err == nil && e.Response.Response.StatusCode != http.StatusNoContent { 3642 e, err = client.StopResponder(e.Response.Response) 3643 if err != nil { 3644 err = autorest.NewErrorWithError(err, "cdn.EndpointsStopFuture", "Result", e.Response.Response, "Failure responding to request") 3645 } 3646 } 3647 return 3648} 3649 3650// EndpointsUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 3651// operation. 3652type EndpointsUpdateFuture struct { 3653 azure.FutureAPI 3654 // Result returns the result of the asynchronous operation. 3655 // If the operation has not completed it will return an error. 3656 Result func(EndpointsClient) (Endpoint, error) 3657} 3658 3659// UnmarshalJSON is the custom unmarshaller for CreateFuture. 3660func (future *EndpointsUpdateFuture) UnmarshalJSON(body []byte) error { 3661 var azFuture azure.Future 3662 if err := json.Unmarshal(body, &azFuture); err != nil { 3663 return err 3664 } 3665 future.FutureAPI = &azFuture 3666 future.Result = future.result 3667 return nil 3668} 3669 3670// result is the default implementation for EndpointsUpdateFuture.Result. 3671func (future *EndpointsUpdateFuture) result(client EndpointsClient) (e Endpoint, err error) { 3672 var done bool 3673 done, err = future.DoneWithContext(context.Background(), client) 3674 if err != nil { 3675 err = autorest.NewErrorWithError(err, "cdn.EndpointsUpdateFuture", "Result", future.Response(), "Polling failure") 3676 return 3677 } 3678 if !done { 3679 e.Response.Response = future.Response() 3680 err = azure.NewAsyncOpIncompleteError("cdn.EndpointsUpdateFuture") 3681 return 3682 } 3683 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 3684 if e.Response.Response, err = future.GetResult(sender); err == nil && e.Response.Response.StatusCode != http.StatusNoContent { 3685 e, err = client.UpdateResponder(e.Response.Response) 3686 if err != nil { 3687 err = autorest.NewErrorWithError(err, "cdn.EndpointsUpdateFuture", "Result", e.Response.Response, "Failure responding to request") 3688 } 3689 } 3690 return 3691} 3692 3693// EndpointUpdateParameters properties required to create or update an endpoint. 3694type EndpointUpdateParameters struct { 3695 // Tags - Endpoint tags. 3696 Tags map[string]*string `json:"tags"` 3697 *EndpointPropertiesUpdateParameters `json:"properties,omitempty"` 3698} 3699 3700// MarshalJSON is the custom marshaler for EndpointUpdateParameters. 3701func (eup EndpointUpdateParameters) MarshalJSON() ([]byte, error) { 3702 objectMap := make(map[string]interface{}) 3703 if eup.Tags != nil { 3704 objectMap["tags"] = eup.Tags 3705 } 3706 if eup.EndpointPropertiesUpdateParameters != nil { 3707 objectMap["properties"] = eup.EndpointPropertiesUpdateParameters 3708 } 3709 return json.Marshal(objectMap) 3710} 3711 3712// UnmarshalJSON is the custom unmarshaler for EndpointUpdateParameters struct. 3713func (eup *EndpointUpdateParameters) UnmarshalJSON(body []byte) error { 3714 var m map[string]*json.RawMessage 3715 err := json.Unmarshal(body, &m) 3716 if err != nil { 3717 return err 3718 } 3719 for k, v := range m { 3720 switch k { 3721 case "tags": 3722 if v != nil { 3723 var tags map[string]*string 3724 err = json.Unmarshal(*v, &tags) 3725 if err != nil { 3726 return err 3727 } 3728 eup.Tags = tags 3729 } 3730 case "properties": 3731 if v != nil { 3732 var endpointPropertiesUpdateParameters EndpointPropertiesUpdateParameters 3733 err = json.Unmarshal(*v, &endpointPropertiesUpdateParameters) 3734 if err != nil { 3735 return err 3736 } 3737 eup.EndpointPropertiesUpdateParameters = &endpointPropertiesUpdateParameters 3738 } 3739 } 3740 } 3741 3742 return nil 3743} 3744 3745// ErrorResponse error response indicates CDN service is not able to process the incoming request. The 3746// reason is provided in the error message. 3747type ErrorResponse struct { 3748 // Code - READ-ONLY; Error code. 3749 Code *string `json:"code,omitempty"` 3750 // Message - READ-ONLY; Error message indicating why the operation failed. 3751 Message *string `json:"message,omitempty"` 3752} 3753 3754// MarshalJSON is the custom marshaler for ErrorResponse. 3755func (er ErrorResponse) MarshalJSON() ([]byte, error) { 3756 objectMap := make(map[string]interface{}) 3757 return json.Marshal(objectMap) 3758} 3759 3760// GeoFilter rules defining user's geo access within a CDN endpoint. 3761type GeoFilter struct { 3762 // RelativePath - Relative path applicable to geo filter. (e.g. '/mypictures', '/mypicture/kitty.jpg', and etc.) 3763 RelativePath *string `json:"relativePath,omitempty"` 3764 // Action - Action of the geo filter, i.e. allow or block access. Possible values include: 'Block', 'Allow' 3765 Action GeoFilterActions `json:"action,omitempty"` 3766 // CountryCodes - Two letter country codes defining user country access in a geo filter, e.g. AU, MX, US. 3767 CountryCodes *[]string `json:"countryCodes,omitempty"` 3768} 3769 3770// HeaderActionParameters defines the parameters for the request header action. 3771type HeaderActionParameters struct { 3772 OdataType *string `json:"@odata.type,omitempty"` 3773 // HeaderAction - Action to perform. Possible values include: 'Append', 'Overwrite', 'Delete' 3774 HeaderAction HeaderAction `json:"headerAction,omitempty"` 3775 // HeaderName - Name of the header to modify 3776 HeaderName *string `json:"headerName,omitempty"` 3777 // Value - Value for the specified action 3778 Value *string `json:"value,omitempty"` 3779} 3780 3781// HTTPVersionMatchConditionParameters defines the parameters for HttpVersion match conditions 3782type HTTPVersionMatchConditionParameters struct { 3783 OdataType *string `json:"@odata.type,omitempty"` 3784 // Operator - Describes operator to be matched 3785 Operator *string `json:"operator,omitempty"` 3786 // NegateCondition - Describes if this is negate condition or not 3787 NegateCondition *bool `json:"negateCondition,omitempty"` 3788 // MatchValues - The match value for the condition of the delivery rule 3789 MatchValues *[]string `json:"matchValues,omitempty"` 3790} 3791 3792// IPAddressGroup CDN Ip address group 3793type IPAddressGroup struct { 3794 // DeliveryRegion - The delivery region of the ip address group 3795 DeliveryRegion *string `json:"deliveryRegion,omitempty"` 3796 // Ipv4Addresses - The list of ip v4 addresses. 3797 Ipv4Addresses *[]CidrIPAddress `json:"ipv4Addresses,omitempty"` 3798 // Ipv6Addresses - The list of ip v6 addresses. 3799 Ipv6Addresses *[]CidrIPAddress `json:"ipv6Addresses,omitempty"` 3800} 3801 3802// IsDeviceMatchConditionParameters defines the parameters for IsDevice match conditions 3803type IsDeviceMatchConditionParameters struct { 3804 OdataType *string `json:"@odata.type,omitempty"` 3805 // Operator - Describes operator to be matched 3806 Operator *string `json:"operator,omitempty"` 3807 // NegateCondition - Describes if this is negate condition or not 3808 NegateCondition *bool `json:"negateCondition,omitempty"` 3809 // MatchValues - The match value for the condition of the delivery rule 3810 MatchValues *[]string `json:"matchValues,omitempty"` 3811 // Transforms - List of transforms 3812 Transforms *[]Transform `json:"transforms,omitempty"` 3813} 3814 3815// KeyVaultCertificateSourceParameters describes the parameters for using a user's KeyVault certificate for 3816// securing custom domain. 3817type KeyVaultCertificateSourceParameters struct { 3818 OdataType *string `json:"@odata.type,omitempty"` 3819 // SubscriptionID - Subscription Id of the user's Key Vault containing the SSL certificate 3820 SubscriptionID *string `json:"subscriptionId,omitempty"` 3821 // ResourceGroupName - Resource group of the user's Key Vault containing the SSL certificate 3822 ResourceGroupName *string `json:"resourceGroupName,omitempty"` 3823 // VaultName - The name of the user's Key Vault containing the SSL certificate 3824 VaultName *string `json:"vaultName,omitempty"` 3825 // SecretName - The name of Key Vault Secret (representing the full certificate PFX) in Key Vault. 3826 SecretName *string `json:"secretName,omitempty"` 3827 // SecretVersion - The version(GUID) of Key Vault Secret in Key Vault. 3828 SecretVersion *string `json:"secretVersion,omitempty"` 3829 // UpdateRule - Describes the action that shall be taken when the certificate is updated in Key Vault. 3830 UpdateRule *string `json:"updateRule,omitempty"` 3831 // DeleteRule - Describes the action that shall be taken when the certificate is removed from Key Vault. 3832 DeleteRule *string `json:"deleteRule,omitempty"` 3833} 3834 3835// LoadParameters parameters required for content load. 3836type LoadParameters struct { 3837 // ContentPaths - The path to the content to be loaded. Path should be a relative file URL of the origin. 3838 ContentPaths *[]string `json:"contentPaths,omitempty"` 3839} 3840 3841// ManagedHTTPSParameters defines the certificate source parameters using CDN managed certificate for 3842// enabling SSL. 3843type ManagedHTTPSParameters struct { 3844 // CertificateSourceParameters - Defines the certificate source parameters using CDN managed certificate for enabling SSL. 3845 CertificateSourceParameters *CertificateSourceParameters `json:"certificateSourceParameters,omitempty"` 3846 // ProtocolType - Defines the TLS extension protocol that is used for secure delivery. Possible values include: 'ServerNameIndication', 'IPBased' 3847 ProtocolType ProtocolType `json:"protocolType,omitempty"` 3848 // MinimumTLSVersion - TLS protocol version that will be used for Https. Possible values include: 'None', 'TLS10', 'TLS12' 3849 MinimumTLSVersion MinimumTLSVersion `json:"minimumTlsVersion,omitempty"` 3850 // CertificateSource - Possible values include: 'CertificateSourceCustomDomainHTTPSParameters', 'CertificateSourceCdn', 'CertificateSourceAzureKeyVault' 3851 CertificateSource CertificateSource `json:"certificateSource,omitempty"` 3852} 3853 3854// MarshalJSON is the custom marshaler for ManagedHTTPSParameters. 3855func (mhp ManagedHTTPSParameters) MarshalJSON() ([]byte, error) { 3856 mhp.CertificateSource = CertificateSourceCdn 3857 objectMap := make(map[string]interface{}) 3858 if mhp.CertificateSourceParameters != nil { 3859 objectMap["certificateSourceParameters"] = mhp.CertificateSourceParameters 3860 } 3861 if mhp.ProtocolType != "" { 3862 objectMap["protocolType"] = mhp.ProtocolType 3863 } 3864 if mhp.MinimumTLSVersion != "" { 3865 objectMap["minimumTlsVersion"] = mhp.MinimumTLSVersion 3866 } 3867 if mhp.CertificateSource != "" { 3868 objectMap["certificateSource"] = mhp.CertificateSource 3869 } 3870 return json.Marshal(objectMap) 3871} 3872 3873// AsManagedHTTPSParameters is the BasicCustomDomainHTTPSParameters implementation for ManagedHTTPSParameters. 3874func (mhp ManagedHTTPSParameters) AsManagedHTTPSParameters() (*ManagedHTTPSParameters, bool) { 3875 return &mhp, true 3876} 3877 3878// AsUserManagedHTTPSParameters is the BasicCustomDomainHTTPSParameters implementation for ManagedHTTPSParameters. 3879func (mhp ManagedHTTPSParameters) AsUserManagedHTTPSParameters() (*UserManagedHTTPSParameters, bool) { 3880 return nil, false 3881} 3882 3883// AsCustomDomainHTTPSParameters is the BasicCustomDomainHTTPSParameters implementation for ManagedHTTPSParameters. 3884func (mhp ManagedHTTPSParameters) AsCustomDomainHTTPSParameters() (*CustomDomainHTTPSParameters, bool) { 3885 return nil, false 3886} 3887 3888// AsBasicCustomDomainHTTPSParameters is the BasicCustomDomainHTTPSParameters implementation for ManagedHTTPSParameters. 3889func (mhp ManagedHTTPSParameters) AsBasicCustomDomainHTTPSParameters() (BasicCustomDomainHTTPSParameters, bool) { 3890 return &mhp, true 3891} 3892 3893// Operation CDN REST API operation 3894type Operation struct { 3895 // Name - READ-ONLY; Operation name: {provider}/{resource}/{operation} 3896 Name *string `json:"name,omitempty"` 3897 // Display - The object that represents the operation. 3898 Display *OperationDisplay `json:"display,omitempty"` 3899} 3900 3901// MarshalJSON is the custom marshaler for Operation. 3902func (o Operation) MarshalJSON() ([]byte, error) { 3903 objectMap := make(map[string]interface{}) 3904 if o.Display != nil { 3905 objectMap["display"] = o.Display 3906 } 3907 return json.Marshal(objectMap) 3908} 3909 3910// OperationDisplay the object that represents the operation. 3911type OperationDisplay struct { 3912 // Provider - READ-ONLY; Service provider: Microsoft.Cdn 3913 Provider *string `json:"provider,omitempty"` 3914 // Resource - READ-ONLY; Resource on which the operation is performed: Profile, endpoint, etc. 3915 Resource *string `json:"resource,omitempty"` 3916 // Operation - READ-ONLY; Operation type: Read, write, delete, etc. 3917 Operation *string `json:"operation,omitempty"` 3918} 3919 3920// MarshalJSON is the custom marshaler for OperationDisplay. 3921func (o OperationDisplay) MarshalJSON() ([]byte, error) { 3922 objectMap := make(map[string]interface{}) 3923 return json.Marshal(objectMap) 3924} 3925 3926// OperationsListResult result of the request to list CDN operations. It contains a list of operations and 3927// a URL link to get the next set of results. 3928type OperationsListResult struct { 3929 autorest.Response `json:"-"` 3930 // Value - READ-ONLY; List of CDN operations supported by the CDN resource provider. 3931 Value *[]Operation `json:"value,omitempty"` 3932 // NextLink - URL to get the next set of operation list results if there are any. 3933 NextLink *string `json:"nextLink,omitempty"` 3934} 3935 3936// MarshalJSON is the custom marshaler for OperationsListResult. 3937func (olr OperationsListResult) MarshalJSON() ([]byte, error) { 3938 objectMap := make(map[string]interface{}) 3939 if olr.NextLink != nil { 3940 objectMap["nextLink"] = olr.NextLink 3941 } 3942 return json.Marshal(objectMap) 3943} 3944 3945// OperationsListResultIterator provides access to a complete listing of Operation values. 3946type OperationsListResultIterator struct { 3947 i int 3948 page OperationsListResultPage 3949} 3950 3951// NextWithContext advances to the next value. If there was an error making 3952// the request the iterator does not advance and the error is returned. 3953func (iter *OperationsListResultIterator) NextWithContext(ctx context.Context) (err error) { 3954 if tracing.IsEnabled() { 3955 ctx = tracing.StartSpan(ctx, fqdn+"/OperationsListResultIterator.NextWithContext") 3956 defer func() { 3957 sc := -1 3958 if iter.Response().Response.Response != nil { 3959 sc = iter.Response().Response.Response.StatusCode 3960 } 3961 tracing.EndSpan(ctx, sc, err) 3962 }() 3963 } 3964 iter.i++ 3965 if iter.i < len(iter.page.Values()) { 3966 return nil 3967 } 3968 err = iter.page.NextWithContext(ctx) 3969 if err != nil { 3970 iter.i-- 3971 return err 3972 } 3973 iter.i = 0 3974 return nil 3975} 3976 3977// Next advances to the next value. If there was an error making 3978// the request the iterator does not advance and the error is returned. 3979// Deprecated: Use NextWithContext() instead. 3980func (iter *OperationsListResultIterator) Next() error { 3981 return iter.NextWithContext(context.Background()) 3982} 3983 3984// NotDone returns true if the enumeration should be started or is not yet complete. 3985func (iter OperationsListResultIterator) NotDone() bool { 3986 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 3987} 3988 3989// Response returns the raw server response from the last page request. 3990func (iter OperationsListResultIterator) Response() OperationsListResult { 3991 return iter.page.Response() 3992} 3993 3994// Value returns the current value or a zero-initialized value if the 3995// iterator has advanced beyond the end of the collection. 3996func (iter OperationsListResultIterator) Value() Operation { 3997 if !iter.page.NotDone() { 3998 return Operation{} 3999 } 4000 return iter.page.Values()[iter.i] 4001} 4002 4003// Creates a new instance of the OperationsListResultIterator type. 4004func NewOperationsListResultIterator(page OperationsListResultPage) OperationsListResultIterator { 4005 return OperationsListResultIterator{page: page} 4006} 4007 4008// IsEmpty returns true if the ListResult contains no values. 4009func (olr OperationsListResult) IsEmpty() bool { 4010 return olr.Value == nil || len(*olr.Value) == 0 4011} 4012 4013// hasNextLink returns true if the NextLink is not empty. 4014func (olr OperationsListResult) hasNextLink() bool { 4015 return olr.NextLink != nil && len(*olr.NextLink) != 0 4016} 4017 4018// operationsListResultPreparer prepares a request to retrieve the next set of results. 4019// It returns nil if no more results exist. 4020func (olr OperationsListResult) operationsListResultPreparer(ctx context.Context) (*http.Request, error) { 4021 if !olr.hasNextLink() { 4022 return nil, nil 4023 } 4024 return autorest.Prepare((&http.Request{}).WithContext(ctx), 4025 autorest.AsJSON(), 4026 autorest.AsGet(), 4027 autorest.WithBaseURL(to.String(olr.NextLink))) 4028} 4029 4030// OperationsListResultPage contains a page of Operation values. 4031type OperationsListResultPage struct { 4032 fn func(context.Context, OperationsListResult) (OperationsListResult, error) 4033 olr OperationsListResult 4034} 4035 4036// NextWithContext advances to the next page of values. If there was an error making 4037// the request the page does not advance and the error is returned. 4038func (page *OperationsListResultPage) NextWithContext(ctx context.Context) (err error) { 4039 if tracing.IsEnabled() { 4040 ctx = tracing.StartSpan(ctx, fqdn+"/OperationsListResultPage.NextWithContext") 4041 defer func() { 4042 sc := -1 4043 if page.Response().Response.Response != nil { 4044 sc = page.Response().Response.Response.StatusCode 4045 } 4046 tracing.EndSpan(ctx, sc, err) 4047 }() 4048 } 4049 for { 4050 next, err := page.fn(ctx, page.olr) 4051 if err != nil { 4052 return err 4053 } 4054 page.olr = next 4055 if !next.hasNextLink() || !next.IsEmpty() { 4056 break 4057 } 4058 } 4059 return nil 4060} 4061 4062// Next advances to the next page of values. If there was an error making 4063// the request the page does not advance and the error is returned. 4064// Deprecated: Use NextWithContext() instead. 4065func (page *OperationsListResultPage) Next() error { 4066 return page.NextWithContext(context.Background()) 4067} 4068 4069// NotDone returns true if the page enumeration should be started or is not yet complete. 4070func (page OperationsListResultPage) NotDone() bool { 4071 return !page.olr.IsEmpty() 4072} 4073 4074// Response returns the raw server response from the last page request. 4075func (page OperationsListResultPage) Response() OperationsListResult { 4076 return page.olr 4077} 4078 4079// Values returns the slice of values for the current page or nil if there are no values. 4080func (page OperationsListResultPage) Values() []Operation { 4081 if page.olr.IsEmpty() { 4082 return nil 4083 } 4084 return *page.olr.Value 4085} 4086 4087// Creates a new instance of the OperationsListResultPage type. 4088func NewOperationsListResultPage(cur OperationsListResult, getNextPage func(context.Context, OperationsListResult) (OperationsListResult, error)) OperationsListResultPage { 4089 return OperationsListResultPage{ 4090 fn: getNextPage, 4091 olr: cur, 4092 } 4093} 4094 4095// Origin CDN origin is the source of the content being delivered via CDN. When the edge nodes represented 4096// by an endpoint do not have the requested content cached, they attempt to fetch it from one or more of 4097// the configured origins. 4098type Origin struct { 4099 autorest.Response `json:"-"` 4100 *OriginProperties `json:"properties,omitempty"` 4101 // Location - Resource location. 4102 Location *string `json:"location,omitempty"` 4103 // Tags - Resource tags. 4104 Tags map[string]*string `json:"tags"` 4105 // ID - READ-ONLY; Resource ID. 4106 ID *string `json:"id,omitempty"` 4107 // Name - READ-ONLY; Resource name. 4108 Name *string `json:"name,omitempty"` 4109 // Type - READ-ONLY; Resource type. 4110 Type *string `json:"type,omitempty"` 4111} 4112 4113// MarshalJSON is the custom marshaler for Origin. 4114func (o Origin) MarshalJSON() ([]byte, error) { 4115 objectMap := make(map[string]interface{}) 4116 if o.OriginProperties != nil { 4117 objectMap["properties"] = o.OriginProperties 4118 } 4119 if o.Location != nil { 4120 objectMap["location"] = o.Location 4121 } 4122 if o.Tags != nil { 4123 objectMap["tags"] = o.Tags 4124 } 4125 return json.Marshal(objectMap) 4126} 4127 4128// UnmarshalJSON is the custom unmarshaler for Origin struct. 4129func (o *Origin) UnmarshalJSON(body []byte) error { 4130 var m map[string]*json.RawMessage 4131 err := json.Unmarshal(body, &m) 4132 if err != nil { 4133 return err 4134 } 4135 for k, v := range m { 4136 switch k { 4137 case "properties": 4138 if v != nil { 4139 var originProperties OriginProperties 4140 err = json.Unmarshal(*v, &originProperties) 4141 if err != nil { 4142 return err 4143 } 4144 o.OriginProperties = &originProperties 4145 } 4146 case "location": 4147 if v != nil { 4148 var location string 4149 err = json.Unmarshal(*v, &location) 4150 if err != nil { 4151 return err 4152 } 4153 o.Location = &location 4154 } 4155 case "tags": 4156 if v != nil { 4157 var tags map[string]*string 4158 err = json.Unmarshal(*v, &tags) 4159 if err != nil { 4160 return err 4161 } 4162 o.Tags = tags 4163 } 4164 case "id": 4165 if v != nil { 4166 var ID string 4167 err = json.Unmarshal(*v, &ID) 4168 if err != nil { 4169 return err 4170 } 4171 o.ID = &ID 4172 } 4173 case "name": 4174 if v != nil { 4175 var name string 4176 err = json.Unmarshal(*v, &name) 4177 if err != nil { 4178 return err 4179 } 4180 o.Name = &name 4181 } 4182 case "type": 4183 if v != nil { 4184 var typeVar string 4185 err = json.Unmarshal(*v, &typeVar) 4186 if err != nil { 4187 return err 4188 } 4189 o.Type = &typeVar 4190 } 4191 } 4192 } 4193 4194 return nil 4195} 4196 4197// OriginListResult result of the request to list origins. It contains a list of origin objects and a URL 4198// link to get the next set of results. 4199type OriginListResult struct { 4200 autorest.Response `json:"-"` 4201 // Value - READ-ONLY; List of CDN origins within an endpoint 4202 Value *[]Origin `json:"value,omitempty"` 4203 // NextLink - URL to get the next set of origin objects if there are any. 4204 NextLink *string `json:"nextLink,omitempty"` 4205} 4206 4207// MarshalJSON is the custom marshaler for OriginListResult. 4208func (olr OriginListResult) MarshalJSON() ([]byte, error) { 4209 objectMap := make(map[string]interface{}) 4210 if olr.NextLink != nil { 4211 objectMap["nextLink"] = olr.NextLink 4212 } 4213 return json.Marshal(objectMap) 4214} 4215 4216// OriginListResultIterator provides access to a complete listing of Origin values. 4217type OriginListResultIterator struct { 4218 i int 4219 page OriginListResultPage 4220} 4221 4222// NextWithContext advances to the next value. If there was an error making 4223// the request the iterator does not advance and the error is returned. 4224func (iter *OriginListResultIterator) NextWithContext(ctx context.Context) (err error) { 4225 if tracing.IsEnabled() { 4226 ctx = tracing.StartSpan(ctx, fqdn+"/OriginListResultIterator.NextWithContext") 4227 defer func() { 4228 sc := -1 4229 if iter.Response().Response.Response != nil { 4230 sc = iter.Response().Response.Response.StatusCode 4231 } 4232 tracing.EndSpan(ctx, sc, err) 4233 }() 4234 } 4235 iter.i++ 4236 if iter.i < len(iter.page.Values()) { 4237 return nil 4238 } 4239 err = iter.page.NextWithContext(ctx) 4240 if err != nil { 4241 iter.i-- 4242 return err 4243 } 4244 iter.i = 0 4245 return nil 4246} 4247 4248// Next advances to the next value. If there was an error making 4249// the request the iterator does not advance and the error is returned. 4250// Deprecated: Use NextWithContext() instead. 4251func (iter *OriginListResultIterator) Next() error { 4252 return iter.NextWithContext(context.Background()) 4253} 4254 4255// NotDone returns true if the enumeration should be started or is not yet complete. 4256func (iter OriginListResultIterator) NotDone() bool { 4257 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 4258} 4259 4260// Response returns the raw server response from the last page request. 4261func (iter OriginListResultIterator) Response() OriginListResult { 4262 return iter.page.Response() 4263} 4264 4265// Value returns the current value or a zero-initialized value if the 4266// iterator has advanced beyond the end of the collection. 4267func (iter OriginListResultIterator) Value() Origin { 4268 if !iter.page.NotDone() { 4269 return Origin{} 4270 } 4271 return iter.page.Values()[iter.i] 4272} 4273 4274// Creates a new instance of the OriginListResultIterator type. 4275func NewOriginListResultIterator(page OriginListResultPage) OriginListResultIterator { 4276 return OriginListResultIterator{page: page} 4277} 4278 4279// IsEmpty returns true if the ListResult contains no values. 4280func (olr OriginListResult) IsEmpty() bool { 4281 return olr.Value == nil || len(*olr.Value) == 0 4282} 4283 4284// hasNextLink returns true if the NextLink is not empty. 4285func (olr OriginListResult) hasNextLink() bool { 4286 return olr.NextLink != nil && len(*olr.NextLink) != 0 4287} 4288 4289// originListResultPreparer prepares a request to retrieve the next set of results. 4290// It returns nil if no more results exist. 4291func (olr OriginListResult) originListResultPreparer(ctx context.Context) (*http.Request, error) { 4292 if !olr.hasNextLink() { 4293 return nil, nil 4294 } 4295 return autorest.Prepare((&http.Request{}).WithContext(ctx), 4296 autorest.AsJSON(), 4297 autorest.AsGet(), 4298 autorest.WithBaseURL(to.String(olr.NextLink))) 4299} 4300 4301// OriginListResultPage contains a page of Origin values. 4302type OriginListResultPage struct { 4303 fn func(context.Context, OriginListResult) (OriginListResult, error) 4304 olr OriginListResult 4305} 4306 4307// NextWithContext advances to the next page of values. If there was an error making 4308// the request the page does not advance and the error is returned. 4309func (page *OriginListResultPage) NextWithContext(ctx context.Context) (err error) { 4310 if tracing.IsEnabled() { 4311 ctx = tracing.StartSpan(ctx, fqdn+"/OriginListResultPage.NextWithContext") 4312 defer func() { 4313 sc := -1 4314 if page.Response().Response.Response != nil { 4315 sc = page.Response().Response.Response.StatusCode 4316 } 4317 tracing.EndSpan(ctx, sc, err) 4318 }() 4319 } 4320 for { 4321 next, err := page.fn(ctx, page.olr) 4322 if err != nil { 4323 return err 4324 } 4325 page.olr = next 4326 if !next.hasNextLink() || !next.IsEmpty() { 4327 break 4328 } 4329 } 4330 return nil 4331} 4332 4333// Next advances to the next page of values. If there was an error making 4334// the request the page does not advance and the error is returned. 4335// Deprecated: Use NextWithContext() instead. 4336func (page *OriginListResultPage) Next() error { 4337 return page.NextWithContext(context.Background()) 4338} 4339 4340// NotDone returns true if the page enumeration should be started or is not yet complete. 4341func (page OriginListResultPage) NotDone() bool { 4342 return !page.olr.IsEmpty() 4343} 4344 4345// Response returns the raw server response from the last page request. 4346func (page OriginListResultPage) Response() OriginListResult { 4347 return page.olr 4348} 4349 4350// Values returns the slice of values for the current page or nil if there are no values. 4351func (page OriginListResultPage) Values() []Origin { 4352 if page.olr.IsEmpty() { 4353 return nil 4354 } 4355 return *page.olr.Value 4356} 4357 4358// Creates a new instance of the OriginListResultPage type. 4359func NewOriginListResultPage(cur OriginListResult, getNextPage func(context.Context, OriginListResult) (OriginListResult, error)) OriginListResultPage { 4360 return OriginListResultPage{ 4361 fn: getNextPage, 4362 olr: cur, 4363 } 4364} 4365 4366// OriginProperties the JSON object that contains the properties of the origin. 4367type OriginProperties struct { 4368 // HostName - The address of the origin. Domain names, IPv4 addresses, and IPv6 addresses are supported. 4369 HostName *string `json:"hostName,omitempty"` 4370 // HTTPPort - The value of the HTTP port. Must be between 1 and 65535. 4371 HTTPPort *int32 `json:"httpPort,omitempty"` 4372 // HTTPSPort - The value of the https port. Must be between 1 and 65535. 4373 HTTPSPort *int32 `json:"httpsPort,omitempty"` 4374 // ResourceState - READ-ONLY; Resource status of the origin. Possible values include: 'OriginResourceStateCreating', 'OriginResourceStateActive', 'OriginResourceStateDeleting' 4375 ResourceState OriginResourceState `json:"resourceState,omitempty"` 4376 // ProvisioningState - READ-ONLY; Provisioning status of the origin. 4377 ProvisioningState *string `json:"provisioningState,omitempty"` 4378} 4379 4380// MarshalJSON is the custom marshaler for OriginProperties. 4381func (op OriginProperties) MarshalJSON() ([]byte, error) { 4382 objectMap := make(map[string]interface{}) 4383 if op.HostName != nil { 4384 objectMap["hostName"] = op.HostName 4385 } 4386 if op.HTTPPort != nil { 4387 objectMap["httpPort"] = op.HTTPPort 4388 } 4389 if op.HTTPSPort != nil { 4390 objectMap["httpsPort"] = op.HTTPSPort 4391 } 4392 return json.Marshal(objectMap) 4393} 4394 4395// OriginPropertiesParameters the JSON object that contains the properties of the origin. 4396type OriginPropertiesParameters struct { 4397 // HostName - The address of the origin. Domain names, IPv4 addresses, and IPv6 addresses are supported. 4398 HostName *string `json:"hostName,omitempty"` 4399 // HTTPPort - The value of the HTTP port. Must be between 1 and 65535. 4400 HTTPPort *int32 `json:"httpPort,omitempty"` 4401 // HTTPSPort - The value of the HTTPS port. Must be between 1 and 65535. 4402 HTTPSPort *int32 `json:"httpsPort,omitempty"` 4403} 4404 4405// OriginsUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 4406// operation. 4407type OriginsUpdateFuture struct { 4408 azure.FutureAPI 4409 // Result returns the result of the asynchronous operation. 4410 // If the operation has not completed it will return an error. 4411 Result func(OriginsClient) (Origin, error) 4412} 4413 4414// UnmarshalJSON is the custom unmarshaller for CreateFuture. 4415func (future *OriginsUpdateFuture) UnmarshalJSON(body []byte) error { 4416 var azFuture azure.Future 4417 if err := json.Unmarshal(body, &azFuture); err != nil { 4418 return err 4419 } 4420 future.FutureAPI = &azFuture 4421 future.Result = future.result 4422 return nil 4423} 4424 4425// result is the default implementation for OriginsUpdateFuture.Result. 4426func (future *OriginsUpdateFuture) result(client OriginsClient) (o Origin, err error) { 4427 var done bool 4428 done, err = future.DoneWithContext(context.Background(), client) 4429 if err != nil { 4430 err = autorest.NewErrorWithError(err, "cdn.OriginsUpdateFuture", "Result", future.Response(), "Polling failure") 4431 return 4432 } 4433 if !done { 4434 o.Response.Response = future.Response() 4435 err = azure.NewAsyncOpIncompleteError("cdn.OriginsUpdateFuture") 4436 return 4437 } 4438 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 4439 if o.Response.Response, err = future.GetResult(sender); err == nil && o.Response.Response.StatusCode != http.StatusNoContent { 4440 o, err = client.UpdateResponder(o.Response.Response) 4441 if err != nil { 4442 err = autorest.NewErrorWithError(err, "cdn.OriginsUpdateFuture", "Result", o.Response.Response, "Failure responding to request") 4443 } 4444 } 4445 return 4446} 4447 4448// OriginUpdateParameters origin properties needed for origin creation or update. 4449type OriginUpdateParameters struct { 4450 *OriginPropertiesParameters `json:"properties,omitempty"` 4451} 4452 4453// MarshalJSON is the custom marshaler for OriginUpdateParameters. 4454func (oup OriginUpdateParameters) MarshalJSON() ([]byte, error) { 4455 objectMap := make(map[string]interface{}) 4456 if oup.OriginPropertiesParameters != nil { 4457 objectMap["properties"] = oup.OriginPropertiesParameters 4458 } 4459 return json.Marshal(objectMap) 4460} 4461 4462// UnmarshalJSON is the custom unmarshaler for OriginUpdateParameters struct. 4463func (oup *OriginUpdateParameters) UnmarshalJSON(body []byte) error { 4464 var m map[string]*json.RawMessage 4465 err := json.Unmarshal(body, &m) 4466 if err != nil { 4467 return err 4468 } 4469 for k, v := range m { 4470 switch k { 4471 case "properties": 4472 if v != nil { 4473 var originPropertiesParameters OriginPropertiesParameters 4474 err = json.Unmarshal(*v, &originPropertiesParameters) 4475 if err != nil { 4476 return err 4477 } 4478 oup.OriginPropertiesParameters = &originPropertiesParameters 4479 } 4480 } 4481 } 4482 4483 return nil 4484} 4485 4486// PostArgsMatchConditionParameters defines the parameters for PostArgs match conditions 4487type PostArgsMatchConditionParameters struct { 4488 OdataType *string `json:"@odata.type,omitempty"` 4489 // Selector - Name of PostArg to be matched 4490 Selector *string `json:"selector,omitempty"` 4491 // Operator - Describes operator to be matched. Possible values include: 'PostArgsOperatorAny', 'PostArgsOperatorEqual', 'PostArgsOperatorContains', 'PostArgsOperatorBeginsWith', 'PostArgsOperatorEndsWith', 'PostArgsOperatorLessThan', 'PostArgsOperatorLessThanOrEqual', 'PostArgsOperatorGreaterThan', 'PostArgsOperatorGreaterThanOrEqual' 4492 Operator PostArgsOperator `json:"operator,omitempty"` 4493 // NegateCondition - Describes if this is negate condition or not 4494 NegateCondition *bool `json:"negateCondition,omitempty"` 4495 // MatchValues - The match value for the condition of the delivery rule 4496 MatchValues *[]string `json:"matchValues,omitempty"` 4497 // Transforms - List of transforms 4498 Transforms *[]Transform `json:"transforms,omitempty"` 4499} 4500 4501// Profile CDN profile is a logical grouping of endpoints that share the same settings, such as CDN 4502// provider and pricing tier. 4503type Profile struct { 4504 autorest.Response `json:"-"` 4505 // Sku - The pricing tier (defines a CDN provider, feature list and rate) of the CDN profile. 4506 Sku *Sku `json:"sku,omitempty"` 4507 *ProfileProperties `json:"properties,omitempty"` 4508 // Location - Resource location. 4509 Location *string `json:"location,omitempty"` 4510 // Tags - Resource tags. 4511 Tags map[string]*string `json:"tags"` 4512 // ID - READ-ONLY; Resource ID. 4513 ID *string `json:"id,omitempty"` 4514 // Name - READ-ONLY; Resource name. 4515 Name *string `json:"name,omitempty"` 4516 // Type - READ-ONLY; Resource type. 4517 Type *string `json:"type,omitempty"` 4518} 4519 4520// MarshalJSON is the custom marshaler for Profile. 4521func (p Profile) MarshalJSON() ([]byte, error) { 4522 objectMap := make(map[string]interface{}) 4523 if p.Sku != nil { 4524 objectMap["sku"] = p.Sku 4525 } 4526 if p.ProfileProperties != nil { 4527 objectMap["properties"] = p.ProfileProperties 4528 } 4529 if p.Location != nil { 4530 objectMap["location"] = p.Location 4531 } 4532 if p.Tags != nil { 4533 objectMap["tags"] = p.Tags 4534 } 4535 return json.Marshal(objectMap) 4536} 4537 4538// UnmarshalJSON is the custom unmarshaler for Profile struct. 4539func (p *Profile) UnmarshalJSON(body []byte) error { 4540 var m map[string]*json.RawMessage 4541 err := json.Unmarshal(body, &m) 4542 if err != nil { 4543 return err 4544 } 4545 for k, v := range m { 4546 switch k { 4547 case "sku": 4548 if v != nil { 4549 var sku Sku 4550 err = json.Unmarshal(*v, &sku) 4551 if err != nil { 4552 return err 4553 } 4554 p.Sku = &sku 4555 } 4556 case "properties": 4557 if v != nil { 4558 var profileProperties ProfileProperties 4559 err = json.Unmarshal(*v, &profileProperties) 4560 if err != nil { 4561 return err 4562 } 4563 p.ProfileProperties = &profileProperties 4564 } 4565 case "location": 4566 if v != nil { 4567 var location string 4568 err = json.Unmarshal(*v, &location) 4569 if err != nil { 4570 return err 4571 } 4572 p.Location = &location 4573 } 4574 case "tags": 4575 if v != nil { 4576 var tags map[string]*string 4577 err = json.Unmarshal(*v, &tags) 4578 if err != nil { 4579 return err 4580 } 4581 p.Tags = tags 4582 } 4583 case "id": 4584 if v != nil { 4585 var ID string 4586 err = json.Unmarshal(*v, &ID) 4587 if err != nil { 4588 return err 4589 } 4590 p.ID = &ID 4591 } 4592 case "name": 4593 if v != nil { 4594 var name string 4595 err = json.Unmarshal(*v, &name) 4596 if err != nil { 4597 return err 4598 } 4599 p.Name = &name 4600 } 4601 case "type": 4602 if v != nil { 4603 var typeVar string 4604 err = json.Unmarshal(*v, &typeVar) 4605 if err != nil { 4606 return err 4607 } 4608 p.Type = &typeVar 4609 } 4610 } 4611 } 4612 4613 return nil 4614} 4615 4616// ProfileListResult result of the request to list profiles. It contains a list of profile objects and a 4617// URL link to get the next set of results. 4618type ProfileListResult struct { 4619 autorest.Response `json:"-"` 4620 // Value - READ-ONLY; List of CDN profiles within a resource group. 4621 Value *[]Profile `json:"value,omitempty"` 4622 // NextLink - URL to get the next set of profile objects if there are any. 4623 NextLink *string `json:"nextLink,omitempty"` 4624} 4625 4626// MarshalJSON is the custom marshaler for ProfileListResult. 4627func (plr ProfileListResult) MarshalJSON() ([]byte, error) { 4628 objectMap := make(map[string]interface{}) 4629 if plr.NextLink != nil { 4630 objectMap["nextLink"] = plr.NextLink 4631 } 4632 return json.Marshal(objectMap) 4633} 4634 4635// ProfileListResultIterator provides access to a complete listing of Profile values. 4636type ProfileListResultIterator struct { 4637 i int 4638 page ProfileListResultPage 4639} 4640 4641// NextWithContext advances to the next value. If there was an error making 4642// the request the iterator does not advance and the error is returned. 4643func (iter *ProfileListResultIterator) NextWithContext(ctx context.Context) (err error) { 4644 if tracing.IsEnabled() { 4645 ctx = tracing.StartSpan(ctx, fqdn+"/ProfileListResultIterator.NextWithContext") 4646 defer func() { 4647 sc := -1 4648 if iter.Response().Response.Response != nil { 4649 sc = iter.Response().Response.Response.StatusCode 4650 } 4651 tracing.EndSpan(ctx, sc, err) 4652 }() 4653 } 4654 iter.i++ 4655 if iter.i < len(iter.page.Values()) { 4656 return nil 4657 } 4658 err = iter.page.NextWithContext(ctx) 4659 if err != nil { 4660 iter.i-- 4661 return err 4662 } 4663 iter.i = 0 4664 return nil 4665} 4666 4667// Next advances to the next value. If there was an error making 4668// the request the iterator does not advance and the error is returned. 4669// Deprecated: Use NextWithContext() instead. 4670func (iter *ProfileListResultIterator) Next() error { 4671 return iter.NextWithContext(context.Background()) 4672} 4673 4674// NotDone returns true if the enumeration should be started or is not yet complete. 4675func (iter ProfileListResultIterator) NotDone() bool { 4676 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 4677} 4678 4679// Response returns the raw server response from the last page request. 4680func (iter ProfileListResultIterator) Response() ProfileListResult { 4681 return iter.page.Response() 4682} 4683 4684// Value returns the current value or a zero-initialized value if the 4685// iterator has advanced beyond the end of the collection. 4686func (iter ProfileListResultIterator) Value() Profile { 4687 if !iter.page.NotDone() { 4688 return Profile{} 4689 } 4690 return iter.page.Values()[iter.i] 4691} 4692 4693// Creates a new instance of the ProfileListResultIterator type. 4694func NewProfileListResultIterator(page ProfileListResultPage) ProfileListResultIterator { 4695 return ProfileListResultIterator{page: page} 4696} 4697 4698// IsEmpty returns true if the ListResult contains no values. 4699func (plr ProfileListResult) IsEmpty() bool { 4700 return plr.Value == nil || len(*plr.Value) == 0 4701} 4702 4703// hasNextLink returns true if the NextLink is not empty. 4704func (plr ProfileListResult) hasNextLink() bool { 4705 return plr.NextLink != nil && len(*plr.NextLink) != 0 4706} 4707 4708// profileListResultPreparer prepares a request to retrieve the next set of results. 4709// It returns nil if no more results exist. 4710func (plr ProfileListResult) profileListResultPreparer(ctx context.Context) (*http.Request, error) { 4711 if !plr.hasNextLink() { 4712 return nil, nil 4713 } 4714 return autorest.Prepare((&http.Request{}).WithContext(ctx), 4715 autorest.AsJSON(), 4716 autorest.AsGet(), 4717 autorest.WithBaseURL(to.String(plr.NextLink))) 4718} 4719 4720// ProfileListResultPage contains a page of Profile values. 4721type ProfileListResultPage struct { 4722 fn func(context.Context, ProfileListResult) (ProfileListResult, error) 4723 plr ProfileListResult 4724} 4725 4726// NextWithContext advances to the next page of values. If there was an error making 4727// the request the page does not advance and the error is returned. 4728func (page *ProfileListResultPage) NextWithContext(ctx context.Context) (err error) { 4729 if tracing.IsEnabled() { 4730 ctx = tracing.StartSpan(ctx, fqdn+"/ProfileListResultPage.NextWithContext") 4731 defer func() { 4732 sc := -1 4733 if page.Response().Response.Response != nil { 4734 sc = page.Response().Response.Response.StatusCode 4735 } 4736 tracing.EndSpan(ctx, sc, err) 4737 }() 4738 } 4739 for { 4740 next, err := page.fn(ctx, page.plr) 4741 if err != nil { 4742 return err 4743 } 4744 page.plr = next 4745 if !next.hasNextLink() || !next.IsEmpty() { 4746 break 4747 } 4748 } 4749 return nil 4750} 4751 4752// Next advances to the next page of values. If there was an error making 4753// the request the page does not advance and the error is returned. 4754// Deprecated: Use NextWithContext() instead. 4755func (page *ProfileListResultPage) Next() error { 4756 return page.NextWithContext(context.Background()) 4757} 4758 4759// NotDone returns true if the page enumeration should be started or is not yet complete. 4760func (page ProfileListResultPage) NotDone() bool { 4761 return !page.plr.IsEmpty() 4762} 4763 4764// Response returns the raw server response from the last page request. 4765func (page ProfileListResultPage) Response() ProfileListResult { 4766 return page.plr 4767} 4768 4769// Values returns the slice of values for the current page or nil if there are no values. 4770func (page ProfileListResultPage) Values() []Profile { 4771 if page.plr.IsEmpty() { 4772 return nil 4773 } 4774 return *page.plr.Value 4775} 4776 4777// Creates a new instance of the ProfileListResultPage type. 4778func NewProfileListResultPage(cur ProfileListResult, getNextPage func(context.Context, ProfileListResult) (ProfileListResult, error)) ProfileListResultPage { 4779 return ProfileListResultPage{ 4780 fn: getNextPage, 4781 plr: cur, 4782 } 4783} 4784 4785// ProfileProperties the JSON object that contains the properties required to create a profile. 4786type ProfileProperties struct { 4787 // ResourceState - READ-ONLY; Resource status of the profile. Possible values include: 'ProfileResourceStateCreating', 'ProfileResourceStateActive', 'ProfileResourceStateDeleting', 'ProfileResourceStateDisabled' 4788 ResourceState ProfileResourceState `json:"resourceState,omitempty"` 4789 // ProvisioningState - READ-ONLY; Provisioning status of the profile. 4790 ProvisioningState *string `json:"provisioningState,omitempty"` 4791} 4792 4793// MarshalJSON is the custom marshaler for ProfileProperties. 4794func (pp ProfileProperties) MarshalJSON() ([]byte, error) { 4795 objectMap := make(map[string]interface{}) 4796 return json.Marshal(objectMap) 4797} 4798 4799// ProfilesCreateFuture an abstraction for monitoring and retrieving the results of a long-running 4800// operation. 4801type ProfilesCreateFuture struct { 4802 azure.FutureAPI 4803 // Result returns the result of the asynchronous operation. 4804 // If the operation has not completed it will return an error. 4805 Result func(ProfilesClient) (Profile, error) 4806} 4807 4808// UnmarshalJSON is the custom unmarshaller for CreateFuture. 4809func (future *ProfilesCreateFuture) UnmarshalJSON(body []byte) error { 4810 var azFuture azure.Future 4811 if err := json.Unmarshal(body, &azFuture); err != nil { 4812 return err 4813 } 4814 future.FutureAPI = &azFuture 4815 future.Result = future.result 4816 return nil 4817} 4818 4819// result is the default implementation for ProfilesCreateFuture.Result. 4820func (future *ProfilesCreateFuture) result(client ProfilesClient) (p Profile, err error) { 4821 var done bool 4822 done, err = future.DoneWithContext(context.Background(), client) 4823 if err != nil { 4824 err = autorest.NewErrorWithError(err, "cdn.ProfilesCreateFuture", "Result", future.Response(), "Polling failure") 4825 return 4826 } 4827 if !done { 4828 p.Response.Response = future.Response() 4829 err = azure.NewAsyncOpIncompleteError("cdn.ProfilesCreateFuture") 4830 return 4831 } 4832 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 4833 if p.Response.Response, err = future.GetResult(sender); err == nil && p.Response.Response.StatusCode != http.StatusNoContent { 4834 p, err = client.CreateResponder(p.Response.Response) 4835 if err != nil { 4836 err = autorest.NewErrorWithError(err, "cdn.ProfilesCreateFuture", "Result", p.Response.Response, "Failure responding to request") 4837 } 4838 } 4839 return 4840} 4841 4842// ProfilesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running 4843// operation. 4844type ProfilesDeleteFuture struct { 4845 azure.FutureAPI 4846 // Result returns the result of the asynchronous operation. 4847 // If the operation has not completed it will return an error. 4848 Result func(ProfilesClient) (autorest.Response, error) 4849} 4850 4851// UnmarshalJSON is the custom unmarshaller for CreateFuture. 4852func (future *ProfilesDeleteFuture) UnmarshalJSON(body []byte) error { 4853 var azFuture azure.Future 4854 if err := json.Unmarshal(body, &azFuture); err != nil { 4855 return err 4856 } 4857 future.FutureAPI = &azFuture 4858 future.Result = future.result 4859 return nil 4860} 4861 4862// result is the default implementation for ProfilesDeleteFuture.Result. 4863func (future *ProfilesDeleteFuture) result(client ProfilesClient) (ar autorest.Response, err error) { 4864 var done bool 4865 done, err = future.DoneWithContext(context.Background(), client) 4866 if err != nil { 4867 err = autorest.NewErrorWithError(err, "cdn.ProfilesDeleteFuture", "Result", future.Response(), "Polling failure") 4868 return 4869 } 4870 if !done { 4871 ar.Response = future.Response() 4872 err = azure.NewAsyncOpIncompleteError("cdn.ProfilesDeleteFuture") 4873 return 4874 } 4875 ar.Response = future.Response() 4876 return 4877} 4878 4879// ProfilesUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 4880// operation. 4881type ProfilesUpdateFuture struct { 4882 azure.FutureAPI 4883 // Result returns the result of the asynchronous operation. 4884 // If the operation has not completed it will return an error. 4885 Result func(ProfilesClient) (Profile, error) 4886} 4887 4888// UnmarshalJSON is the custom unmarshaller for CreateFuture. 4889func (future *ProfilesUpdateFuture) UnmarshalJSON(body []byte) error { 4890 var azFuture azure.Future 4891 if err := json.Unmarshal(body, &azFuture); err != nil { 4892 return err 4893 } 4894 future.FutureAPI = &azFuture 4895 future.Result = future.result 4896 return nil 4897} 4898 4899// result is the default implementation for ProfilesUpdateFuture.Result. 4900func (future *ProfilesUpdateFuture) result(client ProfilesClient) (p Profile, err error) { 4901 var done bool 4902 done, err = future.DoneWithContext(context.Background(), client) 4903 if err != nil { 4904 err = autorest.NewErrorWithError(err, "cdn.ProfilesUpdateFuture", "Result", future.Response(), "Polling failure") 4905 return 4906 } 4907 if !done { 4908 p.Response.Response = future.Response() 4909 err = azure.NewAsyncOpIncompleteError("cdn.ProfilesUpdateFuture") 4910 return 4911 } 4912 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 4913 if p.Response.Response, err = future.GetResult(sender); err == nil && p.Response.Response.StatusCode != http.StatusNoContent { 4914 p, err = client.UpdateResponder(p.Response.Response) 4915 if err != nil { 4916 err = autorest.NewErrorWithError(err, "cdn.ProfilesUpdateFuture", "Result", p.Response.Response, "Failure responding to request") 4917 } 4918 } 4919 return 4920} 4921 4922// ProfileUpdateParameters properties required to update a profile. 4923type ProfileUpdateParameters struct { 4924 // Tags - Profile tags 4925 Tags map[string]*string `json:"tags"` 4926} 4927 4928// MarshalJSON is the custom marshaler for ProfileUpdateParameters. 4929func (pup ProfileUpdateParameters) MarshalJSON() ([]byte, error) { 4930 objectMap := make(map[string]interface{}) 4931 if pup.Tags != nil { 4932 objectMap["tags"] = pup.Tags 4933 } 4934 return json.Marshal(objectMap) 4935} 4936 4937// ProxyResource the resource model definition for a ARM proxy resource. It will have everything other than 4938// required location and tags 4939type ProxyResource struct { 4940 // ID - READ-ONLY; Resource ID. 4941 ID *string `json:"id,omitempty"` 4942 // Name - READ-ONLY; Resource name. 4943 Name *string `json:"name,omitempty"` 4944 // Type - READ-ONLY; Resource type. 4945 Type *string `json:"type,omitempty"` 4946} 4947 4948// MarshalJSON is the custom marshaler for ProxyResource. 4949func (pr ProxyResource) MarshalJSON() ([]byte, error) { 4950 objectMap := make(map[string]interface{}) 4951 return json.Marshal(objectMap) 4952} 4953 4954// PurgeParameters parameters required for content purge. 4955type PurgeParameters struct { 4956 // ContentPaths - The path to the content to be purged. Can describe a file path or a wild card directory. 4957 ContentPaths *[]string `json:"contentPaths,omitempty"` 4958} 4959 4960// QueryStringMatchConditionParameters defines the parameters for QueryString match conditions 4961type QueryStringMatchConditionParameters struct { 4962 OdataType *string `json:"@odata.type,omitempty"` 4963 // Operator - Describes operator to be matched. Possible values include: 'QueryStringOperatorAny', 'QueryStringOperatorEqual', 'QueryStringOperatorContains', 'QueryStringOperatorBeginsWith', 'QueryStringOperatorEndsWith', 'QueryStringOperatorLessThan', 'QueryStringOperatorLessThanOrEqual', 'QueryStringOperatorGreaterThan', 'QueryStringOperatorGreaterThanOrEqual' 4964 Operator QueryStringOperator `json:"operator,omitempty"` 4965 // NegateCondition - Describes if this is negate condition or not 4966 NegateCondition *bool `json:"negateCondition,omitempty"` 4967 // MatchValues - The match value for the condition of the delivery rule 4968 MatchValues *[]string `json:"matchValues,omitempty"` 4969 // Transforms - List of transforms 4970 Transforms *[]Transform `json:"transforms,omitempty"` 4971} 4972 4973// RemoteAddressMatchConditionParameters defines the parameters for RemoteAddress match conditions 4974type RemoteAddressMatchConditionParameters struct { 4975 OdataType *string `json:"@odata.type,omitempty"` 4976 // Operator - Describes operator to be matched. Possible values include: 'RemoteAddressOperatorAny', 'RemoteAddressOperatorIPMatch', 'RemoteAddressOperatorGeoMatch' 4977 Operator RemoteAddressOperator `json:"operator,omitempty"` 4978 // NegateCondition - Describes if this is negate condition or not 4979 NegateCondition *bool `json:"negateCondition,omitempty"` 4980 // 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. 4981 MatchValues *[]string `json:"matchValues,omitempty"` 4982 // Transforms - List of transforms 4983 Transforms *[]Transform `json:"transforms,omitempty"` 4984} 4985 4986// RequestBodyMatchConditionParameters defines the parameters for RequestBody match conditions 4987type RequestBodyMatchConditionParameters struct { 4988 OdataType *string `json:"@odata.type,omitempty"` 4989 // Operator - Describes operator to be matched. Possible values include: 'RequestBodyOperatorAny', 'RequestBodyOperatorEqual', 'RequestBodyOperatorContains', 'RequestBodyOperatorBeginsWith', 'RequestBodyOperatorEndsWith', 'RequestBodyOperatorLessThan', 'RequestBodyOperatorLessThanOrEqual', 'RequestBodyOperatorGreaterThan', 'RequestBodyOperatorGreaterThanOrEqual' 4990 Operator RequestBodyOperator `json:"operator,omitempty"` 4991 // NegateCondition - Describes if this is negate condition or not 4992 NegateCondition *bool `json:"negateCondition,omitempty"` 4993 // MatchValues - The match value for the condition of the delivery rule 4994 MatchValues *[]string `json:"matchValues,omitempty"` 4995 // Transforms - List of transforms 4996 Transforms *[]Transform `json:"transforms,omitempty"` 4997} 4998 4999// RequestHeaderMatchConditionParameters defines the parameters for RequestHeader match conditions 5000type RequestHeaderMatchConditionParameters struct { 5001 OdataType *string `json:"@odata.type,omitempty"` 5002 // Selector - Name of Header to be matched 5003 Selector *string `json:"selector,omitempty"` 5004 // Operator - Describes operator to be matched. Possible values include: 'RequestHeaderOperatorAny', 'RequestHeaderOperatorEqual', 'RequestHeaderOperatorContains', 'RequestHeaderOperatorBeginsWith', 'RequestHeaderOperatorEndsWith', 'RequestHeaderOperatorLessThan', 'RequestHeaderOperatorLessThanOrEqual', 'RequestHeaderOperatorGreaterThan', 'RequestHeaderOperatorGreaterThanOrEqual' 5005 Operator RequestHeaderOperator `json:"operator,omitempty"` 5006 // NegateCondition - Describes if this is negate condition or not 5007 NegateCondition *bool `json:"negateCondition,omitempty"` 5008 // MatchValues - The match value for the condition of the delivery rule 5009 MatchValues *[]string `json:"matchValues,omitempty"` 5010 // Transforms - List of transforms 5011 Transforms *[]Transform `json:"transforms,omitempty"` 5012} 5013 5014// RequestMethodMatchConditionParameters defines the parameters for RequestMethod match conditions 5015type RequestMethodMatchConditionParameters struct { 5016 OdataType *string `json:"@odata.type,omitempty"` 5017 // Operator - Describes operator to be matched 5018 Operator *string `json:"operator,omitempty"` 5019 // NegateCondition - Describes if this is negate condition or not 5020 NegateCondition *bool `json:"negateCondition,omitempty"` 5021 // MatchValues - The match value for the condition of the delivery rule 5022 MatchValues *[]string `json:"matchValues,omitempty"` 5023} 5024 5025// RequestSchemeMatchConditionParameters defines the parameters for RequestScheme match conditions 5026type RequestSchemeMatchConditionParameters struct { 5027 OdataType *string `json:"@odata.type,omitempty"` 5028 // Operator - Describes operator to be matched 5029 Operator *string `json:"operator,omitempty"` 5030 // NegateCondition - Describes if this is negate condition or not 5031 NegateCondition *bool `json:"negateCondition,omitempty"` 5032 // MatchValues - The match value for the condition of the delivery rule 5033 MatchValues *[]string `json:"matchValues,omitempty"` 5034} 5035 5036// RequestURIMatchConditionParameters defines the parameters for RequestUri match conditions 5037type RequestURIMatchConditionParameters struct { 5038 OdataType *string `json:"@odata.type,omitempty"` 5039 // Operator - Describes operator to be matched. Possible values include: 'RequestURIOperatorAny', 'RequestURIOperatorEqual', 'RequestURIOperatorContains', 'RequestURIOperatorBeginsWith', 'RequestURIOperatorEndsWith', 'RequestURIOperatorLessThan', 'RequestURIOperatorLessThanOrEqual', 'RequestURIOperatorGreaterThan', 'RequestURIOperatorGreaterThanOrEqual' 5040 Operator RequestURIOperator `json:"operator,omitempty"` 5041 // NegateCondition - Describes if this is negate condition or not 5042 NegateCondition *bool `json:"negateCondition,omitempty"` 5043 // MatchValues - The match value for the condition of the delivery rule 5044 MatchValues *[]string `json:"matchValues,omitempty"` 5045 // Transforms - List of transforms 5046 Transforms *[]Transform `json:"transforms,omitempty"` 5047} 5048 5049// Resource the core properties of ARM resources 5050type Resource struct { 5051 // ID - READ-ONLY; Resource ID. 5052 ID *string `json:"id,omitempty"` 5053 // Name - READ-ONLY; Resource name. 5054 Name *string `json:"name,omitempty"` 5055 // Type - READ-ONLY; Resource type. 5056 Type *string `json:"type,omitempty"` 5057} 5058 5059// MarshalJSON is the custom marshaler for Resource. 5060func (r Resource) MarshalJSON() ([]byte, error) { 5061 objectMap := make(map[string]interface{}) 5062 return json.Marshal(objectMap) 5063} 5064 5065// ResourceUsage output of check resource usage API. 5066type ResourceUsage struct { 5067 // ResourceType - READ-ONLY; Resource type for which the usage is provided. 5068 ResourceType *string `json:"resourceType,omitempty"` 5069 // Unit - READ-ONLY; Unit of the usage. e.g. Count. 5070 Unit *string `json:"unit,omitempty"` 5071 // CurrentValue - READ-ONLY; Actual value of usage on the specified resource type. 5072 CurrentValue *int32 `json:"currentValue,omitempty"` 5073 // Limit - READ-ONLY; Quota of the specified resource type. 5074 Limit *int32 `json:"limit,omitempty"` 5075} 5076 5077// MarshalJSON is the custom marshaler for ResourceUsage. 5078func (ru ResourceUsage) MarshalJSON() ([]byte, error) { 5079 objectMap := make(map[string]interface{}) 5080 return json.Marshal(objectMap) 5081} 5082 5083// ResourceUsageListResult output of check resource usage API. 5084type ResourceUsageListResult struct { 5085 autorest.Response `json:"-"` 5086 // Value - READ-ONLY; List of resource usages. 5087 Value *[]ResourceUsage `json:"value,omitempty"` 5088 // NextLink - URL to get the next set of custom domain objects if there are any. 5089 NextLink *string `json:"nextLink,omitempty"` 5090} 5091 5092// MarshalJSON is the custom marshaler for ResourceUsageListResult. 5093func (rulr ResourceUsageListResult) MarshalJSON() ([]byte, error) { 5094 objectMap := make(map[string]interface{}) 5095 if rulr.NextLink != nil { 5096 objectMap["nextLink"] = rulr.NextLink 5097 } 5098 return json.Marshal(objectMap) 5099} 5100 5101// ResourceUsageListResultIterator provides access to a complete listing of ResourceUsage values. 5102type ResourceUsageListResultIterator struct { 5103 i int 5104 page ResourceUsageListResultPage 5105} 5106 5107// NextWithContext advances to the next value. If there was an error making 5108// the request the iterator does not advance and the error is returned. 5109func (iter *ResourceUsageListResultIterator) NextWithContext(ctx context.Context) (err error) { 5110 if tracing.IsEnabled() { 5111 ctx = tracing.StartSpan(ctx, fqdn+"/ResourceUsageListResultIterator.NextWithContext") 5112 defer func() { 5113 sc := -1 5114 if iter.Response().Response.Response != nil { 5115 sc = iter.Response().Response.Response.StatusCode 5116 } 5117 tracing.EndSpan(ctx, sc, err) 5118 }() 5119 } 5120 iter.i++ 5121 if iter.i < len(iter.page.Values()) { 5122 return nil 5123 } 5124 err = iter.page.NextWithContext(ctx) 5125 if err != nil { 5126 iter.i-- 5127 return err 5128 } 5129 iter.i = 0 5130 return nil 5131} 5132 5133// Next advances to the next value. If there was an error making 5134// the request the iterator does not advance and the error is returned. 5135// Deprecated: Use NextWithContext() instead. 5136func (iter *ResourceUsageListResultIterator) Next() error { 5137 return iter.NextWithContext(context.Background()) 5138} 5139 5140// NotDone returns true if the enumeration should be started or is not yet complete. 5141func (iter ResourceUsageListResultIterator) NotDone() bool { 5142 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 5143} 5144 5145// Response returns the raw server response from the last page request. 5146func (iter ResourceUsageListResultIterator) Response() ResourceUsageListResult { 5147 return iter.page.Response() 5148} 5149 5150// Value returns the current value or a zero-initialized value if the 5151// iterator has advanced beyond the end of the collection. 5152func (iter ResourceUsageListResultIterator) Value() ResourceUsage { 5153 if !iter.page.NotDone() { 5154 return ResourceUsage{} 5155 } 5156 return iter.page.Values()[iter.i] 5157} 5158 5159// Creates a new instance of the ResourceUsageListResultIterator type. 5160func NewResourceUsageListResultIterator(page ResourceUsageListResultPage) ResourceUsageListResultIterator { 5161 return ResourceUsageListResultIterator{page: page} 5162} 5163 5164// IsEmpty returns true if the ListResult contains no values. 5165func (rulr ResourceUsageListResult) IsEmpty() bool { 5166 return rulr.Value == nil || len(*rulr.Value) == 0 5167} 5168 5169// hasNextLink returns true if the NextLink is not empty. 5170func (rulr ResourceUsageListResult) hasNextLink() bool { 5171 return rulr.NextLink != nil && len(*rulr.NextLink) != 0 5172} 5173 5174// resourceUsageListResultPreparer prepares a request to retrieve the next set of results. 5175// It returns nil if no more results exist. 5176func (rulr ResourceUsageListResult) resourceUsageListResultPreparer(ctx context.Context) (*http.Request, error) { 5177 if !rulr.hasNextLink() { 5178 return nil, nil 5179 } 5180 return autorest.Prepare((&http.Request{}).WithContext(ctx), 5181 autorest.AsJSON(), 5182 autorest.AsGet(), 5183 autorest.WithBaseURL(to.String(rulr.NextLink))) 5184} 5185 5186// ResourceUsageListResultPage contains a page of ResourceUsage values. 5187type ResourceUsageListResultPage struct { 5188 fn func(context.Context, ResourceUsageListResult) (ResourceUsageListResult, error) 5189 rulr ResourceUsageListResult 5190} 5191 5192// NextWithContext advances to the next page of values. If there was an error making 5193// the request the page does not advance and the error is returned. 5194func (page *ResourceUsageListResultPage) NextWithContext(ctx context.Context) (err error) { 5195 if tracing.IsEnabled() { 5196 ctx = tracing.StartSpan(ctx, fqdn+"/ResourceUsageListResultPage.NextWithContext") 5197 defer func() { 5198 sc := -1 5199 if page.Response().Response.Response != nil { 5200 sc = page.Response().Response.Response.StatusCode 5201 } 5202 tracing.EndSpan(ctx, sc, err) 5203 }() 5204 } 5205 for { 5206 next, err := page.fn(ctx, page.rulr) 5207 if err != nil { 5208 return err 5209 } 5210 page.rulr = next 5211 if !next.hasNextLink() || !next.IsEmpty() { 5212 break 5213 } 5214 } 5215 return nil 5216} 5217 5218// Next advances to the next page of values. If there was an error making 5219// the request the page does not advance and the error is returned. 5220// Deprecated: Use NextWithContext() instead. 5221func (page *ResourceUsageListResultPage) Next() error { 5222 return page.NextWithContext(context.Background()) 5223} 5224 5225// NotDone returns true if the page enumeration should be started or is not yet complete. 5226func (page ResourceUsageListResultPage) NotDone() bool { 5227 return !page.rulr.IsEmpty() 5228} 5229 5230// Response returns the raw server response from the last page request. 5231func (page ResourceUsageListResultPage) Response() ResourceUsageListResult { 5232 return page.rulr 5233} 5234 5235// Values returns the slice of values for the current page or nil if there are no values. 5236func (page ResourceUsageListResultPage) Values() []ResourceUsage { 5237 if page.rulr.IsEmpty() { 5238 return nil 5239 } 5240 return *page.rulr.Value 5241} 5242 5243// Creates a new instance of the ResourceUsageListResultPage type. 5244func NewResourceUsageListResultPage(cur ResourceUsageListResult, getNextPage func(context.Context, ResourceUsageListResult) (ResourceUsageListResult, error)) ResourceUsageListResultPage { 5245 return ResourceUsageListResultPage{ 5246 fn: getNextPage, 5247 rulr: cur, 5248 } 5249} 5250 5251// Sku the pricing tier (defines a CDN provider, feature list and rate) of the CDN profile. 5252type Sku struct { 5253 // Name - Name of the pricing tier. Possible values include: 'StandardVerizon', 'PremiumVerizon', 'CustomVerizon', 'StandardAkamai', 'StandardChinaCdn', 'StandardMicrosoft', 'PremiumChinaCdn' 5254 Name SkuName `json:"name,omitempty"` 5255} 5256 5257// SsoURI the URI required to login to the supplemental portal from the Azure portal. 5258type SsoURI struct { 5259 autorest.Response `json:"-"` 5260 // SsoURIValue - READ-ONLY; The URI used to login to the supplemental portal. 5261 SsoURIValue *string `json:"ssoUriValue,omitempty"` 5262} 5263 5264// MarshalJSON is the custom marshaler for SsoURI. 5265func (su SsoURI) MarshalJSON() ([]byte, error) { 5266 objectMap := make(map[string]interface{}) 5267 return json.Marshal(objectMap) 5268} 5269 5270// SupportedOptimizationTypesListResult the result of the GetSupportedOptimizationTypes API 5271type SupportedOptimizationTypesListResult struct { 5272 autorest.Response `json:"-"` 5273 // SupportedOptimizationTypes - READ-ONLY; Supported optimization types for a profile. 5274 SupportedOptimizationTypes *[]OptimizationType `json:"supportedOptimizationTypes,omitempty"` 5275} 5276 5277// MarshalJSON is the custom marshaler for SupportedOptimizationTypesListResult. 5278func (sotlr SupportedOptimizationTypesListResult) MarshalJSON() ([]byte, error) { 5279 objectMap := make(map[string]interface{}) 5280 return json.Marshal(objectMap) 5281} 5282 5283// TrackedResource the resource model definition for a ARM tracked top level resource. 5284type TrackedResource struct { 5285 // Location - Resource location. 5286 Location *string `json:"location,omitempty"` 5287 // Tags - Resource tags. 5288 Tags map[string]*string `json:"tags"` 5289 // ID - READ-ONLY; Resource ID. 5290 ID *string `json:"id,omitempty"` 5291 // Name - READ-ONLY; Resource name. 5292 Name *string `json:"name,omitempty"` 5293 // Type - READ-ONLY; Resource type. 5294 Type *string `json:"type,omitempty"` 5295} 5296 5297// MarshalJSON is the custom marshaler for TrackedResource. 5298func (tr TrackedResource) MarshalJSON() ([]byte, error) { 5299 objectMap := make(map[string]interface{}) 5300 if tr.Location != nil { 5301 objectMap["location"] = tr.Location 5302 } 5303 if tr.Tags != nil { 5304 objectMap["tags"] = tr.Tags 5305 } 5306 return json.Marshal(objectMap) 5307} 5308 5309// URLFileExtensionMatchConditionParameters defines the parameters for UrlFileExtension match conditions 5310type URLFileExtensionMatchConditionParameters struct { 5311 OdataType *string `json:"@odata.type,omitempty"` 5312 // Operator - Describes operator to be matched. Possible values include: 'URLFileExtensionOperatorAny', 'URLFileExtensionOperatorEqual', 'URLFileExtensionOperatorContains', 'URLFileExtensionOperatorBeginsWith', 'URLFileExtensionOperatorEndsWith', 'URLFileExtensionOperatorLessThan', 'URLFileExtensionOperatorLessThanOrEqual', 'URLFileExtensionOperatorGreaterThan', 'URLFileExtensionOperatorGreaterThanOrEqual' 5313 Operator URLFileExtensionOperator `json:"operator,omitempty"` 5314 // NegateCondition - Describes if this is negate condition or not 5315 NegateCondition *bool `json:"negateCondition,omitempty"` 5316 // MatchValues - The match value for the condition of the delivery rule 5317 MatchValues *[]string `json:"matchValues,omitempty"` 5318 // Transforms - List of transforms 5319 Transforms *[]Transform `json:"transforms,omitempty"` 5320} 5321 5322// URLFileNameMatchConditionParameters defines the parameters for UrlFilename match conditions 5323type URLFileNameMatchConditionParameters struct { 5324 OdataType *string `json:"@odata.type,omitempty"` 5325 // Operator - Describes operator to be matched. Possible values include: 'URLFileNameOperatorAny', 'URLFileNameOperatorEqual', 'URLFileNameOperatorContains', 'URLFileNameOperatorBeginsWith', 'URLFileNameOperatorEndsWith', 'URLFileNameOperatorLessThan', 'URLFileNameOperatorLessThanOrEqual', 'URLFileNameOperatorGreaterThan', 'URLFileNameOperatorGreaterThanOrEqual' 5326 Operator URLFileNameOperator `json:"operator,omitempty"` 5327 // NegateCondition - Describes if this is negate condition or not 5328 NegateCondition *bool `json:"negateCondition,omitempty"` 5329 // MatchValues - The match value for the condition of the delivery rule 5330 MatchValues *[]string `json:"matchValues,omitempty"` 5331 // Transforms - List of transforms 5332 Transforms *[]Transform `json:"transforms,omitempty"` 5333} 5334 5335// URLPathMatchConditionParameters defines the parameters for UrlPath match conditions 5336type URLPathMatchConditionParameters struct { 5337 OdataType *string `json:"@odata.type,omitempty"` 5338 // Operator - Describes operator to be matched. Possible values include: 'URLPathOperatorAny', 'URLPathOperatorEqual', 'URLPathOperatorContains', 'URLPathOperatorBeginsWith', 'URLPathOperatorEndsWith', 'URLPathOperatorLessThan', 'URLPathOperatorLessThanOrEqual', 'URLPathOperatorGreaterThan', 'URLPathOperatorGreaterThanOrEqual', 'URLPathOperatorWildcard' 5339 Operator URLPathOperator `json:"operator,omitempty"` 5340 // NegateCondition - Describes if this is negate condition or not 5341 NegateCondition *bool `json:"negateCondition,omitempty"` 5342 // MatchValues - The match value for the condition of the delivery rule 5343 MatchValues *[]string `json:"matchValues,omitempty"` 5344 // Transforms - List of transforms 5345 Transforms *[]Transform `json:"transforms,omitempty"` 5346} 5347 5348// URLRedirectAction defines the url redirect action for the delivery rule. 5349type URLRedirectAction struct { 5350 // Parameters - Defines the parameters for the action. 5351 Parameters *URLRedirectActionParameters `json:"parameters,omitempty"` 5352 // Name - Possible values include: 'NameDeliveryRuleAction', 'NameURLRedirect', 'NameURLRewrite', 'NameModifyRequestHeader', 'NameModifyResponseHeader', 'NameCacheExpiration', 'NameCacheKeyQueryString' 5353 Name NameBasicDeliveryRuleAction `json:"name,omitempty"` 5354} 5355 5356// MarshalJSON is the custom marshaler for URLRedirectAction. 5357func (ura URLRedirectAction) MarshalJSON() ([]byte, error) { 5358 ura.Name = NameURLRedirect 5359 objectMap := make(map[string]interface{}) 5360 if ura.Parameters != nil { 5361 objectMap["parameters"] = ura.Parameters 5362 } 5363 if ura.Name != "" { 5364 objectMap["name"] = ura.Name 5365 } 5366 return json.Marshal(objectMap) 5367} 5368 5369// AsURLRedirectAction is the BasicDeliveryRuleAction implementation for URLRedirectAction. 5370func (ura URLRedirectAction) AsURLRedirectAction() (*URLRedirectAction, bool) { 5371 return &ura, true 5372} 5373 5374// AsURLRewriteAction is the BasicDeliveryRuleAction implementation for URLRedirectAction. 5375func (ura URLRedirectAction) AsURLRewriteAction() (*URLRewriteAction, bool) { 5376 return nil, false 5377} 5378 5379// AsDeliveryRuleRequestHeaderAction is the BasicDeliveryRuleAction implementation for URLRedirectAction. 5380func (ura URLRedirectAction) AsDeliveryRuleRequestHeaderAction() (*DeliveryRuleRequestHeaderAction, bool) { 5381 return nil, false 5382} 5383 5384// AsDeliveryRuleResponseHeaderAction is the BasicDeliveryRuleAction implementation for URLRedirectAction. 5385func (ura URLRedirectAction) AsDeliveryRuleResponseHeaderAction() (*DeliveryRuleResponseHeaderAction, bool) { 5386 return nil, false 5387} 5388 5389// AsDeliveryRuleCacheExpirationAction is the BasicDeliveryRuleAction implementation for URLRedirectAction. 5390func (ura URLRedirectAction) AsDeliveryRuleCacheExpirationAction() (*DeliveryRuleCacheExpirationAction, bool) { 5391 return nil, false 5392} 5393 5394// AsDeliveryRuleCacheKeyQueryStringAction is the BasicDeliveryRuleAction implementation for URLRedirectAction. 5395func (ura URLRedirectAction) AsDeliveryRuleCacheKeyQueryStringAction() (*DeliveryRuleCacheKeyQueryStringAction, bool) { 5396 return nil, false 5397} 5398 5399// AsDeliveryRuleAction is the BasicDeliveryRuleAction implementation for URLRedirectAction. 5400func (ura URLRedirectAction) AsDeliveryRuleAction() (*DeliveryRuleAction, bool) { 5401 return nil, false 5402} 5403 5404// AsBasicDeliveryRuleAction is the BasicDeliveryRuleAction implementation for URLRedirectAction. 5405func (ura URLRedirectAction) AsBasicDeliveryRuleAction() (BasicDeliveryRuleAction, bool) { 5406 return &ura, true 5407} 5408 5409// URLRedirectActionParameters defines the parameters for the url redirect action. 5410type URLRedirectActionParameters struct { 5411 OdataType *string `json:"@odata.type,omitempty"` 5412 // RedirectType - The redirect type the rule will use when redirecting traffic. Possible values include: 'Moved', 'Found', 'TemporaryRedirect', 'PermanentRedirect' 5413 RedirectType RedirectType `json:"redirectType,omitempty"` 5414 // DestinationProtocol - Protocol to use for the redirect. The default value is MatchRequest. Possible values include: 'MatchRequest', 'HTTP', 'HTTPS' 5415 DestinationProtocol DestinationProtocol `json:"destinationProtocol,omitempty"` 5416 // CustomPath - The full path to redirect. Path cannot be empty and must start with /. Leave empty to use the incoming path as destination path. 5417 CustomPath *string `json:"customPath,omitempty"` 5418 // CustomHostname - Host to redirect. Leave empty to use the incoming host as the destination host. 5419 CustomHostname *string `json:"customHostname,omitempty"` 5420 // 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. 5421 CustomQueryString *string `json:"customQueryString,omitempty"` 5422 // CustomFragment - Fragment to add to the redirect URL. Fragment is the part of the URL that comes after #. Do not include the #. 5423 CustomFragment *string `json:"customFragment,omitempty"` 5424} 5425 5426// URLRewriteAction defines the url rewrite action for the delivery rule. 5427type URLRewriteAction struct { 5428 // Parameters - Defines the parameters for the action. 5429 Parameters *URLRewriteActionParameters `json:"parameters,omitempty"` 5430 // Name - Possible values include: 'NameDeliveryRuleAction', 'NameURLRedirect', 'NameURLRewrite', 'NameModifyRequestHeader', 'NameModifyResponseHeader', 'NameCacheExpiration', 'NameCacheKeyQueryString' 5431 Name NameBasicDeliveryRuleAction `json:"name,omitempty"` 5432} 5433 5434// MarshalJSON is the custom marshaler for URLRewriteAction. 5435func (ura URLRewriteAction) MarshalJSON() ([]byte, error) { 5436 ura.Name = NameURLRewrite 5437 objectMap := make(map[string]interface{}) 5438 if ura.Parameters != nil { 5439 objectMap["parameters"] = ura.Parameters 5440 } 5441 if ura.Name != "" { 5442 objectMap["name"] = ura.Name 5443 } 5444 return json.Marshal(objectMap) 5445} 5446 5447// AsURLRedirectAction is the BasicDeliveryRuleAction implementation for URLRewriteAction. 5448func (ura URLRewriteAction) AsURLRedirectAction() (*URLRedirectAction, bool) { 5449 return nil, false 5450} 5451 5452// AsURLRewriteAction is the BasicDeliveryRuleAction implementation for URLRewriteAction. 5453func (ura URLRewriteAction) AsURLRewriteAction() (*URLRewriteAction, bool) { 5454 return &ura, true 5455} 5456 5457// AsDeliveryRuleRequestHeaderAction is the BasicDeliveryRuleAction implementation for URLRewriteAction. 5458func (ura URLRewriteAction) AsDeliveryRuleRequestHeaderAction() (*DeliveryRuleRequestHeaderAction, bool) { 5459 return nil, false 5460} 5461 5462// AsDeliveryRuleResponseHeaderAction is the BasicDeliveryRuleAction implementation for URLRewriteAction. 5463func (ura URLRewriteAction) AsDeliveryRuleResponseHeaderAction() (*DeliveryRuleResponseHeaderAction, bool) { 5464 return nil, false 5465} 5466 5467// AsDeliveryRuleCacheExpirationAction is the BasicDeliveryRuleAction implementation for URLRewriteAction. 5468func (ura URLRewriteAction) AsDeliveryRuleCacheExpirationAction() (*DeliveryRuleCacheExpirationAction, bool) { 5469 return nil, false 5470} 5471 5472// AsDeliveryRuleCacheKeyQueryStringAction is the BasicDeliveryRuleAction implementation for URLRewriteAction. 5473func (ura URLRewriteAction) AsDeliveryRuleCacheKeyQueryStringAction() (*DeliveryRuleCacheKeyQueryStringAction, bool) { 5474 return nil, false 5475} 5476 5477// AsDeliveryRuleAction is the BasicDeliveryRuleAction implementation for URLRewriteAction. 5478func (ura URLRewriteAction) AsDeliveryRuleAction() (*DeliveryRuleAction, bool) { 5479 return nil, false 5480} 5481 5482// AsBasicDeliveryRuleAction is the BasicDeliveryRuleAction implementation for URLRewriteAction. 5483func (ura URLRewriteAction) AsBasicDeliveryRuleAction() (BasicDeliveryRuleAction, bool) { 5484 return &ura, true 5485} 5486 5487// URLRewriteActionParameters defines the parameters for the url rewrite action. 5488type URLRewriteActionParameters struct { 5489 OdataType *string `json:"@odata.type,omitempty"` 5490 // SourcePattern - define a request URI pattern that identifies the type of requests that may be rewritten. Currently, source pattern uses a prefix-based match. To match all URL paths, use "/" as the source pattern value. To match only the root directory and re-write this path, use the origin path field 5491 SourcePattern *string `json:"sourcePattern,omitempty"` 5492 // Destination - Define the destination path for be used in the rewrite. This will overwrite the source pattern 5493 Destination *string `json:"destination,omitempty"` 5494 // PreserveUnmatchedPath - If True, the remaining path after the source pattern will be appended to the new destination path. 5495 PreserveUnmatchedPath *bool `json:"preserveUnmatchedPath,omitempty"` 5496} 5497 5498// UserManagedHTTPSParameters defines the certificate source parameters using user's keyvault certificate 5499// for enabling SSL. 5500type UserManagedHTTPSParameters struct { 5501 // CertificateSourceParameters - Defines the certificate source parameters using user's keyvault certificate for enabling SSL. 5502 CertificateSourceParameters *KeyVaultCertificateSourceParameters `json:"certificateSourceParameters,omitempty"` 5503 // ProtocolType - Defines the TLS extension protocol that is used for secure delivery. Possible values include: 'ServerNameIndication', 'IPBased' 5504 ProtocolType ProtocolType `json:"protocolType,omitempty"` 5505 // MinimumTLSVersion - TLS protocol version that will be used for Https. Possible values include: 'None', 'TLS10', 'TLS12' 5506 MinimumTLSVersion MinimumTLSVersion `json:"minimumTlsVersion,omitempty"` 5507 // CertificateSource - Possible values include: 'CertificateSourceCustomDomainHTTPSParameters', 'CertificateSourceCdn', 'CertificateSourceAzureKeyVault' 5508 CertificateSource CertificateSource `json:"certificateSource,omitempty"` 5509} 5510 5511// MarshalJSON is the custom marshaler for UserManagedHTTPSParameters. 5512func (umhp UserManagedHTTPSParameters) MarshalJSON() ([]byte, error) { 5513 umhp.CertificateSource = CertificateSourceAzureKeyVault 5514 objectMap := make(map[string]interface{}) 5515 if umhp.CertificateSourceParameters != nil { 5516 objectMap["certificateSourceParameters"] = umhp.CertificateSourceParameters 5517 } 5518 if umhp.ProtocolType != "" { 5519 objectMap["protocolType"] = umhp.ProtocolType 5520 } 5521 if umhp.MinimumTLSVersion != "" { 5522 objectMap["minimumTlsVersion"] = umhp.MinimumTLSVersion 5523 } 5524 if umhp.CertificateSource != "" { 5525 objectMap["certificateSource"] = umhp.CertificateSource 5526 } 5527 return json.Marshal(objectMap) 5528} 5529 5530// AsManagedHTTPSParameters is the BasicCustomDomainHTTPSParameters implementation for UserManagedHTTPSParameters. 5531func (umhp UserManagedHTTPSParameters) AsManagedHTTPSParameters() (*ManagedHTTPSParameters, bool) { 5532 return nil, false 5533} 5534 5535// AsUserManagedHTTPSParameters is the BasicCustomDomainHTTPSParameters implementation for UserManagedHTTPSParameters. 5536func (umhp UserManagedHTTPSParameters) AsUserManagedHTTPSParameters() (*UserManagedHTTPSParameters, bool) { 5537 return &umhp, true 5538} 5539 5540// AsCustomDomainHTTPSParameters is the BasicCustomDomainHTTPSParameters implementation for UserManagedHTTPSParameters. 5541func (umhp UserManagedHTTPSParameters) AsCustomDomainHTTPSParameters() (*CustomDomainHTTPSParameters, bool) { 5542 return nil, false 5543} 5544 5545// AsBasicCustomDomainHTTPSParameters is the BasicCustomDomainHTTPSParameters implementation for UserManagedHTTPSParameters. 5546func (umhp UserManagedHTTPSParameters) AsBasicCustomDomainHTTPSParameters() (BasicCustomDomainHTTPSParameters, bool) { 5547 return &umhp, true 5548} 5549 5550// ValidateCustomDomainInput input of the custom domain to be validated for DNS mapping. 5551type ValidateCustomDomainInput struct { 5552 // HostName - The host name of the custom domain. Must be a domain name. 5553 HostName *string `json:"hostName,omitempty"` 5554} 5555 5556// ValidateCustomDomainOutput output of custom domain validation. 5557type ValidateCustomDomainOutput struct { 5558 autorest.Response `json:"-"` 5559 // CustomDomainValidated - READ-ONLY; Indicates whether the custom domain is valid or not. 5560 CustomDomainValidated *bool `json:"customDomainValidated,omitempty"` 5561 // Reason - READ-ONLY; The reason why the custom domain is not valid. 5562 Reason *string `json:"reason,omitempty"` 5563 // Message - READ-ONLY; Error message describing why the custom domain is not valid. 5564 Message *string `json:"message,omitempty"` 5565} 5566 5567// MarshalJSON is the custom marshaler for ValidateCustomDomainOutput. 5568func (vcdo ValidateCustomDomainOutput) MarshalJSON() ([]byte, error) { 5569 objectMap := make(map[string]interface{}) 5570 return json.Marshal(objectMap) 5571} 5572 5573// ValidateProbeInput input of the validate probe API. 5574type ValidateProbeInput struct { 5575 // ProbeURL - The probe URL to validate. 5576 ProbeURL *string `json:"probeURL,omitempty"` 5577} 5578 5579// ValidateProbeOutput output of the validate probe API. 5580type ValidateProbeOutput struct { 5581 autorest.Response `json:"-"` 5582 // IsValid - READ-ONLY; Indicates whether the probe URL is accepted or not. 5583 IsValid *bool `json:"isValid,omitempty"` 5584 // ErrorCode - READ-ONLY; Specifies the error code when the probe url is not accepted. 5585 ErrorCode *string `json:"errorCode,omitempty"` 5586 // Message - READ-ONLY; The detailed error message describing why the probe URL is not accepted. 5587 Message *string `json:"message,omitempty"` 5588} 5589 5590// MarshalJSON is the custom marshaler for ValidateProbeOutput. 5591func (vpo ValidateProbeOutput) MarshalJSON() ([]byte, error) { 5592 objectMap := make(map[string]interface{}) 5593 return json.Marshal(objectMap) 5594} 5595