1package apimanagement 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/date" 15 "github.com/Azure/go-autorest/autorest/to" 16 "github.com/Azure/go-autorest/tracing" 17 "github.com/gofrs/uuid" 18 "net/http" 19) 20 21// The package's fully qualified name. 22const fqdn = "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2020-12-01/apimanagement" 23 24// AccessInformationCollection paged AccessInformation list representation. 25type AccessInformationCollection struct { 26 autorest.Response `json:"-"` 27 // Value - READ-ONLY; Page values. 28 Value *[]AccessInformationContract `json:"value,omitempty"` 29 // Count - Total record count number across all pages. 30 Count *int64 `json:"count,omitempty"` 31 // NextLink - READ-ONLY; Next page link if any. 32 NextLink *string `json:"nextLink,omitempty"` 33} 34 35// MarshalJSON is the custom marshaler for AccessInformationCollection. 36func (aic AccessInformationCollection) MarshalJSON() ([]byte, error) { 37 objectMap := make(map[string]interface{}) 38 if aic.Count != nil { 39 objectMap["count"] = aic.Count 40 } 41 return json.Marshal(objectMap) 42} 43 44// AccessInformationCollectionIterator provides access to a complete listing of AccessInformationContract 45// values. 46type AccessInformationCollectionIterator struct { 47 i int 48 page AccessInformationCollectionPage 49} 50 51// NextWithContext advances to the next value. If there was an error making 52// the request the iterator does not advance and the error is returned. 53func (iter *AccessInformationCollectionIterator) NextWithContext(ctx context.Context) (err error) { 54 if tracing.IsEnabled() { 55 ctx = tracing.StartSpan(ctx, fqdn+"/AccessInformationCollectionIterator.NextWithContext") 56 defer func() { 57 sc := -1 58 if iter.Response().Response.Response != nil { 59 sc = iter.Response().Response.Response.StatusCode 60 } 61 tracing.EndSpan(ctx, sc, err) 62 }() 63 } 64 iter.i++ 65 if iter.i < len(iter.page.Values()) { 66 return nil 67 } 68 err = iter.page.NextWithContext(ctx) 69 if err != nil { 70 iter.i-- 71 return err 72 } 73 iter.i = 0 74 return nil 75} 76 77// Next advances to the next value. If there was an error making 78// the request the iterator does not advance and the error is returned. 79// Deprecated: Use NextWithContext() instead. 80func (iter *AccessInformationCollectionIterator) Next() error { 81 return iter.NextWithContext(context.Background()) 82} 83 84// NotDone returns true if the enumeration should be started or is not yet complete. 85func (iter AccessInformationCollectionIterator) NotDone() bool { 86 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 87} 88 89// Response returns the raw server response from the last page request. 90func (iter AccessInformationCollectionIterator) Response() AccessInformationCollection { 91 return iter.page.Response() 92} 93 94// Value returns the current value or a zero-initialized value if the 95// iterator has advanced beyond the end of the collection. 96func (iter AccessInformationCollectionIterator) Value() AccessInformationContract { 97 if !iter.page.NotDone() { 98 return AccessInformationContract{} 99 } 100 return iter.page.Values()[iter.i] 101} 102 103// Creates a new instance of the AccessInformationCollectionIterator type. 104func NewAccessInformationCollectionIterator(page AccessInformationCollectionPage) AccessInformationCollectionIterator { 105 return AccessInformationCollectionIterator{page: page} 106} 107 108// IsEmpty returns true if the ListResult contains no values. 109func (aic AccessInformationCollection) IsEmpty() bool { 110 return aic.Value == nil || len(*aic.Value) == 0 111} 112 113// hasNextLink returns true if the NextLink is not empty. 114func (aic AccessInformationCollection) hasNextLink() bool { 115 return aic.NextLink != nil && len(*aic.NextLink) != 0 116} 117 118// accessInformationCollectionPreparer prepares a request to retrieve the next set of results. 119// It returns nil if no more results exist. 120func (aic AccessInformationCollection) accessInformationCollectionPreparer(ctx context.Context) (*http.Request, error) { 121 if !aic.hasNextLink() { 122 return nil, nil 123 } 124 return autorest.Prepare((&http.Request{}).WithContext(ctx), 125 autorest.AsJSON(), 126 autorest.AsGet(), 127 autorest.WithBaseURL(to.String(aic.NextLink))) 128} 129 130// AccessInformationCollectionPage contains a page of AccessInformationContract values. 131type AccessInformationCollectionPage struct { 132 fn func(context.Context, AccessInformationCollection) (AccessInformationCollection, error) 133 aic AccessInformationCollection 134} 135 136// NextWithContext advances to the next page of values. If there was an error making 137// the request the page does not advance and the error is returned. 138func (page *AccessInformationCollectionPage) NextWithContext(ctx context.Context) (err error) { 139 if tracing.IsEnabled() { 140 ctx = tracing.StartSpan(ctx, fqdn+"/AccessInformationCollectionPage.NextWithContext") 141 defer func() { 142 sc := -1 143 if page.Response().Response.Response != nil { 144 sc = page.Response().Response.Response.StatusCode 145 } 146 tracing.EndSpan(ctx, sc, err) 147 }() 148 } 149 for { 150 next, err := page.fn(ctx, page.aic) 151 if err != nil { 152 return err 153 } 154 page.aic = next 155 if !next.hasNextLink() || !next.IsEmpty() { 156 break 157 } 158 } 159 return nil 160} 161 162// Next advances to the next page of values. If there was an error making 163// the request the page does not advance and the error is returned. 164// Deprecated: Use NextWithContext() instead. 165func (page *AccessInformationCollectionPage) Next() error { 166 return page.NextWithContext(context.Background()) 167} 168 169// NotDone returns true if the page enumeration should be started or is not yet complete. 170func (page AccessInformationCollectionPage) NotDone() bool { 171 return !page.aic.IsEmpty() 172} 173 174// Response returns the raw server response from the last page request. 175func (page AccessInformationCollectionPage) Response() AccessInformationCollection { 176 return page.aic 177} 178 179// Values returns the slice of values for the current page or nil if there are no values. 180func (page AccessInformationCollectionPage) Values() []AccessInformationContract { 181 if page.aic.IsEmpty() { 182 return nil 183 } 184 return *page.aic.Value 185} 186 187// Creates a new instance of the AccessInformationCollectionPage type. 188func NewAccessInformationCollectionPage(cur AccessInformationCollection, getNextPage func(context.Context, AccessInformationCollection) (AccessInformationCollection, error)) AccessInformationCollectionPage { 189 return AccessInformationCollectionPage{ 190 fn: getNextPage, 191 aic: cur, 192 } 193} 194 195// AccessInformationContract tenant Settings. 196type AccessInformationContract struct { 197 autorest.Response `json:"-"` 198 // AccessInformationContractProperties - AccessInformation entity contract properties. 199 *AccessInformationContractProperties `json:"properties,omitempty"` 200 // ID - READ-ONLY; Resource ID. 201 ID *string `json:"id,omitempty"` 202 // Name - READ-ONLY; Resource name. 203 Name *string `json:"name,omitempty"` 204 // Type - READ-ONLY; Resource type for API Management resource. 205 Type *string `json:"type,omitempty"` 206} 207 208// MarshalJSON is the custom marshaler for AccessInformationContract. 209func (aic AccessInformationContract) MarshalJSON() ([]byte, error) { 210 objectMap := make(map[string]interface{}) 211 if aic.AccessInformationContractProperties != nil { 212 objectMap["properties"] = aic.AccessInformationContractProperties 213 } 214 return json.Marshal(objectMap) 215} 216 217// UnmarshalJSON is the custom unmarshaler for AccessInformationContract struct. 218func (aic *AccessInformationContract) UnmarshalJSON(body []byte) error { 219 var m map[string]*json.RawMessage 220 err := json.Unmarshal(body, &m) 221 if err != nil { 222 return err 223 } 224 for k, v := range m { 225 switch k { 226 case "properties": 227 if v != nil { 228 var accessInformationContractProperties AccessInformationContractProperties 229 err = json.Unmarshal(*v, &accessInformationContractProperties) 230 if err != nil { 231 return err 232 } 233 aic.AccessInformationContractProperties = &accessInformationContractProperties 234 } 235 case "id": 236 if v != nil { 237 var ID string 238 err = json.Unmarshal(*v, &ID) 239 if err != nil { 240 return err 241 } 242 aic.ID = &ID 243 } 244 case "name": 245 if v != nil { 246 var name string 247 err = json.Unmarshal(*v, &name) 248 if err != nil { 249 return err 250 } 251 aic.Name = &name 252 } 253 case "type": 254 if v != nil { 255 var typeVar string 256 err = json.Unmarshal(*v, &typeVar) 257 if err != nil { 258 return err 259 } 260 aic.Type = &typeVar 261 } 262 } 263 } 264 265 return nil 266} 267 268// AccessInformationContractProperties tenant access information contract of the API Management service. 269type AccessInformationContractProperties struct { 270 // ID - Access Information type ('access' or 'gitAccess') 271 ID *string `json:"id,omitempty"` 272 // PrincipalID - Principal (User) Identifier. 273 PrincipalID *string `json:"principalId,omitempty"` 274 // Enabled - Determines whether direct access is enabled. 275 Enabled *bool `json:"enabled,omitempty"` 276} 277 278// AccessInformationCreateParameterProperties tenant access information update parameters of the API 279// Management service 280type AccessInformationCreateParameterProperties struct { 281 // PrincipalID - Principal (User) Identifier. 282 PrincipalID *string `json:"principalId,omitempty"` 283 // PrimaryKey - Primary access key. This property will not be filled on 'GET' operations! Use '/listSecrets' POST request to get the value. 284 PrimaryKey *string `json:"primaryKey,omitempty"` 285 // SecondaryKey - Secondary access key. This property will not be filled on 'GET' operations! Use '/listSecrets' POST request to get the value. 286 SecondaryKey *string `json:"secondaryKey,omitempty"` 287 // Enabled - Determines whether direct access is enabled. 288 Enabled *bool `json:"enabled,omitempty"` 289} 290 291// AccessInformationCreateParameters tenant access information update parameters. 292type AccessInformationCreateParameters struct { 293 // AccessInformationCreateParameterProperties - Tenant access information update parameter properties. 294 *AccessInformationCreateParameterProperties `json:"properties,omitempty"` 295} 296 297// MarshalJSON is the custom marshaler for AccessInformationCreateParameters. 298func (aicp AccessInformationCreateParameters) MarshalJSON() ([]byte, error) { 299 objectMap := make(map[string]interface{}) 300 if aicp.AccessInformationCreateParameterProperties != nil { 301 objectMap["properties"] = aicp.AccessInformationCreateParameterProperties 302 } 303 return json.Marshal(objectMap) 304} 305 306// UnmarshalJSON is the custom unmarshaler for AccessInformationCreateParameters struct. 307func (aicp *AccessInformationCreateParameters) UnmarshalJSON(body []byte) error { 308 var m map[string]*json.RawMessage 309 err := json.Unmarshal(body, &m) 310 if err != nil { 311 return err 312 } 313 for k, v := range m { 314 switch k { 315 case "properties": 316 if v != nil { 317 var accessInformationCreateParameterProperties AccessInformationCreateParameterProperties 318 err = json.Unmarshal(*v, &accessInformationCreateParameterProperties) 319 if err != nil { 320 return err 321 } 322 aicp.AccessInformationCreateParameterProperties = &accessInformationCreateParameterProperties 323 } 324 } 325 } 326 327 return nil 328} 329 330// AccessInformationSecretsContract tenant access information contract of the API Management service. 331type AccessInformationSecretsContract struct { 332 autorest.Response `json:"-"` 333 // ID - Access Information type ('access' or 'gitAccess') 334 ID *string `json:"id,omitempty"` 335 // PrincipalID - Principal (User) Identifier. 336 PrincipalID *string `json:"principalId,omitempty"` 337 // PrimaryKey - Primary access key. This property will not be filled on 'GET' operations! Use '/listSecrets' POST request to get the value. 338 PrimaryKey *string `json:"primaryKey,omitempty"` 339 // SecondaryKey - Secondary access key. This property will not be filled on 'GET' operations! Use '/listSecrets' POST request to get the value. 340 SecondaryKey *string `json:"secondaryKey,omitempty"` 341 // Enabled - Determines whether direct access is enabled. 342 Enabled *bool `json:"enabled,omitempty"` 343} 344 345// AccessInformationUpdateParameterProperties tenant access information update parameters of the API 346// Management service 347type AccessInformationUpdateParameterProperties struct { 348 // Enabled - Determines whether direct access is enabled. 349 Enabled *bool `json:"enabled,omitempty"` 350} 351 352// AccessInformationUpdateParameters tenant access information update parameters. 353type AccessInformationUpdateParameters struct { 354 // AccessInformationUpdateParameterProperties - Tenant access information update parameter properties. 355 *AccessInformationUpdateParameterProperties `json:"properties,omitempty"` 356} 357 358// MarshalJSON is the custom marshaler for AccessInformationUpdateParameters. 359func (aiup AccessInformationUpdateParameters) MarshalJSON() ([]byte, error) { 360 objectMap := make(map[string]interface{}) 361 if aiup.AccessInformationUpdateParameterProperties != nil { 362 objectMap["properties"] = aiup.AccessInformationUpdateParameterProperties 363 } 364 return json.Marshal(objectMap) 365} 366 367// UnmarshalJSON is the custom unmarshaler for AccessInformationUpdateParameters struct. 368func (aiup *AccessInformationUpdateParameters) UnmarshalJSON(body []byte) error { 369 var m map[string]*json.RawMessage 370 err := json.Unmarshal(body, &m) 371 if err != nil { 372 return err 373 } 374 for k, v := range m { 375 switch k { 376 case "properties": 377 if v != nil { 378 var accessInformationUpdateParameterProperties AccessInformationUpdateParameterProperties 379 err = json.Unmarshal(*v, &accessInformationUpdateParameterProperties) 380 if err != nil { 381 return err 382 } 383 aiup.AccessInformationUpdateParameterProperties = &accessInformationUpdateParameterProperties 384 } 385 } 386 } 387 388 return nil 389} 390 391// AdditionalLocation description of an additional API Management resource location. 392type AdditionalLocation struct { 393 // Location - The location name of the additional region among Azure Data center regions. 394 Location *string `json:"location,omitempty"` 395 // Sku - SKU properties of the API Management service. 396 Sku *ServiceSkuProperties `json:"sku,omitempty"` 397 // Zones - A list of availability zones denoting where the resource needs to come from. 398 Zones *[]string `json:"zones,omitempty"` 399 // PublicIPAddresses - READ-ONLY; Public Static Load Balanced IP addresses of the API Management service in the additional location. Available only for Basic, Standard, Premium and Isolated SKU. 400 PublicIPAddresses *[]string `json:"publicIPAddresses,omitempty"` 401 // PrivateIPAddresses - READ-ONLY; Private Static Load Balanced IP addresses of the API Management service which is deployed in an Internal Virtual Network in a particular additional location. Available only for Basic, Standard, Premium and Isolated SKU. 402 PrivateIPAddresses *[]string `json:"privateIPAddresses,omitempty"` 403 // VirtualNetworkConfiguration - Virtual network configuration for the location. 404 VirtualNetworkConfiguration *VirtualNetworkConfiguration `json:"virtualNetworkConfiguration,omitempty"` 405 // GatewayRegionalURL - READ-ONLY; Gateway URL of the API Management service in the Region. 406 GatewayRegionalURL *string `json:"gatewayRegionalUrl,omitempty"` 407 // DisableGateway - Property only valid for an Api Management service deployed in multiple locations. This can be used to disable the gateway in this additional location. 408 DisableGateway *bool `json:"disableGateway,omitempty"` 409} 410 411// MarshalJSON is the custom marshaler for AdditionalLocation. 412func (al AdditionalLocation) MarshalJSON() ([]byte, error) { 413 objectMap := make(map[string]interface{}) 414 if al.Location != nil { 415 objectMap["location"] = al.Location 416 } 417 if al.Sku != nil { 418 objectMap["sku"] = al.Sku 419 } 420 if al.Zones != nil { 421 objectMap["zones"] = al.Zones 422 } 423 if al.VirtualNetworkConfiguration != nil { 424 objectMap["virtualNetworkConfiguration"] = al.VirtualNetworkConfiguration 425 } 426 if al.DisableGateway != nil { 427 objectMap["disableGateway"] = al.DisableGateway 428 } 429 return json.Marshal(objectMap) 430} 431 432// APICollection paged Api list representation. 433type APICollection struct { 434 autorest.Response `json:"-"` 435 // Value - READ-ONLY; Page values. 436 Value *[]APIContract `json:"value,omitempty"` 437 // Count - Total record count number across all pages. 438 Count *int64 `json:"count,omitempty"` 439 // NextLink - READ-ONLY; Next page link if any. 440 NextLink *string `json:"nextLink,omitempty"` 441} 442 443// MarshalJSON is the custom marshaler for APICollection. 444func (ac APICollection) MarshalJSON() ([]byte, error) { 445 objectMap := make(map[string]interface{}) 446 if ac.Count != nil { 447 objectMap["count"] = ac.Count 448 } 449 return json.Marshal(objectMap) 450} 451 452// APICollectionIterator provides access to a complete listing of APIContract values. 453type APICollectionIterator struct { 454 i int 455 page APICollectionPage 456} 457 458// NextWithContext advances to the next value. If there was an error making 459// the request the iterator does not advance and the error is returned. 460func (iter *APICollectionIterator) NextWithContext(ctx context.Context) (err error) { 461 if tracing.IsEnabled() { 462 ctx = tracing.StartSpan(ctx, fqdn+"/APICollectionIterator.NextWithContext") 463 defer func() { 464 sc := -1 465 if iter.Response().Response.Response != nil { 466 sc = iter.Response().Response.Response.StatusCode 467 } 468 tracing.EndSpan(ctx, sc, err) 469 }() 470 } 471 iter.i++ 472 if iter.i < len(iter.page.Values()) { 473 return nil 474 } 475 err = iter.page.NextWithContext(ctx) 476 if err != nil { 477 iter.i-- 478 return err 479 } 480 iter.i = 0 481 return nil 482} 483 484// Next advances to the next value. If there was an error making 485// the request the iterator does not advance and the error is returned. 486// Deprecated: Use NextWithContext() instead. 487func (iter *APICollectionIterator) Next() error { 488 return iter.NextWithContext(context.Background()) 489} 490 491// NotDone returns true if the enumeration should be started or is not yet complete. 492func (iter APICollectionIterator) NotDone() bool { 493 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 494} 495 496// Response returns the raw server response from the last page request. 497func (iter APICollectionIterator) Response() APICollection { 498 return iter.page.Response() 499} 500 501// Value returns the current value or a zero-initialized value if the 502// iterator has advanced beyond the end of the collection. 503func (iter APICollectionIterator) Value() APIContract { 504 if !iter.page.NotDone() { 505 return APIContract{} 506 } 507 return iter.page.Values()[iter.i] 508} 509 510// Creates a new instance of the APICollectionIterator type. 511func NewAPICollectionIterator(page APICollectionPage) APICollectionIterator { 512 return APICollectionIterator{page: page} 513} 514 515// IsEmpty returns true if the ListResult contains no values. 516func (ac APICollection) IsEmpty() bool { 517 return ac.Value == nil || len(*ac.Value) == 0 518} 519 520// hasNextLink returns true if the NextLink is not empty. 521func (ac APICollection) hasNextLink() bool { 522 return ac.NextLink != nil && len(*ac.NextLink) != 0 523} 524 525// aPICollectionPreparer prepares a request to retrieve the next set of results. 526// It returns nil if no more results exist. 527func (ac APICollection) aPICollectionPreparer(ctx context.Context) (*http.Request, error) { 528 if !ac.hasNextLink() { 529 return nil, nil 530 } 531 return autorest.Prepare((&http.Request{}).WithContext(ctx), 532 autorest.AsJSON(), 533 autorest.AsGet(), 534 autorest.WithBaseURL(to.String(ac.NextLink))) 535} 536 537// APICollectionPage contains a page of APIContract values. 538type APICollectionPage struct { 539 fn func(context.Context, APICollection) (APICollection, error) 540 ac APICollection 541} 542 543// NextWithContext advances to the next page of values. If there was an error making 544// the request the page does not advance and the error is returned. 545func (page *APICollectionPage) NextWithContext(ctx context.Context) (err error) { 546 if tracing.IsEnabled() { 547 ctx = tracing.StartSpan(ctx, fqdn+"/APICollectionPage.NextWithContext") 548 defer func() { 549 sc := -1 550 if page.Response().Response.Response != nil { 551 sc = page.Response().Response.Response.StatusCode 552 } 553 tracing.EndSpan(ctx, sc, err) 554 }() 555 } 556 for { 557 next, err := page.fn(ctx, page.ac) 558 if err != nil { 559 return err 560 } 561 page.ac = next 562 if !next.hasNextLink() || !next.IsEmpty() { 563 break 564 } 565 } 566 return nil 567} 568 569// Next advances to the next page of values. If there was an error making 570// the request the page does not advance and the error is returned. 571// Deprecated: Use NextWithContext() instead. 572func (page *APICollectionPage) Next() error { 573 return page.NextWithContext(context.Background()) 574} 575 576// NotDone returns true if the page enumeration should be started or is not yet complete. 577func (page APICollectionPage) NotDone() bool { 578 return !page.ac.IsEmpty() 579} 580 581// Response returns the raw server response from the last page request. 582func (page APICollectionPage) Response() APICollection { 583 return page.ac 584} 585 586// Values returns the slice of values for the current page or nil if there are no values. 587func (page APICollectionPage) Values() []APIContract { 588 if page.ac.IsEmpty() { 589 return nil 590 } 591 return *page.ac.Value 592} 593 594// Creates a new instance of the APICollectionPage type. 595func NewAPICollectionPage(cur APICollection, getNextPage func(context.Context, APICollection) (APICollection, error)) APICollectionPage { 596 return APICollectionPage{ 597 fn: getNextPage, 598 ac: cur, 599 } 600} 601 602// APIContract api details. 603type APIContract struct { 604 autorest.Response `json:"-"` 605 // APIContractProperties - Api entity contract properties. 606 *APIContractProperties `json:"properties,omitempty"` 607 // ID - READ-ONLY; Resource ID. 608 ID *string `json:"id,omitempty"` 609 // Name - READ-ONLY; Resource name. 610 Name *string `json:"name,omitempty"` 611 // Type - READ-ONLY; Resource type for API Management resource. 612 Type *string `json:"type,omitempty"` 613} 614 615// MarshalJSON is the custom marshaler for APIContract. 616func (ac APIContract) MarshalJSON() ([]byte, error) { 617 objectMap := make(map[string]interface{}) 618 if ac.APIContractProperties != nil { 619 objectMap["properties"] = ac.APIContractProperties 620 } 621 return json.Marshal(objectMap) 622} 623 624// UnmarshalJSON is the custom unmarshaler for APIContract struct. 625func (ac *APIContract) UnmarshalJSON(body []byte) error { 626 var m map[string]*json.RawMessage 627 err := json.Unmarshal(body, &m) 628 if err != nil { 629 return err 630 } 631 for k, v := range m { 632 switch k { 633 case "properties": 634 if v != nil { 635 var APIContractProperties APIContractProperties 636 err = json.Unmarshal(*v, &APIContractProperties) 637 if err != nil { 638 return err 639 } 640 ac.APIContractProperties = &APIContractProperties 641 } 642 case "id": 643 if v != nil { 644 var ID string 645 err = json.Unmarshal(*v, &ID) 646 if err != nil { 647 return err 648 } 649 ac.ID = &ID 650 } 651 case "name": 652 if v != nil { 653 var name string 654 err = json.Unmarshal(*v, &name) 655 if err != nil { 656 return err 657 } 658 ac.Name = &name 659 } 660 case "type": 661 if v != nil { 662 var typeVar string 663 err = json.Unmarshal(*v, &typeVar) 664 if err != nil { 665 return err 666 } 667 ac.Type = &typeVar 668 } 669 } 670 } 671 672 return nil 673} 674 675// APIContractProperties api Entity Properties 676type APIContractProperties struct { 677 // SourceAPIID - API identifier of the source API. 678 SourceAPIID *string `json:"sourceApiId,omitempty"` 679 // DisplayName - API name. Must be 1 to 300 characters long. 680 DisplayName *string `json:"displayName,omitempty"` 681 // ServiceURL - Absolute URL of the backend service implementing this API. Cannot be more than 2000 characters long. 682 ServiceURL *string `json:"serviceUrl,omitempty"` 683 // Path - Relative URL uniquely identifying this API and all of its resource paths within the API Management service instance. It is appended to the API endpoint base URL specified during the service instance creation to form a public URL for this API. 684 Path *string `json:"path,omitempty"` 685 // Protocols - Describes on which protocols the operations in this API can be invoked. 686 Protocols *[]Protocol `json:"protocols,omitempty"` 687 // APIVersionSet - Version set details 688 APIVersionSet *APIVersionSetContractDetails `json:"apiVersionSet,omitempty"` 689 // Description - Description of the API. May include HTML formatting tags. 690 Description *string `json:"description,omitempty"` 691 // AuthenticationSettings - Collection of authentication settings included into this API. 692 AuthenticationSettings *AuthenticationSettingsContract `json:"authenticationSettings,omitempty"` 693 // SubscriptionKeyParameterNames - Protocols over which API is made available. 694 SubscriptionKeyParameterNames *SubscriptionKeyParameterNamesContract `json:"subscriptionKeyParameterNames,omitempty"` 695 // APIType - Type of API. Possible values include: 'HTTP', 'Soap' 696 APIType APIType `json:"type,omitempty"` 697 // APIRevision - Describes the Revision of the Api. If no value is provided, default revision 1 is created 698 APIRevision *string `json:"apiRevision,omitempty"` 699 // APIVersion - Indicates the Version identifier of the API if the API is versioned 700 APIVersion *string `json:"apiVersion,omitempty"` 701 // IsCurrent - Indicates if API revision is current api revision. 702 IsCurrent *bool `json:"isCurrent,omitempty"` 703 // IsOnline - READ-ONLY; Indicates if API revision is accessible via the gateway. 704 IsOnline *bool `json:"isOnline,omitempty"` 705 // APIRevisionDescription - Description of the Api Revision. 706 APIRevisionDescription *string `json:"apiRevisionDescription,omitempty"` 707 // APIVersionDescription - Description of the Api Version. 708 APIVersionDescription *string `json:"apiVersionDescription,omitempty"` 709 // APIVersionSetID - A resource identifier for the related ApiVersionSet. 710 APIVersionSetID *string `json:"apiVersionSetId,omitempty"` 711 // SubscriptionRequired - Specifies whether an API or Product subscription is required for accessing the API. 712 SubscriptionRequired *bool `json:"subscriptionRequired,omitempty"` 713} 714 715// MarshalJSON is the custom marshaler for APIContractProperties. 716func (acp APIContractProperties) MarshalJSON() ([]byte, error) { 717 objectMap := make(map[string]interface{}) 718 if acp.SourceAPIID != nil { 719 objectMap["sourceApiId"] = acp.SourceAPIID 720 } 721 if acp.DisplayName != nil { 722 objectMap["displayName"] = acp.DisplayName 723 } 724 if acp.ServiceURL != nil { 725 objectMap["serviceUrl"] = acp.ServiceURL 726 } 727 if acp.Path != nil { 728 objectMap["path"] = acp.Path 729 } 730 if acp.Protocols != nil { 731 objectMap["protocols"] = acp.Protocols 732 } 733 if acp.APIVersionSet != nil { 734 objectMap["apiVersionSet"] = acp.APIVersionSet 735 } 736 if acp.Description != nil { 737 objectMap["description"] = acp.Description 738 } 739 if acp.AuthenticationSettings != nil { 740 objectMap["authenticationSettings"] = acp.AuthenticationSettings 741 } 742 if acp.SubscriptionKeyParameterNames != nil { 743 objectMap["subscriptionKeyParameterNames"] = acp.SubscriptionKeyParameterNames 744 } 745 if acp.APIType != "" { 746 objectMap["type"] = acp.APIType 747 } 748 if acp.APIRevision != nil { 749 objectMap["apiRevision"] = acp.APIRevision 750 } 751 if acp.APIVersion != nil { 752 objectMap["apiVersion"] = acp.APIVersion 753 } 754 if acp.IsCurrent != nil { 755 objectMap["isCurrent"] = acp.IsCurrent 756 } 757 if acp.APIRevisionDescription != nil { 758 objectMap["apiRevisionDescription"] = acp.APIRevisionDescription 759 } 760 if acp.APIVersionDescription != nil { 761 objectMap["apiVersionDescription"] = acp.APIVersionDescription 762 } 763 if acp.APIVersionSetID != nil { 764 objectMap["apiVersionSetId"] = acp.APIVersionSetID 765 } 766 if acp.SubscriptionRequired != nil { 767 objectMap["subscriptionRequired"] = acp.SubscriptionRequired 768 } 769 return json.Marshal(objectMap) 770} 771 772// APIContractUpdateProperties API update contract properties. 773type APIContractUpdateProperties struct { 774 // DisplayName - API name. 775 DisplayName *string `json:"displayName,omitempty"` 776 // ServiceURL - Absolute URL of the backend service implementing this API. 777 ServiceURL *string `json:"serviceUrl,omitempty"` 778 // Path - Relative URL uniquely identifying this API and all of its resource paths within the API Management service instance. It is appended to the API endpoint base URL specified during the service instance creation to form a public URL for this API. 779 Path *string `json:"path,omitempty"` 780 // Protocols - Describes on which protocols the operations in this API can be invoked. 781 Protocols *[]Protocol `json:"protocols,omitempty"` 782 // Description - Description of the API. May include HTML formatting tags. 783 Description *string `json:"description,omitempty"` 784 // AuthenticationSettings - Collection of authentication settings included into this API. 785 AuthenticationSettings *AuthenticationSettingsContract `json:"authenticationSettings,omitempty"` 786 // SubscriptionKeyParameterNames - Protocols over which API is made available. 787 SubscriptionKeyParameterNames *SubscriptionKeyParameterNamesContract `json:"subscriptionKeyParameterNames,omitempty"` 788 // APIType - Type of API. Possible values include: 'HTTP', 'Soap' 789 APIType APIType `json:"type,omitempty"` 790 // APIRevision - Describes the Revision of the Api. If no value is provided, default revision 1 is created 791 APIRevision *string `json:"apiRevision,omitempty"` 792 // APIVersion - Indicates the Version identifier of the API if the API is versioned 793 APIVersion *string `json:"apiVersion,omitempty"` 794 // IsCurrent - Indicates if API revision is current api revision. 795 IsCurrent *bool `json:"isCurrent,omitempty"` 796 // IsOnline - READ-ONLY; Indicates if API revision is accessible via the gateway. 797 IsOnline *bool `json:"isOnline,omitempty"` 798 // APIRevisionDescription - Description of the Api Revision. 799 APIRevisionDescription *string `json:"apiRevisionDescription,omitempty"` 800 // APIVersionDescription - Description of the Api Version. 801 APIVersionDescription *string `json:"apiVersionDescription,omitempty"` 802 // APIVersionSetID - A resource identifier for the related ApiVersionSet. 803 APIVersionSetID *string `json:"apiVersionSetId,omitempty"` 804 // SubscriptionRequired - Specifies whether an API or Product subscription is required for accessing the API. 805 SubscriptionRequired *bool `json:"subscriptionRequired,omitempty"` 806} 807 808// MarshalJSON is the custom marshaler for APIContractUpdateProperties. 809func (acup APIContractUpdateProperties) MarshalJSON() ([]byte, error) { 810 objectMap := make(map[string]interface{}) 811 if acup.DisplayName != nil { 812 objectMap["displayName"] = acup.DisplayName 813 } 814 if acup.ServiceURL != nil { 815 objectMap["serviceUrl"] = acup.ServiceURL 816 } 817 if acup.Path != nil { 818 objectMap["path"] = acup.Path 819 } 820 if acup.Protocols != nil { 821 objectMap["protocols"] = acup.Protocols 822 } 823 if acup.Description != nil { 824 objectMap["description"] = acup.Description 825 } 826 if acup.AuthenticationSettings != nil { 827 objectMap["authenticationSettings"] = acup.AuthenticationSettings 828 } 829 if acup.SubscriptionKeyParameterNames != nil { 830 objectMap["subscriptionKeyParameterNames"] = acup.SubscriptionKeyParameterNames 831 } 832 if acup.APIType != "" { 833 objectMap["type"] = acup.APIType 834 } 835 if acup.APIRevision != nil { 836 objectMap["apiRevision"] = acup.APIRevision 837 } 838 if acup.APIVersion != nil { 839 objectMap["apiVersion"] = acup.APIVersion 840 } 841 if acup.IsCurrent != nil { 842 objectMap["isCurrent"] = acup.IsCurrent 843 } 844 if acup.APIRevisionDescription != nil { 845 objectMap["apiRevisionDescription"] = acup.APIRevisionDescription 846 } 847 if acup.APIVersionDescription != nil { 848 objectMap["apiVersionDescription"] = acup.APIVersionDescription 849 } 850 if acup.APIVersionSetID != nil { 851 objectMap["apiVersionSetId"] = acup.APIVersionSetID 852 } 853 if acup.SubscriptionRequired != nil { 854 objectMap["subscriptionRequired"] = acup.SubscriptionRequired 855 } 856 return json.Marshal(objectMap) 857} 858 859// APICreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 860// operation. 861type APICreateOrUpdateFuture struct { 862 azure.FutureAPI 863 // Result returns the result of the asynchronous operation. 864 // If the operation has not completed it will return an error. 865 Result func(APIClient) (APIContract, error) 866} 867 868// UnmarshalJSON is the custom unmarshaller for CreateFuture. 869func (future *APICreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 870 var azFuture azure.Future 871 if err := json.Unmarshal(body, &azFuture); err != nil { 872 return err 873 } 874 future.FutureAPI = &azFuture 875 future.Result = future.result 876 return nil 877} 878 879// result is the default implementation for APICreateOrUpdateFuture.Result. 880func (future *APICreateOrUpdateFuture) result(client APIClient) (ac APIContract, err error) { 881 var done bool 882 done, err = future.DoneWithContext(context.Background(), client) 883 if err != nil { 884 err = autorest.NewErrorWithError(err, "apimanagement.APICreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 885 return 886 } 887 if !done { 888 ac.Response.Response = future.Response() 889 err = azure.NewAsyncOpIncompleteError("apimanagement.APICreateOrUpdateFuture") 890 return 891 } 892 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 893 if ac.Response.Response, err = future.GetResult(sender); err == nil && ac.Response.Response.StatusCode != http.StatusNoContent { 894 ac, err = client.CreateOrUpdateResponder(ac.Response.Response) 895 if err != nil { 896 err = autorest.NewErrorWithError(err, "apimanagement.APICreateOrUpdateFuture", "Result", ac.Response.Response, "Failure responding to request") 897 } 898 } 899 return 900} 901 902// APICreateOrUpdateParameter API Create or Update Parameters. 903type APICreateOrUpdateParameter struct { 904 // APICreateOrUpdateProperties - Api entity create of update properties. 905 *APICreateOrUpdateProperties `json:"properties,omitempty"` 906} 907 908// MarshalJSON is the custom marshaler for APICreateOrUpdateParameter. 909func (acoup APICreateOrUpdateParameter) MarshalJSON() ([]byte, error) { 910 objectMap := make(map[string]interface{}) 911 if acoup.APICreateOrUpdateProperties != nil { 912 objectMap["properties"] = acoup.APICreateOrUpdateProperties 913 } 914 return json.Marshal(objectMap) 915} 916 917// UnmarshalJSON is the custom unmarshaler for APICreateOrUpdateParameter struct. 918func (acoup *APICreateOrUpdateParameter) UnmarshalJSON(body []byte) error { 919 var m map[string]*json.RawMessage 920 err := json.Unmarshal(body, &m) 921 if err != nil { 922 return err 923 } 924 for k, v := range m { 925 switch k { 926 case "properties": 927 if v != nil { 928 var APICreateOrUpdateProperties APICreateOrUpdateProperties 929 err = json.Unmarshal(*v, &APICreateOrUpdateProperties) 930 if err != nil { 931 return err 932 } 933 acoup.APICreateOrUpdateProperties = &APICreateOrUpdateProperties 934 } 935 } 936 } 937 938 return nil 939} 940 941// APICreateOrUpdateProperties api Create or Update Properties. 942type APICreateOrUpdateProperties struct { 943 // Value - Content value when Importing an API. 944 Value *string `json:"value,omitempty"` 945 // Format - Format of the Content in which the API is getting imported. Possible values include: 'WadlXML', 'WadlLinkJSON', 'SwaggerJSON', 'SwaggerLinkJSON', 'Wsdl', 'WsdlLink', 'Openapi', 'Openapijson', 'OpenapiLink', 'OpenapijsonLink' 946 Format ContentFormat `json:"format,omitempty"` 947 // WsdlSelector - Criteria to limit import of WSDL to a subset of the document. 948 WsdlSelector *APICreateOrUpdatePropertiesWsdlSelector `json:"wsdlSelector,omitempty"` 949 // SoapAPIType - Type of Api to create. 950 // * `http` creates a SOAP to REST API 951 // * `soap` creates a SOAP pass-through API. Possible values include: 'SoapToRest', 'SoapPassThrough' 952 SoapAPIType SoapAPIType `json:"apiType,omitempty"` 953 // SourceAPIID - API identifier of the source API. 954 SourceAPIID *string `json:"sourceApiId,omitempty"` 955 // DisplayName - API name. Must be 1 to 300 characters long. 956 DisplayName *string `json:"displayName,omitempty"` 957 // ServiceURL - Absolute URL of the backend service implementing this API. Cannot be more than 2000 characters long. 958 ServiceURL *string `json:"serviceUrl,omitempty"` 959 // Path - Relative URL uniquely identifying this API and all of its resource paths within the API Management service instance. It is appended to the API endpoint base URL specified during the service instance creation to form a public URL for this API. 960 Path *string `json:"path,omitempty"` 961 // Protocols - Describes on which protocols the operations in this API can be invoked. 962 Protocols *[]Protocol `json:"protocols,omitempty"` 963 // APIVersionSet - Version set details 964 APIVersionSet *APIVersionSetContractDetails `json:"apiVersionSet,omitempty"` 965 // Description - Description of the API. May include HTML formatting tags. 966 Description *string `json:"description,omitempty"` 967 // AuthenticationSettings - Collection of authentication settings included into this API. 968 AuthenticationSettings *AuthenticationSettingsContract `json:"authenticationSettings,omitempty"` 969 // SubscriptionKeyParameterNames - Protocols over which API is made available. 970 SubscriptionKeyParameterNames *SubscriptionKeyParameterNamesContract `json:"subscriptionKeyParameterNames,omitempty"` 971 // APIType - Type of API. Possible values include: 'HTTP', 'Soap' 972 APIType APIType `json:"type,omitempty"` 973 // APIRevision - Describes the Revision of the Api. If no value is provided, default revision 1 is created 974 APIRevision *string `json:"apiRevision,omitempty"` 975 // APIVersion - Indicates the Version identifier of the API if the API is versioned 976 APIVersion *string `json:"apiVersion,omitempty"` 977 // IsCurrent - Indicates if API revision is current api revision. 978 IsCurrent *bool `json:"isCurrent,omitempty"` 979 // IsOnline - READ-ONLY; Indicates if API revision is accessible via the gateway. 980 IsOnline *bool `json:"isOnline,omitempty"` 981 // APIRevisionDescription - Description of the Api Revision. 982 APIRevisionDescription *string `json:"apiRevisionDescription,omitempty"` 983 // APIVersionDescription - Description of the Api Version. 984 APIVersionDescription *string `json:"apiVersionDescription,omitempty"` 985 // APIVersionSetID - A resource identifier for the related ApiVersionSet. 986 APIVersionSetID *string `json:"apiVersionSetId,omitempty"` 987 // SubscriptionRequired - Specifies whether an API or Product subscription is required for accessing the API. 988 SubscriptionRequired *bool `json:"subscriptionRequired,omitempty"` 989} 990 991// MarshalJSON is the custom marshaler for APICreateOrUpdateProperties. 992func (acoup APICreateOrUpdateProperties) MarshalJSON() ([]byte, error) { 993 objectMap := make(map[string]interface{}) 994 if acoup.Value != nil { 995 objectMap["value"] = acoup.Value 996 } 997 if acoup.Format != "" { 998 objectMap["format"] = acoup.Format 999 } 1000 if acoup.WsdlSelector != nil { 1001 objectMap["wsdlSelector"] = acoup.WsdlSelector 1002 } 1003 if acoup.SoapAPIType != "" { 1004 objectMap["apiType"] = acoup.SoapAPIType 1005 } 1006 if acoup.SourceAPIID != nil { 1007 objectMap["sourceApiId"] = acoup.SourceAPIID 1008 } 1009 if acoup.DisplayName != nil { 1010 objectMap["displayName"] = acoup.DisplayName 1011 } 1012 if acoup.ServiceURL != nil { 1013 objectMap["serviceUrl"] = acoup.ServiceURL 1014 } 1015 if acoup.Path != nil { 1016 objectMap["path"] = acoup.Path 1017 } 1018 if acoup.Protocols != nil { 1019 objectMap["protocols"] = acoup.Protocols 1020 } 1021 if acoup.APIVersionSet != nil { 1022 objectMap["apiVersionSet"] = acoup.APIVersionSet 1023 } 1024 if acoup.Description != nil { 1025 objectMap["description"] = acoup.Description 1026 } 1027 if acoup.AuthenticationSettings != nil { 1028 objectMap["authenticationSettings"] = acoup.AuthenticationSettings 1029 } 1030 if acoup.SubscriptionKeyParameterNames != nil { 1031 objectMap["subscriptionKeyParameterNames"] = acoup.SubscriptionKeyParameterNames 1032 } 1033 if acoup.APIType != "" { 1034 objectMap["type"] = acoup.APIType 1035 } 1036 if acoup.APIRevision != nil { 1037 objectMap["apiRevision"] = acoup.APIRevision 1038 } 1039 if acoup.APIVersion != nil { 1040 objectMap["apiVersion"] = acoup.APIVersion 1041 } 1042 if acoup.IsCurrent != nil { 1043 objectMap["isCurrent"] = acoup.IsCurrent 1044 } 1045 if acoup.APIRevisionDescription != nil { 1046 objectMap["apiRevisionDescription"] = acoup.APIRevisionDescription 1047 } 1048 if acoup.APIVersionDescription != nil { 1049 objectMap["apiVersionDescription"] = acoup.APIVersionDescription 1050 } 1051 if acoup.APIVersionSetID != nil { 1052 objectMap["apiVersionSetId"] = acoup.APIVersionSetID 1053 } 1054 if acoup.SubscriptionRequired != nil { 1055 objectMap["subscriptionRequired"] = acoup.SubscriptionRequired 1056 } 1057 return json.Marshal(objectMap) 1058} 1059 1060// APICreateOrUpdatePropertiesWsdlSelector criteria to limit import of WSDL to a subset of the document. 1061type APICreateOrUpdatePropertiesWsdlSelector struct { 1062 // WsdlServiceName - Name of service to import from WSDL 1063 WsdlServiceName *string `json:"wsdlServiceName,omitempty"` 1064 // WsdlEndpointName - Name of endpoint(port) to import from WSDL 1065 WsdlEndpointName *string `json:"wsdlEndpointName,omitempty"` 1066} 1067 1068// APIEntityBaseContract API base contract details. 1069type APIEntityBaseContract struct { 1070 // Description - Description of the API. May include HTML formatting tags. 1071 Description *string `json:"description,omitempty"` 1072 // AuthenticationSettings - Collection of authentication settings included into this API. 1073 AuthenticationSettings *AuthenticationSettingsContract `json:"authenticationSettings,omitempty"` 1074 // SubscriptionKeyParameterNames - Protocols over which API is made available. 1075 SubscriptionKeyParameterNames *SubscriptionKeyParameterNamesContract `json:"subscriptionKeyParameterNames,omitempty"` 1076 // APIType - Type of API. Possible values include: 'HTTP', 'Soap' 1077 APIType APIType `json:"type,omitempty"` 1078 // APIRevision - Describes the Revision of the Api. If no value is provided, default revision 1 is created 1079 APIRevision *string `json:"apiRevision,omitempty"` 1080 // APIVersion - Indicates the Version identifier of the API if the API is versioned 1081 APIVersion *string `json:"apiVersion,omitempty"` 1082 // IsCurrent - Indicates if API revision is current api revision. 1083 IsCurrent *bool `json:"isCurrent,omitempty"` 1084 // IsOnline - READ-ONLY; Indicates if API revision is accessible via the gateway. 1085 IsOnline *bool `json:"isOnline,omitempty"` 1086 // APIRevisionDescription - Description of the Api Revision. 1087 APIRevisionDescription *string `json:"apiRevisionDescription,omitempty"` 1088 // APIVersionDescription - Description of the Api Version. 1089 APIVersionDescription *string `json:"apiVersionDescription,omitempty"` 1090 // APIVersionSetID - A resource identifier for the related ApiVersionSet. 1091 APIVersionSetID *string `json:"apiVersionSetId,omitempty"` 1092 // SubscriptionRequired - Specifies whether an API or Product subscription is required for accessing the API. 1093 SubscriptionRequired *bool `json:"subscriptionRequired,omitempty"` 1094} 1095 1096// MarshalJSON is the custom marshaler for APIEntityBaseContract. 1097func (aebc APIEntityBaseContract) MarshalJSON() ([]byte, error) { 1098 objectMap := make(map[string]interface{}) 1099 if aebc.Description != nil { 1100 objectMap["description"] = aebc.Description 1101 } 1102 if aebc.AuthenticationSettings != nil { 1103 objectMap["authenticationSettings"] = aebc.AuthenticationSettings 1104 } 1105 if aebc.SubscriptionKeyParameterNames != nil { 1106 objectMap["subscriptionKeyParameterNames"] = aebc.SubscriptionKeyParameterNames 1107 } 1108 if aebc.APIType != "" { 1109 objectMap["type"] = aebc.APIType 1110 } 1111 if aebc.APIRevision != nil { 1112 objectMap["apiRevision"] = aebc.APIRevision 1113 } 1114 if aebc.APIVersion != nil { 1115 objectMap["apiVersion"] = aebc.APIVersion 1116 } 1117 if aebc.IsCurrent != nil { 1118 objectMap["isCurrent"] = aebc.IsCurrent 1119 } 1120 if aebc.APIRevisionDescription != nil { 1121 objectMap["apiRevisionDescription"] = aebc.APIRevisionDescription 1122 } 1123 if aebc.APIVersionDescription != nil { 1124 objectMap["apiVersionDescription"] = aebc.APIVersionDescription 1125 } 1126 if aebc.APIVersionSetID != nil { 1127 objectMap["apiVersionSetId"] = aebc.APIVersionSetID 1128 } 1129 if aebc.SubscriptionRequired != nil { 1130 objectMap["subscriptionRequired"] = aebc.SubscriptionRequired 1131 } 1132 return json.Marshal(objectMap) 1133} 1134 1135// APIExportResult API Export result. 1136type APIExportResult struct { 1137 autorest.Response `json:"-"` 1138 // ID - ResourceId of the API which was exported. 1139 ID *string `json:"id,omitempty"` 1140 // ExportResultFormat - Format in which the Api Details are exported to the Storage Blob with Sas Key valid for 5 minutes. Possible values include: 'ExportResultFormatSwagger', 'ExportResultFormatWsdl', 'ExportResultFormatWadl', 'ExportResultFormatOpenAPI' 1141 ExportResultFormat ExportResultFormat `json:"format,omitempty"` 1142 // Value - The object defining the schema of the exported Api Detail 1143 Value *APIExportResultValue `json:"value,omitempty"` 1144} 1145 1146// APIExportResultValue the object defining the schema of the exported Api Detail 1147type APIExportResultValue struct { 1148 // Link - Link to the Storage Blob containing the result of the export operation. The Blob Uri is only valid for 5 minutes. 1149 Link *string `json:"link,omitempty"` 1150} 1151 1152// ApimResource the Resource definition. 1153type ApimResource struct { 1154 // ID - READ-ONLY; Resource ID. 1155 ID *string `json:"id,omitempty"` 1156 // Name - READ-ONLY; Resource name. 1157 Name *string `json:"name,omitempty"` 1158 // Type - READ-ONLY; Resource type for API Management resource is set to Microsoft.ApiManagement. 1159 Type *string `json:"type,omitempty"` 1160 // Tags - Resource tags. 1161 Tags map[string]*string `json:"tags"` 1162} 1163 1164// MarshalJSON is the custom marshaler for ApimResource. 1165func (ar ApimResource) MarshalJSON() ([]byte, error) { 1166 objectMap := make(map[string]interface{}) 1167 if ar.Tags != nil { 1168 objectMap["tags"] = ar.Tags 1169 } 1170 return json.Marshal(objectMap) 1171} 1172 1173// APIReleaseCollection paged ApiRelease list representation. 1174type APIReleaseCollection struct { 1175 autorest.Response `json:"-"` 1176 // Value - READ-ONLY; Page values. 1177 Value *[]APIReleaseContract `json:"value,omitempty"` 1178 // Count - Total record count number across all pages. 1179 Count *int64 `json:"count,omitempty"` 1180 // NextLink - READ-ONLY; Next page link if any. 1181 NextLink *string `json:"nextLink,omitempty"` 1182} 1183 1184// MarshalJSON is the custom marshaler for APIReleaseCollection. 1185func (arc APIReleaseCollection) MarshalJSON() ([]byte, error) { 1186 objectMap := make(map[string]interface{}) 1187 if arc.Count != nil { 1188 objectMap["count"] = arc.Count 1189 } 1190 return json.Marshal(objectMap) 1191} 1192 1193// APIReleaseCollectionIterator provides access to a complete listing of APIReleaseContract values. 1194type APIReleaseCollectionIterator struct { 1195 i int 1196 page APIReleaseCollectionPage 1197} 1198 1199// NextWithContext advances to the next value. If there was an error making 1200// the request the iterator does not advance and the error is returned. 1201func (iter *APIReleaseCollectionIterator) NextWithContext(ctx context.Context) (err error) { 1202 if tracing.IsEnabled() { 1203 ctx = tracing.StartSpan(ctx, fqdn+"/APIReleaseCollectionIterator.NextWithContext") 1204 defer func() { 1205 sc := -1 1206 if iter.Response().Response.Response != nil { 1207 sc = iter.Response().Response.Response.StatusCode 1208 } 1209 tracing.EndSpan(ctx, sc, err) 1210 }() 1211 } 1212 iter.i++ 1213 if iter.i < len(iter.page.Values()) { 1214 return nil 1215 } 1216 err = iter.page.NextWithContext(ctx) 1217 if err != nil { 1218 iter.i-- 1219 return err 1220 } 1221 iter.i = 0 1222 return nil 1223} 1224 1225// Next advances to the next value. If there was an error making 1226// the request the iterator does not advance and the error is returned. 1227// Deprecated: Use NextWithContext() instead. 1228func (iter *APIReleaseCollectionIterator) Next() error { 1229 return iter.NextWithContext(context.Background()) 1230} 1231 1232// NotDone returns true if the enumeration should be started or is not yet complete. 1233func (iter APIReleaseCollectionIterator) NotDone() bool { 1234 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 1235} 1236 1237// Response returns the raw server response from the last page request. 1238func (iter APIReleaseCollectionIterator) Response() APIReleaseCollection { 1239 return iter.page.Response() 1240} 1241 1242// Value returns the current value or a zero-initialized value if the 1243// iterator has advanced beyond the end of the collection. 1244func (iter APIReleaseCollectionIterator) Value() APIReleaseContract { 1245 if !iter.page.NotDone() { 1246 return APIReleaseContract{} 1247 } 1248 return iter.page.Values()[iter.i] 1249} 1250 1251// Creates a new instance of the APIReleaseCollectionIterator type. 1252func NewAPIReleaseCollectionIterator(page APIReleaseCollectionPage) APIReleaseCollectionIterator { 1253 return APIReleaseCollectionIterator{page: page} 1254} 1255 1256// IsEmpty returns true if the ListResult contains no values. 1257func (arc APIReleaseCollection) IsEmpty() bool { 1258 return arc.Value == nil || len(*arc.Value) == 0 1259} 1260 1261// hasNextLink returns true if the NextLink is not empty. 1262func (arc APIReleaseCollection) hasNextLink() bool { 1263 return arc.NextLink != nil && len(*arc.NextLink) != 0 1264} 1265 1266// aPIReleaseCollectionPreparer prepares a request to retrieve the next set of results. 1267// It returns nil if no more results exist. 1268func (arc APIReleaseCollection) aPIReleaseCollectionPreparer(ctx context.Context) (*http.Request, error) { 1269 if !arc.hasNextLink() { 1270 return nil, nil 1271 } 1272 return autorest.Prepare((&http.Request{}).WithContext(ctx), 1273 autorest.AsJSON(), 1274 autorest.AsGet(), 1275 autorest.WithBaseURL(to.String(arc.NextLink))) 1276} 1277 1278// APIReleaseCollectionPage contains a page of APIReleaseContract values. 1279type APIReleaseCollectionPage struct { 1280 fn func(context.Context, APIReleaseCollection) (APIReleaseCollection, error) 1281 arc APIReleaseCollection 1282} 1283 1284// NextWithContext advances to the next page of values. If there was an error making 1285// the request the page does not advance and the error is returned. 1286func (page *APIReleaseCollectionPage) NextWithContext(ctx context.Context) (err error) { 1287 if tracing.IsEnabled() { 1288 ctx = tracing.StartSpan(ctx, fqdn+"/APIReleaseCollectionPage.NextWithContext") 1289 defer func() { 1290 sc := -1 1291 if page.Response().Response.Response != nil { 1292 sc = page.Response().Response.Response.StatusCode 1293 } 1294 tracing.EndSpan(ctx, sc, err) 1295 }() 1296 } 1297 for { 1298 next, err := page.fn(ctx, page.arc) 1299 if err != nil { 1300 return err 1301 } 1302 page.arc = next 1303 if !next.hasNextLink() || !next.IsEmpty() { 1304 break 1305 } 1306 } 1307 return nil 1308} 1309 1310// Next advances to the next page of values. If there was an error making 1311// the request the page does not advance and the error is returned. 1312// Deprecated: Use NextWithContext() instead. 1313func (page *APIReleaseCollectionPage) Next() error { 1314 return page.NextWithContext(context.Background()) 1315} 1316 1317// NotDone returns true if the page enumeration should be started or is not yet complete. 1318func (page APIReleaseCollectionPage) NotDone() bool { 1319 return !page.arc.IsEmpty() 1320} 1321 1322// Response returns the raw server response from the last page request. 1323func (page APIReleaseCollectionPage) Response() APIReleaseCollection { 1324 return page.arc 1325} 1326 1327// Values returns the slice of values for the current page or nil if there are no values. 1328func (page APIReleaseCollectionPage) Values() []APIReleaseContract { 1329 if page.arc.IsEmpty() { 1330 return nil 1331 } 1332 return *page.arc.Value 1333} 1334 1335// Creates a new instance of the APIReleaseCollectionPage type. 1336func NewAPIReleaseCollectionPage(cur APIReleaseCollection, getNextPage func(context.Context, APIReleaseCollection) (APIReleaseCollection, error)) APIReleaseCollectionPage { 1337 return APIReleaseCollectionPage{ 1338 fn: getNextPage, 1339 arc: cur, 1340 } 1341} 1342 1343// APIReleaseContract apiRelease details. 1344type APIReleaseContract struct { 1345 autorest.Response `json:"-"` 1346 // APIReleaseContractProperties - ApiRelease entity contract properties. 1347 *APIReleaseContractProperties `json:"properties,omitempty"` 1348 // ID - READ-ONLY; Resource ID. 1349 ID *string `json:"id,omitempty"` 1350 // Name - READ-ONLY; Resource name. 1351 Name *string `json:"name,omitempty"` 1352 // Type - READ-ONLY; Resource type for API Management resource. 1353 Type *string `json:"type,omitempty"` 1354} 1355 1356// MarshalJSON is the custom marshaler for APIReleaseContract. 1357func (arc APIReleaseContract) MarshalJSON() ([]byte, error) { 1358 objectMap := make(map[string]interface{}) 1359 if arc.APIReleaseContractProperties != nil { 1360 objectMap["properties"] = arc.APIReleaseContractProperties 1361 } 1362 return json.Marshal(objectMap) 1363} 1364 1365// UnmarshalJSON is the custom unmarshaler for APIReleaseContract struct. 1366func (arc *APIReleaseContract) UnmarshalJSON(body []byte) error { 1367 var m map[string]*json.RawMessage 1368 err := json.Unmarshal(body, &m) 1369 if err != nil { 1370 return err 1371 } 1372 for k, v := range m { 1373 switch k { 1374 case "properties": 1375 if v != nil { 1376 var APIReleaseContractProperties APIReleaseContractProperties 1377 err = json.Unmarshal(*v, &APIReleaseContractProperties) 1378 if err != nil { 1379 return err 1380 } 1381 arc.APIReleaseContractProperties = &APIReleaseContractProperties 1382 } 1383 case "id": 1384 if v != nil { 1385 var ID string 1386 err = json.Unmarshal(*v, &ID) 1387 if err != nil { 1388 return err 1389 } 1390 arc.ID = &ID 1391 } 1392 case "name": 1393 if v != nil { 1394 var name string 1395 err = json.Unmarshal(*v, &name) 1396 if err != nil { 1397 return err 1398 } 1399 arc.Name = &name 1400 } 1401 case "type": 1402 if v != nil { 1403 var typeVar string 1404 err = json.Unmarshal(*v, &typeVar) 1405 if err != nil { 1406 return err 1407 } 1408 arc.Type = &typeVar 1409 } 1410 } 1411 } 1412 1413 return nil 1414} 1415 1416// APIReleaseContractProperties API Release details 1417type APIReleaseContractProperties struct { 1418 // APIID - Identifier of the API the release belongs to. 1419 APIID *string `json:"apiId,omitempty"` 1420 // CreatedDateTime - READ-ONLY; The time the API was released. The date conforms to the following format: yyyy-MM-ddTHH:mm:ssZ as specified by the ISO 8601 standard. 1421 CreatedDateTime *date.Time `json:"createdDateTime,omitempty"` 1422 // UpdatedDateTime - READ-ONLY; The time the API release was updated. 1423 UpdatedDateTime *date.Time `json:"updatedDateTime,omitempty"` 1424 // Notes - Release Notes 1425 Notes *string `json:"notes,omitempty"` 1426} 1427 1428// MarshalJSON is the custom marshaler for APIReleaseContractProperties. 1429func (arcp APIReleaseContractProperties) MarshalJSON() ([]byte, error) { 1430 objectMap := make(map[string]interface{}) 1431 if arcp.APIID != nil { 1432 objectMap["apiId"] = arcp.APIID 1433 } 1434 if arcp.Notes != nil { 1435 objectMap["notes"] = arcp.Notes 1436 } 1437 return json.Marshal(objectMap) 1438} 1439 1440// APIRevisionCollection paged Api Revision list representation. 1441type APIRevisionCollection struct { 1442 autorest.Response `json:"-"` 1443 // Value - READ-ONLY; Page values. 1444 Value *[]APIRevisionContract `json:"value,omitempty"` 1445 // Count - Total record count number across all pages. 1446 Count *int64 `json:"count,omitempty"` 1447 // NextLink - READ-ONLY; Next page link if any. 1448 NextLink *string `json:"nextLink,omitempty"` 1449} 1450 1451// MarshalJSON is the custom marshaler for APIRevisionCollection. 1452func (arc APIRevisionCollection) MarshalJSON() ([]byte, error) { 1453 objectMap := make(map[string]interface{}) 1454 if arc.Count != nil { 1455 objectMap["count"] = arc.Count 1456 } 1457 return json.Marshal(objectMap) 1458} 1459 1460// APIRevisionCollectionIterator provides access to a complete listing of APIRevisionContract values. 1461type APIRevisionCollectionIterator struct { 1462 i int 1463 page APIRevisionCollectionPage 1464} 1465 1466// NextWithContext advances to the next value. If there was an error making 1467// the request the iterator does not advance and the error is returned. 1468func (iter *APIRevisionCollectionIterator) NextWithContext(ctx context.Context) (err error) { 1469 if tracing.IsEnabled() { 1470 ctx = tracing.StartSpan(ctx, fqdn+"/APIRevisionCollectionIterator.NextWithContext") 1471 defer func() { 1472 sc := -1 1473 if iter.Response().Response.Response != nil { 1474 sc = iter.Response().Response.Response.StatusCode 1475 } 1476 tracing.EndSpan(ctx, sc, err) 1477 }() 1478 } 1479 iter.i++ 1480 if iter.i < len(iter.page.Values()) { 1481 return nil 1482 } 1483 err = iter.page.NextWithContext(ctx) 1484 if err != nil { 1485 iter.i-- 1486 return err 1487 } 1488 iter.i = 0 1489 return nil 1490} 1491 1492// Next advances to the next value. If there was an error making 1493// the request the iterator does not advance and the error is returned. 1494// Deprecated: Use NextWithContext() instead. 1495func (iter *APIRevisionCollectionIterator) Next() error { 1496 return iter.NextWithContext(context.Background()) 1497} 1498 1499// NotDone returns true if the enumeration should be started or is not yet complete. 1500func (iter APIRevisionCollectionIterator) NotDone() bool { 1501 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 1502} 1503 1504// Response returns the raw server response from the last page request. 1505func (iter APIRevisionCollectionIterator) Response() APIRevisionCollection { 1506 return iter.page.Response() 1507} 1508 1509// Value returns the current value or a zero-initialized value if the 1510// iterator has advanced beyond the end of the collection. 1511func (iter APIRevisionCollectionIterator) Value() APIRevisionContract { 1512 if !iter.page.NotDone() { 1513 return APIRevisionContract{} 1514 } 1515 return iter.page.Values()[iter.i] 1516} 1517 1518// Creates a new instance of the APIRevisionCollectionIterator type. 1519func NewAPIRevisionCollectionIterator(page APIRevisionCollectionPage) APIRevisionCollectionIterator { 1520 return APIRevisionCollectionIterator{page: page} 1521} 1522 1523// IsEmpty returns true if the ListResult contains no values. 1524func (arc APIRevisionCollection) IsEmpty() bool { 1525 return arc.Value == nil || len(*arc.Value) == 0 1526} 1527 1528// hasNextLink returns true if the NextLink is not empty. 1529func (arc APIRevisionCollection) hasNextLink() bool { 1530 return arc.NextLink != nil && len(*arc.NextLink) != 0 1531} 1532 1533// aPIRevisionCollectionPreparer prepares a request to retrieve the next set of results. 1534// It returns nil if no more results exist. 1535func (arc APIRevisionCollection) aPIRevisionCollectionPreparer(ctx context.Context) (*http.Request, error) { 1536 if !arc.hasNextLink() { 1537 return nil, nil 1538 } 1539 return autorest.Prepare((&http.Request{}).WithContext(ctx), 1540 autorest.AsJSON(), 1541 autorest.AsGet(), 1542 autorest.WithBaseURL(to.String(arc.NextLink))) 1543} 1544 1545// APIRevisionCollectionPage contains a page of APIRevisionContract values. 1546type APIRevisionCollectionPage struct { 1547 fn func(context.Context, APIRevisionCollection) (APIRevisionCollection, error) 1548 arc APIRevisionCollection 1549} 1550 1551// NextWithContext advances to the next page of values. If there was an error making 1552// the request the page does not advance and the error is returned. 1553func (page *APIRevisionCollectionPage) NextWithContext(ctx context.Context) (err error) { 1554 if tracing.IsEnabled() { 1555 ctx = tracing.StartSpan(ctx, fqdn+"/APIRevisionCollectionPage.NextWithContext") 1556 defer func() { 1557 sc := -1 1558 if page.Response().Response.Response != nil { 1559 sc = page.Response().Response.Response.StatusCode 1560 } 1561 tracing.EndSpan(ctx, sc, err) 1562 }() 1563 } 1564 for { 1565 next, err := page.fn(ctx, page.arc) 1566 if err != nil { 1567 return err 1568 } 1569 page.arc = next 1570 if !next.hasNextLink() || !next.IsEmpty() { 1571 break 1572 } 1573 } 1574 return nil 1575} 1576 1577// Next advances to the next page of values. If there was an error making 1578// the request the page does not advance and the error is returned. 1579// Deprecated: Use NextWithContext() instead. 1580func (page *APIRevisionCollectionPage) Next() error { 1581 return page.NextWithContext(context.Background()) 1582} 1583 1584// NotDone returns true if the page enumeration should be started or is not yet complete. 1585func (page APIRevisionCollectionPage) NotDone() bool { 1586 return !page.arc.IsEmpty() 1587} 1588 1589// Response returns the raw server response from the last page request. 1590func (page APIRevisionCollectionPage) Response() APIRevisionCollection { 1591 return page.arc 1592} 1593 1594// Values returns the slice of values for the current page or nil if there are no values. 1595func (page APIRevisionCollectionPage) Values() []APIRevisionContract { 1596 if page.arc.IsEmpty() { 1597 return nil 1598 } 1599 return *page.arc.Value 1600} 1601 1602// Creates a new instance of the APIRevisionCollectionPage type. 1603func NewAPIRevisionCollectionPage(cur APIRevisionCollection, getNextPage func(context.Context, APIRevisionCollection) (APIRevisionCollection, error)) APIRevisionCollectionPage { 1604 return APIRevisionCollectionPage{ 1605 fn: getNextPage, 1606 arc: cur, 1607 } 1608} 1609 1610// APIRevisionContract summary of revision metadata. 1611type APIRevisionContract struct { 1612 // APIID - READ-ONLY; Identifier of the API Revision. 1613 APIID *string `json:"apiId,omitempty"` 1614 // APIRevision - READ-ONLY; Revision number of API. 1615 APIRevision *string `json:"apiRevision,omitempty"` 1616 // CreatedDateTime - READ-ONLY; The time the API Revision was created. The date conforms to the following format: yyyy-MM-ddTHH:mm:ssZ as specified by the ISO 8601 standard. 1617 CreatedDateTime *date.Time `json:"createdDateTime,omitempty"` 1618 // UpdatedDateTime - READ-ONLY; The time the API Revision were updated. The date conforms to the following format: yyyy-MM-ddTHH:mm:ssZ as specified by the ISO 8601 standard. 1619 UpdatedDateTime *date.Time `json:"updatedDateTime,omitempty"` 1620 // Description - READ-ONLY; Description of the API Revision. 1621 Description *string `json:"description,omitempty"` 1622 // PrivateURL - READ-ONLY; Gateway URL for accessing the non-current API Revision. 1623 PrivateURL *string `json:"privateUrl,omitempty"` 1624 // IsOnline - READ-ONLY; Indicates if API revision is the current api revision. 1625 IsOnline *bool `json:"isOnline,omitempty"` 1626 // IsCurrent - READ-ONLY; Indicates if API revision is accessible via the gateway. 1627 IsCurrent *bool `json:"isCurrent,omitempty"` 1628} 1629 1630// MarshalJSON is the custom marshaler for APIRevisionContract. 1631func (arc APIRevisionContract) MarshalJSON() ([]byte, error) { 1632 objectMap := make(map[string]interface{}) 1633 return json.Marshal(objectMap) 1634} 1635 1636// APIRevisionInfoContract object used to create an API Revision or Version based on an existing API 1637// Revision 1638type APIRevisionInfoContract struct { 1639 // SourceAPIID - Resource identifier of API to be used to create the revision from. 1640 SourceAPIID *string `json:"sourceApiId,omitempty"` 1641 // APIVersionName - Version identifier for the new API Version. 1642 APIVersionName *string `json:"apiVersionName,omitempty"` 1643 // APIRevisionDescription - Description of new API Revision. 1644 APIRevisionDescription *string `json:"apiRevisionDescription,omitempty"` 1645 // APIVersionSet - Version set details 1646 APIVersionSet *APIVersionSetContractDetails `json:"apiVersionSet,omitempty"` 1647} 1648 1649// APISchemaCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 1650// operation. 1651type APISchemaCreateOrUpdateFuture struct { 1652 azure.FutureAPI 1653 // Result returns the result of the asynchronous operation. 1654 // If the operation has not completed it will return an error. 1655 Result func(APISchemaClient) (SchemaContract, error) 1656} 1657 1658// UnmarshalJSON is the custom unmarshaller for CreateFuture. 1659func (future *APISchemaCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 1660 var azFuture azure.Future 1661 if err := json.Unmarshal(body, &azFuture); err != nil { 1662 return err 1663 } 1664 future.FutureAPI = &azFuture 1665 future.Result = future.result 1666 return nil 1667} 1668 1669// result is the default implementation for APISchemaCreateOrUpdateFuture.Result. 1670func (future *APISchemaCreateOrUpdateFuture) result(client APISchemaClient) (sc SchemaContract, err error) { 1671 var done bool 1672 done, err = future.DoneWithContext(context.Background(), client) 1673 if err != nil { 1674 err = autorest.NewErrorWithError(err, "apimanagement.APISchemaCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 1675 return 1676 } 1677 if !done { 1678 sc.Response.Response = future.Response() 1679 err = azure.NewAsyncOpIncompleteError("apimanagement.APISchemaCreateOrUpdateFuture") 1680 return 1681 } 1682 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 1683 if sc.Response.Response, err = future.GetResult(sender); err == nil && sc.Response.Response.StatusCode != http.StatusNoContent { 1684 sc, err = client.CreateOrUpdateResponder(sc.Response.Response) 1685 if err != nil { 1686 err = autorest.NewErrorWithError(err, "apimanagement.APISchemaCreateOrUpdateFuture", "Result", sc.Response.Response, "Failure responding to request") 1687 } 1688 } 1689 return 1690} 1691 1692// APITagResourceContractProperties API contract properties for the Tag Resources. 1693type APITagResourceContractProperties struct { 1694 // ID - API identifier in the form /apis/{apiId}. 1695 ID *string `json:"id,omitempty"` 1696 // Name - API name. 1697 Name *string `json:"name,omitempty"` 1698 // ServiceURL - Absolute URL of the backend service implementing this API. 1699 ServiceURL *string `json:"serviceUrl,omitempty"` 1700 // Path - Relative URL uniquely identifying this API and all of its resource paths within the API Management service instance. It is appended to the API endpoint base URL specified during the service instance creation to form a public URL for this API. 1701 Path *string `json:"path,omitempty"` 1702 // Protocols - Describes on which protocols the operations in this API can be invoked. 1703 Protocols *[]Protocol `json:"protocols,omitempty"` 1704 // Description - Description of the API. May include HTML formatting tags. 1705 Description *string `json:"description,omitempty"` 1706 // AuthenticationSettings - Collection of authentication settings included into this API. 1707 AuthenticationSettings *AuthenticationSettingsContract `json:"authenticationSettings,omitempty"` 1708 // SubscriptionKeyParameterNames - Protocols over which API is made available. 1709 SubscriptionKeyParameterNames *SubscriptionKeyParameterNamesContract `json:"subscriptionKeyParameterNames,omitempty"` 1710 // APIType - Type of API. Possible values include: 'HTTP', 'Soap' 1711 APIType APIType `json:"type,omitempty"` 1712 // APIRevision - Describes the Revision of the Api. If no value is provided, default revision 1 is created 1713 APIRevision *string `json:"apiRevision,omitempty"` 1714 // APIVersion - Indicates the Version identifier of the API if the API is versioned 1715 APIVersion *string `json:"apiVersion,omitempty"` 1716 // IsCurrent - Indicates if API revision is current api revision. 1717 IsCurrent *bool `json:"isCurrent,omitempty"` 1718 // IsOnline - READ-ONLY; Indicates if API revision is accessible via the gateway. 1719 IsOnline *bool `json:"isOnline,omitempty"` 1720 // APIRevisionDescription - Description of the Api Revision. 1721 APIRevisionDescription *string `json:"apiRevisionDescription,omitempty"` 1722 // APIVersionDescription - Description of the Api Version. 1723 APIVersionDescription *string `json:"apiVersionDescription,omitempty"` 1724 // APIVersionSetID - A resource identifier for the related ApiVersionSet. 1725 APIVersionSetID *string `json:"apiVersionSetId,omitempty"` 1726 // SubscriptionRequired - Specifies whether an API or Product subscription is required for accessing the API. 1727 SubscriptionRequired *bool `json:"subscriptionRequired,omitempty"` 1728} 1729 1730// MarshalJSON is the custom marshaler for APITagResourceContractProperties. 1731func (atrcp APITagResourceContractProperties) MarshalJSON() ([]byte, error) { 1732 objectMap := make(map[string]interface{}) 1733 if atrcp.ID != nil { 1734 objectMap["id"] = atrcp.ID 1735 } 1736 if atrcp.Name != nil { 1737 objectMap["name"] = atrcp.Name 1738 } 1739 if atrcp.ServiceURL != nil { 1740 objectMap["serviceUrl"] = atrcp.ServiceURL 1741 } 1742 if atrcp.Path != nil { 1743 objectMap["path"] = atrcp.Path 1744 } 1745 if atrcp.Protocols != nil { 1746 objectMap["protocols"] = atrcp.Protocols 1747 } 1748 if atrcp.Description != nil { 1749 objectMap["description"] = atrcp.Description 1750 } 1751 if atrcp.AuthenticationSettings != nil { 1752 objectMap["authenticationSettings"] = atrcp.AuthenticationSettings 1753 } 1754 if atrcp.SubscriptionKeyParameterNames != nil { 1755 objectMap["subscriptionKeyParameterNames"] = atrcp.SubscriptionKeyParameterNames 1756 } 1757 if atrcp.APIType != "" { 1758 objectMap["type"] = atrcp.APIType 1759 } 1760 if atrcp.APIRevision != nil { 1761 objectMap["apiRevision"] = atrcp.APIRevision 1762 } 1763 if atrcp.APIVersion != nil { 1764 objectMap["apiVersion"] = atrcp.APIVersion 1765 } 1766 if atrcp.IsCurrent != nil { 1767 objectMap["isCurrent"] = atrcp.IsCurrent 1768 } 1769 if atrcp.APIRevisionDescription != nil { 1770 objectMap["apiRevisionDescription"] = atrcp.APIRevisionDescription 1771 } 1772 if atrcp.APIVersionDescription != nil { 1773 objectMap["apiVersionDescription"] = atrcp.APIVersionDescription 1774 } 1775 if atrcp.APIVersionSetID != nil { 1776 objectMap["apiVersionSetId"] = atrcp.APIVersionSetID 1777 } 1778 if atrcp.SubscriptionRequired != nil { 1779 objectMap["subscriptionRequired"] = atrcp.SubscriptionRequired 1780 } 1781 return json.Marshal(objectMap) 1782} 1783 1784// APIUpdateContract API update contract details. 1785type APIUpdateContract struct { 1786 // APIContractUpdateProperties - Properties of the API entity that can be updated. 1787 *APIContractUpdateProperties `json:"properties,omitempty"` 1788} 1789 1790// MarshalJSON is the custom marshaler for APIUpdateContract. 1791func (auc APIUpdateContract) MarshalJSON() ([]byte, error) { 1792 objectMap := make(map[string]interface{}) 1793 if auc.APIContractUpdateProperties != nil { 1794 objectMap["properties"] = auc.APIContractUpdateProperties 1795 } 1796 return json.Marshal(objectMap) 1797} 1798 1799// UnmarshalJSON is the custom unmarshaler for APIUpdateContract struct. 1800func (auc *APIUpdateContract) UnmarshalJSON(body []byte) error { 1801 var m map[string]*json.RawMessage 1802 err := json.Unmarshal(body, &m) 1803 if err != nil { 1804 return err 1805 } 1806 for k, v := range m { 1807 switch k { 1808 case "properties": 1809 if v != nil { 1810 var APIContractUpdateProperties APIContractUpdateProperties 1811 err = json.Unmarshal(*v, &APIContractUpdateProperties) 1812 if err != nil { 1813 return err 1814 } 1815 auc.APIContractUpdateProperties = &APIContractUpdateProperties 1816 } 1817 } 1818 } 1819 1820 return nil 1821} 1822 1823// APIVersionConstraint control Plane Apis version constraint for the API Management service. 1824type APIVersionConstraint struct { 1825 // MinAPIVersion - Limit control plane API calls to API Management service with version equal to or newer than this value. 1826 MinAPIVersion *string `json:"minApiVersion,omitempty"` 1827} 1828 1829// APIVersionSetCollection paged Api Version Set list representation. 1830type APIVersionSetCollection struct { 1831 autorest.Response `json:"-"` 1832 // Value - Page values. 1833 Value *[]APIVersionSetContract `json:"value,omitempty"` 1834 // Count - Total record count number across all pages. 1835 Count *int64 `json:"count,omitempty"` 1836 // NextLink - Next page link if any. 1837 NextLink *string `json:"nextLink,omitempty"` 1838} 1839 1840// APIVersionSetCollectionIterator provides access to a complete listing of APIVersionSetContract values. 1841type APIVersionSetCollectionIterator struct { 1842 i int 1843 page APIVersionSetCollectionPage 1844} 1845 1846// NextWithContext advances to the next value. If there was an error making 1847// the request the iterator does not advance and the error is returned. 1848func (iter *APIVersionSetCollectionIterator) NextWithContext(ctx context.Context) (err error) { 1849 if tracing.IsEnabled() { 1850 ctx = tracing.StartSpan(ctx, fqdn+"/APIVersionSetCollectionIterator.NextWithContext") 1851 defer func() { 1852 sc := -1 1853 if iter.Response().Response.Response != nil { 1854 sc = iter.Response().Response.Response.StatusCode 1855 } 1856 tracing.EndSpan(ctx, sc, err) 1857 }() 1858 } 1859 iter.i++ 1860 if iter.i < len(iter.page.Values()) { 1861 return nil 1862 } 1863 err = iter.page.NextWithContext(ctx) 1864 if err != nil { 1865 iter.i-- 1866 return err 1867 } 1868 iter.i = 0 1869 return nil 1870} 1871 1872// Next advances to the next value. If there was an error making 1873// the request the iterator does not advance and the error is returned. 1874// Deprecated: Use NextWithContext() instead. 1875func (iter *APIVersionSetCollectionIterator) Next() error { 1876 return iter.NextWithContext(context.Background()) 1877} 1878 1879// NotDone returns true if the enumeration should be started or is not yet complete. 1880func (iter APIVersionSetCollectionIterator) NotDone() bool { 1881 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 1882} 1883 1884// Response returns the raw server response from the last page request. 1885func (iter APIVersionSetCollectionIterator) Response() APIVersionSetCollection { 1886 return iter.page.Response() 1887} 1888 1889// Value returns the current value or a zero-initialized value if the 1890// iterator has advanced beyond the end of the collection. 1891func (iter APIVersionSetCollectionIterator) Value() APIVersionSetContract { 1892 if !iter.page.NotDone() { 1893 return APIVersionSetContract{} 1894 } 1895 return iter.page.Values()[iter.i] 1896} 1897 1898// Creates a new instance of the APIVersionSetCollectionIterator type. 1899func NewAPIVersionSetCollectionIterator(page APIVersionSetCollectionPage) APIVersionSetCollectionIterator { 1900 return APIVersionSetCollectionIterator{page: page} 1901} 1902 1903// IsEmpty returns true if the ListResult contains no values. 1904func (avsc APIVersionSetCollection) IsEmpty() bool { 1905 return avsc.Value == nil || len(*avsc.Value) == 0 1906} 1907 1908// hasNextLink returns true if the NextLink is not empty. 1909func (avsc APIVersionSetCollection) hasNextLink() bool { 1910 return avsc.NextLink != nil && len(*avsc.NextLink) != 0 1911} 1912 1913// aPIVersionSetCollectionPreparer prepares a request to retrieve the next set of results. 1914// It returns nil if no more results exist. 1915func (avsc APIVersionSetCollection) aPIVersionSetCollectionPreparer(ctx context.Context) (*http.Request, error) { 1916 if !avsc.hasNextLink() { 1917 return nil, nil 1918 } 1919 return autorest.Prepare((&http.Request{}).WithContext(ctx), 1920 autorest.AsJSON(), 1921 autorest.AsGet(), 1922 autorest.WithBaseURL(to.String(avsc.NextLink))) 1923} 1924 1925// APIVersionSetCollectionPage contains a page of APIVersionSetContract values. 1926type APIVersionSetCollectionPage struct { 1927 fn func(context.Context, APIVersionSetCollection) (APIVersionSetCollection, error) 1928 avsc APIVersionSetCollection 1929} 1930 1931// NextWithContext advances to the next page of values. If there was an error making 1932// the request the page does not advance and the error is returned. 1933func (page *APIVersionSetCollectionPage) NextWithContext(ctx context.Context) (err error) { 1934 if tracing.IsEnabled() { 1935 ctx = tracing.StartSpan(ctx, fqdn+"/APIVersionSetCollectionPage.NextWithContext") 1936 defer func() { 1937 sc := -1 1938 if page.Response().Response.Response != nil { 1939 sc = page.Response().Response.Response.StatusCode 1940 } 1941 tracing.EndSpan(ctx, sc, err) 1942 }() 1943 } 1944 for { 1945 next, err := page.fn(ctx, page.avsc) 1946 if err != nil { 1947 return err 1948 } 1949 page.avsc = next 1950 if !next.hasNextLink() || !next.IsEmpty() { 1951 break 1952 } 1953 } 1954 return nil 1955} 1956 1957// Next advances to the next page of values. If there was an error making 1958// the request the page does not advance and the error is returned. 1959// Deprecated: Use NextWithContext() instead. 1960func (page *APIVersionSetCollectionPage) Next() error { 1961 return page.NextWithContext(context.Background()) 1962} 1963 1964// NotDone returns true if the page enumeration should be started or is not yet complete. 1965func (page APIVersionSetCollectionPage) NotDone() bool { 1966 return !page.avsc.IsEmpty() 1967} 1968 1969// Response returns the raw server response from the last page request. 1970func (page APIVersionSetCollectionPage) Response() APIVersionSetCollection { 1971 return page.avsc 1972} 1973 1974// Values returns the slice of values for the current page or nil if there are no values. 1975func (page APIVersionSetCollectionPage) Values() []APIVersionSetContract { 1976 if page.avsc.IsEmpty() { 1977 return nil 1978 } 1979 return *page.avsc.Value 1980} 1981 1982// Creates a new instance of the APIVersionSetCollectionPage type. 1983func NewAPIVersionSetCollectionPage(cur APIVersionSetCollection, getNextPage func(context.Context, APIVersionSetCollection) (APIVersionSetCollection, error)) APIVersionSetCollectionPage { 1984 return APIVersionSetCollectionPage{ 1985 fn: getNextPage, 1986 avsc: cur, 1987 } 1988} 1989 1990// APIVersionSetContract api Version Set Contract details. 1991type APIVersionSetContract struct { 1992 autorest.Response `json:"-"` 1993 // APIVersionSetContractProperties - Api VersionSet contract properties. 1994 *APIVersionSetContractProperties `json:"properties,omitempty"` 1995 // ID - READ-ONLY; Resource ID. 1996 ID *string `json:"id,omitempty"` 1997 // Name - READ-ONLY; Resource name. 1998 Name *string `json:"name,omitempty"` 1999 // Type - READ-ONLY; Resource type for API Management resource. 2000 Type *string `json:"type,omitempty"` 2001} 2002 2003// MarshalJSON is the custom marshaler for APIVersionSetContract. 2004func (avsc APIVersionSetContract) MarshalJSON() ([]byte, error) { 2005 objectMap := make(map[string]interface{}) 2006 if avsc.APIVersionSetContractProperties != nil { 2007 objectMap["properties"] = avsc.APIVersionSetContractProperties 2008 } 2009 return json.Marshal(objectMap) 2010} 2011 2012// UnmarshalJSON is the custom unmarshaler for APIVersionSetContract struct. 2013func (avsc *APIVersionSetContract) UnmarshalJSON(body []byte) error { 2014 var m map[string]*json.RawMessage 2015 err := json.Unmarshal(body, &m) 2016 if err != nil { 2017 return err 2018 } 2019 for k, v := range m { 2020 switch k { 2021 case "properties": 2022 if v != nil { 2023 var APIVersionSetContractProperties APIVersionSetContractProperties 2024 err = json.Unmarshal(*v, &APIVersionSetContractProperties) 2025 if err != nil { 2026 return err 2027 } 2028 avsc.APIVersionSetContractProperties = &APIVersionSetContractProperties 2029 } 2030 case "id": 2031 if v != nil { 2032 var ID string 2033 err = json.Unmarshal(*v, &ID) 2034 if err != nil { 2035 return err 2036 } 2037 avsc.ID = &ID 2038 } 2039 case "name": 2040 if v != nil { 2041 var name string 2042 err = json.Unmarshal(*v, &name) 2043 if err != nil { 2044 return err 2045 } 2046 avsc.Name = &name 2047 } 2048 case "type": 2049 if v != nil { 2050 var typeVar string 2051 err = json.Unmarshal(*v, &typeVar) 2052 if err != nil { 2053 return err 2054 } 2055 avsc.Type = &typeVar 2056 } 2057 } 2058 } 2059 2060 return nil 2061} 2062 2063// APIVersionSetContractDetails an API Version Set contains the common configuration for a set of API 2064// Versions relating 2065type APIVersionSetContractDetails struct { 2066 // ID - Identifier for existing API Version Set. Omit this value to create a new Version Set. 2067 ID *string `json:"id,omitempty"` 2068 // Name - The display Name of the API Version Set. 2069 Name *string `json:"name,omitempty"` 2070 // Description - Description of API Version Set. 2071 Description *string `json:"description,omitempty"` 2072 // VersioningScheme - An value that determines where the API Version identifier will be located in a HTTP request. Possible values include: 'VersioningScheme1Segment', 'VersioningScheme1Query', 'VersioningScheme1Header' 2073 VersioningScheme VersioningScheme1 `json:"versioningScheme,omitempty"` 2074 // VersionQueryName - Name of query parameter that indicates the API Version if versioningScheme is set to `query`. 2075 VersionQueryName *string `json:"versionQueryName,omitempty"` 2076 // VersionHeaderName - Name of HTTP header parameter that indicates the API Version if versioningScheme is set to `header`. 2077 VersionHeaderName *string `json:"versionHeaderName,omitempty"` 2078} 2079 2080// APIVersionSetContractProperties properties of an API Version Set. 2081type APIVersionSetContractProperties struct { 2082 // DisplayName - Name of API Version Set 2083 DisplayName *string `json:"displayName,omitempty"` 2084 // VersioningScheme - An value that determines where the API Version identifier will be located in a HTTP request. Possible values include: 'VersioningSchemeSegment', 'VersioningSchemeQuery', 'VersioningSchemeHeader' 2085 VersioningScheme VersioningScheme `json:"versioningScheme,omitempty"` 2086 // Description - Description of API Version Set. 2087 Description *string `json:"description,omitempty"` 2088 // VersionQueryName - Name of query parameter that indicates the API Version if versioningScheme is set to `query`. 2089 VersionQueryName *string `json:"versionQueryName,omitempty"` 2090 // VersionHeaderName - Name of HTTP header parameter that indicates the API Version if versioningScheme is set to `header`. 2091 VersionHeaderName *string `json:"versionHeaderName,omitempty"` 2092} 2093 2094// APIVersionSetEntityBase api Version set base parameters 2095type APIVersionSetEntityBase struct { 2096 // Description - Description of API Version Set. 2097 Description *string `json:"description,omitempty"` 2098 // VersionQueryName - Name of query parameter that indicates the API Version if versioningScheme is set to `query`. 2099 VersionQueryName *string `json:"versionQueryName,omitempty"` 2100 // VersionHeaderName - Name of HTTP header parameter that indicates the API Version if versioningScheme is set to `header`. 2101 VersionHeaderName *string `json:"versionHeaderName,omitempty"` 2102} 2103 2104// APIVersionSetUpdateParameters parameters to update or create an Api Version Set Contract. 2105type APIVersionSetUpdateParameters struct { 2106 // APIVersionSetUpdateParametersProperties - Parameters to update or create an Api Version Set Contract. 2107 *APIVersionSetUpdateParametersProperties `json:"properties,omitempty"` 2108} 2109 2110// MarshalJSON is the custom marshaler for APIVersionSetUpdateParameters. 2111func (avsup APIVersionSetUpdateParameters) MarshalJSON() ([]byte, error) { 2112 objectMap := make(map[string]interface{}) 2113 if avsup.APIVersionSetUpdateParametersProperties != nil { 2114 objectMap["properties"] = avsup.APIVersionSetUpdateParametersProperties 2115 } 2116 return json.Marshal(objectMap) 2117} 2118 2119// UnmarshalJSON is the custom unmarshaler for APIVersionSetUpdateParameters struct. 2120func (avsup *APIVersionSetUpdateParameters) UnmarshalJSON(body []byte) error { 2121 var m map[string]*json.RawMessage 2122 err := json.Unmarshal(body, &m) 2123 if err != nil { 2124 return err 2125 } 2126 for k, v := range m { 2127 switch k { 2128 case "properties": 2129 if v != nil { 2130 var APIVersionSetUpdateParametersProperties APIVersionSetUpdateParametersProperties 2131 err = json.Unmarshal(*v, &APIVersionSetUpdateParametersProperties) 2132 if err != nil { 2133 return err 2134 } 2135 avsup.APIVersionSetUpdateParametersProperties = &APIVersionSetUpdateParametersProperties 2136 } 2137 } 2138 } 2139 2140 return nil 2141} 2142 2143// APIVersionSetUpdateParametersProperties properties used to create or update an API Version Set. 2144type APIVersionSetUpdateParametersProperties struct { 2145 // DisplayName - Name of API Version Set 2146 DisplayName *string `json:"displayName,omitempty"` 2147 // VersioningScheme - An value that determines where the API Version identifier will be located in a HTTP request. Possible values include: 'VersioningSchemeSegment', 'VersioningSchemeQuery', 'VersioningSchemeHeader' 2148 VersioningScheme VersioningScheme `json:"versioningScheme,omitempty"` 2149 // Description - Description of API Version Set. 2150 Description *string `json:"description,omitempty"` 2151 // VersionQueryName - Name of query parameter that indicates the API Version if versioningScheme is set to `query`. 2152 VersionQueryName *string `json:"versionQueryName,omitempty"` 2153 // VersionHeaderName - Name of HTTP header parameter that indicates the API Version if versioningScheme is set to `header`. 2154 VersionHeaderName *string `json:"versionHeaderName,omitempty"` 2155} 2156 2157// AssociationContract association entity details. 2158type AssociationContract struct { 2159 // AssociationContractProperties - Association entity contract properties. 2160 *AssociationContractProperties `json:"properties,omitempty"` 2161 // ID - READ-ONLY; Resource ID. 2162 ID *string `json:"id,omitempty"` 2163 // Name - READ-ONLY; Resource name. 2164 Name *string `json:"name,omitempty"` 2165 // Type - READ-ONLY; Resource type for API Management resource. 2166 Type *string `json:"type,omitempty"` 2167} 2168 2169// MarshalJSON is the custom marshaler for AssociationContract. 2170func (ac AssociationContract) MarshalJSON() ([]byte, error) { 2171 objectMap := make(map[string]interface{}) 2172 if ac.AssociationContractProperties != nil { 2173 objectMap["properties"] = ac.AssociationContractProperties 2174 } 2175 return json.Marshal(objectMap) 2176} 2177 2178// UnmarshalJSON is the custom unmarshaler for AssociationContract struct. 2179func (ac *AssociationContract) UnmarshalJSON(body []byte) error { 2180 var m map[string]*json.RawMessage 2181 err := json.Unmarshal(body, &m) 2182 if err != nil { 2183 return err 2184 } 2185 for k, v := range m { 2186 switch k { 2187 case "properties": 2188 if v != nil { 2189 var associationContractProperties AssociationContractProperties 2190 err = json.Unmarshal(*v, &associationContractProperties) 2191 if err != nil { 2192 return err 2193 } 2194 ac.AssociationContractProperties = &associationContractProperties 2195 } 2196 case "id": 2197 if v != nil { 2198 var ID string 2199 err = json.Unmarshal(*v, &ID) 2200 if err != nil { 2201 return err 2202 } 2203 ac.ID = &ID 2204 } 2205 case "name": 2206 if v != nil { 2207 var name string 2208 err = json.Unmarshal(*v, &name) 2209 if err != nil { 2210 return err 2211 } 2212 ac.Name = &name 2213 } 2214 case "type": 2215 if v != nil { 2216 var typeVar string 2217 err = json.Unmarshal(*v, &typeVar) 2218 if err != nil { 2219 return err 2220 } 2221 ac.Type = &typeVar 2222 } 2223 } 2224 } 2225 2226 return nil 2227} 2228 2229// AssociationContractProperties association entity contract properties. 2230type AssociationContractProperties struct { 2231 // ProvisioningState - Provisioning state. Possible values include: 'Created' 2232 ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` 2233} 2234 2235// AuthenticationSettingsContract API Authentication Settings. 2236type AuthenticationSettingsContract struct { 2237 // OAuth2 - OAuth2 Authentication settings 2238 OAuth2 *OAuth2AuthenticationSettingsContract `json:"oAuth2,omitempty"` 2239 // Openid - OpenID Connect Authentication Settings 2240 Openid *OpenIDAuthenticationSettingsContract `json:"openid,omitempty"` 2241} 2242 2243// AuthorizationServerCollection paged OAuth2 Authorization Servers list representation. 2244type AuthorizationServerCollection struct { 2245 autorest.Response `json:"-"` 2246 // Value - Page values. 2247 Value *[]AuthorizationServerContract `json:"value,omitempty"` 2248 // Count - Total record count number across all pages. 2249 Count *int64 `json:"count,omitempty"` 2250 // NextLink - Next page link if any. 2251 NextLink *string `json:"nextLink,omitempty"` 2252} 2253 2254// AuthorizationServerCollectionIterator provides access to a complete listing of 2255// AuthorizationServerContract values. 2256type AuthorizationServerCollectionIterator struct { 2257 i int 2258 page AuthorizationServerCollectionPage 2259} 2260 2261// NextWithContext advances to the next value. If there was an error making 2262// the request the iterator does not advance and the error is returned. 2263func (iter *AuthorizationServerCollectionIterator) NextWithContext(ctx context.Context) (err error) { 2264 if tracing.IsEnabled() { 2265 ctx = tracing.StartSpan(ctx, fqdn+"/AuthorizationServerCollectionIterator.NextWithContext") 2266 defer func() { 2267 sc := -1 2268 if iter.Response().Response.Response != nil { 2269 sc = iter.Response().Response.Response.StatusCode 2270 } 2271 tracing.EndSpan(ctx, sc, err) 2272 }() 2273 } 2274 iter.i++ 2275 if iter.i < len(iter.page.Values()) { 2276 return nil 2277 } 2278 err = iter.page.NextWithContext(ctx) 2279 if err != nil { 2280 iter.i-- 2281 return err 2282 } 2283 iter.i = 0 2284 return nil 2285} 2286 2287// Next advances to the next value. If there was an error making 2288// the request the iterator does not advance and the error is returned. 2289// Deprecated: Use NextWithContext() instead. 2290func (iter *AuthorizationServerCollectionIterator) Next() error { 2291 return iter.NextWithContext(context.Background()) 2292} 2293 2294// NotDone returns true if the enumeration should be started or is not yet complete. 2295func (iter AuthorizationServerCollectionIterator) NotDone() bool { 2296 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 2297} 2298 2299// Response returns the raw server response from the last page request. 2300func (iter AuthorizationServerCollectionIterator) Response() AuthorizationServerCollection { 2301 return iter.page.Response() 2302} 2303 2304// Value returns the current value or a zero-initialized value if the 2305// iterator has advanced beyond the end of the collection. 2306func (iter AuthorizationServerCollectionIterator) Value() AuthorizationServerContract { 2307 if !iter.page.NotDone() { 2308 return AuthorizationServerContract{} 2309 } 2310 return iter.page.Values()[iter.i] 2311} 2312 2313// Creates a new instance of the AuthorizationServerCollectionIterator type. 2314func NewAuthorizationServerCollectionIterator(page AuthorizationServerCollectionPage) AuthorizationServerCollectionIterator { 2315 return AuthorizationServerCollectionIterator{page: page} 2316} 2317 2318// IsEmpty returns true if the ListResult contains no values. 2319func (asc AuthorizationServerCollection) IsEmpty() bool { 2320 return asc.Value == nil || len(*asc.Value) == 0 2321} 2322 2323// hasNextLink returns true if the NextLink is not empty. 2324func (asc AuthorizationServerCollection) hasNextLink() bool { 2325 return asc.NextLink != nil && len(*asc.NextLink) != 0 2326} 2327 2328// authorizationServerCollectionPreparer prepares a request to retrieve the next set of results. 2329// It returns nil if no more results exist. 2330func (asc AuthorizationServerCollection) authorizationServerCollectionPreparer(ctx context.Context) (*http.Request, error) { 2331 if !asc.hasNextLink() { 2332 return nil, nil 2333 } 2334 return autorest.Prepare((&http.Request{}).WithContext(ctx), 2335 autorest.AsJSON(), 2336 autorest.AsGet(), 2337 autorest.WithBaseURL(to.String(asc.NextLink))) 2338} 2339 2340// AuthorizationServerCollectionPage contains a page of AuthorizationServerContract values. 2341type AuthorizationServerCollectionPage struct { 2342 fn func(context.Context, AuthorizationServerCollection) (AuthorizationServerCollection, error) 2343 asc AuthorizationServerCollection 2344} 2345 2346// NextWithContext advances to the next page of values. If there was an error making 2347// the request the page does not advance and the error is returned. 2348func (page *AuthorizationServerCollectionPage) NextWithContext(ctx context.Context) (err error) { 2349 if tracing.IsEnabled() { 2350 ctx = tracing.StartSpan(ctx, fqdn+"/AuthorizationServerCollectionPage.NextWithContext") 2351 defer func() { 2352 sc := -1 2353 if page.Response().Response.Response != nil { 2354 sc = page.Response().Response.Response.StatusCode 2355 } 2356 tracing.EndSpan(ctx, sc, err) 2357 }() 2358 } 2359 for { 2360 next, err := page.fn(ctx, page.asc) 2361 if err != nil { 2362 return err 2363 } 2364 page.asc = next 2365 if !next.hasNextLink() || !next.IsEmpty() { 2366 break 2367 } 2368 } 2369 return nil 2370} 2371 2372// Next advances to the next page of values. If there was an error making 2373// the request the page does not advance and the error is returned. 2374// Deprecated: Use NextWithContext() instead. 2375func (page *AuthorizationServerCollectionPage) Next() error { 2376 return page.NextWithContext(context.Background()) 2377} 2378 2379// NotDone returns true if the page enumeration should be started or is not yet complete. 2380func (page AuthorizationServerCollectionPage) NotDone() bool { 2381 return !page.asc.IsEmpty() 2382} 2383 2384// Response returns the raw server response from the last page request. 2385func (page AuthorizationServerCollectionPage) Response() AuthorizationServerCollection { 2386 return page.asc 2387} 2388 2389// Values returns the slice of values for the current page or nil if there are no values. 2390func (page AuthorizationServerCollectionPage) Values() []AuthorizationServerContract { 2391 if page.asc.IsEmpty() { 2392 return nil 2393 } 2394 return *page.asc.Value 2395} 2396 2397// Creates a new instance of the AuthorizationServerCollectionPage type. 2398func NewAuthorizationServerCollectionPage(cur AuthorizationServerCollection, getNextPage func(context.Context, AuthorizationServerCollection) (AuthorizationServerCollection, error)) AuthorizationServerCollectionPage { 2399 return AuthorizationServerCollectionPage{ 2400 fn: getNextPage, 2401 asc: cur, 2402 } 2403} 2404 2405// AuthorizationServerContract external OAuth authorization server settings. 2406type AuthorizationServerContract struct { 2407 autorest.Response `json:"-"` 2408 // AuthorizationServerContractProperties - Properties of the External OAuth authorization server Contract. 2409 *AuthorizationServerContractProperties `json:"properties,omitempty"` 2410 // ID - READ-ONLY; Resource ID. 2411 ID *string `json:"id,omitempty"` 2412 // Name - READ-ONLY; Resource name. 2413 Name *string `json:"name,omitempty"` 2414 // Type - READ-ONLY; Resource type for API Management resource. 2415 Type *string `json:"type,omitempty"` 2416} 2417 2418// MarshalJSON is the custom marshaler for AuthorizationServerContract. 2419func (asc AuthorizationServerContract) MarshalJSON() ([]byte, error) { 2420 objectMap := make(map[string]interface{}) 2421 if asc.AuthorizationServerContractProperties != nil { 2422 objectMap["properties"] = asc.AuthorizationServerContractProperties 2423 } 2424 return json.Marshal(objectMap) 2425} 2426 2427// UnmarshalJSON is the custom unmarshaler for AuthorizationServerContract struct. 2428func (asc *AuthorizationServerContract) UnmarshalJSON(body []byte) error { 2429 var m map[string]*json.RawMessage 2430 err := json.Unmarshal(body, &m) 2431 if err != nil { 2432 return err 2433 } 2434 for k, v := range m { 2435 switch k { 2436 case "properties": 2437 if v != nil { 2438 var authorizationServerContractProperties AuthorizationServerContractProperties 2439 err = json.Unmarshal(*v, &authorizationServerContractProperties) 2440 if err != nil { 2441 return err 2442 } 2443 asc.AuthorizationServerContractProperties = &authorizationServerContractProperties 2444 } 2445 case "id": 2446 if v != nil { 2447 var ID string 2448 err = json.Unmarshal(*v, &ID) 2449 if err != nil { 2450 return err 2451 } 2452 asc.ID = &ID 2453 } 2454 case "name": 2455 if v != nil { 2456 var name string 2457 err = json.Unmarshal(*v, &name) 2458 if err != nil { 2459 return err 2460 } 2461 asc.Name = &name 2462 } 2463 case "type": 2464 if v != nil { 2465 var typeVar string 2466 err = json.Unmarshal(*v, &typeVar) 2467 if err != nil { 2468 return err 2469 } 2470 asc.Type = &typeVar 2471 } 2472 } 2473 } 2474 2475 return nil 2476} 2477 2478// AuthorizationServerContractBaseProperties external OAuth authorization server Update settings contract. 2479type AuthorizationServerContractBaseProperties struct { 2480 // Description - Description of the authorization server. Can contain HTML formatting tags. 2481 Description *string `json:"description,omitempty"` 2482 // AuthorizationMethods - HTTP verbs supported by the authorization endpoint. GET must be always present. POST is optional. 2483 AuthorizationMethods *[]AuthorizationMethod `json:"authorizationMethods,omitempty"` 2484 // ClientAuthenticationMethod - Method of authentication supported by the token endpoint of this authorization server. Possible values are Basic and/or Body. When Body is specified, client credentials and other parameters are passed within the request body in the application/x-www-form-urlencoded format. 2485 ClientAuthenticationMethod *[]ClientAuthenticationMethod `json:"clientAuthenticationMethod,omitempty"` 2486 // TokenBodyParameters - Additional parameters required by the token endpoint of this authorization server represented as an array of JSON objects with name and value string properties, i.e. {"name" : "name value", "value": "a value"}. 2487 TokenBodyParameters *[]TokenBodyParameterContract `json:"tokenBodyParameters,omitempty"` 2488 // TokenEndpoint - OAuth token endpoint. Contains absolute URI to entity being referenced. 2489 TokenEndpoint *string `json:"tokenEndpoint,omitempty"` 2490 // SupportState - If true, authorization server will include state parameter from the authorization request to its response. Client may use state parameter to raise protocol security. 2491 SupportState *bool `json:"supportState,omitempty"` 2492 // DefaultScope - Access token scope that is going to be requested by default. Can be overridden at the API level. Should be provided in the form of a string containing space-delimited values. 2493 DefaultScope *string `json:"defaultScope,omitempty"` 2494 // BearerTokenSendingMethods - Specifies the mechanism by which access token is passed to the API. 2495 BearerTokenSendingMethods *[]BearerTokenSendingMethod `json:"bearerTokenSendingMethods,omitempty"` 2496 // ResourceOwnerUsername - Can be optionally specified when resource owner password grant type is supported by this authorization server. Default resource owner username. 2497 ResourceOwnerUsername *string `json:"resourceOwnerUsername,omitempty"` 2498 // ResourceOwnerPassword - Can be optionally specified when resource owner password grant type is supported by this authorization server. Default resource owner password. 2499 ResourceOwnerPassword *string `json:"resourceOwnerPassword,omitempty"` 2500} 2501 2502// AuthorizationServerContractProperties external OAuth authorization server settings Properties. 2503type AuthorizationServerContractProperties struct { 2504 // DisplayName - User-friendly authorization server name. 2505 DisplayName *string `json:"displayName,omitempty"` 2506 // ClientRegistrationEndpoint - Optional reference to a page where client or app registration for this authorization server is performed. Contains absolute URL to entity being referenced. 2507 ClientRegistrationEndpoint *string `json:"clientRegistrationEndpoint,omitempty"` 2508 // AuthorizationEndpoint - OAuth authorization endpoint. See http://tools.ietf.org/html/rfc6749#section-3.2. 2509 AuthorizationEndpoint *string `json:"authorizationEndpoint,omitempty"` 2510 // GrantTypes - Form of an authorization grant, which the client uses to request the access token. 2511 GrantTypes *[]GrantType `json:"grantTypes,omitempty"` 2512 // ClientID - Client or app id registered with this authorization server. 2513 ClientID *string `json:"clientId,omitempty"` 2514 // ClientSecret - Client or app secret registered with this authorization server. This property will not be filled on 'GET' operations! Use '/listSecrets' POST request to get the value. 2515 ClientSecret *string `json:"clientSecret,omitempty"` 2516 // Description - Description of the authorization server. Can contain HTML formatting tags. 2517 Description *string `json:"description,omitempty"` 2518 // AuthorizationMethods - HTTP verbs supported by the authorization endpoint. GET must be always present. POST is optional. 2519 AuthorizationMethods *[]AuthorizationMethod `json:"authorizationMethods,omitempty"` 2520 // ClientAuthenticationMethod - Method of authentication supported by the token endpoint of this authorization server. Possible values are Basic and/or Body. When Body is specified, client credentials and other parameters are passed within the request body in the application/x-www-form-urlencoded format. 2521 ClientAuthenticationMethod *[]ClientAuthenticationMethod `json:"clientAuthenticationMethod,omitempty"` 2522 // TokenBodyParameters - Additional parameters required by the token endpoint of this authorization server represented as an array of JSON objects with name and value string properties, i.e. {"name" : "name value", "value": "a value"}. 2523 TokenBodyParameters *[]TokenBodyParameterContract `json:"tokenBodyParameters,omitempty"` 2524 // TokenEndpoint - OAuth token endpoint. Contains absolute URI to entity being referenced. 2525 TokenEndpoint *string `json:"tokenEndpoint,omitempty"` 2526 // SupportState - If true, authorization server will include state parameter from the authorization request to its response. Client may use state parameter to raise protocol security. 2527 SupportState *bool `json:"supportState,omitempty"` 2528 // DefaultScope - Access token scope that is going to be requested by default. Can be overridden at the API level. Should be provided in the form of a string containing space-delimited values. 2529 DefaultScope *string `json:"defaultScope,omitempty"` 2530 // BearerTokenSendingMethods - Specifies the mechanism by which access token is passed to the API. 2531 BearerTokenSendingMethods *[]BearerTokenSendingMethod `json:"bearerTokenSendingMethods,omitempty"` 2532 // ResourceOwnerUsername - Can be optionally specified when resource owner password grant type is supported by this authorization server. Default resource owner username. 2533 ResourceOwnerUsername *string `json:"resourceOwnerUsername,omitempty"` 2534 // ResourceOwnerPassword - Can be optionally specified when resource owner password grant type is supported by this authorization server. Default resource owner password. 2535 ResourceOwnerPassword *string `json:"resourceOwnerPassword,omitempty"` 2536} 2537 2538// AuthorizationServerSecretsContract oAuth Server Secrets Contract. 2539type AuthorizationServerSecretsContract struct { 2540 autorest.Response `json:"-"` 2541 // ClientSecret - oAuth Authorization Server Secrets. 2542 ClientSecret *string `json:"clientSecret,omitempty"` 2543 // ResourceOwnerUsername - Can be optionally specified when resource owner password grant type is supported by this authorization server. Default resource owner username. 2544 ResourceOwnerUsername *string `json:"resourceOwnerUsername,omitempty"` 2545 // ResourceOwnerPassword - Can be optionally specified when resource owner password grant type is supported by this authorization server. Default resource owner password. 2546 ResourceOwnerPassword *string `json:"resourceOwnerPassword,omitempty"` 2547} 2548 2549// AuthorizationServerUpdateContract external OAuth authorization server settings. 2550type AuthorizationServerUpdateContract struct { 2551 // AuthorizationServerUpdateContractProperties - Properties of the External OAuth authorization server update Contract. 2552 *AuthorizationServerUpdateContractProperties `json:"properties,omitempty"` 2553 // ID - READ-ONLY; Resource ID. 2554 ID *string `json:"id,omitempty"` 2555 // Name - READ-ONLY; Resource name. 2556 Name *string `json:"name,omitempty"` 2557 // Type - READ-ONLY; Resource type for API Management resource. 2558 Type *string `json:"type,omitempty"` 2559} 2560 2561// MarshalJSON is the custom marshaler for AuthorizationServerUpdateContract. 2562func (asuc AuthorizationServerUpdateContract) MarshalJSON() ([]byte, error) { 2563 objectMap := make(map[string]interface{}) 2564 if asuc.AuthorizationServerUpdateContractProperties != nil { 2565 objectMap["properties"] = asuc.AuthorizationServerUpdateContractProperties 2566 } 2567 return json.Marshal(objectMap) 2568} 2569 2570// UnmarshalJSON is the custom unmarshaler for AuthorizationServerUpdateContract struct. 2571func (asuc *AuthorizationServerUpdateContract) UnmarshalJSON(body []byte) error { 2572 var m map[string]*json.RawMessage 2573 err := json.Unmarshal(body, &m) 2574 if err != nil { 2575 return err 2576 } 2577 for k, v := range m { 2578 switch k { 2579 case "properties": 2580 if v != nil { 2581 var authorizationServerUpdateContractProperties AuthorizationServerUpdateContractProperties 2582 err = json.Unmarshal(*v, &authorizationServerUpdateContractProperties) 2583 if err != nil { 2584 return err 2585 } 2586 asuc.AuthorizationServerUpdateContractProperties = &authorizationServerUpdateContractProperties 2587 } 2588 case "id": 2589 if v != nil { 2590 var ID string 2591 err = json.Unmarshal(*v, &ID) 2592 if err != nil { 2593 return err 2594 } 2595 asuc.ID = &ID 2596 } 2597 case "name": 2598 if v != nil { 2599 var name string 2600 err = json.Unmarshal(*v, &name) 2601 if err != nil { 2602 return err 2603 } 2604 asuc.Name = &name 2605 } 2606 case "type": 2607 if v != nil { 2608 var typeVar string 2609 err = json.Unmarshal(*v, &typeVar) 2610 if err != nil { 2611 return err 2612 } 2613 asuc.Type = &typeVar 2614 } 2615 } 2616 } 2617 2618 return nil 2619} 2620 2621// AuthorizationServerUpdateContractProperties external OAuth authorization server Update settings 2622// contract. 2623type AuthorizationServerUpdateContractProperties struct { 2624 // DisplayName - User-friendly authorization server name. 2625 DisplayName *string `json:"displayName,omitempty"` 2626 // ClientRegistrationEndpoint - Optional reference to a page where client or app registration for this authorization server is performed. Contains absolute URL to entity being referenced. 2627 ClientRegistrationEndpoint *string `json:"clientRegistrationEndpoint,omitempty"` 2628 // AuthorizationEndpoint - OAuth authorization endpoint. See http://tools.ietf.org/html/rfc6749#section-3.2. 2629 AuthorizationEndpoint *string `json:"authorizationEndpoint,omitempty"` 2630 // GrantTypes - Form of an authorization grant, which the client uses to request the access token. 2631 GrantTypes *[]GrantType `json:"grantTypes,omitempty"` 2632 // ClientID - Client or app id registered with this authorization server. 2633 ClientID *string `json:"clientId,omitempty"` 2634 // ClientSecret - Client or app secret registered with this authorization server. This property will not be filled on 'GET' operations! Use '/listSecrets' POST request to get the value. 2635 ClientSecret *string `json:"clientSecret,omitempty"` 2636 // Description - Description of the authorization server. Can contain HTML formatting tags. 2637 Description *string `json:"description,omitempty"` 2638 // AuthorizationMethods - HTTP verbs supported by the authorization endpoint. GET must be always present. POST is optional. 2639 AuthorizationMethods *[]AuthorizationMethod `json:"authorizationMethods,omitempty"` 2640 // ClientAuthenticationMethod - Method of authentication supported by the token endpoint of this authorization server. Possible values are Basic and/or Body. When Body is specified, client credentials and other parameters are passed within the request body in the application/x-www-form-urlencoded format. 2641 ClientAuthenticationMethod *[]ClientAuthenticationMethod `json:"clientAuthenticationMethod,omitempty"` 2642 // TokenBodyParameters - Additional parameters required by the token endpoint of this authorization server represented as an array of JSON objects with name and value string properties, i.e. {"name" : "name value", "value": "a value"}. 2643 TokenBodyParameters *[]TokenBodyParameterContract `json:"tokenBodyParameters,omitempty"` 2644 // TokenEndpoint - OAuth token endpoint. Contains absolute URI to entity being referenced. 2645 TokenEndpoint *string `json:"tokenEndpoint,omitempty"` 2646 // SupportState - If true, authorization server will include state parameter from the authorization request to its response. Client may use state parameter to raise protocol security. 2647 SupportState *bool `json:"supportState,omitempty"` 2648 // DefaultScope - Access token scope that is going to be requested by default. Can be overridden at the API level. Should be provided in the form of a string containing space-delimited values. 2649 DefaultScope *string `json:"defaultScope,omitempty"` 2650 // BearerTokenSendingMethods - Specifies the mechanism by which access token is passed to the API. 2651 BearerTokenSendingMethods *[]BearerTokenSendingMethod `json:"bearerTokenSendingMethods,omitempty"` 2652 // ResourceOwnerUsername - Can be optionally specified when resource owner password grant type is supported by this authorization server. Default resource owner username. 2653 ResourceOwnerUsername *string `json:"resourceOwnerUsername,omitempty"` 2654 // ResourceOwnerPassword - Can be optionally specified when resource owner password grant type is supported by this authorization server. Default resource owner password. 2655 ResourceOwnerPassword *string `json:"resourceOwnerPassword,omitempty"` 2656} 2657 2658// BackendAuthorizationHeaderCredentials authorization header information. 2659type BackendAuthorizationHeaderCredentials struct { 2660 // Scheme - Authentication Scheme name. 2661 Scheme *string `json:"scheme,omitempty"` 2662 // Parameter - Authentication Parameter value. 2663 Parameter *string `json:"parameter,omitempty"` 2664} 2665 2666// BackendBaseParameters backend entity base Parameter set. 2667type BackendBaseParameters struct { 2668 // Title - Backend Title. 2669 Title *string `json:"title,omitempty"` 2670 // Description - Backend Description. 2671 Description *string `json:"description,omitempty"` 2672 // ResourceID - Management Uri of the Resource in External System. This url can be the Arm Resource Id of Logic Apps, Function Apps or Api Apps. 2673 ResourceID *string `json:"resourceId,omitempty"` 2674 // Properties - Backend Properties contract 2675 Properties *BackendProperties `json:"properties,omitempty"` 2676 // Credentials - Backend Credentials Contract Properties 2677 Credentials *BackendCredentialsContract `json:"credentials,omitempty"` 2678 // Proxy - Backend Proxy Contract Properties 2679 Proxy *BackendProxyContract `json:"proxy,omitempty"` 2680 // TLS - Backend TLS Properties 2681 TLS *BackendTLSProperties `json:"tls,omitempty"` 2682} 2683 2684// BackendCollection paged Backend list representation. 2685type BackendCollection struct { 2686 autorest.Response `json:"-"` 2687 // Value - Backend values. 2688 Value *[]BackendContract `json:"value,omitempty"` 2689 // Count - Total record count number across all pages. 2690 Count *int64 `json:"count,omitempty"` 2691 // NextLink - Next page link if any. 2692 NextLink *string `json:"nextLink,omitempty"` 2693} 2694 2695// BackendCollectionIterator provides access to a complete listing of BackendContract values. 2696type BackendCollectionIterator struct { 2697 i int 2698 page BackendCollectionPage 2699} 2700 2701// NextWithContext advances to the next value. If there was an error making 2702// the request the iterator does not advance and the error is returned. 2703func (iter *BackendCollectionIterator) NextWithContext(ctx context.Context) (err error) { 2704 if tracing.IsEnabled() { 2705 ctx = tracing.StartSpan(ctx, fqdn+"/BackendCollectionIterator.NextWithContext") 2706 defer func() { 2707 sc := -1 2708 if iter.Response().Response.Response != nil { 2709 sc = iter.Response().Response.Response.StatusCode 2710 } 2711 tracing.EndSpan(ctx, sc, err) 2712 }() 2713 } 2714 iter.i++ 2715 if iter.i < len(iter.page.Values()) { 2716 return nil 2717 } 2718 err = iter.page.NextWithContext(ctx) 2719 if err != nil { 2720 iter.i-- 2721 return err 2722 } 2723 iter.i = 0 2724 return nil 2725} 2726 2727// Next advances to the next value. If there was an error making 2728// the request the iterator does not advance and the error is returned. 2729// Deprecated: Use NextWithContext() instead. 2730func (iter *BackendCollectionIterator) Next() error { 2731 return iter.NextWithContext(context.Background()) 2732} 2733 2734// NotDone returns true if the enumeration should be started or is not yet complete. 2735func (iter BackendCollectionIterator) NotDone() bool { 2736 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 2737} 2738 2739// Response returns the raw server response from the last page request. 2740func (iter BackendCollectionIterator) Response() BackendCollection { 2741 return iter.page.Response() 2742} 2743 2744// Value returns the current value or a zero-initialized value if the 2745// iterator has advanced beyond the end of the collection. 2746func (iter BackendCollectionIterator) Value() BackendContract { 2747 if !iter.page.NotDone() { 2748 return BackendContract{} 2749 } 2750 return iter.page.Values()[iter.i] 2751} 2752 2753// Creates a new instance of the BackendCollectionIterator type. 2754func NewBackendCollectionIterator(page BackendCollectionPage) BackendCollectionIterator { 2755 return BackendCollectionIterator{page: page} 2756} 2757 2758// IsEmpty returns true if the ListResult contains no values. 2759func (bc BackendCollection) IsEmpty() bool { 2760 return bc.Value == nil || len(*bc.Value) == 0 2761} 2762 2763// hasNextLink returns true if the NextLink is not empty. 2764func (bc BackendCollection) hasNextLink() bool { 2765 return bc.NextLink != nil && len(*bc.NextLink) != 0 2766} 2767 2768// backendCollectionPreparer prepares a request to retrieve the next set of results. 2769// It returns nil if no more results exist. 2770func (bc BackendCollection) backendCollectionPreparer(ctx context.Context) (*http.Request, error) { 2771 if !bc.hasNextLink() { 2772 return nil, nil 2773 } 2774 return autorest.Prepare((&http.Request{}).WithContext(ctx), 2775 autorest.AsJSON(), 2776 autorest.AsGet(), 2777 autorest.WithBaseURL(to.String(bc.NextLink))) 2778} 2779 2780// BackendCollectionPage contains a page of BackendContract values. 2781type BackendCollectionPage struct { 2782 fn func(context.Context, BackendCollection) (BackendCollection, error) 2783 bc BackendCollection 2784} 2785 2786// NextWithContext advances to the next page of values. If there was an error making 2787// the request the page does not advance and the error is returned. 2788func (page *BackendCollectionPage) NextWithContext(ctx context.Context) (err error) { 2789 if tracing.IsEnabled() { 2790 ctx = tracing.StartSpan(ctx, fqdn+"/BackendCollectionPage.NextWithContext") 2791 defer func() { 2792 sc := -1 2793 if page.Response().Response.Response != nil { 2794 sc = page.Response().Response.Response.StatusCode 2795 } 2796 tracing.EndSpan(ctx, sc, err) 2797 }() 2798 } 2799 for { 2800 next, err := page.fn(ctx, page.bc) 2801 if err != nil { 2802 return err 2803 } 2804 page.bc = next 2805 if !next.hasNextLink() || !next.IsEmpty() { 2806 break 2807 } 2808 } 2809 return nil 2810} 2811 2812// Next advances to the next page of values. If there was an error making 2813// the request the page does not advance and the error is returned. 2814// Deprecated: Use NextWithContext() instead. 2815func (page *BackendCollectionPage) Next() error { 2816 return page.NextWithContext(context.Background()) 2817} 2818 2819// NotDone returns true if the page enumeration should be started or is not yet complete. 2820func (page BackendCollectionPage) NotDone() bool { 2821 return !page.bc.IsEmpty() 2822} 2823 2824// Response returns the raw server response from the last page request. 2825func (page BackendCollectionPage) Response() BackendCollection { 2826 return page.bc 2827} 2828 2829// Values returns the slice of values for the current page or nil if there are no values. 2830func (page BackendCollectionPage) Values() []BackendContract { 2831 if page.bc.IsEmpty() { 2832 return nil 2833 } 2834 return *page.bc.Value 2835} 2836 2837// Creates a new instance of the BackendCollectionPage type. 2838func NewBackendCollectionPage(cur BackendCollection, getNextPage func(context.Context, BackendCollection) (BackendCollection, error)) BackendCollectionPage { 2839 return BackendCollectionPage{ 2840 fn: getNextPage, 2841 bc: cur, 2842 } 2843} 2844 2845// BackendContract backend details. 2846type BackendContract struct { 2847 autorest.Response `json:"-"` 2848 // BackendContractProperties - Backend entity contract properties. 2849 *BackendContractProperties `json:"properties,omitempty"` 2850 // ID - READ-ONLY; Resource ID. 2851 ID *string `json:"id,omitempty"` 2852 // Name - READ-ONLY; Resource name. 2853 Name *string `json:"name,omitempty"` 2854 // Type - READ-ONLY; Resource type for API Management resource. 2855 Type *string `json:"type,omitempty"` 2856} 2857 2858// MarshalJSON is the custom marshaler for BackendContract. 2859func (bc BackendContract) MarshalJSON() ([]byte, error) { 2860 objectMap := make(map[string]interface{}) 2861 if bc.BackendContractProperties != nil { 2862 objectMap["properties"] = bc.BackendContractProperties 2863 } 2864 return json.Marshal(objectMap) 2865} 2866 2867// UnmarshalJSON is the custom unmarshaler for BackendContract struct. 2868func (bc *BackendContract) UnmarshalJSON(body []byte) error { 2869 var m map[string]*json.RawMessage 2870 err := json.Unmarshal(body, &m) 2871 if err != nil { 2872 return err 2873 } 2874 for k, v := range m { 2875 switch k { 2876 case "properties": 2877 if v != nil { 2878 var backendContractProperties BackendContractProperties 2879 err = json.Unmarshal(*v, &backendContractProperties) 2880 if err != nil { 2881 return err 2882 } 2883 bc.BackendContractProperties = &backendContractProperties 2884 } 2885 case "id": 2886 if v != nil { 2887 var ID string 2888 err = json.Unmarshal(*v, &ID) 2889 if err != nil { 2890 return err 2891 } 2892 bc.ID = &ID 2893 } 2894 case "name": 2895 if v != nil { 2896 var name string 2897 err = json.Unmarshal(*v, &name) 2898 if err != nil { 2899 return err 2900 } 2901 bc.Name = &name 2902 } 2903 case "type": 2904 if v != nil { 2905 var typeVar string 2906 err = json.Unmarshal(*v, &typeVar) 2907 if err != nil { 2908 return err 2909 } 2910 bc.Type = &typeVar 2911 } 2912 } 2913 } 2914 2915 return nil 2916} 2917 2918// BackendContractProperties parameters supplied to the Create Backend operation. 2919type BackendContractProperties struct { 2920 // URL - Runtime Url of the Backend. 2921 URL *string `json:"url,omitempty"` 2922 // Protocol - Backend communication protocol. Possible values include: 'BackendProtocolHTTP', 'BackendProtocolSoap' 2923 Protocol BackendProtocol `json:"protocol,omitempty"` 2924 // Title - Backend Title. 2925 Title *string `json:"title,omitempty"` 2926 // Description - Backend Description. 2927 Description *string `json:"description,omitempty"` 2928 // ResourceID - Management Uri of the Resource in External System. This url can be the Arm Resource Id of Logic Apps, Function Apps or Api Apps. 2929 ResourceID *string `json:"resourceId,omitempty"` 2930 // Properties - Backend Properties contract 2931 Properties *BackendProperties `json:"properties,omitempty"` 2932 // Credentials - Backend Credentials Contract Properties 2933 Credentials *BackendCredentialsContract `json:"credentials,omitempty"` 2934 // Proxy - Backend Proxy Contract Properties 2935 Proxy *BackendProxyContract `json:"proxy,omitempty"` 2936 // TLS - Backend TLS Properties 2937 TLS *BackendTLSProperties `json:"tls,omitempty"` 2938} 2939 2940// BackendCredentialsContract details of the Credentials used to connect to Backend. 2941type BackendCredentialsContract struct { 2942 // CertificateIds - List of Client Certificate Ids. 2943 CertificateIds *[]string `json:"certificateIds,omitempty"` 2944 // Certificate - List of Client Certificate Thumbprints. Will be ignored if certificatesIds are provided. 2945 Certificate *[]string `json:"certificate,omitempty"` 2946 // Query - Query Parameter description. 2947 Query map[string][]string `json:"query"` 2948 // Header - Header Parameter description. 2949 Header map[string][]string `json:"header"` 2950 // Authorization - Authorization header authentication 2951 Authorization *BackendAuthorizationHeaderCredentials `json:"authorization,omitempty"` 2952} 2953 2954// MarshalJSON is the custom marshaler for BackendCredentialsContract. 2955func (bcc BackendCredentialsContract) MarshalJSON() ([]byte, error) { 2956 objectMap := make(map[string]interface{}) 2957 if bcc.CertificateIds != nil { 2958 objectMap["certificateIds"] = bcc.CertificateIds 2959 } 2960 if bcc.Certificate != nil { 2961 objectMap["certificate"] = bcc.Certificate 2962 } 2963 if bcc.Query != nil { 2964 objectMap["query"] = bcc.Query 2965 } 2966 if bcc.Header != nil { 2967 objectMap["header"] = bcc.Header 2968 } 2969 if bcc.Authorization != nil { 2970 objectMap["authorization"] = bcc.Authorization 2971 } 2972 return json.Marshal(objectMap) 2973} 2974 2975// BackendProperties properties specific to the Backend Type. 2976type BackendProperties struct { 2977 // ServiceFabricCluster - Backend Service Fabric Cluster Properties 2978 ServiceFabricCluster *BackendServiceFabricClusterProperties `json:"serviceFabricCluster,omitempty"` 2979} 2980 2981// BackendProxyContract details of the Backend WebProxy Server to use in the Request to Backend. 2982type BackendProxyContract struct { 2983 // URL - WebProxy Server AbsoluteUri property which includes the entire URI stored in the Uri instance, including all fragments and query strings. 2984 URL *string `json:"url,omitempty"` 2985 // Username - Username to connect to the WebProxy server 2986 Username *string `json:"username,omitempty"` 2987 // Password - Password to connect to the WebProxy Server 2988 Password *string `json:"password,omitempty"` 2989} 2990 2991// BackendReconnectContract reconnect request parameters. 2992type BackendReconnectContract struct { 2993 // BackendReconnectProperties - Reconnect request properties. 2994 *BackendReconnectProperties `json:"properties,omitempty"` 2995 // ID - READ-ONLY; Resource ID. 2996 ID *string `json:"id,omitempty"` 2997 // Name - READ-ONLY; Resource name. 2998 Name *string `json:"name,omitempty"` 2999 // Type - READ-ONLY; Resource type for API Management resource. 3000 Type *string `json:"type,omitempty"` 3001} 3002 3003// MarshalJSON is the custom marshaler for BackendReconnectContract. 3004func (brc BackendReconnectContract) MarshalJSON() ([]byte, error) { 3005 objectMap := make(map[string]interface{}) 3006 if brc.BackendReconnectProperties != nil { 3007 objectMap["properties"] = brc.BackendReconnectProperties 3008 } 3009 return json.Marshal(objectMap) 3010} 3011 3012// UnmarshalJSON is the custom unmarshaler for BackendReconnectContract struct. 3013func (brc *BackendReconnectContract) UnmarshalJSON(body []byte) error { 3014 var m map[string]*json.RawMessage 3015 err := json.Unmarshal(body, &m) 3016 if err != nil { 3017 return err 3018 } 3019 for k, v := range m { 3020 switch k { 3021 case "properties": 3022 if v != nil { 3023 var backendReconnectProperties BackendReconnectProperties 3024 err = json.Unmarshal(*v, &backendReconnectProperties) 3025 if err != nil { 3026 return err 3027 } 3028 brc.BackendReconnectProperties = &backendReconnectProperties 3029 } 3030 case "id": 3031 if v != nil { 3032 var ID string 3033 err = json.Unmarshal(*v, &ID) 3034 if err != nil { 3035 return err 3036 } 3037 brc.ID = &ID 3038 } 3039 case "name": 3040 if v != nil { 3041 var name string 3042 err = json.Unmarshal(*v, &name) 3043 if err != nil { 3044 return err 3045 } 3046 brc.Name = &name 3047 } 3048 case "type": 3049 if v != nil { 3050 var typeVar string 3051 err = json.Unmarshal(*v, &typeVar) 3052 if err != nil { 3053 return err 3054 } 3055 brc.Type = &typeVar 3056 } 3057 } 3058 } 3059 3060 return nil 3061} 3062 3063// BackendReconnectProperties properties to control reconnect requests. 3064type BackendReconnectProperties struct { 3065 // After - Duration in ISO8601 format after which reconnect will be initiated. Minimum duration of the Reconnect is PT2M. 3066 After *string `json:"after,omitempty"` 3067} 3068 3069// BackendServiceFabricClusterProperties properties of the Service Fabric Type Backend. 3070type BackendServiceFabricClusterProperties struct { 3071 // ClientCertificateID - The client certificate id for the management endpoint. 3072 ClientCertificateID *string `json:"clientCertificateId,omitempty"` 3073 // ClientCertificatethumbprint - The client certificate thumbprint for the management endpoint. Will be ignored if certificatesIds are provided 3074 ClientCertificatethumbprint *string `json:"clientCertificatethumbprint,omitempty"` 3075 // MaxPartitionResolutionRetries - Maximum number of retries while attempting resolve the partition. 3076 MaxPartitionResolutionRetries *int32 `json:"maxPartitionResolutionRetries,omitempty"` 3077 // ManagementEndpoints - The cluster management endpoint. 3078 ManagementEndpoints *[]string `json:"managementEndpoints,omitempty"` 3079 // ServerCertificateThumbprints - Thumbprints of certificates cluster management service uses for tls communication 3080 ServerCertificateThumbprints *[]string `json:"serverCertificateThumbprints,omitempty"` 3081 // ServerX509Names - Server X509 Certificate Names Collection 3082 ServerX509Names *[]X509CertificateName `json:"serverX509Names,omitempty"` 3083} 3084 3085// BackendTLSProperties properties controlling TLS Certificate Validation. 3086type BackendTLSProperties struct { 3087 // ValidateCertificateChain - Flag indicating whether SSL certificate chain validation should be done when using self-signed certificates for this backend host. 3088 ValidateCertificateChain *bool `json:"validateCertificateChain,omitempty"` 3089 // ValidateCertificateName - Flag indicating whether SSL certificate name validation should be done when using self-signed certificates for this backend host. 3090 ValidateCertificateName *bool `json:"validateCertificateName,omitempty"` 3091} 3092 3093// BackendUpdateParameterProperties parameters supplied to the Update Backend operation. 3094type BackendUpdateParameterProperties struct { 3095 // URL - Runtime Url of the Backend. 3096 URL *string `json:"url,omitempty"` 3097 // Protocol - Backend communication protocol. Possible values include: 'BackendProtocolHTTP', 'BackendProtocolSoap' 3098 Protocol BackendProtocol `json:"protocol,omitempty"` 3099 // Title - Backend Title. 3100 Title *string `json:"title,omitempty"` 3101 // Description - Backend Description. 3102 Description *string `json:"description,omitempty"` 3103 // ResourceID - Management Uri of the Resource in External System. This url can be the Arm Resource Id of Logic Apps, Function Apps or Api Apps. 3104 ResourceID *string `json:"resourceId,omitempty"` 3105 // Properties - Backend Properties contract 3106 Properties *BackendProperties `json:"properties,omitempty"` 3107 // Credentials - Backend Credentials Contract Properties 3108 Credentials *BackendCredentialsContract `json:"credentials,omitempty"` 3109 // Proxy - Backend Proxy Contract Properties 3110 Proxy *BackendProxyContract `json:"proxy,omitempty"` 3111 // TLS - Backend TLS Properties 3112 TLS *BackendTLSProperties `json:"tls,omitempty"` 3113} 3114 3115// BackendUpdateParameters backend update parameters. 3116type BackendUpdateParameters struct { 3117 // BackendUpdateParameterProperties - Backend entity update contract properties. 3118 *BackendUpdateParameterProperties `json:"properties,omitempty"` 3119} 3120 3121// MarshalJSON is the custom marshaler for BackendUpdateParameters. 3122func (bup BackendUpdateParameters) MarshalJSON() ([]byte, error) { 3123 objectMap := make(map[string]interface{}) 3124 if bup.BackendUpdateParameterProperties != nil { 3125 objectMap["properties"] = bup.BackendUpdateParameterProperties 3126 } 3127 return json.Marshal(objectMap) 3128} 3129 3130// UnmarshalJSON is the custom unmarshaler for BackendUpdateParameters struct. 3131func (bup *BackendUpdateParameters) UnmarshalJSON(body []byte) error { 3132 var m map[string]*json.RawMessage 3133 err := json.Unmarshal(body, &m) 3134 if err != nil { 3135 return err 3136 } 3137 for k, v := range m { 3138 switch k { 3139 case "properties": 3140 if v != nil { 3141 var backendUpdateParameterProperties BackendUpdateParameterProperties 3142 err = json.Unmarshal(*v, &backendUpdateParameterProperties) 3143 if err != nil { 3144 return err 3145 } 3146 bup.BackendUpdateParameterProperties = &backendUpdateParameterProperties 3147 } 3148 } 3149 } 3150 3151 return nil 3152} 3153 3154// BodyDiagnosticSettings body logging settings. 3155type BodyDiagnosticSettings struct { 3156 // Bytes - Number of request body bytes to log. 3157 Bytes *int32 `json:"bytes,omitempty"` 3158} 3159 3160// CacheCollection paged Caches list representation. 3161type CacheCollection struct { 3162 autorest.Response `json:"-"` 3163 // Value - Page values. 3164 Value *[]CacheContract `json:"value,omitempty"` 3165 // Count - Total record count number across all pages. 3166 Count *int64 `json:"count,omitempty"` 3167 // NextLink - Next page link if any. 3168 NextLink *string `json:"nextLink,omitempty"` 3169} 3170 3171// CacheCollectionIterator provides access to a complete listing of CacheContract values. 3172type CacheCollectionIterator struct { 3173 i int 3174 page CacheCollectionPage 3175} 3176 3177// NextWithContext advances to the next value. If there was an error making 3178// the request the iterator does not advance and the error is returned. 3179func (iter *CacheCollectionIterator) NextWithContext(ctx context.Context) (err error) { 3180 if tracing.IsEnabled() { 3181 ctx = tracing.StartSpan(ctx, fqdn+"/CacheCollectionIterator.NextWithContext") 3182 defer func() { 3183 sc := -1 3184 if iter.Response().Response.Response != nil { 3185 sc = iter.Response().Response.Response.StatusCode 3186 } 3187 tracing.EndSpan(ctx, sc, err) 3188 }() 3189 } 3190 iter.i++ 3191 if iter.i < len(iter.page.Values()) { 3192 return nil 3193 } 3194 err = iter.page.NextWithContext(ctx) 3195 if err != nil { 3196 iter.i-- 3197 return err 3198 } 3199 iter.i = 0 3200 return nil 3201} 3202 3203// Next advances to the next value. If there was an error making 3204// the request the iterator does not advance and the error is returned. 3205// Deprecated: Use NextWithContext() instead. 3206func (iter *CacheCollectionIterator) Next() error { 3207 return iter.NextWithContext(context.Background()) 3208} 3209 3210// NotDone returns true if the enumeration should be started or is not yet complete. 3211func (iter CacheCollectionIterator) NotDone() bool { 3212 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 3213} 3214 3215// Response returns the raw server response from the last page request. 3216func (iter CacheCollectionIterator) Response() CacheCollection { 3217 return iter.page.Response() 3218} 3219 3220// Value returns the current value or a zero-initialized value if the 3221// iterator has advanced beyond the end of the collection. 3222func (iter CacheCollectionIterator) Value() CacheContract { 3223 if !iter.page.NotDone() { 3224 return CacheContract{} 3225 } 3226 return iter.page.Values()[iter.i] 3227} 3228 3229// Creates a new instance of the CacheCollectionIterator type. 3230func NewCacheCollectionIterator(page CacheCollectionPage) CacheCollectionIterator { 3231 return CacheCollectionIterator{page: page} 3232} 3233 3234// IsEmpty returns true if the ListResult contains no values. 3235func (cc CacheCollection) IsEmpty() bool { 3236 return cc.Value == nil || len(*cc.Value) == 0 3237} 3238 3239// hasNextLink returns true if the NextLink is not empty. 3240func (cc CacheCollection) hasNextLink() bool { 3241 return cc.NextLink != nil && len(*cc.NextLink) != 0 3242} 3243 3244// cacheCollectionPreparer prepares a request to retrieve the next set of results. 3245// It returns nil if no more results exist. 3246func (cc CacheCollection) cacheCollectionPreparer(ctx context.Context) (*http.Request, error) { 3247 if !cc.hasNextLink() { 3248 return nil, nil 3249 } 3250 return autorest.Prepare((&http.Request{}).WithContext(ctx), 3251 autorest.AsJSON(), 3252 autorest.AsGet(), 3253 autorest.WithBaseURL(to.String(cc.NextLink))) 3254} 3255 3256// CacheCollectionPage contains a page of CacheContract values. 3257type CacheCollectionPage struct { 3258 fn func(context.Context, CacheCollection) (CacheCollection, error) 3259 cc CacheCollection 3260} 3261 3262// NextWithContext advances to the next page of values. If there was an error making 3263// the request the page does not advance and the error is returned. 3264func (page *CacheCollectionPage) NextWithContext(ctx context.Context) (err error) { 3265 if tracing.IsEnabled() { 3266 ctx = tracing.StartSpan(ctx, fqdn+"/CacheCollectionPage.NextWithContext") 3267 defer func() { 3268 sc := -1 3269 if page.Response().Response.Response != nil { 3270 sc = page.Response().Response.Response.StatusCode 3271 } 3272 tracing.EndSpan(ctx, sc, err) 3273 }() 3274 } 3275 for { 3276 next, err := page.fn(ctx, page.cc) 3277 if err != nil { 3278 return err 3279 } 3280 page.cc = next 3281 if !next.hasNextLink() || !next.IsEmpty() { 3282 break 3283 } 3284 } 3285 return nil 3286} 3287 3288// Next advances to the next page of values. If there was an error making 3289// the request the page does not advance and the error is returned. 3290// Deprecated: Use NextWithContext() instead. 3291func (page *CacheCollectionPage) Next() error { 3292 return page.NextWithContext(context.Background()) 3293} 3294 3295// NotDone returns true if the page enumeration should be started or is not yet complete. 3296func (page CacheCollectionPage) NotDone() bool { 3297 return !page.cc.IsEmpty() 3298} 3299 3300// Response returns the raw server response from the last page request. 3301func (page CacheCollectionPage) Response() CacheCollection { 3302 return page.cc 3303} 3304 3305// Values returns the slice of values for the current page or nil if there are no values. 3306func (page CacheCollectionPage) Values() []CacheContract { 3307 if page.cc.IsEmpty() { 3308 return nil 3309 } 3310 return *page.cc.Value 3311} 3312 3313// Creates a new instance of the CacheCollectionPage type. 3314func NewCacheCollectionPage(cur CacheCollection, getNextPage func(context.Context, CacheCollection) (CacheCollection, error)) CacheCollectionPage { 3315 return CacheCollectionPage{ 3316 fn: getNextPage, 3317 cc: cur, 3318 } 3319} 3320 3321// CacheContract cache details. 3322type CacheContract struct { 3323 autorest.Response `json:"-"` 3324 // CacheContractProperties - Cache properties details. 3325 *CacheContractProperties `json:"properties,omitempty"` 3326 // ID - READ-ONLY; Resource ID. 3327 ID *string `json:"id,omitempty"` 3328 // Name - READ-ONLY; Resource name. 3329 Name *string `json:"name,omitempty"` 3330 // Type - READ-ONLY; Resource type for API Management resource. 3331 Type *string `json:"type,omitempty"` 3332} 3333 3334// MarshalJSON is the custom marshaler for CacheContract. 3335func (cc CacheContract) MarshalJSON() ([]byte, error) { 3336 objectMap := make(map[string]interface{}) 3337 if cc.CacheContractProperties != nil { 3338 objectMap["properties"] = cc.CacheContractProperties 3339 } 3340 return json.Marshal(objectMap) 3341} 3342 3343// UnmarshalJSON is the custom unmarshaler for CacheContract struct. 3344func (cc *CacheContract) UnmarshalJSON(body []byte) error { 3345 var m map[string]*json.RawMessage 3346 err := json.Unmarshal(body, &m) 3347 if err != nil { 3348 return err 3349 } 3350 for k, v := range m { 3351 switch k { 3352 case "properties": 3353 if v != nil { 3354 var cacheContractProperties CacheContractProperties 3355 err = json.Unmarshal(*v, &cacheContractProperties) 3356 if err != nil { 3357 return err 3358 } 3359 cc.CacheContractProperties = &cacheContractProperties 3360 } 3361 case "id": 3362 if v != nil { 3363 var ID string 3364 err = json.Unmarshal(*v, &ID) 3365 if err != nil { 3366 return err 3367 } 3368 cc.ID = &ID 3369 } 3370 case "name": 3371 if v != nil { 3372 var name string 3373 err = json.Unmarshal(*v, &name) 3374 if err != nil { 3375 return err 3376 } 3377 cc.Name = &name 3378 } 3379 case "type": 3380 if v != nil { 3381 var typeVar string 3382 err = json.Unmarshal(*v, &typeVar) 3383 if err != nil { 3384 return err 3385 } 3386 cc.Type = &typeVar 3387 } 3388 } 3389 } 3390 3391 return nil 3392} 3393 3394// CacheContractProperties properties of the Cache contract. 3395type CacheContractProperties struct { 3396 // Description - Cache description 3397 Description *string `json:"description,omitempty"` 3398 // ConnectionString - Runtime connection string to cache 3399 ConnectionString *string `json:"connectionString,omitempty"` 3400 // UseFromLocation - Location identifier to use cache from (should be either 'default' or valid Azure region identifier) 3401 UseFromLocation *string `json:"useFromLocation,omitempty"` 3402 // ResourceID - Original uri of entity in external system cache points to 3403 ResourceID *string `json:"resourceId,omitempty"` 3404} 3405 3406// CacheUpdateParameters cache update details. 3407type CacheUpdateParameters struct { 3408 // CacheUpdateProperties - Cache update properties details. 3409 *CacheUpdateProperties `json:"properties,omitempty"` 3410} 3411 3412// MarshalJSON is the custom marshaler for CacheUpdateParameters. 3413func (cup CacheUpdateParameters) MarshalJSON() ([]byte, error) { 3414 objectMap := make(map[string]interface{}) 3415 if cup.CacheUpdateProperties != nil { 3416 objectMap["properties"] = cup.CacheUpdateProperties 3417 } 3418 return json.Marshal(objectMap) 3419} 3420 3421// UnmarshalJSON is the custom unmarshaler for CacheUpdateParameters struct. 3422func (cup *CacheUpdateParameters) UnmarshalJSON(body []byte) error { 3423 var m map[string]*json.RawMessage 3424 err := json.Unmarshal(body, &m) 3425 if err != nil { 3426 return err 3427 } 3428 for k, v := range m { 3429 switch k { 3430 case "properties": 3431 if v != nil { 3432 var cacheUpdateProperties CacheUpdateProperties 3433 err = json.Unmarshal(*v, &cacheUpdateProperties) 3434 if err != nil { 3435 return err 3436 } 3437 cup.CacheUpdateProperties = &cacheUpdateProperties 3438 } 3439 } 3440 } 3441 3442 return nil 3443} 3444 3445// CacheUpdateProperties parameters supplied to the Update Cache operation. 3446type CacheUpdateProperties struct { 3447 // Description - Cache description 3448 Description *string `json:"description,omitempty"` 3449 // ConnectionString - Runtime connection string to cache 3450 ConnectionString *string `json:"connectionString,omitempty"` 3451 // UseFromLocation - Location identifier to use cache from (should be either 'default' or valid Azure region identifier) 3452 UseFromLocation *string `json:"useFromLocation,omitempty"` 3453 // ResourceID - Original uri of entity in external system cache points to 3454 ResourceID *string `json:"resourceId,omitempty"` 3455} 3456 3457// CertificateCollection paged Certificates list representation. 3458type CertificateCollection struct { 3459 autorest.Response `json:"-"` 3460 // Value - Page values. 3461 Value *[]CertificateContract `json:"value,omitempty"` 3462 // Count - Total record count number across all pages. 3463 Count *int64 `json:"count,omitempty"` 3464 // NextLink - Next page link if any. 3465 NextLink *string `json:"nextLink,omitempty"` 3466} 3467 3468// CertificateCollectionIterator provides access to a complete listing of CertificateContract values. 3469type CertificateCollectionIterator struct { 3470 i int 3471 page CertificateCollectionPage 3472} 3473 3474// NextWithContext advances to the next value. If there was an error making 3475// the request the iterator does not advance and the error is returned. 3476func (iter *CertificateCollectionIterator) NextWithContext(ctx context.Context) (err error) { 3477 if tracing.IsEnabled() { 3478 ctx = tracing.StartSpan(ctx, fqdn+"/CertificateCollectionIterator.NextWithContext") 3479 defer func() { 3480 sc := -1 3481 if iter.Response().Response.Response != nil { 3482 sc = iter.Response().Response.Response.StatusCode 3483 } 3484 tracing.EndSpan(ctx, sc, err) 3485 }() 3486 } 3487 iter.i++ 3488 if iter.i < len(iter.page.Values()) { 3489 return nil 3490 } 3491 err = iter.page.NextWithContext(ctx) 3492 if err != nil { 3493 iter.i-- 3494 return err 3495 } 3496 iter.i = 0 3497 return nil 3498} 3499 3500// Next advances to the next value. If there was an error making 3501// the request the iterator does not advance and the error is returned. 3502// Deprecated: Use NextWithContext() instead. 3503func (iter *CertificateCollectionIterator) Next() error { 3504 return iter.NextWithContext(context.Background()) 3505} 3506 3507// NotDone returns true if the enumeration should be started or is not yet complete. 3508func (iter CertificateCollectionIterator) NotDone() bool { 3509 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 3510} 3511 3512// Response returns the raw server response from the last page request. 3513func (iter CertificateCollectionIterator) Response() CertificateCollection { 3514 return iter.page.Response() 3515} 3516 3517// Value returns the current value or a zero-initialized value if the 3518// iterator has advanced beyond the end of the collection. 3519func (iter CertificateCollectionIterator) Value() CertificateContract { 3520 if !iter.page.NotDone() { 3521 return CertificateContract{} 3522 } 3523 return iter.page.Values()[iter.i] 3524} 3525 3526// Creates a new instance of the CertificateCollectionIterator type. 3527func NewCertificateCollectionIterator(page CertificateCollectionPage) CertificateCollectionIterator { 3528 return CertificateCollectionIterator{page: page} 3529} 3530 3531// IsEmpty returns true if the ListResult contains no values. 3532func (cc CertificateCollection) IsEmpty() bool { 3533 return cc.Value == nil || len(*cc.Value) == 0 3534} 3535 3536// hasNextLink returns true if the NextLink is not empty. 3537func (cc CertificateCollection) hasNextLink() bool { 3538 return cc.NextLink != nil && len(*cc.NextLink) != 0 3539} 3540 3541// certificateCollectionPreparer prepares a request to retrieve the next set of results. 3542// It returns nil if no more results exist. 3543func (cc CertificateCollection) certificateCollectionPreparer(ctx context.Context) (*http.Request, error) { 3544 if !cc.hasNextLink() { 3545 return nil, nil 3546 } 3547 return autorest.Prepare((&http.Request{}).WithContext(ctx), 3548 autorest.AsJSON(), 3549 autorest.AsGet(), 3550 autorest.WithBaseURL(to.String(cc.NextLink))) 3551} 3552 3553// CertificateCollectionPage contains a page of CertificateContract values. 3554type CertificateCollectionPage struct { 3555 fn func(context.Context, CertificateCollection) (CertificateCollection, error) 3556 cc CertificateCollection 3557} 3558 3559// NextWithContext advances to the next page of values. If there was an error making 3560// the request the page does not advance and the error is returned. 3561func (page *CertificateCollectionPage) NextWithContext(ctx context.Context) (err error) { 3562 if tracing.IsEnabled() { 3563 ctx = tracing.StartSpan(ctx, fqdn+"/CertificateCollectionPage.NextWithContext") 3564 defer func() { 3565 sc := -1 3566 if page.Response().Response.Response != nil { 3567 sc = page.Response().Response.Response.StatusCode 3568 } 3569 tracing.EndSpan(ctx, sc, err) 3570 }() 3571 } 3572 for { 3573 next, err := page.fn(ctx, page.cc) 3574 if err != nil { 3575 return err 3576 } 3577 page.cc = next 3578 if !next.hasNextLink() || !next.IsEmpty() { 3579 break 3580 } 3581 } 3582 return nil 3583} 3584 3585// Next advances to the next page of values. If there was an error making 3586// the request the page does not advance and the error is returned. 3587// Deprecated: Use NextWithContext() instead. 3588func (page *CertificateCollectionPage) Next() error { 3589 return page.NextWithContext(context.Background()) 3590} 3591 3592// NotDone returns true if the page enumeration should be started or is not yet complete. 3593func (page CertificateCollectionPage) NotDone() bool { 3594 return !page.cc.IsEmpty() 3595} 3596 3597// Response returns the raw server response from the last page request. 3598func (page CertificateCollectionPage) Response() CertificateCollection { 3599 return page.cc 3600} 3601 3602// Values returns the slice of values for the current page or nil if there are no values. 3603func (page CertificateCollectionPage) Values() []CertificateContract { 3604 if page.cc.IsEmpty() { 3605 return nil 3606 } 3607 return *page.cc.Value 3608} 3609 3610// Creates a new instance of the CertificateCollectionPage type. 3611func NewCertificateCollectionPage(cur CertificateCollection, getNextPage func(context.Context, CertificateCollection) (CertificateCollection, error)) CertificateCollectionPage { 3612 return CertificateCollectionPage{ 3613 fn: getNextPage, 3614 cc: cur, 3615 } 3616} 3617 3618// CertificateConfiguration certificate configuration which consist of non-trusted intermediates and root 3619// certificates. 3620type CertificateConfiguration struct { 3621 // EncodedCertificate - Base64 Encoded certificate. 3622 EncodedCertificate *string `json:"encodedCertificate,omitempty"` 3623 // CertificatePassword - Certificate Password. 3624 CertificatePassword *string `json:"certificatePassword,omitempty"` 3625 // StoreName - The System.Security.Cryptography.x509certificates.StoreName certificate store location. Only Root and CertificateAuthority are valid locations. Possible values include: 'CertificateAuthority', 'Root' 3626 StoreName StoreName `json:"storeName,omitempty"` 3627 // Certificate - Certificate information. 3628 Certificate *CertificateInformation `json:"certificate,omitempty"` 3629} 3630 3631// CertificateContract certificate details. 3632type CertificateContract struct { 3633 autorest.Response `json:"-"` 3634 // CertificateContractProperties - Certificate properties details. 3635 *CertificateContractProperties `json:"properties,omitempty"` 3636 // ID - READ-ONLY; Resource ID. 3637 ID *string `json:"id,omitempty"` 3638 // Name - READ-ONLY; Resource name. 3639 Name *string `json:"name,omitempty"` 3640 // Type - READ-ONLY; Resource type for API Management resource. 3641 Type *string `json:"type,omitempty"` 3642} 3643 3644// MarshalJSON is the custom marshaler for CertificateContract. 3645func (cc CertificateContract) MarshalJSON() ([]byte, error) { 3646 objectMap := make(map[string]interface{}) 3647 if cc.CertificateContractProperties != nil { 3648 objectMap["properties"] = cc.CertificateContractProperties 3649 } 3650 return json.Marshal(objectMap) 3651} 3652 3653// UnmarshalJSON is the custom unmarshaler for CertificateContract struct. 3654func (cc *CertificateContract) UnmarshalJSON(body []byte) error { 3655 var m map[string]*json.RawMessage 3656 err := json.Unmarshal(body, &m) 3657 if err != nil { 3658 return err 3659 } 3660 for k, v := range m { 3661 switch k { 3662 case "properties": 3663 if v != nil { 3664 var certificateContractProperties CertificateContractProperties 3665 err = json.Unmarshal(*v, &certificateContractProperties) 3666 if err != nil { 3667 return err 3668 } 3669 cc.CertificateContractProperties = &certificateContractProperties 3670 } 3671 case "id": 3672 if v != nil { 3673 var ID string 3674 err = json.Unmarshal(*v, &ID) 3675 if err != nil { 3676 return err 3677 } 3678 cc.ID = &ID 3679 } 3680 case "name": 3681 if v != nil { 3682 var name string 3683 err = json.Unmarshal(*v, &name) 3684 if err != nil { 3685 return err 3686 } 3687 cc.Name = &name 3688 } 3689 case "type": 3690 if v != nil { 3691 var typeVar string 3692 err = json.Unmarshal(*v, &typeVar) 3693 if err != nil { 3694 return err 3695 } 3696 cc.Type = &typeVar 3697 } 3698 } 3699 } 3700 3701 return nil 3702} 3703 3704// CertificateContractProperties properties of the Certificate contract. 3705type CertificateContractProperties struct { 3706 // Subject - Subject attribute of the certificate. 3707 Subject *string `json:"subject,omitempty"` 3708 // Thumbprint - Thumbprint of the certificate. 3709 Thumbprint *string `json:"thumbprint,omitempty"` 3710 // ExpirationDate - Expiration date of the certificate. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. 3711 ExpirationDate *date.Time `json:"expirationDate,omitempty"` 3712 // KeyVault - KeyVault location details of the certificate. 3713 KeyVault *KeyVaultContractProperties `json:"keyVault,omitempty"` 3714} 3715 3716// CertificateCreateOrUpdateParameters certificate create or update details. 3717type CertificateCreateOrUpdateParameters struct { 3718 // CertificateCreateOrUpdateProperties - Certificate create or update properties details. 3719 *CertificateCreateOrUpdateProperties `json:"properties,omitempty"` 3720} 3721 3722// MarshalJSON is the custom marshaler for CertificateCreateOrUpdateParameters. 3723func (ccoup CertificateCreateOrUpdateParameters) MarshalJSON() ([]byte, error) { 3724 objectMap := make(map[string]interface{}) 3725 if ccoup.CertificateCreateOrUpdateProperties != nil { 3726 objectMap["properties"] = ccoup.CertificateCreateOrUpdateProperties 3727 } 3728 return json.Marshal(objectMap) 3729} 3730 3731// UnmarshalJSON is the custom unmarshaler for CertificateCreateOrUpdateParameters struct. 3732func (ccoup *CertificateCreateOrUpdateParameters) UnmarshalJSON(body []byte) error { 3733 var m map[string]*json.RawMessage 3734 err := json.Unmarshal(body, &m) 3735 if err != nil { 3736 return err 3737 } 3738 for k, v := range m { 3739 switch k { 3740 case "properties": 3741 if v != nil { 3742 var certificateCreateOrUpdateProperties CertificateCreateOrUpdateProperties 3743 err = json.Unmarshal(*v, &certificateCreateOrUpdateProperties) 3744 if err != nil { 3745 return err 3746 } 3747 ccoup.CertificateCreateOrUpdateProperties = &certificateCreateOrUpdateProperties 3748 } 3749 } 3750 } 3751 3752 return nil 3753} 3754 3755// CertificateCreateOrUpdateProperties parameters supplied to the CreateOrUpdate certificate operation. 3756type CertificateCreateOrUpdateProperties struct { 3757 // Data - Base 64 encoded certificate using the application/x-pkcs12 representation. 3758 Data *string `json:"data,omitempty"` 3759 // Password - Password for the Certificate 3760 Password *string `json:"password,omitempty"` 3761 // KeyVault - KeyVault location details of the certificate. 3762 KeyVault *KeyVaultContractCreateProperties `json:"keyVault,omitempty"` 3763} 3764 3765// CertificateInformation SSL certificate information. 3766type CertificateInformation struct { 3767 // Expiry - Expiration date of the certificate. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. 3768 Expiry *date.Time `json:"expiry,omitempty"` 3769 // Thumbprint - Thumbprint of the certificate. 3770 Thumbprint *string `json:"thumbprint,omitempty"` 3771 // Subject - Subject of the certificate. 3772 Subject *string `json:"subject,omitempty"` 3773} 3774 3775// ClientSecretContract client or app secret used in IdentityProviders, Aad, OpenID or OAuth. 3776type ClientSecretContract struct { 3777 autorest.Response `json:"-"` 3778 // ClientSecret - Client or app secret used in IdentityProviders, Aad, OpenID or OAuth. 3779 ClientSecret *string `json:"clientSecret,omitempty"` 3780} 3781 3782// ConnectivityStatusContract details about connectivity to a resource. 3783type ConnectivityStatusContract struct { 3784 // Name - The hostname of the resource which the service depends on. This can be the database, storage or any other azure resource on which the service depends upon. 3785 Name *string `json:"name,omitempty"` 3786 // Status - Resource Connectivity Status Type identifier. Possible values include: 'Initializing', 'Success', 'Failure' 3787 Status ConnectivityStatusType `json:"status,omitempty"` 3788 // Error - Error details of the connectivity to the resource. 3789 Error *string `json:"error,omitempty"` 3790 // LastUpdated - The date when the resource connectivity status was last updated. This status should be updated every 15 minutes. If this status has not been updated, then it means that the service has lost network connectivity to the resource, from inside the Virtual Network.The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. 3791 LastUpdated *date.Time `json:"lastUpdated,omitempty"` 3792 // LastStatusChange - The date when the resource connectivity status last Changed from success to failure or vice-versa. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. 3793 LastStatusChange *date.Time `json:"lastStatusChange,omitempty"` 3794 // ResourceType - Resource Type. 3795 ResourceType *string `json:"resourceType,omitempty"` 3796 // IsOptional - Whether this is optional. 3797 IsOptional *bool `json:"isOptional,omitempty"` 3798} 3799 3800// ContentItemCollection paged list of content items. 3801type ContentItemCollection struct { 3802 autorest.Response `json:"-"` 3803 // Value - READ-ONLY; Collection of content items. 3804 Value *[]ContentItemContract `json:"value,omitempty"` 3805 // NextLink - READ-ONLY; Next page link, if any. 3806 NextLink *string `json:"nextLink,omitempty"` 3807} 3808 3809// MarshalJSON is the custom marshaler for ContentItemCollection. 3810func (cic ContentItemCollection) MarshalJSON() ([]byte, error) { 3811 objectMap := make(map[string]interface{}) 3812 return json.Marshal(objectMap) 3813} 3814 3815// ContentItemCollectionIterator provides access to a complete listing of ContentItemContract values. 3816type ContentItemCollectionIterator struct { 3817 i int 3818 page ContentItemCollectionPage 3819} 3820 3821// NextWithContext advances to the next value. If there was an error making 3822// the request the iterator does not advance and the error is returned. 3823func (iter *ContentItemCollectionIterator) NextWithContext(ctx context.Context) (err error) { 3824 if tracing.IsEnabled() { 3825 ctx = tracing.StartSpan(ctx, fqdn+"/ContentItemCollectionIterator.NextWithContext") 3826 defer func() { 3827 sc := -1 3828 if iter.Response().Response.Response != nil { 3829 sc = iter.Response().Response.Response.StatusCode 3830 } 3831 tracing.EndSpan(ctx, sc, err) 3832 }() 3833 } 3834 iter.i++ 3835 if iter.i < len(iter.page.Values()) { 3836 return nil 3837 } 3838 err = iter.page.NextWithContext(ctx) 3839 if err != nil { 3840 iter.i-- 3841 return err 3842 } 3843 iter.i = 0 3844 return nil 3845} 3846 3847// Next advances to the next value. If there was an error making 3848// the request the iterator does not advance and the error is returned. 3849// Deprecated: Use NextWithContext() instead. 3850func (iter *ContentItemCollectionIterator) Next() error { 3851 return iter.NextWithContext(context.Background()) 3852} 3853 3854// NotDone returns true if the enumeration should be started or is not yet complete. 3855func (iter ContentItemCollectionIterator) NotDone() bool { 3856 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 3857} 3858 3859// Response returns the raw server response from the last page request. 3860func (iter ContentItemCollectionIterator) Response() ContentItemCollection { 3861 return iter.page.Response() 3862} 3863 3864// Value returns the current value or a zero-initialized value if the 3865// iterator has advanced beyond the end of the collection. 3866func (iter ContentItemCollectionIterator) Value() ContentItemContract { 3867 if !iter.page.NotDone() { 3868 return ContentItemContract{} 3869 } 3870 return iter.page.Values()[iter.i] 3871} 3872 3873// Creates a new instance of the ContentItemCollectionIterator type. 3874func NewContentItemCollectionIterator(page ContentItemCollectionPage) ContentItemCollectionIterator { 3875 return ContentItemCollectionIterator{page: page} 3876} 3877 3878// IsEmpty returns true if the ListResult contains no values. 3879func (cic ContentItemCollection) IsEmpty() bool { 3880 return cic.Value == nil || len(*cic.Value) == 0 3881} 3882 3883// hasNextLink returns true if the NextLink is not empty. 3884func (cic ContentItemCollection) hasNextLink() bool { 3885 return cic.NextLink != nil && len(*cic.NextLink) != 0 3886} 3887 3888// contentItemCollectionPreparer prepares a request to retrieve the next set of results. 3889// It returns nil if no more results exist. 3890func (cic ContentItemCollection) contentItemCollectionPreparer(ctx context.Context) (*http.Request, error) { 3891 if !cic.hasNextLink() { 3892 return nil, nil 3893 } 3894 return autorest.Prepare((&http.Request{}).WithContext(ctx), 3895 autorest.AsJSON(), 3896 autorest.AsGet(), 3897 autorest.WithBaseURL(to.String(cic.NextLink))) 3898} 3899 3900// ContentItemCollectionPage contains a page of ContentItemContract values. 3901type ContentItemCollectionPage struct { 3902 fn func(context.Context, ContentItemCollection) (ContentItemCollection, error) 3903 cic ContentItemCollection 3904} 3905 3906// NextWithContext advances to the next page of values. If there was an error making 3907// the request the page does not advance and the error is returned. 3908func (page *ContentItemCollectionPage) NextWithContext(ctx context.Context) (err error) { 3909 if tracing.IsEnabled() { 3910 ctx = tracing.StartSpan(ctx, fqdn+"/ContentItemCollectionPage.NextWithContext") 3911 defer func() { 3912 sc := -1 3913 if page.Response().Response.Response != nil { 3914 sc = page.Response().Response.Response.StatusCode 3915 } 3916 tracing.EndSpan(ctx, sc, err) 3917 }() 3918 } 3919 for { 3920 next, err := page.fn(ctx, page.cic) 3921 if err != nil { 3922 return err 3923 } 3924 page.cic = next 3925 if !next.hasNextLink() || !next.IsEmpty() { 3926 break 3927 } 3928 } 3929 return nil 3930} 3931 3932// Next advances to the next page of values. If there was an error making 3933// the request the page does not advance and the error is returned. 3934// Deprecated: Use NextWithContext() instead. 3935func (page *ContentItemCollectionPage) Next() error { 3936 return page.NextWithContext(context.Background()) 3937} 3938 3939// NotDone returns true if the page enumeration should be started or is not yet complete. 3940func (page ContentItemCollectionPage) NotDone() bool { 3941 return !page.cic.IsEmpty() 3942} 3943 3944// Response returns the raw server response from the last page request. 3945func (page ContentItemCollectionPage) Response() ContentItemCollection { 3946 return page.cic 3947} 3948 3949// Values returns the slice of values for the current page or nil if there are no values. 3950func (page ContentItemCollectionPage) Values() []ContentItemContract { 3951 if page.cic.IsEmpty() { 3952 return nil 3953 } 3954 return *page.cic.Value 3955} 3956 3957// Creates a new instance of the ContentItemCollectionPage type. 3958func NewContentItemCollectionPage(cur ContentItemCollection, getNextPage func(context.Context, ContentItemCollection) (ContentItemCollection, error)) ContentItemCollectionPage { 3959 return ContentItemCollectionPage{ 3960 fn: getNextPage, 3961 cic: cur, 3962 } 3963} 3964 3965// ContentItemContract content type contract details. 3966type ContentItemContract struct { 3967 autorest.Response `json:"-"` 3968 // Properties - Properties of the content item. 3969 Properties map[string]interface{} `json:"properties"` 3970 // ID - READ-ONLY; Resource ID. 3971 ID *string `json:"id,omitempty"` 3972 // Name - READ-ONLY; Resource name. 3973 Name *string `json:"name,omitempty"` 3974 // Type - READ-ONLY; Resource type for API Management resource. 3975 Type *string `json:"type,omitempty"` 3976} 3977 3978// MarshalJSON is the custom marshaler for ContentItemContract. 3979func (cic ContentItemContract) MarshalJSON() ([]byte, error) { 3980 objectMap := make(map[string]interface{}) 3981 if cic.Properties != nil { 3982 objectMap["properties"] = cic.Properties 3983 } 3984 return json.Marshal(objectMap) 3985} 3986 3987// ContentTypeCollection paged list of content types. 3988type ContentTypeCollection struct { 3989 autorest.Response `json:"-"` 3990 // Value - READ-ONLY; Collection of content types. 3991 Value *[]ContentTypeContract `json:"value,omitempty"` 3992 // NextLink - READ-ONLY; Next page link, if any. 3993 NextLink *string `json:"nextLink,omitempty"` 3994} 3995 3996// MarshalJSON is the custom marshaler for ContentTypeCollection. 3997func (ctc ContentTypeCollection) MarshalJSON() ([]byte, error) { 3998 objectMap := make(map[string]interface{}) 3999 return json.Marshal(objectMap) 4000} 4001 4002// ContentTypeCollectionIterator provides access to a complete listing of ContentTypeContract values. 4003type ContentTypeCollectionIterator struct { 4004 i int 4005 page ContentTypeCollectionPage 4006} 4007 4008// NextWithContext advances to the next value. If there was an error making 4009// the request the iterator does not advance and the error is returned. 4010func (iter *ContentTypeCollectionIterator) NextWithContext(ctx context.Context) (err error) { 4011 if tracing.IsEnabled() { 4012 ctx = tracing.StartSpan(ctx, fqdn+"/ContentTypeCollectionIterator.NextWithContext") 4013 defer func() { 4014 sc := -1 4015 if iter.Response().Response.Response != nil { 4016 sc = iter.Response().Response.Response.StatusCode 4017 } 4018 tracing.EndSpan(ctx, sc, err) 4019 }() 4020 } 4021 iter.i++ 4022 if iter.i < len(iter.page.Values()) { 4023 return nil 4024 } 4025 err = iter.page.NextWithContext(ctx) 4026 if err != nil { 4027 iter.i-- 4028 return err 4029 } 4030 iter.i = 0 4031 return nil 4032} 4033 4034// Next advances to the next value. If there was an error making 4035// the request the iterator does not advance and the error is returned. 4036// Deprecated: Use NextWithContext() instead. 4037func (iter *ContentTypeCollectionIterator) Next() error { 4038 return iter.NextWithContext(context.Background()) 4039} 4040 4041// NotDone returns true if the enumeration should be started or is not yet complete. 4042func (iter ContentTypeCollectionIterator) NotDone() bool { 4043 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 4044} 4045 4046// Response returns the raw server response from the last page request. 4047func (iter ContentTypeCollectionIterator) Response() ContentTypeCollection { 4048 return iter.page.Response() 4049} 4050 4051// Value returns the current value or a zero-initialized value if the 4052// iterator has advanced beyond the end of the collection. 4053func (iter ContentTypeCollectionIterator) Value() ContentTypeContract { 4054 if !iter.page.NotDone() { 4055 return ContentTypeContract{} 4056 } 4057 return iter.page.Values()[iter.i] 4058} 4059 4060// Creates a new instance of the ContentTypeCollectionIterator type. 4061func NewContentTypeCollectionIterator(page ContentTypeCollectionPage) ContentTypeCollectionIterator { 4062 return ContentTypeCollectionIterator{page: page} 4063} 4064 4065// IsEmpty returns true if the ListResult contains no values. 4066func (ctc ContentTypeCollection) IsEmpty() bool { 4067 return ctc.Value == nil || len(*ctc.Value) == 0 4068} 4069 4070// hasNextLink returns true if the NextLink is not empty. 4071func (ctc ContentTypeCollection) hasNextLink() bool { 4072 return ctc.NextLink != nil && len(*ctc.NextLink) != 0 4073} 4074 4075// contentTypeCollectionPreparer prepares a request to retrieve the next set of results. 4076// It returns nil if no more results exist. 4077func (ctc ContentTypeCollection) contentTypeCollectionPreparer(ctx context.Context) (*http.Request, error) { 4078 if !ctc.hasNextLink() { 4079 return nil, nil 4080 } 4081 return autorest.Prepare((&http.Request{}).WithContext(ctx), 4082 autorest.AsJSON(), 4083 autorest.AsGet(), 4084 autorest.WithBaseURL(to.String(ctc.NextLink))) 4085} 4086 4087// ContentTypeCollectionPage contains a page of ContentTypeContract values. 4088type ContentTypeCollectionPage struct { 4089 fn func(context.Context, ContentTypeCollection) (ContentTypeCollection, error) 4090 ctc ContentTypeCollection 4091} 4092 4093// NextWithContext advances to the next page of values. If there was an error making 4094// the request the page does not advance and the error is returned. 4095func (page *ContentTypeCollectionPage) NextWithContext(ctx context.Context) (err error) { 4096 if tracing.IsEnabled() { 4097 ctx = tracing.StartSpan(ctx, fqdn+"/ContentTypeCollectionPage.NextWithContext") 4098 defer func() { 4099 sc := -1 4100 if page.Response().Response.Response != nil { 4101 sc = page.Response().Response.Response.StatusCode 4102 } 4103 tracing.EndSpan(ctx, sc, err) 4104 }() 4105 } 4106 for { 4107 next, err := page.fn(ctx, page.ctc) 4108 if err != nil { 4109 return err 4110 } 4111 page.ctc = next 4112 if !next.hasNextLink() || !next.IsEmpty() { 4113 break 4114 } 4115 } 4116 return nil 4117} 4118 4119// Next advances to the next page of values. If there was an error making 4120// the request the page does not advance and the error is returned. 4121// Deprecated: Use NextWithContext() instead. 4122func (page *ContentTypeCollectionPage) Next() error { 4123 return page.NextWithContext(context.Background()) 4124} 4125 4126// NotDone returns true if the page enumeration should be started or is not yet complete. 4127func (page ContentTypeCollectionPage) NotDone() bool { 4128 return !page.ctc.IsEmpty() 4129} 4130 4131// Response returns the raw server response from the last page request. 4132func (page ContentTypeCollectionPage) Response() ContentTypeCollection { 4133 return page.ctc 4134} 4135 4136// Values returns the slice of values for the current page or nil if there are no values. 4137func (page ContentTypeCollectionPage) Values() []ContentTypeContract { 4138 if page.ctc.IsEmpty() { 4139 return nil 4140 } 4141 return *page.ctc.Value 4142} 4143 4144// Creates a new instance of the ContentTypeCollectionPage type. 4145func NewContentTypeCollectionPage(cur ContentTypeCollection, getNextPage func(context.Context, ContentTypeCollection) (ContentTypeCollection, error)) ContentTypeCollectionPage { 4146 return ContentTypeCollectionPage{ 4147 fn: getNextPage, 4148 ctc: cur, 4149 } 4150} 4151 4152// ContentTypeContract content type contract details. 4153type ContentTypeContract struct { 4154 autorest.Response `json:"-"` 4155 // ContentTypeContractProperties - Properties of the content type. 4156 *ContentTypeContractProperties `json:"properties,omitempty"` 4157 // ID - READ-ONLY; Resource ID. 4158 ID *string `json:"id,omitempty"` 4159 // Name - READ-ONLY; Resource name. 4160 Name *string `json:"name,omitempty"` 4161 // Type - READ-ONLY; Resource type for API Management resource. 4162 Type *string `json:"type,omitempty"` 4163} 4164 4165// MarshalJSON is the custom marshaler for ContentTypeContract. 4166func (ctc ContentTypeContract) MarshalJSON() ([]byte, error) { 4167 objectMap := make(map[string]interface{}) 4168 if ctc.ContentTypeContractProperties != nil { 4169 objectMap["properties"] = ctc.ContentTypeContractProperties 4170 } 4171 return json.Marshal(objectMap) 4172} 4173 4174// UnmarshalJSON is the custom unmarshaler for ContentTypeContract struct. 4175func (ctc *ContentTypeContract) UnmarshalJSON(body []byte) error { 4176 var m map[string]*json.RawMessage 4177 err := json.Unmarshal(body, &m) 4178 if err != nil { 4179 return err 4180 } 4181 for k, v := range m { 4182 switch k { 4183 case "properties": 4184 if v != nil { 4185 var contentTypeContractProperties ContentTypeContractProperties 4186 err = json.Unmarshal(*v, &contentTypeContractProperties) 4187 if err != nil { 4188 return err 4189 } 4190 ctc.ContentTypeContractProperties = &contentTypeContractProperties 4191 } 4192 case "id": 4193 if v != nil { 4194 var ID string 4195 err = json.Unmarshal(*v, &ID) 4196 if err != nil { 4197 return err 4198 } 4199 ctc.ID = &ID 4200 } 4201 case "name": 4202 if v != nil { 4203 var name string 4204 err = json.Unmarshal(*v, &name) 4205 if err != nil { 4206 return err 4207 } 4208 ctc.Name = &name 4209 } 4210 case "type": 4211 if v != nil { 4212 var typeVar string 4213 err = json.Unmarshal(*v, &typeVar) 4214 if err != nil { 4215 return err 4216 } 4217 ctc.Type = &typeVar 4218 } 4219 } 4220 } 4221 4222 return nil 4223} 4224 4225// ContentTypeContractProperties ... 4226type ContentTypeContractProperties struct { 4227 // ID - Content type identifier 4228 ID *string `json:"id,omitempty"` 4229 // Name - Content type name. Must be 1 to 250 characters long. 4230 Name *string `json:"name,omitempty"` 4231 // Description - Content type description. 4232 Description *string `json:"description,omitempty"` 4233 // Schema - Content type schema. 4234 Schema interface{} `json:"schema,omitempty"` 4235 // Version - Content type version. 4236 Version *string `json:"version,omitempty"` 4237} 4238 4239// DataMasking ... 4240type DataMasking struct { 4241 // QueryParams - Masking settings for Url query parameters 4242 QueryParams *[]DataMaskingEntity `json:"queryParams,omitempty"` 4243 // Headers - Masking settings for headers 4244 Headers *[]DataMaskingEntity `json:"headers,omitempty"` 4245} 4246 4247// DataMaskingEntity ... 4248type DataMaskingEntity struct { 4249 // Value - The name of an entity to mask (e.g. a name of a header or a query parameter). 4250 Value *string `json:"value,omitempty"` 4251 // Mode - Data masking mode. Possible values include: 'Mask', 'Hide' 4252 Mode DataMaskingMode `json:"mode,omitempty"` 4253} 4254 4255// DeletedServiceContract deleted Api Management Service information. 4256type DeletedServiceContract struct { 4257 autorest.Response `json:"-"` 4258 // DeletedServiceContractProperties - Deleted Api Management Service details. 4259 *DeletedServiceContractProperties `json:"properties,omitempty"` 4260 // Location - READ-ONLY; Api Management Service Master Location. 4261 Location *string `json:"location,omitempty"` 4262 // ID - READ-ONLY; Resource ID. 4263 ID *string `json:"id,omitempty"` 4264 // Name - READ-ONLY; Resource name. 4265 Name *string `json:"name,omitempty"` 4266 // Type - READ-ONLY; Resource type for API Management resource. 4267 Type *string `json:"type,omitempty"` 4268} 4269 4270// MarshalJSON is the custom marshaler for DeletedServiceContract. 4271func (dsc DeletedServiceContract) MarshalJSON() ([]byte, error) { 4272 objectMap := make(map[string]interface{}) 4273 if dsc.DeletedServiceContractProperties != nil { 4274 objectMap["properties"] = dsc.DeletedServiceContractProperties 4275 } 4276 return json.Marshal(objectMap) 4277} 4278 4279// UnmarshalJSON is the custom unmarshaler for DeletedServiceContract struct. 4280func (dsc *DeletedServiceContract) UnmarshalJSON(body []byte) error { 4281 var m map[string]*json.RawMessage 4282 err := json.Unmarshal(body, &m) 4283 if err != nil { 4284 return err 4285 } 4286 for k, v := range m { 4287 switch k { 4288 case "properties": 4289 if v != nil { 4290 var deletedServiceContractProperties DeletedServiceContractProperties 4291 err = json.Unmarshal(*v, &deletedServiceContractProperties) 4292 if err != nil { 4293 return err 4294 } 4295 dsc.DeletedServiceContractProperties = &deletedServiceContractProperties 4296 } 4297 case "location": 4298 if v != nil { 4299 var location string 4300 err = json.Unmarshal(*v, &location) 4301 if err != nil { 4302 return err 4303 } 4304 dsc.Location = &location 4305 } 4306 case "id": 4307 if v != nil { 4308 var ID string 4309 err = json.Unmarshal(*v, &ID) 4310 if err != nil { 4311 return err 4312 } 4313 dsc.ID = &ID 4314 } 4315 case "name": 4316 if v != nil { 4317 var name string 4318 err = json.Unmarshal(*v, &name) 4319 if err != nil { 4320 return err 4321 } 4322 dsc.Name = &name 4323 } 4324 case "type": 4325 if v != nil { 4326 var typeVar string 4327 err = json.Unmarshal(*v, &typeVar) 4328 if err != nil { 4329 return err 4330 } 4331 dsc.Type = &typeVar 4332 } 4333 } 4334 } 4335 4336 return nil 4337} 4338 4339// DeletedServiceContractProperties ... 4340type DeletedServiceContractProperties struct { 4341 // ServiceID - Fully-qualified API Management Service Resource ID 4342 ServiceID *string `json:"serviceId,omitempty"` 4343 // ScheduledPurgeDate - UTC Date and Time when the service will be automatically purged. The date conforms to the following format: yyyy-MM-ddTHH:mm:ssZ as specified by the ISO 8601 standard. 4344 ScheduledPurgeDate *date.Time `json:"scheduledPurgeDate,omitempty"` 4345 // DeletionDate - UTC Timestamp when the service was soft-deleted. The date conforms to the following format: yyyy-MM-ddTHH:mm:ssZ as specified by the ISO 8601 standard. 4346 DeletionDate *date.Time `json:"deletionDate,omitempty"` 4347} 4348 4349// DeletedServicesCollection paged deleted Api Management Services List Representation. 4350type DeletedServicesCollection struct { 4351 autorest.Response `json:"-"` 4352 // Value - READ-ONLY; Page values. 4353 Value *[]DeletedServiceContract `json:"value,omitempty"` 4354 // NextLink - READ-ONLY; Next page link if any. 4355 NextLink *string `json:"nextLink,omitempty"` 4356} 4357 4358// MarshalJSON is the custom marshaler for DeletedServicesCollection. 4359func (dsc DeletedServicesCollection) MarshalJSON() ([]byte, error) { 4360 objectMap := make(map[string]interface{}) 4361 return json.Marshal(objectMap) 4362} 4363 4364// DeletedServicesCollectionIterator provides access to a complete listing of DeletedServiceContract 4365// values. 4366type DeletedServicesCollectionIterator struct { 4367 i int 4368 page DeletedServicesCollectionPage 4369} 4370 4371// NextWithContext advances to the next value. If there was an error making 4372// the request the iterator does not advance and the error is returned. 4373func (iter *DeletedServicesCollectionIterator) NextWithContext(ctx context.Context) (err error) { 4374 if tracing.IsEnabled() { 4375 ctx = tracing.StartSpan(ctx, fqdn+"/DeletedServicesCollectionIterator.NextWithContext") 4376 defer func() { 4377 sc := -1 4378 if iter.Response().Response.Response != nil { 4379 sc = iter.Response().Response.Response.StatusCode 4380 } 4381 tracing.EndSpan(ctx, sc, err) 4382 }() 4383 } 4384 iter.i++ 4385 if iter.i < len(iter.page.Values()) { 4386 return nil 4387 } 4388 err = iter.page.NextWithContext(ctx) 4389 if err != nil { 4390 iter.i-- 4391 return err 4392 } 4393 iter.i = 0 4394 return nil 4395} 4396 4397// Next advances to the next value. If there was an error making 4398// the request the iterator does not advance and the error is returned. 4399// Deprecated: Use NextWithContext() instead. 4400func (iter *DeletedServicesCollectionIterator) Next() error { 4401 return iter.NextWithContext(context.Background()) 4402} 4403 4404// NotDone returns true if the enumeration should be started or is not yet complete. 4405func (iter DeletedServicesCollectionIterator) NotDone() bool { 4406 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 4407} 4408 4409// Response returns the raw server response from the last page request. 4410func (iter DeletedServicesCollectionIterator) Response() DeletedServicesCollection { 4411 return iter.page.Response() 4412} 4413 4414// Value returns the current value or a zero-initialized value if the 4415// iterator has advanced beyond the end of the collection. 4416func (iter DeletedServicesCollectionIterator) Value() DeletedServiceContract { 4417 if !iter.page.NotDone() { 4418 return DeletedServiceContract{} 4419 } 4420 return iter.page.Values()[iter.i] 4421} 4422 4423// Creates a new instance of the DeletedServicesCollectionIterator type. 4424func NewDeletedServicesCollectionIterator(page DeletedServicesCollectionPage) DeletedServicesCollectionIterator { 4425 return DeletedServicesCollectionIterator{page: page} 4426} 4427 4428// IsEmpty returns true if the ListResult contains no values. 4429func (dsc DeletedServicesCollection) IsEmpty() bool { 4430 return dsc.Value == nil || len(*dsc.Value) == 0 4431} 4432 4433// hasNextLink returns true if the NextLink is not empty. 4434func (dsc DeletedServicesCollection) hasNextLink() bool { 4435 return dsc.NextLink != nil && len(*dsc.NextLink) != 0 4436} 4437 4438// deletedServicesCollectionPreparer prepares a request to retrieve the next set of results. 4439// It returns nil if no more results exist. 4440func (dsc DeletedServicesCollection) deletedServicesCollectionPreparer(ctx context.Context) (*http.Request, error) { 4441 if !dsc.hasNextLink() { 4442 return nil, nil 4443 } 4444 return autorest.Prepare((&http.Request{}).WithContext(ctx), 4445 autorest.AsJSON(), 4446 autorest.AsGet(), 4447 autorest.WithBaseURL(to.String(dsc.NextLink))) 4448} 4449 4450// DeletedServicesCollectionPage contains a page of DeletedServiceContract values. 4451type DeletedServicesCollectionPage struct { 4452 fn func(context.Context, DeletedServicesCollection) (DeletedServicesCollection, error) 4453 dsc DeletedServicesCollection 4454} 4455 4456// NextWithContext advances to the next page of values. If there was an error making 4457// the request the page does not advance and the error is returned. 4458func (page *DeletedServicesCollectionPage) NextWithContext(ctx context.Context) (err error) { 4459 if tracing.IsEnabled() { 4460 ctx = tracing.StartSpan(ctx, fqdn+"/DeletedServicesCollectionPage.NextWithContext") 4461 defer func() { 4462 sc := -1 4463 if page.Response().Response.Response != nil { 4464 sc = page.Response().Response.Response.StatusCode 4465 } 4466 tracing.EndSpan(ctx, sc, err) 4467 }() 4468 } 4469 for { 4470 next, err := page.fn(ctx, page.dsc) 4471 if err != nil { 4472 return err 4473 } 4474 page.dsc = next 4475 if !next.hasNextLink() || !next.IsEmpty() { 4476 break 4477 } 4478 } 4479 return nil 4480} 4481 4482// Next advances to the next page of values. If there was an error making 4483// the request the page does not advance and the error is returned. 4484// Deprecated: Use NextWithContext() instead. 4485func (page *DeletedServicesCollectionPage) Next() error { 4486 return page.NextWithContext(context.Background()) 4487} 4488 4489// NotDone returns true if the page enumeration should be started or is not yet complete. 4490func (page DeletedServicesCollectionPage) NotDone() bool { 4491 return !page.dsc.IsEmpty() 4492} 4493 4494// Response returns the raw server response from the last page request. 4495func (page DeletedServicesCollectionPage) Response() DeletedServicesCollection { 4496 return page.dsc 4497} 4498 4499// Values returns the slice of values for the current page or nil if there are no values. 4500func (page DeletedServicesCollectionPage) Values() []DeletedServiceContract { 4501 if page.dsc.IsEmpty() { 4502 return nil 4503 } 4504 return *page.dsc.Value 4505} 4506 4507// Creates a new instance of the DeletedServicesCollectionPage type. 4508func NewDeletedServicesCollectionPage(cur DeletedServicesCollection, getNextPage func(context.Context, DeletedServicesCollection) (DeletedServicesCollection, error)) DeletedServicesCollectionPage { 4509 return DeletedServicesCollectionPage{ 4510 fn: getNextPage, 4511 dsc: cur, 4512 } 4513} 4514 4515// DeletedServicesPurgeFuture an abstraction for monitoring and retrieving the results of a long-running 4516// operation. 4517type DeletedServicesPurgeFuture struct { 4518 azure.FutureAPI 4519 // Result returns the result of the asynchronous operation. 4520 // If the operation has not completed it will return an error. 4521 Result func(DeletedServicesClient) (DeletedServiceContract, error) 4522} 4523 4524// UnmarshalJSON is the custom unmarshaller for CreateFuture. 4525func (future *DeletedServicesPurgeFuture) UnmarshalJSON(body []byte) error { 4526 var azFuture azure.Future 4527 if err := json.Unmarshal(body, &azFuture); err != nil { 4528 return err 4529 } 4530 future.FutureAPI = &azFuture 4531 future.Result = future.result 4532 return nil 4533} 4534 4535// result is the default implementation for DeletedServicesPurgeFuture.Result. 4536func (future *DeletedServicesPurgeFuture) result(client DeletedServicesClient) (dsc DeletedServiceContract, err error) { 4537 var done bool 4538 done, err = future.DoneWithContext(context.Background(), client) 4539 if err != nil { 4540 err = autorest.NewErrorWithError(err, "apimanagement.DeletedServicesPurgeFuture", "Result", future.Response(), "Polling failure") 4541 return 4542 } 4543 if !done { 4544 dsc.Response.Response = future.Response() 4545 err = azure.NewAsyncOpIncompleteError("apimanagement.DeletedServicesPurgeFuture") 4546 return 4547 } 4548 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 4549 if dsc.Response.Response, err = future.GetResult(sender); err == nil && dsc.Response.Response.StatusCode != http.StatusNoContent { 4550 dsc, err = client.PurgeResponder(dsc.Response.Response) 4551 if err != nil { 4552 err = autorest.NewErrorWithError(err, "apimanagement.DeletedServicesPurgeFuture", "Result", dsc.Response.Response, "Failure responding to request") 4553 } 4554 } 4555 return 4556} 4557 4558// DeployConfigurationParameterProperties parameters supplied to the Deploy Configuration operation. 4559type DeployConfigurationParameterProperties struct { 4560 // Branch - The name of the Git branch from which the configuration is to be deployed to the configuration database. 4561 Branch *string `json:"branch,omitempty"` 4562 // Force - The value enforcing deleting subscriptions to products that are deleted in this update. 4563 Force *bool `json:"force,omitempty"` 4564} 4565 4566// DeployConfigurationParameters deploy Tenant Configuration Contract. 4567type DeployConfigurationParameters struct { 4568 // DeployConfigurationParameterProperties - Deploy Configuration Parameter contract properties. 4569 *DeployConfigurationParameterProperties `json:"properties,omitempty"` 4570} 4571 4572// MarshalJSON is the custom marshaler for DeployConfigurationParameters. 4573func (dcp DeployConfigurationParameters) MarshalJSON() ([]byte, error) { 4574 objectMap := make(map[string]interface{}) 4575 if dcp.DeployConfigurationParameterProperties != nil { 4576 objectMap["properties"] = dcp.DeployConfigurationParameterProperties 4577 } 4578 return json.Marshal(objectMap) 4579} 4580 4581// UnmarshalJSON is the custom unmarshaler for DeployConfigurationParameters struct. 4582func (dcp *DeployConfigurationParameters) UnmarshalJSON(body []byte) error { 4583 var m map[string]*json.RawMessage 4584 err := json.Unmarshal(body, &m) 4585 if err != nil { 4586 return err 4587 } 4588 for k, v := range m { 4589 switch k { 4590 case "properties": 4591 if v != nil { 4592 var deployConfigurationParameterProperties DeployConfigurationParameterProperties 4593 err = json.Unmarshal(*v, &deployConfigurationParameterProperties) 4594 if err != nil { 4595 return err 4596 } 4597 dcp.DeployConfigurationParameterProperties = &deployConfigurationParameterProperties 4598 } 4599 } 4600 } 4601 4602 return nil 4603} 4604 4605// DiagnosticCollection paged Diagnostic list representation. 4606type DiagnosticCollection struct { 4607 autorest.Response `json:"-"` 4608 // Value - Page values. 4609 Value *[]DiagnosticContract `json:"value,omitempty"` 4610 // Count - Total record count number across all pages. 4611 Count *int64 `json:"count,omitempty"` 4612 // NextLink - Next page link if any. 4613 NextLink *string `json:"nextLink,omitempty"` 4614} 4615 4616// DiagnosticCollectionIterator provides access to a complete listing of DiagnosticContract values. 4617type DiagnosticCollectionIterator struct { 4618 i int 4619 page DiagnosticCollectionPage 4620} 4621 4622// NextWithContext advances to the next value. If there was an error making 4623// the request the iterator does not advance and the error is returned. 4624func (iter *DiagnosticCollectionIterator) NextWithContext(ctx context.Context) (err error) { 4625 if tracing.IsEnabled() { 4626 ctx = tracing.StartSpan(ctx, fqdn+"/DiagnosticCollectionIterator.NextWithContext") 4627 defer func() { 4628 sc := -1 4629 if iter.Response().Response.Response != nil { 4630 sc = iter.Response().Response.Response.StatusCode 4631 } 4632 tracing.EndSpan(ctx, sc, err) 4633 }() 4634 } 4635 iter.i++ 4636 if iter.i < len(iter.page.Values()) { 4637 return nil 4638 } 4639 err = iter.page.NextWithContext(ctx) 4640 if err != nil { 4641 iter.i-- 4642 return err 4643 } 4644 iter.i = 0 4645 return nil 4646} 4647 4648// Next advances to the next value. If there was an error making 4649// the request the iterator does not advance and the error is returned. 4650// Deprecated: Use NextWithContext() instead. 4651func (iter *DiagnosticCollectionIterator) Next() error { 4652 return iter.NextWithContext(context.Background()) 4653} 4654 4655// NotDone returns true if the enumeration should be started or is not yet complete. 4656func (iter DiagnosticCollectionIterator) NotDone() bool { 4657 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 4658} 4659 4660// Response returns the raw server response from the last page request. 4661func (iter DiagnosticCollectionIterator) Response() DiagnosticCollection { 4662 return iter.page.Response() 4663} 4664 4665// Value returns the current value or a zero-initialized value if the 4666// iterator has advanced beyond the end of the collection. 4667func (iter DiagnosticCollectionIterator) Value() DiagnosticContract { 4668 if !iter.page.NotDone() { 4669 return DiagnosticContract{} 4670 } 4671 return iter.page.Values()[iter.i] 4672} 4673 4674// Creates a new instance of the DiagnosticCollectionIterator type. 4675func NewDiagnosticCollectionIterator(page DiagnosticCollectionPage) DiagnosticCollectionIterator { 4676 return DiagnosticCollectionIterator{page: page} 4677} 4678 4679// IsEmpty returns true if the ListResult contains no values. 4680func (dc DiagnosticCollection) IsEmpty() bool { 4681 return dc.Value == nil || len(*dc.Value) == 0 4682} 4683 4684// hasNextLink returns true if the NextLink is not empty. 4685func (dc DiagnosticCollection) hasNextLink() bool { 4686 return dc.NextLink != nil && len(*dc.NextLink) != 0 4687} 4688 4689// diagnosticCollectionPreparer prepares a request to retrieve the next set of results. 4690// It returns nil if no more results exist. 4691func (dc DiagnosticCollection) diagnosticCollectionPreparer(ctx context.Context) (*http.Request, error) { 4692 if !dc.hasNextLink() { 4693 return nil, nil 4694 } 4695 return autorest.Prepare((&http.Request{}).WithContext(ctx), 4696 autorest.AsJSON(), 4697 autorest.AsGet(), 4698 autorest.WithBaseURL(to.String(dc.NextLink))) 4699} 4700 4701// DiagnosticCollectionPage contains a page of DiagnosticContract values. 4702type DiagnosticCollectionPage struct { 4703 fn func(context.Context, DiagnosticCollection) (DiagnosticCollection, error) 4704 dc DiagnosticCollection 4705} 4706 4707// NextWithContext advances to the next page of values. If there was an error making 4708// the request the page does not advance and the error is returned. 4709func (page *DiagnosticCollectionPage) NextWithContext(ctx context.Context) (err error) { 4710 if tracing.IsEnabled() { 4711 ctx = tracing.StartSpan(ctx, fqdn+"/DiagnosticCollectionPage.NextWithContext") 4712 defer func() { 4713 sc := -1 4714 if page.Response().Response.Response != nil { 4715 sc = page.Response().Response.Response.StatusCode 4716 } 4717 tracing.EndSpan(ctx, sc, err) 4718 }() 4719 } 4720 for { 4721 next, err := page.fn(ctx, page.dc) 4722 if err != nil { 4723 return err 4724 } 4725 page.dc = next 4726 if !next.hasNextLink() || !next.IsEmpty() { 4727 break 4728 } 4729 } 4730 return nil 4731} 4732 4733// Next advances to the next page of values. If there was an error making 4734// the request the page does not advance and the error is returned. 4735// Deprecated: Use NextWithContext() instead. 4736func (page *DiagnosticCollectionPage) Next() error { 4737 return page.NextWithContext(context.Background()) 4738} 4739 4740// NotDone returns true if the page enumeration should be started or is not yet complete. 4741func (page DiagnosticCollectionPage) NotDone() bool { 4742 return !page.dc.IsEmpty() 4743} 4744 4745// Response returns the raw server response from the last page request. 4746func (page DiagnosticCollectionPage) Response() DiagnosticCollection { 4747 return page.dc 4748} 4749 4750// Values returns the slice of values for the current page or nil if there are no values. 4751func (page DiagnosticCollectionPage) Values() []DiagnosticContract { 4752 if page.dc.IsEmpty() { 4753 return nil 4754 } 4755 return *page.dc.Value 4756} 4757 4758// Creates a new instance of the DiagnosticCollectionPage type. 4759func NewDiagnosticCollectionPage(cur DiagnosticCollection, getNextPage func(context.Context, DiagnosticCollection) (DiagnosticCollection, error)) DiagnosticCollectionPage { 4760 return DiagnosticCollectionPage{ 4761 fn: getNextPage, 4762 dc: cur, 4763 } 4764} 4765 4766// DiagnosticContract diagnostic details. 4767type DiagnosticContract struct { 4768 autorest.Response `json:"-"` 4769 // DiagnosticContractProperties - Diagnostic entity contract properties. 4770 *DiagnosticContractProperties `json:"properties,omitempty"` 4771 // ID - READ-ONLY; Resource ID. 4772 ID *string `json:"id,omitempty"` 4773 // Name - READ-ONLY; Resource name. 4774 Name *string `json:"name,omitempty"` 4775 // Type - READ-ONLY; Resource type for API Management resource. 4776 Type *string `json:"type,omitempty"` 4777} 4778 4779// MarshalJSON is the custom marshaler for DiagnosticContract. 4780func (dc DiagnosticContract) MarshalJSON() ([]byte, error) { 4781 objectMap := make(map[string]interface{}) 4782 if dc.DiagnosticContractProperties != nil { 4783 objectMap["properties"] = dc.DiagnosticContractProperties 4784 } 4785 return json.Marshal(objectMap) 4786} 4787 4788// UnmarshalJSON is the custom unmarshaler for DiagnosticContract struct. 4789func (dc *DiagnosticContract) UnmarshalJSON(body []byte) error { 4790 var m map[string]*json.RawMessage 4791 err := json.Unmarshal(body, &m) 4792 if err != nil { 4793 return err 4794 } 4795 for k, v := range m { 4796 switch k { 4797 case "properties": 4798 if v != nil { 4799 var diagnosticContractProperties DiagnosticContractProperties 4800 err = json.Unmarshal(*v, &diagnosticContractProperties) 4801 if err != nil { 4802 return err 4803 } 4804 dc.DiagnosticContractProperties = &diagnosticContractProperties 4805 } 4806 case "id": 4807 if v != nil { 4808 var ID string 4809 err = json.Unmarshal(*v, &ID) 4810 if err != nil { 4811 return err 4812 } 4813 dc.ID = &ID 4814 } 4815 case "name": 4816 if v != nil { 4817 var name string 4818 err = json.Unmarshal(*v, &name) 4819 if err != nil { 4820 return err 4821 } 4822 dc.Name = &name 4823 } 4824 case "type": 4825 if v != nil { 4826 var typeVar string 4827 err = json.Unmarshal(*v, &typeVar) 4828 if err != nil { 4829 return err 4830 } 4831 dc.Type = &typeVar 4832 } 4833 } 4834 } 4835 4836 return nil 4837} 4838 4839// DiagnosticContractProperties diagnostic Entity Properties 4840type DiagnosticContractProperties struct { 4841 // AlwaysLog - Specifies for what type of messages sampling settings should not apply. Possible values include: 'AllErrors' 4842 AlwaysLog AlwaysLog `json:"alwaysLog,omitempty"` 4843 // LoggerID - Resource Id of a target logger. 4844 LoggerID *string `json:"loggerId,omitempty"` 4845 // Sampling - Sampling settings for Diagnostic. 4846 Sampling *SamplingSettings `json:"sampling,omitempty"` 4847 // Frontend - Diagnostic settings for incoming/outgoing HTTP messages to the Gateway. 4848 Frontend *PipelineDiagnosticSettings `json:"frontend,omitempty"` 4849 // Backend - Diagnostic settings for incoming/outgoing HTTP messages to the Backend 4850 Backend *PipelineDiagnosticSettings `json:"backend,omitempty"` 4851 // LogClientIP - Log the ClientIP. Default is false. 4852 LogClientIP *bool `json:"logClientIp,omitempty"` 4853 // HTTPCorrelationProtocol - Sets correlation protocol to use for Application Insights diagnostics. Possible values include: 'HTTPCorrelationProtocolNone', 'HTTPCorrelationProtocolLegacy', 'HTTPCorrelationProtocolW3C' 4854 HTTPCorrelationProtocol HTTPCorrelationProtocol `json:"httpCorrelationProtocol,omitempty"` 4855 // Verbosity - The verbosity level applied to traces emitted by trace policies. Possible values include: 'Verbose', 'Information', 'Error' 4856 Verbosity Verbosity `json:"verbosity,omitempty"` 4857 // OperationNameFormat - The format of the Operation Name for Application Insights telemetries. Default is Name. Possible values include: 'Name', 'URL' 4858 OperationNameFormat OperationNameFormat `json:"operationNameFormat,omitempty"` 4859} 4860 4861// EmailTemplateCollection paged email template list representation. 4862type EmailTemplateCollection struct { 4863 autorest.Response `json:"-"` 4864 // Value - Page values. 4865 Value *[]EmailTemplateContract `json:"value,omitempty"` 4866 // Count - Total record count number across all pages. 4867 Count *int64 `json:"count,omitempty"` 4868 // NextLink - Next page link if any. 4869 NextLink *string `json:"nextLink,omitempty"` 4870} 4871 4872// EmailTemplateCollectionIterator provides access to a complete listing of EmailTemplateContract values. 4873type EmailTemplateCollectionIterator struct { 4874 i int 4875 page EmailTemplateCollectionPage 4876} 4877 4878// NextWithContext advances to the next value. If there was an error making 4879// the request the iterator does not advance and the error is returned. 4880func (iter *EmailTemplateCollectionIterator) NextWithContext(ctx context.Context) (err error) { 4881 if tracing.IsEnabled() { 4882 ctx = tracing.StartSpan(ctx, fqdn+"/EmailTemplateCollectionIterator.NextWithContext") 4883 defer func() { 4884 sc := -1 4885 if iter.Response().Response.Response != nil { 4886 sc = iter.Response().Response.Response.StatusCode 4887 } 4888 tracing.EndSpan(ctx, sc, err) 4889 }() 4890 } 4891 iter.i++ 4892 if iter.i < len(iter.page.Values()) { 4893 return nil 4894 } 4895 err = iter.page.NextWithContext(ctx) 4896 if err != nil { 4897 iter.i-- 4898 return err 4899 } 4900 iter.i = 0 4901 return nil 4902} 4903 4904// Next advances to the next value. If there was an error making 4905// the request the iterator does not advance and the error is returned. 4906// Deprecated: Use NextWithContext() instead. 4907func (iter *EmailTemplateCollectionIterator) Next() error { 4908 return iter.NextWithContext(context.Background()) 4909} 4910 4911// NotDone returns true if the enumeration should be started or is not yet complete. 4912func (iter EmailTemplateCollectionIterator) NotDone() bool { 4913 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 4914} 4915 4916// Response returns the raw server response from the last page request. 4917func (iter EmailTemplateCollectionIterator) Response() EmailTemplateCollection { 4918 return iter.page.Response() 4919} 4920 4921// Value returns the current value or a zero-initialized value if the 4922// iterator has advanced beyond the end of the collection. 4923func (iter EmailTemplateCollectionIterator) Value() EmailTemplateContract { 4924 if !iter.page.NotDone() { 4925 return EmailTemplateContract{} 4926 } 4927 return iter.page.Values()[iter.i] 4928} 4929 4930// Creates a new instance of the EmailTemplateCollectionIterator type. 4931func NewEmailTemplateCollectionIterator(page EmailTemplateCollectionPage) EmailTemplateCollectionIterator { 4932 return EmailTemplateCollectionIterator{page: page} 4933} 4934 4935// IsEmpty returns true if the ListResult contains no values. 4936func (etc EmailTemplateCollection) IsEmpty() bool { 4937 return etc.Value == nil || len(*etc.Value) == 0 4938} 4939 4940// hasNextLink returns true if the NextLink is not empty. 4941func (etc EmailTemplateCollection) hasNextLink() bool { 4942 return etc.NextLink != nil && len(*etc.NextLink) != 0 4943} 4944 4945// emailTemplateCollectionPreparer prepares a request to retrieve the next set of results. 4946// It returns nil if no more results exist. 4947func (etc EmailTemplateCollection) emailTemplateCollectionPreparer(ctx context.Context) (*http.Request, error) { 4948 if !etc.hasNextLink() { 4949 return nil, nil 4950 } 4951 return autorest.Prepare((&http.Request{}).WithContext(ctx), 4952 autorest.AsJSON(), 4953 autorest.AsGet(), 4954 autorest.WithBaseURL(to.String(etc.NextLink))) 4955} 4956 4957// EmailTemplateCollectionPage contains a page of EmailTemplateContract values. 4958type EmailTemplateCollectionPage struct { 4959 fn func(context.Context, EmailTemplateCollection) (EmailTemplateCollection, error) 4960 etc EmailTemplateCollection 4961} 4962 4963// NextWithContext advances to the next page of values. If there was an error making 4964// the request the page does not advance and the error is returned. 4965func (page *EmailTemplateCollectionPage) NextWithContext(ctx context.Context) (err error) { 4966 if tracing.IsEnabled() { 4967 ctx = tracing.StartSpan(ctx, fqdn+"/EmailTemplateCollectionPage.NextWithContext") 4968 defer func() { 4969 sc := -1 4970 if page.Response().Response.Response != nil { 4971 sc = page.Response().Response.Response.StatusCode 4972 } 4973 tracing.EndSpan(ctx, sc, err) 4974 }() 4975 } 4976 for { 4977 next, err := page.fn(ctx, page.etc) 4978 if err != nil { 4979 return err 4980 } 4981 page.etc = next 4982 if !next.hasNextLink() || !next.IsEmpty() { 4983 break 4984 } 4985 } 4986 return nil 4987} 4988 4989// Next advances to the next page of values. If there was an error making 4990// the request the page does not advance and the error is returned. 4991// Deprecated: Use NextWithContext() instead. 4992func (page *EmailTemplateCollectionPage) Next() error { 4993 return page.NextWithContext(context.Background()) 4994} 4995 4996// NotDone returns true if the page enumeration should be started or is not yet complete. 4997func (page EmailTemplateCollectionPage) NotDone() bool { 4998 return !page.etc.IsEmpty() 4999} 5000 5001// Response returns the raw server response from the last page request. 5002func (page EmailTemplateCollectionPage) Response() EmailTemplateCollection { 5003 return page.etc 5004} 5005 5006// Values returns the slice of values for the current page or nil if there are no values. 5007func (page EmailTemplateCollectionPage) Values() []EmailTemplateContract { 5008 if page.etc.IsEmpty() { 5009 return nil 5010 } 5011 return *page.etc.Value 5012} 5013 5014// Creates a new instance of the EmailTemplateCollectionPage type. 5015func NewEmailTemplateCollectionPage(cur EmailTemplateCollection, getNextPage func(context.Context, EmailTemplateCollection) (EmailTemplateCollection, error)) EmailTemplateCollectionPage { 5016 return EmailTemplateCollectionPage{ 5017 fn: getNextPage, 5018 etc: cur, 5019 } 5020} 5021 5022// EmailTemplateContract email Template details. 5023type EmailTemplateContract struct { 5024 autorest.Response `json:"-"` 5025 // EmailTemplateContractProperties - Email Template entity contract properties. 5026 *EmailTemplateContractProperties `json:"properties,omitempty"` 5027 // ID - READ-ONLY; Resource ID. 5028 ID *string `json:"id,omitempty"` 5029 // Name - READ-ONLY; Resource name. 5030 Name *string `json:"name,omitempty"` 5031 // Type - READ-ONLY; Resource type for API Management resource. 5032 Type *string `json:"type,omitempty"` 5033} 5034 5035// MarshalJSON is the custom marshaler for EmailTemplateContract. 5036func (etc EmailTemplateContract) MarshalJSON() ([]byte, error) { 5037 objectMap := make(map[string]interface{}) 5038 if etc.EmailTemplateContractProperties != nil { 5039 objectMap["properties"] = etc.EmailTemplateContractProperties 5040 } 5041 return json.Marshal(objectMap) 5042} 5043 5044// UnmarshalJSON is the custom unmarshaler for EmailTemplateContract struct. 5045func (etc *EmailTemplateContract) UnmarshalJSON(body []byte) error { 5046 var m map[string]*json.RawMessage 5047 err := json.Unmarshal(body, &m) 5048 if err != nil { 5049 return err 5050 } 5051 for k, v := range m { 5052 switch k { 5053 case "properties": 5054 if v != nil { 5055 var emailTemplateContractProperties EmailTemplateContractProperties 5056 err = json.Unmarshal(*v, &emailTemplateContractProperties) 5057 if err != nil { 5058 return err 5059 } 5060 etc.EmailTemplateContractProperties = &emailTemplateContractProperties 5061 } 5062 case "id": 5063 if v != nil { 5064 var ID string 5065 err = json.Unmarshal(*v, &ID) 5066 if err != nil { 5067 return err 5068 } 5069 etc.ID = &ID 5070 } 5071 case "name": 5072 if v != nil { 5073 var name string 5074 err = json.Unmarshal(*v, &name) 5075 if err != nil { 5076 return err 5077 } 5078 etc.Name = &name 5079 } 5080 case "type": 5081 if v != nil { 5082 var typeVar string 5083 err = json.Unmarshal(*v, &typeVar) 5084 if err != nil { 5085 return err 5086 } 5087 etc.Type = &typeVar 5088 } 5089 } 5090 } 5091 5092 return nil 5093} 5094 5095// EmailTemplateContractProperties email Template Contract properties. 5096type EmailTemplateContractProperties struct { 5097 // Subject - Subject of the Template. 5098 Subject *string `json:"subject,omitempty"` 5099 // Body - Email Template Body. This should be a valid XDocument 5100 Body *string `json:"body,omitempty"` 5101 // Title - Title of the Template. 5102 Title *string `json:"title,omitempty"` 5103 // Description - Description of the Email Template. 5104 Description *string `json:"description,omitempty"` 5105 // IsDefault - READ-ONLY; Whether the template is the default template provided by Api Management or has been edited. 5106 IsDefault *bool `json:"isDefault,omitempty"` 5107 // Parameters - Email Template Parameter values. 5108 Parameters *[]EmailTemplateParametersContractProperties `json:"parameters,omitempty"` 5109} 5110 5111// MarshalJSON is the custom marshaler for EmailTemplateContractProperties. 5112func (etcp EmailTemplateContractProperties) MarshalJSON() ([]byte, error) { 5113 objectMap := make(map[string]interface{}) 5114 if etcp.Subject != nil { 5115 objectMap["subject"] = etcp.Subject 5116 } 5117 if etcp.Body != nil { 5118 objectMap["body"] = etcp.Body 5119 } 5120 if etcp.Title != nil { 5121 objectMap["title"] = etcp.Title 5122 } 5123 if etcp.Description != nil { 5124 objectMap["description"] = etcp.Description 5125 } 5126 if etcp.Parameters != nil { 5127 objectMap["parameters"] = etcp.Parameters 5128 } 5129 return json.Marshal(objectMap) 5130} 5131 5132// EmailTemplateParametersContractProperties email Template Parameter contract. 5133type EmailTemplateParametersContractProperties struct { 5134 // Name - Template parameter name. 5135 Name *string `json:"name,omitempty"` 5136 // Title - Template parameter title. 5137 Title *string `json:"title,omitempty"` 5138 // Description - Template parameter description. 5139 Description *string `json:"description,omitempty"` 5140} 5141 5142// EmailTemplateUpdateParameterProperties email Template Update Contract properties. 5143type EmailTemplateUpdateParameterProperties struct { 5144 // Subject - Subject of the Template. 5145 Subject *string `json:"subject,omitempty"` 5146 // Title - Title of the Template. 5147 Title *string `json:"title,omitempty"` 5148 // Description - Description of the Email Template. 5149 Description *string `json:"description,omitempty"` 5150 // Body - Email Template Body. This should be a valid XDocument 5151 Body *string `json:"body,omitempty"` 5152 // Parameters - Email Template Parameter values. 5153 Parameters *[]EmailTemplateParametersContractProperties `json:"parameters,omitempty"` 5154} 5155 5156// EmailTemplateUpdateParameters email Template update Parameters. 5157type EmailTemplateUpdateParameters struct { 5158 // EmailTemplateUpdateParameterProperties - Email Template Update contract properties. 5159 *EmailTemplateUpdateParameterProperties `json:"properties,omitempty"` 5160} 5161 5162// MarshalJSON is the custom marshaler for EmailTemplateUpdateParameters. 5163func (etup EmailTemplateUpdateParameters) MarshalJSON() ([]byte, error) { 5164 objectMap := make(map[string]interface{}) 5165 if etup.EmailTemplateUpdateParameterProperties != nil { 5166 objectMap["properties"] = etup.EmailTemplateUpdateParameterProperties 5167 } 5168 return json.Marshal(objectMap) 5169} 5170 5171// UnmarshalJSON is the custom unmarshaler for EmailTemplateUpdateParameters struct. 5172func (etup *EmailTemplateUpdateParameters) UnmarshalJSON(body []byte) error { 5173 var m map[string]*json.RawMessage 5174 err := json.Unmarshal(body, &m) 5175 if err != nil { 5176 return err 5177 } 5178 for k, v := range m { 5179 switch k { 5180 case "properties": 5181 if v != nil { 5182 var emailTemplateUpdateParameterProperties EmailTemplateUpdateParameterProperties 5183 err = json.Unmarshal(*v, &emailTemplateUpdateParameterProperties) 5184 if err != nil { 5185 return err 5186 } 5187 etup.EmailTemplateUpdateParameterProperties = &emailTemplateUpdateParameterProperties 5188 } 5189 } 5190 } 5191 5192 return nil 5193} 5194 5195// ErrorFieldContract error Field contract. 5196type ErrorFieldContract struct { 5197 // Code - Property level error code. 5198 Code *string `json:"code,omitempty"` 5199 // Message - Human-readable representation of property-level error. 5200 Message *string `json:"message,omitempty"` 5201 // Target - Property name. 5202 Target *string `json:"target,omitempty"` 5203} 5204 5205// ErrorResponse error Response. 5206type ErrorResponse struct { 5207 // ErrorResponseBody - Properties of the Error Response. 5208 *ErrorResponseBody `json:"error,omitempty"` 5209} 5210 5211// MarshalJSON is the custom marshaler for ErrorResponse. 5212func (er ErrorResponse) MarshalJSON() ([]byte, error) { 5213 objectMap := make(map[string]interface{}) 5214 if er.ErrorResponseBody != nil { 5215 objectMap["error"] = er.ErrorResponseBody 5216 } 5217 return json.Marshal(objectMap) 5218} 5219 5220// UnmarshalJSON is the custom unmarshaler for ErrorResponse struct. 5221func (er *ErrorResponse) UnmarshalJSON(body []byte) error { 5222 var m map[string]*json.RawMessage 5223 err := json.Unmarshal(body, &m) 5224 if err != nil { 5225 return err 5226 } 5227 for k, v := range m { 5228 switch k { 5229 case "error": 5230 if v != nil { 5231 var errorResponseBody ErrorResponseBody 5232 err = json.Unmarshal(*v, &errorResponseBody) 5233 if err != nil { 5234 return err 5235 } 5236 er.ErrorResponseBody = &errorResponseBody 5237 } 5238 } 5239 } 5240 5241 return nil 5242} 5243 5244// ErrorResponseBody error Body contract. 5245type ErrorResponseBody struct { 5246 // Code - Service-defined error code. This code serves as a sub-status for the HTTP error code specified in the response. 5247 Code *string `json:"code,omitempty"` 5248 // Message - Human-readable representation of the error. 5249 Message *string `json:"message,omitempty"` 5250 // Details - The list of invalid fields send in request, in case of validation error. 5251 Details *[]ErrorFieldContract `json:"details,omitempty"` 5252} 5253 5254// GatewayCertificateAuthorityCollection paged Gateway certificate authority list representation. 5255type GatewayCertificateAuthorityCollection struct { 5256 autorest.Response `json:"-"` 5257 // Value - READ-ONLY; Page values. 5258 Value *[]GatewayCertificateAuthorityContract `json:"value,omitempty"` 5259 // NextLink - READ-ONLY; Next page link if any. 5260 NextLink *string `json:"nextLink,omitempty"` 5261} 5262 5263// MarshalJSON is the custom marshaler for GatewayCertificateAuthorityCollection. 5264func (gcac GatewayCertificateAuthorityCollection) MarshalJSON() ([]byte, error) { 5265 objectMap := make(map[string]interface{}) 5266 return json.Marshal(objectMap) 5267} 5268 5269// GatewayCertificateAuthorityCollectionIterator provides access to a complete listing of 5270// GatewayCertificateAuthorityContract values. 5271type GatewayCertificateAuthorityCollectionIterator struct { 5272 i int 5273 page GatewayCertificateAuthorityCollectionPage 5274} 5275 5276// NextWithContext advances to the next value. If there was an error making 5277// the request the iterator does not advance and the error is returned. 5278func (iter *GatewayCertificateAuthorityCollectionIterator) NextWithContext(ctx context.Context) (err error) { 5279 if tracing.IsEnabled() { 5280 ctx = tracing.StartSpan(ctx, fqdn+"/GatewayCertificateAuthorityCollectionIterator.NextWithContext") 5281 defer func() { 5282 sc := -1 5283 if iter.Response().Response.Response != nil { 5284 sc = iter.Response().Response.Response.StatusCode 5285 } 5286 tracing.EndSpan(ctx, sc, err) 5287 }() 5288 } 5289 iter.i++ 5290 if iter.i < len(iter.page.Values()) { 5291 return nil 5292 } 5293 err = iter.page.NextWithContext(ctx) 5294 if err != nil { 5295 iter.i-- 5296 return err 5297 } 5298 iter.i = 0 5299 return nil 5300} 5301 5302// Next advances to the next value. If there was an error making 5303// the request the iterator does not advance and the error is returned. 5304// Deprecated: Use NextWithContext() instead. 5305func (iter *GatewayCertificateAuthorityCollectionIterator) Next() error { 5306 return iter.NextWithContext(context.Background()) 5307} 5308 5309// NotDone returns true if the enumeration should be started or is not yet complete. 5310func (iter GatewayCertificateAuthorityCollectionIterator) NotDone() bool { 5311 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 5312} 5313 5314// Response returns the raw server response from the last page request. 5315func (iter GatewayCertificateAuthorityCollectionIterator) Response() GatewayCertificateAuthorityCollection { 5316 return iter.page.Response() 5317} 5318 5319// Value returns the current value or a zero-initialized value if the 5320// iterator has advanced beyond the end of the collection. 5321func (iter GatewayCertificateAuthorityCollectionIterator) Value() GatewayCertificateAuthorityContract { 5322 if !iter.page.NotDone() { 5323 return GatewayCertificateAuthorityContract{} 5324 } 5325 return iter.page.Values()[iter.i] 5326} 5327 5328// Creates a new instance of the GatewayCertificateAuthorityCollectionIterator type. 5329func NewGatewayCertificateAuthorityCollectionIterator(page GatewayCertificateAuthorityCollectionPage) GatewayCertificateAuthorityCollectionIterator { 5330 return GatewayCertificateAuthorityCollectionIterator{page: page} 5331} 5332 5333// IsEmpty returns true if the ListResult contains no values. 5334func (gcac GatewayCertificateAuthorityCollection) IsEmpty() bool { 5335 return gcac.Value == nil || len(*gcac.Value) == 0 5336} 5337 5338// hasNextLink returns true if the NextLink is not empty. 5339func (gcac GatewayCertificateAuthorityCollection) hasNextLink() bool { 5340 return gcac.NextLink != nil && len(*gcac.NextLink) != 0 5341} 5342 5343// gatewayCertificateAuthorityCollectionPreparer prepares a request to retrieve the next set of results. 5344// It returns nil if no more results exist. 5345func (gcac GatewayCertificateAuthorityCollection) gatewayCertificateAuthorityCollectionPreparer(ctx context.Context) (*http.Request, error) { 5346 if !gcac.hasNextLink() { 5347 return nil, nil 5348 } 5349 return autorest.Prepare((&http.Request{}).WithContext(ctx), 5350 autorest.AsJSON(), 5351 autorest.AsGet(), 5352 autorest.WithBaseURL(to.String(gcac.NextLink))) 5353} 5354 5355// GatewayCertificateAuthorityCollectionPage contains a page of GatewayCertificateAuthorityContract values. 5356type GatewayCertificateAuthorityCollectionPage struct { 5357 fn func(context.Context, GatewayCertificateAuthorityCollection) (GatewayCertificateAuthorityCollection, error) 5358 gcac GatewayCertificateAuthorityCollection 5359} 5360 5361// NextWithContext advances to the next page of values. If there was an error making 5362// the request the page does not advance and the error is returned. 5363func (page *GatewayCertificateAuthorityCollectionPage) NextWithContext(ctx context.Context) (err error) { 5364 if tracing.IsEnabled() { 5365 ctx = tracing.StartSpan(ctx, fqdn+"/GatewayCertificateAuthorityCollectionPage.NextWithContext") 5366 defer func() { 5367 sc := -1 5368 if page.Response().Response.Response != nil { 5369 sc = page.Response().Response.Response.StatusCode 5370 } 5371 tracing.EndSpan(ctx, sc, err) 5372 }() 5373 } 5374 for { 5375 next, err := page.fn(ctx, page.gcac) 5376 if err != nil { 5377 return err 5378 } 5379 page.gcac = next 5380 if !next.hasNextLink() || !next.IsEmpty() { 5381 break 5382 } 5383 } 5384 return nil 5385} 5386 5387// Next advances to the next page of values. If there was an error making 5388// the request the page does not advance and the error is returned. 5389// Deprecated: Use NextWithContext() instead. 5390func (page *GatewayCertificateAuthorityCollectionPage) Next() error { 5391 return page.NextWithContext(context.Background()) 5392} 5393 5394// NotDone returns true if the page enumeration should be started or is not yet complete. 5395func (page GatewayCertificateAuthorityCollectionPage) NotDone() bool { 5396 return !page.gcac.IsEmpty() 5397} 5398 5399// Response returns the raw server response from the last page request. 5400func (page GatewayCertificateAuthorityCollectionPage) Response() GatewayCertificateAuthorityCollection { 5401 return page.gcac 5402} 5403 5404// Values returns the slice of values for the current page or nil if there are no values. 5405func (page GatewayCertificateAuthorityCollectionPage) Values() []GatewayCertificateAuthorityContract { 5406 if page.gcac.IsEmpty() { 5407 return nil 5408 } 5409 return *page.gcac.Value 5410} 5411 5412// Creates a new instance of the GatewayCertificateAuthorityCollectionPage type. 5413func NewGatewayCertificateAuthorityCollectionPage(cur GatewayCertificateAuthorityCollection, getNextPage func(context.Context, GatewayCertificateAuthorityCollection) (GatewayCertificateAuthorityCollection, error)) GatewayCertificateAuthorityCollectionPage { 5414 return GatewayCertificateAuthorityCollectionPage{ 5415 fn: getNextPage, 5416 gcac: cur, 5417 } 5418} 5419 5420// GatewayCertificateAuthorityContract gateway certificate authority details. 5421type GatewayCertificateAuthorityContract struct { 5422 autorest.Response `json:"-"` 5423 // GatewayCertificateAuthorityContractProperties - Gateway certificate authority details. 5424 *GatewayCertificateAuthorityContractProperties `json:"properties,omitempty"` 5425 // ID - READ-ONLY; Resource ID. 5426 ID *string `json:"id,omitempty"` 5427 // Name - READ-ONLY; Resource name. 5428 Name *string `json:"name,omitempty"` 5429 // Type - READ-ONLY; Resource type for API Management resource. 5430 Type *string `json:"type,omitempty"` 5431} 5432 5433// MarshalJSON is the custom marshaler for GatewayCertificateAuthorityContract. 5434func (gcac GatewayCertificateAuthorityContract) MarshalJSON() ([]byte, error) { 5435 objectMap := make(map[string]interface{}) 5436 if gcac.GatewayCertificateAuthorityContractProperties != nil { 5437 objectMap["properties"] = gcac.GatewayCertificateAuthorityContractProperties 5438 } 5439 return json.Marshal(objectMap) 5440} 5441 5442// UnmarshalJSON is the custom unmarshaler for GatewayCertificateAuthorityContract struct. 5443func (gcac *GatewayCertificateAuthorityContract) UnmarshalJSON(body []byte) error { 5444 var m map[string]*json.RawMessage 5445 err := json.Unmarshal(body, &m) 5446 if err != nil { 5447 return err 5448 } 5449 for k, v := range m { 5450 switch k { 5451 case "properties": 5452 if v != nil { 5453 var gatewayCertificateAuthorityContractProperties GatewayCertificateAuthorityContractProperties 5454 err = json.Unmarshal(*v, &gatewayCertificateAuthorityContractProperties) 5455 if err != nil { 5456 return err 5457 } 5458 gcac.GatewayCertificateAuthorityContractProperties = &gatewayCertificateAuthorityContractProperties 5459 } 5460 case "id": 5461 if v != nil { 5462 var ID string 5463 err = json.Unmarshal(*v, &ID) 5464 if err != nil { 5465 return err 5466 } 5467 gcac.ID = &ID 5468 } 5469 case "name": 5470 if v != nil { 5471 var name string 5472 err = json.Unmarshal(*v, &name) 5473 if err != nil { 5474 return err 5475 } 5476 gcac.Name = &name 5477 } 5478 case "type": 5479 if v != nil { 5480 var typeVar string 5481 err = json.Unmarshal(*v, &typeVar) 5482 if err != nil { 5483 return err 5484 } 5485 gcac.Type = &typeVar 5486 } 5487 } 5488 } 5489 5490 return nil 5491} 5492 5493// GatewayCertificateAuthorityContractProperties gateway certificate authority details. 5494type GatewayCertificateAuthorityContractProperties struct { 5495 // IsTrusted - Determines whether certificate authority is trusted. 5496 IsTrusted *bool `json:"isTrusted,omitempty"` 5497} 5498 5499// GatewayCollection paged Gateway list representation. 5500type GatewayCollection struct { 5501 autorest.Response `json:"-"` 5502 // Value - READ-ONLY; Page values. 5503 Value *[]GatewayContract `json:"value,omitempty"` 5504 // Count - Total record count number across all pages. 5505 Count *int64 `json:"count,omitempty"` 5506 // NextLink - READ-ONLY; Next page link if any. 5507 NextLink *string `json:"nextLink,omitempty"` 5508} 5509 5510// MarshalJSON is the custom marshaler for GatewayCollection. 5511func (gc GatewayCollection) MarshalJSON() ([]byte, error) { 5512 objectMap := make(map[string]interface{}) 5513 if gc.Count != nil { 5514 objectMap["count"] = gc.Count 5515 } 5516 return json.Marshal(objectMap) 5517} 5518 5519// GatewayCollectionIterator provides access to a complete listing of GatewayContract values. 5520type GatewayCollectionIterator struct { 5521 i int 5522 page GatewayCollectionPage 5523} 5524 5525// NextWithContext advances to the next value. If there was an error making 5526// the request the iterator does not advance and the error is returned. 5527func (iter *GatewayCollectionIterator) NextWithContext(ctx context.Context) (err error) { 5528 if tracing.IsEnabled() { 5529 ctx = tracing.StartSpan(ctx, fqdn+"/GatewayCollectionIterator.NextWithContext") 5530 defer func() { 5531 sc := -1 5532 if iter.Response().Response.Response != nil { 5533 sc = iter.Response().Response.Response.StatusCode 5534 } 5535 tracing.EndSpan(ctx, sc, err) 5536 }() 5537 } 5538 iter.i++ 5539 if iter.i < len(iter.page.Values()) { 5540 return nil 5541 } 5542 err = iter.page.NextWithContext(ctx) 5543 if err != nil { 5544 iter.i-- 5545 return err 5546 } 5547 iter.i = 0 5548 return nil 5549} 5550 5551// Next advances to the next value. If there was an error making 5552// the request the iterator does not advance and the error is returned. 5553// Deprecated: Use NextWithContext() instead. 5554func (iter *GatewayCollectionIterator) Next() error { 5555 return iter.NextWithContext(context.Background()) 5556} 5557 5558// NotDone returns true if the enumeration should be started or is not yet complete. 5559func (iter GatewayCollectionIterator) NotDone() bool { 5560 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 5561} 5562 5563// Response returns the raw server response from the last page request. 5564func (iter GatewayCollectionIterator) Response() GatewayCollection { 5565 return iter.page.Response() 5566} 5567 5568// Value returns the current value or a zero-initialized value if the 5569// iterator has advanced beyond the end of the collection. 5570func (iter GatewayCollectionIterator) Value() GatewayContract { 5571 if !iter.page.NotDone() { 5572 return GatewayContract{} 5573 } 5574 return iter.page.Values()[iter.i] 5575} 5576 5577// Creates a new instance of the GatewayCollectionIterator type. 5578func NewGatewayCollectionIterator(page GatewayCollectionPage) GatewayCollectionIterator { 5579 return GatewayCollectionIterator{page: page} 5580} 5581 5582// IsEmpty returns true if the ListResult contains no values. 5583func (gc GatewayCollection) IsEmpty() bool { 5584 return gc.Value == nil || len(*gc.Value) == 0 5585} 5586 5587// hasNextLink returns true if the NextLink is not empty. 5588func (gc GatewayCollection) hasNextLink() bool { 5589 return gc.NextLink != nil && len(*gc.NextLink) != 0 5590} 5591 5592// gatewayCollectionPreparer prepares a request to retrieve the next set of results. 5593// It returns nil if no more results exist. 5594func (gc GatewayCollection) gatewayCollectionPreparer(ctx context.Context) (*http.Request, error) { 5595 if !gc.hasNextLink() { 5596 return nil, nil 5597 } 5598 return autorest.Prepare((&http.Request{}).WithContext(ctx), 5599 autorest.AsJSON(), 5600 autorest.AsGet(), 5601 autorest.WithBaseURL(to.String(gc.NextLink))) 5602} 5603 5604// GatewayCollectionPage contains a page of GatewayContract values. 5605type GatewayCollectionPage struct { 5606 fn func(context.Context, GatewayCollection) (GatewayCollection, error) 5607 gc GatewayCollection 5608} 5609 5610// NextWithContext advances to the next page of values. If there was an error making 5611// the request the page does not advance and the error is returned. 5612func (page *GatewayCollectionPage) NextWithContext(ctx context.Context) (err error) { 5613 if tracing.IsEnabled() { 5614 ctx = tracing.StartSpan(ctx, fqdn+"/GatewayCollectionPage.NextWithContext") 5615 defer func() { 5616 sc := -1 5617 if page.Response().Response.Response != nil { 5618 sc = page.Response().Response.Response.StatusCode 5619 } 5620 tracing.EndSpan(ctx, sc, err) 5621 }() 5622 } 5623 for { 5624 next, err := page.fn(ctx, page.gc) 5625 if err != nil { 5626 return err 5627 } 5628 page.gc = next 5629 if !next.hasNextLink() || !next.IsEmpty() { 5630 break 5631 } 5632 } 5633 return nil 5634} 5635 5636// Next advances to the next page of values. If there was an error making 5637// the request the page does not advance and the error is returned. 5638// Deprecated: Use NextWithContext() instead. 5639func (page *GatewayCollectionPage) Next() error { 5640 return page.NextWithContext(context.Background()) 5641} 5642 5643// NotDone returns true if the page enumeration should be started or is not yet complete. 5644func (page GatewayCollectionPage) NotDone() bool { 5645 return !page.gc.IsEmpty() 5646} 5647 5648// Response returns the raw server response from the last page request. 5649func (page GatewayCollectionPage) Response() GatewayCollection { 5650 return page.gc 5651} 5652 5653// Values returns the slice of values for the current page or nil if there are no values. 5654func (page GatewayCollectionPage) Values() []GatewayContract { 5655 if page.gc.IsEmpty() { 5656 return nil 5657 } 5658 return *page.gc.Value 5659} 5660 5661// Creates a new instance of the GatewayCollectionPage type. 5662func NewGatewayCollectionPage(cur GatewayCollection, getNextPage func(context.Context, GatewayCollection) (GatewayCollection, error)) GatewayCollectionPage { 5663 return GatewayCollectionPage{ 5664 fn: getNextPage, 5665 gc: cur, 5666 } 5667} 5668 5669// GatewayContract gateway details. 5670type GatewayContract struct { 5671 autorest.Response `json:"-"` 5672 // GatewayContractProperties - Gateway details. 5673 *GatewayContractProperties `json:"properties,omitempty"` 5674 // ID - READ-ONLY; Resource ID. 5675 ID *string `json:"id,omitempty"` 5676 // Name - READ-ONLY; Resource name. 5677 Name *string `json:"name,omitempty"` 5678 // Type - READ-ONLY; Resource type for API Management resource. 5679 Type *string `json:"type,omitempty"` 5680} 5681 5682// MarshalJSON is the custom marshaler for GatewayContract. 5683func (gc GatewayContract) MarshalJSON() ([]byte, error) { 5684 objectMap := make(map[string]interface{}) 5685 if gc.GatewayContractProperties != nil { 5686 objectMap["properties"] = gc.GatewayContractProperties 5687 } 5688 return json.Marshal(objectMap) 5689} 5690 5691// UnmarshalJSON is the custom unmarshaler for GatewayContract struct. 5692func (gc *GatewayContract) UnmarshalJSON(body []byte) error { 5693 var m map[string]*json.RawMessage 5694 err := json.Unmarshal(body, &m) 5695 if err != nil { 5696 return err 5697 } 5698 for k, v := range m { 5699 switch k { 5700 case "properties": 5701 if v != nil { 5702 var gatewayContractProperties GatewayContractProperties 5703 err = json.Unmarshal(*v, &gatewayContractProperties) 5704 if err != nil { 5705 return err 5706 } 5707 gc.GatewayContractProperties = &gatewayContractProperties 5708 } 5709 case "id": 5710 if v != nil { 5711 var ID string 5712 err = json.Unmarshal(*v, &ID) 5713 if err != nil { 5714 return err 5715 } 5716 gc.ID = &ID 5717 } 5718 case "name": 5719 if v != nil { 5720 var name string 5721 err = json.Unmarshal(*v, &name) 5722 if err != nil { 5723 return err 5724 } 5725 gc.Name = &name 5726 } 5727 case "type": 5728 if v != nil { 5729 var typeVar string 5730 err = json.Unmarshal(*v, &typeVar) 5731 if err != nil { 5732 return err 5733 } 5734 gc.Type = &typeVar 5735 } 5736 } 5737 } 5738 5739 return nil 5740} 5741 5742// GatewayContractProperties properties of the Gateway contract. 5743type GatewayContractProperties struct { 5744 // LocationData - Gateway location. 5745 LocationData *ResourceLocationDataContract `json:"locationData,omitempty"` 5746 // Description - Gateway description 5747 Description *string `json:"description,omitempty"` 5748} 5749 5750// GatewayHostnameConfigurationCollection paged Gateway hostname configuration list representation. 5751type GatewayHostnameConfigurationCollection struct { 5752 autorest.Response `json:"-"` 5753 // Value - READ-ONLY; Page values. 5754 Value *[]GatewayHostnameConfigurationContract `json:"value,omitempty"` 5755 // NextLink - READ-ONLY; Next page link if any. 5756 NextLink *string `json:"nextLink,omitempty"` 5757} 5758 5759// MarshalJSON is the custom marshaler for GatewayHostnameConfigurationCollection. 5760func (ghcc GatewayHostnameConfigurationCollection) MarshalJSON() ([]byte, error) { 5761 objectMap := make(map[string]interface{}) 5762 return json.Marshal(objectMap) 5763} 5764 5765// GatewayHostnameConfigurationCollectionIterator provides access to a complete listing of 5766// GatewayHostnameConfigurationContract values. 5767type GatewayHostnameConfigurationCollectionIterator struct { 5768 i int 5769 page GatewayHostnameConfigurationCollectionPage 5770} 5771 5772// NextWithContext advances to the next value. If there was an error making 5773// the request the iterator does not advance and the error is returned. 5774func (iter *GatewayHostnameConfigurationCollectionIterator) NextWithContext(ctx context.Context) (err error) { 5775 if tracing.IsEnabled() { 5776 ctx = tracing.StartSpan(ctx, fqdn+"/GatewayHostnameConfigurationCollectionIterator.NextWithContext") 5777 defer func() { 5778 sc := -1 5779 if iter.Response().Response.Response != nil { 5780 sc = iter.Response().Response.Response.StatusCode 5781 } 5782 tracing.EndSpan(ctx, sc, err) 5783 }() 5784 } 5785 iter.i++ 5786 if iter.i < len(iter.page.Values()) { 5787 return nil 5788 } 5789 err = iter.page.NextWithContext(ctx) 5790 if err != nil { 5791 iter.i-- 5792 return err 5793 } 5794 iter.i = 0 5795 return nil 5796} 5797 5798// Next advances to the next value. If there was an error making 5799// the request the iterator does not advance and the error is returned. 5800// Deprecated: Use NextWithContext() instead. 5801func (iter *GatewayHostnameConfigurationCollectionIterator) Next() error { 5802 return iter.NextWithContext(context.Background()) 5803} 5804 5805// NotDone returns true if the enumeration should be started or is not yet complete. 5806func (iter GatewayHostnameConfigurationCollectionIterator) NotDone() bool { 5807 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 5808} 5809 5810// Response returns the raw server response from the last page request. 5811func (iter GatewayHostnameConfigurationCollectionIterator) Response() GatewayHostnameConfigurationCollection { 5812 return iter.page.Response() 5813} 5814 5815// Value returns the current value or a zero-initialized value if the 5816// iterator has advanced beyond the end of the collection. 5817func (iter GatewayHostnameConfigurationCollectionIterator) Value() GatewayHostnameConfigurationContract { 5818 if !iter.page.NotDone() { 5819 return GatewayHostnameConfigurationContract{} 5820 } 5821 return iter.page.Values()[iter.i] 5822} 5823 5824// Creates a new instance of the GatewayHostnameConfigurationCollectionIterator type. 5825func NewGatewayHostnameConfigurationCollectionIterator(page GatewayHostnameConfigurationCollectionPage) GatewayHostnameConfigurationCollectionIterator { 5826 return GatewayHostnameConfigurationCollectionIterator{page: page} 5827} 5828 5829// IsEmpty returns true if the ListResult contains no values. 5830func (ghcc GatewayHostnameConfigurationCollection) IsEmpty() bool { 5831 return ghcc.Value == nil || len(*ghcc.Value) == 0 5832} 5833 5834// hasNextLink returns true if the NextLink is not empty. 5835func (ghcc GatewayHostnameConfigurationCollection) hasNextLink() bool { 5836 return ghcc.NextLink != nil && len(*ghcc.NextLink) != 0 5837} 5838 5839// gatewayHostnameConfigurationCollectionPreparer prepares a request to retrieve the next set of results. 5840// It returns nil if no more results exist. 5841func (ghcc GatewayHostnameConfigurationCollection) gatewayHostnameConfigurationCollectionPreparer(ctx context.Context) (*http.Request, error) { 5842 if !ghcc.hasNextLink() { 5843 return nil, nil 5844 } 5845 return autorest.Prepare((&http.Request{}).WithContext(ctx), 5846 autorest.AsJSON(), 5847 autorest.AsGet(), 5848 autorest.WithBaseURL(to.String(ghcc.NextLink))) 5849} 5850 5851// GatewayHostnameConfigurationCollectionPage contains a page of GatewayHostnameConfigurationContract 5852// values. 5853type GatewayHostnameConfigurationCollectionPage struct { 5854 fn func(context.Context, GatewayHostnameConfigurationCollection) (GatewayHostnameConfigurationCollection, error) 5855 ghcc GatewayHostnameConfigurationCollection 5856} 5857 5858// NextWithContext advances to the next page of values. If there was an error making 5859// the request the page does not advance and the error is returned. 5860func (page *GatewayHostnameConfigurationCollectionPage) NextWithContext(ctx context.Context) (err error) { 5861 if tracing.IsEnabled() { 5862 ctx = tracing.StartSpan(ctx, fqdn+"/GatewayHostnameConfigurationCollectionPage.NextWithContext") 5863 defer func() { 5864 sc := -1 5865 if page.Response().Response.Response != nil { 5866 sc = page.Response().Response.Response.StatusCode 5867 } 5868 tracing.EndSpan(ctx, sc, err) 5869 }() 5870 } 5871 for { 5872 next, err := page.fn(ctx, page.ghcc) 5873 if err != nil { 5874 return err 5875 } 5876 page.ghcc = next 5877 if !next.hasNextLink() || !next.IsEmpty() { 5878 break 5879 } 5880 } 5881 return nil 5882} 5883 5884// Next advances to the next page of values. If there was an error making 5885// the request the page does not advance and the error is returned. 5886// Deprecated: Use NextWithContext() instead. 5887func (page *GatewayHostnameConfigurationCollectionPage) Next() error { 5888 return page.NextWithContext(context.Background()) 5889} 5890 5891// NotDone returns true if the page enumeration should be started or is not yet complete. 5892func (page GatewayHostnameConfigurationCollectionPage) NotDone() bool { 5893 return !page.ghcc.IsEmpty() 5894} 5895 5896// Response returns the raw server response from the last page request. 5897func (page GatewayHostnameConfigurationCollectionPage) Response() GatewayHostnameConfigurationCollection { 5898 return page.ghcc 5899} 5900 5901// Values returns the slice of values for the current page or nil if there are no values. 5902func (page GatewayHostnameConfigurationCollectionPage) Values() []GatewayHostnameConfigurationContract { 5903 if page.ghcc.IsEmpty() { 5904 return nil 5905 } 5906 return *page.ghcc.Value 5907} 5908 5909// Creates a new instance of the GatewayHostnameConfigurationCollectionPage type. 5910func NewGatewayHostnameConfigurationCollectionPage(cur GatewayHostnameConfigurationCollection, getNextPage func(context.Context, GatewayHostnameConfigurationCollection) (GatewayHostnameConfigurationCollection, error)) GatewayHostnameConfigurationCollectionPage { 5911 return GatewayHostnameConfigurationCollectionPage{ 5912 fn: getNextPage, 5913 ghcc: cur, 5914 } 5915} 5916 5917// GatewayHostnameConfigurationContract gateway hostname configuration details. 5918type GatewayHostnameConfigurationContract struct { 5919 autorest.Response `json:"-"` 5920 // GatewayHostnameConfigurationContractProperties - Gateway hostname configuration details. 5921 *GatewayHostnameConfigurationContractProperties `json:"properties,omitempty"` 5922 // ID - READ-ONLY; Resource ID. 5923 ID *string `json:"id,omitempty"` 5924 // Name - READ-ONLY; Resource name. 5925 Name *string `json:"name,omitempty"` 5926 // Type - READ-ONLY; Resource type for API Management resource. 5927 Type *string `json:"type,omitempty"` 5928} 5929 5930// MarshalJSON is the custom marshaler for GatewayHostnameConfigurationContract. 5931func (ghcc GatewayHostnameConfigurationContract) MarshalJSON() ([]byte, error) { 5932 objectMap := make(map[string]interface{}) 5933 if ghcc.GatewayHostnameConfigurationContractProperties != nil { 5934 objectMap["properties"] = ghcc.GatewayHostnameConfigurationContractProperties 5935 } 5936 return json.Marshal(objectMap) 5937} 5938 5939// UnmarshalJSON is the custom unmarshaler for GatewayHostnameConfigurationContract struct. 5940func (ghcc *GatewayHostnameConfigurationContract) UnmarshalJSON(body []byte) error { 5941 var m map[string]*json.RawMessage 5942 err := json.Unmarshal(body, &m) 5943 if err != nil { 5944 return err 5945 } 5946 for k, v := range m { 5947 switch k { 5948 case "properties": 5949 if v != nil { 5950 var gatewayHostnameConfigurationContractProperties GatewayHostnameConfigurationContractProperties 5951 err = json.Unmarshal(*v, &gatewayHostnameConfigurationContractProperties) 5952 if err != nil { 5953 return err 5954 } 5955 ghcc.GatewayHostnameConfigurationContractProperties = &gatewayHostnameConfigurationContractProperties 5956 } 5957 case "id": 5958 if v != nil { 5959 var ID string 5960 err = json.Unmarshal(*v, &ID) 5961 if err != nil { 5962 return err 5963 } 5964 ghcc.ID = &ID 5965 } 5966 case "name": 5967 if v != nil { 5968 var name string 5969 err = json.Unmarshal(*v, &name) 5970 if err != nil { 5971 return err 5972 } 5973 ghcc.Name = &name 5974 } 5975 case "type": 5976 if v != nil { 5977 var typeVar string 5978 err = json.Unmarshal(*v, &typeVar) 5979 if err != nil { 5980 return err 5981 } 5982 ghcc.Type = &typeVar 5983 } 5984 } 5985 } 5986 5987 return nil 5988} 5989 5990// GatewayHostnameConfigurationContractProperties gateway hostname configuration details. 5991type GatewayHostnameConfigurationContractProperties struct { 5992 // Hostname - Hostname value. Supports valid domain name, partial or full wildcard 5993 Hostname *string `json:"hostname,omitempty"` 5994 // CertificateID - Identifier of Certificate entity that will be used for TLS connection establishment 5995 CertificateID *string `json:"certificateId,omitempty"` 5996 // NegotiateClientCertificate - Determines whether gateway requests client certificate 5997 NegotiateClientCertificate *bool `json:"negotiateClientCertificate,omitempty"` 5998 // TLS10Enabled - Specifies if TLS 1.0 is supported 5999 TLS10Enabled *bool `json:"tls10Enabled,omitempty"` 6000 // TLS11Enabled - Specifies if TLS 1.1 is supported 6001 TLS11Enabled *bool `json:"tls11Enabled,omitempty"` 6002 // HTTP2Enabled - Specifies if HTTP/2.0 is supported 6003 HTTP2Enabled *bool `json:"http2Enabled,omitempty"` 6004} 6005 6006// GatewayKeyRegenerationRequestContract gateway key regeneration request contract properties. 6007type GatewayKeyRegenerationRequestContract struct { 6008 // KeyType - The Key being regenerated. Possible values include: 'Primary', 'Secondary' 6009 KeyType KeyType `json:"keyType,omitempty"` 6010} 6011 6012// GatewayKeysContract gateway authentication keys. 6013type GatewayKeysContract struct { 6014 autorest.Response `json:"-"` 6015 // Primary - Primary gateway key. 6016 Primary *string `json:"primary,omitempty"` 6017 // Secondary - Secondary gateway key. 6018 Secondary *string `json:"secondary,omitempty"` 6019} 6020 6021// GatewayTokenContract gateway access token. 6022type GatewayTokenContract struct { 6023 autorest.Response `json:"-"` 6024 // Value - Shared Access Authentication token value for the Gateway. 6025 Value *string `json:"value,omitempty"` 6026} 6027 6028// GatewayTokenRequestContract gateway token request contract properties. 6029type GatewayTokenRequestContract struct { 6030 // KeyType - The Key to be used to generate gateway token. Possible values include: 'Primary', 'Secondary' 6031 KeyType KeyType `json:"keyType,omitempty"` 6032 // Expiry - The Expiry time of the Token. Maximum token expiry time is set to 30 days. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. 6033 Expiry *date.Time `json:"expiry,omitempty"` 6034} 6035 6036// GenerateSsoURLResult generate SSO Url operations response details. 6037type GenerateSsoURLResult struct { 6038 autorest.Response `json:"-"` 6039 // Value - Redirect Url containing the SSO URL value. 6040 Value *string `json:"value,omitempty"` 6041} 6042 6043// GroupCollection paged Group list representation. 6044type GroupCollection struct { 6045 autorest.Response `json:"-"` 6046 // Value - Page values. 6047 Value *[]GroupContract `json:"value,omitempty"` 6048 // Count - Total record count number across all pages. 6049 Count *int64 `json:"count,omitempty"` 6050 // NextLink - Next page link if any. 6051 NextLink *string `json:"nextLink,omitempty"` 6052} 6053 6054// GroupCollectionIterator provides access to a complete listing of GroupContract values. 6055type GroupCollectionIterator struct { 6056 i int 6057 page GroupCollectionPage 6058} 6059 6060// NextWithContext advances to the next value. If there was an error making 6061// the request the iterator does not advance and the error is returned. 6062func (iter *GroupCollectionIterator) NextWithContext(ctx context.Context) (err error) { 6063 if tracing.IsEnabled() { 6064 ctx = tracing.StartSpan(ctx, fqdn+"/GroupCollectionIterator.NextWithContext") 6065 defer func() { 6066 sc := -1 6067 if iter.Response().Response.Response != nil { 6068 sc = iter.Response().Response.Response.StatusCode 6069 } 6070 tracing.EndSpan(ctx, sc, err) 6071 }() 6072 } 6073 iter.i++ 6074 if iter.i < len(iter.page.Values()) { 6075 return nil 6076 } 6077 err = iter.page.NextWithContext(ctx) 6078 if err != nil { 6079 iter.i-- 6080 return err 6081 } 6082 iter.i = 0 6083 return nil 6084} 6085 6086// Next advances to the next value. If there was an error making 6087// the request the iterator does not advance and the error is returned. 6088// Deprecated: Use NextWithContext() instead. 6089func (iter *GroupCollectionIterator) Next() error { 6090 return iter.NextWithContext(context.Background()) 6091} 6092 6093// NotDone returns true if the enumeration should be started or is not yet complete. 6094func (iter GroupCollectionIterator) NotDone() bool { 6095 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 6096} 6097 6098// Response returns the raw server response from the last page request. 6099func (iter GroupCollectionIterator) Response() GroupCollection { 6100 return iter.page.Response() 6101} 6102 6103// Value returns the current value or a zero-initialized value if the 6104// iterator has advanced beyond the end of the collection. 6105func (iter GroupCollectionIterator) Value() GroupContract { 6106 if !iter.page.NotDone() { 6107 return GroupContract{} 6108 } 6109 return iter.page.Values()[iter.i] 6110} 6111 6112// Creates a new instance of the GroupCollectionIterator type. 6113func NewGroupCollectionIterator(page GroupCollectionPage) GroupCollectionIterator { 6114 return GroupCollectionIterator{page: page} 6115} 6116 6117// IsEmpty returns true if the ListResult contains no values. 6118func (gc GroupCollection) IsEmpty() bool { 6119 return gc.Value == nil || len(*gc.Value) == 0 6120} 6121 6122// hasNextLink returns true if the NextLink is not empty. 6123func (gc GroupCollection) hasNextLink() bool { 6124 return gc.NextLink != nil && len(*gc.NextLink) != 0 6125} 6126 6127// groupCollectionPreparer prepares a request to retrieve the next set of results. 6128// It returns nil if no more results exist. 6129func (gc GroupCollection) groupCollectionPreparer(ctx context.Context) (*http.Request, error) { 6130 if !gc.hasNextLink() { 6131 return nil, nil 6132 } 6133 return autorest.Prepare((&http.Request{}).WithContext(ctx), 6134 autorest.AsJSON(), 6135 autorest.AsGet(), 6136 autorest.WithBaseURL(to.String(gc.NextLink))) 6137} 6138 6139// GroupCollectionPage contains a page of GroupContract values. 6140type GroupCollectionPage struct { 6141 fn func(context.Context, GroupCollection) (GroupCollection, error) 6142 gc GroupCollection 6143} 6144 6145// NextWithContext advances to the next page of values. If there was an error making 6146// the request the page does not advance and the error is returned. 6147func (page *GroupCollectionPage) NextWithContext(ctx context.Context) (err error) { 6148 if tracing.IsEnabled() { 6149 ctx = tracing.StartSpan(ctx, fqdn+"/GroupCollectionPage.NextWithContext") 6150 defer func() { 6151 sc := -1 6152 if page.Response().Response.Response != nil { 6153 sc = page.Response().Response.Response.StatusCode 6154 } 6155 tracing.EndSpan(ctx, sc, err) 6156 }() 6157 } 6158 for { 6159 next, err := page.fn(ctx, page.gc) 6160 if err != nil { 6161 return err 6162 } 6163 page.gc = next 6164 if !next.hasNextLink() || !next.IsEmpty() { 6165 break 6166 } 6167 } 6168 return nil 6169} 6170 6171// Next advances to the next page of values. If there was an error making 6172// the request the page does not advance and the error is returned. 6173// Deprecated: Use NextWithContext() instead. 6174func (page *GroupCollectionPage) Next() error { 6175 return page.NextWithContext(context.Background()) 6176} 6177 6178// NotDone returns true if the page enumeration should be started or is not yet complete. 6179func (page GroupCollectionPage) NotDone() bool { 6180 return !page.gc.IsEmpty() 6181} 6182 6183// Response returns the raw server response from the last page request. 6184func (page GroupCollectionPage) Response() GroupCollection { 6185 return page.gc 6186} 6187 6188// Values returns the slice of values for the current page or nil if there are no values. 6189func (page GroupCollectionPage) Values() []GroupContract { 6190 if page.gc.IsEmpty() { 6191 return nil 6192 } 6193 return *page.gc.Value 6194} 6195 6196// Creates a new instance of the GroupCollectionPage type. 6197func NewGroupCollectionPage(cur GroupCollection, getNextPage func(context.Context, GroupCollection) (GroupCollection, error)) GroupCollectionPage { 6198 return GroupCollectionPage{ 6199 fn: getNextPage, 6200 gc: cur, 6201 } 6202} 6203 6204// GroupContract contract details. 6205type GroupContract struct { 6206 autorest.Response `json:"-"` 6207 // GroupContractProperties - Group entity contract properties. 6208 *GroupContractProperties `json:"properties,omitempty"` 6209 // ID - READ-ONLY; Resource ID. 6210 ID *string `json:"id,omitempty"` 6211 // Name - READ-ONLY; Resource name. 6212 Name *string `json:"name,omitempty"` 6213 // Type - READ-ONLY; Resource type for API Management resource. 6214 Type *string `json:"type,omitempty"` 6215} 6216 6217// MarshalJSON is the custom marshaler for GroupContract. 6218func (gc GroupContract) MarshalJSON() ([]byte, error) { 6219 objectMap := make(map[string]interface{}) 6220 if gc.GroupContractProperties != nil { 6221 objectMap["properties"] = gc.GroupContractProperties 6222 } 6223 return json.Marshal(objectMap) 6224} 6225 6226// UnmarshalJSON is the custom unmarshaler for GroupContract struct. 6227func (gc *GroupContract) UnmarshalJSON(body []byte) error { 6228 var m map[string]*json.RawMessage 6229 err := json.Unmarshal(body, &m) 6230 if err != nil { 6231 return err 6232 } 6233 for k, v := range m { 6234 switch k { 6235 case "properties": 6236 if v != nil { 6237 var groupContractProperties GroupContractProperties 6238 err = json.Unmarshal(*v, &groupContractProperties) 6239 if err != nil { 6240 return err 6241 } 6242 gc.GroupContractProperties = &groupContractProperties 6243 } 6244 case "id": 6245 if v != nil { 6246 var ID string 6247 err = json.Unmarshal(*v, &ID) 6248 if err != nil { 6249 return err 6250 } 6251 gc.ID = &ID 6252 } 6253 case "name": 6254 if v != nil { 6255 var name string 6256 err = json.Unmarshal(*v, &name) 6257 if err != nil { 6258 return err 6259 } 6260 gc.Name = &name 6261 } 6262 case "type": 6263 if v != nil { 6264 var typeVar string 6265 err = json.Unmarshal(*v, &typeVar) 6266 if err != nil { 6267 return err 6268 } 6269 gc.Type = &typeVar 6270 } 6271 } 6272 } 6273 6274 return nil 6275} 6276 6277// GroupContractProperties group contract Properties. 6278type GroupContractProperties struct { 6279 // DisplayName - Group name. 6280 DisplayName *string `json:"displayName,omitempty"` 6281 // Description - Group description. Can contain HTML formatting tags. 6282 Description *string `json:"description,omitempty"` 6283 // BuiltIn - READ-ONLY; true if the group is one of the three system groups (Administrators, Developers, or Guests); otherwise false. 6284 BuiltIn *bool `json:"builtIn,omitempty"` 6285 // Type - Group type. Possible values include: 'Custom', 'System', 'External' 6286 Type GroupType `json:"type,omitempty"` 6287 // ExternalID - For external groups, this property contains the id of the group from the external identity provider, e.g. for Azure Active Directory `aad://<tenant>.onmicrosoft.com/groups/<group object id>`; otherwise the value is null. 6288 ExternalID *string `json:"externalId,omitempty"` 6289} 6290 6291// MarshalJSON is the custom marshaler for GroupContractProperties. 6292func (gcp GroupContractProperties) MarshalJSON() ([]byte, error) { 6293 objectMap := make(map[string]interface{}) 6294 if gcp.DisplayName != nil { 6295 objectMap["displayName"] = gcp.DisplayName 6296 } 6297 if gcp.Description != nil { 6298 objectMap["description"] = gcp.Description 6299 } 6300 if gcp.Type != "" { 6301 objectMap["type"] = gcp.Type 6302 } 6303 if gcp.ExternalID != nil { 6304 objectMap["externalId"] = gcp.ExternalID 6305 } 6306 return json.Marshal(objectMap) 6307} 6308 6309// GroupCreateParameters parameters supplied to the Create Group operation. 6310type GroupCreateParameters struct { 6311 // GroupCreateParametersProperties - Properties supplied to Create Group operation. 6312 *GroupCreateParametersProperties `json:"properties,omitempty"` 6313} 6314 6315// MarshalJSON is the custom marshaler for GroupCreateParameters. 6316func (gcp GroupCreateParameters) MarshalJSON() ([]byte, error) { 6317 objectMap := make(map[string]interface{}) 6318 if gcp.GroupCreateParametersProperties != nil { 6319 objectMap["properties"] = gcp.GroupCreateParametersProperties 6320 } 6321 return json.Marshal(objectMap) 6322} 6323 6324// UnmarshalJSON is the custom unmarshaler for GroupCreateParameters struct. 6325func (gcp *GroupCreateParameters) UnmarshalJSON(body []byte) error { 6326 var m map[string]*json.RawMessage 6327 err := json.Unmarshal(body, &m) 6328 if err != nil { 6329 return err 6330 } 6331 for k, v := range m { 6332 switch k { 6333 case "properties": 6334 if v != nil { 6335 var groupCreateParametersProperties GroupCreateParametersProperties 6336 err = json.Unmarshal(*v, &groupCreateParametersProperties) 6337 if err != nil { 6338 return err 6339 } 6340 gcp.GroupCreateParametersProperties = &groupCreateParametersProperties 6341 } 6342 } 6343 } 6344 6345 return nil 6346} 6347 6348// GroupCreateParametersProperties parameters supplied to the Create Group operation. 6349type GroupCreateParametersProperties struct { 6350 // DisplayName - Group name. 6351 DisplayName *string `json:"displayName,omitempty"` 6352 // Description - Group description. 6353 Description *string `json:"description,omitempty"` 6354 // Type - Group type. Possible values include: 'Custom', 'System', 'External' 6355 Type GroupType `json:"type,omitempty"` 6356 // ExternalID - Identifier of the external groups, this property contains the id of the group from the external identity provider, e.g. for Azure Active Directory `aad://<tenant>.onmicrosoft.com/groups/<group object id>`; otherwise the value is null. 6357 ExternalID *string `json:"externalId,omitempty"` 6358} 6359 6360// GroupUpdateParameters parameters supplied to the Update Group operation. 6361type GroupUpdateParameters struct { 6362 // GroupUpdateParametersProperties - Group entity update contract properties. 6363 *GroupUpdateParametersProperties `json:"properties,omitempty"` 6364} 6365 6366// MarshalJSON is the custom marshaler for GroupUpdateParameters. 6367func (gup GroupUpdateParameters) MarshalJSON() ([]byte, error) { 6368 objectMap := make(map[string]interface{}) 6369 if gup.GroupUpdateParametersProperties != nil { 6370 objectMap["properties"] = gup.GroupUpdateParametersProperties 6371 } 6372 return json.Marshal(objectMap) 6373} 6374 6375// UnmarshalJSON is the custom unmarshaler for GroupUpdateParameters struct. 6376func (gup *GroupUpdateParameters) UnmarshalJSON(body []byte) error { 6377 var m map[string]*json.RawMessage 6378 err := json.Unmarshal(body, &m) 6379 if err != nil { 6380 return err 6381 } 6382 for k, v := range m { 6383 switch k { 6384 case "properties": 6385 if v != nil { 6386 var groupUpdateParametersProperties GroupUpdateParametersProperties 6387 err = json.Unmarshal(*v, &groupUpdateParametersProperties) 6388 if err != nil { 6389 return err 6390 } 6391 gup.GroupUpdateParametersProperties = &groupUpdateParametersProperties 6392 } 6393 } 6394 } 6395 6396 return nil 6397} 6398 6399// GroupUpdateParametersProperties parameters supplied to the Update Group operation. 6400type GroupUpdateParametersProperties struct { 6401 // DisplayName - Group name. 6402 DisplayName *string `json:"displayName,omitempty"` 6403 // Description - Group description. 6404 Description *string `json:"description,omitempty"` 6405 // Type - Group type. Possible values include: 'Custom', 'System', 'External' 6406 Type GroupType `json:"type,omitempty"` 6407 // ExternalID - Identifier of the external groups, this property contains the id of the group from the external identity provider, e.g. for Azure Active Directory `aad://<tenant>.onmicrosoft.com/groups/<group object id>`; otherwise the value is null. 6408 ExternalID *string `json:"externalId,omitempty"` 6409} 6410 6411// HostnameConfiguration custom hostname configuration. 6412type HostnameConfiguration struct { 6413 // Type - Hostname type. Possible values include: 'HostnameTypeProxy', 'HostnameTypePortal', 'HostnameTypeManagement', 'HostnameTypeScm', 'HostnameTypeDeveloperPortal' 6414 Type HostnameType `json:"type,omitempty"` 6415 // HostName - Hostname to configure on the Api Management service. 6416 HostName *string `json:"hostName,omitempty"` 6417 // KeyVaultID - Url to the KeyVault Secret containing the Ssl Certificate. If absolute Url containing version is provided, auto-update of ssl certificate will not work. This requires Api Management service to be configured with aka.ms/apimmsi. The secret should be of type *application/x-pkcs12* 6418 KeyVaultID *string `json:"keyVaultId,omitempty"` 6419 // IdentityClientID - System or User Assigned Managed identity clientId as generated by Azure AD, which has GET access to the keyVault containing the SSL certificate. 6420 IdentityClientID *string `json:"identityClientId,omitempty"` 6421 // EncodedCertificate - Base64 Encoded certificate. 6422 EncodedCertificate *string `json:"encodedCertificate,omitempty"` 6423 // CertificatePassword - Certificate Password. 6424 CertificatePassword *string `json:"certificatePassword,omitempty"` 6425 // DefaultSslBinding - Specify true to setup the certificate associated with this Hostname as the Default SSL Certificate. If a client does not send the SNI header, then this will be the certificate that will be challenged. The property is useful if a service has multiple custom hostname enabled and it needs to decide on the default ssl certificate. The setting only applied to Proxy Hostname Type. 6426 DefaultSslBinding *bool `json:"defaultSslBinding,omitempty"` 6427 // NegotiateClientCertificate - Specify true to always negotiate client certificate on the hostname. Default Value is false. 6428 NegotiateClientCertificate *bool `json:"negotiateClientCertificate,omitempty"` 6429 // Certificate - Certificate information. 6430 Certificate *CertificateInformation `json:"certificate,omitempty"` 6431} 6432 6433// HTTPMessageDiagnostic http message diagnostic settings. 6434type HTTPMessageDiagnostic struct { 6435 // Headers - Array of HTTP Headers to log. 6436 Headers *[]string `json:"headers,omitempty"` 6437 // Body - Body logging settings. 6438 Body *BodyDiagnosticSettings `json:"body,omitempty"` 6439 // DataMasking - Data masking settings. 6440 DataMasking *DataMasking `json:"dataMasking,omitempty"` 6441} 6442 6443// IdentityProviderBaseParameters identity Provider Base Parameter Properties. 6444type IdentityProviderBaseParameters struct { 6445 // Type - Identity Provider Type identifier. Possible values include: 'Facebook', 'Google', 'Microsoft', 'Twitter', 'Aad', 'AadB2C' 6446 Type IdentityProviderType `json:"type,omitempty"` 6447 // SigninTenant - The TenantId to use instead of Common when logging into Active Directory 6448 SigninTenant *string `json:"signinTenant,omitempty"` 6449 // AllowedTenants - List of Allowed Tenants when configuring Azure Active Directory login. 6450 AllowedTenants *[]string `json:"allowedTenants,omitempty"` 6451 // Authority - OpenID Connect discovery endpoint hostname for AAD or AAD B2C. 6452 Authority *string `json:"authority,omitempty"` 6453 // SignupPolicyName - Signup Policy Name. Only applies to AAD B2C Identity Provider. 6454 SignupPolicyName *string `json:"signupPolicyName,omitempty"` 6455 // SigninPolicyName - Signin Policy Name. Only applies to AAD B2C Identity Provider. 6456 SigninPolicyName *string `json:"signinPolicyName,omitempty"` 6457 // ProfileEditingPolicyName - Profile Editing Policy Name. Only applies to AAD B2C Identity Provider. 6458 ProfileEditingPolicyName *string `json:"profileEditingPolicyName,omitempty"` 6459 // PasswordResetPolicyName - Password Reset Policy Name. Only applies to AAD B2C Identity Provider. 6460 PasswordResetPolicyName *string `json:"passwordResetPolicyName,omitempty"` 6461} 6462 6463// IdentityProviderContract identity Provider details. 6464type IdentityProviderContract struct { 6465 autorest.Response `json:"-"` 6466 // IdentityProviderContractProperties - Identity Provider contract properties. 6467 *IdentityProviderContractProperties `json:"properties,omitempty"` 6468 // ID - READ-ONLY; Resource ID. 6469 ID *string `json:"id,omitempty"` 6470 // Name - READ-ONLY; Resource name. 6471 Name *string `json:"name,omitempty"` 6472 // Type - READ-ONLY; Resource type for API Management resource. 6473 Type *string `json:"type,omitempty"` 6474} 6475 6476// MarshalJSON is the custom marshaler for IdentityProviderContract. 6477func (ipc IdentityProviderContract) MarshalJSON() ([]byte, error) { 6478 objectMap := make(map[string]interface{}) 6479 if ipc.IdentityProviderContractProperties != nil { 6480 objectMap["properties"] = ipc.IdentityProviderContractProperties 6481 } 6482 return json.Marshal(objectMap) 6483} 6484 6485// UnmarshalJSON is the custom unmarshaler for IdentityProviderContract struct. 6486func (ipc *IdentityProviderContract) UnmarshalJSON(body []byte) error { 6487 var m map[string]*json.RawMessage 6488 err := json.Unmarshal(body, &m) 6489 if err != nil { 6490 return err 6491 } 6492 for k, v := range m { 6493 switch k { 6494 case "properties": 6495 if v != nil { 6496 var identityProviderContractProperties IdentityProviderContractProperties 6497 err = json.Unmarshal(*v, &identityProviderContractProperties) 6498 if err != nil { 6499 return err 6500 } 6501 ipc.IdentityProviderContractProperties = &identityProviderContractProperties 6502 } 6503 case "id": 6504 if v != nil { 6505 var ID string 6506 err = json.Unmarshal(*v, &ID) 6507 if err != nil { 6508 return err 6509 } 6510 ipc.ID = &ID 6511 } 6512 case "name": 6513 if v != nil { 6514 var name string 6515 err = json.Unmarshal(*v, &name) 6516 if err != nil { 6517 return err 6518 } 6519 ipc.Name = &name 6520 } 6521 case "type": 6522 if v != nil { 6523 var typeVar string 6524 err = json.Unmarshal(*v, &typeVar) 6525 if err != nil { 6526 return err 6527 } 6528 ipc.Type = &typeVar 6529 } 6530 } 6531 } 6532 6533 return nil 6534} 6535 6536// IdentityProviderContractProperties the external Identity Providers like Facebook, Google, Microsoft, 6537// Twitter or Azure Active Directory which can be used to enable access to the API Management service 6538// developer portal for all users. 6539type IdentityProviderContractProperties struct { 6540 // ClientID - Client Id of the Application in the external Identity Provider. It is App ID for Facebook login, Client ID for Google login, App ID for Microsoft. 6541 ClientID *string `json:"clientId,omitempty"` 6542 // ClientSecret - Client secret of the Application in external Identity Provider, used to authenticate login request. For example, it is App Secret for Facebook login, API Key for Google login, Public Key for Microsoft. This property will not be filled on 'GET' operations! Use '/listSecrets' POST request to get the value. 6543 ClientSecret *string `json:"clientSecret,omitempty"` 6544 // Type - Identity Provider Type identifier. Possible values include: 'Facebook', 'Google', 'Microsoft', 'Twitter', 'Aad', 'AadB2C' 6545 Type IdentityProviderType `json:"type,omitempty"` 6546 // SigninTenant - The TenantId to use instead of Common when logging into Active Directory 6547 SigninTenant *string `json:"signinTenant,omitempty"` 6548 // AllowedTenants - List of Allowed Tenants when configuring Azure Active Directory login. 6549 AllowedTenants *[]string `json:"allowedTenants,omitempty"` 6550 // Authority - OpenID Connect discovery endpoint hostname for AAD or AAD B2C. 6551 Authority *string `json:"authority,omitempty"` 6552 // SignupPolicyName - Signup Policy Name. Only applies to AAD B2C Identity Provider. 6553 SignupPolicyName *string `json:"signupPolicyName,omitempty"` 6554 // SigninPolicyName - Signin Policy Name. Only applies to AAD B2C Identity Provider. 6555 SigninPolicyName *string `json:"signinPolicyName,omitempty"` 6556 // ProfileEditingPolicyName - Profile Editing Policy Name. Only applies to AAD B2C Identity Provider. 6557 ProfileEditingPolicyName *string `json:"profileEditingPolicyName,omitempty"` 6558 // PasswordResetPolicyName - Password Reset Policy Name. Only applies to AAD B2C Identity Provider. 6559 PasswordResetPolicyName *string `json:"passwordResetPolicyName,omitempty"` 6560} 6561 6562// IdentityProviderCreateContract identity Provider details. 6563type IdentityProviderCreateContract struct { 6564 // IdentityProviderCreateContractProperties - Identity Provider contract properties. 6565 *IdentityProviderCreateContractProperties `json:"properties,omitempty"` 6566 // ID - READ-ONLY; Resource ID. 6567 ID *string `json:"id,omitempty"` 6568 // Name - READ-ONLY; Resource name. 6569 Name *string `json:"name,omitempty"` 6570 // Type - READ-ONLY; Resource type for API Management resource. 6571 Type *string `json:"type,omitempty"` 6572} 6573 6574// MarshalJSON is the custom marshaler for IdentityProviderCreateContract. 6575func (ipcc IdentityProviderCreateContract) MarshalJSON() ([]byte, error) { 6576 objectMap := make(map[string]interface{}) 6577 if ipcc.IdentityProviderCreateContractProperties != nil { 6578 objectMap["properties"] = ipcc.IdentityProviderCreateContractProperties 6579 } 6580 return json.Marshal(objectMap) 6581} 6582 6583// UnmarshalJSON is the custom unmarshaler for IdentityProviderCreateContract struct. 6584func (ipcc *IdentityProviderCreateContract) UnmarshalJSON(body []byte) error { 6585 var m map[string]*json.RawMessage 6586 err := json.Unmarshal(body, &m) 6587 if err != nil { 6588 return err 6589 } 6590 for k, v := range m { 6591 switch k { 6592 case "properties": 6593 if v != nil { 6594 var identityProviderCreateContractProperties IdentityProviderCreateContractProperties 6595 err = json.Unmarshal(*v, &identityProviderCreateContractProperties) 6596 if err != nil { 6597 return err 6598 } 6599 ipcc.IdentityProviderCreateContractProperties = &identityProviderCreateContractProperties 6600 } 6601 case "id": 6602 if v != nil { 6603 var ID string 6604 err = json.Unmarshal(*v, &ID) 6605 if err != nil { 6606 return err 6607 } 6608 ipcc.ID = &ID 6609 } 6610 case "name": 6611 if v != nil { 6612 var name string 6613 err = json.Unmarshal(*v, &name) 6614 if err != nil { 6615 return err 6616 } 6617 ipcc.Name = &name 6618 } 6619 case "type": 6620 if v != nil { 6621 var typeVar string 6622 err = json.Unmarshal(*v, &typeVar) 6623 if err != nil { 6624 return err 6625 } 6626 ipcc.Type = &typeVar 6627 } 6628 } 6629 } 6630 6631 return nil 6632} 6633 6634// IdentityProviderCreateContractProperties the external Identity Providers like Facebook, Google, 6635// Microsoft, Twitter or Azure Active Directory which can be used to enable access to the API Management 6636// service developer portal for all users. 6637type IdentityProviderCreateContractProperties struct { 6638 // ClientID - Client Id of the Application in the external Identity Provider. It is App ID for Facebook login, Client ID for Google login, App ID for Microsoft. 6639 ClientID *string `json:"clientId,omitempty"` 6640 // ClientSecret - Client secret of the Application in external Identity Provider, used to authenticate login request. For example, it is App Secret for Facebook login, API Key for Google login, Public Key for Microsoft. This property will not be filled on 'GET' operations! Use '/listSecrets' POST request to get the value. 6641 ClientSecret *string `json:"clientSecret,omitempty"` 6642 // Type - Identity Provider Type identifier. Possible values include: 'Facebook', 'Google', 'Microsoft', 'Twitter', 'Aad', 'AadB2C' 6643 Type IdentityProviderType `json:"type,omitempty"` 6644 // SigninTenant - The TenantId to use instead of Common when logging into Active Directory 6645 SigninTenant *string `json:"signinTenant,omitempty"` 6646 // AllowedTenants - List of Allowed Tenants when configuring Azure Active Directory login. 6647 AllowedTenants *[]string `json:"allowedTenants,omitempty"` 6648 // Authority - OpenID Connect discovery endpoint hostname for AAD or AAD B2C. 6649 Authority *string `json:"authority,omitempty"` 6650 // SignupPolicyName - Signup Policy Name. Only applies to AAD B2C Identity Provider. 6651 SignupPolicyName *string `json:"signupPolicyName,omitempty"` 6652 // SigninPolicyName - Signin Policy Name. Only applies to AAD B2C Identity Provider. 6653 SigninPolicyName *string `json:"signinPolicyName,omitempty"` 6654 // ProfileEditingPolicyName - Profile Editing Policy Name. Only applies to AAD B2C Identity Provider. 6655 ProfileEditingPolicyName *string `json:"profileEditingPolicyName,omitempty"` 6656 // PasswordResetPolicyName - Password Reset Policy Name. Only applies to AAD B2C Identity Provider. 6657 PasswordResetPolicyName *string `json:"passwordResetPolicyName,omitempty"` 6658} 6659 6660// IdentityProviderList list of all the Identity Providers configured on the service instance. 6661type IdentityProviderList struct { 6662 autorest.Response `json:"-"` 6663 // Value - Identity Provider configuration values. 6664 Value *[]IdentityProviderContract `json:"value,omitempty"` 6665 // Count - Total record count number across all pages. 6666 Count *int64 `json:"count,omitempty"` 6667 // NextLink - Next page link if any. 6668 NextLink *string `json:"nextLink,omitempty"` 6669} 6670 6671// IdentityProviderListIterator provides access to a complete listing of IdentityProviderContract values. 6672type IdentityProviderListIterator struct { 6673 i int 6674 page IdentityProviderListPage 6675} 6676 6677// NextWithContext advances to the next value. If there was an error making 6678// the request the iterator does not advance and the error is returned. 6679func (iter *IdentityProviderListIterator) NextWithContext(ctx context.Context) (err error) { 6680 if tracing.IsEnabled() { 6681 ctx = tracing.StartSpan(ctx, fqdn+"/IdentityProviderListIterator.NextWithContext") 6682 defer func() { 6683 sc := -1 6684 if iter.Response().Response.Response != nil { 6685 sc = iter.Response().Response.Response.StatusCode 6686 } 6687 tracing.EndSpan(ctx, sc, err) 6688 }() 6689 } 6690 iter.i++ 6691 if iter.i < len(iter.page.Values()) { 6692 return nil 6693 } 6694 err = iter.page.NextWithContext(ctx) 6695 if err != nil { 6696 iter.i-- 6697 return err 6698 } 6699 iter.i = 0 6700 return nil 6701} 6702 6703// Next advances to the next value. If there was an error making 6704// the request the iterator does not advance and the error is returned. 6705// Deprecated: Use NextWithContext() instead. 6706func (iter *IdentityProviderListIterator) Next() error { 6707 return iter.NextWithContext(context.Background()) 6708} 6709 6710// NotDone returns true if the enumeration should be started or is not yet complete. 6711func (iter IdentityProviderListIterator) NotDone() bool { 6712 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 6713} 6714 6715// Response returns the raw server response from the last page request. 6716func (iter IdentityProviderListIterator) Response() IdentityProviderList { 6717 return iter.page.Response() 6718} 6719 6720// Value returns the current value or a zero-initialized value if the 6721// iterator has advanced beyond the end of the collection. 6722func (iter IdentityProviderListIterator) Value() IdentityProviderContract { 6723 if !iter.page.NotDone() { 6724 return IdentityProviderContract{} 6725 } 6726 return iter.page.Values()[iter.i] 6727} 6728 6729// Creates a new instance of the IdentityProviderListIterator type. 6730func NewIdentityProviderListIterator(page IdentityProviderListPage) IdentityProviderListIterator { 6731 return IdentityProviderListIterator{page: page} 6732} 6733 6734// IsEmpty returns true if the ListResult contains no values. 6735func (ipl IdentityProviderList) IsEmpty() bool { 6736 return ipl.Value == nil || len(*ipl.Value) == 0 6737} 6738 6739// hasNextLink returns true if the NextLink is not empty. 6740func (ipl IdentityProviderList) hasNextLink() bool { 6741 return ipl.NextLink != nil && len(*ipl.NextLink) != 0 6742} 6743 6744// identityProviderListPreparer prepares a request to retrieve the next set of results. 6745// It returns nil if no more results exist. 6746func (ipl IdentityProviderList) identityProviderListPreparer(ctx context.Context) (*http.Request, error) { 6747 if !ipl.hasNextLink() { 6748 return nil, nil 6749 } 6750 return autorest.Prepare((&http.Request{}).WithContext(ctx), 6751 autorest.AsJSON(), 6752 autorest.AsGet(), 6753 autorest.WithBaseURL(to.String(ipl.NextLink))) 6754} 6755 6756// IdentityProviderListPage contains a page of IdentityProviderContract values. 6757type IdentityProviderListPage struct { 6758 fn func(context.Context, IdentityProviderList) (IdentityProviderList, error) 6759 ipl IdentityProviderList 6760} 6761 6762// NextWithContext advances to the next page of values. If there was an error making 6763// the request the page does not advance and the error is returned. 6764func (page *IdentityProviderListPage) NextWithContext(ctx context.Context) (err error) { 6765 if tracing.IsEnabled() { 6766 ctx = tracing.StartSpan(ctx, fqdn+"/IdentityProviderListPage.NextWithContext") 6767 defer func() { 6768 sc := -1 6769 if page.Response().Response.Response != nil { 6770 sc = page.Response().Response.Response.StatusCode 6771 } 6772 tracing.EndSpan(ctx, sc, err) 6773 }() 6774 } 6775 for { 6776 next, err := page.fn(ctx, page.ipl) 6777 if err != nil { 6778 return err 6779 } 6780 page.ipl = next 6781 if !next.hasNextLink() || !next.IsEmpty() { 6782 break 6783 } 6784 } 6785 return nil 6786} 6787 6788// Next advances to the next page of values. If there was an error making 6789// the request the page does not advance and the error is returned. 6790// Deprecated: Use NextWithContext() instead. 6791func (page *IdentityProviderListPage) Next() error { 6792 return page.NextWithContext(context.Background()) 6793} 6794 6795// NotDone returns true if the page enumeration should be started or is not yet complete. 6796func (page IdentityProviderListPage) NotDone() bool { 6797 return !page.ipl.IsEmpty() 6798} 6799 6800// Response returns the raw server response from the last page request. 6801func (page IdentityProviderListPage) Response() IdentityProviderList { 6802 return page.ipl 6803} 6804 6805// Values returns the slice of values for the current page or nil if there are no values. 6806func (page IdentityProviderListPage) Values() []IdentityProviderContract { 6807 if page.ipl.IsEmpty() { 6808 return nil 6809 } 6810 return *page.ipl.Value 6811} 6812 6813// Creates a new instance of the IdentityProviderListPage type. 6814func NewIdentityProviderListPage(cur IdentityProviderList, getNextPage func(context.Context, IdentityProviderList) (IdentityProviderList, error)) IdentityProviderListPage { 6815 return IdentityProviderListPage{ 6816 fn: getNextPage, 6817 ipl: cur, 6818 } 6819} 6820 6821// IdentityProviderUpdateParameters parameters supplied to update Identity Provider 6822type IdentityProviderUpdateParameters struct { 6823 // IdentityProviderUpdateProperties - Identity Provider update properties. 6824 *IdentityProviderUpdateProperties `json:"properties,omitempty"` 6825} 6826 6827// MarshalJSON is the custom marshaler for IdentityProviderUpdateParameters. 6828func (ipup IdentityProviderUpdateParameters) MarshalJSON() ([]byte, error) { 6829 objectMap := make(map[string]interface{}) 6830 if ipup.IdentityProviderUpdateProperties != nil { 6831 objectMap["properties"] = ipup.IdentityProviderUpdateProperties 6832 } 6833 return json.Marshal(objectMap) 6834} 6835 6836// UnmarshalJSON is the custom unmarshaler for IdentityProviderUpdateParameters struct. 6837func (ipup *IdentityProviderUpdateParameters) UnmarshalJSON(body []byte) error { 6838 var m map[string]*json.RawMessage 6839 err := json.Unmarshal(body, &m) 6840 if err != nil { 6841 return err 6842 } 6843 for k, v := range m { 6844 switch k { 6845 case "properties": 6846 if v != nil { 6847 var identityProviderUpdateProperties IdentityProviderUpdateProperties 6848 err = json.Unmarshal(*v, &identityProviderUpdateProperties) 6849 if err != nil { 6850 return err 6851 } 6852 ipup.IdentityProviderUpdateProperties = &identityProviderUpdateProperties 6853 } 6854 } 6855 } 6856 6857 return nil 6858} 6859 6860// IdentityProviderUpdateProperties parameters supplied to the Update Identity Provider operation. 6861type IdentityProviderUpdateProperties struct { 6862 // ClientID - Client Id of the Application in the external Identity Provider. It is App ID for Facebook login, Client ID for Google login, App ID for Microsoft. 6863 ClientID *string `json:"clientId,omitempty"` 6864 // ClientSecret - Client secret of the Application in external Identity Provider, used to authenticate login request. For example, it is App Secret for Facebook login, API Key for Google login, Public Key for Microsoft. 6865 ClientSecret *string `json:"clientSecret,omitempty"` 6866 // Type - Identity Provider Type identifier. Possible values include: 'Facebook', 'Google', 'Microsoft', 'Twitter', 'Aad', 'AadB2C' 6867 Type IdentityProviderType `json:"type,omitempty"` 6868 // SigninTenant - The TenantId to use instead of Common when logging into Active Directory 6869 SigninTenant *string `json:"signinTenant,omitempty"` 6870 // AllowedTenants - List of Allowed Tenants when configuring Azure Active Directory login. 6871 AllowedTenants *[]string `json:"allowedTenants,omitempty"` 6872 // Authority - OpenID Connect discovery endpoint hostname for AAD or AAD B2C. 6873 Authority *string `json:"authority,omitempty"` 6874 // SignupPolicyName - Signup Policy Name. Only applies to AAD B2C Identity Provider. 6875 SignupPolicyName *string `json:"signupPolicyName,omitempty"` 6876 // SigninPolicyName - Signin Policy Name. Only applies to AAD B2C Identity Provider. 6877 SigninPolicyName *string `json:"signinPolicyName,omitempty"` 6878 // ProfileEditingPolicyName - Profile Editing Policy Name. Only applies to AAD B2C Identity Provider. 6879 ProfileEditingPolicyName *string `json:"profileEditingPolicyName,omitempty"` 6880 // PasswordResetPolicyName - Password Reset Policy Name. Only applies to AAD B2C Identity Provider. 6881 PasswordResetPolicyName *string `json:"passwordResetPolicyName,omitempty"` 6882} 6883 6884// IssueAttachmentCollection paged Issue Attachment list representation. 6885type IssueAttachmentCollection struct { 6886 autorest.Response `json:"-"` 6887 // Value - READ-ONLY; Issue Attachment values. 6888 Value *[]IssueAttachmentContract `json:"value,omitempty"` 6889 // Count - Total record count number across all pages. 6890 Count *int64 `json:"count,omitempty"` 6891 // NextLink - READ-ONLY; Next page link if any. 6892 NextLink *string `json:"nextLink,omitempty"` 6893} 6894 6895// MarshalJSON is the custom marshaler for IssueAttachmentCollection. 6896func (iac IssueAttachmentCollection) MarshalJSON() ([]byte, error) { 6897 objectMap := make(map[string]interface{}) 6898 if iac.Count != nil { 6899 objectMap["count"] = iac.Count 6900 } 6901 return json.Marshal(objectMap) 6902} 6903 6904// IssueAttachmentCollectionIterator provides access to a complete listing of IssueAttachmentContract 6905// values. 6906type IssueAttachmentCollectionIterator struct { 6907 i int 6908 page IssueAttachmentCollectionPage 6909} 6910 6911// NextWithContext advances to the next value. If there was an error making 6912// the request the iterator does not advance and the error is returned. 6913func (iter *IssueAttachmentCollectionIterator) NextWithContext(ctx context.Context) (err error) { 6914 if tracing.IsEnabled() { 6915 ctx = tracing.StartSpan(ctx, fqdn+"/IssueAttachmentCollectionIterator.NextWithContext") 6916 defer func() { 6917 sc := -1 6918 if iter.Response().Response.Response != nil { 6919 sc = iter.Response().Response.Response.StatusCode 6920 } 6921 tracing.EndSpan(ctx, sc, err) 6922 }() 6923 } 6924 iter.i++ 6925 if iter.i < len(iter.page.Values()) { 6926 return nil 6927 } 6928 err = iter.page.NextWithContext(ctx) 6929 if err != nil { 6930 iter.i-- 6931 return err 6932 } 6933 iter.i = 0 6934 return nil 6935} 6936 6937// Next advances to the next value. If there was an error making 6938// the request the iterator does not advance and the error is returned. 6939// Deprecated: Use NextWithContext() instead. 6940func (iter *IssueAttachmentCollectionIterator) Next() error { 6941 return iter.NextWithContext(context.Background()) 6942} 6943 6944// NotDone returns true if the enumeration should be started or is not yet complete. 6945func (iter IssueAttachmentCollectionIterator) NotDone() bool { 6946 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 6947} 6948 6949// Response returns the raw server response from the last page request. 6950func (iter IssueAttachmentCollectionIterator) Response() IssueAttachmentCollection { 6951 return iter.page.Response() 6952} 6953 6954// Value returns the current value or a zero-initialized value if the 6955// iterator has advanced beyond the end of the collection. 6956func (iter IssueAttachmentCollectionIterator) Value() IssueAttachmentContract { 6957 if !iter.page.NotDone() { 6958 return IssueAttachmentContract{} 6959 } 6960 return iter.page.Values()[iter.i] 6961} 6962 6963// Creates a new instance of the IssueAttachmentCollectionIterator type. 6964func NewIssueAttachmentCollectionIterator(page IssueAttachmentCollectionPage) IssueAttachmentCollectionIterator { 6965 return IssueAttachmentCollectionIterator{page: page} 6966} 6967 6968// IsEmpty returns true if the ListResult contains no values. 6969func (iac IssueAttachmentCollection) IsEmpty() bool { 6970 return iac.Value == nil || len(*iac.Value) == 0 6971} 6972 6973// hasNextLink returns true if the NextLink is not empty. 6974func (iac IssueAttachmentCollection) hasNextLink() bool { 6975 return iac.NextLink != nil && len(*iac.NextLink) != 0 6976} 6977 6978// issueAttachmentCollectionPreparer prepares a request to retrieve the next set of results. 6979// It returns nil if no more results exist. 6980func (iac IssueAttachmentCollection) issueAttachmentCollectionPreparer(ctx context.Context) (*http.Request, error) { 6981 if !iac.hasNextLink() { 6982 return nil, nil 6983 } 6984 return autorest.Prepare((&http.Request{}).WithContext(ctx), 6985 autorest.AsJSON(), 6986 autorest.AsGet(), 6987 autorest.WithBaseURL(to.String(iac.NextLink))) 6988} 6989 6990// IssueAttachmentCollectionPage contains a page of IssueAttachmentContract values. 6991type IssueAttachmentCollectionPage struct { 6992 fn func(context.Context, IssueAttachmentCollection) (IssueAttachmentCollection, error) 6993 iac IssueAttachmentCollection 6994} 6995 6996// NextWithContext advances to the next page of values. If there was an error making 6997// the request the page does not advance and the error is returned. 6998func (page *IssueAttachmentCollectionPage) NextWithContext(ctx context.Context) (err error) { 6999 if tracing.IsEnabled() { 7000 ctx = tracing.StartSpan(ctx, fqdn+"/IssueAttachmentCollectionPage.NextWithContext") 7001 defer func() { 7002 sc := -1 7003 if page.Response().Response.Response != nil { 7004 sc = page.Response().Response.Response.StatusCode 7005 } 7006 tracing.EndSpan(ctx, sc, err) 7007 }() 7008 } 7009 for { 7010 next, err := page.fn(ctx, page.iac) 7011 if err != nil { 7012 return err 7013 } 7014 page.iac = next 7015 if !next.hasNextLink() || !next.IsEmpty() { 7016 break 7017 } 7018 } 7019 return nil 7020} 7021 7022// Next advances to the next page of values. If there was an error making 7023// the request the page does not advance and the error is returned. 7024// Deprecated: Use NextWithContext() instead. 7025func (page *IssueAttachmentCollectionPage) Next() error { 7026 return page.NextWithContext(context.Background()) 7027} 7028 7029// NotDone returns true if the page enumeration should be started or is not yet complete. 7030func (page IssueAttachmentCollectionPage) NotDone() bool { 7031 return !page.iac.IsEmpty() 7032} 7033 7034// Response returns the raw server response from the last page request. 7035func (page IssueAttachmentCollectionPage) Response() IssueAttachmentCollection { 7036 return page.iac 7037} 7038 7039// Values returns the slice of values for the current page or nil if there are no values. 7040func (page IssueAttachmentCollectionPage) Values() []IssueAttachmentContract { 7041 if page.iac.IsEmpty() { 7042 return nil 7043 } 7044 return *page.iac.Value 7045} 7046 7047// Creates a new instance of the IssueAttachmentCollectionPage type. 7048func NewIssueAttachmentCollectionPage(cur IssueAttachmentCollection, getNextPage func(context.Context, IssueAttachmentCollection) (IssueAttachmentCollection, error)) IssueAttachmentCollectionPage { 7049 return IssueAttachmentCollectionPage{ 7050 fn: getNextPage, 7051 iac: cur, 7052 } 7053} 7054 7055// IssueAttachmentContract issue Attachment Contract details. 7056type IssueAttachmentContract struct { 7057 autorest.Response `json:"-"` 7058 // IssueAttachmentContractProperties - Properties of the Issue Attachment. 7059 *IssueAttachmentContractProperties `json:"properties,omitempty"` 7060 // ID - READ-ONLY; Resource ID. 7061 ID *string `json:"id,omitempty"` 7062 // Name - READ-ONLY; Resource name. 7063 Name *string `json:"name,omitempty"` 7064 // Type - READ-ONLY; Resource type for API Management resource. 7065 Type *string `json:"type,omitempty"` 7066} 7067 7068// MarshalJSON is the custom marshaler for IssueAttachmentContract. 7069func (iac IssueAttachmentContract) MarshalJSON() ([]byte, error) { 7070 objectMap := make(map[string]interface{}) 7071 if iac.IssueAttachmentContractProperties != nil { 7072 objectMap["properties"] = iac.IssueAttachmentContractProperties 7073 } 7074 return json.Marshal(objectMap) 7075} 7076 7077// UnmarshalJSON is the custom unmarshaler for IssueAttachmentContract struct. 7078func (iac *IssueAttachmentContract) UnmarshalJSON(body []byte) error { 7079 var m map[string]*json.RawMessage 7080 err := json.Unmarshal(body, &m) 7081 if err != nil { 7082 return err 7083 } 7084 for k, v := range m { 7085 switch k { 7086 case "properties": 7087 if v != nil { 7088 var issueAttachmentContractProperties IssueAttachmentContractProperties 7089 err = json.Unmarshal(*v, &issueAttachmentContractProperties) 7090 if err != nil { 7091 return err 7092 } 7093 iac.IssueAttachmentContractProperties = &issueAttachmentContractProperties 7094 } 7095 case "id": 7096 if v != nil { 7097 var ID string 7098 err = json.Unmarshal(*v, &ID) 7099 if err != nil { 7100 return err 7101 } 7102 iac.ID = &ID 7103 } 7104 case "name": 7105 if v != nil { 7106 var name string 7107 err = json.Unmarshal(*v, &name) 7108 if err != nil { 7109 return err 7110 } 7111 iac.Name = &name 7112 } 7113 case "type": 7114 if v != nil { 7115 var typeVar string 7116 err = json.Unmarshal(*v, &typeVar) 7117 if err != nil { 7118 return err 7119 } 7120 iac.Type = &typeVar 7121 } 7122 } 7123 } 7124 7125 return nil 7126} 7127 7128// IssueAttachmentContractProperties issue Attachment contract Properties. 7129type IssueAttachmentContractProperties struct { 7130 // Title - Filename by which the binary data will be saved. 7131 Title *string `json:"title,omitempty"` 7132 // ContentFormat - Either 'link' if content is provided via an HTTP link or the MIME type of the Base64-encoded binary data provided in the 'content' property. 7133 ContentFormat *string `json:"contentFormat,omitempty"` 7134 // Content - An HTTP link or Base64-encoded binary data. 7135 Content *string `json:"content,omitempty"` 7136} 7137 7138// IssueCollection paged Issue list representation. 7139type IssueCollection struct { 7140 autorest.Response `json:"-"` 7141 // Value - READ-ONLY; Issue values. 7142 Value *[]IssueContract `json:"value,omitempty"` 7143 // Count - Total record count number across all pages. 7144 Count *int64 `json:"count,omitempty"` 7145 // NextLink - READ-ONLY; Next page link if any. 7146 NextLink *string `json:"nextLink,omitempty"` 7147} 7148 7149// MarshalJSON is the custom marshaler for IssueCollection. 7150func (ic IssueCollection) MarshalJSON() ([]byte, error) { 7151 objectMap := make(map[string]interface{}) 7152 if ic.Count != nil { 7153 objectMap["count"] = ic.Count 7154 } 7155 return json.Marshal(objectMap) 7156} 7157 7158// IssueCollectionIterator provides access to a complete listing of IssueContract values. 7159type IssueCollectionIterator struct { 7160 i int 7161 page IssueCollectionPage 7162} 7163 7164// NextWithContext advances to the next value. If there was an error making 7165// the request the iterator does not advance and the error is returned. 7166func (iter *IssueCollectionIterator) NextWithContext(ctx context.Context) (err error) { 7167 if tracing.IsEnabled() { 7168 ctx = tracing.StartSpan(ctx, fqdn+"/IssueCollectionIterator.NextWithContext") 7169 defer func() { 7170 sc := -1 7171 if iter.Response().Response.Response != nil { 7172 sc = iter.Response().Response.Response.StatusCode 7173 } 7174 tracing.EndSpan(ctx, sc, err) 7175 }() 7176 } 7177 iter.i++ 7178 if iter.i < len(iter.page.Values()) { 7179 return nil 7180 } 7181 err = iter.page.NextWithContext(ctx) 7182 if err != nil { 7183 iter.i-- 7184 return err 7185 } 7186 iter.i = 0 7187 return nil 7188} 7189 7190// Next advances to the next value. If there was an error making 7191// the request the iterator does not advance and the error is returned. 7192// Deprecated: Use NextWithContext() instead. 7193func (iter *IssueCollectionIterator) Next() error { 7194 return iter.NextWithContext(context.Background()) 7195} 7196 7197// NotDone returns true if the enumeration should be started or is not yet complete. 7198func (iter IssueCollectionIterator) NotDone() bool { 7199 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 7200} 7201 7202// Response returns the raw server response from the last page request. 7203func (iter IssueCollectionIterator) Response() IssueCollection { 7204 return iter.page.Response() 7205} 7206 7207// Value returns the current value or a zero-initialized value if the 7208// iterator has advanced beyond the end of the collection. 7209func (iter IssueCollectionIterator) Value() IssueContract { 7210 if !iter.page.NotDone() { 7211 return IssueContract{} 7212 } 7213 return iter.page.Values()[iter.i] 7214} 7215 7216// Creates a new instance of the IssueCollectionIterator type. 7217func NewIssueCollectionIterator(page IssueCollectionPage) IssueCollectionIterator { 7218 return IssueCollectionIterator{page: page} 7219} 7220 7221// IsEmpty returns true if the ListResult contains no values. 7222func (ic IssueCollection) IsEmpty() bool { 7223 return ic.Value == nil || len(*ic.Value) == 0 7224} 7225 7226// hasNextLink returns true if the NextLink is not empty. 7227func (ic IssueCollection) hasNextLink() bool { 7228 return ic.NextLink != nil && len(*ic.NextLink) != 0 7229} 7230 7231// issueCollectionPreparer prepares a request to retrieve the next set of results. 7232// It returns nil if no more results exist. 7233func (ic IssueCollection) issueCollectionPreparer(ctx context.Context) (*http.Request, error) { 7234 if !ic.hasNextLink() { 7235 return nil, nil 7236 } 7237 return autorest.Prepare((&http.Request{}).WithContext(ctx), 7238 autorest.AsJSON(), 7239 autorest.AsGet(), 7240 autorest.WithBaseURL(to.String(ic.NextLink))) 7241} 7242 7243// IssueCollectionPage contains a page of IssueContract values. 7244type IssueCollectionPage struct { 7245 fn func(context.Context, IssueCollection) (IssueCollection, error) 7246 ic IssueCollection 7247} 7248 7249// NextWithContext advances to the next page of values. If there was an error making 7250// the request the page does not advance and the error is returned. 7251func (page *IssueCollectionPage) NextWithContext(ctx context.Context) (err error) { 7252 if tracing.IsEnabled() { 7253 ctx = tracing.StartSpan(ctx, fqdn+"/IssueCollectionPage.NextWithContext") 7254 defer func() { 7255 sc := -1 7256 if page.Response().Response.Response != nil { 7257 sc = page.Response().Response.Response.StatusCode 7258 } 7259 tracing.EndSpan(ctx, sc, err) 7260 }() 7261 } 7262 for { 7263 next, err := page.fn(ctx, page.ic) 7264 if err != nil { 7265 return err 7266 } 7267 page.ic = next 7268 if !next.hasNextLink() || !next.IsEmpty() { 7269 break 7270 } 7271 } 7272 return nil 7273} 7274 7275// Next advances to the next page of values. If there was an error making 7276// the request the page does not advance and the error is returned. 7277// Deprecated: Use NextWithContext() instead. 7278func (page *IssueCollectionPage) Next() error { 7279 return page.NextWithContext(context.Background()) 7280} 7281 7282// NotDone returns true if the page enumeration should be started or is not yet complete. 7283func (page IssueCollectionPage) NotDone() bool { 7284 return !page.ic.IsEmpty() 7285} 7286 7287// Response returns the raw server response from the last page request. 7288func (page IssueCollectionPage) Response() IssueCollection { 7289 return page.ic 7290} 7291 7292// Values returns the slice of values for the current page or nil if there are no values. 7293func (page IssueCollectionPage) Values() []IssueContract { 7294 if page.ic.IsEmpty() { 7295 return nil 7296 } 7297 return *page.ic.Value 7298} 7299 7300// Creates a new instance of the IssueCollectionPage type. 7301func NewIssueCollectionPage(cur IssueCollection, getNextPage func(context.Context, IssueCollection) (IssueCollection, error)) IssueCollectionPage { 7302 return IssueCollectionPage{ 7303 fn: getNextPage, 7304 ic: cur, 7305 } 7306} 7307 7308// IssueCommentCollection paged Issue Comment list representation. 7309type IssueCommentCollection struct { 7310 autorest.Response `json:"-"` 7311 // Value - READ-ONLY; Issue Comment values. 7312 Value *[]IssueCommentContract `json:"value,omitempty"` 7313 // Count - Total record count number across all pages. 7314 Count *int64 `json:"count,omitempty"` 7315 // NextLink - READ-ONLY; Next page link if any. 7316 NextLink *string `json:"nextLink,omitempty"` 7317} 7318 7319// MarshalJSON is the custom marshaler for IssueCommentCollection. 7320func (icc IssueCommentCollection) MarshalJSON() ([]byte, error) { 7321 objectMap := make(map[string]interface{}) 7322 if icc.Count != nil { 7323 objectMap["count"] = icc.Count 7324 } 7325 return json.Marshal(objectMap) 7326} 7327 7328// IssueCommentCollectionIterator provides access to a complete listing of IssueCommentContract values. 7329type IssueCommentCollectionIterator struct { 7330 i int 7331 page IssueCommentCollectionPage 7332} 7333 7334// NextWithContext advances to the next value. If there was an error making 7335// the request the iterator does not advance and the error is returned. 7336func (iter *IssueCommentCollectionIterator) NextWithContext(ctx context.Context) (err error) { 7337 if tracing.IsEnabled() { 7338 ctx = tracing.StartSpan(ctx, fqdn+"/IssueCommentCollectionIterator.NextWithContext") 7339 defer func() { 7340 sc := -1 7341 if iter.Response().Response.Response != nil { 7342 sc = iter.Response().Response.Response.StatusCode 7343 } 7344 tracing.EndSpan(ctx, sc, err) 7345 }() 7346 } 7347 iter.i++ 7348 if iter.i < len(iter.page.Values()) { 7349 return nil 7350 } 7351 err = iter.page.NextWithContext(ctx) 7352 if err != nil { 7353 iter.i-- 7354 return err 7355 } 7356 iter.i = 0 7357 return nil 7358} 7359 7360// Next advances to the next value. If there was an error making 7361// the request the iterator does not advance and the error is returned. 7362// Deprecated: Use NextWithContext() instead. 7363func (iter *IssueCommentCollectionIterator) Next() error { 7364 return iter.NextWithContext(context.Background()) 7365} 7366 7367// NotDone returns true if the enumeration should be started or is not yet complete. 7368func (iter IssueCommentCollectionIterator) NotDone() bool { 7369 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 7370} 7371 7372// Response returns the raw server response from the last page request. 7373func (iter IssueCommentCollectionIterator) Response() IssueCommentCollection { 7374 return iter.page.Response() 7375} 7376 7377// Value returns the current value or a zero-initialized value if the 7378// iterator has advanced beyond the end of the collection. 7379func (iter IssueCommentCollectionIterator) Value() IssueCommentContract { 7380 if !iter.page.NotDone() { 7381 return IssueCommentContract{} 7382 } 7383 return iter.page.Values()[iter.i] 7384} 7385 7386// Creates a new instance of the IssueCommentCollectionIterator type. 7387func NewIssueCommentCollectionIterator(page IssueCommentCollectionPage) IssueCommentCollectionIterator { 7388 return IssueCommentCollectionIterator{page: page} 7389} 7390 7391// IsEmpty returns true if the ListResult contains no values. 7392func (icc IssueCommentCollection) IsEmpty() bool { 7393 return icc.Value == nil || len(*icc.Value) == 0 7394} 7395 7396// hasNextLink returns true if the NextLink is not empty. 7397func (icc IssueCommentCollection) hasNextLink() bool { 7398 return icc.NextLink != nil && len(*icc.NextLink) != 0 7399} 7400 7401// issueCommentCollectionPreparer prepares a request to retrieve the next set of results. 7402// It returns nil if no more results exist. 7403func (icc IssueCommentCollection) issueCommentCollectionPreparer(ctx context.Context) (*http.Request, error) { 7404 if !icc.hasNextLink() { 7405 return nil, nil 7406 } 7407 return autorest.Prepare((&http.Request{}).WithContext(ctx), 7408 autorest.AsJSON(), 7409 autorest.AsGet(), 7410 autorest.WithBaseURL(to.String(icc.NextLink))) 7411} 7412 7413// IssueCommentCollectionPage contains a page of IssueCommentContract values. 7414type IssueCommentCollectionPage struct { 7415 fn func(context.Context, IssueCommentCollection) (IssueCommentCollection, error) 7416 icc IssueCommentCollection 7417} 7418 7419// NextWithContext advances to the next page of values. If there was an error making 7420// the request the page does not advance and the error is returned. 7421func (page *IssueCommentCollectionPage) NextWithContext(ctx context.Context) (err error) { 7422 if tracing.IsEnabled() { 7423 ctx = tracing.StartSpan(ctx, fqdn+"/IssueCommentCollectionPage.NextWithContext") 7424 defer func() { 7425 sc := -1 7426 if page.Response().Response.Response != nil { 7427 sc = page.Response().Response.Response.StatusCode 7428 } 7429 tracing.EndSpan(ctx, sc, err) 7430 }() 7431 } 7432 for { 7433 next, err := page.fn(ctx, page.icc) 7434 if err != nil { 7435 return err 7436 } 7437 page.icc = next 7438 if !next.hasNextLink() || !next.IsEmpty() { 7439 break 7440 } 7441 } 7442 return nil 7443} 7444 7445// Next advances to the next page of values. If there was an error making 7446// the request the page does not advance and the error is returned. 7447// Deprecated: Use NextWithContext() instead. 7448func (page *IssueCommentCollectionPage) Next() error { 7449 return page.NextWithContext(context.Background()) 7450} 7451 7452// NotDone returns true if the page enumeration should be started or is not yet complete. 7453func (page IssueCommentCollectionPage) NotDone() bool { 7454 return !page.icc.IsEmpty() 7455} 7456 7457// Response returns the raw server response from the last page request. 7458func (page IssueCommentCollectionPage) Response() IssueCommentCollection { 7459 return page.icc 7460} 7461 7462// Values returns the slice of values for the current page or nil if there are no values. 7463func (page IssueCommentCollectionPage) Values() []IssueCommentContract { 7464 if page.icc.IsEmpty() { 7465 return nil 7466 } 7467 return *page.icc.Value 7468} 7469 7470// Creates a new instance of the IssueCommentCollectionPage type. 7471func NewIssueCommentCollectionPage(cur IssueCommentCollection, getNextPage func(context.Context, IssueCommentCollection) (IssueCommentCollection, error)) IssueCommentCollectionPage { 7472 return IssueCommentCollectionPage{ 7473 fn: getNextPage, 7474 icc: cur, 7475 } 7476} 7477 7478// IssueCommentContract issue Comment Contract details. 7479type IssueCommentContract struct { 7480 autorest.Response `json:"-"` 7481 // IssueCommentContractProperties - Properties of the Issue Comment. 7482 *IssueCommentContractProperties `json:"properties,omitempty"` 7483 // ID - READ-ONLY; Resource ID. 7484 ID *string `json:"id,omitempty"` 7485 // Name - READ-ONLY; Resource name. 7486 Name *string `json:"name,omitempty"` 7487 // Type - READ-ONLY; Resource type for API Management resource. 7488 Type *string `json:"type,omitempty"` 7489} 7490 7491// MarshalJSON is the custom marshaler for IssueCommentContract. 7492func (icc IssueCommentContract) MarshalJSON() ([]byte, error) { 7493 objectMap := make(map[string]interface{}) 7494 if icc.IssueCommentContractProperties != nil { 7495 objectMap["properties"] = icc.IssueCommentContractProperties 7496 } 7497 return json.Marshal(objectMap) 7498} 7499 7500// UnmarshalJSON is the custom unmarshaler for IssueCommentContract struct. 7501func (icc *IssueCommentContract) UnmarshalJSON(body []byte) error { 7502 var m map[string]*json.RawMessage 7503 err := json.Unmarshal(body, &m) 7504 if err != nil { 7505 return err 7506 } 7507 for k, v := range m { 7508 switch k { 7509 case "properties": 7510 if v != nil { 7511 var issueCommentContractProperties IssueCommentContractProperties 7512 err = json.Unmarshal(*v, &issueCommentContractProperties) 7513 if err != nil { 7514 return err 7515 } 7516 icc.IssueCommentContractProperties = &issueCommentContractProperties 7517 } 7518 case "id": 7519 if v != nil { 7520 var ID string 7521 err = json.Unmarshal(*v, &ID) 7522 if err != nil { 7523 return err 7524 } 7525 icc.ID = &ID 7526 } 7527 case "name": 7528 if v != nil { 7529 var name string 7530 err = json.Unmarshal(*v, &name) 7531 if err != nil { 7532 return err 7533 } 7534 icc.Name = &name 7535 } 7536 case "type": 7537 if v != nil { 7538 var typeVar string 7539 err = json.Unmarshal(*v, &typeVar) 7540 if err != nil { 7541 return err 7542 } 7543 icc.Type = &typeVar 7544 } 7545 } 7546 } 7547 7548 return nil 7549} 7550 7551// IssueCommentContractProperties issue Comment contract Properties. 7552type IssueCommentContractProperties struct { 7553 // Text - Comment text. 7554 Text *string `json:"text,omitempty"` 7555 // CreatedDate - Date and time when the comment was created. 7556 CreatedDate *date.Time `json:"createdDate,omitempty"` 7557 // UserID - A resource identifier for the user who left the comment. 7558 UserID *string `json:"userId,omitempty"` 7559} 7560 7561// IssueContract issue Contract details. 7562type IssueContract struct { 7563 autorest.Response `json:"-"` 7564 // IssueContractProperties - Properties of the Issue. 7565 *IssueContractProperties `json:"properties,omitempty"` 7566 // ID - READ-ONLY; Resource ID. 7567 ID *string `json:"id,omitempty"` 7568 // Name - READ-ONLY; Resource name. 7569 Name *string `json:"name,omitempty"` 7570 // Type - READ-ONLY; Resource type for API Management resource. 7571 Type *string `json:"type,omitempty"` 7572} 7573 7574// MarshalJSON is the custom marshaler for IssueContract. 7575func (ic IssueContract) MarshalJSON() ([]byte, error) { 7576 objectMap := make(map[string]interface{}) 7577 if ic.IssueContractProperties != nil { 7578 objectMap["properties"] = ic.IssueContractProperties 7579 } 7580 return json.Marshal(objectMap) 7581} 7582 7583// UnmarshalJSON is the custom unmarshaler for IssueContract struct. 7584func (ic *IssueContract) UnmarshalJSON(body []byte) error { 7585 var m map[string]*json.RawMessage 7586 err := json.Unmarshal(body, &m) 7587 if err != nil { 7588 return err 7589 } 7590 for k, v := range m { 7591 switch k { 7592 case "properties": 7593 if v != nil { 7594 var issueContractProperties IssueContractProperties 7595 err = json.Unmarshal(*v, &issueContractProperties) 7596 if err != nil { 7597 return err 7598 } 7599 ic.IssueContractProperties = &issueContractProperties 7600 } 7601 case "id": 7602 if v != nil { 7603 var ID string 7604 err = json.Unmarshal(*v, &ID) 7605 if err != nil { 7606 return err 7607 } 7608 ic.ID = &ID 7609 } 7610 case "name": 7611 if v != nil { 7612 var name string 7613 err = json.Unmarshal(*v, &name) 7614 if err != nil { 7615 return err 7616 } 7617 ic.Name = &name 7618 } 7619 case "type": 7620 if v != nil { 7621 var typeVar string 7622 err = json.Unmarshal(*v, &typeVar) 7623 if err != nil { 7624 return err 7625 } 7626 ic.Type = &typeVar 7627 } 7628 } 7629 } 7630 7631 return nil 7632} 7633 7634// IssueContractBaseProperties issue contract Base Properties. 7635type IssueContractBaseProperties struct { 7636 // CreatedDate - Date and time when the issue was created. 7637 CreatedDate *date.Time `json:"createdDate,omitempty"` 7638 // State - Status of the issue. Possible values include: 'Proposed', 'Open', 'Removed', 'Resolved', 'Closed' 7639 State State `json:"state,omitempty"` 7640 // APIID - A resource identifier for the API the issue was created for. 7641 APIID *string `json:"apiId,omitempty"` 7642} 7643 7644// IssueContractProperties issue contract Properties. 7645type IssueContractProperties struct { 7646 // Title - The issue title. 7647 Title *string `json:"title,omitempty"` 7648 // Description - Text describing the issue. 7649 Description *string `json:"description,omitempty"` 7650 // UserID - A resource identifier for the user created the issue. 7651 UserID *string `json:"userId,omitempty"` 7652 // CreatedDate - Date and time when the issue was created. 7653 CreatedDate *date.Time `json:"createdDate,omitempty"` 7654 // State - Status of the issue. Possible values include: 'Proposed', 'Open', 'Removed', 'Resolved', 'Closed' 7655 State State `json:"state,omitempty"` 7656 // APIID - A resource identifier for the API the issue was created for. 7657 APIID *string `json:"apiId,omitempty"` 7658} 7659 7660// IssueUpdateContract issue update Parameters. 7661type IssueUpdateContract struct { 7662 // IssueUpdateContractProperties - Issue entity Update contract properties. 7663 *IssueUpdateContractProperties `json:"properties,omitempty"` 7664} 7665 7666// MarshalJSON is the custom marshaler for IssueUpdateContract. 7667func (iuc IssueUpdateContract) MarshalJSON() ([]byte, error) { 7668 objectMap := make(map[string]interface{}) 7669 if iuc.IssueUpdateContractProperties != nil { 7670 objectMap["properties"] = iuc.IssueUpdateContractProperties 7671 } 7672 return json.Marshal(objectMap) 7673} 7674 7675// UnmarshalJSON is the custom unmarshaler for IssueUpdateContract struct. 7676func (iuc *IssueUpdateContract) UnmarshalJSON(body []byte) error { 7677 var m map[string]*json.RawMessage 7678 err := json.Unmarshal(body, &m) 7679 if err != nil { 7680 return err 7681 } 7682 for k, v := range m { 7683 switch k { 7684 case "properties": 7685 if v != nil { 7686 var issueUpdateContractProperties IssueUpdateContractProperties 7687 err = json.Unmarshal(*v, &issueUpdateContractProperties) 7688 if err != nil { 7689 return err 7690 } 7691 iuc.IssueUpdateContractProperties = &issueUpdateContractProperties 7692 } 7693 } 7694 } 7695 7696 return nil 7697} 7698 7699// IssueUpdateContractProperties issue contract Update Properties. 7700type IssueUpdateContractProperties struct { 7701 // Title - The issue title. 7702 Title *string `json:"title,omitempty"` 7703 // Description - Text describing the issue. 7704 Description *string `json:"description,omitempty"` 7705 // UserID - A resource identifier for the user created the issue. 7706 UserID *string `json:"userId,omitempty"` 7707 // CreatedDate - Date and time when the issue was created. 7708 CreatedDate *date.Time `json:"createdDate,omitempty"` 7709 // State - Status of the issue. Possible values include: 'Proposed', 'Open', 'Removed', 'Resolved', 'Closed' 7710 State State `json:"state,omitempty"` 7711 // APIID - A resource identifier for the API the issue was created for. 7712 APIID *string `json:"apiId,omitempty"` 7713} 7714 7715// KeyVaultContractCreateProperties create keyVault contract details. 7716type KeyVaultContractCreateProperties struct { 7717 // SecretIdentifier - Key vault secret identifier for fetching secret. Providing a versioned secret will prevent auto-refresh. This requires Api Management service to be configured with aka.ms/apimmsi 7718 SecretIdentifier *string `json:"secretIdentifier,omitempty"` 7719 // IdentityClientID - SystemAssignedIdentity or UserAssignedIdentity Client Id which will be used to access key vault secret. 7720 IdentityClientID *string `json:"identityClientId,omitempty"` 7721} 7722 7723// KeyVaultContractProperties keyVault contract details. 7724type KeyVaultContractProperties struct { 7725 // LastStatus - Last time sync and refresh status of secret from key vault. 7726 LastStatus *KeyVaultLastAccessStatusContractProperties `json:"lastStatus,omitempty"` 7727 // SecretIdentifier - Key vault secret identifier for fetching secret. Providing a versioned secret will prevent auto-refresh. This requires Api Management service to be configured with aka.ms/apimmsi 7728 SecretIdentifier *string `json:"secretIdentifier,omitempty"` 7729 // IdentityClientID - SystemAssignedIdentity or UserAssignedIdentity Client Id which will be used to access key vault secret. 7730 IdentityClientID *string `json:"identityClientId,omitempty"` 7731} 7732 7733// KeyVaultLastAccessStatusContractProperties issue contract Update Properties. 7734type KeyVaultLastAccessStatusContractProperties struct { 7735 // Code - Last status code for sync and refresh of secret from key vault. 7736 Code *string `json:"code,omitempty"` 7737 // Message - Details of the error else empty. 7738 Message *string `json:"message,omitempty"` 7739 // TimeStampUtc - Last time secret was accessed. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. 7740 TimeStampUtc *date.Time `json:"timeStampUtc,omitempty"` 7741} 7742 7743// ListNetworkStatusContractByLocation ... 7744type ListNetworkStatusContractByLocation struct { 7745 autorest.Response `json:"-"` 7746 Value *[]NetworkStatusContractByLocation `json:"value,omitempty"` 7747} 7748 7749// LoggerCollection paged Logger list representation. 7750type LoggerCollection struct { 7751 autorest.Response `json:"-"` 7752 // Value - Logger values. 7753 Value *[]LoggerContract `json:"value,omitempty"` 7754 // Count - Total record count number across all pages. 7755 Count *int64 `json:"count,omitempty"` 7756 // NextLink - Next page link if any. 7757 NextLink *string `json:"nextLink,omitempty"` 7758} 7759 7760// LoggerCollectionIterator provides access to a complete listing of LoggerContract values. 7761type LoggerCollectionIterator struct { 7762 i int 7763 page LoggerCollectionPage 7764} 7765 7766// NextWithContext advances to the next value. If there was an error making 7767// the request the iterator does not advance and the error is returned. 7768func (iter *LoggerCollectionIterator) NextWithContext(ctx context.Context) (err error) { 7769 if tracing.IsEnabled() { 7770 ctx = tracing.StartSpan(ctx, fqdn+"/LoggerCollectionIterator.NextWithContext") 7771 defer func() { 7772 sc := -1 7773 if iter.Response().Response.Response != nil { 7774 sc = iter.Response().Response.Response.StatusCode 7775 } 7776 tracing.EndSpan(ctx, sc, err) 7777 }() 7778 } 7779 iter.i++ 7780 if iter.i < len(iter.page.Values()) { 7781 return nil 7782 } 7783 err = iter.page.NextWithContext(ctx) 7784 if err != nil { 7785 iter.i-- 7786 return err 7787 } 7788 iter.i = 0 7789 return nil 7790} 7791 7792// Next advances to the next value. If there was an error making 7793// the request the iterator does not advance and the error is returned. 7794// Deprecated: Use NextWithContext() instead. 7795func (iter *LoggerCollectionIterator) Next() error { 7796 return iter.NextWithContext(context.Background()) 7797} 7798 7799// NotDone returns true if the enumeration should be started or is not yet complete. 7800func (iter LoggerCollectionIterator) NotDone() bool { 7801 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 7802} 7803 7804// Response returns the raw server response from the last page request. 7805func (iter LoggerCollectionIterator) Response() LoggerCollection { 7806 return iter.page.Response() 7807} 7808 7809// Value returns the current value or a zero-initialized value if the 7810// iterator has advanced beyond the end of the collection. 7811func (iter LoggerCollectionIterator) Value() LoggerContract { 7812 if !iter.page.NotDone() { 7813 return LoggerContract{} 7814 } 7815 return iter.page.Values()[iter.i] 7816} 7817 7818// Creates a new instance of the LoggerCollectionIterator type. 7819func NewLoggerCollectionIterator(page LoggerCollectionPage) LoggerCollectionIterator { 7820 return LoggerCollectionIterator{page: page} 7821} 7822 7823// IsEmpty returns true if the ListResult contains no values. 7824func (lc LoggerCollection) IsEmpty() bool { 7825 return lc.Value == nil || len(*lc.Value) == 0 7826} 7827 7828// hasNextLink returns true if the NextLink is not empty. 7829func (lc LoggerCollection) hasNextLink() bool { 7830 return lc.NextLink != nil && len(*lc.NextLink) != 0 7831} 7832 7833// loggerCollectionPreparer prepares a request to retrieve the next set of results. 7834// It returns nil if no more results exist. 7835func (lc LoggerCollection) loggerCollectionPreparer(ctx context.Context) (*http.Request, error) { 7836 if !lc.hasNextLink() { 7837 return nil, nil 7838 } 7839 return autorest.Prepare((&http.Request{}).WithContext(ctx), 7840 autorest.AsJSON(), 7841 autorest.AsGet(), 7842 autorest.WithBaseURL(to.String(lc.NextLink))) 7843} 7844 7845// LoggerCollectionPage contains a page of LoggerContract values. 7846type LoggerCollectionPage struct { 7847 fn func(context.Context, LoggerCollection) (LoggerCollection, error) 7848 lc LoggerCollection 7849} 7850 7851// NextWithContext advances to the next page of values. If there was an error making 7852// the request the page does not advance and the error is returned. 7853func (page *LoggerCollectionPage) NextWithContext(ctx context.Context) (err error) { 7854 if tracing.IsEnabled() { 7855 ctx = tracing.StartSpan(ctx, fqdn+"/LoggerCollectionPage.NextWithContext") 7856 defer func() { 7857 sc := -1 7858 if page.Response().Response.Response != nil { 7859 sc = page.Response().Response.Response.StatusCode 7860 } 7861 tracing.EndSpan(ctx, sc, err) 7862 }() 7863 } 7864 for { 7865 next, err := page.fn(ctx, page.lc) 7866 if err != nil { 7867 return err 7868 } 7869 page.lc = next 7870 if !next.hasNextLink() || !next.IsEmpty() { 7871 break 7872 } 7873 } 7874 return nil 7875} 7876 7877// Next advances to the next page of values. If there was an error making 7878// the request the page does not advance and the error is returned. 7879// Deprecated: Use NextWithContext() instead. 7880func (page *LoggerCollectionPage) Next() error { 7881 return page.NextWithContext(context.Background()) 7882} 7883 7884// NotDone returns true if the page enumeration should be started or is not yet complete. 7885func (page LoggerCollectionPage) NotDone() bool { 7886 return !page.lc.IsEmpty() 7887} 7888 7889// Response returns the raw server response from the last page request. 7890func (page LoggerCollectionPage) Response() LoggerCollection { 7891 return page.lc 7892} 7893 7894// Values returns the slice of values for the current page or nil if there are no values. 7895func (page LoggerCollectionPage) Values() []LoggerContract { 7896 if page.lc.IsEmpty() { 7897 return nil 7898 } 7899 return *page.lc.Value 7900} 7901 7902// Creates a new instance of the LoggerCollectionPage type. 7903func NewLoggerCollectionPage(cur LoggerCollection, getNextPage func(context.Context, LoggerCollection) (LoggerCollection, error)) LoggerCollectionPage { 7904 return LoggerCollectionPage{ 7905 fn: getNextPage, 7906 lc: cur, 7907 } 7908} 7909 7910// LoggerContract logger details. 7911type LoggerContract struct { 7912 autorest.Response `json:"-"` 7913 // LoggerContractProperties - Logger entity contract properties. 7914 *LoggerContractProperties `json:"properties,omitempty"` 7915 // ID - READ-ONLY; Resource ID. 7916 ID *string `json:"id,omitempty"` 7917 // Name - READ-ONLY; Resource name. 7918 Name *string `json:"name,omitempty"` 7919 // Type - READ-ONLY; Resource type for API Management resource. 7920 Type *string `json:"type,omitempty"` 7921} 7922 7923// MarshalJSON is the custom marshaler for LoggerContract. 7924func (lc LoggerContract) MarshalJSON() ([]byte, error) { 7925 objectMap := make(map[string]interface{}) 7926 if lc.LoggerContractProperties != nil { 7927 objectMap["properties"] = lc.LoggerContractProperties 7928 } 7929 return json.Marshal(objectMap) 7930} 7931 7932// UnmarshalJSON is the custom unmarshaler for LoggerContract struct. 7933func (lc *LoggerContract) UnmarshalJSON(body []byte) error { 7934 var m map[string]*json.RawMessage 7935 err := json.Unmarshal(body, &m) 7936 if err != nil { 7937 return err 7938 } 7939 for k, v := range m { 7940 switch k { 7941 case "properties": 7942 if v != nil { 7943 var loggerContractProperties LoggerContractProperties 7944 err = json.Unmarshal(*v, &loggerContractProperties) 7945 if err != nil { 7946 return err 7947 } 7948 lc.LoggerContractProperties = &loggerContractProperties 7949 } 7950 case "id": 7951 if v != nil { 7952 var ID string 7953 err = json.Unmarshal(*v, &ID) 7954 if err != nil { 7955 return err 7956 } 7957 lc.ID = &ID 7958 } 7959 case "name": 7960 if v != nil { 7961 var name string 7962 err = json.Unmarshal(*v, &name) 7963 if err != nil { 7964 return err 7965 } 7966 lc.Name = &name 7967 } 7968 case "type": 7969 if v != nil { 7970 var typeVar string 7971 err = json.Unmarshal(*v, &typeVar) 7972 if err != nil { 7973 return err 7974 } 7975 lc.Type = &typeVar 7976 } 7977 } 7978 } 7979 7980 return nil 7981} 7982 7983// LoggerContractProperties the Logger entity in API Management represents an event sink that you can use 7984// to log API Management events. Currently the Logger entity supports logging API Management events to 7985// Azure Event Hubs. 7986type LoggerContractProperties struct { 7987 // LoggerType - Logger type. Possible values include: 'AzureEventHub', 'ApplicationInsights', 'AzureMonitor' 7988 LoggerType LoggerType `json:"loggerType,omitempty"` 7989 // Description - Logger description. 7990 Description *string `json:"description,omitempty"` 7991 // Credentials - The name and SendRule connection string of the event hub for azureEventHub logger. 7992 // Instrumentation key for applicationInsights logger. 7993 Credentials map[string]*string `json:"credentials"` 7994 // IsBuffered - Whether records are buffered in the logger before publishing. Default is assumed to be true. 7995 IsBuffered *bool `json:"isBuffered,omitempty"` 7996 // ResourceID - Azure Resource Id of a log target (either Azure Event Hub resource or Azure Application Insights resource). 7997 ResourceID *string `json:"resourceId,omitempty"` 7998} 7999 8000// MarshalJSON is the custom marshaler for LoggerContractProperties. 8001func (lcp LoggerContractProperties) MarshalJSON() ([]byte, error) { 8002 objectMap := make(map[string]interface{}) 8003 if lcp.LoggerType != "" { 8004 objectMap["loggerType"] = lcp.LoggerType 8005 } 8006 if lcp.Description != nil { 8007 objectMap["description"] = lcp.Description 8008 } 8009 if lcp.Credentials != nil { 8010 objectMap["credentials"] = lcp.Credentials 8011 } 8012 if lcp.IsBuffered != nil { 8013 objectMap["isBuffered"] = lcp.IsBuffered 8014 } 8015 if lcp.ResourceID != nil { 8016 objectMap["resourceId"] = lcp.ResourceID 8017 } 8018 return json.Marshal(objectMap) 8019} 8020 8021// LoggerUpdateContract logger update contract. 8022type LoggerUpdateContract struct { 8023 // LoggerUpdateParameters - Logger entity update contract properties. 8024 *LoggerUpdateParameters `json:"properties,omitempty"` 8025} 8026 8027// MarshalJSON is the custom marshaler for LoggerUpdateContract. 8028func (luc LoggerUpdateContract) MarshalJSON() ([]byte, error) { 8029 objectMap := make(map[string]interface{}) 8030 if luc.LoggerUpdateParameters != nil { 8031 objectMap["properties"] = luc.LoggerUpdateParameters 8032 } 8033 return json.Marshal(objectMap) 8034} 8035 8036// UnmarshalJSON is the custom unmarshaler for LoggerUpdateContract struct. 8037func (luc *LoggerUpdateContract) UnmarshalJSON(body []byte) error { 8038 var m map[string]*json.RawMessage 8039 err := json.Unmarshal(body, &m) 8040 if err != nil { 8041 return err 8042 } 8043 for k, v := range m { 8044 switch k { 8045 case "properties": 8046 if v != nil { 8047 var loggerUpdateParameters LoggerUpdateParameters 8048 err = json.Unmarshal(*v, &loggerUpdateParameters) 8049 if err != nil { 8050 return err 8051 } 8052 luc.LoggerUpdateParameters = &loggerUpdateParameters 8053 } 8054 } 8055 } 8056 8057 return nil 8058} 8059 8060// LoggerUpdateParameters parameters supplied to the Update Logger operation. 8061type LoggerUpdateParameters struct { 8062 // LoggerType - Logger type. Possible values include: 'AzureEventHub', 'ApplicationInsights', 'AzureMonitor' 8063 LoggerType LoggerType `json:"loggerType,omitempty"` 8064 // Description - Logger description. 8065 Description *string `json:"description,omitempty"` 8066 // Credentials - Logger credentials. 8067 Credentials map[string]*string `json:"credentials"` 8068 // IsBuffered - Whether records are buffered in the logger before publishing. Default is assumed to be true. 8069 IsBuffered *bool `json:"isBuffered,omitempty"` 8070} 8071 8072// MarshalJSON is the custom marshaler for LoggerUpdateParameters. 8073func (lup LoggerUpdateParameters) MarshalJSON() ([]byte, error) { 8074 objectMap := make(map[string]interface{}) 8075 if lup.LoggerType != "" { 8076 objectMap["loggerType"] = lup.LoggerType 8077 } 8078 if lup.Description != nil { 8079 objectMap["description"] = lup.Description 8080 } 8081 if lup.Credentials != nil { 8082 objectMap["credentials"] = lup.Credentials 8083 } 8084 if lup.IsBuffered != nil { 8085 objectMap["isBuffered"] = lup.IsBuffered 8086 } 8087 return json.Marshal(objectMap) 8088} 8089 8090// NamedValueCollection paged NamedValue list representation. 8091type NamedValueCollection struct { 8092 autorest.Response `json:"-"` 8093 // Value - Page values. 8094 Value *[]NamedValueContract `json:"value,omitempty"` 8095 // Count - Total record count number across all pages. 8096 Count *int64 `json:"count,omitempty"` 8097 // NextLink - Next page link if any. 8098 NextLink *string `json:"nextLink,omitempty"` 8099} 8100 8101// NamedValueCollectionIterator provides access to a complete listing of NamedValueContract values. 8102type NamedValueCollectionIterator struct { 8103 i int 8104 page NamedValueCollectionPage 8105} 8106 8107// NextWithContext advances to the next value. If there was an error making 8108// the request the iterator does not advance and the error is returned. 8109func (iter *NamedValueCollectionIterator) NextWithContext(ctx context.Context) (err error) { 8110 if tracing.IsEnabled() { 8111 ctx = tracing.StartSpan(ctx, fqdn+"/NamedValueCollectionIterator.NextWithContext") 8112 defer func() { 8113 sc := -1 8114 if iter.Response().Response.Response != nil { 8115 sc = iter.Response().Response.Response.StatusCode 8116 } 8117 tracing.EndSpan(ctx, sc, err) 8118 }() 8119 } 8120 iter.i++ 8121 if iter.i < len(iter.page.Values()) { 8122 return nil 8123 } 8124 err = iter.page.NextWithContext(ctx) 8125 if err != nil { 8126 iter.i-- 8127 return err 8128 } 8129 iter.i = 0 8130 return nil 8131} 8132 8133// Next advances to the next value. If there was an error making 8134// the request the iterator does not advance and the error is returned. 8135// Deprecated: Use NextWithContext() instead. 8136func (iter *NamedValueCollectionIterator) Next() error { 8137 return iter.NextWithContext(context.Background()) 8138} 8139 8140// NotDone returns true if the enumeration should be started or is not yet complete. 8141func (iter NamedValueCollectionIterator) NotDone() bool { 8142 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 8143} 8144 8145// Response returns the raw server response from the last page request. 8146func (iter NamedValueCollectionIterator) Response() NamedValueCollection { 8147 return iter.page.Response() 8148} 8149 8150// Value returns the current value or a zero-initialized value if the 8151// iterator has advanced beyond the end of the collection. 8152func (iter NamedValueCollectionIterator) Value() NamedValueContract { 8153 if !iter.page.NotDone() { 8154 return NamedValueContract{} 8155 } 8156 return iter.page.Values()[iter.i] 8157} 8158 8159// Creates a new instance of the NamedValueCollectionIterator type. 8160func NewNamedValueCollectionIterator(page NamedValueCollectionPage) NamedValueCollectionIterator { 8161 return NamedValueCollectionIterator{page: page} 8162} 8163 8164// IsEmpty returns true if the ListResult contains no values. 8165func (nvc NamedValueCollection) IsEmpty() bool { 8166 return nvc.Value == nil || len(*nvc.Value) == 0 8167} 8168 8169// hasNextLink returns true if the NextLink is not empty. 8170func (nvc NamedValueCollection) hasNextLink() bool { 8171 return nvc.NextLink != nil && len(*nvc.NextLink) != 0 8172} 8173 8174// namedValueCollectionPreparer prepares a request to retrieve the next set of results. 8175// It returns nil if no more results exist. 8176func (nvc NamedValueCollection) namedValueCollectionPreparer(ctx context.Context) (*http.Request, error) { 8177 if !nvc.hasNextLink() { 8178 return nil, nil 8179 } 8180 return autorest.Prepare((&http.Request{}).WithContext(ctx), 8181 autorest.AsJSON(), 8182 autorest.AsGet(), 8183 autorest.WithBaseURL(to.String(nvc.NextLink))) 8184} 8185 8186// NamedValueCollectionPage contains a page of NamedValueContract values. 8187type NamedValueCollectionPage struct { 8188 fn func(context.Context, NamedValueCollection) (NamedValueCollection, error) 8189 nvc NamedValueCollection 8190} 8191 8192// NextWithContext advances to the next page of values. If there was an error making 8193// the request the page does not advance and the error is returned. 8194func (page *NamedValueCollectionPage) NextWithContext(ctx context.Context) (err error) { 8195 if tracing.IsEnabled() { 8196 ctx = tracing.StartSpan(ctx, fqdn+"/NamedValueCollectionPage.NextWithContext") 8197 defer func() { 8198 sc := -1 8199 if page.Response().Response.Response != nil { 8200 sc = page.Response().Response.Response.StatusCode 8201 } 8202 tracing.EndSpan(ctx, sc, err) 8203 }() 8204 } 8205 for { 8206 next, err := page.fn(ctx, page.nvc) 8207 if err != nil { 8208 return err 8209 } 8210 page.nvc = next 8211 if !next.hasNextLink() || !next.IsEmpty() { 8212 break 8213 } 8214 } 8215 return nil 8216} 8217 8218// Next advances to the next page of values. If there was an error making 8219// the request the page does not advance and the error is returned. 8220// Deprecated: Use NextWithContext() instead. 8221func (page *NamedValueCollectionPage) Next() error { 8222 return page.NextWithContext(context.Background()) 8223} 8224 8225// NotDone returns true if the page enumeration should be started or is not yet complete. 8226func (page NamedValueCollectionPage) NotDone() bool { 8227 return !page.nvc.IsEmpty() 8228} 8229 8230// Response returns the raw server response from the last page request. 8231func (page NamedValueCollectionPage) Response() NamedValueCollection { 8232 return page.nvc 8233} 8234 8235// Values returns the slice of values for the current page or nil if there are no values. 8236func (page NamedValueCollectionPage) Values() []NamedValueContract { 8237 if page.nvc.IsEmpty() { 8238 return nil 8239 } 8240 return *page.nvc.Value 8241} 8242 8243// Creates a new instance of the NamedValueCollectionPage type. 8244func NewNamedValueCollectionPage(cur NamedValueCollection, getNextPage func(context.Context, NamedValueCollection) (NamedValueCollection, error)) NamedValueCollectionPage { 8245 return NamedValueCollectionPage{ 8246 fn: getNextPage, 8247 nvc: cur, 8248 } 8249} 8250 8251// NamedValueContract namedValue details. 8252type NamedValueContract struct { 8253 autorest.Response `json:"-"` 8254 // NamedValueContractProperties - NamedValue entity contract properties. 8255 *NamedValueContractProperties `json:"properties,omitempty"` 8256 // ID - READ-ONLY; Resource ID. 8257 ID *string `json:"id,omitempty"` 8258 // Name - READ-ONLY; Resource name. 8259 Name *string `json:"name,omitempty"` 8260 // Type - READ-ONLY; Resource type for API Management resource. 8261 Type *string `json:"type,omitempty"` 8262} 8263 8264// MarshalJSON is the custom marshaler for NamedValueContract. 8265func (nvc NamedValueContract) MarshalJSON() ([]byte, error) { 8266 objectMap := make(map[string]interface{}) 8267 if nvc.NamedValueContractProperties != nil { 8268 objectMap["properties"] = nvc.NamedValueContractProperties 8269 } 8270 return json.Marshal(objectMap) 8271} 8272 8273// UnmarshalJSON is the custom unmarshaler for NamedValueContract struct. 8274func (nvc *NamedValueContract) UnmarshalJSON(body []byte) error { 8275 var m map[string]*json.RawMessage 8276 err := json.Unmarshal(body, &m) 8277 if err != nil { 8278 return err 8279 } 8280 for k, v := range m { 8281 switch k { 8282 case "properties": 8283 if v != nil { 8284 var namedValueContractProperties NamedValueContractProperties 8285 err = json.Unmarshal(*v, &namedValueContractProperties) 8286 if err != nil { 8287 return err 8288 } 8289 nvc.NamedValueContractProperties = &namedValueContractProperties 8290 } 8291 case "id": 8292 if v != nil { 8293 var ID string 8294 err = json.Unmarshal(*v, &ID) 8295 if err != nil { 8296 return err 8297 } 8298 nvc.ID = &ID 8299 } 8300 case "name": 8301 if v != nil { 8302 var name string 8303 err = json.Unmarshal(*v, &name) 8304 if err != nil { 8305 return err 8306 } 8307 nvc.Name = &name 8308 } 8309 case "type": 8310 if v != nil { 8311 var typeVar string 8312 err = json.Unmarshal(*v, &typeVar) 8313 if err != nil { 8314 return err 8315 } 8316 nvc.Type = &typeVar 8317 } 8318 } 8319 } 8320 8321 return nil 8322} 8323 8324// NamedValueContractProperties namedValue Contract properties. 8325type NamedValueContractProperties struct { 8326 // DisplayName - Unique name of NamedValue. It may contain only letters, digits, period, dash, and underscore characters. 8327 DisplayName *string `json:"displayName,omitempty"` 8328 // Value - Value of the NamedValue. Can contain policy expressions. It may not be empty or consist only of whitespace. This property will not be filled on 'GET' operations! Use '/listSecrets' POST request to get the value. 8329 Value *string `json:"value,omitempty"` 8330 // KeyVault - KeyVault location details of the namedValue. 8331 KeyVault *KeyVaultContractProperties `json:"keyVault,omitempty"` 8332 // Tags - Optional tags that when provided can be used to filter the NamedValue list. 8333 Tags *[]string `json:"tags,omitempty"` 8334 // Secret - Determines whether the value is a secret and should be encrypted or not. Default value is false. 8335 Secret *bool `json:"secret,omitempty"` 8336} 8337 8338// NamedValueCreateContract namedValue details. 8339type NamedValueCreateContract struct { 8340 // NamedValueCreateContractProperties - NamedValue entity contract properties for PUT operation. 8341 *NamedValueCreateContractProperties `json:"properties,omitempty"` 8342 // ID - READ-ONLY; Resource ID. 8343 ID *string `json:"id,omitempty"` 8344 // Name - READ-ONLY; Resource name. 8345 Name *string `json:"name,omitempty"` 8346 // Type - READ-ONLY; Resource type for API Management resource. 8347 Type *string `json:"type,omitempty"` 8348} 8349 8350// MarshalJSON is the custom marshaler for NamedValueCreateContract. 8351func (nvcc NamedValueCreateContract) MarshalJSON() ([]byte, error) { 8352 objectMap := make(map[string]interface{}) 8353 if nvcc.NamedValueCreateContractProperties != nil { 8354 objectMap["properties"] = nvcc.NamedValueCreateContractProperties 8355 } 8356 return json.Marshal(objectMap) 8357} 8358 8359// UnmarshalJSON is the custom unmarshaler for NamedValueCreateContract struct. 8360func (nvcc *NamedValueCreateContract) UnmarshalJSON(body []byte) error { 8361 var m map[string]*json.RawMessage 8362 err := json.Unmarshal(body, &m) 8363 if err != nil { 8364 return err 8365 } 8366 for k, v := range m { 8367 switch k { 8368 case "properties": 8369 if v != nil { 8370 var namedValueCreateContractProperties NamedValueCreateContractProperties 8371 err = json.Unmarshal(*v, &namedValueCreateContractProperties) 8372 if err != nil { 8373 return err 8374 } 8375 nvcc.NamedValueCreateContractProperties = &namedValueCreateContractProperties 8376 } 8377 case "id": 8378 if v != nil { 8379 var ID string 8380 err = json.Unmarshal(*v, &ID) 8381 if err != nil { 8382 return err 8383 } 8384 nvcc.ID = &ID 8385 } 8386 case "name": 8387 if v != nil { 8388 var name string 8389 err = json.Unmarshal(*v, &name) 8390 if err != nil { 8391 return err 8392 } 8393 nvcc.Name = &name 8394 } 8395 case "type": 8396 if v != nil { 8397 var typeVar string 8398 err = json.Unmarshal(*v, &typeVar) 8399 if err != nil { 8400 return err 8401 } 8402 nvcc.Type = &typeVar 8403 } 8404 } 8405 } 8406 8407 return nil 8408} 8409 8410// NamedValueCreateContractProperties namedValue Contract properties. 8411type NamedValueCreateContractProperties struct { 8412 // DisplayName - Unique name of NamedValue. It may contain only letters, digits, period, dash, and underscore characters. 8413 DisplayName *string `json:"displayName,omitempty"` 8414 // Value - Value of the NamedValue. Can contain policy expressions. It may not be empty or consist only of whitespace. This property will not be filled on 'GET' operations! Use '/listSecrets' POST request to get the value. 8415 Value *string `json:"value,omitempty"` 8416 // KeyVault - KeyVault location details of the namedValue. 8417 KeyVault *KeyVaultContractCreateProperties `json:"keyVault,omitempty"` 8418 // Tags - Optional tags that when provided can be used to filter the NamedValue list. 8419 Tags *[]string `json:"tags,omitempty"` 8420 // Secret - Determines whether the value is a secret and should be encrypted or not. Default value is false. 8421 Secret *bool `json:"secret,omitempty"` 8422} 8423 8424// NamedValueCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a 8425// long-running operation. 8426type NamedValueCreateOrUpdateFuture struct { 8427 azure.FutureAPI 8428 // Result returns the result of the asynchronous operation. 8429 // If the operation has not completed it will return an error. 8430 Result func(NamedValueClient) (NamedValueContract, error) 8431} 8432 8433// UnmarshalJSON is the custom unmarshaller for CreateFuture. 8434func (future *NamedValueCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 8435 var azFuture azure.Future 8436 if err := json.Unmarshal(body, &azFuture); err != nil { 8437 return err 8438 } 8439 future.FutureAPI = &azFuture 8440 future.Result = future.result 8441 return nil 8442} 8443 8444// result is the default implementation for NamedValueCreateOrUpdateFuture.Result. 8445func (future *NamedValueCreateOrUpdateFuture) result(client NamedValueClient) (nvc NamedValueContract, err error) { 8446 var done bool 8447 done, err = future.DoneWithContext(context.Background(), client) 8448 if err != nil { 8449 err = autorest.NewErrorWithError(err, "apimanagement.NamedValueCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 8450 return 8451 } 8452 if !done { 8453 nvc.Response.Response = future.Response() 8454 err = azure.NewAsyncOpIncompleteError("apimanagement.NamedValueCreateOrUpdateFuture") 8455 return 8456 } 8457 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 8458 if nvc.Response.Response, err = future.GetResult(sender); err == nil && nvc.Response.Response.StatusCode != http.StatusNoContent { 8459 nvc, err = client.CreateOrUpdateResponder(nvc.Response.Response) 8460 if err != nil { 8461 err = autorest.NewErrorWithError(err, "apimanagement.NamedValueCreateOrUpdateFuture", "Result", nvc.Response.Response, "Failure responding to request") 8462 } 8463 } 8464 return 8465} 8466 8467// NamedValueEntityBaseParameters namedValue Entity Base Parameters set. 8468type NamedValueEntityBaseParameters struct { 8469 // Tags - Optional tags that when provided can be used to filter the NamedValue list. 8470 Tags *[]string `json:"tags,omitempty"` 8471 // Secret - Determines whether the value is a secret and should be encrypted or not. Default value is false. 8472 Secret *bool `json:"secret,omitempty"` 8473} 8474 8475// NamedValueRefreshSecretFuture an abstraction for monitoring and retrieving the results of a long-running 8476// operation. 8477type NamedValueRefreshSecretFuture struct { 8478 azure.FutureAPI 8479 // Result returns the result of the asynchronous operation. 8480 // If the operation has not completed it will return an error. 8481 Result func(NamedValueClient) (NamedValueContract, error) 8482} 8483 8484// UnmarshalJSON is the custom unmarshaller for CreateFuture. 8485func (future *NamedValueRefreshSecretFuture) UnmarshalJSON(body []byte) error { 8486 var azFuture azure.Future 8487 if err := json.Unmarshal(body, &azFuture); err != nil { 8488 return err 8489 } 8490 future.FutureAPI = &azFuture 8491 future.Result = future.result 8492 return nil 8493} 8494 8495// result is the default implementation for NamedValueRefreshSecretFuture.Result. 8496func (future *NamedValueRefreshSecretFuture) result(client NamedValueClient) (nvc NamedValueContract, err error) { 8497 var done bool 8498 done, err = future.DoneWithContext(context.Background(), client) 8499 if err != nil { 8500 err = autorest.NewErrorWithError(err, "apimanagement.NamedValueRefreshSecretFuture", "Result", future.Response(), "Polling failure") 8501 return 8502 } 8503 if !done { 8504 nvc.Response.Response = future.Response() 8505 err = azure.NewAsyncOpIncompleteError("apimanagement.NamedValueRefreshSecretFuture") 8506 return 8507 } 8508 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 8509 if nvc.Response.Response, err = future.GetResult(sender); err == nil && nvc.Response.Response.StatusCode != http.StatusNoContent { 8510 nvc, err = client.RefreshSecretResponder(nvc.Response.Response) 8511 if err != nil { 8512 err = autorest.NewErrorWithError(err, "apimanagement.NamedValueRefreshSecretFuture", "Result", nvc.Response.Response, "Failure responding to request") 8513 } 8514 } 8515 return 8516} 8517 8518// NamedValueSecretContract client or app secret used in IdentityProviders, Aad, OpenID or OAuth. 8519type NamedValueSecretContract struct { 8520 autorest.Response `json:"-"` 8521 // Value - This is secret value of the NamedValue entity. 8522 Value *string `json:"value,omitempty"` 8523} 8524 8525// NamedValueUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 8526// operation. 8527type NamedValueUpdateFuture struct { 8528 azure.FutureAPI 8529 // Result returns the result of the asynchronous operation. 8530 // If the operation has not completed it will return an error. 8531 Result func(NamedValueClient) (NamedValueContract, error) 8532} 8533 8534// UnmarshalJSON is the custom unmarshaller for CreateFuture. 8535func (future *NamedValueUpdateFuture) UnmarshalJSON(body []byte) error { 8536 var azFuture azure.Future 8537 if err := json.Unmarshal(body, &azFuture); err != nil { 8538 return err 8539 } 8540 future.FutureAPI = &azFuture 8541 future.Result = future.result 8542 return nil 8543} 8544 8545// result is the default implementation for NamedValueUpdateFuture.Result. 8546func (future *NamedValueUpdateFuture) result(client NamedValueClient) (nvc NamedValueContract, err error) { 8547 var done bool 8548 done, err = future.DoneWithContext(context.Background(), client) 8549 if err != nil { 8550 err = autorest.NewErrorWithError(err, "apimanagement.NamedValueUpdateFuture", "Result", future.Response(), "Polling failure") 8551 return 8552 } 8553 if !done { 8554 nvc.Response.Response = future.Response() 8555 err = azure.NewAsyncOpIncompleteError("apimanagement.NamedValueUpdateFuture") 8556 return 8557 } 8558 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 8559 if nvc.Response.Response, err = future.GetResult(sender); err == nil && nvc.Response.Response.StatusCode != http.StatusNoContent { 8560 nvc, err = client.UpdateResponder(nvc.Response.Response) 8561 if err != nil { 8562 err = autorest.NewErrorWithError(err, "apimanagement.NamedValueUpdateFuture", "Result", nvc.Response.Response, "Failure responding to request") 8563 } 8564 } 8565 return 8566} 8567 8568// NamedValueUpdateParameterProperties namedValue Contract properties. 8569type NamedValueUpdateParameterProperties struct { 8570 // DisplayName - Unique name of NamedValue. It may contain only letters, digits, period, dash, and underscore characters. 8571 DisplayName *string `json:"displayName,omitempty"` 8572 // Value - Value of the NamedValue. Can contain policy expressions. It may not be empty or consist only of whitespace. 8573 Value *string `json:"value,omitempty"` 8574 // KeyVault - KeyVault location details of the namedValue. 8575 KeyVault *KeyVaultContractCreateProperties `json:"keyVault,omitempty"` 8576 // Tags - Optional tags that when provided can be used to filter the NamedValue list. 8577 Tags *[]string `json:"tags,omitempty"` 8578 // Secret - Determines whether the value is a secret and should be encrypted or not. Default value is false. 8579 Secret *bool `json:"secret,omitempty"` 8580} 8581 8582// NamedValueUpdateParameters namedValue update Parameters. 8583type NamedValueUpdateParameters struct { 8584 // NamedValueUpdateParameterProperties - NamedValue entity Update contract properties. 8585 *NamedValueUpdateParameterProperties `json:"properties,omitempty"` 8586} 8587 8588// MarshalJSON is the custom marshaler for NamedValueUpdateParameters. 8589func (nvup NamedValueUpdateParameters) MarshalJSON() ([]byte, error) { 8590 objectMap := make(map[string]interface{}) 8591 if nvup.NamedValueUpdateParameterProperties != nil { 8592 objectMap["properties"] = nvup.NamedValueUpdateParameterProperties 8593 } 8594 return json.Marshal(objectMap) 8595} 8596 8597// UnmarshalJSON is the custom unmarshaler for NamedValueUpdateParameters struct. 8598func (nvup *NamedValueUpdateParameters) UnmarshalJSON(body []byte) error { 8599 var m map[string]*json.RawMessage 8600 err := json.Unmarshal(body, &m) 8601 if err != nil { 8602 return err 8603 } 8604 for k, v := range m { 8605 switch k { 8606 case "properties": 8607 if v != nil { 8608 var namedValueUpdateParameterProperties NamedValueUpdateParameterProperties 8609 err = json.Unmarshal(*v, &namedValueUpdateParameterProperties) 8610 if err != nil { 8611 return err 8612 } 8613 nvup.NamedValueUpdateParameterProperties = &namedValueUpdateParameterProperties 8614 } 8615 } 8616 } 8617 8618 return nil 8619} 8620 8621// NetworkStatusContract network Status details. 8622type NetworkStatusContract struct { 8623 autorest.Response `json:"-"` 8624 // DNSServers - Gets the list of DNS servers IPV4 addresses. 8625 DNSServers *[]string `json:"dnsServers,omitempty"` 8626 // ConnectivityStatus - Gets the list of Connectivity Status to the Resources on which the service depends upon. 8627 ConnectivityStatus *[]ConnectivityStatusContract `json:"connectivityStatus,omitempty"` 8628} 8629 8630// NetworkStatusContractByLocation network Status in the Location 8631type NetworkStatusContractByLocation struct { 8632 // Location - Location of service 8633 Location *string `json:"location,omitempty"` 8634 // NetworkStatus - Network status in Location 8635 NetworkStatus *NetworkStatusContract `json:"networkStatus,omitempty"` 8636} 8637 8638// NotificationCollection paged Notification list representation. 8639type NotificationCollection struct { 8640 autorest.Response `json:"-"` 8641 // Value - Page values. 8642 Value *[]NotificationContract `json:"value,omitempty"` 8643 // Count - Total record count number across all pages. 8644 Count *int64 `json:"count,omitempty"` 8645 // NextLink - Next page link if any. 8646 NextLink *string `json:"nextLink,omitempty"` 8647} 8648 8649// NotificationCollectionIterator provides access to a complete listing of NotificationContract values. 8650type NotificationCollectionIterator struct { 8651 i int 8652 page NotificationCollectionPage 8653} 8654 8655// NextWithContext advances to the next value. If there was an error making 8656// the request the iterator does not advance and the error is returned. 8657func (iter *NotificationCollectionIterator) NextWithContext(ctx context.Context) (err error) { 8658 if tracing.IsEnabled() { 8659 ctx = tracing.StartSpan(ctx, fqdn+"/NotificationCollectionIterator.NextWithContext") 8660 defer func() { 8661 sc := -1 8662 if iter.Response().Response.Response != nil { 8663 sc = iter.Response().Response.Response.StatusCode 8664 } 8665 tracing.EndSpan(ctx, sc, err) 8666 }() 8667 } 8668 iter.i++ 8669 if iter.i < len(iter.page.Values()) { 8670 return nil 8671 } 8672 err = iter.page.NextWithContext(ctx) 8673 if err != nil { 8674 iter.i-- 8675 return err 8676 } 8677 iter.i = 0 8678 return nil 8679} 8680 8681// Next advances to the next value. If there was an error making 8682// the request the iterator does not advance and the error is returned. 8683// Deprecated: Use NextWithContext() instead. 8684func (iter *NotificationCollectionIterator) Next() error { 8685 return iter.NextWithContext(context.Background()) 8686} 8687 8688// NotDone returns true if the enumeration should be started or is not yet complete. 8689func (iter NotificationCollectionIterator) NotDone() bool { 8690 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 8691} 8692 8693// Response returns the raw server response from the last page request. 8694func (iter NotificationCollectionIterator) Response() NotificationCollection { 8695 return iter.page.Response() 8696} 8697 8698// Value returns the current value or a zero-initialized value if the 8699// iterator has advanced beyond the end of the collection. 8700func (iter NotificationCollectionIterator) Value() NotificationContract { 8701 if !iter.page.NotDone() { 8702 return NotificationContract{} 8703 } 8704 return iter.page.Values()[iter.i] 8705} 8706 8707// Creates a new instance of the NotificationCollectionIterator type. 8708func NewNotificationCollectionIterator(page NotificationCollectionPage) NotificationCollectionIterator { 8709 return NotificationCollectionIterator{page: page} 8710} 8711 8712// IsEmpty returns true if the ListResult contains no values. 8713func (nc NotificationCollection) IsEmpty() bool { 8714 return nc.Value == nil || len(*nc.Value) == 0 8715} 8716 8717// hasNextLink returns true if the NextLink is not empty. 8718func (nc NotificationCollection) hasNextLink() bool { 8719 return nc.NextLink != nil && len(*nc.NextLink) != 0 8720} 8721 8722// notificationCollectionPreparer prepares a request to retrieve the next set of results. 8723// It returns nil if no more results exist. 8724func (nc NotificationCollection) notificationCollectionPreparer(ctx context.Context) (*http.Request, error) { 8725 if !nc.hasNextLink() { 8726 return nil, nil 8727 } 8728 return autorest.Prepare((&http.Request{}).WithContext(ctx), 8729 autorest.AsJSON(), 8730 autorest.AsGet(), 8731 autorest.WithBaseURL(to.String(nc.NextLink))) 8732} 8733 8734// NotificationCollectionPage contains a page of NotificationContract values. 8735type NotificationCollectionPage struct { 8736 fn func(context.Context, NotificationCollection) (NotificationCollection, error) 8737 nc NotificationCollection 8738} 8739 8740// NextWithContext advances to the next page of values. If there was an error making 8741// the request the page does not advance and the error is returned. 8742func (page *NotificationCollectionPage) NextWithContext(ctx context.Context) (err error) { 8743 if tracing.IsEnabled() { 8744 ctx = tracing.StartSpan(ctx, fqdn+"/NotificationCollectionPage.NextWithContext") 8745 defer func() { 8746 sc := -1 8747 if page.Response().Response.Response != nil { 8748 sc = page.Response().Response.Response.StatusCode 8749 } 8750 tracing.EndSpan(ctx, sc, err) 8751 }() 8752 } 8753 for { 8754 next, err := page.fn(ctx, page.nc) 8755 if err != nil { 8756 return err 8757 } 8758 page.nc = next 8759 if !next.hasNextLink() || !next.IsEmpty() { 8760 break 8761 } 8762 } 8763 return nil 8764} 8765 8766// Next advances to the next page of values. If there was an error making 8767// the request the page does not advance and the error is returned. 8768// Deprecated: Use NextWithContext() instead. 8769func (page *NotificationCollectionPage) Next() error { 8770 return page.NextWithContext(context.Background()) 8771} 8772 8773// NotDone returns true if the page enumeration should be started or is not yet complete. 8774func (page NotificationCollectionPage) NotDone() bool { 8775 return !page.nc.IsEmpty() 8776} 8777 8778// Response returns the raw server response from the last page request. 8779func (page NotificationCollectionPage) Response() NotificationCollection { 8780 return page.nc 8781} 8782 8783// Values returns the slice of values for the current page or nil if there are no values. 8784func (page NotificationCollectionPage) Values() []NotificationContract { 8785 if page.nc.IsEmpty() { 8786 return nil 8787 } 8788 return *page.nc.Value 8789} 8790 8791// Creates a new instance of the NotificationCollectionPage type. 8792func NewNotificationCollectionPage(cur NotificationCollection, getNextPage func(context.Context, NotificationCollection) (NotificationCollection, error)) NotificationCollectionPage { 8793 return NotificationCollectionPage{ 8794 fn: getNextPage, 8795 nc: cur, 8796 } 8797} 8798 8799// NotificationContract notification details. 8800type NotificationContract struct { 8801 autorest.Response `json:"-"` 8802 // NotificationContractProperties - Notification entity contract properties. 8803 *NotificationContractProperties `json:"properties,omitempty"` 8804 // ID - READ-ONLY; Resource ID. 8805 ID *string `json:"id,omitempty"` 8806 // Name - READ-ONLY; Resource name. 8807 Name *string `json:"name,omitempty"` 8808 // Type - READ-ONLY; Resource type for API Management resource. 8809 Type *string `json:"type,omitempty"` 8810} 8811 8812// MarshalJSON is the custom marshaler for NotificationContract. 8813func (nc NotificationContract) MarshalJSON() ([]byte, error) { 8814 objectMap := make(map[string]interface{}) 8815 if nc.NotificationContractProperties != nil { 8816 objectMap["properties"] = nc.NotificationContractProperties 8817 } 8818 return json.Marshal(objectMap) 8819} 8820 8821// UnmarshalJSON is the custom unmarshaler for NotificationContract struct. 8822func (nc *NotificationContract) UnmarshalJSON(body []byte) error { 8823 var m map[string]*json.RawMessage 8824 err := json.Unmarshal(body, &m) 8825 if err != nil { 8826 return err 8827 } 8828 for k, v := range m { 8829 switch k { 8830 case "properties": 8831 if v != nil { 8832 var notificationContractProperties NotificationContractProperties 8833 err = json.Unmarshal(*v, ¬ificationContractProperties) 8834 if err != nil { 8835 return err 8836 } 8837 nc.NotificationContractProperties = ¬ificationContractProperties 8838 } 8839 case "id": 8840 if v != nil { 8841 var ID string 8842 err = json.Unmarshal(*v, &ID) 8843 if err != nil { 8844 return err 8845 } 8846 nc.ID = &ID 8847 } 8848 case "name": 8849 if v != nil { 8850 var name string 8851 err = json.Unmarshal(*v, &name) 8852 if err != nil { 8853 return err 8854 } 8855 nc.Name = &name 8856 } 8857 case "type": 8858 if v != nil { 8859 var typeVar string 8860 err = json.Unmarshal(*v, &typeVar) 8861 if err != nil { 8862 return err 8863 } 8864 nc.Type = &typeVar 8865 } 8866 } 8867 } 8868 8869 return nil 8870} 8871 8872// NotificationContractProperties notification Contract properties. 8873type NotificationContractProperties struct { 8874 // Title - Title of the Notification. 8875 Title *string `json:"title,omitempty"` 8876 // Description - Description of the Notification. 8877 Description *string `json:"description,omitempty"` 8878 // Recipients - Recipient Parameter values. 8879 Recipients *RecipientsContractProperties `json:"recipients,omitempty"` 8880} 8881 8882// OAuth2AuthenticationSettingsContract API OAuth2 Authentication settings details. 8883type OAuth2AuthenticationSettingsContract struct { 8884 // AuthorizationServerID - OAuth authorization server identifier. 8885 AuthorizationServerID *string `json:"authorizationServerId,omitempty"` 8886 // Scope - operations scope. 8887 Scope *string `json:"scope,omitempty"` 8888} 8889 8890// OpenIDAuthenticationSettingsContract API OAuth2 Authentication settings details. 8891type OpenIDAuthenticationSettingsContract struct { 8892 // OpenidProviderID - OAuth authorization server identifier. 8893 OpenidProviderID *string `json:"openidProviderId,omitempty"` 8894 // BearerTokenSendingMethods - How to send token to the server. 8895 BearerTokenSendingMethods *[]BearerTokenSendingMethods `json:"bearerTokenSendingMethods,omitempty"` 8896} 8897 8898// OpenIDConnectProviderCollection paged OpenIdProviders list representation. 8899type OpenIDConnectProviderCollection struct { 8900 autorest.Response `json:"-"` 8901 // Value - Page values. 8902 Value *[]OpenidConnectProviderContract `json:"value,omitempty"` 8903 // Count - Total record count number across all pages. 8904 Count *int64 `json:"count,omitempty"` 8905 // NextLink - Next page link if any. 8906 NextLink *string `json:"nextLink,omitempty"` 8907} 8908 8909// OpenIDConnectProviderCollectionIterator provides access to a complete listing of 8910// OpenidConnectProviderContract values. 8911type OpenIDConnectProviderCollectionIterator struct { 8912 i int 8913 page OpenIDConnectProviderCollectionPage 8914} 8915 8916// NextWithContext advances to the next value. If there was an error making 8917// the request the iterator does not advance and the error is returned. 8918func (iter *OpenIDConnectProviderCollectionIterator) NextWithContext(ctx context.Context) (err error) { 8919 if tracing.IsEnabled() { 8920 ctx = tracing.StartSpan(ctx, fqdn+"/OpenIDConnectProviderCollectionIterator.NextWithContext") 8921 defer func() { 8922 sc := -1 8923 if iter.Response().Response.Response != nil { 8924 sc = iter.Response().Response.Response.StatusCode 8925 } 8926 tracing.EndSpan(ctx, sc, err) 8927 }() 8928 } 8929 iter.i++ 8930 if iter.i < len(iter.page.Values()) { 8931 return nil 8932 } 8933 err = iter.page.NextWithContext(ctx) 8934 if err != nil { 8935 iter.i-- 8936 return err 8937 } 8938 iter.i = 0 8939 return nil 8940} 8941 8942// Next advances to the next value. If there was an error making 8943// the request the iterator does not advance and the error is returned. 8944// Deprecated: Use NextWithContext() instead. 8945func (iter *OpenIDConnectProviderCollectionIterator) Next() error { 8946 return iter.NextWithContext(context.Background()) 8947} 8948 8949// NotDone returns true if the enumeration should be started or is not yet complete. 8950func (iter OpenIDConnectProviderCollectionIterator) NotDone() bool { 8951 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 8952} 8953 8954// Response returns the raw server response from the last page request. 8955func (iter OpenIDConnectProviderCollectionIterator) Response() OpenIDConnectProviderCollection { 8956 return iter.page.Response() 8957} 8958 8959// Value returns the current value or a zero-initialized value if the 8960// iterator has advanced beyond the end of the collection. 8961func (iter OpenIDConnectProviderCollectionIterator) Value() OpenidConnectProviderContract { 8962 if !iter.page.NotDone() { 8963 return OpenidConnectProviderContract{} 8964 } 8965 return iter.page.Values()[iter.i] 8966} 8967 8968// Creates a new instance of the OpenIDConnectProviderCollectionIterator type. 8969func NewOpenIDConnectProviderCollectionIterator(page OpenIDConnectProviderCollectionPage) OpenIDConnectProviderCollectionIterator { 8970 return OpenIDConnectProviderCollectionIterator{page: page} 8971} 8972 8973// IsEmpty returns true if the ListResult contains no values. 8974func (oicpc OpenIDConnectProviderCollection) IsEmpty() bool { 8975 return oicpc.Value == nil || len(*oicpc.Value) == 0 8976} 8977 8978// hasNextLink returns true if the NextLink is not empty. 8979func (oicpc OpenIDConnectProviderCollection) hasNextLink() bool { 8980 return oicpc.NextLink != nil && len(*oicpc.NextLink) != 0 8981} 8982 8983// openIDConnectProviderCollectionPreparer prepares a request to retrieve the next set of results. 8984// It returns nil if no more results exist. 8985func (oicpc OpenIDConnectProviderCollection) openIDConnectProviderCollectionPreparer(ctx context.Context) (*http.Request, error) { 8986 if !oicpc.hasNextLink() { 8987 return nil, nil 8988 } 8989 return autorest.Prepare((&http.Request{}).WithContext(ctx), 8990 autorest.AsJSON(), 8991 autorest.AsGet(), 8992 autorest.WithBaseURL(to.String(oicpc.NextLink))) 8993} 8994 8995// OpenIDConnectProviderCollectionPage contains a page of OpenidConnectProviderContract values. 8996type OpenIDConnectProviderCollectionPage struct { 8997 fn func(context.Context, OpenIDConnectProviderCollection) (OpenIDConnectProviderCollection, error) 8998 oicpc OpenIDConnectProviderCollection 8999} 9000 9001// NextWithContext advances to the next page of values. If there was an error making 9002// the request the page does not advance and the error is returned. 9003func (page *OpenIDConnectProviderCollectionPage) NextWithContext(ctx context.Context) (err error) { 9004 if tracing.IsEnabled() { 9005 ctx = tracing.StartSpan(ctx, fqdn+"/OpenIDConnectProviderCollectionPage.NextWithContext") 9006 defer func() { 9007 sc := -1 9008 if page.Response().Response.Response != nil { 9009 sc = page.Response().Response.Response.StatusCode 9010 } 9011 tracing.EndSpan(ctx, sc, err) 9012 }() 9013 } 9014 for { 9015 next, err := page.fn(ctx, page.oicpc) 9016 if err != nil { 9017 return err 9018 } 9019 page.oicpc = next 9020 if !next.hasNextLink() || !next.IsEmpty() { 9021 break 9022 } 9023 } 9024 return nil 9025} 9026 9027// Next advances to the next page of values. If there was an error making 9028// the request the page does not advance and the error is returned. 9029// Deprecated: Use NextWithContext() instead. 9030func (page *OpenIDConnectProviderCollectionPage) Next() error { 9031 return page.NextWithContext(context.Background()) 9032} 9033 9034// NotDone returns true if the page enumeration should be started or is not yet complete. 9035func (page OpenIDConnectProviderCollectionPage) NotDone() bool { 9036 return !page.oicpc.IsEmpty() 9037} 9038 9039// Response returns the raw server response from the last page request. 9040func (page OpenIDConnectProviderCollectionPage) Response() OpenIDConnectProviderCollection { 9041 return page.oicpc 9042} 9043 9044// Values returns the slice of values for the current page or nil if there are no values. 9045func (page OpenIDConnectProviderCollectionPage) Values() []OpenidConnectProviderContract { 9046 if page.oicpc.IsEmpty() { 9047 return nil 9048 } 9049 return *page.oicpc.Value 9050} 9051 9052// Creates a new instance of the OpenIDConnectProviderCollectionPage type. 9053func NewOpenIDConnectProviderCollectionPage(cur OpenIDConnectProviderCollection, getNextPage func(context.Context, OpenIDConnectProviderCollection) (OpenIDConnectProviderCollection, error)) OpenIDConnectProviderCollectionPage { 9054 return OpenIDConnectProviderCollectionPage{ 9055 fn: getNextPage, 9056 oicpc: cur, 9057 } 9058} 9059 9060// OpenidConnectProviderContract openId Connect Provider details. 9061type OpenidConnectProviderContract struct { 9062 autorest.Response `json:"-"` 9063 // OpenidConnectProviderContractProperties - OpenId Connect Provider contract properties. 9064 *OpenidConnectProviderContractProperties `json:"properties,omitempty"` 9065 // ID - READ-ONLY; Resource ID. 9066 ID *string `json:"id,omitempty"` 9067 // Name - READ-ONLY; Resource name. 9068 Name *string `json:"name,omitempty"` 9069 // Type - READ-ONLY; Resource type for API Management resource. 9070 Type *string `json:"type,omitempty"` 9071} 9072 9073// MarshalJSON is the custom marshaler for OpenidConnectProviderContract. 9074func (ocpc OpenidConnectProviderContract) MarshalJSON() ([]byte, error) { 9075 objectMap := make(map[string]interface{}) 9076 if ocpc.OpenidConnectProviderContractProperties != nil { 9077 objectMap["properties"] = ocpc.OpenidConnectProviderContractProperties 9078 } 9079 return json.Marshal(objectMap) 9080} 9081 9082// UnmarshalJSON is the custom unmarshaler for OpenidConnectProviderContract struct. 9083func (ocpc *OpenidConnectProviderContract) UnmarshalJSON(body []byte) error { 9084 var m map[string]*json.RawMessage 9085 err := json.Unmarshal(body, &m) 9086 if err != nil { 9087 return err 9088 } 9089 for k, v := range m { 9090 switch k { 9091 case "properties": 9092 if v != nil { 9093 var openidConnectProviderContractProperties OpenidConnectProviderContractProperties 9094 err = json.Unmarshal(*v, &openidConnectProviderContractProperties) 9095 if err != nil { 9096 return err 9097 } 9098 ocpc.OpenidConnectProviderContractProperties = &openidConnectProviderContractProperties 9099 } 9100 case "id": 9101 if v != nil { 9102 var ID string 9103 err = json.Unmarshal(*v, &ID) 9104 if err != nil { 9105 return err 9106 } 9107 ocpc.ID = &ID 9108 } 9109 case "name": 9110 if v != nil { 9111 var name string 9112 err = json.Unmarshal(*v, &name) 9113 if err != nil { 9114 return err 9115 } 9116 ocpc.Name = &name 9117 } 9118 case "type": 9119 if v != nil { 9120 var typeVar string 9121 err = json.Unmarshal(*v, &typeVar) 9122 if err != nil { 9123 return err 9124 } 9125 ocpc.Type = &typeVar 9126 } 9127 } 9128 } 9129 9130 return nil 9131} 9132 9133// OpenidConnectProviderContractProperties openID Connect Providers Contract. 9134type OpenidConnectProviderContractProperties struct { 9135 // DisplayName - User-friendly OpenID Connect Provider name. 9136 DisplayName *string `json:"displayName,omitempty"` 9137 // Description - User-friendly description of OpenID Connect Provider. 9138 Description *string `json:"description,omitempty"` 9139 // MetadataEndpoint - Metadata endpoint URI. 9140 MetadataEndpoint *string `json:"metadataEndpoint,omitempty"` 9141 // ClientID - Client ID of developer console which is the client application. 9142 ClientID *string `json:"clientId,omitempty"` 9143 // ClientSecret - Client Secret of developer console which is the client application. 9144 ClientSecret *string `json:"clientSecret,omitempty"` 9145} 9146 9147// OpenidConnectProviderUpdateContract parameters supplied to the Update OpenID Connect Provider operation. 9148type OpenidConnectProviderUpdateContract struct { 9149 // OpenidConnectProviderUpdateContractProperties - OpenId Connect Provider Update contract properties. 9150 *OpenidConnectProviderUpdateContractProperties `json:"properties,omitempty"` 9151} 9152 9153// MarshalJSON is the custom marshaler for OpenidConnectProviderUpdateContract. 9154func (ocpuc OpenidConnectProviderUpdateContract) MarshalJSON() ([]byte, error) { 9155 objectMap := make(map[string]interface{}) 9156 if ocpuc.OpenidConnectProviderUpdateContractProperties != nil { 9157 objectMap["properties"] = ocpuc.OpenidConnectProviderUpdateContractProperties 9158 } 9159 return json.Marshal(objectMap) 9160} 9161 9162// UnmarshalJSON is the custom unmarshaler for OpenidConnectProviderUpdateContract struct. 9163func (ocpuc *OpenidConnectProviderUpdateContract) UnmarshalJSON(body []byte) error { 9164 var m map[string]*json.RawMessage 9165 err := json.Unmarshal(body, &m) 9166 if err != nil { 9167 return err 9168 } 9169 for k, v := range m { 9170 switch k { 9171 case "properties": 9172 if v != nil { 9173 var openidConnectProviderUpdateContractProperties OpenidConnectProviderUpdateContractProperties 9174 err = json.Unmarshal(*v, &openidConnectProviderUpdateContractProperties) 9175 if err != nil { 9176 return err 9177 } 9178 ocpuc.OpenidConnectProviderUpdateContractProperties = &openidConnectProviderUpdateContractProperties 9179 } 9180 } 9181 } 9182 9183 return nil 9184} 9185 9186// OpenidConnectProviderUpdateContractProperties parameters supplied to the Update OpenID Connect Provider 9187// operation. 9188type OpenidConnectProviderUpdateContractProperties struct { 9189 // DisplayName - User-friendly OpenID Connect Provider name. 9190 DisplayName *string `json:"displayName,omitempty"` 9191 // Description - User-friendly description of OpenID Connect Provider. 9192 Description *string `json:"description,omitempty"` 9193 // MetadataEndpoint - Metadata endpoint URI. 9194 MetadataEndpoint *string `json:"metadataEndpoint,omitempty"` 9195 // ClientID - Client ID of developer console which is the client application. 9196 ClientID *string `json:"clientId,omitempty"` 9197 // ClientSecret - Client Secret of developer console which is the client application. 9198 ClientSecret *string `json:"clientSecret,omitempty"` 9199} 9200 9201// Operation REST API operation 9202type Operation struct { 9203 // Name - Operation name: {provider}/{resource}/{operation} 9204 Name *string `json:"name,omitempty"` 9205 // Display - The object that describes the operation. 9206 Display *OperationDisplay `json:"display,omitempty"` 9207 // Origin - The operation origin. 9208 Origin *string `json:"origin,omitempty"` 9209 // Properties - The operation properties. 9210 Properties interface{} `json:"properties,omitempty"` 9211} 9212 9213// OperationCollection paged Operation list representation. 9214type OperationCollection struct { 9215 autorest.Response `json:"-"` 9216 // Value - READ-ONLY; Page values. 9217 Value *[]OperationContract `json:"value,omitempty"` 9218 // Count - Total record count number across all pages. 9219 Count *int64 `json:"count,omitempty"` 9220 // NextLink - READ-ONLY; Next page link if any. 9221 NextLink *string `json:"nextLink,omitempty"` 9222} 9223 9224// MarshalJSON is the custom marshaler for OperationCollection. 9225func (oc OperationCollection) MarshalJSON() ([]byte, error) { 9226 objectMap := make(map[string]interface{}) 9227 if oc.Count != nil { 9228 objectMap["count"] = oc.Count 9229 } 9230 return json.Marshal(objectMap) 9231} 9232 9233// OperationCollectionIterator provides access to a complete listing of OperationContract values. 9234type OperationCollectionIterator struct { 9235 i int 9236 page OperationCollectionPage 9237} 9238 9239// NextWithContext advances to the next value. If there was an error making 9240// the request the iterator does not advance and the error is returned. 9241func (iter *OperationCollectionIterator) NextWithContext(ctx context.Context) (err error) { 9242 if tracing.IsEnabled() { 9243 ctx = tracing.StartSpan(ctx, fqdn+"/OperationCollectionIterator.NextWithContext") 9244 defer func() { 9245 sc := -1 9246 if iter.Response().Response.Response != nil { 9247 sc = iter.Response().Response.Response.StatusCode 9248 } 9249 tracing.EndSpan(ctx, sc, err) 9250 }() 9251 } 9252 iter.i++ 9253 if iter.i < len(iter.page.Values()) { 9254 return nil 9255 } 9256 err = iter.page.NextWithContext(ctx) 9257 if err != nil { 9258 iter.i-- 9259 return err 9260 } 9261 iter.i = 0 9262 return nil 9263} 9264 9265// Next advances to the next value. If there was an error making 9266// the request the iterator does not advance and the error is returned. 9267// Deprecated: Use NextWithContext() instead. 9268func (iter *OperationCollectionIterator) Next() error { 9269 return iter.NextWithContext(context.Background()) 9270} 9271 9272// NotDone returns true if the enumeration should be started or is not yet complete. 9273func (iter OperationCollectionIterator) NotDone() bool { 9274 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 9275} 9276 9277// Response returns the raw server response from the last page request. 9278func (iter OperationCollectionIterator) Response() OperationCollection { 9279 return iter.page.Response() 9280} 9281 9282// Value returns the current value or a zero-initialized value if the 9283// iterator has advanced beyond the end of the collection. 9284func (iter OperationCollectionIterator) Value() OperationContract { 9285 if !iter.page.NotDone() { 9286 return OperationContract{} 9287 } 9288 return iter.page.Values()[iter.i] 9289} 9290 9291// Creates a new instance of the OperationCollectionIterator type. 9292func NewOperationCollectionIterator(page OperationCollectionPage) OperationCollectionIterator { 9293 return OperationCollectionIterator{page: page} 9294} 9295 9296// IsEmpty returns true if the ListResult contains no values. 9297func (oc OperationCollection) IsEmpty() bool { 9298 return oc.Value == nil || len(*oc.Value) == 0 9299} 9300 9301// hasNextLink returns true if the NextLink is not empty. 9302func (oc OperationCollection) hasNextLink() bool { 9303 return oc.NextLink != nil && len(*oc.NextLink) != 0 9304} 9305 9306// operationCollectionPreparer prepares a request to retrieve the next set of results. 9307// It returns nil if no more results exist. 9308func (oc OperationCollection) operationCollectionPreparer(ctx context.Context) (*http.Request, error) { 9309 if !oc.hasNextLink() { 9310 return nil, nil 9311 } 9312 return autorest.Prepare((&http.Request{}).WithContext(ctx), 9313 autorest.AsJSON(), 9314 autorest.AsGet(), 9315 autorest.WithBaseURL(to.String(oc.NextLink))) 9316} 9317 9318// OperationCollectionPage contains a page of OperationContract values. 9319type OperationCollectionPage struct { 9320 fn func(context.Context, OperationCollection) (OperationCollection, error) 9321 oc OperationCollection 9322} 9323 9324// NextWithContext advances to the next page of values. If there was an error making 9325// the request the page does not advance and the error is returned. 9326func (page *OperationCollectionPage) NextWithContext(ctx context.Context) (err error) { 9327 if tracing.IsEnabled() { 9328 ctx = tracing.StartSpan(ctx, fqdn+"/OperationCollectionPage.NextWithContext") 9329 defer func() { 9330 sc := -1 9331 if page.Response().Response.Response != nil { 9332 sc = page.Response().Response.Response.StatusCode 9333 } 9334 tracing.EndSpan(ctx, sc, err) 9335 }() 9336 } 9337 for { 9338 next, err := page.fn(ctx, page.oc) 9339 if err != nil { 9340 return err 9341 } 9342 page.oc = next 9343 if !next.hasNextLink() || !next.IsEmpty() { 9344 break 9345 } 9346 } 9347 return nil 9348} 9349 9350// Next advances to the next page of values. If there was an error making 9351// the request the page does not advance and the error is returned. 9352// Deprecated: Use NextWithContext() instead. 9353func (page *OperationCollectionPage) Next() error { 9354 return page.NextWithContext(context.Background()) 9355} 9356 9357// NotDone returns true if the page enumeration should be started or is not yet complete. 9358func (page OperationCollectionPage) NotDone() bool { 9359 return !page.oc.IsEmpty() 9360} 9361 9362// Response returns the raw server response from the last page request. 9363func (page OperationCollectionPage) Response() OperationCollection { 9364 return page.oc 9365} 9366 9367// Values returns the slice of values for the current page or nil if there are no values. 9368func (page OperationCollectionPage) Values() []OperationContract { 9369 if page.oc.IsEmpty() { 9370 return nil 9371 } 9372 return *page.oc.Value 9373} 9374 9375// Creates a new instance of the OperationCollectionPage type. 9376func NewOperationCollectionPage(cur OperationCollection, getNextPage func(context.Context, OperationCollection) (OperationCollection, error)) OperationCollectionPage { 9377 return OperationCollectionPage{ 9378 fn: getNextPage, 9379 oc: cur, 9380 } 9381} 9382 9383// OperationContract api Operation details. 9384type OperationContract struct { 9385 autorest.Response `json:"-"` 9386 // OperationContractProperties - Properties of the Operation Contract. 9387 *OperationContractProperties `json:"properties,omitempty"` 9388 // ID - READ-ONLY; Resource ID. 9389 ID *string `json:"id,omitempty"` 9390 // Name - READ-ONLY; Resource name. 9391 Name *string `json:"name,omitempty"` 9392 // Type - READ-ONLY; Resource type for API Management resource. 9393 Type *string `json:"type,omitempty"` 9394} 9395 9396// MarshalJSON is the custom marshaler for OperationContract. 9397func (oc OperationContract) MarshalJSON() ([]byte, error) { 9398 objectMap := make(map[string]interface{}) 9399 if oc.OperationContractProperties != nil { 9400 objectMap["properties"] = oc.OperationContractProperties 9401 } 9402 return json.Marshal(objectMap) 9403} 9404 9405// UnmarshalJSON is the custom unmarshaler for OperationContract struct. 9406func (oc *OperationContract) UnmarshalJSON(body []byte) error { 9407 var m map[string]*json.RawMessage 9408 err := json.Unmarshal(body, &m) 9409 if err != nil { 9410 return err 9411 } 9412 for k, v := range m { 9413 switch k { 9414 case "properties": 9415 if v != nil { 9416 var operationContractProperties OperationContractProperties 9417 err = json.Unmarshal(*v, &operationContractProperties) 9418 if err != nil { 9419 return err 9420 } 9421 oc.OperationContractProperties = &operationContractProperties 9422 } 9423 case "id": 9424 if v != nil { 9425 var ID string 9426 err = json.Unmarshal(*v, &ID) 9427 if err != nil { 9428 return err 9429 } 9430 oc.ID = &ID 9431 } 9432 case "name": 9433 if v != nil { 9434 var name string 9435 err = json.Unmarshal(*v, &name) 9436 if err != nil { 9437 return err 9438 } 9439 oc.Name = &name 9440 } 9441 case "type": 9442 if v != nil { 9443 var typeVar string 9444 err = json.Unmarshal(*v, &typeVar) 9445 if err != nil { 9446 return err 9447 } 9448 oc.Type = &typeVar 9449 } 9450 } 9451 } 9452 9453 return nil 9454} 9455 9456// OperationContractProperties operation Contract Properties 9457type OperationContractProperties struct { 9458 // DisplayName - Operation Name. 9459 DisplayName *string `json:"displayName,omitempty"` 9460 // Method - A Valid HTTP Operation Method. Typical Http Methods like GET, PUT, POST but not limited by only them. 9461 Method *string `json:"method,omitempty"` 9462 // URLTemplate - Relative URL template identifying the target resource for this operation. May include parameters. Example: /customers/{cid}/orders/{oid}/?date={date} 9463 URLTemplate *string `json:"urlTemplate,omitempty"` 9464 // TemplateParameters - Collection of URL template parameters. 9465 TemplateParameters *[]ParameterContract `json:"templateParameters,omitempty"` 9466 // Description - Description of the operation. May include HTML formatting tags. 9467 Description *string `json:"description,omitempty"` 9468 // Request - An entity containing request details. 9469 Request *RequestContract `json:"request,omitempty"` 9470 // Responses - Array of Operation responses. 9471 Responses *[]ResponseContract `json:"responses,omitempty"` 9472 // Policies - Operation Policies 9473 Policies *string `json:"policies,omitempty"` 9474} 9475 9476// OperationDisplay the object that describes the operation. 9477type OperationDisplay struct { 9478 // Provider - Friendly name of the resource provider 9479 Provider *string `json:"provider,omitempty"` 9480 // Operation - Operation type: read, write, delete, listKeys/action, etc. 9481 Operation *string `json:"operation,omitempty"` 9482 // Resource - Resource type on which the operation is performed. 9483 Resource *string `json:"resource,omitempty"` 9484 // Description - Friendly name of the operation 9485 Description *string `json:"description,omitempty"` 9486} 9487 9488// OperationEntityBaseContract api Operation Entity Base Contract details. 9489type OperationEntityBaseContract struct { 9490 // TemplateParameters - Collection of URL template parameters. 9491 TemplateParameters *[]ParameterContract `json:"templateParameters,omitempty"` 9492 // Description - Description of the operation. May include HTML formatting tags. 9493 Description *string `json:"description,omitempty"` 9494 // Request - An entity containing request details. 9495 Request *RequestContract `json:"request,omitempty"` 9496 // Responses - Array of Operation responses. 9497 Responses *[]ResponseContract `json:"responses,omitempty"` 9498 // Policies - Operation Policies 9499 Policies *string `json:"policies,omitempty"` 9500} 9501 9502// OperationListResult result of the request to list REST API operations. It contains a list of operations 9503// and a URL nextLink to get the next set of results. 9504type OperationListResult struct { 9505 autorest.Response `json:"-"` 9506 // Value - List of operations supported by the resource provider. 9507 Value *[]Operation `json:"value,omitempty"` 9508 // NextLink - URL to get the next set of operation list results if there are any. 9509 NextLink *string `json:"nextLink,omitempty"` 9510} 9511 9512// OperationListResultIterator provides access to a complete listing of Operation values. 9513type OperationListResultIterator struct { 9514 i int 9515 page OperationListResultPage 9516} 9517 9518// NextWithContext advances to the next value. If there was an error making 9519// the request the iterator does not advance and the error is returned. 9520func (iter *OperationListResultIterator) NextWithContext(ctx context.Context) (err error) { 9521 if tracing.IsEnabled() { 9522 ctx = tracing.StartSpan(ctx, fqdn+"/OperationListResultIterator.NextWithContext") 9523 defer func() { 9524 sc := -1 9525 if iter.Response().Response.Response != nil { 9526 sc = iter.Response().Response.Response.StatusCode 9527 } 9528 tracing.EndSpan(ctx, sc, err) 9529 }() 9530 } 9531 iter.i++ 9532 if iter.i < len(iter.page.Values()) { 9533 return nil 9534 } 9535 err = iter.page.NextWithContext(ctx) 9536 if err != nil { 9537 iter.i-- 9538 return err 9539 } 9540 iter.i = 0 9541 return nil 9542} 9543 9544// Next advances to the next value. If there was an error making 9545// the request the iterator does not advance and the error is returned. 9546// Deprecated: Use NextWithContext() instead. 9547func (iter *OperationListResultIterator) Next() error { 9548 return iter.NextWithContext(context.Background()) 9549} 9550 9551// NotDone returns true if the enumeration should be started or is not yet complete. 9552func (iter OperationListResultIterator) NotDone() bool { 9553 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 9554} 9555 9556// Response returns the raw server response from the last page request. 9557func (iter OperationListResultIterator) Response() OperationListResult { 9558 return iter.page.Response() 9559} 9560 9561// Value returns the current value or a zero-initialized value if the 9562// iterator has advanced beyond the end of the collection. 9563func (iter OperationListResultIterator) Value() Operation { 9564 if !iter.page.NotDone() { 9565 return Operation{} 9566 } 9567 return iter.page.Values()[iter.i] 9568} 9569 9570// Creates a new instance of the OperationListResultIterator type. 9571func NewOperationListResultIterator(page OperationListResultPage) OperationListResultIterator { 9572 return OperationListResultIterator{page: page} 9573} 9574 9575// IsEmpty returns true if the ListResult contains no values. 9576func (olr OperationListResult) IsEmpty() bool { 9577 return olr.Value == nil || len(*olr.Value) == 0 9578} 9579 9580// hasNextLink returns true if the NextLink is not empty. 9581func (olr OperationListResult) hasNextLink() bool { 9582 return olr.NextLink != nil && len(*olr.NextLink) != 0 9583} 9584 9585// operationListResultPreparer prepares a request to retrieve the next set of results. 9586// It returns nil if no more results exist. 9587func (olr OperationListResult) operationListResultPreparer(ctx context.Context) (*http.Request, error) { 9588 if !olr.hasNextLink() { 9589 return nil, nil 9590 } 9591 return autorest.Prepare((&http.Request{}).WithContext(ctx), 9592 autorest.AsJSON(), 9593 autorest.AsGet(), 9594 autorest.WithBaseURL(to.String(olr.NextLink))) 9595} 9596 9597// OperationListResultPage contains a page of Operation values. 9598type OperationListResultPage struct { 9599 fn func(context.Context, OperationListResult) (OperationListResult, error) 9600 olr OperationListResult 9601} 9602 9603// NextWithContext advances to the next page of values. If there was an error making 9604// the request the page does not advance and the error is returned. 9605func (page *OperationListResultPage) NextWithContext(ctx context.Context) (err error) { 9606 if tracing.IsEnabled() { 9607 ctx = tracing.StartSpan(ctx, fqdn+"/OperationListResultPage.NextWithContext") 9608 defer func() { 9609 sc := -1 9610 if page.Response().Response.Response != nil { 9611 sc = page.Response().Response.Response.StatusCode 9612 } 9613 tracing.EndSpan(ctx, sc, err) 9614 }() 9615 } 9616 for { 9617 next, err := page.fn(ctx, page.olr) 9618 if err != nil { 9619 return err 9620 } 9621 page.olr = next 9622 if !next.hasNextLink() || !next.IsEmpty() { 9623 break 9624 } 9625 } 9626 return nil 9627} 9628 9629// Next advances to the next page of values. If there was an error making 9630// the request the page does not advance and the error is returned. 9631// Deprecated: Use NextWithContext() instead. 9632func (page *OperationListResultPage) Next() error { 9633 return page.NextWithContext(context.Background()) 9634} 9635 9636// NotDone returns true if the page enumeration should be started or is not yet complete. 9637func (page OperationListResultPage) NotDone() bool { 9638 return !page.olr.IsEmpty() 9639} 9640 9641// Response returns the raw server response from the last page request. 9642func (page OperationListResultPage) Response() OperationListResult { 9643 return page.olr 9644} 9645 9646// Values returns the slice of values for the current page or nil if there are no values. 9647func (page OperationListResultPage) Values() []Operation { 9648 if page.olr.IsEmpty() { 9649 return nil 9650 } 9651 return *page.olr.Value 9652} 9653 9654// Creates a new instance of the OperationListResultPage type. 9655func NewOperationListResultPage(cur OperationListResult, getNextPage func(context.Context, OperationListResult) (OperationListResult, error)) OperationListResultPage { 9656 return OperationListResultPage{ 9657 fn: getNextPage, 9658 olr: cur, 9659 } 9660} 9661 9662// OperationResultContract operation Result. 9663type OperationResultContract struct { 9664 autorest.Response `json:"-"` 9665 // ID - Operation result identifier. 9666 ID *string `json:"id,omitempty"` 9667 // Status - Status of an async operation. Possible values include: 'Started', 'InProgress', 'Succeeded', 'Failed' 9668 Status AsyncOperationStatus `json:"status,omitempty"` 9669 // Started - Start time of an async operation. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. 9670 Started *date.Time `json:"started,omitempty"` 9671 // Updated - Last update time of an async operation. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. 9672 Updated *date.Time `json:"updated,omitempty"` 9673 // ResultInfo - Optional result info. 9674 ResultInfo *string `json:"resultInfo,omitempty"` 9675 // Error - Error Body Contract 9676 Error *ErrorResponseBody `json:"error,omitempty"` 9677 // ActionLog - READ-ONLY; This property if only provided as part of the TenantConfiguration_Validate operation. It contains the log the entities which will be updated/created/deleted as part of the TenantConfiguration_Deploy operation. 9678 ActionLog *[]OperationResultLogItemContract `json:"actionLog,omitempty"` 9679} 9680 9681// MarshalJSON is the custom marshaler for OperationResultContract. 9682func (orc OperationResultContract) MarshalJSON() ([]byte, error) { 9683 objectMap := make(map[string]interface{}) 9684 if orc.ID != nil { 9685 objectMap["id"] = orc.ID 9686 } 9687 if orc.Status != "" { 9688 objectMap["status"] = orc.Status 9689 } 9690 if orc.Started != nil { 9691 objectMap["started"] = orc.Started 9692 } 9693 if orc.Updated != nil { 9694 objectMap["updated"] = orc.Updated 9695 } 9696 if orc.ResultInfo != nil { 9697 objectMap["resultInfo"] = orc.ResultInfo 9698 } 9699 if orc.Error != nil { 9700 objectMap["error"] = orc.Error 9701 } 9702 return json.Marshal(objectMap) 9703} 9704 9705// OperationResultLogItemContract log of the entity being created, updated or deleted. 9706type OperationResultLogItemContract struct { 9707 // ObjectType - The type of entity contract. 9708 ObjectType *string `json:"objectType,omitempty"` 9709 // Action - Action like create/update/delete. 9710 Action *string `json:"action,omitempty"` 9711 // ObjectKey - Identifier of the entity being created/updated/deleted. 9712 ObjectKey *string `json:"objectKey,omitempty"` 9713} 9714 9715// OperationTagResourceContractProperties operation Entity contract Properties. 9716type OperationTagResourceContractProperties struct { 9717 // ID - Identifier of the operation in form /operations/{operationId}. 9718 ID *string `json:"id,omitempty"` 9719 // Name - READ-ONLY; Operation name. 9720 Name *string `json:"name,omitempty"` 9721 // APIName - READ-ONLY; Api Name. 9722 APIName *string `json:"apiName,omitempty"` 9723 // APIRevision - READ-ONLY; Api Revision. 9724 APIRevision *string `json:"apiRevision,omitempty"` 9725 // APIVersion - READ-ONLY; Api Version. 9726 APIVersion *string `json:"apiVersion,omitempty"` 9727 // Description - READ-ONLY; Operation Description. 9728 Description *string `json:"description,omitempty"` 9729 // Method - READ-ONLY; A Valid HTTP Operation Method. Typical Http Methods like GET, PUT, POST but not limited by only them. 9730 Method *string `json:"method,omitempty"` 9731 // URLTemplate - READ-ONLY; Relative URL template identifying the target resource for this operation. May include parameters. Example: /customers/{cid}/orders/{oid}/?date={date} 9732 URLTemplate *string `json:"urlTemplate,omitempty"` 9733} 9734 9735// MarshalJSON is the custom marshaler for OperationTagResourceContractProperties. 9736func (otrcp OperationTagResourceContractProperties) MarshalJSON() ([]byte, error) { 9737 objectMap := make(map[string]interface{}) 9738 if otrcp.ID != nil { 9739 objectMap["id"] = otrcp.ID 9740 } 9741 return json.Marshal(objectMap) 9742} 9743 9744// OperationUpdateContract api Operation Update Contract details. 9745type OperationUpdateContract struct { 9746 // OperationUpdateContractProperties - Properties of the API Operation entity that can be updated. 9747 *OperationUpdateContractProperties `json:"properties,omitempty"` 9748} 9749 9750// MarshalJSON is the custom marshaler for OperationUpdateContract. 9751func (ouc OperationUpdateContract) MarshalJSON() ([]byte, error) { 9752 objectMap := make(map[string]interface{}) 9753 if ouc.OperationUpdateContractProperties != nil { 9754 objectMap["properties"] = ouc.OperationUpdateContractProperties 9755 } 9756 return json.Marshal(objectMap) 9757} 9758 9759// UnmarshalJSON is the custom unmarshaler for OperationUpdateContract struct. 9760func (ouc *OperationUpdateContract) UnmarshalJSON(body []byte) error { 9761 var m map[string]*json.RawMessage 9762 err := json.Unmarshal(body, &m) 9763 if err != nil { 9764 return err 9765 } 9766 for k, v := range m { 9767 switch k { 9768 case "properties": 9769 if v != nil { 9770 var operationUpdateContractProperties OperationUpdateContractProperties 9771 err = json.Unmarshal(*v, &operationUpdateContractProperties) 9772 if err != nil { 9773 return err 9774 } 9775 ouc.OperationUpdateContractProperties = &operationUpdateContractProperties 9776 } 9777 } 9778 } 9779 9780 return nil 9781} 9782 9783// OperationUpdateContractProperties operation Update Contract Properties. 9784type OperationUpdateContractProperties struct { 9785 // DisplayName - Operation Name. 9786 DisplayName *string `json:"displayName,omitempty"` 9787 // Method - A Valid HTTP Operation Method. Typical Http Methods like GET, PUT, POST but not limited by only them. 9788 Method *string `json:"method,omitempty"` 9789 // URLTemplate - Relative URL template identifying the target resource for this operation. May include parameters. Example: /customers/{cid}/orders/{oid}/?date={date} 9790 URLTemplate *string `json:"urlTemplate,omitempty"` 9791 // TemplateParameters - Collection of URL template parameters. 9792 TemplateParameters *[]ParameterContract `json:"templateParameters,omitempty"` 9793 // Description - Description of the operation. May include HTML formatting tags. 9794 Description *string `json:"description,omitempty"` 9795 // Request - An entity containing request details. 9796 Request *RequestContract `json:"request,omitempty"` 9797 // Responses - Array of Operation responses. 9798 Responses *[]ResponseContract `json:"responses,omitempty"` 9799 // Policies - Operation Policies 9800 Policies *string `json:"policies,omitempty"` 9801} 9802 9803// ParameterContract operation parameters details. 9804type ParameterContract struct { 9805 // Name - Parameter name. 9806 Name *string `json:"name,omitempty"` 9807 // Description - Parameter description. 9808 Description *string `json:"description,omitempty"` 9809 // Type - Parameter type. 9810 Type *string `json:"type,omitempty"` 9811 // DefaultValue - Default parameter value. 9812 DefaultValue *string `json:"defaultValue,omitempty"` 9813 // Required - Specifies whether parameter is required or not. 9814 Required *bool `json:"required,omitempty"` 9815 // Values - Parameter values. 9816 Values *[]string `json:"values,omitempty"` 9817} 9818 9819// PipelineDiagnosticSettings diagnostic settings for incoming/outgoing HTTP messages to the Gateway. 9820type PipelineDiagnosticSettings struct { 9821 // Request - Diagnostic settings for request. 9822 Request *HTTPMessageDiagnostic `json:"request,omitempty"` 9823 // Response - Diagnostic settings for response. 9824 Response *HTTPMessageDiagnostic `json:"response,omitempty"` 9825} 9826 9827// PolicyCollection the response of the list policy operation. 9828type PolicyCollection struct { 9829 autorest.Response `json:"-"` 9830 // Value - Policy Contract value. 9831 Value *[]PolicyContract `json:"value,omitempty"` 9832 // Count - Total record count number. 9833 Count *int64 `json:"count,omitempty"` 9834 // NextLink - Next page link if any. 9835 NextLink *string `json:"nextLink,omitempty"` 9836} 9837 9838// PolicyContract policy Contract details. 9839type PolicyContract struct { 9840 autorest.Response `json:"-"` 9841 // PolicyContractProperties - Properties of the Policy. 9842 *PolicyContractProperties `json:"properties,omitempty"` 9843 // ID - READ-ONLY; Resource ID. 9844 ID *string `json:"id,omitempty"` 9845 // Name - READ-ONLY; Resource name. 9846 Name *string `json:"name,omitempty"` 9847 // Type - READ-ONLY; Resource type for API Management resource. 9848 Type *string `json:"type,omitempty"` 9849} 9850 9851// MarshalJSON is the custom marshaler for PolicyContract. 9852func (pc PolicyContract) MarshalJSON() ([]byte, error) { 9853 objectMap := make(map[string]interface{}) 9854 if pc.PolicyContractProperties != nil { 9855 objectMap["properties"] = pc.PolicyContractProperties 9856 } 9857 return json.Marshal(objectMap) 9858} 9859 9860// UnmarshalJSON is the custom unmarshaler for PolicyContract struct. 9861func (pc *PolicyContract) UnmarshalJSON(body []byte) error { 9862 var m map[string]*json.RawMessage 9863 err := json.Unmarshal(body, &m) 9864 if err != nil { 9865 return err 9866 } 9867 for k, v := range m { 9868 switch k { 9869 case "properties": 9870 if v != nil { 9871 var policyContractProperties PolicyContractProperties 9872 err = json.Unmarshal(*v, &policyContractProperties) 9873 if err != nil { 9874 return err 9875 } 9876 pc.PolicyContractProperties = &policyContractProperties 9877 } 9878 case "id": 9879 if v != nil { 9880 var ID string 9881 err = json.Unmarshal(*v, &ID) 9882 if err != nil { 9883 return err 9884 } 9885 pc.ID = &ID 9886 } 9887 case "name": 9888 if v != nil { 9889 var name string 9890 err = json.Unmarshal(*v, &name) 9891 if err != nil { 9892 return err 9893 } 9894 pc.Name = &name 9895 } 9896 case "type": 9897 if v != nil { 9898 var typeVar string 9899 err = json.Unmarshal(*v, &typeVar) 9900 if err != nil { 9901 return err 9902 } 9903 pc.Type = &typeVar 9904 } 9905 } 9906 } 9907 9908 return nil 9909} 9910 9911// PolicyContractProperties policy contract Properties. 9912type PolicyContractProperties struct { 9913 // Value - Contents of the Policy as defined by the format. 9914 Value *string `json:"value,omitempty"` 9915 // Format - Format of the policyContent. Possible values include: 'XML', 'XMLLink', 'Rawxml', 'RawxmlLink' 9916 Format PolicyContentFormat `json:"format,omitempty"` 9917} 9918 9919// PolicyDescriptionCollection descriptions of APIM policies. 9920type PolicyDescriptionCollection struct { 9921 autorest.Response `json:"-"` 9922 // Value - Descriptions of APIM policies. 9923 Value *[]PolicyDescriptionContract `json:"value,omitempty"` 9924 // Count - Total record count number. 9925 Count *int64 `json:"count,omitempty"` 9926} 9927 9928// PolicyDescriptionContract policy description details. 9929type PolicyDescriptionContract struct { 9930 // PolicyDescriptionContractProperties - Policy description contract properties. 9931 *PolicyDescriptionContractProperties `json:"properties,omitempty"` 9932 // ID - READ-ONLY; Resource ID. 9933 ID *string `json:"id,omitempty"` 9934 // Name - READ-ONLY; Resource name. 9935 Name *string `json:"name,omitempty"` 9936 // Type - READ-ONLY; Resource type for API Management resource. 9937 Type *string `json:"type,omitempty"` 9938} 9939 9940// MarshalJSON is the custom marshaler for PolicyDescriptionContract. 9941func (pdc PolicyDescriptionContract) MarshalJSON() ([]byte, error) { 9942 objectMap := make(map[string]interface{}) 9943 if pdc.PolicyDescriptionContractProperties != nil { 9944 objectMap["properties"] = pdc.PolicyDescriptionContractProperties 9945 } 9946 return json.Marshal(objectMap) 9947} 9948 9949// UnmarshalJSON is the custom unmarshaler for PolicyDescriptionContract struct. 9950func (pdc *PolicyDescriptionContract) UnmarshalJSON(body []byte) error { 9951 var m map[string]*json.RawMessage 9952 err := json.Unmarshal(body, &m) 9953 if err != nil { 9954 return err 9955 } 9956 for k, v := range m { 9957 switch k { 9958 case "properties": 9959 if v != nil { 9960 var policyDescriptionContractProperties PolicyDescriptionContractProperties 9961 err = json.Unmarshal(*v, &policyDescriptionContractProperties) 9962 if err != nil { 9963 return err 9964 } 9965 pdc.PolicyDescriptionContractProperties = &policyDescriptionContractProperties 9966 } 9967 case "id": 9968 if v != nil { 9969 var ID string 9970 err = json.Unmarshal(*v, &ID) 9971 if err != nil { 9972 return err 9973 } 9974 pdc.ID = &ID 9975 } 9976 case "name": 9977 if v != nil { 9978 var name string 9979 err = json.Unmarshal(*v, &name) 9980 if err != nil { 9981 return err 9982 } 9983 pdc.Name = &name 9984 } 9985 case "type": 9986 if v != nil { 9987 var typeVar string 9988 err = json.Unmarshal(*v, &typeVar) 9989 if err != nil { 9990 return err 9991 } 9992 pdc.Type = &typeVar 9993 } 9994 } 9995 } 9996 9997 return nil 9998} 9999 10000// PolicyDescriptionContractProperties policy description properties. 10001type PolicyDescriptionContractProperties struct { 10002 // Description - READ-ONLY; Policy description. 10003 Description *string `json:"description,omitempty"` 10004 // Scope - READ-ONLY; Binary OR value of the Snippet scope. 10005 Scope *int64 `json:"scope,omitempty"` 10006} 10007 10008// MarshalJSON is the custom marshaler for PolicyDescriptionContractProperties. 10009func (pdcp PolicyDescriptionContractProperties) MarshalJSON() ([]byte, error) { 10010 objectMap := make(map[string]interface{}) 10011 return json.Marshal(objectMap) 10012} 10013 10014// PortalDelegationSettings delegation settings for a developer portal. 10015type PortalDelegationSettings struct { 10016 autorest.Response `json:"-"` 10017 // PortalDelegationSettingsProperties - Delegation settings contract properties. 10018 *PortalDelegationSettingsProperties `json:"properties,omitempty"` 10019 // ID - READ-ONLY; Resource ID. 10020 ID *string `json:"id,omitempty"` 10021 // Name - READ-ONLY; Resource name. 10022 Name *string `json:"name,omitempty"` 10023 // Type - READ-ONLY; Resource type for API Management resource. 10024 Type *string `json:"type,omitempty"` 10025} 10026 10027// MarshalJSON is the custom marshaler for PortalDelegationSettings. 10028func (pds PortalDelegationSettings) MarshalJSON() ([]byte, error) { 10029 objectMap := make(map[string]interface{}) 10030 if pds.PortalDelegationSettingsProperties != nil { 10031 objectMap["properties"] = pds.PortalDelegationSettingsProperties 10032 } 10033 return json.Marshal(objectMap) 10034} 10035 10036// UnmarshalJSON is the custom unmarshaler for PortalDelegationSettings struct. 10037func (pds *PortalDelegationSettings) UnmarshalJSON(body []byte) error { 10038 var m map[string]*json.RawMessage 10039 err := json.Unmarshal(body, &m) 10040 if err != nil { 10041 return err 10042 } 10043 for k, v := range m { 10044 switch k { 10045 case "properties": 10046 if v != nil { 10047 var portalDelegationSettingsProperties PortalDelegationSettingsProperties 10048 err = json.Unmarshal(*v, &portalDelegationSettingsProperties) 10049 if err != nil { 10050 return err 10051 } 10052 pds.PortalDelegationSettingsProperties = &portalDelegationSettingsProperties 10053 } 10054 case "id": 10055 if v != nil { 10056 var ID string 10057 err = json.Unmarshal(*v, &ID) 10058 if err != nil { 10059 return err 10060 } 10061 pds.ID = &ID 10062 } 10063 case "name": 10064 if v != nil { 10065 var name string 10066 err = json.Unmarshal(*v, &name) 10067 if err != nil { 10068 return err 10069 } 10070 pds.Name = &name 10071 } 10072 case "type": 10073 if v != nil { 10074 var typeVar string 10075 err = json.Unmarshal(*v, &typeVar) 10076 if err != nil { 10077 return err 10078 } 10079 pds.Type = &typeVar 10080 } 10081 } 10082 } 10083 10084 return nil 10085} 10086 10087// PortalDelegationSettingsProperties delegation settings contract properties. 10088type PortalDelegationSettingsProperties struct { 10089 // URL - A delegation Url. 10090 URL *string `json:"url,omitempty"` 10091 // ValidationKey - A base64-encoded validation key to validate, that a request is coming from Azure API Management. 10092 ValidationKey *string `json:"validationKey,omitempty"` 10093 // Subscriptions - Subscriptions delegation settings. 10094 Subscriptions *SubscriptionsDelegationSettingsProperties `json:"subscriptions,omitempty"` 10095 // UserRegistration - User registration delegation settings. 10096 UserRegistration *RegistrationDelegationSettingsProperties `json:"userRegistration,omitempty"` 10097} 10098 10099// PortalRevisionCollection paged list of portal revisions. 10100type PortalRevisionCollection struct { 10101 autorest.Response `json:"-"` 10102 // Value - READ-ONLY; Collection of portal revisions. 10103 Value *[]PortalRevisionContract `json:"value,omitempty"` 10104 // NextLink - READ-ONLY; Next page link, if any. 10105 NextLink *string `json:"nextLink,omitempty"` 10106} 10107 10108// MarshalJSON is the custom marshaler for PortalRevisionCollection. 10109func (prc PortalRevisionCollection) MarshalJSON() ([]byte, error) { 10110 objectMap := make(map[string]interface{}) 10111 return json.Marshal(objectMap) 10112} 10113 10114// PortalRevisionCollectionIterator provides access to a complete listing of PortalRevisionContract values. 10115type PortalRevisionCollectionIterator struct { 10116 i int 10117 page PortalRevisionCollectionPage 10118} 10119 10120// NextWithContext advances to the next value. If there was an error making 10121// the request the iterator does not advance and the error is returned. 10122func (iter *PortalRevisionCollectionIterator) NextWithContext(ctx context.Context) (err error) { 10123 if tracing.IsEnabled() { 10124 ctx = tracing.StartSpan(ctx, fqdn+"/PortalRevisionCollectionIterator.NextWithContext") 10125 defer func() { 10126 sc := -1 10127 if iter.Response().Response.Response != nil { 10128 sc = iter.Response().Response.Response.StatusCode 10129 } 10130 tracing.EndSpan(ctx, sc, err) 10131 }() 10132 } 10133 iter.i++ 10134 if iter.i < len(iter.page.Values()) { 10135 return nil 10136 } 10137 err = iter.page.NextWithContext(ctx) 10138 if err != nil { 10139 iter.i-- 10140 return err 10141 } 10142 iter.i = 0 10143 return nil 10144} 10145 10146// Next advances to the next value. If there was an error making 10147// the request the iterator does not advance and the error is returned. 10148// Deprecated: Use NextWithContext() instead. 10149func (iter *PortalRevisionCollectionIterator) Next() error { 10150 return iter.NextWithContext(context.Background()) 10151} 10152 10153// NotDone returns true if the enumeration should be started or is not yet complete. 10154func (iter PortalRevisionCollectionIterator) NotDone() bool { 10155 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 10156} 10157 10158// Response returns the raw server response from the last page request. 10159func (iter PortalRevisionCollectionIterator) Response() PortalRevisionCollection { 10160 return iter.page.Response() 10161} 10162 10163// Value returns the current value or a zero-initialized value if the 10164// iterator has advanced beyond the end of the collection. 10165func (iter PortalRevisionCollectionIterator) Value() PortalRevisionContract { 10166 if !iter.page.NotDone() { 10167 return PortalRevisionContract{} 10168 } 10169 return iter.page.Values()[iter.i] 10170} 10171 10172// Creates a new instance of the PortalRevisionCollectionIterator type. 10173func NewPortalRevisionCollectionIterator(page PortalRevisionCollectionPage) PortalRevisionCollectionIterator { 10174 return PortalRevisionCollectionIterator{page: page} 10175} 10176 10177// IsEmpty returns true if the ListResult contains no values. 10178func (prc PortalRevisionCollection) IsEmpty() bool { 10179 return prc.Value == nil || len(*prc.Value) == 0 10180} 10181 10182// hasNextLink returns true if the NextLink is not empty. 10183func (prc PortalRevisionCollection) hasNextLink() bool { 10184 return prc.NextLink != nil && len(*prc.NextLink) != 0 10185} 10186 10187// portalRevisionCollectionPreparer prepares a request to retrieve the next set of results. 10188// It returns nil if no more results exist. 10189func (prc PortalRevisionCollection) portalRevisionCollectionPreparer(ctx context.Context) (*http.Request, error) { 10190 if !prc.hasNextLink() { 10191 return nil, nil 10192 } 10193 return autorest.Prepare((&http.Request{}).WithContext(ctx), 10194 autorest.AsJSON(), 10195 autorest.AsGet(), 10196 autorest.WithBaseURL(to.String(prc.NextLink))) 10197} 10198 10199// PortalRevisionCollectionPage contains a page of PortalRevisionContract values. 10200type PortalRevisionCollectionPage struct { 10201 fn func(context.Context, PortalRevisionCollection) (PortalRevisionCollection, error) 10202 prc PortalRevisionCollection 10203} 10204 10205// NextWithContext advances to the next page of values. If there was an error making 10206// the request the page does not advance and the error is returned. 10207func (page *PortalRevisionCollectionPage) NextWithContext(ctx context.Context) (err error) { 10208 if tracing.IsEnabled() { 10209 ctx = tracing.StartSpan(ctx, fqdn+"/PortalRevisionCollectionPage.NextWithContext") 10210 defer func() { 10211 sc := -1 10212 if page.Response().Response.Response != nil { 10213 sc = page.Response().Response.Response.StatusCode 10214 } 10215 tracing.EndSpan(ctx, sc, err) 10216 }() 10217 } 10218 for { 10219 next, err := page.fn(ctx, page.prc) 10220 if err != nil { 10221 return err 10222 } 10223 page.prc = next 10224 if !next.hasNextLink() || !next.IsEmpty() { 10225 break 10226 } 10227 } 10228 return nil 10229} 10230 10231// Next advances to the next page of values. If there was an error making 10232// the request the page does not advance and the error is returned. 10233// Deprecated: Use NextWithContext() instead. 10234func (page *PortalRevisionCollectionPage) Next() error { 10235 return page.NextWithContext(context.Background()) 10236} 10237 10238// NotDone returns true if the page enumeration should be started or is not yet complete. 10239func (page PortalRevisionCollectionPage) NotDone() bool { 10240 return !page.prc.IsEmpty() 10241} 10242 10243// Response returns the raw server response from the last page request. 10244func (page PortalRevisionCollectionPage) Response() PortalRevisionCollection { 10245 return page.prc 10246} 10247 10248// Values returns the slice of values for the current page or nil if there are no values. 10249func (page PortalRevisionCollectionPage) Values() []PortalRevisionContract { 10250 if page.prc.IsEmpty() { 10251 return nil 10252 } 10253 return *page.prc.Value 10254} 10255 10256// Creates a new instance of the PortalRevisionCollectionPage type. 10257func NewPortalRevisionCollectionPage(cur PortalRevisionCollection, getNextPage func(context.Context, PortalRevisionCollection) (PortalRevisionCollection, error)) PortalRevisionCollectionPage { 10258 return PortalRevisionCollectionPage{ 10259 fn: getNextPage, 10260 prc: cur, 10261 } 10262} 10263 10264// PortalRevisionContract portal revisions contract details. 10265type PortalRevisionContract struct { 10266 autorest.Response `json:"-"` 10267 // PortalRevisionContractProperties - Properties of the portal revisions. 10268 *PortalRevisionContractProperties `json:"properties,omitempty"` 10269 // ID - READ-ONLY; Resource ID. 10270 ID *string `json:"id,omitempty"` 10271 // Name - READ-ONLY; Resource name. 10272 Name *string `json:"name,omitempty"` 10273 // Type - READ-ONLY; Resource type for API Management resource. 10274 Type *string `json:"type,omitempty"` 10275} 10276 10277// MarshalJSON is the custom marshaler for PortalRevisionContract. 10278func (prc PortalRevisionContract) MarshalJSON() ([]byte, error) { 10279 objectMap := make(map[string]interface{}) 10280 if prc.PortalRevisionContractProperties != nil { 10281 objectMap["properties"] = prc.PortalRevisionContractProperties 10282 } 10283 return json.Marshal(objectMap) 10284} 10285 10286// UnmarshalJSON is the custom unmarshaler for PortalRevisionContract struct. 10287func (prc *PortalRevisionContract) UnmarshalJSON(body []byte) error { 10288 var m map[string]*json.RawMessage 10289 err := json.Unmarshal(body, &m) 10290 if err != nil { 10291 return err 10292 } 10293 for k, v := range m { 10294 switch k { 10295 case "properties": 10296 if v != nil { 10297 var portalRevisionContractProperties PortalRevisionContractProperties 10298 err = json.Unmarshal(*v, &portalRevisionContractProperties) 10299 if err != nil { 10300 return err 10301 } 10302 prc.PortalRevisionContractProperties = &portalRevisionContractProperties 10303 } 10304 case "id": 10305 if v != nil { 10306 var ID string 10307 err = json.Unmarshal(*v, &ID) 10308 if err != nil { 10309 return err 10310 } 10311 prc.ID = &ID 10312 } 10313 case "name": 10314 if v != nil { 10315 var name string 10316 err = json.Unmarshal(*v, &name) 10317 if err != nil { 10318 return err 10319 } 10320 prc.Name = &name 10321 } 10322 case "type": 10323 if v != nil { 10324 var typeVar string 10325 err = json.Unmarshal(*v, &typeVar) 10326 if err != nil { 10327 return err 10328 } 10329 prc.Type = &typeVar 10330 } 10331 } 10332 } 10333 10334 return nil 10335} 10336 10337// PortalRevisionContractProperties ... 10338type PortalRevisionContractProperties struct { 10339 // Description - Portal revision description. 10340 Description *string `json:"description,omitempty"` 10341 // StatusDetails - READ-ONLY; Portal revision publishing status details. 10342 StatusDetails *string `json:"statusDetails,omitempty"` 10343 // Status - READ-ONLY; Portal revision publishing status. Possible values include: 'PortalRevisionStatusPending', 'PortalRevisionStatusPublishing', 'PortalRevisionStatusCompleted', 'PortalRevisionStatusFailed' 10344 Status PortalRevisionStatus `json:"status,omitempty"` 10345 // IsCurrent - Indicates if the Portal Revision is public. 10346 IsCurrent *bool `json:"isCurrent,omitempty"` 10347 // CreatedDateTime - READ-ONLY; Portal revision creation date and time. 10348 CreatedDateTime *date.Time `json:"createdDateTime,omitempty"` 10349 // UpdatedDateTime - READ-ONLY; Last updated date and time. 10350 UpdatedDateTime *date.Time `json:"updatedDateTime,omitempty"` 10351} 10352 10353// MarshalJSON is the custom marshaler for PortalRevisionContractProperties. 10354func (prcp PortalRevisionContractProperties) MarshalJSON() ([]byte, error) { 10355 objectMap := make(map[string]interface{}) 10356 if prcp.Description != nil { 10357 objectMap["description"] = prcp.Description 10358 } 10359 if prcp.IsCurrent != nil { 10360 objectMap["isCurrent"] = prcp.IsCurrent 10361 } 10362 return json.Marshal(objectMap) 10363} 10364 10365// PortalRevisionCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a 10366// long-running operation. 10367type PortalRevisionCreateOrUpdateFuture struct { 10368 azure.FutureAPI 10369 // Result returns the result of the asynchronous operation. 10370 // If the operation has not completed it will return an error. 10371 Result func(PortalRevisionClient) (PortalRevisionContract, error) 10372} 10373 10374// UnmarshalJSON is the custom unmarshaller for CreateFuture. 10375func (future *PortalRevisionCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 10376 var azFuture azure.Future 10377 if err := json.Unmarshal(body, &azFuture); err != nil { 10378 return err 10379 } 10380 future.FutureAPI = &azFuture 10381 future.Result = future.result 10382 return nil 10383} 10384 10385// result is the default implementation for PortalRevisionCreateOrUpdateFuture.Result. 10386func (future *PortalRevisionCreateOrUpdateFuture) result(client PortalRevisionClient) (prc PortalRevisionContract, err error) { 10387 var done bool 10388 done, err = future.DoneWithContext(context.Background(), client) 10389 if err != nil { 10390 err = autorest.NewErrorWithError(err, "apimanagement.PortalRevisionCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 10391 return 10392 } 10393 if !done { 10394 prc.Response.Response = future.Response() 10395 err = azure.NewAsyncOpIncompleteError("apimanagement.PortalRevisionCreateOrUpdateFuture") 10396 return 10397 } 10398 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 10399 if prc.Response.Response, err = future.GetResult(sender); err == nil && prc.Response.Response.StatusCode != http.StatusNoContent { 10400 prc, err = client.CreateOrUpdateResponder(prc.Response.Response) 10401 if err != nil { 10402 err = autorest.NewErrorWithError(err, "apimanagement.PortalRevisionCreateOrUpdateFuture", "Result", prc.Response.Response, "Failure responding to request") 10403 } 10404 } 10405 return 10406} 10407 10408// PortalRevisionUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 10409// operation. 10410type PortalRevisionUpdateFuture struct { 10411 azure.FutureAPI 10412 // Result returns the result of the asynchronous operation. 10413 // If the operation has not completed it will return an error. 10414 Result func(PortalRevisionClient) (PortalRevisionContract, error) 10415} 10416 10417// UnmarshalJSON is the custom unmarshaller for CreateFuture. 10418func (future *PortalRevisionUpdateFuture) UnmarshalJSON(body []byte) error { 10419 var azFuture azure.Future 10420 if err := json.Unmarshal(body, &azFuture); err != nil { 10421 return err 10422 } 10423 future.FutureAPI = &azFuture 10424 future.Result = future.result 10425 return nil 10426} 10427 10428// result is the default implementation for PortalRevisionUpdateFuture.Result. 10429func (future *PortalRevisionUpdateFuture) result(client PortalRevisionClient) (prc PortalRevisionContract, err error) { 10430 var done bool 10431 done, err = future.DoneWithContext(context.Background(), client) 10432 if err != nil { 10433 err = autorest.NewErrorWithError(err, "apimanagement.PortalRevisionUpdateFuture", "Result", future.Response(), "Polling failure") 10434 return 10435 } 10436 if !done { 10437 prc.Response.Response = future.Response() 10438 err = azure.NewAsyncOpIncompleteError("apimanagement.PortalRevisionUpdateFuture") 10439 return 10440 } 10441 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 10442 if prc.Response.Response, err = future.GetResult(sender); err == nil && prc.Response.Response.StatusCode != http.StatusNoContent { 10443 prc, err = client.UpdateResponder(prc.Response.Response) 10444 if err != nil { 10445 err = autorest.NewErrorWithError(err, "apimanagement.PortalRevisionUpdateFuture", "Result", prc.Response.Response, "Failure responding to request") 10446 } 10447 } 10448 return 10449} 10450 10451// PortalSettingsCollection descriptions of APIM policies. 10452type PortalSettingsCollection struct { 10453 autorest.Response `json:"-"` 10454 // Value - Descriptions of APIM policies. 10455 Value *[]PortalSettingsContract `json:"value,omitempty"` 10456 // Count - Total record count number. 10457 Count *int64 `json:"count,omitempty"` 10458} 10459 10460// PortalSettingsContract portal Settings for the Developer Portal. 10461type PortalSettingsContract struct { 10462 // PortalSettingsContractProperties - Portal Settings contract properties. 10463 *PortalSettingsContractProperties `json:"properties,omitempty"` 10464 // ID - READ-ONLY; Resource ID. 10465 ID *string `json:"id,omitempty"` 10466 // Name - READ-ONLY; Resource name. 10467 Name *string `json:"name,omitempty"` 10468 // Type - READ-ONLY; Resource type for API Management resource. 10469 Type *string `json:"type,omitempty"` 10470} 10471 10472// MarshalJSON is the custom marshaler for PortalSettingsContract. 10473func (psc PortalSettingsContract) MarshalJSON() ([]byte, error) { 10474 objectMap := make(map[string]interface{}) 10475 if psc.PortalSettingsContractProperties != nil { 10476 objectMap["properties"] = psc.PortalSettingsContractProperties 10477 } 10478 return json.Marshal(objectMap) 10479} 10480 10481// UnmarshalJSON is the custom unmarshaler for PortalSettingsContract struct. 10482func (psc *PortalSettingsContract) UnmarshalJSON(body []byte) error { 10483 var m map[string]*json.RawMessage 10484 err := json.Unmarshal(body, &m) 10485 if err != nil { 10486 return err 10487 } 10488 for k, v := range m { 10489 switch k { 10490 case "properties": 10491 if v != nil { 10492 var portalSettingsContractProperties PortalSettingsContractProperties 10493 err = json.Unmarshal(*v, &portalSettingsContractProperties) 10494 if err != nil { 10495 return err 10496 } 10497 psc.PortalSettingsContractProperties = &portalSettingsContractProperties 10498 } 10499 case "id": 10500 if v != nil { 10501 var ID string 10502 err = json.Unmarshal(*v, &ID) 10503 if err != nil { 10504 return err 10505 } 10506 psc.ID = &ID 10507 } 10508 case "name": 10509 if v != nil { 10510 var name string 10511 err = json.Unmarshal(*v, &name) 10512 if err != nil { 10513 return err 10514 } 10515 psc.Name = &name 10516 } 10517 case "type": 10518 if v != nil { 10519 var typeVar string 10520 err = json.Unmarshal(*v, &typeVar) 10521 if err != nil { 10522 return err 10523 } 10524 psc.Type = &typeVar 10525 } 10526 } 10527 } 10528 10529 return nil 10530} 10531 10532// PortalSettingsContractProperties sign-in settings contract properties. 10533type PortalSettingsContractProperties struct { 10534 // URL - A delegation Url. 10535 URL *string `json:"url,omitempty"` 10536 // ValidationKey - A base64-encoded validation key to validate, that a request is coming from Azure API Management. 10537 ValidationKey *string `json:"validationKey,omitempty"` 10538 // Subscriptions - Subscriptions delegation settings. 10539 Subscriptions *SubscriptionsDelegationSettingsProperties `json:"subscriptions,omitempty"` 10540 // UserRegistration - User registration delegation settings. 10541 UserRegistration *RegistrationDelegationSettingsProperties `json:"userRegistration,omitempty"` 10542 // Enabled - Redirect Anonymous users to the Sign-In page. 10543 Enabled *bool `json:"enabled,omitempty"` 10544 // TermsOfService - Terms of service contract properties. 10545 TermsOfService *TermsOfServiceProperties `json:"termsOfService,omitempty"` 10546} 10547 10548// PortalSettingValidationKeyContract client or app secret used in IdentityProviders, Aad, OpenID or OAuth. 10549type PortalSettingValidationKeyContract struct { 10550 autorest.Response `json:"-"` 10551 // ValidationKey - This is secret value of the validation key in portal settings. 10552 ValidationKey *string `json:"validationKey,omitempty"` 10553} 10554 10555// PortalSigninSettingProperties sign-in settings contract properties. 10556type PortalSigninSettingProperties struct { 10557 // Enabled - Redirect Anonymous users to the Sign-In page. 10558 Enabled *bool `json:"enabled,omitempty"` 10559} 10560 10561// PortalSigninSettings sign-In settings for the Developer Portal. 10562type PortalSigninSettings struct { 10563 autorest.Response `json:"-"` 10564 // PortalSigninSettingProperties - Sign-in settings contract properties. 10565 *PortalSigninSettingProperties `json:"properties,omitempty"` 10566 // ID - READ-ONLY; Resource ID. 10567 ID *string `json:"id,omitempty"` 10568 // Name - READ-ONLY; Resource name. 10569 Name *string `json:"name,omitempty"` 10570 // Type - READ-ONLY; Resource type for API Management resource. 10571 Type *string `json:"type,omitempty"` 10572} 10573 10574// MarshalJSON is the custom marshaler for PortalSigninSettings. 10575func (pss PortalSigninSettings) MarshalJSON() ([]byte, error) { 10576 objectMap := make(map[string]interface{}) 10577 if pss.PortalSigninSettingProperties != nil { 10578 objectMap["properties"] = pss.PortalSigninSettingProperties 10579 } 10580 return json.Marshal(objectMap) 10581} 10582 10583// UnmarshalJSON is the custom unmarshaler for PortalSigninSettings struct. 10584func (pss *PortalSigninSettings) UnmarshalJSON(body []byte) error { 10585 var m map[string]*json.RawMessage 10586 err := json.Unmarshal(body, &m) 10587 if err != nil { 10588 return err 10589 } 10590 for k, v := range m { 10591 switch k { 10592 case "properties": 10593 if v != nil { 10594 var portalSigninSettingProperties PortalSigninSettingProperties 10595 err = json.Unmarshal(*v, &portalSigninSettingProperties) 10596 if err != nil { 10597 return err 10598 } 10599 pss.PortalSigninSettingProperties = &portalSigninSettingProperties 10600 } 10601 case "id": 10602 if v != nil { 10603 var ID string 10604 err = json.Unmarshal(*v, &ID) 10605 if err != nil { 10606 return err 10607 } 10608 pss.ID = &ID 10609 } 10610 case "name": 10611 if v != nil { 10612 var name string 10613 err = json.Unmarshal(*v, &name) 10614 if err != nil { 10615 return err 10616 } 10617 pss.Name = &name 10618 } 10619 case "type": 10620 if v != nil { 10621 var typeVar string 10622 err = json.Unmarshal(*v, &typeVar) 10623 if err != nil { 10624 return err 10625 } 10626 pss.Type = &typeVar 10627 } 10628 } 10629 } 10630 10631 return nil 10632} 10633 10634// PortalSignupSettings sign-Up settings for a developer portal. 10635type PortalSignupSettings struct { 10636 autorest.Response `json:"-"` 10637 // PortalSignupSettingsProperties - Sign-up settings contract properties. 10638 *PortalSignupSettingsProperties `json:"properties,omitempty"` 10639 // ID - READ-ONLY; Resource ID. 10640 ID *string `json:"id,omitempty"` 10641 // Name - READ-ONLY; Resource name. 10642 Name *string `json:"name,omitempty"` 10643 // Type - READ-ONLY; Resource type for API Management resource. 10644 Type *string `json:"type,omitempty"` 10645} 10646 10647// MarshalJSON is the custom marshaler for PortalSignupSettings. 10648func (pss PortalSignupSettings) MarshalJSON() ([]byte, error) { 10649 objectMap := make(map[string]interface{}) 10650 if pss.PortalSignupSettingsProperties != nil { 10651 objectMap["properties"] = pss.PortalSignupSettingsProperties 10652 } 10653 return json.Marshal(objectMap) 10654} 10655 10656// UnmarshalJSON is the custom unmarshaler for PortalSignupSettings struct. 10657func (pss *PortalSignupSettings) UnmarshalJSON(body []byte) error { 10658 var m map[string]*json.RawMessage 10659 err := json.Unmarshal(body, &m) 10660 if err != nil { 10661 return err 10662 } 10663 for k, v := range m { 10664 switch k { 10665 case "properties": 10666 if v != nil { 10667 var portalSignupSettingsProperties PortalSignupSettingsProperties 10668 err = json.Unmarshal(*v, &portalSignupSettingsProperties) 10669 if err != nil { 10670 return err 10671 } 10672 pss.PortalSignupSettingsProperties = &portalSignupSettingsProperties 10673 } 10674 case "id": 10675 if v != nil { 10676 var ID string 10677 err = json.Unmarshal(*v, &ID) 10678 if err != nil { 10679 return err 10680 } 10681 pss.ID = &ID 10682 } 10683 case "name": 10684 if v != nil { 10685 var name string 10686 err = json.Unmarshal(*v, &name) 10687 if err != nil { 10688 return err 10689 } 10690 pss.Name = &name 10691 } 10692 case "type": 10693 if v != nil { 10694 var typeVar string 10695 err = json.Unmarshal(*v, &typeVar) 10696 if err != nil { 10697 return err 10698 } 10699 pss.Type = &typeVar 10700 } 10701 } 10702 } 10703 10704 return nil 10705} 10706 10707// PortalSignupSettingsProperties sign-up settings contract properties. 10708type PortalSignupSettingsProperties struct { 10709 // Enabled - Allow users to sign up on a developer portal. 10710 Enabled *bool `json:"enabled,omitempty"` 10711 // TermsOfService - Terms of service contract properties. 10712 TermsOfService *TermsOfServiceProperties `json:"termsOfService,omitempty"` 10713} 10714 10715// ProductCollection paged Products list representation. 10716type ProductCollection struct { 10717 autorest.Response `json:"-"` 10718 // Value - Page values. 10719 Value *[]ProductContract `json:"value,omitempty"` 10720 // Count - Total record count number across all pages. 10721 Count *int64 `json:"count,omitempty"` 10722 // NextLink - Next page link if any. 10723 NextLink *string `json:"nextLink,omitempty"` 10724} 10725 10726// ProductCollectionIterator provides access to a complete listing of ProductContract values. 10727type ProductCollectionIterator struct { 10728 i int 10729 page ProductCollectionPage 10730} 10731 10732// NextWithContext advances to the next value. If there was an error making 10733// the request the iterator does not advance and the error is returned. 10734func (iter *ProductCollectionIterator) NextWithContext(ctx context.Context) (err error) { 10735 if tracing.IsEnabled() { 10736 ctx = tracing.StartSpan(ctx, fqdn+"/ProductCollectionIterator.NextWithContext") 10737 defer func() { 10738 sc := -1 10739 if iter.Response().Response.Response != nil { 10740 sc = iter.Response().Response.Response.StatusCode 10741 } 10742 tracing.EndSpan(ctx, sc, err) 10743 }() 10744 } 10745 iter.i++ 10746 if iter.i < len(iter.page.Values()) { 10747 return nil 10748 } 10749 err = iter.page.NextWithContext(ctx) 10750 if err != nil { 10751 iter.i-- 10752 return err 10753 } 10754 iter.i = 0 10755 return nil 10756} 10757 10758// Next advances to the next value. If there was an error making 10759// the request the iterator does not advance and the error is returned. 10760// Deprecated: Use NextWithContext() instead. 10761func (iter *ProductCollectionIterator) Next() error { 10762 return iter.NextWithContext(context.Background()) 10763} 10764 10765// NotDone returns true if the enumeration should be started or is not yet complete. 10766func (iter ProductCollectionIterator) NotDone() bool { 10767 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 10768} 10769 10770// Response returns the raw server response from the last page request. 10771func (iter ProductCollectionIterator) Response() ProductCollection { 10772 return iter.page.Response() 10773} 10774 10775// Value returns the current value or a zero-initialized value if the 10776// iterator has advanced beyond the end of the collection. 10777func (iter ProductCollectionIterator) Value() ProductContract { 10778 if !iter.page.NotDone() { 10779 return ProductContract{} 10780 } 10781 return iter.page.Values()[iter.i] 10782} 10783 10784// Creates a new instance of the ProductCollectionIterator type. 10785func NewProductCollectionIterator(page ProductCollectionPage) ProductCollectionIterator { 10786 return ProductCollectionIterator{page: page} 10787} 10788 10789// IsEmpty returns true if the ListResult contains no values. 10790func (pc ProductCollection) IsEmpty() bool { 10791 return pc.Value == nil || len(*pc.Value) == 0 10792} 10793 10794// hasNextLink returns true if the NextLink is not empty. 10795func (pc ProductCollection) hasNextLink() bool { 10796 return pc.NextLink != nil && len(*pc.NextLink) != 0 10797} 10798 10799// productCollectionPreparer prepares a request to retrieve the next set of results. 10800// It returns nil if no more results exist. 10801func (pc ProductCollection) productCollectionPreparer(ctx context.Context) (*http.Request, error) { 10802 if !pc.hasNextLink() { 10803 return nil, nil 10804 } 10805 return autorest.Prepare((&http.Request{}).WithContext(ctx), 10806 autorest.AsJSON(), 10807 autorest.AsGet(), 10808 autorest.WithBaseURL(to.String(pc.NextLink))) 10809} 10810 10811// ProductCollectionPage contains a page of ProductContract values. 10812type ProductCollectionPage struct { 10813 fn func(context.Context, ProductCollection) (ProductCollection, error) 10814 pc ProductCollection 10815} 10816 10817// NextWithContext advances to the next page of values. If there was an error making 10818// the request the page does not advance and the error is returned. 10819func (page *ProductCollectionPage) NextWithContext(ctx context.Context) (err error) { 10820 if tracing.IsEnabled() { 10821 ctx = tracing.StartSpan(ctx, fqdn+"/ProductCollectionPage.NextWithContext") 10822 defer func() { 10823 sc := -1 10824 if page.Response().Response.Response != nil { 10825 sc = page.Response().Response.Response.StatusCode 10826 } 10827 tracing.EndSpan(ctx, sc, err) 10828 }() 10829 } 10830 for { 10831 next, err := page.fn(ctx, page.pc) 10832 if err != nil { 10833 return err 10834 } 10835 page.pc = next 10836 if !next.hasNextLink() || !next.IsEmpty() { 10837 break 10838 } 10839 } 10840 return nil 10841} 10842 10843// Next advances to the next page of values. If there was an error making 10844// the request the page does not advance and the error is returned. 10845// Deprecated: Use NextWithContext() instead. 10846func (page *ProductCollectionPage) Next() error { 10847 return page.NextWithContext(context.Background()) 10848} 10849 10850// NotDone returns true if the page enumeration should be started or is not yet complete. 10851func (page ProductCollectionPage) NotDone() bool { 10852 return !page.pc.IsEmpty() 10853} 10854 10855// Response returns the raw server response from the last page request. 10856func (page ProductCollectionPage) Response() ProductCollection { 10857 return page.pc 10858} 10859 10860// Values returns the slice of values for the current page or nil if there are no values. 10861func (page ProductCollectionPage) Values() []ProductContract { 10862 if page.pc.IsEmpty() { 10863 return nil 10864 } 10865 return *page.pc.Value 10866} 10867 10868// Creates a new instance of the ProductCollectionPage type. 10869func NewProductCollectionPage(cur ProductCollection, getNextPage func(context.Context, ProductCollection) (ProductCollection, error)) ProductCollectionPage { 10870 return ProductCollectionPage{ 10871 fn: getNextPage, 10872 pc: cur, 10873 } 10874} 10875 10876// ProductContract product details. 10877type ProductContract struct { 10878 autorest.Response `json:"-"` 10879 // ProductContractProperties - Product entity contract properties. 10880 *ProductContractProperties `json:"properties,omitempty"` 10881 // ID - READ-ONLY; Resource ID. 10882 ID *string `json:"id,omitempty"` 10883 // Name - READ-ONLY; Resource name. 10884 Name *string `json:"name,omitempty"` 10885 // Type - READ-ONLY; Resource type for API Management resource. 10886 Type *string `json:"type,omitempty"` 10887} 10888 10889// MarshalJSON is the custom marshaler for ProductContract. 10890func (pc ProductContract) MarshalJSON() ([]byte, error) { 10891 objectMap := make(map[string]interface{}) 10892 if pc.ProductContractProperties != nil { 10893 objectMap["properties"] = pc.ProductContractProperties 10894 } 10895 return json.Marshal(objectMap) 10896} 10897 10898// UnmarshalJSON is the custom unmarshaler for ProductContract struct. 10899func (pc *ProductContract) UnmarshalJSON(body []byte) error { 10900 var m map[string]*json.RawMessage 10901 err := json.Unmarshal(body, &m) 10902 if err != nil { 10903 return err 10904 } 10905 for k, v := range m { 10906 switch k { 10907 case "properties": 10908 if v != nil { 10909 var productContractProperties ProductContractProperties 10910 err = json.Unmarshal(*v, &productContractProperties) 10911 if err != nil { 10912 return err 10913 } 10914 pc.ProductContractProperties = &productContractProperties 10915 } 10916 case "id": 10917 if v != nil { 10918 var ID string 10919 err = json.Unmarshal(*v, &ID) 10920 if err != nil { 10921 return err 10922 } 10923 pc.ID = &ID 10924 } 10925 case "name": 10926 if v != nil { 10927 var name string 10928 err = json.Unmarshal(*v, &name) 10929 if err != nil { 10930 return err 10931 } 10932 pc.Name = &name 10933 } 10934 case "type": 10935 if v != nil { 10936 var typeVar string 10937 err = json.Unmarshal(*v, &typeVar) 10938 if err != nil { 10939 return err 10940 } 10941 pc.Type = &typeVar 10942 } 10943 } 10944 } 10945 10946 return nil 10947} 10948 10949// ProductContractProperties product profile. 10950type ProductContractProperties struct { 10951 // DisplayName - Product name. 10952 DisplayName *string `json:"displayName,omitempty"` 10953 // Description - Product description. May include HTML formatting tags. 10954 Description *string `json:"description,omitempty"` 10955 // Terms - Product terms of use. Developers trying to subscribe to the product will be presented and required to accept these terms before they can complete the subscription process. 10956 Terms *string `json:"terms,omitempty"` 10957 // SubscriptionRequired - Whether a product subscription is required for accessing APIs included in this product. If true, the product is referred to as "protected" and a valid subscription key is required for a request to an API included in the product to succeed. If false, the product is referred to as "open" and requests to an API included in the product can be made without a subscription key. If property is omitted when creating a new product it's value is assumed to be true. 10958 SubscriptionRequired *bool `json:"subscriptionRequired,omitempty"` 10959 // ApprovalRequired - whether subscription approval is required. If false, new subscriptions will be approved automatically enabling developers to call the product’s APIs immediately after subscribing. If true, administrators must manually approve the subscription before the developer can any of the product’s APIs. Can be present only if subscriptionRequired property is present and has a value of false. 10960 ApprovalRequired *bool `json:"approvalRequired,omitempty"` 10961 // SubscriptionsLimit - Whether the number of subscriptions a user can have to this product at the same time. Set to null or omit to allow unlimited per user subscriptions. Can be present only if subscriptionRequired property is present and has a value of false. 10962 SubscriptionsLimit *int32 `json:"subscriptionsLimit,omitempty"` 10963 // State - whether product is published or not. Published products are discoverable by users of developer portal. Non published products are visible only to administrators. Default state of Product is notPublished. Possible values include: 'NotPublished', 'Published' 10964 State ProductState `json:"state,omitempty"` 10965} 10966 10967// ProductEntityBaseParameters product Entity Base Parameters 10968type ProductEntityBaseParameters struct { 10969 // Description - Product description. May include HTML formatting tags. 10970 Description *string `json:"description,omitempty"` 10971 // Terms - Product terms of use. Developers trying to subscribe to the product will be presented and required to accept these terms before they can complete the subscription process. 10972 Terms *string `json:"terms,omitempty"` 10973 // SubscriptionRequired - Whether a product subscription is required for accessing APIs included in this product. If true, the product is referred to as "protected" and a valid subscription key is required for a request to an API included in the product to succeed. If false, the product is referred to as "open" and requests to an API included in the product can be made without a subscription key. If property is omitted when creating a new product it's value is assumed to be true. 10974 SubscriptionRequired *bool `json:"subscriptionRequired,omitempty"` 10975 // ApprovalRequired - whether subscription approval is required. If false, new subscriptions will be approved automatically enabling developers to call the product’s APIs immediately after subscribing. If true, administrators must manually approve the subscription before the developer can any of the product’s APIs. Can be present only if subscriptionRequired property is present and has a value of false. 10976 ApprovalRequired *bool `json:"approvalRequired,omitempty"` 10977 // SubscriptionsLimit - Whether the number of subscriptions a user can have to this product at the same time. Set to null or omit to allow unlimited per user subscriptions. Can be present only if subscriptionRequired property is present and has a value of false. 10978 SubscriptionsLimit *int32 `json:"subscriptionsLimit,omitempty"` 10979 // State - whether product is published or not. Published products are discoverable by users of developer portal. Non published products are visible only to administrators. Default state of Product is notPublished. Possible values include: 'NotPublished', 'Published' 10980 State ProductState `json:"state,omitempty"` 10981} 10982 10983// ProductTagResourceContractProperties product profile. 10984type ProductTagResourceContractProperties struct { 10985 // ID - Identifier of the product in the form of /products/{productId} 10986 ID *string `json:"id,omitempty"` 10987 // Name - Product name. 10988 Name *string `json:"name,omitempty"` 10989 // Description - Product description. May include HTML formatting tags. 10990 Description *string `json:"description,omitempty"` 10991 // Terms - Product terms of use. Developers trying to subscribe to the product will be presented and required to accept these terms before they can complete the subscription process. 10992 Terms *string `json:"terms,omitempty"` 10993 // SubscriptionRequired - Whether a product subscription is required for accessing APIs included in this product. If true, the product is referred to as "protected" and a valid subscription key is required for a request to an API included in the product to succeed. If false, the product is referred to as "open" and requests to an API included in the product can be made without a subscription key. If property is omitted when creating a new product it's value is assumed to be true. 10994 SubscriptionRequired *bool `json:"subscriptionRequired,omitempty"` 10995 // ApprovalRequired - whether subscription approval is required. If false, new subscriptions will be approved automatically enabling developers to call the product’s APIs immediately after subscribing. If true, administrators must manually approve the subscription before the developer can any of the product’s APIs. Can be present only if subscriptionRequired property is present and has a value of false. 10996 ApprovalRequired *bool `json:"approvalRequired,omitempty"` 10997 // SubscriptionsLimit - Whether the number of subscriptions a user can have to this product at the same time. Set to null or omit to allow unlimited per user subscriptions. Can be present only if subscriptionRequired property is present and has a value of false. 10998 SubscriptionsLimit *int32 `json:"subscriptionsLimit,omitempty"` 10999 // State - whether product is published or not. Published products are discoverable by users of developer portal. Non published products are visible only to administrators. Default state of Product is notPublished. Possible values include: 'NotPublished', 'Published' 11000 State ProductState `json:"state,omitempty"` 11001} 11002 11003// ProductUpdateParameters product Update parameters. 11004type ProductUpdateParameters struct { 11005 // ProductUpdateProperties - Product entity Update contract properties. 11006 *ProductUpdateProperties `json:"properties,omitempty"` 11007} 11008 11009// MarshalJSON is the custom marshaler for ProductUpdateParameters. 11010func (pup ProductUpdateParameters) MarshalJSON() ([]byte, error) { 11011 objectMap := make(map[string]interface{}) 11012 if pup.ProductUpdateProperties != nil { 11013 objectMap["properties"] = pup.ProductUpdateProperties 11014 } 11015 return json.Marshal(objectMap) 11016} 11017 11018// UnmarshalJSON is the custom unmarshaler for ProductUpdateParameters struct. 11019func (pup *ProductUpdateParameters) UnmarshalJSON(body []byte) error { 11020 var m map[string]*json.RawMessage 11021 err := json.Unmarshal(body, &m) 11022 if err != nil { 11023 return err 11024 } 11025 for k, v := range m { 11026 switch k { 11027 case "properties": 11028 if v != nil { 11029 var productUpdateProperties ProductUpdateProperties 11030 err = json.Unmarshal(*v, &productUpdateProperties) 11031 if err != nil { 11032 return err 11033 } 11034 pup.ProductUpdateProperties = &productUpdateProperties 11035 } 11036 } 11037 } 11038 11039 return nil 11040} 11041 11042// ProductUpdateProperties parameters supplied to the Update Product operation. 11043type ProductUpdateProperties struct { 11044 // DisplayName - Product name. 11045 DisplayName *string `json:"displayName,omitempty"` 11046 // Description - Product description. May include HTML formatting tags. 11047 Description *string `json:"description,omitempty"` 11048 // Terms - Product terms of use. Developers trying to subscribe to the product will be presented and required to accept these terms before they can complete the subscription process. 11049 Terms *string `json:"terms,omitempty"` 11050 // SubscriptionRequired - Whether a product subscription is required for accessing APIs included in this product. If true, the product is referred to as "protected" and a valid subscription key is required for a request to an API included in the product to succeed. If false, the product is referred to as "open" and requests to an API included in the product can be made without a subscription key. If property is omitted when creating a new product it's value is assumed to be true. 11051 SubscriptionRequired *bool `json:"subscriptionRequired,omitempty"` 11052 // ApprovalRequired - whether subscription approval is required. If false, new subscriptions will be approved automatically enabling developers to call the product’s APIs immediately after subscribing. If true, administrators must manually approve the subscription before the developer can any of the product’s APIs. Can be present only if subscriptionRequired property is present and has a value of false. 11053 ApprovalRequired *bool `json:"approvalRequired,omitempty"` 11054 // SubscriptionsLimit - Whether the number of subscriptions a user can have to this product at the same time. Set to null or omit to allow unlimited per user subscriptions. Can be present only if subscriptionRequired property is present and has a value of false. 11055 SubscriptionsLimit *int32 `json:"subscriptionsLimit,omitempty"` 11056 // State - whether product is published or not. Published products are discoverable by users of developer portal. Non published products are visible only to administrators. Default state of Product is notPublished. Possible values include: 'NotPublished', 'Published' 11057 State ProductState `json:"state,omitempty"` 11058} 11059 11060// QuotaCounterCollection paged Quota Counter list representation. 11061type QuotaCounterCollection struct { 11062 autorest.Response `json:"-"` 11063 // Value - Quota counter values. 11064 Value *[]QuotaCounterContract `json:"value,omitempty"` 11065 // Count - Total record count number across all pages. 11066 Count *int64 `json:"count,omitempty"` 11067 // NextLink - Next page link if any. 11068 NextLink *string `json:"nextLink,omitempty"` 11069} 11070 11071// QuotaCounterContract quota counter details. 11072type QuotaCounterContract struct { 11073 autorest.Response `json:"-"` 11074 // CounterKey - The Key value of the Counter. Must not be empty. 11075 CounterKey *string `json:"counterKey,omitempty"` 11076 // PeriodKey - Identifier of the Period for which the counter was collected. Must not be empty. 11077 PeriodKey *string `json:"periodKey,omitempty"` 11078 // PeriodStartTime - The date of the start of Counter Period. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. 11079 PeriodStartTime *date.Time `json:"periodStartTime,omitempty"` 11080 // PeriodEndTime - The date of the end of Counter Period. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. 11081 PeriodEndTime *date.Time `json:"periodEndTime,omitempty"` 11082 // Value - Quota Value Properties 11083 Value *QuotaCounterValueContractProperties `json:"value,omitempty"` 11084} 11085 11086// QuotaCounterValueContract quota counter value details. 11087type QuotaCounterValueContract struct { 11088 // QuotaCounterValueContractProperties - Quota counter Value Properties. 11089 *QuotaCounterValueContractProperties `json:"value,omitempty"` 11090} 11091 11092// MarshalJSON is the custom marshaler for QuotaCounterValueContract. 11093func (qcvc QuotaCounterValueContract) MarshalJSON() ([]byte, error) { 11094 objectMap := make(map[string]interface{}) 11095 if qcvc.QuotaCounterValueContractProperties != nil { 11096 objectMap["value"] = qcvc.QuotaCounterValueContractProperties 11097 } 11098 return json.Marshal(objectMap) 11099} 11100 11101// UnmarshalJSON is the custom unmarshaler for QuotaCounterValueContract struct. 11102func (qcvc *QuotaCounterValueContract) UnmarshalJSON(body []byte) error { 11103 var m map[string]*json.RawMessage 11104 err := json.Unmarshal(body, &m) 11105 if err != nil { 11106 return err 11107 } 11108 for k, v := range m { 11109 switch k { 11110 case "value": 11111 if v != nil { 11112 var quotaCounterValueContractProperties QuotaCounterValueContractProperties 11113 err = json.Unmarshal(*v, "aCounterValueContractProperties) 11114 if err != nil { 11115 return err 11116 } 11117 qcvc.QuotaCounterValueContractProperties = "aCounterValueContractProperties 11118 } 11119 } 11120 } 11121 11122 return nil 11123} 11124 11125// QuotaCounterValueContractProperties quota counter value details. 11126type QuotaCounterValueContractProperties struct { 11127 // CallsCount - Number of times Counter was called. 11128 CallsCount *int32 `json:"callsCount,omitempty"` 11129 // KbTransferred - Data Transferred in KiloBytes. 11130 KbTransferred *float64 `json:"kbTransferred,omitempty"` 11131} 11132 11133// QuotaCounterValueUpdateContract quota counter value details. 11134type QuotaCounterValueUpdateContract struct { 11135 // QuotaCounterValueContractProperties - Quota counter value details. 11136 *QuotaCounterValueContractProperties `json:"properties,omitempty"` 11137} 11138 11139// MarshalJSON is the custom marshaler for QuotaCounterValueUpdateContract. 11140func (qcvuc QuotaCounterValueUpdateContract) MarshalJSON() ([]byte, error) { 11141 objectMap := make(map[string]interface{}) 11142 if qcvuc.QuotaCounterValueContractProperties != nil { 11143 objectMap["properties"] = qcvuc.QuotaCounterValueContractProperties 11144 } 11145 return json.Marshal(objectMap) 11146} 11147 11148// UnmarshalJSON is the custom unmarshaler for QuotaCounterValueUpdateContract struct. 11149func (qcvuc *QuotaCounterValueUpdateContract) UnmarshalJSON(body []byte) error { 11150 var m map[string]*json.RawMessage 11151 err := json.Unmarshal(body, &m) 11152 if err != nil { 11153 return err 11154 } 11155 for k, v := range m { 11156 switch k { 11157 case "properties": 11158 if v != nil { 11159 var quotaCounterValueContractProperties QuotaCounterValueContractProperties 11160 err = json.Unmarshal(*v, "aCounterValueContractProperties) 11161 if err != nil { 11162 return err 11163 } 11164 qcvuc.QuotaCounterValueContractProperties = "aCounterValueContractProperties 11165 } 11166 } 11167 } 11168 11169 return nil 11170} 11171 11172// RecipientEmailCollection paged Recipient User list representation. 11173type RecipientEmailCollection struct { 11174 autorest.Response `json:"-"` 11175 // Value - Page values. 11176 Value *[]RecipientEmailContract `json:"value,omitempty"` 11177 // Count - Total record count number across all pages. 11178 Count *int64 `json:"count,omitempty"` 11179 // NextLink - Next page link if any. 11180 NextLink *string `json:"nextLink,omitempty"` 11181} 11182 11183// RecipientEmailContract recipient Email details. 11184type RecipientEmailContract struct { 11185 autorest.Response `json:"-"` 11186 // RecipientEmailContractProperties - Recipient Email contract properties. 11187 *RecipientEmailContractProperties `json:"properties,omitempty"` 11188 // ID - READ-ONLY; Resource ID. 11189 ID *string `json:"id,omitempty"` 11190 // Name - READ-ONLY; Resource name. 11191 Name *string `json:"name,omitempty"` 11192 // Type - READ-ONLY; Resource type for API Management resource. 11193 Type *string `json:"type,omitempty"` 11194} 11195 11196// MarshalJSON is the custom marshaler for RecipientEmailContract. 11197func (rec RecipientEmailContract) MarshalJSON() ([]byte, error) { 11198 objectMap := make(map[string]interface{}) 11199 if rec.RecipientEmailContractProperties != nil { 11200 objectMap["properties"] = rec.RecipientEmailContractProperties 11201 } 11202 return json.Marshal(objectMap) 11203} 11204 11205// UnmarshalJSON is the custom unmarshaler for RecipientEmailContract struct. 11206func (rec *RecipientEmailContract) UnmarshalJSON(body []byte) error { 11207 var m map[string]*json.RawMessage 11208 err := json.Unmarshal(body, &m) 11209 if err != nil { 11210 return err 11211 } 11212 for k, v := range m { 11213 switch k { 11214 case "properties": 11215 if v != nil { 11216 var recipientEmailContractProperties RecipientEmailContractProperties 11217 err = json.Unmarshal(*v, &recipientEmailContractProperties) 11218 if err != nil { 11219 return err 11220 } 11221 rec.RecipientEmailContractProperties = &recipientEmailContractProperties 11222 } 11223 case "id": 11224 if v != nil { 11225 var ID string 11226 err = json.Unmarshal(*v, &ID) 11227 if err != nil { 11228 return err 11229 } 11230 rec.ID = &ID 11231 } 11232 case "name": 11233 if v != nil { 11234 var name string 11235 err = json.Unmarshal(*v, &name) 11236 if err != nil { 11237 return err 11238 } 11239 rec.Name = &name 11240 } 11241 case "type": 11242 if v != nil { 11243 var typeVar string 11244 err = json.Unmarshal(*v, &typeVar) 11245 if err != nil { 11246 return err 11247 } 11248 rec.Type = &typeVar 11249 } 11250 } 11251 } 11252 11253 return nil 11254} 11255 11256// RecipientEmailContractProperties recipient Email Contract Properties. 11257type RecipientEmailContractProperties struct { 11258 // Email - User Email subscribed to notification. 11259 Email *string `json:"email,omitempty"` 11260} 11261 11262// RecipientsContractProperties notification Parameter contract. 11263type RecipientsContractProperties struct { 11264 // Emails - List of Emails subscribed for the notification. 11265 Emails *[]string `json:"emails,omitempty"` 11266 // Users - List of Users subscribed for the notification. 11267 Users *[]string `json:"users,omitempty"` 11268} 11269 11270// RecipientUserCollection paged Recipient User list representation. 11271type RecipientUserCollection struct { 11272 autorest.Response `json:"-"` 11273 // Value - Page values. 11274 Value *[]RecipientUserContract `json:"value,omitempty"` 11275 // Count - Total record count number across all pages. 11276 Count *int64 `json:"count,omitempty"` 11277 // NextLink - Next page link if any. 11278 NextLink *string `json:"nextLink,omitempty"` 11279} 11280 11281// RecipientUserContract recipient User details. 11282type RecipientUserContract struct { 11283 autorest.Response `json:"-"` 11284 // RecipientUsersContractProperties - Recipient User entity contract properties. 11285 *RecipientUsersContractProperties `json:"properties,omitempty"` 11286 // ID - READ-ONLY; Resource ID. 11287 ID *string `json:"id,omitempty"` 11288 // Name - READ-ONLY; Resource name. 11289 Name *string `json:"name,omitempty"` 11290 // Type - READ-ONLY; Resource type for API Management resource. 11291 Type *string `json:"type,omitempty"` 11292} 11293 11294// MarshalJSON is the custom marshaler for RecipientUserContract. 11295func (ruc RecipientUserContract) MarshalJSON() ([]byte, error) { 11296 objectMap := make(map[string]interface{}) 11297 if ruc.RecipientUsersContractProperties != nil { 11298 objectMap["properties"] = ruc.RecipientUsersContractProperties 11299 } 11300 return json.Marshal(objectMap) 11301} 11302 11303// UnmarshalJSON is the custom unmarshaler for RecipientUserContract struct. 11304func (ruc *RecipientUserContract) UnmarshalJSON(body []byte) error { 11305 var m map[string]*json.RawMessage 11306 err := json.Unmarshal(body, &m) 11307 if err != nil { 11308 return err 11309 } 11310 for k, v := range m { 11311 switch k { 11312 case "properties": 11313 if v != nil { 11314 var recipientUsersContractProperties RecipientUsersContractProperties 11315 err = json.Unmarshal(*v, &recipientUsersContractProperties) 11316 if err != nil { 11317 return err 11318 } 11319 ruc.RecipientUsersContractProperties = &recipientUsersContractProperties 11320 } 11321 case "id": 11322 if v != nil { 11323 var ID string 11324 err = json.Unmarshal(*v, &ID) 11325 if err != nil { 11326 return err 11327 } 11328 ruc.ID = &ID 11329 } 11330 case "name": 11331 if v != nil { 11332 var name string 11333 err = json.Unmarshal(*v, &name) 11334 if err != nil { 11335 return err 11336 } 11337 ruc.Name = &name 11338 } 11339 case "type": 11340 if v != nil { 11341 var typeVar string 11342 err = json.Unmarshal(*v, &typeVar) 11343 if err != nil { 11344 return err 11345 } 11346 ruc.Type = &typeVar 11347 } 11348 } 11349 } 11350 11351 return nil 11352} 11353 11354// RecipientUsersContractProperties recipient User Contract Properties. 11355type RecipientUsersContractProperties struct { 11356 // UserID - API Management UserId subscribed to notification. 11357 UserID *string `json:"userId,omitempty"` 11358} 11359 11360// RegionContract region profile. 11361type RegionContract struct { 11362 // Name - READ-ONLY; Region name. 11363 Name *string `json:"name,omitempty"` 11364 // IsMasterRegion - whether Region is the master region. 11365 IsMasterRegion *bool `json:"isMasterRegion,omitempty"` 11366 // IsDeleted - whether Region is deleted. 11367 IsDeleted *bool `json:"isDeleted,omitempty"` 11368} 11369 11370// MarshalJSON is the custom marshaler for RegionContract. 11371func (rc RegionContract) MarshalJSON() ([]byte, error) { 11372 objectMap := make(map[string]interface{}) 11373 if rc.IsMasterRegion != nil { 11374 objectMap["isMasterRegion"] = rc.IsMasterRegion 11375 } 11376 if rc.IsDeleted != nil { 11377 objectMap["isDeleted"] = rc.IsDeleted 11378 } 11379 return json.Marshal(objectMap) 11380} 11381 11382// RegionListResult lists Regions operation response details. 11383type RegionListResult struct { 11384 autorest.Response `json:"-"` 11385 // Value - Lists of Regions. 11386 Value *[]RegionContract `json:"value,omitempty"` 11387 // Count - Total record count number across all pages. 11388 Count *int64 `json:"count,omitempty"` 11389 // NextLink - Next page link if any. 11390 NextLink *string `json:"nextLink,omitempty"` 11391} 11392 11393// RegionListResultIterator provides access to a complete listing of RegionContract values. 11394type RegionListResultIterator struct { 11395 i int 11396 page RegionListResultPage 11397} 11398 11399// NextWithContext advances to the next value. If there was an error making 11400// the request the iterator does not advance and the error is returned. 11401func (iter *RegionListResultIterator) NextWithContext(ctx context.Context) (err error) { 11402 if tracing.IsEnabled() { 11403 ctx = tracing.StartSpan(ctx, fqdn+"/RegionListResultIterator.NextWithContext") 11404 defer func() { 11405 sc := -1 11406 if iter.Response().Response.Response != nil { 11407 sc = iter.Response().Response.Response.StatusCode 11408 } 11409 tracing.EndSpan(ctx, sc, err) 11410 }() 11411 } 11412 iter.i++ 11413 if iter.i < len(iter.page.Values()) { 11414 return nil 11415 } 11416 err = iter.page.NextWithContext(ctx) 11417 if err != nil { 11418 iter.i-- 11419 return err 11420 } 11421 iter.i = 0 11422 return nil 11423} 11424 11425// Next advances to the next value. If there was an error making 11426// the request the iterator does not advance and the error is returned. 11427// Deprecated: Use NextWithContext() instead. 11428func (iter *RegionListResultIterator) Next() error { 11429 return iter.NextWithContext(context.Background()) 11430} 11431 11432// NotDone returns true if the enumeration should be started or is not yet complete. 11433func (iter RegionListResultIterator) NotDone() bool { 11434 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 11435} 11436 11437// Response returns the raw server response from the last page request. 11438func (iter RegionListResultIterator) Response() RegionListResult { 11439 return iter.page.Response() 11440} 11441 11442// Value returns the current value or a zero-initialized value if the 11443// iterator has advanced beyond the end of the collection. 11444func (iter RegionListResultIterator) Value() RegionContract { 11445 if !iter.page.NotDone() { 11446 return RegionContract{} 11447 } 11448 return iter.page.Values()[iter.i] 11449} 11450 11451// Creates a new instance of the RegionListResultIterator type. 11452func NewRegionListResultIterator(page RegionListResultPage) RegionListResultIterator { 11453 return RegionListResultIterator{page: page} 11454} 11455 11456// IsEmpty returns true if the ListResult contains no values. 11457func (rlr RegionListResult) IsEmpty() bool { 11458 return rlr.Value == nil || len(*rlr.Value) == 0 11459} 11460 11461// hasNextLink returns true if the NextLink is not empty. 11462func (rlr RegionListResult) hasNextLink() bool { 11463 return rlr.NextLink != nil && len(*rlr.NextLink) != 0 11464} 11465 11466// regionListResultPreparer prepares a request to retrieve the next set of results. 11467// It returns nil if no more results exist. 11468func (rlr RegionListResult) regionListResultPreparer(ctx context.Context) (*http.Request, error) { 11469 if !rlr.hasNextLink() { 11470 return nil, nil 11471 } 11472 return autorest.Prepare((&http.Request{}).WithContext(ctx), 11473 autorest.AsJSON(), 11474 autorest.AsGet(), 11475 autorest.WithBaseURL(to.String(rlr.NextLink))) 11476} 11477 11478// RegionListResultPage contains a page of RegionContract values. 11479type RegionListResultPage struct { 11480 fn func(context.Context, RegionListResult) (RegionListResult, error) 11481 rlr RegionListResult 11482} 11483 11484// NextWithContext advances to the next page of values. If there was an error making 11485// the request the page does not advance and the error is returned. 11486func (page *RegionListResultPage) NextWithContext(ctx context.Context) (err error) { 11487 if tracing.IsEnabled() { 11488 ctx = tracing.StartSpan(ctx, fqdn+"/RegionListResultPage.NextWithContext") 11489 defer func() { 11490 sc := -1 11491 if page.Response().Response.Response != nil { 11492 sc = page.Response().Response.Response.StatusCode 11493 } 11494 tracing.EndSpan(ctx, sc, err) 11495 }() 11496 } 11497 for { 11498 next, err := page.fn(ctx, page.rlr) 11499 if err != nil { 11500 return err 11501 } 11502 page.rlr = next 11503 if !next.hasNextLink() || !next.IsEmpty() { 11504 break 11505 } 11506 } 11507 return nil 11508} 11509 11510// Next advances to the next page of values. If there was an error making 11511// the request the page does not advance and the error is returned. 11512// Deprecated: Use NextWithContext() instead. 11513func (page *RegionListResultPage) Next() error { 11514 return page.NextWithContext(context.Background()) 11515} 11516 11517// NotDone returns true if the page enumeration should be started or is not yet complete. 11518func (page RegionListResultPage) NotDone() bool { 11519 return !page.rlr.IsEmpty() 11520} 11521 11522// Response returns the raw server response from the last page request. 11523func (page RegionListResultPage) Response() RegionListResult { 11524 return page.rlr 11525} 11526 11527// Values returns the slice of values for the current page or nil if there are no values. 11528func (page RegionListResultPage) Values() []RegionContract { 11529 if page.rlr.IsEmpty() { 11530 return nil 11531 } 11532 return *page.rlr.Value 11533} 11534 11535// Creates a new instance of the RegionListResultPage type. 11536func NewRegionListResultPage(cur RegionListResult, getNextPage func(context.Context, RegionListResult) (RegionListResult, error)) RegionListResultPage { 11537 return RegionListResultPage{ 11538 fn: getNextPage, 11539 rlr: cur, 11540 } 11541} 11542 11543// RegistrationDelegationSettingsProperties user registration delegation settings properties. 11544type RegistrationDelegationSettingsProperties struct { 11545 // Enabled - Enable or disable delegation for user registration. 11546 Enabled *bool `json:"enabled,omitempty"` 11547} 11548 11549// ReportCollection paged Report records list representation. 11550type ReportCollection struct { 11551 autorest.Response `json:"-"` 11552 // Value - Page values. 11553 Value *[]ReportRecordContract `json:"value,omitempty"` 11554 // Count - Total record count number across all pages. 11555 Count *int64 `json:"count,omitempty"` 11556 // NextLink - Next page link if any. 11557 NextLink *string `json:"nextLink,omitempty"` 11558} 11559 11560// ReportCollectionIterator provides access to a complete listing of ReportRecordContract values. 11561type ReportCollectionIterator struct { 11562 i int 11563 page ReportCollectionPage 11564} 11565 11566// NextWithContext advances to the next value. If there was an error making 11567// the request the iterator does not advance and the error is returned. 11568func (iter *ReportCollectionIterator) NextWithContext(ctx context.Context) (err error) { 11569 if tracing.IsEnabled() { 11570 ctx = tracing.StartSpan(ctx, fqdn+"/ReportCollectionIterator.NextWithContext") 11571 defer func() { 11572 sc := -1 11573 if iter.Response().Response.Response != nil { 11574 sc = iter.Response().Response.Response.StatusCode 11575 } 11576 tracing.EndSpan(ctx, sc, err) 11577 }() 11578 } 11579 iter.i++ 11580 if iter.i < len(iter.page.Values()) { 11581 return nil 11582 } 11583 err = iter.page.NextWithContext(ctx) 11584 if err != nil { 11585 iter.i-- 11586 return err 11587 } 11588 iter.i = 0 11589 return nil 11590} 11591 11592// Next advances to the next value. If there was an error making 11593// the request the iterator does not advance and the error is returned. 11594// Deprecated: Use NextWithContext() instead. 11595func (iter *ReportCollectionIterator) Next() error { 11596 return iter.NextWithContext(context.Background()) 11597} 11598 11599// NotDone returns true if the enumeration should be started or is not yet complete. 11600func (iter ReportCollectionIterator) NotDone() bool { 11601 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 11602} 11603 11604// Response returns the raw server response from the last page request. 11605func (iter ReportCollectionIterator) Response() ReportCollection { 11606 return iter.page.Response() 11607} 11608 11609// Value returns the current value or a zero-initialized value if the 11610// iterator has advanced beyond the end of the collection. 11611func (iter ReportCollectionIterator) Value() ReportRecordContract { 11612 if !iter.page.NotDone() { 11613 return ReportRecordContract{} 11614 } 11615 return iter.page.Values()[iter.i] 11616} 11617 11618// Creates a new instance of the ReportCollectionIterator type. 11619func NewReportCollectionIterator(page ReportCollectionPage) ReportCollectionIterator { 11620 return ReportCollectionIterator{page: page} 11621} 11622 11623// IsEmpty returns true if the ListResult contains no values. 11624func (rc ReportCollection) IsEmpty() bool { 11625 return rc.Value == nil || len(*rc.Value) == 0 11626} 11627 11628// hasNextLink returns true if the NextLink is not empty. 11629func (rc ReportCollection) hasNextLink() bool { 11630 return rc.NextLink != nil && len(*rc.NextLink) != 0 11631} 11632 11633// reportCollectionPreparer prepares a request to retrieve the next set of results. 11634// It returns nil if no more results exist. 11635func (rc ReportCollection) reportCollectionPreparer(ctx context.Context) (*http.Request, error) { 11636 if !rc.hasNextLink() { 11637 return nil, nil 11638 } 11639 return autorest.Prepare((&http.Request{}).WithContext(ctx), 11640 autorest.AsJSON(), 11641 autorest.AsGet(), 11642 autorest.WithBaseURL(to.String(rc.NextLink))) 11643} 11644 11645// ReportCollectionPage contains a page of ReportRecordContract values. 11646type ReportCollectionPage struct { 11647 fn func(context.Context, ReportCollection) (ReportCollection, error) 11648 rc ReportCollection 11649} 11650 11651// NextWithContext advances to the next page of values. If there was an error making 11652// the request the page does not advance and the error is returned. 11653func (page *ReportCollectionPage) NextWithContext(ctx context.Context) (err error) { 11654 if tracing.IsEnabled() { 11655 ctx = tracing.StartSpan(ctx, fqdn+"/ReportCollectionPage.NextWithContext") 11656 defer func() { 11657 sc := -1 11658 if page.Response().Response.Response != nil { 11659 sc = page.Response().Response.Response.StatusCode 11660 } 11661 tracing.EndSpan(ctx, sc, err) 11662 }() 11663 } 11664 for { 11665 next, err := page.fn(ctx, page.rc) 11666 if err != nil { 11667 return err 11668 } 11669 page.rc = next 11670 if !next.hasNextLink() || !next.IsEmpty() { 11671 break 11672 } 11673 } 11674 return nil 11675} 11676 11677// Next advances to the next page of values. If there was an error making 11678// the request the page does not advance and the error is returned. 11679// Deprecated: Use NextWithContext() instead. 11680func (page *ReportCollectionPage) Next() error { 11681 return page.NextWithContext(context.Background()) 11682} 11683 11684// NotDone returns true if the page enumeration should be started or is not yet complete. 11685func (page ReportCollectionPage) NotDone() bool { 11686 return !page.rc.IsEmpty() 11687} 11688 11689// Response returns the raw server response from the last page request. 11690func (page ReportCollectionPage) Response() ReportCollection { 11691 return page.rc 11692} 11693 11694// Values returns the slice of values for the current page or nil if there are no values. 11695func (page ReportCollectionPage) Values() []ReportRecordContract { 11696 if page.rc.IsEmpty() { 11697 return nil 11698 } 11699 return *page.rc.Value 11700} 11701 11702// Creates a new instance of the ReportCollectionPage type. 11703func NewReportCollectionPage(cur ReportCollection, getNextPage func(context.Context, ReportCollection) (ReportCollection, error)) ReportCollectionPage { 11704 return ReportCollectionPage{ 11705 fn: getNextPage, 11706 rc: cur, 11707 } 11708} 11709 11710// ReportRecordContract report data. 11711type ReportRecordContract struct { 11712 // Name - Name depending on report endpoint specifies product, API, operation or developer name. 11713 Name *string `json:"name,omitempty"` 11714 // Timestamp - Start of aggregation period. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. 11715 Timestamp *date.Time `json:"timestamp,omitempty"` 11716 // Interval - Length of aggregation period. Interval must be multiple of 15 minutes and may not be zero. The value should be in ISO 8601 format (http://en.wikipedia.org/wiki/ISO_8601#Durations). 11717 Interval *string `json:"interval,omitempty"` 11718 // Country - Country to which this record data is related. 11719 Country *string `json:"country,omitempty"` 11720 // Region - Country region to which this record data is related. 11721 Region *string `json:"region,omitempty"` 11722 // Zip - Zip code to which this record data is related. 11723 Zip *string `json:"zip,omitempty"` 11724 // UserID - READ-ONLY; User identifier path. /users/{userId} 11725 UserID *string `json:"userId,omitempty"` 11726 // ProductID - READ-ONLY; Product identifier path. /products/{productId} 11727 ProductID *string `json:"productId,omitempty"` 11728 // APIID - API identifier path. /apis/{apiId} 11729 APIID *string `json:"apiId,omitempty"` 11730 // OperationID - Operation identifier path. /apis/{apiId}/operations/{operationId} 11731 OperationID *string `json:"operationId,omitempty"` 11732 // APIRegion - API region identifier. 11733 APIRegion *string `json:"apiRegion,omitempty"` 11734 // SubscriptionID - Subscription identifier path. /subscriptions/{subscriptionId} 11735 SubscriptionID *string `json:"subscriptionId,omitempty"` 11736 // CallCountSuccess - Number of successful calls. This includes calls returning HttpStatusCode <= 301 and HttpStatusCode.NotModified and HttpStatusCode.TemporaryRedirect 11737 CallCountSuccess *int32 `json:"callCountSuccess,omitempty"` 11738 // CallCountBlocked - Number of calls blocked due to invalid credentials. This includes calls returning HttpStatusCode.Unauthorized and HttpStatusCode.Forbidden and HttpStatusCode.TooManyRequests 11739 CallCountBlocked *int32 `json:"callCountBlocked,omitempty"` 11740 // CallCountFailed - Number of calls failed due to proxy or backend errors. This includes calls returning HttpStatusCode.BadRequest(400) and any Code between HttpStatusCode.InternalServerError (500) and 600 11741 CallCountFailed *int32 `json:"callCountFailed,omitempty"` 11742 // CallCountOther - Number of other calls. 11743 CallCountOther *int32 `json:"callCountOther,omitempty"` 11744 // CallCountTotal - Total number of calls. 11745 CallCountTotal *int32 `json:"callCountTotal,omitempty"` 11746 // Bandwidth - Bandwidth consumed. 11747 Bandwidth *int64 `json:"bandwidth,omitempty"` 11748 // CacheHitCount - Number of times when content was served from cache policy. 11749 CacheHitCount *int32 `json:"cacheHitCount,omitempty"` 11750 // CacheMissCount - Number of times content was fetched from backend. 11751 CacheMissCount *int32 `json:"cacheMissCount,omitempty"` 11752 // APITimeAvg - Average time it took to process request. 11753 APITimeAvg *float64 `json:"apiTimeAvg,omitempty"` 11754 // APITimeMin - Minimum time it took to process request. 11755 APITimeMin *float64 `json:"apiTimeMin,omitempty"` 11756 // APITimeMax - Maximum time it took to process request. 11757 APITimeMax *float64 `json:"apiTimeMax,omitempty"` 11758 // ServiceTimeAvg - Average time it took to process request on backend. 11759 ServiceTimeAvg *float64 `json:"serviceTimeAvg,omitempty"` 11760 // ServiceTimeMin - Minimum time it took to process request on backend. 11761 ServiceTimeMin *float64 `json:"serviceTimeMin,omitempty"` 11762 // ServiceTimeMax - Maximum time it took to process request on backend. 11763 ServiceTimeMax *float64 `json:"serviceTimeMax,omitempty"` 11764} 11765 11766// MarshalJSON is the custom marshaler for ReportRecordContract. 11767func (rrc ReportRecordContract) MarshalJSON() ([]byte, error) { 11768 objectMap := make(map[string]interface{}) 11769 if rrc.Name != nil { 11770 objectMap["name"] = rrc.Name 11771 } 11772 if rrc.Timestamp != nil { 11773 objectMap["timestamp"] = rrc.Timestamp 11774 } 11775 if rrc.Interval != nil { 11776 objectMap["interval"] = rrc.Interval 11777 } 11778 if rrc.Country != nil { 11779 objectMap["country"] = rrc.Country 11780 } 11781 if rrc.Region != nil { 11782 objectMap["region"] = rrc.Region 11783 } 11784 if rrc.Zip != nil { 11785 objectMap["zip"] = rrc.Zip 11786 } 11787 if rrc.APIID != nil { 11788 objectMap["apiId"] = rrc.APIID 11789 } 11790 if rrc.OperationID != nil { 11791 objectMap["operationId"] = rrc.OperationID 11792 } 11793 if rrc.APIRegion != nil { 11794 objectMap["apiRegion"] = rrc.APIRegion 11795 } 11796 if rrc.SubscriptionID != nil { 11797 objectMap["subscriptionId"] = rrc.SubscriptionID 11798 } 11799 if rrc.CallCountSuccess != nil { 11800 objectMap["callCountSuccess"] = rrc.CallCountSuccess 11801 } 11802 if rrc.CallCountBlocked != nil { 11803 objectMap["callCountBlocked"] = rrc.CallCountBlocked 11804 } 11805 if rrc.CallCountFailed != nil { 11806 objectMap["callCountFailed"] = rrc.CallCountFailed 11807 } 11808 if rrc.CallCountOther != nil { 11809 objectMap["callCountOther"] = rrc.CallCountOther 11810 } 11811 if rrc.CallCountTotal != nil { 11812 objectMap["callCountTotal"] = rrc.CallCountTotal 11813 } 11814 if rrc.Bandwidth != nil { 11815 objectMap["bandwidth"] = rrc.Bandwidth 11816 } 11817 if rrc.CacheHitCount != nil { 11818 objectMap["cacheHitCount"] = rrc.CacheHitCount 11819 } 11820 if rrc.CacheMissCount != nil { 11821 objectMap["cacheMissCount"] = rrc.CacheMissCount 11822 } 11823 if rrc.APITimeAvg != nil { 11824 objectMap["apiTimeAvg"] = rrc.APITimeAvg 11825 } 11826 if rrc.APITimeMin != nil { 11827 objectMap["apiTimeMin"] = rrc.APITimeMin 11828 } 11829 if rrc.APITimeMax != nil { 11830 objectMap["apiTimeMax"] = rrc.APITimeMax 11831 } 11832 if rrc.ServiceTimeAvg != nil { 11833 objectMap["serviceTimeAvg"] = rrc.ServiceTimeAvg 11834 } 11835 if rrc.ServiceTimeMin != nil { 11836 objectMap["serviceTimeMin"] = rrc.ServiceTimeMin 11837 } 11838 if rrc.ServiceTimeMax != nil { 11839 objectMap["serviceTimeMax"] = rrc.ServiceTimeMax 11840 } 11841 return json.Marshal(objectMap) 11842} 11843 11844// RepresentationContract operation request/response representation details. 11845type RepresentationContract struct { 11846 // ContentType - Specifies a registered or custom content type for this representation, e.g. application/xml. 11847 ContentType *string `json:"contentType,omitempty"` 11848 // Sample - An example of the representation. 11849 Sample *string `json:"sample,omitempty"` 11850 // SchemaID - Schema identifier. Applicable only if 'contentType' value is neither 'application/x-www-form-urlencoded' nor 'multipart/form-data'. 11851 SchemaID *string `json:"schemaId,omitempty"` 11852 // TypeName - Type name defined by the schema. Applicable only if 'contentType' value is neither 'application/x-www-form-urlencoded' nor 'multipart/form-data'. 11853 TypeName *string `json:"typeName,omitempty"` 11854 // FormParameters - Collection of form parameters. Required if 'contentType' value is either 'application/x-www-form-urlencoded' or 'multipart/form-data'.. 11855 FormParameters *[]ParameterContract `json:"formParameters,omitempty"` 11856} 11857 11858// RequestContract operation request details. 11859type RequestContract struct { 11860 // Description - Operation request description. 11861 Description *string `json:"description,omitempty"` 11862 // QueryParameters - Collection of operation request query parameters. 11863 QueryParameters *[]ParameterContract `json:"queryParameters,omitempty"` 11864 // Headers - Collection of operation request headers. 11865 Headers *[]ParameterContract `json:"headers,omitempty"` 11866 // Representations - Collection of operation request representations. 11867 Representations *[]RepresentationContract `json:"representations,omitempty"` 11868} 11869 11870// RequestReportCollection paged Report records list representation. 11871type RequestReportCollection struct { 11872 autorest.Response `json:"-"` 11873 // Value - Page values. 11874 Value *[]RequestReportRecordContract `json:"value,omitempty"` 11875 // Count - Total record count number across all pages. 11876 Count *int64 `json:"count,omitempty"` 11877} 11878 11879// RequestReportRecordContract request Report data. 11880type RequestReportRecordContract struct { 11881 // APIID - API identifier path. /apis/{apiId} 11882 APIID *string `json:"apiId,omitempty"` 11883 // OperationID - Operation identifier path. /apis/{apiId}/operations/{operationId} 11884 OperationID *string `json:"operationId,omitempty"` 11885 // ProductID - READ-ONLY; Product identifier path. /products/{productId} 11886 ProductID *string `json:"productId,omitempty"` 11887 // UserID - READ-ONLY; User identifier path. /users/{userId} 11888 UserID *string `json:"userId,omitempty"` 11889 // Method - The HTTP method associated with this request.. 11890 Method *string `json:"method,omitempty"` 11891 // URL - The full URL associated with this request. 11892 URL *string `json:"url,omitempty"` 11893 // IPAddress - The client IP address associated with this request. 11894 IPAddress *string `json:"ipAddress,omitempty"` 11895 // BackendResponseCode - The HTTP status code received by the gateway as a result of forwarding this request to the backend. 11896 BackendResponseCode *string `json:"backendResponseCode,omitempty"` 11897 // ResponseCode - The HTTP status code returned by the gateway. 11898 ResponseCode *int32 `json:"responseCode,omitempty"` 11899 // ResponseSize - The size of the response returned by the gateway. 11900 ResponseSize *int32 `json:"responseSize,omitempty"` 11901 // Timestamp - The date and time when this request was received by the gateway in ISO 8601 format. 11902 Timestamp *date.Time `json:"timestamp,omitempty"` 11903 // Cache - Specifies if response cache was involved in generating the response. If the value is none, the cache was not used. If the value is hit, cached response was returned. If the value is miss, the cache was used but lookup resulted in a miss and request was fulfilled by the backend. 11904 Cache *string `json:"cache,omitempty"` 11905 // APITime - The total time it took to process this request. 11906 APITime *float64 `json:"apiTime,omitempty"` 11907 // ServiceTime - he time it took to forward this request to the backend and get the response back. 11908 ServiceTime *float64 `json:"serviceTime,omitempty"` 11909 // APIRegion - Azure region where the gateway that processed this request is located. 11910 APIRegion *string `json:"apiRegion,omitempty"` 11911 // SubscriptionID - Subscription identifier path. /subscriptions/{subscriptionId} 11912 SubscriptionID *string `json:"subscriptionId,omitempty"` 11913 // RequestID - Request Identifier. 11914 RequestID *string `json:"requestId,omitempty"` 11915 // RequestSize - The size of this request.. 11916 RequestSize *int32 `json:"requestSize,omitempty"` 11917} 11918 11919// MarshalJSON is the custom marshaler for RequestReportRecordContract. 11920func (rrrc RequestReportRecordContract) MarshalJSON() ([]byte, error) { 11921 objectMap := make(map[string]interface{}) 11922 if rrrc.APIID != nil { 11923 objectMap["apiId"] = rrrc.APIID 11924 } 11925 if rrrc.OperationID != nil { 11926 objectMap["operationId"] = rrrc.OperationID 11927 } 11928 if rrrc.Method != nil { 11929 objectMap["method"] = rrrc.Method 11930 } 11931 if rrrc.URL != nil { 11932 objectMap["url"] = rrrc.URL 11933 } 11934 if rrrc.IPAddress != nil { 11935 objectMap["ipAddress"] = rrrc.IPAddress 11936 } 11937 if rrrc.BackendResponseCode != nil { 11938 objectMap["backendResponseCode"] = rrrc.BackendResponseCode 11939 } 11940 if rrrc.ResponseCode != nil { 11941 objectMap["responseCode"] = rrrc.ResponseCode 11942 } 11943 if rrrc.ResponseSize != nil { 11944 objectMap["responseSize"] = rrrc.ResponseSize 11945 } 11946 if rrrc.Timestamp != nil { 11947 objectMap["timestamp"] = rrrc.Timestamp 11948 } 11949 if rrrc.Cache != nil { 11950 objectMap["cache"] = rrrc.Cache 11951 } 11952 if rrrc.APITime != nil { 11953 objectMap["apiTime"] = rrrc.APITime 11954 } 11955 if rrrc.ServiceTime != nil { 11956 objectMap["serviceTime"] = rrrc.ServiceTime 11957 } 11958 if rrrc.APIRegion != nil { 11959 objectMap["apiRegion"] = rrrc.APIRegion 11960 } 11961 if rrrc.SubscriptionID != nil { 11962 objectMap["subscriptionId"] = rrrc.SubscriptionID 11963 } 11964 if rrrc.RequestID != nil { 11965 objectMap["requestId"] = rrrc.RequestID 11966 } 11967 if rrrc.RequestSize != nil { 11968 objectMap["requestSize"] = rrrc.RequestSize 11969 } 11970 return json.Marshal(objectMap) 11971} 11972 11973// Resource the Resource definition. 11974type Resource struct { 11975 // ID - READ-ONLY; Resource ID. 11976 ID *string `json:"id,omitempty"` 11977 // Name - READ-ONLY; Resource name. 11978 Name *string `json:"name,omitempty"` 11979 // Type - READ-ONLY; Resource type for API Management resource. 11980 Type *string `json:"type,omitempty"` 11981} 11982 11983// MarshalJSON is the custom marshaler for Resource. 11984func (r Resource) MarshalJSON() ([]byte, error) { 11985 objectMap := make(map[string]interface{}) 11986 return json.Marshal(objectMap) 11987} 11988 11989// ResourceLocationDataContract resource location data properties. 11990type ResourceLocationDataContract struct { 11991 // Name - A canonical name for the geographic or physical location. 11992 Name *string `json:"name,omitempty"` 11993 // City - The city or locality where the resource is located. 11994 City *string `json:"city,omitempty"` 11995 // District - The district, state, or province where the resource is located. 11996 District *string `json:"district,omitempty"` 11997 // CountryOrRegion - The country or region where the resource is located. 11998 CountryOrRegion *string `json:"countryOrRegion,omitempty"` 11999} 12000 12001// ResourceSku describes an available API Management SKU. 12002type ResourceSku struct { 12003 // Name - Name of the Sku. Possible values include: 'SkuTypeDeveloper', 'SkuTypeStandard', 'SkuTypePremium', 'SkuTypeBasic', 'SkuTypeConsumption', 'SkuTypeIsolated' 12004 Name SkuType `json:"name,omitempty"` 12005} 12006 12007// ResourceSkuCapacity describes scaling information of a SKU. 12008type ResourceSkuCapacity struct { 12009 // Minimum - READ-ONLY; The minimum capacity. 12010 Minimum *int32 `json:"minimum,omitempty"` 12011 // Maximum - READ-ONLY; The maximum capacity that can be set. 12012 Maximum *int32 `json:"maximum,omitempty"` 12013 // Default - READ-ONLY; The default capacity. 12014 Default *int32 `json:"default,omitempty"` 12015 // ScaleType - READ-ONLY; The scale type applicable to the sku. Possible values include: 'ResourceSkuCapacityScaleTypeAutomatic', 'ResourceSkuCapacityScaleTypeManual', 'ResourceSkuCapacityScaleTypeNone' 12016 ScaleType ResourceSkuCapacityScaleType `json:"scaleType,omitempty"` 12017} 12018 12019// MarshalJSON is the custom marshaler for ResourceSkuCapacity. 12020func (rsc ResourceSkuCapacity) MarshalJSON() ([]byte, error) { 12021 objectMap := make(map[string]interface{}) 12022 return json.Marshal(objectMap) 12023} 12024 12025// ResourceSkuResult describes an available API Management service SKU. 12026type ResourceSkuResult struct { 12027 // ResourceType - READ-ONLY; The type of resource the SKU applies to. 12028 ResourceType *string `json:"resourceType,omitempty"` 12029 // Sku - READ-ONLY; Specifies API Management SKU. 12030 Sku *ResourceSku `json:"sku,omitempty"` 12031 // Capacity - READ-ONLY; Specifies the number of API Management units. 12032 Capacity *ResourceSkuCapacity `json:"capacity,omitempty"` 12033} 12034 12035// MarshalJSON is the custom marshaler for ResourceSkuResult. 12036func (rsr ResourceSkuResult) MarshalJSON() ([]byte, error) { 12037 objectMap := make(map[string]interface{}) 12038 return json.Marshal(objectMap) 12039} 12040 12041// ResourceSkuResults the API Management service SKUs operation response. 12042type ResourceSkuResults struct { 12043 autorest.Response `json:"-"` 12044 // Value - The list of skus available for the service. 12045 Value *[]ResourceSkuResult `json:"value,omitempty"` 12046 // NextLink - The uri to fetch the next page of API Management service Skus. 12047 NextLink *string `json:"nextLink,omitempty"` 12048} 12049 12050// ResourceSkuResultsIterator provides access to a complete listing of ResourceSkuResult values. 12051type ResourceSkuResultsIterator struct { 12052 i int 12053 page ResourceSkuResultsPage 12054} 12055 12056// NextWithContext advances to the next value. If there was an error making 12057// the request the iterator does not advance and the error is returned. 12058func (iter *ResourceSkuResultsIterator) NextWithContext(ctx context.Context) (err error) { 12059 if tracing.IsEnabled() { 12060 ctx = tracing.StartSpan(ctx, fqdn+"/ResourceSkuResultsIterator.NextWithContext") 12061 defer func() { 12062 sc := -1 12063 if iter.Response().Response.Response != nil { 12064 sc = iter.Response().Response.Response.StatusCode 12065 } 12066 tracing.EndSpan(ctx, sc, err) 12067 }() 12068 } 12069 iter.i++ 12070 if iter.i < len(iter.page.Values()) { 12071 return nil 12072 } 12073 err = iter.page.NextWithContext(ctx) 12074 if err != nil { 12075 iter.i-- 12076 return err 12077 } 12078 iter.i = 0 12079 return nil 12080} 12081 12082// Next advances to the next value. If there was an error making 12083// the request the iterator does not advance and the error is returned. 12084// Deprecated: Use NextWithContext() instead. 12085func (iter *ResourceSkuResultsIterator) Next() error { 12086 return iter.NextWithContext(context.Background()) 12087} 12088 12089// NotDone returns true if the enumeration should be started or is not yet complete. 12090func (iter ResourceSkuResultsIterator) NotDone() bool { 12091 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 12092} 12093 12094// Response returns the raw server response from the last page request. 12095func (iter ResourceSkuResultsIterator) Response() ResourceSkuResults { 12096 return iter.page.Response() 12097} 12098 12099// Value returns the current value or a zero-initialized value if the 12100// iterator has advanced beyond the end of the collection. 12101func (iter ResourceSkuResultsIterator) Value() ResourceSkuResult { 12102 if !iter.page.NotDone() { 12103 return ResourceSkuResult{} 12104 } 12105 return iter.page.Values()[iter.i] 12106} 12107 12108// Creates a new instance of the ResourceSkuResultsIterator type. 12109func NewResourceSkuResultsIterator(page ResourceSkuResultsPage) ResourceSkuResultsIterator { 12110 return ResourceSkuResultsIterator{page: page} 12111} 12112 12113// IsEmpty returns true if the ListResult contains no values. 12114func (rsr ResourceSkuResults) IsEmpty() bool { 12115 return rsr.Value == nil || len(*rsr.Value) == 0 12116} 12117 12118// hasNextLink returns true if the NextLink is not empty. 12119func (rsr ResourceSkuResults) hasNextLink() bool { 12120 return rsr.NextLink != nil && len(*rsr.NextLink) != 0 12121} 12122 12123// resourceSkuResultsPreparer prepares a request to retrieve the next set of results. 12124// It returns nil if no more results exist. 12125func (rsr ResourceSkuResults) resourceSkuResultsPreparer(ctx context.Context) (*http.Request, error) { 12126 if !rsr.hasNextLink() { 12127 return nil, nil 12128 } 12129 return autorest.Prepare((&http.Request{}).WithContext(ctx), 12130 autorest.AsJSON(), 12131 autorest.AsGet(), 12132 autorest.WithBaseURL(to.String(rsr.NextLink))) 12133} 12134 12135// ResourceSkuResultsPage contains a page of ResourceSkuResult values. 12136type ResourceSkuResultsPage struct { 12137 fn func(context.Context, ResourceSkuResults) (ResourceSkuResults, error) 12138 rsr ResourceSkuResults 12139} 12140 12141// NextWithContext advances to the next page of values. If there was an error making 12142// the request the page does not advance and the error is returned. 12143func (page *ResourceSkuResultsPage) NextWithContext(ctx context.Context) (err error) { 12144 if tracing.IsEnabled() { 12145 ctx = tracing.StartSpan(ctx, fqdn+"/ResourceSkuResultsPage.NextWithContext") 12146 defer func() { 12147 sc := -1 12148 if page.Response().Response.Response != nil { 12149 sc = page.Response().Response.Response.StatusCode 12150 } 12151 tracing.EndSpan(ctx, sc, err) 12152 }() 12153 } 12154 for { 12155 next, err := page.fn(ctx, page.rsr) 12156 if err != nil { 12157 return err 12158 } 12159 page.rsr = next 12160 if !next.hasNextLink() || !next.IsEmpty() { 12161 break 12162 } 12163 } 12164 return nil 12165} 12166 12167// Next advances to the next page of values. If there was an error making 12168// the request the page does not advance and the error is returned. 12169// Deprecated: Use NextWithContext() instead. 12170func (page *ResourceSkuResultsPage) Next() error { 12171 return page.NextWithContext(context.Background()) 12172} 12173 12174// NotDone returns true if the page enumeration should be started or is not yet complete. 12175func (page ResourceSkuResultsPage) NotDone() bool { 12176 return !page.rsr.IsEmpty() 12177} 12178 12179// Response returns the raw server response from the last page request. 12180func (page ResourceSkuResultsPage) Response() ResourceSkuResults { 12181 return page.rsr 12182} 12183 12184// Values returns the slice of values for the current page or nil if there are no values. 12185func (page ResourceSkuResultsPage) Values() []ResourceSkuResult { 12186 if page.rsr.IsEmpty() { 12187 return nil 12188 } 12189 return *page.rsr.Value 12190} 12191 12192// Creates a new instance of the ResourceSkuResultsPage type. 12193func NewResourceSkuResultsPage(cur ResourceSkuResults, getNextPage func(context.Context, ResourceSkuResults) (ResourceSkuResults, error)) ResourceSkuResultsPage { 12194 return ResourceSkuResultsPage{ 12195 fn: getNextPage, 12196 rsr: cur, 12197 } 12198} 12199 12200// ResponseContract operation response details. 12201type ResponseContract struct { 12202 // StatusCode - Operation response HTTP status code. 12203 StatusCode *int32 `json:"statusCode,omitempty"` 12204 // Description - Operation response description. 12205 Description *string `json:"description,omitempty"` 12206 // Representations - Collection of operation response representations. 12207 Representations *[]RepresentationContract `json:"representations,omitempty"` 12208 // Headers - Collection of operation response headers. 12209 Headers *[]ParameterContract `json:"headers,omitempty"` 12210} 12211 12212// SamplingSettings sampling settings for Diagnostic. 12213type SamplingSettings struct { 12214 // SamplingType - Sampling type. Possible values include: 'Fixed' 12215 SamplingType SamplingType `json:"samplingType,omitempty"` 12216 // Percentage - Rate of sampling for fixed-rate sampling. 12217 Percentage *float64 `json:"percentage,omitempty"` 12218} 12219 12220// SaveConfigurationParameter save Tenant Configuration Contract details. 12221type SaveConfigurationParameter struct { 12222 // SaveConfigurationParameterProperties - Properties of the Save Configuration Parameters. 12223 *SaveConfigurationParameterProperties `json:"properties,omitempty"` 12224} 12225 12226// MarshalJSON is the custom marshaler for SaveConfigurationParameter. 12227func (scp SaveConfigurationParameter) MarshalJSON() ([]byte, error) { 12228 objectMap := make(map[string]interface{}) 12229 if scp.SaveConfigurationParameterProperties != nil { 12230 objectMap["properties"] = scp.SaveConfigurationParameterProperties 12231 } 12232 return json.Marshal(objectMap) 12233} 12234 12235// UnmarshalJSON is the custom unmarshaler for SaveConfigurationParameter struct. 12236func (scp *SaveConfigurationParameter) UnmarshalJSON(body []byte) error { 12237 var m map[string]*json.RawMessage 12238 err := json.Unmarshal(body, &m) 12239 if err != nil { 12240 return err 12241 } 12242 for k, v := range m { 12243 switch k { 12244 case "properties": 12245 if v != nil { 12246 var saveConfigurationParameterProperties SaveConfigurationParameterProperties 12247 err = json.Unmarshal(*v, &saveConfigurationParameterProperties) 12248 if err != nil { 12249 return err 12250 } 12251 scp.SaveConfigurationParameterProperties = &saveConfigurationParameterProperties 12252 } 12253 } 12254 } 12255 12256 return nil 12257} 12258 12259// SaveConfigurationParameterProperties parameters supplied to the Save Tenant Configuration operation. 12260type SaveConfigurationParameterProperties struct { 12261 // Branch - The name of the Git branch in which to commit the current configuration snapshot. 12262 Branch *string `json:"branch,omitempty"` 12263 // Force - The value if true, the current configuration database is committed to the Git repository, even if the Git repository has newer changes that would be overwritten. 12264 Force *bool `json:"force,omitempty"` 12265} 12266 12267// SchemaCollection the response of the list schema operation. 12268type SchemaCollection struct { 12269 autorest.Response `json:"-"` 12270 // Value - READ-ONLY; Api Schema Contract value. 12271 Value *[]SchemaContract `json:"value,omitempty"` 12272 // Count - Total record count number. 12273 Count *int64 `json:"count,omitempty"` 12274 // NextLink - READ-ONLY; Next page link if any. 12275 NextLink *string `json:"nextLink,omitempty"` 12276} 12277 12278// MarshalJSON is the custom marshaler for SchemaCollection. 12279func (sc SchemaCollection) MarshalJSON() ([]byte, error) { 12280 objectMap := make(map[string]interface{}) 12281 if sc.Count != nil { 12282 objectMap["count"] = sc.Count 12283 } 12284 return json.Marshal(objectMap) 12285} 12286 12287// SchemaCollectionIterator provides access to a complete listing of SchemaContract values. 12288type SchemaCollectionIterator struct { 12289 i int 12290 page SchemaCollectionPage 12291} 12292 12293// NextWithContext advances to the next value. If there was an error making 12294// the request the iterator does not advance and the error is returned. 12295func (iter *SchemaCollectionIterator) NextWithContext(ctx context.Context) (err error) { 12296 if tracing.IsEnabled() { 12297 ctx = tracing.StartSpan(ctx, fqdn+"/SchemaCollectionIterator.NextWithContext") 12298 defer func() { 12299 sc := -1 12300 if iter.Response().Response.Response != nil { 12301 sc = iter.Response().Response.Response.StatusCode 12302 } 12303 tracing.EndSpan(ctx, sc, err) 12304 }() 12305 } 12306 iter.i++ 12307 if iter.i < len(iter.page.Values()) { 12308 return nil 12309 } 12310 err = iter.page.NextWithContext(ctx) 12311 if err != nil { 12312 iter.i-- 12313 return err 12314 } 12315 iter.i = 0 12316 return nil 12317} 12318 12319// Next advances to the next value. If there was an error making 12320// the request the iterator does not advance and the error is returned. 12321// Deprecated: Use NextWithContext() instead. 12322func (iter *SchemaCollectionIterator) Next() error { 12323 return iter.NextWithContext(context.Background()) 12324} 12325 12326// NotDone returns true if the enumeration should be started or is not yet complete. 12327func (iter SchemaCollectionIterator) NotDone() bool { 12328 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 12329} 12330 12331// Response returns the raw server response from the last page request. 12332func (iter SchemaCollectionIterator) Response() SchemaCollection { 12333 return iter.page.Response() 12334} 12335 12336// Value returns the current value or a zero-initialized value if the 12337// iterator has advanced beyond the end of the collection. 12338func (iter SchemaCollectionIterator) Value() SchemaContract { 12339 if !iter.page.NotDone() { 12340 return SchemaContract{} 12341 } 12342 return iter.page.Values()[iter.i] 12343} 12344 12345// Creates a new instance of the SchemaCollectionIterator type. 12346func NewSchemaCollectionIterator(page SchemaCollectionPage) SchemaCollectionIterator { 12347 return SchemaCollectionIterator{page: page} 12348} 12349 12350// IsEmpty returns true if the ListResult contains no values. 12351func (sc SchemaCollection) IsEmpty() bool { 12352 return sc.Value == nil || len(*sc.Value) == 0 12353} 12354 12355// hasNextLink returns true if the NextLink is not empty. 12356func (sc SchemaCollection) hasNextLink() bool { 12357 return sc.NextLink != nil && len(*sc.NextLink) != 0 12358} 12359 12360// schemaCollectionPreparer prepares a request to retrieve the next set of results. 12361// It returns nil if no more results exist. 12362func (sc SchemaCollection) schemaCollectionPreparer(ctx context.Context) (*http.Request, error) { 12363 if !sc.hasNextLink() { 12364 return nil, nil 12365 } 12366 return autorest.Prepare((&http.Request{}).WithContext(ctx), 12367 autorest.AsJSON(), 12368 autorest.AsGet(), 12369 autorest.WithBaseURL(to.String(sc.NextLink))) 12370} 12371 12372// SchemaCollectionPage contains a page of SchemaContract values. 12373type SchemaCollectionPage struct { 12374 fn func(context.Context, SchemaCollection) (SchemaCollection, error) 12375 sc SchemaCollection 12376} 12377 12378// NextWithContext advances to the next page of values. If there was an error making 12379// the request the page does not advance and the error is returned. 12380func (page *SchemaCollectionPage) NextWithContext(ctx context.Context) (err error) { 12381 if tracing.IsEnabled() { 12382 ctx = tracing.StartSpan(ctx, fqdn+"/SchemaCollectionPage.NextWithContext") 12383 defer func() { 12384 sc := -1 12385 if page.Response().Response.Response != nil { 12386 sc = page.Response().Response.Response.StatusCode 12387 } 12388 tracing.EndSpan(ctx, sc, err) 12389 }() 12390 } 12391 for { 12392 next, err := page.fn(ctx, page.sc) 12393 if err != nil { 12394 return err 12395 } 12396 page.sc = next 12397 if !next.hasNextLink() || !next.IsEmpty() { 12398 break 12399 } 12400 } 12401 return nil 12402} 12403 12404// Next advances to the next page of values. If there was an error making 12405// the request the page does not advance and the error is returned. 12406// Deprecated: Use NextWithContext() instead. 12407func (page *SchemaCollectionPage) Next() error { 12408 return page.NextWithContext(context.Background()) 12409} 12410 12411// NotDone returns true if the page enumeration should be started or is not yet complete. 12412func (page SchemaCollectionPage) NotDone() bool { 12413 return !page.sc.IsEmpty() 12414} 12415 12416// Response returns the raw server response from the last page request. 12417func (page SchemaCollectionPage) Response() SchemaCollection { 12418 return page.sc 12419} 12420 12421// Values returns the slice of values for the current page or nil if there are no values. 12422func (page SchemaCollectionPage) Values() []SchemaContract { 12423 if page.sc.IsEmpty() { 12424 return nil 12425 } 12426 return *page.sc.Value 12427} 12428 12429// Creates a new instance of the SchemaCollectionPage type. 12430func NewSchemaCollectionPage(cur SchemaCollection, getNextPage func(context.Context, SchemaCollection) (SchemaCollection, error)) SchemaCollectionPage { 12431 return SchemaCollectionPage{ 12432 fn: getNextPage, 12433 sc: cur, 12434 } 12435} 12436 12437// SchemaContract schema Contract details. 12438type SchemaContract struct { 12439 autorest.Response `json:"-"` 12440 // SchemaContractProperties - Properties of the Schema. 12441 *SchemaContractProperties `json:"properties,omitempty"` 12442 // ID - READ-ONLY; Resource ID. 12443 ID *string `json:"id,omitempty"` 12444 // Name - READ-ONLY; Resource name. 12445 Name *string `json:"name,omitempty"` 12446 // Type - READ-ONLY; Resource type for API Management resource. 12447 Type *string `json:"type,omitempty"` 12448} 12449 12450// MarshalJSON is the custom marshaler for SchemaContract. 12451func (sc SchemaContract) MarshalJSON() ([]byte, error) { 12452 objectMap := make(map[string]interface{}) 12453 if sc.SchemaContractProperties != nil { 12454 objectMap["properties"] = sc.SchemaContractProperties 12455 } 12456 return json.Marshal(objectMap) 12457} 12458 12459// UnmarshalJSON is the custom unmarshaler for SchemaContract struct. 12460func (sc *SchemaContract) UnmarshalJSON(body []byte) error { 12461 var m map[string]*json.RawMessage 12462 err := json.Unmarshal(body, &m) 12463 if err != nil { 12464 return err 12465 } 12466 for k, v := range m { 12467 switch k { 12468 case "properties": 12469 if v != nil { 12470 var schemaContractProperties SchemaContractProperties 12471 err = json.Unmarshal(*v, &schemaContractProperties) 12472 if err != nil { 12473 return err 12474 } 12475 sc.SchemaContractProperties = &schemaContractProperties 12476 } 12477 case "id": 12478 if v != nil { 12479 var ID string 12480 err = json.Unmarshal(*v, &ID) 12481 if err != nil { 12482 return err 12483 } 12484 sc.ID = &ID 12485 } 12486 case "name": 12487 if v != nil { 12488 var name string 12489 err = json.Unmarshal(*v, &name) 12490 if err != nil { 12491 return err 12492 } 12493 sc.Name = &name 12494 } 12495 case "type": 12496 if v != nil { 12497 var typeVar string 12498 err = json.Unmarshal(*v, &typeVar) 12499 if err != nil { 12500 return err 12501 } 12502 sc.Type = &typeVar 12503 } 12504 } 12505 } 12506 12507 return nil 12508} 12509 12510// SchemaContractProperties API Schema create or update contract Properties. 12511type SchemaContractProperties struct { 12512 // ContentType - Must be a valid a media type used in a Content-Type header as defined in the RFC 2616. Media type of the schema document (e.g. application/json, application/xml). </br> - `Swagger` Schema use `application/vnd.ms-azure-apim.swagger.definitions+json` </br> - `WSDL` Schema use `application/vnd.ms-azure-apim.xsd+xml` </br> - `OpenApi` Schema use `application/vnd.oai.openapi.components+json` </br> - `WADL Schema` use `application/vnd.ms-azure-apim.wadl.grammars+xml`. 12513 ContentType *string `json:"contentType,omitempty"` 12514 // SchemaDocumentProperties - Create or update Properties of the Schema Document. 12515 *SchemaDocumentProperties `json:"document,omitempty"` 12516} 12517 12518// MarshalJSON is the custom marshaler for SchemaContractProperties. 12519func (scp SchemaContractProperties) MarshalJSON() ([]byte, error) { 12520 objectMap := make(map[string]interface{}) 12521 if scp.ContentType != nil { 12522 objectMap["contentType"] = scp.ContentType 12523 } 12524 if scp.SchemaDocumentProperties != nil { 12525 objectMap["document"] = scp.SchemaDocumentProperties 12526 } 12527 return json.Marshal(objectMap) 12528} 12529 12530// UnmarshalJSON is the custom unmarshaler for SchemaContractProperties struct. 12531func (scp *SchemaContractProperties) UnmarshalJSON(body []byte) error { 12532 var m map[string]*json.RawMessage 12533 err := json.Unmarshal(body, &m) 12534 if err != nil { 12535 return err 12536 } 12537 for k, v := range m { 12538 switch k { 12539 case "contentType": 12540 if v != nil { 12541 var contentType string 12542 err = json.Unmarshal(*v, &contentType) 12543 if err != nil { 12544 return err 12545 } 12546 scp.ContentType = &contentType 12547 } 12548 case "document": 12549 if v != nil { 12550 var schemaDocumentProperties SchemaDocumentProperties 12551 err = json.Unmarshal(*v, &schemaDocumentProperties) 12552 if err != nil { 12553 return err 12554 } 12555 scp.SchemaDocumentProperties = &schemaDocumentProperties 12556 } 12557 } 12558 } 12559 12560 return nil 12561} 12562 12563// SchemaDocumentProperties schema Document Properties. 12564type SchemaDocumentProperties struct { 12565 // Value - Json escaped string defining the document representing the Schema. Used for schemas other than Swagger/OpenAPI. 12566 Value *string `json:"value,omitempty"` 12567 // Definitions - Types definitions. Used for Swagger/OpenAPI schemas only, null otherwise. 12568 Definitions interface{} `json:"definitions,omitempty"` 12569} 12570 12571// ServiceApplyNetworkConfigurationParameters parameter supplied to the Apply Network configuration 12572// operation. 12573type ServiceApplyNetworkConfigurationParameters struct { 12574 // Location - Location of the Api Management service to update for a multi-region service. For a service deployed in a single region, this parameter is not required. 12575 Location *string `json:"location,omitempty"` 12576} 12577 12578// ServiceApplyNetworkConfigurationUpdatesFuture an abstraction for monitoring and retrieving the results 12579// of a long-running operation. 12580type ServiceApplyNetworkConfigurationUpdatesFuture struct { 12581 azure.FutureAPI 12582 // Result returns the result of the asynchronous operation. 12583 // If the operation has not completed it will return an error. 12584 Result func(ServiceClient) (ServiceResource, error) 12585} 12586 12587// UnmarshalJSON is the custom unmarshaller for CreateFuture. 12588func (future *ServiceApplyNetworkConfigurationUpdatesFuture) UnmarshalJSON(body []byte) error { 12589 var azFuture azure.Future 12590 if err := json.Unmarshal(body, &azFuture); err != nil { 12591 return err 12592 } 12593 future.FutureAPI = &azFuture 12594 future.Result = future.result 12595 return nil 12596} 12597 12598// result is the default implementation for ServiceApplyNetworkConfigurationUpdatesFuture.Result. 12599func (future *ServiceApplyNetworkConfigurationUpdatesFuture) result(client ServiceClient) (sr ServiceResource, err error) { 12600 var done bool 12601 done, err = future.DoneWithContext(context.Background(), client) 12602 if err != nil { 12603 err = autorest.NewErrorWithError(err, "apimanagement.ServiceApplyNetworkConfigurationUpdatesFuture", "Result", future.Response(), "Polling failure") 12604 return 12605 } 12606 if !done { 12607 sr.Response.Response = future.Response() 12608 err = azure.NewAsyncOpIncompleteError("apimanagement.ServiceApplyNetworkConfigurationUpdatesFuture") 12609 return 12610 } 12611 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 12612 if sr.Response.Response, err = future.GetResult(sender); err == nil && sr.Response.Response.StatusCode != http.StatusNoContent { 12613 sr, err = client.ApplyNetworkConfigurationUpdatesResponder(sr.Response.Response) 12614 if err != nil { 12615 err = autorest.NewErrorWithError(err, "apimanagement.ServiceApplyNetworkConfigurationUpdatesFuture", "Result", sr.Response.Response, "Failure responding to request") 12616 } 12617 } 12618 return 12619} 12620 12621// ServiceBackupFuture an abstraction for monitoring and retrieving the results of a long-running 12622// operation. 12623type ServiceBackupFuture struct { 12624 azure.FutureAPI 12625 // Result returns the result of the asynchronous operation. 12626 // If the operation has not completed it will return an error. 12627 Result func(ServiceClient) (ServiceResource, error) 12628} 12629 12630// UnmarshalJSON is the custom unmarshaller for CreateFuture. 12631func (future *ServiceBackupFuture) UnmarshalJSON(body []byte) error { 12632 var azFuture azure.Future 12633 if err := json.Unmarshal(body, &azFuture); err != nil { 12634 return err 12635 } 12636 future.FutureAPI = &azFuture 12637 future.Result = future.result 12638 return nil 12639} 12640 12641// result is the default implementation for ServiceBackupFuture.Result. 12642func (future *ServiceBackupFuture) result(client ServiceClient) (sr ServiceResource, err error) { 12643 var done bool 12644 done, err = future.DoneWithContext(context.Background(), client) 12645 if err != nil { 12646 err = autorest.NewErrorWithError(err, "apimanagement.ServiceBackupFuture", "Result", future.Response(), "Polling failure") 12647 return 12648 } 12649 if !done { 12650 sr.Response.Response = future.Response() 12651 err = azure.NewAsyncOpIncompleteError("apimanagement.ServiceBackupFuture") 12652 return 12653 } 12654 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 12655 if sr.Response.Response, err = future.GetResult(sender); err == nil && sr.Response.Response.StatusCode != http.StatusNoContent { 12656 sr, err = client.BackupResponder(sr.Response.Response) 12657 if err != nil { 12658 err = autorest.NewErrorWithError(err, "apimanagement.ServiceBackupFuture", "Result", sr.Response.Response, "Failure responding to request") 12659 } 12660 } 12661 return 12662} 12663 12664// ServiceBackupRestoreParameters parameters supplied to the Backup/Restore of an API Management service 12665// operation. 12666type ServiceBackupRestoreParameters struct { 12667 // StorageAccount - Azure Cloud Storage account (used to place/retrieve the backup) name. 12668 StorageAccount *string `json:"storageAccount,omitempty"` 12669 // AccessKey - Azure Cloud Storage account (used to place/retrieve the backup) access key. 12670 AccessKey *string `json:"accessKey,omitempty"` 12671 // ContainerName - Azure Cloud Storage blob container name used to place/retrieve the backup. 12672 ContainerName *string `json:"containerName,omitempty"` 12673 // BackupName - The name of the backup file to create. 12674 BackupName *string `json:"backupName,omitempty"` 12675} 12676 12677// ServiceBaseProperties base Properties of an API Management service resource description. 12678type ServiceBaseProperties struct { 12679 // NotificationSenderEmail - Email address from which the notification will be sent. 12680 NotificationSenderEmail *string `json:"notificationSenderEmail,omitempty"` 12681 // ProvisioningState - READ-ONLY; The current provisioning state of the API Management service which can be one of the following: Created/Activating/Succeeded/Updating/Failed/Stopped/Terminating/TerminationFailed/Deleted. 12682 ProvisioningState *string `json:"provisioningState,omitempty"` 12683 // TargetProvisioningState - READ-ONLY; The provisioning state of the API Management service, which is targeted by the long running operation started on the service. 12684 TargetProvisioningState *string `json:"targetProvisioningState,omitempty"` 12685 // CreatedAtUtc - READ-ONLY; Creation UTC date of the API Management service.The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. 12686 CreatedAtUtc *date.Time `json:"createdAtUtc,omitempty"` 12687 // GatewayURL - READ-ONLY; Gateway URL of the API Management service. 12688 GatewayURL *string `json:"gatewayUrl,omitempty"` 12689 // GatewayRegionalURL - READ-ONLY; Gateway URL of the API Management service in the Default Region. 12690 GatewayRegionalURL *string `json:"gatewayRegionalUrl,omitempty"` 12691 // PortalURL - READ-ONLY; Publisher portal endpoint Url of the API Management service. 12692 PortalURL *string `json:"portalUrl,omitempty"` 12693 // ManagementAPIURL - READ-ONLY; Management API endpoint URL of the API Management service. 12694 ManagementAPIURL *string `json:"managementApiUrl,omitempty"` 12695 // ScmURL - READ-ONLY; SCM endpoint URL of the API Management service. 12696 ScmURL *string `json:"scmUrl,omitempty"` 12697 // DeveloperPortalURL - READ-ONLY; DEveloper Portal endpoint URL of the API Management service. 12698 DeveloperPortalURL *string `json:"developerPortalUrl,omitempty"` 12699 // HostnameConfigurations - Custom hostname configuration of the API Management service. 12700 HostnameConfigurations *[]HostnameConfiguration `json:"hostnameConfigurations,omitempty"` 12701 // PublicIPAddresses - READ-ONLY; Public Static Load Balanced IP addresses of the API Management service in Primary region. Available only for Basic, Standard, Premium and Isolated SKU. 12702 PublicIPAddresses *[]string `json:"publicIPAddresses,omitempty"` 12703 // PrivateIPAddresses - READ-ONLY; Private Static Load Balanced IP addresses of the API Management service in Primary region which is deployed in an Internal Virtual Network. Available only for Basic, Standard, Premium and Isolated SKU. 12704 PrivateIPAddresses *[]string `json:"privateIPAddresses,omitempty"` 12705 // VirtualNetworkConfiguration - Virtual network configuration of the API Management service. 12706 VirtualNetworkConfiguration *VirtualNetworkConfiguration `json:"virtualNetworkConfiguration,omitempty"` 12707 // AdditionalLocations - Additional datacenter locations of the API Management service. 12708 AdditionalLocations *[]AdditionalLocation `json:"additionalLocations,omitempty"` 12709 // CustomProperties - Custom properties of the API Management service.</br>Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TripleDes168` will disable the cipher TLS_RSA_WITH_3DES_EDE_CBC_SHA for all TLS(1.0, 1.1 and 1.2).</br>Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls11` can be used to disable just TLS 1.1.</br>Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls10` can be used to disable TLS 1.0 on an API Management service.</br>Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls11` can be used to disable just TLS 1.1 for communications with backends.</br>Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls10` can be used to disable TLS 1.0 for communications with backends.</br>Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Protocols.Server.Http2` can be used to enable HTTP2 protocol on an API Management service.</br>Not specifying any of these properties on PATCH operation will reset omitted properties' values to their defaults. For all the settings except Http2 the default value is `True` if the service was created on or before April 1st 2018 and `False` otherwise. Http2 setting's default value is `False`.</br></br>You can disable any of next ciphers by using settings `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.[cipher_name]`: TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA, TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA, TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA, TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA, TLS_RSA_WITH_AES_128_GCM_SHA256, TLS_RSA_WITH_AES_256_CBC_SHA256, TLS_RSA_WITH_AES_128_CBC_SHA256, TLS_RSA_WITH_AES_256_CBC_SHA, TLS_RSA_WITH_AES_128_CBC_SHA. For example, `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TLS_RSA_WITH_AES_128_CBC_SHA256`:`false`. The default value is `true` for them. Note: next ciphers can't be disabled since they are required by Azure CloudService internal components: TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384,TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256,TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384,TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256,TLS_RSA_WITH_AES_256_GCM_SHA384 12710 CustomProperties map[string]*string `json:"customProperties"` 12711 // Certificates - List of Certificates that need to be installed in the API Management service. Max supported certificates that can be installed is 10. 12712 Certificates *[]CertificateConfiguration `json:"certificates,omitempty"` 12713 // EnableClientCertificate - Property only meant to be used for Consumption SKU Service. This enforces a client certificate to be presented on each request to the gateway. This also enables the ability to authenticate the certificate in the policy on the gateway. 12714 EnableClientCertificate *bool `json:"enableClientCertificate,omitempty"` 12715 // DisableGateway - Property only valid for an Api Management service deployed in multiple locations. This can be used to disable the gateway in master region. 12716 DisableGateway *bool `json:"disableGateway,omitempty"` 12717 // VirtualNetworkType - The type of VPN in which API Management service needs to be configured in. None (Default Value) means the API Management service is not part of any Virtual Network, External means the API Management deployment is set up inside a Virtual Network having an Internet Facing Endpoint, and Internal means that API Management deployment is setup inside a Virtual Network having an Intranet Facing Endpoint only. Possible values include: 'VirtualNetworkTypeNone', 'VirtualNetworkTypeExternal', 'VirtualNetworkTypeInternal' 12718 VirtualNetworkType VirtualNetworkType `json:"virtualNetworkType,omitempty"` 12719 // APIVersionConstraint - Control Plane Apis version constraint for the API Management service. 12720 APIVersionConstraint *APIVersionConstraint `json:"apiVersionConstraint,omitempty"` 12721 // Restore - Undelete Api Management Service if it was previously soft-deleted. If this flag is specified and set to True all other properties will be ignored. 12722 Restore *bool `json:"restore,omitempty"` 12723} 12724 12725// MarshalJSON is the custom marshaler for ServiceBaseProperties. 12726func (sbp ServiceBaseProperties) MarshalJSON() ([]byte, error) { 12727 objectMap := make(map[string]interface{}) 12728 if sbp.NotificationSenderEmail != nil { 12729 objectMap["notificationSenderEmail"] = sbp.NotificationSenderEmail 12730 } 12731 if sbp.HostnameConfigurations != nil { 12732 objectMap["hostnameConfigurations"] = sbp.HostnameConfigurations 12733 } 12734 if sbp.VirtualNetworkConfiguration != nil { 12735 objectMap["virtualNetworkConfiguration"] = sbp.VirtualNetworkConfiguration 12736 } 12737 if sbp.AdditionalLocations != nil { 12738 objectMap["additionalLocations"] = sbp.AdditionalLocations 12739 } 12740 if sbp.CustomProperties != nil { 12741 objectMap["customProperties"] = sbp.CustomProperties 12742 } 12743 if sbp.Certificates != nil { 12744 objectMap["certificates"] = sbp.Certificates 12745 } 12746 if sbp.EnableClientCertificate != nil { 12747 objectMap["enableClientCertificate"] = sbp.EnableClientCertificate 12748 } 12749 if sbp.DisableGateway != nil { 12750 objectMap["disableGateway"] = sbp.DisableGateway 12751 } 12752 if sbp.VirtualNetworkType != "" { 12753 objectMap["virtualNetworkType"] = sbp.VirtualNetworkType 12754 } 12755 if sbp.APIVersionConstraint != nil { 12756 objectMap["apiVersionConstraint"] = sbp.APIVersionConstraint 12757 } 12758 if sbp.Restore != nil { 12759 objectMap["restore"] = sbp.Restore 12760 } 12761 return json.Marshal(objectMap) 12762} 12763 12764// ServiceCheckNameAvailabilityParameters parameters supplied to the CheckNameAvailability operation. 12765type ServiceCheckNameAvailabilityParameters struct { 12766 // Name - The name to check for availability. 12767 Name *string `json:"name,omitempty"` 12768} 12769 12770// ServiceCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 12771// operation. 12772type ServiceCreateOrUpdateFuture struct { 12773 azure.FutureAPI 12774 // Result returns the result of the asynchronous operation. 12775 // If the operation has not completed it will return an error. 12776 Result func(ServiceClient) (ServiceResource, error) 12777} 12778 12779// UnmarshalJSON is the custom unmarshaller for CreateFuture. 12780func (future *ServiceCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 12781 var azFuture azure.Future 12782 if err := json.Unmarshal(body, &azFuture); err != nil { 12783 return err 12784 } 12785 future.FutureAPI = &azFuture 12786 future.Result = future.result 12787 return nil 12788} 12789 12790// result is the default implementation for ServiceCreateOrUpdateFuture.Result. 12791func (future *ServiceCreateOrUpdateFuture) result(client ServiceClient) (sr ServiceResource, err error) { 12792 var done bool 12793 done, err = future.DoneWithContext(context.Background(), client) 12794 if err != nil { 12795 err = autorest.NewErrorWithError(err, "apimanagement.ServiceCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 12796 return 12797 } 12798 if !done { 12799 sr.Response.Response = future.Response() 12800 err = azure.NewAsyncOpIncompleteError("apimanagement.ServiceCreateOrUpdateFuture") 12801 return 12802 } 12803 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 12804 if sr.Response.Response, err = future.GetResult(sender); err == nil && sr.Response.Response.StatusCode != http.StatusNoContent { 12805 sr, err = client.CreateOrUpdateResponder(sr.Response.Response) 12806 if err != nil { 12807 err = autorest.NewErrorWithError(err, "apimanagement.ServiceCreateOrUpdateFuture", "Result", sr.Response.Response, "Failure responding to request") 12808 } 12809 } 12810 return 12811} 12812 12813// ServiceDeleteFuture an abstraction for monitoring and retrieving the results of a long-running 12814// operation. 12815type ServiceDeleteFuture struct { 12816 azure.FutureAPI 12817 // Result returns the result of the asynchronous operation. 12818 // If the operation has not completed it will return an error. 12819 Result func(ServiceClient) (ServiceResource, error) 12820} 12821 12822// UnmarshalJSON is the custom unmarshaller for CreateFuture. 12823func (future *ServiceDeleteFuture) UnmarshalJSON(body []byte) error { 12824 var azFuture azure.Future 12825 if err := json.Unmarshal(body, &azFuture); err != nil { 12826 return err 12827 } 12828 future.FutureAPI = &azFuture 12829 future.Result = future.result 12830 return nil 12831} 12832 12833// result is the default implementation for ServiceDeleteFuture.Result. 12834func (future *ServiceDeleteFuture) result(client ServiceClient) (sr ServiceResource, err error) { 12835 var done bool 12836 done, err = future.DoneWithContext(context.Background(), client) 12837 if err != nil { 12838 err = autorest.NewErrorWithError(err, "apimanagement.ServiceDeleteFuture", "Result", future.Response(), "Polling failure") 12839 return 12840 } 12841 if !done { 12842 sr.Response.Response = future.Response() 12843 err = azure.NewAsyncOpIncompleteError("apimanagement.ServiceDeleteFuture") 12844 return 12845 } 12846 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 12847 if sr.Response.Response, err = future.GetResult(sender); err == nil && sr.Response.Response.StatusCode != http.StatusNoContent { 12848 sr, err = client.DeleteResponder(sr.Response.Response) 12849 if err != nil { 12850 err = autorest.NewErrorWithError(err, "apimanagement.ServiceDeleteFuture", "Result", sr.Response.Response, "Failure responding to request") 12851 } 12852 } 12853 return 12854} 12855 12856// ServiceGetDomainOwnershipIdentifierResult response of the GetDomainOwnershipIdentifier operation. 12857type ServiceGetDomainOwnershipIdentifierResult struct { 12858 autorest.Response `json:"-"` 12859 // DomainOwnershipIdentifier - READ-ONLY; The domain ownership identifier value. 12860 DomainOwnershipIdentifier *string `json:"domainOwnershipIdentifier,omitempty"` 12861} 12862 12863// MarshalJSON is the custom marshaler for ServiceGetDomainOwnershipIdentifierResult. 12864func (sgdoir ServiceGetDomainOwnershipIdentifierResult) MarshalJSON() ([]byte, error) { 12865 objectMap := make(map[string]interface{}) 12866 return json.Marshal(objectMap) 12867} 12868 12869// ServiceGetSsoTokenResult the response of the GetSsoToken operation. 12870type ServiceGetSsoTokenResult struct { 12871 autorest.Response `json:"-"` 12872 // RedirectURI - Redirect URL to the Publisher Portal containing the SSO token. 12873 RedirectURI *string `json:"redirectUri,omitempty"` 12874} 12875 12876// ServiceIdentity identity properties of the Api Management service resource. 12877type ServiceIdentity struct { 12878 // Type - The type of identity used for the resource. The type 'SystemAssigned, UserAssigned' includes both an implicitly created identity and a set of user assigned identities. The type 'None' will remove any identities from the service. Possible values include: 'SystemAssigned', 'UserAssigned', 'SystemAssignedUserAssigned', 'None' 12879 Type ApimIdentityType `json:"type,omitempty"` 12880 // PrincipalID - READ-ONLY; The principal id of the identity. 12881 PrincipalID *uuid.UUID `json:"principalId,omitempty"` 12882 // TenantID - READ-ONLY; The client tenant id of the identity. 12883 TenantID *uuid.UUID `json:"tenantId,omitempty"` 12884 // UserAssignedIdentities - The list of user identities associated with the resource. The user identity 12885 // dictionary key references will be ARM resource ids in the form: 12886 // '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/ 12887 // providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. 12888 UserAssignedIdentities map[string]*UserIdentityProperties `json:"userAssignedIdentities"` 12889} 12890 12891// MarshalJSON is the custom marshaler for ServiceIdentity. 12892func (si ServiceIdentity) MarshalJSON() ([]byte, error) { 12893 objectMap := make(map[string]interface{}) 12894 if si.Type != "" { 12895 objectMap["type"] = si.Type 12896 } 12897 if si.UserAssignedIdentities != nil { 12898 objectMap["userAssignedIdentities"] = si.UserAssignedIdentities 12899 } 12900 return json.Marshal(objectMap) 12901} 12902 12903// ServiceListResult the response of the List API Management services operation. 12904type ServiceListResult struct { 12905 autorest.Response `json:"-"` 12906 // Value - Result of the List API Management services operation. 12907 Value *[]ServiceResource `json:"value,omitempty"` 12908 // NextLink - Link to the next set of results. Not empty if Value contains incomplete list of API Management services. 12909 NextLink *string `json:"nextLink,omitempty"` 12910} 12911 12912// ServiceListResultIterator provides access to a complete listing of ServiceResource values. 12913type ServiceListResultIterator struct { 12914 i int 12915 page ServiceListResultPage 12916} 12917 12918// NextWithContext advances to the next value. If there was an error making 12919// the request the iterator does not advance and the error is returned. 12920func (iter *ServiceListResultIterator) NextWithContext(ctx context.Context) (err error) { 12921 if tracing.IsEnabled() { 12922 ctx = tracing.StartSpan(ctx, fqdn+"/ServiceListResultIterator.NextWithContext") 12923 defer func() { 12924 sc := -1 12925 if iter.Response().Response.Response != nil { 12926 sc = iter.Response().Response.Response.StatusCode 12927 } 12928 tracing.EndSpan(ctx, sc, err) 12929 }() 12930 } 12931 iter.i++ 12932 if iter.i < len(iter.page.Values()) { 12933 return nil 12934 } 12935 err = iter.page.NextWithContext(ctx) 12936 if err != nil { 12937 iter.i-- 12938 return err 12939 } 12940 iter.i = 0 12941 return nil 12942} 12943 12944// Next advances to the next value. If there was an error making 12945// the request the iterator does not advance and the error is returned. 12946// Deprecated: Use NextWithContext() instead. 12947func (iter *ServiceListResultIterator) Next() error { 12948 return iter.NextWithContext(context.Background()) 12949} 12950 12951// NotDone returns true if the enumeration should be started or is not yet complete. 12952func (iter ServiceListResultIterator) NotDone() bool { 12953 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 12954} 12955 12956// Response returns the raw server response from the last page request. 12957func (iter ServiceListResultIterator) Response() ServiceListResult { 12958 return iter.page.Response() 12959} 12960 12961// Value returns the current value or a zero-initialized value if the 12962// iterator has advanced beyond the end of the collection. 12963func (iter ServiceListResultIterator) Value() ServiceResource { 12964 if !iter.page.NotDone() { 12965 return ServiceResource{} 12966 } 12967 return iter.page.Values()[iter.i] 12968} 12969 12970// Creates a new instance of the ServiceListResultIterator type. 12971func NewServiceListResultIterator(page ServiceListResultPage) ServiceListResultIterator { 12972 return ServiceListResultIterator{page: page} 12973} 12974 12975// IsEmpty returns true if the ListResult contains no values. 12976func (slr ServiceListResult) IsEmpty() bool { 12977 return slr.Value == nil || len(*slr.Value) == 0 12978} 12979 12980// hasNextLink returns true if the NextLink is not empty. 12981func (slr ServiceListResult) hasNextLink() bool { 12982 return slr.NextLink != nil && len(*slr.NextLink) != 0 12983} 12984 12985// serviceListResultPreparer prepares a request to retrieve the next set of results. 12986// It returns nil if no more results exist. 12987func (slr ServiceListResult) serviceListResultPreparer(ctx context.Context) (*http.Request, error) { 12988 if !slr.hasNextLink() { 12989 return nil, nil 12990 } 12991 return autorest.Prepare((&http.Request{}).WithContext(ctx), 12992 autorest.AsJSON(), 12993 autorest.AsGet(), 12994 autorest.WithBaseURL(to.String(slr.NextLink))) 12995} 12996 12997// ServiceListResultPage contains a page of ServiceResource values. 12998type ServiceListResultPage struct { 12999 fn func(context.Context, ServiceListResult) (ServiceListResult, error) 13000 slr ServiceListResult 13001} 13002 13003// NextWithContext advances to the next page of values. If there was an error making 13004// the request the page does not advance and the error is returned. 13005func (page *ServiceListResultPage) NextWithContext(ctx context.Context) (err error) { 13006 if tracing.IsEnabled() { 13007 ctx = tracing.StartSpan(ctx, fqdn+"/ServiceListResultPage.NextWithContext") 13008 defer func() { 13009 sc := -1 13010 if page.Response().Response.Response != nil { 13011 sc = page.Response().Response.Response.StatusCode 13012 } 13013 tracing.EndSpan(ctx, sc, err) 13014 }() 13015 } 13016 for { 13017 next, err := page.fn(ctx, page.slr) 13018 if err != nil { 13019 return err 13020 } 13021 page.slr = next 13022 if !next.hasNextLink() || !next.IsEmpty() { 13023 break 13024 } 13025 } 13026 return nil 13027} 13028 13029// Next advances to the next page of values. If there was an error making 13030// the request the page does not advance and the error is returned. 13031// Deprecated: Use NextWithContext() instead. 13032func (page *ServiceListResultPage) Next() error { 13033 return page.NextWithContext(context.Background()) 13034} 13035 13036// NotDone returns true if the page enumeration should be started or is not yet complete. 13037func (page ServiceListResultPage) NotDone() bool { 13038 return !page.slr.IsEmpty() 13039} 13040 13041// Response returns the raw server response from the last page request. 13042func (page ServiceListResultPage) Response() ServiceListResult { 13043 return page.slr 13044} 13045 13046// Values returns the slice of values for the current page or nil if there are no values. 13047func (page ServiceListResultPage) Values() []ServiceResource { 13048 if page.slr.IsEmpty() { 13049 return nil 13050 } 13051 return *page.slr.Value 13052} 13053 13054// Creates a new instance of the ServiceListResultPage type. 13055func NewServiceListResultPage(cur ServiceListResult, getNextPage func(context.Context, ServiceListResult) (ServiceListResult, error)) ServiceListResultPage { 13056 return ServiceListResultPage{ 13057 fn: getNextPage, 13058 slr: cur, 13059 } 13060} 13061 13062// ServiceNameAvailabilityResult response of the CheckNameAvailability operation. 13063type ServiceNameAvailabilityResult struct { 13064 autorest.Response `json:"-"` 13065 // NameAvailable - READ-ONLY; True if the name is available and can be used to create a new API Management service; otherwise false. 13066 NameAvailable *bool `json:"nameAvailable,omitempty"` 13067 // Message - READ-ONLY; If reason == invalid, provide the user with the reason why the given name is invalid, and provide the resource naming requirements so that the user can select a valid name. If reason == AlreadyExists, explain that <resourceName> is already in use, and direct them to select a different name. 13068 Message *string `json:"message,omitempty"` 13069 // Reason - Invalid indicates the name provided does not match the resource provider’s naming requirements (incorrect length, unsupported characters, etc.) AlreadyExists indicates that the name is already in use and is therefore unavailable. Possible values include: 'Valid', 'Invalid', 'AlreadyExists' 13070 Reason NameAvailabilityReason `json:"reason,omitempty"` 13071} 13072 13073// MarshalJSON is the custom marshaler for ServiceNameAvailabilityResult. 13074func (snar ServiceNameAvailabilityResult) MarshalJSON() ([]byte, error) { 13075 objectMap := make(map[string]interface{}) 13076 if snar.Reason != "" { 13077 objectMap["reason"] = snar.Reason 13078 } 13079 return json.Marshal(objectMap) 13080} 13081 13082// ServiceProperties properties of an API Management service resource description. 13083type ServiceProperties struct { 13084 // PublisherEmail - Publisher email. 13085 PublisherEmail *string `json:"publisherEmail,omitempty"` 13086 // PublisherName - Publisher name. 13087 PublisherName *string `json:"publisherName,omitempty"` 13088 // NotificationSenderEmail - Email address from which the notification will be sent. 13089 NotificationSenderEmail *string `json:"notificationSenderEmail,omitempty"` 13090 // ProvisioningState - READ-ONLY; The current provisioning state of the API Management service which can be one of the following: Created/Activating/Succeeded/Updating/Failed/Stopped/Terminating/TerminationFailed/Deleted. 13091 ProvisioningState *string `json:"provisioningState,omitempty"` 13092 // TargetProvisioningState - READ-ONLY; The provisioning state of the API Management service, which is targeted by the long running operation started on the service. 13093 TargetProvisioningState *string `json:"targetProvisioningState,omitempty"` 13094 // CreatedAtUtc - READ-ONLY; Creation UTC date of the API Management service.The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. 13095 CreatedAtUtc *date.Time `json:"createdAtUtc,omitempty"` 13096 // GatewayURL - READ-ONLY; Gateway URL of the API Management service. 13097 GatewayURL *string `json:"gatewayUrl,omitempty"` 13098 // GatewayRegionalURL - READ-ONLY; Gateway URL of the API Management service in the Default Region. 13099 GatewayRegionalURL *string `json:"gatewayRegionalUrl,omitempty"` 13100 // PortalURL - READ-ONLY; Publisher portal endpoint Url of the API Management service. 13101 PortalURL *string `json:"portalUrl,omitempty"` 13102 // ManagementAPIURL - READ-ONLY; Management API endpoint URL of the API Management service. 13103 ManagementAPIURL *string `json:"managementApiUrl,omitempty"` 13104 // ScmURL - READ-ONLY; SCM endpoint URL of the API Management service. 13105 ScmURL *string `json:"scmUrl,omitempty"` 13106 // DeveloperPortalURL - READ-ONLY; DEveloper Portal endpoint URL of the API Management service. 13107 DeveloperPortalURL *string `json:"developerPortalUrl,omitempty"` 13108 // HostnameConfigurations - Custom hostname configuration of the API Management service. 13109 HostnameConfigurations *[]HostnameConfiguration `json:"hostnameConfigurations,omitempty"` 13110 // PublicIPAddresses - READ-ONLY; Public Static Load Balanced IP addresses of the API Management service in Primary region. Available only for Basic, Standard, Premium and Isolated SKU. 13111 PublicIPAddresses *[]string `json:"publicIPAddresses,omitempty"` 13112 // PrivateIPAddresses - READ-ONLY; Private Static Load Balanced IP addresses of the API Management service in Primary region which is deployed in an Internal Virtual Network. Available only for Basic, Standard, Premium and Isolated SKU. 13113 PrivateIPAddresses *[]string `json:"privateIPAddresses,omitempty"` 13114 // VirtualNetworkConfiguration - Virtual network configuration of the API Management service. 13115 VirtualNetworkConfiguration *VirtualNetworkConfiguration `json:"virtualNetworkConfiguration,omitempty"` 13116 // AdditionalLocations - Additional datacenter locations of the API Management service. 13117 AdditionalLocations *[]AdditionalLocation `json:"additionalLocations,omitempty"` 13118 // CustomProperties - Custom properties of the API Management service.</br>Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TripleDes168` will disable the cipher TLS_RSA_WITH_3DES_EDE_CBC_SHA for all TLS(1.0, 1.1 and 1.2).</br>Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls11` can be used to disable just TLS 1.1.</br>Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls10` can be used to disable TLS 1.0 on an API Management service.</br>Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls11` can be used to disable just TLS 1.1 for communications with backends.</br>Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls10` can be used to disable TLS 1.0 for communications with backends.</br>Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Protocols.Server.Http2` can be used to enable HTTP2 protocol on an API Management service.</br>Not specifying any of these properties on PATCH operation will reset omitted properties' values to their defaults. For all the settings except Http2 the default value is `True` if the service was created on or before April 1st 2018 and `False` otherwise. Http2 setting's default value is `False`.</br></br>You can disable any of next ciphers by using settings `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.[cipher_name]`: TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA, TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA, TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA, TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA, TLS_RSA_WITH_AES_128_GCM_SHA256, TLS_RSA_WITH_AES_256_CBC_SHA256, TLS_RSA_WITH_AES_128_CBC_SHA256, TLS_RSA_WITH_AES_256_CBC_SHA, TLS_RSA_WITH_AES_128_CBC_SHA. For example, `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TLS_RSA_WITH_AES_128_CBC_SHA256`:`false`. The default value is `true` for them. Note: next ciphers can't be disabled since they are required by Azure CloudService internal components: TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384,TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256,TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384,TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256,TLS_RSA_WITH_AES_256_GCM_SHA384 13119 CustomProperties map[string]*string `json:"customProperties"` 13120 // Certificates - List of Certificates that need to be installed in the API Management service. Max supported certificates that can be installed is 10. 13121 Certificates *[]CertificateConfiguration `json:"certificates,omitempty"` 13122 // EnableClientCertificate - Property only meant to be used for Consumption SKU Service. This enforces a client certificate to be presented on each request to the gateway. This also enables the ability to authenticate the certificate in the policy on the gateway. 13123 EnableClientCertificate *bool `json:"enableClientCertificate,omitempty"` 13124 // DisableGateway - Property only valid for an Api Management service deployed in multiple locations. This can be used to disable the gateway in master region. 13125 DisableGateway *bool `json:"disableGateway,omitempty"` 13126 // VirtualNetworkType - The type of VPN in which API Management service needs to be configured in. None (Default Value) means the API Management service is not part of any Virtual Network, External means the API Management deployment is set up inside a Virtual Network having an Internet Facing Endpoint, and Internal means that API Management deployment is setup inside a Virtual Network having an Intranet Facing Endpoint only. Possible values include: 'VirtualNetworkTypeNone', 'VirtualNetworkTypeExternal', 'VirtualNetworkTypeInternal' 13127 VirtualNetworkType VirtualNetworkType `json:"virtualNetworkType,omitempty"` 13128 // APIVersionConstraint - Control Plane Apis version constraint for the API Management service. 13129 APIVersionConstraint *APIVersionConstraint `json:"apiVersionConstraint,omitempty"` 13130 // Restore - Undelete Api Management Service if it was previously soft-deleted. If this flag is specified and set to True all other properties will be ignored. 13131 Restore *bool `json:"restore,omitempty"` 13132} 13133 13134// MarshalJSON is the custom marshaler for ServiceProperties. 13135func (sp ServiceProperties) MarshalJSON() ([]byte, error) { 13136 objectMap := make(map[string]interface{}) 13137 if sp.PublisherEmail != nil { 13138 objectMap["publisherEmail"] = sp.PublisherEmail 13139 } 13140 if sp.PublisherName != nil { 13141 objectMap["publisherName"] = sp.PublisherName 13142 } 13143 if sp.NotificationSenderEmail != nil { 13144 objectMap["notificationSenderEmail"] = sp.NotificationSenderEmail 13145 } 13146 if sp.HostnameConfigurations != nil { 13147 objectMap["hostnameConfigurations"] = sp.HostnameConfigurations 13148 } 13149 if sp.VirtualNetworkConfiguration != nil { 13150 objectMap["virtualNetworkConfiguration"] = sp.VirtualNetworkConfiguration 13151 } 13152 if sp.AdditionalLocations != nil { 13153 objectMap["additionalLocations"] = sp.AdditionalLocations 13154 } 13155 if sp.CustomProperties != nil { 13156 objectMap["customProperties"] = sp.CustomProperties 13157 } 13158 if sp.Certificates != nil { 13159 objectMap["certificates"] = sp.Certificates 13160 } 13161 if sp.EnableClientCertificate != nil { 13162 objectMap["enableClientCertificate"] = sp.EnableClientCertificate 13163 } 13164 if sp.DisableGateway != nil { 13165 objectMap["disableGateway"] = sp.DisableGateway 13166 } 13167 if sp.VirtualNetworkType != "" { 13168 objectMap["virtualNetworkType"] = sp.VirtualNetworkType 13169 } 13170 if sp.APIVersionConstraint != nil { 13171 objectMap["apiVersionConstraint"] = sp.APIVersionConstraint 13172 } 13173 if sp.Restore != nil { 13174 objectMap["restore"] = sp.Restore 13175 } 13176 return json.Marshal(objectMap) 13177} 13178 13179// ServiceResource a single API Management service resource in List or Get response. 13180type ServiceResource struct { 13181 autorest.Response `json:"-"` 13182 // ServiceProperties - Properties of the API Management service. 13183 *ServiceProperties `json:"properties,omitempty"` 13184 // Sku - SKU properties of the API Management service. 13185 Sku *ServiceSkuProperties `json:"sku,omitempty"` 13186 // Identity - Managed service identity of the Api Management service. 13187 Identity *ServiceIdentity `json:"identity,omitempty"` 13188 // Location - Resource location. 13189 Location *string `json:"location,omitempty"` 13190 // Etag - READ-ONLY; ETag of the resource. 13191 Etag *string `json:"etag,omitempty"` 13192 // Zones - A list of availability zones denoting where the resource needs to come from. 13193 Zones *[]string `json:"zones,omitempty"` 13194 // ID - READ-ONLY; Resource ID. 13195 ID *string `json:"id,omitempty"` 13196 // Name - READ-ONLY; Resource name. 13197 Name *string `json:"name,omitempty"` 13198 // Type - READ-ONLY; Resource type for API Management resource is set to Microsoft.ApiManagement. 13199 Type *string `json:"type,omitempty"` 13200 // Tags - Resource tags. 13201 Tags map[string]*string `json:"tags"` 13202} 13203 13204// MarshalJSON is the custom marshaler for ServiceResource. 13205func (sr ServiceResource) MarshalJSON() ([]byte, error) { 13206 objectMap := make(map[string]interface{}) 13207 if sr.ServiceProperties != nil { 13208 objectMap["properties"] = sr.ServiceProperties 13209 } 13210 if sr.Sku != nil { 13211 objectMap["sku"] = sr.Sku 13212 } 13213 if sr.Identity != nil { 13214 objectMap["identity"] = sr.Identity 13215 } 13216 if sr.Location != nil { 13217 objectMap["location"] = sr.Location 13218 } 13219 if sr.Zones != nil { 13220 objectMap["zones"] = sr.Zones 13221 } 13222 if sr.Tags != nil { 13223 objectMap["tags"] = sr.Tags 13224 } 13225 return json.Marshal(objectMap) 13226} 13227 13228// UnmarshalJSON is the custom unmarshaler for ServiceResource struct. 13229func (sr *ServiceResource) UnmarshalJSON(body []byte) error { 13230 var m map[string]*json.RawMessage 13231 err := json.Unmarshal(body, &m) 13232 if err != nil { 13233 return err 13234 } 13235 for k, v := range m { 13236 switch k { 13237 case "properties": 13238 if v != nil { 13239 var serviceProperties ServiceProperties 13240 err = json.Unmarshal(*v, &serviceProperties) 13241 if err != nil { 13242 return err 13243 } 13244 sr.ServiceProperties = &serviceProperties 13245 } 13246 case "sku": 13247 if v != nil { 13248 var sku ServiceSkuProperties 13249 err = json.Unmarshal(*v, &sku) 13250 if err != nil { 13251 return err 13252 } 13253 sr.Sku = &sku 13254 } 13255 case "identity": 13256 if v != nil { 13257 var identity ServiceIdentity 13258 err = json.Unmarshal(*v, &identity) 13259 if err != nil { 13260 return err 13261 } 13262 sr.Identity = &identity 13263 } 13264 case "location": 13265 if v != nil { 13266 var location string 13267 err = json.Unmarshal(*v, &location) 13268 if err != nil { 13269 return err 13270 } 13271 sr.Location = &location 13272 } 13273 case "etag": 13274 if v != nil { 13275 var etag string 13276 err = json.Unmarshal(*v, &etag) 13277 if err != nil { 13278 return err 13279 } 13280 sr.Etag = &etag 13281 } 13282 case "zones": 13283 if v != nil { 13284 var zones []string 13285 err = json.Unmarshal(*v, &zones) 13286 if err != nil { 13287 return err 13288 } 13289 sr.Zones = &zones 13290 } 13291 case "id": 13292 if v != nil { 13293 var ID string 13294 err = json.Unmarshal(*v, &ID) 13295 if err != nil { 13296 return err 13297 } 13298 sr.ID = &ID 13299 } 13300 case "name": 13301 if v != nil { 13302 var name string 13303 err = json.Unmarshal(*v, &name) 13304 if err != nil { 13305 return err 13306 } 13307 sr.Name = &name 13308 } 13309 case "type": 13310 if v != nil { 13311 var typeVar string 13312 err = json.Unmarshal(*v, &typeVar) 13313 if err != nil { 13314 return err 13315 } 13316 sr.Type = &typeVar 13317 } 13318 case "tags": 13319 if v != nil { 13320 var tags map[string]*string 13321 err = json.Unmarshal(*v, &tags) 13322 if err != nil { 13323 return err 13324 } 13325 sr.Tags = tags 13326 } 13327 } 13328 } 13329 13330 return nil 13331} 13332 13333// ServiceRestoreFuture an abstraction for monitoring and retrieving the results of a long-running 13334// operation. 13335type ServiceRestoreFuture struct { 13336 azure.FutureAPI 13337 // Result returns the result of the asynchronous operation. 13338 // If the operation has not completed it will return an error. 13339 Result func(ServiceClient) (ServiceResource, error) 13340} 13341 13342// UnmarshalJSON is the custom unmarshaller for CreateFuture. 13343func (future *ServiceRestoreFuture) UnmarshalJSON(body []byte) error { 13344 var azFuture azure.Future 13345 if err := json.Unmarshal(body, &azFuture); err != nil { 13346 return err 13347 } 13348 future.FutureAPI = &azFuture 13349 future.Result = future.result 13350 return nil 13351} 13352 13353// result is the default implementation for ServiceRestoreFuture.Result. 13354func (future *ServiceRestoreFuture) result(client ServiceClient) (sr ServiceResource, err error) { 13355 var done bool 13356 done, err = future.DoneWithContext(context.Background(), client) 13357 if err != nil { 13358 err = autorest.NewErrorWithError(err, "apimanagement.ServiceRestoreFuture", "Result", future.Response(), "Polling failure") 13359 return 13360 } 13361 if !done { 13362 sr.Response.Response = future.Response() 13363 err = azure.NewAsyncOpIncompleteError("apimanagement.ServiceRestoreFuture") 13364 return 13365 } 13366 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 13367 if sr.Response.Response, err = future.GetResult(sender); err == nil && sr.Response.Response.StatusCode != http.StatusNoContent { 13368 sr, err = client.RestoreResponder(sr.Response.Response) 13369 if err != nil { 13370 err = autorest.NewErrorWithError(err, "apimanagement.ServiceRestoreFuture", "Result", sr.Response.Response, "Failure responding to request") 13371 } 13372 } 13373 return 13374} 13375 13376// ServiceSkuProperties API Management service resource SKU properties. 13377type ServiceSkuProperties struct { 13378 // Name - Name of the Sku. Possible values include: 'SkuTypeDeveloper', 'SkuTypeStandard', 'SkuTypePremium', 'SkuTypeBasic', 'SkuTypeConsumption', 'SkuTypeIsolated' 13379 Name SkuType `json:"name,omitempty"` 13380 // Capacity - Capacity of the SKU (number of deployed units of the SKU). For Consumption SKU capacity must be specified as 0. 13381 Capacity *int32 `json:"capacity,omitempty"` 13382} 13383 13384// ServiceUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 13385// operation. 13386type ServiceUpdateFuture struct { 13387 azure.FutureAPI 13388 // Result returns the result of the asynchronous operation. 13389 // If the operation has not completed it will return an error. 13390 Result func(ServiceClient) (ServiceResource, error) 13391} 13392 13393// UnmarshalJSON is the custom unmarshaller for CreateFuture. 13394func (future *ServiceUpdateFuture) UnmarshalJSON(body []byte) error { 13395 var azFuture azure.Future 13396 if err := json.Unmarshal(body, &azFuture); err != nil { 13397 return err 13398 } 13399 future.FutureAPI = &azFuture 13400 future.Result = future.result 13401 return nil 13402} 13403 13404// result is the default implementation for ServiceUpdateFuture.Result. 13405func (future *ServiceUpdateFuture) result(client ServiceClient) (sr ServiceResource, err error) { 13406 var done bool 13407 done, err = future.DoneWithContext(context.Background(), client) 13408 if err != nil { 13409 err = autorest.NewErrorWithError(err, "apimanagement.ServiceUpdateFuture", "Result", future.Response(), "Polling failure") 13410 return 13411 } 13412 if !done { 13413 sr.Response.Response = future.Response() 13414 err = azure.NewAsyncOpIncompleteError("apimanagement.ServiceUpdateFuture") 13415 return 13416 } 13417 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 13418 if sr.Response.Response, err = future.GetResult(sender); err == nil && sr.Response.Response.StatusCode != http.StatusNoContent { 13419 sr, err = client.UpdateResponder(sr.Response.Response) 13420 if err != nil { 13421 err = autorest.NewErrorWithError(err, "apimanagement.ServiceUpdateFuture", "Result", sr.Response.Response, "Failure responding to request") 13422 } 13423 } 13424 return 13425} 13426 13427// ServiceUpdateParameters parameter supplied to Update Api Management Service. 13428type ServiceUpdateParameters struct { 13429 // ServiceUpdateProperties - Properties of the API Management service. 13430 *ServiceUpdateProperties `json:"properties,omitempty"` 13431 // Sku - SKU properties of the API Management service. 13432 Sku *ServiceSkuProperties `json:"sku,omitempty"` 13433 // Identity - Managed service identity of the Api Management service. 13434 Identity *ServiceIdentity `json:"identity,omitempty"` 13435 // Etag - READ-ONLY; ETag of the resource. 13436 Etag *string `json:"etag,omitempty"` 13437 // ID - READ-ONLY; Resource ID. 13438 ID *string `json:"id,omitempty"` 13439 // Name - READ-ONLY; Resource name. 13440 Name *string `json:"name,omitempty"` 13441 // Type - READ-ONLY; Resource type for API Management resource is set to Microsoft.ApiManagement. 13442 Type *string `json:"type,omitempty"` 13443 // Tags - Resource tags. 13444 Tags map[string]*string `json:"tags"` 13445} 13446 13447// MarshalJSON is the custom marshaler for ServiceUpdateParameters. 13448func (sup ServiceUpdateParameters) MarshalJSON() ([]byte, error) { 13449 objectMap := make(map[string]interface{}) 13450 if sup.ServiceUpdateProperties != nil { 13451 objectMap["properties"] = sup.ServiceUpdateProperties 13452 } 13453 if sup.Sku != nil { 13454 objectMap["sku"] = sup.Sku 13455 } 13456 if sup.Identity != nil { 13457 objectMap["identity"] = sup.Identity 13458 } 13459 if sup.Tags != nil { 13460 objectMap["tags"] = sup.Tags 13461 } 13462 return json.Marshal(objectMap) 13463} 13464 13465// UnmarshalJSON is the custom unmarshaler for ServiceUpdateParameters struct. 13466func (sup *ServiceUpdateParameters) UnmarshalJSON(body []byte) error { 13467 var m map[string]*json.RawMessage 13468 err := json.Unmarshal(body, &m) 13469 if err != nil { 13470 return err 13471 } 13472 for k, v := range m { 13473 switch k { 13474 case "properties": 13475 if v != nil { 13476 var serviceUpdateProperties ServiceUpdateProperties 13477 err = json.Unmarshal(*v, &serviceUpdateProperties) 13478 if err != nil { 13479 return err 13480 } 13481 sup.ServiceUpdateProperties = &serviceUpdateProperties 13482 } 13483 case "sku": 13484 if v != nil { 13485 var sku ServiceSkuProperties 13486 err = json.Unmarshal(*v, &sku) 13487 if err != nil { 13488 return err 13489 } 13490 sup.Sku = &sku 13491 } 13492 case "identity": 13493 if v != nil { 13494 var identity ServiceIdentity 13495 err = json.Unmarshal(*v, &identity) 13496 if err != nil { 13497 return err 13498 } 13499 sup.Identity = &identity 13500 } 13501 case "etag": 13502 if v != nil { 13503 var etag string 13504 err = json.Unmarshal(*v, &etag) 13505 if err != nil { 13506 return err 13507 } 13508 sup.Etag = &etag 13509 } 13510 case "id": 13511 if v != nil { 13512 var ID string 13513 err = json.Unmarshal(*v, &ID) 13514 if err != nil { 13515 return err 13516 } 13517 sup.ID = &ID 13518 } 13519 case "name": 13520 if v != nil { 13521 var name string 13522 err = json.Unmarshal(*v, &name) 13523 if err != nil { 13524 return err 13525 } 13526 sup.Name = &name 13527 } 13528 case "type": 13529 if v != nil { 13530 var typeVar string 13531 err = json.Unmarshal(*v, &typeVar) 13532 if err != nil { 13533 return err 13534 } 13535 sup.Type = &typeVar 13536 } 13537 case "tags": 13538 if v != nil { 13539 var tags map[string]*string 13540 err = json.Unmarshal(*v, &tags) 13541 if err != nil { 13542 return err 13543 } 13544 sup.Tags = tags 13545 } 13546 } 13547 } 13548 13549 return nil 13550} 13551 13552// ServiceUpdateProperties properties of an API Management service resource description. 13553type ServiceUpdateProperties struct { 13554 // PublisherEmail - Publisher email. 13555 PublisherEmail *string `json:"publisherEmail,omitempty"` 13556 // PublisherName - Publisher name. 13557 PublisherName *string `json:"publisherName,omitempty"` 13558 // NotificationSenderEmail - Email address from which the notification will be sent. 13559 NotificationSenderEmail *string `json:"notificationSenderEmail,omitempty"` 13560 // ProvisioningState - READ-ONLY; The current provisioning state of the API Management service which can be one of the following: Created/Activating/Succeeded/Updating/Failed/Stopped/Terminating/TerminationFailed/Deleted. 13561 ProvisioningState *string `json:"provisioningState,omitempty"` 13562 // TargetProvisioningState - READ-ONLY; The provisioning state of the API Management service, which is targeted by the long running operation started on the service. 13563 TargetProvisioningState *string `json:"targetProvisioningState,omitempty"` 13564 // CreatedAtUtc - READ-ONLY; Creation UTC date of the API Management service.The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. 13565 CreatedAtUtc *date.Time `json:"createdAtUtc,omitempty"` 13566 // GatewayURL - READ-ONLY; Gateway URL of the API Management service. 13567 GatewayURL *string `json:"gatewayUrl,omitempty"` 13568 // GatewayRegionalURL - READ-ONLY; Gateway URL of the API Management service in the Default Region. 13569 GatewayRegionalURL *string `json:"gatewayRegionalUrl,omitempty"` 13570 // PortalURL - READ-ONLY; Publisher portal endpoint Url of the API Management service. 13571 PortalURL *string `json:"portalUrl,omitempty"` 13572 // ManagementAPIURL - READ-ONLY; Management API endpoint URL of the API Management service. 13573 ManagementAPIURL *string `json:"managementApiUrl,omitempty"` 13574 // ScmURL - READ-ONLY; SCM endpoint URL of the API Management service. 13575 ScmURL *string `json:"scmUrl,omitempty"` 13576 // DeveloperPortalURL - READ-ONLY; DEveloper Portal endpoint URL of the API Management service. 13577 DeveloperPortalURL *string `json:"developerPortalUrl,omitempty"` 13578 // HostnameConfigurations - Custom hostname configuration of the API Management service. 13579 HostnameConfigurations *[]HostnameConfiguration `json:"hostnameConfigurations,omitempty"` 13580 // PublicIPAddresses - READ-ONLY; Public Static Load Balanced IP addresses of the API Management service in Primary region. Available only for Basic, Standard, Premium and Isolated SKU. 13581 PublicIPAddresses *[]string `json:"publicIPAddresses,omitempty"` 13582 // PrivateIPAddresses - READ-ONLY; Private Static Load Balanced IP addresses of the API Management service in Primary region which is deployed in an Internal Virtual Network. Available only for Basic, Standard, Premium and Isolated SKU. 13583 PrivateIPAddresses *[]string `json:"privateIPAddresses,omitempty"` 13584 // VirtualNetworkConfiguration - Virtual network configuration of the API Management service. 13585 VirtualNetworkConfiguration *VirtualNetworkConfiguration `json:"virtualNetworkConfiguration,omitempty"` 13586 // AdditionalLocations - Additional datacenter locations of the API Management service. 13587 AdditionalLocations *[]AdditionalLocation `json:"additionalLocations,omitempty"` 13588 // CustomProperties - Custom properties of the API Management service.</br>Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TripleDes168` will disable the cipher TLS_RSA_WITH_3DES_EDE_CBC_SHA for all TLS(1.0, 1.1 and 1.2).</br>Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls11` can be used to disable just TLS 1.1.</br>Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls10` can be used to disable TLS 1.0 on an API Management service.</br>Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls11` can be used to disable just TLS 1.1 for communications with backends.</br>Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls10` can be used to disable TLS 1.0 for communications with backends.</br>Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Protocols.Server.Http2` can be used to enable HTTP2 protocol on an API Management service.</br>Not specifying any of these properties on PATCH operation will reset omitted properties' values to their defaults. For all the settings except Http2 the default value is `True` if the service was created on or before April 1st 2018 and `False` otherwise. Http2 setting's default value is `False`.</br></br>You can disable any of next ciphers by using settings `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.[cipher_name]`: TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA, TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA, TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA, TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA, TLS_RSA_WITH_AES_128_GCM_SHA256, TLS_RSA_WITH_AES_256_CBC_SHA256, TLS_RSA_WITH_AES_128_CBC_SHA256, TLS_RSA_WITH_AES_256_CBC_SHA, TLS_RSA_WITH_AES_128_CBC_SHA. For example, `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TLS_RSA_WITH_AES_128_CBC_SHA256`:`false`. The default value is `true` for them. Note: next ciphers can't be disabled since they are required by Azure CloudService internal components: TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384,TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256,TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384,TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256,TLS_RSA_WITH_AES_256_GCM_SHA384 13589 CustomProperties map[string]*string `json:"customProperties"` 13590 // Certificates - List of Certificates that need to be installed in the API Management service. Max supported certificates that can be installed is 10. 13591 Certificates *[]CertificateConfiguration `json:"certificates,omitempty"` 13592 // EnableClientCertificate - Property only meant to be used for Consumption SKU Service. This enforces a client certificate to be presented on each request to the gateway. This also enables the ability to authenticate the certificate in the policy on the gateway. 13593 EnableClientCertificate *bool `json:"enableClientCertificate,omitempty"` 13594 // DisableGateway - Property only valid for an Api Management service deployed in multiple locations. This can be used to disable the gateway in master region. 13595 DisableGateway *bool `json:"disableGateway,omitempty"` 13596 // VirtualNetworkType - The type of VPN in which API Management service needs to be configured in. None (Default Value) means the API Management service is not part of any Virtual Network, External means the API Management deployment is set up inside a Virtual Network having an Internet Facing Endpoint, and Internal means that API Management deployment is setup inside a Virtual Network having an Intranet Facing Endpoint only. Possible values include: 'VirtualNetworkTypeNone', 'VirtualNetworkTypeExternal', 'VirtualNetworkTypeInternal' 13597 VirtualNetworkType VirtualNetworkType `json:"virtualNetworkType,omitempty"` 13598 // APIVersionConstraint - Control Plane Apis version constraint for the API Management service. 13599 APIVersionConstraint *APIVersionConstraint `json:"apiVersionConstraint,omitempty"` 13600 // Restore - Undelete Api Management Service if it was previously soft-deleted. If this flag is specified and set to True all other properties will be ignored. 13601 Restore *bool `json:"restore,omitempty"` 13602} 13603 13604// MarshalJSON is the custom marshaler for ServiceUpdateProperties. 13605func (sup ServiceUpdateProperties) MarshalJSON() ([]byte, error) { 13606 objectMap := make(map[string]interface{}) 13607 if sup.PublisherEmail != nil { 13608 objectMap["publisherEmail"] = sup.PublisherEmail 13609 } 13610 if sup.PublisherName != nil { 13611 objectMap["publisherName"] = sup.PublisherName 13612 } 13613 if sup.NotificationSenderEmail != nil { 13614 objectMap["notificationSenderEmail"] = sup.NotificationSenderEmail 13615 } 13616 if sup.HostnameConfigurations != nil { 13617 objectMap["hostnameConfigurations"] = sup.HostnameConfigurations 13618 } 13619 if sup.VirtualNetworkConfiguration != nil { 13620 objectMap["virtualNetworkConfiguration"] = sup.VirtualNetworkConfiguration 13621 } 13622 if sup.AdditionalLocations != nil { 13623 objectMap["additionalLocations"] = sup.AdditionalLocations 13624 } 13625 if sup.CustomProperties != nil { 13626 objectMap["customProperties"] = sup.CustomProperties 13627 } 13628 if sup.Certificates != nil { 13629 objectMap["certificates"] = sup.Certificates 13630 } 13631 if sup.EnableClientCertificate != nil { 13632 objectMap["enableClientCertificate"] = sup.EnableClientCertificate 13633 } 13634 if sup.DisableGateway != nil { 13635 objectMap["disableGateway"] = sup.DisableGateway 13636 } 13637 if sup.VirtualNetworkType != "" { 13638 objectMap["virtualNetworkType"] = sup.VirtualNetworkType 13639 } 13640 if sup.APIVersionConstraint != nil { 13641 objectMap["apiVersionConstraint"] = sup.APIVersionConstraint 13642 } 13643 if sup.Restore != nil { 13644 objectMap["restore"] = sup.Restore 13645 } 13646 return json.Marshal(objectMap) 13647} 13648 13649// Sku describes an available ApiManagement SKU. 13650type Sku struct { 13651 // ResourceType - READ-ONLY; The type of resource the SKU applies to. 13652 ResourceType *string `json:"resourceType,omitempty"` 13653 // Name - READ-ONLY; The name of SKU. 13654 Name *string `json:"name,omitempty"` 13655 // Tier - READ-ONLY; Specifies the tier of virtual machines in a scale set.<br /><br /> Possible Values:<br /><br /> **Standard**<br /><br /> **Basic** 13656 Tier *string `json:"tier,omitempty"` 13657 // Size - READ-ONLY; The Size of the SKU. 13658 Size *string `json:"size,omitempty"` 13659 // Family - READ-ONLY; The Family of this particular SKU. 13660 Family *string `json:"family,omitempty"` 13661 // Kind - READ-ONLY; The Kind of resources that are supported in this SKU. 13662 Kind *string `json:"kind,omitempty"` 13663 // Capacity - READ-ONLY; Specifies the number of virtual machines in the scale set. 13664 Capacity *SkuCapacity `json:"capacity,omitempty"` 13665 // Locations - READ-ONLY; The set of locations that the SKU is available. 13666 Locations *[]string `json:"locations,omitempty"` 13667 // LocationInfo - READ-ONLY; A list of locations and availability zones in those locations where the SKU is available. 13668 LocationInfo *[]SkuLocationInfo `json:"locationInfo,omitempty"` 13669 // APIVersions - READ-ONLY; The api versions that support this SKU. 13670 APIVersions *[]string `json:"apiVersions,omitempty"` 13671 // Costs - READ-ONLY; Metadata for retrieving price info. 13672 Costs *[]SkuCosts `json:"costs,omitempty"` 13673 // Capabilities - READ-ONLY; A name value pair to describe the capability. 13674 Capabilities *[]SkuCapabilities `json:"capabilities,omitempty"` 13675 // Restrictions - READ-ONLY; The restrictions because of which SKU cannot be used. This is empty if there are no restrictions. 13676 Restrictions *[]SkuRestrictions `json:"restrictions,omitempty"` 13677} 13678 13679// MarshalJSON is the custom marshaler for Sku. 13680func (s Sku) MarshalJSON() ([]byte, error) { 13681 objectMap := make(map[string]interface{}) 13682 return json.Marshal(objectMap) 13683} 13684 13685// SkuCapabilities describes The SKU capabilities object. 13686type SkuCapabilities struct { 13687 // Name - READ-ONLY; An invariant to describe the feature. 13688 Name *string `json:"name,omitempty"` 13689 // Value - READ-ONLY; An invariant if the feature is measured by quantity. 13690 Value *string `json:"value,omitempty"` 13691} 13692 13693// MarshalJSON is the custom marshaler for SkuCapabilities. 13694func (sc SkuCapabilities) MarshalJSON() ([]byte, error) { 13695 objectMap := make(map[string]interface{}) 13696 return json.Marshal(objectMap) 13697} 13698 13699// SkuCapacity describes scaling information of a SKU. 13700type SkuCapacity struct { 13701 // Minimum - READ-ONLY; The minimum capacity. 13702 Minimum *int32 `json:"minimum,omitempty"` 13703 // Maximum - READ-ONLY; The maximum capacity that can be set. 13704 Maximum *int32 `json:"maximum,omitempty"` 13705 // Default - READ-ONLY; The default capacity. 13706 Default *int32 `json:"default,omitempty"` 13707 // ScaleType - READ-ONLY; The scale type applicable to the sku. Possible values include: 'SkuCapacityScaleTypeAutomatic', 'SkuCapacityScaleTypeManual', 'SkuCapacityScaleTypeNone' 13708 ScaleType SkuCapacityScaleType `json:"scaleType,omitempty"` 13709} 13710 13711// MarshalJSON is the custom marshaler for SkuCapacity. 13712func (sc SkuCapacity) MarshalJSON() ([]byte, error) { 13713 objectMap := make(map[string]interface{}) 13714 return json.Marshal(objectMap) 13715} 13716 13717// SkuCosts describes metadata for retrieving price info. 13718type SkuCosts struct { 13719 // MeterID - READ-ONLY; Used for querying price from commerce. 13720 MeterID *string `json:"meterID,omitempty"` 13721 // Quantity - READ-ONLY; The multiplier is needed to extend the base metered cost. 13722 Quantity *int64 `json:"quantity,omitempty"` 13723 // ExtendedUnit - READ-ONLY; An invariant to show the extended unit. 13724 ExtendedUnit *string `json:"extendedUnit,omitempty"` 13725} 13726 13727// MarshalJSON is the custom marshaler for SkuCosts. 13728func (sc SkuCosts) MarshalJSON() ([]byte, error) { 13729 objectMap := make(map[string]interface{}) 13730 return json.Marshal(objectMap) 13731} 13732 13733// SkuLocationInfo ... 13734type SkuLocationInfo struct { 13735 // Location - READ-ONLY; Location of the SKU 13736 Location *string `json:"location,omitempty"` 13737 // Zones - READ-ONLY; List of availability zones where the SKU is supported. 13738 Zones *[]string `json:"zones,omitempty"` 13739 // ZoneDetails - READ-ONLY; Details of capabilities available to a SKU in specific zones. 13740 ZoneDetails *[]SkuZoneDetails `json:"zoneDetails,omitempty"` 13741} 13742 13743// MarshalJSON is the custom marshaler for SkuLocationInfo. 13744func (sli SkuLocationInfo) MarshalJSON() ([]byte, error) { 13745 objectMap := make(map[string]interface{}) 13746 return json.Marshal(objectMap) 13747} 13748 13749// SkuRestrictionInfo ... 13750type SkuRestrictionInfo struct { 13751 // Locations - READ-ONLY; Locations where the SKU is restricted 13752 Locations *[]string `json:"locations,omitempty"` 13753 // Zones - READ-ONLY; List of availability zones where the SKU is restricted. 13754 Zones *[]string `json:"zones,omitempty"` 13755} 13756 13757// MarshalJSON is the custom marshaler for SkuRestrictionInfo. 13758func (sri SkuRestrictionInfo) MarshalJSON() ([]byte, error) { 13759 objectMap := make(map[string]interface{}) 13760 return json.Marshal(objectMap) 13761} 13762 13763// SkuRestrictions describes scaling information of a SKU. 13764type SkuRestrictions struct { 13765 // Type - READ-ONLY; The type of restrictions. Possible values include: 'Location', 'Zone' 13766 Type SkuRestrictionsType `json:"type,omitempty"` 13767 // Values - READ-ONLY; The value of restrictions. If the restriction type is set to location. This would be different locations where the SKU is restricted. 13768 Values *[]string `json:"values,omitempty"` 13769 // RestrictionInfo - READ-ONLY; The information about the restriction where the SKU cannot be used. 13770 RestrictionInfo *SkuRestrictionInfo `json:"restrictionInfo,omitempty"` 13771 // ReasonCode - READ-ONLY; The reason for restriction. Possible values include: 'QuotaID', 'NotAvailableForSubscription' 13772 ReasonCode SkuRestrictionsReasonCode `json:"reasonCode,omitempty"` 13773} 13774 13775// MarshalJSON is the custom marshaler for SkuRestrictions. 13776func (sr SkuRestrictions) MarshalJSON() ([]byte, error) { 13777 objectMap := make(map[string]interface{}) 13778 return json.Marshal(objectMap) 13779} 13780 13781// SkusResult the List Resource Skus operation response. 13782type SkusResult struct { 13783 autorest.Response `json:"-"` 13784 // Value - The list of skus available for the subscription. 13785 Value *[]Sku `json:"value,omitempty"` 13786 // NextLink - READ-ONLY; The URI to fetch the next page of Resource Skus. Call ListNext() with this URI to fetch the next page of Resource Skus 13787 NextLink *string `json:"nextLink,omitempty"` 13788} 13789 13790// MarshalJSON is the custom marshaler for SkusResult. 13791func (sr SkusResult) MarshalJSON() ([]byte, error) { 13792 objectMap := make(map[string]interface{}) 13793 if sr.Value != nil { 13794 objectMap["value"] = sr.Value 13795 } 13796 return json.Marshal(objectMap) 13797} 13798 13799// SkusResultIterator provides access to a complete listing of Sku values. 13800type SkusResultIterator struct { 13801 i int 13802 page SkusResultPage 13803} 13804 13805// NextWithContext advances to the next value. If there was an error making 13806// the request the iterator does not advance and the error is returned. 13807func (iter *SkusResultIterator) NextWithContext(ctx context.Context) (err error) { 13808 if tracing.IsEnabled() { 13809 ctx = tracing.StartSpan(ctx, fqdn+"/SkusResultIterator.NextWithContext") 13810 defer func() { 13811 sc := -1 13812 if iter.Response().Response.Response != nil { 13813 sc = iter.Response().Response.Response.StatusCode 13814 } 13815 tracing.EndSpan(ctx, sc, err) 13816 }() 13817 } 13818 iter.i++ 13819 if iter.i < len(iter.page.Values()) { 13820 return nil 13821 } 13822 err = iter.page.NextWithContext(ctx) 13823 if err != nil { 13824 iter.i-- 13825 return err 13826 } 13827 iter.i = 0 13828 return nil 13829} 13830 13831// Next advances to the next value. If there was an error making 13832// the request the iterator does not advance and the error is returned. 13833// Deprecated: Use NextWithContext() instead. 13834func (iter *SkusResultIterator) Next() error { 13835 return iter.NextWithContext(context.Background()) 13836} 13837 13838// NotDone returns true if the enumeration should be started or is not yet complete. 13839func (iter SkusResultIterator) NotDone() bool { 13840 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 13841} 13842 13843// Response returns the raw server response from the last page request. 13844func (iter SkusResultIterator) Response() SkusResult { 13845 return iter.page.Response() 13846} 13847 13848// Value returns the current value or a zero-initialized value if the 13849// iterator has advanced beyond the end of the collection. 13850func (iter SkusResultIterator) Value() Sku { 13851 if !iter.page.NotDone() { 13852 return Sku{} 13853 } 13854 return iter.page.Values()[iter.i] 13855} 13856 13857// Creates a new instance of the SkusResultIterator type. 13858func NewSkusResultIterator(page SkusResultPage) SkusResultIterator { 13859 return SkusResultIterator{page: page} 13860} 13861 13862// IsEmpty returns true if the ListResult contains no values. 13863func (sr SkusResult) IsEmpty() bool { 13864 return sr.Value == nil || len(*sr.Value) == 0 13865} 13866 13867// hasNextLink returns true if the NextLink is not empty. 13868func (sr SkusResult) hasNextLink() bool { 13869 return sr.NextLink != nil && len(*sr.NextLink) != 0 13870} 13871 13872// skusResultPreparer prepares a request to retrieve the next set of results. 13873// It returns nil if no more results exist. 13874func (sr SkusResult) skusResultPreparer(ctx context.Context) (*http.Request, error) { 13875 if !sr.hasNextLink() { 13876 return nil, nil 13877 } 13878 return autorest.Prepare((&http.Request{}).WithContext(ctx), 13879 autorest.AsJSON(), 13880 autorest.AsGet(), 13881 autorest.WithBaseURL(to.String(sr.NextLink))) 13882} 13883 13884// SkusResultPage contains a page of Sku values. 13885type SkusResultPage struct { 13886 fn func(context.Context, SkusResult) (SkusResult, error) 13887 sr SkusResult 13888} 13889 13890// NextWithContext advances to the next page of values. If there was an error making 13891// the request the page does not advance and the error is returned. 13892func (page *SkusResultPage) NextWithContext(ctx context.Context) (err error) { 13893 if tracing.IsEnabled() { 13894 ctx = tracing.StartSpan(ctx, fqdn+"/SkusResultPage.NextWithContext") 13895 defer func() { 13896 sc := -1 13897 if page.Response().Response.Response != nil { 13898 sc = page.Response().Response.Response.StatusCode 13899 } 13900 tracing.EndSpan(ctx, sc, err) 13901 }() 13902 } 13903 for { 13904 next, err := page.fn(ctx, page.sr) 13905 if err != nil { 13906 return err 13907 } 13908 page.sr = next 13909 if !next.hasNextLink() || !next.IsEmpty() { 13910 break 13911 } 13912 } 13913 return nil 13914} 13915 13916// Next advances to the next page of values. If there was an error making 13917// the request the page does not advance and the error is returned. 13918// Deprecated: Use NextWithContext() instead. 13919func (page *SkusResultPage) Next() error { 13920 return page.NextWithContext(context.Background()) 13921} 13922 13923// NotDone returns true if the page enumeration should be started or is not yet complete. 13924func (page SkusResultPage) NotDone() bool { 13925 return !page.sr.IsEmpty() 13926} 13927 13928// Response returns the raw server response from the last page request. 13929func (page SkusResultPage) Response() SkusResult { 13930 return page.sr 13931} 13932 13933// Values returns the slice of values for the current page or nil if there are no values. 13934func (page SkusResultPage) Values() []Sku { 13935 if page.sr.IsEmpty() { 13936 return nil 13937 } 13938 return *page.sr.Value 13939} 13940 13941// Creates a new instance of the SkusResultPage type. 13942func NewSkusResultPage(cur SkusResult, getNextPage func(context.Context, SkusResult) (SkusResult, error)) SkusResultPage { 13943 return SkusResultPage{ 13944 fn: getNextPage, 13945 sr: cur, 13946 } 13947} 13948 13949// SkuZoneDetails describes The zonal capabilities of a SKU. 13950type SkuZoneDetails struct { 13951 // Name - READ-ONLY; The set of zones that the SKU is available in with the specified capabilities. 13952 Name *[]string `json:"name,omitempty"` 13953 // Capabilities - READ-ONLY; A list of capabilities that are available for the SKU in the specified list of zones. 13954 Capabilities *[]SkuCapabilities `json:"capabilities,omitempty"` 13955} 13956 13957// MarshalJSON is the custom marshaler for SkuZoneDetails. 13958func (szd SkuZoneDetails) MarshalJSON() ([]byte, error) { 13959 objectMap := make(map[string]interface{}) 13960 return json.Marshal(objectMap) 13961} 13962 13963// SubscriptionCollection paged Subscriptions list representation. 13964type SubscriptionCollection struct { 13965 autorest.Response `json:"-"` 13966 // Value - Page values. 13967 Value *[]SubscriptionContract `json:"value,omitempty"` 13968 // Count - Total record count number across all pages. 13969 Count *int64 `json:"count,omitempty"` 13970 // NextLink - Next page link if any. 13971 NextLink *string `json:"nextLink,omitempty"` 13972} 13973 13974// SubscriptionCollectionIterator provides access to a complete listing of SubscriptionContract values. 13975type SubscriptionCollectionIterator struct { 13976 i int 13977 page SubscriptionCollectionPage 13978} 13979 13980// NextWithContext advances to the next value. If there was an error making 13981// the request the iterator does not advance and the error is returned. 13982func (iter *SubscriptionCollectionIterator) NextWithContext(ctx context.Context) (err error) { 13983 if tracing.IsEnabled() { 13984 ctx = tracing.StartSpan(ctx, fqdn+"/SubscriptionCollectionIterator.NextWithContext") 13985 defer func() { 13986 sc := -1 13987 if iter.Response().Response.Response != nil { 13988 sc = iter.Response().Response.Response.StatusCode 13989 } 13990 tracing.EndSpan(ctx, sc, err) 13991 }() 13992 } 13993 iter.i++ 13994 if iter.i < len(iter.page.Values()) { 13995 return nil 13996 } 13997 err = iter.page.NextWithContext(ctx) 13998 if err != nil { 13999 iter.i-- 14000 return err 14001 } 14002 iter.i = 0 14003 return nil 14004} 14005 14006// Next advances to the next value. If there was an error making 14007// the request the iterator does not advance and the error is returned. 14008// Deprecated: Use NextWithContext() instead. 14009func (iter *SubscriptionCollectionIterator) Next() error { 14010 return iter.NextWithContext(context.Background()) 14011} 14012 14013// NotDone returns true if the enumeration should be started or is not yet complete. 14014func (iter SubscriptionCollectionIterator) NotDone() bool { 14015 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 14016} 14017 14018// Response returns the raw server response from the last page request. 14019func (iter SubscriptionCollectionIterator) Response() SubscriptionCollection { 14020 return iter.page.Response() 14021} 14022 14023// Value returns the current value or a zero-initialized value if the 14024// iterator has advanced beyond the end of the collection. 14025func (iter SubscriptionCollectionIterator) Value() SubscriptionContract { 14026 if !iter.page.NotDone() { 14027 return SubscriptionContract{} 14028 } 14029 return iter.page.Values()[iter.i] 14030} 14031 14032// Creates a new instance of the SubscriptionCollectionIterator type. 14033func NewSubscriptionCollectionIterator(page SubscriptionCollectionPage) SubscriptionCollectionIterator { 14034 return SubscriptionCollectionIterator{page: page} 14035} 14036 14037// IsEmpty returns true if the ListResult contains no values. 14038func (sc SubscriptionCollection) IsEmpty() bool { 14039 return sc.Value == nil || len(*sc.Value) == 0 14040} 14041 14042// hasNextLink returns true if the NextLink is not empty. 14043func (sc SubscriptionCollection) hasNextLink() bool { 14044 return sc.NextLink != nil && len(*sc.NextLink) != 0 14045} 14046 14047// subscriptionCollectionPreparer prepares a request to retrieve the next set of results. 14048// It returns nil if no more results exist. 14049func (sc SubscriptionCollection) subscriptionCollectionPreparer(ctx context.Context) (*http.Request, error) { 14050 if !sc.hasNextLink() { 14051 return nil, nil 14052 } 14053 return autorest.Prepare((&http.Request{}).WithContext(ctx), 14054 autorest.AsJSON(), 14055 autorest.AsGet(), 14056 autorest.WithBaseURL(to.String(sc.NextLink))) 14057} 14058 14059// SubscriptionCollectionPage contains a page of SubscriptionContract values. 14060type SubscriptionCollectionPage struct { 14061 fn func(context.Context, SubscriptionCollection) (SubscriptionCollection, error) 14062 sc SubscriptionCollection 14063} 14064 14065// NextWithContext advances to the next page of values. If there was an error making 14066// the request the page does not advance and the error is returned. 14067func (page *SubscriptionCollectionPage) NextWithContext(ctx context.Context) (err error) { 14068 if tracing.IsEnabled() { 14069 ctx = tracing.StartSpan(ctx, fqdn+"/SubscriptionCollectionPage.NextWithContext") 14070 defer func() { 14071 sc := -1 14072 if page.Response().Response.Response != nil { 14073 sc = page.Response().Response.Response.StatusCode 14074 } 14075 tracing.EndSpan(ctx, sc, err) 14076 }() 14077 } 14078 for { 14079 next, err := page.fn(ctx, page.sc) 14080 if err != nil { 14081 return err 14082 } 14083 page.sc = next 14084 if !next.hasNextLink() || !next.IsEmpty() { 14085 break 14086 } 14087 } 14088 return nil 14089} 14090 14091// Next advances to the next page of values. If there was an error making 14092// the request the page does not advance and the error is returned. 14093// Deprecated: Use NextWithContext() instead. 14094func (page *SubscriptionCollectionPage) Next() error { 14095 return page.NextWithContext(context.Background()) 14096} 14097 14098// NotDone returns true if the page enumeration should be started or is not yet complete. 14099func (page SubscriptionCollectionPage) NotDone() bool { 14100 return !page.sc.IsEmpty() 14101} 14102 14103// Response returns the raw server response from the last page request. 14104func (page SubscriptionCollectionPage) Response() SubscriptionCollection { 14105 return page.sc 14106} 14107 14108// Values returns the slice of values for the current page or nil if there are no values. 14109func (page SubscriptionCollectionPage) Values() []SubscriptionContract { 14110 if page.sc.IsEmpty() { 14111 return nil 14112 } 14113 return *page.sc.Value 14114} 14115 14116// Creates a new instance of the SubscriptionCollectionPage type. 14117func NewSubscriptionCollectionPage(cur SubscriptionCollection, getNextPage func(context.Context, SubscriptionCollection) (SubscriptionCollection, error)) SubscriptionCollectionPage { 14118 return SubscriptionCollectionPage{ 14119 fn: getNextPage, 14120 sc: cur, 14121 } 14122} 14123 14124// SubscriptionContract subscription details. 14125type SubscriptionContract struct { 14126 autorest.Response `json:"-"` 14127 // SubscriptionContractProperties - Subscription contract properties. 14128 *SubscriptionContractProperties `json:"properties,omitempty"` 14129 // ID - READ-ONLY; Resource ID. 14130 ID *string `json:"id,omitempty"` 14131 // Name - READ-ONLY; Resource name. 14132 Name *string `json:"name,omitempty"` 14133 // Type - READ-ONLY; Resource type for API Management resource. 14134 Type *string `json:"type,omitempty"` 14135} 14136 14137// MarshalJSON is the custom marshaler for SubscriptionContract. 14138func (sc SubscriptionContract) MarshalJSON() ([]byte, error) { 14139 objectMap := make(map[string]interface{}) 14140 if sc.SubscriptionContractProperties != nil { 14141 objectMap["properties"] = sc.SubscriptionContractProperties 14142 } 14143 return json.Marshal(objectMap) 14144} 14145 14146// UnmarshalJSON is the custom unmarshaler for SubscriptionContract struct. 14147func (sc *SubscriptionContract) UnmarshalJSON(body []byte) error { 14148 var m map[string]*json.RawMessage 14149 err := json.Unmarshal(body, &m) 14150 if err != nil { 14151 return err 14152 } 14153 for k, v := range m { 14154 switch k { 14155 case "properties": 14156 if v != nil { 14157 var subscriptionContractProperties SubscriptionContractProperties 14158 err = json.Unmarshal(*v, &subscriptionContractProperties) 14159 if err != nil { 14160 return err 14161 } 14162 sc.SubscriptionContractProperties = &subscriptionContractProperties 14163 } 14164 case "id": 14165 if v != nil { 14166 var ID string 14167 err = json.Unmarshal(*v, &ID) 14168 if err != nil { 14169 return err 14170 } 14171 sc.ID = &ID 14172 } 14173 case "name": 14174 if v != nil { 14175 var name string 14176 err = json.Unmarshal(*v, &name) 14177 if err != nil { 14178 return err 14179 } 14180 sc.Name = &name 14181 } 14182 case "type": 14183 if v != nil { 14184 var typeVar string 14185 err = json.Unmarshal(*v, &typeVar) 14186 if err != nil { 14187 return err 14188 } 14189 sc.Type = &typeVar 14190 } 14191 } 14192 } 14193 14194 return nil 14195} 14196 14197// SubscriptionContractProperties subscription details. 14198type SubscriptionContractProperties struct { 14199 // OwnerID - The user resource identifier of the subscription owner. The value is a valid relative URL in the format of /users/{userId} where {userId} is a user identifier. 14200 OwnerID *string `json:"ownerId,omitempty"` 14201 // Scope - Scope like /products/{productId} or /apis or /apis/{apiId}. 14202 Scope *string `json:"scope,omitempty"` 14203 // DisplayName - The name of the subscription, or null if the subscription has no name. 14204 DisplayName *string `json:"displayName,omitempty"` 14205 // State - Subscription state. Possible states are * active – the subscription is active, * suspended – the subscription is blocked, and the subscriber cannot call any APIs of the product, * submitted – the subscription request has been made by the developer, but has not yet been approved or rejected, * rejected – the subscription request has been denied by an administrator, * cancelled – the subscription has been cancelled by the developer or administrator, * expired – the subscription reached its expiration date and was deactivated. Possible values include: 'Suspended', 'Active', 'Expired', 'Submitted', 'Rejected', 'Cancelled' 14206 State SubscriptionState `json:"state,omitempty"` 14207 // CreatedDate - READ-ONLY; Subscription creation date. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. 14208 CreatedDate *date.Time `json:"createdDate,omitempty"` 14209 // StartDate - Subscription activation date. The setting is for audit purposes only and the subscription is not automatically activated. The subscription lifecycle can be managed by using the `state` property. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. 14210 StartDate *date.Time `json:"startDate,omitempty"` 14211 // ExpirationDate - Subscription expiration date. The setting is for audit purposes only and the subscription is not automatically expired. The subscription lifecycle can be managed by using the `state` property. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. 14212 ExpirationDate *date.Time `json:"expirationDate,omitempty"` 14213 // EndDate - Date when subscription was cancelled or expired. The setting is for audit purposes only and the subscription is not automatically cancelled. The subscription lifecycle can be managed by using the `state` property. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. 14214 EndDate *date.Time `json:"endDate,omitempty"` 14215 // NotificationDate - Upcoming subscription expiration notification date. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. 14216 NotificationDate *date.Time `json:"notificationDate,omitempty"` 14217 // PrimaryKey - Subscription primary key. This property will not be filled on 'GET' operations! Use '/listSecrets' POST request to get the value. 14218 PrimaryKey *string `json:"primaryKey,omitempty"` 14219 // SecondaryKey - Subscription secondary key. This property will not be filled on 'GET' operations! Use '/listSecrets' POST request to get the value. 14220 SecondaryKey *string `json:"secondaryKey,omitempty"` 14221 // StateComment - Optional subscription comment added by an administrator when the state is changed to the 'rejected'. 14222 StateComment *string `json:"stateComment,omitempty"` 14223 // AllowTracing - Determines whether tracing is enabled 14224 AllowTracing *bool `json:"allowTracing,omitempty"` 14225} 14226 14227// MarshalJSON is the custom marshaler for SubscriptionContractProperties. 14228func (scp SubscriptionContractProperties) MarshalJSON() ([]byte, error) { 14229 objectMap := make(map[string]interface{}) 14230 if scp.OwnerID != nil { 14231 objectMap["ownerId"] = scp.OwnerID 14232 } 14233 if scp.Scope != nil { 14234 objectMap["scope"] = scp.Scope 14235 } 14236 if scp.DisplayName != nil { 14237 objectMap["displayName"] = scp.DisplayName 14238 } 14239 if scp.State != "" { 14240 objectMap["state"] = scp.State 14241 } 14242 if scp.StartDate != nil { 14243 objectMap["startDate"] = scp.StartDate 14244 } 14245 if scp.ExpirationDate != nil { 14246 objectMap["expirationDate"] = scp.ExpirationDate 14247 } 14248 if scp.EndDate != nil { 14249 objectMap["endDate"] = scp.EndDate 14250 } 14251 if scp.NotificationDate != nil { 14252 objectMap["notificationDate"] = scp.NotificationDate 14253 } 14254 if scp.PrimaryKey != nil { 14255 objectMap["primaryKey"] = scp.PrimaryKey 14256 } 14257 if scp.SecondaryKey != nil { 14258 objectMap["secondaryKey"] = scp.SecondaryKey 14259 } 14260 if scp.StateComment != nil { 14261 objectMap["stateComment"] = scp.StateComment 14262 } 14263 if scp.AllowTracing != nil { 14264 objectMap["allowTracing"] = scp.AllowTracing 14265 } 14266 return json.Marshal(objectMap) 14267} 14268 14269// SubscriptionCreateParameterProperties parameters supplied to the Create subscription operation. 14270type SubscriptionCreateParameterProperties struct { 14271 // OwnerID - User (user id path) for whom subscription is being created in form /users/{userId} 14272 OwnerID *string `json:"ownerId,omitempty"` 14273 // Scope - Scope like /products/{productId} or /apis or /apis/{apiId}. 14274 Scope *string `json:"scope,omitempty"` 14275 // DisplayName - Subscription name. 14276 DisplayName *string `json:"displayName,omitempty"` 14277 // PrimaryKey - Primary subscription key. If not specified during request key will be generated automatically. 14278 PrimaryKey *string `json:"primaryKey,omitempty"` 14279 // SecondaryKey - Secondary subscription key. If not specified during request key will be generated automatically. 14280 SecondaryKey *string `json:"secondaryKey,omitempty"` 14281 // State - Initial subscription state. If no value is specified, subscription is created with Submitted state. Possible states are * active – the subscription is active, * suspended – the subscription is blocked, and the subscriber cannot call any APIs of the product, * submitted – the subscription request has been made by the developer, but has not yet been approved or rejected, * rejected – the subscription request has been denied by an administrator, * cancelled – the subscription has been cancelled by the developer or administrator, * expired – the subscription reached its expiration date and was deactivated. Possible values include: 'Suspended', 'Active', 'Expired', 'Submitted', 'Rejected', 'Cancelled' 14282 State SubscriptionState `json:"state,omitempty"` 14283 // AllowTracing - Determines whether tracing can be enabled 14284 AllowTracing *bool `json:"allowTracing,omitempty"` 14285} 14286 14287// SubscriptionCreateParameters subscription create details. 14288type SubscriptionCreateParameters struct { 14289 // SubscriptionCreateParameterProperties - Subscription contract properties. 14290 *SubscriptionCreateParameterProperties `json:"properties,omitempty"` 14291} 14292 14293// MarshalJSON is the custom marshaler for SubscriptionCreateParameters. 14294func (scp SubscriptionCreateParameters) MarshalJSON() ([]byte, error) { 14295 objectMap := make(map[string]interface{}) 14296 if scp.SubscriptionCreateParameterProperties != nil { 14297 objectMap["properties"] = scp.SubscriptionCreateParameterProperties 14298 } 14299 return json.Marshal(objectMap) 14300} 14301 14302// UnmarshalJSON is the custom unmarshaler for SubscriptionCreateParameters struct. 14303func (scp *SubscriptionCreateParameters) UnmarshalJSON(body []byte) error { 14304 var m map[string]*json.RawMessage 14305 err := json.Unmarshal(body, &m) 14306 if err != nil { 14307 return err 14308 } 14309 for k, v := range m { 14310 switch k { 14311 case "properties": 14312 if v != nil { 14313 var subscriptionCreateParameterProperties SubscriptionCreateParameterProperties 14314 err = json.Unmarshal(*v, &subscriptionCreateParameterProperties) 14315 if err != nil { 14316 return err 14317 } 14318 scp.SubscriptionCreateParameterProperties = &subscriptionCreateParameterProperties 14319 } 14320 } 14321 } 14322 14323 return nil 14324} 14325 14326// SubscriptionKeyParameterNamesContract subscription key parameter names details. 14327type SubscriptionKeyParameterNamesContract struct { 14328 // Header - Subscription key header name. 14329 Header *string `json:"header,omitempty"` 14330 // Query - Subscription key query string parameter name. 14331 Query *string `json:"query,omitempty"` 14332} 14333 14334// SubscriptionKeysContract subscription keys. 14335type SubscriptionKeysContract struct { 14336 autorest.Response `json:"-"` 14337 // PrimaryKey - Subscription primary key. 14338 PrimaryKey *string `json:"primaryKey,omitempty"` 14339 // SecondaryKey - Subscription secondary key. 14340 SecondaryKey *string `json:"secondaryKey,omitempty"` 14341} 14342 14343// SubscriptionsDelegationSettingsProperties subscriptions delegation settings properties. 14344type SubscriptionsDelegationSettingsProperties struct { 14345 // Enabled - Enable or disable delegation for subscriptions. 14346 Enabled *bool `json:"enabled,omitempty"` 14347} 14348 14349// SubscriptionUpdateParameterProperties parameters supplied to the Update subscription operation. 14350type SubscriptionUpdateParameterProperties struct { 14351 // OwnerID - User identifier path: /users/{userId} 14352 OwnerID *string `json:"ownerId,omitempty"` 14353 // Scope - Scope like /products/{productId} or /apis or /apis/{apiId} 14354 Scope *string `json:"scope,omitempty"` 14355 // ExpirationDate - Subscription expiration date. The setting is for audit purposes only and the subscription is not automatically expired. The subscription lifecycle can be managed by using the `state` property. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. 14356 ExpirationDate *date.Time `json:"expirationDate,omitempty"` 14357 // DisplayName - Subscription name. 14358 DisplayName *string `json:"displayName,omitempty"` 14359 // PrimaryKey - Primary subscription key. 14360 PrimaryKey *string `json:"primaryKey,omitempty"` 14361 // SecondaryKey - Secondary subscription key. 14362 SecondaryKey *string `json:"secondaryKey,omitempty"` 14363 // State - Subscription state. Possible states are * active – the subscription is active, * suspended – the subscription is blocked, and the subscriber cannot call any APIs of the product, * submitted – the subscription request has been made by the developer, but has not yet been approved or rejected, * rejected – the subscription request has been denied by an administrator, * cancelled – the subscription has been cancelled by the developer or administrator, * expired – the subscription reached its expiration date and was deactivated. Possible values include: 'Suspended', 'Active', 'Expired', 'Submitted', 'Rejected', 'Cancelled' 14364 State SubscriptionState `json:"state,omitempty"` 14365 // StateComment - Comments describing subscription state change by the administrator when the state is changed to the 'rejected'. 14366 StateComment *string `json:"stateComment,omitempty"` 14367 // AllowTracing - Determines whether tracing can be enabled 14368 AllowTracing *bool `json:"allowTracing,omitempty"` 14369} 14370 14371// SubscriptionUpdateParameters subscription update details. 14372type SubscriptionUpdateParameters struct { 14373 // SubscriptionUpdateParameterProperties - Subscription Update contract properties. 14374 *SubscriptionUpdateParameterProperties `json:"properties,omitempty"` 14375} 14376 14377// MarshalJSON is the custom marshaler for SubscriptionUpdateParameters. 14378func (sup SubscriptionUpdateParameters) MarshalJSON() ([]byte, error) { 14379 objectMap := make(map[string]interface{}) 14380 if sup.SubscriptionUpdateParameterProperties != nil { 14381 objectMap["properties"] = sup.SubscriptionUpdateParameterProperties 14382 } 14383 return json.Marshal(objectMap) 14384} 14385 14386// UnmarshalJSON is the custom unmarshaler for SubscriptionUpdateParameters struct. 14387func (sup *SubscriptionUpdateParameters) UnmarshalJSON(body []byte) error { 14388 var m map[string]*json.RawMessage 14389 err := json.Unmarshal(body, &m) 14390 if err != nil { 14391 return err 14392 } 14393 for k, v := range m { 14394 switch k { 14395 case "properties": 14396 if v != nil { 14397 var subscriptionUpdateParameterProperties SubscriptionUpdateParameterProperties 14398 err = json.Unmarshal(*v, &subscriptionUpdateParameterProperties) 14399 if err != nil { 14400 return err 14401 } 14402 sup.SubscriptionUpdateParameterProperties = &subscriptionUpdateParameterProperties 14403 } 14404 } 14405 } 14406 14407 return nil 14408} 14409 14410// TagCollection paged Tag list representation. 14411type TagCollection struct { 14412 autorest.Response `json:"-"` 14413 // Value - Page values. 14414 Value *[]TagContract `json:"value,omitempty"` 14415 // Count - Total record count number across all pages. 14416 Count *int64 `json:"count,omitempty"` 14417 // NextLink - Next page link if any. 14418 NextLink *string `json:"nextLink,omitempty"` 14419} 14420 14421// TagCollectionIterator provides access to a complete listing of TagContract values. 14422type TagCollectionIterator struct { 14423 i int 14424 page TagCollectionPage 14425} 14426 14427// NextWithContext advances to the next value. If there was an error making 14428// the request the iterator does not advance and the error is returned. 14429func (iter *TagCollectionIterator) NextWithContext(ctx context.Context) (err error) { 14430 if tracing.IsEnabled() { 14431 ctx = tracing.StartSpan(ctx, fqdn+"/TagCollectionIterator.NextWithContext") 14432 defer func() { 14433 sc := -1 14434 if iter.Response().Response.Response != nil { 14435 sc = iter.Response().Response.Response.StatusCode 14436 } 14437 tracing.EndSpan(ctx, sc, err) 14438 }() 14439 } 14440 iter.i++ 14441 if iter.i < len(iter.page.Values()) { 14442 return nil 14443 } 14444 err = iter.page.NextWithContext(ctx) 14445 if err != nil { 14446 iter.i-- 14447 return err 14448 } 14449 iter.i = 0 14450 return nil 14451} 14452 14453// Next advances to the next value. If there was an error making 14454// the request the iterator does not advance and the error is returned. 14455// Deprecated: Use NextWithContext() instead. 14456func (iter *TagCollectionIterator) Next() error { 14457 return iter.NextWithContext(context.Background()) 14458} 14459 14460// NotDone returns true if the enumeration should be started or is not yet complete. 14461func (iter TagCollectionIterator) NotDone() bool { 14462 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 14463} 14464 14465// Response returns the raw server response from the last page request. 14466func (iter TagCollectionIterator) Response() TagCollection { 14467 return iter.page.Response() 14468} 14469 14470// Value returns the current value or a zero-initialized value if the 14471// iterator has advanced beyond the end of the collection. 14472func (iter TagCollectionIterator) Value() TagContract { 14473 if !iter.page.NotDone() { 14474 return TagContract{} 14475 } 14476 return iter.page.Values()[iter.i] 14477} 14478 14479// Creates a new instance of the TagCollectionIterator type. 14480func NewTagCollectionIterator(page TagCollectionPage) TagCollectionIterator { 14481 return TagCollectionIterator{page: page} 14482} 14483 14484// IsEmpty returns true if the ListResult contains no values. 14485func (tc TagCollection) IsEmpty() bool { 14486 return tc.Value == nil || len(*tc.Value) == 0 14487} 14488 14489// hasNextLink returns true if the NextLink is not empty. 14490func (tc TagCollection) hasNextLink() bool { 14491 return tc.NextLink != nil && len(*tc.NextLink) != 0 14492} 14493 14494// tagCollectionPreparer prepares a request to retrieve the next set of results. 14495// It returns nil if no more results exist. 14496func (tc TagCollection) tagCollectionPreparer(ctx context.Context) (*http.Request, error) { 14497 if !tc.hasNextLink() { 14498 return nil, nil 14499 } 14500 return autorest.Prepare((&http.Request{}).WithContext(ctx), 14501 autorest.AsJSON(), 14502 autorest.AsGet(), 14503 autorest.WithBaseURL(to.String(tc.NextLink))) 14504} 14505 14506// TagCollectionPage contains a page of TagContract values. 14507type TagCollectionPage struct { 14508 fn func(context.Context, TagCollection) (TagCollection, error) 14509 tc TagCollection 14510} 14511 14512// NextWithContext advances to the next page of values. If there was an error making 14513// the request the page does not advance and the error is returned. 14514func (page *TagCollectionPage) NextWithContext(ctx context.Context) (err error) { 14515 if tracing.IsEnabled() { 14516 ctx = tracing.StartSpan(ctx, fqdn+"/TagCollectionPage.NextWithContext") 14517 defer func() { 14518 sc := -1 14519 if page.Response().Response.Response != nil { 14520 sc = page.Response().Response.Response.StatusCode 14521 } 14522 tracing.EndSpan(ctx, sc, err) 14523 }() 14524 } 14525 for { 14526 next, err := page.fn(ctx, page.tc) 14527 if err != nil { 14528 return err 14529 } 14530 page.tc = next 14531 if !next.hasNextLink() || !next.IsEmpty() { 14532 break 14533 } 14534 } 14535 return nil 14536} 14537 14538// Next advances to the next page of values. If there was an error making 14539// the request the page does not advance and the error is returned. 14540// Deprecated: Use NextWithContext() instead. 14541func (page *TagCollectionPage) Next() error { 14542 return page.NextWithContext(context.Background()) 14543} 14544 14545// NotDone returns true if the page enumeration should be started or is not yet complete. 14546func (page TagCollectionPage) NotDone() bool { 14547 return !page.tc.IsEmpty() 14548} 14549 14550// Response returns the raw server response from the last page request. 14551func (page TagCollectionPage) Response() TagCollection { 14552 return page.tc 14553} 14554 14555// Values returns the slice of values for the current page or nil if there are no values. 14556func (page TagCollectionPage) Values() []TagContract { 14557 if page.tc.IsEmpty() { 14558 return nil 14559 } 14560 return *page.tc.Value 14561} 14562 14563// Creates a new instance of the TagCollectionPage type. 14564func NewTagCollectionPage(cur TagCollection, getNextPage func(context.Context, TagCollection) (TagCollection, error)) TagCollectionPage { 14565 return TagCollectionPage{ 14566 fn: getNextPage, 14567 tc: cur, 14568 } 14569} 14570 14571// TagContract tag Contract details. 14572type TagContract struct { 14573 autorest.Response `json:"-"` 14574 // TagContractProperties - Tag entity contract properties. 14575 *TagContractProperties `json:"properties,omitempty"` 14576 // ID - READ-ONLY; Resource ID. 14577 ID *string `json:"id,omitempty"` 14578 // Name - READ-ONLY; Resource name. 14579 Name *string `json:"name,omitempty"` 14580 // Type - READ-ONLY; Resource type for API Management resource. 14581 Type *string `json:"type,omitempty"` 14582} 14583 14584// MarshalJSON is the custom marshaler for TagContract. 14585func (tc TagContract) MarshalJSON() ([]byte, error) { 14586 objectMap := make(map[string]interface{}) 14587 if tc.TagContractProperties != nil { 14588 objectMap["properties"] = tc.TagContractProperties 14589 } 14590 return json.Marshal(objectMap) 14591} 14592 14593// UnmarshalJSON is the custom unmarshaler for TagContract struct. 14594func (tc *TagContract) UnmarshalJSON(body []byte) error { 14595 var m map[string]*json.RawMessage 14596 err := json.Unmarshal(body, &m) 14597 if err != nil { 14598 return err 14599 } 14600 for k, v := range m { 14601 switch k { 14602 case "properties": 14603 if v != nil { 14604 var tagContractProperties TagContractProperties 14605 err = json.Unmarshal(*v, &tagContractProperties) 14606 if err != nil { 14607 return err 14608 } 14609 tc.TagContractProperties = &tagContractProperties 14610 } 14611 case "id": 14612 if v != nil { 14613 var ID string 14614 err = json.Unmarshal(*v, &ID) 14615 if err != nil { 14616 return err 14617 } 14618 tc.ID = &ID 14619 } 14620 case "name": 14621 if v != nil { 14622 var name string 14623 err = json.Unmarshal(*v, &name) 14624 if err != nil { 14625 return err 14626 } 14627 tc.Name = &name 14628 } 14629 case "type": 14630 if v != nil { 14631 var typeVar string 14632 err = json.Unmarshal(*v, &typeVar) 14633 if err != nil { 14634 return err 14635 } 14636 tc.Type = &typeVar 14637 } 14638 } 14639 } 14640 14641 return nil 14642} 14643 14644// TagContractProperties tag contract Properties. 14645type TagContractProperties struct { 14646 // DisplayName - Tag name. 14647 DisplayName *string `json:"displayName,omitempty"` 14648} 14649 14650// TagCreateUpdateParameters parameters supplied to Create/Update Tag operations. 14651type TagCreateUpdateParameters struct { 14652 // TagContractProperties - Properties supplied to Create Tag operation. 14653 *TagContractProperties `json:"properties,omitempty"` 14654} 14655 14656// MarshalJSON is the custom marshaler for TagCreateUpdateParameters. 14657func (tcup TagCreateUpdateParameters) MarshalJSON() ([]byte, error) { 14658 objectMap := make(map[string]interface{}) 14659 if tcup.TagContractProperties != nil { 14660 objectMap["properties"] = tcup.TagContractProperties 14661 } 14662 return json.Marshal(objectMap) 14663} 14664 14665// UnmarshalJSON is the custom unmarshaler for TagCreateUpdateParameters struct. 14666func (tcup *TagCreateUpdateParameters) UnmarshalJSON(body []byte) error { 14667 var m map[string]*json.RawMessage 14668 err := json.Unmarshal(body, &m) 14669 if err != nil { 14670 return err 14671 } 14672 for k, v := range m { 14673 switch k { 14674 case "properties": 14675 if v != nil { 14676 var tagContractProperties TagContractProperties 14677 err = json.Unmarshal(*v, &tagContractProperties) 14678 if err != nil { 14679 return err 14680 } 14681 tcup.TagContractProperties = &tagContractProperties 14682 } 14683 } 14684 } 14685 14686 return nil 14687} 14688 14689// TagDescriptionBaseProperties parameters supplied to the Create TagDescription operation. 14690type TagDescriptionBaseProperties struct { 14691 // Description - Description of the Tag. 14692 Description *string `json:"description,omitempty"` 14693 // ExternalDocsURL - Absolute URL of external resources describing the tag. 14694 ExternalDocsURL *string `json:"externalDocsUrl,omitempty"` 14695 // ExternalDocsDescription - Description of the external resources describing the tag. 14696 ExternalDocsDescription *string `json:"externalDocsDescription,omitempty"` 14697} 14698 14699// TagDescriptionCollection paged TagDescription list representation. 14700type TagDescriptionCollection struct { 14701 autorest.Response `json:"-"` 14702 // Value - Page values. 14703 Value *[]TagDescriptionContract `json:"value,omitempty"` 14704 // Count - Total record count number across all pages. 14705 Count *int64 `json:"count,omitempty"` 14706 // NextLink - Next page link if any. 14707 NextLink *string `json:"nextLink,omitempty"` 14708} 14709 14710// TagDescriptionCollectionIterator provides access to a complete listing of TagDescriptionContract values. 14711type TagDescriptionCollectionIterator struct { 14712 i int 14713 page TagDescriptionCollectionPage 14714} 14715 14716// NextWithContext advances to the next value. If there was an error making 14717// the request the iterator does not advance and the error is returned. 14718func (iter *TagDescriptionCollectionIterator) NextWithContext(ctx context.Context) (err error) { 14719 if tracing.IsEnabled() { 14720 ctx = tracing.StartSpan(ctx, fqdn+"/TagDescriptionCollectionIterator.NextWithContext") 14721 defer func() { 14722 sc := -1 14723 if iter.Response().Response.Response != nil { 14724 sc = iter.Response().Response.Response.StatusCode 14725 } 14726 tracing.EndSpan(ctx, sc, err) 14727 }() 14728 } 14729 iter.i++ 14730 if iter.i < len(iter.page.Values()) { 14731 return nil 14732 } 14733 err = iter.page.NextWithContext(ctx) 14734 if err != nil { 14735 iter.i-- 14736 return err 14737 } 14738 iter.i = 0 14739 return nil 14740} 14741 14742// Next advances to the next value. If there was an error making 14743// the request the iterator does not advance and the error is returned. 14744// Deprecated: Use NextWithContext() instead. 14745func (iter *TagDescriptionCollectionIterator) Next() error { 14746 return iter.NextWithContext(context.Background()) 14747} 14748 14749// NotDone returns true if the enumeration should be started or is not yet complete. 14750func (iter TagDescriptionCollectionIterator) NotDone() bool { 14751 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 14752} 14753 14754// Response returns the raw server response from the last page request. 14755func (iter TagDescriptionCollectionIterator) Response() TagDescriptionCollection { 14756 return iter.page.Response() 14757} 14758 14759// Value returns the current value or a zero-initialized value if the 14760// iterator has advanced beyond the end of the collection. 14761func (iter TagDescriptionCollectionIterator) Value() TagDescriptionContract { 14762 if !iter.page.NotDone() { 14763 return TagDescriptionContract{} 14764 } 14765 return iter.page.Values()[iter.i] 14766} 14767 14768// Creates a new instance of the TagDescriptionCollectionIterator type. 14769func NewTagDescriptionCollectionIterator(page TagDescriptionCollectionPage) TagDescriptionCollectionIterator { 14770 return TagDescriptionCollectionIterator{page: page} 14771} 14772 14773// IsEmpty returns true if the ListResult contains no values. 14774func (tdc TagDescriptionCollection) IsEmpty() bool { 14775 return tdc.Value == nil || len(*tdc.Value) == 0 14776} 14777 14778// hasNextLink returns true if the NextLink is not empty. 14779func (tdc TagDescriptionCollection) hasNextLink() bool { 14780 return tdc.NextLink != nil && len(*tdc.NextLink) != 0 14781} 14782 14783// tagDescriptionCollectionPreparer prepares a request to retrieve the next set of results. 14784// It returns nil if no more results exist. 14785func (tdc TagDescriptionCollection) tagDescriptionCollectionPreparer(ctx context.Context) (*http.Request, error) { 14786 if !tdc.hasNextLink() { 14787 return nil, nil 14788 } 14789 return autorest.Prepare((&http.Request{}).WithContext(ctx), 14790 autorest.AsJSON(), 14791 autorest.AsGet(), 14792 autorest.WithBaseURL(to.String(tdc.NextLink))) 14793} 14794 14795// TagDescriptionCollectionPage contains a page of TagDescriptionContract values. 14796type TagDescriptionCollectionPage struct { 14797 fn func(context.Context, TagDescriptionCollection) (TagDescriptionCollection, error) 14798 tdc TagDescriptionCollection 14799} 14800 14801// NextWithContext advances to the next page of values. If there was an error making 14802// the request the page does not advance and the error is returned. 14803func (page *TagDescriptionCollectionPage) NextWithContext(ctx context.Context) (err error) { 14804 if tracing.IsEnabled() { 14805 ctx = tracing.StartSpan(ctx, fqdn+"/TagDescriptionCollectionPage.NextWithContext") 14806 defer func() { 14807 sc := -1 14808 if page.Response().Response.Response != nil { 14809 sc = page.Response().Response.Response.StatusCode 14810 } 14811 tracing.EndSpan(ctx, sc, err) 14812 }() 14813 } 14814 for { 14815 next, err := page.fn(ctx, page.tdc) 14816 if err != nil { 14817 return err 14818 } 14819 page.tdc = next 14820 if !next.hasNextLink() || !next.IsEmpty() { 14821 break 14822 } 14823 } 14824 return nil 14825} 14826 14827// Next advances to the next page of values. If there was an error making 14828// the request the page does not advance and the error is returned. 14829// Deprecated: Use NextWithContext() instead. 14830func (page *TagDescriptionCollectionPage) Next() error { 14831 return page.NextWithContext(context.Background()) 14832} 14833 14834// NotDone returns true if the page enumeration should be started or is not yet complete. 14835func (page TagDescriptionCollectionPage) NotDone() bool { 14836 return !page.tdc.IsEmpty() 14837} 14838 14839// Response returns the raw server response from the last page request. 14840func (page TagDescriptionCollectionPage) Response() TagDescriptionCollection { 14841 return page.tdc 14842} 14843 14844// Values returns the slice of values for the current page or nil if there are no values. 14845func (page TagDescriptionCollectionPage) Values() []TagDescriptionContract { 14846 if page.tdc.IsEmpty() { 14847 return nil 14848 } 14849 return *page.tdc.Value 14850} 14851 14852// Creates a new instance of the TagDescriptionCollectionPage type. 14853func NewTagDescriptionCollectionPage(cur TagDescriptionCollection, getNextPage func(context.Context, TagDescriptionCollection) (TagDescriptionCollection, error)) TagDescriptionCollectionPage { 14854 return TagDescriptionCollectionPage{ 14855 fn: getNextPage, 14856 tdc: cur, 14857 } 14858} 14859 14860// TagDescriptionContract contract details. 14861type TagDescriptionContract struct { 14862 autorest.Response `json:"-"` 14863 // TagDescriptionContractProperties - TagDescription entity contract properties. 14864 *TagDescriptionContractProperties `json:"properties,omitempty"` 14865 // ID - READ-ONLY; Resource ID. 14866 ID *string `json:"id,omitempty"` 14867 // Name - READ-ONLY; Resource name. 14868 Name *string `json:"name,omitempty"` 14869 // Type - READ-ONLY; Resource type for API Management resource. 14870 Type *string `json:"type,omitempty"` 14871} 14872 14873// MarshalJSON is the custom marshaler for TagDescriptionContract. 14874func (tdc TagDescriptionContract) MarshalJSON() ([]byte, error) { 14875 objectMap := make(map[string]interface{}) 14876 if tdc.TagDescriptionContractProperties != nil { 14877 objectMap["properties"] = tdc.TagDescriptionContractProperties 14878 } 14879 return json.Marshal(objectMap) 14880} 14881 14882// UnmarshalJSON is the custom unmarshaler for TagDescriptionContract struct. 14883func (tdc *TagDescriptionContract) UnmarshalJSON(body []byte) error { 14884 var m map[string]*json.RawMessage 14885 err := json.Unmarshal(body, &m) 14886 if err != nil { 14887 return err 14888 } 14889 for k, v := range m { 14890 switch k { 14891 case "properties": 14892 if v != nil { 14893 var tagDescriptionContractProperties TagDescriptionContractProperties 14894 err = json.Unmarshal(*v, &tagDescriptionContractProperties) 14895 if err != nil { 14896 return err 14897 } 14898 tdc.TagDescriptionContractProperties = &tagDescriptionContractProperties 14899 } 14900 case "id": 14901 if v != nil { 14902 var ID string 14903 err = json.Unmarshal(*v, &ID) 14904 if err != nil { 14905 return err 14906 } 14907 tdc.ID = &ID 14908 } 14909 case "name": 14910 if v != nil { 14911 var name string 14912 err = json.Unmarshal(*v, &name) 14913 if err != nil { 14914 return err 14915 } 14916 tdc.Name = &name 14917 } 14918 case "type": 14919 if v != nil { 14920 var typeVar string 14921 err = json.Unmarshal(*v, &typeVar) 14922 if err != nil { 14923 return err 14924 } 14925 tdc.Type = &typeVar 14926 } 14927 } 14928 } 14929 14930 return nil 14931} 14932 14933// TagDescriptionContractProperties tagDescription contract Properties. 14934type TagDescriptionContractProperties struct { 14935 // TagID - Identifier of the tag in the form of /tags/{tagId} 14936 TagID *string `json:"tagId,omitempty"` 14937 // DisplayName - Tag name. 14938 DisplayName *string `json:"displayName,omitempty"` 14939 // Description - Description of the Tag. 14940 Description *string `json:"description,omitempty"` 14941 // ExternalDocsURL - Absolute URL of external resources describing the tag. 14942 ExternalDocsURL *string `json:"externalDocsUrl,omitempty"` 14943 // ExternalDocsDescription - Description of the external resources describing the tag. 14944 ExternalDocsDescription *string `json:"externalDocsDescription,omitempty"` 14945} 14946 14947// TagDescriptionCreateParameters parameters supplied to the Create TagDescription operation. 14948type TagDescriptionCreateParameters struct { 14949 // TagDescriptionBaseProperties - Properties supplied to Create TagDescription operation. 14950 *TagDescriptionBaseProperties `json:"properties,omitempty"` 14951} 14952 14953// MarshalJSON is the custom marshaler for TagDescriptionCreateParameters. 14954func (tdcp TagDescriptionCreateParameters) MarshalJSON() ([]byte, error) { 14955 objectMap := make(map[string]interface{}) 14956 if tdcp.TagDescriptionBaseProperties != nil { 14957 objectMap["properties"] = tdcp.TagDescriptionBaseProperties 14958 } 14959 return json.Marshal(objectMap) 14960} 14961 14962// UnmarshalJSON is the custom unmarshaler for TagDescriptionCreateParameters struct. 14963func (tdcp *TagDescriptionCreateParameters) UnmarshalJSON(body []byte) error { 14964 var m map[string]*json.RawMessage 14965 err := json.Unmarshal(body, &m) 14966 if err != nil { 14967 return err 14968 } 14969 for k, v := range m { 14970 switch k { 14971 case "properties": 14972 if v != nil { 14973 var tagDescriptionBaseProperties TagDescriptionBaseProperties 14974 err = json.Unmarshal(*v, &tagDescriptionBaseProperties) 14975 if err != nil { 14976 return err 14977 } 14978 tdcp.TagDescriptionBaseProperties = &tagDescriptionBaseProperties 14979 } 14980 } 14981 } 14982 14983 return nil 14984} 14985 14986// TagResourceCollection paged Tag list representation. 14987type TagResourceCollection struct { 14988 autorest.Response `json:"-"` 14989 // Value - Page values. 14990 Value *[]TagResourceContract `json:"value,omitempty"` 14991 // Count - Total record count number across all pages. 14992 Count *int64 `json:"count,omitempty"` 14993 // NextLink - Next page link if any. 14994 NextLink *string `json:"nextLink,omitempty"` 14995} 14996 14997// TagResourceCollectionIterator provides access to a complete listing of TagResourceContract values. 14998type TagResourceCollectionIterator struct { 14999 i int 15000 page TagResourceCollectionPage 15001} 15002 15003// NextWithContext advances to the next value. If there was an error making 15004// the request the iterator does not advance and the error is returned. 15005func (iter *TagResourceCollectionIterator) NextWithContext(ctx context.Context) (err error) { 15006 if tracing.IsEnabled() { 15007 ctx = tracing.StartSpan(ctx, fqdn+"/TagResourceCollectionIterator.NextWithContext") 15008 defer func() { 15009 sc := -1 15010 if iter.Response().Response.Response != nil { 15011 sc = iter.Response().Response.Response.StatusCode 15012 } 15013 tracing.EndSpan(ctx, sc, err) 15014 }() 15015 } 15016 iter.i++ 15017 if iter.i < len(iter.page.Values()) { 15018 return nil 15019 } 15020 err = iter.page.NextWithContext(ctx) 15021 if err != nil { 15022 iter.i-- 15023 return err 15024 } 15025 iter.i = 0 15026 return nil 15027} 15028 15029// Next advances to the next value. If there was an error making 15030// the request the iterator does not advance and the error is returned. 15031// Deprecated: Use NextWithContext() instead. 15032func (iter *TagResourceCollectionIterator) Next() error { 15033 return iter.NextWithContext(context.Background()) 15034} 15035 15036// NotDone returns true if the enumeration should be started or is not yet complete. 15037func (iter TagResourceCollectionIterator) NotDone() bool { 15038 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 15039} 15040 15041// Response returns the raw server response from the last page request. 15042func (iter TagResourceCollectionIterator) Response() TagResourceCollection { 15043 return iter.page.Response() 15044} 15045 15046// Value returns the current value or a zero-initialized value if the 15047// iterator has advanced beyond the end of the collection. 15048func (iter TagResourceCollectionIterator) Value() TagResourceContract { 15049 if !iter.page.NotDone() { 15050 return TagResourceContract{} 15051 } 15052 return iter.page.Values()[iter.i] 15053} 15054 15055// Creates a new instance of the TagResourceCollectionIterator type. 15056func NewTagResourceCollectionIterator(page TagResourceCollectionPage) TagResourceCollectionIterator { 15057 return TagResourceCollectionIterator{page: page} 15058} 15059 15060// IsEmpty returns true if the ListResult contains no values. 15061func (trc TagResourceCollection) IsEmpty() bool { 15062 return trc.Value == nil || len(*trc.Value) == 0 15063} 15064 15065// hasNextLink returns true if the NextLink is not empty. 15066func (trc TagResourceCollection) hasNextLink() bool { 15067 return trc.NextLink != nil && len(*trc.NextLink) != 0 15068} 15069 15070// tagResourceCollectionPreparer prepares a request to retrieve the next set of results. 15071// It returns nil if no more results exist. 15072func (trc TagResourceCollection) tagResourceCollectionPreparer(ctx context.Context) (*http.Request, error) { 15073 if !trc.hasNextLink() { 15074 return nil, nil 15075 } 15076 return autorest.Prepare((&http.Request{}).WithContext(ctx), 15077 autorest.AsJSON(), 15078 autorest.AsGet(), 15079 autorest.WithBaseURL(to.String(trc.NextLink))) 15080} 15081 15082// TagResourceCollectionPage contains a page of TagResourceContract values. 15083type TagResourceCollectionPage struct { 15084 fn func(context.Context, TagResourceCollection) (TagResourceCollection, error) 15085 trc TagResourceCollection 15086} 15087 15088// NextWithContext advances to the next page of values. If there was an error making 15089// the request the page does not advance and the error is returned. 15090func (page *TagResourceCollectionPage) NextWithContext(ctx context.Context) (err error) { 15091 if tracing.IsEnabled() { 15092 ctx = tracing.StartSpan(ctx, fqdn+"/TagResourceCollectionPage.NextWithContext") 15093 defer func() { 15094 sc := -1 15095 if page.Response().Response.Response != nil { 15096 sc = page.Response().Response.Response.StatusCode 15097 } 15098 tracing.EndSpan(ctx, sc, err) 15099 }() 15100 } 15101 for { 15102 next, err := page.fn(ctx, page.trc) 15103 if err != nil { 15104 return err 15105 } 15106 page.trc = next 15107 if !next.hasNextLink() || !next.IsEmpty() { 15108 break 15109 } 15110 } 15111 return nil 15112} 15113 15114// Next advances to the next page of values. If there was an error making 15115// the request the page does not advance and the error is returned. 15116// Deprecated: Use NextWithContext() instead. 15117func (page *TagResourceCollectionPage) Next() error { 15118 return page.NextWithContext(context.Background()) 15119} 15120 15121// NotDone returns true if the page enumeration should be started or is not yet complete. 15122func (page TagResourceCollectionPage) NotDone() bool { 15123 return !page.trc.IsEmpty() 15124} 15125 15126// Response returns the raw server response from the last page request. 15127func (page TagResourceCollectionPage) Response() TagResourceCollection { 15128 return page.trc 15129} 15130 15131// Values returns the slice of values for the current page or nil if there are no values. 15132func (page TagResourceCollectionPage) Values() []TagResourceContract { 15133 if page.trc.IsEmpty() { 15134 return nil 15135 } 15136 return *page.trc.Value 15137} 15138 15139// Creates a new instance of the TagResourceCollectionPage type. 15140func NewTagResourceCollectionPage(cur TagResourceCollection, getNextPage func(context.Context, TagResourceCollection) (TagResourceCollection, error)) TagResourceCollectionPage { 15141 return TagResourceCollectionPage{ 15142 fn: getNextPage, 15143 trc: cur, 15144 } 15145} 15146 15147// TagResourceContract tagResource contract properties. 15148type TagResourceContract struct { 15149 // Tag - Tag associated with the resource. 15150 Tag *TagTagResourceContractProperties `json:"tag,omitempty"` 15151 // API - Api associated with the tag. 15152 API *APITagResourceContractProperties `json:"api,omitempty"` 15153 // Operation - Operation associated with the tag. 15154 Operation *OperationTagResourceContractProperties `json:"operation,omitempty"` 15155 // Product - Product associated with the tag. 15156 Product *ProductTagResourceContractProperties `json:"product,omitempty"` 15157} 15158 15159// TagTagResourceContractProperties contract defining the Tag property in the Tag Resource Contract 15160type TagTagResourceContractProperties struct { 15161 // ID - Tag identifier 15162 ID *string `json:"id,omitempty"` 15163 // Name - Tag Name 15164 Name *string `json:"name,omitempty"` 15165} 15166 15167// TenantConfigurationDeployFuture an abstraction for monitoring and retrieving the results of a 15168// long-running operation. 15169type TenantConfigurationDeployFuture struct { 15170 azure.FutureAPI 15171 // Result returns the result of the asynchronous operation. 15172 // If the operation has not completed it will return an error. 15173 Result func(TenantConfigurationClient) (OperationResultContract, error) 15174} 15175 15176// UnmarshalJSON is the custom unmarshaller for CreateFuture. 15177func (future *TenantConfigurationDeployFuture) UnmarshalJSON(body []byte) error { 15178 var azFuture azure.Future 15179 if err := json.Unmarshal(body, &azFuture); err != nil { 15180 return err 15181 } 15182 future.FutureAPI = &azFuture 15183 future.Result = future.result 15184 return nil 15185} 15186 15187// result is the default implementation for TenantConfigurationDeployFuture.Result. 15188func (future *TenantConfigurationDeployFuture) result(client TenantConfigurationClient) (orc OperationResultContract, err error) { 15189 var done bool 15190 done, err = future.DoneWithContext(context.Background(), client) 15191 if err != nil { 15192 err = autorest.NewErrorWithError(err, "apimanagement.TenantConfigurationDeployFuture", "Result", future.Response(), "Polling failure") 15193 return 15194 } 15195 if !done { 15196 orc.Response.Response = future.Response() 15197 err = azure.NewAsyncOpIncompleteError("apimanagement.TenantConfigurationDeployFuture") 15198 return 15199 } 15200 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 15201 if orc.Response.Response, err = future.GetResult(sender); err == nil && orc.Response.Response.StatusCode != http.StatusNoContent { 15202 orc, err = client.DeployResponder(orc.Response.Response) 15203 if err != nil { 15204 err = autorest.NewErrorWithError(err, "apimanagement.TenantConfigurationDeployFuture", "Result", orc.Response.Response, "Failure responding to request") 15205 } 15206 } 15207 return 15208} 15209 15210// TenantConfigurationSaveFuture an abstraction for monitoring and retrieving the results of a long-running 15211// operation. 15212type TenantConfigurationSaveFuture struct { 15213 azure.FutureAPI 15214 // Result returns the result of the asynchronous operation. 15215 // If the operation has not completed it will return an error. 15216 Result func(TenantConfigurationClient) (OperationResultContract, error) 15217} 15218 15219// UnmarshalJSON is the custom unmarshaller for CreateFuture. 15220func (future *TenantConfigurationSaveFuture) UnmarshalJSON(body []byte) error { 15221 var azFuture azure.Future 15222 if err := json.Unmarshal(body, &azFuture); err != nil { 15223 return err 15224 } 15225 future.FutureAPI = &azFuture 15226 future.Result = future.result 15227 return nil 15228} 15229 15230// result is the default implementation for TenantConfigurationSaveFuture.Result. 15231func (future *TenantConfigurationSaveFuture) result(client TenantConfigurationClient) (orc OperationResultContract, err error) { 15232 var done bool 15233 done, err = future.DoneWithContext(context.Background(), client) 15234 if err != nil { 15235 err = autorest.NewErrorWithError(err, "apimanagement.TenantConfigurationSaveFuture", "Result", future.Response(), "Polling failure") 15236 return 15237 } 15238 if !done { 15239 orc.Response.Response = future.Response() 15240 err = azure.NewAsyncOpIncompleteError("apimanagement.TenantConfigurationSaveFuture") 15241 return 15242 } 15243 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 15244 if orc.Response.Response, err = future.GetResult(sender); err == nil && orc.Response.Response.StatusCode != http.StatusNoContent { 15245 orc, err = client.SaveResponder(orc.Response.Response) 15246 if err != nil { 15247 err = autorest.NewErrorWithError(err, "apimanagement.TenantConfigurationSaveFuture", "Result", orc.Response.Response, "Failure responding to request") 15248 } 15249 } 15250 return 15251} 15252 15253// TenantConfigurationSyncStateContract tenant Configuration Synchronization State. 15254type TenantConfigurationSyncStateContract struct { 15255 autorest.Response `json:"-"` 15256 // Branch - The name of Git branch. 15257 Branch *string `json:"branch,omitempty"` 15258 // CommitID - The latest commit Id. 15259 CommitID *string `json:"commitId,omitempty"` 15260 // IsExport - value indicating if last sync was save (true) or deploy (false) operation. 15261 IsExport *bool `json:"isExport,omitempty"` 15262 // IsSynced - value indicating if last synchronization was later than the configuration change. 15263 IsSynced *bool `json:"isSynced,omitempty"` 15264 // IsGitEnabled - value indicating whether Git configuration access is enabled. 15265 IsGitEnabled *bool `json:"isGitEnabled,omitempty"` 15266 // SyncDate - The date of the latest synchronization. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. 15267 SyncDate *date.Time `json:"syncDate,omitempty"` 15268 // ConfigurationChangeDate - The date of the latest configuration change. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. 15269 ConfigurationChangeDate *date.Time `json:"configurationChangeDate,omitempty"` 15270} 15271 15272// TenantConfigurationValidateFuture an abstraction for monitoring and retrieving the results of a 15273// long-running operation. 15274type TenantConfigurationValidateFuture struct { 15275 azure.FutureAPI 15276 // Result returns the result of the asynchronous operation. 15277 // If the operation has not completed it will return an error. 15278 Result func(TenantConfigurationClient) (OperationResultContract, error) 15279} 15280 15281// UnmarshalJSON is the custom unmarshaller for CreateFuture. 15282func (future *TenantConfigurationValidateFuture) UnmarshalJSON(body []byte) error { 15283 var azFuture azure.Future 15284 if err := json.Unmarshal(body, &azFuture); err != nil { 15285 return err 15286 } 15287 future.FutureAPI = &azFuture 15288 future.Result = future.result 15289 return nil 15290} 15291 15292// result is the default implementation for TenantConfigurationValidateFuture.Result. 15293func (future *TenantConfigurationValidateFuture) result(client TenantConfigurationClient) (orc OperationResultContract, err error) { 15294 var done bool 15295 done, err = future.DoneWithContext(context.Background(), client) 15296 if err != nil { 15297 err = autorest.NewErrorWithError(err, "apimanagement.TenantConfigurationValidateFuture", "Result", future.Response(), "Polling failure") 15298 return 15299 } 15300 if !done { 15301 orc.Response.Response = future.Response() 15302 err = azure.NewAsyncOpIncompleteError("apimanagement.TenantConfigurationValidateFuture") 15303 return 15304 } 15305 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 15306 if orc.Response.Response, err = future.GetResult(sender); err == nil && orc.Response.Response.StatusCode != http.StatusNoContent { 15307 orc, err = client.ValidateResponder(orc.Response.Response) 15308 if err != nil { 15309 err = autorest.NewErrorWithError(err, "apimanagement.TenantConfigurationValidateFuture", "Result", orc.Response.Response, "Failure responding to request") 15310 } 15311 } 15312 return 15313} 15314 15315// TenantSettingsCollection paged AccessInformation list representation. 15316type TenantSettingsCollection struct { 15317 autorest.Response `json:"-"` 15318 // Value - READ-ONLY; Page values. 15319 Value *[]TenantSettingsContract `json:"value,omitempty"` 15320 // NextLink - READ-ONLY; Next page link if any. 15321 NextLink *string `json:"nextLink,omitempty"` 15322} 15323 15324// MarshalJSON is the custom marshaler for TenantSettingsCollection. 15325func (tsc TenantSettingsCollection) MarshalJSON() ([]byte, error) { 15326 objectMap := make(map[string]interface{}) 15327 return json.Marshal(objectMap) 15328} 15329 15330// TenantSettingsCollectionIterator provides access to a complete listing of TenantSettingsContract values. 15331type TenantSettingsCollectionIterator struct { 15332 i int 15333 page TenantSettingsCollectionPage 15334} 15335 15336// NextWithContext advances to the next value. If there was an error making 15337// the request the iterator does not advance and the error is returned. 15338func (iter *TenantSettingsCollectionIterator) NextWithContext(ctx context.Context) (err error) { 15339 if tracing.IsEnabled() { 15340 ctx = tracing.StartSpan(ctx, fqdn+"/TenantSettingsCollectionIterator.NextWithContext") 15341 defer func() { 15342 sc := -1 15343 if iter.Response().Response.Response != nil { 15344 sc = iter.Response().Response.Response.StatusCode 15345 } 15346 tracing.EndSpan(ctx, sc, err) 15347 }() 15348 } 15349 iter.i++ 15350 if iter.i < len(iter.page.Values()) { 15351 return nil 15352 } 15353 err = iter.page.NextWithContext(ctx) 15354 if err != nil { 15355 iter.i-- 15356 return err 15357 } 15358 iter.i = 0 15359 return nil 15360} 15361 15362// Next advances to the next value. If there was an error making 15363// the request the iterator does not advance and the error is returned. 15364// Deprecated: Use NextWithContext() instead. 15365func (iter *TenantSettingsCollectionIterator) Next() error { 15366 return iter.NextWithContext(context.Background()) 15367} 15368 15369// NotDone returns true if the enumeration should be started or is not yet complete. 15370func (iter TenantSettingsCollectionIterator) NotDone() bool { 15371 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 15372} 15373 15374// Response returns the raw server response from the last page request. 15375func (iter TenantSettingsCollectionIterator) Response() TenantSettingsCollection { 15376 return iter.page.Response() 15377} 15378 15379// Value returns the current value or a zero-initialized value if the 15380// iterator has advanced beyond the end of the collection. 15381func (iter TenantSettingsCollectionIterator) Value() TenantSettingsContract { 15382 if !iter.page.NotDone() { 15383 return TenantSettingsContract{} 15384 } 15385 return iter.page.Values()[iter.i] 15386} 15387 15388// Creates a new instance of the TenantSettingsCollectionIterator type. 15389func NewTenantSettingsCollectionIterator(page TenantSettingsCollectionPage) TenantSettingsCollectionIterator { 15390 return TenantSettingsCollectionIterator{page: page} 15391} 15392 15393// IsEmpty returns true if the ListResult contains no values. 15394func (tsc TenantSettingsCollection) IsEmpty() bool { 15395 return tsc.Value == nil || len(*tsc.Value) == 0 15396} 15397 15398// hasNextLink returns true if the NextLink is not empty. 15399func (tsc TenantSettingsCollection) hasNextLink() bool { 15400 return tsc.NextLink != nil && len(*tsc.NextLink) != 0 15401} 15402 15403// tenantSettingsCollectionPreparer prepares a request to retrieve the next set of results. 15404// It returns nil if no more results exist. 15405func (tsc TenantSettingsCollection) tenantSettingsCollectionPreparer(ctx context.Context) (*http.Request, error) { 15406 if !tsc.hasNextLink() { 15407 return nil, nil 15408 } 15409 return autorest.Prepare((&http.Request{}).WithContext(ctx), 15410 autorest.AsJSON(), 15411 autorest.AsGet(), 15412 autorest.WithBaseURL(to.String(tsc.NextLink))) 15413} 15414 15415// TenantSettingsCollectionPage contains a page of TenantSettingsContract values. 15416type TenantSettingsCollectionPage struct { 15417 fn func(context.Context, TenantSettingsCollection) (TenantSettingsCollection, error) 15418 tsc TenantSettingsCollection 15419} 15420 15421// NextWithContext advances to the next page of values. If there was an error making 15422// the request the page does not advance and the error is returned. 15423func (page *TenantSettingsCollectionPage) NextWithContext(ctx context.Context) (err error) { 15424 if tracing.IsEnabled() { 15425 ctx = tracing.StartSpan(ctx, fqdn+"/TenantSettingsCollectionPage.NextWithContext") 15426 defer func() { 15427 sc := -1 15428 if page.Response().Response.Response != nil { 15429 sc = page.Response().Response.Response.StatusCode 15430 } 15431 tracing.EndSpan(ctx, sc, err) 15432 }() 15433 } 15434 for { 15435 next, err := page.fn(ctx, page.tsc) 15436 if err != nil { 15437 return err 15438 } 15439 page.tsc = next 15440 if !next.hasNextLink() || !next.IsEmpty() { 15441 break 15442 } 15443 } 15444 return nil 15445} 15446 15447// Next advances to the next page of values. If there was an error making 15448// the request the page does not advance and the error is returned. 15449// Deprecated: Use NextWithContext() instead. 15450func (page *TenantSettingsCollectionPage) Next() error { 15451 return page.NextWithContext(context.Background()) 15452} 15453 15454// NotDone returns true if the page enumeration should be started or is not yet complete. 15455func (page TenantSettingsCollectionPage) NotDone() bool { 15456 return !page.tsc.IsEmpty() 15457} 15458 15459// Response returns the raw server response from the last page request. 15460func (page TenantSettingsCollectionPage) Response() TenantSettingsCollection { 15461 return page.tsc 15462} 15463 15464// Values returns the slice of values for the current page or nil if there are no values. 15465func (page TenantSettingsCollectionPage) Values() []TenantSettingsContract { 15466 if page.tsc.IsEmpty() { 15467 return nil 15468 } 15469 return *page.tsc.Value 15470} 15471 15472// Creates a new instance of the TenantSettingsCollectionPage type. 15473func NewTenantSettingsCollectionPage(cur TenantSettingsCollection, getNextPage func(context.Context, TenantSettingsCollection) (TenantSettingsCollection, error)) TenantSettingsCollectionPage { 15474 return TenantSettingsCollectionPage{ 15475 fn: getNextPage, 15476 tsc: cur, 15477 } 15478} 15479 15480// TenantSettingsContract tenant Settings. 15481type TenantSettingsContract struct { 15482 autorest.Response `json:"-"` 15483 // TenantSettingsContractProperties - TenantSettings entity contract properties. 15484 *TenantSettingsContractProperties `json:"properties,omitempty"` 15485 // ID - READ-ONLY; Resource ID. 15486 ID *string `json:"id,omitempty"` 15487 // Name - READ-ONLY; Resource name. 15488 Name *string `json:"name,omitempty"` 15489 // Type - READ-ONLY; Resource type for API Management resource. 15490 Type *string `json:"type,omitempty"` 15491} 15492 15493// MarshalJSON is the custom marshaler for TenantSettingsContract. 15494func (tsc TenantSettingsContract) MarshalJSON() ([]byte, error) { 15495 objectMap := make(map[string]interface{}) 15496 if tsc.TenantSettingsContractProperties != nil { 15497 objectMap["properties"] = tsc.TenantSettingsContractProperties 15498 } 15499 return json.Marshal(objectMap) 15500} 15501 15502// UnmarshalJSON is the custom unmarshaler for TenantSettingsContract struct. 15503func (tsc *TenantSettingsContract) UnmarshalJSON(body []byte) error { 15504 var m map[string]*json.RawMessage 15505 err := json.Unmarshal(body, &m) 15506 if err != nil { 15507 return err 15508 } 15509 for k, v := range m { 15510 switch k { 15511 case "properties": 15512 if v != nil { 15513 var tenantSettingsContractProperties TenantSettingsContractProperties 15514 err = json.Unmarshal(*v, &tenantSettingsContractProperties) 15515 if err != nil { 15516 return err 15517 } 15518 tsc.TenantSettingsContractProperties = &tenantSettingsContractProperties 15519 } 15520 case "id": 15521 if v != nil { 15522 var ID string 15523 err = json.Unmarshal(*v, &ID) 15524 if err != nil { 15525 return err 15526 } 15527 tsc.ID = &ID 15528 } 15529 case "name": 15530 if v != nil { 15531 var name string 15532 err = json.Unmarshal(*v, &name) 15533 if err != nil { 15534 return err 15535 } 15536 tsc.Name = &name 15537 } 15538 case "type": 15539 if v != nil { 15540 var typeVar string 15541 err = json.Unmarshal(*v, &typeVar) 15542 if err != nil { 15543 return err 15544 } 15545 tsc.Type = &typeVar 15546 } 15547 } 15548 } 15549 15550 return nil 15551} 15552 15553// TenantSettingsContractProperties tenant access information contract of the API Management service. 15554type TenantSettingsContractProperties struct { 15555 // Settings - Tenant settings 15556 Settings map[string]*string `json:"settings"` 15557} 15558 15559// MarshalJSON is the custom marshaler for TenantSettingsContractProperties. 15560func (tscp TenantSettingsContractProperties) MarshalJSON() ([]byte, error) { 15561 objectMap := make(map[string]interface{}) 15562 if tscp.Settings != nil { 15563 objectMap["settings"] = tscp.Settings 15564 } 15565 return json.Marshal(objectMap) 15566} 15567 15568// TermsOfServiceProperties terms of service contract properties. 15569type TermsOfServiceProperties struct { 15570 // Text - A terms of service text. 15571 Text *string `json:"text,omitempty"` 15572 // Enabled - Display terms of service during a sign-up process. 15573 Enabled *bool `json:"enabled,omitempty"` 15574 // ConsentRequired - Ask user for consent to the terms of service. 15575 ConsentRequired *bool `json:"consentRequired,omitempty"` 15576} 15577 15578// TokenBodyParameterContract oAuth acquire token request body parameter (www-url-form-encoded). 15579type TokenBodyParameterContract struct { 15580 // Name - body parameter name. 15581 Name *string `json:"name,omitempty"` 15582 // Value - body parameter value. 15583 Value *string `json:"value,omitempty"` 15584} 15585 15586// UserCollection paged Users list representation. 15587type UserCollection struct { 15588 autorest.Response `json:"-"` 15589 // Value - Page values. 15590 Value *[]UserContract `json:"value,omitempty"` 15591 // Count - Total record count number across all pages. 15592 Count *int64 `json:"count,omitempty"` 15593 // NextLink - Next page link if any. 15594 NextLink *string `json:"nextLink,omitempty"` 15595} 15596 15597// UserCollectionIterator provides access to a complete listing of UserContract values. 15598type UserCollectionIterator struct { 15599 i int 15600 page UserCollectionPage 15601} 15602 15603// NextWithContext advances to the next value. If there was an error making 15604// the request the iterator does not advance and the error is returned. 15605func (iter *UserCollectionIterator) NextWithContext(ctx context.Context) (err error) { 15606 if tracing.IsEnabled() { 15607 ctx = tracing.StartSpan(ctx, fqdn+"/UserCollectionIterator.NextWithContext") 15608 defer func() { 15609 sc := -1 15610 if iter.Response().Response.Response != nil { 15611 sc = iter.Response().Response.Response.StatusCode 15612 } 15613 tracing.EndSpan(ctx, sc, err) 15614 }() 15615 } 15616 iter.i++ 15617 if iter.i < len(iter.page.Values()) { 15618 return nil 15619 } 15620 err = iter.page.NextWithContext(ctx) 15621 if err != nil { 15622 iter.i-- 15623 return err 15624 } 15625 iter.i = 0 15626 return nil 15627} 15628 15629// Next advances to the next value. If there was an error making 15630// the request the iterator does not advance and the error is returned. 15631// Deprecated: Use NextWithContext() instead. 15632func (iter *UserCollectionIterator) Next() error { 15633 return iter.NextWithContext(context.Background()) 15634} 15635 15636// NotDone returns true if the enumeration should be started or is not yet complete. 15637func (iter UserCollectionIterator) NotDone() bool { 15638 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 15639} 15640 15641// Response returns the raw server response from the last page request. 15642func (iter UserCollectionIterator) Response() UserCollection { 15643 return iter.page.Response() 15644} 15645 15646// Value returns the current value or a zero-initialized value if the 15647// iterator has advanced beyond the end of the collection. 15648func (iter UserCollectionIterator) Value() UserContract { 15649 if !iter.page.NotDone() { 15650 return UserContract{} 15651 } 15652 return iter.page.Values()[iter.i] 15653} 15654 15655// Creates a new instance of the UserCollectionIterator type. 15656func NewUserCollectionIterator(page UserCollectionPage) UserCollectionIterator { 15657 return UserCollectionIterator{page: page} 15658} 15659 15660// IsEmpty returns true if the ListResult contains no values. 15661func (uc UserCollection) IsEmpty() bool { 15662 return uc.Value == nil || len(*uc.Value) == 0 15663} 15664 15665// hasNextLink returns true if the NextLink is not empty. 15666func (uc UserCollection) hasNextLink() bool { 15667 return uc.NextLink != nil && len(*uc.NextLink) != 0 15668} 15669 15670// userCollectionPreparer prepares a request to retrieve the next set of results. 15671// It returns nil if no more results exist. 15672func (uc UserCollection) userCollectionPreparer(ctx context.Context) (*http.Request, error) { 15673 if !uc.hasNextLink() { 15674 return nil, nil 15675 } 15676 return autorest.Prepare((&http.Request{}).WithContext(ctx), 15677 autorest.AsJSON(), 15678 autorest.AsGet(), 15679 autorest.WithBaseURL(to.String(uc.NextLink))) 15680} 15681 15682// UserCollectionPage contains a page of UserContract values. 15683type UserCollectionPage struct { 15684 fn func(context.Context, UserCollection) (UserCollection, error) 15685 uc UserCollection 15686} 15687 15688// NextWithContext advances to the next page of values. If there was an error making 15689// the request the page does not advance and the error is returned. 15690func (page *UserCollectionPage) NextWithContext(ctx context.Context) (err error) { 15691 if tracing.IsEnabled() { 15692 ctx = tracing.StartSpan(ctx, fqdn+"/UserCollectionPage.NextWithContext") 15693 defer func() { 15694 sc := -1 15695 if page.Response().Response.Response != nil { 15696 sc = page.Response().Response.Response.StatusCode 15697 } 15698 tracing.EndSpan(ctx, sc, err) 15699 }() 15700 } 15701 for { 15702 next, err := page.fn(ctx, page.uc) 15703 if err != nil { 15704 return err 15705 } 15706 page.uc = next 15707 if !next.hasNextLink() || !next.IsEmpty() { 15708 break 15709 } 15710 } 15711 return nil 15712} 15713 15714// Next advances to the next page of values. If there was an error making 15715// the request the page does not advance and the error is returned. 15716// Deprecated: Use NextWithContext() instead. 15717func (page *UserCollectionPage) Next() error { 15718 return page.NextWithContext(context.Background()) 15719} 15720 15721// NotDone returns true if the page enumeration should be started or is not yet complete. 15722func (page UserCollectionPage) NotDone() bool { 15723 return !page.uc.IsEmpty() 15724} 15725 15726// Response returns the raw server response from the last page request. 15727func (page UserCollectionPage) Response() UserCollection { 15728 return page.uc 15729} 15730 15731// Values returns the slice of values for the current page or nil if there are no values. 15732func (page UserCollectionPage) Values() []UserContract { 15733 if page.uc.IsEmpty() { 15734 return nil 15735 } 15736 return *page.uc.Value 15737} 15738 15739// Creates a new instance of the UserCollectionPage type. 15740func NewUserCollectionPage(cur UserCollection, getNextPage func(context.Context, UserCollection) (UserCollection, error)) UserCollectionPage { 15741 return UserCollectionPage{ 15742 fn: getNextPage, 15743 uc: cur, 15744 } 15745} 15746 15747// UserContract user details. 15748type UserContract struct { 15749 autorest.Response `json:"-"` 15750 // UserContractProperties - User entity contract properties. 15751 *UserContractProperties `json:"properties,omitempty"` 15752 // ID - READ-ONLY; Resource ID. 15753 ID *string `json:"id,omitempty"` 15754 // Name - READ-ONLY; Resource name. 15755 Name *string `json:"name,omitempty"` 15756 // Type - READ-ONLY; Resource type for API Management resource. 15757 Type *string `json:"type,omitempty"` 15758} 15759 15760// MarshalJSON is the custom marshaler for UserContract. 15761func (uc UserContract) MarshalJSON() ([]byte, error) { 15762 objectMap := make(map[string]interface{}) 15763 if uc.UserContractProperties != nil { 15764 objectMap["properties"] = uc.UserContractProperties 15765 } 15766 return json.Marshal(objectMap) 15767} 15768 15769// UnmarshalJSON is the custom unmarshaler for UserContract struct. 15770func (uc *UserContract) UnmarshalJSON(body []byte) error { 15771 var m map[string]*json.RawMessage 15772 err := json.Unmarshal(body, &m) 15773 if err != nil { 15774 return err 15775 } 15776 for k, v := range m { 15777 switch k { 15778 case "properties": 15779 if v != nil { 15780 var userContractProperties UserContractProperties 15781 err = json.Unmarshal(*v, &userContractProperties) 15782 if err != nil { 15783 return err 15784 } 15785 uc.UserContractProperties = &userContractProperties 15786 } 15787 case "id": 15788 if v != nil { 15789 var ID string 15790 err = json.Unmarshal(*v, &ID) 15791 if err != nil { 15792 return err 15793 } 15794 uc.ID = &ID 15795 } 15796 case "name": 15797 if v != nil { 15798 var name string 15799 err = json.Unmarshal(*v, &name) 15800 if err != nil { 15801 return err 15802 } 15803 uc.Name = &name 15804 } 15805 case "type": 15806 if v != nil { 15807 var typeVar string 15808 err = json.Unmarshal(*v, &typeVar) 15809 if err != nil { 15810 return err 15811 } 15812 uc.Type = &typeVar 15813 } 15814 } 15815 } 15816 15817 return nil 15818} 15819 15820// UserContractProperties user profile. 15821type UserContractProperties struct { 15822 // FirstName - First name. 15823 FirstName *string `json:"firstName,omitempty"` 15824 // LastName - Last name. 15825 LastName *string `json:"lastName,omitempty"` 15826 // Email - Email address. 15827 Email *string `json:"email,omitempty"` 15828 // RegistrationDate - Date of user registration. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. 15829 RegistrationDate *date.Time `json:"registrationDate,omitempty"` 15830 // Groups - READ-ONLY; Collection of groups user is part of. 15831 Groups *[]GroupContractProperties `json:"groups,omitempty"` 15832 // State - Account state. Specifies whether the user is active or not. Blocked users are unable to sign into the developer portal or call any APIs of subscribed products. Default state is Active. Possible values include: 'UserStateActive', 'UserStateBlocked', 'UserStatePending', 'UserStateDeleted' 15833 State UserState `json:"state,omitempty"` 15834 // Note - Optional note about a user set by the administrator. 15835 Note *string `json:"note,omitempty"` 15836 // Identities - Collection of user identities. 15837 Identities *[]UserIdentityContract `json:"identities,omitempty"` 15838} 15839 15840// MarshalJSON is the custom marshaler for UserContractProperties. 15841func (ucp UserContractProperties) MarshalJSON() ([]byte, error) { 15842 objectMap := make(map[string]interface{}) 15843 if ucp.FirstName != nil { 15844 objectMap["firstName"] = ucp.FirstName 15845 } 15846 if ucp.LastName != nil { 15847 objectMap["lastName"] = ucp.LastName 15848 } 15849 if ucp.Email != nil { 15850 objectMap["email"] = ucp.Email 15851 } 15852 if ucp.RegistrationDate != nil { 15853 objectMap["registrationDate"] = ucp.RegistrationDate 15854 } 15855 if ucp.State != "" { 15856 objectMap["state"] = ucp.State 15857 } 15858 if ucp.Note != nil { 15859 objectMap["note"] = ucp.Note 15860 } 15861 if ucp.Identities != nil { 15862 objectMap["identities"] = ucp.Identities 15863 } 15864 return json.Marshal(objectMap) 15865} 15866 15867// UserCreateParameterProperties parameters supplied to the Create User operation. 15868type UserCreateParameterProperties struct { 15869 // Email - Email address. Must not be empty and must be unique within the service instance. 15870 Email *string `json:"email,omitempty"` 15871 // FirstName - First name. 15872 FirstName *string `json:"firstName,omitempty"` 15873 // LastName - Last name. 15874 LastName *string `json:"lastName,omitempty"` 15875 // Password - User Password. If no value is provided, a default password is generated. 15876 Password *string `json:"password,omitempty"` 15877 // AppType - Determines the type of application which send the create user request. Default is legacy portal. Possible values include: 'Portal', 'DeveloperPortal' 15878 AppType AppType `json:"appType,omitempty"` 15879 // Confirmation - Determines the type of confirmation e-mail that will be sent to the newly created user. Possible values include: 'Signup', 'Invite' 15880 Confirmation Confirmation `json:"confirmation,omitempty"` 15881 // State - Account state. Specifies whether the user is active or not. Blocked users are unable to sign into the developer portal or call any APIs of subscribed products. Default state is Active. Possible values include: 'UserStateActive', 'UserStateBlocked', 'UserStatePending', 'UserStateDeleted' 15882 State UserState `json:"state,omitempty"` 15883 // Note - Optional note about a user set by the administrator. 15884 Note *string `json:"note,omitempty"` 15885 // Identities - Collection of user identities. 15886 Identities *[]UserIdentityContract `json:"identities,omitempty"` 15887} 15888 15889// UserCreateParameters user create details. 15890type UserCreateParameters struct { 15891 // UserCreateParameterProperties - User entity create contract properties. 15892 *UserCreateParameterProperties `json:"properties,omitempty"` 15893} 15894 15895// MarshalJSON is the custom marshaler for UserCreateParameters. 15896func (ucp UserCreateParameters) MarshalJSON() ([]byte, error) { 15897 objectMap := make(map[string]interface{}) 15898 if ucp.UserCreateParameterProperties != nil { 15899 objectMap["properties"] = ucp.UserCreateParameterProperties 15900 } 15901 return json.Marshal(objectMap) 15902} 15903 15904// UnmarshalJSON is the custom unmarshaler for UserCreateParameters struct. 15905func (ucp *UserCreateParameters) UnmarshalJSON(body []byte) error { 15906 var m map[string]*json.RawMessage 15907 err := json.Unmarshal(body, &m) 15908 if err != nil { 15909 return err 15910 } 15911 for k, v := range m { 15912 switch k { 15913 case "properties": 15914 if v != nil { 15915 var userCreateParameterProperties UserCreateParameterProperties 15916 err = json.Unmarshal(*v, &userCreateParameterProperties) 15917 if err != nil { 15918 return err 15919 } 15920 ucp.UserCreateParameterProperties = &userCreateParameterProperties 15921 } 15922 } 15923 } 15924 15925 return nil 15926} 15927 15928// UserEntityBaseParameters user Entity Base Parameters set. 15929type UserEntityBaseParameters struct { 15930 // State - Account state. Specifies whether the user is active or not. Blocked users are unable to sign into the developer portal or call any APIs of subscribed products. Default state is Active. Possible values include: 'UserStateActive', 'UserStateBlocked', 'UserStatePending', 'UserStateDeleted' 15931 State UserState `json:"state,omitempty"` 15932 // Note - Optional note about a user set by the administrator. 15933 Note *string `json:"note,omitempty"` 15934 // Identities - Collection of user identities. 15935 Identities *[]UserIdentityContract `json:"identities,omitempty"` 15936} 15937 15938// UserIdentityCollection list of Users Identity list representation. 15939type UserIdentityCollection struct { 15940 autorest.Response `json:"-"` 15941 // Value - User Identity values. 15942 Value *[]UserIdentityContract `json:"value,omitempty"` 15943 // Count - Total record count number across all pages. 15944 Count *int64 `json:"count,omitempty"` 15945 // NextLink - Next page link if any. 15946 NextLink *string `json:"nextLink,omitempty"` 15947} 15948 15949// UserIdentityCollectionIterator provides access to a complete listing of UserIdentityContract values. 15950type UserIdentityCollectionIterator struct { 15951 i int 15952 page UserIdentityCollectionPage 15953} 15954 15955// NextWithContext advances to the next value. If there was an error making 15956// the request the iterator does not advance and the error is returned. 15957func (iter *UserIdentityCollectionIterator) NextWithContext(ctx context.Context) (err error) { 15958 if tracing.IsEnabled() { 15959 ctx = tracing.StartSpan(ctx, fqdn+"/UserIdentityCollectionIterator.NextWithContext") 15960 defer func() { 15961 sc := -1 15962 if iter.Response().Response.Response != nil { 15963 sc = iter.Response().Response.Response.StatusCode 15964 } 15965 tracing.EndSpan(ctx, sc, err) 15966 }() 15967 } 15968 iter.i++ 15969 if iter.i < len(iter.page.Values()) { 15970 return nil 15971 } 15972 err = iter.page.NextWithContext(ctx) 15973 if err != nil { 15974 iter.i-- 15975 return err 15976 } 15977 iter.i = 0 15978 return nil 15979} 15980 15981// Next advances to the next value. If there was an error making 15982// the request the iterator does not advance and the error is returned. 15983// Deprecated: Use NextWithContext() instead. 15984func (iter *UserIdentityCollectionIterator) Next() error { 15985 return iter.NextWithContext(context.Background()) 15986} 15987 15988// NotDone returns true if the enumeration should be started or is not yet complete. 15989func (iter UserIdentityCollectionIterator) NotDone() bool { 15990 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 15991} 15992 15993// Response returns the raw server response from the last page request. 15994func (iter UserIdentityCollectionIterator) Response() UserIdentityCollection { 15995 return iter.page.Response() 15996} 15997 15998// Value returns the current value or a zero-initialized value if the 15999// iterator has advanced beyond the end of the collection. 16000func (iter UserIdentityCollectionIterator) Value() UserIdentityContract { 16001 if !iter.page.NotDone() { 16002 return UserIdentityContract{} 16003 } 16004 return iter.page.Values()[iter.i] 16005} 16006 16007// Creates a new instance of the UserIdentityCollectionIterator type. 16008func NewUserIdentityCollectionIterator(page UserIdentityCollectionPage) UserIdentityCollectionIterator { 16009 return UserIdentityCollectionIterator{page: page} 16010} 16011 16012// IsEmpty returns true if the ListResult contains no values. 16013func (uic UserIdentityCollection) IsEmpty() bool { 16014 return uic.Value == nil || len(*uic.Value) == 0 16015} 16016 16017// hasNextLink returns true if the NextLink is not empty. 16018func (uic UserIdentityCollection) hasNextLink() bool { 16019 return uic.NextLink != nil && len(*uic.NextLink) != 0 16020} 16021 16022// userIdentityCollectionPreparer prepares a request to retrieve the next set of results. 16023// It returns nil if no more results exist. 16024func (uic UserIdentityCollection) userIdentityCollectionPreparer(ctx context.Context) (*http.Request, error) { 16025 if !uic.hasNextLink() { 16026 return nil, nil 16027 } 16028 return autorest.Prepare((&http.Request{}).WithContext(ctx), 16029 autorest.AsJSON(), 16030 autorest.AsGet(), 16031 autorest.WithBaseURL(to.String(uic.NextLink))) 16032} 16033 16034// UserIdentityCollectionPage contains a page of UserIdentityContract values. 16035type UserIdentityCollectionPage struct { 16036 fn func(context.Context, UserIdentityCollection) (UserIdentityCollection, error) 16037 uic UserIdentityCollection 16038} 16039 16040// NextWithContext advances to the next page of values. If there was an error making 16041// the request the page does not advance and the error is returned. 16042func (page *UserIdentityCollectionPage) NextWithContext(ctx context.Context) (err error) { 16043 if tracing.IsEnabled() { 16044 ctx = tracing.StartSpan(ctx, fqdn+"/UserIdentityCollectionPage.NextWithContext") 16045 defer func() { 16046 sc := -1 16047 if page.Response().Response.Response != nil { 16048 sc = page.Response().Response.Response.StatusCode 16049 } 16050 tracing.EndSpan(ctx, sc, err) 16051 }() 16052 } 16053 for { 16054 next, err := page.fn(ctx, page.uic) 16055 if err != nil { 16056 return err 16057 } 16058 page.uic = next 16059 if !next.hasNextLink() || !next.IsEmpty() { 16060 break 16061 } 16062 } 16063 return nil 16064} 16065 16066// Next advances to the next page of values. If there was an error making 16067// the request the page does not advance and the error is returned. 16068// Deprecated: Use NextWithContext() instead. 16069func (page *UserIdentityCollectionPage) Next() error { 16070 return page.NextWithContext(context.Background()) 16071} 16072 16073// NotDone returns true if the page enumeration should be started or is not yet complete. 16074func (page UserIdentityCollectionPage) NotDone() bool { 16075 return !page.uic.IsEmpty() 16076} 16077 16078// Response returns the raw server response from the last page request. 16079func (page UserIdentityCollectionPage) Response() UserIdentityCollection { 16080 return page.uic 16081} 16082 16083// Values returns the slice of values for the current page or nil if there are no values. 16084func (page UserIdentityCollectionPage) Values() []UserIdentityContract { 16085 if page.uic.IsEmpty() { 16086 return nil 16087 } 16088 return *page.uic.Value 16089} 16090 16091// Creates a new instance of the UserIdentityCollectionPage type. 16092func NewUserIdentityCollectionPage(cur UserIdentityCollection, getNextPage func(context.Context, UserIdentityCollection) (UserIdentityCollection, error)) UserIdentityCollectionPage { 16093 return UserIdentityCollectionPage{ 16094 fn: getNextPage, 16095 uic: cur, 16096 } 16097} 16098 16099// UserIdentityContract user identity details. 16100type UserIdentityContract struct { 16101 // Provider - Identity provider name. 16102 Provider *string `json:"provider,omitempty"` 16103 // ID - Identifier value within provider. 16104 ID *string `json:"id,omitempty"` 16105} 16106 16107// UserIdentityProperties ... 16108type UserIdentityProperties struct { 16109 // PrincipalID - The principal id of user assigned identity. 16110 PrincipalID *string `json:"principalId,omitempty"` 16111 // ClientID - The client id of user assigned identity. 16112 ClientID *string `json:"clientId,omitempty"` 16113} 16114 16115// UserTokenParameterProperties parameters supplied to the Get User Token operation. 16116type UserTokenParameterProperties struct { 16117 // KeyType - The Key to be used to generate token for user. Possible values include: 'Primary', 'Secondary' 16118 KeyType KeyType `json:"keyType,omitempty"` 16119 // Expiry - The Expiry time of the Token. Maximum token expiry time is set to 30 days. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. 16120 Expiry *date.Time `json:"expiry,omitempty"` 16121} 16122 16123// UserTokenParameters get User Token parameters. 16124type UserTokenParameters struct { 16125 // UserTokenParameterProperties - User Token Parameter contract properties. 16126 *UserTokenParameterProperties `json:"properties,omitempty"` 16127} 16128 16129// MarshalJSON is the custom marshaler for UserTokenParameters. 16130func (utp UserTokenParameters) MarshalJSON() ([]byte, error) { 16131 objectMap := make(map[string]interface{}) 16132 if utp.UserTokenParameterProperties != nil { 16133 objectMap["properties"] = utp.UserTokenParameterProperties 16134 } 16135 return json.Marshal(objectMap) 16136} 16137 16138// UnmarshalJSON is the custom unmarshaler for UserTokenParameters struct. 16139func (utp *UserTokenParameters) UnmarshalJSON(body []byte) error { 16140 var m map[string]*json.RawMessage 16141 err := json.Unmarshal(body, &m) 16142 if err != nil { 16143 return err 16144 } 16145 for k, v := range m { 16146 switch k { 16147 case "properties": 16148 if v != nil { 16149 var userTokenParameterProperties UserTokenParameterProperties 16150 err = json.Unmarshal(*v, &userTokenParameterProperties) 16151 if err != nil { 16152 return err 16153 } 16154 utp.UserTokenParameterProperties = &userTokenParameterProperties 16155 } 16156 } 16157 } 16158 16159 return nil 16160} 16161 16162// UserTokenResult get User Token response details. 16163type UserTokenResult struct { 16164 autorest.Response `json:"-"` 16165 // Value - Shared Access Authorization token for the User. 16166 Value *string `json:"value,omitempty"` 16167} 16168 16169// UserUpdateParameters user update parameters. 16170type UserUpdateParameters struct { 16171 // UserUpdateParametersProperties - User entity update contract properties. 16172 *UserUpdateParametersProperties `json:"properties,omitempty"` 16173} 16174 16175// MarshalJSON is the custom marshaler for UserUpdateParameters. 16176func (uup UserUpdateParameters) MarshalJSON() ([]byte, error) { 16177 objectMap := make(map[string]interface{}) 16178 if uup.UserUpdateParametersProperties != nil { 16179 objectMap["properties"] = uup.UserUpdateParametersProperties 16180 } 16181 return json.Marshal(objectMap) 16182} 16183 16184// UnmarshalJSON is the custom unmarshaler for UserUpdateParameters struct. 16185func (uup *UserUpdateParameters) UnmarshalJSON(body []byte) error { 16186 var m map[string]*json.RawMessage 16187 err := json.Unmarshal(body, &m) 16188 if err != nil { 16189 return err 16190 } 16191 for k, v := range m { 16192 switch k { 16193 case "properties": 16194 if v != nil { 16195 var userUpdateParametersProperties UserUpdateParametersProperties 16196 err = json.Unmarshal(*v, &userUpdateParametersProperties) 16197 if err != nil { 16198 return err 16199 } 16200 uup.UserUpdateParametersProperties = &userUpdateParametersProperties 16201 } 16202 } 16203 } 16204 16205 return nil 16206} 16207 16208// UserUpdateParametersProperties parameters supplied to the Update User operation. 16209type UserUpdateParametersProperties struct { 16210 // Email - Email address. Must not be empty and must be unique within the service instance. 16211 Email *string `json:"email,omitempty"` 16212 // Password - User Password. 16213 Password *string `json:"password,omitempty"` 16214 // FirstName - First name. 16215 FirstName *string `json:"firstName,omitempty"` 16216 // LastName - Last name. 16217 LastName *string `json:"lastName,omitempty"` 16218 // State - Account state. Specifies whether the user is active or not. Blocked users are unable to sign into the developer portal or call any APIs of subscribed products. Default state is Active. Possible values include: 'UserStateActive', 'UserStateBlocked', 'UserStatePending', 'UserStateDeleted' 16219 State UserState `json:"state,omitempty"` 16220 // Note - Optional note about a user set by the administrator. 16221 Note *string `json:"note,omitempty"` 16222 // Identities - Collection of user identities. 16223 Identities *[]UserIdentityContract `json:"identities,omitempty"` 16224} 16225 16226// VirtualNetworkConfiguration configuration of a virtual network to which API Management service is 16227// deployed. 16228type VirtualNetworkConfiguration struct { 16229 // Vnetid - READ-ONLY; The virtual network ID. This is typically a GUID. Expect a null GUID by default. 16230 Vnetid *string `json:"vnetid,omitempty"` 16231 // Subnetname - READ-ONLY; The name of the subnet. 16232 Subnetname *string `json:"subnetname,omitempty"` 16233 // SubnetResourceID - The full resource ID of a subnet in a virtual network to deploy the API Management service in. 16234 SubnetResourceID *string `json:"subnetResourceId,omitempty"` 16235} 16236 16237// MarshalJSON is the custom marshaler for VirtualNetworkConfiguration. 16238func (vnc VirtualNetworkConfiguration) MarshalJSON() ([]byte, error) { 16239 objectMap := make(map[string]interface{}) 16240 if vnc.SubnetResourceID != nil { 16241 objectMap["subnetResourceId"] = vnc.SubnetResourceID 16242 } 16243 return json.Marshal(objectMap) 16244} 16245 16246// X509CertificateName properties of server X509Names. 16247type X509CertificateName struct { 16248 // Name - Common Name of the Certificate. 16249 Name *string `json:"name,omitempty"` 16250 // IssuerCertificateThumbprint - Thumbprint for the Issuer of the Certificate. 16251 IssuerCertificateThumbprint *string `json:"issuerCertificateThumbprint,omitempty"` 16252} 16253