1package apimanagement 2 3// Copyright (c) Microsoft and contributors. All rights reserved. 4// 5// Licensed under the Apache License, Version 2.0 (the "License"); 6// you may not use this file except in compliance with the License. 7// You may obtain a copy of the License at 8// http://www.apache.org/licenses/LICENSE-2.0 9// 10// Unless required by applicable law or agreed to in writing, software 11// distributed under the License is distributed on an "AS IS" BASIS, 12// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13// 14// See the License for the specific language governing permissions and 15// limitations under the License. 16// 17// Code generated by Microsoft (R) AutoRest Code Generator. 18// Changes may cause incorrect behavior and will be lost if the code is regenerated. 19 20import ( 21 "context" 22 "encoding/json" 23 "github.com/Azure/go-autorest/autorest" 24 "github.com/Azure/go-autorest/autorest/azure" 25 "github.com/Azure/go-autorest/autorest/date" 26 "github.com/Azure/go-autorest/autorest/to" 27 "github.com/Azure/go-autorest/tracing" 28 "github.com/gofrs/uuid" 29 "net/http" 30) 31 32// The package's fully qualified name. 33const fqdn = "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2020-12-01/apimanagement" 34 35// AccessInformationCollection paged AccessInformation list representation. 36type AccessInformationCollection struct { 37 autorest.Response `json:"-"` 38 // Value - READ-ONLY; Page values. 39 Value *[]AccessInformationContract `json:"value,omitempty"` 40 // Count - Total record count number across all pages. 41 Count *int64 `json:"count,omitempty"` 42 // NextLink - READ-ONLY; Next page link if any. 43 NextLink *string `json:"nextLink,omitempty"` 44} 45 46// MarshalJSON is the custom marshaler for AccessInformationCollection. 47func (aic AccessInformationCollection) MarshalJSON() ([]byte, error) { 48 objectMap := make(map[string]interface{}) 49 if aic.Count != nil { 50 objectMap["count"] = aic.Count 51 } 52 return json.Marshal(objectMap) 53} 54 55// AccessInformationCollectionIterator provides access to a complete listing of AccessInformationContract 56// values. 57type AccessInformationCollectionIterator struct { 58 i int 59 page AccessInformationCollectionPage 60} 61 62// NextWithContext advances to the next value. If there was an error making 63// the request the iterator does not advance and the error is returned. 64func (iter *AccessInformationCollectionIterator) NextWithContext(ctx context.Context) (err error) { 65 if tracing.IsEnabled() { 66 ctx = tracing.StartSpan(ctx, fqdn+"/AccessInformationCollectionIterator.NextWithContext") 67 defer func() { 68 sc := -1 69 if iter.Response().Response.Response != nil { 70 sc = iter.Response().Response.Response.StatusCode 71 } 72 tracing.EndSpan(ctx, sc, err) 73 }() 74 } 75 iter.i++ 76 if iter.i < len(iter.page.Values()) { 77 return nil 78 } 79 err = iter.page.NextWithContext(ctx) 80 if err != nil { 81 iter.i-- 82 return err 83 } 84 iter.i = 0 85 return nil 86} 87 88// Next advances to the next value. If there was an error making 89// the request the iterator does not advance and the error is returned. 90// Deprecated: Use NextWithContext() instead. 91func (iter *AccessInformationCollectionIterator) Next() error { 92 return iter.NextWithContext(context.Background()) 93} 94 95// NotDone returns true if the enumeration should be started or is not yet complete. 96func (iter AccessInformationCollectionIterator) NotDone() bool { 97 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 98} 99 100// Response returns the raw server response from the last page request. 101func (iter AccessInformationCollectionIterator) Response() AccessInformationCollection { 102 return iter.page.Response() 103} 104 105// Value returns the current value or a zero-initialized value if the 106// iterator has advanced beyond the end of the collection. 107func (iter AccessInformationCollectionIterator) Value() AccessInformationContract { 108 if !iter.page.NotDone() { 109 return AccessInformationContract{} 110 } 111 return iter.page.Values()[iter.i] 112} 113 114// Creates a new instance of the AccessInformationCollectionIterator type. 115func NewAccessInformationCollectionIterator(page AccessInformationCollectionPage) AccessInformationCollectionIterator { 116 return AccessInformationCollectionIterator{page: page} 117} 118 119// IsEmpty returns true if the ListResult contains no values. 120func (aic AccessInformationCollection) IsEmpty() bool { 121 return aic.Value == nil || len(*aic.Value) == 0 122} 123 124// hasNextLink returns true if the NextLink is not empty. 125func (aic AccessInformationCollection) hasNextLink() bool { 126 return aic.NextLink != nil && len(*aic.NextLink) != 0 127} 128 129// accessInformationCollectionPreparer prepares a request to retrieve the next set of results. 130// It returns nil if no more results exist. 131func (aic AccessInformationCollection) accessInformationCollectionPreparer(ctx context.Context) (*http.Request, error) { 132 if !aic.hasNextLink() { 133 return nil, nil 134 } 135 return autorest.Prepare((&http.Request{}).WithContext(ctx), 136 autorest.AsJSON(), 137 autorest.AsGet(), 138 autorest.WithBaseURL(to.String(aic.NextLink))) 139} 140 141// AccessInformationCollectionPage contains a page of AccessInformationContract values. 142type AccessInformationCollectionPage struct { 143 fn func(context.Context, AccessInformationCollection) (AccessInformationCollection, error) 144 aic AccessInformationCollection 145} 146 147// NextWithContext advances to the next page of values. If there was an error making 148// the request the page does not advance and the error is returned. 149func (page *AccessInformationCollectionPage) NextWithContext(ctx context.Context) (err error) { 150 if tracing.IsEnabled() { 151 ctx = tracing.StartSpan(ctx, fqdn+"/AccessInformationCollectionPage.NextWithContext") 152 defer func() { 153 sc := -1 154 if page.Response().Response.Response != nil { 155 sc = page.Response().Response.Response.StatusCode 156 } 157 tracing.EndSpan(ctx, sc, err) 158 }() 159 } 160 for { 161 next, err := page.fn(ctx, page.aic) 162 if err != nil { 163 return err 164 } 165 page.aic = next 166 if !next.hasNextLink() || !next.IsEmpty() { 167 break 168 } 169 } 170 return nil 171} 172 173// Next advances to the next page of values. If there was an error making 174// the request the page does not advance and the error is returned. 175// Deprecated: Use NextWithContext() instead. 176func (page *AccessInformationCollectionPage) Next() error { 177 return page.NextWithContext(context.Background()) 178} 179 180// NotDone returns true if the page enumeration should be started or is not yet complete. 181func (page AccessInformationCollectionPage) NotDone() bool { 182 return !page.aic.IsEmpty() 183} 184 185// Response returns the raw server response from the last page request. 186func (page AccessInformationCollectionPage) Response() AccessInformationCollection { 187 return page.aic 188} 189 190// Values returns the slice of values for the current page or nil if there are no values. 191func (page AccessInformationCollectionPage) Values() []AccessInformationContract { 192 if page.aic.IsEmpty() { 193 return nil 194 } 195 return *page.aic.Value 196} 197 198// Creates a new instance of the AccessInformationCollectionPage type. 199func NewAccessInformationCollectionPage(cur AccessInformationCollection, getNextPage func(context.Context, AccessInformationCollection) (AccessInformationCollection, error)) AccessInformationCollectionPage { 200 return AccessInformationCollectionPage{ 201 fn: getNextPage, 202 aic: cur, 203 } 204} 205 206// AccessInformationContract tenant Settings. 207type AccessInformationContract struct { 208 autorest.Response `json:"-"` 209 // AccessInformationContractProperties - AccessInformation entity contract properties. 210 *AccessInformationContractProperties `json:"properties,omitempty"` 211 // ID - READ-ONLY; Resource ID. 212 ID *string `json:"id,omitempty"` 213 // Name - READ-ONLY; Resource name. 214 Name *string `json:"name,omitempty"` 215 // Type - READ-ONLY; Resource type for API Management resource. 216 Type *string `json:"type,omitempty"` 217} 218 219// MarshalJSON is the custom marshaler for AccessInformationContract. 220func (aic AccessInformationContract) MarshalJSON() ([]byte, error) { 221 objectMap := make(map[string]interface{}) 222 if aic.AccessInformationContractProperties != nil { 223 objectMap["properties"] = aic.AccessInformationContractProperties 224 } 225 return json.Marshal(objectMap) 226} 227 228// UnmarshalJSON is the custom unmarshaler for AccessInformationContract struct. 229func (aic *AccessInformationContract) UnmarshalJSON(body []byte) error { 230 var m map[string]*json.RawMessage 231 err := json.Unmarshal(body, &m) 232 if err != nil { 233 return err 234 } 235 for k, v := range m { 236 switch k { 237 case "properties": 238 if v != nil { 239 var accessInformationContractProperties AccessInformationContractProperties 240 err = json.Unmarshal(*v, &accessInformationContractProperties) 241 if err != nil { 242 return err 243 } 244 aic.AccessInformationContractProperties = &accessInformationContractProperties 245 } 246 case "id": 247 if v != nil { 248 var ID string 249 err = json.Unmarshal(*v, &ID) 250 if err != nil { 251 return err 252 } 253 aic.ID = &ID 254 } 255 case "name": 256 if v != nil { 257 var name string 258 err = json.Unmarshal(*v, &name) 259 if err != nil { 260 return err 261 } 262 aic.Name = &name 263 } 264 case "type": 265 if v != nil { 266 var typeVar string 267 err = json.Unmarshal(*v, &typeVar) 268 if err != nil { 269 return err 270 } 271 aic.Type = &typeVar 272 } 273 } 274 } 275 276 return nil 277} 278 279// AccessInformationContractProperties tenant access information contract of the API Management service. 280type AccessInformationContractProperties struct { 281 // ID - Access Information type ('access' or 'gitAccess') 282 ID *string `json:"id,omitempty"` 283 // PrincipalID - Principal (User) Identifier. 284 PrincipalID *string `json:"principalId,omitempty"` 285 // Enabled - Determines whether direct access is enabled. 286 Enabled *bool `json:"enabled,omitempty"` 287} 288 289// AccessInformationCreateParameterProperties tenant access information update parameters of the API 290// Management service 291type AccessInformationCreateParameterProperties struct { 292 // PrincipalID - Principal (User) Identifier. 293 PrincipalID *string `json:"principalId,omitempty"` 294 // PrimaryKey - Primary access key. This property will not be filled on 'GET' operations! Use '/listSecrets' POST request to get the value. 295 PrimaryKey *string `json:"primaryKey,omitempty"` 296 // SecondaryKey - Secondary access key. This property will not be filled on 'GET' operations! Use '/listSecrets' POST request to get the value. 297 SecondaryKey *string `json:"secondaryKey,omitempty"` 298 // Enabled - Determines whether direct access is enabled. 299 Enabled *bool `json:"enabled,omitempty"` 300} 301 302// AccessInformationCreateParameters tenant access information update parameters. 303type AccessInformationCreateParameters struct { 304 // AccessInformationCreateParameterProperties - Tenant access information update parameter properties. 305 *AccessInformationCreateParameterProperties `json:"properties,omitempty"` 306} 307 308// MarshalJSON is the custom marshaler for AccessInformationCreateParameters. 309func (aicp AccessInformationCreateParameters) MarshalJSON() ([]byte, error) { 310 objectMap := make(map[string]interface{}) 311 if aicp.AccessInformationCreateParameterProperties != nil { 312 objectMap["properties"] = aicp.AccessInformationCreateParameterProperties 313 } 314 return json.Marshal(objectMap) 315} 316 317// UnmarshalJSON is the custom unmarshaler for AccessInformationCreateParameters struct. 318func (aicp *AccessInformationCreateParameters) UnmarshalJSON(body []byte) error { 319 var m map[string]*json.RawMessage 320 err := json.Unmarshal(body, &m) 321 if err != nil { 322 return err 323 } 324 for k, v := range m { 325 switch k { 326 case "properties": 327 if v != nil { 328 var accessInformationCreateParameterProperties AccessInformationCreateParameterProperties 329 err = json.Unmarshal(*v, &accessInformationCreateParameterProperties) 330 if err != nil { 331 return err 332 } 333 aicp.AccessInformationCreateParameterProperties = &accessInformationCreateParameterProperties 334 } 335 } 336 } 337 338 return nil 339} 340 341// AccessInformationSecretsContract tenant access information contract of the API Management service. 342type AccessInformationSecretsContract struct { 343 autorest.Response `json:"-"` 344 // ID - Access Information type ('access' or 'gitAccess') 345 ID *string `json:"id,omitempty"` 346 // PrincipalID - Principal (User) Identifier. 347 PrincipalID *string `json:"principalId,omitempty"` 348 // PrimaryKey - Primary access key. This property will not be filled on 'GET' operations! Use '/listSecrets' POST request to get the value. 349 PrimaryKey *string `json:"primaryKey,omitempty"` 350 // SecondaryKey - Secondary access key. This property will not be filled on 'GET' operations! Use '/listSecrets' POST request to get the value. 351 SecondaryKey *string `json:"secondaryKey,omitempty"` 352 // Enabled - Determines whether direct access is enabled. 353 Enabled *bool `json:"enabled,omitempty"` 354} 355 356// AccessInformationUpdateParameterProperties tenant access information update parameters of the API 357// Management service 358type AccessInformationUpdateParameterProperties struct { 359 // Enabled - Determines whether direct access is enabled. 360 Enabled *bool `json:"enabled,omitempty"` 361} 362 363// AccessInformationUpdateParameters tenant access information update parameters. 364type AccessInformationUpdateParameters struct { 365 // AccessInformationUpdateParameterProperties - Tenant access information update parameter properties. 366 *AccessInformationUpdateParameterProperties `json:"properties,omitempty"` 367} 368 369// MarshalJSON is the custom marshaler for AccessInformationUpdateParameters. 370func (aiup AccessInformationUpdateParameters) MarshalJSON() ([]byte, error) { 371 objectMap := make(map[string]interface{}) 372 if aiup.AccessInformationUpdateParameterProperties != nil { 373 objectMap["properties"] = aiup.AccessInformationUpdateParameterProperties 374 } 375 return json.Marshal(objectMap) 376} 377 378// UnmarshalJSON is the custom unmarshaler for AccessInformationUpdateParameters struct. 379func (aiup *AccessInformationUpdateParameters) UnmarshalJSON(body []byte) error { 380 var m map[string]*json.RawMessage 381 err := json.Unmarshal(body, &m) 382 if err != nil { 383 return err 384 } 385 for k, v := range m { 386 switch k { 387 case "properties": 388 if v != nil { 389 var accessInformationUpdateParameterProperties AccessInformationUpdateParameterProperties 390 err = json.Unmarshal(*v, &accessInformationUpdateParameterProperties) 391 if err != nil { 392 return err 393 } 394 aiup.AccessInformationUpdateParameterProperties = &accessInformationUpdateParameterProperties 395 } 396 } 397 } 398 399 return nil 400} 401 402// AdditionalLocation description of an additional API Management resource location. 403type AdditionalLocation struct { 404 // Location - The location name of the additional region among Azure Data center regions. 405 Location *string `json:"location,omitempty"` 406 // Sku - SKU properties of the API Management service. 407 Sku *ServiceSkuProperties `json:"sku,omitempty"` 408 // Zones - A list of availability zones denoting where the resource needs to come from. 409 Zones *[]string `json:"zones,omitempty"` 410 // 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. 411 PublicIPAddresses *[]string `json:"publicIPAddresses,omitempty"` 412 // 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. 413 PrivateIPAddresses *[]string `json:"privateIPAddresses,omitempty"` 414 // VirtualNetworkConfiguration - Virtual network configuration for the location. 415 VirtualNetworkConfiguration *VirtualNetworkConfiguration `json:"virtualNetworkConfiguration,omitempty"` 416 // GatewayRegionalURL - READ-ONLY; Gateway URL of the API Management service in the Region. 417 GatewayRegionalURL *string `json:"gatewayRegionalUrl,omitempty"` 418 // 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. 419 DisableGateway *bool `json:"disableGateway,omitempty"` 420} 421 422// MarshalJSON is the custom marshaler for AdditionalLocation. 423func (al AdditionalLocation) MarshalJSON() ([]byte, error) { 424 objectMap := make(map[string]interface{}) 425 if al.Location != nil { 426 objectMap["location"] = al.Location 427 } 428 if al.Sku != nil { 429 objectMap["sku"] = al.Sku 430 } 431 if al.Zones != nil { 432 objectMap["zones"] = al.Zones 433 } 434 if al.VirtualNetworkConfiguration != nil { 435 objectMap["virtualNetworkConfiguration"] = al.VirtualNetworkConfiguration 436 } 437 if al.DisableGateway != nil { 438 objectMap["disableGateway"] = al.DisableGateway 439 } 440 return json.Marshal(objectMap) 441} 442 443// APICollection paged Api list representation. 444type APICollection struct { 445 autorest.Response `json:"-"` 446 // Value - READ-ONLY; Page values. 447 Value *[]APIContract `json:"value,omitempty"` 448 // Count - Total record count number across all pages. 449 Count *int64 `json:"count,omitempty"` 450 // NextLink - READ-ONLY; Next page link if any. 451 NextLink *string `json:"nextLink,omitempty"` 452} 453 454// MarshalJSON is the custom marshaler for APICollection. 455func (ac APICollection) MarshalJSON() ([]byte, error) { 456 objectMap := make(map[string]interface{}) 457 if ac.Count != nil { 458 objectMap["count"] = ac.Count 459 } 460 return json.Marshal(objectMap) 461} 462 463// APICollectionIterator provides access to a complete listing of APIContract values. 464type APICollectionIterator struct { 465 i int 466 page APICollectionPage 467} 468 469// NextWithContext advances to the next value. If there was an error making 470// the request the iterator does not advance and the error is returned. 471func (iter *APICollectionIterator) NextWithContext(ctx context.Context) (err error) { 472 if tracing.IsEnabled() { 473 ctx = tracing.StartSpan(ctx, fqdn+"/APICollectionIterator.NextWithContext") 474 defer func() { 475 sc := -1 476 if iter.Response().Response.Response != nil { 477 sc = iter.Response().Response.Response.StatusCode 478 } 479 tracing.EndSpan(ctx, sc, err) 480 }() 481 } 482 iter.i++ 483 if iter.i < len(iter.page.Values()) { 484 return nil 485 } 486 err = iter.page.NextWithContext(ctx) 487 if err != nil { 488 iter.i-- 489 return err 490 } 491 iter.i = 0 492 return nil 493} 494 495// Next advances to the next value. If there was an error making 496// the request the iterator does not advance and the error is returned. 497// Deprecated: Use NextWithContext() instead. 498func (iter *APICollectionIterator) Next() error { 499 return iter.NextWithContext(context.Background()) 500} 501 502// NotDone returns true if the enumeration should be started or is not yet complete. 503func (iter APICollectionIterator) NotDone() bool { 504 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 505} 506 507// Response returns the raw server response from the last page request. 508func (iter APICollectionIterator) Response() APICollection { 509 return iter.page.Response() 510} 511 512// Value returns the current value or a zero-initialized value if the 513// iterator has advanced beyond the end of the collection. 514func (iter APICollectionIterator) Value() APIContract { 515 if !iter.page.NotDone() { 516 return APIContract{} 517 } 518 return iter.page.Values()[iter.i] 519} 520 521// Creates a new instance of the APICollectionIterator type. 522func NewAPICollectionIterator(page APICollectionPage) APICollectionIterator { 523 return APICollectionIterator{page: page} 524} 525 526// IsEmpty returns true if the ListResult contains no values. 527func (ac APICollection) IsEmpty() bool { 528 return ac.Value == nil || len(*ac.Value) == 0 529} 530 531// hasNextLink returns true if the NextLink is not empty. 532func (ac APICollection) hasNextLink() bool { 533 return ac.NextLink != nil && len(*ac.NextLink) != 0 534} 535 536// aPICollectionPreparer prepares a request to retrieve the next set of results. 537// It returns nil if no more results exist. 538func (ac APICollection) aPICollectionPreparer(ctx context.Context) (*http.Request, error) { 539 if !ac.hasNextLink() { 540 return nil, nil 541 } 542 return autorest.Prepare((&http.Request{}).WithContext(ctx), 543 autorest.AsJSON(), 544 autorest.AsGet(), 545 autorest.WithBaseURL(to.String(ac.NextLink))) 546} 547 548// APICollectionPage contains a page of APIContract values. 549type APICollectionPage struct { 550 fn func(context.Context, APICollection) (APICollection, error) 551 ac APICollection 552} 553 554// NextWithContext advances to the next page of values. If there was an error making 555// the request the page does not advance and the error is returned. 556func (page *APICollectionPage) NextWithContext(ctx context.Context) (err error) { 557 if tracing.IsEnabled() { 558 ctx = tracing.StartSpan(ctx, fqdn+"/APICollectionPage.NextWithContext") 559 defer func() { 560 sc := -1 561 if page.Response().Response.Response != nil { 562 sc = page.Response().Response.Response.StatusCode 563 } 564 tracing.EndSpan(ctx, sc, err) 565 }() 566 } 567 for { 568 next, err := page.fn(ctx, page.ac) 569 if err != nil { 570 return err 571 } 572 page.ac = next 573 if !next.hasNextLink() || !next.IsEmpty() { 574 break 575 } 576 } 577 return nil 578} 579 580// Next advances to the next page of values. If there was an error making 581// the request the page does not advance and the error is returned. 582// Deprecated: Use NextWithContext() instead. 583func (page *APICollectionPage) Next() error { 584 return page.NextWithContext(context.Background()) 585} 586 587// NotDone returns true if the page enumeration should be started or is not yet complete. 588func (page APICollectionPage) NotDone() bool { 589 return !page.ac.IsEmpty() 590} 591 592// Response returns the raw server response from the last page request. 593func (page APICollectionPage) Response() APICollection { 594 return page.ac 595} 596 597// Values returns the slice of values for the current page or nil if there are no values. 598func (page APICollectionPage) Values() []APIContract { 599 if page.ac.IsEmpty() { 600 return nil 601 } 602 return *page.ac.Value 603} 604 605// Creates a new instance of the APICollectionPage type. 606func NewAPICollectionPage(cur APICollection, getNextPage func(context.Context, APICollection) (APICollection, error)) APICollectionPage { 607 return APICollectionPage{ 608 fn: getNextPage, 609 ac: cur, 610 } 611} 612 613// APIContract api details. 614type APIContract struct { 615 autorest.Response `json:"-"` 616 // APIContractProperties - Api entity contract properties. 617 *APIContractProperties `json:"properties,omitempty"` 618 // ID - READ-ONLY; Resource ID. 619 ID *string `json:"id,omitempty"` 620 // Name - READ-ONLY; Resource name. 621 Name *string `json:"name,omitempty"` 622 // Type - READ-ONLY; Resource type for API Management resource. 623 Type *string `json:"type,omitempty"` 624} 625 626// MarshalJSON is the custom marshaler for APIContract. 627func (ac APIContract) MarshalJSON() ([]byte, error) { 628 objectMap := make(map[string]interface{}) 629 if ac.APIContractProperties != nil { 630 objectMap["properties"] = ac.APIContractProperties 631 } 632 return json.Marshal(objectMap) 633} 634 635// UnmarshalJSON is the custom unmarshaler for APIContract struct. 636func (ac *APIContract) UnmarshalJSON(body []byte) error { 637 var m map[string]*json.RawMessage 638 err := json.Unmarshal(body, &m) 639 if err != nil { 640 return err 641 } 642 for k, v := range m { 643 switch k { 644 case "properties": 645 if v != nil { 646 var APIContractProperties APIContractProperties 647 err = json.Unmarshal(*v, &APIContractProperties) 648 if err != nil { 649 return err 650 } 651 ac.APIContractProperties = &APIContractProperties 652 } 653 case "id": 654 if v != nil { 655 var ID string 656 err = json.Unmarshal(*v, &ID) 657 if err != nil { 658 return err 659 } 660 ac.ID = &ID 661 } 662 case "name": 663 if v != nil { 664 var name string 665 err = json.Unmarshal(*v, &name) 666 if err != nil { 667 return err 668 } 669 ac.Name = &name 670 } 671 case "type": 672 if v != nil { 673 var typeVar string 674 err = json.Unmarshal(*v, &typeVar) 675 if err != nil { 676 return err 677 } 678 ac.Type = &typeVar 679 } 680 } 681 } 682 683 return nil 684} 685 686// APIContractProperties api Entity Properties 687type APIContractProperties struct { 688 // SourceAPIID - API identifier of the source API. 689 SourceAPIID *string `json:"sourceApiId,omitempty"` 690 // DisplayName - API name. Must be 1 to 300 characters long. 691 DisplayName *string `json:"displayName,omitempty"` 692 // ServiceURL - Absolute URL of the backend service implementing this API. Cannot be more than 2000 characters long. 693 ServiceURL *string `json:"serviceUrl,omitempty"` 694 // 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. 695 Path *string `json:"path,omitempty"` 696 // Protocols - Describes on which protocols the operations in this API can be invoked. 697 Protocols *[]Protocol `json:"protocols,omitempty"` 698 // APIVersionSet - Version set details 699 APIVersionSet *APIVersionSetContractDetails `json:"apiVersionSet,omitempty"` 700 // Description - Description of the API. May include HTML formatting tags. 701 Description *string `json:"description,omitempty"` 702 // AuthenticationSettings - Collection of authentication settings included into this API. 703 AuthenticationSettings *AuthenticationSettingsContract `json:"authenticationSettings,omitempty"` 704 // SubscriptionKeyParameterNames - Protocols over which API is made available. 705 SubscriptionKeyParameterNames *SubscriptionKeyParameterNamesContract `json:"subscriptionKeyParameterNames,omitempty"` 706 // APIType - Type of API. Possible values include: 'HTTP', 'Soap' 707 APIType APIType `json:"type,omitempty"` 708 // APIRevision - Describes the Revision of the Api. If no value is provided, default revision 1 is created 709 APIRevision *string `json:"apiRevision,omitempty"` 710 // APIVersion - Indicates the Version identifier of the API if the API is versioned 711 APIVersion *string `json:"apiVersion,omitempty"` 712 // IsCurrent - Indicates if API revision is current api revision. 713 IsCurrent *bool `json:"isCurrent,omitempty"` 714 // IsOnline - READ-ONLY; Indicates if API revision is accessible via the gateway. 715 IsOnline *bool `json:"isOnline,omitempty"` 716 // APIRevisionDescription - Description of the Api Revision. 717 APIRevisionDescription *string `json:"apiRevisionDescription,omitempty"` 718 // APIVersionDescription - Description of the Api Version. 719 APIVersionDescription *string `json:"apiVersionDescription,omitempty"` 720 // APIVersionSetID - A resource identifier for the related ApiVersionSet. 721 APIVersionSetID *string `json:"apiVersionSetId,omitempty"` 722 // SubscriptionRequired - Specifies whether an API or Product subscription is required for accessing the API. 723 SubscriptionRequired *bool `json:"subscriptionRequired,omitempty"` 724} 725 726// MarshalJSON is the custom marshaler for APIContractProperties. 727func (acp APIContractProperties) MarshalJSON() ([]byte, error) { 728 objectMap := make(map[string]interface{}) 729 if acp.SourceAPIID != nil { 730 objectMap["sourceApiId"] = acp.SourceAPIID 731 } 732 if acp.DisplayName != nil { 733 objectMap["displayName"] = acp.DisplayName 734 } 735 if acp.ServiceURL != nil { 736 objectMap["serviceUrl"] = acp.ServiceURL 737 } 738 if acp.Path != nil { 739 objectMap["path"] = acp.Path 740 } 741 if acp.Protocols != nil { 742 objectMap["protocols"] = acp.Protocols 743 } 744 if acp.APIVersionSet != nil { 745 objectMap["apiVersionSet"] = acp.APIVersionSet 746 } 747 if acp.Description != nil { 748 objectMap["description"] = acp.Description 749 } 750 if acp.AuthenticationSettings != nil { 751 objectMap["authenticationSettings"] = acp.AuthenticationSettings 752 } 753 if acp.SubscriptionKeyParameterNames != nil { 754 objectMap["subscriptionKeyParameterNames"] = acp.SubscriptionKeyParameterNames 755 } 756 if acp.APIType != "" { 757 objectMap["type"] = acp.APIType 758 } 759 if acp.APIRevision != nil { 760 objectMap["apiRevision"] = acp.APIRevision 761 } 762 if acp.APIVersion != nil { 763 objectMap["apiVersion"] = acp.APIVersion 764 } 765 if acp.IsCurrent != nil { 766 objectMap["isCurrent"] = acp.IsCurrent 767 } 768 if acp.APIRevisionDescription != nil { 769 objectMap["apiRevisionDescription"] = acp.APIRevisionDescription 770 } 771 if acp.APIVersionDescription != nil { 772 objectMap["apiVersionDescription"] = acp.APIVersionDescription 773 } 774 if acp.APIVersionSetID != nil { 775 objectMap["apiVersionSetId"] = acp.APIVersionSetID 776 } 777 if acp.SubscriptionRequired != nil { 778 objectMap["subscriptionRequired"] = acp.SubscriptionRequired 779 } 780 return json.Marshal(objectMap) 781} 782 783// APIContractUpdateProperties API update contract properties. 784type APIContractUpdateProperties struct { 785 // DisplayName - API name. 786 DisplayName *string `json:"displayName,omitempty"` 787 // ServiceURL - Absolute URL of the backend service implementing this API. 788 ServiceURL *string `json:"serviceUrl,omitempty"` 789 // 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. 790 Path *string `json:"path,omitempty"` 791 // Protocols - Describes on which protocols the operations in this API can be invoked. 792 Protocols *[]Protocol `json:"protocols,omitempty"` 793 // Description - Description of the API. May include HTML formatting tags. 794 Description *string `json:"description,omitempty"` 795 // AuthenticationSettings - Collection of authentication settings included into this API. 796 AuthenticationSettings *AuthenticationSettingsContract `json:"authenticationSettings,omitempty"` 797 // SubscriptionKeyParameterNames - Protocols over which API is made available. 798 SubscriptionKeyParameterNames *SubscriptionKeyParameterNamesContract `json:"subscriptionKeyParameterNames,omitempty"` 799 // APIType - Type of API. Possible values include: 'HTTP', 'Soap' 800 APIType APIType `json:"type,omitempty"` 801 // APIRevision - Describes the Revision of the Api. If no value is provided, default revision 1 is created 802 APIRevision *string `json:"apiRevision,omitempty"` 803 // APIVersion - Indicates the Version identifier of the API if the API is versioned 804 APIVersion *string `json:"apiVersion,omitempty"` 805 // IsCurrent - Indicates if API revision is current api revision. 806 IsCurrent *bool `json:"isCurrent,omitempty"` 807 // IsOnline - READ-ONLY; Indicates if API revision is accessible via the gateway. 808 IsOnline *bool `json:"isOnline,omitempty"` 809 // APIRevisionDescription - Description of the Api Revision. 810 APIRevisionDescription *string `json:"apiRevisionDescription,omitempty"` 811 // APIVersionDescription - Description of the Api Version. 812 APIVersionDescription *string `json:"apiVersionDescription,omitempty"` 813 // APIVersionSetID - A resource identifier for the related ApiVersionSet. 814 APIVersionSetID *string `json:"apiVersionSetId,omitempty"` 815 // SubscriptionRequired - Specifies whether an API or Product subscription is required for accessing the API. 816 SubscriptionRequired *bool `json:"subscriptionRequired,omitempty"` 817} 818 819// MarshalJSON is the custom marshaler for APIContractUpdateProperties. 820func (acup APIContractUpdateProperties) MarshalJSON() ([]byte, error) { 821 objectMap := make(map[string]interface{}) 822 if acup.DisplayName != nil { 823 objectMap["displayName"] = acup.DisplayName 824 } 825 if acup.ServiceURL != nil { 826 objectMap["serviceUrl"] = acup.ServiceURL 827 } 828 if acup.Path != nil { 829 objectMap["path"] = acup.Path 830 } 831 if acup.Protocols != nil { 832 objectMap["protocols"] = acup.Protocols 833 } 834 if acup.Description != nil { 835 objectMap["description"] = acup.Description 836 } 837 if acup.AuthenticationSettings != nil { 838 objectMap["authenticationSettings"] = acup.AuthenticationSettings 839 } 840 if acup.SubscriptionKeyParameterNames != nil { 841 objectMap["subscriptionKeyParameterNames"] = acup.SubscriptionKeyParameterNames 842 } 843 if acup.APIType != "" { 844 objectMap["type"] = acup.APIType 845 } 846 if acup.APIRevision != nil { 847 objectMap["apiRevision"] = acup.APIRevision 848 } 849 if acup.APIVersion != nil { 850 objectMap["apiVersion"] = acup.APIVersion 851 } 852 if acup.IsCurrent != nil { 853 objectMap["isCurrent"] = acup.IsCurrent 854 } 855 if acup.APIRevisionDescription != nil { 856 objectMap["apiRevisionDescription"] = acup.APIRevisionDescription 857 } 858 if acup.APIVersionDescription != nil { 859 objectMap["apiVersionDescription"] = acup.APIVersionDescription 860 } 861 if acup.APIVersionSetID != nil { 862 objectMap["apiVersionSetId"] = acup.APIVersionSetID 863 } 864 if acup.SubscriptionRequired != nil { 865 objectMap["subscriptionRequired"] = acup.SubscriptionRequired 866 } 867 return json.Marshal(objectMap) 868} 869 870// APICreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 871// operation. 872type APICreateOrUpdateFuture struct { 873 azure.FutureAPI 874 // Result returns the result of the asynchronous operation. 875 // If the operation has not completed it will return an error. 876 Result func(APIClient) (APIContract, error) 877} 878 879// APICreateOrUpdateParameter API Create or Update Parameters. 880type APICreateOrUpdateParameter struct { 881 // APICreateOrUpdateProperties - Api entity create of update properties. 882 *APICreateOrUpdateProperties `json:"properties,omitempty"` 883} 884 885// MarshalJSON is the custom marshaler for APICreateOrUpdateParameter. 886func (acoup APICreateOrUpdateParameter) MarshalJSON() ([]byte, error) { 887 objectMap := make(map[string]interface{}) 888 if acoup.APICreateOrUpdateProperties != nil { 889 objectMap["properties"] = acoup.APICreateOrUpdateProperties 890 } 891 return json.Marshal(objectMap) 892} 893 894// UnmarshalJSON is the custom unmarshaler for APICreateOrUpdateParameter struct. 895func (acoup *APICreateOrUpdateParameter) UnmarshalJSON(body []byte) error { 896 var m map[string]*json.RawMessage 897 err := json.Unmarshal(body, &m) 898 if err != nil { 899 return err 900 } 901 for k, v := range m { 902 switch k { 903 case "properties": 904 if v != nil { 905 var APICreateOrUpdateProperties APICreateOrUpdateProperties 906 err = json.Unmarshal(*v, &APICreateOrUpdateProperties) 907 if err != nil { 908 return err 909 } 910 acoup.APICreateOrUpdateProperties = &APICreateOrUpdateProperties 911 } 912 } 913 } 914 915 return nil 916} 917 918// APICreateOrUpdateProperties api Create or Update Properties. 919type APICreateOrUpdateProperties struct { 920 // Value - Content value when Importing an API. 921 Value *string `json:"value,omitempty"` 922 // 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' 923 Format ContentFormat `json:"format,omitempty"` 924 // WsdlSelector - Criteria to limit import of WSDL to a subset of the document. 925 WsdlSelector *APICreateOrUpdatePropertiesWsdlSelector `json:"wsdlSelector,omitempty"` 926 // SoapAPIType - Type of Api to create. 927 // * `http` creates a SOAP to REST API 928 // * `soap` creates a SOAP pass-through API. Possible values include: 'SoapToRest', 'SoapPassThrough' 929 SoapAPIType SoapAPIType `json:"apiType,omitempty"` 930 // SourceAPIID - API identifier of the source API. 931 SourceAPIID *string `json:"sourceApiId,omitempty"` 932 // DisplayName - API name. Must be 1 to 300 characters long. 933 DisplayName *string `json:"displayName,omitempty"` 934 // ServiceURL - Absolute URL of the backend service implementing this API. Cannot be more than 2000 characters long. 935 ServiceURL *string `json:"serviceUrl,omitempty"` 936 // 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. 937 Path *string `json:"path,omitempty"` 938 // Protocols - Describes on which protocols the operations in this API can be invoked. 939 Protocols *[]Protocol `json:"protocols,omitempty"` 940 // APIVersionSet - Version set details 941 APIVersionSet *APIVersionSetContractDetails `json:"apiVersionSet,omitempty"` 942 // Description - Description of the API. May include HTML formatting tags. 943 Description *string `json:"description,omitempty"` 944 // AuthenticationSettings - Collection of authentication settings included into this API. 945 AuthenticationSettings *AuthenticationSettingsContract `json:"authenticationSettings,omitempty"` 946 // SubscriptionKeyParameterNames - Protocols over which API is made available. 947 SubscriptionKeyParameterNames *SubscriptionKeyParameterNamesContract `json:"subscriptionKeyParameterNames,omitempty"` 948 // APIType - Type of API. Possible values include: 'HTTP', 'Soap' 949 APIType APIType `json:"type,omitempty"` 950 // APIRevision - Describes the Revision of the Api. If no value is provided, default revision 1 is created 951 APIRevision *string `json:"apiRevision,omitempty"` 952 // APIVersion - Indicates the Version identifier of the API if the API is versioned 953 APIVersion *string `json:"apiVersion,omitempty"` 954 // IsCurrent - Indicates if API revision is current api revision. 955 IsCurrent *bool `json:"isCurrent,omitempty"` 956 // IsOnline - READ-ONLY; Indicates if API revision is accessible via the gateway. 957 IsOnline *bool `json:"isOnline,omitempty"` 958 // APIRevisionDescription - Description of the Api Revision. 959 APIRevisionDescription *string `json:"apiRevisionDescription,omitempty"` 960 // APIVersionDescription - Description of the Api Version. 961 APIVersionDescription *string `json:"apiVersionDescription,omitempty"` 962 // APIVersionSetID - A resource identifier for the related ApiVersionSet. 963 APIVersionSetID *string `json:"apiVersionSetId,omitempty"` 964 // SubscriptionRequired - Specifies whether an API or Product subscription is required for accessing the API. 965 SubscriptionRequired *bool `json:"subscriptionRequired,omitempty"` 966} 967 968// MarshalJSON is the custom marshaler for APICreateOrUpdateProperties. 969func (acoup APICreateOrUpdateProperties) MarshalJSON() ([]byte, error) { 970 objectMap := make(map[string]interface{}) 971 if acoup.Value != nil { 972 objectMap["value"] = acoup.Value 973 } 974 if acoup.Format != "" { 975 objectMap["format"] = acoup.Format 976 } 977 if acoup.WsdlSelector != nil { 978 objectMap["wsdlSelector"] = acoup.WsdlSelector 979 } 980 if acoup.SoapAPIType != "" { 981 objectMap["apiType"] = acoup.SoapAPIType 982 } 983 if acoup.SourceAPIID != nil { 984 objectMap["sourceApiId"] = acoup.SourceAPIID 985 } 986 if acoup.DisplayName != nil { 987 objectMap["displayName"] = acoup.DisplayName 988 } 989 if acoup.ServiceURL != nil { 990 objectMap["serviceUrl"] = acoup.ServiceURL 991 } 992 if acoup.Path != nil { 993 objectMap["path"] = acoup.Path 994 } 995 if acoup.Protocols != nil { 996 objectMap["protocols"] = acoup.Protocols 997 } 998 if acoup.APIVersionSet != nil { 999 objectMap["apiVersionSet"] = acoup.APIVersionSet 1000 } 1001 if acoup.Description != nil { 1002 objectMap["description"] = acoup.Description 1003 } 1004 if acoup.AuthenticationSettings != nil { 1005 objectMap["authenticationSettings"] = acoup.AuthenticationSettings 1006 } 1007 if acoup.SubscriptionKeyParameterNames != nil { 1008 objectMap["subscriptionKeyParameterNames"] = acoup.SubscriptionKeyParameterNames 1009 } 1010 if acoup.APIType != "" { 1011 objectMap["type"] = acoup.APIType 1012 } 1013 if acoup.APIRevision != nil { 1014 objectMap["apiRevision"] = acoup.APIRevision 1015 } 1016 if acoup.APIVersion != nil { 1017 objectMap["apiVersion"] = acoup.APIVersion 1018 } 1019 if acoup.IsCurrent != nil { 1020 objectMap["isCurrent"] = acoup.IsCurrent 1021 } 1022 if acoup.APIRevisionDescription != nil { 1023 objectMap["apiRevisionDescription"] = acoup.APIRevisionDescription 1024 } 1025 if acoup.APIVersionDescription != nil { 1026 objectMap["apiVersionDescription"] = acoup.APIVersionDescription 1027 } 1028 if acoup.APIVersionSetID != nil { 1029 objectMap["apiVersionSetId"] = acoup.APIVersionSetID 1030 } 1031 if acoup.SubscriptionRequired != nil { 1032 objectMap["subscriptionRequired"] = acoup.SubscriptionRequired 1033 } 1034 return json.Marshal(objectMap) 1035} 1036 1037// APICreateOrUpdatePropertiesWsdlSelector criteria to limit import of WSDL to a subset of the document. 1038type APICreateOrUpdatePropertiesWsdlSelector struct { 1039 // WsdlServiceName - Name of service to import from WSDL 1040 WsdlServiceName *string `json:"wsdlServiceName,omitempty"` 1041 // WsdlEndpointName - Name of endpoint(port) to import from WSDL 1042 WsdlEndpointName *string `json:"wsdlEndpointName,omitempty"` 1043} 1044 1045// APIEntityBaseContract API base contract details. 1046type APIEntityBaseContract struct { 1047 // Description - Description of the API. May include HTML formatting tags. 1048 Description *string `json:"description,omitempty"` 1049 // AuthenticationSettings - Collection of authentication settings included into this API. 1050 AuthenticationSettings *AuthenticationSettingsContract `json:"authenticationSettings,omitempty"` 1051 // SubscriptionKeyParameterNames - Protocols over which API is made available. 1052 SubscriptionKeyParameterNames *SubscriptionKeyParameterNamesContract `json:"subscriptionKeyParameterNames,omitempty"` 1053 // APIType - Type of API. Possible values include: 'HTTP', 'Soap' 1054 APIType APIType `json:"type,omitempty"` 1055 // APIRevision - Describes the Revision of the Api. If no value is provided, default revision 1 is created 1056 APIRevision *string `json:"apiRevision,omitempty"` 1057 // APIVersion - Indicates the Version identifier of the API if the API is versioned 1058 APIVersion *string `json:"apiVersion,omitempty"` 1059 // IsCurrent - Indicates if API revision is current api revision. 1060 IsCurrent *bool `json:"isCurrent,omitempty"` 1061 // IsOnline - READ-ONLY; Indicates if API revision is accessible via the gateway. 1062 IsOnline *bool `json:"isOnline,omitempty"` 1063 // APIRevisionDescription - Description of the Api Revision. 1064 APIRevisionDescription *string `json:"apiRevisionDescription,omitempty"` 1065 // APIVersionDescription - Description of the Api Version. 1066 APIVersionDescription *string `json:"apiVersionDescription,omitempty"` 1067 // APIVersionSetID - A resource identifier for the related ApiVersionSet. 1068 APIVersionSetID *string `json:"apiVersionSetId,omitempty"` 1069 // SubscriptionRequired - Specifies whether an API or Product subscription is required for accessing the API. 1070 SubscriptionRequired *bool `json:"subscriptionRequired,omitempty"` 1071} 1072 1073// MarshalJSON is the custom marshaler for APIEntityBaseContract. 1074func (aebc APIEntityBaseContract) MarshalJSON() ([]byte, error) { 1075 objectMap := make(map[string]interface{}) 1076 if aebc.Description != nil { 1077 objectMap["description"] = aebc.Description 1078 } 1079 if aebc.AuthenticationSettings != nil { 1080 objectMap["authenticationSettings"] = aebc.AuthenticationSettings 1081 } 1082 if aebc.SubscriptionKeyParameterNames != nil { 1083 objectMap["subscriptionKeyParameterNames"] = aebc.SubscriptionKeyParameterNames 1084 } 1085 if aebc.APIType != "" { 1086 objectMap["type"] = aebc.APIType 1087 } 1088 if aebc.APIRevision != nil { 1089 objectMap["apiRevision"] = aebc.APIRevision 1090 } 1091 if aebc.APIVersion != nil { 1092 objectMap["apiVersion"] = aebc.APIVersion 1093 } 1094 if aebc.IsCurrent != nil { 1095 objectMap["isCurrent"] = aebc.IsCurrent 1096 } 1097 if aebc.APIRevisionDescription != nil { 1098 objectMap["apiRevisionDescription"] = aebc.APIRevisionDescription 1099 } 1100 if aebc.APIVersionDescription != nil { 1101 objectMap["apiVersionDescription"] = aebc.APIVersionDescription 1102 } 1103 if aebc.APIVersionSetID != nil { 1104 objectMap["apiVersionSetId"] = aebc.APIVersionSetID 1105 } 1106 if aebc.SubscriptionRequired != nil { 1107 objectMap["subscriptionRequired"] = aebc.SubscriptionRequired 1108 } 1109 return json.Marshal(objectMap) 1110} 1111 1112// APIExportResult API Export result. 1113type APIExportResult struct { 1114 autorest.Response `json:"-"` 1115 // ID - ResourceId of the API which was exported. 1116 ID *string `json:"id,omitempty"` 1117 // 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' 1118 ExportResultFormat ExportResultFormat `json:"format,omitempty"` 1119 // Value - The object defining the schema of the exported Api Detail 1120 Value *APIExportResultValue `json:"value,omitempty"` 1121} 1122 1123// APIExportResultValue the object defining the schema of the exported Api Detail 1124type APIExportResultValue struct { 1125 // Link - Link to the Storage Blob containing the result of the export operation. The Blob Uri is only valid for 5 minutes. 1126 Link *string `json:"link,omitempty"` 1127} 1128 1129// ApimResource the Resource definition. 1130type ApimResource struct { 1131 // ID - READ-ONLY; Resource ID. 1132 ID *string `json:"id,omitempty"` 1133 // Name - READ-ONLY; Resource name. 1134 Name *string `json:"name,omitempty"` 1135 // Type - READ-ONLY; Resource type for API Management resource is set to Microsoft.ApiManagement. 1136 Type *string `json:"type,omitempty"` 1137 // Tags - Resource tags. 1138 Tags map[string]*string `json:"tags"` 1139} 1140 1141// MarshalJSON is the custom marshaler for ApimResource. 1142func (ar ApimResource) MarshalJSON() ([]byte, error) { 1143 objectMap := make(map[string]interface{}) 1144 if ar.Tags != nil { 1145 objectMap["tags"] = ar.Tags 1146 } 1147 return json.Marshal(objectMap) 1148} 1149 1150// APIReleaseCollection paged ApiRelease list representation. 1151type APIReleaseCollection struct { 1152 autorest.Response `json:"-"` 1153 // Value - READ-ONLY; Page values. 1154 Value *[]APIReleaseContract `json:"value,omitempty"` 1155 // Count - Total record count number across all pages. 1156 Count *int64 `json:"count,omitempty"` 1157 // NextLink - READ-ONLY; Next page link if any. 1158 NextLink *string `json:"nextLink,omitempty"` 1159} 1160 1161// MarshalJSON is the custom marshaler for APIReleaseCollection. 1162func (arc APIReleaseCollection) MarshalJSON() ([]byte, error) { 1163 objectMap := make(map[string]interface{}) 1164 if arc.Count != nil { 1165 objectMap["count"] = arc.Count 1166 } 1167 return json.Marshal(objectMap) 1168} 1169 1170// APIReleaseCollectionIterator provides access to a complete listing of APIReleaseContract values. 1171type APIReleaseCollectionIterator struct { 1172 i int 1173 page APIReleaseCollectionPage 1174} 1175 1176// NextWithContext advances to the next value. If there was an error making 1177// the request the iterator does not advance and the error is returned. 1178func (iter *APIReleaseCollectionIterator) NextWithContext(ctx context.Context) (err error) { 1179 if tracing.IsEnabled() { 1180 ctx = tracing.StartSpan(ctx, fqdn+"/APIReleaseCollectionIterator.NextWithContext") 1181 defer func() { 1182 sc := -1 1183 if iter.Response().Response.Response != nil { 1184 sc = iter.Response().Response.Response.StatusCode 1185 } 1186 tracing.EndSpan(ctx, sc, err) 1187 }() 1188 } 1189 iter.i++ 1190 if iter.i < len(iter.page.Values()) { 1191 return nil 1192 } 1193 err = iter.page.NextWithContext(ctx) 1194 if err != nil { 1195 iter.i-- 1196 return err 1197 } 1198 iter.i = 0 1199 return nil 1200} 1201 1202// Next advances to the next value. If there was an error making 1203// the request the iterator does not advance and the error is returned. 1204// Deprecated: Use NextWithContext() instead. 1205func (iter *APIReleaseCollectionIterator) Next() error { 1206 return iter.NextWithContext(context.Background()) 1207} 1208 1209// NotDone returns true if the enumeration should be started or is not yet complete. 1210func (iter APIReleaseCollectionIterator) NotDone() bool { 1211 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 1212} 1213 1214// Response returns the raw server response from the last page request. 1215func (iter APIReleaseCollectionIterator) Response() APIReleaseCollection { 1216 return iter.page.Response() 1217} 1218 1219// Value returns the current value or a zero-initialized value if the 1220// iterator has advanced beyond the end of the collection. 1221func (iter APIReleaseCollectionIterator) Value() APIReleaseContract { 1222 if !iter.page.NotDone() { 1223 return APIReleaseContract{} 1224 } 1225 return iter.page.Values()[iter.i] 1226} 1227 1228// Creates a new instance of the APIReleaseCollectionIterator type. 1229func NewAPIReleaseCollectionIterator(page APIReleaseCollectionPage) APIReleaseCollectionIterator { 1230 return APIReleaseCollectionIterator{page: page} 1231} 1232 1233// IsEmpty returns true if the ListResult contains no values. 1234func (arc APIReleaseCollection) IsEmpty() bool { 1235 return arc.Value == nil || len(*arc.Value) == 0 1236} 1237 1238// hasNextLink returns true if the NextLink is not empty. 1239func (arc APIReleaseCollection) hasNextLink() bool { 1240 return arc.NextLink != nil && len(*arc.NextLink) != 0 1241} 1242 1243// aPIReleaseCollectionPreparer prepares a request to retrieve the next set of results. 1244// It returns nil if no more results exist. 1245func (arc APIReleaseCollection) aPIReleaseCollectionPreparer(ctx context.Context) (*http.Request, error) { 1246 if !arc.hasNextLink() { 1247 return nil, nil 1248 } 1249 return autorest.Prepare((&http.Request{}).WithContext(ctx), 1250 autorest.AsJSON(), 1251 autorest.AsGet(), 1252 autorest.WithBaseURL(to.String(arc.NextLink))) 1253} 1254 1255// APIReleaseCollectionPage contains a page of APIReleaseContract values. 1256type APIReleaseCollectionPage struct { 1257 fn func(context.Context, APIReleaseCollection) (APIReleaseCollection, error) 1258 arc APIReleaseCollection 1259} 1260 1261// NextWithContext advances to the next page of values. If there was an error making 1262// the request the page does not advance and the error is returned. 1263func (page *APIReleaseCollectionPage) NextWithContext(ctx context.Context) (err error) { 1264 if tracing.IsEnabled() { 1265 ctx = tracing.StartSpan(ctx, fqdn+"/APIReleaseCollectionPage.NextWithContext") 1266 defer func() { 1267 sc := -1 1268 if page.Response().Response.Response != nil { 1269 sc = page.Response().Response.Response.StatusCode 1270 } 1271 tracing.EndSpan(ctx, sc, err) 1272 }() 1273 } 1274 for { 1275 next, err := page.fn(ctx, page.arc) 1276 if err != nil { 1277 return err 1278 } 1279 page.arc = next 1280 if !next.hasNextLink() || !next.IsEmpty() { 1281 break 1282 } 1283 } 1284 return nil 1285} 1286 1287// Next advances to the next page of values. If there was an error making 1288// the request the page does not advance and the error is returned. 1289// Deprecated: Use NextWithContext() instead. 1290func (page *APIReleaseCollectionPage) Next() error { 1291 return page.NextWithContext(context.Background()) 1292} 1293 1294// NotDone returns true if the page enumeration should be started or is not yet complete. 1295func (page APIReleaseCollectionPage) NotDone() bool { 1296 return !page.arc.IsEmpty() 1297} 1298 1299// Response returns the raw server response from the last page request. 1300func (page APIReleaseCollectionPage) Response() APIReleaseCollection { 1301 return page.arc 1302} 1303 1304// Values returns the slice of values for the current page or nil if there are no values. 1305func (page APIReleaseCollectionPage) Values() []APIReleaseContract { 1306 if page.arc.IsEmpty() { 1307 return nil 1308 } 1309 return *page.arc.Value 1310} 1311 1312// Creates a new instance of the APIReleaseCollectionPage type. 1313func NewAPIReleaseCollectionPage(cur APIReleaseCollection, getNextPage func(context.Context, APIReleaseCollection) (APIReleaseCollection, error)) APIReleaseCollectionPage { 1314 return APIReleaseCollectionPage{ 1315 fn: getNextPage, 1316 arc: cur, 1317 } 1318} 1319 1320// APIReleaseContract apiRelease details. 1321type APIReleaseContract struct { 1322 autorest.Response `json:"-"` 1323 // APIReleaseContractProperties - ApiRelease entity contract properties. 1324 *APIReleaseContractProperties `json:"properties,omitempty"` 1325 // ID - READ-ONLY; Resource ID. 1326 ID *string `json:"id,omitempty"` 1327 // Name - READ-ONLY; Resource name. 1328 Name *string `json:"name,omitempty"` 1329 // Type - READ-ONLY; Resource type for API Management resource. 1330 Type *string `json:"type,omitempty"` 1331} 1332 1333// MarshalJSON is the custom marshaler for APIReleaseContract. 1334func (arc APIReleaseContract) MarshalJSON() ([]byte, error) { 1335 objectMap := make(map[string]interface{}) 1336 if arc.APIReleaseContractProperties != nil { 1337 objectMap["properties"] = arc.APIReleaseContractProperties 1338 } 1339 return json.Marshal(objectMap) 1340} 1341 1342// UnmarshalJSON is the custom unmarshaler for APIReleaseContract struct. 1343func (arc *APIReleaseContract) UnmarshalJSON(body []byte) error { 1344 var m map[string]*json.RawMessage 1345 err := json.Unmarshal(body, &m) 1346 if err != nil { 1347 return err 1348 } 1349 for k, v := range m { 1350 switch k { 1351 case "properties": 1352 if v != nil { 1353 var APIReleaseContractProperties APIReleaseContractProperties 1354 err = json.Unmarshal(*v, &APIReleaseContractProperties) 1355 if err != nil { 1356 return err 1357 } 1358 arc.APIReleaseContractProperties = &APIReleaseContractProperties 1359 } 1360 case "id": 1361 if v != nil { 1362 var ID string 1363 err = json.Unmarshal(*v, &ID) 1364 if err != nil { 1365 return err 1366 } 1367 arc.ID = &ID 1368 } 1369 case "name": 1370 if v != nil { 1371 var name string 1372 err = json.Unmarshal(*v, &name) 1373 if err != nil { 1374 return err 1375 } 1376 arc.Name = &name 1377 } 1378 case "type": 1379 if v != nil { 1380 var typeVar string 1381 err = json.Unmarshal(*v, &typeVar) 1382 if err != nil { 1383 return err 1384 } 1385 arc.Type = &typeVar 1386 } 1387 } 1388 } 1389 1390 return nil 1391} 1392 1393// APIReleaseContractProperties API Release details 1394type APIReleaseContractProperties struct { 1395 // APIID - Identifier of the API the release belongs to. 1396 APIID *string `json:"apiId,omitempty"` 1397 // 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. 1398 CreatedDateTime *date.Time `json:"createdDateTime,omitempty"` 1399 // UpdatedDateTime - READ-ONLY; The time the API release was updated. 1400 UpdatedDateTime *date.Time `json:"updatedDateTime,omitempty"` 1401 // Notes - Release Notes 1402 Notes *string `json:"notes,omitempty"` 1403} 1404 1405// MarshalJSON is the custom marshaler for APIReleaseContractProperties. 1406func (arcp APIReleaseContractProperties) MarshalJSON() ([]byte, error) { 1407 objectMap := make(map[string]interface{}) 1408 if arcp.APIID != nil { 1409 objectMap["apiId"] = arcp.APIID 1410 } 1411 if arcp.Notes != nil { 1412 objectMap["notes"] = arcp.Notes 1413 } 1414 return json.Marshal(objectMap) 1415} 1416 1417// APIRevisionCollection paged Api Revision list representation. 1418type APIRevisionCollection struct { 1419 autorest.Response `json:"-"` 1420 // Value - READ-ONLY; Page values. 1421 Value *[]APIRevisionContract `json:"value,omitempty"` 1422 // Count - Total record count number across all pages. 1423 Count *int64 `json:"count,omitempty"` 1424 // NextLink - READ-ONLY; Next page link if any. 1425 NextLink *string `json:"nextLink,omitempty"` 1426} 1427 1428// MarshalJSON is the custom marshaler for APIRevisionCollection. 1429func (arc APIRevisionCollection) MarshalJSON() ([]byte, error) { 1430 objectMap := make(map[string]interface{}) 1431 if arc.Count != nil { 1432 objectMap["count"] = arc.Count 1433 } 1434 return json.Marshal(objectMap) 1435} 1436 1437// APIRevisionCollectionIterator provides access to a complete listing of APIRevisionContract values. 1438type APIRevisionCollectionIterator struct { 1439 i int 1440 page APIRevisionCollectionPage 1441} 1442 1443// NextWithContext advances to the next value. If there was an error making 1444// the request the iterator does not advance and the error is returned. 1445func (iter *APIRevisionCollectionIterator) NextWithContext(ctx context.Context) (err error) { 1446 if tracing.IsEnabled() { 1447 ctx = tracing.StartSpan(ctx, fqdn+"/APIRevisionCollectionIterator.NextWithContext") 1448 defer func() { 1449 sc := -1 1450 if iter.Response().Response.Response != nil { 1451 sc = iter.Response().Response.Response.StatusCode 1452 } 1453 tracing.EndSpan(ctx, sc, err) 1454 }() 1455 } 1456 iter.i++ 1457 if iter.i < len(iter.page.Values()) { 1458 return nil 1459 } 1460 err = iter.page.NextWithContext(ctx) 1461 if err != nil { 1462 iter.i-- 1463 return err 1464 } 1465 iter.i = 0 1466 return nil 1467} 1468 1469// Next advances to the next value. If there was an error making 1470// the request the iterator does not advance and the error is returned. 1471// Deprecated: Use NextWithContext() instead. 1472func (iter *APIRevisionCollectionIterator) Next() error { 1473 return iter.NextWithContext(context.Background()) 1474} 1475 1476// NotDone returns true if the enumeration should be started or is not yet complete. 1477func (iter APIRevisionCollectionIterator) NotDone() bool { 1478 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 1479} 1480 1481// Response returns the raw server response from the last page request. 1482func (iter APIRevisionCollectionIterator) Response() APIRevisionCollection { 1483 return iter.page.Response() 1484} 1485 1486// Value returns the current value or a zero-initialized value if the 1487// iterator has advanced beyond the end of the collection. 1488func (iter APIRevisionCollectionIterator) Value() APIRevisionContract { 1489 if !iter.page.NotDone() { 1490 return APIRevisionContract{} 1491 } 1492 return iter.page.Values()[iter.i] 1493} 1494 1495// Creates a new instance of the APIRevisionCollectionIterator type. 1496func NewAPIRevisionCollectionIterator(page APIRevisionCollectionPage) APIRevisionCollectionIterator { 1497 return APIRevisionCollectionIterator{page: page} 1498} 1499 1500// IsEmpty returns true if the ListResult contains no values. 1501func (arc APIRevisionCollection) IsEmpty() bool { 1502 return arc.Value == nil || len(*arc.Value) == 0 1503} 1504 1505// hasNextLink returns true if the NextLink is not empty. 1506func (arc APIRevisionCollection) hasNextLink() bool { 1507 return arc.NextLink != nil && len(*arc.NextLink) != 0 1508} 1509 1510// aPIRevisionCollectionPreparer prepares a request to retrieve the next set of results. 1511// It returns nil if no more results exist. 1512func (arc APIRevisionCollection) aPIRevisionCollectionPreparer(ctx context.Context) (*http.Request, error) { 1513 if !arc.hasNextLink() { 1514 return nil, nil 1515 } 1516 return autorest.Prepare((&http.Request{}).WithContext(ctx), 1517 autorest.AsJSON(), 1518 autorest.AsGet(), 1519 autorest.WithBaseURL(to.String(arc.NextLink))) 1520} 1521 1522// APIRevisionCollectionPage contains a page of APIRevisionContract values. 1523type APIRevisionCollectionPage struct { 1524 fn func(context.Context, APIRevisionCollection) (APIRevisionCollection, error) 1525 arc APIRevisionCollection 1526} 1527 1528// NextWithContext advances to the next page of values. If there was an error making 1529// the request the page does not advance and the error is returned. 1530func (page *APIRevisionCollectionPage) NextWithContext(ctx context.Context) (err error) { 1531 if tracing.IsEnabled() { 1532 ctx = tracing.StartSpan(ctx, fqdn+"/APIRevisionCollectionPage.NextWithContext") 1533 defer func() { 1534 sc := -1 1535 if page.Response().Response.Response != nil { 1536 sc = page.Response().Response.Response.StatusCode 1537 } 1538 tracing.EndSpan(ctx, sc, err) 1539 }() 1540 } 1541 for { 1542 next, err := page.fn(ctx, page.arc) 1543 if err != nil { 1544 return err 1545 } 1546 page.arc = next 1547 if !next.hasNextLink() || !next.IsEmpty() { 1548 break 1549 } 1550 } 1551 return nil 1552} 1553 1554// Next advances to the next page of values. If there was an error making 1555// the request the page does not advance and the error is returned. 1556// Deprecated: Use NextWithContext() instead. 1557func (page *APIRevisionCollectionPage) Next() error { 1558 return page.NextWithContext(context.Background()) 1559} 1560 1561// NotDone returns true if the page enumeration should be started or is not yet complete. 1562func (page APIRevisionCollectionPage) NotDone() bool { 1563 return !page.arc.IsEmpty() 1564} 1565 1566// Response returns the raw server response from the last page request. 1567func (page APIRevisionCollectionPage) Response() APIRevisionCollection { 1568 return page.arc 1569} 1570 1571// Values returns the slice of values for the current page or nil if there are no values. 1572func (page APIRevisionCollectionPage) Values() []APIRevisionContract { 1573 if page.arc.IsEmpty() { 1574 return nil 1575 } 1576 return *page.arc.Value 1577} 1578 1579// Creates a new instance of the APIRevisionCollectionPage type. 1580func NewAPIRevisionCollectionPage(cur APIRevisionCollection, getNextPage func(context.Context, APIRevisionCollection) (APIRevisionCollection, error)) APIRevisionCollectionPage { 1581 return APIRevisionCollectionPage{ 1582 fn: getNextPage, 1583 arc: cur, 1584 } 1585} 1586 1587// APIRevisionContract summary of revision metadata. 1588type APIRevisionContract struct { 1589 // APIID - READ-ONLY; Identifier of the API Revision. 1590 APIID *string `json:"apiId,omitempty"` 1591 // APIRevision - READ-ONLY; Revision number of API. 1592 APIRevision *string `json:"apiRevision,omitempty"` 1593 // 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. 1594 CreatedDateTime *date.Time `json:"createdDateTime,omitempty"` 1595 // 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. 1596 UpdatedDateTime *date.Time `json:"updatedDateTime,omitempty"` 1597 // Description - READ-ONLY; Description of the API Revision. 1598 Description *string `json:"description,omitempty"` 1599 // PrivateURL - READ-ONLY; Gateway URL for accessing the non-current API Revision. 1600 PrivateURL *string `json:"privateUrl,omitempty"` 1601 // IsOnline - READ-ONLY; Indicates if API revision is the current api revision. 1602 IsOnline *bool `json:"isOnline,omitempty"` 1603 // IsCurrent - READ-ONLY; Indicates if API revision is accessible via the gateway. 1604 IsCurrent *bool `json:"isCurrent,omitempty"` 1605} 1606 1607// APIRevisionInfoContract object used to create an API Revision or Version based on an existing API 1608// Revision 1609type APIRevisionInfoContract struct { 1610 // SourceAPIID - Resource identifier of API to be used to create the revision from. 1611 SourceAPIID *string `json:"sourceApiId,omitempty"` 1612 // APIVersionName - Version identifier for the new API Version. 1613 APIVersionName *string `json:"apiVersionName,omitempty"` 1614 // APIRevisionDescription - Description of new API Revision. 1615 APIRevisionDescription *string `json:"apiRevisionDescription,omitempty"` 1616 // APIVersionSet - Version set details 1617 APIVersionSet *APIVersionSetContractDetails `json:"apiVersionSet,omitempty"` 1618} 1619 1620// APISchemaCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 1621// operation. 1622type APISchemaCreateOrUpdateFuture struct { 1623 azure.FutureAPI 1624 // Result returns the result of the asynchronous operation. 1625 // If the operation has not completed it will return an error. 1626 Result func(APISchemaClient) (SchemaContract, error) 1627} 1628 1629// APITagResourceContractProperties API contract properties for the Tag Resources. 1630type APITagResourceContractProperties struct { 1631 // ID - API identifier in the form /apis/{apiId}. 1632 ID *string `json:"id,omitempty"` 1633 // Name - API name. 1634 Name *string `json:"name,omitempty"` 1635 // ServiceURL - Absolute URL of the backend service implementing this API. 1636 ServiceURL *string `json:"serviceUrl,omitempty"` 1637 // 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. 1638 Path *string `json:"path,omitempty"` 1639 // Protocols - Describes on which protocols the operations in this API can be invoked. 1640 Protocols *[]Protocol `json:"protocols,omitempty"` 1641 // Description - Description of the API. May include HTML formatting tags. 1642 Description *string `json:"description,omitempty"` 1643 // AuthenticationSettings - Collection of authentication settings included into this API. 1644 AuthenticationSettings *AuthenticationSettingsContract `json:"authenticationSettings,omitempty"` 1645 // SubscriptionKeyParameterNames - Protocols over which API is made available. 1646 SubscriptionKeyParameterNames *SubscriptionKeyParameterNamesContract `json:"subscriptionKeyParameterNames,omitempty"` 1647 // APIType - Type of API. Possible values include: 'HTTP', 'Soap' 1648 APIType APIType `json:"type,omitempty"` 1649 // APIRevision - Describes the Revision of the Api. If no value is provided, default revision 1 is created 1650 APIRevision *string `json:"apiRevision,omitempty"` 1651 // APIVersion - Indicates the Version identifier of the API if the API is versioned 1652 APIVersion *string `json:"apiVersion,omitempty"` 1653 // IsCurrent - Indicates if API revision is current api revision. 1654 IsCurrent *bool `json:"isCurrent,omitempty"` 1655 // IsOnline - READ-ONLY; Indicates if API revision is accessible via the gateway. 1656 IsOnline *bool `json:"isOnline,omitempty"` 1657 // APIRevisionDescription - Description of the Api Revision. 1658 APIRevisionDescription *string `json:"apiRevisionDescription,omitempty"` 1659 // APIVersionDescription - Description of the Api Version. 1660 APIVersionDescription *string `json:"apiVersionDescription,omitempty"` 1661 // APIVersionSetID - A resource identifier for the related ApiVersionSet. 1662 APIVersionSetID *string `json:"apiVersionSetId,omitempty"` 1663 // SubscriptionRequired - Specifies whether an API or Product subscription is required for accessing the API. 1664 SubscriptionRequired *bool `json:"subscriptionRequired,omitempty"` 1665} 1666 1667// MarshalJSON is the custom marshaler for APITagResourceContractProperties. 1668func (atrcp APITagResourceContractProperties) MarshalJSON() ([]byte, error) { 1669 objectMap := make(map[string]interface{}) 1670 if atrcp.ID != nil { 1671 objectMap["id"] = atrcp.ID 1672 } 1673 if atrcp.Name != nil { 1674 objectMap["name"] = atrcp.Name 1675 } 1676 if atrcp.ServiceURL != nil { 1677 objectMap["serviceUrl"] = atrcp.ServiceURL 1678 } 1679 if atrcp.Path != nil { 1680 objectMap["path"] = atrcp.Path 1681 } 1682 if atrcp.Protocols != nil { 1683 objectMap["protocols"] = atrcp.Protocols 1684 } 1685 if atrcp.Description != nil { 1686 objectMap["description"] = atrcp.Description 1687 } 1688 if atrcp.AuthenticationSettings != nil { 1689 objectMap["authenticationSettings"] = atrcp.AuthenticationSettings 1690 } 1691 if atrcp.SubscriptionKeyParameterNames != nil { 1692 objectMap["subscriptionKeyParameterNames"] = atrcp.SubscriptionKeyParameterNames 1693 } 1694 if atrcp.APIType != "" { 1695 objectMap["type"] = atrcp.APIType 1696 } 1697 if atrcp.APIRevision != nil { 1698 objectMap["apiRevision"] = atrcp.APIRevision 1699 } 1700 if atrcp.APIVersion != nil { 1701 objectMap["apiVersion"] = atrcp.APIVersion 1702 } 1703 if atrcp.IsCurrent != nil { 1704 objectMap["isCurrent"] = atrcp.IsCurrent 1705 } 1706 if atrcp.APIRevisionDescription != nil { 1707 objectMap["apiRevisionDescription"] = atrcp.APIRevisionDescription 1708 } 1709 if atrcp.APIVersionDescription != nil { 1710 objectMap["apiVersionDescription"] = atrcp.APIVersionDescription 1711 } 1712 if atrcp.APIVersionSetID != nil { 1713 objectMap["apiVersionSetId"] = atrcp.APIVersionSetID 1714 } 1715 if atrcp.SubscriptionRequired != nil { 1716 objectMap["subscriptionRequired"] = atrcp.SubscriptionRequired 1717 } 1718 return json.Marshal(objectMap) 1719} 1720 1721// APIUpdateContract API update contract details. 1722type APIUpdateContract struct { 1723 // APIContractUpdateProperties - Properties of the API entity that can be updated. 1724 *APIContractUpdateProperties `json:"properties,omitempty"` 1725} 1726 1727// MarshalJSON is the custom marshaler for APIUpdateContract. 1728func (auc APIUpdateContract) MarshalJSON() ([]byte, error) { 1729 objectMap := make(map[string]interface{}) 1730 if auc.APIContractUpdateProperties != nil { 1731 objectMap["properties"] = auc.APIContractUpdateProperties 1732 } 1733 return json.Marshal(objectMap) 1734} 1735 1736// UnmarshalJSON is the custom unmarshaler for APIUpdateContract struct. 1737func (auc *APIUpdateContract) UnmarshalJSON(body []byte) error { 1738 var m map[string]*json.RawMessage 1739 err := json.Unmarshal(body, &m) 1740 if err != nil { 1741 return err 1742 } 1743 for k, v := range m { 1744 switch k { 1745 case "properties": 1746 if v != nil { 1747 var APIContractUpdateProperties APIContractUpdateProperties 1748 err = json.Unmarshal(*v, &APIContractUpdateProperties) 1749 if err != nil { 1750 return err 1751 } 1752 auc.APIContractUpdateProperties = &APIContractUpdateProperties 1753 } 1754 } 1755 } 1756 1757 return nil 1758} 1759 1760// APIVersionConstraint control Plane Apis version constraint for the API Management service. 1761type APIVersionConstraint struct { 1762 // MinAPIVersion - Limit control plane API calls to API Management service with version equal to or newer than this value. 1763 MinAPIVersion *string `json:"minApiVersion,omitempty"` 1764} 1765 1766// APIVersionSetCollection paged Api Version Set list representation. 1767type APIVersionSetCollection struct { 1768 autorest.Response `json:"-"` 1769 // Value - Page values. 1770 Value *[]APIVersionSetContract `json:"value,omitempty"` 1771 // Count - Total record count number across all pages. 1772 Count *int64 `json:"count,omitempty"` 1773 // NextLink - Next page link if any. 1774 NextLink *string `json:"nextLink,omitempty"` 1775} 1776 1777// APIVersionSetCollectionIterator provides access to a complete listing of APIVersionSetContract values. 1778type APIVersionSetCollectionIterator struct { 1779 i int 1780 page APIVersionSetCollectionPage 1781} 1782 1783// NextWithContext advances to the next value. If there was an error making 1784// the request the iterator does not advance and the error is returned. 1785func (iter *APIVersionSetCollectionIterator) NextWithContext(ctx context.Context) (err error) { 1786 if tracing.IsEnabled() { 1787 ctx = tracing.StartSpan(ctx, fqdn+"/APIVersionSetCollectionIterator.NextWithContext") 1788 defer func() { 1789 sc := -1 1790 if iter.Response().Response.Response != nil { 1791 sc = iter.Response().Response.Response.StatusCode 1792 } 1793 tracing.EndSpan(ctx, sc, err) 1794 }() 1795 } 1796 iter.i++ 1797 if iter.i < len(iter.page.Values()) { 1798 return nil 1799 } 1800 err = iter.page.NextWithContext(ctx) 1801 if err != nil { 1802 iter.i-- 1803 return err 1804 } 1805 iter.i = 0 1806 return nil 1807} 1808 1809// Next advances to the next value. If there was an error making 1810// the request the iterator does not advance and the error is returned. 1811// Deprecated: Use NextWithContext() instead. 1812func (iter *APIVersionSetCollectionIterator) Next() error { 1813 return iter.NextWithContext(context.Background()) 1814} 1815 1816// NotDone returns true if the enumeration should be started or is not yet complete. 1817func (iter APIVersionSetCollectionIterator) NotDone() bool { 1818 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 1819} 1820 1821// Response returns the raw server response from the last page request. 1822func (iter APIVersionSetCollectionIterator) Response() APIVersionSetCollection { 1823 return iter.page.Response() 1824} 1825 1826// Value returns the current value or a zero-initialized value if the 1827// iterator has advanced beyond the end of the collection. 1828func (iter APIVersionSetCollectionIterator) Value() APIVersionSetContract { 1829 if !iter.page.NotDone() { 1830 return APIVersionSetContract{} 1831 } 1832 return iter.page.Values()[iter.i] 1833} 1834 1835// Creates a new instance of the APIVersionSetCollectionIterator type. 1836func NewAPIVersionSetCollectionIterator(page APIVersionSetCollectionPage) APIVersionSetCollectionIterator { 1837 return APIVersionSetCollectionIterator{page: page} 1838} 1839 1840// IsEmpty returns true if the ListResult contains no values. 1841func (avsc APIVersionSetCollection) IsEmpty() bool { 1842 return avsc.Value == nil || len(*avsc.Value) == 0 1843} 1844 1845// hasNextLink returns true if the NextLink is not empty. 1846func (avsc APIVersionSetCollection) hasNextLink() bool { 1847 return avsc.NextLink != nil && len(*avsc.NextLink) != 0 1848} 1849 1850// aPIVersionSetCollectionPreparer prepares a request to retrieve the next set of results. 1851// It returns nil if no more results exist. 1852func (avsc APIVersionSetCollection) aPIVersionSetCollectionPreparer(ctx context.Context) (*http.Request, error) { 1853 if !avsc.hasNextLink() { 1854 return nil, nil 1855 } 1856 return autorest.Prepare((&http.Request{}).WithContext(ctx), 1857 autorest.AsJSON(), 1858 autorest.AsGet(), 1859 autorest.WithBaseURL(to.String(avsc.NextLink))) 1860} 1861 1862// APIVersionSetCollectionPage contains a page of APIVersionSetContract values. 1863type APIVersionSetCollectionPage struct { 1864 fn func(context.Context, APIVersionSetCollection) (APIVersionSetCollection, error) 1865 avsc APIVersionSetCollection 1866} 1867 1868// NextWithContext advances to the next page of values. If there was an error making 1869// the request the page does not advance and the error is returned. 1870func (page *APIVersionSetCollectionPage) NextWithContext(ctx context.Context) (err error) { 1871 if tracing.IsEnabled() { 1872 ctx = tracing.StartSpan(ctx, fqdn+"/APIVersionSetCollectionPage.NextWithContext") 1873 defer func() { 1874 sc := -1 1875 if page.Response().Response.Response != nil { 1876 sc = page.Response().Response.Response.StatusCode 1877 } 1878 tracing.EndSpan(ctx, sc, err) 1879 }() 1880 } 1881 for { 1882 next, err := page.fn(ctx, page.avsc) 1883 if err != nil { 1884 return err 1885 } 1886 page.avsc = next 1887 if !next.hasNextLink() || !next.IsEmpty() { 1888 break 1889 } 1890 } 1891 return nil 1892} 1893 1894// Next advances to the next page of values. If there was an error making 1895// the request the page does not advance and the error is returned. 1896// Deprecated: Use NextWithContext() instead. 1897func (page *APIVersionSetCollectionPage) Next() error { 1898 return page.NextWithContext(context.Background()) 1899} 1900 1901// NotDone returns true if the page enumeration should be started or is not yet complete. 1902func (page APIVersionSetCollectionPage) NotDone() bool { 1903 return !page.avsc.IsEmpty() 1904} 1905 1906// Response returns the raw server response from the last page request. 1907func (page APIVersionSetCollectionPage) Response() APIVersionSetCollection { 1908 return page.avsc 1909} 1910 1911// Values returns the slice of values for the current page or nil if there are no values. 1912func (page APIVersionSetCollectionPage) Values() []APIVersionSetContract { 1913 if page.avsc.IsEmpty() { 1914 return nil 1915 } 1916 return *page.avsc.Value 1917} 1918 1919// Creates a new instance of the APIVersionSetCollectionPage type. 1920func NewAPIVersionSetCollectionPage(cur APIVersionSetCollection, getNextPage func(context.Context, APIVersionSetCollection) (APIVersionSetCollection, error)) APIVersionSetCollectionPage { 1921 return APIVersionSetCollectionPage{ 1922 fn: getNextPage, 1923 avsc: cur, 1924 } 1925} 1926 1927// APIVersionSetContract api Version Set Contract details. 1928type APIVersionSetContract struct { 1929 autorest.Response `json:"-"` 1930 // APIVersionSetContractProperties - Api VersionSet contract properties. 1931 *APIVersionSetContractProperties `json:"properties,omitempty"` 1932 // ID - READ-ONLY; Resource ID. 1933 ID *string `json:"id,omitempty"` 1934 // Name - READ-ONLY; Resource name. 1935 Name *string `json:"name,omitempty"` 1936 // Type - READ-ONLY; Resource type for API Management resource. 1937 Type *string `json:"type,omitempty"` 1938} 1939 1940// MarshalJSON is the custom marshaler for APIVersionSetContract. 1941func (avsc APIVersionSetContract) MarshalJSON() ([]byte, error) { 1942 objectMap := make(map[string]interface{}) 1943 if avsc.APIVersionSetContractProperties != nil { 1944 objectMap["properties"] = avsc.APIVersionSetContractProperties 1945 } 1946 return json.Marshal(objectMap) 1947} 1948 1949// UnmarshalJSON is the custom unmarshaler for APIVersionSetContract struct. 1950func (avsc *APIVersionSetContract) UnmarshalJSON(body []byte) error { 1951 var m map[string]*json.RawMessage 1952 err := json.Unmarshal(body, &m) 1953 if err != nil { 1954 return err 1955 } 1956 for k, v := range m { 1957 switch k { 1958 case "properties": 1959 if v != nil { 1960 var APIVersionSetContractProperties APIVersionSetContractProperties 1961 err = json.Unmarshal(*v, &APIVersionSetContractProperties) 1962 if err != nil { 1963 return err 1964 } 1965 avsc.APIVersionSetContractProperties = &APIVersionSetContractProperties 1966 } 1967 case "id": 1968 if v != nil { 1969 var ID string 1970 err = json.Unmarshal(*v, &ID) 1971 if err != nil { 1972 return err 1973 } 1974 avsc.ID = &ID 1975 } 1976 case "name": 1977 if v != nil { 1978 var name string 1979 err = json.Unmarshal(*v, &name) 1980 if err != nil { 1981 return err 1982 } 1983 avsc.Name = &name 1984 } 1985 case "type": 1986 if v != nil { 1987 var typeVar string 1988 err = json.Unmarshal(*v, &typeVar) 1989 if err != nil { 1990 return err 1991 } 1992 avsc.Type = &typeVar 1993 } 1994 } 1995 } 1996 1997 return nil 1998} 1999 2000// APIVersionSetContractDetails an API Version Set contains the common configuration for a set of API 2001// Versions relating 2002type APIVersionSetContractDetails struct { 2003 // ID - Identifier for existing API Version Set. Omit this value to create a new Version Set. 2004 ID *string `json:"id,omitempty"` 2005 // Name - The display Name of the API Version Set. 2006 Name *string `json:"name,omitempty"` 2007 // Description - Description of API Version Set. 2008 Description *string `json:"description,omitempty"` 2009 // VersioningScheme - An value that determines where the API Version identifier will be located in a HTTP request. Possible values include: 'VersioningScheme1Segment', 'VersioningScheme1Query', 'VersioningScheme1Header' 2010 VersioningScheme VersioningScheme1 `json:"versioningScheme,omitempty"` 2011 // VersionQueryName - Name of query parameter that indicates the API Version if versioningScheme is set to `query`. 2012 VersionQueryName *string `json:"versionQueryName,omitempty"` 2013 // VersionHeaderName - Name of HTTP header parameter that indicates the API Version if versioningScheme is set to `header`. 2014 VersionHeaderName *string `json:"versionHeaderName,omitempty"` 2015} 2016 2017// APIVersionSetContractProperties properties of an API Version Set. 2018type APIVersionSetContractProperties struct { 2019 // DisplayName - Name of API Version Set 2020 DisplayName *string `json:"displayName,omitempty"` 2021 // VersioningScheme - An value that determines where the API Version identifier will be located in a HTTP request. Possible values include: 'VersioningSchemeSegment', 'VersioningSchemeQuery', 'VersioningSchemeHeader' 2022 VersioningScheme VersioningScheme `json:"versioningScheme,omitempty"` 2023 // Description - Description of API Version Set. 2024 Description *string `json:"description,omitempty"` 2025 // VersionQueryName - Name of query parameter that indicates the API Version if versioningScheme is set to `query`. 2026 VersionQueryName *string `json:"versionQueryName,omitempty"` 2027 // VersionHeaderName - Name of HTTP header parameter that indicates the API Version if versioningScheme is set to `header`. 2028 VersionHeaderName *string `json:"versionHeaderName,omitempty"` 2029} 2030 2031// APIVersionSetEntityBase api Version set base parameters 2032type APIVersionSetEntityBase struct { 2033 // Description - Description of API Version Set. 2034 Description *string `json:"description,omitempty"` 2035 // VersionQueryName - Name of query parameter that indicates the API Version if versioningScheme is set to `query`. 2036 VersionQueryName *string `json:"versionQueryName,omitempty"` 2037 // VersionHeaderName - Name of HTTP header parameter that indicates the API Version if versioningScheme is set to `header`. 2038 VersionHeaderName *string `json:"versionHeaderName,omitempty"` 2039} 2040 2041// APIVersionSetUpdateParameters parameters to update or create an Api Version Set Contract. 2042type APIVersionSetUpdateParameters struct { 2043 // APIVersionSetUpdateParametersProperties - Parameters to update or create an Api Version Set Contract. 2044 *APIVersionSetUpdateParametersProperties `json:"properties,omitempty"` 2045} 2046 2047// MarshalJSON is the custom marshaler for APIVersionSetUpdateParameters. 2048func (avsup APIVersionSetUpdateParameters) MarshalJSON() ([]byte, error) { 2049 objectMap := make(map[string]interface{}) 2050 if avsup.APIVersionSetUpdateParametersProperties != nil { 2051 objectMap["properties"] = avsup.APIVersionSetUpdateParametersProperties 2052 } 2053 return json.Marshal(objectMap) 2054} 2055 2056// UnmarshalJSON is the custom unmarshaler for APIVersionSetUpdateParameters struct. 2057func (avsup *APIVersionSetUpdateParameters) UnmarshalJSON(body []byte) error { 2058 var m map[string]*json.RawMessage 2059 err := json.Unmarshal(body, &m) 2060 if err != nil { 2061 return err 2062 } 2063 for k, v := range m { 2064 switch k { 2065 case "properties": 2066 if v != nil { 2067 var APIVersionSetUpdateParametersProperties APIVersionSetUpdateParametersProperties 2068 err = json.Unmarshal(*v, &APIVersionSetUpdateParametersProperties) 2069 if err != nil { 2070 return err 2071 } 2072 avsup.APIVersionSetUpdateParametersProperties = &APIVersionSetUpdateParametersProperties 2073 } 2074 } 2075 } 2076 2077 return nil 2078} 2079 2080// APIVersionSetUpdateParametersProperties properties used to create or update an API Version Set. 2081type APIVersionSetUpdateParametersProperties 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// AssociationContract association entity details. 2095type AssociationContract struct { 2096 // AssociationContractProperties - Association entity contract properties. 2097 *AssociationContractProperties `json:"properties,omitempty"` 2098 // ID - READ-ONLY; Resource ID. 2099 ID *string `json:"id,omitempty"` 2100 // Name - READ-ONLY; Resource name. 2101 Name *string `json:"name,omitempty"` 2102 // Type - READ-ONLY; Resource type for API Management resource. 2103 Type *string `json:"type,omitempty"` 2104} 2105 2106// MarshalJSON is the custom marshaler for AssociationContract. 2107func (ac AssociationContract) MarshalJSON() ([]byte, error) { 2108 objectMap := make(map[string]interface{}) 2109 if ac.AssociationContractProperties != nil { 2110 objectMap["properties"] = ac.AssociationContractProperties 2111 } 2112 return json.Marshal(objectMap) 2113} 2114 2115// UnmarshalJSON is the custom unmarshaler for AssociationContract struct. 2116func (ac *AssociationContract) UnmarshalJSON(body []byte) error { 2117 var m map[string]*json.RawMessage 2118 err := json.Unmarshal(body, &m) 2119 if err != nil { 2120 return err 2121 } 2122 for k, v := range m { 2123 switch k { 2124 case "properties": 2125 if v != nil { 2126 var associationContractProperties AssociationContractProperties 2127 err = json.Unmarshal(*v, &associationContractProperties) 2128 if err != nil { 2129 return err 2130 } 2131 ac.AssociationContractProperties = &associationContractProperties 2132 } 2133 case "id": 2134 if v != nil { 2135 var ID string 2136 err = json.Unmarshal(*v, &ID) 2137 if err != nil { 2138 return err 2139 } 2140 ac.ID = &ID 2141 } 2142 case "name": 2143 if v != nil { 2144 var name string 2145 err = json.Unmarshal(*v, &name) 2146 if err != nil { 2147 return err 2148 } 2149 ac.Name = &name 2150 } 2151 case "type": 2152 if v != nil { 2153 var typeVar string 2154 err = json.Unmarshal(*v, &typeVar) 2155 if err != nil { 2156 return err 2157 } 2158 ac.Type = &typeVar 2159 } 2160 } 2161 } 2162 2163 return nil 2164} 2165 2166// AssociationContractProperties association entity contract properties. 2167type AssociationContractProperties struct { 2168 // ProvisioningState - Provisioning state. Possible values include: 'Created' 2169 ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` 2170} 2171 2172// AuthenticationSettingsContract API Authentication Settings. 2173type AuthenticationSettingsContract struct { 2174 // OAuth2 - OAuth2 Authentication settings 2175 OAuth2 *OAuth2AuthenticationSettingsContract `json:"oAuth2,omitempty"` 2176 // Openid - OpenID Connect Authentication Settings 2177 Openid *OpenIDAuthenticationSettingsContract `json:"openid,omitempty"` 2178} 2179 2180// AuthorizationServerCollection paged OAuth2 Authorization Servers list representation. 2181type AuthorizationServerCollection struct { 2182 autorest.Response `json:"-"` 2183 // Value - Page values. 2184 Value *[]AuthorizationServerContract `json:"value,omitempty"` 2185 // Count - Total record count number across all pages. 2186 Count *int64 `json:"count,omitempty"` 2187 // NextLink - Next page link if any. 2188 NextLink *string `json:"nextLink,omitempty"` 2189} 2190 2191// AuthorizationServerCollectionIterator provides access to a complete listing of 2192// AuthorizationServerContract values. 2193type AuthorizationServerCollectionIterator struct { 2194 i int 2195 page AuthorizationServerCollectionPage 2196} 2197 2198// NextWithContext advances to the next value. If there was an error making 2199// the request the iterator does not advance and the error is returned. 2200func (iter *AuthorizationServerCollectionIterator) NextWithContext(ctx context.Context) (err error) { 2201 if tracing.IsEnabled() { 2202 ctx = tracing.StartSpan(ctx, fqdn+"/AuthorizationServerCollectionIterator.NextWithContext") 2203 defer func() { 2204 sc := -1 2205 if iter.Response().Response.Response != nil { 2206 sc = iter.Response().Response.Response.StatusCode 2207 } 2208 tracing.EndSpan(ctx, sc, err) 2209 }() 2210 } 2211 iter.i++ 2212 if iter.i < len(iter.page.Values()) { 2213 return nil 2214 } 2215 err = iter.page.NextWithContext(ctx) 2216 if err != nil { 2217 iter.i-- 2218 return err 2219 } 2220 iter.i = 0 2221 return nil 2222} 2223 2224// Next advances to the next value. If there was an error making 2225// the request the iterator does not advance and the error is returned. 2226// Deprecated: Use NextWithContext() instead. 2227func (iter *AuthorizationServerCollectionIterator) Next() error { 2228 return iter.NextWithContext(context.Background()) 2229} 2230 2231// NotDone returns true if the enumeration should be started or is not yet complete. 2232func (iter AuthorizationServerCollectionIterator) NotDone() bool { 2233 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 2234} 2235 2236// Response returns the raw server response from the last page request. 2237func (iter AuthorizationServerCollectionIterator) Response() AuthorizationServerCollection { 2238 return iter.page.Response() 2239} 2240 2241// Value returns the current value or a zero-initialized value if the 2242// iterator has advanced beyond the end of the collection. 2243func (iter AuthorizationServerCollectionIterator) Value() AuthorizationServerContract { 2244 if !iter.page.NotDone() { 2245 return AuthorizationServerContract{} 2246 } 2247 return iter.page.Values()[iter.i] 2248} 2249 2250// Creates a new instance of the AuthorizationServerCollectionIterator type. 2251func NewAuthorizationServerCollectionIterator(page AuthorizationServerCollectionPage) AuthorizationServerCollectionIterator { 2252 return AuthorizationServerCollectionIterator{page: page} 2253} 2254 2255// IsEmpty returns true if the ListResult contains no values. 2256func (asc AuthorizationServerCollection) IsEmpty() bool { 2257 return asc.Value == nil || len(*asc.Value) == 0 2258} 2259 2260// hasNextLink returns true if the NextLink is not empty. 2261func (asc AuthorizationServerCollection) hasNextLink() bool { 2262 return asc.NextLink != nil && len(*asc.NextLink) != 0 2263} 2264 2265// authorizationServerCollectionPreparer prepares a request to retrieve the next set of results. 2266// It returns nil if no more results exist. 2267func (asc AuthorizationServerCollection) authorizationServerCollectionPreparer(ctx context.Context) (*http.Request, error) { 2268 if !asc.hasNextLink() { 2269 return nil, nil 2270 } 2271 return autorest.Prepare((&http.Request{}).WithContext(ctx), 2272 autorest.AsJSON(), 2273 autorest.AsGet(), 2274 autorest.WithBaseURL(to.String(asc.NextLink))) 2275} 2276 2277// AuthorizationServerCollectionPage contains a page of AuthorizationServerContract values. 2278type AuthorizationServerCollectionPage struct { 2279 fn func(context.Context, AuthorizationServerCollection) (AuthorizationServerCollection, error) 2280 asc AuthorizationServerCollection 2281} 2282 2283// NextWithContext advances to the next page of values. If there was an error making 2284// the request the page does not advance and the error is returned. 2285func (page *AuthorizationServerCollectionPage) NextWithContext(ctx context.Context) (err error) { 2286 if tracing.IsEnabled() { 2287 ctx = tracing.StartSpan(ctx, fqdn+"/AuthorizationServerCollectionPage.NextWithContext") 2288 defer func() { 2289 sc := -1 2290 if page.Response().Response.Response != nil { 2291 sc = page.Response().Response.Response.StatusCode 2292 } 2293 tracing.EndSpan(ctx, sc, err) 2294 }() 2295 } 2296 for { 2297 next, err := page.fn(ctx, page.asc) 2298 if err != nil { 2299 return err 2300 } 2301 page.asc = next 2302 if !next.hasNextLink() || !next.IsEmpty() { 2303 break 2304 } 2305 } 2306 return nil 2307} 2308 2309// Next advances to the next page of values. If there was an error making 2310// the request the page does not advance and the error is returned. 2311// Deprecated: Use NextWithContext() instead. 2312func (page *AuthorizationServerCollectionPage) Next() error { 2313 return page.NextWithContext(context.Background()) 2314} 2315 2316// NotDone returns true if the page enumeration should be started or is not yet complete. 2317func (page AuthorizationServerCollectionPage) NotDone() bool { 2318 return !page.asc.IsEmpty() 2319} 2320 2321// Response returns the raw server response from the last page request. 2322func (page AuthorizationServerCollectionPage) Response() AuthorizationServerCollection { 2323 return page.asc 2324} 2325 2326// Values returns the slice of values for the current page or nil if there are no values. 2327func (page AuthorizationServerCollectionPage) Values() []AuthorizationServerContract { 2328 if page.asc.IsEmpty() { 2329 return nil 2330 } 2331 return *page.asc.Value 2332} 2333 2334// Creates a new instance of the AuthorizationServerCollectionPage type. 2335func NewAuthorizationServerCollectionPage(cur AuthorizationServerCollection, getNextPage func(context.Context, AuthorizationServerCollection) (AuthorizationServerCollection, error)) AuthorizationServerCollectionPage { 2336 return AuthorizationServerCollectionPage{ 2337 fn: getNextPage, 2338 asc: cur, 2339 } 2340} 2341 2342// AuthorizationServerContract external OAuth authorization server settings. 2343type AuthorizationServerContract struct { 2344 autorest.Response `json:"-"` 2345 // AuthorizationServerContractProperties - Properties of the External OAuth authorization server Contract. 2346 *AuthorizationServerContractProperties `json:"properties,omitempty"` 2347 // ID - READ-ONLY; Resource ID. 2348 ID *string `json:"id,omitempty"` 2349 // Name - READ-ONLY; Resource name. 2350 Name *string `json:"name,omitempty"` 2351 // Type - READ-ONLY; Resource type for API Management resource. 2352 Type *string `json:"type,omitempty"` 2353} 2354 2355// MarshalJSON is the custom marshaler for AuthorizationServerContract. 2356func (asc AuthorizationServerContract) MarshalJSON() ([]byte, error) { 2357 objectMap := make(map[string]interface{}) 2358 if asc.AuthorizationServerContractProperties != nil { 2359 objectMap["properties"] = asc.AuthorizationServerContractProperties 2360 } 2361 return json.Marshal(objectMap) 2362} 2363 2364// UnmarshalJSON is the custom unmarshaler for AuthorizationServerContract struct. 2365func (asc *AuthorizationServerContract) UnmarshalJSON(body []byte) error { 2366 var m map[string]*json.RawMessage 2367 err := json.Unmarshal(body, &m) 2368 if err != nil { 2369 return err 2370 } 2371 for k, v := range m { 2372 switch k { 2373 case "properties": 2374 if v != nil { 2375 var authorizationServerContractProperties AuthorizationServerContractProperties 2376 err = json.Unmarshal(*v, &authorizationServerContractProperties) 2377 if err != nil { 2378 return err 2379 } 2380 asc.AuthorizationServerContractProperties = &authorizationServerContractProperties 2381 } 2382 case "id": 2383 if v != nil { 2384 var ID string 2385 err = json.Unmarshal(*v, &ID) 2386 if err != nil { 2387 return err 2388 } 2389 asc.ID = &ID 2390 } 2391 case "name": 2392 if v != nil { 2393 var name string 2394 err = json.Unmarshal(*v, &name) 2395 if err != nil { 2396 return err 2397 } 2398 asc.Name = &name 2399 } 2400 case "type": 2401 if v != nil { 2402 var typeVar string 2403 err = json.Unmarshal(*v, &typeVar) 2404 if err != nil { 2405 return err 2406 } 2407 asc.Type = &typeVar 2408 } 2409 } 2410 } 2411 2412 return nil 2413} 2414 2415// AuthorizationServerContractBaseProperties external OAuth authorization server Update settings contract. 2416type AuthorizationServerContractBaseProperties struct { 2417 // Description - Description of the authorization server. Can contain HTML formatting tags. 2418 Description *string `json:"description,omitempty"` 2419 // AuthorizationMethods - HTTP verbs supported by the authorization endpoint. GET must be always present. POST is optional. 2420 AuthorizationMethods *[]AuthorizationMethod `json:"authorizationMethods,omitempty"` 2421 // 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. 2422 ClientAuthenticationMethod *[]ClientAuthenticationMethod `json:"clientAuthenticationMethod,omitempty"` 2423 // 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"}. 2424 TokenBodyParameters *[]TokenBodyParameterContract `json:"tokenBodyParameters,omitempty"` 2425 // TokenEndpoint - OAuth token endpoint. Contains absolute URI to entity being referenced. 2426 TokenEndpoint *string `json:"tokenEndpoint,omitempty"` 2427 // 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. 2428 SupportState *bool `json:"supportState,omitempty"` 2429 // 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. 2430 DefaultScope *string `json:"defaultScope,omitempty"` 2431 // BearerTokenSendingMethods - Specifies the mechanism by which access token is passed to the API. 2432 BearerTokenSendingMethods *[]BearerTokenSendingMethod `json:"bearerTokenSendingMethods,omitempty"` 2433 // ResourceOwnerUsername - Can be optionally specified when resource owner password grant type is supported by this authorization server. Default resource owner username. 2434 ResourceOwnerUsername *string `json:"resourceOwnerUsername,omitempty"` 2435 // ResourceOwnerPassword - Can be optionally specified when resource owner password grant type is supported by this authorization server. Default resource owner password. 2436 ResourceOwnerPassword *string `json:"resourceOwnerPassword,omitempty"` 2437} 2438 2439// AuthorizationServerContractProperties external OAuth authorization server settings Properties. 2440type AuthorizationServerContractProperties struct { 2441 // DisplayName - User-friendly authorization server name. 2442 DisplayName *string `json:"displayName,omitempty"` 2443 // ClientRegistrationEndpoint - Optional reference to a page where client or app registration for this authorization server is performed. Contains absolute URL to entity being referenced. 2444 ClientRegistrationEndpoint *string `json:"clientRegistrationEndpoint,omitempty"` 2445 // AuthorizationEndpoint - OAuth authorization endpoint. See http://tools.ietf.org/html/rfc6749#section-3.2. 2446 AuthorizationEndpoint *string `json:"authorizationEndpoint,omitempty"` 2447 // GrantTypes - Form of an authorization grant, which the client uses to request the access token. 2448 GrantTypes *[]GrantType `json:"grantTypes,omitempty"` 2449 // ClientID - Client or app id registered with this authorization server. 2450 ClientID *string `json:"clientId,omitempty"` 2451 // 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. 2452 ClientSecret *string `json:"clientSecret,omitempty"` 2453 // Description - Description of the authorization server. Can contain HTML formatting tags. 2454 Description *string `json:"description,omitempty"` 2455 // AuthorizationMethods - HTTP verbs supported by the authorization endpoint. GET must be always present. POST is optional. 2456 AuthorizationMethods *[]AuthorizationMethod `json:"authorizationMethods,omitempty"` 2457 // 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. 2458 ClientAuthenticationMethod *[]ClientAuthenticationMethod `json:"clientAuthenticationMethod,omitempty"` 2459 // 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"}. 2460 TokenBodyParameters *[]TokenBodyParameterContract `json:"tokenBodyParameters,omitempty"` 2461 // TokenEndpoint - OAuth token endpoint. Contains absolute URI to entity being referenced. 2462 TokenEndpoint *string `json:"tokenEndpoint,omitempty"` 2463 // 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. 2464 SupportState *bool `json:"supportState,omitempty"` 2465 // 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. 2466 DefaultScope *string `json:"defaultScope,omitempty"` 2467 // BearerTokenSendingMethods - Specifies the mechanism by which access token is passed to the API. 2468 BearerTokenSendingMethods *[]BearerTokenSendingMethod `json:"bearerTokenSendingMethods,omitempty"` 2469 // ResourceOwnerUsername - Can be optionally specified when resource owner password grant type is supported by this authorization server. Default resource owner username. 2470 ResourceOwnerUsername *string `json:"resourceOwnerUsername,omitempty"` 2471 // ResourceOwnerPassword - Can be optionally specified when resource owner password grant type is supported by this authorization server. Default resource owner password. 2472 ResourceOwnerPassword *string `json:"resourceOwnerPassword,omitempty"` 2473} 2474 2475// AuthorizationServerSecretsContract oAuth Server Secrets Contract. 2476type AuthorizationServerSecretsContract struct { 2477 autorest.Response `json:"-"` 2478 // ClientSecret - oAuth Authorization Server Secrets. 2479 ClientSecret *string `json:"clientSecret,omitempty"` 2480 // ResourceOwnerUsername - Can be optionally specified when resource owner password grant type is supported by this authorization server. Default resource owner username. 2481 ResourceOwnerUsername *string `json:"resourceOwnerUsername,omitempty"` 2482 // ResourceOwnerPassword - Can be optionally specified when resource owner password grant type is supported by this authorization server. Default resource owner password. 2483 ResourceOwnerPassword *string `json:"resourceOwnerPassword,omitempty"` 2484} 2485 2486// AuthorizationServerUpdateContract external OAuth authorization server settings. 2487type AuthorizationServerUpdateContract struct { 2488 // AuthorizationServerUpdateContractProperties - Properties of the External OAuth authorization server update Contract. 2489 *AuthorizationServerUpdateContractProperties `json:"properties,omitempty"` 2490 // ID - READ-ONLY; Resource ID. 2491 ID *string `json:"id,omitempty"` 2492 // Name - READ-ONLY; Resource name. 2493 Name *string `json:"name,omitempty"` 2494 // Type - READ-ONLY; Resource type for API Management resource. 2495 Type *string `json:"type,omitempty"` 2496} 2497 2498// MarshalJSON is the custom marshaler for AuthorizationServerUpdateContract. 2499func (asuc AuthorizationServerUpdateContract) MarshalJSON() ([]byte, error) { 2500 objectMap := make(map[string]interface{}) 2501 if asuc.AuthorizationServerUpdateContractProperties != nil { 2502 objectMap["properties"] = asuc.AuthorizationServerUpdateContractProperties 2503 } 2504 return json.Marshal(objectMap) 2505} 2506 2507// UnmarshalJSON is the custom unmarshaler for AuthorizationServerUpdateContract struct. 2508func (asuc *AuthorizationServerUpdateContract) UnmarshalJSON(body []byte) error { 2509 var m map[string]*json.RawMessage 2510 err := json.Unmarshal(body, &m) 2511 if err != nil { 2512 return err 2513 } 2514 for k, v := range m { 2515 switch k { 2516 case "properties": 2517 if v != nil { 2518 var authorizationServerUpdateContractProperties AuthorizationServerUpdateContractProperties 2519 err = json.Unmarshal(*v, &authorizationServerUpdateContractProperties) 2520 if err != nil { 2521 return err 2522 } 2523 asuc.AuthorizationServerUpdateContractProperties = &authorizationServerUpdateContractProperties 2524 } 2525 case "id": 2526 if v != nil { 2527 var ID string 2528 err = json.Unmarshal(*v, &ID) 2529 if err != nil { 2530 return err 2531 } 2532 asuc.ID = &ID 2533 } 2534 case "name": 2535 if v != nil { 2536 var name string 2537 err = json.Unmarshal(*v, &name) 2538 if err != nil { 2539 return err 2540 } 2541 asuc.Name = &name 2542 } 2543 case "type": 2544 if v != nil { 2545 var typeVar string 2546 err = json.Unmarshal(*v, &typeVar) 2547 if err != nil { 2548 return err 2549 } 2550 asuc.Type = &typeVar 2551 } 2552 } 2553 } 2554 2555 return nil 2556} 2557 2558// AuthorizationServerUpdateContractProperties external OAuth authorization server Update settings 2559// contract. 2560type AuthorizationServerUpdateContractProperties struct { 2561 // DisplayName - User-friendly authorization server name. 2562 DisplayName *string `json:"displayName,omitempty"` 2563 // ClientRegistrationEndpoint - Optional reference to a page where client or app registration for this authorization server is performed. Contains absolute URL to entity being referenced. 2564 ClientRegistrationEndpoint *string `json:"clientRegistrationEndpoint,omitempty"` 2565 // AuthorizationEndpoint - OAuth authorization endpoint. See http://tools.ietf.org/html/rfc6749#section-3.2. 2566 AuthorizationEndpoint *string `json:"authorizationEndpoint,omitempty"` 2567 // GrantTypes - Form of an authorization grant, which the client uses to request the access token. 2568 GrantTypes *[]GrantType `json:"grantTypes,omitempty"` 2569 // ClientID - Client or app id registered with this authorization server. 2570 ClientID *string `json:"clientId,omitempty"` 2571 // 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. 2572 ClientSecret *string `json:"clientSecret,omitempty"` 2573 // Description - Description of the authorization server. Can contain HTML formatting tags. 2574 Description *string `json:"description,omitempty"` 2575 // AuthorizationMethods - HTTP verbs supported by the authorization endpoint. GET must be always present. POST is optional. 2576 AuthorizationMethods *[]AuthorizationMethod `json:"authorizationMethods,omitempty"` 2577 // 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. 2578 ClientAuthenticationMethod *[]ClientAuthenticationMethod `json:"clientAuthenticationMethod,omitempty"` 2579 // 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"}. 2580 TokenBodyParameters *[]TokenBodyParameterContract `json:"tokenBodyParameters,omitempty"` 2581 // TokenEndpoint - OAuth token endpoint. Contains absolute URI to entity being referenced. 2582 TokenEndpoint *string `json:"tokenEndpoint,omitempty"` 2583 // 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. 2584 SupportState *bool `json:"supportState,omitempty"` 2585 // 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. 2586 DefaultScope *string `json:"defaultScope,omitempty"` 2587 // BearerTokenSendingMethods - Specifies the mechanism by which access token is passed to the API. 2588 BearerTokenSendingMethods *[]BearerTokenSendingMethod `json:"bearerTokenSendingMethods,omitempty"` 2589 // ResourceOwnerUsername - Can be optionally specified when resource owner password grant type is supported by this authorization server. Default resource owner username. 2590 ResourceOwnerUsername *string `json:"resourceOwnerUsername,omitempty"` 2591 // ResourceOwnerPassword - Can be optionally specified when resource owner password grant type is supported by this authorization server. Default resource owner password. 2592 ResourceOwnerPassword *string `json:"resourceOwnerPassword,omitempty"` 2593} 2594 2595// BackendAuthorizationHeaderCredentials authorization header information. 2596type BackendAuthorizationHeaderCredentials struct { 2597 // Scheme - Authentication Scheme name. 2598 Scheme *string `json:"scheme,omitempty"` 2599 // Parameter - Authentication Parameter value. 2600 Parameter *string `json:"parameter,omitempty"` 2601} 2602 2603// BackendBaseParameters backend entity base Parameter set. 2604type BackendBaseParameters struct { 2605 // Title - Backend Title. 2606 Title *string `json:"title,omitempty"` 2607 // Description - Backend Description. 2608 Description *string `json:"description,omitempty"` 2609 // 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. 2610 ResourceID *string `json:"resourceId,omitempty"` 2611 // Properties - Backend Properties contract 2612 Properties *BackendProperties `json:"properties,omitempty"` 2613 // Credentials - Backend Credentials Contract Properties 2614 Credentials *BackendCredentialsContract `json:"credentials,omitempty"` 2615 // Proxy - Backend Proxy Contract Properties 2616 Proxy *BackendProxyContract `json:"proxy,omitempty"` 2617 // TLS - Backend TLS Properties 2618 TLS *BackendTLSProperties `json:"tls,omitempty"` 2619} 2620 2621// BackendCollection paged Backend list representation. 2622type BackendCollection struct { 2623 autorest.Response `json:"-"` 2624 // Value - Backend values. 2625 Value *[]BackendContract `json:"value,omitempty"` 2626 // Count - Total record count number across all pages. 2627 Count *int64 `json:"count,omitempty"` 2628 // NextLink - Next page link if any. 2629 NextLink *string `json:"nextLink,omitempty"` 2630} 2631 2632// BackendCollectionIterator provides access to a complete listing of BackendContract values. 2633type BackendCollectionIterator struct { 2634 i int 2635 page BackendCollectionPage 2636} 2637 2638// NextWithContext advances to the next value. If there was an error making 2639// the request the iterator does not advance and the error is returned. 2640func (iter *BackendCollectionIterator) NextWithContext(ctx context.Context) (err error) { 2641 if tracing.IsEnabled() { 2642 ctx = tracing.StartSpan(ctx, fqdn+"/BackendCollectionIterator.NextWithContext") 2643 defer func() { 2644 sc := -1 2645 if iter.Response().Response.Response != nil { 2646 sc = iter.Response().Response.Response.StatusCode 2647 } 2648 tracing.EndSpan(ctx, sc, err) 2649 }() 2650 } 2651 iter.i++ 2652 if iter.i < len(iter.page.Values()) { 2653 return nil 2654 } 2655 err = iter.page.NextWithContext(ctx) 2656 if err != nil { 2657 iter.i-- 2658 return err 2659 } 2660 iter.i = 0 2661 return nil 2662} 2663 2664// Next advances to the next value. If there was an error making 2665// the request the iterator does not advance and the error is returned. 2666// Deprecated: Use NextWithContext() instead. 2667func (iter *BackendCollectionIterator) Next() error { 2668 return iter.NextWithContext(context.Background()) 2669} 2670 2671// NotDone returns true if the enumeration should be started or is not yet complete. 2672func (iter BackendCollectionIterator) NotDone() bool { 2673 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 2674} 2675 2676// Response returns the raw server response from the last page request. 2677func (iter BackendCollectionIterator) Response() BackendCollection { 2678 return iter.page.Response() 2679} 2680 2681// Value returns the current value or a zero-initialized value if the 2682// iterator has advanced beyond the end of the collection. 2683func (iter BackendCollectionIterator) Value() BackendContract { 2684 if !iter.page.NotDone() { 2685 return BackendContract{} 2686 } 2687 return iter.page.Values()[iter.i] 2688} 2689 2690// Creates a new instance of the BackendCollectionIterator type. 2691func NewBackendCollectionIterator(page BackendCollectionPage) BackendCollectionIterator { 2692 return BackendCollectionIterator{page: page} 2693} 2694 2695// IsEmpty returns true if the ListResult contains no values. 2696func (bc BackendCollection) IsEmpty() bool { 2697 return bc.Value == nil || len(*bc.Value) == 0 2698} 2699 2700// hasNextLink returns true if the NextLink is not empty. 2701func (bc BackendCollection) hasNextLink() bool { 2702 return bc.NextLink != nil && len(*bc.NextLink) != 0 2703} 2704 2705// backendCollectionPreparer prepares a request to retrieve the next set of results. 2706// It returns nil if no more results exist. 2707func (bc BackendCollection) backendCollectionPreparer(ctx context.Context) (*http.Request, error) { 2708 if !bc.hasNextLink() { 2709 return nil, nil 2710 } 2711 return autorest.Prepare((&http.Request{}).WithContext(ctx), 2712 autorest.AsJSON(), 2713 autorest.AsGet(), 2714 autorest.WithBaseURL(to.String(bc.NextLink))) 2715} 2716 2717// BackendCollectionPage contains a page of BackendContract values. 2718type BackendCollectionPage struct { 2719 fn func(context.Context, BackendCollection) (BackendCollection, error) 2720 bc BackendCollection 2721} 2722 2723// NextWithContext advances to the next page of values. If there was an error making 2724// the request the page does not advance and the error is returned. 2725func (page *BackendCollectionPage) NextWithContext(ctx context.Context) (err error) { 2726 if tracing.IsEnabled() { 2727 ctx = tracing.StartSpan(ctx, fqdn+"/BackendCollectionPage.NextWithContext") 2728 defer func() { 2729 sc := -1 2730 if page.Response().Response.Response != nil { 2731 sc = page.Response().Response.Response.StatusCode 2732 } 2733 tracing.EndSpan(ctx, sc, err) 2734 }() 2735 } 2736 for { 2737 next, err := page.fn(ctx, page.bc) 2738 if err != nil { 2739 return err 2740 } 2741 page.bc = next 2742 if !next.hasNextLink() || !next.IsEmpty() { 2743 break 2744 } 2745 } 2746 return nil 2747} 2748 2749// Next advances to the next page of values. If there was an error making 2750// the request the page does not advance and the error is returned. 2751// Deprecated: Use NextWithContext() instead. 2752func (page *BackendCollectionPage) Next() error { 2753 return page.NextWithContext(context.Background()) 2754} 2755 2756// NotDone returns true if the page enumeration should be started or is not yet complete. 2757func (page BackendCollectionPage) NotDone() bool { 2758 return !page.bc.IsEmpty() 2759} 2760 2761// Response returns the raw server response from the last page request. 2762func (page BackendCollectionPage) Response() BackendCollection { 2763 return page.bc 2764} 2765 2766// Values returns the slice of values for the current page or nil if there are no values. 2767func (page BackendCollectionPage) Values() []BackendContract { 2768 if page.bc.IsEmpty() { 2769 return nil 2770 } 2771 return *page.bc.Value 2772} 2773 2774// Creates a new instance of the BackendCollectionPage type. 2775func NewBackendCollectionPage(cur BackendCollection, getNextPage func(context.Context, BackendCollection) (BackendCollection, error)) BackendCollectionPage { 2776 return BackendCollectionPage{ 2777 fn: getNextPage, 2778 bc: cur, 2779 } 2780} 2781 2782// BackendContract backend details. 2783type BackendContract struct { 2784 autorest.Response `json:"-"` 2785 // BackendContractProperties - Backend entity contract properties. 2786 *BackendContractProperties `json:"properties,omitempty"` 2787 // ID - READ-ONLY; Resource ID. 2788 ID *string `json:"id,omitempty"` 2789 // Name - READ-ONLY; Resource name. 2790 Name *string `json:"name,omitempty"` 2791 // Type - READ-ONLY; Resource type for API Management resource. 2792 Type *string `json:"type,omitempty"` 2793} 2794 2795// MarshalJSON is the custom marshaler for BackendContract. 2796func (bc BackendContract) MarshalJSON() ([]byte, error) { 2797 objectMap := make(map[string]interface{}) 2798 if bc.BackendContractProperties != nil { 2799 objectMap["properties"] = bc.BackendContractProperties 2800 } 2801 return json.Marshal(objectMap) 2802} 2803 2804// UnmarshalJSON is the custom unmarshaler for BackendContract struct. 2805func (bc *BackendContract) UnmarshalJSON(body []byte) error { 2806 var m map[string]*json.RawMessage 2807 err := json.Unmarshal(body, &m) 2808 if err != nil { 2809 return err 2810 } 2811 for k, v := range m { 2812 switch k { 2813 case "properties": 2814 if v != nil { 2815 var backendContractProperties BackendContractProperties 2816 err = json.Unmarshal(*v, &backendContractProperties) 2817 if err != nil { 2818 return err 2819 } 2820 bc.BackendContractProperties = &backendContractProperties 2821 } 2822 case "id": 2823 if v != nil { 2824 var ID string 2825 err = json.Unmarshal(*v, &ID) 2826 if err != nil { 2827 return err 2828 } 2829 bc.ID = &ID 2830 } 2831 case "name": 2832 if v != nil { 2833 var name string 2834 err = json.Unmarshal(*v, &name) 2835 if err != nil { 2836 return err 2837 } 2838 bc.Name = &name 2839 } 2840 case "type": 2841 if v != nil { 2842 var typeVar string 2843 err = json.Unmarshal(*v, &typeVar) 2844 if err != nil { 2845 return err 2846 } 2847 bc.Type = &typeVar 2848 } 2849 } 2850 } 2851 2852 return nil 2853} 2854 2855// BackendContractProperties parameters supplied to the Create Backend operation. 2856type BackendContractProperties struct { 2857 // URL - Runtime Url of the Backend. 2858 URL *string `json:"url,omitempty"` 2859 // Protocol - Backend communication protocol. Possible values include: 'BackendProtocolHTTP', 'BackendProtocolSoap' 2860 Protocol BackendProtocol `json:"protocol,omitempty"` 2861 // Title - Backend Title. 2862 Title *string `json:"title,omitempty"` 2863 // Description - Backend Description. 2864 Description *string `json:"description,omitempty"` 2865 // 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. 2866 ResourceID *string `json:"resourceId,omitempty"` 2867 // Properties - Backend Properties contract 2868 Properties *BackendProperties `json:"properties,omitempty"` 2869 // Credentials - Backend Credentials Contract Properties 2870 Credentials *BackendCredentialsContract `json:"credentials,omitempty"` 2871 // Proxy - Backend Proxy Contract Properties 2872 Proxy *BackendProxyContract `json:"proxy,omitempty"` 2873 // TLS - Backend TLS Properties 2874 TLS *BackendTLSProperties `json:"tls,omitempty"` 2875} 2876 2877// BackendCredentialsContract details of the Credentials used to connect to Backend. 2878type BackendCredentialsContract struct { 2879 // CertificateIds - List of Client Certificate Ids. 2880 CertificateIds *[]string `json:"certificateIds,omitempty"` 2881 // Certificate - List of Client Certificate Thumbprints. Will be ignored if certificatesIds are provided. 2882 Certificate *[]string `json:"certificate,omitempty"` 2883 // Query - Query Parameter description. 2884 Query map[string][]string `json:"query"` 2885 // Header - Header Parameter description. 2886 Header map[string][]string `json:"header"` 2887 // Authorization - Authorization header authentication 2888 Authorization *BackendAuthorizationHeaderCredentials `json:"authorization,omitempty"` 2889} 2890 2891// MarshalJSON is the custom marshaler for BackendCredentialsContract. 2892func (bcc BackendCredentialsContract) MarshalJSON() ([]byte, error) { 2893 objectMap := make(map[string]interface{}) 2894 if bcc.CertificateIds != nil { 2895 objectMap["certificateIds"] = bcc.CertificateIds 2896 } 2897 if bcc.Certificate != nil { 2898 objectMap["certificate"] = bcc.Certificate 2899 } 2900 if bcc.Query != nil { 2901 objectMap["query"] = bcc.Query 2902 } 2903 if bcc.Header != nil { 2904 objectMap["header"] = bcc.Header 2905 } 2906 if bcc.Authorization != nil { 2907 objectMap["authorization"] = bcc.Authorization 2908 } 2909 return json.Marshal(objectMap) 2910} 2911 2912// BackendProperties properties specific to the Backend Type. 2913type BackendProperties struct { 2914 // ServiceFabricCluster - Backend Service Fabric Cluster Properties 2915 ServiceFabricCluster *BackendServiceFabricClusterProperties `json:"serviceFabricCluster,omitempty"` 2916} 2917 2918// BackendProxyContract details of the Backend WebProxy Server to use in the Request to Backend. 2919type BackendProxyContract struct { 2920 // URL - WebProxy Server AbsoluteUri property which includes the entire URI stored in the Uri instance, including all fragments and query strings. 2921 URL *string `json:"url,omitempty"` 2922 // Username - Username to connect to the WebProxy server 2923 Username *string `json:"username,omitempty"` 2924 // Password - Password to connect to the WebProxy Server 2925 Password *string `json:"password,omitempty"` 2926} 2927 2928// BackendReconnectContract reconnect request parameters. 2929type BackendReconnectContract struct { 2930 // BackendReconnectProperties - Reconnect request properties. 2931 *BackendReconnectProperties `json:"properties,omitempty"` 2932 // ID - READ-ONLY; Resource ID. 2933 ID *string `json:"id,omitempty"` 2934 // Name - READ-ONLY; Resource name. 2935 Name *string `json:"name,omitempty"` 2936 // Type - READ-ONLY; Resource type for API Management resource. 2937 Type *string `json:"type,omitempty"` 2938} 2939 2940// MarshalJSON is the custom marshaler for BackendReconnectContract. 2941func (brc BackendReconnectContract) MarshalJSON() ([]byte, error) { 2942 objectMap := make(map[string]interface{}) 2943 if brc.BackendReconnectProperties != nil { 2944 objectMap["properties"] = brc.BackendReconnectProperties 2945 } 2946 return json.Marshal(objectMap) 2947} 2948 2949// UnmarshalJSON is the custom unmarshaler for BackendReconnectContract struct. 2950func (brc *BackendReconnectContract) UnmarshalJSON(body []byte) error { 2951 var m map[string]*json.RawMessage 2952 err := json.Unmarshal(body, &m) 2953 if err != nil { 2954 return err 2955 } 2956 for k, v := range m { 2957 switch k { 2958 case "properties": 2959 if v != nil { 2960 var backendReconnectProperties BackendReconnectProperties 2961 err = json.Unmarshal(*v, &backendReconnectProperties) 2962 if err != nil { 2963 return err 2964 } 2965 brc.BackendReconnectProperties = &backendReconnectProperties 2966 } 2967 case "id": 2968 if v != nil { 2969 var ID string 2970 err = json.Unmarshal(*v, &ID) 2971 if err != nil { 2972 return err 2973 } 2974 brc.ID = &ID 2975 } 2976 case "name": 2977 if v != nil { 2978 var name string 2979 err = json.Unmarshal(*v, &name) 2980 if err != nil { 2981 return err 2982 } 2983 brc.Name = &name 2984 } 2985 case "type": 2986 if v != nil { 2987 var typeVar string 2988 err = json.Unmarshal(*v, &typeVar) 2989 if err != nil { 2990 return err 2991 } 2992 brc.Type = &typeVar 2993 } 2994 } 2995 } 2996 2997 return nil 2998} 2999 3000// BackendReconnectProperties properties to control reconnect requests. 3001type BackendReconnectProperties struct { 3002 // After - Duration in ISO8601 format after which reconnect will be initiated. Minimum duration of the Reconnect is PT2M. 3003 After *string `json:"after,omitempty"` 3004} 3005 3006// BackendServiceFabricClusterProperties properties of the Service Fabric Type Backend. 3007type BackendServiceFabricClusterProperties struct { 3008 // ClientCertificateID - The client certificate id for the management endpoint. 3009 ClientCertificateID *string `json:"clientCertificateId,omitempty"` 3010 // ClientCertificatethumbprint - The client certificate thumbprint for the management endpoint. Will be ignored if certificatesIds are provided 3011 ClientCertificatethumbprint *string `json:"clientCertificatethumbprint,omitempty"` 3012 // MaxPartitionResolutionRetries - Maximum number of retries while attempting resolve the partition. 3013 MaxPartitionResolutionRetries *int32 `json:"maxPartitionResolutionRetries,omitempty"` 3014 // ManagementEndpoints - The cluster management endpoint. 3015 ManagementEndpoints *[]string `json:"managementEndpoints,omitempty"` 3016 // ServerCertificateThumbprints - Thumbprints of certificates cluster management service uses for tls communication 3017 ServerCertificateThumbprints *[]string `json:"serverCertificateThumbprints,omitempty"` 3018 // ServerX509Names - Server X509 Certificate Names Collection 3019 ServerX509Names *[]X509CertificateName `json:"serverX509Names,omitempty"` 3020} 3021 3022// BackendTLSProperties properties controlling TLS Certificate Validation. 3023type BackendTLSProperties struct { 3024 // ValidateCertificateChain - Flag indicating whether SSL certificate chain validation should be done when using self-signed certificates for this backend host. 3025 ValidateCertificateChain *bool `json:"validateCertificateChain,omitempty"` 3026 // ValidateCertificateName - Flag indicating whether SSL certificate name validation should be done when using self-signed certificates for this backend host. 3027 ValidateCertificateName *bool `json:"validateCertificateName,omitempty"` 3028} 3029 3030// BackendUpdateParameterProperties parameters supplied to the Update Backend operation. 3031type BackendUpdateParameterProperties struct { 3032 // URL - Runtime Url of the Backend. 3033 URL *string `json:"url,omitempty"` 3034 // Protocol - Backend communication protocol. Possible values include: 'BackendProtocolHTTP', 'BackendProtocolSoap' 3035 Protocol BackendProtocol `json:"protocol,omitempty"` 3036 // Title - Backend Title. 3037 Title *string `json:"title,omitempty"` 3038 // Description - Backend Description. 3039 Description *string `json:"description,omitempty"` 3040 // 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. 3041 ResourceID *string `json:"resourceId,omitempty"` 3042 // Properties - Backend Properties contract 3043 Properties *BackendProperties `json:"properties,omitempty"` 3044 // Credentials - Backend Credentials Contract Properties 3045 Credentials *BackendCredentialsContract `json:"credentials,omitempty"` 3046 // Proxy - Backend Proxy Contract Properties 3047 Proxy *BackendProxyContract `json:"proxy,omitempty"` 3048 // TLS - Backend TLS Properties 3049 TLS *BackendTLSProperties `json:"tls,omitempty"` 3050} 3051 3052// BackendUpdateParameters backend update parameters. 3053type BackendUpdateParameters struct { 3054 // BackendUpdateParameterProperties - Backend entity update contract properties. 3055 *BackendUpdateParameterProperties `json:"properties,omitempty"` 3056} 3057 3058// MarshalJSON is the custom marshaler for BackendUpdateParameters. 3059func (bup BackendUpdateParameters) MarshalJSON() ([]byte, error) { 3060 objectMap := make(map[string]interface{}) 3061 if bup.BackendUpdateParameterProperties != nil { 3062 objectMap["properties"] = bup.BackendUpdateParameterProperties 3063 } 3064 return json.Marshal(objectMap) 3065} 3066 3067// UnmarshalJSON is the custom unmarshaler for BackendUpdateParameters struct. 3068func (bup *BackendUpdateParameters) UnmarshalJSON(body []byte) error { 3069 var m map[string]*json.RawMessage 3070 err := json.Unmarshal(body, &m) 3071 if err != nil { 3072 return err 3073 } 3074 for k, v := range m { 3075 switch k { 3076 case "properties": 3077 if v != nil { 3078 var backendUpdateParameterProperties BackendUpdateParameterProperties 3079 err = json.Unmarshal(*v, &backendUpdateParameterProperties) 3080 if err != nil { 3081 return err 3082 } 3083 bup.BackendUpdateParameterProperties = &backendUpdateParameterProperties 3084 } 3085 } 3086 } 3087 3088 return nil 3089} 3090 3091// BodyDiagnosticSettings body logging settings. 3092type BodyDiagnosticSettings struct { 3093 // Bytes - Number of request body bytes to log. 3094 Bytes *int32 `json:"bytes,omitempty"` 3095} 3096 3097// CacheCollection paged Caches list representation. 3098type CacheCollection struct { 3099 autorest.Response `json:"-"` 3100 // Value - Page values. 3101 Value *[]CacheContract `json:"value,omitempty"` 3102 // Count - Total record count number across all pages. 3103 Count *int64 `json:"count,omitempty"` 3104 // NextLink - Next page link if any. 3105 NextLink *string `json:"nextLink,omitempty"` 3106} 3107 3108// CacheCollectionIterator provides access to a complete listing of CacheContract values. 3109type CacheCollectionIterator struct { 3110 i int 3111 page CacheCollectionPage 3112} 3113 3114// NextWithContext advances to the next value. If there was an error making 3115// the request the iterator does not advance and the error is returned. 3116func (iter *CacheCollectionIterator) NextWithContext(ctx context.Context) (err error) { 3117 if tracing.IsEnabled() { 3118 ctx = tracing.StartSpan(ctx, fqdn+"/CacheCollectionIterator.NextWithContext") 3119 defer func() { 3120 sc := -1 3121 if iter.Response().Response.Response != nil { 3122 sc = iter.Response().Response.Response.StatusCode 3123 } 3124 tracing.EndSpan(ctx, sc, err) 3125 }() 3126 } 3127 iter.i++ 3128 if iter.i < len(iter.page.Values()) { 3129 return nil 3130 } 3131 err = iter.page.NextWithContext(ctx) 3132 if err != nil { 3133 iter.i-- 3134 return err 3135 } 3136 iter.i = 0 3137 return nil 3138} 3139 3140// Next advances to the next value. If there was an error making 3141// the request the iterator does not advance and the error is returned. 3142// Deprecated: Use NextWithContext() instead. 3143func (iter *CacheCollectionIterator) Next() error { 3144 return iter.NextWithContext(context.Background()) 3145} 3146 3147// NotDone returns true if the enumeration should be started or is not yet complete. 3148func (iter CacheCollectionIterator) NotDone() bool { 3149 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 3150} 3151 3152// Response returns the raw server response from the last page request. 3153func (iter CacheCollectionIterator) Response() CacheCollection { 3154 return iter.page.Response() 3155} 3156 3157// Value returns the current value or a zero-initialized value if the 3158// iterator has advanced beyond the end of the collection. 3159func (iter CacheCollectionIterator) Value() CacheContract { 3160 if !iter.page.NotDone() { 3161 return CacheContract{} 3162 } 3163 return iter.page.Values()[iter.i] 3164} 3165 3166// Creates a new instance of the CacheCollectionIterator type. 3167func NewCacheCollectionIterator(page CacheCollectionPage) CacheCollectionIterator { 3168 return CacheCollectionIterator{page: page} 3169} 3170 3171// IsEmpty returns true if the ListResult contains no values. 3172func (cc CacheCollection) IsEmpty() bool { 3173 return cc.Value == nil || len(*cc.Value) == 0 3174} 3175 3176// hasNextLink returns true if the NextLink is not empty. 3177func (cc CacheCollection) hasNextLink() bool { 3178 return cc.NextLink != nil && len(*cc.NextLink) != 0 3179} 3180 3181// cacheCollectionPreparer prepares a request to retrieve the next set of results. 3182// It returns nil if no more results exist. 3183func (cc CacheCollection) cacheCollectionPreparer(ctx context.Context) (*http.Request, error) { 3184 if !cc.hasNextLink() { 3185 return nil, nil 3186 } 3187 return autorest.Prepare((&http.Request{}).WithContext(ctx), 3188 autorest.AsJSON(), 3189 autorest.AsGet(), 3190 autorest.WithBaseURL(to.String(cc.NextLink))) 3191} 3192 3193// CacheCollectionPage contains a page of CacheContract values. 3194type CacheCollectionPage struct { 3195 fn func(context.Context, CacheCollection) (CacheCollection, error) 3196 cc CacheCollection 3197} 3198 3199// NextWithContext advances to the next page of values. If there was an error making 3200// the request the page does not advance and the error is returned. 3201func (page *CacheCollectionPage) NextWithContext(ctx context.Context) (err error) { 3202 if tracing.IsEnabled() { 3203 ctx = tracing.StartSpan(ctx, fqdn+"/CacheCollectionPage.NextWithContext") 3204 defer func() { 3205 sc := -1 3206 if page.Response().Response.Response != nil { 3207 sc = page.Response().Response.Response.StatusCode 3208 } 3209 tracing.EndSpan(ctx, sc, err) 3210 }() 3211 } 3212 for { 3213 next, err := page.fn(ctx, page.cc) 3214 if err != nil { 3215 return err 3216 } 3217 page.cc = next 3218 if !next.hasNextLink() || !next.IsEmpty() { 3219 break 3220 } 3221 } 3222 return nil 3223} 3224 3225// Next advances to the next page of values. If there was an error making 3226// the request the page does not advance and the error is returned. 3227// Deprecated: Use NextWithContext() instead. 3228func (page *CacheCollectionPage) Next() error { 3229 return page.NextWithContext(context.Background()) 3230} 3231 3232// NotDone returns true if the page enumeration should be started or is not yet complete. 3233func (page CacheCollectionPage) NotDone() bool { 3234 return !page.cc.IsEmpty() 3235} 3236 3237// Response returns the raw server response from the last page request. 3238func (page CacheCollectionPage) Response() CacheCollection { 3239 return page.cc 3240} 3241 3242// Values returns the slice of values for the current page or nil if there are no values. 3243func (page CacheCollectionPage) Values() []CacheContract { 3244 if page.cc.IsEmpty() { 3245 return nil 3246 } 3247 return *page.cc.Value 3248} 3249 3250// Creates a new instance of the CacheCollectionPage type. 3251func NewCacheCollectionPage(cur CacheCollection, getNextPage func(context.Context, CacheCollection) (CacheCollection, error)) CacheCollectionPage { 3252 return CacheCollectionPage{ 3253 fn: getNextPage, 3254 cc: cur, 3255 } 3256} 3257 3258// CacheContract cache details. 3259type CacheContract struct { 3260 autorest.Response `json:"-"` 3261 // CacheContractProperties - Cache properties details. 3262 *CacheContractProperties `json:"properties,omitempty"` 3263 // ID - READ-ONLY; Resource ID. 3264 ID *string `json:"id,omitempty"` 3265 // Name - READ-ONLY; Resource name. 3266 Name *string `json:"name,omitempty"` 3267 // Type - READ-ONLY; Resource type for API Management resource. 3268 Type *string `json:"type,omitempty"` 3269} 3270 3271// MarshalJSON is the custom marshaler for CacheContract. 3272func (cc CacheContract) MarshalJSON() ([]byte, error) { 3273 objectMap := make(map[string]interface{}) 3274 if cc.CacheContractProperties != nil { 3275 objectMap["properties"] = cc.CacheContractProperties 3276 } 3277 return json.Marshal(objectMap) 3278} 3279 3280// UnmarshalJSON is the custom unmarshaler for CacheContract struct. 3281func (cc *CacheContract) UnmarshalJSON(body []byte) error { 3282 var m map[string]*json.RawMessage 3283 err := json.Unmarshal(body, &m) 3284 if err != nil { 3285 return err 3286 } 3287 for k, v := range m { 3288 switch k { 3289 case "properties": 3290 if v != nil { 3291 var cacheContractProperties CacheContractProperties 3292 err = json.Unmarshal(*v, &cacheContractProperties) 3293 if err != nil { 3294 return err 3295 } 3296 cc.CacheContractProperties = &cacheContractProperties 3297 } 3298 case "id": 3299 if v != nil { 3300 var ID string 3301 err = json.Unmarshal(*v, &ID) 3302 if err != nil { 3303 return err 3304 } 3305 cc.ID = &ID 3306 } 3307 case "name": 3308 if v != nil { 3309 var name string 3310 err = json.Unmarshal(*v, &name) 3311 if err != nil { 3312 return err 3313 } 3314 cc.Name = &name 3315 } 3316 case "type": 3317 if v != nil { 3318 var typeVar string 3319 err = json.Unmarshal(*v, &typeVar) 3320 if err != nil { 3321 return err 3322 } 3323 cc.Type = &typeVar 3324 } 3325 } 3326 } 3327 3328 return nil 3329} 3330 3331// CacheContractProperties properties of the Cache contract. 3332type CacheContractProperties struct { 3333 // Description - Cache description 3334 Description *string `json:"description,omitempty"` 3335 // ConnectionString - Runtime connection string to cache 3336 ConnectionString *string `json:"connectionString,omitempty"` 3337 // UseFromLocation - Location identifier to use cache from (should be either 'default' or valid Azure region identifier) 3338 UseFromLocation *string `json:"useFromLocation,omitempty"` 3339 // ResourceID - Original uri of entity in external system cache points to 3340 ResourceID *string `json:"resourceId,omitempty"` 3341} 3342 3343// CacheUpdateParameters cache update details. 3344type CacheUpdateParameters struct { 3345 // CacheUpdateProperties - Cache update properties details. 3346 *CacheUpdateProperties `json:"properties,omitempty"` 3347} 3348 3349// MarshalJSON is the custom marshaler for CacheUpdateParameters. 3350func (cup CacheUpdateParameters) MarshalJSON() ([]byte, error) { 3351 objectMap := make(map[string]interface{}) 3352 if cup.CacheUpdateProperties != nil { 3353 objectMap["properties"] = cup.CacheUpdateProperties 3354 } 3355 return json.Marshal(objectMap) 3356} 3357 3358// UnmarshalJSON is the custom unmarshaler for CacheUpdateParameters struct. 3359func (cup *CacheUpdateParameters) UnmarshalJSON(body []byte) error { 3360 var m map[string]*json.RawMessage 3361 err := json.Unmarshal(body, &m) 3362 if err != nil { 3363 return err 3364 } 3365 for k, v := range m { 3366 switch k { 3367 case "properties": 3368 if v != nil { 3369 var cacheUpdateProperties CacheUpdateProperties 3370 err = json.Unmarshal(*v, &cacheUpdateProperties) 3371 if err != nil { 3372 return err 3373 } 3374 cup.CacheUpdateProperties = &cacheUpdateProperties 3375 } 3376 } 3377 } 3378 3379 return nil 3380} 3381 3382// CacheUpdateProperties parameters supplied to the Update Cache operation. 3383type CacheUpdateProperties struct { 3384 // Description - Cache description 3385 Description *string `json:"description,omitempty"` 3386 // ConnectionString - Runtime connection string to cache 3387 ConnectionString *string `json:"connectionString,omitempty"` 3388 // UseFromLocation - Location identifier to use cache from (should be either 'default' or valid Azure region identifier) 3389 UseFromLocation *string `json:"useFromLocation,omitempty"` 3390 // ResourceID - Original uri of entity in external system cache points to 3391 ResourceID *string `json:"resourceId,omitempty"` 3392} 3393 3394// CertificateCollection paged Certificates list representation. 3395type CertificateCollection struct { 3396 autorest.Response `json:"-"` 3397 // Value - Page values. 3398 Value *[]CertificateContract `json:"value,omitempty"` 3399 // Count - Total record count number across all pages. 3400 Count *int64 `json:"count,omitempty"` 3401 // NextLink - Next page link if any. 3402 NextLink *string `json:"nextLink,omitempty"` 3403} 3404 3405// CertificateCollectionIterator provides access to a complete listing of CertificateContract values. 3406type CertificateCollectionIterator struct { 3407 i int 3408 page CertificateCollectionPage 3409} 3410 3411// NextWithContext advances to the next value. If there was an error making 3412// the request the iterator does not advance and the error is returned. 3413func (iter *CertificateCollectionIterator) NextWithContext(ctx context.Context) (err error) { 3414 if tracing.IsEnabled() { 3415 ctx = tracing.StartSpan(ctx, fqdn+"/CertificateCollectionIterator.NextWithContext") 3416 defer func() { 3417 sc := -1 3418 if iter.Response().Response.Response != nil { 3419 sc = iter.Response().Response.Response.StatusCode 3420 } 3421 tracing.EndSpan(ctx, sc, err) 3422 }() 3423 } 3424 iter.i++ 3425 if iter.i < len(iter.page.Values()) { 3426 return nil 3427 } 3428 err = iter.page.NextWithContext(ctx) 3429 if err != nil { 3430 iter.i-- 3431 return err 3432 } 3433 iter.i = 0 3434 return nil 3435} 3436 3437// Next advances to the next value. If there was an error making 3438// the request the iterator does not advance and the error is returned. 3439// Deprecated: Use NextWithContext() instead. 3440func (iter *CertificateCollectionIterator) Next() error { 3441 return iter.NextWithContext(context.Background()) 3442} 3443 3444// NotDone returns true if the enumeration should be started or is not yet complete. 3445func (iter CertificateCollectionIterator) NotDone() bool { 3446 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 3447} 3448 3449// Response returns the raw server response from the last page request. 3450func (iter CertificateCollectionIterator) Response() CertificateCollection { 3451 return iter.page.Response() 3452} 3453 3454// Value returns the current value or a zero-initialized value if the 3455// iterator has advanced beyond the end of the collection. 3456func (iter CertificateCollectionIterator) Value() CertificateContract { 3457 if !iter.page.NotDone() { 3458 return CertificateContract{} 3459 } 3460 return iter.page.Values()[iter.i] 3461} 3462 3463// Creates a new instance of the CertificateCollectionIterator type. 3464func NewCertificateCollectionIterator(page CertificateCollectionPage) CertificateCollectionIterator { 3465 return CertificateCollectionIterator{page: page} 3466} 3467 3468// IsEmpty returns true if the ListResult contains no values. 3469func (cc CertificateCollection) IsEmpty() bool { 3470 return cc.Value == nil || len(*cc.Value) == 0 3471} 3472 3473// hasNextLink returns true if the NextLink is not empty. 3474func (cc CertificateCollection) hasNextLink() bool { 3475 return cc.NextLink != nil && len(*cc.NextLink) != 0 3476} 3477 3478// certificateCollectionPreparer prepares a request to retrieve the next set of results. 3479// It returns nil if no more results exist. 3480func (cc CertificateCollection) certificateCollectionPreparer(ctx context.Context) (*http.Request, error) { 3481 if !cc.hasNextLink() { 3482 return nil, nil 3483 } 3484 return autorest.Prepare((&http.Request{}).WithContext(ctx), 3485 autorest.AsJSON(), 3486 autorest.AsGet(), 3487 autorest.WithBaseURL(to.String(cc.NextLink))) 3488} 3489 3490// CertificateCollectionPage contains a page of CertificateContract values. 3491type CertificateCollectionPage struct { 3492 fn func(context.Context, CertificateCollection) (CertificateCollection, error) 3493 cc CertificateCollection 3494} 3495 3496// NextWithContext advances to the next page of values. If there was an error making 3497// the request the page does not advance and the error is returned. 3498func (page *CertificateCollectionPage) NextWithContext(ctx context.Context) (err error) { 3499 if tracing.IsEnabled() { 3500 ctx = tracing.StartSpan(ctx, fqdn+"/CertificateCollectionPage.NextWithContext") 3501 defer func() { 3502 sc := -1 3503 if page.Response().Response.Response != nil { 3504 sc = page.Response().Response.Response.StatusCode 3505 } 3506 tracing.EndSpan(ctx, sc, err) 3507 }() 3508 } 3509 for { 3510 next, err := page.fn(ctx, page.cc) 3511 if err != nil { 3512 return err 3513 } 3514 page.cc = next 3515 if !next.hasNextLink() || !next.IsEmpty() { 3516 break 3517 } 3518 } 3519 return nil 3520} 3521 3522// Next advances to the next page of values. If there was an error making 3523// the request the page does not advance and the error is returned. 3524// Deprecated: Use NextWithContext() instead. 3525func (page *CertificateCollectionPage) Next() error { 3526 return page.NextWithContext(context.Background()) 3527} 3528 3529// NotDone returns true if the page enumeration should be started or is not yet complete. 3530func (page CertificateCollectionPage) NotDone() bool { 3531 return !page.cc.IsEmpty() 3532} 3533 3534// Response returns the raw server response from the last page request. 3535func (page CertificateCollectionPage) Response() CertificateCollection { 3536 return page.cc 3537} 3538 3539// Values returns the slice of values for the current page or nil if there are no values. 3540func (page CertificateCollectionPage) Values() []CertificateContract { 3541 if page.cc.IsEmpty() { 3542 return nil 3543 } 3544 return *page.cc.Value 3545} 3546 3547// Creates a new instance of the CertificateCollectionPage type. 3548func NewCertificateCollectionPage(cur CertificateCollection, getNextPage func(context.Context, CertificateCollection) (CertificateCollection, error)) CertificateCollectionPage { 3549 return CertificateCollectionPage{ 3550 fn: getNextPage, 3551 cc: cur, 3552 } 3553} 3554 3555// CertificateConfiguration certificate configuration which consist of non-trusted intermediates and root 3556// certificates. 3557type CertificateConfiguration struct { 3558 // EncodedCertificate - Base64 Encoded certificate. 3559 EncodedCertificate *string `json:"encodedCertificate,omitempty"` 3560 // CertificatePassword - Certificate Password. 3561 CertificatePassword *string `json:"certificatePassword,omitempty"` 3562 // StoreName - The System.Security.Cryptography.x509certificates.StoreName certificate store location. Only Root and CertificateAuthority are valid locations. Possible values include: 'CertificateAuthority', 'Root' 3563 StoreName StoreName `json:"storeName,omitempty"` 3564 // Certificate - Certificate information. 3565 Certificate *CertificateInformation `json:"certificate,omitempty"` 3566} 3567 3568// CertificateContract certificate details. 3569type CertificateContract struct { 3570 autorest.Response `json:"-"` 3571 // CertificateContractProperties - Certificate properties details. 3572 *CertificateContractProperties `json:"properties,omitempty"` 3573 // ID - READ-ONLY; Resource ID. 3574 ID *string `json:"id,omitempty"` 3575 // Name - READ-ONLY; Resource name. 3576 Name *string `json:"name,omitempty"` 3577 // Type - READ-ONLY; Resource type for API Management resource. 3578 Type *string `json:"type,omitempty"` 3579} 3580 3581// MarshalJSON is the custom marshaler for CertificateContract. 3582func (cc CertificateContract) MarshalJSON() ([]byte, error) { 3583 objectMap := make(map[string]interface{}) 3584 if cc.CertificateContractProperties != nil { 3585 objectMap["properties"] = cc.CertificateContractProperties 3586 } 3587 return json.Marshal(objectMap) 3588} 3589 3590// UnmarshalJSON is the custom unmarshaler for CertificateContract struct. 3591func (cc *CertificateContract) UnmarshalJSON(body []byte) error { 3592 var m map[string]*json.RawMessage 3593 err := json.Unmarshal(body, &m) 3594 if err != nil { 3595 return err 3596 } 3597 for k, v := range m { 3598 switch k { 3599 case "properties": 3600 if v != nil { 3601 var certificateContractProperties CertificateContractProperties 3602 err = json.Unmarshal(*v, &certificateContractProperties) 3603 if err != nil { 3604 return err 3605 } 3606 cc.CertificateContractProperties = &certificateContractProperties 3607 } 3608 case "id": 3609 if v != nil { 3610 var ID string 3611 err = json.Unmarshal(*v, &ID) 3612 if err != nil { 3613 return err 3614 } 3615 cc.ID = &ID 3616 } 3617 case "name": 3618 if v != nil { 3619 var name string 3620 err = json.Unmarshal(*v, &name) 3621 if err != nil { 3622 return err 3623 } 3624 cc.Name = &name 3625 } 3626 case "type": 3627 if v != nil { 3628 var typeVar string 3629 err = json.Unmarshal(*v, &typeVar) 3630 if err != nil { 3631 return err 3632 } 3633 cc.Type = &typeVar 3634 } 3635 } 3636 } 3637 3638 return nil 3639} 3640 3641// CertificateContractProperties properties of the Certificate contract. 3642type CertificateContractProperties struct { 3643 // Subject - Subject attribute of the certificate. 3644 Subject *string `json:"subject,omitempty"` 3645 // Thumbprint - Thumbprint of the certificate. 3646 Thumbprint *string `json:"thumbprint,omitempty"` 3647 // 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. 3648 ExpirationDate *date.Time `json:"expirationDate,omitempty"` 3649 // KeyVault - KeyVault location details of the certificate. 3650 KeyVault *KeyVaultContractProperties `json:"keyVault,omitempty"` 3651} 3652 3653// CertificateCreateOrUpdateParameters certificate create or update details. 3654type CertificateCreateOrUpdateParameters struct { 3655 // CertificateCreateOrUpdateProperties - Certificate create or update properties details. 3656 *CertificateCreateOrUpdateProperties `json:"properties,omitempty"` 3657} 3658 3659// MarshalJSON is the custom marshaler for CertificateCreateOrUpdateParameters. 3660func (ccoup CertificateCreateOrUpdateParameters) MarshalJSON() ([]byte, error) { 3661 objectMap := make(map[string]interface{}) 3662 if ccoup.CertificateCreateOrUpdateProperties != nil { 3663 objectMap["properties"] = ccoup.CertificateCreateOrUpdateProperties 3664 } 3665 return json.Marshal(objectMap) 3666} 3667 3668// UnmarshalJSON is the custom unmarshaler for CertificateCreateOrUpdateParameters struct. 3669func (ccoup *CertificateCreateOrUpdateParameters) UnmarshalJSON(body []byte) error { 3670 var m map[string]*json.RawMessage 3671 err := json.Unmarshal(body, &m) 3672 if err != nil { 3673 return err 3674 } 3675 for k, v := range m { 3676 switch k { 3677 case "properties": 3678 if v != nil { 3679 var certificateCreateOrUpdateProperties CertificateCreateOrUpdateProperties 3680 err = json.Unmarshal(*v, &certificateCreateOrUpdateProperties) 3681 if err != nil { 3682 return err 3683 } 3684 ccoup.CertificateCreateOrUpdateProperties = &certificateCreateOrUpdateProperties 3685 } 3686 } 3687 } 3688 3689 return nil 3690} 3691 3692// CertificateCreateOrUpdateProperties parameters supplied to the CreateOrUpdate certificate operation. 3693type CertificateCreateOrUpdateProperties struct { 3694 // Data - Base 64 encoded certificate using the application/x-pkcs12 representation. 3695 Data *string `json:"data,omitempty"` 3696 // Password - Password for the Certificate 3697 Password *string `json:"password,omitempty"` 3698 // KeyVault - KeyVault location details of the certificate. 3699 KeyVault *KeyVaultContractCreateProperties `json:"keyVault,omitempty"` 3700} 3701 3702// CertificateInformation SSL certificate information. 3703type CertificateInformation struct { 3704 // 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. 3705 Expiry *date.Time `json:"expiry,omitempty"` 3706 // Thumbprint - Thumbprint of the certificate. 3707 Thumbprint *string `json:"thumbprint,omitempty"` 3708 // Subject - Subject of the certificate. 3709 Subject *string `json:"subject,omitempty"` 3710} 3711 3712// ClientSecretContract client or app secret used in IdentityProviders, Aad, OpenID or OAuth. 3713type ClientSecretContract struct { 3714 autorest.Response `json:"-"` 3715 // ClientSecret - Client or app secret used in IdentityProviders, Aad, OpenID or OAuth. 3716 ClientSecret *string `json:"clientSecret,omitempty"` 3717} 3718 3719// ConnectivityStatusContract details about connectivity to a resource. 3720type ConnectivityStatusContract struct { 3721 // 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. 3722 Name *string `json:"name,omitempty"` 3723 // Status - Resource Connectivity Status Type identifier. Possible values include: 'Initializing', 'Success', 'Failure' 3724 Status ConnectivityStatusType `json:"status,omitempty"` 3725 // Error - Error details of the connectivity to the resource. 3726 Error *string `json:"error,omitempty"` 3727 // 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. 3728 LastUpdated *date.Time `json:"lastUpdated,omitempty"` 3729 // 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. 3730 LastStatusChange *date.Time `json:"lastStatusChange,omitempty"` 3731 // ResourceType - Resource Type. 3732 ResourceType *string `json:"resourceType,omitempty"` 3733 // IsOptional - Whether this is optional. 3734 IsOptional *bool `json:"isOptional,omitempty"` 3735} 3736 3737// ContentItemCollection paged list of content items. 3738type ContentItemCollection struct { 3739 autorest.Response `json:"-"` 3740 // Value - READ-ONLY; Collection of content items. 3741 Value *[]ContentItemContract `json:"value,omitempty"` 3742 // NextLink - READ-ONLY; Next page link, if any. 3743 NextLink *string `json:"nextLink,omitempty"` 3744} 3745 3746// ContentItemCollectionIterator provides access to a complete listing of ContentItemContract values. 3747type ContentItemCollectionIterator struct { 3748 i int 3749 page ContentItemCollectionPage 3750} 3751 3752// NextWithContext advances to the next value. If there was an error making 3753// the request the iterator does not advance and the error is returned. 3754func (iter *ContentItemCollectionIterator) NextWithContext(ctx context.Context) (err error) { 3755 if tracing.IsEnabled() { 3756 ctx = tracing.StartSpan(ctx, fqdn+"/ContentItemCollectionIterator.NextWithContext") 3757 defer func() { 3758 sc := -1 3759 if iter.Response().Response.Response != nil { 3760 sc = iter.Response().Response.Response.StatusCode 3761 } 3762 tracing.EndSpan(ctx, sc, err) 3763 }() 3764 } 3765 iter.i++ 3766 if iter.i < len(iter.page.Values()) { 3767 return nil 3768 } 3769 err = iter.page.NextWithContext(ctx) 3770 if err != nil { 3771 iter.i-- 3772 return err 3773 } 3774 iter.i = 0 3775 return nil 3776} 3777 3778// Next advances to the next value. If there was an error making 3779// the request the iterator does not advance and the error is returned. 3780// Deprecated: Use NextWithContext() instead. 3781func (iter *ContentItemCollectionIterator) Next() error { 3782 return iter.NextWithContext(context.Background()) 3783} 3784 3785// NotDone returns true if the enumeration should be started or is not yet complete. 3786func (iter ContentItemCollectionIterator) NotDone() bool { 3787 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 3788} 3789 3790// Response returns the raw server response from the last page request. 3791func (iter ContentItemCollectionIterator) Response() ContentItemCollection { 3792 return iter.page.Response() 3793} 3794 3795// Value returns the current value or a zero-initialized value if the 3796// iterator has advanced beyond the end of the collection. 3797func (iter ContentItemCollectionIterator) Value() ContentItemContract { 3798 if !iter.page.NotDone() { 3799 return ContentItemContract{} 3800 } 3801 return iter.page.Values()[iter.i] 3802} 3803 3804// Creates a new instance of the ContentItemCollectionIterator type. 3805func NewContentItemCollectionIterator(page ContentItemCollectionPage) ContentItemCollectionIterator { 3806 return ContentItemCollectionIterator{page: page} 3807} 3808 3809// IsEmpty returns true if the ListResult contains no values. 3810func (cic ContentItemCollection) IsEmpty() bool { 3811 return cic.Value == nil || len(*cic.Value) == 0 3812} 3813 3814// hasNextLink returns true if the NextLink is not empty. 3815func (cic ContentItemCollection) hasNextLink() bool { 3816 return cic.NextLink != nil && len(*cic.NextLink) != 0 3817} 3818 3819// contentItemCollectionPreparer prepares a request to retrieve the next set of results. 3820// It returns nil if no more results exist. 3821func (cic ContentItemCollection) contentItemCollectionPreparer(ctx context.Context) (*http.Request, error) { 3822 if !cic.hasNextLink() { 3823 return nil, nil 3824 } 3825 return autorest.Prepare((&http.Request{}).WithContext(ctx), 3826 autorest.AsJSON(), 3827 autorest.AsGet(), 3828 autorest.WithBaseURL(to.String(cic.NextLink))) 3829} 3830 3831// ContentItemCollectionPage contains a page of ContentItemContract values. 3832type ContentItemCollectionPage struct { 3833 fn func(context.Context, ContentItemCollection) (ContentItemCollection, error) 3834 cic ContentItemCollection 3835} 3836 3837// NextWithContext advances to the next page of values. If there was an error making 3838// the request the page does not advance and the error is returned. 3839func (page *ContentItemCollectionPage) NextWithContext(ctx context.Context) (err error) { 3840 if tracing.IsEnabled() { 3841 ctx = tracing.StartSpan(ctx, fqdn+"/ContentItemCollectionPage.NextWithContext") 3842 defer func() { 3843 sc := -1 3844 if page.Response().Response.Response != nil { 3845 sc = page.Response().Response.Response.StatusCode 3846 } 3847 tracing.EndSpan(ctx, sc, err) 3848 }() 3849 } 3850 for { 3851 next, err := page.fn(ctx, page.cic) 3852 if err != nil { 3853 return err 3854 } 3855 page.cic = next 3856 if !next.hasNextLink() || !next.IsEmpty() { 3857 break 3858 } 3859 } 3860 return nil 3861} 3862 3863// Next advances to the next page of values. If there was an error making 3864// the request the page does not advance and the error is returned. 3865// Deprecated: Use NextWithContext() instead. 3866func (page *ContentItemCollectionPage) Next() error { 3867 return page.NextWithContext(context.Background()) 3868} 3869 3870// NotDone returns true if the page enumeration should be started or is not yet complete. 3871func (page ContentItemCollectionPage) NotDone() bool { 3872 return !page.cic.IsEmpty() 3873} 3874 3875// Response returns the raw server response from the last page request. 3876func (page ContentItemCollectionPage) Response() ContentItemCollection { 3877 return page.cic 3878} 3879 3880// Values returns the slice of values for the current page or nil if there are no values. 3881func (page ContentItemCollectionPage) Values() []ContentItemContract { 3882 if page.cic.IsEmpty() { 3883 return nil 3884 } 3885 return *page.cic.Value 3886} 3887 3888// Creates a new instance of the ContentItemCollectionPage type. 3889func NewContentItemCollectionPage(cur ContentItemCollection, getNextPage func(context.Context, ContentItemCollection) (ContentItemCollection, error)) ContentItemCollectionPage { 3890 return ContentItemCollectionPage{ 3891 fn: getNextPage, 3892 cic: cur, 3893 } 3894} 3895 3896// ContentItemContract content type contract details. 3897type ContentItemContract struct { 3898 autorest.Response `json:"-"` 3899 // Properties - Properties of the content item. 3900 Properties map[string]interface{} `json:"properties"` 3901 // ID - READ-ONLY; Resource ID. 3902 ID *string `json:"id,omitempty"` 3903 // Name - READ-ONLY; Resource name. 3904 Name *string `json:"name,omitempty"` 3905 // Type - READ-ONLY; Resource type for API Management resource. 3906 Type *string `json:"type,omitempty"` 3907} 3908 3909// MarshalJSON is the custom marshaler for ContentItemContract. 3910func (cic ContentItemContract) MarshalJSON() ([]byte, error) { 3911 objectMap := make(map[string]interface{}) 3912 if cic.Properties != nil { 3913 objectMap["properties"] = cic.Properties 3914 } 3915 return json.Marshal(objectMap) 3916} 3917 3918// ContentTypeCollection paged list of content types. 3919type ContentTypeCollection struct { 3920 autorest.Response `json:"-"` 3921 // Value - READ-ONLY; Collection of content types. 3922 Value *[]ContentTypeContract `json:"value,omitempty"` 3923 // NextLink - READ-ONLY; Next page link, if any. 3924 NextLink *string `json:"nextLink,omitempty"` 3925} 3926 3927// ContentTypeCollectionIterator provides access to a complete listing of ContentTypeContract values. 3928type ContentTypeCollectionIterator struct { 3929 i int 3930 page ContentTypeCollectionPage 3931} 3932 3933// NextWithContext advances to the next value. If there was an error making 3934// the request the iterator does not advance and the error is returned. 3935func (iter *ContentTypeCollectionIterator) NextWithContext(ctx context.Context) (err error) { 3936 if tracing.IsEnabled() { 3937 ctx = tracing.StartSpan(ctx, fqdn+"/ContentTypeCollectionIterator.NextWithContext") 3938 defer func() { 3939 sc := -1 3940 if iter.Response().Response.Response != nil { 3941 sc = iter.Response().Response.Response.StatusCode 3942 } 3943 tracing.EndSpan(ctx, sc, err) 3944 }() 3945 } 3946 iter.i++ 3947 if iter.i < len(iter.page.Values()) { 3948 return nil 3949 } 3950 err = iter.page.NextWithContext(ctx) 3951 if err != nil { 3952 iter.i-- 3953 return err 3954 } 3955 iter.i = 0 3956 return nil 3957} 3958 3959// Next advances to the next value. If there was an error making 3960// the request the iterator does not advance and the error is returned. 3961// Deprecated: Use NextWithContext() instead. 3962func (iter *ContentTypeCollectionIterator) Next() error { 3963 return iter.NextWithContext(context.Background()) 3964} 3965 3966// NotDone returns true if the enumeration should be started or is not yet complete. 3967func (iter ContentTypeCollectionIterator) NotDone() bool { 3968 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 3969} 3970 3971// Response returns the raw server response from the last page request. 3972func (iter ContentTypeCollectionIterator) Response() ContentTypeCollection { 3973 return iter.page.Response() 3974} 3975 3976// Value returns the current value or a zero-initialized value if the 3977// iterator has advanced beyond the end of the collection. 3978func (iter ContentTypeCollectionIterator) Value() ContentTypeContract { 3979 if !iter.page.NotDone() { 3980 return ContentTypeContract{} 3981 } 3982 return iter.page.Values()[iter.i] 3983} 3984 3985// Creates a new instance of the ContentTypeCollectionIterator type. 3986func NewContentTypeCollectionIterator(page ContentTypeCollectionPage) ContentTypeCollectionIterator { 3987 return ContentTypeCollectionIterator{page: page} 3988} 3989 3990// IsEmpty returns true if the ListResult contains no values. 3991func (ctc ContentTypeCollection) IsEmpty() bool { 3992 return ctc.Value == nil || len(*ctc.Value) == 0 3993} 3994 3995// hasNextLink returns true if the NextLink is not empty. 3996func (ctc ContentTypeCollection) hasNextLink() bool { 3997 return ctc.NextLink != nil && len(*ctc.NextLink) != 0 3998} 3999 4000// contentTypeCollectionPreparer prepares a request to retrieve the next set of results. 4001// It returns nil if no more results exist. 4002func (ctc ContentTypeCollection) contentTypeCollectionPreparer(ctx context.Context) (*http.Request, error) { 4003 if !ctc.hasNextLink() { 4004 return nil, nil 4005 } 4006 return autorest.Prepare((&http.Request{}).WithContext(ctx), 4007 autorest.AsJSON(), 4008 autorest.AsGet(), 4009 autorest.WithBaseURL(to.String(ctc.NextLink))) 4010} 4011 4012// ContentTypeCollectionPage contains a page of ContentTypeContract values. 4013type ContentTypeCollectionPage struct { 4014 fn func(context.Context, ContentTypeCollection) (ContentTypeCollection, error) 4015 ctc ContentTypeCollection 4016} 4017 4018// NextWithContext advances to the next page of values. If there was an error making 4019// the request the page does not advance and the error is returned. 4020func (page *ContentTypeCollectionPage) NextWithContext(ctx context.Context) (err error) { 4021 if tracing.IsEnabled() { 4022 ctx = tracing.StartSpan(ctx, fqdn+"/ContentTypeCollectionPage.NextWithContext") 4023 defer func() { 4024 sc := -1 4025 if page.Response().Response.Response != nil { 4026 sc = page.Response().Response.Response.StatusCode 4027 } 4028 tracing.EndSpan(ctx, sc, err) 4029 }() 4030 } 4031 for { 4032 next, err := page.fn(ctx, page.ctc) 4033 if err != nil { 4034 return err 4035 } 4036 page.ctc = next 4037 if !next.hasNextLink() || !next.IsEmpty() { 4038 break 4039 } 4040 } 4041 return nil 4042} 4043 4044// Next advances to the next page of values. If there was an error making 4045// the request the page does not advance and the error is returned. 4046// Deprecated: Use NextWithContext() instead. 4047func (page *ContentTypeCollectionPage) Next() error { 4048 return page.NextWithContext(context.Background()) 4049} 4050 4051// NotDone returns true if the page enumeration should be started or is not yet complete. 4052func (page ContentTypeCollectionPage) NotDone() bool { 4053 return !page.ctc.IsEmpty() 4054} 4055 4056// Response returns the raw server response from the last page request. 4057func (page ContentTypeCollectionPage) Response() ContentTypeCollection { 4058 return page.ctc 4059} 4060 4061// Values returns the slice of values for the current page or nil if there are no values. 4062func (page ContentTypeCollectionPage) Values() []ContentTypeContract { 4063 if page.ctc.IsEmpty() { 4064 return nil 4065 } 4066 return *page.ctc.Value 4067} 4068 4069// Creates a new instance of the ContentTypeCollectionPage type. 4070func NewContentTypeCollectionPage(cur ContentTypeCollection, getNextPage func(context.Context, ContentTypeCollection) (ContentTypeCollection, error)) ContentTypeCollectionPage { 4071 return ContentTypeCollectionPage{ 4072 fn: getNextPage, 4073 ctc: cur, 4074 } 4075} 4076 4077// ContentTypeContract content type contract details. 4078type ContentTypeContract struct { 4079 autorest.Response `json:"-"` 4080 // ContentTypeContractProperties - Properties of the content type. 4081 *ContentTypeContractProperties `json:"properties,omitempty"` 4082 // ID - READ-ONLY; Resource ID. 4083 ID *string `json:"id,omitempty"` 4084 // Name - READ-ONLY; Resource name. 4085 Name *string `json:"name,omitempty"` 4086 // Type - READ-ONLY; Resource type for API Management resource. 4087 Type *string `json:"type,omitempty"` 4088} 4089 4090// MarshalJSON is the custom marshaler for ContentTypeContract. 4091func (ctc ContentTypeContract) MarshalJSON() ([]byte, error) { 4092 objectMap := make(map[string]interface{}) 4093 if ctc.ContentTypeContractProperties != nil { 4094 objectMap["properties"] = ctc.ContentTypeContractProperties 4095 } 4096 return json.Marshal(objectMap) 4097} 4098 4099// UnmarshalJSON is the custom unmarshaler for ContentTypeContract struct. 4100func (ctc *ContentTypeContract) UnmarshalJSON(body []byte) error { 4101 var m map[string]*json.RawMessage 4102 err := json.Unmarshal(body, &m) 4103 if err != nil { 4104 return err 4105 } 4106 for k, v := range m { 4107 switch k { 4108 case "properties": 4109 if v != nil { 4110 var contentTypeContractProperties ContentTypeContractProperties 4111 err = json.Unmarshal(*v, &contentTypeContractProperties) 4112 if err != nil { 4113 return err 4114 } 4115 ctc.ContentTypeContractProperties = &contentTypeContractProperties 4116 } 4117 case "id": 4118 if v != nil { 4119 var ID string 4120 err = json.Unmarshal(*v, &ID) 4121 if err != nil { 4122 return err 4123 } 4124 ctc.ID = &ID 4125 } 4126 case "name": 4127 if v != nil { 4128 var name string 4129 err = json.Unmarshal(*v, &name) 4130 if err != nil { 4131 return err 4132 } 4133 ctc.Name = &name 4134 } 4135 case "type": 4136 if v != nil { 4137 var typeVar string 4138 err = json.Unmarshal(*v, &typeVar) 4139 if err != nil { 4140 return err 4141 } 4142 ctc.Type = &typeVar 4143 } 4144 } 4145 } 4146 4147 return nil 4148} 4149 4150// ContentTypeContractProperties ... 4151type ContentTypeContractProperties struct { 4152 // ID - Content type identifier 4153 ID *string `json:"id,omitempty"` 4154 // Name - Content type name. Must be 1 to 250 characters long. 4155 Name *string `json:"name,omitempty"` 4156 // Description - Content type description. 4157 Description *string `json:"description,omitempty"` 4158 // Schema - Content type schema. 4159 Schema interface{} `json:"schema,omitempty"` 4160 // Version - Content type version. 4161 Version *string `json:"version,omitempty"` 4162} 4163 4164// DataMasking ... 4165type DataMasking struct { 4166 // QueryParams - Masking settings for Url query parameters 4167 QueryParams *[]DataMaskingEntity `json:"queryParams,omitempty"` 4168 // Headers - Masking settings for headers 4169 Headers *[]DataMaskingEntity `json:"headers,omitempty"` 4170} 4171 4172// DataMaskingEntity ... 4173type DataMaskingEntity struct { 4174 // Value - The name of an entity to mask (e.g. a name of a header or a query parameter). 4175 Value *string `json:"value,omitempty"` 4176 // Mode - Data masking mode. Possible values include: 'Mask', 'Hide' 4177 Mode DataMaskingMode `json:"mode,omitempty"` 4178} 4179 4180// DeletedServiceContract deleted Api Management Service information. 4181type DeletedServiceContract struct { 4182 autorest.Response `json:"-"` 4183 // DeletedServiceContractProperties - Deleted Api Management Service details. 4184 *DeletedServiceContractProperties `json:"properties,omitempty"` 4185 // Location - READ-ONLY; Api Management Service Master Location. 4186 Location *string `json:"location,omitempty"` 4187 // ID - READ-ONLY; Resource ID. 4188 ID *string `json:"id,omitempty"` 4189 // Name - READ-ONLY; Resource name. 4190 Name *string `json:"name,omitempty"` 4191 // Type - READ-ONLY; Resource type for API Management resource. 4192 Type *string `json:"type,omitempty"` 4193} 4194 4195// MarshalJSON is the custom marshaler for DeletedServiceContract. 4196func (dsc DeletedServiceContract) MarshalJSON() ([]byte, error) { 4197 objectMap := make(map[string]interface{}) 4198 if dsc.DeletedServiceContractProperties != nil { 4199 objectMap["properties"] = dsc.DeletedServiceContractProperties 4200 } 4201 return json.Marshal(objectMap) 4202} 4203 4204// UnmarshalJSON is the custom unmarshaler for DeletedServiceContract struct. 4205func (dsc *DeletedServiceContract) UnmarshalJSON(body []byte) error { 4206 var m map[string]*json.RawMessage 4207 err := json.Unmarshal(body, &m) 4208 if err != nil { 4209 return err 4210 } 4211 for k, v := range m { 4212 switch k { 4213 case "properties": 4214 if v != nil { 4215 var deletedServiceContractProperties DeletedServiceContractProperties 4216 err = json.Unmarshal(*v, &deletedServiceContractProperties) 4217 if err != nil { 4218 return err 4219 } 4220 dsc.DeletedServiceContractProperties = &deletedServiceContractProperties 4221 } 4222 case "location": 4223 if v != nil { 4224 var location string 4225 err = json.Unmarshal(*v, &location) 4226 if err != nil { 4227 return err 4228 } 4229 dsc.Location = &location 4230 } 4231 case "id": 4232 if v != nil { 4233 var ID string 4234 err = json.Unmarshal(*v, &ID) 4235 if err != nil { 4236 return err 4237 } 4238 dsc.ID = &ID 4239 } 4240 case "name": 4241 if v != nil { 4242 var name string 4243 err = json.Unmarshal(*v, &name) 4244 if err != nil { 4245 return err 4246 } 4247 dsc.Name = &name 4248 } 4249 case "type": 4250 if v != nil { 4251 var typeVar string 4252 err = json.Unmarshal(*v, &typeVar) 4253 if err != nil { 4254 return err 4255 } 4256 dsc.Type = &typeVar 4257 } 4258 } 4259 } 4260 4261 return nil 4262} 4263 4264// DeletedServiceContractProperties ... 4265type DeletedServiceContractProperties struct { 4266 // ServiceID - Fully-qualified API Management Service Resource ID 4267 ServiceID *string `json:"serviceId,omitempty"` 4268 // 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. 4269 ScheduledPurgeDate *date.Time `json:"scheduledPurgeDate,omitempty"` 4270 // 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. 4271 DeletionDate *date.Time `json:"deletionDate,omitempty"` 4272} 4273 4274// DeletedServicesCollection paged deleted Api Management Services List Representation. 4275type DeletedServicesCollection struct { 4276 autorest.Response `json:"-"` 4277 // Value - READ-ONLY; Page values. 4278 Value *[]DeletedServiceContract `json:"value,omitempty"` 4279 // NextLink - READ-ONLY; Next page link if any. 4280 NextLink *string `json:"nextLink,omitempty"` 4281} 4282 4283// DeletedServicesCollectionIterator provides access to a complete listing of DeletedServiceContract 4284// values. 4285type DeletedServicesCollectionIterator struct { 4286 i int 4287 page DeletedServicesCollectionPage 4288} 4289 4290// NextWithContext advances to the next value. If there was an error making 4291// the request the iterator does not advance and the error is returned. 4292func (iter *DeletedServicesCollectionIterator) NextWithContext(ctx context.Context) (err error) { 4293 if tracing.IsEnabled() { 4294 ctx = tracing.StartSpan(ctx, fqdn+"/DeletedServicesCollectionIterator.NextWithContext") 4295 defer func() { 4296 sc := -1 4297 if iter.Response().Response.Response != nil { 4298 sc = iter.Response().Response.Response.StatusCode 4299 } 4300 tracing.EndSpan(ctx, sc, err) 4301 }() 4302 } 4303 iter.i++ 4304 if iter.i < len(iter.page.Values()) { 4305 return nil 4306 } 4307 err = iter.page.NextWithContext(ctx) 4308 if err != nil { 4309 iter.i-- 4310 return err 4311 } 4312 iter.i = 0 4313 return nil 4314} 4315 4316// Next advances to the next value. If there was an error making 4317// the request the iterator does not advance and the error is returned. 4318// Deprecated: Use NextWithContext() instead. 4319func (iter *DeletedServicesCollectionIterator) Next() error { 4320 return iter.NextWithContext(context.Background()) 4321} 4322 4323// NotDone returns true if the enumeration should be started or is not yet complete. 4324func (iter DeletedServicesCollectionIterator) NotDone() bool { 4325 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 4326} 4327 4328// Response returns the raw server response from the last page request. 4329func (iter DeletedServicesCollectionIterator) Response() DeletedServicesCollection { 4330 return iter.page.Response() 4331} 4332 4333// Value returns the current value or a zero-initialized value if the 4334// iterator has advanced beyond the end of the collection. 4335func (iter DeletedServicesCollectionIterator) Value() DeletedServiceContract { 4336 if !iter.page.NotDone() { 4337 return DeletedServiceContract{} 4338 } 4339 return iter.page.Values()[iter.i] 4340} 4341 4342// Creates a new instance of the DeletedServicesCollectionIterator type. 4343func NewDeletedServicesCollectionIterator(page DeletedServicesCollectionPage) DeletedServicesCollectionIterator { 4344 return DeletedServicesCollectionIterator{page: page} 4345} 4346 4347// IsEmpty returns true if the ListResult contains no values. 4348func (dsc DeletedServicesCollection) IsEmpty() bool { 4349 return dsc.Value == nil || len(*dsc.Value) == 0 4350} 4351 4352// hasNextLink returns true if the NextLink is not empty. 4353func (dsc DeletedServicesCollection) hasNextLink() bool { 4354 return dsc.NextLink != nil && len(*dsc.NextLink) != 0 4355} 4356 4357// deletedServicesCollectionPreparer prepares a request to retrieve the next set of results. 4358// It returns nil if no more results exist. 4359func (dsc DeletedServicesCollection) deletedServicesCollectionPreparer(ctx context.Context) (*http.Request, error) { 4360 if !dsc.hasNextLink() { 4361 return nil, nil 4362 } 4363 return autorest.Prepare((&http.Request{}).WithContext(ctx), 4364 autorest.AsJSON(), 4365 autorest.AsGet(), 4366 autorest.WithBaseURL(to.String(dsc.NextLink))) 4367} 4368 4369// DeletedServicesCollectionPage contains a page of DeletedServiceContract values. 4370type DeletedServicesCollectionPage struct { 4371 fn func(context.Context, DeletedServicesCollection) (DeletedServicesCollection, error) 4372 dsc DeletedServicesCollection 4373} 4374 4375// NextWithContext advances to the next page of values. If there was an error making 4376// the request the page does not advance and the error is returned. 4377func (page *DeletedServicesCollectionPage) NextWithContext(ctx context.Context) (err error) { 4378 if tracing.IsEnabled() { 4379 ctx = tracing.StartSpan(ctx, fqdn+"/DeletedServicesCollectionPage.NextWithContext") 4380 defer func() { 4381 sc := -1 4382 if page.Response().Response.Response != nil { 4383 sc = page.Response().Response.Response.StatusCode 4384 } 4385 tracing.EndSpan(ctx, sc, err) 4386 }() 4387 } 4388 for { 4389 next, err := page.fn(ctx, page.dsc) 4390 if err != nil { 4391 return err 4392 } 4393 page.dsc = next 4394 if !next.hasNextLink() || !next.IsEmpty() { 4395 break 4396 } 4397 } 4398 return nil 4399} 4400 4401// Next advances to the next page of values. If there was an error making 4402// the request the page does not advance and the error is returned. 4403// Deprecated: Use NextWithContext() instead. 4404func (page *DeletedServicesCollectionPage) Next() error { 4405 return page.NextWithContext(context.Background()) 4406} 4407 4408// NotDone returns true if the page enumeration should be started or is not yet complete. 4409func (page DeletedServicesCollectionPage) NotDone() bool { 4410 return !page.dsc.IsEmpty() 4411} 4412 4413// Response returns the raw server response from the last page request. 4414func (page DeletedServicesCollectionPage) Response() DeletedServicesCollection { 4415 return page.dsc 4416} 4417 4418// Values returns the slice of values for the current page or nil if there are no values. 4419func (page DeletedServicesCollectionPage) Values() []DeletedServiceContract { 4420 if page.dsc.IsEmpty() { 4421 return nil 4422 } 4423 return *page.dsc.Value 4424} 4425 4426// Creates a new instance of the DeletedServicesCollectionPage type. 4427func NewDeletedServicesCollectionPage(cur DeletedServicesCollection, getNextPage func(context.Context, DeletedServicesCollection) (DeletedServicesCollection, error)) DeletedServicesCollectionPage { 4428 return DeletedServicesCollectionPage{ 4429 fn: getNextPage, 4430 dsc: cur, 4431 } 4432} 4433 4434// DeletedServicesPurgeFuture an abstraction for monitoring and retrieving the results of a long-running 4435// operation. 4436type DeletedServicesPurgeFuture struct { 4437 azure.FutureAPI 4438 // Result returns the result of the asynchronous operation. 4439 // If the operation has not completed it will return an error. 4440 Result func(DeletedServicesClient) (DeletedServiceContract, error) 4441} 4442 4443// DeployConfigurationParameterProperties parameters supplied to the Deploy Configuration operation. 4444type DeployConfigurationParameterProperties struct { 4445 // Branch - The name of the Git branch from which the configuration is to be deployed to the configuration database. 4446 Branch *string `json:"branch,omitempty"` 4447 // Force - The value enforcing deleting subscriptions to products that are deleted in this update. 4448 Force *bool `json:"force,omitempty"` 4449} 4450 4451// DeployConfigurationParameters deploy Tenant Configuration Contract. 4452type DeployConfigurationParameters struct { 4453 // DeployConfigurationParameterProperties - Deploy Configuration Parameter contract properties. 4454 *DeployConfigurationParameterProperties `json:"properties,omitempty"` 4455} 4456 4457// MarshalJSON is the custom marshaler for DeployConfigurationParameters. 4458func (dcp DeployConfigurationParameters) MarshalJSON() ([]byte, error) { 4459 objectMap := make(map[string]interface{}) 4460 if dcp.DeployConfigurationParameterProperties != nil { 4461 objectMap["properties"] = dcp.DeployConfigurationParameterProperties 4462 } 4463 return json.Marshal(objectMap) 4464} 4465 4466// UnmarshalJSON is the custom unmarshaler for DeployConfigurationParameters struct. 4467func (dcp *DeployConfigurationParameters) UnmarshalJSON(body []byte) error { 4468 var m map[string]*json.RawMessage 4469 err := json.Unmarshal(body, &m) 4470 if err != nil { 4471 return err 4472 } 4473 for k, v := range m { 4474 switch k { 4475 case "properties": 4476 if v != nil { 4477 var deployConfigurationParameterProperties DeployConfigurationParameterProperties 4478 err = json.Unmarshal(*v, &deployConfigurationParameterProperties) 4479 if err != nil { 4480 return err 4481 } 4482 dcp.DeployConfigurationParameterProperties = &deployConfigurationParameterProperties 4483 } 4484 } 4485 } 4486 4487 return nil 4488} 4489 4490// DiagnosticCollection paged Diagnostic list representation. 4491type DiagnosticCollection struct { 4492 autorest.Response `json:"-"` 4493 // Value - Page values. 4494 Value *[]DiagnosticContract `json:"value,omitempty"` 4495 // Count - Total record count number across all pages. 4496 Count *int64 `json:"count,omitempty"` 4497 // NextLink - Next page link if any. 4498 NextLink *string `json:"nextLink,omitempty"` 4499} 4500 4501// DiagnosticCollectionIterator provides access to a complete listing of DiagnosticContract values. 4502type DiagnosticCollectionIterator struct { 4503 i int 4504 page DiagnosticCollectionPage 4505} 4506 4507// NextWithContext advances to the next value. If there was an error making 4508// the request the iterator does not advance and the error is returned. 4509func (iter *DiagnosticCollectionIterator) NextWithContext(ctx context.Context) (err error) { 4510 if tracing.IsEnabled() { 4511 ctx = tracing.StartSpan(ctx, fqdn+"/DiagnosticCollectionIterator.NextWithContext") 4512 defer func() { 4513 sc := -1 4514 if iter.Response().Response.Response != nil { 4515 sc = iter.Response().Response.Response.StatusCode 4516 } 4517 tracing.EndSpan(ctx, sc, err) 4518 }() 4519 } 4520 iter.i++ 4521 if iter.i < len(iter.page.Values()) { 4522 return nil 4523 } 4524 err = iter.page.NextWithContext(ctx) 4525 if err != nil { 4526 iter.i-- 4527 return err 4528 } 4529 iter.i = 0 4530 return nil 4531} 4532 4533// Next advances to the next value. If there was an error making 4534// the request the iterator does not advance and the error is returned. 4535// Deprecated: Use NextWithContext() instead. 4536func (iter *DiagnosticCollectionIterator) Next() error { 4537 return iter.NextWithContext(context.Background()) 4538} 4539 4540// NotDone returns true if the enumeration should be started or is not yet complete. 4541func (iter DiagnosticCollectionIterator) NotDone() bool { 4542 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 4543} 4544 4545// Response returns the raw server response from the last page request. 4546func (iter DiagnosticCollectionIterator) Response() DiagnosticCollection { 4547 return iter.page.Response() 4548} 4549 4550// Value returns the current value or a zero-initialized value if the 4551// iterator has advanced beyond the end of the collection. 4552func (iter DiagnosticCollectionIterator) Value() DiagnosticContract { 4553 if !iter.page.NotDone() { 4554 return DiagnosticContract{} 4555 } 4556 return iter.page.Values()[iter.i] 4557} 4558 4559// Creates a new instance of the DiagnosticCollectionIterator type. 4560func NewDiagnosticCollectionIterator(page DiagnosticCollectionPage) DiagnosticCollectionIterator { 4561 return DiagnosticCollectionIterator{page: page} 4562} 4563 4564// IsEmpty returns true if the ListResult contains no values. 4565func (dc DiagnosticCollection) IsEmpty() bool { 4566 return dc.Value == nil || len(*dc.Value) == 0 4567} 4568 4569// hasNextLink returns true if the NextLink is not empty. 4570func (dc DiagnosticCollection) hasNextLink() bool { 4571 return dc.NextLink != nil && len(*dc.NextLink) != 0 4572} 4573 4574// diagnosticCollectionPreparer prepares a request to retrieve the next set of results. 4575// It returns nil if no more results exist. 4576func (dc DiagnosticCollection) diagnosticCollectionPreparer(ctx context.Context) (*http.Request, error) { 4577 if !dc.hasNextLink() { 4578 return nil, nil 4579 } 4580 return autorest.Prepare((&http.Request{}).WithContext(ctx), 4581 autorest.AsJSON(), 4582 autorest.AsGet(), 4583 autorest.WithBaseURL(to.String(dc.NextLink))) 4584} 4585 4586// DiagnosticCollectionPage contains a page of DiagnosticContract values. 4587type DiagnosticCollectionPage struct { 4588 fn func(context.Context, DiagnosticCollection) (DiagnosticCollection, error) 4589 dc DiagnosticCollection 4590} 4591 4592// NextWithContext advances to the next page of values. If there was an error making 4593// the request the page does not advance and the error is returned. 4594func (page *DiagnosticCollectionPage) NextWithContext(ctx context.Context) (err error) { 4595 if tracing.IsEnabled() { 4596 ctx = tracing.StartSpan(ctx, fqdn+"/DiagnosticCollectionPage.NextWithContext") 4597 defer func() { 4598 sc := -1 4599 if page.Response().Response.Response != nil { 4600 sc = page.Response().Response.Response.StatusCode 4601 } 4602 tracing.EndSpan(ctx, sc, err) 4603 }() 4604 } 4605 for { 4606 next, err := page.fn(ctx, page.dc) 4607 if err != nil { 4608 return err 4609 } 4610 page.dc = next 4611 if !next.hasNextLink() || !next.IsEmpty() { 4612 break 4613 } 4614 } 4615 return nil 4616} 4617 4618// Next advances to the next page of values. If there was an error making 4619// the request the page does not advance and the error is returned. 4620// Deprecated: Use NextWithContext() instead. 4621func (page *DiagnosticCollectionPage) Next() error { 4622 return page.NextWithContext(context.Background()) 4623} 4624 4625// NotDone returns true if the page enumeration should be started or is not yet complete. 4626func (page DiagnosticCollectionPage) NotDone() bool { 4627 return !page.dc.IsEmpty() 4628} 4629 4630// Response returns the raw server response from the last page request. 4631func (page DiagnosticCollectionPage) Response() DiagnosticCollection { 4632 return page.dc 4633} 4634 4635// Values returns the slice of values for the current page or nil if there are no values. 4636func (page DiagnosticCollectionPage) Values() []DiagnosticContract { 4637 if page.dc.IsEmpty() { 4638 return nil 4639 } 4640 return *page.dc.Value 4641} 4642 4643// Creates a new instance of the DiagnosticCollectionPage type. 4644func NewDiagnosticCollectionPage(cur DiagnosticCollection, getNextPage func(context.Context, DiagnosticCollection) (DiagnosticCollection, error)) DiagnosticCollectionPage { 4645 return DiagnosticCollectionPage{ 4646 fn: getNextPage, 4647 dc: cur, 4648 } 4649} 4650 4651// DiagnosticContract diagnostic details. 4652type DiagnosticContract struct { 4653 autorest.Response `json:"-"` 4654 // DiagnosticContractProperties - Diagnostic entity contract properties. 4655 *DiagnosticContractProperties `json:"properties,omitempty"` 4656 // ID - READ-ONLY; Resource ID. 4657 ID *string `json:"id,omitempty"` 4658 // Name - READ-ONLY; Resource name. 4659 Name *string `json:"name,omitempty"` 4660 // Type - READ-ONLY; Resource type for API Management resource. 4661 Type *string `json:"type,omitempty"` 4662} 4663 4664// MarshalJSON is the custom marshaler for DiagnosticContract. 4665func (dc DiagnosticContract) MarshalJSON() ([]byte, error) { 4666 objectMap := make(map[string]interface{}) 4667 if dc.DiagnosticContractProperties != nil { 4668 objectMap["properties"] = dc.DiagnosticContractProperties 4669 } 4670 return json.Marshal(objectMap) 4671} 4672 4673// UnmarshalJSON is the custom unmarshaler for DiagnosticContract struct. 4674func (dc *DiagnosticContract) UnmarshalJSON(body []byte) error { 4675 var m map[string]*json.RawMessage 4676 err := json.Unmarshal(body, &m) 4677 if err != nil { 4678 return err 4679 } 4680 for k, v := range m { 4681 switch k { 4682 case "properties": 4683 if v != nil { 4684 var diagnosticContractProperties DiagnosticContractProperties 4685 err = json.Unmarshal(*v, &diagnosticContractProperties) 4686 if err != nil { 4687 return err 4688 } 4689 dc.DiagnosticContractProperties = &diagnosticContractProperties 4690 } 4691 case "id": 4692 if v != nil { 4693 var ID string 4694 err = json.Unmarshal(*v, &ID) 4695 if err != nil { 4696 return err 4697 } 4698 dc.ID = &ID 4699 } 4700 case "name": 4701 if v != nil { 4702 var name string 4703 err = json.Unmarshal(*v, &name) 4704 if err != nil { 4705 return err 4706 } 4707 dc.Name = &name 4708 } 4709 case "type": 4710 if v != nil { 4711 var typeVar string 4712 err = json.Unmarshal(*v, &typeVar) 4713 if err != nil { 4714 return err 4715 } 4716 dc.Type = &typeVar 4717 } 4718 } 4719 } 4720 4721 return nil 4722} 4723 4724// DiagnosticContractProperties diagnostic Entity Properties 4725type DiagnosticContractProperties struct { 4726 // AlwaysLog - Specifies for what type of messages sampling settings should not apply. Possible values include: 'AllErrors' 4727 AlwaysLog AlwaysLog `json:"alwaysLog,omitempty"` 4728 // LoggerID - Resource Id of a target logger. 4729 LoggerID *string `json:"loggerId,omitempty"` 4730 // Sampling - Sampling settings for Diagnostic. 4731 Sampling *SamplingSettings `json:"sampling,omitempty"` 4732 // Frontend - Diagnostic settings for incoming/outgoing HTTP messages to the Gateway. 4733 Frontend *PipelineDiagnosticSettings `json:"frontend,omitempty"` 4734 // Backend - Diagnostic settings for incoming/outgoing HTTP messages to the Backend 4735 Backend *PipelineDiagnosticSettings `json:"backend,omitempty"` 4736 // LogClientIP - Log the ClientIP. Default is false. 4737 LogClientIP *bool `json:"logClientIp,omitempty"` 4738 // HTTPCorrelationProtocol - Sets correlation protocol to use for Application Insights diagnostics. Possible values include: 'HTTPCorrelationProtocolNone', 'HTTPCorrelationProtocolLegacy', 'HTTPCorrelationProtocolW3C' 4739 HTTPCorrelationProtocol HTTPCorrelationProtocol `json:"httpCorrelationProtocol,omitempty"` 4740 // Verbosity - The verbosity level applied to traces emitted by trace policies. Possible values include: 'Verbose', 'Information', 'Error' 4741 Verbosity Verbosity `json:"verbosity,omitempty"` 4742 // OperationNameFormat - The format of the Operation Name for Application Insights telemetries. Default is Name. Possible values include: 'Name', 'URL' 4743 OperationNameFormat OperationNameFormat `json:"operationNameFormat,omitempty"` 4744} 4745 4746// EmailTemplateCollection paged email template list representation. 4747type EmailTemplateCollection struct { 4748 autorest.Response `json:"-"` 4749 // Value - Page values. 4750 Value *[]EmailTemplateContract `json:"value,omitempty"` 4751 // Count - Total record count number across all pages. 4752 Count *int64 `json:"count,omitempty"` 4753 // NextLink - Next page link if any. 4754 NextLink *string `json:"nextLink,omitempty"` 4755} 4756 4757// EmailTemplateCollectionIterator provides access to a complete listing of EmailTemplateContract values. 4758type EmailTemplateCollectionIterator struct { 4759 i int 4760 page EmailTemplateCollectionPage 4761} 4762 4763// NextWithContext advances to the next value. If there was an error making 4764// the request the iterator does not advance and the error is returned. 4765func (iter *EmailTemplateCollectionIterator) NextWithContext(ctx context.Context) (err error) { 4766 if tracing.IsEnabled() { 4767 ctx = tracing.StartSpan(ctx, fqdn+"/EmailTemplateCollectionIterator.NextWithContext") 4768 defer func() { 4769 sc := -1 4770 if iter.Response().Response.Response != nil { 4771 sc = iter.Response().Response.Response.StatusCode 4772 } 4773 tracing.EndSpan(ctx, sc, err) 4774 }() 4775 } 4776 iter.i++ 4777 if iter.i < len(iter.page.Values()) { 4778 return nil 4779 } 4780 err = iter.page.NextWithContext(ctx) 4781 if err != nil { 4782 iter.i-- 4783 return err 4784 } 4785 iter.i = 0 4786 return nil 4787} 4788 4789// Next advances to the next value. If there was an error making 4790// the request the iterator does not advance and the error is returned. 4791// Deprecated: Use NextWithContext() instead. 4792func (iter *EmailTemplateCollectionIterator) Next() error { 4793 return iter.NextWithContext(context.Background()) 4794} 4795 4796// NotDone returns true if the enumeration should be started or is not yet complete. 4797func (iter EmailTemplateCollectionIterator) NotDone() bool { 4798 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 4799} 4800 4801// Response returns the raw server response from the last page request. 4802func (iter EmailTemplateCollectionIterator) Response() EmailTemplateCollection { 4803 return iter.page.Response() 4804} 4805 4806// Value returns the current value or a zero-initialized value if the 4807// iterator has advanced beyond the end of the collection. 4808func (iter EmailTemplateCollectionIterator) Value() EmailTemplateContract { 4809 if !iter.page.NotDone() { 4810 return EmailTemplateContract{} 4811 } 4812 return iter.page.Values()[iter.i] 4813} 4814 4815// Creates a new instance of the EmailTemplateCollectionIterator type. 4816func NewEmailTemplateCollectionIterator(page EmailTemplateCollectionPage) EmailTemplateCollectionIterator { 4817 return EmailTemplateCollectionIterator{page: page} 4818} 4819 4820// IsEmpty returns true if the ListResult contains no values. 4821func (etc EmailTemplateCollection) IsEmpty() bool { 4822 return etc.Value == nil || len(*etc.Value) == 0 4823} 4824 4825// hasNextLink returns true if the NextLink is not empty. 4826func (etc EmailTemplateCollection) hasNextLink() bool { 4827 return etc.NextLink != nil && len(*etc.NextLink) != 0 4828} 4829 4830// emailTemplateCollectionPreparer prepares a request to retrieve the next set of results. 4831// It returns nil if no more results exist. 4832func (etc EmailTemplateCollection) emailTemplateCollectionPreparer(ctx context.Context) (*http.Request, error) { 4833 if !etc.hasNextLink() { 4834 return nil, nil 4835 } 4836 return autorest.Prepare((&http.Request{}).WithContext(ctx), 4837 autorest.AsJSON(), 4838 autorest.AsGet(), 4839 autorest.WithBaseURL(to.String(etc.NextLink))) 4840} 4841 4842// EmailTemplateCollectionPage contains a page of EmailTemplateContract values. 4843type EmailTemplateCollectionPage struct { 4844 fn func(context.Context, EmailTemplateCollection) (EmailTemplateCollection, error) 4845 etc EmailTemplateCollection 4846} 4847 4848// NextWithContext advances to the next page of values. If there was an error making 4849// the request the page does not advance and the error is returned. 4850func (page *EmailTemplateCollectionPage) NextWithContext(ctx context.Context) (err error) { 4851 if tracing.IsEnabled() { 4852 ctx = tracing.StartSpan(ctx, fqdn+"/EmailTemplateCollectionPage.NextWithContext") 4853 defer func() { 4854 sc := -1 4855 if page.Response().Response.Response != nil { 4856 sc = page.Response().Response.Response.StatusCode 4857 } 4858 tracing.EndSpan(ctx, sc, err) 4859 }() 4860 } 4861 for { 4862 next, err := page.fn(ctx, page.etc) 4863 if err != nil { 4864 return err 4865 } 4866 page.etc = next 4867 if !next.hasNextLink() || !next.IsEmpty() { 4868 break 4869 } 4870 } 4871 return nil 4872} 4873 4874// Next advances to the next page of values. If there was an error making 4875// the request the page does not advance and the error is returned. 4876// Deprecated: Use NextWithContext() instead. 4877func (page *EmailTemplateCollectionPage) Next() error { 4878 return page.NextWithContext(context.Background()) 4879} 4880 4881// NotDone returns true if the page enumeration should be started or is not yet complete. 4882func (page EmailTemplateCollectionPage) NotDone() bool { 4883 return !page.etc.IsEmpty() 4884} 4885 4886// Response returns the raw server response from the last page request. 4887func (page EmailTemplateCollectionPage) Response() EmailTemplateCollection { 4888 return page.etc 4889} 4890 4891// Values returns the slice of values for the current page or nil if there are no values. 4892func (page EmailTemplateCollectionPage) Values() []EmailTemplateContract { 4893 if page.etc.IsEmpty() { 4894 return nil 4895 } 4896 return *page.etc.Value 4897} 4898 4899// Creates a new instance of the EmailTemplateCollectionPage type. 4900func NewEmailTemplateCollectionPage(cur EmailTemplateCollection, getNextPage func(context.Context, EmailTemplateCollection) (EmailTemplateCollection, error)) EmailTemplateCollectionPage { 4901 return EmailTemplateCollectionPage{ 4902 fn: getNextPage, 4903 etc: cur, 4904 } 4905} 4906 4907// EmailTemplateContract email Template details. 4908type EmailTemplateContract struct { 4909 autorest.Response `json:"-"` 4910 // EmailTemplateContractProperties - Email Template entity contract properties. 4911 *EmailTemplateContractProperties `json:"properties,omitempty"` 4912 // ID - READ-ONLY; Resource ID. 4913 ID *string `json:"id,omitempty"` 4914 // Name - READ-ONLY; Resource name. 4915 Name *string `json:"name,omitempty"` 4916 // Type - READ-ONLY; Resource type for API Management resource. 4917 Type *string `json:"type,omitempty"` 4918} 4919 4920// MarshalJSON is the custom marshaler for EmailTemplateContract. 4921func (etc EmailTemplateContract) MarshalJSON() ([]byte, error) { 4922 objectMap := make(map[string]interface{}) 4923 if etc.EmailTemplateContractProperties != nil { 4924 objectMap["properties"] = etc.EmailTemplateContractProperties 4925 } 4926 return json.Marshal(objectMap) 4927} 4928 4929// UnmarshalJSON is the custom unmarshaler for EmailTemplateContract struct. 4930func (etc *EmailTemplateContract) UnmarshalJSON(body []byte) error { 4931 var m map[string]*json.RawMessage 4932 err := json.Unmarshal(body, &m) 4933 if err != nil { 4934 return err 4935 } 4936 for k, v := range m { 4937 switch k { 4938 case "properties": 4939 if v != nil { 4940 var emailTemplateContractProperties EmailTemplateContractProperties 4941 err = json.Unmarshal(*v, &emailTemplateContractProperties) 4942 if err != nil { 4943 return err 4944 } 4945 etc.EmailTemplateContractProperties = &emailTemplateContractProperties 4946 } 4947 case "id": 4948 if v != nil { 4949 var ID string 4950 err = json.Unmarshal(*v, &ID) 4951 if err != nil { 4952 return err 4953 } 4954 etc.ID = &ID 4955 } 4956 case "name": 4957 if v != nil { 4958 var name string 4959 err = json.Unmarshal(*v, &name) 4960 if err != nil { 4961 return err 4962 } 4963 etc.Name = &name 4964 } 4965 case "type": 4966 if v != nil { 4967 var typeVar string 4968 err = json.Unmarshal(*v, &typeVar) 4969 if err != nil { 4970 return err 4971 } 4972 etc.Type = &typeVar 4973 } 4974 } 4975 } 4976 4977 return nil 4978} 4979 4980// EmailTemplateContractProperties email Template Contract properties. 4981type EmailTemplateContractProperties struct { 4982 // Subject - Subject of the Template. 4983 Subject *string `json:"subject,omitempty"` 4984 // Body - Email Template Body. This should be a valid XDocument 4985 Body *string `json:"body,omitempty"` 4986 // Title - Title of the Template. 4987 Title *string `json:"title,omitempty"` 4988 // Description - Description of the Email Template. 4989 Description *string `json:"description,omitempty"` 4990 // IsDefault - READ-ONLY; Whether the template is the default template provided by Api Management or has been edited. 4991 IsDefault *bool `json:"isDefault,omitempty"` 4992 // Parameters - Email Template Parameter values. 4993 Parameters *[]EmailTemplateParametersContractProperties `json:"parameters,omitempty"` 4994} 4995 4996// MarshalJSON is the custom marshaler for EmailTemplateContractProperties. 4997func (etcp EmailTemplateContractProperties) MarshalJSON() ([]byte, error) { 4998 objectMap := make(map[string]interface{}) 4999 if etcp.Subject != nil { 5000 objectMap["subject"] = etcp.Subject 5001 } 5002 if etcp.Body != nil { 5003 objectMap["body"] = etcp.Body 5004 } 5005 if etcp.Title != nil { 5006 objectMap["title"] = etcp.Title 5007 } 5008 if etcp.Description != nil { 5009 objectMap["description"] = etcp.Description 5010 } 5011 if etcp.Parameters != nil { 5012 objectMap["parameters"] = etcp.Parameters 5013 } 5014 return json.Marshal(objectMap) 5015} 5016 5017// EmailTemplateParametersContractProperties email Template Parameter contract. 5018type EmailTemplateParametersContractProperties struct { 5019 // Name - Template parameter name. 5020 Name *string `json:"name,omitempty"` 5021 // Title - Template parameter title. 5022 Title *string `json:"title,omitempty"` 5023 // Description - Template parameter description. 5024 Description *string `json:"description,omitempty"` 5025} 5026 5027// EmailTemplateUpdateParameterProperties email Template Update Contract properties. 5028type EmailTemplateUpdateParameterProperties struct { 5029 // Subject - Subject of the Template. 5030 Subject *string `json:"subject,omitempty"` 5031 // Title - Title of the Template. 5032 Title *string `json:"title,omitempty"` 5033 // Description - Description of the Email Template. 5034 Description *string `json:"description,omitempty"` 5035 // Body - Email Template Body. This should be a valid XDocument 5036 Body *string `json:"body,omitempty"` 5037 // Parameters - Email Template Parameter values. 5038 Parameters *[]EmailTemplateParametersContractProperties `json:"parameters,omitempty"` 5039} 5040 5041// EmailTemplateUpdateParameters email Template update Parameters. 5042type EmailTemplateUpdateParameters struct { 5043 // EmailTemplateUpdateParameterProperties - Email Template Update contract properties. 5044 *EmailTemplateUpdateParameterProperties `json:"properties,omitempty"` 5045} 5046 5047// MarshalJSON is the custom marshaler for EmailTemplateUpdateParameters. 5048func (etup EmailTemplateUpdateParameters) MarshalJSON() ([]byte, error) { 5049 objectMap := make(map[string]interface{}) 5050 if etup.EmailTemplateUpdateParameterProperties != nil { 5051 objectMap["properties"] = etup.EmailTemplateUpdateParameterProperties 5052 } 5053 return json.Marshal(objectMap) 5054} 5055 5056// UnmarshalJSON is the custom unmarshaler for EmailTemplateUpdateParameters struct. 5057func (etup *EmailTemplateUpdateParameters) UnmarshalJSON(body []byte) error { 5058 var m map[string]*json.RawMessage 5059 err := json.Unmarshal(body, &m) 5060 if err != nil { 5061 return err 5062 } 5063 for k, v := range m { 5064 switch k { 5065 case "properties": 5066 if v != nil { 5067 var emailTemplateUpdateParameterProperties EmailTemplateUpdateParameterProperties 5068 err = json.Unmarshal(*v, &emailTemplateUpdateParameterProperties) 5069 if err != nil { 5070 return err 5071 } 5072 etup.EmailTemplateUpdateParameterProperties = &emailTemplateUpdateParameterProperties 5073 } 5074 } 5075 } 5076 5077 return nil 5078} 5079 5080// ErrorFieldContract error Field contract. 5081type ErrorFieldContract struct { 5082 // Code - Property level error code. 5083 Code *string `json:"code,omitempty"` 5084 // Message - Human-readable representation of property-level error. 5085 Message *string `json:"message,omitempty"` 5086 // Target - Property name. 5087 Target *string `json:"target,omitempty"` 5088} 5089 5090// ErrorResponse error Response. 5091type ErrorResponse struct { 5092 // ErrorResponseBody - Properties of the Error Response. 5093 *ErrorResponseBody `json:"error,omitempty"` 5094} 5095 5096// MarshalJSON is the custom marshaler for ErrorResponse. 5097func (er ErrorResponse) MarshalJSON() ([]byte, error) { 5098 objectMap := make(map[string]interface{}) 5099 if er.ErrorResponseBody != nil { 5100 objectMap["error"] = er.ErrorResponseBody 5101 } 5102 return json.Marshal(objectMap) 5103} 5104 5105// UnmarshalJSON is the custom unmarshaler for ErrorResponse struct. 5106func (er *ErrorResponse) UnmarshalJSON(body []byte) error { 5107 var m map[string]*json.RawMessage 5108 err := json.Unmarshal(body, &m) 5109 if err != nil { 5110 return err 5111 } 5112 for k, v := range m { 5113 switch k { 5114 case "error": 5115 if v != nil { 5116 var errorResponseBody ErrorResponseBody 5117 err = json.Unmarshal(*v, &errorResponseBody) 5118 if err != nil { 5119 return err 5120 } 5121 er.ErrorResponseBody = &errorResponseBody 5122 } 5123 } 5124 } 5125 5126 return nil 5127} 5128 5129// ErrorResponseBody error Body contract. 5130type ErrorResponseBody struct { 5131 // Code - Service-defined error code. This code serves as a sub-status for the HTTP error code specified in the response. 5132 Code *string `json:"code,omitempty"` 5133 // Message - Human-readable representation of the error. 5134 Message *string `json:"message,omitempty"` 5135 // Details - The list of invalid fields send in request, in case of validation error. 5136 Details *[]ErrorFieldContract `json:"details,omitempty"` 5137} 5138 5139// GatewayCertificateAuthorityCollection paged Gateway certificate authority list representation. 5140type GatewayCertificateAuthorityCollection struct { 5141 autorest.Response `json:"-"` 5142 // Value - READ-ONLY; Page values. 5143 Value *[]GatewayCertificateAuthorityContract `json:"value,omitempty"` 5144 // NextLink - READ-ONLY; Next page link if any. 5145 NextLink *string `json:"nextLink,omitempty"` 5146} 5147 5148// GatewayCertificateAuthorityCollectionIterator provides access to a complete listing of 5149// GatewayCertificateAuthorityContract values. 5150type GatewayCertificateAuthorityCollectionIterator struct { 5151 i int 5152 page GatewayCertificateAuthorityCollectionPage 5153} 5154 5155// NextWithContext advances to the next value. If there was an error making 5156// the request the iterator does not advance and the error is returned. 5157func (iter *GatewayCertificateAuthorityCollectionIterator) NextWithContext(ctx context.Context) (err error) { 5158 if tracing.IsEnabled() { 5159 ctx = tracing.StartSpan(ctx, fqdn+"/GatewayCertificateAuthorityCollectionIterator.NextWithContext") 5160 defer func() { 5161 sc := -1 5162 if iter.Response().Response.Response != nil { 5163 sc = iter.Response().Response.Response.StatusCode 5164 } 5165 tracing.EndSpan(ctx, sc, err) 5166 }() 5167 } 5168 iter.i++ 5169 if iter.i < len(iter.page.Values()) { 5170 return nil 5171 } 5172 err = iter.page.NextWithContext(ctx) 5173 if err != nil { 5174 iter.i-- 5175 return err 5176 } 5177 iter.i = 0 5178 return nil 5179} 5180 5181// Next advances to the next value. If there was an error making 5182// the request the iterator does not advance and the error is returned. 5183// Deprecated: Use NextWithContext() instead. 5184func (iter *GatewayCertificateAuthorityCollectionIterator) Next() error { 5185 return iter.NextWithContext(context.Background()) 5186} 5187 5188// NotDone returns true if the enumeration should be started or is not yet complete. 5189func (iter GatewayCertificateAuthorityCollectionIterator) NotDone() bool { 5190 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 5191} 5192 5193// Response returns the raw server response from the last page request. 5194func (iter GatewayCertificateAuthorityCollectionIterator) Response() GatewayCertificateAuthorityCollection { 5195 return iter.page.Response() 5196} 5197 5198// Value returns the current value or a zero-initialized value if the 5199// iterator has advanced beyond the end of the collection. 5200func (iter GatewayCertificateAuthorityCollectionIterator) Value() GatewayCertificateAuthorityContract { 5201 if !iter.page.NotDone() { 5202 return GatewayCertificateAuthorityContract{} 5203 } 5204 return iter.page.Values()[iter.i] 5205} 5206 5207// Creates a new instance of the GatewayCertificateAuthorityCollectionIterator type. 5208func NewGatewayCertificateAuthorityCollectionIterator(page GatewayCertificateAuthorityCollectionPage) GatewayCertificateAuthorityCollectionIterator { 5209 return GatewayCertificateAuthorityCollectionIterator{page: page} 5210} 5211 5212// IsEmpty returns true if the ListResult contains no values. 5213func (gcac GatewayCertificateAuthorityCollection) IsEmpty() bool { 5214 return gcac.Value == nil || len(*gcac.Value) == 0 5215} 5216 5217// hasNextLink returns true if the NextLink is not empty. 5218func (gcac GatewayCertificateAuthorityCollection) hasNextLink() bool { 5219 return gcac.NextLink != nil && len(*gcac.NextLink) != 0 5220} 5221 5222// gatewayCertificateAuthorityCollectionPreparer prepares a request to retrieve the next set of results. 5223// It returns nil if no more results exist. 5224func (gcac GatewayCertificateAuthorityCollection) gatewayCertificateAuthorityCollectionPreparer(ctx context.Context) (*http.Request, error) { 5225 if !gcac.hasNextLink() { 5226 return nil, nil 5227 } 5228 return autorest.Prepare((&http.Request{}).WithContext(ctx), 5229 autorest.AsJSON(), 5230 autorest.AsGet(), 5231 autorest.WithBaseURL(to.String(gcac.NextLink))) 5232} 5233 5234// GatewayCertificateAuthorityCollectionPage contains a page of GatewayCertificateAuthorityContract values. 5235type GatewayCertificateAuthorityCollectionPage struct { 5236 fn func(context.Context, GatewayCertificateAuthorityCollection) (GatewayCertificateAuthorityCollection, error) 5237 gcac GatewayCertificateAuthorityCollection 5238} 5239 5240// NextWithContext advances to the next page of values. If there was an error making 5241// the request the page does not advance and the error is returned. 5242func (page *GatewayCertificateAuthorityCollectionPage) NextWithContext(ctx context.Context) (err error) { 5243 if tracing.IsEnabled() { 5244 ctx = tracing.StartSpan(ctx, fqdn+"/GatewayCertificateAuthorityCollectionPage.NextWithContext") 5245 defer func() { 5246 sc := -1 5247 if page.Response().Response.Response != nil { 5248 sc = page.Response().Response.Response.StatusCode 5249 } 5250 tracing.EndSpan(ctx, sc, err) 5251 }() 5252 } 5253 for { 5254 next, err := page.fn(ctx, page.gcac) 5255 if err != nil { 5256 return err 5257 } 5258 page.gcac = next 5259 if !next.hasNextLink() || !next.IsEmpty() { 5260 break 5261 } 5262 } 5263 return nil 5264} 5265 5266// Next advances to the next page of values. If there was an error making 5267// the request the page does not advance and the error is returned. 5268// Deprecated: Use NextWithContext() instead. 5269func (page *GatewayCertificateAuthorityCollectionPage) Next() error { 5270 return page.NextWithContext(context.Background()) 5271} 5272 5273// NotDone returns true if the page enumeration should be started or is not yet complete. 5274func (page GatewayCertificateAuthorityCollectionPage) NotDone() bool { 5275 return !page.gcac.IsEmpty() 5276} 5277 5278// Response returns the raw server response from the last page request. 5279func (page GatewayCertificateAuthorityCollectionPage) Response() GatewayCertificateAuthorityCollection { 5280 return page.gcac 5281} 5282 5283// Values returns the slice of values for the current page or nil if there are no values. 5284func (page GatewayCertificateAuthorityCollectionPage) Values() []GatewayCertificateAuthorityContract { 5285 if page.gcac.IsEmpty() { 5286 return nil 5287 } 5288 return *page.gcac.Value 5289} 5290 5291// Creates a new instance of the GatewayCertificateAuthorityCollectionPage type. 5292func NewGatewayCertificateAuthorityCollectionPage(cur GatewayCertificateAuthorityCollection, getNextPage func(context.Context, GatewayCertificateAuthorityCollection) (GatewayCertificateAuthorityCollection, error)) GatewayCertificateAuthorityCollectionPage { 5293 return GatewayCertificateAuthorityCollectionPage{ 5294 fn: getNextPage, 5295 gcac: cur, 5296 } 5297} 5298 5299// GatewayCertificateAuthorityContract gateway certificate authority details. 5300type GatewayCertificateAuthorityContract struct { 5301 autorest.Response `json:"-"` 5302 // GatewayCertificateAuthorityContractProperties - Gateway certificate authority details. 5303 *GatewayCertificateAuthorityContractProperties `json:"properties,omitempty"` 5304 // ID - READ-ONLY; Resource ID. 5305 ID *string `json:"id,omitempty"` 5306 // Name - READ-ONLY; Resource name. 5307 Name *string `json:"name,omitempty"` 5308 // Type - READ-ONLY; Resource type for API Management resource. 5309 Type *string `json:"type,omitempty"` 5310} 5311 5312// MarshalJSON is the custom marshaler for GatewayCertificateAuthorityContract. 5313func (gcac GatewayCertificateAuthorityContract) MarshalJSON() ([]byte, error) { 5314 objectMap := make(map[string]interface{}) 5315 if gcac.GatewayCertificateAuthorityContractProperties != nil { 5316 objectMap["properties"] = gcac.GatewayCertificateAuthorityContractProperties 5317 } 5318 return json.Marshal(objectMap) 5319} 5320 5321// UnmarshalJSON is the custom unmarshaler for GatewayCertificateAuthorityContract struct. 5322func (gcac *GatewayCertificateAuthorityContract) UnmarshalJSON(body []byte) error { 5323 var m map[string]*json.RawMessage 5324 err := json.Unmarshal(body, &m) 5325 if err != nil { 5326 return err 5327 } 5328 for k, v := range m { 5329 switch k { 5330 case "properties": 5331 if v != nil { 5332 var gatewayCertificateAuthorityContractProperties GatewayCertificateAuthorityContractProperties 5333 err = json.Unmarshal(*v, &gatewayCertificateAuthorityContractProperties) 5334 if err != nil { 5335 return err 5336 } 5337 gcac.GatewayCertificateAuthorityContractProperties = &gatewayCertificateAuthorityContractProperties 5338 } 5339 case "id": 5340 if v != nil { 5341 var ID string 5342 err = json.Unmarshal(*v, &ID) 5343 if err != nil { 5344 return err 5345 } 5346 gcac.ID = &ID 5347 } 5348 case "name": 5349 if v != nil { 5350 var name string 5351 err = json.Unmarshal(*v, &name) 5352 if err != nil { 5353 return err 5354 } 5355 gcac.Name = &name 5356 } 5357 case "type": 5358 if v != nil { 5359 var typeVar string 5360 err = json.Unmarshal(*v, &typeVar) 5361 if err != nil { 5362 return err 5363 } 5364 gcac.Type = &typeVar 5365 } 5366 } 5367 } 5368 5369 return nil 5370} 5371 5372// GatewayCertificateAuthorityContractProperties gateway certificate authority details. 5373type GatewayCertificateAuthorityContractProperties struct { 5374 // IsTrusted - Determines whether certificate authority is trusted. 5375 IsTrusted *bool `json:"isTrusted,omitempty"` 5376} 5377 5378// GatewayCollection paged Gateway list representation. 5379type GatewayCollection struct { 5380 autorest.Response `json:"-"` 5381 // Value - READ-ONLY; Page values. 5382 Value *[]GatewayContract `json:"value,omitempty"` 5383 // Count - Total record count number across all pages. 5384 Count *int64 `json:"count,omitempty"` 5385 // NextLink - READ-ONLY; Next page link if any. 5386 NextLink *string `json:"nextLink,omitempty"` 5387} 5388 5389// MarshalJSON is the custom marshaler for GatewayCollection. 5390func (gc GatewayCollection) MarshalJSON() ([]byte, error) { 5391 objectMap := make(map[string]interface{}) 5392 if gc.Count != nil { 5393 objectMap["count"] = gc.Count 5394 } 5395 return json.Marshal(objectMap) 5396} 5397 5398// GatewayCollectionIterator provides access to a complete listing of GatewayContract values. 5399type GatewayCollectionIterator struct { 5400 i int 5401 page GatewayCollectionPage 5402} 5403 5404// NextWithContext advances to the next value. If there was an error making 5405// the request the iterator does not advance and the error is returned. 5406func (iter *GatewayCollectionIterator) NextWithContext(ctx context.Context) (err error) { 5407 if tracing.IsEnabled() { 5408 ctx = tracing.StartSpan(ctx, fqdn+"/GatewayCollectionIterator.NextWithContext") 5409 defer func() { 5410 sc := -1 5411 if iter.Response().Response.Response != nil { 5412 sc = iter.Response().Response.Response.StatusCode 5413 } 5414 tracing.EndSpan(ctx, sc, err) 5415 }() 5416 } 5417 iter.i++ 5418 if iter.i < len(iter.page.Values()) { 5419 return nil 5420 } 5421 err = iter.page.NextWithContext(ctx) 5422 if err != nil { 5423 iter.i-- 5424 return err 5425 } 5426 iter.i = 0 5427 return nil 5428} 5429 5430// Next advances to the next value. If there was an error making 5431// the request the iterator does not advance and the error is returned. 5432// Deprecated: Use NextWithContext() instead. 5433func (iter *GatewayCollectionIterator) Next() error { 5434 return iter.NextWithContext(context.Background()) 5435} 5436 5437// NotDone returns true if the enumeration should be started or is not yet complete. 5438func (iter GatewayCollectionIterator) NotDone() bool { 5439 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 5440} 5441 5442// Response returns the raw server response from the last page request. 5443func (iter GatewayCollectionIterator) Response() GatewayCollection { 5444 return iter.page.Response() 5445} 5446 5447// Value returns the current value or a zero-initialized value if the 5448// iterator has advanced beyond the end of the collection. 5449func (iter GatewayCollectionIterator) Value() GatewayContract { 5450 if !iter.page.NotDone() { 5451 return GatewayContract{} 5452 } 5453 return iter.page.Values()[iter.i] 5454} 5455 5456// Creates a new instance of the GatewayCollectionIterator type. 5457func NewGatewayCollectionIterator(page GatewayCollectionPage) GatewayCollectionIterator { 5458 return GatewayCollectionIterator{page: page} 5459} 5460 5461// IsEmpty returns true if the ListResult contains no values. 5462func (gc GatewayCollection) IsEmpty() bool { 5463 return gc.Value == nil || len(*gc.Value) == 0 5464} 5465 5466// hasNextLink returns true if the NextLink is not empty. 5467func (gc GatewayCollection) hasNextLink() bool { 5468 return gc.NextLink != nil && len(*gc.NextLink) != 0 5469} 5470 5471// gatewayCollectionPreparer prepares a request to retrieve the next set of results. 5472// It returns nil if no more results exist. 5473func (gc GatewayCollection) gatewayCollectionPreparer(ctx context.Context) (*http.Request, error) { 5474 if !gc.hasNextLink() { 5475 return nil, nil 5476 } 5477 return autorest.Prepare((&http.Request{}).WithContext(ctx), 5478 autorest.AsJSON(), 5479 autorest.AsGet(), 5480 autorest.WithBaseURL(to.String(gc.NextLink))) 5481} 5482 5483// GatewayCollectionPage contains a page of GatewayContract values. 5484type GatewayCollectionPage struct { 5485 fn func(context.Context, GatewayCollection) (GatewayCollection, error) 5486 gc GatewayCollection 5487} 5488 5489// NextWithContext advances to the next page of values. If there was an error making 5490// the request the page does not advance and the error is returned. 5491func (page *GatewayCollectionPage) NextWithContext(ctx context.Context) (err error) { 5492 if tracing.IsEnabled() { 5493 ctx = tracing.StartSpan(ctx, fqdn+"/GatewayCollectionPage.NextWithContext") 5494 defer func() { 5495 sc := -1 5496 if page.Response().Response.Response != nil { 5497 sc = page.Response().Response.Response.StatusCode 5498 } 5499 tracing.EndSpan(ctx, sc, err) 5500 }() 5501 } 5502 for { 5503 next, err := page.fn(ctx, page.gc) 5504 if err != nil { 5505 return err 5506 } 5507 page.gc = next 5508 if !next.hasNextLink() || !next.IsEmpty() { 5509 break 5510 } 5511 } 5512 return nil 5513} 5514 5515// Next advances to the next page of values. If there was an error making 5516// the request the page does not advance and the error is returned. 5517// Deprecated: Use NextWithContext() instead. 5518func (page *GatewayCollectionPage) Next() error { 5519 return page.NextWithContext(context.Background()) 5520} 5521 5522// NotDone returns true if the page enumeration should be started or is not yet complete. 5523func (page GatewayCollectionPage) NotDone() bool { 5524 return !page.gc.IsEmpty() 5525} 5526 5527// Response returns the raw server response from the last page request. 5528func (page GatewayCollectionPage) Response() GatewayCollection { 5529 return page.gc 5530} 5531 5532// Values returns the slice of values for the current page or nil if there are no values. 5533func (page GatewayCollectionPage) Values() []GatewayContract { 5534 if page.gc.IsEmpty() { 5535 return nil 5536 } 5537 return *page.gc.Value 5538} 5539 5540// Creates a new instance of the GatewayCollectionPage type. 5541func NewGatewayCollectionPage(cur GatewayCollection, getNextPage func(context.Context, GatewayCollection) (GatewayCollection, error)) GatewayCollectionPage { 5542 return GatewayCollectionPage{ 5543 fn: getNextPage, 5544 gc: cur, 5545 } 5546} 5547 5548// GatewayContract gateway details. 5549type GatewayContract struct { 5550 autorest.Response `json:"-"` 5551 // GatewayContractProperties - Gateway details. 5552 *GatewayContractProperties `json:"properties,omitempty"` 5553 // ID - READ-ONLY; Resource ID. 5554 ID *string `json:"id,omitempty"` 5555 // Name - READ-ONLY; Resource name. 5556 Name *string `json:"name,omitempty"` 5557 // Type - READ-ONLY; Resource type for API Management resource. 5558 Type *string `json:"type,omitempty"` 5559} 5560 5561// MarshalJSON is the custom marshaler for GatewayContract. 5562func (gc GatewayContract) MarshalJSON() ([]byte, error) { 5563 objectMap := make(map[string]interface{}) 5564 if gc.GatewayContractProperties != nil { 5565 objectMap["properties"] = gc.GatewayContractProperties 5566 } 5567 return json.Marshal(objectMap) 5568} 5569 5570// UnmarshalJSON is the custom unmarshaler for GatewayContract struct. 5571func (gc *GatewayContract) UnmarshalJSON(body []byte) error { 5572 var m map[string]*json.RawMessage 5573 err := json.Unmarshal(body, &m) 5574 if err != nil { 5575 return err 5576 } 5577 for k, v := range m { 5578 switch k { 5579 case "properties": 5580 if v != nil { 5581 var gatewayContractProperties GatewayContractProperties 5582 err = json.Unmarshal(*v, &gatewayContractProperties) 5583 if err != nil { 5584 return err 5585 } 5586 gc.GatewayContractProperties = &gatewayContractProperties 5587 } 5588 case "id": 5589 if v != nil { 5590 var ID string 5591 err = json.Unmarshal(*v, &ID) 5592 if err != nil { 5593 return err 5594 } 5595 gc.ID = &ID 5596 } 5597 case "name": 5598 if v != nil { 5599 var name string 5600 err = json.Unmarshal(*v, &name) 5601 if err != nil { 5602 return err 5603 } 5604 gc.Name = &name 5605 } 5606 case "type": 5607 if v != nil { 5608 var typeVar string 5609 err = json.Unmarshal(*v, &typeVar) 5610 if err != nil { 5611 return err 5612 } 5613 gc.Type = &typeVar 5614 } 5615 } 5616 } 5617 5618 return nil 5619} 5620 5621// GatewayContractProperties properties of the Gateway contract. 5622type GatewayContractProperties struct { 5623 // LocationData - Gateway location. 5624 LocationData *ResourceLocationDataContract `json:"locationData,omitempty"` 5625 // Description - Gateway description 5626 Description *string `json:"description,omitempty"` 5627} 5628 5629// GatewayHostnameConfigurationCollection paged Gateway hostname configuration list representation. 5630type GatewayHostnameConfigurationCollection struct { 5631 autorest.Response `json:"-"` 5632 // Value - READ-ONLY; Page values. 5633 Value *[]GatewayHostnameConfigurationContract `json:"value,omitempty"` 5634 // NextLink - READ-ONLY; Next page link if any. 5635 NextLink *string `json:"nextLink,omitempty"` 5636} 5637 5638// GatewayHostnameConfigurationCollectionIterator provides access to a complete listing of 5639// GatewayHostnameConfigurationContract values. 5640type GatewayHostnameConfigurationCollectionIterator struct { 5641 i int 5642 page GatewayHostnameConfigurationCollectionPage 5643} 5644 5645// NextWithContext advances to the next value. If there was an error making 5646// the request the iterator does not advance and the error is returned. 5647func (iter *GatewayHostnameConfigurationCollectionIterator) NextWithContext(ctx context.Context) (err error) { 5648 if tracing.IsEnabled() { 5649 ctx = tracing.StartSpan(ctx, fqdn+"/GatewayHostnameConfigurationCollectionIterator.NextWithContext") 5650 defer func() { 5651 sc := -1 5652 if iter.Response().Response.Response != nil { 5653 sc = iter.Response().Response.Response.StatusCode 5654 } 5655 tracing.EndSpan(ctx, sc, err) 5656 }() 5657 } 5658 iter.i++ 5659 if iter.i < len(iter.page.Values()) { 5660 return nil 5661 } 5662 err = iter.page.NextWithContext(ctx) 5663 if err != nil { 5664 iter.i-- 5665 return err 5666 } 5667 iter.i = 0 5668 return nil 5669} 5670 5671// Next advances to the next value. If there was an error making 5672// the request the iterator does not advance and the error is returned. 5673// Deprecated: Use NextWithContext() instead. 5674func (iter *GatewayHostnameConfigurationCollectionIterator) Next() error { 5675 return iter.NextWithContext(context.Background()) 5676} 5677 5678// NotDone returns true if the enumeration should be started or is not yet complete. 5679func (iter GatewayHostnameConfigurationCollectionIterator) NotDone() bool { 5680 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 5681} 5682 5683// Response returns the raw server response from the last page request. 5684func (iter GatewayHostnameConfigurationCollectionIterator) Response() GatewayHostnameConfigurationCollection { 5685 return iter.page.Response() 5686} 5687 5688// Value returns the current value or a zero-initialized value if the 5689// iterator has advanced beyond the end of the collection. 5690func (iter GatewayHostnameConfigurationCollectionIterator) Value() GatewayHostnameConfigurationContract { 5691 if !iter.page.NotDone() { 5692 return GatewayHostnameConfigurationContract{} 5693 } 5694 return iter.page.Values()[iter.i] 5695} 5696 5697// Creates a new instance of the GatewayHostnameConfigurationCollectionIterator type. 5698func NewGatewayHostnameConfigurationCollectionIterator(page GatewayHostnameConfigurationCollectionPage) GatewayHostnameConfigurationCollectionIterator { 5699 return GatewayHostnameConfigurationCollectionIterator{page: page} 5700} 5701 5702// IsEmpty returns true if the ListResult contains no values. 5703func (ghcc GatewayHostnameConfigurationCollection) IsEmpty() bool { 5704 return ghcc.Value == nil || len(*ghcc.Value) == 0 5705} 5706 5707// hasNextLink returns true if the NextLink is not empty. 5708func (ghcc GatewayHostnameConfigurationCollection) hasNextLink() bool { 5709 return ghcc.NextLink != nil && len(*ghcc.NextLink) != 0 5710} 5711 5712// gatewayHostnameConfigurationCollectionPreparer prepares a request to retrieve the next set of results. 5713// It returns nil if no more results exist. 5714func (ghcc GatewayHostnameConfigurationCollection) gatewayHostnameConfigurationCollectionPreparer(ctx context.Context) (*http.Request, error) { 5715 if !ghcc.hasNextLink() { 5716 return nil, nil 5717 } 5718 return autorest.Prepare((&http.Request{}).WithContext(ctx), 5719 autorest.AsJSON(), 5720 autorest.AsGet(), 5721 autorest.WithBaseURL(to.String(ghcc.NextLink))) 5722} 5723 5724// GatewayHostnameConfigurationCollectionPage contains a page of GatewayHostnameConfigurationContract 5725// values. 5726type GatewayHostnameConfigurationCollectionPage struct { 5727 fn func(context.Context, GatewayHostnameConfigurationCollection) (GatewayHostnameConfigurationCollection, error) 5728 ghcc GatewayHostnameConfigurationCollection 5729} 5730 5731// NextWithContext advances to the next page of values. If there was an error making 5732// the request the page does not advance and the error is returned. 5733func (page *GatewayHostnameConfigurationCollectionPage) NextWithContext(ctx context.Context) (err error) { 5734 if tracing.IsEnabled() { 5735 ctx = tracing.StartSpan(ctx, fqdn+"/GatewayHostnameConfigurationCollectionPage.NextWithContext") 5736 defer func() { 5737 sc := -1 5738 if page.Response().Response.Response != nil { 5739 sc = page.Response().Response.Response.StatusCode 5740 } 5741 tracing.EndSpan(ctx, sc, err) 5742 }() 5743 } 5744 for { 5745 next, err := page.fn(ctx, page.ghcc) 5746 if err != nil { 5747 return err 5748 } 5749 page.ghcc = next 5750 if !next.hasNextLink() || !next.IsEmpty() { 5751 break 5752 } 5753 } 5754 return nil 5755} 5756 5757// Next advances to the next page of values. If there was an error making 5758// the request the page does not advance and the error is returned. 5759// Deprecated: Use NextWithContext() instead. 5760func (page *GatewayHostnameConfigurationCollectionPage) Next() error { 5761 return page.NextWithContext(context.Background()) 5762} 5763 5764// NotDone returns true if the page enumeration should be started or is not yet complete. 5765func (page GatewayHostnameConfigurationCollectionPage) NotDone() bool { 5766 return !page.ghcc.IsEmpty() 5767} 5768 5769// Response returns the raw server response from the last page request. 5770func (page GatewayHostnameConfigurationCollectionPage) Response() GatewayHostnameConfigurationCollection { 5771 return page.ghcc 5772} 5773 5774// Values returns the slice of values for the current page or nil if there are no values. 5775func (page GatewayHostnameConfigurationCollectionPage) Values() []GatewayHostnameConfigurationContract { 5776 if page.ghcc.IsEmpty() { 5777 return nil 5778 } 5779 return *page.ghcc.Value 5780} 5781 5782// Creates a new instance of the GatewayHostnameConfigurationCollectionPage type. 5783func NewGatewayHostnameConfigurationCollectionPage(cur GatewayHostnameConfigurationCollection, getNextPage func(context.Context, GatewayHostnameConfigurationCollection) (GatewayHostnameConfigurationCollection, error)) GatewayHostnameConfigurationCollectionPage { 5784 return GatewayHostnameConfigurationCollectionPage{ 5785 fn: getNextPage, 5786 ghcc: cur, 5787 } 5788} 5789 5790// GatewayHostnameConfigurationContract gateway hostname configuration details. 5791type GatewayHostnameConfigurationContract struct { 5792 autorest.Response `json:"-"` 5793 // GatewayHostnameConfigurationContractProperties - Gateway hostname configuration details. 5794 *GatewayHostnameConfigurationContractProperties `json:"properties,omitempty"` 5795 // ID - READ-ONLY; Resource ID. 5796 ID *string `json:"id,omitempty"` 5797 // Name - READ-ONLY; Resource name. 5798 Name *string `json:"name,omitempty"` 5799 // Type - READ-ONLY; Resource type for API Management resource. 5800 Type *string `json:"type,omitempty"` 5801} 5802 5803// MarshalJSON is the custom marshaler for GatewayHostnameConfigurationContract. 5804func (ghcc GatewayHostnameConfigurationContract) MarshalJSON() ([]byte, error) { 5805 objectMap := make(map[string]interface{}) 5806 if ghcc.GatewayHostnameConfigurationContractProperties != nil { 5807 objectMap["properties"] = ghcc.GatewayHostnameConfigurationContractProperties 5808 } 5809 return json.Marshal(objectMap) 5810} 5811 5812// UnmarshalJSON is the custom unmarshaler for GatewayHostnameConfigurationContract struct. 5813func (ghcc *GatewayHostnameConfigurationContract) UnmarshalJSON(body []byte) error { 5814 var m map[string]*json.RawMessage 5815 err := json.Unmarshal(body, &m) 5816 if err != nil { 5817 return err 5818 } 5819 for k, v := range m { 5820 switch k { 5821 case "properties": 5822 if v != nil { 5823 var gatewayHostnameConfigurationContractProperties GatewayHostnameConfigurationContractProperties 5824 err = json.Unmarshal(*v, &gatewayHostnameConfigurationContractProperties) 5825 if err != nil { 5826 return err 5827 } 5828 ghcc.GatewayHostnameConfigurationContractProperties = &gatewayHostnameConfigurationContractProperties 5829 } 5830 case "id": 5831 if v != nil { 5832 var ID string 5833 err = json.Unmarshal(*v, &ID) 5834 if err != nil { 5835 return err 5836 } 5837 ghcc.ID = &ID 5838 } 5839 case "name": 5840 if v != nil { 5841 var name string 5842 err = json.Unmarshal(*v, &name) 5843 if err != nil { 5844 return err 5845 } 5846 ghcc.Name = &name 5847 } 5848 case "type": 5849 if v != nil { 5850 var typeVar string 5851 err = json.Unmarshal(*v, &typeVar) 5852 if err != nil { 5853 return err 5854 } 5855 ghcc.Type = &typeVar 5856 } 5857 } 5858 } 5859 5860 return nil 5861} 5862 5863// GatewayHostnameConfigurationContractProperties gateway hostname configuration details. 5864type GatewayHostnameConfigurationContractProperties struct { 5865 // Hostname - Hostname value. Supports valid domain name, partial or full wildcard 5866 Hostname *string `json:"hostname,omitempty"` 5867 // CertificateID - Identifier of Certificate entity that will be used for TLS connection establishment 5868 CertificateID *string `json:"certificateId,omitempty"` 5869 // NegotiateClientCertificate - Determines whether gateway requests client certificate 5870 NegotiateClientCertificate *bool `json:"negotiateClientCertificate,omitempty"` 5871 // TLS10Enabled - Specifies if TLS 1.0 is supported 5872 TLS10Enabled *bool `json:"tls10Enabled,omitempty"` 5873 // TLS11Enabled - Specifies if TLS 1.1 is supported 5874 TLS11Enabled *bool `json:"tls11Enabled,omitempty"` 5875 // HTTP2Enabled - Specifies if HTTP/2.0 is supported 5876 HTTP2Enabled *bool `json:"http2Enabled,omitempty"` 5877} 5878 5879// GatewayKeyRegenerationRequestContract gateway key regeneration request contract properties. 5880type GatewayKeyRegenerationRequestContract struct { 5881 // KeyType - The Key being regenerated. Possible values include: 'Primary', 'Secondary' 5882 KeyType KeyType `json:"keyType,omitempty"` 5883} 5884 5885// GatewayKeysContract gateway authentication keys. 5886type GatewayKeysContract struct { 5887 autorest.Response `json:"-"` 5888 // Primary - Primary gateway key. 5889 Primary *string `json:"primary,omitempty"` 5890 // Secondary - Secondary gateway key. 5891 Secondary *string `json:"secondary,omitempty"` 5892} 5893 5894// GatewayTokenContract gateway access token. 5895type GatewayTokenContract struct { 5896 autorest.Response `json:"-"` 5897 // Value - Shared Access Authentication token value for the Gateway. 5898 Value *string `json:"value,omitempty"` 5899} 5900 5901// GatewayTokenRequestContract gateway token request contract properties. 5902type GatewayTokenRequestContract struct { 5903 // KeyType - The Key to be used to generate gateway token. Possible values include: 'Primary', 'Secondary' 5904 KeyType KeyType `json:"keyType,omitempty"` 5905 // 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. 5906 Expiry *date.Time `json:"expiry,omitempty"` 5907} 5908 5909// GenerateSsoURLResult generate SSO Url operations response details. 5910type GenerateSsoURLResult struct { 5911 autorest.Response `json:"-"` 5912 // Value - Redirect Url containing the SSO URL value. 5913 Value *string `json:"value,omitempty"` 5914} 5915 5916// GroupCollection paged Group list representation. 5917type GroupCollection struct { 5918 autorest.Response `json:"-"` 5919 // Value - Page values. 5920 Value *[]GroupContract `json:"value,omitempty"` 5921 // Count - Total record count number across all pages. 5922 Count *int64 `json:"count,omitempty"` 5923 // NextLink - Next page link if any. 5924 NextLink *string `json:"nextLink,omitempty"` 5925} 5926 5927// GroupCollectionIterator provides access to a complete listing of GroupContract values. 5928type GroupCollectionIterator struct { 5929 i int 5930 page GroupCollectionPage 5931} 5932 5933// NextWithContext advances to the next value. If there was an error making 5934// the request the iterator does not advance and the error is returned. 5935func (iter *GroupCollectionIterator) NextWithContext(ctx context.Context) (err error) { 5936 if tracing.IsEnabled() { 5937 ctx = tracing.StartSpan(ctx, fqdn+"/GroupCollectionIterator.NextWithContext") 5938 defer func() { 5939 sc := -1 5940 if iter.Response().Response.Response != nil { 5941 sc = iter.Response().Response.Response.StatusCode 5942 } 5943 tracing.EndSpan(ctx, sc, err) 5944 }() 5945 } 5946 iter.i++ 5947 if iter.i < len(iter.page.Values()) { 5948 return nil 5949 } 5950 err = iter.page.NextWithContext(ctx) 5951 if err != nil { 5952 iter.i-- 5953 return err 5954 } 5955 iter.i = 0 5956 return nil 5957} 5958 5959// Next advances to the next value. If there was an error making 5960// the request the iterator does not advance and the error is returned. 5961// Deprecated: Use NextWithContext() instead. 5962func (iter *GroupCollectionIterator) Next() error { 5963 return iter.NextWithContext(context.Background()) 5964} 5965 5966// NotDone returns true if the enumeration should be started or is not yet complete. 5967func (iter GroupCollectionIterator) NotDone() bool { 5968 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 5969} 5970 5971// Response returns the raw server response from the last page request. 5972func (iter GroupCollectionIterator) Response() GroupCollection { 5973 return iter.page.Response() 5974} 5975 5976// Value returns the current value or a zero-initialized value if the 5977// iterator has advanced beyond the end of the collection. 5978func (iter GroupCollectionIterator) Value() GroupContract { 5979 if !iter.page.NotDone() { 5980 return GroupContract{} 5981 } 5982 return iter.page.Values()[iter.i] 5983} 5984 5985// Creates a new instance of the GroupCollectionIterator type. 5986func NewGroupCollectionIterator(page GroupCollectionPage) GroupCollectionIterator { 5987 return GroupCollectionIterator{page: page} 5988} 5989 5990// IsEmpty returns true if the ListResult contains no values. 5991func (gc GroupCollection) IsEmpty() bool { 5992 return gc.Value == nil || len(*gc.Value) == 0 5993} 5994 5995// hasNextLink returns true if the NextLink is not empty. 5996func (gc GroupCollection) hasNextLink() bool { 5997 return gc.NextLink != nil && len(*gc.NextLink) != 0 5998} 5999 6000// groupCollectionPreparer prepares a request to retrieve the next set of results. 6001// It returns nil if no more results exist. 6002func (gc GroupCollection) groupCollectionPreparer(ctx context.Context) (*http.Request, error) { 6003 if !gc.hasNextLink() { 6004 return nil, nil 6005 } 6006 return autorest.Prepare((&http.Request{}).WithContext(ctx), 6007 autorest.AsJSON(), 6008 autorest.AsGet(), 6009 autorest.WithBaseURL(to.String(gc.NextLink))) 6010} 6011 6012// GroupCollectionPage contains a page of GroupContract values. 6013type GroupCollectionPage struct { 6014 fn func(context.Context, GroupCollection) (GroupCollection, error) 6015 gc GroupCollection 6016} 6017 6018// NextWithContext advances to the next page of values. If there was an error making 6019// the request the page does not advance and the error is returned. 6020func (page *GroupCollectionPage) NextWithContext(ctx context.Context) (err error) { 6021 if tracing.IsEnabled() { 6022 ctx = tracing.StartSpan(ctx, fqdn+"/GroupCollectionPage.NextWithContext") 6023 defer func() { 6024 sc := -1 6025 if page.Response().Response.Response != nil { 6026 sc = page.Response().Response.Response.StatusCode 6027 } 6028 tracing.EndSpan(ctx, sc, err) 6029 }() 6030 } 6031 for { 6032 next, err := page.fn(ctx, page.gc) 6033 if err != nil { 6034 return err 6035 } 6036 page.gc = next 6037 if !next.hasNextLink() || !next.IsEmpty() { 6038 break 6039 } 6040 } 6041 return nil 6042} 6043 6044// Next advances to the next page of values. If there was an error making 6045// the request the page does not advance and the error is returned. 6046// Deprecated: Use NextWithContext() instead. 6047func (page *GroupCollectionPage) Next() error { 6048 return page.NextWithContext(context.Background()) 6049} 6050 6051// NotDone returns true if the page enumeration should be started or is not yet complete. 6052func (page GroupCollectionPage) NotDone() bool { 6053 return !page.gc.IsEmpty() 6054} 6055 6056// Response returns the raw server response from the last page request. 6057func (page GroupCollectionPage) Response() GroupCollection { 6058 return page.gc 6059} 6060 6061// Values returns the slice of values for the current page or nil if there are no values. 6062func (page GroupCollectionPage) Values() []GroupContract { 6063 if page.gc.IsEmpty() { 6064 return nil 6065 } 6066 return *page.gc.Value 6067} 6068 6069// Creates a new instance of the GroupCollectionPage type. 6070func NewGroupCollectionPage(cur GroupCollection, getNextPage func(context.Context, GroupCollection) (GroupCollection, error)) GroupCollectionPage { 6071 return GroupCollectionPage{ 6072 fn: getNextPage, 6073 gc: cur, 6074 } 6075} 6076 6077// GroupContract contract details. 6078type GroupContract struct { 6079 autorest.Response `json:"-"` 6080 // GroupContractProperties - Group entity contract properties. 6081 *GroupContractProperties `json:"properties,omitempty"` 6082 // ID - READ-ONLY; Resource ID. 6083 ID *string `json:"id,omitempty"` 6084 // Name - READ-ONLY; Resource name. 6085 Name *string `json:"name,omitempty"` 6086 // Type - READ-ONLY; Resource type for API Management resource. 6087 Type *string `json:"type,omitempty"` 6088} 6089 6090// MarshalJSON is the custom marshaler for GroupContract. 6091func (gc GroupContract) MarshalJSON() ([]byte, error) { 6092 objectMap := make(map[string]interface{}) 6093 if gc.GroupContractProperties != nil { 6094 objectMap["properties"] = gc.GroupContractProperties 6095 } 6096 return json.Marshal(objectMap) 6097} 6098 6099// UnmarshalJSON is the custom unmarshaler for GroupContract struct. 6100func (gc *GroupContract) UnmarshalJSON(body []byte) error { 6101 var m map[string]*json.RawMessage 6102 err := json.Unmarshal(body, &m) 6103 if err != nil { 6104 return err 6105 } 6106 for k, v := range m { 6107 switch k { 6108 case "properties": 6109 if v != nil { 6110 var groupContractProperties GroupContractProperties 6111 err = json.Unmarshal(*v, &groupContractProperties) 6112 if err != nil { 6113 return err 6114 } 6115 gc.GroupContractProperties = &groupContractProperties 6116 } 6117 case "id": 6118 if v != nil { 6119 var ID string 6120 err = json.Unmarshal(*v, &ID) 6121 if err != nil { 6122 return err 6123 } 6124 gc.ID = &ID 6125 } 6126 case "name": 6127 if v != nil { 6128 var name string 6129 err = json.Unmarshal(*v, &name) 6130 if err != nil { 6131 return err 6132 } 6133 gc.Name = &name 6134 } 6135 case "type": 6136 if v != nil { 6137 var typeVar string 6138 err = json.Unmarshal(*v, &typeVar) 6139 if err != nil { 6140 return err 6141 } 6142 gc.Type = &typeVar 6143 } 6144 } 6145 } 6146 6147 return nil 6148} 6149 6150// GroupContractProperties group contract Properties. 6151type GroupContractProperties struct { 6152 // DisplayName - Group name. 6153 DisplayName *string `json:"displayName,omitempty"` 6154 // Description - Group description. Can contain HTML formatting tags. 6155 Description *string `json:"description,omitempty"` 6156 // BuiltIn - READ-ONLY; true if the group is one of the three system groups (Administrators, Developers, or Guests); otherwise false. 6157 BuiltIn *bool `json:"builtIn,omitempty"` 6158 // Type - Group type. Possible values include: 'Custom', 'System', 'External' 6159 Type GroupType `json:"type,omitempty"` 6160 // 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. 6161 ExternalID *string `json:"externalId,omitempty"` 6162} 6163 6164// MarshalJSON is the custom marshaler for GroupContractProperties. 6165func (gcp GroupContractProperties) MarshalJSON() ([]byte, error) { 6166 objectMap := make(map[string]interface{}) 6167 if gcp.DisplayName != nil { 6168 objectMap["displayName"] = gcp.DisplayName 6169 } 6170 if gcp.Description != nil { 6171 objectMap["description"] = gcp.Description 6172 } 6173 if gcp.Type != "" { 6174 objectMap["type"] = gcp.Type 6175 } 6176 if gcp.ExternalID != nil { 6177 objectMap["externalId"] = gcp.ExternalID 6178 } 6179 return json.Marshal(objectMap) 6180} 6181 6182// GroupCreateParameters parameters supplied to the Create Group operation. 6183type GroupCreateParameters struct { 6184 // GroupCreateParametersProperties - Properties supplied to Create Group operation. 6185 *GroupCreateParametersProperties `json:"properties,omitempty"` 6186} 6187 6188// MarshalJSON is the custom marshaler for GroupCreateParameters. 6189func (gcp GroupCreateParameters) MarshalJSON() ([]byte, error) { 6190 objectMap := make(map[string]interface{}) 6191 if gcp.GroupCreateParametersProperties != nil { 6192 objectMap["properties"] = gcp.GroupCreateParametersProperties 6193 } 6194 return json.Marshal(objectMap) 6195} 6196 6197// UnmarshalJSON is the custom unmarshaler for GroupCreateParameters struct. 6198func (gcp *GroupCreateParameters) UnmarshalJSON(body []byte) error { 6199 var m map[string]*json.RawMessage 6200 err := json.Unmarshal(body, &m) 6201 if err != nil { 6202 return err 6203 } 6204 for k, v := range m { 6205 switch k { 6206 case "properties": 6207 if v != nil { 6208 var groupCreateParametersProperties GroupCreateParametersProperties 6209 err = json.Unmarshal(*v, &groupCreateParametersProperties) 6210 if err != nil { 6211 return err 6212 } 6213 gcp.GroupCreateParametersProperties = &groupCreateParametersProperties 6214 } 6215 } 6216 } 6217 6218 return nil 6219} 6220 6221// GroupCreateParametersProperties parameters supplied to the Create Group operation. 6222type GroupCreateParametersProperties struct { 6223 // DisplayName - Group name. 6224 DisplayName *string `json:"displayName,omitempty"` 6225 // Description - Group description. 6226 Description *string `json:"description,omitempty"` 6227 // Type - Group type. Possible values include: 'Custom', 'System', 'External' 6228 Type GroupType `json:"type,omitempty"` 6229 // 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. 6230 ExternalID *string `json:"externalId,omitempty"` 6231} 6232 6233// GroupUpdateParameters parameters supplied to the Update Group operation. 6234type GroupUpdateParameters struct { 6235 // GroupUpdateParametersProperties - Group entity update contract properties. 6236 *GroupUpdateParametersProperties `json:"properties,omitempty"` 6237} 6238 6239// MarshalJSON is the custom marshaler for GroupUpdateParameters. 6240func (gup GroupUpdateParameters) MarshalJSON() ([]byte, error) { 6241 objectMap := make(map[string]interface{}) 6242 if gup.GroupUpdateParametersProperties != nil { 6243 objectMap["properties"] = gup.GroupUpdateParametersProperties 6244 } 6245 return json.Marshal(objectMap) 6246} 6247 6248// UnmarshalJSON is the custom unmarshaler for GroupUpdateParameters struct. 6249func (gup *GroupUpdateParameters) UnmarshalJSON(body []byte) error { 6250 var m map[string]*json.RawMessage 6251 err := json.Unmarshal(body, &m) 6252 if err != nil { 6253 return err 6254 } 6255 for k, v := range m { 6256 switch k { 6257 case "properties": 6258 if v != nil { 6259 var groupUpdateParametersProperties GroupUpdateParametersProperties 6260 err = json.Unmarshal(*v, &groupUpdateParametersProperties) 6261 if err != nil { 6262 return err 6263 } 6264 gup.GroupUpdateParametersProperties = &groupUpdateParametersProperties 6265 } 6266 } 6267 } 6268 6269 return nil 6270} 6271 6272// GroupUpdateParametersProperties parameters supplied to the Update Group operation. 6273type GroupUpdateParametersProperties struct { 6274 // DisplayName - Group name. 6275 DisplayName *string `json:"displayName,omitempty"` 6276 // Description - Group description. 6277 Description *string `json:"description,omitempty"` 6278 // Type - Group type. Possible values include: 'Custom', 'System', 'External' 6279 Type GroupType `json:"type,omitempty"` 6280 // 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. 6281 ExternalID *string `json:"externalId,omitempty"` 6282} 6283 6284// HostnameConfiguration custom hostname configuration. 6285type HostnameConfiguration struct { 6286 // Type - Hostname type. Possible values include: 'HostnameTypeProxy', 'HostnameTypePortal', 'HostnameTypeManagement', 'HostnameTypeScm', 'HostnameTypeDeveloperPortal' 6287 Type HostnameType `json:"type,omitempty"` 6288 // HostName - Hostname to configure on the Api Management service. 6289 HostName *string `json:"hostName,omitempty"` 6290 // 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* 6291 KeyVaultID *string `json:"keyVaultId,omitempty"` 6292 // IdentityClientID - System or User Assigned Managed identity clientId as generated by Azure AD, which has GET access to the keyVault containing the SSL certificate. 6293 IdentityClientID *string `json:"identityClientId,omitempty"` 6294 // EncodedCertificate - Base64 Encoded certificate. 6295 EncodedCertificate *string `json:"encodedCertificate,omitempty"` 6296 // CertificatePassword - Certificate Password. 6297 CertificatePassword *string `json:"certificatePassword,omitempty"` 6298 // 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. 6299 DefaultSslBinding *bool `json:"defaultSslBinding,omitempty"` 6300 // NegotiateClientCertificate - Specify true to always negotiate client certificate on the hostname. Default Value is false. 6301 NegotiateClientCertificate *bool `json:"negotiateClientCertificate,omitempty"` 6302 // Certificate - Certificate information. 6303 Certificate *CertificateInformation `json:"certificate,omitempty"` 6304} 6305 6306// HTTPMessageDiagnostic http message diagnostic settings. 6307type HTTPMessageDiagnostic struct { 6308 // Headers - Array of HTTP Headers to log. 6309 Headers *[]string `json:"headers,omitempty"` 6310 // Body - Body logging settings. 6311 Body *BodyDiagnosticSettings `json:"body,omitempty"` 6312 // DataMasking - Data masking settings. 6313 DataMasking *DataMasking `json:"dataMasking,omitempty"` 6314} 6315 6316// IdentityProviderBaseParameters identity Provider Base Parameter Properties. 6317type IdentityProviderBaseParameters struct { 6318 // Type - Identity Provider Type identifier. Possible values include: 'Facebook', 'Google', 'Microsoft', 'Twitter', 'Aad', 'AadB2C' 6319 Type IdentityProviderType `json:"type,omitempty"` 6320 // SigninTenant - The TenantId to use instead of Common when logging into Active Directory 6321 SigninTenant *string `json:"signinTenant,omitempty"` 6322 // AllowedTenants - List of Allowed Tenants when configuring Azure Active Directory login. 6323 AllowedTenants *[]string `json:"allowedTenants,omitempty"` 6324 // Authority - OpenID Connect discovery endpoint hostname for AAD or AAD B2C. 6325 Authority *string `json:"authority,omitempty"` 6326 // SignupPolicyName - Signup Policy Name. Only applies to AAD B2C Identity Provider. 6327 SignupPolicyName *string `json:"signupPolicyName,omitempty"` 6328 // SigninPolicyName - Signin Policy Name. Only applies to AAD B2C Identity Provider. 6329 SigninPolicyName *string `json:"signinPolicyName,omitempty"` 6330 // ProfileEditingPolicyName - Profile Editing Policy Name. Only applies to AAD B2C Identity Provider. 6331 ProfileEditingPolicyName *string `json:"profileEditingPolicyName,omitempty"` 6332 // PasswordResetPolicyName - Password Reset Policy Name. Only applies to AAD B2C Identity Provider. 6333 PasswordResetPolicyName *string `json:"passwordResetPolicyName,omitempty"` 6334} 6335 6336// IdentityProviderContract identity Provider details. 6337type IdentityProviderContract struct { 6338 autorest.Response `json:"-"` 6339 // IdentityProviderContractProperties - Identity Provider contract properties. 6340 *IdentityProviderContractProperties `json:"properties,omitempty"` 6341 // ID - READ-ONLY; Resource ID. 6342 ID *string `json:"id,omitempty"` 6343 // Name - READ-ONLY; Resource name. 6344 Name *string `json:"name,omitempty"` 6345 // Type - READ-ONLY; Resource type for API Management resource. 6346 Type *string `json:"type,omitempty"` 6347} 6348 6349// MarshalJSON is the custom marshaler for IdentityProviderContract. 6350func (ipc IdentityProviderContract) MarshalJSON() ([]byte, error) { 6351 objectMap := make(map[string]interface{}) 6352 if ipc.IdentityProviderContractProperties != nil { 6353 objectMap["properties"] = ipc.IdentityProviderContractProperties 6354 } 6355 return json.Marshal(objectMap) 6356} 6357 6358// UnmarshalJSON is the custom unmarshaler for IdentityProviderContract struct. 6359func (ipc *IdentityProviderContract) UnmarshalJSON(body []byte) error { 6360 var m map[string]*json.RawMessage 6361 err := json.Unmarshal(body, &m) 6362 if err != nil { 6363 return err 6364 } 6365 for k, v := range m { 6366 switch k { 6367 case "properties": 6368 if v != nil { 6369 var identityProviderContractProperties IdentityProviderContractProperties 6370 err = json.Unmarshal(*v, &identityProviderContractProperties) 6371 if err != nil { 6372 return err 6373 } 6374 ipc.IdentityProviderContractProperties = &identityProviderContractProperties 6375 } 6376 case "id": 6377 if v != nil { 6378 var ID string 6379 err = json.Unmarshal(*v, &ID) 6380 if err != nil { 6381 return err 6382 } 6383 ipc.ID = &ID 6384 } 6385 case "name": 6386 if v != nil { 6387 var name string 6388 err = json.Unmarshal(*v, &name) 6389 if err != nil { 6390 return err 6391 } 6392 ipc.Name = &name 6393 } 6394 case "type": 6395 if v != nil { 6396 var typeVar string 6397 err = json.Unmarshal(*v, &typeVar) 6398 if err != nil { 6399 return err 6400 } 6401 ipc.Type = &typeVar 6402 } 6403 } 6404 } 6405 6406 return nil 6407} 6408 6409// IdentityProviderContractProperties the external Identity Providers like Facebook, Google, Microsoft, 6410// Twitter or Azure Active Directory which can be used to enable access to the API Management service 6411// developer portal for all users. 6412type IdentityProviderContractProperties struct { 6413 // 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. 6414 ClientID *string `json:"clientId,omitempty"` 6415 // 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. 6416 ClientSecret *string `json:"clientSecret,omitempty"` 6417 // Type - Identity Provider Type identifier. Possible values include: 'Facebook', 'Google', 'Microsoft', 'Twitter', 'Aad', 'AadB2C' 6418 Type IdentityProviderType `json:"type,omitempty"` 6419 // SigninTenant - The TenantId to use instead of Common when logging into Active Directory 6420 SigninTenant *string `json:"signinTenant,omitempty"` 6421 // AllowedTenants - List of Allowed Tenants when configuring Azure Active Directory login. 6422 AllowedTenants *[]string `json:"allowedTenants,omitempty"` 6423 // Authority - OpenID Connect discovery endpoint hostname for AAD or AAD B2C. 6424 Authority *string `json:"authority,omitempty"` 6425 // SignupPolicyName - Signup Policy Name. Only applies to AAD B2C Identity Provider. 6426 SignupPolicyName *string `json:"signupPolicyName,omitempty"` 6427 // SigninPolicyName - Signin Policy Name. Only applies to AAD B2C Identity Provider. 6428 SigninPolicyName *string `json:"signinPolicyName,omitempty"` 6429 // ProfileEditingPolicyName - Profile Editing Policy Name. Only applies to AAD B2C Identity Provider. 6430 ProfileEditingPolicyName *string `json:"profileEditingPolicyName,omitempty"` 6431 // PasswordResetPolicyName - Password Reset Policy Name. Only applies to AAD B2C Identity Provider. 6432 PasswordResetPolicyName *string `json:"passwordResetPolicyName,omitempty"` 6433} 6434 6435// IdentityProviderCreateContract identity Provider details. 6436type IdentityProviderCreateContract struct { 6437 // IdentityProviderCreateContractProperties - Identity Provider contract properties. 6438 *IdentityProviderCreateContractProperties `json:"properties,omitempty"` 6439 // ID - READ-ONLY; Resource ID. 6440 ID *string `json:"id,omitempty"` 6441 // Name - READ-ONLY; Resource name. 6442 Name *string `json:"name,omitempty"` 6443 // Type - READ-ONLY; Resource type for API Management resource. 6444 Type *string `json:"type,omitempty"` 6445} 6446 6447// MarshalJSON is the custom marshaler for IdentityProviderCreateContract. 6448func (ipcc IdentityProviderCreateContract) MarshalJSON() ([]byte, error) { 6449 objectMap := make(map[string]interface{}) 6450 if ipcc.IdentityProviderCreateContractProperties != nil { 6451 objectMap["properties"] = ipcc.IdentityProviderCreateContractProperties 6452 } 6453 return json.Marshal(objectMap) 6454} 6455 6456// UnmarshalJSON is the custom unmarshaler for IdentityProviderCreateContract struct. 6457func (ipcc *IdentityProviderCreateContract) UnmarshalJSON(body []byte) error { 6458 var m map[string]*json.RawMessage 6459 err := json.Unmarshal(body, &m) 6460 if err != nil { 6461 return err 6462 } 6463 for k, v := range m { 6464 switch k { 6465 case "properties": 6466 if v != nil { 6467 var identityProviderCreateContractProperties IdentityProviderCreateContractProperties 6468 err = json.Unmarshal(*v, &identityProviderCreateContractProperties) 6469 if err != nil { 6470 return err 6471 } 6472 ipcc.IdentityProviderCreateContractProperties = &identityProviderCreateContractProperties 6473 } 6474 case "id": 6475 if v != nil { 6476 var ID string 6477 err = json.Unmarshal(*v, &ID) 6478 if err != nil { 6479 return err 6480 } 6481 ipcc.ID = &ID 6482 } 6483 case "name": 6484 if v != nil { 6485 var name string 6486 err = json.Unmarshal(*v, &name) 6487 if err != nil { 6488 return err 6489 } 6490 ipcc.Name = &name 6491 } 6492 case "type": 6493 if v != nil { 6494 var typeVar string 6495 err = json.Unmarshal(*v, &typeVar) 6496 if err != nil { 6497 return err 6498 } 6499 ipcc.Type = &typeVar 6500 } 6501 } 6502 } 6503 6504 return nil 6505} 6506 6507// IdentityProviderCreateContractProperties the external Identity Providers like Facebook, Google, 6508// Microsoft, Twitter or Azure Active Directory which can be used to enable access to the API Management 6509// service developer portal for all users. 6510type IdentityProviderCreateContractProperties struct { 6511 // 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. 6512 ClientID *string `json:"clientId,omitempty"` 6513 // 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. 6514 ClientSecret *string `json:"clientSecret,omitempty"` 6515 // Type - Identity Provider Type identifier. Possible values include: 'Facebook', 'Google', 'Microsoft', 'Twitter', 'Aad', 'AadB2C' 6516 Type IdentityProviderType `json:"type,omitempty"` 6517 // SigninTenant - The TenantId to use instead of Common when logging into Active Directory 6518 SigninTenant *string `json:"signinTenant,omitempty"` 6519 // AllowedTenants - List of Allowed Tenants when configuring Azure Active Directory login. 6520 AllowedTenants *[]string `json:"allowedTenants,omitempty"` 6521 // Authority - OpenID Connect discovery endpoint hostname for AAD or AAD B2C. 6522 Authority *string `json:"authority,omitempty"` 6523 // SignupPolicyName - Signup Policy Name. Only applies to AAD B2C Identity Provider. 6524 SignupPolicyName *string `json:"signupPolicyName,omitempty"` 6525 // SigninPolicyName - Signin Policy Name. Only applies to AAD B2C Identity Provider. 6526 SigninPolicyName *string `json:"signinPolicyName,omitempty"` 6527 // ProfileEditingPolicyName - Profile Editing Policy Name. Only applies to AAD B2C Identity Provider. 6528 ProfileEditingPolicyName *string `json:"profileEditingPolicyName,omitempty"` 6529 // PasswordResetPolicyName - Password Reset Policy Name. Only applies to AAD B2C Identity Provider. 6530 PasswordResetPolicyName *string `json:"passwordResetPolicyName,omitempty"` 6531} 6532 6533// IdentityProviderList list of all the Identity Providers configured on the service instance. 6534type IdentityProviderList struct { 6535 autorest.Response `json:"-"` 6536 // Value - Identity Provider configuration values. 6537 Value *[]IdentityProviderContract `json:"value,omitempty"` 6538 // Count - Total record count number across all pages. 6539 Count *int64 `json:"count,omitempty"` 6540 // NextLink - Next page link if any. 6541 NextLink *string `json:"nextLink,omitempty"` 6542} 6543 6544// IdentityProviderListIterator provides access to a complete listing of IdentityProviderContract values. 6545type IdentityProviderListIterator struct { 6546 i int 6547 page IdentityProviderListPage 6548} 6549 6550// NextWithContext advances to the next value. If there was an error making 6551// the request the iterator does not advance and the error is returned. 6552func (iter *IdentityProviderListIterator) NextWithContext(ctx context.Context) (err error) { 6553 if tracing.IsEnabled() { 6554 ctx = tracing.StartSpan(ctx, fqdn+"/IdentityProviderListIterator.NextWithContext") 6555 defer func() { 6556 sc := -1 6557 if iter.Response().Response.Response != nil { 6558 sc = iter.Response().Response.Response.StatusCode 6559 } 6560 tracing.EndSpan(ctx, sc, err) 6561 }() 6562 } 6563 iter.i++ 6564 if iter.i < len(iter.page.Values()) { 6565 return nil 6566 } 6567 err = iter.page.NextWithContext(ctx) 6568 if err != nil { 6569 iter.i-- 6570 return err 6571 } 6572 iter.i = 0 6573 return nil 6574} 6575 6576// Next advances to the next value. If there was an error making 6577// the request the iterator does not advance and the error is returned. 6578// Deprecated: Use NextWithContext() instead. 6579func (iter *IdentityProviderListIterator) Next() error { 6580 return iter.NextWithContext(context.Background()) 6581} 6582 6583// NotDone returns true if the enumeration should be started or is not yet complete. 6584func (iter IdentityProviderListIterator) NotDone() bool { 6585 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 6586} 6587 6588// Response returns the raw server response from the last page request. 6589func (iter IdentityProviderListIterator) Response() IdentityProviderList { 6590 return iter.page.Response() 6591} 6592 6593// Value returns the current value or a zero-initialized value if the 6594// iterator has advanced beyond the end of the collection. 6595func (iter IdentityProviderListIterator) Value() IdentityProviderContract { 6596 if !iter.page.NotDone() { 6597 return IdentityProviderContract{} 6598 } 6599 return iter.page.Values()[iter.i] 6600} 6601 6602// Creates a new instance of the IdentityProviderListIterator type. 6603func NewIdentityProviderListIterator(page IdentityProviderListPage) IdentityProviderListIterator { 6604 return IdentityProviderListIterator{page: page} 6605} 6606 6607// IsEmpty returns true if the ListResult contains no values. 6608func (ipl IdentityProviderList) IsEmpty() bool { 6609 return ipl.Value == nil || len(*ipl.Value) == 0 6610} 6611 6612// hasNextLink returns true if the NextLink is not empty. 6613func (ipl IdentityProviderList) hasNextLink() bool { 6614 return ipl.NextLink != nil && len(*ipl.NextLink) != 0 6615} 6616 6617// identityProviderListPreparer prepares a request to retrieve the next set of results. 6618// It returns nil if no more results exist. 6619func (ipl IdentityProviderList) identityProviderListPreparer(ctx context.Context) (*http.Request, error) { 6620 if !ipl.hasNextLink() { 6621 return nil, nil 6622 } 6623 return autorest.Prepare((&http.Request{}).WithContext(ctx), 6624 autorest.AsJSON(), 6625 autorest.AsGet(), 6626 autorest.WithBaseURL(to.String(ipl.NextLink))) 6627} 6628 6629// IdentityProviderListPage contains a page of IdentityProviderContract values. 6630type IdentityProviderListPage struct { 6631 fn func(context.Context, IdentityProviderList) (IdentityProviderList, error) 6632 ipl IdentityProviderList 6633} 6634 6635// NextWithContext advances to the next page of values. If there was an error making 6636// the request the page does not advance and the error is returned. 6637func (page *IdentityProviderListPage) NextWithContext(ctx context.Context) (err error) { 6638 if tracing.IsEnabled() { 6639 ctx = tracing.StartSpan(ctx, fqdn+"/IdentityProviderListPage.NextWithContext") 6640 defer func() { 6641 sc := -1 6642 if page.Response().Response.Response != nil { 6643 sc = page.Response().Response.Response.StatusCode 6644 } 6645 tracing.EndSpan(ctx, sc, err) 6646 }() 6647 } 6648 for { 6649 next, err := page.fn(ctx, page.ipl) 6650 if err != nil { 6651 return err 6652 } 6653 page.ipl = next 6654 if !next.hasNextLink() || !next.IsEmpty() { 6655 break 6656 } 6657 } 6658 return nil 6659} 6660 6661// Next advances to the next page of values. If there was an error making 6662// the request the page does not advance and the error is returned. 6663// Deprecated: Use NextWithContext() instead. 6664func (page *IdentityProviderListPage) Next() error { 6665 return page.NextWithContext(context.Background()) 6666} 6667 6668// NotDone returns true if the page enumeration should be started or is not yet complete. 6669func (page IdentityProviderListPage) NotDone() bool { 6670 return !page.ipl.IsEmpty() 6671} 6672 6673// Response returns the raw server response from the last page request. 6674func (page IdentityProviderListPage) Response() IdentityProviderList { 6675 return page.ipl 6676} 6677 6678// Values returns the slice of values for the current page or nil if there are no values. 6679func (page IdentityProviderListPage) Values() []IdentityProviderContract { 6680 if page.ipl.IsEmpty() { 6681 return nil 6682 } 6683 return *page.ipl.Value 6684} 6685 6686// Creates a new instance of the IdentityProviderListPage type. 6687func NewIdentityProviderListPage(cur IdentityProviderList, getNextPage func(context.Context, IdentityProviderList) (IdentityProviderList, error)) IdentityProviderListPage { 6688 return IdentityProviderListPage{ 6689 fn: getNextPage, 6690 ipl: cur, 6691 } 6692} 6693 6694// IdentityProviderUpdateParameters parameters supplied to update Identity Provider 6695type IdentityProviderUpdateParameters struct { 6696 // IdentityProviderUpdateProperties - Identity Provider update properties. 6697 *IdentityProviderUpdateProperties `json:"properties,omitempty"` 6698} 6699 6700// MarshalJSON is the custom marshaler for IdentityProviderUpdateParameters. 6701func (ipup IdentityProviderUpdateParameters) MarshalJSON() ([]byte, error) { 6702 objectMap := make(map[string]interface{}) 6703 if ipup.IdentityProviderUpdateProperties != nil { 6704 objectMap["properties"] = ipup.IdentityProviderUpdateProperties 6705 } 6706 return json.Marshal(objectMap) 6707} 6708 6709// UnmarshalJSON is the custom unmarshaler for IdentityProviderUpdateParameters struct. 6710func (ipup *IdentityProviderUpdateParameters) UnmarshalJSON(body []byte) error { 6711 var m map[string]*json.RawMessage 6712 err := json.Unmarshal(body, &m) 6713 if err != nil { 6714 return err 6715 } 6716 for k, v := range m { 6717 switch k { 6718 case "properties": 6719 if v != nil { 6720 var identityProviderUpdateProperties IdentityProviderUpdateProperties 6721 err = json.Unmarshal(*v, &identityProviderUpdateProperties) 6722 if err != nil { 6723 return err 6724 } 6725 ipup.IdentityProviderUpdateProperties = &identityProviderUpdateProperties 6726 } 6727 } 6728 } 6729 6730 return nil 6731} 6732 6733// IdentityProviderUpdateProperties parameters supplied to the Update Identity Provider operation. 6734type IdentityProviderUpdateProperties struct { 6735 // 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. 6736 ClientID *string `json:"clientId,omitempty"` 6737 // 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. 6738 ClientSecret *string `json:"clientSecret,omitempty"` 6739 // Type - Identity Provider Type identifier. Possible values include: 'Facebook', 'Google', 'Microsoft', 'Twitter', 'Aad', 'AadB2C' 6740 Type IdentityProviderType `json:"type,omitempty"` 6741 // SigninTenant - The TenantId to use instead of Common when logging into Active Directory 6742 SigninTenant *string `json:"signinTenant,omitempty"` 6743 // AllowedTenants - List of Allowed Tenants when configuring Azure Active Directory login. 6744 AllowedTenants *[]string `json:"allowedTenants,omitempty"` 6745 // Authority - OpenID Connect discovery endpoint hostname for AAD or AAD B2C. 6746 Authority *string `json:"authority,omitempty"` 6747 // SignupPolicyName - Signup Policy Name. Only applies to AAD B2C Identity Provider. 6748 SignupPolicyName *string `json:"signupPolicyName,omitempty"` 6749 // SigninPolicyName - Signin Policy Name. Only applies to AAD B2C Identity Provider. 6750 SigninPolicyName *string `json:"signinPolicyName,omitempty"` 6751 // ProfileEditingPolicyName - Profile Editing Policy Name. Only applies to AAD B2C Identity Provider. 6752 ProfileEditingPolicyName *string `json:"profileEditingPolicyName,omitempty"` 6753 // PasswordResetPolicyName - Password Reset Policy Name. Only applies to AAD B2C Identity Provider. 6754 PasswordResetPolicyName *string `json:"passwordResetPolicyName,omitempty"` 6755} 6756 6757// IssueAttachmentCollection paged Issue Attachment list representation. 6758type IssueAttachmentCollection struct { 6759 autorest.Response `json:"-"` 6760 // Value - READ-ONLY; Issue Attachment values. 6761 Value *[]IssueAttachmentContract `json:"value,omitempty"` 6762 // Count - Total record count number across all pages. 6763 Count *int64 `json:"count,omitempty"` 6764 // NextLink - READ-ONLY; Next page link if any. 6765 NextLink *string `json:"nextLink,omitempty"` 6766} 6767 6768// MarshalJSON is the custom marshaler for IssueAttachmentCollection. 6769func (iac IssueAttachmentCollection) MarshalJSON() ([]byte, error) { 6770 objectMap := make(map[string]interface{}) 6771 if iac.Count != nil { 6772 objectMap["count"] = iac.Count 6773 } 6774 return json.Marshal(objectMap) 6775} 6776 6777// IssueAttachmentCollectionIterator provides access to a complete listing of IssueAttachmentContract 6778// values. 6779type IssueAttachmentCollectionIterator struct { 6780 i int 6781 page IssueAttachmentCollectionPage 6782} 6783 6784// NextWithContext advances to the next value. If there was an error making 6785// the request the iterator does not advance and the error is returned. 6786func (iter *IssueAttachmentCollectionIterator) NextWithContext(ctx context.Context) (err error) { 6787 if tracing.IsEnabled() { 6788 ctx = tracing.StartSpan(ctx, fqdn+"/IssueAttachmentCollectionIterator.NextWithContext") 6789 defer func() { 6790 sc := -1 6791 if iter.Response().Response.Response != nil { 6792 sc = iter.Response().Response.Response.StatusCode 6793 } 6794 tracing.EndSpan(ctx, sc, err) 6795 }() 6796 } 6797 iter.i++ 6798 if iter.i < len(iter.page.Values()) { 6799 return nil 6800 } 6801 err = iter.page.NextWithContext(ctx) 6802 if err != nil { 6803 iter.i-- 6804 return err 6805 } 6806 iter.i = 0 6807 return nil 6808} 6809 6810// Next advances to the next value. If there was an error making 6811// the request the iterator does not advance and the error is returned. 6812// Deprecated: Use NextWithContext() instead. 6813func (iter *IssueAttachmentCollectionIterator) Next() error { 6814 return iter.NextWithContext(context.Background()) 6815} 6816 6817// NotDone returns true if the enumeration should be started or is not yet complete. 6818func (iter IssueAttachmentCollectionIterator) NotDone() bool { 6819 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 6820} 6821 6822// Response returns the raw server response from the last page request. 6823func (iter IssueAttachmentCollectionIterator) Response() IssueAttachmentCollection { 6824 return iter.page.Response() 6825} 6826 6827// Value returns the current value or a zero-initialized value if the 6828// iterator has advanced beyond the end of the collection. 6829func (iter IssueAttachmentCollectionIterator) Value() IssueAttachmentContract { 6830 if !iter.page.NotDone() { 6831 return IssueAttachmentContract{} 6832 } 6833 return iter.page.Values()[iter.i] 6834} 6835 6836// Creates a new instance of the IssueAttachmentCollectionIterator type. 6837func NewIssueAttachmentCollectionIterator(page IssueAttachmentCollectionPage) IssueAttachmentCollectionIterator { 6838 return IssueAttachmentCollectionIterator{page: page} 6839} 6840 6841// IsEmpty returns true if the ListResult contains no values. 6842func (iac IssueAttachmentCollection) IsEmpty() bool { 6843 return iac.Value == nil || len(*iac.Value) == 0 6844} 6845 6846// hasNextLink returns true if the NextLink is not empty. 6847func (iac IssueAttachmentCollection) hasNextLink() bool { 6848 return iac.NextLink != nil && len(*iac.NextLink) != 0 6849} 6850 6851// issueAttachmentCollectionPreparer prepares a request to retrieve the next set of results. 6852// It returns nil if no more results exist. 6853func (iac IssueAttachmentCollection) issueAttachmentCollectionPreparer(ctx context.Context) (*http.Request, error) { 6854 if !iac.hasNextLink() { 6855 return nil, nil 6856 } 6857 return autorest.Prepare((&http.Request{}).WithContext(ctx), 6858 autorest.AsJSON(), 6859 autorest.AsGet(), 6860 autorest.WithBaseURL(to.String(iac.NextLink))) 6861} 6862 6863// IssueAttachmentCollectionPage contains a page of IssueAttachmentContract values. 6864type IssueAttachmentCollectionPage struct { 6865 fn func(context.Context, IssueAttachmentCollection) (IssueAttachmentCollection, error) 6866 iac IssueAttachmentCollection 6867} 6868 6869// NextWithContext advances to the next page of values. If there was an error making 6870// the request the page does not advance and the error is returned. 6871func (page *IssueAttachmentCollectionPage) NextWithContext(ctx context.Context) (err error) { 6872 if tracing.IsEnabled() { 6873 ctx = tracing.StartSpan(ctx, fqdn+"/IssueAttachmentCollectionPage.NextWithContext") 6874 defer func() { 6875 sc := -1 6876 if page.Response().Response.Response != nil { 6877 sc = page.Response().Response.Response.StatusCode 6878 } 6879 tracing.EndSpan(ctx, sc, err) 6880 }() 6881 } 6882 for { 6883 next, err := page.fn(ctx, page.iac) 6884 if err != nil { 6885 return err 6886 } 6887 page.iac = next 6888 if !next.hasNextLink() || !next.IsEmpty() { 6889 break 6890 } 6891 } 6892 return nil 6893} 6894 6895// Next advances to the next page of values. If there was an error making 6896// the request the page does not advance and the error is returned. 6897// Deprecated: Use NextWithContext() instead. 6898func (page *IssueAttachmentCollectionPage) Next() error { 6899 return page.NextWithContext(context.Background()) 6900} 6901 6902// NotDone returns true if the page enumeration should be started or is not yet complete. 6903func (page IssueAttachmentCollectionPage) NotDone() bool { 6904 return !page.iac.IsEmpty() 6905} 6906 6907// Response returns the raw server response from the last page request. 6908func (page IssueAttachmentCollectionPage) Response() IssueAttachmentCollection { 6909 return page.iac 6910} 6911 6912// Values returns the slice of values for the current page or nil if there are no values. 6913func (page IssueAttachmentCollectionPage) Values() []IssueAttachmentContract { 6914 if page.iac.IsEmpty() { 6915 return nil 6916 } 6917 return *page.iac.Value 6918} 6919 6920// Creates a new instance of the IssueAttachmentCollectionPage type. 6921func NewIssueAttachmentCollectionPage(cur IssueAttachmentCollection, getNextPage func(context.Context, IssueAttachmentCollection) (IssueAttachmentCollection, error)) IssueAttachmentCollectionPage { 6922 return IssueAttachmentCollectionPage{ 6923 fn: getNextPage, 6924 iac: cur, 6925 } 6926} 6927 6928// IssueAttachmentContract issue Attachment Contract details. 6929type IssueAttachmentContract struct { 6930 autorest.Response `json:"-"` 6931 // IssueAttachmentContractProperties - Properties of the Issue Attachment. 6932 *IssueAttachmentContractProperties `json:"properties,omitempty"` 6933 // ID - READ-ONLY; Resource ID. 6934 ID *string `json:"id,omitempty"` 6935 // Name - READ-ONLY; Resource name. 6936 Name *string `json:"name,omitempty"` 6937 // Type - READ-ONLY; Resource type for API Management resource. 6938 Type *string `json:"type,omitempty"` 6939} 6940 6941// MarshalJSON is the custom marshaler for IssueAttachmentContract. 6942func (iac IssueAttachmentContract) MarshalJSON() ([]byte, error) { 6943 objectMap := make(map[string]interface{}) 6944 if iac.IssueAttachmentContractProperties != nil { 6945 objectMap["properties"] = iac.IssueAttachmentContractProperties 6946 } 6947 return json.Marshal(objectMap) 6948} 6949 6950// UnmarshalJSON is the custom unmarshaler for IssueAttachmentContract struct. 6951func (iac *IssueAttachmentContract) UnmarshalJSON(body []byte) error { 6952 var m map[string]*json.RawMessage 6953 err := json.Unmarshal(body, &m) 6954 if err != nil { 6955 return err 6956 } 6957 for k, v := range m { 6958 switch k { 6959 case "properties": 6960 if v != nil { 6961 var issueAttachmentContractProperties IssueAttachmentContractProperties 6962 err = json.Unmarshal(*v, &issueAttachmentContractProperties) 6963 if err != nil { 6964 return err 6965 } 6966 iac.IssueAttachmentContractProperties = &issueAttachmentContractProperties 6967 } 6968 case "id": 6969 if v != nil { 6970 var ID string 6971 err = json.Unmarshal(*v, &ID) 6972 if err != nil { 6973 return err 6974 } 6975 iac.ID = &ID 6976 } 6977 case "name": 6978 if v != nil { 6979 var name string 6980 err = json.Unmarshal(*v, &name) 6981 if err != nil { 6982 return err 6983 } 6984 iac.Name = &name 6985 } 6986 case "type": 6987 if v != nil { 6988 var typeVar string 6989 err = json.Unmarshal(*v, &typeVar) 6990 if err != nil { 6991 return err 6992 } 6993 iac.Type = &typeVar 6994 } 6995 } 6996 } 6997 6998 return nil 6999} 7000 7001// IssueAttachmentContractProperties issue Attachment contract Properties. 7002type IssueAttachmentContractProperties struct { 7003 // Title - Filename by which the binary data will be saved. 7004 Title *string `json:"title,omitempty"` 7005 // 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. 7006 ContentFormat *string `json:"contentFormat,omitempty"` 7007 // Content - An HTTP link or Base64-encoded binary data. 7008 Content *string `json:"content,omitempty"` 7009} 7010 7011// IssueCollection paged Issue list representation. 7012type IssueCollection struct { 7013 autorest.Response `json:"-"` 7014 // Value - READ-ONLY; Issue values. 7015 Value *[]IssueContract `json:"value,omitempty"` 7016 // Count - Total record count number across all pages. 7017 Count *int64 `json:"count,omitempty"` 7018 // NextLink - READ-ONLY; Next page link if any. 7019 NextLink *string `json:"nextLink,omitempty"` 7020} 7021 7022// MarshalJSON is the custom marshaler for IssueCollection. 7023func (ic IssueCollection) MarshalJSON() ([]byte, error) { 7024 objectMap := make(map[string]interface{}) 7025 if ic.Count != nil { 7026 objectMap["count"] = ic.Count 7027 } 7028 return json.Marshal(objectMap) 7029} 7030 7031// IssueCollectionIterator provides access to a complete listing of IssueContract values. 7032type IssueCollectionIterator struct { 7033 i int 7034 page IssueCollectionPage 7035} 7036 7037// NextWithContext advances to the next value. If there was an error making 7038// the request the iterator does not advance and the error is returned. 7039func (iter *IssueCollectionIterator) NextWithContext(ctx context.Context) (err error) { 7040 if tracing.IsEnabled() { 7041 ctx = tracing.StartSpan(ctx, fqdn+"/IssueCollectionIterator.NextWithContext") 7042 defer func() { 7043 sc := -1 7044 if iter.Response().Response.Response != nil { 7045 sc = iter.Response().Response.Response.StatusCode 7046 } 7047 tracing.EndSpan(ctx, sc, err) 7048 }() 7049 } 7050 iter.i++ 7051 if iter.i < len(iter.page.Values()) { 7052 return nil 7053 } 7054 err = iter.page.NextWithContext(ctx) 7055 if err != nil { 7056 iter.i-- 7057 return err 7058 } 7059 iter.i = 0 7060 return nil 7061} 7062 7063// Next advances to the next value. If there was an error making 7064// the request the iterator does not advance and the error is returned. 7065// Deprecated: Use NextWithContext() instead. 7066func (iter *IssueCollectionIterator) Next() error { 7067 return iter.NextWithContext(context.Background()) 7068} 7069 7070// NotDone returns true if the enumeration should be started or is not yet complete. 7071func (iter IssueCollectionIterator) NotDone() bool { 7072 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 7073} 7074 7075// Response returns the raw server response from the last page request. 7076func (iter IssueCollectionIterator) Response() IssueCollection { 7077 return iter.page.Response() 7078} 7079 7080// Value returns the current value or a zero-initialized value if the 7081// iterator has advanced beyond the end of the collection. 7082func (iter IssueCollectionIterator) Value() IssueContract { 7083 if !iter.page.NotDone() { 7084 return IssueContract{} 7085 } 7086 return iter.page.Values()[iter.i] 7087} 7088 7089// Creates a new instance of the IssueCollectionIterator type. 7090func NewIssueCollectionIterator(page IssueCollectionPage) IssueCollectionIterator { 7091 return IssueCollectionIterator{page: page} 7092} 7093 7094// IsEmpty returns true if the ListResult contains no values. 7095func (ic IssueCollection) IsEmpty() bool { 7096 return ic.Value == nil || len(*ic.Value) == 0 7097} 7098 7099// hasNextLink returns true if the NextLink is not empty. 7100func (ic IssueCollection) hasNextLink() bool { 7101 return ic.NextLink != nil && len(*ic.NextLink) != 0 7102} 7103 7104// issueCollectionPreparer prepares a request to retrieve the next set of results. 7105// It returns nil if no more results exist. 7106func (ic IssueCollection) issueCollectionPreparer(ctx context.Context) (*http.Request, error) { 7107 if !ic.hasNextLink() { 7108 return nil, nil 7109 } 7110 return autorest.Prepare((&http.Request{}).WithContext(ctx), 7111 autorest.AsJSON(), 7112 autorest.AsGet(), 7113 autorest.WithBaseURL(to.String(ic.NextLink))) 7114} 7115 7116// IssueCollectionPage contains a page of IssueContract values. 7117type IssueCollectionPage struct { 7118 fn func(context.Context, IssueCollection) (IssueCollection, error) 7119 ic IssueCollection 7120} 7121 7122// NextWithContext advances to the next page of values. If there was an error making 7123// the request the page does not advance and the error is returned. 7124func (page *IssueCollectionPage) NextWithContext(ctx context.Context) (err error) { 7125 if tracing.IsEnabled() { 7126 ctx = tracing.StartSpan(ctx, fqdn+"/IssueCollectionPage.NextWithContext") 7127 defer func() { 7128 sc := -1 7129 if page.Response().Response.Response != nil { 7130 sc = page.Response().Response.Response.StatusCode 7131 } 7132 tracing.EndSpan(ctx, sc, err) 7133 }() 7134 } 7135 for { 7136 next, err := page.fn(ctx, page.ic) 7137 if err != nil { 7138 return err 7139 } 7140 page.ic = next 7141 if !next.hasNextLink() || !next.IsEmpty() { 7142 break 7143 } 7144 } 7145 return nil 7146} 7147 7148// Next advances to the next page of values. If there was an error making 7149// the request the page does not advance and the error is returned. 7150// Deprecated: Use NextWithContext() instead. 7151func (page *IssueCollectionPage) Next() error { 7152 return page.NextWithContext(context.Background()) 7153} 7154 7155// NotDone returns true if the page enumeration should be started or is not yet complete. 7156func (page IssueCollectionPage) NotDone() bool { 7157 return !page.ic.IsEmpty() 7158} 7159 7160// Response returns the raw server response from the last page request. 7161func (page IssueCollectionPage) Response() IssueCollection { 7162 return page.ic 7163} 7164 7165// Values returns the slice of values for the current page or nil if there are no values. 7166func (page IssueCollectionPage) Values() []IssueContract { 7167 if page.ic.IsEmpty() { 7168 return nil 7169 } 7170 return *page.ic.Value 7171} 7172 7173// Creates a new instance of the IssueCollectionPage type. 7174func NewIssueCollectionPage(cur IssueCollection, getNextPage func(context.Context, IssueCollection) (IssueCollection, error)) IssueCollectionPage { 7175 return IssueCollectionPage{ 7176 fn: getNextPage, 7177 ic: cur, 7178 } 7179} 7180 7181// IssueCommentCollection paged Issue Comment list representation. 7182type IssueCommentCollection struct { 7183 autorest.Response `json:"-"` 7184 // Value - READ-ONLY; Issue Comment values. 7185 Value *[]IssueCommentContract `json:"value,omitempty"` 7186 // Count - Total record count number across all pages. 7187 Count *int64 `json:"count,omitempty"` 7188 // NextLink - READ-ONLY; Next page link if any. 7189 NextLink *string `json:"nextLink,omitempty"` 7190} 7191 7192// MarshalJSON is the custom marshaler for IssueCommentCollection. 7193func (icc IssueCommentCollection) MarshalJSON() ([]byte, error) { 7194 objectMap := make(map[string]interface{}) 7195 if icc.Count != nil { 7196 objectMap["count"] = icc.Count 7197 } 7198 return json.Marshal(objectMap) 7199} 7200 7201// IssueCommentCollectionIterator provides access to a complete listing of IssueCommentContract values. 7202type IssueCommentCollectionIterator struct { 7203 i int 7204 page IssueCommentCollectionPage 7205} 7206 7207// NextWithContext advances to the next value. If there was an error making 7208// the request the iterator does not advance and the error is returned. 7209func (iter *IssueCommentCollectionIterator) NextWithContext(ctx context.Context) (err error) { 7210 if tracing.IsEnabled() { 7211 ctx = tracing.StartSpan(ctx, fqdn+"/IssueCommentCollectionIterator.NextWithContext") 7212 defer func() { 7213 sc := -1 7214 if iter.Response().Response.Response != nil { 7215 sc = iter.Response().Response.Response.StatusCode 7216 } 7217 tracing.EndSpan(ctx, sc, err) 7218 }() 7219 } 7220 iter.i++ 7221 if iter.i < len(iter.page.Values()) { 7222 return nil 7223 } 7224 err = iter.page.NextWithContext(ctx) 7225 if err != nil { 7226 iter.i-- 7227 return err 7228 } 7229 iter.i = 0 7230 return nil 7231} 7232 7233// Next advances to the next value. If there was an error making 7234// the request the iterator does not advance and the error is returned. 7235// Deprecated: Use NextWithContext() instead. 7236func (iter *IssueCommentCollectionIterator) Next() error { 7237 return iter.NextWithContext(context.Background()) 7238} 7239 7240// NotDone returns true if the enumeration should be started or is not yet complete. 7241func (iter IssueCommentCollectionIterator) NotDone() bool { 7242 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 7243} 7244 7245// Response returns the raw server response from the last page request. 7246func (iter IssueCommentCollectionIterator) Response() IssueCommentCollection { 7247 return iter.page.Response() 7248} 7249 7250// Value returns the current value or a zero-initialized value if the 7251// iterator has advanced beyond the end of the collection. 7252func (iter IssueCommentCollectionIterator) Value() IssueCommentContract { 7253 if !iter.page.NotDone() { 7254 return IssueCommentContract{} 7255 } 7256 return iter.page.Values()[iter.i] 7257} 7258 7259// Creates a new instance of the IssueCommentCollectionIterator type. 7260func NewIssueCommentCollectionIterator(page IssueCommentCollectionPage) IssueCommentCollectionIterator { 7261 return IssueCommentCollectionIterator{page: page} 7262} 7263 7264// IsEmpty returns true if the ListResult contains no values. 7265func (icc IssueCommentCollection) IsEmpty() bool { 7266 return icc.Value == nil || len(*icc.Value) == 0 7267} 7268 7269// hasNextLink returns true if the NextLink is not empty. 7270func (icc IssueCommentCollection) hasNextLink() bool { 7271 return icc.NextLink != nil && len(*icc.NextLink) != 0 7272} 7273 7274// issueCommentCollectionPreparer prepares a request to retrieve the next set of results. 7275// It returns nil if no more results exist. 7276func (icc IssueCommentCollection) issueCommentCollectionPreparer(ctx context.Context) (*http.Request, error) { 7277 if !icc.hasNextLink() { 7278 return nil, nil 7279 } 7280 return autorest.Prepare((&http.Request{}).WithContext(ctx), 7281 autorest.AsJSON(), 7282 autorest.AsGet(), 7283 autorest.WithBaseURL(to.String(icc.NextLink))) 7284} 7285 7286// IssueCommentCollectionPage contains a page of IssueCommentContract values. 7287type IssueCommentCollectionPage struct { 7288 fn func(context.Context, IssueCommentCollection) (IssueCommentCollection, error) 7289 icc IssueCommentCollection 7290} 7291 7292// NextWithContext advances to the next page of values. If there was an error making 7293// the request the page does not advance and the error is returned. 7294func (page *IssueCommentCollectionPage) NextWithContext(ctx context.Context) (err error) { 7295 if tracing.IsEnabled() { 7296 ctx = tracing.StartSpan(ctx, fqdn+"/IssueCommentCollectionPage.NextWithContext") 7297 defer func() { 7298 sc := -1 7299 if page.Response().Response.Response != nil { 7300 sc = page.Response().Response.Response.StatusCode 7301 } 7302 tracing.EndSpan(ctx, sc, err) 7303 }() 7304 } 7305 for { 7306 next, err := page.fn(ctx, page.icc) 7307 if err != nil { 7308 return err 7309 } 7310 page.icc = next 7311 if !next.hasNextLink() || !next.IsEmpty() { 7312 break 7313 } 7314 } 7315 return nil 7316} 7317 7318// Next advances to the next page of values. If there was an error making 7319// the request the page does not advance and the error is returned. 7320// Deprecated: Use NextWithContext() instead. 7321func (page *IssueCommentCollectionPage) Next() error { 7322 return page.NextWithContext(context.Background()) 7323} 7324 7325// NotDone returns true if the page enumeration should be started or is not yet complete. 7326func (page IssueCommentCollectionPage) NotDone() bool { 7327 return !page.icc.IsEmpty() 7328} 7329 7330// Response returns the raw server response from the last page request. 7331func (page IssueCommentCollectionPage) Response() IssueCommentCollection { 7332 return page.icc 7333} 7334 7335// Values returns the slice of values for the current page or nil if there are no values. 7336func (page IssueCommentCollectionPage) Values() []IssueCommentContract { 7337 if page.icc.IsEmpty() { 7338 return nil 7339 } 7340 return *page.icc.Value 7341} 7342 7343// Creates a new instance of the IssueCommentCollectionPage type. 7344func NewIssueCommentCollectionPage(cur IssueCommentCollection, getNextPage func(context.Context, IssueCommentCollection) (IssueCommentCollection, error)) IssueCommentCollectionPage { 7345 return IssueCommentCollectionPage{ 7346 fn: getNextPage, 7347 icc: cur, 7348 } 7349} 7350 7351// IssueCommentContract issue Comment Contract details. 7352type IssueCommentContract struct { 7353 autorest.Response `json:"-"` 7354 // IssueCommentContractProperties - Properties of the Issue Comment. 7355 *IssueCommentContractProperties `json:"properties,omitempty"` 7356 // ID - READ-ONLY; Resource ID. 7357 ID *string `json:"id,omitempty"` 7358 // Name - READ-ONLY; Resource name. 7359 Name *string `json:"name,omitempty"` 7360 // Type - READ-ONLY; Resource type for API Management resource. 7361 Type *string `json:"type,omitempty"` 7362} 7363 7364// MarshalJSON is the custom marshaler for IssueCommentContract. 7365func (icc IssueCommentContract) MarshalJSON() ([]byte, error) { 7366 objectMap := make(map[string]interface{}) 7367 if icc.IssueCommentContractProperties != nil { 7368 objectMap["properties"] = icc.IssueCommentContractProperties 7369 } 7370 return json.Marshal(objectMap) 7371} 7372 7373// UnmarshalJSON is the custom unmarshaler for IssueCommentContract struct. 7374func (icc *IssueCommentContract) UnmarshalJSON(body []byte) error { 7375 var m map[string]*json.RawMessage 7376 err := json.Unmarshal(body, &m) 7377 if err != nil { 7378 return err 7379 } 7380 for k, v := range m { 7381 switch k { 7382 case "properties": 7383 if v != nil { 7384 var issueCommentContractProperties IssueCommentContractProperties 7385 err = json.Unmarshal(*v, &issueCommentContractProperties) 7386 if err != nil { 7387 return err 7388 } 7389 icc.IssueCommentContractProperties = &issueCommentContractProperties 7390 } 7391 case "id": 7392 if v != nil { 7393 var ID string 7394 err = json.Unmarshal(*v, &ID) 7395 if err != nil { 7396 return err 7397 } 7398 icc.ID = &ID 7399 } 7400 case "name": 7401 if v != nil { 7402 var name string 7403 err = json.Unmarshal(*v, &name) 7404 if err != nil { 7405 return err 7406 } 7407 icc.Name = &name 7408 } 7409 case "type": 7410 if v != nil { 7411 var typeVar string 7412 err = json.Unmarshal(*v, &typeVar) 7413 if err != nil { 7414 return err 7415 } 7416 icc.Type = &typeVar 7417 } 7418 } 7419 } 7420 7421 return nil 7422} 7423 7424// IssueCommentContractProperties issue Comment contract Properties. 7425type IssueCommentContractProperties struct { 7426 // Text - Comment text. 7427 Text *string `json:"text,omitempty"` 7428 // CreatedDate - Date and time when the comment was created. 7429 CreatedDate *date.Time `json:"createdDate,omitempty"` 7430 // UserID - A resource identifier for the user who left the comment. 7431 UserID *string `json:"userId,omitempty"` 7432} 7433 7434// IssueContract issue Contract details. 7435type IssueContract struct { 7436 autorest.Response `json:"-"` 7437 // IssueContractProperties - Properties of the Issue. 7438 *IssueContractProperties `json:"properties,omitempty"` 7439 // ID - READ-ONLY; Resource ID. 7440 ID *string `json:"id,omitempty"` 7441 // Name - READ-ONLY; Resource name. 7442 Name *string `json:"name,omitempty"` 7443 // Type - READ-ONLY; Resource type for API Management resource. 7444 Type *string `json:"type,omitempty"` 7445} 7446 7447// MarshalJSON is the custom marshaler for IssueContract. 7448func (ic IssueContract) MarshalJSON() ([]byte, error) { 7449 objectMap := make(map[string]interface{}) 7450 if ic.IssueContractProperties != nil { 7451 objectMap["properties"] = ic.IssueContractProperties 7452 } 7453 return json.Marshal(objectMap) 7454} 7455 7456// UnmarshalJSON is the custom unmarshaler for IssueContract struct. 7457func (ic *IssueContract) UnmarshalJSON(body []byte) error { 7458 var m map[string]*json.RawMessage 7459 err := json.Unmarshal(body, &m) 7460 if err != nil { 7461 return err 7462 } 7463 for k, v := range m { 7464 switch k { 7465 case "properties": 7466 if v != nil { 7467 var issueContractProperties IssueContractProperties 7468 err = json.Unmarshal(*v, &issueContractProperties) 7469 if err != nil { 7470 return err 7471 } 7472 ic.IssueContractProperties = &issueContractProperties 7473 } 7474 case "id": 7475 if v != nil { 7476 var ID string 7477 err = json.Unmarshal(*v, &ID) 7478 if err != nil { 7479 return err 7480 } 7481 ic.ID = &ID 7482 } 7483 case "name": 7484 if v != nil { 7485 var name string 7486 err = json.Unmarshal(*v, &name) 7487 if err != nil { 7488 return err 7489 } 7490 ic.Name = &name 7491 } 7492 case "type": 7493 if v != nil { 7494 var typeVar string 7495 err = json.Unmarshal(*v, &typeVar) 7496 if err != nil { 7497 return err 7498 } 7499 ic.Type = &typeVar 7500 } 7501 } 7502 } 7503 7504 return nil 7505} 7506 7507// IssueContractBaseProperties issue contract Base Properties. 7508type IssueContractBaseProperties struct { 7509 // CreatedDate - Date and time when the issue was created. 7510 CreatedDate *date.Time `json:"createdDate,omitempty"` 7511 // State - Status of the issue. Possible values include: 'Proposed', 'Open', 'Removed', 'Resolved', 'Closed' 7512 State State `json:"state,omitempty"` 7513 // APIID - A resource identifier for the API the issue was created for. 7514 APIID *string `json:"apiId,omitempty"` 7515} 7516 7517// IssueContractProperties issue contract Properties. 7518type IssueContractProperties struct { 7519 // Title - The issue title. 7520 Title *string `json:"title,omitempty"` 7521 // Description - Text describing the issue. 7522 Description *string `json:"description,omitempty"` 7523 // UserID - A resource identifier for the user created the issue. 7524 UserID *string `json:"userId,omitempty"` 7525 // CreatedDate - Date and time when the issue was created. 7526 CreatedDate *date.Time `json:"createdDate,omitempty"` 7527 // State - Status of the issue. Possible values include: 'Proposed', 'Open', 'Removed', 'Resolved', 'Closed' 7528 State State `json:"state,omitempty"` 7529 // APIID - A resource identifier for the API the issue was created for. 7530 APIID *string `json:"apiId,omitempty"` 7531} 7532 7533// IssueUpdateContract issue update Parameters. 7534type IssueUpdateContract struct { 7535 // IssueUpdateContractProperties - Issue entity Update contract properties. 7536 *IssueUpdateContractProperties `json:"properties,omitempty"` 7537} 7538 7539// MarshalJSON is the custom marshaler for IssueUpdateContract. 7540func (iuc IssueUpdateContract) MarshalJSON() ([]byte, error) { 7541 objectMap := make(map[string]interface{}) 7542 if iuc.IssueUpdateContractProperties != nil { 7543 objectMap["properties"] = iuc.IssueUpdateContractProperties 7544 } 7545 return json.Marshal(objectMap) 7546} 7547 7548// UnmarshalJSON is the custom unmarshaler for IssueUpdateContract struct. 7549func (iuc *IssueUpdateContract) UnmarshalJSON(body []byte) error { 7550 var m map[string]*json.RawMessage 7551 err := json.Unmarshal(body, &m) 7552 if err != nil { 7553 return err 7554 } 7555 for k, v := range m { 7556 switch k { 7557 case "properties": 7558 if v != nil { 7559 var issueUpdateContractProperties IssueUpdateContractProperties 7560 err = json.Unmarshal(*v, &issueUpdateContractProperties) 7561 if err != nil { 7562 return err 7563 } 7564 iuc.IssueUpdateContractProperties = &issueUpdateContractProperties 7565 } 7566 } 7567 } 7568 7569 return nil 7570} 7571 7572// IssueUpdateContractProperties issue contract Update Properties. 7573type IssueUpdateContractProperties struct { 7574 // Title - The issue title. 7575 Title *string `json:"title,omitempty"` 7576 // Description - Text describing the issue. 7577 Description *string `json:"description,omitempty"` 7578 // UserID - A resource identifier for the user created the issue. 7579 UserID *string `json:"userId,omitempty"` 7580 // CreatedDate - Date and time when the issue was created. 7581 CreatedDate *date.Time `json:"createdDate,omitempty"` 7582 // State - Status of the issue. Possible values include: 'Proposed', 'Open', 'Removed', 'Resolved', 'Closed' 7583 State State `json:"state,omitempty"` 7584 // APIID - A resource identifier for the API the issue was created for. 7585 APIID *string `json:"apiId,omitempty"` 7586} 7587 7588// KeyVaultContractCreateProperties create keyVault contract details. 7589type KeyVaultContractCreateProperties struct { 7590 // 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 7591 SecretIdentifier *string `json:"secretIdentifier,omitempty"` 7592 // IdentityClientID - SystemAssignedIdentity or UserAssignedIdentity Client Id which will be used to access key vault secret. 7593 IdentityClientID *string `json:"identityClientId,omitempty"` 7594} 7595 7596// KeyVaultContractProperties keyVault contract details. 7597type KeyVaultContractProperties struct { 7598 // LastStatus - Last time sync and refresh status of secret from key vault. 7599 LastStatus *KeyVaultLastAccessStatusContractProperties `json:"lastStatus,omitempty"` 7600 // 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 7601 SecretIdentifier *string `json:"secretIdentifier,omitempty"` 7602 // IdentityClientID - SystemAssignedIdentity or UserAssignedIdentity Client Id which will be used to access key vault secret. 7603 IdentityClientID *string `json:"identityClientId,omitempty"` 7604} 7605 7606// KeyVaultLastAccessStatusContractProperties issue contract Update Properties. 7607type KeyVaultLastAccessStatusContractProperties struct { 7608 // Code - Last status code for sync and refresh of secret from key vault. 7609 Code *string `json:"code,omitempty"` 7610 // Message - Details of the error else empty. 7611 Message *string `json:"message,omitempty"` 7612 // 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. 7613 TimeStampUtc *date.Time `json:"timeStampUtc,omitempty"` 7614} 7615 7616// ListNetworkStatusContractByLocation ... 7617type ListNetworkStatusContractByLocation struct { 7618 autorest.Response `json:"-"` 7619 Value *[]NetworkStatusContractByLocation `json:"value,omitempty"` 7620} 7621 7622// LoggerCollection paged Logger list representation. 7623type LoggerCollection struct { 7624 autorest.Response `json:"-"` 7625 // Value - Logger values. 7626 Value *[]LoggerContract `json:"value,omitempty"` 7627 // Count - Total record count number across all pages. 7628 Count *int64 `json:"count,omitempty"` 7629 // NextLink - Next page link if any. 7630 NextLink *string `json:"nextLink,omitempty"` 7631} 7632 7633// LoggerCollectionIterator provides access to a complete listing of LoggerContract values. 7634type LoggerCollectionIterator struct { 7635 i int 7636 page LoggerCollectionPage 7637} 7638 7639// NextWithContext advances to the next value. If there was an error making 7640// the request the iterator does not advance and the error is returned. 7641func (iter *LoggerCollectionIterator) NextWithContext(ctx context.Context) (err error) { 7642 if tracing.IsEnabled() { 7643 ctx = tracing.StartSpan(ctx, fqdn+"/LoggerCollectionIterator.NextWithContext") 7644 defer func() { 7645 sc := -1 7646 if iter.Response().Response.Response != nil { 7647 sc = iter.Response().Response.Response.StatusCode 7648 } 7649 tracing.EndSpan(ctx, sc, err) 7650 }() 7651 } 7652 iter.i++ 7653 if iter.i < len(iter.page.Values()) { 7654 return nil 7655 } 7656 err = iter.page.NextWithContext(ctx) 7657 if err != nil { 7658 iter.i-- 7659 return err 7660 } 7661 iter.i = 0 7662 return nil 7663} 7664 7665// Next advances to the next value. If there was an error making 7666// the request the iterator does not advance and the error is returned. 7667// Deprecated: Use NextWithContext() instead. 7668func (iter *LoggerCollectionIterator) Next() error { 7669 return iter.NextWithContext(context.Background()) 7670} 7671 7672// NotDone returns true if the enumeration should be started or is not yet complete. 7673func (iter LoggerCollectionIterator) NotDone() bool { 7674 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 7675} 7676 7677// Response returns the raw server response from the last page request. 7678func (iter LoggerCollectionIterator) Response() LoggerCollection { 7679 return iter.page.Response() 7680} 7681 7682// Value returns the current value or a zero-initialized value if the 7683// iterator has advanced beyond the end of the collection. 7684func (iter LoggerCollectionIterator) Value() LoggerContract { 7685 if !iter.page.NotDone() { 7686 return LoggerContract{} 7687 } 7688 return iter.page.Values()[iter.i] 7689} 7690 7691// Creates a new instance of the LoggerCollectionIterator type. 7692func NewLoggerCollectionIterator(page LoggerCollectionPage) LoggerCollectionIterator { 7693 return LoggerCollectionIterator{page: page} 7694} 7695 7696// IsEmpty returns true if the ListResult contains no values. 7697func (lc LoggerCollection) IsEmpty() bool { 7698 return lc.Value == nil || len(*lc.Value) == 0 7699} 7700 7701// hasNextLink returns true if the NextLink is not empty. 7702func (lc LoggerCollection) hasNextLink() bool { 7703 return lc.NextLink != nil && len(*lc.NextLink) != 0 7704} 7705 7706// loggerCollectionPreparer prepares a request to retrieve the next set of results. 7707// It returns nil if no more results exist. 7708func (lc LoggerCollection) loggerCollectionPreparer(ctx context.Context) (*http.Request, error) { 7709 if !lc.hasNextLink() { 7710 return nil, nil 7711 } 7712 return autorest.Prepare((&http.Request{}).WithContext(ctx), 7713 autorest.AsJSON(), 7714 autorest.AsGet(), 7715 autorest.WithBaseURL(to.String(lc.NextLink))) 7716} 7717 7718// LoggerCollectionPage contains a page of LoggerContract values. 7719type LoggerCollectionPage struct { 7720 fn func(context.Context, LoggerCollection) (LoggerCollection, error) 7721 lc LoggerCollection 7722} 7723 7724// NextWithContext advances to the next page of values. If there was an error making 7725// the request the page does not advance and the error is returned. 7726func (page *LoggerCollectionPage) NextWithContext(ctx context.Context) (err error) { 7727 if tracing.IsEnabled() { 7728 ctx = tracing.StartSpan(ctx, fqdn+"/LoggerCollectionPage.NextWithContext") 7729 defer func() { 7730 sc := -1 7731 if page.Response().Response.Response != nil { 7732 sc = page.Response().Response.Response.StatusCode 7733 } 7734 tracing.EndSpan(ctx, sc, err) 7735 }() 7736 } 7737 for { 7738 next, err := page.fn(ctx, page.lc) 7739 if err != nil { 7740 return err 7741 } 7742 page.lc = next 7743 if !next.hasNextLink() || !next.IsEmpty() { 7744 break 7745 } 7746 } 7747 return nil 7748} 7749 7750// Next advances to the next page of values. If there was an error making 7751// the request the page does not advance and the error is returned. 7752// Deprecated: Use NextWithContext() instead. 7753func (page *LoggerCollectionPage) Next() error { 7754 return page.NextWithContext(context.Background()) 7755} 7756 7757// NotDone returns true if the page enumeration should be started or is not yet complete. 7758func (page LoggerCollectionPage) NotDone() bool { 7759 return !page.lc.IsEmpty() 7760} 7761 7762// Response returns the raw server response from the last page request. 7763func (page LoggerCollectionPage) Response() LoggerCollection { 7764 return page.lc 7765} 7766 7767// Values returns the slice of values for the current page or nil if there are no values. 7768func (page LoggerCollectionPage) Values() []LoggerContract { 7769 if page.lc.IsEmpty() { 7770 return nil 7771 } 7772 return *page.lc.Value 7773} 7774 7775// Creates a new instance of the LoggerCollectionPage type. 7776func NewLoggerCollectionPage(cur LoggerCollection, getNextPage func(context.Context, LoggerCollection) (LoggerCollection, error)) LoggerCollectionPage { 7777 return LoggerCollectionPage{ 7778 fn: getNextPage, 7779 lc: cur, 7780 } 7781} 7782 7783// LoggerContract logger details. 7784type LoggerContract struct { 7785 autorest.Response `json:"-"` 7786 // LoggerContractProperties - Logger entity contract properties. 7787 *LoggerContractProperties `json:"properties,omitempty"` 7788 // ID - READ-ONLY; Resource ID. 7789 ID *string `json:"id,omitempty"` 7790 // Name - READ-ONLY; Resource name. 7791 Name *string `json:"name,omitempty"` 7792 // Type - READ-ONLY; Resource type for API Management resource. 7793 Type *string `json:"type,omitempty"` 7794} 7795 7796// MarshalJSON is the custom marshaler for LoggerContract. 7797func (lc LoggerContract) MarshalJSON() ([]byte, error) { 7798 objectMap := make(map[string]interface{}) 7799 if lc.LoggerContractProperties != nil { 7800 objectMap["properties"] = lc.LoggerContractProperties 7801 } 7802 return json.Marshal(objectMap) 7803} 7804 7805// UnmarshalJSON is the custom unmarshaler for LoggerContract struct. 7806func (lc *LoggerContract) UnmarshalJSON(body []byte) error { 7807 var m map[string]*json.RawMessage 7808 err := json.Unmarshal(body, &m) 7809 if err != nil { 7810 return err 7811 } 7812 for k, v := range m { 7813 switch k { 7814 case "properties": 7815 if v != nil { 7816 var loggerContractProperties LoggerContractProperties 7817 err = json.Unmarshal(*v, &loggerContractProperties) 7818 if err != nil { 7819 return err 7820 } 7821 lc.LoggerContractProperties = &loggerContractProperties 7822 } 7823 case "id": 7824 if v != nil { 7825 var ID string 7826 err = json.Unmarshal(*v, &ID) 7827 if err != nil { 7828 return err 7829 } 7830 lc.ID = &ID 7831 } 7832 case "name": 7833 if v != nil { 7834 var name string 7835 err = json.Unmarshal(*v, &name) 7836 if err != nil { 7837 return err 7838 } 7839 lc.Name = &name 7840 } 7841 case "type": 7842 if v != nil { 7843 var typeVar string 7844 err = json.Unmarshal(*v, &typeVar) 7845 if err != nil { 7846 return err 7847 } 7848 lc.Type = &typeVar 7849 } 7850 } 7851 } 7852 7853 return nil 7854} 7855 7856// LoggerContractProperties the Logger entity in API Management represents an event sink that you can use 7857// to log API Management events. Currently the Logger entity supports logging API Management events to 7858// Azure Event Hubs. 7859type LoggerContractProperties struct { 7860 // LoggerType - Logger type. Possible values include: 'AzureEventHub', 'ApplicationInsights', 'AzureMonitor' 7861 LoggerType LoggerType `json:"loggerType,omitempty"` 7862 // Description - Logger description. 7863 Description *string `json:"description,omitempty"` 7864 // Credentials - The name and SendRule connection string of the event hub for azureEventHub logger. 7865 // Instrumentation key for applicationInsights logger. 7866 Credentials map[string]*string `json:"credentials"` 7867 // IsBuffered - Whether records are buffered in the logger before publishing. Default is assumed to be true. 7868 IsBuffered *bool `json:"isBuffered,omitempty"` 7869 // ResourceID - Azure Resource Id of a log target (either Azure Event Hub resource or Azure Application Insights resource). 7870 ResourceID *string `json:"resourceId,omitempty"` 7871} 7872 7873// MarshalJSON is the custom marshaler for LoggerContractProperties. 7874func (lcp LoggerContractProperties) MarshalJSON() ([]byte, error) { 7875 objectMap := make(map[string]interface{}) 7876 if lcp.LoggerType != "" { 7877 objectMap["loggerType"] = lcp.LoggerType 7878 } 7879 if lcp.Description != nil { 7880 objectMap["description"] = lcp.Description 7881 } 7882 if lcp.Credentials != nil { 7883 objectMap["credentials"] = lcp.Credentials 7884 } 7885 if lcp.IsBuffered != nil { 7886 objectMap["isBuffered"] = lcp.IsBuffered 7887 } 7888 if lcp.ResourceID != nil { 7889 objectMap["resourceId"] = lcp.ResourceID 7890 } 7891 return json.Marshal(objectMap) 7892} 7893 7894// LoggerUpdateContract logger update contract. 7895type LoggerUpdateContract struct { 7896 // LoggerUpdateParameters - Logger entity update contract properties. 7897 *LoggerUpdateParameters `json:"properties,omitempty"` 7898} 7899 7900// MarshalJSON is the custom marshaler for LoggerUpdateContract. 7901func (luc LoggerUpdateContract) MarshalJSON() ([]byte, error) { 7902 objectMap := make(map[string]interface{}) 7903 if luc.LoggerUpdateParameters != nil { 7904 objectMap["properties"] = luc.LoggerUpdateParameters 7905 } 7906 return json.Marshal(objectMap) 7907} 7908 7909// UnmarshalJSON is the custom unmarshaler for LoggerUpdateContract struct. 7910func (luc *LoggerUpdateContract) UnmarshalJSON(body []byte) error { 7911 var m map[string]*json.RawMessage 7912 err := json.Unmarshal(body, &m) 7913 if err != nil { 7914 return err 7915 } 7916 for k, v := range m { 7917 switch k { 7918 case "properties": 7919 if v != nil { 7920 var loggerUpdateParameters LoggerUpdateParameters 7921 err = json.Unmarshal(*v, &loggerUpdateParameters) 7922 if err != nil { 7923 return err 7924 } 7925 luc.LoggerUpdateParameters = &loggerUpdateParameters 7926 } 7927 } 7928 } 7929 7930 return nil 7931} 7932 7933// LoggerUpdateParameters parameters supplied to the Update Logger operation. 7934type LoggerUpdateParameters struct { 7935 // LoggerType - Logger type. Possible values include: 'AzureEventHub', 'ApplicationInsights', 'AzureMonitor' 7936 LoggerType LoggerType `json:"loggerType,omitempty"` 7937 // Description - Logger description. 7938 Description *string `json:"description,omitempty"` 7939 // Credentials - Logger credentials. 7940 Credentials map[string]*string `json:"credentials"` 7941 // IsBuffered - Whether records are buffered in the logger before publishing. Default is assumed to be true. 7942 IsBuffered *bool `json:"isBuffered,omitempty"` 7943} 7944 7945// MarshalJSON is the custom marshaler for LoggerUpdateParameters. 7946func (lup LoggerUpdateParameters) MarshalJSON() ([]byte, error) { 7947 objectMap := make(map[string]interface{}) 7948 if lup.LoggerType != "" { 7949 objectMap["loggerType"] = lup.LoggerType 7950 } 7951 if lup.Description != nil { 7952 objectMap["description"] = lup.Description 7953 } 7954 if lup.Credentials != nil { 7955 objectMap["credentials"] = lup.Credentials 7956 } 7957 if lup.IsBuffered != nil { 7958 objectMap["isBuffered"] = lup.IsBuffered 7959 } 7960 return json.Marshal(objectMap) 7961} 7962 7963// NamedValueCollection paged NamedValue list representation. 7964type NamedValueCollection struct { 7965 autorest.Response `json:"-"` 7966 // Value - Page values. 7967 Value *[]NamedValueContract `json:"value,omitempty"` 7968 // Count - Total record count number across all pages. 7969 Count *int64 `json:"count,omitempty"` 7970 // NextLink - Next page link if any. 7971 NextLink *string `json:"nextLink,omitempty"` 7972} 7973 7974// NamedValueCollectionIterator provides access to a complete listing of NamedValueContract values. 7975type NamedValueCollectionIterator struct { 7976 i int 7977 page NamedValueCollectionPage 7978} 7979 7980// NextWithContext advances to the next value. If there was an error making 7981// the request the iterator does not advance and the error is returned. 7982func (iter *NamedValueCollectionIterator) NextWithContext(ctx context.Context) (err error) { 7983 if tracing.IsEnabled() { 7984 ctx = tracing.StartSpan(ctx, fqdn+"/NamedValueCollectionIterator.NextWithContext") 7985 defer func() { 7986 sc := -1 7987 if iter.Response().Response.Response != nil { 7988 sc = iter.Response().Response.Response.StatusCode 7989 } 7990 tracing.EndSpan(ctx, sc, err) 7991 }() 7992 } 7993 iter.i++ 7994 if iter.i < len(iter.page.Values()) { 7995 return nil 7996 } 7997 err = iter.page.NextWithContext(ctx) 7998 if err != nil { 7999 iter.i-- 8000 return err 8001 } 8002 iter.i = 0 8003 return nil 8004} 8005 8006// Next advances to the next value. If there was an error making 8007// the request the iterator does not advance and the error is returned. 8008// Deprecated: Use NextWithContext() instead. 8009func (iter *NamedValueCollectionIterator) Next() error { 8010 return iter.NextWithContext(context.Background()) 8011} 8012 8013// NotDone returns true if the enumeration should be started or is not yet complete. 8014func (iter NamedValueCollectionIterator) NotDone() bool { 8015 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 8016} 8017 8018// Response returns the raw server response from the last page request. 8019func (iter NamedValueCollectionIterator) Response() NamedValueCollection { 8020 return iter.page.Response() 8021} 8022 8023// Value returns the current value or a zero-initialized value if the 8024// iterator has advanced beyond the end of the collection. 8025func (iter NamedValueCollectionIterator) Value() NamedValueContract { 8026 if !iter.page.NotDone() { 8027 return NamedValueContract{} 8028 } 8029 return iter.page.Values()[iter.i] 8030} 8031 8032// Creates a new instance of the NamedValueCollectionIterator type. 8033func NewNamedValueCollectionIterator(page NamedValueCollectionPage) NamedValueCollectionIterator { 8034 return NamedValueCollectionIterator{page: page} 8035} 8036 8037// IsEmpty returns true if the ListResult contains no values. 8038func (nvc NamedValueCollection) IsEmpty() bool { 8039 return nvc.Value == nil || len(*nvc.Value) == 0 8040} 8041 8042// hasNextLink returns true if the NextLink is not empty. 8043func (nvc NamedValueCollection) hasNextLink() bool { 8044 return nvc.NextLink != nil && len(*nvc.NextLink) != 0 8045} 8046 8047// namedValueCollectionPreparer prepares a request to retrieve the next set of results. 8048// It returns nil if no more results exist. 8049func (nvc NamedValueCollection) namedValueCollectionPreparer(ctx context.Context) (*http.Request, error) { 8050 if !nvc.hasNextLink() { 8051 return nil, nil 8052 } 8053 return autorest.Prepare((&http.Request{}).WithContext(ctx), 8054 autorest.AsJSON(), 8055 autorest.AsGet(), 8056 autorest.WithBaseURL(to.String(nvc.NextLink))) 8057} 8058 8059// NamedValueCollectionPage contains a page of NamedValueContract values. 8060type NamedValueCollectionPage struct { 8061 fn func(context.Context, NamedValueCollection) (NamedValueCollection, error) 8062 nvc NamedValueCollection 8063} 8064 8065// NextWithContext advances to the next page of values. If there was an error making 8066// the request the page does not advance and the error is returned. 8067func (page *NamedValueCollectionPage) NextWithContext(ctx context.Context) (err error) { 8068 if tracing.IsEnabled() { 8069 ctx = tracing.StartSpan(ctx, fqdn+"/NamedValueCollectionPage.NextWithContext") 8070 defer func() { 8071 sc := -1 8072 if page.Response().Response.Response != nil { 8073 sc = page.Response().Response.Response.StatusCode 8074 } 8075 tracing.EndSpan(ctx, sc, err) 8076 }() 8077 } 8078 for { 8079 next, err := page.fn(ctx, page.nvc) 8080 if err != nil { 8081 return err 8082 } 8083 page.nvc = next 8084 if !next.hasNextLink() || !next.IsEmpty() { 8085 break 8086 } 8087 } 8088 return nil 8089} 8090 8091// Next advances to the next page of values. If there was an error making 8092// the request the page does not advance and the error is returned. 8093// Deprecated: Use NextWithContext() instead. 8094func (page *NamedValueCollectionPage) Next() error { 8095 return page.NextWithContext(context.Background()) 8096} 8097 8098// NotDone returns true if the page enumeration should be started or is not yet complete. 8099func (page NamedValueCollectionPage) NotDone() bool { 8100 return !page.nvc.IsEmpty() 8101} 8102 8103// Response returns the raw server response from the last page request. 8104func (page NamedValueCollectionPage) Response() NamedValueCollection { 8105 return page.nvc 8106} 8107 8108// Values returns the slice of values for the current page or nil if there are no values. 8109func (page NamedValueCollectionPage) Values() []NamedValueContract { 8110 if page.nvc.IsEmpty() { 8111 return nil 8112 } 8113 return *page.nvc.Value 8114} 8115 8116// Creates a new instance of the NamedValueCollectionPage type. 8117func NewNamedValueCollectionPage(cur NamedValueCollection, getNextPage func(context.Context, NamedValueCollection) (NamedValueCollection, error)) NamedValueCollectionPage { 8118 return NamedValueCollectionPage{ 8119 fn: getNextPage, 8120 nvc: cur, 8121 } 8122} 8123 8124// NamedValueContract namedValue details. 8125type NamedValueContract struct { 8126 autorest.Response `json:"-"` 8127 // NamedValueContractProperties - NamedValue entity contract properties. 8128 *NamedValueContractProperties `json:"properties,omitempty"` 8129 // ID - READ-ONLY; Resource ID. 8130 ID *string `json:"id,omitempty"` 8131 // Name - READ-ONLY; Resource name. 8132 Name *string `json:"name,omitempty"` 8133 // Type - READ-ONLY; Resource type for API Management resource. 8134 Type *string `json:"type,omitempty"` 8135} 8136 8137// MarshalJSON is the custom marshaler for NamedValueContract. 8138func (nvc NamedValueContract) MarshalJSON() ([]byte, error) { 8139 objectMap := make(map[string]interface{}) 8140 if nvc.NamedValueContractProperties != nil { 8141 objectMap["properties"] = nvc.NamedValueContractProperties 8142 } 8143 return json.Marshal(objectMap) 8144} 8145 8146// UnmarshalJSON is the custom unmarshaler for NamedValueContract struct. 8147func (nvc *NamedValueContract) UnmarshalJSON(body []byte) error { 8148 var m map[string]*json.RawMessage 8149 err := json.Unmarshal(body, &m) 8150 if err != nil { 8151 return err 8152 } 8153 for k, v := range m { 8154 switch k { 8155 case "properties": 8156 if v != nil { 8157 var namedValueContractProperties NamedValueContractProperties 8158 err = json.Unmarshal(*v, &namedValueContractProperties) 8159 if err != nil { 8160 return err 8161 } 8162 nvc.NamedValueContractProperties = &namedValueContractProperties 8163 } 8164 case "id": 8165 if v != nil { 8166 var ID string 8167 err = json.Unmarshal(*v, &ID) 8168 if err != nil { 8169 return err 8170 } 8171 nvc.ID = &ID 8172 } 8173 case "name": 8174 if v != nil { 8175 var name string 8176 err = json.Unmarshal(*v, &name) 8177 if err != nil { 8178 return err 8179 } 8180 nvc.Name = &name 8181 } 8182 case "type": 8183 if v != nil { 8184 var typeVar string 8185 err = json.Unmarshal(*v, &typeVar) 8186 if err != nil { 8187 return err 8188 } 8189 nvc.Type = &typeVar 8190 } 8191 } 8192 } 8193 8194 return nil 8195} 8196 8197// NamedValueContractProperties namedValue Contract properties. 8198type NamedValueContractProperties struct { 8199 // DisplayName - Unique name of NamedValue. It may contain only letters, digits, period, dash, and underscore characters. 8200 DisplayName *string `json:"displayName,omitempty"` 8201 // 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. 8202 Value *string `json:"value,omitempty"` 8203 // KeyVault - KeyVault location details of the namedValue. 8204 KeyVault *KeyVaultContractProperties `json:"keyVault,omitempty"` 8205 // Tags - Optional tags that when provided can be used to filter the NamedValue list. 8206 Tags *[]string `json:"tags,omitempty"` 8207 // Secret - Determines whether the value is a secret and should be encrypted or not. Default value is false. 8208 Secret *bool `json:"secret,omitempty"` 8209} 8210 8211// NamedValueCreateContract namedValue details. 8212type NamedValueCreateContract struct { 8213 // NamedValueCreateContractProperties - NamedValue entity contract properties for PUT operation. 8214 *NamedValueCreateContractProperties `json:"properties,omitempty"` 8215 // ID - READ-ONLY; Resource ID. 8216 ID *string `json:"id,omitempty"` 8217 // Name - READ-ONLY; Resource name. 8218 Name *string `json:"name,omitempty"` 8219 // Type - READ-ONLY; Resource type for API Management resource. 8220 Type *string `json:"type,omitempty"` 8221} 8222 8223// MarshalJSON is the custom marshaler for NamedValueCreateContract. 8224func (nvcc NamedValueCreateContract) MarshalJSON() ([]byte, error) { 8225 objectMap := make(map[string]interface{}) 8226 if nvcc.NamedValueCreateContractProperties != nil { 8227 objectMap["properties"] = nvcc.NamedValueCreateContractProperties 8228 } 8229 return json.Marshal(objectMap) 8230} 8231 8232// UnmarshalJSON is the custom unmarshaler for NamedValueCreateContract struct. 8233func (nvcc *NamedValueCreateContract) UnmarshalJSON(body []byte) error { 8234 var m map[string]*json.RawMessage 8235 err := json.Unmarshal(body, &m) 8236 if err != nil { 8237 return err 8238 } 8239 for k, v := range m { 8240 switch k { 8241 case "properties": 8242 if v != nil { 8243 var namedValueCreateContractProperties NamedValueCreateContractProperties 8244 err = json.Unmarshal(*v, &namedValueCreateContractProperties) 8245 if err != nil { 8246 return err 8247 } 8248 nvcc.NamedValueCreateContractProperties = &namedValueCreateContractProperties 8249 } 8250 case "id": 8251 if v != nil { 8252 var ID string 8253 err = json.Unmarshal(*v, &ID) 8254 if err != nil { 8255 return err 8256 } 8257 nvcc.ID = &ID 8258 } 8259 case "name": 8260 if v != nil { 8261 var name string 8262 err = json.Unmarshal(*v, &name) 8263 if err != nil { 8264 return err 8265 } 8266 nvcc.Name = &name 8267 } 8268 case "type": 8269 if v != nil { 8270 var typeVar string 8271 err = json.Unmarshal(*v, &typeVar) 8272 if err != nil { 8273 return err 8274 } 8275 nvcc.Type = &typeVar 8276 } 8277 } 8278 } 8279 8280 return nil 8281} 8282 8283// NamedValueCreateContractProperties namedValue Contract properties. 8284type NamedValueCreateContractProperties struct { 8285 // DisplayName - Unique name of NamedValue. It may contain only letters, digits, period, dash, and underscore characters. 8286 DisplayName *string `json:"displayName,omitempty"` 8287 // 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. 8288 Value *string `json:"value,omitempty"` 8289 // KeyVault - KeyVault location details of the namedValue. 8290 KeyVault *KeyVaultContractCreateProperties `json:"keyVault,omitempty"` 8291 // Tags - Optional tags that when provided can be used to filter the NamedValue list. 8292 Tags *[]string `json:"tags,omitempty"` 8293 // Secret - Determines whether the value is a secret and should be encrypted or not. Default value is false. 8294 Secret *bool `json:"secret,omitempty"` 8295} 8296 8297// NamedValueCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a 8298// long-running operation. 8299type NamedValueCreateOrUpdateFuture struct { 8300 azure.FutureAPI 8301 // Result returns the result of the asynchronous operation. 8302 // If the operation has not completed it will return an error. 8303 Result func(NamedValueClient) (NamedValueContract, error) 8304} 8305 8306// NamedValueEntityBaseParameters namedValue Entity Base Parameters set. 8307type NamedValueEntityBaseParameters struct { 8308 // Tags - Optional tags that when provided can be used to filter the NamedValue list. 8309 Tags *[]string `json:"tags,omitempty"` 8310 // Secret - Determines whether the value is a secret and should be encrypted or not. Default value is false. 8311 Secret *bool `json:"secret,omitempty"` 8312} 8313 8314// NamedValueRefreshSecretFuture an abstraction for monitoring and retrieving the results of a long-running 8315// operation. 8316type NamedValueRefreshSecretFuture struct { 8317 azure.FutureAPI 8318 // Result returns the result of the asynchronous operation. 8319 // If the operation has not completed it will return an error. 8320 Result func(NamedValueClient) (NamedValueContract, error) 8321} 8322 8323// NamedValueSecretContract client or app secret used in IdentityProviders, Aad, OpenID or OAuth. 8324type NamedValueSecretContract struct { 8325 autorest.Response `json:"-"` 8326 // Value - This is secret value of the NamedValue entity. 8327 Value *string `json:"value,omitempty"` 8328} 8329 8330// NamedValueUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 8331// operation. 8332type NamedValueUpdateFuture struct { 8333 azure.FutureAPI 8334 // Result returns the result of the asynchronous operation. 8335 // If the operation has not completed it will return an error. 8336 Result func(NamedValueClient) (NamedValueContract, error) 8337} 8338 8339// NamedValueUpdateParameterProperties namedValue Contract properties. 8340type NamedValueUpdateParameterProperties struct { 8341 // DisplayName - Unique name of NamedValue. It may contain only letters, digits, period, dash, and underscore characters. 8342 DisplayName *string `json:"displayName,omitempty"` 8343 // Value - Value of the NamedValue. Can contain policy expressions. It may not be empty or consist only of whitespace. 8344 Value *string `json:"value,omitempty"` 8345 // KeyVault - KeyVault location details of the namedValue. 8346 KeyVault *KeyVaultContractCreateProperties `json:"keyVault,omitempty"` 8347 // Tags - Optional tags that when provided can be used to filter the NamedValue list. 8348 Tags *[]string `json:"tags,omitempty"` 8349 // Secret - Determines whether the value is a secret and should be encrypted or not. Default value is false. 8350 Secret *bool `json:"secret,omitempty"` 8351} 8352 8353// NamedValueUpdateParameters namedValue update Parameters. 8354type NamedValueUpdateParameters struct { 8355 // NamedValueUpdateParameterProperties - NamedValue entity Update contract properties. 8356 *NamedValueUpdateParameterProperties `json:"properties,omitempty"` 8357} 8358 8359// MarshalJSON is the custom marshaler for NamedValueUpdateParameters. 8360func (nvup NamedValueUpdateParameters) MarshalJSON() ([]byte, error) { 8361 objectMap := make(map[string]interface{}) 8362 if nvup.NamedValueUpdateParameterProperties != nil { 8363 objectMap["properties"] = nvup.NamedValueUpdateParameterProperties 8364 } 8365 return json.Marshal(objectMap) 8366} 8367 8368// UnmarshalJSON is the custom unmarshaler for NamedValueUpdateParameters struct. 8369func (nvup *NamedValueUpdateParameters) UnmarshalJSON(body []byte) error { 8370 var m map[string]*json.RawMessage 8371 err := json.Unmarshal(body, &m) 8372 if err != nil { 8373 return err 8374 } 8375 for k, v := range m { 8376 switch k { 8377 case "properties": 8378 if v != nil { 8379 var namedValueUpdateParameterProperties NamedValueUpdateParameterProperties 8380 err = json.Unmarshal(*v, &namedValueUpdateParameterProperties) 8381 if err != nil { 8382 return err 8383 } 8384 nvup.NamedValueUpdateParameterProperties = &namedValueUpdateParameterProperties 8385 } 8386 } 8387 } 8388 8389 return nil 8390} 8391 8392// NetworkStatusContract network Status details. 8393type NetworkStatusContract struct { 8394 autorest.Response `json:"-"` 8395 // DNSServers - Gets the list of DNS servers IPV4 addresses. 8396 DNSServers *[]string `json:"dnsServers,omitempty"` 8397 // ConnectivityStatus - Gets the list of Connectivity Status to the Resources on which the service depends upon. 8398 ConnectivityStatus *[]ConnectivityStatusContract `json:"connectivityStatus,omitempty"` 8399} 8400 8401// NetworkStatusContractByLocation network Status in the Location 8402type NetworkStatusContractByLocation struct { 8403 // Location - Location of service 8404 Location *string `json:"location,omitempty"` 8405 // NetworkStatus - Network status in Location 8406 NetworkStatus *NetworkStatusContract `json:"networkStatus,omitempty"` 8407} 8408 8409// NotificationCollection paged Notification list representation. 8410type NotificationCollection struct { 8411 autorest.Response `json:"-"` 8412 // Value - Page values. 8413 Value *[]NotificationContract `json:"value,omitempty"` 8414 // Count - Total record count number across all pages. 8415 Count *int64 `json:"count,omitempty"` 8416 // NextLink - Next page link if any. 8417 NextLink *string `json:"nextLink,omitempty"` 8418} 8419 8420// NotificationCollectionIterator provides access to a complete listing of NotificationContract values. 8421type NotificationCollectionIterator struct { 8422 i int 8423 page NotificationCollectionPage 8424} 8425 8426// NextWithContext advances to the next value. If there was an error making 8427// the request the iterator does not advance and the error is returned. 8428func (iter *NotificationCollectionIterator) NextWithContext(ctx context.Context) (err error) { 8429 if tracing.IsEnabled() { 8430 ctx = tracing.StartSpan(ctx, fqdn+"/NotificationCollectionIterator.NextWithContext") 8431 defer func() { 8432 sc := -1 8433 if iter.Response().Response.Response != nil { 8434 sc = iter.Response().Response.Response.StatusCode 8435 } 8436 tracing.EndSpan(ctx, sc, err) 8437 }() 8438 } 8439 iter.i++ 8440 if iter.i < len(iter.page.Values()) { 8441 return nil 8442 } 8443 err = iter.page.NextWithContext(ctx) 8444 if err != nil { 8445 iter.i-- 8446 return err 8447 } 8448 iter.i = 0 8449 return nil 8450} 8451 8452// Next advances to the next value. If there was an error making 8453// the request the iterator does not advance and the error is returned. 8454// Deprecated: Use NextWithContext() instead. 8455func (iter *NotificationCollectionIterator) Next() error { 8456 return iter.NextWithContext(context.Background()) 8457} 8458 8459// NotDone returns true if the enumeration should be started or is not yet complete. 8460func (iter NotificationCollectionIterator) NotDone() bool { 8461 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 8462} 8463 8464// Response returns the raw server response from the last page request. 8465func (iter NotificationCollectionIterator) Response() NotificationCollection { 8466 return iter.page.Response() 8467} 8468 8469// Value returns the current value or a zero-initialized value if the 8470// iterator has advanced beyond the end of the collection. 8471func (iter NotificationCollectionIterator) Value() NotificationContract { 8472 if !iter.page.NotDone() { 8473 return NotificationContract{} 8474 } 8475 return iter.page.Values()[iter.i] 8476} 8477 8478// Creates a new instance of the NotificationCollectionIterator type. 8479func NewNotificationCollectionIterator(page NotificationCollectionPage) NotificationCollectionIterator { 8480 return NotificationCollectionIterator{page: page} 8481} 8482 8483// IsEmpty returns true if the ListResult contains no values. 8484func (nc NotificationCollection) IsEmpty() bool { 8485 return nc.Value == nil || len(*nc.Value) == 0 8486} 8487 8488// hasNextLink returns true if the NextLink is not empty. 8489func (nc NotificationCollection) hasNextLink() bool { 8490 return nc.NextLink != nil && len(*nc.NextLink) != 0 8491} 8492 8493// notificationCollectionPreparer prepares a request to retrieve the next set of results. 8494// It returns nil if no more results exist. 8495func (nc NotificationCollection) notificationCollectionPreparer(ctx context.Context) (*http.Request, error) { 8496 if !nc.hasNextLink() { 8497 return nil, nil 8498 } 8499 return autorest.Prepare((&http.Request{}).WithContext(ctx), 8500 autorest.AsJSON(), 8501 autorest.AsGet(), 8502 autorest.WithBaseURL(to.String(nc.NextLink))) 8503} 8504 8505// NotificationCollectionPage contains a page of NotificationContract values. 8506type NotificationCollectionPage struct { 8507 fn func(context.Context, NotificationCollection) (NotificationCollection, error) 8508 nc NotificationCollection 8509} 8510 8511// NextWithContext advances to the next page of values. If there was an error making 8512// the request the page does not advance and the error is returned. 8513func (page *NotificationCollectionPage) NextWithContext(ctx context.Context) (err error) { 8514 if tracing.IsEnabled() { 8515 ctx = tracing.StartSpan(ctx, fqdn+"/NotificationCollectionPage.NextWithContext") 8516 defer func() { 8517 sc := -1 8518 if page.Response().Response.Response != nil { 8519 sc = page.Response().Response.Response.StatusCode 8520 } 8521 tracing.EndSpan(ctx, sc, err) 8522 }() 8523 } 8524 for { 8525 next, err := page.fn(ctx, page.nc) 8526 if err != nil { 8527 return err 8528 } 8529 page.nc = next 8530 if !next.hasNextLink() || !next.IsEmpty() { 8531 break 8532 } 8533 } 8534 return nil 8535} 8536 8537// Next advances to the next page of values. If there was an error making 8538// the request the page does not advance and the error is returned. 8539// Deprecated: Use NextWithContext() instead. 8540func (page *NotificationCollectionPage) Next() error { 8541 return page.NextWithContext(context.Background()) 8542} 8543 8544// NotDone returns true if the page enumeration should be started or is not yet complete. 8545func (page NotificationCollectionPage) NotDone() bool { 8546 return !page.nc.IsEmpty() 8547} 8548 8549// Response returns the raw server response from the last page request. 8550func (page NotificationCollectionPage) Response() NotificationCollection { 8551 return page.nc 8552} 8553 8554// Values returns the slice of values for the current page or nil if there are no values. 8555func (page NotificationCollectionPage) Values() []NotificationContract { 8556 if page.nc.IsEmpty() { 8557 return nil 8558 } 8559 return *page.nc.Value 8560} 8561 8562// Creates a new instance of the NotificationCollectionPage type. 8563func NewNotificationCollectionPage(cur NotificationCollection, getNextPage func(context.Context, NotificationCollection) (NotificationCollection, error)) NotificationCollectionPage { 8564 return NotificationCollectionPage{ 8565 fn: getNextPage, 8566 nc: cur, 8567 } 8568} 8569 8570// NotificationContract notification details. 8571type NotificationContract struct { 8572 autorest.Response `json:"-"` 8573 // NotificationContractProperties - Notification entity contract properties. 8574 *NotificationContractProperties `json:"properties,omitempty"` 8575 // ID - READ-ONLY; Resource ID. 8576 ID *string `json:"id,omitempty"` 8577 // Name - READ-ONLY; Resource name. 8578 Name *string `json:"name,omitempty"` 8579 // Type - READ-ONLY; Resource type for API Management resource. 8580 Type *string `json:"type,omitempty"` 8581} 8582 8583// MarshalJSON is the custom marshaler for NotificationContract. 8584func (nc NotificationContract) MarshalJSON() ([]byte, error) { 8585 objectMap := make(map[string]interface{}) 8586 if nc.NotificationContractProperties != nil { 8587 objectMap["properties"] = nc.NotificationContractProperties 8588 } 8589 return json.Marshal(objectMap) 8590} 8591 8592// UnmarshalJSON is the custom unmarshaler for NotificationContract struct. 8593func (nc *NotificationContract) UnmarshalJSON(body []byte) error { 8594 var m map[string]*json.RawMessage 8595 err := json.Unmarshal(body, &m) 8596 if err != nil { 8597 return err 8598 } 8599 for k, v := range m { 8600 switch k { 8601 case "properties": 8602 if v != nil { 8603 var notificationContractProperties NotificationContractProperties 8604 err = json.Unmarshal(*v, ¬ificationContractProperties) 8605 if err != nil { 8606 return err 8607 } 8608 nc.NotificationContractProperties = ¬ificationContractProperties 8609 } 8610 case "id": 8611 if v != nil { 8612 var ID string 8613 err = json.Unmarshal(*v, &ID) 8614 if err != nil { 8615 return err 8616 } 8617 nc.ID = &ID 8618 } 8619 case "name": 8620 if v != nil { 8621 var name string 8622 err = json.Unmarshal(*v, &name) 8623 if err != nil { 8624 return err 8625 } 8626 nc.Name = &name 8627 } 8628 case "type": 8629 if v != nil { 8630 var typeVar string 8631 err = json.Unmarshal(*v, &typeVar) 8632 if err != nil { 8633 return err 8634 } 8635 nc.Type = &typeVar 8636 } 8637 } 8638 } 8639 8640 return nil 8641} 8642 8643// NotificationContractProperties notification Contract properties. 8644type NotificationContractProperties struct { 8645 // Title - Title of the Notification. 8646 Title *string `json:"title,omitempty"` 8647 // Description - Description of the Notification. 8648 Description *string `json:"description,omitempty"` 8649 // Recipients - Recipient Parameter values. 8650 Recipients *RecipientsContractProperties `json:"recipients,omitempty"` 8651} 8652 8653// OAuth2AuthenticationSettingsContract API OAuth2 Authentication settings details. 8654type OAuth2AuthenticationSettingsContract struct { 8655 // AuthorizationServerID - OAuth authorization server identifier. 8656 AuthorizationServerID *string `json:"authorizationServerId,omitempty"` 8657 // Scope - operations scope. 8658 Scope *string `json:"scope,omitempty"` 8659} 8660 8661// OpenIDAuthenticationSettingsContract API OAuth2 Authentication settings details. 8662type OpenIDAuthenticationSettingsContract struct { 8663 // OpenidProviderID - OAuth authorization server identifier. 8664 OpenidProviderID *string `json:"openidProviderId,omitempty"` 8665 // BearerTokenSendingMethods - How to send token to the server. 8666 BearerTokenSendingMethods *[]BearerTokenSendingMethods `json:"bearerTokenSendingMethods,omitempty"` 8667} 8668 8669// OpenIDConnectProviderCollection paged OpenIdProviders list representation. 8670type OpenIDConnectProviderCollection struct { 8671 autorest.Response `json:"-"` 8672 // Value - Page values. 8673 Value *[]OpenidConnectProviderContract `json:"value,omitempty"` 8674 // Count - Total record count number across all pages. 8675 Count *int64 `json:"count,omitempty"` 8676 // NextLink - Next page link if any. 8677 NextLink *string `json:"nextLink,omitempty"` 8678} 8679 8680// OpenIDConnectProviderCollectionIterator provides access to a complete listing of 8681// OpenidConnectProviderContract values. 8682type OpenIDConnectProviderCollectionIterator struct { 8683 i int 8684 page OpenIDConnectProviderCollectionPage 8685} 8686 8687// NextWithContext advances to the next value. If there was an error making 8688// the request the iterator does not advance and the error is returned. 8689func (iter *OpenIDConnectProviderCollectionIterator) NextWithContext(ctx context.Context) (err error) { 8690 if tracing.IsEnabled() { 8691 ctx = tracing.StartSpan(ctx, fqdn+"/OpenIDConnectProviderCollectionIterator.NextWithContext") 8692 defer func() { 8693 sc := -1 8694 if iter.Response().Response.Response != nil { 8695 sc = iter.Response().Response.Response.StatusCode 8696 } 8697 tracing.EndSpan(ctx, sc, err) 8698 }() 8699 } 8700 iter.i++ 8701 if iter.i < len(iter.page.Values()) { 8702 return nil 8703 } 8704 err = iter.page.NextWithContext(ctx) 8705 if err != nil { 8706 iter.i-- 8707 return err 8708 } 8709 iter.i = 0 8710 return nil 8711} 8712 8713// Next advances to the next value. If there was an error making 8714// the request the iterator does not advance and the error is returned. 8715// Deprecated: Use NextWithContext() instead. 8716func (iter *OpenIDConnectProviderCollectionIterator) Next() error { 8717 return iter.NextWithContext(context.Background()) 8718} 8719 8720// NotDone returns true if the enumeration should be started or is not yet complete. 8721func (iter OpenIDConnectProviderCollectionIterator) NotDone() bool { 8722 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 8723} 8724 8725// Response returns the raw server response from the last page request. 8726func (iter OpenIDConnectProviderCollectionIterator) Response() OpenIDConnectProviderCollection { 8727 return iter.page.Response() 8728} 8729 8730// Value returns the current value or a zero-initialized value if the 8731// iterator has advanced beyond the end of the collection. 8732func (iter OpenIDConnectProviderCollectionIterator) Value() OpenidConnectProviderContract { 8733 if !iter.page.NotDone() { 8734 return OpenidConnectProviderContract{} 8735 } 8736 return iter.page.Values()[iter.i] 8737} 8738 8739// Creates a new instance of the OpenIDConnectProviderCollectionIterator type. 8740func NewOpenIDConnectProviderCollectionIterator(page OpenIDConnectProviderCollectionPage) OpenIDConnectProviderCollectionIterator { 8741 return OpenIDConnectProviderCollectionIterator{page: page} 8742} 8743 8744// IsEmpty returns true if the ListResult contains no values. 8745func (oicpc OpenIDConnectProviderCollection) IsEmpty() bool { 8746 return oicpc.Value == nil || len(*oicpc.Value) == 0 8747} 8748 8749// hasNextLink returns true if the NextLink is not empty. 8750func (oicpc OpenIDConnectProviderCollection) hasNextLink() bool { 8751 return oicpc.NextLink != nil && len(*oicpc.NextLink) != 0 8752} 8753 8754// openIDConnectProviderCollectionPreparer prepares a request to retrieve the next set of results. 8755// It returns nil if no more results exist. 8756func (oicpc OpenIDConnectProviderCollection) openIDConnectProviderCollectionPreparer(ctx context.Context) (*http.Request, error) { 8757 if !oicpc.hasNextLink() { 8758 return nil, nil 8759 } 8760 return autorest.Prepare((&http.Request{}).WithContext(ctx), 8761 autorest.AsJSON(), 8762 autorest.AsGet(), 8763 autorest.WithBaseURL(to.String(oicpc.NextLink))) 8764} 8765 8766// OpenIDConnectProviderCollectionPage contains a page of OpenidConnectProviderContract values. 8767type OpenIDConnectProviderCollectionPage struct { 8768 fn func(context.Context, OpenIDConnectProviderCollection) (OpenIDConnectProviderCollection, error) 8769 oicpc OpenIDConnectProviderCollection 8770} 8771 8772// NextWithContext advances to the next page of values. If there was an error making 8773// the request the page does not advance and the error is returned. 8774func (page *OpenIDConnectProviderCollectionPage) NextWithContext(ctx context.Context) (err error) { 8775 if tracing.IsEnabled() { 8776 ctx = tracing.StartSpan(ctx, fqdn+"/OpenIDConnectProviderCollectionPage.NextWithContext") 8777 defer func() { 8778 sc := -1 8779 if page.Response().Response.Response != nil { 8780 sc = page.Response().Response.Response.StatusCode 8781 } 8782 tracing.EndSpan(ctx, sc, err) 8783 }() 8784 } 8785 for { 8786 next, err := page.fn(ctx, page.oicpc) 8787 if err != nil { 8788 return err 8789 } 8790 page.oicpc = next 8791 if !next.hasNextLink() || !next.IsEmpty() { 8792 break 8793 } 8794 } 8795 return nil 8796} 8797 8798// Next advances to the next page of values. If there was an error making 8799// the request the page does not advance and the error is returned. 8800// Deprecated: Use NextWithContext() instead. 8801func (page *OpenIDConnectProviderCollectionPage) Next() error { 8802 return page.NextWithContext(context.Background()) 8803} 8804 8805// NotDone returns true if the page enumeration should be started or is not yet complete. 8806func (page OpenIDConnectProviderCollectionPage) NotDone() bool { 8807 return !page.oicpc.IsEmpty() 8808} 8809 8810// Response returns the raw server response from the last page request. 8811func (page OpenIDConnectProviderCollectionPage) Response() OpenIDConnectProviderCollection { 8812 return page.oicpc 8813} 8814 8815// Values returns the slice of values for the current page or nil if there are no values. 8816func (page OpenIDConnectProviderCollectionPage) Values() []OpenidConnectProviderContract { 8817 if page.oicpc.IsEmpty() { 8818 return nil 8819 } 8820 return *page.oicpc.Value 8821} 8822 8823// Creates a new instance of the OpenIDConnectProviderCollectionPage type. 8824func NewOpenIDConnectProviderCollectionPage(cur OpenIDConnectProviderCollection, getNextPage func(context.Context, OpenIDConnectProviderCollection) (OpenIDConnectProviderCollection, error)) OpenIDConnectProviderCollectionPage { 8825 return OpenIDConnectProviderCollectionPage{ 8826 fn: getNextPage, 8827 oicpc: cur, 8828 } 8829} 8830 8831// OpenidConnectProviderContract openId Connect Provider details. 8832type OpenidConnectProviderContract struct { 8833 autorest.Response `json:"-"` 8834 // OpenidConnectProviderContractProperties - OpenId Connect Provider contract properties. 8835 *OpenidConnectProviderContractProperties `json:"properties,omitempty"` 8836 // ID - READ-ONLY; Resource ID. 8837 ID *string `json:"id,omitempty"` 8838 // Name - READ-ONLY; Resource name. 8839 Name *string `json:"name,omitempty"` 8840 // Type - READ-ONLY; Resource type for API Management resource. 8841 Type *string `json:"type,omitempty"` 8842} 8843 8844// MarshalJSON is the custom marshaler for OpenidConnectProviderContract. 8845func (ocpc OpenidConnectProviderContract) MarshalJSON() ([]byte, error) { 8846 objectMap := make(map[string]interface{}) 8847 if ocpc.OpenidConnectProviderContractProperties != nil { 8848 objectMap["properties"] = ocpc.OpenidConnectProviderContractProperties 8849 } 8850 return json.Marshal(objectMap) 8851} 8852 8853// UnmarshalJSON is the custom unmarshaler for OpenidConnectProviderContract struct. 8854func (ocpc *OpenidConnectProviderContract) UnmarshalJSON(body []byte) error { 8855 var m map[string]*json.RawMessage 8856 err := json.Unmarshal(body, &m) 8857 if err != nil { 8858 return err 8859 } 8860 for k, v := range m { 8861 switch k { 8862 case "properties": 8863 if v != nil { 8864 var openidConnectProviderContractProperties OpenidConnectProviderContractProperties 8865 err = json.Unmarshal(*v, &openidConnectProviderContractProperties) 8866 if err != nil { 8867 return err 8868 } 8869 ocpc.OpenidConnectProviderContractProperties = &openidConnectProviderContractProperties 8870 } 8871 case "id": 8872 if v != nil { 8873 var ID string 8874 err = json.Unmarshal(*v, &ID) 8875 if err != nil { 8876 return err 8877 } 8878 ocpc.ID = &ID 8879 } 8880 case "name": 8881 if v != nil { 8882 var name string 8883 err = json.Unmarshal(*v, &name) 8884 if err != nil { 8885 return err 8886 } 8887 ocpc.Name = &name 8888 } 8889 case "type": 8890 if v != nil { 8891 var typeVar string 8892 err = json.Unmarshal(*v, &typeVar) 8893 if err != nil { 8894 return err 8895 } 8896 ocpc.Type = &typeVar 8897 } 8898 } 8899 } 8900 8901 return nil 8902} 8903 8904// OpenidConnectProviderContractProperties openID Connect Providers Contract. 8905type OpenidConnectProviderContractProperties struct { 8906 // DisplayName - User-friendly OpenID Connect Provider name. 8907 DisplayName *string `json:"displayName,omitempty"` 8908 // Description - User-friendly description of OpenID Connect Provider. 8909 Description *string `json:"description,omitempty"` 8910 // MetadataEndpoint - Metadata endpoint URI. 8911 MetadataEndpoint *string `json:"metadataEndpoint,omitempty"` 8912 // ClientID - Client ID of developer console which is the client application. 8913 ClientID *string `json:"clientId,omitempty"` 8914 // ClientSecret - Client Secret of developer console which is the client application. 8915 ClientSecret *string `json:"clientSecret,omitempty"` 8916} 8917 8918// OpenidConnectProviderUpdateContract parameters supplied to the Update OpenID Connect Provider operation. 8919type OpenidConnectProviderUpdateContract struct { 8920 // OpenidConnectProviderUpdateContractProperties - OpenId Connect Provider Update contract properties. 8921 *OpenidConnectProviderUpdateContractProperties `json:"properties,omitempty"` 8922} 8923 8924// MarshalJSON is the custom marshaler for OpenidConnectProviderUpdateContract. 8925func (ocpuc OpenidConnectProviderUpdateContract) MarshalJSON() ([]byte, error) { 8926 objectMap := make(map[string]interface{}) 8927 if ocpuc.OpenidConnectProviderUpdateContractProperties != nil { 8928 objectMap["properties"] = ocpuc.OpenidConnectProviderUpdateContractProperties 8929 } 8930 return json.Marshal(objectMap) 8931} 8932 8933// UnmarshalJSON is the custom unmarshaler for OpenidConnectProviderUpdateContract struct. 8934func (ocpuc *OpenidConnectProviderUpdateContract) UnmarshalJSON(body []byte) error { 8935 var m map[string]*json.RawMessage 8936 err := json.Unmarshal(body, &m) 8937 if err != nil { 8938 return err 8939 } 8940 for k, v := range m { 8941 switch k { 8942 case "properties": 8943 if v != nil { 8944 var openidConnectProviderUpdateContractProperties OpenidConnectProviderUpdateContractProperties 8945 err = json.Unmarshal(*v, &openidConnectProviderUpdateContractProperties) 8946 if err != nil { 8947 return err 8948 } 8949 ocpuc.OpenidConnectProviderUpdateContractProperties = &openidConnectProviderUpdateContractProperties 8950 } 8951 } 8952 } 8953 8954 return nil 8955} 8956 8957// OpenidConnectProviderUpdateContractProperties parameters supplied to the Update OpenID Connect Provider 8958// operation. 8959type OpenidConnectProviderUpdateContractProperties struct { 8960 // DisplayName - User-friendly OpenID Connect Provider name. 8961 DisplayName *string `json:"displayName,omitempty"` 8962 // Description - User-friendly description of OpenID Connect Provider. 8963 Description *string `json:"description,omitempty"` 8964 // MetadataEndpoint - Metadata endpoint URI. 8965 MetadataEndpoint *string `json:"metadataEndpoint,omitempty"` 8966 // ClientID - Client ID of developer console which is the client application. 8967 ClientID *string `json:"clientId,omitempty"` 8968 // ClientSecret - Client Secret of developer console which is the client application. 8969 ClientSecret *string `json:"clientSecret,omitempty"` 8970} 8971 8972// Operation REST API operation 8973type Operation struct { 8974 // Name - Operation name: {provider}/{resource}/{operation} 8975 Name *string `json:"name,omitempty"` 8976 // Display - The object that describes the operation. 8977 Display *OperationDisplay `json:"display,omitempty"` 8978 // Origin - The operation origin. 8979 Origin *string `json:"origin,omitempty"` 8980 // Properties - The operation properties. 8981 Properties interface{} `json:"properties,omitempty"` 8982} 8983 8984// OperationCollection paged Operation list representation. 8985type OperationCollection struct { 8986 autorest.Response `json:"-"` 8987 // Value - READ-ONLY; Page values. 8988 Value *[]OperationContract `json:"value,omitempty"` 8989 // Count - Total record count number across all pages. 8990 Count *int64 `json:"count,omitempty"` 8991 // NextLink - READ-ONLY; Next page link if any. 8992 NextLink *string `json:"nextLink,omitempty"` 8993} 8994 8995// MarshalJSON is the custom marshaler for OperationCollection. 8996func (oc OperationCollection) MarshalJSON() ([]byte, error) { 8997 objectMap := make(map[string]interface{}) 8998 if oc.Count != nil { 8999 objectMap["count"] = oc.Count 9000 } 9001 return json.Marshal(objectMap) 9002} 9003 9004// OperationCollectionIterator provides access to a complete listing of OperationContract values. 9005type OperationCollectionIterator struct { 9006 i int 9007 page OperationCollectionPage 9008} 9009 9010// NextWithContext advances to the next value. If there was an error making 9011// the request the iterator does not advance and the error is returned. 9012func (iter *OperationCollectionIterator) NextWithContext(ctx context.Context) (err error) { 9013 if tracing.IsEnabled() { 9014 ctx = tracing.StartSpan(ctx, fqdn+"/OperationCollectionIterator.NextWithContext") 9015 defer func() { 9016 sc := -1 9017 if iter.Response().Response.Response != nil { 9018 sc = iter.Response().Response.Response.StatusCode 9019 } 9020 tracing.EndSpan(ctx, sc, err) 9021 }() 9022 } 9023 iter.i++ 9024 if iter.i < len(iter.page.Values()) { 9025 return nil 9026 } 9027 err = iter.page.NextWithContext(ctx) 9028 if err != nil { 9029 iter.i-- 9030 return err 9031 } 9032 iter.i = 0 9033 return nil 9034} 9035 9036// Next advances to the next value. If there was an error making 9037// the request the iterator does not advance and the error is returned. 9038// Deprecated: Use NextWithContext() instead. 9039func (iter *OperationCollectionIterator) Next() error { 9040 return iter.NextWithContext(context.Background()) 9041} 9042 9043// NotDone returns true if the enumeration should be started or is not yet complete. 9044func (iter OperationCollectionIterator) NotDone() bool { 9045 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 9046} 9047 9048// Response returns the raw server response from the last page request. 9049func (iter OperationCollectionIterator) Response() OperationCollection { 9050 return iter.page.Response() 9051} 9052 9053// Value returns the current value or a zero-initialized value if the 9054// iterator has advanced beyond the end of the collection. 9055func (iter OperationCollectionIterator) Value() OperationContract { 9056 if !iter.page.NotDone() { 9057 return OperationContract{} 9058 } 9059 return iter.page.Values()[iter.i] 9060} 9061 9062// Creates a new instance of the OperationCollectionIterator type. 9063func NewOperationCollectionIterator(page OperationCollectionPage) OperationCollectionIterator { 9064 return OperationCollectionIterator{page: page} 9065} 9066 9067// IsEmpty returns true if the ListResult contains no values. 9068func (oc OperationCollection) IsEmpty() bool { 9069 return oc.Value == nil || len(*oc.Value) == 0 9070} 9071 9072// hasNextLink returns true if the NextLink is not empty. 9073func (oc OperationCollection) hasNextLink() bool { 9074 return oc.NextLink != nil && len(*oc.NextLink) != 0 9075} 9076 9077// operationCollectionPreparer prepares a request to retrieve the next set of results. 9078// It returns nil if no more results exist. 9079func (oc OperationCollection) operationCollectionPreparer(ctx context.Context) (*http.Request, error) { 9080 if !oc.hasNextLink() { 9081 return nil, nil 9082 } 9083 return autorest.Prepare((&http.Request{}).WithContext(ctx), 9084 autorest.AsJSON(), 9085 autorest.AsGet(), 9086 autorest.WithBaseURL(to.String(oc.NextLink))) 9087} 9088 9089// OperationCollectionPage contains a page of OperationContract values. 9090type OperationCollectionPage struct { 9091 fn func(context.Context, OperationCollection) (OperationCollection, error) 9092 oc OperationCollection 9093} 9094 9095// NextWithContext advances to the next page of values. If there was an error making 9096// the request the page does not advance and the error is returned. 9097func (page *OperationCollectionPage) NextWithContext(ctx context.Context) (err error) { 9098 if tracing.IsEnabled() { 9099 ctx = tracing.StartSpan(ctx, fqdn+"/OperationCollectionPage.NextWithContext") 9100 defer func() { 9101 sc := -1 9102 if page.Response().Response.Response != nil { 9103 sc = page.Response().Response.Response.StatusCode 9104 } 9105 tracing.EndSpan(ctx, sc, err) 9106 }() 9107 } 9108 for { 9109 next, err := page.fn(ctx, page.oc) 9110 if err != nil { 9111 return err 9112 } 9113 page.oc = next 9114 if !next.hasNextLink() || !next.IsEmpty() { 9115 break 9116 } 9117 } 9118 return nil 9119} 9120 9121// Next advances to the next page of values. If there was an error making 9122// the request the page does not advance and the error is returned. 9123// Deprecated: Use NextWithContext() instead. 9124func (page *OperationCollectionPage) Next() error { 9125 return page.NextWithContext(context.Background()) 9126} 9127 9128// NotDone returns true if the page enumeration should be started or is not yet complete. 9129func (page OperationCollectionPage) NotDone() bool { 9130 return !page.oc.IsEmpty() 9131} 9132 9133// Response returns the raw server response from the last page request. 9134func (page OperationCollectionPage) Response() OperationCollection { 9135 return page.oc 9136} 9137 9138// Values returns the slice of values for the current page or nil if there are no values. 9139func (page OperationCollectionPage) Values() []OperationContract { 9140 if page.oc.IsEmpty() { 9141 return nil 9142 } 9143 return *page.oc.Value 9144} 9145 9146// Creates a new instance of the OperationCollectionPage type. 9147func NewOperationCollectionPage(cur OperationCollection, getNextPage func(context.Context, OperationCollection) (OperationCollection, error)) OperationCollectionPage { 9148 return OperationCollectionPage{ 9149 fn: getNextPage, 9150 oc: cur, 9151 } 9152} 9153 9154// OperationContract api Operation details. 9155type OperationContract struct { 9156 autorest.Response `json:"-"` 9157 // OperationContractProperties - Properties of the Operation Contract. 9158 *OperationContractProperties `json:"properties,omitempty"` 9159 // ID - READ-ONLY; Resource ID. 9160 ID *string `json:"id,omitempty"` 9161 // Name - READ-ONLY; Resource name. 9162 Name *string `json:"name,omitempty"` 9163 // Type - READ-ONLY; Resource type for API Management resource. 9164 Type *string `json:"type,omitempty"` 9165} 9166 9167// MarshalJSON is the custom marshaler for OperationContract. 9168func (oc OperationContract) MarshalJSON() ([]byte, error) { 9169 objectMap := make(map[string]interface{}) 9170 if oc.OperationContractProperties != nil { 9171 objectMap["properties"] = oc.OperationContractProperties 9172 } 9173 return json.Marshal(objectMap) 9174} 9175 9176// UnmarshalJSON is the custom unmarshaler for OperationContract struct. 9177func (oc *OperationContract) UnmarshalJSON(body []byte) error { 9178 var m map[string]*json.RawMessage 9179 err := json.Unmarshal(body, &m) 9180 if err != nil { 9181 return err 9182 } 9183 for k, v := range m { 9184 switch k { 9185 case "properties": 9186 if v != nil { 9187 var operationContractProperties OperationContractProperties 9188 err = json.Unmarshal(*v, &operationContractProperties) 9189 if err != nil { 9190 return err 9191 } 9192 oc.OperationContractProperties = &operationContractProperties 9193 } 9194 case "id": 9195 if v != nil { 9196 var ID string 9197 err = json.Unmarshal(*v, &ID) 9198 if err != nil { 9199 return err 9200 } 9201 oc.ID = &ID 9202 } 9203 case "name": 9204 if v != nil { 9205 var name string 9206 err = json.Unmarshal(*v, &name) 9207 if err != nil { 9208 return err 9209 } 9210 oc.Name = &name 9211 } 9212 case "type": 9213 if v != nil { 9214 var typeVar string 9215 err = json.Unmarshal(*v, &typeVar) 9216 if err != nil { 9217 return err 9218 } 9219 oc.Type = &typeVar 9220 } 9221 } 9222 } 9223 9224 return nil 9225} 9226 9227// OperationContractProperties operation Contract Properties 9228type OperationContractProperties struct { 9229 // DisplayName - Operation Name. 9230 DisplayName *string `json:"displayName,omitempty"` 9231 // Method - A Valid HTTP Operation Method. Typical Http Methods like GET, PUT, POST but not limited by only them. 9232 Method *string `json:"method,omitempty"` 9233 // URLTemplate - Relative URL template identifying the target resource for this operation. May include parameters. Example: /customers/{cid}/orders/{oid}/?date={date} 9234 URLTemplate *string `json:"urlTemplate,omitempty"` 9235 // TemplateParameters - Collection of URL template parameters. 9236 TemplateParameters *[]ParameterContract `json:"templateParameters,omitempty"` 9237 // Description - Description of the operation. May include HTML formatting tags. 9238 Description *string `json:"description,omitempty"` 9239 // Request - An entity containing request details. 9240 Request *RequestContract `json:"request,omitempty"` 9241 // Responses - Array of Operation responses. 9242 Responses *[]ResponseContract `json:"responses,omitempty"` 9243 // Policies - Operation Policies 9244 Policies *string `json:"policies,omitempty"` 9245} 9246 9247// OperationDisplay the object that describes the operation. 9248type OperationDisplay struct { 9249 // Provider - Friendly name of the resource provider 9250 Provider *string `json:"provider,omitempty"` 9251 // Operation - Operation type: read, write, delete, listKeys/action, etc. 9252 Operation *string `json:"operation,omitempty"` 9253 // Resource - Resource type on which the operation is performed. 9254 Resource *string `json:"resource,omitempty"` 9255 // Description - Friendly name of the operation 9256 Description *string `json:"description,omitempty"` 9257} 9258 9259// OperationEntityBaseContract api Operation Entity Base Contract details. 9260type OperationEntityBaseContract struct { 9261 // TemplateParameters - Collection of URL template parameters. 9262 TemplateParameters *[]ParameterContract `json:"templateParameters,omitempty"` 9263 // Description - Description of the operation. May include HTML formatting tags. 9264 Description *string `json:"description,omitempty"` 9265 // Request - An entity containing request details. 9266 Request *RequestContract `json:"request,omitempty"` 9267 // Responses - Array of Operation responses. 9268 Responses *[]ResponseContract `json:"responses,omitempty"` 9269 // Policies - Operation Policies 9270 Policies *string `json:"policies,omitempty"` 9271} 9272 9273// OperationListResult result of the request to list REST API operations. It contains a list of operations 9274// and a URL nextLink to get the next set of results. 9275type OperationListResult struct { 9276 autorest.Response `json:"-"` 9277 // Value - List of operations supported by the resource provider. 9278 Value *[]Operation `json:"value,omitempty"` 9279 // NextLink - URL to get the next set of operation list results if there are any. 9280 NextLink *string `json:"nextLink,omitempty"` 9281} 9282 9283// OperationListResultIterator provides access to a complete listing of Operation values. 9284type OperationListResultIterator struct { 9285 i int 9286 page OperationListResultPage 9287} 9288 9289// NextWithContext advances to the next value. If there was an error making 9290// the request the iterator does not advance and the error is returned. 9291func (iter *OperationListResultIterator) NextWithContext(ctx context.Context) (err error) { 9292 if tracing.IsEnabled() { 9293 ctx = tracing.StartSpan(ctx, fqdn+"/OperationListResultIterator.NextWithContext") 9294 defer func() { 9295 sc := -1 9296 if iter.Response().Response.Response != nil { 9297 sc = iter.Response().Response.Response.StatusCode 9298 } 9299 tracing.EndSpan(ctx, sc, err) 9300 }() 9301 } 9302 iter.i++ 9303 if iter.i < len(iter.page.Values()) { 9304 return nil 9305 } 9306 err = iter.page.NextWithContext(ctx) 9307 if err != nil { 9308 iter.i-- 9309 return err 9310 } 9311 iter.i = 0 9312 return nil 9313} 9314 9315// Next advances to the next value. If there was an error making 9316// the request the iterator does not advance and the error is returned. 9317// Deprecated: Use NextWithContext() instead. 9318func (iter *OperationListResultIterator) Next() error { 9319 return iter.NextWithContext(context.Background()) 9320} 9321 9322// NotDone returns true if the enumeration should be started or is not yet complete. 9323func (iter OperationListResultIterator) NotDone() bool { 9324 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 9325} 9326 9327// Response returns the raw server response from the last page request. 9328func (iter OperationListResultIterator) Response() OperationListResult { 9329 return iter.page.Response() 9330} 9331 9332// Value returns the current value or a zero-initialized value if the 9333// iterator has advanced beyond the end of the collection. 9334func (iter OperationListResultIterator) Value() Operation { 9335 if !iter.page.NotDone() { 9336 return Operation{} 9337 } 9338 return iter.page.Values()[iter.i] 9339} 9340 9341// Creates a new instance of the OperationListResultIterator type. 9342func NewOperationListResultIterator(page OperationListResultPage) OperationListResultIterator { 9343 return OperationListResultIterator{page: page} 9344} 9345 9346// IsEmpty returns true if the ListResult contains no values. 9347func (olr OperationListResult) IsEmpty() bool { 9348 return olr.Value == nil || len(*olr.Value) == 0 9349} 9350 9351// hasNextLink returns true if the NextLink is not empty. 9352func (olr OperationListResult) hasNextLink() bool { 9353 return olr.NextLink != nil && len(*olr.NextLink) != 0 9354} 9355 9356// operationListResultPreparer prepares a request to retrieve the next set of results. 9357// It returns nil if no more results exist. 9358func (olr OperationListResult) operationListResultPreparer(ctx context.Context) (*http.Request, error) { 9359 if !olr.hasNextLink() { 9360 return nil, nil 9361 } 9362 return autorest.Prepare((&http.Request{}).WithContext(ctx), 9363 autorest.AsJSON(), 9364 autorest.AsGet(), 9365 autorest.WithBaseURL(to.String(olr.NextLink))) 9366} 9367 9368// OperationListResultPage contains a page of Operation values. 9369type OperationListResultPage struct { 9370 fn func(context.Context, OperationListResult) (OperationListResult, error) 9371 olr OperationListResult 9372} 9373 9374// NextWithContext advances to the next page of values. If there was an error making 9375// the request the page does not advance and the error is returned. 9376func (page *OperationListResultPage) NextWithContext(ctx context.Context) (err error) { 9377 if tracing.IsEnabled() { 9378 ctx = tracing.StartSpan(ctx, fqdn+"/OperationListResultPage.NextWithContext") 9379 defer func() { 9380 sc := -1 9381 if page.Response().Response.Response != nil { 9382 sc = page.Response().Response.Response.StatusCode 9383 } 9384 tracing.EndSpan(ctx, sc, err) 9385 }() 9386 } 9387 for { 9388 next, err := page.fn(ctx, page.olr) 9389 if err != nil { 9390 return err 9391 } 9392 page.olr = next 9393 if !next.hasNextLink() || !next.IsEmpty() { 9394 break 9395 } 9396 } 9397 return nil 9398} 9399 9400// Next advances to the next page of values. If there was an error making 9401// the request the page does not advance and the error is returned. 9402// Deprecated: Use NextWithContext() instead. 9403func (page *OperationListResultPage) Next() error { 9404 return page.NextWithContext(context.Background()) 9405} 9406 9407// NotDone returns true if the page enumeration should be started or is not yet complete. 9408func (page OperationListResultPage) NotDone() bool { 9409 return !page.olr.IsEmpty() 9410} 9411 9412// Response returns the raw server response from the last page request. 9413func (page OperationListResultPage) Response() OperationListResult { 9414 return page.olr 9415} 9416 9417// Values returns the slice of values for the current page or nil if there are no values. 9418func (page OperationListResultPage) Values() []Operation { 9419 if page.olr.IsEmpty() { 9420 return nil 9421 } 9422 return *page.olr.Value 9423} 9424 9425// Creates a new instance of the OperationListResultPage type. 9426func NewOperationListResultPage(cur OperationListResult, getNextPage func(context.Context, OperationListResult) (OperationListResult, error)) OperationListResultPage { 9427 return OperationListResultPage{ 9428 fn: getNextPage, 9429 olr: cur, 9430 } 9431} 9432 9433// OperationResultContract operation Result. 9434type OperationResultContract struct { 9435 autorest.Response `json:"-"` 9436 // ID - Operation result identifier. 9437 ID *string `json:"id,omitempty"` 9438 // Status - Status of an async operation. Possible values include: 'Started', 'InProgress', 'Succeeded', 'Failed' 9439 Status AsyncOperationStatus `json:"status,omitempty"` 9440 // 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. 9441 Started *date.Time `json:"started,omitempty"` 9442 // 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. 9443 Updated *date.Time `json:"updated,omitempty"` 9444 // ResultInfo - Optional result info. 9445 ResultInfo *string `json:"resultInfo,omitempty"` 9446 // Error - Error Body Contract 9447 Error *ErrorResponseBody `json:"error,omitempty"` 9448 // 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. 9449 ActionLog *[]OperationResultLogItemContract `json:"actionLog,omitempty"` 9450} 9451 9452// MarshalJSON is the custom marshaler for OperationResultContract. 9453func (orc OperationResultContract) MarshalJSON() ([]byte, error) { 9454 objectMap := make(map[string]interface{}) 9455 if orc.ID != nil { 9456 objectMap["id"] = orc.ID 9457 } 9458 if orc.Status != "" { 9459 objectMap["status"] = orc.Status 9460 } 9461 if orc.Started != nil { 9462 objectMap["started"] = orc.Started 9463 } 9464 if orc.Updated != nil { 9465 objectMap["updated"] = orc.Updated 9466 } 9467 if orc.ResultInfo != nil { 9468 objectMap["resultInfo"] = orc.ResultInfo 9469 } 9470 if orc.Error != nil { 9471 objectMap["error"] = orc.Error 9472 } 9473 return json.Marshal(objectMap) 9474} 9475 9476// OperationResultLogItemContract log of the entity being created, updated or deleted. 9477type OperationResultLogItemContract struct { 9478 // ObjectType - The type of entity contract. 9479 ObjectType *string `json:"objectType,omitempty"` 9480 // Action - Action like create/update/delete. 9481 Action *string `json:"action,omitempty"` 9482 // ObjectKey - Identifier of the entity being created/updated/deleted. 9483 ObjectKey *string `json:"objectKey,omitempty"` 9484} 9485 9486// OperationTagResourceContractProperties operation Entity contract Properties. 9487type OperationTagResourceContractProperties struct { 9488 // ID - Identifier of the operation in form /operations/{operationId}. 9489 ID *string `json:"id,omitempty"` 9490 // Name - READ-ONLY; Operation name. 9491 Name *string `json:"name,omitempty"` 9492 // APIName - READ-ONLY; Api Name. 9493 APIName *string `json:"apiName,omitempty"` 9494 // APIRevision - READ-ONLY; Api Revision. 9495 APIRevision *string `json:"apiRevision,omitempty"` 9496 // APIVersion - READ-ONLY; Api Version. 9497 APIVersion *string `json:"apiVersion,omitempty"` 9498 // Description - READ-ONLY; Operation Description. 9499 Description *string `json:"description,omitempty"` 9500 // Method - READ-ONLY; A Valid HTTP Operation Method. Typical Http Methods like GET, PUT, POST but not limited by only them. 9501 Method *string `json:"method,omitempty"` 9502 // URLTemplate - READ-ONLY; Relative URL template identifying the target resource for this operation. May include parameters. Example: /customers/{cid}/orders/{oid}/?date={date} 9503 URLTemplate *string `json:"urlTemplate,omitempty"` 9504} 9505 9506// MarshalJSON is the custom marshaler for OperationTagResourceContractProperties. 9507func (otrcp OperationTagResourceContractProperties) MarshalJSON() ([]byte, error) { 9508 objectMap := make(map[string]interface{}) 9509 if otrcp.ID != nil { 9510 objectMap["id"] = otrcp.ID 9511 } 9512 return json.Marshal(objectMap) 9513} 9514 9515// OperationUpdateContract api Operation Update Contract details. 9516type OperationUpdateContract struct { 9517 // OperationUpdateContractProperties - Properties of the API Operation entity that can be updated. 9518 *OperationUpdateContractProperties `json:"properties,omitempty"` 9519} 9520 9521// MarshalJSON is the custom marshaler for OperationUpdateContract. 9522func (ouc OperationUpdateContract) MarshalJSON() ([]byte, error) { 9523 objectMap := make(map[string]interface{}) 9524 if ouc.OperationUpdateContractProperties != nil { 9525 objectMap["properties"] = ouc.OperationUpdateContractProperties 9526 } 9527 return json.Marshal(objectMap) 9528} 9529 9530// UnmarshalJSON is the custom unmarshaler for OperationUpdateContract struct. 9531func (ouc *OperationUpdateContract) UnmarshalJSON(body []byte) error { 9532 var m map[string]*json.RawMessage 9533 err := json.Unmarshal(body, &m) 9534 if err != nil { 9535 return err 9536 } 9537 for k, v := range m { 9538 switch k { 9539 case "properties": 9540 if v != nil { 9541 var operationUpdateContractProperties OperationUpdateContractProperties 9542 err = json.Unmarshal(*v, &operationUpdateContractProperties) 9543 if err != nil { 9544 return err 9545 } 9546 ouc.OperationUpdateContractProperties = &operationUpdateContractProperties 9547 } 9548 } 9549 } 9550 9551 return nil 9552} 9553 9554// OperationUpdateContractProperties operation Update Contract Properties. 9555type OperationUpdateContractProperties struct { 9556 // DisplayName - Operation Name. 9557 DisplayName *string `json:"displayName,omitempty"` 9558 // Method - A Valid HTTP Operation Method. Typical Http Methods like GET, PUT, POST but not limited by only them. 9559 Method *string `json:"method,omitempty"` 9560 // URLTemplate - Relative URL template identifying the target resource for this operation. May include parameters. Example: /customers/{cid}/orders/{oid}/?date={date} 9561 URLTemplate *string `json:"urlTemplate,omitempty"` 9562 // TemplateParameters - Collection of URL template parameters. 9563 TemplateParameters *[]ParameterContract `json:"templateParameters,omitempty"` 9564 // Description - Description of the operation. May include HTML formatting tags. 9565 Description *string `json:"description,omitempty"` 9566 // Request - An entity containing request details. 9567 Request *RequestContract `json:"request,omitempty"` 9568 // Responses - Array of Operation responses. 9569 Responses *[]ResponseContract `json:"responses,omitempty"` 9570 // Policies - Operation Policies 9571 Policies *string `json:"policies,omitempty"` 9572} 9573 9574// ParameterContract operation parameters details. 9575type ParameterContract struct { 9576 // Name - Parameter name. 9577 Name *string `json:"name,omitempty"` 9578 // Description - Parameter description. 9579 Description *string `json:"description,omitempty"` 9580 // Type - Parameter type. 9581 Type *string `json:"type,omitempty"` 9582 // DefaultValue - Default parameter value. 9583 DefaultValue *string `json:"defaultValue,omitempty"` 9584 // Required - Specifies whether parameter is required or not. 9585 Required *bool `json:"required,omitempty"` 9586 // Values - Parameter values. 9587 Values *[]string `json:"values,omitempty"` 9588} 9589 9590// PipelineDiagnosticSettings diagnostic settings for incoming/outgoing HTTP messages to the Gateway. 9591type PipelineDiagnosticSettings struct { 9592 // Request - Diagnostic settings for request. 9593 Request *HTTPMessageDiagnostic `json:"request,omitempty"` 9594 // Response - Diagnostic settings for response. 9595 Response *HTTPMessageDiagnostic `json:"response,omitempty"` 9596} 9597 9598// PolicyCollection the response of the list policy operation. 9599type PolicyCollection struct { 9600 autorest.Response `json:"-"` 9601 // Value - Policy Contract value. 9602 Value *[]PolicyContract `json:"value,omitempty"` 9603 // Count - Total record count number. 9604 Count *int64 `json:"count,omitempty"` 9605 // NextLink - Next page link if any. 9606 NextLink *string `json:"nextLink,omitempty"` 9607} 9608 9609// PolicyContract policy Contract details. 9610type PolicyContract struct { 9611 autorest.Response `json:"-"` 9612 // PolicyContractProperties - Properties of the Policy. 9613 *PolicyContractProperties `json:"properties,omitempty"` 9614 // ID - READ-ONLY; Resource ID. 9615 ID *string `json:"id,omitempty"` 9616 // Name - READ-ONLY; Resource name. 9617 Name *string `json:"name,omitempty"` 9618 // Type - READ-ONLY; Resource type for API Management resource. 9619 Type *string `json:"type,omitempty"` 9620} 9621 9622// MarshalJSON is the custom marshaler for PolicyContract. 9623func (pc PolicyContract) MarshalJSON() ([]byte, error) { 9624 objectMap := make(map[string]interface{}) 9625 if pc.PolicyContractProperties != nil { 9626 objectMap["properties"] = pc.PolicyContractProperties 9627 } 9628 return json.Marshal(objectMap) 9629} 9630 9631// UnmarshalJSON is the custom unmarshaler for PolicyContract struct. 9632func (pc *PolicyContract) UnmarshalJSON(body []byte) error { 9633 var m map[string]*json.RawMessage 9634 err := json.Unmarshal(body, &m) 9635 if err != nil { 9636 return err 9637 } 9638 for k, v := range m { 9639 switch k { 9640 case "properties": 9641 if v != nil { 9642 var policyContractProperties PolicyContractProperties 9643 err = json.Unmarshal(*v, &policyContractProperties) 9644 if err != nil { 9645 return err 9646 } 9647 pc.PolicyContractProperties = &policyContractProperties 9648 } 9649 case "id": 9650 if v != nil { 9651 var ID string 9652 err = json.Unmarshal(*v, &ID) 9653 if err != nil { 9654 return err 9655 } 9656 pc.ID = &ID 9657 } 9658 case "name": 9659 if v != nil { 9660 var name string 9661 err = json.Unmarshal(*v, &name) 9662 if err != nil { 9663 return err 9664 } 9665 pc.Name = &name 9666 } 9667 case "type": 9668 if v != nil { 9669 var typeVar string 9670 err = json.Unmarshal(*v, &typeVar) 9671 if err != nil { 9672 return err 9673 } 9674 pc.Type = &typeVar 9675 } 9676 } 9677 } 9678 9679 return nil 9680} 9681 9682// PolicyContractProperties policy contract Properties. 9683type PolicyContractProperties struct { 9684 // Value - Contents of the Policy as defined by the format. 9685 Value *string `json:"value,omitempty"` 9686 // Format - Format of the policyContent. Possible values include: 'XML', 'XMLLink', 'Rawxml', 'RawxmlLink' 9687 Format PolicyContentFormat `json:"format,omitempty"` 9688} 9689 9690// PolicyDescriptionCollection descriptions of APIM policies. 9691type PolicyDescriptionCollection struct { 9692 autorest.Response `json:"-"` 9693 // Value - Descriptions of APIM policies. 9694 Value *[]PolicyDescriptionContract `json:"value,omitempty"` 9695 // Count - Total record count number. 9696 Count *int64 `json:"count,omitempty"` 9697} 9698 9699// PolicyDescriptionContract policy description details. 9700type PolicyDescriptionContract struct { 9701 // PolicyDescriptionContractProperties - Policy description contract properties. 9702 *PolicyDescriptionContractProperties `json:"properties,omitempty"` 9703 // ID - READ-ONLY; Resource ID. 9704 ID *string `json:"id,omitempty"` 9705 // Name - READ-ONLY; Resource name. 9706 Name *string `json:"name,omitempty"` 9707 // Type - READ-ONLY; Resource type for API Management resource. 9708 Type *string `json:"type,omitempty"` 9709} 9710 9711// MarshalJSON is the custom marshaler for PolicyDescriptionContract. 9712func (pdc PolicyDescriptionContract) MarshalJSON() ([]byte, error) { 9713 objectMap := make(map[string]interface{}) 9714 if pdc.PolicyDescriptionContractProperties != nil { 9715 objectMap["properties"] = pdc.PolicyDescriptionContractProperties 9716 } 9717 return json.Marshal(objectMap) 9718} 9719 9720// UnmarshalJSON is the custom unmarshaler for PolicyDescriptionContract struct. 9721func (pdc *PolicyDescriptionContract) UnmarshalJSON(body []byte) error { 9722 var m map[string]*json.RawMessage 9723 err := json.Unmarshal(body, &m) 9724 if err != nil { 9725 return err 9726 } 9727 for k, v := range m { 9728 switch k { 9729 case "properties": 9730 if v != nil { 9731 var policyDescriptionContractProperties PolicyDescriptionContractProperties 9732 err = json.Unmarshal(*v, &policyDescriptionContractProperties) 9733 if err != nil { 9734 return err 9735 } 9736 pdc.PolicyDescriptionContractProperties = &policyDescriptionContractProperties 9737 } 9738 case "id": 9739 if v != nil { 9740 var ID string 9741 err = json.Unmarshal(*v, &ID) 9742 if err != nil { 9743 return err 9744 } 9745 pdc.ID = &ID 9746 } 9747 case "name": 9748 if v != nil { 9749 var name string 9750 err = json.Unmarshal(*v, &name) 9751 if err != nil { 9752 return err 9753 } 9754 pdc.Name = &name 9755 } 9756 case "type": 9757 if v != nil { 9758 var typeVar string 9759 err = json.Unmarshal(*v, &typeVar) 9760 if err != nil { 9761 return err 9762 } 9763 pdc.Type = &typeVar 9764 } 9765 } 9766 } 9767 9768 return nil 9769} 9770 9771// PolicyDescriptionContractProperties policy description properties. 9772type PolicyDescriptionContractProperties struct { 9773 // Description - READ-ONLY; Policy description. 9774 Description *string `json:"description,omitempty"` 9775 // Scope - READ-ONLY; Binary OR value of the Snippet scope. 9776 Scope *int64 `json:"scope,omitempty"` 9777} 9778 9779// PortalDelegationSettings delegation settings for a developer portal. 9780type PortalDelegationSettings struct { 9781 autorest.Response `json:"-"` 9782 // PortalDelegationSettingsProperties - Delegation settings contract properties. 9783 *PortalDelegationSettingsProperties `json:"properties,omitempty"` 9784 // ID - READ-ONLY; Resource ID. 9785 ID *string `json:"id,omitempty"` 9786 // Name - READ-ONLY; Resource name. 9787 Name *string `json:"name,omitempty"` 9788 // Type - READ-ONLY; Resource type for API Management resource. 9789 Type *string `json:"type,omitempty"` 9790} 9791 9792// MarshalJSON is the custom marshaler for PortalDelegationSettings. 9793func (pds PortalDelegationSettings) MarshalJSON() ([]byte, error) { 9794 objectMap := make(map[string]interface{}) 9795 if pds.PortalDelegationSettingsProperties != nil { 9796 objectMap["properties"] = pds.PortalDelegationSettingsProperties 9797 } 9798 return json.Marshal(objectMap) 9799} 9800 9801// UnmarshalJSON is the custom unmarshaler for PortalDelegationSettings struct. 9802func (pds *PortalDelegationSettings) UnmarshalJSON(body []byte) error { 9803 var m map[string]*json.RawMessage 9804 err := json.Unmarshal(body, &m) 9805 if err != nil { 9806 return err 9807 } 9808 for k, v := range m { 9809 switch k { 9810 case "properties": 9811 if v != nil { 9812 var portalDelegationSettingsProperties PortalDelegationSettingsProperties 9813 err = json.Unmarshal(*v, &portalDelegationSettingsProperties) 9814 if err != nil { 9815 return err 9816 } 9817 pds.PortalDelegationSettingsProperties = &portalDelegationSettingsProperties 9818 } 9819 case "id": 9820 if v != nil { 9821 var ID string 9822 err = json.Unmarshal(*v, &ID) 9823 if err != nil { 9824 return err 9825 } 9826 pds.ID = &ID 9827 } 9828 case "name": 9829 if v != nil { 9830 var name string 9831 err = json.Unmarshal(*v, &name) 9832 if err != nil { 9833 return err 9834 } 9835 pds.Name = &name 9836 } 9837 case "type": 9838 if v != nil { 9839 var typeVar string 9840 err = json.Unmarshal(*v, &typeVar) 9841 if err != nil { 9842 return err 9843 } 9844 pds.Type = &typeVar 9845 } 9846 } 9847 } 9848 9849 return nil 9850} 9851 9852// PortalDelegationSettingsProperties delegation settings contract properties. 9853type PortalDelegationSettingsProperties struct { 9854 // URL - A delegation Url. 9855 URL *string `json:"url,omitempty"` 9856 // ValidationKey - A base64-encoded validation key to validate, that a request is coming from Azure API Management. 9857 ValidationKey *string `json:"validationKey,omitempty"` 9858 // Subscriptions - Subscriptions delegation settings. 9859 Subscriptions *SubscriptionsDelegationSettingsProperties `json:"subscriptions,omitempty"` 9860 // UserRegistration - User registration delegation settings. 9861 UserRegistration *RegistrationDelegationSettingsProperties `json:"userRegistration,omitempty"` 9862} 9863 9864// PortalRevisionCollection paged list of portal revisions. 9865type PortalRevisionCollection struct { 9866 autorest.Response `json:"-"` 9867 // Value - READ-ONLY; Collection of portal revisions. 9868 Value *[]PortalRevisionContract `json:"value,omitempty"` 9869 // NextLink - READ-ONLY; Next page link, if any. 9870 NextLink *string `json:"nextLink,omitempty"` 9871} 9872 9873// PortalRevisionCollectionIterator provides access to a complete listing of PortalRevisionContract values. 9874type PortalRevisionCollectionIterator struct { 9875 i int 9876 page PortalRevisionCollectionPage 9877} 9878 9879// NextWithContext advances to the next value. If there was an error making 9880// the request the iterator does not advance and the error is returned. 9881func (iter *PortalRevisionCollectionIterator) NextWithContext(ctx context.Context) (err error) { 9882 if tracing.IsEnabled() { 9883 ctx = tracing.StartSpan(ctx, fqdn+"/PortalRevisionCollectionIterator.NextWithContext") 9884 defer func() { 9885 sc := -1 9886 if iter.Response().Response.Response != nil { 9887 sc = iter.Response().Response.Response.StatusCode 9888 } 9889 tracing.EndSpan(ctx, sc, err) 9890 }() 9891 } 9892 iter.i++ 9893 if iter.i < len(iter.page.Values()) { 9894 return nil 9895 } 9896 err = iter.page.NextWithContext(ctx) 9897 if err != nil { 9898 iter.i-- 9899 return err 9900 } 9901 iter.i = 0 9902 return nil 9903} 9904 9905// Next advances to the next value. If there was an error making 9906// the request the iterator does not advance and the error is returned. 9907// Deprecated: Use NextWithContext() instead. 9908func (iter *PortalRevisionCollectionIterator) Next() error { 9909 return iter.NextWithContext(context.Background()) 9910} 9911 9912// NotDone returns true if the enumeration should be started or is not yet complete. 9913func (iter PortalRevisionCollectionIterator) NotDone() bool { 9914 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 9915} 9916 9917// Response returns the raw server response from the last page request. 9918func (iter PortalRevisionCollectionIterator) Response() PortalRevisionCollection { 9919 return iter.page.Response() 9920} 9921 9922// Value returns the current value or a zero-initialized value if the 9923// iterator has advanced beyond the end of the collection. 9924func (iter PortalRevisionCollectionIterator) Value() PortalRevisionContract { 9925 if !iter.page.NotDone() { 9926 return PortalRevisionContract{} 9927 } 9928 return iter.page.Values()[iter.i] 9929} 9930 9931// Creates a new instance of the PortalRevisionCollectionIterator type. 9932func NewPortalRevisionCollectionIterator(page PortalRevisionCollectionPage) PortalRevisionCollectionIterator { 9933 return PortalRevisionCollectionIterator{page: page} 9934} 9935 9936// IsEmpty returns true if the ListResult contains no values. 9937func (prc PortalRevisionCollection) IsEmpty() bool { 9938 return prc.Value == nil || len(*prc.Value) == 0 9939} 9940 9941// hasNextLink returns true if the NextLink is not empty. 9942func (prc PortalRevisionCollection) hasNextLink() bool { 9943 return prc.NextLink != nil && len(*prc.NextLink) != 0 9944} 9945 9946// portalRevisionCollectionPreparer prepares a request to retrieve the next set of results. 9947// It returns nil if no more results exist. 9948func (prc PortalRevisionCollection) portalRevisionCollectionPreparer(ctx context.Context) (*http.Request, error) { 9949 if !prc.hasNextLink() { 9950 return nil, nil 9951 } 9952 return autorest.Prepare((&http.Request{}).WithContext(ctx), 9953 autorest.AsJSON(), 9954 autorest.AsGet(), 9955 autorest.WithBaseURL(to.String(prc.NextLink))) 9956} 9957 9958// PortalRevisionCollectionPage contains a page of PortalRevisionContract values. 9959type PortalRevisionCollectionPage struct { 9960 fn func(context.Context, PortalRevisionCollection) (PortalRevisionCollection, error) 9961 prc PortalRevisionCollection 9962} 9963 9964// NextWithContext advances to the next page of values. If there was an error making 9965// the request the page does not advance and the error is returned. 9966func (page *PortalRevisionCollectionPage) NextWithContext(ctx context.Context) (err error) { 9967 if tracing.IsEnabled() { 9968 ctx = tracing.StartSpan(ctx, fqdn+"/PortalRevisionCollectionPage.NextWithContext") 9969 defer func() { 9970 sc := -1 9971 if page.Response().Response.Response != nil { 9972 sc = page.Response().Response.Response.StatusCode 9973 } 9974 tracing.EndSpan(ctx, sc, err) 9975 }() 9976 } 9977 for { 9978 next, err := page.fn(ctx, page.prc) 9979 if err != nil { 9980 return err 9981 } 9982 page.prc = next 9983 if !next.hasNextLink() || !next.IsEmpty() { 9984 break 9985 } 9986 } 9987 return nil 9988} 9989 9990// Next advances to the next page of values. If there was an error making 9991// the request the page does not advance and the error is returned. 9992// Deprecated: Use NextWithContext() instead. 9993func (page *PortalRevisionCollectionPage) Next() error { 9994 return page.NextWithContext(context.Background()) 9995} 9996 9997// NotDone returns true if the page enumeration should be started or is not yet complete. 9998func (page PortalRevisionCollectionPage) NotDone() bool { 9999 return !page.prc.IsEmpty() 10000} 10001 10002// Response returns the raw server response from the last page request. 10003func (page PortalRevisionCollectionPage) Response() PortalRevisionCollection { 10004 return page.prc 10005} 10006 10007// Values returns the slice of values for the current page or nil if there are no values. 10008func (page PortalRevisionCollectionPage) Values() []PortalRevisionContract { 10009 if page.prc.IsEmpty() { 10010 return nil 10011 } 10012 return *page.prc.Value 10013} 10014 10015// Creates a new instance of the PortalRevisionCollectionPage type. 10016func NewPortalRevisionCollectionPage(cur PortalRevisionCollection, getNextPage func(context.Context, PortalRevisionCollection) (PortalRevisionCollection, error)) PortalRevisionCollectionPage { 10017 return PortalRevisionCollectionPage{ 10018 fn: getNextPage, 10019 prc: cur, 10020 } 10021} 10022 10023// PortalRevisionContract portal revisions contract details. 10024type PortalRevisionContract struct { 10025 autorest.Response `json:"-"` 10026 // PortalRevisionContractProperties - Properties of the portal revisions. 10027 *PortalRevisionContractProperties `json:"properties,omitempty"` 10028 // ID - READ-ONLY; Resource ID. 10029 ID *string `json:"id,omitempty"` 10030 // Name - READ-ONLY; Resource name. 10031 Name *string `json:"name,omitempty"` 10032 // Type - READ-ONLY; Resource type for API Management resource. 10033 Type *string `json:"type,omitempty"` 10034} 10035 10036// MarshalJSON is the custom marshaler for PortalRevisionContract. 10037func (prc PortalRevisionContract) MarshalJSON() ([]byte, error) { 10038 objectMap := make(map[string]interface{}) 10039 if prc.PortalRevisionContractProperties != nil { 10040 objectMap["properties"] = prc.PortalRevisionContractProperties 10041 } 10042 return json.Marshal(objectMap) 10043} 10044 10045// UnmarshalJSON is the custom unmarshaler for PortalRevisionContract struct. 10046func (prc *PortalRevisionContract) UnmarshalJSON(body []byte) error { 10047 var m map[string]*json.RawMessage 10048 err := json.Unmarshal(body, &m) 10049 if err != nil { 10050 return err 10051 } 10052 for k, v := range m { 10053 switch k { 10054 case "properties": 10055 if v != nil { 10056 var portalRevisionContractProperties PortalRevisionContractProperties 10057 err = json.Unmarshal(*v, &portalRevisionContractProperties) 10058 if err != nil { 10059 return err 10060 } 10061 prc.PortalRevisionContractProperties = &portalRevisionContractProperties 10062 } 10063 case "id": 10064 if v != nil { 10065 var ID string 10066 err = json.Unmarshal(*v, &ID) 10067 if err != nil { 10068 return err 10069 } 10070 prc.ID = &ID 10071 } 10072 case "name": 10073 if v != nil { 10074 var name string 10075 err = json.Unmarshal(*v, &name) 10076 if err != nil { 10077 return err 10078 } 10079 prc.Name = &name 10080 } 10081 case "type": 10082 if v != nil { 10083 var typeVar string 10084 err = json.Unmarshal(*v, &typeVar) 10085 if err != nil { 10086 return err 10087 } 10088 prc.Type = &typeVar 10089 } 10090 } 10091 } 10092 10093 return nil 10094} 10095 10096// PortalRevisionContractProperties ... 10097type PortalRevisionContractProperties struct { 10098 // Description - Portal revision description. 10099 Description *string `json:"description,omitempty"` 10100 // StatusDetails - READ-ONLY; Portal revision publishing status details. 10101 StatusDetails *string `json:"statusDetails,omitempty"` 10102 // Status - READ-ONLY; Portal revision publishing status. Possible values include: 'PortalRevisionStatusPending', 'PortalRevisionStatusPublishing', 'PortalRevisionStatusCompleted', 'PortalRevisionStatusFailed' 10103 Status PortalRevisionStatus `json:"status,omitempty"` 10104 // IsCurrent - Indicates if the Portal Revision is public. 10105 IsCurrent *bool `json:"isCurrent,omitempty"` 10106 // CreatedDateTime - READ-ONLY; Portal revision creation date and time. 10107 CreatedDateTime *date.Time `json:"createdDateTime,omitempty"` 10108 // UpdatedDateTime - READ-ONLY; Last updated date and time. 10109 UpdatedDateTime *date.Time `json:"updatedDateTime,omitempty"` 10110} 10111 10112// MarshalJSON is the custom marshaler for PortalRevisionContractProperties. 10113func (prcp PortalRevisionContractProperties) MarshalJSON() ([]byte, error) { 10114 objectMap := make(map[string]interface{}) 10115 if prcp.Description != nil { 10116 objectMap["description"] = prcp.Description 10117 } 10118 if prcp.IsCurrent != nil { 10119 objectMap["isCurrent"] = prcp.IsCurrent 10120 } 10121 return json.Marshal(objectMap) 10122} 10123 10124// PortalRevisionCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a 10125// long-running operation. 10126type PortalRevisionCreateOrUpdateFuture struct { 10127 azure.FutureAPI 10128 // Result returns the result of the asynchronous operation. 10129 // If the operation has not completed it will return an error. 10130 Result func(PortalRevisionClient) (PortalRevisionContract, error) 10131} 10132 10133// PortalRevisionUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 10134// operation. 10135type PortalRevisionUpdateFuture struct { 10136 azure.FutureAPI 10137 // Result returns the result of the asynchronous operation. 10138 // If the operation has not completed it will return an error. 10139 Result func(PortalRevisionClient) (PortalRevisionContract, error) 10140} 10141 10142// PortalSettingsCollection descriptions of APIM policies. 10143type PortalSettingsCollection struct { 10144 autorest.Response `json:"-"` 10145 // Value - Descriptions of APIM policies. 10146 Value *[]PortalSettingsContract `json:"value,omitempty"` 10147 // Count - Total record count number. 10148 Count *int64 `json:"count,omitempty"` 10149} 10150 10151// PortalSettingsContract portal Settings for the Developer Portal. 10152type PortalSettingsContract struct { 10153 // PortalSettingsContractProperties - Portal Settings contract properties. 10154 *PortalSettingsContractProperties `json:"properties,omitempty"` 10155 // ID - READ-ONLY; Resource ID. 10156 ID *string `json:"id,omitempty"` 10157 // Name - READ-ONLY; Resource name. 10158 Name *string `json:"name,omitempty"` 10159 // Type - READ-ONLY; Resource type for API Management resource. 10160 Type *string `json:"type,omitempty"` 10161} 10162 10163// MarshalJSON is the custom marshaler for PortalSettingsContract. 10164func (psc PortalSettingsContract) MarshalJSON() ([]byte, error) { 10165 objectMap := make(map[string]interface{}) 10166 if psc.PortalSettingsContractProperties != nil { 10167 objectMap["properties"] = psc.PortalSettingsContractProperties 10168 } 10169 return json.Marshal(objectMap) 10170} 10171 10172// UnmarshalJSON is the custom unmarshaler for PortalSettingsContract struct. 10173func (psc *PortalSettingsContract) UnmarshalJSON(body []byte) error { 10174 var m map[string]*json.RawMessage 10175 err := json.Unmarshal(body, &m) 10176 if err != nil { 10177 return err 10178 } 10179 for k, v := range m { 10180 switch k { 10181 case "properties": 10182 if v != nil { 10183 var portalSettingsContractProperties PortalSettingsContractProperties 10184 err = json.Unmarshal(*v, &portalSettingsContractProperties) 10185 if err != nil { 10186 return err 10187 } 10188 psc.PortalSettingsContractProperties = &portalSettingsContractProperties 10189 } 10190 case "id": 10191 if v != nil { 10192 var ID string 10193 err = json.Unmarshal(*v, &ID) 10194 if err != nil { 10195 return err 10196 } 10197 psc.ID = &ID 10198 } 10199 case "name": 10200 if v != nil { 10201 var name string 10202 err = json.Unmarshal(*v, &name) 10203 if err != nil { 10204 return err 10205 } 10206 psc.Name = &name 10207 } 10208 case "type": 10209 if v != nil { 10210 var typeVar string 10211 err = json.Unmarshal(*v, &typeVar) 10212 if err != nil { 10213 return err 10214 } 10215 psc.Type = &typeVar 10216 } 10217 } 10218 } 10219 10220 return nil 10221} 10222 10223// PortalSettingsContractProperties sign-in settings contract properties. 10224type PortalSettingsContractProperties struct { 10225 // URL - A delegation Url. 10226 URL *string `json:"url,omitempty"` 10227 // ValidationKey - A base64-encoded validation key to validate, that a request is coming from Azure API Management. 10228 ValidationKey *string `json:"validationKey,omitempty"` 10229 // Subscriptions - Subscriptions delegation settings. 10230 Subscriptions *SubscriptionsDelegationSettingsProperties `json:"subscriptions,omitempty"` 10231 // UserRegistration - User registration delegation settings. 10232 UserRegistration *RegistrationDelegationSettingsProperties `json:"userRegistration,omitempty"` 10233 // Enabled - Redirect Anonymous users to the Sign-In page. 10234 Enabled *bool `json:"enabled,omitempty"` 10235 // TermsOfService - Terms of service contract properties. 10236 TermsOfService *TermsOfServiceProperties `json:"termsOfService,omitempty"` 10237} 10238 10239// PortalSettingValidationKeyContract client or app secret used in IdentityProviders, Aad, OpenID or OAuth. 10240type PortalSettingValidationKeyContract struct { 10241 autorest.Response `json:"-"` 10242 // ValidationKey - This is secret value of the validation key in portal settings. 10243 ValidationKey *string `json:"validationKey,omitempty"` 10244} 10245 10246// PortalSigninSettingProperties sign-in settings contract properties. 10247type PortalSigninSettingProperties struct { 10248 // Enabled - Redirect Anonymous users to the Sign-In page. 10249 Enabled *bool `json:"enabled,omitempty"` 10250} 10251 10252// PortalSigninSettings sign-In settings for the Developer Portal. 10253type PortalSigninSettings struct { 10254 autorest.Response `json:"-"` 10255 // PortalSigninSettingProperties - Sign-in settings contract properties. 10256 *PortalSigninSettingProperties `json:"properties,omitempty"` 10257 // ID - READ-ONLY; Resource ID. 10258 ID *string `json:"id,omitempty"` 10259 // Name - READ-ONLY; Resource name. 10260 Name *string `json:"name,omitempty"` 10261 // Type - READ-ONLY; Resource type for API Management resource. 10262 Type *string `json:"type,omitempty"` 10263} 10264 10265// MarshalJSON is the custom marshaler for PortalSigninSettings. 10266func (pss PortalSigninSettings) MarshalJSON() ([]byte, error) { 10267 objectMap := make(map[string]interface{}) 10268 if pss.PortalSigninSettingProperties != nil { 10269 objectMap["properties"] = pss.PortalSigninSettingProperties 10270 } 10271 return json.Marshal(objectMap) 10272} 10273 10274// UnmarshalJSON is the custom unmarshaler for PortalSigninSettings struct. 10275func (pss *PortalSigninSettings) UnmarshalJSON(body []byte) error { 10276 var m map[string]*json.RawMessage 10277 err := json.Unmarshal(body, &m) 10278 if err != nil { 10279 return err 10280 } 10281 for k, v := range m { 10282 switch k { 10283 case "properties": 10284 if v != nil { 10285 var portalSigninSettingProperties PortalSigninSettingProperties 10286 err = json.Unmarshal(*v, &portalSigninSettingProperties) 10287 if err != nil { 10288 return err 10289 } 10290 pss.PortalSigninSettingProperties = &portalSigninSettingProperties 10291 } 10292 case "id": 10293 if v != nil { 10294 var ID string 10295 err = json.Unmarshal(*v, &ID) 10296 if err != nil { 10297 return err 10298 } 10299 pss.ID = &ID 10300 } 10301 case "name": 10302 if v != nil { 10303 var name string 10304 err = json.Unmarshal(*v, &name) 10305 if err != nil { 10306 return err 10307 } 10308 pss.Name = &name 10309 } 10310 case "type": 10311 if v != nil { 10312 var typeVar string 10313 err = json.Unmarshal(*v, &typeVar) 10314 if err != nil { 10315 return err 10316 } 10317 pss.Type = &typeVar 10318 } 10319 } 10320 } 10321 10322 return nil 10323} 10324 10325// PortalSignupSettings sign-Up settings for a developer portal. 10326type PortalSignupSettings struct { 10327 autorest.Response `json:"-"` 10328 // PortalSignupSettingsProperties - Sign-up settings contract properties. 10329 *PortalSignupSettingsProperties `json:"properties,omitempty"` 10330 // ID - READ-ONLY; Resource ID. 10331 ID *string `json:"id,omitempty"` 10332 // Name - READ-ONLY; Resource name. 10333 Name *string `json:"name,omitempty"` 10334 // Type - READ-ONLY; Resource type for API Management resource. 10335 Type *string `json:"type,omitempty"` 10336} 10337 10338// MarshalJSON is the custom marshaler for PortalSignupSettings. 10339func (pss PortalSignupSettings) MarshalJSON() ([]byte, error) { 10340 objectMap := make(map[string]interface{}) 10341 if pss.PortalSignupSettingsProperties != nil { 10342 objectMap["properties"] = pss.PortalSignupSettingsProperties 10343 } 10344 return json.Marshal(objectMap) 10345} 10346 10347// UnmarshalJSON is the custom unmarshaler for PortalSignupSettings struct. 10348func (pss *PortalSignupSettings) UnmarshalJSON(body []byte) error { 10349 var m map[string]*json.RawMessage 10350 err := json.Unmarshal(body, &m) 10351 if err != nil { 10352 return err 10353 } 10354 for k, v := range m { 10355 switch k { 10356 case "properties": 10357 if v != nil { 10358 var portalSignupSettingsProperties PortalSignupSettingsProperties 10359 err = json.Unmarshal(*v, &portalSignupSettingsProperties) 10360 if err != nil { 10361 return err 10362 } 10363 pss.PortalSignupSettingsProperties = &portalSignupSettingsProperties 10364 } 10365 case "id": 10366 if v != nil { 10367 var ID string 10368 err = json.Unmarshal(*v, &ID) 10369 if err != nil { 10370 return err 10371 } 10372 pss.ID = &ID 10373 } 10374 case "name": 10375 if v != nil { 10376 var name string 10377 err = json.Unmarshal(*v, &name) 10378 if err != nil { 10379 return err 10380 } 10381 pss.Name = &name 10382 } 10383 case "type": 10384 if v != nil { 10385 var typeVar string 10386 err = json.Unmarshal(*v, &typeVar) 10387 if err != nil { 10388 return err 10389 } 10390 pss.Type = &typeVar 10391 } 10392 } 10393 } 10394 10395 return nil 10396} 10397 10398// PortalSignupSettingsProperties sign-up settings contract properties. 10399type PortalSignupSettingsProperties struct { 10400 // Enabled - Allow users to sign up on a developer portal. 10401 Enabled *bool `json:"enabled,omitempty"` 10402 // TermsOfService - Terms of service contract properties. 10403 TermsOfService *TermsOfServiceProperties `json:"termsOfService,omitempty"` 10404} 10405 10406// ProductCollection paged Products list representation. 10407type ProductCollection struct { 10408 autorest.Response `json:"-"` 10409 // Value - Page values. 10410 Value *[]ProductContract `json:"value,omitempty"` 10411 // Count - Total record count number across all pages. 10412 Count *int64 `json:"count,omitempty"` 10413 // NextLink - Next page link if any. 10414 NextLink *string `json:"nextLink,omitempty"` 10415} 10416 10417// ProductCollectionIterator provides access to a complete listing of ProductContract values. 10418type ProductCollectionIterator struct { 10419 i int 10420 page ProductCollectionPage 10421} 10422 10423// NextWithContext advances to the next value. If there was an error making 10424// the request the iterator does not advance and the error is returned. 10425func (iter *ProductCollectionIterator) NextWithContext(ctx context.Context) (err error) { 10426 if tracing.IsEnabled() { 10427 ctx = tracing.StartSpan(ctx, fqdn+"/ProductCollectionIterator.NextWithContext") 10428 defer func() { 10429 sc := -1 10430 if iter.Response().Response.Response != nil { 10431 sc = iter.Response().Response.Response.StatusCode 10432 } 10433 tracing.EndSpan(ctx, sc, err) 10434 }() 10435 } 10436 iter.i++ 10437 if iter.i < len(iter.page.Values()) { 10438 return nil 10439 } 10440 err = iter.page.NextWithContext(ctx) 10441 if err != nil { 10442 iter.i-- 10443 return err 10444 } 10445 iter.i = 0 10446 return nil 10447} 10448 10449// Next advances to the next value. If there was an error making 10450// the request the iterator does not advance and the error is returned. 10451// Deprecated: Use NextWithContext() instead. 10452func (iter *ProductCollectionIterator) Next() error { 10453 return iter.NextWithContext(context.Background()) 10454} 10455 10456// NotDone returns true if the enumeration should be started or is not yet complete. 10457func (iter ProductCollectionIterator) NotDone() bool { 10458 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 10459} 10460 10461// Response returns the raw server response from the last page request. 10462func (iter ProductCollectionIterator) Response() ProductCollection { 10463 return iter.page.Response() 10464} 10465 10466// Value returns the current value or a zero-initialized value if the 10467// iterator has advanced beyond the end of the collection. 10468func (iter ProductCollectionIterator) Value() ProductContract { 10469 if !iter.page.NotDone() { 10470 return ProductContract{} 10471 } 10472 return iter.page.Values()[iter.i] 10473} 10474 10475// Creates a new instance of the ProductCollectionIterator type. 10476func NewProductCollectionIterator(page ProductCollectionPage) ProductCollectionIterator { 10477 return ProductCollectionIterator{page: page} 10478} 10479 10480// IsEmpty returns true if the ListResult contains no values. 10481func (pc ProductCollection) IsEmpty() bool { 10482 return pc.Value == nil || len(*pc.Value) == 0 10483} 10484 10485// hasNextLink returns true if the NextLink is not empty. 10486func (pc ProductCollection) hasNextLink() bool { 10487 return pc.NextLink != nil && len(*pc.NextLink) != 0 10488} 10489 10490// productCollectionPreparer prepares a request to retrieve the next set of results. 10491// It returns nil if no more results exist. 10492func (pc ProductCollection) productCollectionPreparer(ctx context.Context) (*http.Request, error) { 10493 if !pc.hasNextLink() { 10494 return nil, nil 10495 } 10496 return autorest.Prepare((&http.Request{}).WithContext(ctx), 10497 autorest.AsJSON(), 10498 autorest.AsGet(), 10499 autorest.WithBaseURL(to.String(pc.NextLink))) 10500} 10501 10502// ProductCollectionPage contains a page of ProductContract values. 10503type ProductCollectionPage struct { 10504 fn func(context.Context, ProductCollection) (ProductCollection, error) 10505 pc ProductCollection 10506} 10507 10508// NextWithContext advances to the next page of values. If there was an error making 10509// the request the page does not advance and the error is returned. 10510func (page *ProductCollectionPage) NextWithContext(ctx context.Context) (err error) { 10511 if tracing.IsEnabled() { 10512 ctx = tracing.StartSpan(ctx, fqdn+"/ProductCollectionPage.NextWithContext") 10513 defer func() { 10514 sc := -1 10515 if page.Response().Response.Response != nil { 10516 sc = page.Response().Response.Response.StatusCode 10517 } 10518 tracing.EndSpan(ctx, sc, err) 10519 }() 10520 } 10521 for { 10522 next, err := page.fn(ctx, page.pc) 10523 if err != nil { 10524 return err 10525 } 10526 page.pc = next 10527 if !next.hasNextLink() || !next.IsEmpty() { 10528 break 10529 } 10530 } 10531 return nil 10532} 10533 10534// Next advances to the next page of values. If there was an error making 10535// the request the page does not advance and the error is returned. 10536// Deprecated: Use NextWithContext() instead. 10537func (page *ProductCollectionPage) Next() error { 10538 return page.NextWithContext(context.Background()) 10539} 10540 10541// NotDone returns true if the page enumeration should be started or is not yet complete. 10542func (page ProductCollectionPage) NotDone() bool { 10543 return !page.pc.IsEmpty() 10544} 10545 10546// Response returns the raw server response from the last page request. 10547func (page ProductCollectionPage) Response() ProductCollection { 10548 return page.pc 10549} 10550 10551// Values returns the slice of values for the current page or nil if there are no values. 10552func (page ProductCollectionPage) Values() []ProductContract { 10553 if page.pc.IsEmpty() { 10554 return nil 10555 } 10556 return *page.pc.Value 10557} 10558 10559// Creates a new instance of the ProductCollectionPage type. 10560func NewProductCollectionPage(cur ProductCollection, getNextPage func(context.Context, ProductCollection) (ProductCollection, error)) ProductCollectionPage { 10561 return ProductCollectionPage{ 10562 fn: getNextPage, 10563 pc: cur, 10564 } 10565} 10566 10567// ProductContract product details. 10568type ProductContract struct { 10569 autorest.Response `json:"-"` 10570 // ProductContractProperties - Product entity contract properties. 10571 *ProductContractProperties `json:"properties,omitempty"` 10572 // ID - READ-ONLY; Resource ID. 10573 ID *string `json:"id,omitempty"` 10574 // Name - READ-ONLY; Resource name. 10575 Name *string `json:"name,omitempty"` 10576 // Type - READ-ONLY; Resource type for API Management resource. 10577 Type *string `json:"type,omitempty"` 10578} 10579 10580// MarshalJSON is the custom marshaler for ProductContract. 10581func (pc ProductContract) MarshalJSON() ([]byte, error) { 10582 objectMap := make(map[string]interface{}) 10583 if pc.ProductContractProperties != nil { 10584 objectMap["properties"] = pc.ProductContractProperties 10585 } 10586 return json.Marshal(objectMap) 10587} 10588 10589// UnmarshalJSON is the custom unmarshaler for ProductContract struct. 10590func (pc *ProductContract) UnmarshalJSON(body []byte) error { 10591 var m map[string]*json.RawMessage 10592 err := json.Unmarshal(body, &m) 10593 if err != nil { 10594 return err 10595 } 10596 for k, v := range m { 10597 switch k { 10598 case "properties": 10599 if v != nil { 10600 var productContractProperties ProductContractProperties 10601 err = json.Unmarshal(*v, &productContractProperties) 10602 if err != nil { 10603 return err 10604 } 10605 pc.ProductContractProperties = &productContractProperties 10606 } 10607 case "id": 10608 if v != nil { 10609 var ID string 10610 err = json.Unmarshal(*v, &ID) 10611 if err != nil { 10612 return err 10613 } 10614 pc.ID = &ID 10615 } 10616 case "name": 10617 if v != nil { 10618 var name string 10619 err = json.Unmarshal(*v, &name) 10620 if err != nil { 10621 return err 10622 } 10623 pc.Name = &name 10624 } 10625 case "type": 10626 if v != nil { 10627 var typeVar string 10628 err = json.Unmarshal(*v, &typeVar) 10629 if err != nil { 10630 return err 10631 } 10632 pc.Type = &typeVar 10633 } 10634 } 10635 } 10636 10637 return nil 10638} 10639 10640// ProductContractProperties product profile. 10641type ProductContractProperties struct { 10642 // DisplayName - Product name. 10643 DisplayName *string `json:"displayName,omitempty"` 10644 // Description - Product description. May include HTML formatting tags. 10645 Description *string `json:"description,omitempty"` 10646 // 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. 10647 Terms *string `json:"terms,omitempty"` 10648 // 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. 10649 SubscriptionRequired *bool `json:"subscriptionRequired,omitempty"` 10650 // 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. 10651 ApprovalRequired *bool `json:"approvalRequired,omitempty"` 10652 // 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. 10653 SubscriptionsLimit *int32 `json:"subscriptionsLimit,omitempty"` 10654 // 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' 10655 State ProductState `json:"state,omitempty"` 10656} 10657 10658// ProductEntityBaseParameters product Entity Base Parameters 10659type ProductEntityBaseParameters struct { 10660 // Description - Product description. May include HTML formatting tags. 10661 Description *string `json:"description,omitempty"` 10662 // 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. 10663 Terms *string `json:"terms,omitempty"` 10664 // 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. 10665 SubscriptionRequired *bool `json:"subscriptionRequired,omitempty"` 10666 // 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. 10667 ApprovalRequired *bool `json:"approvalRequired,omitempty"` 10668 // 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. 10669 SubscriptionsLimit *int32 `json:"subscriptionsLimit,omitempty"` 10670 // 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' 10671 State ProductState `json:"state,omitempty"` 10672} 10673 10674// ProductTagResourceContractProperties product profile. 10675type ProductTagResourceContractProperties struct { 10676 // ID - Identifier of the product in the form of /products/{productId} 10677 ID *string `json:"id,omitempty"` 10678 // Name - Product name. 10679 Name *string `json:"name,omitempty"` 10680 // Description - Product description. May include HTML formatting tags. 10681 Description *string `json:"description,omitempty"` 10682 // 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. 10683 Terms *string `json:"terms,omitempty"` 10684 // 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. 10685 SubscriptionRequired *bool `json:"subscriptionRequired,omitempty"` 10686 // 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. 10687 ApprovalRequired *bool `json:"approvalRequired,omitempty"` 10688 // 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. 10689 SubscriptionsLimit *int32 `json:"subscriptionsLimit,omitempty"` 10690 // 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' 10691 State ProductState `json:"state,omitempty"` 10692} 10693 10694// ProductUpdateParameters product Update parameters. 10695type ProductUpdateParameters struct { 10696 // ProductUpdateProperties - Product entity Update contract properties. 10697 *ProductUpdateProperties `json:"properties,omitempty"` 10698} 10699 10700// MarshalJSON is the custom marshaler for ProductUpdateParameters. 10701func (pup ProductUpdateParameters) MarshalJSON() ([]byte, error) { 10702 objectMap := make(map[string]interface{}) 10703 if pup.ProductUpdateProperties != nil { 10704 objectMap["properties"] = pup.ProductUpdateProperties 10705 } 10706 return json.Marshal(objectMap) 10707} 10708 10709// UnmarshalJSON is the custom unmarshaler for ProductUpdateParameters struct. 10710func (pup *ProductUpdateParameters) UnmarshalJSON(body []byte) error { 10711 var m map[string]*json.RawMessage 10712 err := json.Unmarshal(body, &m) 10713 if err != nil { 10714 return err 10715 } 10716 for k, v := range m { 10717 switch k { 10718 case "properties": 10719 if v != nil { 10720 var productUpdateProperties ProductUpdateProperties 10721 err = json.Unmarshal(*v, &productUpdateProperties) 10722 if err != nil { 10723 return err 10724 } 10725 pup.ProductUpdateProperties = &productUpdateProperties 10726 } 10727 } 10728 } 10729 10730 return nil 10731} 10732 10733// ProductUpdateProperties parameters supplied to the Update Product operation. 10734type ProductUpdateProperties struct { 10735 // DisplayName - Product name. 10736 DisplayName *string `json:"displayName,omitempty"` 10737 // Description - Product description. May include HTML formatting tags. 10738 Description *string `json:"description,omitempty"` 10739 // 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. 10740 Terms *string `json:"terms,omitempty"` 10741 // 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. 10742 SubscriptionRequired *bool `json:"subscriptionRequired,omitempty"` 10743 // 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. 10744 ApprovalRequired *bool `json:"approvalRequired,omitempty"` 10745 // 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. 10746 SubscriptionsLimit *int32 `json:"subscriptionsLimit,omitempty"` 10747 // 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' 10748 State ProductState `json:"state,omitempty"` 10749} 10750 10751// QuotaCounterCollection paged Quota Counter list representation. 10752type QuotaCounterCollection struct { 10753 autorest.Response `json:"-"` 10754 // Value - Quota counter values. 10755 Value *[]QuotaCounterContract `json:"value,omitempty"` 10756 // Count - Total record count number across all pages. 10757 Count *int64 `json:"count,omitempty"` 10758 // NextLink - Next page link if any. 10759 NextLink *string `json:"nextLink,omitempty"` 10760} 10761 10762// QuotaCounterContract quota counter details. 10763type QuotaCounterContract struct { 10764 autorest.Response `json:"-"` 10765 // CounterKey - The Key value of the Counter. Must not be empty. 10766 CounterKey *string `json:"counterKey,omitempty"` 10767 // PeriodKey - Identifier of the Period for which the counter was collected. Must not be empty. 10768 PeriodKey *string `json:"periodKey,omitempty"` 10769 // 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. 10770 PeriodStartTime *date.Time `json:"periodStartTime,omitempty"` 10771 // 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. 10772 PeriodEndTime *date.Time `json:"periodEndTime,omitempty"` 10773 // Value - Quota Value Properties 10774 Value *QuotaCounterValueContractProperties `json:"value,omitempty"` 10775} 10776 10777// QuotaCounterValueContract quota counter value details. 10778type QuotaCounterValueContract struct { 10779 // QuotaCounterValueContractProperties - Quota counter Value Properties. 10780 *QuotaCounterValueContractProperties `json:"value,omitempty"` 10781} 10782 10783// MarshalJSON is the custom marshaler for QuotaCounterValueContract. 10784func (qcvc QuotaCounterValueContract) MarshalJSON() ([]byte, error) { 10785 objectMap := make(map[string]interface{}) 10786 if qcvc.QuotaCounterValueContractProperties != nil { 10787 objectMap["value"] = qcvc.QuotaCounterValueContractProperties 10788 } 10789 return json.Marshal(objectMap) 10790} 10791 10792// UnmarshalJSON is the custom unmarshaler for QuotaCounterValueContract struct. 10793func (qcvc *QuotaCounterValueContract) UnmarshalJSON(body []byte) error { 10794 var m map[string]*json.RawMessage 10795 err := json.Unmarshal(body, &m) 10796 if err != nil { 10797 return err 10798 } 10799 for k, v := range m { 10800 switch k { 10801 case "value": 10802 if v != nil { 10803 var quotaCounterValueContractProperties QuotaCounterValueContractProperties 10804 err = json.Unmarshal(*v, "aCounterValueContractProperties) 10805 if err != nil { 10806 return err 10807 } 10808 qcvc.QuotaCounterValueContractProperties = "aCounterValueContractProperties 10809 } 10810 } 10811 } 10812 10813 return nil 10814} 10815 10816// QuotaCounterValueContractProperties quota counter value details. 10817type QuotaCounterValueContractProperties struct { 10818 // CallsCount - Number of times Counter was called. 10819 CallsCount *int32 `json:"callsCount,omitempty"` 10820 // KbTransferred - Data Transferred in KiloBytes. 10821 KbTransferred *float64 `json:"kbTransferred,omitempty"` 10822} 10823 10824// QuotaCounterValueUpdateContract quota counter value details. 10825type QuotaCounterValueUpdateContract struct { 10826 // QuotaCounterValueContractProperties - Quota counter value details. 10827 *QuotaCounterValueContractProperties `json:"properties,omitempty"` 10828} 10829 10830// MarshalJSON is the custom marshaler for QuotaCounterValueUpdateContract. 10831func (qcvuc QuotaCounterValueUpdateContract) MarshalJSON() ([]byte, error) { 10832 objectMap := make(map[string]interface{}) 10833 if qcvuc.QuotaCounterValueContractProperties != nil { 10834 objectMap["properties"] = qcvuc.QuotaCounterValueContractProperties 10835 } 10836 return json.Marshal(objectMap) 10837} 10838 10839// UnmarshalJSON is the custom unmarshaler for QuotaCounterValueUpdateContract struct. 10840func (qcvuc *QuotaCounterValueUpdateContract) UnmarshalJSON(body []byte) error { 10841 var m map[string]*json.RawMessage 10842 err := json.Unmarshal(body, &m) 10843 if err != nil { 10844 return err 10845 } 10846 for k, v := range m { 10847 switch k { 10848 case "properties": 10849 if v != nil { 10850 var quotaCounterValueContractProperties QuotaCounterValueContractProperties 10851 err = json.Unmarshal(*v, "aCounterValueContractProperties) 10852 if err != nil { 10853 return err 10854 } 10855 qcvuc.QuotaCounterValueContractProperties = "aCounterValueContractProperties 10856 } 10857 } 10858 } 10859 10860 return nil 10861} 10862 10863// RecipientEmailCollection paged Recipient User list representation. 10864type RecipientEmailCollection struct { 10865 autorest.Response `json:"-"` 10866 // Value - Page values. 10867 Value *[]RecipientEmailContract `json:"value,omitempty"` 10868 // Count - Total record count number across all pages. 10869 Count *int64 `json:"count,omitempty"` 10870 // NextLink - Next page link if any. 10871 NextLink *string `json:"nextLink,omitempty"` 10872} 10873 10874// RecipientEmailContract recipient Email details. 10875type RecipientEmailContract struct { 10876 autorest.Response `json:"-"` 10877 // RecipientEmailContractProperties - Recipient Email contract properties. 10878 *RecipientEmailContractProperties `json:"properties,omitempty"` 10879 // ID - READ-ONLY; Resource ID. 10880 ID *string `json:"id,omitempty"` 10881 // Name - READ-ONLY; Resource name. 10882 Name *string `json:"name,omitempty"` 10883 // Type - READ-ONLY; Resource type for API Management resource. 10884 Type *string `json:"type,omitempty"` 10885} 10886 10887// MarshalJSON is the custom marshaler for RecipientEmailContract. 10888func (rec RecipientEmailContract) MarshalJSON() ([]byte, error) { 10889 objectMap := make(map[string]interface{}) 10890 if rec.RecipientEmailContractProperties != nil { 10891 objectMap["properties"] = rec.RecipientEmailContractProperties 10892 } 10893 return json.Marshal(objectMap) 10894} 10895 10896// UnmarshalJSON is the custom unmarshaler for RecipientEmailContract struct. 10897func (rec *RecipientEmailContract) UnmarshalJSON(body []byte) error { 10898 var m map[string]*json.RawMessage 10899 err := json.Unmarshal(body, &m) 10900 if err != nil { 10901 return err 10902 } 10903 for k, v := range m { 10904 switch k { 10905 case "properties": 10906 if v != nil { 10907 var recipientEmailContractProperties RecipientEmailContractProperties 10908 err = json.Unmarshal(*v, &recipientEmailContractProperties) 10909 if err != nil { 10910 return err 10911 } 10912 rec.RecipientEmailContractProperties = &recipientEmailContractProperties 10913 } 10914 case "id": 10915 if v != nil { 10916 var ID string 10917 err = json.Unmarshal(*v, &ID) 10918 if err != nil { 10919 return err 10920 } 10921 rec.ID = &ID 10922 } 10923 case "name": 10924 if v != nil { 10925 var name string 10926 err = json.Unmarshal(*v, &name) 10927 if err != nil { 10928 return err 10929 } 10930 rec.Name = &name 10931 } 10932 case "type": 10933 if v != nil { 10934 var typeVar string 10935 err = json.Unmarshal(*v, &typeVar) 10936 if err != nil { 10937 return err 10938 } 10939 rec.Type = &typeVar 10940 } 10941 } 10942 } 10943 10944 return nil 10945} 10946 10947// RecipientEmailContractProperties recipient Email Contract Properties. 10948type RecipientEmailContractProperties struct { 10949 // Email - User Email subscribed to notification. 10950 Email *string `json:"email,omitempty"` 10951} 10952 10953// RecipientsContractProperties notification Parameter contract. 10954type RecipientsContractProperties struct { 10955 // Emails - List of Emails subscribed for the notification. 10956 Emails *[]string `json:"emails,omitempty"` 10957 // Users - List of Users subscribed for the notification. 10958 Users *[]string `json:"users,omitempty"` 10959} 10960 10961// RecipientUserCollection paged Recipient User list representation. 10962type RecipientUserCollection struct { 10963 autorest.Response `json:"-"` 10964 // Value - Page values. 10965 Value *[]RecipientUserContract `json:"value,omitempty"` 10966 // Count - Total record count number across all pages. 10967 Count *int64 `json:"count,omitempty"` 10968 // NextLink - Next page link if any. 10969 NextLink *string `json:"nextLink,omitempty"` 10970} 10971 10972// RecipientUserContract recipient User details. 10973type RecipientUserContract struct { 10974 autorest.Response `json:"-"` 10975 // RecipientUsersContractProperties - Recipient User entity contract properties. 10976 *RecipientUsersContractProperties `json:"properties,omitempty"` 10977 // ID - READ-ONLY; Resource ID. 10978 ID *string `json:"id,omitempty"` 10979 // Name - READ-ONLY; Resource name. 10980 Name *string `json:"name,omitempty"` 10981 // Type - READ-ONLY; Resource type for API Management resource. 10982 Type *string `json:"type,omitempty"` 10983} 10984 10985// MarshalJSON is the custom marshaler for RecipientUserContract. 10986func (ruc RecipientUserContract) MarshalJSON() ([]byte, error) { 10987 objectMap := make(map[string]interface{}) 10988 if ruc.RecipientUsersContractProperties != nil { 10989 objectMap["properties"] = ruc.RecipientUsersContractProperties 10990 } 10991 return json.Marshal(objectMap) 10992} 10993 10994// UnmarshalJSON is the custom unmarshaler for RecipientUserContract struct. 10995func (ruc *RecipientUserContract) UnmarshalJSON(body []byte) error { 10996 var m map[string]*json.RawMessage 10997 err := json.Unmarshal(body, &m) 10998 if err != nil { 10999 return err 11000 } 11001 for k, v := range m { 11002 switch k { 11003 case "properties": 11004 if v != nil { 11005 var recipientUsersContractProperties RecipientUsersContractProperties 11006 err = json.Unmarshal(*v, &recipientUsersContractProperties) 11007 if err != nil { 11008 return err 11009 } 11010 ruc.RecipientUsersContractProperties = &recipientUsersContractProperties 11011 } 11012 case "id": 11013 if v != nil { 11014 var ID string 11015 err = json.Unmarshal(*v, &ID) 11016 if err != nil { 11017 return err 11018 } 11019 ruc.ID = &ID 11020 } 11021 case "name": 11022 if v != nil { 11023 var name string 11024 err = json.Unmarshal(*v, &name) 11025 if err != nil { 11026 return err 11027 } 11028 ruc.Name = &name 11029 } 11030 case "type": 11031 if v != nil { 11032 var typeVar string 11033 err = json.Unmarshal(*v, &typeVar) 11034 if err != nil { 11035 return err 11036 } 11037 ruc.Type = &typeVar 11038 } 11039 } 11040 } 11041 11042 return nil 11043} 11044 11045// RecipientUsersContractProperties recipient User Contract Properties. 11046type RecipientUsersContractProperties struct { 11047 // UserID - API Management UserId subscribed to notification. 11048 UserID *string `json:"userId,omitempty"` 11049} 11050 11051// RegionContract region profile. 11052type RegionContract struct { 11053 // Name - READ-ONLY; Region name. 11054 Name *string `json:"name,omitempty"` 11055 // IsMasterRegion - whether Region is the master region. 11056 IsMasterRegion *bool `json:"isMasterRegion,omitempty"` 11057 // IsDeleted - whether Region is deleted. 11058 IsDeleted *bool `json:"isDeleted,omitempty"` 11059} 11060 11061// MarshalJSON is the custom marshaler for RegionContract. 11062func (rc RegionContract) MarshalJSON() ([]byte, error) { 11063 objectMap := make(map[string]interface{}) 11064 if rc.IsMasterRegion != nil { 11065 objectMap["isMasterRegion"] = rc.IsMasterRegion 11066 } 11067 if rc.IsDeleted != nil { 11068 objectMap["isDeleted"] = rc.IsDeleted 11069 } 11070 return json.Marshal(objectMap) 11071} 11072 11073// RegionListResult lists Regions operation response details. 11074type RegionListResult struct { 11075 autorest.Response `json:"-"` 11076 // Value - Lists of Regions. 11077 Value *[]RegionContract `json:"value,omitempty"` 11078 // Count - Total record count number across all pages. 11079 Count *int64 `json:"count,omitempty"` 11080 // NextLink - Next page link if any. 11081 NextLink *string `json:"nextLink,omitempty"` 11082} 11083 11084// RegionListResultIterator provides access to a complete listing of RegionContract values. 11085type RegionListResultIterator struct { 11086 i int 11087 page RegionListResultPage 11088} 11089 11090// NextWithContext advances to the next value. If there was an error making 11091// the request the iterator does not advance and the error is returned. 11092func (iter *RegionListResultIterator) NextWithContext(ctx context.Context) (err error) { 11093 if tracing.IsEnabled() { 11094 ctx = tracing.StartSpan(ctx, fqdn+"/RegionListResultIterator.NextWithContext") 11095 defer func() { 11096 sc := -1 11097 if iter.Response().Response.Response != nil { 11098 sc = iter.Response().Response.Response.StatusCode 11099 } 11100 tracing.EndSpan(ctx, sc, err) 11101 }() 11102 } 11103 iter.i++ 11104 if iter.i < len(iter.page.Values()) { 11105 return nil 11106 } 11107 err = iter.page.NextWithContext(ctx) 11108 if err != nil { 11109 iter.i-- 11110 return err 11111 } 11112 iter.i = 0 11113 return nil 11114} 11115 11116// Next advances to the next value. If there was an error making 11117// the request the iterator does not advance and the error is returned. 11118// Deprecated: Use NextWithContext() instead. 11119func (iter *RegionListResultIterator) Next() error { 11120 return iter.NextWithContext(context.Background()) 11121} 11122 11123// NotDone returns true if the enumeration should be started or is not yet complete. 11124func (iter RegionListResultIterator) NotDone() bool { 11125 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 11126} 11127 11128// Response returns the raw server response from the last page request. 11129func (iter RegionListResultIterator) Response() RegionListResult { 11130 return iter.page.Response() 11131} 11132 11133// Value returns the current value or a zero-initialized value if the 11134// iterator has advanced beyond the end of the collection. 11135func (iter RegionListResultIterator) Value() RegionContract { 11136 if !iter.page.NotDone() { 11137 return RegionContract{} 11138 } 11139 return iter.page.Values()[iter.i] 11140} 11141 11142// Creates a new instance of the RegionListResultIterator type. 11143func NewRegionListResultIterator(page RegionListResultPage) RegionListResultIterator { 11144 return RegionListResultIterator{page: page} 11145} 11146 11147// IsEmpty returns true if the ListResult contains no values. 11148func (rlr RegionListResult) IsEmpty() bool { 11149 return rlr.Value == nil || len(*rlr.Value) == 0 11150} 11151 11152// hasNextLink returns true if the NextLink is not empty. 11153func (rlr RegionListResult) hasNextLink() bool { 11154 return rlr.NextLink != nil && len(*rlr.NextLink) != 0 11155} 11156 11157// regionListResultPreparer prepares a request to retrieve the next set of results. 11158// It returns nil if no more results exist. 11159func (rlr RegionListResult) regionListResultPreparer(ctx context.Context) (*http.Request, error) { 11160 if !rlr.hasNextLink() { 11161 return nil, nil 11162 } 11163 return autorest.Prepare((&http.Request{}).WithContext(ctx), 11164 autorest.AsJSON(), 11165 autorest.AsGet(), 11166 autorest.WithBaseURL(to.String(rlr.NextLink))) 11167} 11168 11169// RegionListResultPage contains a page of RegionContract values. 11170type RegionListResultPage struct { 11171 fn func(context.Context, RegionListResult) (RegionListResult, error) 11172 rlr RegionListResult 11173} 11174 11175// NextWithContext advances to the next page of values. If there was an error making 11176// the request the page does not advance and the error is returned. 11177func (page *RegionListResultPage) NextWithContext(ctx context.Context) (err error) { 11178 if tracing.IsEnabled() { 11179 ctx = tracing.StartSpan(ctx, fqdn+"/RegionListResultPage.NextWithContext") 11180 defer func() { 11181 sc := -1 11182 if page.Response().Response.Response != nil { 11183 sc = page.Response().Response.Response.StatusCode 11184 } 11185 tracing.EndSpan(ctx, sc, err) 11186 }() 11187 } 11188 for { 11189 next, err := page.fn(ctx, page.rlr) 11190 if err != nil { 11191 return err 11192 } 11193 page.rlr = next 11194 if !next.hasNextLink() || !next.IsEmpty() { 11195 break 11196 } 11197 } 11198 return nil 11199} 11200 11201// Next advances to the next page of values. If there was an error making 11202// the request the page does not advance and the error is returned. 11203// Deprecated: Use NextWithContext() instead. 11204func (page *RegionListResultPage) Next() error { 11205 return page.NextWithContext(context.Background()) 11206} 11207 11208// NotDone returns true if the page enumeration should be started or is not yet complete. 11209func (page RegionListResultPage) NotDone() bool { 11210 return !page.rlr.IsEmpty() 11211} 11212 11213// Response returns the raw server response from the last page request. 11214func (page RegionListResultPage) Response() RegionListResult { 11215 return page.rlr 11216} 11217 11218// Values returns the slice of values for the current page or nil if there are no values. 11219func (page RegionListResultPage) Values() []RegionContract { 11220 if page.rlr.IsEmpty() { 11221 return nil 11222 } 11223 return *page.rlr.Value 11224} 11225 11226// Creates a new instance of the RegionListResultPage type. 11227func NewRegionListResultPage(cur RegionListResult, getNextPage func(context.Context, RegionListResult) (RegionListResult, error)) RegionListResultPage { 11228 return RegionListResultPage{ 11229 fn: getNextPage, 11230 rlr: cur, 11231 } 11232} 11233 11234// RegistrationDelegationSettingsProperties user registration delegation settings properties. 11235type RegistrationDelegationSettingsProperties struct { 11236 // Enabled - Enable or disable delegation for user registration. 11237 Enabled *bool `json:"enabled,omitempty"` 11238} 11239 11240// ReportCollection paged Report records list representation. 11241type ReportCollection struct { 11242 autorest.Response `json:"-"` 11243 // Value - Page values. 11244 Value *[]ReportRecordContract `json:"value,omitempty"` 11245 // Count - Total record count number across all pages. 11246 Count *int64 `json:"count,omitempty"` 11247 // NextLink - Next page link if any. 11248 NextLink *string `json:"nextLink,omitempty"` 11249} 11250 11251// ReportCollectionIterator provides access to a complete listing of ReportRecordContract values. 11252type ReportCollectionIterator struct { 11253 i int 11254 page ReportCollectionPage 11255} 11256 11257// NextWithContext advances to the next value. If there was an error making 11258// the request the iterator does not advance and the error is returned. 11259func (iter *ReportCollectionIterator) NextWithContext(ctx context.Context) (err error) { 11260 if tracing.IsEnabled() { 11261 ctx = tracing.StartSpan(ctx, fqdn+"/ReportCollectionIterator.NextWithContext") 11262 defer func() { 11263 sc := -1 11264 if iter.Response().Response.Response != nil { 11265 sc = iter.Response().Response.Response.StatusCode 11266 } 11267 tracing.EndSpan(ctx, sc, err) 11268 }() 11269 } 11270 iter.i++ 11271 if iter.i < len(iter.page.Values()) { 11272 return nil 11273 } 11274 err = iter.page.NextWithContext(ctx) 11275 if err != nil { 11276 iter.i-- 11277 return err 11278 } 11279 iter.i = 0 11280 return nil 11281} 11282 11283// Next advances to the next value. If there was an error making 11284// the request the iterator does not advance and the error is returned. 11285// Deprecated: Use NextWithContext() instead. 11286func (iter *ReportCollectionIterator) Next() error { 11287 return iter.NextWithContext(context.Background()) 11288} 11289 11290// NotDone returns true if the enumeration should be started or is not yet complete. 11291func (iter ReportCollectionIterator) NotDone() bool { 11292 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 11293} 11294 11295// Response returns the raw server response from the last page request. 11296func (iter ReportCollectionIterator) Response() ReportCollection { 11297 return iter.page.Response() 11298} 11299 11300// Value returns the current value or a zero-initialized value if the 11301// iterator has advanced beyond the end of the collection. 11302func (iter ReportCollectionIterator) Value() ReportRecordContract { 11303 if !iter.page.NotDone() { 11304 return ReportRecordContract{} 11305 } 11306 return iter.page.Values()[iter.i] 11307} 11308 11309// Creates a new instance of the ReportCollectionIterator type. 11310func NewReportCollectionIterator(page ReportCollectionPage) ReportCollectionIterator { 11311 return ReportCollectionIterator{page: page} 11312} 11313 11314// IsEmpty returns true if the ListResult contains no values. 11315func (rc ReportCollection) IsEmpty() bool { 11316 return rc.Value == nil || len(*rc.Value) == 0 11317} 11318 11319// hasNextLink returns true if the NextLink is not empty. 11320func (rc ReportCollection) hasNextLink() bool { 11321 return rc.NextLink != nil && len(*rc.NextLink) != 0 11322} 11323 11324// reportCollectionPreparer prepares a request to retrieve the next set of results. 11325// It returns nil if no more results exist. 11326func (rc ReportCollection) reportCollectionPreparer(ctx context.Context) (*http.Request, error) { 11327 if !rc.hasNextLink() { 11328 return nil, nil 11329 } 11330 return autorest.Prepare((&http.Request{}).WithContext(ctx), 11331 autorest.AsJSON(), 11332 autorest.AsGet(), 11333 autorest.WithBaseURL(to.String(rc.NextLink))) 11334} 11335 11336// ReportCollectionPage contains a page of ReportRecordContract values. 11337type ReportCollectionPage struct { 11338 fn func(context.Context, ReportCollection) (ReportCollection, error) 11339 rc ReportCollection 11340} 11341 11342// NextWithContext advances to the next page of values. If there was an error making 11343// the request the page does not advance and the error is returned. 11344func (page *ReportCollectionPage) NextWithContext(ctx context.Context) (err error) { 11345 if tracing.IsEnabled() { 11346 ctx = tracing.StartSpan(ctx, fqdn+"/ReportCollectionPage.NextWithContext") 11347 defer func() { 11348 sc := -1 11349 if page.Response().Response.Response != nil { 11350 sc = page.Response().Response.Response.StatusCode 11351 } 11352 tracing.EndSpan(ctx, sc, err) 11353 }() 11354 } 11355 for { 11356 next, err := page.fn(ctx, page.rc) 11357 if err != nil { 11358 return err 11359 } 11360 page.rc = next 11361 if !next.hasNextLink() || !next.IsEmpty() { 11362 break 11363 } 11364 } 11365 return nil 11366} 11367 11368// Next advances to the next page of values. If there was an error making 11369// the request the page does not advance and the error is returned. 11370// Deprecated: Use NextWithContext() instead. 11371func (page *ReportCollectionPage) Next() error { 11372 return page.NextWithContext(context.Background()) 11373} 11374 11375// NotDone returns true if the page enumeration should be started or is not yet complete. 11376func (page ReportCollectionPage) NotDone() bool { 11377 return !page.rc.IsEmpty() 11378} 11379 11380// Response returns the raw server response from the last page request. 11381func (page ReportCollectionPage) Response() ReportCollection { 11382 return page.rc 11383} 11384 11385// Values returns the slice of values for the current page or nil if there are no values. 11386func (page ReportCollectionPage) Values() []ReportRecordContract { 11387 if page.rc.IsEmpty() { 11388 return nil 11389 } 11390 return *page.rc.Value 11391} 11392 11393// Creates a new instance of the ReportCollectionPage type. 11394func NewReportCollectionPage(cur ReportCollection, getNextPage func(context.Context, ReportCollection) (ReportCollection, error)) ReportCollectionPage { 11395 return ReportCollectionPage{ 11396 fn: getNextPage, 11397 rc: cur, 11398 } 11399} 11400 11401// ReportRecordContract report data. 11402type ReportRecordContract struct { 11403 // Name - Name depending on report endpoint specifies product, API, operation or developer name. 11404 Name *string `json:"name,omitempty"` 11405 // Timestamp - Start of aggregation period. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. 11406 Timestamp *date.Time `json:"timestamp,omitempty"` 11407 // 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). 11408 Interval *string `json:"interval,omitempty"` 11409 // Country - Country to which this record data is related. 11410 Country *string `json:"country,omitempty"` 11411 // Region - Country region to which this record data is related. 11412 Region *string `json:"region,omitempty"` 11413 // Zip - Zip code to which this record data is related. 11414 Zip *string `json:"zip,omitempty"` 11415 // UserID - READ-ONLY; User identifier path. /users/{userId} 11416 UserID *string `json:"userId,omitempty"` 11417 // ProductID - READ-ONLY; Product identifier path. /products/{productId} 11418 ProductID *string `json:"productId,omitempty"` 11419 // APIID - API identifier path. /apis/{apiId} 11420 APIID *string `json:"apiId,omitempty"` 11421 // OperationID - Operation identifier path. /apis/{apiId}/operations/{operationId} 11422 OperationID *string `json:"operationId,omitempty"` 11423 // APIRegion - API region identifier. 11424 APIRegion *string `json:"apiRegion,omitempty"` 11425 // SubscriptionID - Subscription identifier path. /subscriptions/{subscriptionId} 11426 SubscriptionID *string `json:"subscriptionId,omitempty"` 11427 // CallCountSuccess - Number of successful calls. This includes calls returning HttpStatusCode <= 301 and HttpStatusCode.NotModified and HttpStatusCode.TemporaryRedirect 11428 CallCountSuccess *int32 `json:"callCountSuccess,omitempty"` 11429 // CallCountBlocked - Number of calls blocked due to invalid credentials. This includes calls returning HttpStatusCode.Unauthorized and HttpStatusCode.Forbidden and HttpStatusCode.TooManyRequests 11430 CallCountBlocked *int32 `json:"callCountBlocked,omitempty"` 11431 // 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 11432 CallCountFailed *int32 `json:"callCountFailed,omitempty"` 11433 // CallCountOther - Number of other calls. 11434 CallCountOther *int32 `json:"callCountOther,omitempty"` 11435 // CallCountTotal - Total number of calls. 11436 CallCountTotal *int32 `json:"callCountTotal,omitempty"` 11437 // Bandwidth - Bandwidth consumed. 11438 Bandwidth *int64 `json:"bandwidth,omitempty"` 11439 // CacheHitCount - Number of times when content was served from cache policy. 11440 CacheHitCount *int32 `json:"cacheHitCount,omitempty"` 11441 // CacheMissCount - Number of times content was fetched from backend. 11442 CacheMissCount *int32 `json:"cacheMissCount,omitempty"` 11443 // APITimeAvg - Average time it took to process request. 11444 APITimeAvg *float64 `json:"apiTimeAvg,omitempty"` 11445 // APITimeMin - Minimum time it took to process request. 11446 APITimeMin *float64 `json:"apiTimeMin,omitempty"` 11447 // APITimeMax - Maximum time it took to process request. 11448 APITimeMax *float64 `json:"apiTimeMax,omitempty"` 11449 // ServiceTimeAvg - Average time it took to process request on backend. 11450 ServiceTimeAvg *float64 `json:"serviceTimeAvg,omitempty"` 11451 // ServiceTimeMin - Minimum time it took to process request on backend. 11452 ServiceTimeMin *float64 `json:"serviceTimeMin,omitempty"` 11453 // ServiceTimeMax - Maximum time it took to process request on backend. 11454 ServiceTimeMax *float64 `json:"serviceTimeMax,omitempty"` 11455} 11456 11457// MarshalJSON is the custom marshaler for ReportRecordContract. 11458func (rrc ReportRecordContract) MarshalJSON() ([]byte, error) { 11459 objectMap := make(map[string]interface{}) 11460 if rrc.Name != nil { 11461 objectMap["name"] = rrc.Name 11462 } 11463 if rrc.Timestamp != nil { 11464 objectMap["timestamp"] = rrc.Timestamp 11465 } 11466 if rrc.Interval != nil { 11467 objectMap["interval"] = rrc.Interval 11468 } 11469 if rrc.Country != nil { 11470 objectMap["country"] = rrc.Country 11471 } 11472 if rrc.Region != nil { 11473 objectMap["region"] = rrc.Region 11474 } 11475 if rrc.Zip != nil { 11476 objectMap["zip"] = rrc.Zip 11477 } 11478 if rrc.APIID != nil { 11479 objectMap["apiId"] = rrc.APIID 11480 } 11481 if rrc.OperationID != nil { 11482 objectMap["operationId"] = rrc.OperationID 11483 } 11484 if rrc.APIRegion != nil { 11485 objectMap["apiRegion"] = rrc.APIRegion 11486 } 11487 if rrc.SubscriptionID != nil { 11488 objectMap["subscriptionId"] = rrc.SubscriptionID 11489 } 11490 if rrc.CallCountSuccess != nil { 11491 objectMap["callCountSuccess"] = rrc.CallCountSuccess 11492 } 11493 if rrc.CallCountBlocked != nil { 11494 objectMap["callCountBlocked"] = rrc.CallCountBlocked 11495 } 11496 if rrc.CallCountFailed != nil { 11497 objectMap["callCountFailed"] = rrc.CallCountFailed 11498 } 11499 if rrc.CallCountOther != nil { 11500 objectMap["callCountOther"] = rrc.CallCountOther 11501 } 11502 if rrc.CallCountTotal != nil { 11503 objectMap["callCountTotal"] = rrc.CallCountTotal 11504 } 11505 if rrc.Bandwidth != nil { 11506 objectMap["bandwidth"] = rrc.Bandwidth 11507 } 11508 if rrc.CacheHitCount != nil { 11509 objectMap["cacheHitCount"] = rrc.CacheHitCount 11510 } 11511 if rrc.CacheMissCount != nil { 11512 objectMap["cacheMissCount"] = rrc.CacheMissCount 11513 } 11514 if rrc.APITimeAvg != nil { 11515 objectMap["apiTimeAvg"] = rrc.APITimeAvg 11516 } 11517 if rrc.APITimeMin != nil { 11518 objectMap["apiTimeMin"] = rrc.APITimeMin 11519 } 11520 if rrc.APITimeMax != nil { 11521 objectMap["apiTimeMax"] = rrc.APITimeMax 11522 } 11523 if rrc.ServiceTimeAvg != nil { 11524 objectMap["serviceTimeAvg"] = rrc.ServiceTimeAvg 11525 } 11526 if rrc.ServiceTimeMin != nil { 11527 objectMap["serviceTimeMin"] = rrc.ServiceTimeMin 11528 } 11529 if rrc.ServiceTimeMax != nil { 11530 objectMap["serviceTimeMax"] = rrc.ServiceTimeMax 11531 } 11532 return json.Marshal(objectMap) 11533} 11534 11535// RepresentationContract operation request/response representation details. 11536type RepresentationContract struct { 11537 // ContentType - Specifies a registered or custom content type for this representation, e.g. application/xml. 11538 ContentType *string `json:"contentType,omitempty"` 11539 // Sample - An example of the representation. 11540 Sample *string `json:"sample,omitempty"` 11541 // SchemaID - Schema identifier. Applicable only if 'contentType' value is neither 'application/x-www-form-urlencoded' nor 'multipart/form-data'. 11542 SchemaID *string `json:"schemaId,omitempty"` 11543 // TypeName - Type name defined by the schema. Applicable only if 'contentType' value is neither 'application/x-www-form-urlencoded' nor 'multipart/form-data'. 11544 TypeName *string `json:"typeName,omitempty"` 11545 // FormParameters - Collection of form parameters. Required if 'contentType' value is either 'application/x-www-form-urlencoded' or 'multipart/form-data'.. 11546 FormParameters *[]ParameterContract `json:"formParameters,omitempty"` 11547} 11548 11549// RequestContract operation request details. 11550type RequestContract struct { 11551 // Description - Operation request description. 11552 Description *string `json:"description,omitempty"` 11553 // QueryParameters - Collection of operation request query parameters. 11554 QueryParameters *[]ParameterContract `json:"queryParameters,omitempty"` 11555 // Headers - Collection of operation request headers. 11556 Headers *[]ParameterContract `json:"headers,omitempty"` 11557 // Representations - Collection of operation request representations. 11558 Representations *[]RepresentationContract `json:"representations,omitempty"` 11559} 11560 11561// RequestReportCollection paged Report records list representation. 11562type RequestReportCollection struct { 11563 autorest.Response `json:"-"` 11564 // Value - Page values. 11565 Value *[]RequestReportRecordContract `json:"value,omitempty"` 11566 // Count - Total record count number across all pages. 11567 Count *int64 `json:"count,omitempty"` 11568} 11569 11570// RequestReportRecordContract request Report data. 11571type RequestReportRecordContract struct { 11572 // APIID - API identifier path. /apis/{apiId} 11573 APIID *string `json:"apiId,omitempty"` 11574 // OperationID - Operation identifier path. /apis/{apiId}/operations/{operationId} 11575 OperationID *string `json:"operationId,omitempty"` 11576 // ProductID - READ-ONLY; Product identifier path. /products/{productId} 11577 ProductID *string `json:"productId,omitempty"` 11578 // UserID - READ-ONLY; User identifier path. /users/{userId} 11579 UserID *string `json:"userId,omitempty"` 11580 // Method - The HTTP method associated with this request.. 11581 Method *string `json:"method,omitempty"` 11582 // URL - The full URL associated with this request. 11583 URL *string `json:"url,omitempty"` 11584 // IPAddress - The client IP address associated with this request. 11585 IPAddress *string `json:"ipAddress,omitempty"` 11586 // BackendResponseCode - The HTTP status code received by the gateway as a result of forwarding this request to the backend. 11587 BackendResponseCode *string `json:"backendResponseCode,omitempty"` 11588 // ResponseCode - The HTTP status code returned by the gateway. 11589 ResponseCode *int32 `json:"responseCode,omitempty"` 11590 // ResponseSize - The size of the response returned by the gateway. 11591 ResponseSize *int32 `json:"responseSize,omitempty"` 11592 // Timestamp - The date and time when this request was received by the gateway in ISO 8601 format. 11593 Timestamp *date.Time `json:"timestamp,omitempty"` 11594 // 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. 11595 Cache *string `json:"cache,omitempty"` 11596 // APITime - The total time it took to process this request. 11597 APITime *float64 `json:"apiTime,omitempty"` 11598 // ServiceTime - he time it took to forward this request to the backend and get the response back. 11599 ServiceTime *float64 `json:"serviceTime,omitempty"` 11600 // APIRegion - Azure region where the gateway that processed this request is located. 11601 APIRegion *string `json:"apiRegion,omitempty"` 11602 // SubscriptionID - Subscription identifier path. /subscriptions/{subscriptionId} 11603 SubscriptionID *string `json:"subscriptionId,omitempty"` 11604 // RequestID - Request Identifier. 11605 RequestID *string `json:"requestId,omitempty"` 11606 // RequestSize - The size of this request.. 11607 RequestSize *int32 `json:"requestSize,omitempty"` 11608} 11609 11610// MarshalJSON is the custom marshaler for RequestReportRecordContract. 11611func (rrrc RequestReportRecordContract) MarshalJSON() ([]byte, error) { 11612 objectMap := make(map[string]interface{}) 11613 if rrrc.APIID != nil { 11614 objectMap["apiId"] = rrrc.APIID 11615 } 11616 if rrrc.OperationID != nil { 11617 objectMap["operationId"] = rrrc.OperationID 11618 } 11619 if rrrc.Method != nil { 11620 objectMap["method"] = rrrc.Method 11621 } 11622 if rrrc.URL != nil { 11623 objectMap["url"] = rrrc.URL 11624 } 11625 if rrrc.IPAddress != nil { 11626 objectMap["ipAddress"] = rrrc.IPAddress 11627 } 11628 if rrrc.BackendResponseCode != nil { 11629 objectMap["backendResponseCode"] = rrrc.BackendResponseCode 11630 } 11631 if rrrc.ResponseCode != nil { 11632 objectMap["responseCode"] = rrrc.ResponseCode 11633 } 11634 if rrrc.ResponseSize != nil { 11635 objectMap["responseSize"] = rrrc.ResponseSize 11636 } 11637 if rrrc.Timestamp != nil { 11638 objectMap["timestamp"] = rrrc.Timestamp 11639 } 11640 if rrrc.Cache != nil { 11641 objectMap["cache"] = rrrc.Cache 11642 } 11643 if rrrc.APITime != nil { 11644 objectMap["apiTime"] = rrrc.APITime 11645 } 11646 if rrrc.ServiceTime != nil { 11647 objectMap["serviceTime"] = rrrc.ServiceTime 11648 } 11649 if rrrc.APIRegion != nil { 11650 objectMap["apiRegion"] = rrrc.APIRegion 11651 } 11652 if rrrc.SubscriptionID != nil { 11653 objectMap["subscriptionId"] = rrrc.SubscriptionID 11654 } 11655 if rrrc.RequestID != nil { 11656 objectMap["requestId"] = rrrc.RequestID 11657 } 11658 if rrrc.RequestSize != nil { 11659 objectMap["requestSize"] = rrrc.RequestSize 11660 } 11661 return json.Marshal(objectMap) 11662} 11663 11664// Resource the Resource definition. 11665type Resource struct { 11666 // ID - READ-ONLY; Resource ID. 11667 ID *string `json:"id,omitempty"` 11668 // Name - READ-ONLY; Resource name. 11669 Name *string `json:"name,omitempty"` 11670 // Type - READ-ONLY; Resource type for API Management resource. 11671 Type *string `json:"type,omitempty"` 11672} 11673 11674// ResourceLocationDataContract resource location data properties. 11675type ResourceLocationDataContract struct { 11676 // Name - A canonical name for the geographic or physical location. 11677 Name *string `json:"name,omitempty"` 11678 // City - The city or locality where the resource is located. 11679 City *string `json:"city,omitempty"` 11680 // District - The district, state, or province where the resource is located. 11681 District *string `json:"district,omitempty"` 11682 // CountryOrRegion - The country or region where the resource is located. 11683 CountryOrRegion *string `json:"countryOrRegion,omitempty"` 11684} 11685 11686// ResourceSku describes an available API Management SKU. 11687type ResourceSku struct { 11688 // Name - Name of the Sku. Possible values include: 'SkuTypeDeveloper', 'SkuTypeStandard', 'SkuTypePremium', 'SkuTypeBasic', 'SkuTypeConsumption', 'SkuTypeIsolated' 11689 Name SkuType `json:"name,omitempty"` 11690} 11691 11692// ResourceSkuCapacity describes scaling information of a SKU. 11693type ResourceSkuCapacity struct { 11694 // Minimum - READ-ONLY; The minimum capacity. 11695 Minimum *int32 `json:"minimum,omitempty"` 11696 // Maximum - READ-ONLY; The maximum capacity that can be set. 11697 Maximum *int32 `json:"maximum,omitempty"` 11698 // Default - READ-ONLY; The default capacity. 11699 Default *int32 `json:"default,omitempty"` 11700 // ScaleType - READ-ONLY; The scale type applicable to the sku. Possible values include: 'ResourceSkuCapacityScaleTypeAutomatic', 'ResourceSkuCapacityScaleTypeManual', 'ResourceSkuCapacityScaleTypeNone' 11701 ScaleType ResourceSkuCapacityScaleType `json:"scaleType,omitempty"` 11702} 11703 11704// ResourceSkuResult describes an available API Management service SKU. 11705type ResourceSkuResult struct { 11706 // ResourceType - READ-ONLY; The type of resource the SKU applies to. 11707 ResourceType *string `json:"resourceType,omitempty"` 11708 // Sku - READ-ONLY; Specifies API Management SKU. 11709 Sku *ResourceSku `json:"sku,omitempty"` 11710 // Capacity - READ-ONLY; Specifies the number of API Management units. 11711 Capacity *ResourceSkuCapacity `json:"capacity,omitempty"` 11712} 11713 11714// ResourceSkuResults the API Management service SKUs operation response. 11715type ResourceSkuResults struct { 11716 autorest.Response `json:"-"` 11717 // Value - The list of skus available for the service. 11718 Value *[]ResourceSkuResult `json:"value,omitempty"` 11719 // NextLink - The uri to fetch the next page of API Management service Skus. 11720 NextLink *string `json:"nextLink,omitempty"` 11721} 11722 11723// ResourceSkuResultsIterator provides access to a complete listing of ResourceSkuResult values. 11724type ResourceSkuResultsIterator struct { 11725 i int 11726 page ResourceSkuResultsPage 11727} 11728 11729// NextWithContext advances to the next value. If there was an error making 11730// the request the iterator does not advance and the error is returned. 11731func (iter *ResourceSkuResultsIterator) NextWithContext(ctx context.Context) (err error) { 11732 if tracing.IsEnabled() { 11733 ctx = tracing.StartSpan(ctx, fqdn+"/ResourceSkuResultsIterator.NextWithContext") 11734 defer func() { 11735 sc := -1 11736 if iter.Response().Response.Response != nil { 11737 sc = iter.Response().Response.Response.StatusCode 11738 } 11739 tracing.EndSpan(ctx, sc, err) 11740 }() 11741 } 11742 iter.i++ 11743 if iter.i < len(iter.page.Values()) { 11744 return nil 11745 } 11746 err = iter.page.NextWithContext(ctx) 11747 if err != nil { 11748 iter.i-- 11749 return err 11750 } 11751 iter.i = 0 11752 return nil 11753} 11754 11755// Next advances to the next value. If there was an error making 11756// the request the iterator does not advance and the error is returned. 11757// Deprecated: Use NextWithContext() instead. 11758func (iter *ResourceSkuResultsIterator) Next() error { 11759 return iter.NextWithContext(context.Background()) 11760} 11761 11762// NotDone returns true if the enumeration should be started or is not yet complete. 11763func (iter ResourceSkuResultsIterator) NotDone() bool { 11764 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 11765} 11766 11767// Response returns the raw server response from the last page request. 11768func (iter ResourceSkuResultsIterator) Response() ResourceSkuResults { 11769 return iter.page.Response() 11770} 11771 11772// Value returns the current value or a zero-initialized value if the 11773// iterator has advanced beyond the end of the collection. 11774func (iter ResourceSkuResultsIterator) Value() ResourceSkuResult { 11775 if !iter.page.NotDone() { 11776 return ResourceSkuResult{} 11777 } 11778 return iter.page.Values()[iter.i] 11779} 11780 11781// Creates a new instance of the ResourceSkuResultsIterator type. 11782func NewResourceSkuResultsIterator(page ResourceSkuResultsPage) ResourceSkuResultsIterator { 11783 return ResourceSkuResultsIterator{page: page} 11784} 11785 11786// IsEmpty returns true if the ListResult contains no values. 11787func (rsr ResourceSkuResults) IsEmpty() bool { 11788 return rsr.Value == nil || len(*rsr.Value) == 0 11789} 11790 11791// hasNextLink returns true if the NextLink is not empty. 11792func (rsr ResourceSkuResults) hasNextLink() bool { 11793 return rsr.NextLink != nil && len(*rsr.NextLink) != 0 11794} 11795 11796// resourceSkuResultsPreparer prepares a request to retrieve the next set of results. 11797// It returns nil if no more results exist. 11798func (rsr ResourceSkuResults) resourceSkuResultsPreparer(ctx context.Context) (*http.Request, error) { 11799 if !rsr.hasNextLink() { 11800 return nil, nil 11801 } 11802 return autorest.Prepare((&http.Request{}).WithContext(ctx), 11803 autorest.AsJSON(), 11804 autorest.AsGet(), 11805 autorest.WithBaseURL(to.String(rsr.NextLink))) 11806} 11807 11808// ResourceSkuResultsPage contains a page of ResourceSkuResult values. 11809type ResourceSkuResultsPage struct { 11810 fn func(context.Context, ResourceSkuResults) (ResourceSkuResults, error) 11811 rsr ResourceSkuResults 11812} 11813 11814// NextWithContext advances to the next page of values. If there was an error making 11815// the request the page does not advance and the error is returned. 11816func (page *ResourceSkuResultsPage) NextWithContext(ctx context.Context) (err error) { 11817 if tracing.IsEnabled() { 11818 ctx = tracing.StartSpan(ctx, fqdn+"/ResourceSkuResultsPage.NextWithContext") 11819 defer func() { 11820 sc := -1 11821 if page.Response().Response.Response != nil { 11822 sc = page.Response().Response.Response.StatusCode 11823 } 11824 tracing.EndSpan(ctx, sc, err) 11825 }() 11826 } 11827 for { 11828 next, err := page.fn(ctx, page.rsr) 11829 if err != nil { 11830 return err 11831 } 11832 page.rsr = next 11833 if !next.hasNextLink() || !next.IsEmpty() { 11834 break 11835 } 11836 } 11837 return nil 11838} 11839 11840// Next advances to the next page of values. If there was an error making 11841// the request the page does not advance and the error is returned. 11842// Deprecated: Use NextWithContext() instead. 11843func (page *ResourceSkuResultsPage) Next() error { 11844 return page.NextWithContext(context.Background()) 11845} 11846 11847// NotDone returns true if the page enumeration should be started or is not yet complete. 11848func (page ResourceSkuResultsPage) NotDone() bool { 11849 return !page.rsr.IsEmpty() 11850} 11851 11852// Response returns the raw server response from the last page request. 11853func (page ResourceSkuResultsPage) Response() ResourceSkuResults { 11854 return page.rsr 11855} 11856 11857// Values returns the slice of values for the current page or nil if there are no values. 11858func (page ResourceSkuResultsPage) Values() []ResourceSkuResult { 11859 if page.rsr.IsEmpty() { 11860 return nil 11861 } 11862 return *page.rsr.Value 11863} 11864 11865// Creates a new instance of the ResourceSkuResultsPage type. 11866func NewResourceSkuResultsPage(cur ResourceSkuResults, getNextPage func(context.Context, ResourceSkuResults) (ResourceSkuResults, error)) ResourceSkuResultsPage { 11867 return ResourceSkuResultsPage{ 11868 fn: getNextPage, 11869 rsr: cur, 11870 } 11871} 11872 11873// ResponseContract operation response details. 11874type ResponseContract struct { 11875 // StatusCode - Operation response HTTP status code. 11876 StatusCode *int32 `json:"statusCode,omitempty"` 11877 // Description - Operation response description. 11878 Description *string `json:"description,omitempty"` 11879 // Representations - Collection of operation response representations. 11880 Representations *[]RepresentationContract `json:"representations,omitempty"` 11881 // Headers - Collection of operation response headers. 11882 Headers *[]ParameterContract `json:"headers,omitempty"` 11883} 11884 11885// SamplingSettings sampling settings for Diagnostic. 11886type SamplingSettings struct { 11887 // SamplingType - Sampling type. Possible values include: 'Fixed' 11888 SamplingType SamplingType `json:"samplingType,omitempty"` 11889 // Percentage - Rate of sampling for fixed-rate sampling. 11890 Percentage *float64 `json:"percentage,omitempty"` 11891} 11892 11893// SaveConfigurationParameter save Tenant Configuration Contract details. 11894type SaveConfigurationParameter struct { 11895 // SaveConfigurationParameterProperties - Properties of the Save Configuration Parameters. 11896 *SaveConfigurationParameterProperties `json:"properties,omitempty"` 11897} 11898 11899// MarshalJSON is the custom marshaler for SaveConfigurationParameter. 11900func (scp SaveConfigurationParameter) MarshalJSON() ([]byte, error) { 11901 objectMap := make(map[string]interface{}) 11902 if scp.SaveConfigurationParameterProperties != nil { 11903 objectMap["properties"] = scp.SaveConfigurationParameterProperties 11904 } 11905 return json.Marshal(objectMap) 11906} 11907 11908// UnmarshalJSON is the custom unmarshaler for SaveConfigurationParameter struct. 11909func (scp *SaveConfigurationParameter) UnmarshalJSON(body []byte) error { 11910 var m map[string]*json.RawMessage 11911 err := json.Unmarshal(body, &m) 11912 if err != nil { 11913 return err 11914 } 11915 for k, v := range m { 11916 switch k { 11917 case "properties": 11918 if v != nil { 11919 var saveConfigurationParameterProperties SaveConfigurationParameterProperties 11920 err = json.Unmarshal(*v, &saveConfigurationParameterProperties) 11921 if err != nil { 11922 return err 11923 } 11924 scp.SaveConfigurationParameterProperties = &saveConfigurationParameterProperties 11925 } 11926 } 11927 } 11928 11929 return nil 11930} 11931 11932// SaveConfigurationParameterProperties parameters supplied to the Save Tenant Configuration operation. 11933type SaveConfigurationParameterProperties struct { 11934 // Branch - The name of the Git branch in which to commit the current configuration snapshot. 11935 Branch *string `json:"branch,omitempty"` 11936 // 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. 11937 Force *bool `json:"force,omitempty"` 11938} 11939 11940// SchemaCollection the response of the list schema operation. 11941type SchemaCollection struct { 11942 autorest.Response `json:"-"` 11943 // Value - READ-ONLY; Api Schema Contract value. 11944 Value *[]SchemaContract `json:"value,omitempty"` 11945 // Count - Total record count number. 11946 Count *int64 `json:"count,omitempty"` 11947 // NextLink - READ-ONLY; Next page link if any. 11948 NextLink *string `json:"nextLink,omitempty"` 11949} 11950 11951// MarshalJSON is the custom marshaler for SchemaCollection. 11952func (sc SchemaCollection) MarshalJSON() ([]byte, error) { 11953 objectMap := make(map[string]interface{}) 11954 if sc.Count != nil { 11955 objectMap["count"] = sc.Count 11956 } 11957 return json.Marshal(objectMap) 11958} 11959 11960// SchemaCollectionIterator provides access to a complete listing of SchemaContract values. 11961type SchemaCollectionIterator struct { 11962 i int 11963 page SchemaCollectionPage 11964} 11965 11966// NextWithContext advances to the next value. If there was an error making 11967// the request the iterator does not advance and the error is returned. 11968func (iter *SchemaCollectionIterator) NextWithContext(ctx context.Context) (err error) { 11969 if tracing.IsEnabled() { 11970 ctx = tracing.StartSpan(ctx, fqdn+"/SchemaCollectionIterator.NextWithContext") 11971 defer func() { 11972 sc := -1 11973 if iter.Response().Response.Response != nil { 11974 sc = iter.Response().Response.Response.StatusCode 11975 } 11976 tracing.EndSpan(ctx, sc, err) 11977 }() 11978 } 11979 iter.i++ 11980 if iter.i < len(iter.page.Values()) { 11981 return nil 11982 } 11983 err = iter.page.NextWithContext(ctx) 11984 if err != nil { 11985 iter.i-- 11986 return err 11987 } 11988 iter.i = 0 11989 return nil 11990} 11991 11992// Next advances to the next value. If there was an error making 11993// the request the iterator does not advance and the error is returned. 11994// Deprecated: Use NextWithContext() instead. 11995func (iter *SchemaCollectionIterator) Next() error { 11996 return iter.NextWithContext(context.Background()) 11997} 11998 11999// NotDone returns true if the enumeration should be started or is not yet complete. 12000func (iter SchemaCollectionIterator) NotDone() bool { 12001 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 12002} 12003 12004// Response returns the raw server response from the last page request. 12005func (iter SchemaCollectionIterator) Response() SchemaCollection { 12006 return iter.page.Response() 12007} 12008 12009// Value returns the current value or a zero-initialized value if the 12010// iterator has advanced beyond the end of the collection. 12011func (iter SchemaCollectionIterator) Value() SchemaContract { 12012 if !iter.page.NotDone() { 12013 return SchemaContract{} 12014 } 12015 return iter.page.Values()[iter.i] 12016} 12017 12018// Creates a new instance of the SchemaCollectionIterator type. 12019func NewSchemaCollectionIterator(page SchemaCollectionPage) SchemaCollectionIterator { 12020 return SchemaCollectionIterator{page: page} 12021} 12022 12023// IsEmpty returns true if the ListResult contains no values. 12024func (sc SchemaCollection) IsEmpty() bool { 12025 return sc.Value == nil || len(*sc.Value) == 0 12026} 12027 12028// hasNextLink returns true if the NextLink is not empty. 12029func (sc SchemaCollection) hasNextLink() bool { 12030 return sc.NextLink != nil && len(*sc.NextLink) != 0 12031} 12032 12033// schemaCollectionPreparer prepares a request to retrieve the next set of results. 12034// It returns nil if no more results exist. 12035func (sc SchemaCollection) schemaCollectionPreparer(ctx context.Context) (*http.Request, error) { 12036 if !sc.hasNextLink() { 12037 return nil, nil 12038 } 12039 return autorest.Prepare((&http.Request{}).WithContext(ctx), 12040 autorest.AsJSON(), 12041 autorest.AsGet(), 12042 autorest.WithBaseURL(to.String(sc.NextLink))) 12043} 12044 12045// SchemaCollectionPage contains a page of SchemaContract values. 12046type SchemaCollectionPage struct { 12047 fn func(context.Context, SchemaCollection) (SchemaCollection, error) 12048 sc SchemaCollection 12049} 12050 12051// NextWithContext advances to the next page of values. If there was an error making 12052// the request the page does not advance and the error is returned. 12053func (page *SchemaCollectionPage) NextWithContext(ctx context.Context) (err error) { 12054 if tracing.IsEnabled() { 12055 ctx = tracing.StartSpan(ctx, fqdn+"/SchemaCollectionPage.NextWithContext") 12056 defer func() { 12057 sc := -1 12058 if page.Response().Response.Response != nil { 12059 sc = page.Response().Response.Response.StatusCode 12060 } 12061 tracing.EndSpan(ctx, sc, err) 12062 }() 12063 } 12064 for { 12065 next, err := page.fn(ctx, page.sc) 12066 if err != nil { 12067 return err 12068 } 12069 page.sc = next 12070 if !next.hasNextLink() || !next.IsEmpty() { 12071 break 12072 } 12073 } 12074 return nil 12075} 12076 12077// Next advances to the next page of values. If there was an error making 12078// the request the page does not advance and the error is returned. 12079// Deprecated: Use NextWithContext() instead. 12080func (page *SchemaCollectionPage) Next() error { 12081 return page.NextWithContext(context.Background()) 12082} 12083 12084// NotDone returns true if the page enumeration should be started or is not yet complete. 12085func (page SchemaCollectionPage) NotDone() bool { 12086 return !page.sc.IsEmpty() 12087} 12088 12089// Response returns the raw server response from the last page request. 12090func (page SchemaCollectionPage) Response() SchemaCollection { 12091 return page.sc 12092} 12093 12094// Values returns the slice of values for the current page or nil if there are no values. 12095func (page SchemaCollectionPage) Values() []SchemaContract { 12096 if page.sc.IsEmpty() { 12097 return nil 12098 } 12099 return *page.sc.Value 12100} 12101 12102// Creates a new instance of the SchemaCollectionPage type. 12103func NewSchemaCollectionPage(cur SchemaCollection, getNextPage func(context.Context, SchemaCollection) (SchemaCollection, error)) SchemaCollectionPage { 12104 return SchemaCollectionPage{ 12105 fn: getNextPage, 12106 sc: cur, 12107 } 12108} 12109 12110// SchemaContract schema Contract details. 12111type SchemaContract struct { 12112 autorest.Response `json:"-"` 12113 // SchemaContractProperties - Properties of the Schema. 12114 *SchemaContractProperties `json:"properties,omitempty"` 12115 // ID - READ-ONLY; Resource ID. 12116 ID *string `json:"id,omitempty"` 12117 // Name - READ-ONLY; Resource name. 12118 Name *string `json:"name,omitempty"` 12119 // Type - READ-ONLY; Resource type for API Management resource. 12120 Type *string `json:"type,omitempty"` 12121} 12122 12123// MarshalJSON is the custom marshaler for SchemaContract. 12124func (sc SchemaContract) MarshalJSON() ([]byte, error) { 12125 objectMap := make(map[string]interface{}) 12126 if sc.SchemaContractProperties != nil { 12127 objectMap["properties"] = sc.SchemaContractProperties 12128 } 12129 return json.Marshal(objectMap) 12130} 12131 12132// UnmarshalJSON is the custom unmarshaler for SchemaContract struct. 12133func (sc *SchemaContract) UnmarshalJSON(body []byte) error { 12134 var m map[string]*json.RawMessage 12135 err := json.Unmarshal(body, &m) 12136 if err != nil { 12137 return err 12138 } 12139 for k, v := range m { 12140 switch k { 12141 case "properties": 12142 if v != nil { 12143 var schemaContractProperties SchemaContractProperties 12144 err = json.Unmarshal(*v, &schemaContractProperties) 12145 if err != nil { 12146 return err 12147 } 12148 sc.SchemaContractProperties = &schemaContractProperties 12149 } 12150 case "id": 12151 if v != nil { 12152 var ID string 12153 err = json.Unmarshal(*v, &ID) 12154 if err != nil { 12155 return err 12156 } 12157 sc.ID = &ID 12158 } 12159 case "name": 12160 if v != nil { 12161 var name string 12162 err = json.Unmarshal(*v, &name) 12163 if err != nil { 12164 return err 12165 } 12166 sc.Name = &name 12167 } 12168 case "type": 12169 if v != nil { 12170 var typeVar string 12171 err = json.Unmarshal(*v, &typeVar) 12172 if err != nil { 12173 return err 12174 } 12175 sc.Type = &typeVar 12176 } 12177 } 12178 } 12179 12180 return nil 12181} 12182 12183// SchemaContractProperties API Schema create or update contract Properties. 12184type SchemaContractProperties struct { 12185 // 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`. 12186 ContentType *string `json:"contentType,omitempty"` 12187 // SchemaDocumentProperties - Create or update Properties of the Schema Document. 12188 *SchemaDocumentProperties `json:"document,omitempty"` 12189} 12190 12191// MarshalJSON is the custom marshaler for SchemaContractProperties. 12192func (scp SchemaContractProperties) MarshalJSON() ([]byte, error) { 12193 objectMap := make(map[string]interface{}) 12194 if scp.ContentType != nil { 12195 objectMap["contentType"] = scp.ContentType 12196 } 12197 if scp.SchemaDocumentProperties != nil { 12198 objectMap["document"] = scp.SchemaDocumentProperties 12199 } 12200 return json.Marshal(objectMap) 12201} 12202 12203// UnmarshalJSON is the custom unmarshaler for SchemaContractProperties struct. 12204func (scp *SchemaContractProperties) UnmarshalJSON(body []byte) error { 12205 var m map[string]*json.RawMessage 12206 err := json.Unmarshal(body, &m) 12207 if err != nil { 12208 return err 12209 } 12210 for k, v := range m { 12211 switch k { 12212 case "contentType": 12213 if v != nil { 12214 var contentType string 12215 err = json.Unmarshal(*v, &contentType) 12216 if err != nil { 12217 return err 12218 } 12219 scp.ContentType = &contentType 12220 } 12221 case "document": 12222 if v != nil { 12223 var schemaDocumentProperties SchemaDocumentProperties 12224 err = json.Unmarshal(*v, &schemaDocumentProperties) 12225 if err != nil { 12226 return err 12227 } 12228 scp.SchemaDocumentProperties = &schemaDocumentProperties 12229 } 12230 } 12231 } 12232 12233 return nil 12234} 12235 12236// SchemaDocumentProperties schema Document Properties. 12237type SchemaDocumentProperties struct { 12238 // Value - Json escaped string defining the document representing the Schema. Used for schemas other than Swagger/OpenAPI. 12239 Value *string `json:"value,omitempty"` 12240 // Definitions - Types definitions. Used for Swagger/OpenAPI schemas only, null otherwise. 12241 Definitions interface{} `json:"definitions,omitempty"` 12242} 12243 12244// ServiceApplyNetworkConfigurationParameters parameter supplied to the Apply Network configuration 12245// operation. 12246type ServiceApplyNetworkConfigurationParameters struct { 12247 // 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. 12248 Location *string `json:"location,omitempty"` 12249} 12250 12251// ServiceApplyNetworkConfigurationUpdatesFuture an abstraction for monitoring and retrieving the results 12252// of a long-running operation. 12253type ServiceApplyNetworkConfigurationUpdatesFuture struct { 12254 azure.FutureAPI 12255 // Result returns the result of the asynchronous operation. 12256 // If the operation has not completed it will return an error. 12257 Result func(ServiceClient) (ServiceResource, error) 12258} 12259 12260// ServiceBackupFuture an abstraction for monitoring and retrieving the results of a long-running 12261// operation. 12262type ServiceBackupFuture struct { 12263 azure.FutureAPI 12264 // Result returns the result of the asynchronous operation. 12265 // If the operation has not completed it will return an error. 12266 Result func(ServiceClient) (ServiceResource, error) 12267} 12268 12269// ServiceBackupRestoreParameters parameters supplied to the Backup/Restore of an API Management service 12270// operation. 12271type ServiceBackupRestoreParameters struct { 12272 // StorageAccount - Azure Cloud Storage account (used to place/retrieve the backup) name. 12273 StorageAccount *string `json:"storageAccount,omitempty"` 12274 // AccessKey - Azure Cloud Storage account (used to place/retrieve the backup) access key. 12275 AccessKey *string `json:"accessKey,omitempty"` 12276 // ContainerName - Azure Cloud Storage blob container name used to place/retrieve the backup. 12277 ContainerName *string `json:"containerName,omitempty"` 12278 // BackupName - The name of the backup file to create. 12279 BackupName *string `json:"backupName,omitempty"` 12280} 12281 12282// ServiceBaseProperties base Properties of an API Management service resource description. 12283type ServiceBaseProperties struct { 12284 // NotificationSenderEmail - Email address from which the notification will be sent. 12285 NotificationSenderEmail *string `json:"notificationSenderEmail,omitempty"` 12286 // 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. 12287 ProvisioningState *string `json:"provisioningState,omitempty"` 12288 // TargetProvisioningState - READ-ONLY; The provisioning state of the API Management service, which is targeted by the long running operation started on the service. 12289 TargetProvisioningState *string `json:"targetProvisioningState,omitempty"` 12290 // 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. 12291 CreatedAtUtc *date.Time `json:"createdAtUtc,omitempty"` 12292 // GatewayURL - READ-ONLY; Gateway URL of the API Management service. 12293 GatewayURL *string `json:"gatewayUrl,omitempty"` 12294 // GatewayRegionalURL - READ-ONLY; Gateway URL of the API Management service in the Default Region. 12295 GatewayRegionalURL *string `json:"gatewayRegionalUrl,omitempty"` 12296 // PortalURL - READ-ONLY; Publisher portal endpoint Url of the API Management service. 12297 PortalURL *string `json:"portalUrl,omitempty"` 12298 // ManagementAPIURL - READ-ONLY; Management API endpoint URL of the API Management service. 12299 ManagementAPIURL *string `json:"managementApiUrl,omitempty"` 12300 // ScmURL - READ-ONLY; SCM endpoint URL of the API Management service. 12301 ScmURL *string `json:"scmUrl,omitempty"` 12302 // DeveloperPortalURL - READ-ONLY; DEveloper Portal endpoint URL of the API Management service. 12303 DeveloperPortalURL *string `json:"developerPortalUrl,omitempty"` 12304 // HostnameConfigurations - Custom hostname configuration of the API Management service. 12305 HostnameConfigurations *[]HostnameConfiguration `json:"hostnameConfigurations,omitempty"` 12306 // 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. 12307 PublicIPAddresses *[]string `json:"publicIPAddresses,omitempty"` 12308 // 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. 12309 PrivateIPAddresses *[]string `json:"privateIPAddresses,omitempty"` 12310 // VirtualNetworkConfiguration - Virtual network configuration of the API Management service. 12311 VirtualNetworkConfiguration *VirtualNetworkConfiguration `json:"virtualNetworkConfiguration,omitempty"` 12312 // AdditionalLocations - Additional datacenter locations of the API Management service. 12313 AdditionalLocations *[]AdditionalLocation `json:"additionalLocations,omitempty"` 12314 // 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 12315 CustomProperties map[string]*string `json:"customProperties"` 12316 // Certificates - List of Certificates that need to be installed in the API Management service. Max supported certificates that can be installed is 10. 12317 Certificates *[]CertificateConfiguration `json:"certificates,omitempty"` 12318 // 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. 12319 EnableClientCertificate *bool `json:"enableClientCertificate,omitempty"` 12320 // DisableGateway - Property only valid for an Api Management service deployed in multiple locations. This can be used to disable the gateway in master region. 12321 DisableGateway *bool `json:"disableGateway,omitempty"` 12322 // 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' 12323 VirtualNetworkType VirtualNetworkType `json:"virtualNetworkType,omitempty"` 12324 // APIVersionConstraint - Control Plane Apis version constraint for the API Management service. 12325 APIVersionConstraint *APIVersionConstraint `json:"apiVersionConstraint,omitempty"` 12326 // 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. 12327 Restore *bool `json:"restore,omitempty"` 12328} 12329 12330// MarshalJSON is the custom marshaler for ServiceBaseProperties. 12331func (sbp ServiceBaseProperties) MarshalJSON() ([]byte, error) { 12332 objectMap := make(map[string]interface{}) 12333 if sbp.NotificationSenderEmail != nil { 12334 objectMap["notificationSenderEmail"] = sbp.NotificationSenderEmail 12335 } 12336 if sbp.HostnameConfigurations != nil { 12337 objectMap["hostnameConfigurations"] = sbp.HostnameConfigurations 12338 } 12339 if sbp.VirtualNetworkConfiguration != nil { 12340 objectMap["virtualNetworkConfiguration"] = sbp.VirtualNetworkConfiguration 12341 } 12342 if sbp.AdditionalLocations != nil { 12343 objectMap["additionalLocations"] = sbp.AdditionalLocations 12344 } 12345 if sbp.CustomProperties != nil { 12346 objectMap["customProperties"] = sbp.CustomProperties 12347 } 12348 if sbp.Certificates != nil { 12349 objectMap["certificates"] = sbp.Certificates 12350 } 12351 if sbp.EnableClientCertificate != nil { 12352 objectMap["enableClientCertificate"] = sbp.EnableClientCertificate 12353 } 12354 if sbp.DisableGateway != nil { 12355 objectMap["disableGateway"] = sbp.DisableGateway 12356 } 12357 if sbp.VirtualNetworkType != "" { 12358 objectMap["virtualNetworkType"] = sbp.VirtualNetworkType 12359 } 12360 if sbp.APIVersionConstraint != nil { 12361 objectMap["apiVersionConstraint"] = sbp.APIVersionConstraint 12362 } 12363 if sbp.Restore != nil { 12364 objectMap["restore"] = sbp.Restore 12365 } 12366 return json.Marshal(objectMap) 12367} 12368 12369// ServiceCheckNameAvailabilityParameters parameters supplied to the CheckNameAvailability operation. 12370type ServiceCheckNameAvailabilityParameters struct { 12371 // Name - The name to check for availability. 12372 Name *string `json:"name,omitempty"` 12373} 12374 12375// ServiceCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 12376// operation. 12377type ServiceCreateOrUpdateFuture struct { 12378 azure.FutureAPI 12379 // Result returns the result of the asynchronous operation. 12380 // If the operation has not completed it will return an error. 12381 Result func(ServiceClient) (ServiceResource, error) 12382} 12383 12384// ServiceDeleteFuture an abstraction for monitoring and retrieving the results of a long-running 12385// operation. 12386type ServiceDeleteFuture struct { 12387 azure.FutureAPI 12388 // Result returns the result of the asynchronous operation. 12389 // If the operation has not completed it will return an error. 12390 Result func(ServiceClient) (ServiceResource, error) 12391} 12392 12393// ServiceGetDomainOwnershipIdentifierResult response of the GetDomainOwnershipIdentifier operation. 12394type ServiceGetDomainOwnershipIdentifierResult struct { 12395 autorest.Response `json:"-"` 12396 // DomainOwnershipIdentifier - READ-ONLY; The domain ownership identifier value. 12397 DomainOwnershipIdentifier *string `json:"domainOwnershipIdentifier,omitempty"` 12398} 12399 12400// ServiceGetSsoTokenResult the response of the GetSsoToken operation. 12401type ServiceGetSsoTokenResult struct { 12402 autorest.Response `json:"-"` 12403 // RedirectURI - Redirect URL to the Publisher Portal containing the SSO token. 12404 RedirectURI *string `json:"redirectUri,omitempty"` 12405} 12406 12407// ServiceIdentity identity properties of the Api Management service resource. 12408type ServiceIdentity struct { 12409 // 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' 12410 Type ApimIdentityType `json:"type,omitempty"` 12411 // PrincipalID - READ-ONLY; The principal id of the identity. 12412 PrincipalID *uuid.UUID `json:"principalId,omitempty"` 12413 // TenantID - READ-ONLY; The client tenant id of the identity. 12414 TenantID *uuid.UUID `json:"tenantId,omitempty"` 12415 // UserAssignedIdentities - The list of user identities associated with the resource. The user identity 12416 // dictionary key references will be ARM resource ids in the form: 12417 // '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/ 12418 // providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. 12419 UserAssignedIdentities map[string]*UserIdentityProperties `json:"userAssignedIdentities"` 12420} 12421 12422// MarshalJSON is the custom marshaler for ServiceIdentity. 12423func (si ServiceIdentity) MarshalJSON() ([]byte, error) { 12424 objectMap := make(map[string]interface{}) 12425 if si.Type != "" { 12426 objectMap["type"] = si.Type 12427 } 12428 if si.UserAssignedIdentities != nil { 12429 objectMap["userAssignedIdentities"] = si.UserAssignedIdentities 12430 } 12431 return json.Marshal(objectMap) 12432} 12433 12434// ServiceListResult the response of the List API Management services operation. 12435type ServiceListResult struct { 12436 autorest.Response `json:"-"` 12437 // Value - Result of the List API Management services operation. 12438 Value *[]ServiceResource `json:"value,omitempty"` 12439 // NextLink - Link to the next set of results. Not empty if Value contains incomplete list of API Management services. 12440 NextLink *string `json:"nextLink,omitempty"` 12441} 12442 12443// ServiceListResultIterator provides access to a complete listing of ServiceResource values. 12444type ServiceListResultIterator struct { 12445 i int 12446 page ServiceListResultPage 12447} 12448 12449// NextWithContext advances to the next value. If there was an error making 12450// the request the iterator does not advance and the error is returned. 12451func (iter *ServiceListResultIterator) NextWithContext(ctx context.Context) (err error) { 12452 if tracing.IsEnabled() { 12453 ctx = tracing.StartSpan(ctx, fqdn+"/ServiceListResultIterator.NextWithContext") 12454 defer func() { 12455 sc := -1 12456 if iter.Response().Response.Response != nil { 12457 sc = iter.Response().Response.Response.StatusCode 12458 } 12459 tracing.EndSpan(ctx, sc, err) 12460 }() 12461 } 12462 iter.i++ 12463 if iter.i < len(iter.page.Values()) { 12464 return nil 12465 } 12466 err = iter.page.NextWithContext(ctx) 12467 if err != nil { 12468 iter.i-- 12469 return err 12470 } 12471 iter.i = 0 12472 return nil 12473} 12474 12475// Next advances to the next value. If there was an error making 12476// the request the iterator does not advance and the error is returned. 12477// Deprecated: Use NextWithContext() instead. 12478func (iter *ServiceListResultIterator) Next() error { 12479 return iter.NextWithContext(context.Background()) 12480} 12481 12482// NotDone returns true if the enumeration should be started or is not yet complete. 12483func (iter ServiceListResultIterator) NotDone() bool { 12484 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 12485} 12486 12487// Response returns the raw server response from the last page request. 12488func (iter ServiceListResultIterator) Response() ServiceListResult { 12489 return iter.page.Response() 12490} 12491 12492// Value returns the current value or a zero-initialized value if the 12493// iterator has advanced beyond the end of the collection. 12494func (iter ServiceListResultIterator) Value() ServiceResource { 12495 if !iter.page.NotDone() { 12496 return ServiceResource{} 12497 } 12498 return iter.page.Values()[iter.i] 12499} 12500 12501// Creates a new instance of the ServiceListResultIterator type. 12502func NewServiceListResultIterator(page ServiceListResultPage) ServiceListResultIterator { 12503 return ServiceListResultIterator{page: page} 12504} 12505 12506// IsEmpty returns true if the ListResult contains no values. 12507func (slr ServiceListResult) IsEmpty() bool { 12508 return slr.Value == nil || len(*slr.Value) == 0 12509} 12510 12511// hasNextLink returns true if the NextLink is not empty. 12512func (slr ServiceListResult) hasNextLink() bool { 12513 return slr.NextLink != nil && len(*slr.NextLink) != 0 12514} 12515 12516// serviceListResultPreparer prepares a request to retrieve the next set of results. 12517// It returns nil if no more results exist. 12518func (slr ServiceListResult) serviceListResultPreparer(ctx context.Context) (*http.Request, error) { 12519 if !slr.hasNextLink() { 12520 return nil, nil 12521 } 12522 return autorest.Prepare((&http.Request{}).WithContext(ctx), 12523 autorest.AsJSON(), 12524 autorest.AsGet(), 12525 autorest.WithBaseURL(to.String(slr.NextLink))) 12526} 12527 12528// ServiceListResultPage contains a page of ServiceResource values. 12529type ServiceListResultPage struct { 12530 fn func(context.Context, ServiceListResult) (ServiceListResult, error) 12531 slr ServiceListResult 12532} 12533 12534// NextWithContext advances to the next page of values. If there was an error making 12535// the request the page does not advance and the error is returned. 12536func (page *ServiceListResultPage) NextWithContext(ctx context.Context) (err error) { 12537 if tracing.IsEnabled() { 12538 ctx = tracing.StartSpan(ctx, fqdn+"/ServiceListResultPage.NextWithContext") 12539 defer func() { 12540 sc := -1 12541 if page.Response().Response.Response != nil { 12542 sc = page.Response().Response.Response.StatusCode 12543 } 12544 tracing.EndSpan(ctx, sc, err) 12545 }() 12546 } 12547 for { 12548 next, err := page.fn(ctx, page.slr) 12549 if err != nil { 12550 return err 12551 } 12552 page.slr = next 12553 if !next.hasNextLink() || !next.IsEmpty() { 12554 break 12555 } 12556 } 12557 return nil 12558} 12559 12560// Next advances to the next page of values. If there was an error making 12561// the request the page does not advance and the error is returned. 12562// Deprecated: Use NextWithContext() instead. 12563func (page *ServiceListResultPage) Next() error { 12564 return page.NextWithContext(context.Background()) 12565} 12566 12567// NotDone returns true if the page enumeration should be started or is not yet complete. 12568func (page ServiceListResultPage) NotDone() bool { 12569 return !page.slr.IsEmpty() 12570} 12571 12572// Response returns the raw server response from the last page request. 12573func (page ServiceListResultPage) Response() ServiceListResult { 12574 return page.slr 12575} 12576 12577// Values returns the slice of values for the current page or nil if there are no values. 12578func (page ServiceListResultPage) Values() []ServiceResource { 12579 if page.slr.IsEmpty() { 12580 return nil 12581 } 12582 return *page.slr.Value 12583} 12584 12585// Creates a new instance of the ServiceListResultPage type. 12586func NewServiceListResultPage(cur ServiceListResult, getNextPage func(context.Context, ServiceListResult) (ServiceListResult, error)) ServiceListResultPage { 12587 return ServiceListResultPage{ 12588 fn: getNextPage, 12589 slr: cur, 12590 } 12591} 12592 12593// ServiceNameAvailabilityResult response of the CheckNameAvailability operation. 12594type ServiceNameAvailabilityResult struct { 12595 autorest.Response `json:"-"` 12596 // NameAvailable - READ-ONLY; True if the name is available and can be used to create a new API Management service; otherwise false. 12597 NameAvailable *bool `json:"nameAvailable,omitempty"` 12598 // 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. 12599 Message *string `json:"message,omitempty"` 12600 // 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' 12601 Reason NameAvailabilityReason `json:"reason,omitempty"` 12602} 12603 12604// MarshalJSON is the custom marshaler for ServiceNameAvailabilityResult. 12605func (snar ServiceNameAvailabilityResult) MarshalJSON() ([]byte, error) { 12606 objectMap := make(map[string]interface{}) 12607 if snar.Reason != "" { 12608 objectMap["reason"] = snar.Reason 12609 } 12610 return json.Marshal(objectMap) 12611} 12612 12613// ServiceProperties properties of an API Management service resource description. 12614type ServiceProperties struct { 12615 // PublisherEmail - Publisher email. 12616 PublisherEmail *string `json:"publisherEmail,omitempty"` 12617 // PublisherName - Publisher name. 12618 PublisherName *string `json:"publisherName,omitempty"` 12619 // NotificationSenderEmail - Email address from which the notification will be sent. 12620 NotificationSenderEmail *string `json:"notificationSenderEmail,omitempty"` 12621 // 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. 12622 ProvisioningState *string `json:"provisioningState,omitempty"` 12623 // TargetProvisioningState - READ-ONLY; The provisioning state of the API Management service, which is targeted by the long running operation started on the service. 12624 TargetProvisioningState *string `json:"targetProvisioningState,omitempty"` 12625 // 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. 12626 CreatedAtUtc *date.Time `json:"createdAtUtc,omitempty"` 12627 // GatewayURL - READ-ONLY; Gateway URL of the API Management service. 12628 GatewayURL *string `json:"gatewayUrl,omitempty"` 12629 // GatewayRegionalURL - READ-ONLY; Gateway URL of the API Management service in the Default Region. 12630 GatewayRegionalURL *string `json:"gatewayRegionalUrl,omitempty"` 12631 // PortalURL - READ-ONLY; Publisher portal endpoint Url of the API Management service. 12632 PortalURL *string `json:"portalUrl,omitempty"` 12633 // ManagementAPIURL - READ-ONLY; Management API endpoint URL of the API Management service. 12634 ManagementAPIURL *string `json:"managementApiUrl,omitempty"` 12635 // ScmURL - READ-ONLY; SCM endpoint URL of the API Management service. 12636 ScmURL *string `json:"scmUrl,omitempty"` 12637 // DeveloperPortalURL - READ-ONLY; DEveloper Portal endpoint URL of the API Management service. 12638 DeveloperPortalURL *string `json:"developerPortalUrl,omitempty"` 12639 // HostnameConfigurations - Custom hostname configuration of the API Management service. 12640 HostnameConfigurations *[]HostnameConfiguration `json:"hostnameConfigurations,omitempty"` 12641 // 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. 12642 PublicIPAddresses *[]string `json:"publicIPAddresses,omitempty"` 12643 // 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. 12644 PrivateIPAddresses *[]string `json:"privateIPAddresses,omitempty"` 12645 // VirtualNetworkConfiguration - Virtual network configuration of the API Management service. 12646 VirtualNetworkConfiguration *VirtualNetworkConfiguration `json:"virtualNetworkConfiguration,omitempty"` 12647 // AdditionalLocations - Additional datacenter locations of the API Management service. 12648 AdditionalLocations *[]AdditionalLocation `json:"additionalLocations,omitempty"` 12649 // 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 12650 CustomProperties map[string]*string `json:"customProperties"` 12651 // Certificates - List of Certificates that need to be installed in the API Management service. Max supported certificates that can be installed is 10. 12652 Certificates *[]CertificateConfiguration `json:"certificates,omitempty"` 12653 // 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. 12654 EnableClientCertificate *bool `json:"enableClientCertificate,omitempty"` 12655 // DisableGateway - Property only valid for an Api Management service deployed in multiple locations. This can be used to disable the gateway in master region. 12656 DisableGateway *bool `json:"disableGateway,omitempty"` 12657 // 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' 12658 VirtualNetworkType VirtualNetworkType `json:"virtualNetworkType,omitempty"` 12659 // APIVersionConstraint - Control Plane Apis version constraint for the API Management service. 12660 APIVersionConstraint *APIVersionConstraint `json:"apiVersionConstraint,omitempty"` 12661 // 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. 12662 Restore *bool `json:"restore,omitempty"` 12663} 12664 12665// MarshalJSON is the custom marshaler for ServiceProperties. 12666func (sp ServiceProperties) MarshalJSON() ([]byte, error) { 12667 objectMap := make(map[string]interface{}) 12668 if sp.PublisherEmail != nil { 12669 objectMap["publisherEmail"] = sp.PublisherEmail 12670 } 12671 if sp.PublisherName != nil { 12672 objectMap["publisherName"] = sp.PublisherName 12673 } 12674 if sp.NotificationSenderEmail != nil { 12675 objectMap["notificationSenderEmail"] = sp.NotificationSenderEmail 12676 } 12677 if sp.HostnameConfigurations != nil { 12678 objectMap["hostnameConfigurations"] = sp.HostnameConfigurations 12679 } 12680 if sp.VirtualNetworkConfiguration != nil { 12681 objectMap["virtualNetworkConfiguration"] = sp.VirtualNetworkConfiguration 12682 } 12683 if sp.AdditionalLocations != nil { 12684 objectMap["additionalLocations"] = sp.AdditionalLocations 12685 } 12686 if sp.CustomProperties != nil { 12687 objectMap["customProperties"] = sp.CustomProperties 12688 } 12689 if sp.Certificates != nil { 12690 objectMap["certificates"] = sp.Certificates 12691 } 12692 if sp.EnableClientCertificate != nil { 12693 objectMap["enableClientCertificate"] = sp.EnableClientCertificate 12694 } 12695 if sp.DisableGateway != nil { 12696 objectMap["disableGateway"] = sp.DisableGateway 12697 } 12698 if sp.VirtualNetworkType != "" { 12699 objectMap["virtualNetworkType"] = sp.VirtualNetworkType 12700 } 12701 if sp.APIVersionConstraint != nil { 12702 objectMap["apiVersionConstraint"] = sp.APIVersionConstraint 12703 } 12704 if sp.Restore != nil { 12705 objectMap["restore"] = sp.Restore 12706 } 12707 return json.Marshal(objectMap) 12708} 12709 12710// ServiceResource a single API Management service resource in List or Get response. 12711type ServiceResource struct { 12712 autorest.Response `json:"-"` 12713 // ServiceProperties - Properties of the API Management service. 12714 *ServiceProperties `json:"properties,omitempty"` 12715 // Sku - SKU properties of the API Management service. 12716 Sku *ServiceSkuProperties `json:"sku,omitempty"` 12717 // Identity - Managed service identity of the Api Management service. 12718 Identity *ServiceIdentity `json:"identity,omitempty"` 12719 // Location - Resource location. 12720 Location *string `json:"location,omitempty"` 12721 // Etag - READ-ONLY; ETag of the resource. 12722 Etag *string `json:"etag,omitempty"` 12723 // Zones - A list of availability zones denoting where the resource needs to come from. 12724 Zones *[]string `json:"zones,omitempty"` 12725 // ID - READ-ONLY; Resource ID. 12726 ID *string `json:"id,omitempty"` 12727 // Name - READ-ONLY; Resource name. 12728 Name *string `json:"name,omitempty"` 12729 // Type - READ-ONLY; Resource type for API Management resource is set to Microsoft.ApiManagement. 12730 Type *string `json:"type,omitempty"` 12731 // Tags - Resource tags. 12732 Tags map[string]*string `json:"tags"` 12733} 12734 12735// MarshalJSON is the custom marshaler for ServiceResource. 12736func (sr ServiceResource) MarshalJSON() ([]byte, error) { 12737 objectMap := make(map[string]interface{}) 12738 if sr.ServiceProperties != nil { 12739 objectMap["properties"] = sr.ServiceProperties 12740 } 12741 if sr.Sku != nil { 12742 objectMap["sku"] = sr.Sku 12743 } 12744 if sr.Identity != nil { 12745 objectMap["identity"] = sr.Identity 12746 } 12747 if sr.Location != nil { 12748 objectMap["location"] = sr.Location 12749 } 12750 if sr.Zones != nil { 12751 objectMap["zones"] = sr.Zones 12752 } 12753 if sr.Tags != nil { 12754 objectMap["tags"] = sr.Tags 12755 } 12756 return json.Marshal(objectMap) 12757} 12758 12759// UnmarshalJSON is the custom unmarshaler for ServiceResource struct. 12760func (sr *ServiceResource) UnmarshalJSON(body []byte) error { 12761 var m map[string]*json.RawMessage 12762 err := json.Unmarshal(body, &m) 12763 if err != nil { 12764 return err 12765 } 12766 for k, v := range m { 12767 switch k { 12768 case "properties": 12769 if v != nil { 12770 var serviceProperties ServiceProperties 12771 err = json.Unmarshal(*v, &serviceProperties) 12772 if err != nil { 12773 return err 12774 } 12775 sr.ServiceProperties = &serviceProperties 12776 } 12777 case "sku": 12778 if v != nil { 12779 var sku ServiceSkuProperties 12780 err = json.Unmarshal(*v, &sku) 12781 if err != nil { 12782 return err 12783 } 12784 sr.Sku = &sku 12785 } 12786 case "identity": 12787 if v != nil { 12788 var identity ServiceIdentity 12789 err = json.Unmarshal(*v, &identity) 12790 if err != nil { 12791 return err 12792 } 12793 sr.Identity = &identity 12794 } 12795 case "location": 12796 if v != nil { 12797 var location string 12798 err = json.Unmarshal(*v, &location) 12799 if err != nil { 12800 return err 12801 } 12802 sr.Location = &location 12803 } 12804 case "etag": 12805 if v != nil { 12806 var etag string 12807 err = json.Unmarshal(*v, &etag) 12808 if err != nil { 12809 return err 12810 } 12811 sr.Etag = &etag 12812 } 12813 case "zones": 12814 if v != nil { 12815 var zones []string 12816 err = json.Unmarshal(*v, &zones) 12817 if err != nil { 12818 return err 12819 } 12820 sr.Zones = &zones 12821 } 12822 case "id": 12823 if v != nil { 12824 var ID string 12825 err = json.Unmarshal(*v, &ID) 12826 if err != nil { 12827 return err 12828 } 12829 sr.ID = &ID 12830 } 12831 case "name": 12832 if v != nil { 12833 var name string 12834 err = json.Unmarshal(*v, &name) 12835 if err != nil { 12836 return err 12837 } 12838 sr.Name = &name 12839 } 12840 case "type": 12841 if v != nil { 12842 var typeVar string 12843 err = json.Unmarshal(*v, &typeVar) 12844 if err != nil { 12845 return err 12846 } 12847 sr.Type = &typeVar 12848 } 12849 case "tags": 12850 if v != nil { 12851 var tags map[string]*string 12852 err = json.Unmarshal(*v, &tags) 12853 if err != nil { 12854 return err 12855 } 12856 sr.Tags = tags 12857 } 12858 } 12859 } 12860 12861 return nil 12862} 12863 12864// ServiceRestoreFuture an abstraction for monitoring and retrieving the results of a long-running 12865// operation. 12866type ServiceRestoreFuture struct { 12867 azure.FutureAPI 12868 // Result returns the result of the asynchronous operation. 12869 // If the operation has not completed it will return an error. 12870 Result func(ServiceClient) (ServiceResource, error) 12871} 12872 12873// ServiceSkuProperties API Management service resource SKU properties. 12874type ServiceSkuProperties struct { 12875 // Name - Name of the Sku. Possible values include: 'SkuTypeDeveloper', 'SkuTypeStandard', 'SkuTypePremium', 'SkuTypeBasic', 'SkuTypeConsumption', 'SkuTypeIsolated' 12876 Name SkuType `json:"name,omitempty"` 12877 // Capacity - Capacity of the SKU (number of deployed units of the SKU). For Consumption SKU capacity must be specified as 0. 12878 Capacity *int32 `json:"capacity,omitempty"` 12879} 12880 12881// ServiceUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 12882// operation. 12883type ServiceUpdateFuture struct { 12884 azure.FutureAPI 12885 // Result returns the result of the asynchronous operation. 12886 // If the operation has not completed it will return an error. 12887 Result func(ServiceClient) (ServiceResource, error) 12888} 12889 12890// ServiceUpdateParameters parameter supplied to Update Api Management Service. 12891type ServiceUpdateParameters struct { 12892 // ServiceUpdateProperties - Properties of the API Management service. 12893 *ServiceUpdateProperties `json:"properties,omitempty"` 12894 // Sku - SKU properties of the API Management service. 12895 Sku *ServiceSkuProperties `json:"sku,omitempty"` 12896 // Identity - Managed service identity of the Api Management service. 12897 Identity *ServiceIdentity `json:"identity,omitempty"` 12898 // Etag - READ-ONLY; ETag of the resource. 12899 Etag *string `json:"etag,omitempty"` 12900 // ID - READ-ONLY; Resource ID. 12901 ID *string `json:"id,omitempty"` 12902 // Name - READ-ONLY; Resource name. 12903 Name *string `json:"name,omitempty"` 12904 // Type - READ-ONLY; Resource type for API Management resource is set to Microsoft.ApiManagement. 12905 Type *string `json:"type,omitempty"` 12906 // Tags - Resource tags. 12907 Tags map[string]*string `json:"tags"` 12908} 12909 12910// MarshalJSON is the custom marshaler for ServiceUpdateParameters. 12911func (sup ServiceUpdateParameters) MarshalJSON() ([]byte, error) { 12912 objectMap := make(map[string]interface{}) 12913 if sup.ServiceUpdateProperties != nil { 12914 objectMap["properties"] = sup.ServiceUpdateProperties 12915 } 12916 if sup.Sku != nil { 12917 objectMap["sku"] = sup.Sku 12918 } 12919 if sup.Identity != nil { 12920 objectMap["identity"] = sup.Identity 12921 } 12922 if sup.Tags != nil { 12923 objectMap["tags"] = sup.Tags 12924 } 12925 return json.Marshal(objectMap) 12926} 12927 12928// UnmarshalJSON is the custom unmarshaler for ServiceUpdateParameters struct. 12929func (sup *ServiceUpdateParameters) UnmarshalJSON(body []byte) error { 12930 var m map[string]*json.RawMessage 12931 err := json.Unmarshal(body, &m) 12932 if err != nil { 12933 return err 12934 } 12935 for k, v := range m { 12936 switch k { 12937 case "properties": 12938 if v != nil { 12939 var serviceUpdateProperties ServiceUpdateProperties 12940 err = json.Unmarshal(*v, &serviceUpdateProperties) 12941 if err != nil { 12942 return err 12943 } 12944 sup.ServiceUpdateProperties = &serviceUpdateProperties 12945 } 12946 case "sku": 12947 if v != nil { 12948 var sku ServiceSkuProperties 12949 err = json.Unmarshal(*v, &sku) 12950 if err != nil { 12951 return err 12952 } 12953 sup.Sku = &sku 12954 } 12955 case "identity": 12956 if v != nil { 12957 var identity ServiceIdentity 12958 err = json.Unmarshal(*v, &identity) 12959 if err != nil { 12960 return err 12961 } 12962 sup.Identity = &identity 12963 } 12964 case "etag": 12965 if v != nil { 12966 var etag string 12967 err = json.Unmarshal(*v, &etag) 12968 if err != nil { 12969 return err 12970 } 12971 sup.Etag = &etag 12972 } 12973 case "id": 12974 if v != nil { 12975 var ID string 12976 err = json.Unmarshal(*v, &ID) 12977 if err != nil { 12978 return err 12979 } 12980 sup.ID = &ID 12981 } 12982 case "name": 12983 if v != nil { 12984 var name string 12985 err = json.Unmarshal(*v, &name) 12986 if err != nil { 12987 return err 12988 } 12989 sup.Name = &name 12990 } 12991 case "type": 12992 if v != nil { 12993 var typeVar string 12994 err = json.Unmarshal(*v, &typeVar) 12995 if err != nil { 12996 return err 12997 } 12998 sup.Type = &typeVar 12999 } 13000 case "tags": 13001 if v != nil { 13002 var tags map[string]*string 13003 err = json.Unmarshal(*v, &tags) 13004 if err != nil { 13005 return err 13006 } 13007 sup.Tags = tags 13008 } 13009 } 13010 } 13011 13012 return nil 13013} 13014 13015// ServiceUpdateProperties properties of an API Management service resource description. 13016type ServiceUpdateProperties struct { 13017 // PublisherEmail - Publisher email. 13018 PublisherEmail *string `json:"publisherEmail,omitempty"` 13019 // PublisherName - Publisher name. 13020 PublisherName *string `json:"publisherName,omitempty"` 13021 // NotificationSenderEmail - Email address from which the notification will be sent. 13022 NotificationSenderEmail *string `json:"notificationSenderEmail,omitempty"` 13023 // 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. 13024 ProvisioningState *string `json:"provisioningState,omitempty"` 13025 // TargetProvisioningState - READ-ONLY; The provisioning state of the API Management service, which is targeted by the long running operation started on the service. 13026 TargetProvisioningState *string `json:"targetProvisioningState,omitempty"` 13027 // 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. 13028 CreatedAtUtc *date.Time `json:"createdAtUtc,omitempty"` 13029 // GatewayURL - READ-ONLY; Gateway URL of the API Management service. 13030 GatewayURL *string `json:"gatewayUrl,omitempty"` 13031 // GatewayRegionalURL - READ-ONLY; Gateway URL of the API Management service in the Default Region. 13032 GatewayRegionalURL *string `json:"gatewayRegionalUrl,omitempty"` 13033 // PortalURL - READ-ONLY; Publisher portal endpoint Url of the API Management service. 13034 PortalURL *string `json:"portalUrl,omitempty"` 13035 // ManagementAPIURL - READ-ONLY; Management API endpoint URL of the API Management service. 13036 ManagementAPIURL *string `json:"managementApiUrl,omitempty"` 13037 // ScmURL - READ-ONLY; SCM endpoint URL of the API Management service. 13038 ScmURL *string `json:"scmUrl,omitempty"` 13039 // DeveloperPortalURL - READ-ONLY; DEveloper Portal endpoint URL of the API Management service. 13040 DeveloperPortalURL *string `json:"developerPortalUrl,omitempty"` 13041 // HostnameConfigurations - Custom hostname configuration of the API Management service. 13042 HostnameConfigurations *[]HostnameConfiguration `json:"hostnameConfigurations,omitempty"` 13043 // 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. 13044 PublicIPAddresses *[]string `json:"publicIPAddresses,omitempty"` 13045 // 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. 13046 PrivateIPAddresses *[]string `json:"privateIPAddresses,omitempty"` 13047 // VirtualNetworkConfiguration - Virtual network configuration of the API Management service. 13048 VirtualNetworkConfiguration *VirtualNetworkConfiguration `json:"virtualNetworkConfiguration,omitempty"` 13049 // AdditionalLocations - Additional datacenter locations of the API Management service. 13050 AdditionalLocations *[]AdditionalLocation `json:"additionalLocations,omitempty"` 13051 // 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 13052 CustomProperties map[string]*string `json:"customProperties"` 13053 // Certificates - List of Certificates that need to be installed in the API Management service. Max supported certificates that can be installed is 10. 13054 Certificates *[]CertificateConfiguration `json:"certificates,omitempty"` 13055 // 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. 13056 EnableClientCertificate *bool `json:"enableClientCertificate,omitempty"` 13057 // DisableGateway - Property only valid for an Api Management service deployed in multiple locations. This can be used to disable the gateway in master region. 13058 DisableGateway *bool `json:"disableGateway,omitempty"` 13059 // 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' 13060 VirtualNetworkType VirtualNetworkType `json:"virtualNetworkType,omitempty"` 13061 // APIVersionConstraint - Control Plane Apis version constraint for the API Management service. 13062 APIVersionConstraint *APIVersionConstraint `json:"apiVersionConstraint,omitempty"` 13063 // 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. 13064 Restore *bool `json:"restore,omitempty"` 13065} 13066 13067// MarshalJSON is the custom marshaler for ServiceUpdateProperties. 13068func (sup ServiceUpdateProperties) MarshalJSON() ([]byte, error) { 13069 objectMap := make(map[string]interface{}) 13070 if sup.PublisherEmail != nil { 13071 objectMap["publisherEmail"] = sup.PublisherEmail 13072 } 13073 if sup.PublisherName != nil { 13074 objectMap["publisherName"] = sup.PublisherName 13075 } 13076 if sup.NotificationSenderEmail != nil { 13077 objectMap["notificationSenderEmail"] = sup.NotificationSenderEmail 13078 } 13079 if sup.HostnameConfigurations != nil { 13080 objectMap["hostnameConfigurations"] = sup.HostnameConfigurations 13081 } 13082 if sup.VirtualNetworkConfiguration != nil { 13083 objectMap["virtualNetworkConfiguration"] = sup.VirtualNetworkConfiguration 13084 } 13085 if sup.AdditionalLocations != nil { 13086 objectMap["additionalLocations"] = sup.AdditionalLocations 13087 } 13088 if sup.CustomProperties != nil { 13089 objectMap["customProperties"] = sup.CustomProperties 13090 } 13091 if sup.Certificates != nil { 13092 objectMap["certificates"] = sup.Certificates 13093 } 13094 if sup.EnableClientCertificate != nil { 13095 objectMap["enableClientCertificate"] = sup.EnableClientCertificate 13096 } 13097 if sup.DisableGateway != nil { 13098 objectMap["disableGateway"] = sup.DisableGateway 13099 } 13100 if sup.VirtualNetworkType != "" { 13101 objectMap["virtualNetworkType"] = sup.VirtualNetworkType 13102 } 13103 if sup.APIVersionConstraint != nil { 13104 objectMap["apiVersionConstraint"] = sup.APIVersionConstraint 13105 } 13106 if sup.Restore != nil { 13107 objectMap["restore"] = sup.Restore 13108 } 13109 return json.Marshal(objectMap) 13110} 13111 13112// Sku describes an available ApiManagement SKU. 13113type Sku struct { 13114 // ResourceType - READ-ONLY; The type of resource the SKU applies to. 13115 ResourceType *string `json:"resourceType,omitempty"` 13116 // Name - READ-ONLY; The name of SKU. 13117 Name *string `json:"name,omitempty"` 13118 // Tier - READ-ONLY; Specifies the tier of virtual machines in a scale set.<br /><br /> Possible Values:<br /><br /> **Standard**<br /><br /> **Basic** 13119 Tier *string `json:"tier,omitempty"` 13120 // Size - READ-ONLY; The Size of the SKU. 13121 Size *string `json:"size,omitempty"` 13122 // Family - READ-ONLY; The Family of this particular SKU. 13123 Family *string `json:"family,omitempty"` 13124 // Kind - READ-ONLY; The Kind of resources that are supported in this SKU. 13125 Kind *string `json:"kind,omitempty"` 13126 // Capacity - READ-ONLY; Specifies the number of virtual machines in the scale set. 13127 Capacity *SkuCapacity `json:"capacity,omitempty"` 13128 // Locations - READ-ONLY; The set of locations that the SKU is available. 13129 Locations *[]string `json:"locations,omitempty"` 13130 // LocationInfo - READ-ONLY; A list of locations and availability zones in those locations where the SKU is available. 13131 LocationInfo *[]SkuLocationInfo `json:"locationInfo,omitempty"` 13132 // APIVersions - READ-ONLY; The api versions that support this SKU. 13133 APIVersions *[]string `json:"apiVersions,omitempty"` 13134 // Costs - READ-ONLY; Metadata for retrieving price info. 13135 Costs *[]SkuCosts `json:"costs,omitempty"` 13136 // Capabilities - READ-ONLY; A name value pair to describe the capability. 13137 Capabilities *[]SkuCapabilities `json:"capabilities,omitempty"` 13138 // Restrictions - READ-ONLY; The restrictions because of which SKU cannot be used. This is empty if there are no restrictions. 13139 Restrictions *[]SkuRestrictions `json:"restrictions,omitempty"` 13140} 13141 13142// SkuCapabilities describes The SKU capabilities object. 13143type SkuCapabilities struct { 13144 // Name - READ-ONLY; An invariant to describe the feature. 13145 Name *string `json:"name,omitempty"` 13146 // Value - READ-ONLY; An invariant if the feature is measured by quantity. 13147 Value *string `json:"value,omitempty"` 13148} 13149 13150// SkuCapacity describes scaling information of a SKU. 13151type SkuCapacity struct { 13152 // Minimum - READ-ONLY; The minimum capacity. 13153 Minimum *int32 `json:"minimum,omitempty"` 13154 // Maximum - READ-ONLY; The maximum capacity that can be set. 13155 Maximum *int32 `json:"maximum,omitempty"` 13156 // Default - READ-ONLY; The default capacity. 13157 Default *int32 `json:"default,omitempty"` 13158 // ScaleType - READ-ONLY; The scale type applicable to the sku. Possible values include: 'SkuCapacityScaleTypeAutomatic', 'SkuCapacityScaleTypeManual', 'SkuCapacityScaleTypeNone' 13159 ScaleType SkuCapacityScaleType `json:"scaleType,omitempty"` 13160} 13161 13162// SkuCosts describes metadata for retrieving price info. 13163type SkuCosts struct { 13164 // MeterID - READ-ONLY; Used for querying price from commerce. 13165 MeterID *string `json:"meterID,omitempty"` 13166 // Quantity - READ-ONLY; The multiplier is needed to extend the base metered cost. 13167 Quantity *int64 `json:"quantity,omitempty"` 13168 // ExtendedUnit - READ-ONLY; An invariant to show the extended unit. 13169 ExtendedUnit *string `json:"extendedUnit,omitempty"` 13170} 13171 13172// SkuLocationInfo ... 13173type SkuLocationInfo struct { 13174 // Location - READ-ONLY; Location of the SKU 13175 Location *string `json:"location,omitempty"` 13176 // Zones - READ-ONLY; List of availability zones where the SKU is supported. 13177 Zones *[]string `json:"zones,omitempty"` 13178 // ZoneDetails - READ-ONLY; Details of capabilities available to a SKU in specific zones. 13179 ZoneDetails *[]SkuZoneDetails `json:"zoneDetails,omitempty"` 13180} 13181 13182// SkuRestrictionInfo ... 13183type SkuRestrictionInfo struct { 13184 // Locations - READ-ONLY; Locations where the SKU is restricted 13185 Locations *[]string `json:"locations,omitempty"` 13186 // Zones - READ-ONLY; List of availability zones where the SKU is restricted. 13187 Zones *[]string `json:"zones,omitempty"` 13188} 13189 13190// SkuRestrictions describes scaling information of a SKU. 13191type SkuRestrictions struct { 13192 // Type - READ-ONLY; The type of restrictions. Possible values include: 'Location', 'Zone' 13193 Type SkuRestrictionsType `json:"type,omitempty"` 13194 // 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. 13195 Values *[]string `json:"values,omitempty"` 13196 // RestrictionInfo - READ-ONLY; The information about the restriction where the SKU cannot be used. 13197 RestrictionInfo *SkuRestrictionInfo `json:"restrictionInfo,omitempty"` 13198 // ReasonCode - READ-ONLY; The reason for restriction. Possible values include: 'QuotaID', 'NotAvailableForSubscription' 13199 ReasonCode SkuRestrictionsReasonCode `json:"reasonCode,omitempty"` 13200} 13201 13202// SkusResult the List Resource Skus operation response. 13203type SkusResult struct { 13204 autorest.Response `json:"-"` 13205 // Value - The list of skus available for the subscription. 13206 Value *[]Sku `json:"value,omitempty"` 13207 // 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 13208 NextLink *string `json:"nextLink,omitempty"` 13209} 13210 13211// MarshalJSON is the custom marshaler for SkusResult. 13212func (sr SkusResult) MarshalJSON() ([]byte, error) { 13213 objectMap := make(map[string]interface{}) 13214 if sr.Value != nil { 13215 objectMap["value"] = sr.Value 13216 } 13217 return json.Marshal(objectMap) 13218} 13219 13220// SkusResultIterator provides access to a complete listing of Sku values. 13221type SkusResultIterator struct { 13222 i int 13223 page SkusResultPage 13224} 13225 13226// NextWithContext advances to the next value. If there was an error making 13227// the request the iterator does not advance and the error is returned. 13228func (iter *SkusResultIterator) NextWithContext(ctx context.Context) (err error) { 13229 if tracing.IsEnabled() { 13230 ctx = tracing.StartSpan(ctx, fqdn+"/SkusResultIterator.NextWithContext") 13231 defer func() { 13232 sc := -1 13233 if iter.Response().Response.Response != nil { 13234 sc = iter.Response().Response.Response.StatusCode 13235 } 13236 tracing.EndSpan(ctx, sc, err) 13237 }() 13238 } 13239 iter.i++ 13240 if iter.i < len(iter.page.Values()) { 13241 return nil 13242 } 13243 err = iter.page.NextWithContext(ctx) 13244 if err != nil { 13245 iter.i-- 13246 return err 13247 } 13248 iter.i = 0 13249 return nil 13250} 13251 13252// Next advances to the next value. If there was an error making 13253// the request the iterator does not advance and the error is returned. 13254// Deprecated: Use NextWithContext() instead. 13255func (iter *SkusResultIterator) Next() error { 13256 return iter.NextWithContext(context.Background()) 13257} 13258 13259// NotDone returns true if the enumeration should be started or is not yet complete. 13260func (iter SkusResultIterator) NotDone() bool { 13261 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 13262} 13263 13264// Response returns the raw server response from the last page request. 13265func (iter SkusResultIterator) Response() SkusResult { 13266 return iter.page.Response() 13267} 13268 13269// Value returns the current value or a zero-initialized value if the 13270// iterator has advanced beyond the end of the collection. 13271func (iter SkusResultIterator) Value() Sku { 13272 if !iter.page.NotDone() { 13273 return Sku{} 13274 } 13275 return iter.page.Values()[iter.i] 13276} 13277 13278// Creates a new instance of the SkusResultIterator type. 13279func NewSkusResultIterator(page SkusResultPage) SkusResultIterator { 13280 return SkusResultIterator{page: page} 13281} 13282 13283// IsEmpty returns true if the ListResult contains no values. 13284func (sr SkusResult) IsEmpty() bool { 13285 return sr.Value == nil || len(*sr.Value) == 0 13286} 13287 13288// hasNextLink returns true if the NextLink is not empty. 13289func (sr SkusResult) hasNextLink() bool { 13290 return sr.NextLink != nil && len(*sr.NextLink) != 0 13291} 13292 13293// skusResultPreparer prepares a request to retrieve the next set of results. 13294// It returns nil if no more results exist. 13295func (sr SkusResult) skusResultPreparer(ctx context.Context) (*http.Request, error) { 13296 if !sr.hasNextLink() { 13297 return nil, nil 13298 } 13299 return autorest.Prepare((&http.Request{}).WithContext(ctx), 13300 autorest.AsJSON(), 13301 autorest.AsGet(), 13302 autorest.WithBaseURL(to.String(sr.NextLink))) 13303} 13304 13305// SkusResultPage contains a page of Sku values. 13306type SkusResultPage struct { 13307 fn func(context.Context, SkusResult) (SkusResult, error) 13308 sr SkusResult 13309} 13310 13311// NextWithContext advances to the next page of values. If there was an error making 13312// the request the page does not advance and the error is returned. 13313func (page *SkusResultPage) NextWithContext(ctx context.Context) (err error) { 13314 if tracing.IsEnabled() { 13315 ctx = tracing.StartSpan(ctx, fqdn+"/SkusResultPage.NextWithContext") 13316 defer func() { 13317 sc := -1 13318 if page.Response().Response.Response != nil { 13319 sc = page.Response().Response.Response.StatusCode 13320 } 13321 tracing.EndSpan(ctx, sc, err) 13322 }() 13323 } 13324 for { 13325 next, err := page.fn(ctx, page.sr) 13326 if err != nil { 13327 return err 13328 } 13329 page.sr = next 13330 if !next.hasNextLink() || !next.IsEmpty() { 13331 break 13332 } 13333 } 13334 return nil 13335} 13336 13337// Next advances to the next page of values. If there was an error making 13338// the request the page does not advance and the error is returned. 13339// Deprecated: Use NextWithContext() instead. 13340func (page *SkusResultPage) Next() error { 13341 return page.NextWithContext(context.Background()) 13342} 13343 13344// NotDone returns true if the page enumeration should be started or is not yet complete. 13345func (page SkusResultPage) NotDone() bool { 13346 return !page.sr.IsEmpty() 13347} 13348 13349// Response returns the raw server response from the last page request. 13350func (page SkusResultPage) Response() SkusResult { 13351 return page.sr 13352} 13353 13354// Values returns the slice of values for the current page or nil if there are no values. 13355func (page SkusResultPage) Values() []Sku { 13356 if page.sr.IsEmpty() { 13357 return nil 13358 } 13359 return *page.sr.Value 13360} 13361 13362// Creates a new instance of the SkusResultPage type. 13363func NewSkusResultPage(cur SkusResult, getNextPage func(context.Context, SkusResult) (SkusResult, error)) SkusResultPage { 13364 return SkusResultPage{ 13365 fn: getNextPage, 13366 sr: cur, 13367 } 13368} 13369 13370// SkuZoneDetails describes The zonal capabilities of a SKU. 13371type SkuZoneDetails struct { 13372 // Name - READ-ONLY; The set of zones that the SKU is available in with the specified capabilities. 13373 Name *[]string `json:"name,omitempty"` 13374 // Capabilities - READ-ONLY; A list of capabilities that are available for the SKU in the specified list of zones. 13375 Capabilities *[]SkuCapabilities `json:"capabilities,omitempty"` 13376} 13377 13378// SubscriptionCollection paged Subscriptions list representation. 13379type SubscriptionCollection struct { 13380 autorest.Response `json:"-"` 13381 // Value - Page values. 13382 Value *[]SubscriptionContract `json:"value,omitempty"` 13383 // Count - Total record count number across all pages. 13384 Count *int64 `json:"count,omitempty"` 13385 // NextLink - Next page link if any. 13386 NextLink *string `json:"nextLink,omitempty"` 13387} 13388 13389// SubscriptionCollectionIterator provides access to a complete listing of SubscriptionContract values. 13390type SubscriptionCollectionIterator struct { 13391 i int 13392 page SubscriptionCollectionPage 13393} 13394 13395// NextWithContext advances to the next value. If there was an error making 13396// the request the iterator does not advance and the error is returned. 13397func (iter *SubscriptionCollectionIterator) NextWithContext(ctx context.Context) (err error) { 13398 if tracing.IsEnabled() { 13399 ctx = tracing.StartSpan(ctx, fqdn+"/SubscriptionCollectionIterator.NextWithContext") 13400 defer func() { 13401 sc := -1 13402 if iter.Response().Response.Response != nil { 13403 sc = iter.Response().Response.Response.StatusCode 13404 } 13405 tracing.EndSpan(ctx, sc, err) 13406 }() 13407 } 13408 iter.i++ 13409 if iter.i < len(iter.page.Values()) { 13410 return nil 13411 } 13412 err = iter.page.NextWithContext(ctx) 13413 if err != nil { 13414 iter.i-- 13415 return err 13416 } 13417 iter.i = 0 13418 return nil 13419} 13420 13421// Next advances to the next value. If there was an error making 13422// the request the iterator does not advance and the error is returned. 13423// Deprecated: Use NextWithContext() instead. 13424func (iter *SubscriptionCollectionIterator) Next() error { 13425 return iter.NextWithContext(context.Background()) 13426} 13427 13428// NotDone returns true if the enumeration should be started or is not yet complete. 13429func (iter SubscriptionCollectionIterator) NotDone() bool { 13430 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 13431} 13432 13433// Response returns the raw server response from the last page request. 13434func (iter SubscriptionCollectionIterator) Response() SubscriptionCollection { 13435 return iter.page.Response() 13436} 13437 13438// Value returns the current value or a zero-initialized value if the 13439// iterator has advanced beyond the end of the collection. 13440func (iter SubscriptionCollectionIterator) Value() SubscriptionContract { 13441 if !iter.page.NotDone() { 13442 return SubscriptionContract{} 13443 } 13444 return iter.page.Values()[iter.i] 13445} 13446 13447// Creates a new instance of the SubscriptionCollectionIterator type. 13448func NewSubscriptionCollectionIterator(page SubscriptionCollectionPage) SubscriptionCollectionIterator { 13449 return SubscriptionCollectionIterator{page: page} 13450} 13451 13452// IsEmpty returns true if the ListResult contains no values. 13453func (sc SubscriptionCollection) IsEmpty() bool { 13454 return sc.Value == nil || len(*sc.Value) == 0 13455} 13456 13457// hasNextLink returns true if the NextLink is not empty. 13458func (sc SubscriptionCollection) hasNextLink() bool { 13459 return sc.NextLink != nil && len(*sc.NextLink) != 0 13460} 13461 13462// subscriptionCollectionPreparer prepares a request to retrieve the next set of results. 13463// It returns nil if no more results exist. 13464func (sc SubscriptionCollection) subscriptionCollectionPreparer(ctx context.Context) (*http.Request, error) { 13465 if !sc.hasNextLink() { 13466 return nil, nil 13467 } 13468 return autorest.Prepare((&http.Request{}).WithContext(ctx), 13469 autorest.AsJSON(), 13470 autorest.AsGet(), 13471 autorest.WithBaseURL(to.String(sc.NextLink))) 13472} 13473 13474// SubscriptionCollectionPage contains a page of SubscriptionContract values. 13475type SubscriptionCollectionPage struct { 13476 fn func(context.Context, SubscriptionCollection) (SubscriptionCollection, error) 13477 sc SubscriptionCollection 13478} 13479 13480// NextWithContext advances to the next page of values. If there was an error making 13481// the request the page does not advance and the error is returned. 13482func (page *SubscriptionCollectionPage) NextWithContext(ctx context.Context) (err error) { 13483 if tracing.IsEnabled() { 13484 ctx = tracing.StartSpan(ctx, fqdn+"/SubscriptionCollectionPage.NextWithContext") 13485 defer func() { 13486 sc := -1 13487 if page.Response().Response.Response != nil { 13488 sc = page.Response().Response.Response.StatusCode 13489 } 13490 tracing.EndSpan(ctx, sc, err) 13491 }() 13492 } 13493 for { 13494 next, err := page.fn(ctx, page.sc) 13495 if err != nil { 13496 return err 13497 } 13498 page.sc = next 13499 if !next.hasNextLink() || !next.IsEmpty() { 13500 break 13501 } 13502 } 13503 return nil 13504} 13505 13506// Next advances to the next page of values. If there was an error making 13507// the request the page does not advance and the error is returned. 13508// Deprecated: Use NextWithContext() instead. 13509func (page *SubscriptionCollectionPage) Next() error { 13510 return page.NextWithContext(context.Background()) 13511} 13512 13513// NotDone returns true if the page enumeration should be started or is not yet complete. 13514func (page SubscriptionCollectionPage) NotDone() bool { 13515 return !page.sc.IsEmpty() 13516} 13517 13518// Response returns the raw server response from the last page request. 13519func (page SubscriptionCollectionPage) Response() SubscriptionCollection { 13520 return page.sc 13521} 13522 13523// Values returns the slice of values for the current page or nil if there are no values. 13524func (page SubscriptionCollectionPage) Values() []SubscriptionContract { 13525 if page.sc.IsEmpty() { 13526 return nil 13527 } 13528 return *page.sc.Value 13529} 13530 13531// Creates a new instance of the SubscriptionCollectionPage type. 13532func NewSubscriptionCollectionPage(cur SubscriptionCollection, getNextPage func(context.Context, SubscriptionCollection) (SubscriptionCollection, error)) SubscriptionCollectionPage { 13533 return SubscriptionCollectionPage{ 13534 fn: getNextPage, 13535 sc: cur, 13536 } 13537} 13538 13539// SubscriptionContract subscription details. 13540type SubscriptionContract struct { 13541 autorest.Response `json:"-"` 13542 // SubscriptionContractProperties - Subscription contract properties. 13543 *SubscriptionContractProperties `json:"properties,omitempty"` 13544 // ID - READ-ONLY; Resource ID. 13545 ID *string `json:"id,omitempty"` 13546 // Name - READ-ONLY; Resource name. 13547 Name *string `json:"name,omitempty"` 13548 // Type - READ-ONLY; Resource type for API Management resource. 13549 Type *string `json:"type,omitempty"` 13550} 13551 13552// MarshalJSON is the custom marshaler for SubscriptionContract. 13553func (sc SubscriptionContract) MarshalJSON() ([]byte, error) { 13554 objectMap := make(map[string]interface{}) 13555 if sc.SubscriptionContractProperties != nil { 13556 objectMap["properties"] = sc.SubscriptionContractProperties 13557 } 13558 return json.Marshal(objectMap) 13559} 13560 13561// UnmarshalJSON is the custom unmarshaler for SubscriptionContract struct. 13562func (sc *SubscriptionContract) UnmarshalJSON(body []byte) error { 13563 var m map[string]*json.RawMessage 13564 err := json.Unmarshal(body, &m) 13565 if err != nil { 13566 return err 13567 } 13568 for k, v := range m { 13569 switch k { 13570 case "properties": 13571 if v != nil { 13572 var subscriptionContractProperties SubscriptionContractProperties 13573 err = json.Unmarshal(*v, &subscriptionContractProperties) 13574 if err != nil { 13575 return err 13576 } 13577 sc.SubscriptionContractProperties = &subscriptionContractProperties 13578 } 13579 case "id": 13580 if v != nil { 13581 var ID string 13582 err = json.Unmarshal(*v, &ID) 13583 if err != nil { 13584 return err 13585 } 13586 sc.ID = &ID 13587 } 13588 case "name": 13589 if v != nil { 13590 var name string 13591 err = json.Unmarshal(*v, &name) 13592 if err != nil { 13593 return err 13594 } 13595 sc.Name = &name 13596 } 13597 case "type": 13598 if v != nil { 13599 var typeVar string 13600 err = json.Unmarshal(*v, &typeVar) 13601 if err != nil { 13602 return err 13603 } 13604 sc.Type = &typeVar 13605 } 13606 } 13607 } 13608 13609 return nil 13610} 13611 13612// SubscriptionContractProperties subscription details. 13613type SubscriptionContractProperties struct { 13614 // 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. 13615 OwnerID *string `json:"ownerId,omitempty"` 13616 // Scope - Scope like /products/{productId} or /apis or /apis/{apiId}. 13617 Scope *string `json:"scope,omitempty"` 13618 // DisplayName - The name of the subscription, or null if the subscription has no name. 13619 DisplayName *string `json:"displayName,omitempty"` 13620 // 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' 13621 State SubscriptionState `json:"state,omitempty"` 13622 // 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. 13623 CreatedDate *date.Time `json:"createdDate,omitempty"` 13624 // 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. 13625 StartDate *date.Time `json:"startDate,omitempty"` 13626 // 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. 13627 ExpirationDate *date.Time `json:"expirationDate,omitempty"` 13628 // 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. 13629 EndDate *date.Time `json:"endDate,omitempty"` 13630 // 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. 13631 NotificationDate *date.Time `json:"notificationDate,omitempty"` 13632 // PrimaryKey - Subscription primary key. This property will not be filled on 'GET' operations! Use '/listSecrets' POST request to get the value. 13633 PrimaryKey *string `json:"primaryKey,omitempty"` 13634 // SecondaryKey - Subscription secondary key. This property will not be filled on 'GET' operations! Use '/listSecrets' POST request to get the value. 13635 SecondaryKey *string `json:"secondaryKey,omitempty"` 13636 // StateComment - Optional subscription comment added by an administrator when the state is changed to the 'rejected'. 13637 StateComment *string `json:"stateComment,omitempty"` 13638 // AllowTracing - Determines whether tracing is enabled 13639 AllowTracing *bool `json:"allowTracing,omitempty"` 13640} 13641 13642// MarshalJSON is the custom marshaler for SubscriptionContractProperties. 13643func (scp SubscriptionContractProperties) MarshalJSON() ([]byte, error) { 13644 objectMap := make(map[string]interface{}) 13645 if scp.OwnerID != nil { 13646 objectMap["ownerId"] = scp.OwnerID 13647 } 13648 if scp.Scope != nil { 13649 objectMap["scope"] = scp.Scope 13650 } 13651 if scp.DisplayName != nil { 13652 objectMap["displayName"] = scp.DisplayName 13653 } 13654 if scp.State != "" { 13655 objectMap["state"] = scp.State 13656 } 13657 if scp.StartDate != nil { 13658 objectMap["startDate"] = scp.StartDate 13659 } 13660 if scp.ExpirationDate != nil { 13661 objectMap["expirationDate"] = scp.ExpirationDate 13662 } 13663 if scp.EndDate != nil { 13664 objectMap["endDate"] = scp.EndDate 13665 } 13666 if scp.NotificationDate != nil { 13667 objectMap["notificationDate"] = scp.NotificationDate 13668 } 13669 if scp.PrimaryKey != nil { 13670 objectMap["primaryKey"] = scp.PrimaryKey 13671 } 13672 if scp.SecondaryKey != nil { 13673 objectMap["secondaryKey"] = scp.SecondaryKey 13674 } 13675 if scp.StateComment != nil { 13676 objectMap["stateComment"] = scp.StateComment 13677 } 13678 if scp.AllowTracing != nil { 13679 objectMap["allowTracing"] = scp.AllowTracing 13680 } 13681 return json.Marshal(objectMap) 13682} 13683 13684// SubscriptionCreateParameterProperties parameters supplied to the Create subscription operation. 13685type SubscriptionCreateParameterProperties struct { 13686 // OwnerID - User (user id path) for whom subscription is being created in form /users/{userId} 13687 OwnerID *string `json:"ownerId,omitempty"` 13688 // Scope - Scope like /products/{productId} or /apis or /apis/{apiId}. 13689 Scope *string `json:"scope,omitempty"` 13690 // DisplayName - Subscription name. 13691 DisplayName *string `json:"displayName,omitempty"` 13692 // PrimaryKey - Primary subscription key. If not specified during request key will be generated automatically. 13693 PrimaryKey *string `json:"primaryKey,omitempty"` 13694 // SecondaryKey - Secondary subscription key. If not specified during request key will be generated automatically. 13695 SecondaryKey *string `json:"secondaryKey,omitempty"` 13696 // 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' 13697 State SubscriptionState `json:"state,omitempty"` 13698 // AllowTracing - Determines whether tracing can be enabled 13699 AllowTracing *bool `json:"allowTracing,omitempty"` 13700} 13701 13702// SubscriptionCreateParameters subscription create details. 13703type SubscriptionCreateParameters struct { 13704 // SubscriptionCreateParameterProperties - Subscription contract properties. 13705 *SubscriptionCreateParameterProperties `json:"properties,omitempty"` 13706} 13707 13708// MarshalJSON is the custom marshaler for SubscriptionCreateParameters. 13709func (scp SubscriptionCreateParameters) MarshalJSON() ([]byte, error) { 13710 objectMap := make(map[string]interface{}) 13711 if scp.SubscriptionCreateParameterProperties != nil { 13712 objectMap["properties"] = scp.SubscriptionCreateParameterProperties 13713 } 13714 return json.Marshal(objectMap) 13715} 13716 13717// UnmarshalJSON is the custom unmarshaler for SubscriptionCreateParameters struct. 13718func (scp *SubscriptionCreateParameters) UnmarshalJSON(body []byte) error { 13719 var m map[string]*json.RawMessage 13720 err := json.Unmarshal(body, &m) 13721 if err != nil { 13722 return err 13723 } 13724 for k, v := range m { 13725 switch k { 13726 case "properties": 13727 if v != nil { 13728 var subscriptionCreateParameterProperties SubscriptionCreateParameterProperties 13729 err = json.Unmarshal(*v, &subscriptionCreateParameterProperties) 13730 if err != nil { 13731 return err 13732 } 13733 scp.SubscriptionCreateParameterProperties = &subscriptionCreateParameterProperties 13734 } 13735 } 13736 } 13737 13738 return nil 13739} 13740 13741// SubscriptionKeyParameterNamesContract subscription key parameter names details. 13742type SubscriptionKeyParameterNamesContract struct { 13743 // Header - Subscription key header name. 13744 Header *string `json:"header,omitempty"` 13745 // Query - Subscription key query string parameter name. 13746 Query *string `json:"query,omitempty"` 13747} 13748 13749// SubscriptionKeysContract subscription keys. 13750type SubscriptionKeysContract struct { 13751 autorest.Response `json:"-"` 13752 // PrimaryKey - Subscription primary key. 13753 PrimaryKey *string `json:"primaryKey,omitempty"` 13754 // SecondaryKey - Subscription secondary key. 13755 SecondaryKey *string `json:"secondaryKey,omitempty"` 13756} 13757 13758// SubscriptionsDelegationSettingsProperties subscriptions delegation settings properties. 13759type SubscriptionsDelegationSettingsProperties struct { 13760 // Enabled - Enable or disable delegation for subscriptions. 13761 Enabled *bool `json:"enabled,omitempty"` 13762} 13763 13764// SubscriptionUpdateParameterProperties parameters supplied to the Update subscription operation. 13765type SubscriptionUpdateParameterProperties struct { 13766 // OwnerID - User identifier path: /users/{userId} 13767 OwnerID *string `json:"ownerId,omitempty"` 13768 // Scope - Scope like /products/{productId} or /apis or /apis/{apiId} 13769 Scope *string `json:"scope,omitempty"` 13770 // 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. 13771 ExpirationDate *date.Time `json:"expirationDate,omitempty"` 13772 // DisplayName - Subscription name. 13773 DisplayName *string `json:"displayName,omitempty"` 13774 // PrimaryKey - Primary subscription key. 13775 PrimaryKey *string `json:"primaryKey,omitempty"` 13776 // SecondaryKey - Secondary subscription key. 13777 SecondaryKey *string `json:"secondaryKey,omitempty"` 13778 // 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' 13779 State SubscriptionState `json:"state,omitempty"` 13780 // StateComment - Comments describing subscription state change by the administrator when the state is changed to the 'rejected'. 13781 StateComment *string `json:"stateComment,omitempty"` 13782 // AllowTracing - Determines whether tracing can be enabled 13783 AllowTracing *bool `json:"allowTracing,omitempty"` 13784} 13785 13786// SubscriptionUpdateParameters subscription update details. 13787type SubscriptionUpdateParameters struct { 13788 // SubscriptionUpdateParameterProperties - Subscription Update contract properties. 13789 *SubscriptionUpdateParameterProperties `json:"properties,omitempty"` 13790} 13791 13792// MarshalJSON is the custom marshaler for SubscriptionUpdateParameters. 13793func (sup SubscriptionUpdateParameters) MarshalJSON() ([]byte, error) { 13794 objectMap := make(map[string]interface{}) 13795 if sup.SubscriptionUpdateParameterProperties != nil { 13796 objectMap["properties"] = sup.SubscriptionUpdateParameterProperties 13797 } 13798 return json.Marshal(objectMap) 13799} 13800 13801// UnmarshalJSON is the custom unmarshaler for SubscriptionUpdateParameters struct. 13802func (sup *SubscriptionUpdateParameters) UnmarshalJSON(body []byte) error { 13803 var m map[string]*json.RawMessage 13804 err := json.Unmarshal(body, &m) 13805 if err != nil { 13806 return err 13807 } 13808 for k, v := range m { 13809 switch k { 13810 case "properties": 13811 if v != nil { 13812 var subscriptionUpdateParameterProperties SubscriptionUpdateParameterProperties 13813 err = json.Unmarshal(*v, &subscriptionUpdateParameterProperties) 13814 if err != nil { 13815 return err 13816 } 13817 sup.SubscriptionUpdateParameterProperties = &subscriptionUpdateParameterProperties 13818 } 13819 } 13820 } 13821 13822 return nil 13823} 13824 13825// TagCollection paged Tag list representation. 13826type TagCollection struct { 13827 autorest.Response `json:"-"` 13828 // Value - Page values. 13829 Value *[]TagContract `json:"value,omitempty"` 13830 // Count - Total record count number across all pages. 13831 Count *int64 `json:"count,omitempty"` 13832 // NextLink - Next page link if any. 13833 NextLink *string `json:"nextLink,omitempty"` 13834} 13835 13836// TagCollectionIterator provides access to a complete listing of TagContract values. 13837type TagCollectionIterator struct { 13838 i int 13839 page TagCollectionPage 13840} 13841 13842// NextWithContext advances to the next value. If there was an error making 13843// the request the iterator does not advance and the error is returned. 13844func (iter *TagCollectionIterator) NextWithContext(ctx context.Context) (err error) { 13845 if tracing.IsEnabled() { 13846 ctx = tracing.StartSpan(ctx, fqdn+"/TagCollectionIterator.NextWithContext") 13847 defer func() { 13848 sc := -1 13849 if iter.Response().Response.Response != nil { 13850 sc = iter.Response().Response.Response.StatusCode 13851 } 13852 tracing.EndSpan(ctx, sc, err) 13853 }() 13854 } 13855 iter.i++ 13856 if iter.i < len(iter.page.Values()) { 13857 return nil 13858 } 13859 err = iter.page.NextWithContext(ctx) 13860 if err != nil { 13861 iter.i-- 13862 return err 13863 } 13864 iter.i = 0 13865 return nil 13866} 13867 13868// Next advances to the next value. If there was an error making 13869// the request the iterator does not advance and the error is returned. 13870// Deprecated: Use NextWithContext() instead. 13871func (iter *TagCollectionIterator) Next() error { 13872 return iter.NextWithContext(context.Background()) 13873} 13874 13875// NotDone returns true if the enumeration should be started or is not yet complete. 13876func (iter TagCollectionIterator) NotDone() bool { 13877 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 13878} 13879 13880// Response returns the raw server response from the last page request. 13881func (iter TagCollectionIterator) Response() TagCollection { 13882 return iter.page.Response() 13883} 13884 13885// Value returns the current value or a zero-initialized value if the 13886// iterator has advanced beyond the end of the collection. 13887func (iter TagCollectionIterator) Value() TagContract { 13888 if !iter.page.NotDone() { 13889 return TagContract{} 13890 } 13891 return iter.page.Values()[iter.i] 13892} 13893 13894// Creates a new instance of the TagCollectionIterator type. 13895func NewTagCollectionIterator(page TagCollectionPage) TagCollectionIterator { 13896 return TagCollectionIterator{page: page} 13897} 13898 13899// IsEmpty returns true if the ListResult contains no values. 13900func (tc TagCollection) IsEmpty() bool { 13901 return tc.Value == nil || len(*tc.Value) == 0 13902} 13903 13904// hasNextLink returns true if the NextLink is not empty. 13905func (tc TagCollection) hasNextLink() bool { 13906 return tc.NextLink != nil && len(*tc.NextLink) != 0 13907} 13908 13909// tagCollectionPreparer prepares a request to retrieve the next set of results. 13910// It returns nil if no more results exist. 13911func (tc TagCollection) tagCollectionPreparer(ctx context.Context) (*http.Request, error) { 13912 if !tc.hasNextLink() { 13913 return nil, nil 13914 } 13915 return autorest.Prepare((&http.Request{}).WithContext(ctx), 13916 autorest.AsJSON(), 13917 autorest.AsGet(), 13918 autorest.WithBaseURL(to.String(tc.NextLink))) 13919} 13920 13921// TagCollectionPage contains a page of TagContract values. 13922type TagCollectionPage struct { 13923 fn func(context.Context, TagCollection) (TagCollection, error) 13924 tc TagCollection 13925} 13926 13927// NextWithContext advances to the next page of values. If there was an error making 13928// the request the page does not advance and the error is returned. 13929func (page *TagCollectionPage) NextWithContext(ctx context.Context) (err error) { 13930 if tracing.IsEnabled() { 13931 ctx = tracing.StartSpan(ctx, fqdn+"/TagCollectionPage.NextWithContext") 13932 defer func() { 13933 sc := -1 13934 if page.Response().Response.Response != nil { 13935 sc = page.Response().Response.Response.StatusCode 13936 } 13937 tracing.EndSpan(ctx, sc, err) 13938 }() 13939 } 13940 for { 13941 next, err := page.fn(ctx, page.tc) 13942 if err != nil { 13943 return err 13944 } 13945 page.tc = next 13946 if !next.hasNextLink() || !next.IsEmpty() { 13947 break 13948 } 13949 } 13950 return nil 13951} 13952 13953// Next advances to the next page of values. If there was an error making 13954// the request the page does not advance and the error is returned. 13955// Deprecated: Use NextWithContext() instead. 13956func (page *TagCollectionPage) Next() error { 13957 return page.NextWithContext(context.Background()) 13958} 13959 13960// NotDone returns true if the page enumeration should be started or is not yet complete. 13961func (page TagCollectionPage) NotDone() bool { 13962 return !page.tc.IsEmpty() 13963} 13964 13965// Response returns the raw server response from the last page request. 13966func (page TagCollectionPage) Response() TagCollection { 13967 return page.tc 13968} 13969 13970// Values returns the slice of values for the current page or nil if there are no values. 13971func (page TagCollectionPage) Values() []TagContract { 13972 if page.tc.IsEmpty() { 13973 return nil 13974 } 13975 return *page.tc.Value 13976} 13977 13978// Creates a new instance of the TagCollectionPage type. 13979func NewTagCollectionPage(cur TagCollection, getNextPage func(context.Context, TagCollection) (TagCollection, error)) TagCollectionPage { 13980 return TagCollectionPage{ 13981 fn: getNextPage, 13982 tc: cur, 13983 } 13984} 13985 13986// TagContract tag Contract details. 13987type TagContract struct { 13988 autorest.Response `json:"-"` 13989 // TagContractProperties - Tag entity contract properties. 13990 *TagContractProperties `json:"properties,omitempty"` 13991 // ID - READ-ONLY; Resource ID. 13992 ID *string `json:"id,omitempty"` 13993 // Name - READ-ONLY; Resource name. 13994 Name *string `json:"name,omitempty"` 13995 // Type - READ-ONLY; Resource type for API Management resource. 13996 Type *string `json:"type,omitempty"` 13997} 13998 13999// MarshalJSON is the custom marshaler for TagContract. 14000func (tc TagContract) MarshalJSON() ([]byte, error) { 14001 objectMap := make(map[string]interface{}) 14002 if tc.TagContractProperties != nil { 14003 objectMap["properties"] = tc.TagContractProperties 14004 } 14005 return json.Marshal(objectMap) 14006} 14007 14008// UnmarshalJSON is the custom unmarshaler for TagContract struct. 14009func (tc *TagContract) UnmarshalJSON(body []byte) error { 14010 var m map[string]*json.RawMessage 14011 err := json.Unmarshal(body, &m) 14012 if err != nil { 14013 return err 14014 } 14015 for k, v := range m { 14016 switch k { 14017 case "properties": 14018 if v != nil { 14019 var tagContractProperties TagContractProperties 14020 err = json.Unmarshal(*v, &tagContractProperties) 14021 if err != nil { 14022 return err 14023 } 14024 tc.TagContractProperties = &tagContractProperties 14025 } 14026 case "id": 14027 if v != nil { 14028 var ID string 14029 err = json.Unmarshal(*v, &ID) 14030 if err != nil { 14031 return err 14032 } 14033 tc.ID = &ID 14034 } 14035 case "name": 14036 if v != nil { 14037 var name string 14038 err = json.Unmarshal(*v, &name) 14039 if err != nil { 14040 return err 14041 } 14042 tc.Name = &name 14043 } 14044 case "type": 14045 if v != nil { 14046 var typeVar string 14047 err = json.Unmarshal(*v, &typeVar) 14048 if err != nil { 14049 return err 14050 } 14051 tc.Type = &typeVar 14052 } 14053 } 14054 } 14055 14056 return nil 14057} 14058 14059// TagContractProperties tag contract Properties. 14060type TagContractProperties struct { 14061 // DisplayName - Tag name. 14062 DisplayName *string `json:"displayName,omitempty"` 14063} 14064 14065// TagCreateUpdateParameters parameters supplied to Create/Update Tag operations. 14066type TagCreateUpdateParameters struct { 14067 // TagContractProperties - Properties supplied to Create Tag operation. 14068 *TagContractProperties `json:"properties,omitempty"` 14069} 14070 14071// MarshalJSON is the custom marshaler for TagCreateUpdateParameters. 14072func (tcup TagCreateUpdateParameters) MarshalJSON() ([]byte, error) { 14073 objectMap := make(map[string]interface{}) 14074 if tcup.TagContractProperties != nil { 14075 objectMap["properties"] = tcup.TagContractProperties 14076 } 14077 return json.Marshal(objectMap) 14078} 14079 14080// UnmarshalJSON is the custom unmarshaler for TagCreateUpdateParameters struct. 14081func (tcup *TagCreateUpdateParameters) UnmarshalJSON(body []byte) error { 14082 var m map[string]*json.RawMessage 14083 err := json.Unmarshal(body, &m) 14084 if err != nil { 14085 return err 14086 } 14087 for k, v := range m { 14088 switch k { 14089 case "properties": 14090 if v != nil { 14091 var tagContractProperties TagContractProperties 14092 err = json.Unmarshal(*v, &tagContractProperties) 14093 if err != nil { 14094 return err 14095 } 14096 tcup.TagContractProperties = &tagContractProperties 14097 } 14098 } 14099 } 14100 14101 return nil 14102} 14103 14104// TagDescriptionBaseProperties parameters supplied to the Create TagDescription operation. 14105type TagDescriptionBaseProperties struct { 14106 // Description - Description of the Tag. 14107 Description *string `json:"description,omitempty"` 14108 // ExternalDocsURL - Absolute URL of external resources describing the tag. 14109 ExternalDocsURL *string `json:"externalDocsUrl,omitempty"` 14110 // ExternalDocsDescription - Description of the external resources describing the tag. 14111 ExternalDocsDescription *string `json:"externalDocsDescription,omitempty"` 14112} 14113 14114// TagDescriptionCollection paged TagDescription list representation. 14115type TagDescriptionCollection struct { 14116 autorest.Response `json:"-"` 14117 // Value - Page values. 14118 Value *[]TagDescriptionContract `json:"value,omitempty"` 14119 // Count - Total record count number across all pages. 14120 Count *int64 `json:"count,omitempty"` 14121 // NextLink - Next page link if any. 14122 NextLink *string `json:"nextLink,omitempty"` 14123} 14124 14125// TagDescriptionCollectionIterator provides access to a complete listing of TagDescriptionContract values. 14126type TagDescriptionCollectionIterator struct { 14127 i int 14128 page TagDescriptionCollectionPage 14129} 14130 14131// NextWithContext advances to the next value. If there was an error making 14132// the request the iterator does not advance and the error is returned. 14133func (iter *TagDescriptionCollectionIterator) NextWithContext(ctx context.Context) (err error) { 14134 if tracing.IsEnabled() { 14135 ctx = tracing.StartSpan(ctx, fqdn+"/TagDescriptionCollectionIterator.NextWithContext") 14136 defer func() { 14137 sc := -1 14138 if iter.Response().Response.Response != nil { 14139 sc = iter.Response().Response.Response.StatusCode 14140 } 14141 tracing.EndSpan(ctx, sc, err) 14142 }() 14143 } 14144 iter.i++ 14145 if iter.i < len(iter.page.Values()) { 14146 return nil 14147 } 14148 err = iter.page.NextWithContext(ctx) 14149 if err != nil { 14150 iter.i-- 14151 return err 14152 } 14153 iter.i = 0 14154 return nil 14155} 14156 14157// Next advances to the next value. If there was an error making 14158// the request the iterator does not advance and the error is returned. 14159// Deprecated: Use NextWithContext() instead. 14160func (iter *TagDescriptionCollectionIterator) Next() error { 14161 return iter.NextWithContext(context.Background()) 14162} 14163 14164// NotDone returns true if the enumeration should be started or is not yet complete. 14165func (iter TagDescriptionCollectionIterator) NotDone() bool { 14166 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 14167} 14168 14169// Response returns the raw server response from the last page request. 14170func (iter TagDescriptionCollectionIterator) Response() TagDescriptionCollection { 14171 return iter.page.Response() 14172} 14173 14174// Value returns the current value or a zero-initialized value if the 14175// iterator has advanced beyond the end of the collection. 14176func (iter TagDescriptionCollectionIterator) Value() TagDescriptionContract { 14177 if !iter.page.NotDone() { 14178 return TagDescriptionContract{} 14179 } 14180 return iter.page.Values()[iter.i] 14181} 14182 14183// Creates a new instance of the TagDescriptionCollectionIterator type. 14184func NewTagDescriptionCollectionIterator(page TagDescriptionCollectionPage) TagDescriptionCollectionIterator { 14185 return TagDescriptionCollectionIterator{page: page} 14186} 14187 14188// IsEmpty returns true if the ListResult contains no values. 14189func (tdc TagDescriptionCollection) IsEmpty() bool { 14190 return tdc.Value == nil || len(*tdc.Value) == 0 14191} 14192 14193// hasNextLink returns true if the NextLink is not empty. 14194func (tdc TagDescriptionCollection) hasNextLink() bool { 14195 return tdc.NextLink != nil && len(*tdc.NextLink) != 0 14196} 14197 14198// tagDescriptionCollectionPreparer prepares a request to retrieve the next set of results. 14199// It returns nil if no more results exist. 14200func (tdc TagDescriptionCollection) tagDescriptionCollectionPreparer(ctx context.Context) (*http.Request, error) { 14201 if !tdc.hasNextLink() { 14202 return nil, nil 14203 } 14204 return autorest.Prepare((&http.Request{}).WithContext(ctx), 14205 autorest.AsJSON(), 14206 autorest.AsGet(), 14207 autorest.WithBaseURL(to.String(tdc.NextLink))) 14208} 14209 14210// TagDescriptionCollectionPage contains a page of TagDescriptionContract values. 14211type TagDescriptionCollectionPage struct { 14212 fn func(context.Context, TagDescriptionCollection) (TagDescriptionCollection, error) 14213 tdc TagDescriptionCollection 14214} 14215 14216// NextWithContext advances to the next page of values. If there was an error making 14217// the request the page does not advance and the error is returned. 14218func (page *TagDescriptionCollectionPage) NextWithContext(ctx context.Context) (err error) { 14219 if tracing.IsEnabled() { 14220 ctx = tracing.StartSpan(ctx, fqdn+"/TagDescriptionCollectionPage.NextWithContext") 14221 defer func() { 14222 sc := -1 14223 if page.Response().Response.Response != nil { 14224 sc = page.Response().Response.Response.StatusCode 14225 } 14226 tracing.EndSpan(ctx, sc, err) 14227 }() 14228 } 14229 for { 14230 next, err := page.fn(ctx, page.tdc) 14231 if err != nil { 14232 return err 14233 } 14234 page.tdc = next 14235 if !next.hasNextLink() || !next.IsEmpty() { 14236 break 14237 } 14238 } 14239 return nil 14240} 14241 14242// Next advances to the next page of values. If there was an error making 14243// the request the page does not advance and the error is returned. 14244// Deprecated: Use NextWithContext() instead. 14245func (page *TagDescriptionCollectionPage) Next() error { 14246 return page.NextWithContext(context.Background()) 14247} 14248 14249// NotDone returns true if the page enumeration should be started or is not yet complete. 14250func (page TagDescriptionCollectionPage) NotDone() bool { 14251 return !page.tdc.IsEmpty() 14252} 14253 14254// Response returns the raw server response from the last page request. 14255func (page TagDescriptionCollectionPage) Response() TagDescriptionCollection { 14256 return page.tdc 14257} 14258 14259// Values returns the slice of values for the current page or nil if there are no values. 14260func (page TagDescriptionCollectionPage) Values() []TagDescriptionContract { 14261 if page.tdc.IsEmpty() { 14262 return nil 14263 } 14264 return *page.tdc.Value 14265} 14266 14267// Creates a new instance of the TagDescriptionCollectionPage type. 14268func NewTagDescriptionCollectionPage(cur TagDescriptionCollection, getNextPage func(context.Context, TagDescriptionCollection) (TagDescriptionCollection, error)) TagDescriptionCollectionPage { 14269 return TagDescriptionCollectionPage{ 14270 fn: getNextPage, 14271 tdc: cur, 14272 } 14273} 14274 14275// TagDescriptionContract contract details. 14276type TagDescriptionContract struct { 14277 autorest.Response `json:"-"` 14278 // TagDescriptionContractProperties - TagDescription entity contract properties. 14279 *TagDescriptionContractProperties `json:"properties,omitempty"` 14280 // ID - READ-ONLY; Resource ID. 14281 ID *string `json:"id,omitempty"` 14282 // Name - READ-ONLY; Resource name. 14283 Name *string `json:"name,omitempty"` 14284 // Type - READ-ONLY; Resource type for API Management resource. 14285 Type *string `json:"type,omitempty"` 14286} 14287 14288// MarshalJSON is the custom marshaler for TagDescriptionContract. 14289func (tdc TagDescriptionContract) MarshalJSON() ([]byte, error) { 14290 objectMap := make(map[string]interface{}) 14291 if tdc.TagDescriptionContractProperties != nil { 14292 objectMap["properties"] = tdc.TagDescriptionContractProperties 14293 } 14294 return json.Marshal(objectMap) 14295} 14296 14297// UnmarshalJSON is the custom unmarshaler for TagDescriptionContract struct. 14298func (tdc *TagDescriptionContract) UnmarshalJSON(body []byte) error { 14299 var m map[string]*json.RawMessage 14300 err := json.Unmarshal(body, &m) 14301 if err != nil { 14302 return err 14303 } 14304 for k, v := range m { 14305 switch k { 14306 case "properties": 14307 if v != nil { 14308 var tagDescriptionContractProperties TagDescriptionContractProperties 14309 err = json.Unmarshal(*v, &tagDescriptionContractProperties) 14310 if err != nil { 14311 return err 14312 } 14313 tdc.TagDescriptionContractProperties = &tagDescriptionContractProperties 14314 } 14315 case "id": 14316 if v != nil { 14317 var ID string 14318 err = json.Unmarshal(*v, &ID) 14319 if err != nil { 14320 return err 14321 } 14322 tdc.ID = &ID 14323 } 14324 case "name": 14325 if v != nil { 14326 var name string 14327 err = json.Unmarshal(*v, &name) 14328 if err != nil { 14329 return err 14330 } 14331 tdc.Name = &name 14332 } 14333 case "type": 14334 if v != nil { 14335 var typeVar string 14336 err = json.Unmarshal(*v, &typeVar) 14337 if err != nil { 14338 return err 14339 } 14340 tdc.Type = &typeVar 14341 } 14342 } 14343 } 14344 14345 return nil 14346} 14347 14348// TagDescriptionContractProperties tagDescription contract Properties. 14349type TagDescriptionContractProperties struct { 14350 // TagID - Identifier of the tag in the form of /tags/{tagId} 14351 TagID *string `json:"tagId,omitempty"` 14352 // DisplayName - Tag name. 14353 DisplayName *string `json:"displayName,omitempty"` 14354 // Description - Description of the Tag. 14355 Description *string `json:"description,omitempty"` 14356 // ExternalDocsURL - Absolute URL of external resources describing the tag. 14357 ExternalDocsURL *string `json:"externalDocsUrl,omitempty"` 14358 // ExternalDocsDescription - Description of the external resources describing the tag. 14359 ExternalDocsDescription *string `json:"externalDocsDescription,omitempty"` 14360} 14361 14362// TagDescriptionCreateParameters parameters supplied to the Create TagDescription operation. 14363type TagDescriptionCreateParameters struct { 14364 // TagDescriptionBaseProperties - Properties supplied to Create TagDescription operation. 14365 *TagDescriptionBaseProperties `json:"properties,omitempty"` 14366} 14367 14368// MarshalJSON is the custom marshaler for TagDescriptionCreateParameters. 14369func (tdcp TagDescriptionCreateParameters) MarshalJSON() ([]byte, error) { 14370 objectMap := make(map[string]interface{}) 14371 if tdcp.TagDescriptionBaseProperties != nil { 14372 objectMap["properties"] = tdcp.TagDescriptionBaseProperties 14373 } 14374 return json.Marshal(objectMap) 14375} 14376 14377// UnmarshalJSON is the custom unmarshaler for TagDescriptionCreateParameters struct. 14378func (tdcp *TagDescriptionCreateParameters) UnmarshalJSON(body []byte) error { 14379 var m map[string]*json.RawMessage 14380 err := json.Unmarshal(body, &m) 14381 if err != nil { 14382 return err 14383 } 14384 for k, v := range m { 14385 switch k { 14386 case "properties": 14387 if v != nil { 14388 var tagDescriptionBaseProperties TagDescriptionBaseProperties 14389 err = json.Unmarshal(*v, &tagDescriptionBaseProperties) 14390 if err != nil { 14391 return err 14392 } 14393 tdcp.TagDescriptionBaseProperties = &tagDescriptionBaseProperties 14394 } 14395 } 14396 } 14397 14398 return nil 14399} 14400 14401// TagResourceCollection paged Tag list representation. 14402type TagResourceCollection struct { 14403 autorest.Response `json:"-"` 14404 // Value - Page values. 14405 Value *[]TagResourceContract `json:"value,omitempty"` 14406 // Count - Total record count number across all pages. 14407 Count *int64 `json:"count,omitempty"` 14408 // NextLink - Next page link if any. 14409 NextLink *string `json:"nextLink,omitempty"` 14410} 14411 14412// TagResourceCollectionIterator provides access to a complete listing of TagResourceContract values. 14413type TagResourceCollectionIterator struct { 14414 i int 14415 page TagResourceCollectionPage 14416} 14417 14418// NextWithContext advances to the next value. If there was an error making 14419// the request the iterator does not advance and the error is returned. 14420func (iter *TagResourceCollectionIterator) NextWithContext(ctx context.Context) (err error) { 14421 if tracing.IsEnabled() { 14422 ctx = tracing.StartSpan(ctx, fqdn+"/TagResourceCollectionIterator.NextWithContext") 14423 defer func() { 14424 sc := -1 14425 if iter.Response().Response.Response != nil { 14426 sc = iter.Response().Response.Response.StatusCode 14427 } 14428 tracing.EndSpan(ctx, sc, err) 14429 }() 14430 } 14431 iter.i++ 14432 if iter.i < len(iter.page.Values()) { 14433 return nil 14434 } 14435 err = iter.page.NextWithContext(ctx) 14436 if err != nil { 14437 iter.i-- 14438 return err 14439 } 14440 iter.i = 0 14441 return nil 14442} 14443 14444// Next advances to the next value. If there was an error making 14445// the request the iterator does not advance and the error is returned. 14446// Deprecated: Use NextWithContext() instead. 14447func (iter *TagResourceCollectionIterator) Next() error { 14448 return iter.NextWithContext(context.Background()) 14449} 14450 14451// NotDone returns true if the enumeration should be started or is not yet complete. 14452func (iter TagResourceCollectionIterator) NotDone() bool { 14453 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 14454} 14455 14456// Response returns the raw server response from the last page request. 14457func (iter TagResourceCollectionIterator) Response() TagResourceCollection { 14458 return iter.page.Response() 14459} 14460 14461// Value returns the current value or a zero-initialized value if the 14462// iterator has advanced beyond the end of the collection. 14463func (iter TagResourceCollectionIterator) Value() TagResourceContract { 14464 if !iter.page.NotDone() { 14465 return TagResourceContract{} 14466 } 14467 return iter.page.Values()[iter.i] 14468} 14469 14470// Creates a new instance of the TagResourceCollectionIterator type. 14471func NewTagResourceCollectionIterator(page TagResourceCollectionPage) TagResourceCollectionIterator { 14472 return TagResourceCollectionIterator{page: page} 14473} 14474 14475// IsEmpty returns true if the ListResult contains no values. 14476func (trc TagResourceCollection) IsEmpty() bool { 14477 return trc.Value == nil || len(*trc.Value) == 0 14478} 14479 14480// hasNextLink returns true if the NextLink is not empty. 14481func (trc TagResourceCollection) hasNextLink() bool { 14482 return trc.NextLink != nil && len(*trc.NextLink) != 0 14483} 14484 14485// tagResourceCollectionPreparer prepares a request to retrieve the next set of results. 14486// It returns nil if no more results exist. 14487func (trc TagResourceCollection) tagResourceCollectionPreparer(ctx context.Context) (*http.Request, error) { 14488 if !trc.hasNextLink() { 14489 return nil, nil 14490 } 14491 return autorest.Prepare((&http.Request{}).WithContext(ctx), 14492 autorest.AsJSON(), 14493 autorest.AsGet(), 14494 autorest.WithBaseURL(to.String(trc.NextLink))) 14495} 14496 14497// TagResourceCollectionPage contains a page of TagResourceContract values. 14498type TagResourceCollectionPage struct { 14499 fn func(context.Context, TagResourceCollection) (TagResourceCollection, error) 14500 trc TagResourceCollection 14501} 14502 14503// NextWithContext advances to the next page of values. If there was an error making 14504// the request the page does not advance and the error is returned. 14505func (page *TagResourceCollectionPage) NextWithContext(ctx context.Context) (err error) { 14506 if tracing.IsEnabled() { 14507 ctx = tracing.StartSpan(ctx, fqdn+"/TagResourceCollectionPage.NextWithContext") 14508 defer func() { 14509 sc := -1 14510 if page.Response().Response.Response != nil { 14511 sc = page.Response().Response.Response.StatusCode 14512 } 14513 tracing.EndSpan(ctx, sc, err) 14514 }() 14515 } 14516 for { 14517 next, err := page.fn(ctx, page.trc) 14518 if err != nil { 14519 return err 14520 } 14521 page.trc = next 14522 if !next.hasNextLink() || !next.IsEmpty() { 14523 break 14524 } 14525 } 14526 return nil 14527} 14528 14529// Next advances to the next page of values. If there was an error making 14530// the request the page does not advance and the error is returned. 14531// Deprecated: Use NextWithContext() instead. 14532func (page *TagResourceCollectionPage) Next() error { 14533 return page.NextWithContext(context.Background()) 14534} 14535 14536// NotDone returns true if the page enumeration should be started or is not yet complete. 14537func (page TagResourceCollectionPage) NotDone() bool { 14538 return !page.trc.IsEmpty() 14539} 14540 14541// Response returns the raw server response from the last page request. 14542func (page TagResourceCollectionPage) Response() TagResourceCollection { 14543 return page.trc 14544} 14545 14546// Values returns the slice of values for the current page or nil if there are no values. 14547func (page TagResourceCollectionPage) Values() []TagResourceContract { 14548 if page.trc.IsEmpty() { 14549 return nil 14550 } 14551 return *page.trc.Value 14552} 14553 14554// Creates a new instance of the TagResourceCollectionPage type. 14555func NewTagResourceCollectionPage(cur TagResourceCollection, getNextPage func(context.Context, TagResourceCollection) (TagResourceCollection, error)) TagResourceCollectionPage { 14556 return TagResourceCollectionPage{ 14557 fn: getNextPage, 14558 trc: cur, 14559 } 14560} 14561 14562// TagResourceContract tagResource contract properties. 14563type TagResourceContract struct { 14564 // Tag - Tag associated with the resource. 14565 Tag *TagTagResourceContractProperties `json:"tag,omitempty"` 14566 // API - Api associated with the tag. 14567 API *APITagResourceContractProperties `json:"api,omitempty"` 14568 // Operation - Operation associated with the tag. 14569 Operation *OperationTagResourceContractProperties `json:"operation,omitempty"` 14570 // Product - Product associated with the tag. 14571 Product *ProductTagResourceContractProperties `json:"product,omitempty"` 14572} 14573 14574// TagTagResourceContractProperties contract defining the Tag property in the Tag Resource Contract 14575type TagTagResourceContractProperties struct { 14576 // ID - Tag identifier 14577 ID *string `json:"id,omitempty"` 14578 // Name - Tag Name 14579 Name *string `json:"name,omitempty"` 14580} 14581 14582// TenantConfigurationDeployFuture an abstraction for monitoring and retrieving the results of a 14583// long-running operation. 14584type TenantConfigurationDeployFuture struct { 14585 azure.FutureAPI 14586 // Result returns the result of the asynchronous operation. 14587 // If the operation has not completed it will return an error. 14588 Result func(TenantConfigurationClient) (OperationResultContract, error) 14589} 14590 14591// TenantConfigurationSaveFuture an abstraction for monitoring and retrieving the results of a long-running 14592// operation. 14593type TenantConfigurationSaveFuture struct { 14594 azure.FutureAPI 14595 // Result returns the result of the asynchronous operation. 14596 // If the operation has not completed it will return an error. 14597 Result func(TenantConfigurationClient) (OperationResultContract, error) 14598} 14599 14600// TenantConfigurationSyncStateContract tenant Configuration Synchronization State. 14601type TenantConfigurationSyncStateContract struct { 14602 autorest.Response `json:"-"` 14603 // Branch - The name of Git branch. 14604 Branch *string `json:"branch,omitempty"` 14605 // CommitID - The latest commit Id. 14606 CommitID *string `json:"commitId,omitempty"` 14607 // IsExport - value indicating if last sync was save (true) or deploy (false) operation. 14608 IsExport *bool `json:"isExport,omitempty"` 14609 // IsSynced - value indicating if last synchronization was later than the configuration change. 14610 IsSynced *bool `json:"isSynced,omitempty"` 14611 // IsGitEnabled - value indicating whether Git configuration access is enabled. 14612 IsGitEnabled *bool `json:"isGitEnabled,omitempty"` 14613 // 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. 14614 SyncDate *date.Time `json:"syncDate,omitempty"` 14615 // 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. 14616 ConfigurationChangeDate *date.Time `json:"configurationChangeDate,omitempty"` 14617} 14618 14619// TenantConfigurationValidateFuture an abstraction for monitoring and retrieving the results of a 14620// long-running operation. 14621type TenantConfigurationValidateFuture struct { 14622 azure.FutureAPI 14623 // Result returns the result of the asynchronous operation. 14624 // If the operation has not completed it will return an error. 14625 Result func(TenantConfigurationClient) (OperationResultContract, error) 14626} 14627 14628// TenantSettingsCollection paged AccessInformation list representation. 14629type TenantSettingsCollection struct { 14630 autorest.Response `json:"-"` 14631 // Value - READ-ONLY; Page values. 14632 Value *[]TenantSettingsContract `json:"value,omitempty"` 14633 // NextLink - READ-ONLY; Next page link if any. 14634 NextLink *string `json:"nextLink,omitempty"` 14635} 14636 14637// TenantSettingsCollectionIterator provides access to a complete listing of TenantSettingsContract values. 14638type TenantSettingsCollectionIterator struct { 14639 i int 14640 page TenantSettingsCollectionPage 14641} 14642 14643// NextWithContext advances to the next value. If there was an error making 14644// the request the iterator does not advance and the error is returned. 14645func (iter *TenantSettingsCollectionIterator) NextWithContext(ctx context.Context) (err error) { 14646 if tracing.IsEnabled() { 14647 ctx = tracing.StartSpan(ctx, fqdn+"/TenantSettingsCollectionIterator.NextWithContext") 14648 defer func() { 14649 sc := -1 14650 if iter.Response().Response.Response != nil { 14651 sc = iter.Response().Response.Response.StatusCode 14652 } 14653 tracing.EndSpan(ctx, sc, err) 14654 }() 14655 } 14656 iter.i++ 14657 if iter.i < len(iter.page.Values()) { 14658 return nil 14659 } 14660 err = iter.page.NextWithContext(ctx) 14661 if err != nil { 14662 iter.i-- 14663 return err 14664 } 14665 iter.i = 0 14666 return nil 14667} 14668 14669// Next advances to the next value. If there was an error making 14670// the request the iterator does not advance and the error is returned. 14671// Deprecated: Use NextWithContext() instead. 14672func (iter *TenantSettingsCollectionIterator) Next() error { 14673 return iter.NextWithContext(context.Background()) 14674} 14675 14676// NotDone returns true if the enumeration should be started or is not yet complete. 14677func (iter TenantSettingsCollectionIterator) NotDone() bool { 14678 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 14679} 14680 14681// Response returns the raw server response from the last page request. 14682func (iter TenantSettingsCollectionIterator) Response() TenantSettingsCollection { 14683 return iter.page.Response() 14684} 14685 14686// Value returns the current value or a zero-initialized value if the 14687// iterator has advanced beyond the end of the collection. 14688func (iter TenantSettingsCollectionIterator) Value() TenantSettingsContract { 14689 if !iter.page.NotDone() { 14690 return TenantSettingsContract{} 14691 } 14692 return iter.page.Values()[iter.i] 14693} 14694 14695// Creates a new instance of the TenantSettingsCollectionIterator type. 14696func NewTenantSettingsCollectionIterator(page TenantSettingsCollectionPage) TenantSettingsCollectionIterator { 14697 return TenantSettingsCollectionIterator{page: page} 14698} 14699 14700// IsEmpty returns true if the ListResult contains no values. 14701func (tsc TenantSettingsCollection) IsEmpty() bool { 14702 return tsc.Value == nil || len(*tsc.Value) == 0 14703} 14704 14705// hasNextLink returns true if the NextLink is not empty. 14706func (tsc TenantSettingsCollection) hasNextLink() bool { 14707 return tsc.NextLink != nil && len(*tsc.NextLink) != 0 14708} 14709 14710// tenantSettingsCollectionPreparer prepares a request to retrieve the next set of results. 14711// It returns nil if no more results exist. 14712func (tsc TenantSettingsCollection) tenantSettingsCollectionPreparer(ctx context.Context) (*http.Request, error) { 14713 if !tsc.hasNextLink() { 14714 return nil, nil 14715 } 14716 return autorest.Prepare((&http.Request{}).WithContext(ctx), 14717 autorest.AsJSON(), 14718 autorest.AsGet(), 14719 autorest.WithBaseURL(to.String(tsc.NextLink))) 14720} 14721 14722// TenantSettingsCollectionPage contains a page of TenantSettingsContract values. 14723type TenantSettingsCollectionPage struct { 14724 fn func(context.Context, TenantSettingsCollection) (TenantSettingsCollection, error) 14725 tsc TenantSettingsCollection 14726} 14727 14728// NextWithContext advances to the next page of values. If there was an error making 14729// the request the page does not advance and the error is returned. 14730func (page *TenantSettingsCollectionPage) NextWithContext(ctx context.Context) (err error) { 14731 if tracing.IsEnabled() { 14732 ctx = tracing.StartSpan(ctx, fqdn+"/TenantSettingsCollectionPage.NextWithContext") 14733 defer func() { 14734 sc := -1 14735 if page.Response().Response.Response != nil { 14736 sc = page.Response().Response.Response.StatusCode 14737 } 14738 tracing.EndSpan(ctx, sc, err) 14739 }() 14740 } 14741 for { 14742 next, err := page.fn(ctx, page.tsc) 14743 if err != nil { 14744 return err 14745 } 14746 page.tsc = next 14747 if !next.hasNextLink() || !next.IsEmpty() { 14748 break 14749 } 14750 } 14751 return nil 14752} 14753 14754// Next advances to the next page of values. If there was an error making 14755// the request the page does not advance and the error is returned. 14756// Deprecated: Use NextWithContext() instead. 14757func (page *TenantSettingsCollectionPage) Next() error { 14758 return page.NextWithContext(context.Background()) 14759} 14760 14761// NotDone returns true if the page enumeration should be started or is not yet complete. 14762func (page TenantSettingsCollectionPage) NotDone() bool { 14763 return !page.tsc.IsEmpty() 14764} 14765 14766// Response returns the raw server response from the last page request. 14767func (page TenantSettingsCollectionPage) Response() TenantSettingsCollection { 14768 return page.tsc 14769} 14770 14771// Values returns the slice of values for the current page or nil if there are no values. 14772func (page TenantSettingsCollectionPage) Values() []TenantSettingsContract { 14773 if page.tsc.IsEmpty() { 14774 return nil 14775 } 14776 return *page.tsc.Value 14777} 14778 14779// Creates a new instance of the TenantSettingsCollectionPage type. 14780func NewTenantSettingsCollectionPage(cur TenantSettingsCollection, getNextPage func(context.Context, TenantSettingsCollection) (TenantSettingsCollection, error)) TenantSettingsCollectionPage { 14781 return TenantSettingsCollectionPage{ 14782 fn: getNextPage, 14783 tsc: cur, 14784 } 14785} 14786 14787// TenantSettingsContract tenant Settings. 14788type TenantSettingsContract struct { 14789 autorest.Response `json:"-"` 14790 // TenantSettingsContractProperties - TenantSettings entity contract properties. 14791 *TenantSettingsContractProperties `json:"properties,omitempty"` 14792 // ID - READ-ONLY; Resource ID. 14793 ID *string `json:"id,omitempty"` 14794 // Name - READ-ONLY; Resource name. 14795 Name *string `json:"name,omitempty"` 14796 // Type - READ-ONLY; Resource type for API Management resource. 14797 Type *string `json:"type,omitempty"` 14798} 14799 14800// MarshalJSON is the custom marshaler for TenantSettingsContract. 14801func (tsc TenantSettingsContract) MarshalJSON() ([]byte, error) { 14802 objectMap := make(map[string]interface{}) 14803 if tsc.TenantSettingsContractProperties != nil { 14804 objectMap["properties"] = tsc.TenantSettingsContractProperties 14805 } 14806 return json.Marshal(objectMap) 14807} 14808 14809// UnmarshalJSON is the custom unmarshaler for TenantSettingsContract struct. 14810func (tsc *TenantSettingsContract) UnmarshalJSON(body []byte) error { 14811 var m map[string]*json.RawMessage 14812 err := json.Unmarshal(body, &m) 14813 if err != nil { 14814 return err 14815 } 14816 for k, v := range m { 14817 switch k { 14818 case "properties": 14819 if v != nil { 14820 var tenantSettingsContractProperties TenantSettingsContractProperties 14821 err = json.Unmarshal(*v, &tenantSettingsContractProperties) 14822 if err != nil { 14823 return err 14824 } 14825 tsc.TenantSettingsContractProperties = &tenantSettingsContractProperties 14826 } 14827 case "id": 14828 if v != nil { 14829 var ID string 14830 err = json.Unmarshal(*v, &ID) 14831 if err != nil { 14832 return err 14833 } 14834 tsc.ID = &ID 14835 } 14836 case "name": 14837 if v != nil { 14838 var name string 14839 err = json.Unmarshal(*v, &name) 14840 if err != nil { 14841 return err 14842 } 14843 tsc.Name = &name 14844 } 14845 case "type": 14846 if v != nil { 14847 var typeVar string 14848 err = json.Unmarshal(*v, &typeVar) 14849 if err != nil { 14850 return err 14851 } 14852 tsc.Type = &typeVar 14853 } 14854 } 14855 } 14856 14857 return nil 14858} 14859 14860// TenantSettingsContractProperties tenant access information contract of the API Management service. 14861type TenantSettingsContractProperties struct { 14862 // Settings - Tenant settings 14863 Settings map[string]*string `json:"settings"` 14864} 14865 14866// MarshalJSON is the custom marshaler for TenantSettingsContractProperties. 14867func (tscp TenantSettingsContractProperties) MarshalJSON() ([]byte, error) { 14868 objectMap := make(map[string]interface{}) 14869 if tscp.Settings != nil { 14870 objectMap["settings"] = tscp.Settings 14871 } 14872 return json.Marshal(objectMap) 14873} 14874 14875// TermsOfServiceProperties terms of service contract properties. 14876type TermsOfServiceProperties struct { 14877 // Text - A terms of service text. 14878 Text *string `json:"text,omitempty"` 14879 // Enabled - Display terms of service during a sign-up process. 14880 Enabled *bool `json:"enabled,omitempty"` 14881 // ConsentRequired - Ask user for consent to the terms of service. 14882 ConsentRequired *bool `json:"consentRequired,omitempty"` 14883} 14884 14885// TokenBodyParameterContract oAuth acquire token request body parameter (www-url-form-encoded). 14886type TokenBodyParameterContract struct { 14887 // Name - body parameter name. 14888 Name *string `json:"name,omitempty"` 14889 // Value - body parameter value. 14890 Value *string `json:"value,omitempty"` 14891} 14892 14893// UserCollection paged Users list representation. 14894type UserCollection struct { 14895 autorest.Response `json:"-"` 14896 // Value - Page values. 14897 Value *[]UserContract `json:"value,omitempty"` 14898 // Count - Total record count number across all pages. 14899 Count *int64 `json:"count,omitempty"` 14900 // NextLink - Next page link if any. 14901 NextLink *string `json:"nextLink,omitempty"` 14902} 14903 14904// UserCollectionIterator provides access to a complete listing of UserContract values. 14905type UserCollectionIterator struct { 14906 i int 14907 page UserCollectionPage 14908} 14909 14910// NextWithContext advances to the next value. If there was an error making 14911// the request the iterator does not advance and the error is returned. 14912func (iter *UserCollectionIterator) NextWithContext(ctx context.Context) (err error) { 14913 if tracing.IsEnabled() { 14914 ctx = tracing.StartSpan(ctx, fqdn+"/UserCollectionIterator.NextWithContext") 14915 defer func() { 14916 sc := -1 14917 if iter.Response().Response.Response != nil { 14918 sc = iter.Response().Response.Response.StatusCode 14919 } 14920 tracing.EndSpan(ctx, sc, err) 14921 }() 14922 } 14923 iter.i++ 14924 if iter.i < len(iter.page.Values()) { 14925 return nil 14926 } 14927 err = iter.page.NextWithContext(ctx) 14928 if err != nil { 14929 iter.i-- 14930 return err 14931 } 14932 iter.i = 0 14933 return nil 14934} 14935 14936// Next advances to the next value. If there was an error making 14937// the request the iterator does not advance and the error is returned. 14938// Deprecated: Use NextWithContext() instead. 14939func (iter *UserCollectionIterator) Next() error { 14940 return iter.NextWithContext(context.Background()) 14941} 14942 14943// NotDone returns true if the enumeration should be started or is not yet complete. 14944func (iter UserCollectionIterator) NotDone() bool { 14945 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 14946} 14947 14948// Response returns the raw server response from the last page request. 14949func (iter UserCollectionIterator) Response() UserCollection { 14950 return iter.page.Response() 14951} 14952 14953// Value returns the current value or a zero-initialized value if the 14954// iterator has advanced beyond the end of the collection. 14955func (iter UserCollectionIterator) Value() UserContract { 14956 if !iter.page.NotDone() { 14957 return UserContract{} 14958 } 14959 return iter.page.Values()[iter.i] 14960} 14961 14962// Creates a new instance of the UserCollectionIterator type. 14963func NewUserCollectionIterator(page UserCollectionPage) UserCollectionIterator { 14964 return UserCollectionIterator{page: page} 14965} 14966 14967// IsEmpty returns true if the ListResult contains no values. 14968func (uc UserCollection) IsEmpty() bool { 14969 return uc.Value == nil || len(*uc.Value) == 0 14970} 14971 14972// hasNextLink returns true if the NextLink is not empty. 14973func (uc UserCollection) hasNextLink() bool { 14974 return uc.NextLink != nil && len(*uc.NextLink) != 0 14975} 14976 14977// userCollectionPreparer prepares a request to retrieve the next set of results. 14978// It returns nil if no more results exist. 14979func (uc UserCollection) userCollectionPreparer(ctx context.Context) (*http.Request, error) { 14980 if !uc.hasNextLink() { 14981 return nil, nil 14982 } 14983 return autorest.Prepare((&http.Request{}).WithContext(ctx), 14984 autorest.AsJSON(), 14985 autorest.AsGet(), 14986 autorest.WithBaseURL(to.String(uc.NextLink))) 14987} 14988 14989// UserCollectionPage contains a page of UserContract values. 14990type UserCollectionPage struct { 14991 fn func(context.Context, UserCollection) (UserCollection, error) 14992 uc UserCollection 14993} 14994 14995// NextWithContext advances to the next page of values. If there was an error making 14996// the request the page does not advance and the error is returned. 14997func (page *UserCollectionPage) NextWithContext(ctx context.Context) (err error) { 14998 if tracing.IsEnabled() { 14999 ctx = tracing.StartSpan(ctx, fqdn+"/UserCollectionPage.NextWithContext") 15000 defer func() { 15001 sc := -1 15002 if page.Response().Response.Response != nil { 15003 sc = page.Response().Response.Response.StatusCode 15004 } 15005 tracing.EndSpan(ctx, sc, err) 15006 }() 15007 } 15008 for { 15009 next, err := page.fn(ctx, page.uc) 15010 if err != nil { 15011 return err 15012 } 15013 page.uc = next 15014 if !next.hasNextLink() || !next.IsEmpty() { 15015 break 15016 } 15017 } 15018 return nil 15019} 15020 15021// Next advances to the next page of values. If there was an error making 15022// the request the page does not advance and the error is returned. 15023// Deprecated: Use NextWithContext() instead. 15024func (page *UserCollectionPage) Next() error { 15025 return page.NextWithContext(context.Background()) 15026} 15027 15028// NotDone returns true if the page enumeration should be started or is not yet complete. 15029func (page UserCollectionPage) NotDone() bool { 15030 return !page.uc.IsEmpty() 15031} 15032 15033// Response returns the raw server response from the last page request. 15034func (page UserCollectionPage) Response() UserCollection { 15035 return page.uc 15036} 15037 15038// Values returns the slice of values for the current page or nil if there are no values. 15039func (page UserCollectionPage) Values() []UserContract { 15040 if page.uc.IsEmpty() { 15041 return nil 15042 } 15043 return *page.uc.Value 15044} 15045 15046// Creates a new instance of the UserCollectionPage type. 15047func NewUserCollectionPage(cur UserCollection, getNextPage func(context.Context, UserCollection) (UserCollection, error)) UserCollectionPage { 15048 return UserCollectionPage{ 15049 fn: getNextPage, 15050 uc: cur, 15051 } 15052} 15053 15054// UserContract user details. 15055type UserContract struct { 15056 autorest.Response `json:"-"` 15057 // UserContractProperties - User entity contract properties. 15058 *UserContractProperties `json:"properties,omitempty"` 15059 // ID - READ-ONLY; Resource ID. 15060 ID *string `json:"id,omitempty"` 15061 // Name - READ-ONLY; Resource name. 15062 Name *string `json:"name,omitempty"` 15063 // Type - READ-ONLY; Resource type for API Management resource. 15064 Type *string `json:"type,omitempty"` 15065} 15066 15067// MarshalJSON is the custom marshaler for UserContract. 15068func (uc UserContract) MarshalJSON() ([]byte, error) { 15069 objectMap := make(map[string]interface{}) 15070 if uc.UserContractProperties != nil { 15071 objectMap["properties"] = uc.UserContractProperties 15072 } 15073 return json.Marshal(objectMap) 15074} 15075 15076// UnmarshalJSON is the custom unmarshaler for UserContract struct. 15077func (uc *UserContract) UnmarshalJSON(body []byte) error { 15078 var m map[string]*json.RawMessage 15079 err := json.Unmarshal(body, &m) 15080 if err != nil { 15081 return err 15082 } 15083 for k, v := range m { 15084 switch k { 15085 case "properties": 15086 if v != nil { 15087 var userContractProperties UserContractProperties 15088 err = json.Unmarshal(*v, &userContractProperties) 15089 if err != nil { 15090 return err 15091 } 15092 uc.UserContractProperties = &userContractProperties 15093 } 15094 case "id": 15095 if v != nil { 15096 var ID string 15097 err = json.Unmarshal(*v, &ID) 15098 if err != nil { 15099 return err 15100 } 15101 uc.ID = &ID 15102 } 15103 case "name": 15104 if v != nil { 15105 var name string 15106 err = json.Unmarshal(*v, &name) 15107 if err != nil { 15108 return err 15109 } 15110 uc.Name = &name 15111 } 15112 case "type": 15113 if v != nil { 15114 var typeVar string 15115 err = json.Unmarshal(*v, &typeVar) 15116 if err != nil { 15117 return err 15118 } 15119 uc.Type = &typeVar 15120 } 15121 } 15122 } 15123 15124 return nil 15125} 15126 15127// UserContractProperties user profile. 15128type UserContractProperties struct { 15129 // FirstName - First name. 15130 FirstName *string `json:"firstName,omitempty"` 15131 // LastName - Last name. 15132 LastName *string `json:"lastName,omitempty"` 15133 // Email - Email address. 15134 Email *string `json:"email,omitempty"` 15135 // RegistrationDate - Date of user registration. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. 15136 RegistrationDate *date.Time `json:"registrationDate,omitempty"` 15137 // Groups - READ-ONLY; Collection of groups user is part of. 15138 Groups *[]GroupContractProperties `json:"groups,omitempty"` 15139 // 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' 15140 State UserState `json:"state,omitempty"` 15141 // Note - Optional note about a user set by the administrator. 15142 Note *string `json:"note,omitempty"` 15143 // Identities - Collection of user identities. 15144 Identities *[]UserIdentityContract `json:"identities,omitempty"` 15145} 15146 15147// MarshalJSON is the custom marshaler for UserContractProperties. 15148func (ucp UserContractProperties) MarshalJSON() ([]byte, error) { 15149 objectMap := make(map[string]interface{}) 15150 if ucp.FirstName != nil { 15151 objectMap["firstName"] = ucp.FirstName 15152 } 15153 if ucp.LastName != nil { 15154 objectMap["lastName"] = ucp.LastName 15155 } 15156 if ucp.Email != nil { 15157 objectMap["email"] = ucp.Email 15158 } 15159 if ucp.RegistrationDate != nil { 15160 objectMap["registrationDate"] = ucp.RegistrationDate 15161 } 15162 if ucp.State != "" { 15163 objectMap["state"] = ucp.State 15164 } 15165 if ucp.Note != nil { 15166 objectMap["note"] = ucp.Note 15167 } 15168 if ucp.Identities != nil { 15169 objectMap["identities"] = ucp.Identities 15170 } 15171 return json.Marshal(objectMap) 15172} 15173 15174// UserCreateParameterProperties parameters supplied to the Create User operation. 15175type UserCreateParameterProperties struct { 15176 // Email - Email address. Must not be empty and must be unique within the service instance. 15177 Email *string `json:"email,omitempty"` 15178 // FirstName - First name. 15179 FirstName *string `json:"firstName,omitempty"` 15180 // LastName - Last name. 15181 LastName *string `json:"lastName,omitempty"` 15182 // Password - User Password. If no value is provided, a default password is generated. 15183 Password *string `json:"password,omitempty"` 15184 // AppType - Determines the type of application which send the create user request. Default is legacy portal. Possible values include: 'Portal', 'DeveloperPortal' 15185 AppType AppType `json:"appType,omitempty"` 15186 // Confirmation - Determines the type of confirmation e-mail that will be sent to the newly created user. Possible values include: 'Signup', 'Invite' 15187 Confirmation Confirmation `json:"confirmation,omitempty"` 15188 // 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' 15189 State UserState `json:"state,omitempty"` 15190 // Note - Optional note about a user set by the administrator. 15191 Note *string `json:"note,omitempty"` 15192 // Identities - Collection of user identities. 15193 Identities *[]UserIdentityContract `json:"identities,omitempty"` 15194} 15195 15196// UserCreateParameters user create details. 15197type UserCreateParameters struct { 15198 // UserCreateParameterProperties - User entity create contract properties. 15199 *UserCreateParameterProperties `json:"properties,omitempty"` 15200} 15201 15202// MarshalJSON is the custom marshaler for UserCreateParameters. 15203func (ucp UserCreateParameters) MarshalJSON() ([]byte, error) { 15204 objectMap := make(map[string]interface{}) 15205 if ucp.UserCreateParameterProperties != nil { 15206 objectMap["properties"] = ucp.UserCreateParameterProperties 15207 } 15208 return json.Marshal(objectMap) 15209} 15210 15211// UnmarshalJSON is the custom unmarshaler for UserCreateParameters struct. 15212func (ucp *UserCreateParameters) UnmarshalJSON(body []byte) error { 15213 var m map[string]*json.RawMessage 15214 err := json.Unmarshal(body, &m) 15215 if err != nil { 15216 return err 15217 } 15218 for k, v := range m { 15219 switch k { 15220 case "properties": 15221 if v != nil { 15222 var userCreateParameterProperties UserCreateParameterProperties 15223 err = json.Unmarshal(*v, &userCreateParameterProperties) 15224 if err != nil { 15225 return err 15226 } 15227 ucp.UserCreateParameterProperties = &userCreateParameterProperties 15228 } 15229 } 15230 } 15231 15232 return nil 15233} 15234 15235// UserEntityBaseParameters user Entity Base Parameters set. 15236type UserEntityBaseParameters struct { 15237 // 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' 15238 State UserState `json:"state,omitempty"` 15239 // Note - Optional note about a user set by the administrator. 15240 Note *string `json:"note,omitempty"` 15241 // Identities - Collection of user identities. 15242 Identities *[]UserIdentityContract `json:"identities,omitempty"` 15243} 15244 15245// UserIdentityCollection list of Users Identity list representation. 15246type UserIdentityCollection struct { 15247 autorest.Response `json:"-"` 15248 // Value - User Identity values. 15249 Value *[]UserIdentityContract `json:"value,omitempty"` 15250 // Count - Total record count number across all pages. 15251 Count *int64 `json:"count,omitempty"` 15252 // NextLink - Next page link if any. 15253 NextLink *string `json:"nextLink,omitempty"` 15254} 15255 15256// UserIdentityCollectionIterator provides access to a complete listing of UserIdentityContract values. 15257type UserIdentityCollectionIterator struct { 15258 i int 15259 page UserIdentityCollectionPage 15260} 15261 15262// NextWithContext advances to the next value. If there was an error making 15263// the request the iterator does not advance and the error is returned. 15264func (iter *UserIdentityCollectionIterator) NextWithContext(ctx context.Context) (err error) { 15265 if tracing.IsEnabled() { 15266 ctx = tracing.StartSpan(ctx, fqdn+"/UserIdentityCollectionIterator.NextWithContext") 15267 defer func() { 15268 sc := -1 15269 if iter.Response().Response.Response != nil { 15270 sc = iter.Response().Response.Response.StatusCode 15271 } 15272 tracing.EndSpan(ctx, sc, err) 15273 }() 15274 } 15275 iter.i++ 15276 if iter.i < len(iter.page.Values()) { 15277 return nil 15278 } 15279 err = iter.page.NextWithContext(ctx) 15280 if err != nil { 15281 iter.i-- 15282 return err 15283 } 15284 iter.i = 0 15285 return nil 15286} 15287 15288// Next advances to the next value. If there was an error making 15289// the request the iterator does not advance and the error is returned. 15290// Deprecated: Use NextWithContext() instead. 15291func (iter *UserIdentityCollectionIterator) Next() error { 15292 return iter.NextWithContext(context.Background()) 15293} 15294 15295// NotDone returns true if the enumeration should be started or is not yet complete. 15296func (iter UserIdentityCollectionIterator) NotDone() bool { 15297 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 15298} 15299 15300// Response returns the raw server response from the last page request. 15301func (iter UserIdentityCollectionIterator) Response() UserIdentityCollection { 15302 return iter.page.Response() 15303} 15304 15305// Value returns the current value or a zero-initialized value if the 15306// iterator has advanced beyond the end of the collection. 15307func (iter UserIdentityCollectionIterator) Value() UserIdentityContract { 15308 if !iter.page.NotDone() { 15309 return UserIdentityContract{} 15310 } 15311 return iter.page.Values()[iter.i] 15312} 15313 15314// Creates a new instance of the UserIdentityCollectionIterator type. 15315func NewUserIdentityCollectionIterator(page UserIdentityCollectionPage) UserIdentityCollectionIterator { 15316 return UserIdentityCollectionIterator{page: page} 15317} 15318 15319// IsEmpty returns true if the ListResult contains no values. 15320func (uic UserIdentityCollection) IsEmpty() bool { 15321 return uic.Value == nil || len(*uic.Value) == 0 15322} 15323 15324// hasNextLink returns true if the NextLink is not empty. 15325func (uic UserIdentityCollection) hasNextLink() bool { 15326 return uic.NextLink != nil && len(*uic.NextLink) != 0 15327} 15328 15329// userIdentityCollectionPreparer prepares a request to retrieve the next set of results. 15330// It returns nil if no more results exist. 15331func (uic UserIdentityCollection) userIdentityCollectionPreparer(ctx context.Context) (*http.Request, error) { 15332 if !uic.hasNextLink() { 15333 return nil, nil 15334 } 15335 return autorest.Prepare((&http.Request{}).WithContext(ctx), 15336 autorest.AsJSON(), 15337 autorest.AsGet(), 15338 autorest.WithBaseURL(to.String(uic.NextLink))) 15339} 15340 15341// UserIdentityCollectionPage contains a page of UserIdentityContract values. 15342type UserIdentityCollectionPage struct { 15343 fn func(context.Context, UserIdentityCollection) (UserIdentityCollection, error) 15344 uic UserIdentityCollection 15345} 15346 15347// NextWithContext advances to the next page of values. If there was an error making 15348// the request the page does not advance and the error is returned. 15349func (page *UserIdentityCollectionPage) NextWithContext(ctx context.Context) (err error) { 15350 if tracing.IsEnabled() { 15351 ctx = tracing.StartSpan(ctx, fqdn+"/UserIdentityCollectionPage.NextWithContext") 15352 defer func() { 15353 sc := -1 15354 if page.Response().Response.Response != nil { 15355 sc = page.Response().Response.Response.StatusCode 15356 } 15357 tracing.EndSpan(ctx, sc, err) 15358 }() 15359 } 15360 for { 15361 next, err := page.fn(ctx, page.uic) 15362 if err != nil { 15363 return err 15364 } 15365 page.uic = next 15366 if !next.hasNextLink() || !next.IsEmpty() { 15367 break 15368 } 15369 } 15370 return nil 15371} 15372 15373// Next advances to the next page of values. If there was an error making 15374// the request the page does not advance and the error is returned. 15375// Deprecated: Use NextWithContext() instead. 15376func (page *UserIdentityCollectionPage) Next() error { 15377 return page.NextWithContext(context.Background()) 15378} 15379 15380// NotDone returns true if the page enumeration should be started or is not yet complete. 15381func (page UserIdentityCollectionPage) NotDone() bool { 15382 return !page.uic.IsEmpty() 15383} 15384 15385// Response returns the raw server response from the last page request. 15386func (page UserIdentityCollectionPage) Response() UserIdentityCollection { 15387 return page.uic 15388} 15389 15390// Values returns the slice of values for the current page or nil if there are no values. 15391func (page UserIdentityCollectionPage) Values() []UserIdentityContract { 15392 if page.uic.IsEmpty() { 15393 return nil 15394 } 15395 return *page.uic.Value 15396} 15397 15398// Creates a new instance of the UserIdentityCollectionPage type. 15399func NewUserIdentityCollectionPage(cur UserIdentityCollection, getNextPage func(context.Context, UserIdentityCollection) (UserIdentityCollection, error)) UserIdentityCollectionPage { 15400 return UserIdentityCollectionPage{ 15401 fn: getNextPage, 15402 uic: cur, 15403 } 15404} 15405 15406// UserIdentityContract user identity details. 15407type UserIdentityContract struct { 15408 // Provider - Identity provider name. 15409 Provider *string `json:"provider,omitempty"` 15410 // ID - Identifier value within provider. 15411 ID *string `json:"id,omitempty"` 15412} 15413 15414// UserIdentityProperties ... 15415type UserIdentityProperties struct { 15416 // PrincipalID - The principal id of user assigned identity. 15417 PrincipalID *string `json:"principalId,omitempty"` 15418 // ClientID - The client id of user assigned identity. 15419 ClientID *string `json:"clientId,omitempty"` 15420} 15421 15422// UserTokenParameterProperties parameters supplied to the Get User Token operation. 15423type UserTokenParameterProperties struct { 15424 // KeyType - The Key to be used to generate token for user. Possible values include: 'Primary', 'Secondary' 15425 KeyType KeyType `json:"keyType,omitempty"` 15426 // 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. 15427 Expiry *date.Time `json:"expiry,omitempty"` 15428} 15429 15430// UserTokenParameters get User Token parameters. 15431type UserTokenParameters struct { 15432 // UserTokenParameterProperties - User Token Parameter contract properties. 15433 *UserTokenParameterProperties `json:"properties,omitempty"` 15434} 15435 15436// MarshalJSON is the custom marshaler for UserTokenParameters. 15437func (utp UserTokenParameters) MarshalJSON() ([]byte, error) { 15438 objectMap := make(map[string]interface{}) 15439 if utp.UserTokenParameterProperties != nil { 15440 objectMap["properties"] = utp.UserTokenParameterProperties 15441 } 15442 return json.Marshal(objectMap) 15443} 15444 15445// UnmarshalJSON is the custom unmarshaler for UserTokenParameters struct. 15446func (utp *UserTokenParameters) UnmarshalJSON(body []byte) error { 15447 var m map[string]*json.RawMessage 15448 err := json.Unmarshal(body, &m) 15449 if err != nil { 15450 return err 15451 } 15452 for k, v := range m { 15453 switch k { 15454 case "properties": 15455 if v != nil { 15456 var userTokenParameterProperties UserTokenParameterProperties 15457 err = json.Unmarshal(*v, &userTokenParameterProperties) 15458 if err != nil { 15459 return err 15460 } 15461 utp.UserTokenParameterProperties = &userTokenParameterProperties 15462 } 15463 } 15464 } 15465 15466 return nil 15467} 15468 15469// UserTokenResult get User Token response details. 15470type UserTokenResult struct { 15471 autorest.Response `json:"-"` 15472 // Value - Shared Access Authorization token for the User. 15473 Value *string `json:"value,omitempty"` 15474} 15475 15476// UserUpdateParameters user update parameters. 15477type UserUpdateParameters struct { 15478 // UserUpdateParametersProperties - User entity update contract properties. 15479 *UserUpdateParametersProperties `json:"properties,omitempty"` 15480} 15481 15482// MarshalJSON is the custom marshaler for UserUpdateParameters. 15483func (uup UserUpdateParameters) MarshalJSON() ([]byte, error) { 15484 objectMap := make(map[string]interface{}) 15485 if uup.UserUpdateParametersProperties != nil { 15486 objectMap["properties"] = uup.UserUpdateParametersProperties 15487 } 15488 return json.Marshal(objectMap) 15489} 15490 15491// UnmarshalJSON is the custom unmarshaler for UserUpdateParameters struct. 15492func (uup *UserUpdateParameters) UnmarshalJSON(body []byte) error { 15493 var m map[string]*json.RawMessage 15494 err := json.Unmarshal(body, &m) 15495 if err != nil { 15496 return err 15497 } 15498 for k, v := range m { 15499 switch k { 15500 case "properties": 15501 if v != nil { 15502 var userUpdateParametersProperties UserUpdateParametersProperties 15503 err = json.Unmarshal(*v, &userUpdateParametersProperties) 15504 if err != nil { 15505 return err 15506 } 15507 uup.UserUpdateParametersProperties = &userUpdateParametersProperties 15508 } 15509 } 15510 } 15511 15512 return nil 15513} 15514 15515// UserUpdateParametersProperties parameters supplied to the Update User operation. 15516type UserUpdateParametersProperties struct { 15517 // Email - Email address. Must not be empty and must be unique within the service instance. 15518 Email *string `json:"email,omitempty"` 15519 // Password - User Password. 15520 Password *string `json:"password,omitempty"` 15521 // FirstName - First name. 15522 FirstName *string `json:"firstName,omitempty"` 15523 // LastName - Last name. 15524 LastName *string `json:"lastName,omitempty"` 15525 // 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' 15526 State UserState `json:"state,omitempty"` 15527 // Note - Optional note about a user set by the administrator. 15528 Note *string `json:"note,omitempty"` 15529 // Identities - Collection of user identities. 15530 Identities *[]UserIdentityContract `json:"identities,omitempty"` 15531} 15532 15533// VirtualNetworkConfiguration configuration of a virtual network to which API Management service is 15534// deployed. 15535type VirtualNetworkConfiguration struct { 15536 // Vnetid - READ-ONLY; The virtual network ID. This is typically a GUID. Expect a null GUID by default. 15537 Vnetid *string `json:"vnetid,omitempty"` 15538 // Subnetname - READ-ONLY; The name of the subnet. 15539 Subnetname *string `json:"subnetname,omitempty"` 15540 // SubnetResourceID - The full resource ID of a subnet in a virtual network to deploy the API Management service in. 15541 SubnetResourceID *string `json:"subnetResourceId,omitempty"` 15542} 15543 15544// MarshalJSON is the custom marshaler for VirtualNetworkConfiguration. 15545func (vnc VirtualNetworkConfiguration) MarshalJSON() ([]byte, error) { 15546 objectMap := make(map[string]interface{}) 15547 if vnc.SubnetResourceID != nil { 15548 objectMap["subnetResourceId"] = vnc.SubnetResourceID 15549 } 15550 return json.Marshal(objectMap) 15551} 15552 15553// X509CertificateName properties of server X509Names. 15554type X509CertificateName struct { 15555 // Name - Common Name of the Certificate. 15556 Name *string `json:"name,omitempty"` 15557 // IssuerCertificateThumbprint - Thumbprint for the Issuer of the Certificate. 15558 IssuerCertificateThumbprint *string `json:"issuerCertificateThumbprint,omitempty"` 15559} 15560