1package apimanagement 2 3// Copyright (c) Microsoft Corporation. All rights reserved. 4// Licensed under the MIT License. See License.txt in the project root for license information. 5// 6// Code generated by Microsoft (R) AutoRest Code Generator. 7// Changes may cause incorrect behavior and will be lost if the code is regenerated. 8 9import ( 10 "context" 11 "encoding/json" 12 "github.com/Azure/go-autorest/autorest" 13 "github.com/Azure/go-autorest/autorest/azure" 14 "github.com/Azure/go-autorest/autorest/date" 15 "github.com/Azure/go-autorest/autorest/to" 16 "github.com/Azure/go-autorest/tracing" 17 "io" 18 "net/http" 19) 20 21// The package's fully qualified name. 22const fqdn = "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2016-10-10/apimanagement" 23 24// AccessInformationContract tenant access information contract of the API Management service. 25type AccessInformationContract struct { 26 autorest.Response `json:"-"` 27 // ID - Identifier. 28 ID *string `json:"id,omitempty"` 29 // PrimaryKey - Primary access key. 30 PrimaryKey *string `json:"primaryKey,omitempty"` 31 // SecondaryKey - Secondary access key. 32 SecondaryKey *string `json:"secondaryKey,omitempty"` 33 // Enabled - Tenant access information of the API Management service. 34 Enabled *bool `json:"enabled,omitempty"` 35} 36 37// AccessInformationUpdateParameters tenant access information update parameters of the API Management 38// service. 39type AccessInformationUpdateParameters struct { 40 // Enabled - Tenant access information of the API Management service. 41 Enabled *bool `json:"enabled,omitempty"` 42} 43 44// AdditionalRegion description of an additional API Management resource location. 45type AdditionalRegion struct { 46 // Location - The location name of the additional region among Azure Data center regions. 47 Location *string `json:"location,omitempty"` 48 // SkuType - The SKU type in the location. Possible values include: 'Developer', 'Standard', 'Premium' 49 SkuType SkuType `json:"skuType,omitempty"` 50 // SkuUnitCount - The SKU Unit count at the location. The maximum SKU Unit count depends on the SkuType. Maximum allowed for Developer SKU is 1, for Standard SKU is 4, and for Premium SKU is 10, at a location. 51 SkuUnitCount *int32 `json:"skuUnitCount,omitempty"` 52 // StaticIPs - READ-ONLY; Static IP addresses of the location's virtual machines. 53 StaticIPs *[]string `json:"staticIPs,omitempty"` 54 // Vpnconfiguration - Virtual network configuration for the location. 55 Vpnconfiguration *VirtualNetworkConfiguration `json:"vpnconfiguration,omitempty"` 56} 57 58// MarshalJSON is the custom marshaler for AdditionalRegion. 59func (ar AdditionalRegion) MarshalJSON() ([]byte, error) { 60 objectMap := make(map[string]interface{}) 61 if ar.Location != nil { 62 objectMap["location"] = ar.Location 63 } 64 if ar.SkuType != "" { 65 objectMap["skuType"] = ar.SkuType 66 } 67 if ar.SkuUnitCount != nil { 68 objectMap["skuUnitCount"] = ar.SkuUnitCount 69 } 70 if ar.Vpnconfiguration != nil { 71 objectMap["vpnconfiguration"] = ar.Vpnconfiguration 72 } 73 return json.Marshal(objectMap) 74} 75 76// APICollection paged Api list representation. 77type APICollection struct { 78 autorest.Response `json:"-"` 79 // Value - Page values. 80 Value *[]APIContract `json:"value,omitempty"` 81 // Count - Total record count number across all pages. 82 Count *int64 `json:"count,omitempty"` 83 // NextLink - Next page link if any. 84 NextLink *string `json:"nextLink,omitempty"` 85} 86 87// APICollectionIterator provides access to a complete listing of APIContract values. 88type APICollectionIterator struct { 89 i int 90 page APICollectionPage 91} 92 93// NextWithContext advances to the next value. If there was an error making 94// the request the iterator does not advance and the error is returned. 95func (iter *APICollectionIterator) NextWithContext(ctx context.Context) (err error) { 96 if tracing.IsEnabled() { 97 ctx = tracing.StartSpan(ctx, fqdn+"/APICollectionIterator.NextWithContext") 98 defer func() { 99 sc := -1 100 if iter.Response().Response.Response != nil { 101 sc = iter.Response().Response.Response.StatusCode 102 } 103 tracing.EndSpan(ctx, sc, err) 104 }() 105 } 106 iter.i++ 107 if iter.i < len(iter.page.Values()) { 108 return nil 109 } 110 err = iter.page.NextWithContext(ctx) 111 if err != nil { 112 iter.i-- 113 return err 114 } 115 iter.i = 0 116 return nil 117} 118 119// Next advances to the next value. If there was an error making 120// the request the iterator does not advance and the error is returned. 121// Deprecated: Use NextWithContext() instead. 122func (iter *APICollectionIterator) Next() error { 123 return iter.NextWithContext(context.Background()) 124} 125 126// NotDone returns true if the enumeration should be started or is not yet complete. 127func (iter APICollectionIterator) NotDone() bool { 128 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 129} 130 131// Response returns the raw server response from the last page request. 132func (iter APICollectionIterator) Response() APICollection { 133 return iter.page.Response() 134} 135 136// Value returns the current value or a zero-initialized value if the 137// iterator has advanced beyond the end of the collection. 138func (iter APICollectionIterator) Value() APIContract { 139 if !iter.page.NotDone() { 140 return APIContract{} 141 } 142 return iter.page.Values()[iter.i] 143} 144 145// Creates a new instance of the APICollectionIterator type. 146func NewAPICollectionIterator(page APICollectionPage) APICollectionIterator { 147 return APICollectionIterator{page: page} 148} 149 150// IsEmpty returns true if the ListResult contains no values. 151func (ac APICollection) IsEmpty() bool { 152 return ac.Value == nil || len(*ac.Value) == 0 153} 154 155// hasNextLink returns true if the NextLink is not empty. 156func (ac APICollection) hasNextLink() bool { 157 return ac.NextLink != nil && len(*ac.NextLink) != 0 158} 159 160// aPICollectionPreparer prepares a request to retrieve the next set of results. 161// It returns nil if no more results exist. 162func (ac APICollection) aPICollectionPreparer(ctx context.Context) (*http.Request, error) { 163 if !ac.hasNextLink() { 164 return nil, nil 165 } 166 return autorest.Prepare((&http.Request{}).WithContext(ctx), 167 autorest.AsJSON(), 168 autorest.AsGet(), 169 autorest.WithBaseURL(to.String(ac.NextLink))) 170} 171 172// APICollectionPage contains a page of APIContract values. 173type APICollectionPage struct { 174 fn func(context.Context, APICollection) (APICollection, error) 175 ac APICollection 176} 177 178// NextWithContext advances to the next page of values. If there was an error making 179// the request the page does not advance and the error is returned. 180func (page *APICollectionPage) NextWithContext(ctx context.Context) (err error) { 181 if tracing.IsEnabled() { 182 ctx = tracing.StartSpan(ctx, fqdn+"/APICollectionPage.NextWithContext") 183 defer func() { 184 sc := -1 185 if page.Response().Response.Response != nil { 186 sc = page.Response().Response.Response.StatusCode 187 } 188 tracing.EndSpan(ctx, sc, err) 189 }() 190 } 191 for { 192 next, err := page.fn(ctx, page.ac) 193 if err != nil { 194 return err 195 } 196 page.ac = next 197 if !next.hasNextLink() || !next.IsEmpty() { 198 break 199 } 200 } 201 return nil 202} 203 204// Next advances to the next page of values. If there was an error making 205// the request the page does not advance and the error is returned. 206// Deprecated: Use NextWithContext() instead. 207func (page *APICollectionPage) Next() error { 208 return page.NextWithContext(context.Background()) 209} 210 211// NotDone returns true if the page enumeration should be started or is not yet complete. 212func (page APICollectionPage) NotDone() bool { 213 return !page.ac.IsEmpty() 214} 215 216// Response returns the raw server response from the last page request. 217func (page APICollectionPage) Response() APICollection { 218 return page.ac 219} 220 221// Values returns the slice of values for the current page or nil if there are no values. 222func (page APICollectionPage) Values() []APIContract { 223 if page.ac.IsEmpty() { 224 return nil 225 } 226 return *page.ac.Value 227} 228 229// Creates a new instance of the APICollectionPage type. 230func NewAPICollectionPage(cur APICollection, getNextPage func(context.Context, APICollection) (APICollection, error)) APICollectionPage { 231 return APICollectionPage{ 232 fn: getNextPage, 233 ac: cur, 234 } 235} 236 237// APIContract API details. 238type APIContract struct { 239 autorest.Response `json:"-"` 240 // ID - READ-ONLY; API identifier path: /apis/{apiId} 241 ID *string `json:"id,omitempty"` 242 // Name - API name. 243 Name *string `json:"name,omitempty"` 244 // ServiceURL - Absolute URL of the backend service implementing this API. 245 ServiceURL *string `json:"serviceUrl,omitempty"` 246 // 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. 247 Path *string `json:"path,omitempty"` 248 // Protocols - Describes on which protocols the operations in this API can be invoked. 249 Protocols *[]APIProtocolContract `json:"protocols,omitempty"` 250 // Description - Description of the API. May include HTML formatting tags. 251 Description *string `json:"description,omitempty"` 252 // AuthenticationSettings - Collection of authentication settings included into this API. 253 AuthenticationSettings *AuthenticationSettingsContract `json:"authenticationSettings,omitempty"` 254 // SubscriptionKeyParameterNames - Protocols over which API is made available. 255 SubscriptionKeyParameterNames *SubscriptionKeyParameterNamesContract `json:"subscriptionKeyParameterNames,omitempty"` 256 // Type - Type of API. Possible values include: 'APITypeContractHTTP', 'APITypeContractSoap' 257 Type APITypeContract `json:"type,omitempty"` 258} 259 260// MarshalJSON is the custom marshaler for APIContract. 261func (ac APIContract) MarshalJSON() ([]byte, error) { 262 objectMap := make(map[string]interface{}) 263 if ac.Name != nil { 264 objectMap["name"] = ac.Name 265 } 266 if ac.ServiceURL != nil { 267 objectMap["serviceUrl"] = ac.ServiceURL 268 } 269 if ac.Path != nil { 270 objectMap["path"] = ac.Path 271 } 272 if ac.Protocols != nil { 273 objectMap["protocols"] = ac.Protocols 274 } 275 if ac.Description != nil { 276 objectMap["description"] = ac.Description 277 } 278 if ac.AuthenticationSettings != nil { 279 objectMap["authenticationSettings"] = ac.AuthenticationSettings 280 } 281 if ac.SubscriptionKeyParameterNames != nil { 282 objectMap["subscriptionKeyParameterNames"] = ac.SubscriptionKeyParameterNames 283 } 284 if ac.Type != "" { 285 objectMap["type"] = ac.Type 286 } 287 return json.Marshal(objectMap) 288} 289 290// APIEntityBaseContract API base contract details. 291type APIEntityBaseContract struct { 292 // Description - Description of the API. May include HTML formatting tags. 293 Description *string `json:"description,omitempty"` 294 // AuthenticationSettings - Collection of authentication settings included into this API. 295 AuthenticationSettings *AuthenticationSettingsContract `json:"authenticationSettings,omitempty"` 296 // SubscriptionKeyParameterNames - Protocols over which API is made available. 297 SubscriptionKeyParameterNames *SubscriptionKeyParameterNamesContract `json:"subscriptionKeyParameterNames,omitempty"` 298 // Type - Type of API. Possible values include: 'APITypeContractHTTP', 'APITypeContractSoap' 299 Type APITypeContract `json:"type,omitempty"` 300} 301 302// APIExportResult the response model for the export API output operation. 303type APIExportResult struct { 304 autorest.Response `json:"-"` 305 // Content - Response content bytes. 306 Content *[]byte `json:"content,omitempty"` 307 // StatusCode - Possible values include: 'Continue', 'OK', 'Created', 'Accepted', 'NotFound', 'Conflict' 308 StatusCode HTTPStatusCode `json:"statusCode,omitempty"` 309 RequestID *string `json:"requestId,omitempty"` 310} 311 312// APIUpdateContract API Update Contract details. 313type APIUpdateContract struct { 314 // ID - READ-ONLY; API identifier path: /apis/{apiId} 315 ID *string `json:"id,omitempty"` 316 // Name - API name. 317 Name *string `json:"name,omitempty"` 318 // ServiceURL - Absolute URL of the backend service implementing this API. 319 ServiceURL *string `json:"serviceUrl,omitempty"` 320 // 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. 321 Path *string `json:"path,omitempty"` 322 // Protocols - Describes on which protocols the operations in this API can be invoked. 323 Protocols *[]APIProtocolContract `json:"protocols,omitempty"` 324 // Description - Description of the API. May include HTML formatting tags. 325 Description *string `json:"description,omitempty"` 326 // AuthenticationSettings - Collection of authentication settings included into this API. 327 AuthenticationSettings *AuthenticationSettingsContract `json:"authenticationSettings,omitempty"` 328 // SubscriptionKeyParameterNames - Protocols over which API is made available. 329 SubscriptionKeyParameterNames *SubscriptionKeyParameterNamesContract `json:"subscriptionKeyParameterNames,omitempty"` 330 // Type - Type of API. Possible values include: 'APITypeContractHTTP', 'APITypeContractSoap' 331 Type APITypeContract `json:"type,omitempty"` 332} 333 334// MarshalJSON is the custom marshaler for APIUpdateContract. 335func (auc APIUpdateContract) MarshalJSON() ([]byte, error) { 336 objectMap := make(map[string]interface{}) 337 if auc.Name != nil { 338 objectMap["name"] = auc.Name 339 } 340 if auc.ServiceURL != nil { 341 objectMap["serviceUrl"] = auc.ServiceURL 342 } 343 if auc.Path != nil { 344 objectMap["path"] = auc.Path 345 } 346 if auc.Protocols != nil { 347 objectMap["protocols"] = auc.Protocols 348 } 349 if auc.Description != nil { 350 objectMap["description"] = auc.Description 351 } 352 if auc.AuthenticationSettings != nil { 353 objectMap["authenticationSettings"] = auc.AuthenticationSettings 354 } 355 if auc.SubscriptionKeyParameterNames != nil { 356 objectMap["subscriptionKeyParameterNames"] = auc.SubscriptionKeyParameterNames 357 } 358 if auc.Type != "" { 359 objectMap["type"] = auc.Type 360 } 361 return json.Marshal(objectMap) 362} 363 364// AuthenticationSettingsContract API Authentication Settings. 365type AuthenticationSettingsContract struct { 366 OAuth2 *OAuth2AuthenticationSettingsContract `json:"oAuth2,omitempty"` 367} 368 369// AuthorizationServerCollection paged OAuth2 Authorization Servers list representation. 370type AuthorizationServerCollection struct { 371 autorest.Response `json:"-"` 372 // Value - Page values. 373 Value *[]OAuth2AuthorizationServerContract `json:"value,omitempty"` 374 // Count - Total record count number across all pages. 375 Count *int64 `json:"count,omitempty"` 376 // NextLink - Next page link if any. 377 NextLink *string `json:"nextLink,omitempty"` 378} 379 380// AuthorizationServerCollectionIterator provides access to a complete listing of 381// OAuth2AuthorizationServerContract values. 382type AuthorizationServerCollectionIterator struct { 383 i int 384 page AuthorizationServerCollectionPage 385} 386 387// NextWithContext advances to the next value. If there was an error making 388// the request the iterator does not advance and the error is returned. 389func (iter *AuthorizationServerCollectionIterator) NextWithContext(ctx context.Context) (err error) { 390 if tracing.IsEnabled() { 391 ctx = tracing.StartSpan(ctx, fqdn+"/AuthorizationServerCollectionIterator.NextWithContext") 392 defer func() { 393 sc := -1 394 if iter.Response().Response.Response != nil { 395 sc = iter.Response().Response.Response.StatusCode 396 } 397 tracing.EndSpan(ctx, sc, err) 398 }() 399 } 400 iter.i++ 401 if iter.i < len(iter.page.Values()) { 402 return nil 403 } 404 err = iter.page.NextWithContext(ctx) 405 if err != nil { 406 iter.i-- 407 return err 408 } 409 iter.i = 0 410 return nil 411} 412 413// Next advances to the next value. If there was an error making 414// the request the iterator does not advance and the error is returned. 415// Deprecated: Use NextWithContext() instead. 416func (iter *AuthorizationServerCollectionIterator) Next() error { 417 return iter.NextWithContext(context.Background()) 418} 419 420// NotDone returns true if the enumeration should be started or is not yet complete. 421func (iter AuthorizationServerCollectionIterator) NotDone() bool { 422 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 423} 424 425// Response returns the raw server response from the last page request. 426func (iter AuthorizationServerCollectionIterator) Response() AuthorizationServerCollection { 427 return iter.page.Response() 428} 429 430// Value returns the current value or a zero-initialized value if the 431// iterator has advanced beyond the end of the collection. 432func (iter AuthorizationServerCollectionIterator) Value() OAuth2AuthorizationServerContract { 433 if !iter.page.NotDone() { 434 return OAuth2AuthorizationServerContract{} 435 } 436 return iter.page.Values()[iter.i] 437} 438 439// Creates a new instance of the AuthorizationServerCollectionIterator type. 440func NewAuthorizationServerCollectionIterator(page AuthorizationServerCollectionPage) AuthorizationServerCollectionIterator { 441 return AuthorizationServerCollectionIterator{page: page} 442} 443 444// IsEmpty returns true if the ListResult contains no values. 445func (asc AuthorizationServerCollection) IsEmpty() bool { 446 return asc.Value == nil || len(*asc.Value) == 0 447} 448 449// hasNextLink returns true if the NextLink is not empty. 450func (asc AuthorizationServerCollection) hasNextLink() bool { 451 return asc.NextLink != nil && len(*asc.NextLink) != 0 452} 453 454// authorizationServerCollectionPreparer prepares a request to retrieve the next set of results. 455// It returns nil if no more results exist. 456func (asc AuthorizationServerCollection) authorizationServerCollectionPreparer(ctx context.Context) (*http.Request, error) { 457 if !asc.hasNextLink() { 458 return nil, nil 459 } 460 return autorest.Prepare((&http.Request{}).WithContext(ctx), 461 autorest.AsJSON(), 462 autorest.AsGet(), 463 autorest.WithBaseURL(to.String(asc.NextLink))) 464} 465 466// AuthorizationServerCollectionPage contains a page of OAuth2AuthorizationServerContract values. 467type AuthorizationServerCollectionPage struct { 468 fn func(context.Context, AuthorizationServerCollection) (AuthorizationServerCollection, error) 469 asc AuthorizationServerCollection 470} 471 472// NextWithContext advances to the next page of values. If there was an error making 473// the request the page does not advance and the error is returned. 474func (page *AuthorizationServerCollectionPage) NextWithContext(ctx context.Context) (err error) { 475 if tracing.IsEnabled() { 476 ctx = tracing.StartSpan(ctx, fqdn+"/AuthorizationServerCollectionPage.NextWithContext") 477 defer func() { 478 sc := -1 479 if page.Response().Response.Response != nil { 480 sc = page.Response().Response.Response.StatusCode 481 } 482 tracing.EndSpan(ctx, sc, err) 483 }() 484 } 485 for { 486 next, err := page.fn(ctx, page.asc) 487 if err != nil { 488 return err 489 } 490 page.asc = next 491 if !next.hasNextLink() || !next.IsEmpty() { 492 break 493 } 494 } 495 return nil 496} 497 498// Next advances to the next page of values. If there was an error making 499// the request the page does not advance and the error is returned. 500// Deprecated: Use NextWithContext() instead. 501func (page *AuthorizationServerCollectionPage) Next() error { 502 return page.NextWithContext(context.Background()) 503} 504 505// NotDone returns true if the page enumeration should be started or is not yet complete. 506func (page AuthorizationServerCollectionPage) NotDone() bool { 507 return !page.asc.IsEmpty() 508} 509 510// Response returns the raw server response from the last page request. 511func (page AuthorizationServerCollectionPage) Response() AuthorizationServerCollection { 512 return page.asc 513} 514 515// Values returns the slice of values for the current page or nil if there are no values. 516func (page AuthorizationServerCollectionPage) Values() []OAuth2AuthorizationServerContract { 517 if page.asc.IsEmpty() { 518 return nil 519 } 520 return *page.asc.Value 521} 522 523// Creates a new instance of the AuthorizationServerCollectionPage type. 524func NewAuthorizationServerCollectionPage(cur AuthorizationServerCollection, getNextPage func(context.Context, AuthorizationServerCollection) (AuthorizationServerCollection, error)) AuthorizationServerCollectionPage { 525 return AuthorizationServerCollectionPage{ 526 fn: getNextPage, 527 asc: cur, 528 } 529} 530 531// BackendAuthorizationHeaderCredentials authorization header information. 532type BackendAuthorizationHeaderCredentials struct { 533 // Scheme - Authentication Scheme name. 534 Scheme *string `json:"scheme,omitempty"` 535 // Parameter - Authentication Parameter value. 536 Parameter *string `json:"parameter,omitempty"` 537} 538 539// BackendBaseParameters backend entity base Parameter set. 540type BackendBaseParameters struct { 541 // Certificate - List of Client Certificate Thumbprint. 542 Certificate *[]string `json:"certificate,omitempty"` 543 // Query - Query Parameter description. 544 Query map[string][]string `json:"query"` 545 // Header - Header Parameter description. 546 Header map[string][]string `json:"header"` 547 // URL - WebProxy Server AbsoluteUri property which includes the entire URI stored in the Uri instance, including all fragments and query strings. 548 URL *string `json:"url,omitempty"` 549 // Username - Username to connect to the WebProxy server 550 Username *string `json:"username,omitempty"` 551 // Password - Password to connect to the WebProxy Server 552 Password *string `json:"password,omitempty"` 553 // Title - Backend Title. 554 Title *string `json:"title,omitempty"` 555 // Description - Backend Description. 556 Description *string `json:"description,omitempty"` 557 // 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. 558 ResourceID *string `json:"resourceId,omitempty"` 559 *BackendProperties `json:"properties,omitempty"` 560} 561 562// MarshalJSON is the custom marshaler for BackendBaseParameters. 563func (bbp BackendBaseParameters) MarshalJSON() ([]byte, error) { 564 objectMap := make(map[string]interface{}) 565 if bbp.Certificate != nil { 566 objectMap["certificate"] = bbp.Certificate 567 } 568 if bbp.Query != nil { 569 objectMap["query"] = bbp.Query 570 } 571 if bbp.Header != nil { 572 objectMap["header"] = bbp.Header 573 } 574 if bbp.URL != nil { 575 objectMap["url"] = bbp.URL 576 } 577 if bbp.Username != nil { 578 objectMap["username"] = bbp.Username 579 } 580 if bbp.Password != nil { 581 objectMap["password"] = bbp.Password 582 } 583 if bbp.Title != nil { 584 objectMap["title"] = bbp.Title 585 } 586 if bbp.Description != nil { 587 objectMap["description"] = bbp.Description 588 } 589 if bbp.ResourceID != nil { 590 objectMap["resourceId"] = bbp.ResourceID 591 } 592 if bbp.BackendProperties != nil { 593 objectMap["properties"] = bbp.BackendProperties 594 } 595 return json.Marshal(objectMap) 596} 597 598// UnmarshalJSON is the custom unmarshaler for BackendBaseParameters struct. 599func (bbp *BackendBaseParameters) UnmarshalJSON(body []byte) error { 600 var m map[string]*json.RawMessage 601 err := json.Unmarshal(body, &m) 602 if err != nil { 603 return err 604 } 605 for k, v := range m { 606 switch k { 607 case "certificate": 608 if v != nil { 609 var certificate []string 610 err = json.Unmarshal(*v, &certificate) 611 if err != nil { 612 return err 613 } 614 bbp.Certificate = &certificate 615 } 616 case "query": 617 if v != nil { 618 var query map[string][]string 619 err = json.Unmarshal(*v, &query) 620 if err != nil { 621 return err 622 } 623 bbp.Query = query 624 } 625 case "header": 626 if v != nil { 627 var header map[string][]string 628 err = json.Unmarshal(*v, &header) 629 if err != nil { 630 return err 631 } 632 bbp.Header = header 633 } 634 case "url": 635 if v != nil { 636 var URL string 637 err = json.Unmarshal(*v, &URL) 638 if err != nil { 639 return err 640 } 641 bbp.URL = &URL 642 } 643 case "username": 644 if v != nil { 645 var username string 646 err = json.Unmarshal(*v, &username) 647 if err != nil { 648 return err 649 } 650 bbp.Username = &username 651 } 652 case "password": 653 if v != nil { 654 var password string 655 err = json.Unmarshal(*v, &password) 656 if err != nil { 657 return err 658 } 659 bbp.Password = &password 660 } 661 case "title": 662 if v != nil { 663 var title string 664 err = json.Unmarshal(*v, &title) 665 if err != nil { 666 return err 667 } 668 bbp.Title = &title 669 } 670 case "description": 671 if v != nil { 672 var description string 673 err = json.Unmarshal(*v, &description) 674 if err != nil { 675 return err 676 } 677 bbp.Description = &description 678 } 679 case "resourceId": 680 if v != nil { 681 var resourceID string 682 err = json.Unmarshal(*v, &resourceID) 683 if err != nil { 684 return err 685 } 686 bbp.ResourceID = &resourceID 687 } 688 case "properties": 689 if v != nil { 690 var backendProperties BackendProperties 691 err = json.Unmarshal(*v, &backendProperties) 692 if err != nil { 693 return err 694 } 695 bbp.BackendProperties = &backendProperties 696 } 697 } 698 } 699 700 return nil 701} 702 703// BackendCollection paged Backend list representation. 704type BackendCollection struct { 705 autorest.Response `json:"-"` 706 // Value - Backend values. 707 Value *[]BackendResponse `json:"value,omitempty"` 708 // Count - Total record count number across all pages. 709 Count *int64 `json:"count,omitempty"` 710 // NextLink - Next page link if any. 711 NextLink *string `json:"nextLink,omitempty"` 712} 713 714// BackendCollectionIterator provides access to a complete listing of BackendResponse values. 715type BackendCollectionIterator struct { 716 i int 717 page BackendCollectionPage 718} 719 720// NextWithContext advances to the next value. If there was an error making 721// the request the iterator does not advance and the error is returned. 722func (iter *BackendCollectionIterator) NextWithContext(ctx context.Context) (err error) { 723 if tracing.IsEnabled() { 724 ctx = tracing.StartSpan(ctx, fqdn+"/BackendCollectionIterator.NextWithContext") 725 defer func() { 726 sc := -1 727 if iter.Response().Response.Response != nil { 728 sc = iter.Response().Response.Response.StatusCode 729 } 730 tracing.EndSpan(ctx, sc, err) 731 }() 732 } 733 iter.i++ 734 if iter.i < len(iter.page.Values()) { 735 return nil 736 } 737 err = iter.page.NextWithContext(ctx) 738 if err != nil { 739 iter.i-- 740 return err 741 } 742 iter.i = 0 743 return nil 744} 745 746// Next advances to the next value. If there was an error making 747// the request the iterator does not advance and the error is returned. 748// Deprecated: Use NextWithContext() instead. 749func (iter *BackendCollectionIterator) Next() error { 750 return iter.NextWithContext(context.Background()) 751} 752 753// NotDone returns true if the enumeration should be started or is not yet complete. 754func (iter BackendCollectionIterator) NotDone() bool { 755 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 756} 757 758// Response returns the raw server response from the last page request. 759func (iter BackendCollectionIterator) Response() BackendCollection { 760 return iter.page.Response() 761} 762 763// Value returns the current value or a zero-initialized value if the 764// iterator has advanced beyond the end of the collection. 765func (iter BackendCollectionIterator) Value() BackendResponse { 766 if !iter.page.NotDone() { 767 return BackendResponse{} 768 } 769 return iter.page.Values()[iter.i] 770} 771 772// Creates a new instance of the BackendCollectionIterator type. 773func NewBackendCollectionIterator(page BackendCollectionPage) BackendCollectionIterator { 774 return BackendCollectionIterator{page: page} 775} 776 777// IsEmpty returns true if the ListResult contains no values. 778func (bc BackendCollection) IsEmpty() bool { 779 return bc.Value == nil || len(*bc.Value) == 0 780} 781 782// hasNextLink returns true if the NextLink is not empty. 783func (bc BackendCollection) hasNextLink() bool { 784 return bc.NextLink != nil && len(*bc.NextLink) != 0 785} 786 787// backendCollectionPreparer prepares a request to retrieve the next set of results. 788// It returns nil if no more results exist. 789func (bc BackendCollection) backendCollectionPreparer(ctx context.Context) (*http.Request, error) { 790 if !bc.hasNextLink() { 791 return nil, nil 792 } 793 return autorest.Prepare((&http.Request{}).WithContext(ctx), 794 autorest.AsJSON(), 795 autorest.AsGet(), 796 autorest.WithBaseURL(to.String(bc.NextLink))) 797} 798 799// BackendCollectionPage contains a page of BackendResponse values. 800type BackendCollectionPage struct { 801 fn func(context.Context, BackendCollection) (BackendCollection, error) 802 bc BackendCollection 803} 804 805// NextWithContext advances to the next page of values. If there was an error making 806// the request the page does not advance and the error is returned. 807func (page *BackendCollectionPage) NextWithContext(ctx context.Context) (err error) { 808 if tracing.IsEnabled() { 809 ctx = tracing.StartSpan(ctx, fqdn+"/BackendCollectionPage.NextWithContext") 810 defer func() { 811 sc := -1 812 if page.Response().Response.Response != nil { 813 sc = page.Response().Response.Response.StatusCode 814 } 815 tracing.EndSpan(ctx, sc, err) 816 }() 817 } 818 for { 819 next, err := page.fn(ctx, page.bc) 820 if err != nil { 821 return err 822 } 823 page.bc = next 824 if !next.hasNextLink() || !next.IsEmpty() { 825 break 826 } 827 } 828 return nil 829} 830 831// Next advances to the next page of values. If there was an error making 832// the request the page does not advance and the error is returned. 833// Deprecated: Use NextWithContext() instead. 834func (page *BackendCollectionPage) Next() error { 835 return page.NextWithContext(context.Background()) 836} 837 838// NotDone returns true if the page enumeration should be started or is not yet complete. 839func (page BackendCollectionPage) NotDone() bool { 840 return !page.bc.IsEmpty() 841} 842 843// Response returns the raw server response from the last page request. 844func (page BackendCollectionPage) Response() BackendCollection { 845 return page.bc 846} 847 848// Values returns the slice of values for the current page or nil if there are no values. 849func (page BackendCollectionPage) Values() []BackendResponse { 850 if page.bc.IsEmpty() { 851 return nil 852 } 853 return *page.bc.Value 854} 855 856// Creates a new instance of the BackendCollectionPage type. 857func NewBackendCollectionPage(cur BackendCollection, getNextPage func(context.Context, BackendCollection) (BackendCollection, error)) BackendCollectionPage { 858 return BackendCollectionPage{ 859 fn: getNextPage, 860 bc: cur, 861 } 862} 863 864// BackendContract parameters supplied to the Create Backend operation. 865type BackendContract struct { 866 // ID - READ-ONLY; Uniquely identifies the backend within the current API Management service instance. The value is a valid relative URL in the format of /backends/{backendId} where {backendId} is a backend identifier. 867 ID *string `json:"id,omitempty"` 868 // Protocol - Backend communication protocol. Possible values include: 'BackendProtocolHTTP', 'BackendProtocolSoap' 869 Protocol BackendProtocol `json:"protocol,omitempty"` 870 // Certificate - List of Client Certificate Thumbprint. 871 Certificate *[]string `json:"certificate,omitempty"` 872 // Query - Query Parameter description. 873 Query map[string][]string `json:"query"` 874 // Header - Header Parameter description. 875 Header map[string][]string `json:"header"` 876 // URL - WebProxy Server AbsoluteUri property which includes the entire URI stored in the Uri instance, including all fragments and query strings. 877 URL *string `json:"url,omitempty"` 878 // Username - Username to connect to the WebProxy server 879 Username *string `json:"username,omitempty"` 880 // Password - Password to connect to the WebProxy Server 881 Password *string `json:"password,omitempty"` 882 // Title - Backend Title. 883 Title *string `json:"title,omitempty"` 884 // Description - Backend Description. 885 Description *string `json:"description,omitempty"` 886 // 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. 887 ResourceID *string `json:"resourceId,omitempty"` 888 *BackendProperties `json:"properties,omitempty"` 889} 890 891// MarshalJSON is the custom marshaler for BackendContract. 892func (bc BackendContract) MarshalJSON() ([]byte, error) { 893 objectMap := make(map[string]interface{}) 894 if bc.Protocol != "" { 895 objectMap["protocol"] = bc.Protocol 896 } 897 if bc.Certificate != nil { 898 objectMap["certificate"] = bc.Certificate 899 } 900 if bc.Query != nil { 901 objectMap["query"] = bc.Query 902 } 903 if bc.Header != nil { 904 objectMap["header"] = bc.Header 905 } 906 if bc.URL != nil { 907 objectMap["url"] = bc.URL 908 } 909 if bc.Username != nil { 910 objectMap["username"] = bc.Username 911 } 912 if bc.Password != nil { 913 objectMap["password"] = bc.Password 914 } 915 if bc.Title != nil { 916 objectMap["title"] = bc.Title 917 } 918 if bc.Description != nil { 919 objectMap["description"] = bc.Description 920 } 921 if bc.ResourceID != nil { 922 objectMap["resourceId"] = bc.ResourceID 923 } 924 if bc.BackendProperties != nil { 925 objectMap["properties"] = bc.BackendProperties 926 } 927 return json.Marshal(objectMap) 928} 929 930// UnmarshalJSON is the custom unmarshaler for BackendContract struct. 931func (bc *BackendContract) UnmarshalJSON(body []byte) error { 932 var m map[string]*json.RawMessage 933 err := json.Unmarshal(body, &m) 934 if err != nil { 935 return err 936 } 937 for k, v := range m { 938 switch k { 939 case "id": 940 if v != nil { 941 var ID string 942 err = json.Unmarshal(*v, &ID) 943 if err != nil { 944 return err 945 } 946 bc.ID = &ID 947 } 948 case "protocol": 949 if v != nil { 950 var protocol BackendProtocol 951 err = json.Unmarshal(*v, &protocol) 952 if err != nil { 953 return err 954 } 955 bc.Protocol = protocol 956 } 957 case "certificate": 958 if v != nil { 959 var certificate []string 960 err = json.Unmarshal(*v, &certificate) 961 if err != nil { 962 return err 963 } 964 bc.Certificate = &certificate 965 } 966 case "query": 967 if v != nil { 968 var query map[string][]string 969 err = json.Unmarshal(*v, &query) 970 if err != nil { 971 return err 972 } 973 bc.Query = query 974 } 975 case "header": 976 if v != nil { 977 var header map[string][]string 978 err = json.Unmarshal(*v, &header) 979 if err != nil { 980 return err 981 } 982 bc.Header = header 983 } 984 case "url": 985 if v != nil { 986 var URL string 987 err = json.Unmarshal(*v, &URL) 988 if err != nil { 989 return err 990 } 991 bc.URL = &URL 992 } 993 case "username": 994 if v != nil { 995 var username string 996 err = json.Unmarshal(*v, &username) 997 if err != nil { 998 return err 999 } 1000 bc.Username = &username 1001 } 1002 case "password": 1003 if v != nil { 1004 var password string 1005 err = json.Unmarshal(*v, &password) 1006 if err != nil { 1007 return err 1008 } 1009 bc.Password = &password 1010 } 1011 case "title": 1012 if v != nil { 1013 var title string 1014 err = json.Unmarshal(*v, &title) 1015 if err != nil { 1016 return err 1017 } 1018 bc.Title = &title 1019 } 1020 case "description": 1021 if v != nil { 1022 var description string 1023 err = json.Unmarshal(*v, &description) 1024 if err != nil { 1025 return err 1026 } 1027 bc.Description = &description 1028 } 1029 case "resourceId": 1030 if v != nil { 1031 var resourceID string 1032 err = json.Unmarshal(*v, &resourceID) 1033 if err != nil { 1034 return err 1035 } 1036 bc.ResourceID = &resourceID 1037 } 1038 case "properties": 1039 if v != nil { 1040 var backendProperties BackendProperties 1041 err = json.Unmarshal(*v, &backendProperties) 1042 if err != nil { 1043 return err 1044 } 1045 bc.BackendProperties = &backendProperties 1046 } 1047 } 1048 } 1049 1050 return nil 1051} 1052 1053// BackendCredentialsContract details of the Credentials used to connect to Backend. 1054type BackendCredentialsContract struct { 1055 // Certificate - List of Client Certificate Thumbprint. 1056 Certificate *[]string `json:"certificate,omitempty"` 1057 // Query - Query Parameter description. 1058 Query map[string][]string `json:"query"` 1059 // Header - Header Parameter description. 1060 Header map[string][]string `json:"header"` 1061 // Scheme - Authentication Scheme name. 1062 Scheme *string `json:"scheme,omitempty"` 1063 // Parameter - Authentication Parameter value. 1064 Parameter *string `json:"parameter,omitempty"` 1065} 1066 1067// MarshalJSON is the custom marshaler for BackendCredentialsContract. 1068func (bcc BackendCredentialsContract) MarshalJSON() ([]byte, error) { 1069 objectMap := make(map[string]interface{}) 1070 if bcc.Certificate != nil { 1071 objectMap["certificate"] = bcc.Certificate 1072 } 1073 if bcc.Query != nil { 1074 objectMap["query"] = bcc.Query 1075 } 1076 if bcc.Header != nil { 1077 objectMap["header"] = bcc.Header 1078 } 1079 if bcc.Scheme != nil { 1080 objectMap["scheme"] = bcc.Scheme 1081 } 1082 if bcc.Parameter != nil { 1083 objectMap["parameter"] = bcc.Parameter 1084 } 1085 return json.Marshal(objectMap) 1086} 1087 1088// BackendProperties properties specific to a Backend. 1089type BackendProperties struct { 1090 // SkipCertificateChainValidation - Flag indicating whether SSL certificate chain validation should be skipped when using self-signed certificates for this backend host. 1091 SkipCertificateChainValidation *bool `json:"skipCertificateChainValidation,omitempty"` 1092 // SkipCertificateNameValidation - Flag indicating whether SSL certificate name validation should be skipped when using self-signed certificates for this backend host. 1093 SkipCertificateNameValidation *bool `json:"skipCertificateNameValidation,omitempty"` 1094} 1095 1096// BackendProxyContract details of the Backend WebProxy Server to use in the Request to Backend. 1097type BackendProxyContract struct { 1098 // URL - WebProxy Server AbsoluteUri property which includes the entire URI stored in the Uri instance, including all fragments and query strings. 1099 URL *string `json:"url,omitempty"` 1100 // Username - Username to connect to the WebProxy server 1101 Username *string `json:"username,omitempty"` 1102 // Password - Password to connect to the WebProxy Server 1103 Password *string `json:"password,omitempty"` 1104} 1105 1106// BackendResponse the Backend entity in API Management represents a backend service that is configured to 1107// skip certification chain validation when using a self-signed certificate to test mutual certificate 1108// authentication. 1109type BackendResponse struct { 1110 autorest.Response `json:"-"` 1111 // ID - READ-ONLY; Uniquely identifies the backend within the current API Management service instance. The value is a valid relative URL in the format of /backends/{backendId} where {backendId} is a backend identifier. 1112 ID *string `json:"id,omitempty"` 1113 // Protocol - Backend communication protocol. Possible values include: 'BackendProtocolHTTP', 'BackendProtocolSoap' 1114 Protocol BackendProtocol `json:"protocol,omitempty"` 1115 // Certificate - List of Client Certificate Thumbprint. 1116 Certificate *[]string `json:"certificate,omitempty"` 1117 // Query - Query Parameter description. 1118 Query map[string][]string `json:"query"` 1119 // Header - Header Parameter description. 1120 Header map[string][]string `json:"header"` 1121 // URL - WebProxy Server AbsoluteUri property which includes the entire URI stored in the Uri instance, including all fragments and query strings. 1122 URL *string `json:"url,omitempty"` 1123 // Username - Username to connect to the WebProxy server 1124 Username *string `json:"username,omitempty"` 1125 // Password - Password to connect to the WebProxy Server 1126 Password *string `json:"password,omitempty"` 1127 // Title - Backend Title. 1128 Title *string `json:"title,omitempty"` 1129 // Description - Backend Description. 1130 Description *string `json:"description,omitempty"` 1131 // 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. 1132 ResourceID *string `json:"resourceId,omitempty"` 1133 *BackendProperties `json:"properties,omitempty"` 1134} 1135 1136// MarshalJSON is the custom marshaler for BackendResponse. 1137func (br BackendResponse) MarshalJSON() ([]byte, error) { 1138 objectMap := make(map[string]interface{}) 1139 if br.Protocol != "" { 1140 objectMap["protocol"] = br.Protocol 1141 } 1142 if br.Certificate != nil { 1143 objectMap["certificate"] = br.Certificate 1144 } 1145 if br.Query != nil { 1146 objectMap["query"] = br.Query 1147 } 1148 if br.Header != nil { 1149 objectMap["header"] = br.Header 1150 } 1151 if br.URL != nil { 1152 objectMap["url"] = br.URL 1153 } 1154 if br.Username != nil { 1155 objectMap["username"] = br.Username 1156 } 1157 if br.Password != nil { 1158 objectMap["password"] = br.Password 1159 } 1160 if br.Title != nil { 1161 objectMap["title"] = br.Title 1162 } 1163 if br.Description != nil { 1164 objectMap["description"] = br.Description 1165 } 1166 if br.ResourceID != nil { 1167 objectMap["resourceId"] = br.ResourceID 1168 } 1169 if br.BackendProperties != nil { 1170 objectMap["properties"] = br.BackendProperties 1171 } 1172 return json.Marshal(objectMap) 1173} 1174 1175// UnmarshalJSON is the custom unmarshaler for BackendResponse struct. 1176func (br *BackendResponse) UnmarshalJSON(body []byte) error { 1177 var m map[string]*json.RawMessage 1178 err := json.Unmarshal(body, &m) 1179 if err != nil { 1180 return err 1181 } 1182 for k, v := range m { 1183 switch k { 1184 case "id": 1185 if v != nil { 1186 var ID string 1187 err = json.Unmarshal(*v, &ID) 1188 if err != nil { 1189 return err 1190 } 1191 br.ID = &ID 1192 } 1193 case "protocol": 1194 if v != nil { 1195 var protocol BackendProtocol 1196 err = json.Unmarshal(*v, &protocol) 1197 if err != nil { 1198 return err 1199 } 1200 br.Protocol = protocol 1201 } 1202 case "certificate": 1203 if v != nil { 1204 var certificate []string 1205 err = json.Unmarshal(*v, &certificate) 1206 if err != nil { 1207 return err 1208 } 1209 br.Certificate = &certificate 1210 } 1211 case "query": 1212 if v != nil { 1213 var query map[string][]string 1214 err = json.Unmarshal(*v, &query) 1215 if err != nil { 1216 return err 1217 } 1218 br.Query = query 1219 } 1220 case "header": 1221 if v != nil { 1222 var header map[string][]string 1223 err = json.Unmarshal(*v, &header) 1224 if err != nil { 1225 return err 1226 } 1227 br.Header = header 1228 } 1229 case "url": 1230 if v != nil { 1231 var URL string 1232 err = json.Unmarshal(*v, &URL) 1233 if err != nil { 1234 return err 1235 } 1236 br.URL = &URL 1237 } 1238 case "username": 1239 if v != nil { 1240 var username string 1241 err = json.Unmarshal(*v, &username) 1242 if err != nil { 1243 return err 1244 } 1245 br.Username = &username 1246 } 1247 case "password": 1248 if v != nil { 1249 var password string 1250 err = json.Unmarshal(*v, &password) 1251 if err != nil { 1252 return err 1253 } 1254 br.Password = &password 1255 } 1256 case "title": 1257 if v != nil { 1258 var title string 1259 err = json.Unmarshal(*v, &title) 1260 if err != nil { 1261 return err 1262 } 1263 br.Title = &title 1264 } 1265 case "description": 1266 if v != nil { 1267 var description string 1268 err = json.Unmarshal(*v, &description) 1269 if err != nil { 1270 return err 1271 } 1272 br.Description = &description 1273 } 1274 case "resourceId": 1275 if v != nil { 1276 var resourceID string 1277 err = json.Unmarshal(*v, &resourceID) 1278 if err != nil { 1279 return err 1280 } 1281 br.ResourceID = &resourceID 1282 } 1283 case "properties": 1284 if v != nil { 1285 var backendProperties BackendProperties 1286 err = json.Unmarshal(*v, &backendProperties) 1287 if err != nil { 1288 return err 1289 } 1290 br.BackendProperties = &backendProperties 1291 } 1292 } 1293 } 1294 1295 return nil 1296} 1297 1298// BackendUpdateParameters parameters supplied to the Update Backend operation. 1299type BackendUpdateParameters struct { 1300 // Protocol - Backend communication protocol. Possible values include: 'BackendProtocolHTTP', 'BackendProtocolSoap' 1301 Protocol BackendProtocol `json:"protocol,omitempty"` 1302 // Certificate - List of Client Certificate Thumbprint. 1303 Certificate *[]string `json:"certificate,omitempty"` 1304 // Query - Query Parameter description. 1305 Query map[string][]string `json:"query"` 1306 // Header - Header Parameter description. 1307 Header map[string][]string `json:"header"` 1308 // URL - WebProxy Server AbsoluteUri property which includes the entire URI stored in the Uri instance, including all fragments and query strings. 1309 URL *string `json:"url,omitempty"` 1310 // Username - Username to connect to the WebProxy server 1311 Username *string `json:"username,omitempty"` 1312 // Password - Password to connect to the WebProxy Server 1313 Password *string `json:"password,omitempty"` 1314 // Title - Backend Title. 1315 Title *string `json:"title,omitempty"` 1316 // Description - Backend Description. 1317 Description *string `json:"description,omitempty"` 1318 // 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. 1319 ResourceID *string `json:"resourceId,omitempty"` 1320 *BackendProperties `json:"properties,omitempty"` 1321} 1322 1323// MarshalJSON is the custom marshaler for BackendUpdateParameters. 1324func (bup BackendUpdateParameters) MarshalJSON() ([]byte, error) { 1325 objectMap := make(map[string]interface{}) 1326 if bup.Protocol != "" { 1327 objectMap["protocol"] = bup.Protocol 1328 } 1329 if bup.Certificate != nil { 1330 objectMap["certificate"] = bup.Certificate 1331 } 1332 if bup.Query != nil { 1333 objectMap["query"] = bup.Query 1334 } 1335 if bup.Header != nil { 1336 objectMap["header"] = bup.Header 1337 } 1338 if bup.URL != nil { 1339 objectMap["url"] = bup.URL 1340 } 1341 if bup.Username != nil { 1342 objectMap["username"] = bup.Username 1343 } 1344 if bup.Password != nil { 1345 objectMap["password"] = bup.Password 1346 } 1347 if bup.Title != nil { 1348 objectMap["title"] = bup.Title 1349 } 1350 if bup.Description != nil { 1351 objectMap["description"] = bup.Description 1352 } 1353 if bup.ResourceID != nil { 1354 objectMap["resourceId"] = bup.ResourceID 1355 } 1356 if bup.BackendProperties != nil { 1357 objectMap["properties"] = bup.BackendProperties 1358 } 1359 return json.Marshal(objectMap) 1360} 1361 1362// UnmarshalJSON is the custom unmarshaler for BackendUpdateParameters struct. 1363func (bup *BackendUpdateParameters) UnmarshalJSON(body []byte) error { 1364 var m map[string]*json.RawMessage 1365 err := json.Unmarshal(body, &m) 1366 if err != nil { 1367 return err 1368 } 1369 for k, v := range m { 1370 switch k { 1371 case "protocol": 1372 if v != nil { 1373 var protocol BackendProtocol 1374 err = json.Unmarshal(*v, &protocol) 1375 if err != nil { 1376 return err 1377 } 1378 bup.Protocol = protocol 1379 } 1380 case "certificate": 1381 if v != nil { 1382 var certificate []string 1383 err = json.Unmarshal(*v, &certificate) 1384 if err != nil { 1385 return err 1386 } 1387 bup.Certificate = &certificate 1388 } 1389 case "query": 1390 if v != nil { 1391 var query map[string][]string 1392 err = json.Unmarshal(*v, &query) 1393 if err != nil { 1394 return err 1395 } 1396 bup.Query = query 1397 } 1398 case "header": 1399 if v != nil { 1400 var header map[string][]string 1401 err = json.Unmarshal(*v, &header) 1402 if err != nil { 1403 return err 1404 } 1405 bup.Header = header 1406 } 1407 case "url": 1408 if v != nil { 1409 var URL string 1410 err = json.Unmarshal(*v, &URL) 1411 if err != nil { 1412 return err 1413 } 1414 bup.URL = &URL 1415 } 1416 case "username": 1417 if v != nil { 1418 var username string 1419 err = json.Unmarshal(*v, &username) 1420 if err != nil { 1421 return err 1422 } 1423 bup.Username = &username 1424 } 1425 case "password": 1426 if v != nil { 1427 var password string 1428 err = json.Unmarshal(*v, &password) 1429 if err != nil { 1430 return err 1431 } 1432 bup.Password = &password 1433 } 1434 case "title": 1435 if v != nil { 1436 var title string 1437 err = json.Unmarshal(*v, &title) 1438 if err != nil { 1439 return err 1440 } 1441 bup.Title = &title 1442 } 1443 case "description": 1444 if v != nil { 1445 var description string 1446 err = json.Unmarshal(*v, &description) 1447 if err != nil { 1448 return err 1449 } 1450 bup.Description = &description 1451 } 1452 case "resourceId": 1453 if v != nil { 1454 var resourceID string 1455 err = json.Unmarshal(*v, &resourceID) 1456 if err != nil { 1457 return err 1458 } 1459 bup.ResourceID = &resourceID 1460 } 1461 case "properties": 1462 if v != nil { 1463 var backendProperties BackendProperties 1464 err = json.Unmarshal(*v, &backendProperties) 1465 if err != nil { 1466 return err 1467 } 1468 bup.BackendProperties = &backendProperties 1469 } 1470 } 1471 } 1472 1473 return nil 1474} 1475 1476// CertificateCollection paged Certificates list representation. 1477type CertificateCollection struct { 1478 autorest.Response `json:"-"` 1479 // Value - Page values. 1480 Value *[]CertificateContract `json:"value,omitempty"` 1481 // Count - Total record count number across all pages. 1482 Count *int64 `json:"count,omitempty"` 1483 // NextLink - Next page link if any. 1484 NextLink *string `json:"nextLink,omitempty"` 1485} 1486 1487// CertificateCollectionIterator provides access to a complete listing of CertificateContract values. 1488type CertificateCollectionIterator struct { 1489 i int 1490 page CertificateCollectionPage 1491} 1492 1493// NextWithContext advances to the next value. If there was an error making 1494// the request the iterator does not advance and the error is returned. 1495func (iter *CertificateCollectionIterator) NextWithContext(ctx context.Context) (err error) { 1496 if tracing.IsEnabled() { 1497 ctx = tracing.StartSpan(ctx, fqdn+"/CertificateCollectionIterator.NextWithContext") 1498 defer func() { 1499 sc := -1 1500 if iter.Response().Response.Response != nil { 1501 sc = iter.Response().Response.Response.StatusCode 1502 } 1503 tracing.EndSpan(ctx, sc, err) 1504 }() 1505 } 1506 iter.i++ 1507 if iter.i < len(iter.page.Values()) { 1508 return nil 1509 } 1510 err = iter.page.NextWithContext(ctx) 1511 if err != nil { 1512 iter.i-- 1513 return err 1514 } 1515 iter.i = 0 1516 return nil 1517} 1518 1519// Next advances to the next value. If there was an error making 1520// the request the iterator does not advance and the error is returned. 1521// Deprecated: Use NextWithContext() instead. 1522func (iter *CertificateCollectionIterator) Next() error { 1523 return iter.NextWithContext(context.Background()) 1524} 1525 1526// NotDone returns true if the enumeration should be started or is not yet complete. 1527func (iter CertificateCollectionIterator) NotDone() bool { 1528 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 1529} 1530 1531// Response returns the raw server response from the last page request. 1532func (iter CertificateCollectionIterator) Response() CertificateCollection { 1533 return iter.page.Response() 1534} 1535 1536// Value returns the current value or a zero-initialized value if the 1537// iterator has advanced beyond the end of the collection. 1538func (iter CertificateCollectionIterator) Value() CertificateContract { 1539 if !iter.page.NotDone() { 1540 return CertificateContract{} 1541 } 1542 return iter.page.Values()[iter.i] 1543} 1544 1545// Creates a new instance of the CertificateCollectionIterator type. 1546func NewCertificateCollectionIterator(page CertificateCollectionPage) CertificateCollectionIterator { 1547 return CertificateCollectionIterator{page: page} 1548} 1549 1550// IsEmpty returns true if the ListResult contains no values. 1551func (cc CertificateCollection) IsEmpty() bool { 1552 return cc.Value == nil || len(*cc.Value) == 0 1553} 1554 1555// hasNextLink returns true if the NextLink is not empty. 1556func (cc CertificateCollection) hasNextLink() bool { 1557 return cc.NextLink != nil && len(*cc.NextLink) != 0 1558} 1559 1560// certificateCollectionPreparer prepares a request to retrieve the next set of results. 1561// It returns nil if no more results exist. 1562func (cc CertificateCollection) certificateCollectionPreparer(ctx context.Context) (*http.Request, error) { 1563 if !cc.hasNextLink() { 1564 return nil, nil 1565 } 1566 return autorest.Prepare((&http.Request{}).WithContext(ctx), 1567 autorest.AsJSON(), 1568 autorest.AsGet(), 1569 autorest.WithBaseURL(to.String(cc.NextLink))) 1570} 1571 1572// CertificateCollectionPage contains a page of CertificateContract values. 1573type CertificateCollectionPage struct { 1574 fn func(context.Context, CertificateCollection) (CertificateCollection, error) 1575 cc CertificateCollection 1576} 1577 1578// NextWithContext advances to the next page of values. If there was an error making 1579// the request the page does not advance and the error is returned. 1580func (page *CertificateCollectionPage) NextWithContext(ctx context.Context) (err error) { 1581 if tracing.IsEnabled() { 1582 ctx = tracing.StartSpan(ctx, fqdn+"/CertificateCollectionPage.NextWithContext") 1583 defer func() { 1584 sc := -1 1585 if page.Response().Response.Response != nil { 1586 sc = page.Response().Response.Response.StatusCode 1587 } 1588 tracing.EndSpan(ctx, sc, err) 1589 }() 1590 } 1591 for { 1592 next, err := page.fn(ctx, page.cc) 1593 if err != nil { 1594 return err 1595 } 1596 page.cc = next 1597 if !next.hasNextLink() || !next.IsEmpty() { 1598 break 1599 } 1600 } 1601 return nil 1602} 1603 1604// Next advances to the next page of values. If there was an error making 1605// the request the page does not advance and the error is returned. 1606// Deprecated: Use NextWithContext() instead. 1607func (page *CertificateCollectionPage) Next() error { 1608 return page.NextWithContext(context.Background()) 1609} 1610 1611// NotDone returns true if the page enumeration should be started or is not yet complete. 1612func (page CertificateCollectionPage) NotDone() bool { 1613 return !page.cc.IsEmpty() 1614} 1615 1616// Response returns the raw server response from the last page request. 1617func (page CertificateCollectionPage) Response() CertificateCollection { 1618 return page.cc 1619} 1620 1621// Values returns the slice of values for the current page or nil if there are no values. 1622func (page CertificateCollectionPage) Values() []CertificateContract { 1623 if page.cc.IsEmpty() { 1624 return nil 1625 } 1626 return *page.cc.Value 1627} 1628 1629// Creates a new instance of the CertificateCollectionPage type. 1630func NewCertificateCollectionPage(cur CertificateCollection, getNextPage func(context.Context, CertificateCollection) (CertificateCollection, error)) CertificateCollectionPage { 1631 return CertificateCollectionPage{ 1632 fn: getNextPage, 1633 cc: cur, 1634 } 1635} 1636 1637// CertificateContract certificate details. 1638type CertificateContract struct { 1639 autorest.Response `json:"-"` 1640 // ID - READ-ONLY; Certificate identifier path: /certificates/{certificateId} 1641 ID *string `json:"id,omitempty"` 1642 // Subject - Subject attribute of the certificate. 1643 Subject *string `json:"subject,omitempty"` 1644 // Thumbprint - Thumbprint of the certificate. 1645 Thumbprint *string `json:"thumbprint,omitempty"` 1646 // 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. 1647 ExpirationDate *date.Time `json:"expirationDate,omitempty"` 1648} 1649 1650// MarshalJSON is the custom marshaler for CertificateContract. 1651func (cc CertificateContract) MarshalJSON() ([]byte, error) { 1652 objectMap := make(map[string]interface{}) 1653 if cc.Subject != nil { 1654 objectMap["subject"] = cc.Subject 1655 } 1656 if cc.Thumbprint != nil { 1657 objectMap["thumbprint"] = cc.Thumbprint 1658 } 1659 if cc.ExpirationDate != nil { 1660 objectMap["expirationDate"] = cc.ExpirationDate 1661 } 1662 return json.Marshal(objectMap) 1663} 1664 1665// CertificateCreateOrUpdateParameters parameters supplied to the CreateOrUpdate certificate operation. 1666type CertificateCreateOrUpdateParameters struct { 1667 // Data - Base 64 encoded certificate using the application/x-pkcs12 representation. 1668 Data *string `json:"data,omitempty"` 1669 // Password - Password for the Certificate 1670 Password *string `json:"password,omitempty"` 1671} 1672 1673// CertificateInformation SSL certificate information. 1674type CertificateInformation struct { 1675 autorest.Response `json:"-"` 1676 // 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. 1677 Expiry *date.Time `json:"expiry,omitempty"` 1678 // Thumbprint - Thumbprint of the certificate. 1679 Thumbprint *string `json:"thumbprint,omitempty"` 1680 // Subject - Subject of the certificate. 1681 Subject *string `json:"subject,omitempty"` 1682} 1683 1684// ConnectivityStatusContract details about connectivity to a resource. 1685type ConnectivityStatusContract struct { 1686 // 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. 1687 Name *string `json:"name,omitempty"` 1688 // Status - Resource Connectivity Status Type identifier. Possible values include: 'Initializing', 'Success', 'Failure' 1689 Status ConnectivityStatusType `json:"status,omitempty"` 1690 // Error - Error details of the connectivity to the resource. 1691 Error *string `json:"error,omitempty"` 1692 // LastUpdated - The date when the resource connectivity status was last updated. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. 1693 LastUpdated *date.Time `json:"lastUpdated,omitempty"` 1694 // 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. 1695 LastStatusChange *date.Time `json:"lastStatusChange,omitempty"` 1696} 1697 1698// DeployConfigurationParameters parameters supplied to the Deploy Configuration operation. 1699type DeployConfigurationParameters struct { 1700 // Branch - The name of the Git branch from which the configuration is to be deployed to the configuration database. 1701 Branch *string `json:"branch,omitempty"` 1702 // Force - The value enforcing deleting subscriptions to products that are deleted in this update. 1703 Force *bool `json:"force,omitempty"` 1704} 1705 1706// ErrorBodyContract error Body contract. 1707type ErrorBodyContract struct { 1708 autorest.Response `json:"-"` 1709 // Code - Service-defined error code. This code serves as a sub-status for the HTTP error code specified in the response. 1710 Code *string `json:"code,omitempty"` 1711 // Message - Human-readable representation of the error. 1712 Message *string `json:"message,omitempty"` 1713 // Details - The list of invalid fields send in request, in case of validation error. 1714 Details *[]ErrorFieldContract `json:"details,omitempty"` 1715} 1716 1717// ErrorFieldContract error Field contract. 1718type ErrorFieldContract struct { 1719 // Code - Property level error code. 1720 Code *string `json:"code,omitempty"` 1721 // Message - Human-readable representation of property-level error. 1722 Message *string `json:"message,omitempty"` 1723 // Target - Property name. 1724 Target *string `json:"target,omitempty"` 1725} 1726 1727// ErrorResponse error Response. 1728type ErrorResponse struct { 1729 // Code - Error code. 1730 Code *string `json:"code,omitempty"` 1731 // Message - Error message indicating why the operation failed. 1732 Message *string `json:"message,omitempty"` 1733} 1734 1735// GenerateSsoURLResult generate SSO Url operations response details. 1736type GenerateSsoURLResult struct { 1737 autorest.Response `json:"-"` 1738 // Value - Redirect Url containing the SSO URL value. 1739 Value *string `json:"value,omitempty"` 1740} 1741 1742// GroupCollection paged Group list representation. 1743type GroupCollection struct { 1744 autorest.Response `json:"-"` 1745 // Value - Page values. 1746 Value *[]GroupContract `json:"value,omitempty"` 1747 // Count - Total record count number across all pages. 1748 Count *int64 `json:"count,omitempty"` 1749 // NextLink - Next page link if any. 1750 NextLink *string `json:"nextLink,omitempty"` 1751} 1752 1753// GroupCollectionIterator provides access to a complete listing of GroupContract values. 1754type GroupCollectionIterator struct { 1755 i int 1756 page GroupCollectionPage 1757} 1758 1759// NextWithContext advances to the next value. If there was an error making 1760// the request the iterator does not advance and the error is returned. 1761func (iter *GroupCollectionIterator) NextWithContext(ctx context.Context) (err error) { 1762 if tracing.IsEnabled() { 1763 ctx = tracing.StartSpan(ctx, fqdn+"/GroupCollectionIterator.NextWithContext") 1764 defer func() { 1765 sc := -1 1766 if iter.Response().Response.Response != nil { 1767 sc = iter.Response().Response.Response.StatusCode 1768 } 1769 tracing.EndSpan(ctx, sc, err) 1770 }() 1771 } 1772 iter.i++ 1773 if iter.i < len(iter.page.Values()) { 1774 return nil 1775 } 1776 err = iter.page.NextWithContext(ctx) 1777 if err != nil { 1778 iter.i-- 1779 return err 1780 } 1781 iter.i = 0 1782 return nil 1783} 1784 1785// Next advances to the next value. If there was an error making 1786// the request the iterator does not advance and the error is returned. 1787// Deprecated: Use NextWithContext() instead. 1788func (iter *GroupCollectionIterator) Next() error { 1789 return iter.NextWithContext(context.Background()) 1790} 1791 1792// NotDone returns true if the enumeration should be started or is not yet complete. 1793func (iter GroupCollectionIterator) NotDone() bool { 1794 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 1795} 1796 1797// Response returns the raw server response from the last page request. 1798func (iter GroupCollectionIterator) Response() GroupCollection { 1799 return iter.page.Response() 1800} 1801 1802// Value returns the current value or a zero-initialized value if the 1803// iterator has advanced beyond the end of the collection. 1804func (iter GroupCollectionIterator) Value() GroupContract { 1805 if !iter.page.NotDone() { 1806 return GroupContract{} 1807 } 1808 return iter.page.Values()[iter.i] 1809} 1810 1811// Creates a new instance of the GroupCollectionIterator type. 1812func NewGroupCollectionIterator(page GroupCollectionPage) GroupCollectionIterator { 1813 return GroupCollectionIterator{page: page} 1814} 1815 1816// IsEmpty returns true if the ListResult contains no values. 1817func (gc GroupCollection) IsEmpty() bool { 1818 return gc.Value == nil || len(*gc.Value) == 0 1819} 1820 1821// hasNextLink returns true if the NextLink is not empty. 1822func (gc GroupCollection) hasNextLink() bool { 1823 return gc.NextLink != nil && len(*gc.NextLink) != 0 1824} 1825 1826// groupCollectionPreparer prepares a request to retrieve the next set of results. 1827// It returns nil if no more results exist. 1828func (gc GroupCollection) groupCollectionPreparer(ctx context.Context) (*http.Request, error) { 1829 if !gc.hasNextLink() { 1830 return nil, nil 1831 } 1832 return autorest.Prepare((&http.Request{}).WithContext(ctx), 1833 autorest.AsJSON(), 1834 autorest.AsGet(), 1835 autorest.WithBaseURL(to.String(gc.NextLink))) 1836} 1837 1838// GroupCollectionPage contains a page of GroupContract values. 1839type GroupCollectionPage struct { 1840 fn func(context.Context, GroupCollection) (GroupCollection, error) 1841 gc GroupCollection 1842} 1843 1844// NextWithContext advances to the next page of values. If there was an error making 1845// the request the page does not advance and the error is returned. 1846func (page *GroupCollectionPage) NextWithContext(ctx context.Context) (err error) { 1847 if tracing.IsEnabled() { 1848 ctx = tracing.StartSpan(ctx, fqdn+"/GroupCollectionPage.NextWithContext") 1849 defer func() { 1850 sc := -1 1851 if page.Response().Response.Response != nil { 1852 sc = page.Response().Response.Response.StatusCode 1853 } 1854 tracing.EndSpan(ctx, sc, err) 1855 }() 1856 } 1857 for { 1858 next, err := page.fn(ctx, page.gc) 1859 if err != nil { 1860 return err 1861 } 1862 page.gc = next 1863 if !next.hasNextLink() || !next.IsEmpty() { 1864 break 1865 } 1866 } 1867 return nil 1868} 1869 1870// Next advances to the next page of values. If there was an error making 1871// the request the page does not advance and the error is returned. 1872// Deprecated: Use NextWithContext() instead. 1873func (page *GroupCollectionPage) Next() error { 1874 return page.NextWithContext(context.Background()) 1875} 1876 1877// NotDone returns true if the page enumeration should be started or is not yet complete. 1878func (page GroupCollectionPage) NotDone() bool { 1879 return !page.gc.IsEmpty() 1880} 1881 1882// Response returns the raw server response from the last page request. 1883func (page GroupCollectionPage) Response() GroupCollection { 1884 return page.gc 1885} 1886 1887// Values returns the slice of values for the current page or nil if there are no values. 1888func (page GroupCollectionPage) Values() []GroupContract { 1889 if page.gc.IsEmpty() { 1890 return nil 1891 } 1892 return *page.gc.Value 1893} 1894 1895// Creates a new instance of the GroupCollectionPage type. 1896func NewGroupCollectionPage(cur GroupCollection, getNextPage func(context.Context, GroupCollection) (GroupCollection, error)) GroupCollectionPage { 1897 return GroupCollectionPage{ 1898 fn: getNextPage, 1899 gc: cur, 1900 } 1901} 1902 1903// GroupContract developer group. 1904type GroupContract struct { 1905 autorest.Response `json:"-"` 1906 // ID - READ-ONLY; Uniquely identifies the group within the current API Management service instance. The value is a valid relative URL in the format of /groups/{groupId} where {groupId} is a group identifier. 1907 ID *string `json:"id,omitempty"` 1908 // Name - Group name. 1909 Name *string `json:"name,omitempty"` 1910 // Description - Group description. Can contain HTML formatting tags. 1911 Description *string `json:"description,omitempty"` 1912 // BuiltIn - READ-ONLY; true if the group is one of the three system groups (Administrators, Developers, or Guests); otherwise false. 1913 BuiltIn *bool `json:"builtIn,omitempty"` 1914 // Type - READ-ONLY; Group type. Possible values include: 'Custom', 'System', 'External' 1915 Type GroupTypeContract `json:"type,omitempty"` 1916 // ExternalID - READ-ONLY; 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. 1917 ExternalID *string `json:"externalId,omitempty"` 1918} 1919 1920// MarshalJSON is the custom marshaler for GroupContract. 1921func (gc GroupContract) MarshalJSON() ([]byte, error) { 1922 objectMap := make(map[string]interface{}) 1923 if gc.Name != nil { 1924 objectMap["name"] = gc.Name 1925 } 1926 if gc.Description != nil { 1927 objectMap["description"] = gc.Description 1928 } 1929 return json.Marshal(objectMap) 1930} 1931 1932// GroupCreateParameters parameters supplied to the Create Group operation. 1933type GroupCreateParameters struct { 1934 // Name - Group name. 1935 Name *string `json:"name,omitempty"` 1936 // Description - Group description. 1937 Description *string `json:"description,omitempty"` 1938 // Type - Group type. Possible values include: 'Custom', 'System', 'External' 1939 Type GroupTypeContract `json:"type,omitempty"` 1940 // 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. 1941 ExternalID *string `json:"externalId,omitempty"` 1942} 1943 1944// GroupUpdateParameters parameters supplied to the Update Group operation. 1945type GroupUpdateParameters struct { 1946 // Name - Group name. 1947 Name *string `json:"name,omitempty"` 1948 // Description - Group description. 1949 Description *string `json:"description,omitempty"` 1950 // Type - Group type. Possible values include: 'Custom', 'System', 'External' 1951 Type GroupTypeContract `json:"type,omitempty"` 1952 // 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. 1953 ExternalID *string `json:"externalId,omitempty"` 1954} 1955 1956// HostnameConfiguration custom hostname configuration. 1957type HostnameConfiguration struct { 1958 // Type - Hostname type. Possible values include: 'Proxy', 'Portal', 'Management', 'Scm' 1959 Type HostnameType `json:"type,omitempty"` 1960 // Hostname - Hostname. 1961 Hostname *string `json:"hostname,omitempty"` 1962 // Certificate - Certificate information. 1963 Certificate *CertificateInformation `json:"certificate,omitempty"` 1964} 1965 1966// IdentityProviderContract the external Identity Providers like Facebook, Google, Microsoft, Twitter or 1967// Azure Active Directory which can be used to enable access to the API Management service developer portal 1968// for all users. 1969type IdentityProviderContract struct { 1970 autorest.Response `json:"-"` 1971 // 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. 1972 ClientID *string `json:"clientId,omitempty"` 1973 // 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. 1974 ClientSecret *string `json:"clientSecret,omitempty"` 1975 // Type - Identity Provider Type identifier. Possible values include: 'Facebook', 'Google', 'Microsoft', 'Twitter', 'Aad', 'AadB2C' 1976 Type IdentityProviderNameType `json:"type,omitempty"` 1977 // AllowedTenants - List of Allowed Tenants when configuring Azure Active Directory login. 1978 AllowedTenants *[]string `json:"allowedTenants,omitempty"` 1979} 1980 1981// IdentityProviderList list of all the Identity Providers configured on the service instance. 1982type IdentityProviderList struct { 1983 autorest.Response `json:"-"` 1984 // Value - Identity Provider configuration values. 1985 Value *[]IdentityProviderContract `json:"value,omitempty"` 1986} 1987 1988// IdentityProviderUpdateParameters parameters supplied to the Update Identity Provider operation. 1989type IdentityProviderUpdateParameters struct { 1990 // 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. 1991 ClientID *string `json:"clientId,omitempty"` 1992 // 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. 1993 ClientSecret *string `json:"clientSecret,omitempty"` 1994 // AllowedTenants - List of Allowed Tenants when configuring Azure Active Directory login. 1995 AllowedTenants *[]string `json:"allowedTenants,omitempty"` 1996} 1997 1998// LoggerCollection paged Logger list representation. 1999type LoggerCollection struct { 2000 autorest.Response `json:"-"` 2001 // Value - Logger values. 2002 Value *[]LoggerResponse `json:"value,omitempty"` 2003 // Count - Total record count number across all pages. 2004 Count *int64 `json:"count,omitempty"` 2005 // NextLink - Next page link if any. 2006 NextLink *string `json:"nextLink,omitempty"` 2007} 2008 2009// LoggerCollectionIterator provides access to a complete listing of LoggerResponse values. 2010type LoggerCollectionIterator struct { 2011 i int 2012 page LoggerCollectionPage 2013} 2014 2015// NextWithContext advances to the next value. If there was an error making 2016// the request the iterator does not advance and the error is returned. 2017func (iter *LoggerCollectionIterator) NextWithContext(ctx context.Context) (err error) { 2018 if tracing.IsEnabled() { 2019 ctx = tracing.StartSpan(ctx, fqdn+"/LoggerCollectionIterator.NextWithContext") 2020 defer func() { 2021 sc := -1 2022 if iter.Response().Response.Response != nil { 2023 sc = iter.Response().Response.Response.StatusCode 2024 } 2025 tracing.EndSpan(ctx, sc, err) 2026 }() 2027 } 2028 iter.i++ 2029 if iter.i < len(iter.page.Values()) { 2030 return nil 2031 } 2032 err = iter.page.NextWithContext(ctx) 2033 if err != nil { 2034 iter.i-- 2035 return err 2036 } 2037 iter.i = 0 2038 return nil 2039} 2040 2041// Next advances to the next value. If there was an error making 2042// the request the iterator does not advance and the error is returned. 2043// Deprecated: Use NextWithContext() instead. 2044func (iter *LoggerCollectionIterator) Next() error { 2045 return iter.NextWithContext(context.Background()) 2046} 2047 2048// NotDone returns true if the enumeration should be started or is not yet complete. 2049func (iter LoggerCollectionIterator) NotDone() bool { 2050 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 2051} 2052 2053// Response returns the raw server response from the last page request. 2054func (iter LoggerCollectionIterator) Response() LoggerCollection { 2055 return iter.page.Response() 2056} 2057 2058// Value returns the current value or a zero-initialized value if the 2059// iterator has advanced beyond the end of the collection. 2060func (iter LoggerCollectionIterator) Value() LoggerResponse { 2061 if !iter.page.NotDone() { 2062 return LoggerResponse{} 2063 } 2064 return iter.page.Values()[iter.i] 2065} 2066 2067// Creates a new instance of the LoggerCollectionIterator type. 2068func NewLoggerCollectionIterator(page LoggerCollectionPage) LoggerCollectionIterator { 2069 return LoggerCollectionIterator{page: page} 2070} 2071 2072// IsEmpty returns true if the ListResult contains no values. 2073func (lc LoggerCollection) IsEmpty() bool { 2074 return lc.Value == nil || len(*lc.Value) == 0 2075} 2076 2077// hasNextLink returns true if the NextLink is not empty. 2078func (lc LoggerCollection) hasNextLink() bool { 2079 return lc.NextLink != nil && len(*lc.NextLink) != 0 2080} 2081 2082// loggerCollectionPreparer prepares a request to retrieve the next set of results. 2083// It returns nil if no more results exist. 2084func (lc LoggerCollection) loggerCollectionPreparer(ctx context.Context) (*http.Request, error) { 2085 if !lc.hasNextLink() { 2086 return nil, nil 2087 } 2088 return autorest.Prepare((&http.Request{}).WithContext(ctx), 2089 autorest.AsJSON(), 2090 autorest.AsGet(), 2091 autorest.WithBaseURL(to.String(lc.NextLink))) 2092} 2093 2094// LoggerCollectionPage contains a page of LoggerResponse values. 2095type LoggerCollectionPage struct { 2096 fn func(context.Context, LoggerCollection) (LoggerCollection, error) 2097 lc LoggerCollection 2098} 2099 2100// NextWithContext advances to the next page of values. If there was an error making 2101// the request the page does not advance and the error is returned. 2102func (page *LoggerCollectionPage) NextWithContext(ctx context.Context) (err error) { 2103 if tracing.IsEnabled() { 2104 ctx = tracing.StartSpan(ctx, fqdn+"/LoggerCollectionPage.NextWithContext") 2105 defer func() { 2106 sc := -1 2107 if page.Response().Response.Response != nil { 2108 sc = page.Response().Response.Response.StatusCode 2109 } 2110 tracing.EndSpan(ctx, sc, err) 2111 }() 2112 } 2113 for { 2114 next, err := page.fn(ctx, page.lc) 2115 if err != nil { 2116 return err 2117 } 2118 page.lc = next 2119 if !next.hasNextLink() || !next.IsEmpty() { 2120 break 2121 } 2122 } 2123 return nil 2124} 2125 2126// Next advances to the next page of values. If there was an error making 2127// the request the page does not advance and the error is returned. 2128// Deprecated: Use NextWithContext() instead. 2129func (page *LoggerCollectionPage) Next() error { 2130 return page.NextWithContext(context.Background()) 2131} 2132 2133// NotDone returns true if the page enumeration should be started or is not yet complete. 2134func (page LoggerCollectionPage) NotDone() bool { 2135 return !page.lc.IsEmpty() 2136} 2137 2138// Response returns the raw server response from the last page request. 2139func (page LoggerCollectionPage) Response() LoggerCollection { 2140 return page.lc 2141} 2142 2143// Values returns the slice of values for the current page or nil if there are no values. 2144func (page LoggerCollectionPage) Values() []LoggerResponse { 2145 if page.lc.IsEmpty() { 2146 return nil 2147 } 2148 return *page.lc.Value 2149} 2150 2151// Creates a new instance of the LoggerCollectionPage type. 2152func NewLoggerCollectionPage(cur LoggerCollection, getNextPage func(context.Context, LoggerCollection) (LoggerCollection, error)) LoggerCollectionPage { 2153 return LoggerCollectionPage{ 2154 fn: getNextPage, 2155 lc: cur, 2156 } 2157} 2158 2159// LoggerCreateParameters parameters supplied to the Create Logger operation. 2160type LoggerCreateParameters struct { 2161 // Type - Logger type. 2162 Type *string `json:"type,omitempty"` 2163 // Description - Logger description. 2164 Description *string `json:"description,omitempty"` 2165 // Credentials - The name and SendRule connection string of the event hub. 2166 Credentials map[string]*string `json:"credentials"` 2167 // IsBuffered - Whether records are buffered in the logger before publishing. Default is assumed to be true. 2168 IsBuffered *bool `json:"isBuffered,omitempty"` 2169} 2170 2171// MarshalJSON is the custom marshaler for LoggerCreateParameters. 2172func (lcp LoggerCreateParameters) MarshalJSON() ([]byte, error) { 2173 objectMap := make(map[string]interface{}) 2174 if lcp.Type != nil { 2175 objectMap["type"] = lcp.Type 2176 } 2177 if lcp.Description != nil { 2178 objectMap["description"] = lcp.Description 2179 } 2180 if lcp.Credentials != nil { 2181 objectMap["credentials"] = lcp.Credentials 2182 } 2183 if lcp.IsBuffered != nil { 2184 objectMap["isBuffered"] = lcp.IsBuffered 2185 } 2186 return json.Marshal(objectMap) 2187} 2188 2189// LoggerResponse the Logger entity in API Management represents an event sink that you can use to log API 2190// Management events. Currently the Logger entity supports logging API Management events to Azure Event 2191// Hubs. 2192type LoggerResponse struct { 2193 autorest.Response `json:"-"` 2194 // ID - READ-ONLY; Uniquely identifies the logger within the current API Management service instance. The value is a valid relative URL in the format of /loggers/{loggerId} where {loggerId} is a logger identifier. 2195 ID *string `json:"id,omitempty"` 2196 // Type - Logger type. 2197 Type *string `json:"type,omitempty"` 2198 // Description - Logger description. 2199 Description *string `json:"description,omitempty"` 2200 // Credentials - The name and SendRule connection string of the event hub. 2201 Credentials map[string]*string `json:"credentials"` 2202 // IsBuffered - Whether records are buffered in the logger before publishing. Default is assumed to be true. 2203 IsBuffered *bool `json:"isBuffered,omitempty"` 2204} 2205 2206// MarshalJSON is the custom marshaler for LoggerResponse. 2207func (lr LoggerResponse) MarshalJSON() ([]byte, error) { 2208 objectMap := make(map[string]interface{}) 2209 if lr.Type != nil { 2210 objectMap["type"] = lr.Type 2211 } 2212 if lr.Description != nil { 2213 objectMap["description"] = lr.Description 2214 } 2215 if lr.Credentials != nil { 2216 objectMap["credentials"] = lr.Credentials 2217 } 2218 if lr.IsBuffered != nil { 2219 objectMap["isBuffered"] = lr.IsBuffered 2220 } 2221 return json.Marshal(objectMap) 2222} 2223 2224// LoggerUpdateParameters parameters supplied to the Update Logger operation. 2225type LoggerUpdateParameters struct { 2226 // Type - Logger type. 2227 Type *string `json:"type,omitempty"` 2228 // Description - Logger description. 2229 Description *string `json:"description,omitempty"` 2230 // Credentials - Logger credentials. 2231 Credentials map[string]*string `json:"credentials"` 2232 // IsBuffered - whether records are buffered in the logger before publishing. Default is assumed to be true. 2233 IsBuffered *bool `json:"isBuffered,omitempty"` 2234} 2235 2236// MarshalJSON is the custom marshaler for LoggerUpdateParameters. 2237func (lup LoggerUpdateParameters) MarshalJSON() ([]byte, error) { 2238 objectMap := make(map[string]interface{}) 2239 if lup.Type != nil { 2240 objectMap["type"] = lup.Type 2241 } 2242 if lup.Description != nil { 2243 objectMap["description"] = lup.Description 2244 } 2245 if lup.Credentials != nil { 2246 objectMap["credentials"] = lup.Credentials 2247 } 2248 if lup.IsBuffered != nil { 2249 objectMap["isBuffered"] = lup.IsBuffered 2250 } 2251 return json.Marshal(objectMap) 2252} 2253 2254// NetworkStatusContract network Status details. 2255type NetworkStatusContract struct { 2256 autorest.Response `json:"-"` 2257 // DNSServers - Gets the list of DNS servers IPV4 addresses. 2258 DNSServers *[]string `json:"dnsServers,omitempty"` 2259 // ConnectivityStatus - Gets the list of Connectivity Status to the Resources. 2260 ConnectivityStatus *[]ConnectivityStatusContract `json:"connectivityStatus,omitempty"` 2261} 2262 2263// OAuth2AuthenticationSettingsContract API OAuth2 Authentication settings details. 2264type OAuth2AuthenticationSettingsContract struct { 2265 // AuthorizationServerID - OAuth authorization server identifier. 2266 AuthorizationServerID *string `json:"authorizationServerId,omitempty"` 2267 // Scope - operations scope. 2268 Scope *string `json:"scope,omitempty"` 2269} 2270 2271// OAuth2AuthorizationServerContract external OAuth authorization server settings. 2272type OAuth2AuthorizationServerContract struct { 2273 autorest.Response `json:"-"` 2274 // ID - READ-ONLY; Uniquely identifies the authorization server within the current API Management service instance. The value is a valid relative URL in the format of /authorizationServers/{authsid} where {authsid} is an authorization server identifier. 2275 ID *string `json:"id,omitempty"` 2276 // Name - User-friendly authorization server name. 2277 Name *string `json:"name,omitempty"` 2278 // Description - Description of the authorization server. Can contain HTML formatting tags. 2279 Description *string `json:"description,omitempty"` 2280 // ClientRegistrationEndpoint - Optional reference to a page where client or app registration for this authorization server is performed. Contains absolute URL to entity being referenced. 2281 ClientRegistrationEndpoint *string `json:"clientRegistrationEndpoint,omitempty"` 2282 // AuthorizationEndpoint - OAuth authorization endpoint. See http://tools.ietf.org/html/rfc6749#section-3.2. 2283 AuthorizationEndpoint *string `json:"authorizationEndpoint,omitempty"` 2284 // AuthorizationMethods - HTTP verbs supported by the authorization endpoint. GET must be always present. POST is optional. 2285 AuthorizationMethods *[]MethodContract `json:"authorizationMethods,omitempty"` 2286 // 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. 2287 ClientAuthenticationMethod *[]ClientAuthenticationMethodContract `json:"clientAuthenticationMethod,omitempty"` 2288 // 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"}. 2289 TokenBodyParameters *[]TokenBodyParameterContract `json:"tokenBodyParameters,omitempty"` 2290 // TokenEndpoint - OAuth token endpoint. Contains absolute URI to entity being referenced. 2291 TokenEndpoint *string `json:"tokenEndpoint,omitempty"` 2292 // 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. 2293 SupportState *bool `json:"supportState,omitempty"` 2294 // 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. 2295 DefaultScope *string `json:"defaultScope,omitempty"` 2296 // GrantTypes - Form of an authorization grant, which the client uses to request the access token. 2297 GrantTypes *[]GrantTypesContract `json:"grantTypes,omitempty"` 2298 // BearerTokenSendingMethods - Specifies the mechanism by which access token is passed to the API. 2299 BearerTokenSendingMethods *[]BearerTokenSendingMethodsContract `json:"bearerTokenSendingMethods,omitempty"` 2300 // ClientID - Client or app id registered with this authorization server. 2301 ClientID *string `json:"clientId,omitempty"` 2302 // ClientSecret - Client or app secret registered with this authorization server. 2303 ClientSecret *string `json:"clientSecret,omitempty"` 2304 // ResourceOwnerUsername - Can be optionally specified when resource owner password grant type is supported by this authorization server. Default resource owner username. 2305 ResourceOwnerUsername *string `json:"resourceOwnerUsername,omitempty"` 2306 // ResourceOwnerPassword - Can be optionally specified when resource owner password grant type is supported by this authorization server. Default resource owner password. 2307 ResourceOwnerPassword *string `json:"resourceOwnerPassword,omitempty"` 2308} 2309 2310// MarshalJSON is the custom marshaler for OAuth2AuthorizationServerContract. 2311func (oa2asc OAuth2AuthorizationServerContract) MarshalJSON() ([]byte, error) { 2312 objectMap := make(map[string]interface{}) 2313 if oa2asc.Name != nil { 2314 objectMap["name"] = oa2asc.Name 2315 } 2316 if oa2asc.Description != nil { 2317 objectMap["description"] = oa2asc.Description 2318 } 2319 if oa2asc.ClientRegistrationEndpoint != nil { 2320 objectMap["clientRegistrationEndpoint"] = oa2asc.ClientRegistrationEndpoint 2321 } 2322 if oa2asc.AuthorizationEndpoint != nil { 2323 objectMap["authorizationEndpoint"] = oa2asc.AuthorizationEndpoint 2324 } 2325 if oa2asc.AuthorizationMethods != nil { 2326 objectMap["authorizationMethods"] = oa2asc.AuthorizationMethods 2327 } 2328 if oa2asc.ClientAuthenticationMethod != nil { 2329 objectMap["clientAuthenticationMethod"] = oa2asc.ClientAuthenticationMethod 2330 } 2331 if oa2asc.TokenBodyParameters != nil { 2332 objectMap["tokenBodyParameters"] = oa2asc.TokenBodyParameters 2333 } 2334 if oa2asc.TokenEndpoint != nil { 2335 objectMap["tokenEndpoint"] = oa2asc.TokenEndpoint 2336 } 2337 if oa2asc.SupportState != nil { 2338 objectMap["supportState"] = oa2asc.SupportState 2339 } 2340 if oa2asc.DefaultScope != nil { 2341 objectMap["defaultScope"] = oa2asc.DefaultScope 2342 } 2343 if oa2asc.GrantTypes != nil { 2344 objectMap["grantTypes"] = oa2asc.GrantTypes 2345 } 2346 if oa2asc.BearerTokenSendingMethods != nil { 2347 objectMap["bearerTokenSendingMethods"] = oa2asc.BearerTokenSendingMethods 2348 } 2349 if oa2asc.ClientID != nil { 2350 objectMap["clientId"] = oa2asc.ClientID 2351 } 2352 if oa2asc.ClientSecret != nil { 2353 objectMap["clientSecret"] = oa2asc.ClientSecret 2354 } 2355 if oa2asc.ResourceOwnerUsername != nil { 2356 objectMap["resourceOwnerUsername"] = oa2asc.ResourceOwnerUsername 2357 } 2358 if oa2asc.ResourceOwnerPassword != nil { 2359 objectMap["resourceOwnerPassword"] = oa2asc.ResourceOwnerPassword 2360 } 2361 return json.Marshal(objectMap) 2362} 2363 2364// OAuth2AuthorizationServerUpdateContract external OAuth authorization server Update settings contract. 2365type OAuth2AuthorizationServerUpdateContract struct { 2366 // Name - User-friendly authorization server name. 2367 Name *string `json:"name,omitempty"` 2368 // Description - Description of the authorization server. Can contain HTML formatting tags. 2369 Description *string `json:"description,omitempty"` 2370 // ClientRegistrationEndpoint - Optional reference to a page where client or app registration for this authorization server is performed. Contains absolute URL to entity being referenced. 2371 ClientRegistrationEndpoint *string `json:"clientRegistrationEndpoint,omitempty"` 2372 // AuthorizationEndpoint - OAuth authorization endpoint. See http://tools.ietf.org/html/rfc6749#section-3.2. 2373 AuthorizationEndpoint *string `json:"authorizationEndpoint,omitempty"` 2374 // AuthorizationMethods - HTTP verbs supported by the authorization endpoint. GET must be always present. POST is optional. 2375 AuthorizationMethods *[]MethodContract `json:"authorizationMethods,omitempty"` 2376 // 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. 2377 ClientAuthenticationMethod *[]ClientAuthenticationMethodContract `json:"clientAuthenticationMethod,omitempty"` 2378 // 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"}. 2379 TokenBodyParameters *[]TokenBodyParameterContract `json:"tokenBodyParameters,omitempty"` 2380 // TokenEndpoint - OAuth token endpoint. Contains absolute URI to entity being referenced. 2381 TokenEndpoint *string `json:"tokenEndpoint,omitempty"` 2382 // 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. 2383 SupportState *bool `json:"supportState,omitempty"` 2384 // 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. 2385 DefaultScope *string `json:"defaultScope,omitempty"` 2386 // GrantTypes - Form of an authorization grant, which the client uses to request the access token. 2387 GrantTypes *[]GrantTypesContract `json:"grantTypes,omitempty"` 2388 // BearerTokenSendingMethods - Specifies the mechanism by which access token is passed to the API. 2389 BearerTokenSendingMethods *[]BearerTokenSendingMethodsContract `json:"bearerTokenSendingMethods,omitempty"` 2390 // ClientID - Client or app id registered with this authorization server. 2391 ClientID *string `json:"clientId,omitempty"` 2392 // ClientSecret - Client or app secret registered with this authorization server. 2393 ClientSecret *string `json:"clientSecret,omitempty"` 2394 // ResourceOwnerUsername - Can be optionally specified when resource owner password grant type is supported by this authorization server. Default resource owner username. 2395 ResourceOwnerUsername *string `json:"resourceOwnerUsername,omitempty"` 2396 // ResourceOwnerPassword - Can be optionally specified when resource owner password grant type is supported by this authorization server. Default resource owner password. 2397 ResourceOwnerPassword *string `json:"resourceOwnerPassword,omitempty"` 2398} 2399 2400// OpenIDConnectProviderCollection paged OpenIdProviders list representation. 2401type OpenIDConnectProviderCollection struct { 2402 autorest.Response `json:"-"` 2403 // Value - Page values. 2404 Value *[]OpenidConnectProviderContract `json:"value,omitempty"` 2405 // Count - Total record count number across all pages. 2406 Count *int64 `json:"count,omitempty"` 2407 // NextLink - Next page link if any. 2408 NextLink *string `json:"nextLink,omitempty"` 2409} 2410 2411// OpenIDConnectProviderCollectionIterator provides access to a complete listing of 2412// OpenidConnectProviderContract values. 2413type OpenIDConnectProviderCollectionIterator struct { 2414 i int 2415 page OpenIDConnectProviderCollectionPage 2416} 2417 2418// NextWithContext advances to the next value. If there was an error making 2419// the request the iterator does not advance and the error is returned. 2420func (iter *OpenIDConnectProviderCollectionIterator) NextWithContext(ctx context.Context) (err error) { 2421 if tracing.IsEnabled() { 2422 ctx = tracing.StartSpan(ctx, fqdn+"/OpenIDConnectProviderCollectionIterator.NextWithContext") 2423 defer func() { 2424 sc := -1 2425 if iter.Response().Response.Response != nil { 2426 sc = iter.Response().Response.Response.StatusCode 2427 } 2428 tracing.EndSpan(ctx, sc, err) 2429 }() 2430 } 2431 iter.i++ 2432 if iter.i < len(iter.page.Values()) { 2433 return nil 2434 } 2435 err = iter.page.NextWithContext(ctx) 2436 if err != nil { 2437 iter.i-- 2438 return err 2439 } 2440 iter.i = 0 2441 return nil 2442} 2443 2444// Next advances to the next value. If there was an error making 2445// the request the iterator does not advance and the error is returned. 2446// Deprecated: Use NextWithContext() instead. 2447func (iter *OpenIDConnectProviderCollectionIterator) Next() error { 2448 return iter.NextWithContext(context.Background()) 2449} 2450 2451// NotDone returns true if the enumeration should be started or is not yet complete. 2452func (iter OpenIDConnectProviderCollectionIterator) NotDone() bool { 2453 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 2454} 2455 2456// Response returns the raw server response from the last page request. 2457func (iter OpenIDConnectProviderCollectionIterator) Response() OpenIDConnectProviderCollection { 2458 return iter.page.Response() 2459} 2460 2461// Value returns the current value or a zero-initialized value if the 2462// iterator has advanced beyond the end of the collection. 2463func (iter OpenIDConnectProviderCollectionIterator) Value() OpenidConnectProviderContract { 2464 if !iter.page.NotDone() { 2465 return OpenidConnectProviderContract{} 2466 } 2467 return iter.page.Values()[iter.i] 2468} 2469 2470// Creates a new instance of the OpenIDConnectProviderCollectionIterator type. 2471func NewOpenIDConnectProviderCollectionIterator(page OpenIDConnectProviderCollectionPage) OpenIDConnectProviderCollectionIterator { 2472 return OpenIDConnectProviderCollectionIterator{page: page} 2473} 2474 2475// IsEmpty returns true if the ListResult contains no values. 2476func (oicpc OpenIDConnectProviderCollection) IsEmpty() bool { 2477 return oicpc.Value == nil || len(*oicpc.Value) == 0 2478} 2479 2480// hasNextLink returns true if the NextLink is not empty. 2481func (oicpc OpenIDConnectProviderCollection) hasNextLink() bool { 2482 return oicpc.NextLink != nil && len(*oicpc.NextLink) != 0 2483} 2484 2485// openIDConnectProviderCollectionPreparer prepares a request to retrieve the next set of results. 2486// It returns nil if no more results exist. 2487func (oicpc OpenIDConnectProviderCollection) openIDConnectProviderCollectionPreparer(ctx context.Context) (*http.Request, error) { 2488 if !oicpc.hasNextLink() { 2489 return nil, nil 2490 } 2491 return autorest.Prepare((&http.Request{}).WithContext(ctx), 2492 autorest.AsJSON(), 2493 autorest.AsGet(), 2494 autorest.WithBaseURL(to.String(oicpc.NextLink))) 2495} 2496 2497// OpenIDConnectProviderCollectionPage contains a page of OpenidConnectProviderContract values. 2498type OpenIDConnectProviderCollectionPage struct { 2499 fn func(context.Context, OpenIDConnectProviderCollection) (OpenIDConnectProviderCollection, error) 2500 oicpc OpenIDConnectProviderCollection 2501} 2502 2503// NextWithContext advances to the next page of values. If there was an error making 2504// the request the page does not advance and the error is returned. 2505func (page *OpenIDConnectProviderCollectionPage) NextWithContext(ctx context.Context) (err error) { 2506 if tracing.IsEnabled() { 2507 ctx = tracing.StartSpan(ctx, fqdn+"/OpenIDConnectProviderCollectionPage.NextWithContext") 2508 defer func() { 2509 sc := -1 2510 if page.Response().Response.Response != nil { 2511 sc = page.Response().Response.Response.StatusCode 2512 } 2513 tracing.EndSpan(ctx, sc, err) 2514 }() 2515 } 2516 for { 2517 next, err := page.fn(ctx, page.oicpc) 2518 if err != nil { 2519 return err 2520 } 2521 page.oicpc = next 2522 if !next.hasNextLink() || !next.IsEmpty() { 2523 break 2524 } 2525 } 2526 return nil 2527} 2528 2529// Next advances to the next page of values. If there was an error making 2530// the request the page does not advance and the error is returned. 2531// Deprecated: Use NextWithContext() instead. 2532func (page *OpenIDConnectProviderCollectionPage) Next() error { 2533 return page.NextWithContext(context.Background()) 2534} 2535 2536// NotDone returns true if the page enumeration should be started or is not yet complete. 2537func (page OpenIDConnectProviderCollectionPage) NotDone() bool { 2538 return !page.oicpc.IsEmpty() 2539} 2540 2541// Response returns the raw server response from the last page request. 2542func (page OpenIDConnectProviderCollectionPage) Response() OpenIDConnectProviderCollection { 2543 return page.oicpc 2544} 2545 2546// Values returns the slice of values for the current page or nil if there are no values. 2547func (page OpenIDConnectProviderCollectionPage) Values() []OpenidConnectProviderContract { 2548 if page.oicpc.IsEmpty() { 2549 return nil 2550 } 2551 return *page.oicpc.Value 2552} 2553 2554// Creates a new instance of the OpenIDConnectProviderCollectionPage type. 2555func NewOpenIDConnectProviderCollectionPage(cur OpenIDConnectProviderCollection, getNextPage func(context.Context, OpenIDConnectProviderCollection) (OpenIDConnectProviderCollection, error)) OpenIDConnectProviderCollectionPage { 2556 return OpenIDConnectProviderCollectionPage{ 2557 fn: getNextPage, 2558 oicpc: cur, 2559 } 2560} 2561 2562// OpenidConnectProviderContract openID Connect Providers Contract. 2563type OpenidConnectProviderContract struct { 2564 autorest.Response `json:"-"` 2565 // ID - OpenID Connect Provider identifier. 2566 ID *string `json:"id,omitempty"` 2567 // Name - User-friendly OpenID Connect Provider name. 2568 Name *string `json:"name,omitempty"` 2569 // Description - User-friendly description of OpenID Connect Provider. 2570 Description *string `json:"description,omitempty"` 2571 // MetadataEndpoint - Metadata endpoint URI. 2572 MetadataEndpoint *string `json:"metadataEndpoint,omitempty"` 2573 // ClientID - Client ID of developer console which is the client application. 2574 ClientID *string `json:"clientId,omitempty"` 2575 // ClientSecret - Client Secret of developer console which is the client application. 2576 ClientSecret *string `json:"clientSecret,omitempty"` 2577} 2578 2579// OpenidConnectProviderCreateContract parameters supplied to the Create OpenID Connect Provider operation. 2580type OpenidConnectProviderCreateContract struct { 2581 // Name - User-friendly OpenID Connect Provider name. 2582 Name *string `json:"name,omitempty"` 2583 // Description - User-friendly description of OpenID Connect Provider. 2584 Description *string `json:"description,omitempty"` 2585 // MetadataEndpoint - Metadata endpoint URI. 2586 MetadataEndpoint *string `json:"metadataEndpoint,omitempty"` 2587 // ClientID - Client ID of developer console which is the client application. 2588 ClientID *string `json:"clientId,omitempty"` 2589 // ClientSecret - Client Secret of developer console which is the client application. 2590 ClientSecret *string `json:"clientSecret,omitempty"` 2591} 2592 2593// OpenidConnectProviderUpdateContract parameters supplied to the Update OpenID Connect Provider operation. 2594type OpenidConnectProviderUpdateContract struct { 2595 // Name - User-friendly OpenID Connect Provider name. 2596 Name *string `json:"name,omitempty"` 2597 // Description - User-friendly description of OpenID Connect Provider. 2598 Description *string `json:"description,omitempty"` 2599 // MetadataEndpoint - Metadata endpoint URI. 2600 MetadataEndpoint *string `json:"metadataEndpoint,omitempty"` 2601 // ClientID - Client ID of developer console which is the client application. 2602 ClientID *string `json:"clientId,omitempty"` 2603 // ClientSecret - Client Secret of developer console which is the client application. 2604 ClientSecret *string `json:"clientSecret,omitempty"` 2605} 2606 2607// Operation REST API operation 2608type Operation struct { 2609 // Name - Operation name: {provider}/{resource}/{operation} 2610 Name *string `json:"name,omitempty"` 2611 // Display - The object that describes the operation. 2612 Display *OperationDisplay `json:"display,omitempty"` 2613} 2614 2615// OperationCollection paged Operation list representation. 2616type OperationCollection struct { 2617 autorest.Response `json:"-"` 2618 // Value - Page values. 2619 Value *[]OperationContract `json:"value,omitempty"` 2620 // Count - Total record count number across all pages. 2621 Count *int64 `json:"count,omitempty"` 2622 // NextLink - Next page link if any. 2623 NextLink *string `json:"nextLink,omitempty"` 2624} 2625 2626// OperationCollectionIterator provides access to a complete listing of OperationContract values. 2627type OperationCollectionIterator struct { 2628 i int 2629 page OperationCollectionPage 2630} 2631 2632// NextWithContext advances to the next value. If there was an error making 2633// the request the iterator does not advance and the error is returned. 2634func (iter *OperationCollectionIterator) NextWithContext(ctx context.Context) (err error) { 2635 if tracing.IsEnabled() { 2636 ctx = tracing.StartSpan(ctx, fqdn+"/OperationCollectionIterator.NextWithContext") 2637 defer func() { 2638 sc := -1 2639 if iter.Response().Response.Response != nil { 2640 sc = iter.Response().Response.Response.StatusCode 2641 } 2642 tracing.EndSpan(ctx, sc, err) 2643 }() 2644 } 2645 iter.i++ 2646 if iter.i < len(iter.page.Values()) { 2647 return nil 2648 } 2649 err = iter.page.NextWithContext(ctx) 2650 if err != nil { 2651 iter.i-- 2652 return err 2653 } 2654 iter.i = 0 2655 return nil 2656} 2657 2658// Next advances to the next value. If there was an error making 2659// the request the iterator does not advance and the error is returned. 2660// Deprecated: Use NextWithContext() instead. 2661func (iter *OperationCollectionIterator) Next() error { 2662 return iter.NextWithContext(context.Background()) 2663} 2664 2665// NotDone returns true if the enumeration should be started or is not yet complete. 2666func (iter OperationCollectionIterator) NotDone() bool { 2667 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 2668} 2669 2670// Response returns the raw server response from the last page request. 2671func (iter OperationCollectionIterator) Response() OperationCollection { 2672 return iter.page.Response() 2673} 2674 2675// Value returns the current value or a zero-initialized value if the 2676// iterator has advanced beyond the end of the collection. 2677func (iter OperationCollectionIterator) Value() OperationContract { 2678 if !iter.page.NotDone() { 2679 return OperationContract{} 2680 } 2681 return iter.page.Values()[iter.i] 2682} 2683 2684// Creates a new instance of the OperationCollectionIterator type. 2685func NewOperationCollectionIterator(page OperationCollectionPage) OperationCollectionIterator { 2686 return OperationCollectionIterator{page: page} 2687} 2688 2689// IsEmpty returns true if the ListResult contains no values. 2690func (oc OperationCollection) IsEmpty() bool { 2691 return oc.Value == nil || len(*oc.Value) == 0 2692} 2693 2694// hasNextLink returns true if the NextLink is not empty. 2695func (oc OperationCollection) hasNextLink() bool { 2696 return oc.NextLink != nil && len(*oc.NextLink) != 0 2697} 2698 2699// operationCollectionPreparer prepares a request to retrieve the next set of results. 2700// It returns nil if no more results exist. 2701func (oc OperationCollection) operationCollectionPreparer(ctx context.Context) (*http.Request, error) { 2702 if !oc.hasNextLink() { 2703 return nil, nil 2704 } 2705 return autorest.Prepare((&http.Request{}).WithContext(ctx), 2706 autorest.AsJSON(), 2707 autorest.AsGet(), 2708 autorest.WithBaseURL(to.String(oc.NextLink))) 2709} 2710 2711// OperationCollectionPage contains a page of OperationContract values. 2712type OperationCollectionPage struct { 2713 fn func(context.Context, OperationCollection) (OperationCollection, error) 2714 oc OperationCollection 2715} 2716 2717// NextWithContext advances to the next page of values. If there was an error making 2718// the request the page does not advance and the error is returned. 2719func (page *OperationCollectionPage) NextWithContext(ctx context.Context) (err error) { 2720 if tracing.IsEnabled() { 2721 ctx = tracing.StartSpan(ctx, fqdn+"/OperationCollectionPage.NextWithContext") 2722 defer func() { 2723 sc := -1 2724 if page.Response().Response.Response != nil { 2725 sc = page.Response().Response.Response.StatusCode 2726 } 2727 tracing.EndSpan(ctx, sc, err) 2728 }() 2729 } 2730 for { 2731 next, err := page.fn(ctx, page.oc) 2732 if err != nil { 2733 return err 2734 } 2735 page.oc = next 2736 if !next.hasNextLink() || !next.IsEmpty() { 2737 break 2738 } 2739 } 2740 return nil 2741} 2742 2743// Next advances to the next page of values. If there was an error making 2744// the request the page does not advance and the error is returned. 2745// Deprecated: Use NextWithContext() instead. 2746func (page *OperationCollectionPage) Next() error { 2747 return page.NextWithContext(context.Background()) 2748} 2749 2750// NotDone returns true if the page enumeration should be started or is not yet complete. 2751func (page OperationCollectionPage) NotDone() bool { 2752 return !page.oc.IsEmpty() 2753} 2754 2755// Response returns the raw server response from the last page request. 2756func (page OperationCollectionPage) Response() OperationCollection { 2757 return page.oc 2758} 2759 2760// Values returns the slice of values for the current page or nil if there are no values. 2761func (page OperationCollectionPage) Values() []OperationContract { 2762 if page.oc.IsEmpty() { 2763 return nil 2764 } 2765 return *page.oc.Value 2766} 2767 2768// Creates a new instance of the OperationCollectionPage type. 2769func NewOperationCollectionPage(cur OperationCollection, getNextPage func(context.Context, OperationCollection) (OperationCollection, error)) OperationCollectionPage { 2770 return OperationCollectionPage{ 2771 fn: getNextPage, 2772 oc: cur, 2773 } 2774} 2775 2776// OperationContract api Operation details. 2777type OperationContract struct { 2778 autorest.Response `json:"-"` 2779 // ID - READ-ONLY; Uniquely identifies the operation within the current API Management service instance. The value is a valid relative URL in the format of /apis/{aid}/operations/{id} where {aid} is an API identifier and {id} is an operation identifier. 2780 ID *string `json:"id,omitempty"` 2781 // Name - Operation Name. 2782 Name *string `json:"name,omitempty"` 2783 // Method - A Valid HTTP Operation Method. Typical Http Methods like GET, PUT, POST but not limited by only them. 2784 Method *string `json:"method,omitempty"` 2785 // URLTemplate - Relative URL template identifying the target resource for this operation. May include parameters. Example: /customers/{cid}/orders/{oid}/?date={date} 2786 URLTemplate *string `json:"urlTemplate,omitempty"` 2787 // TemplateParameters - Collection of URL template parameters. 2788 TemplateParameters *[]ParameterContract `json:"templateParameters,omitempty"` 2789 // Description - Description of the operation. May include HTML formatting tags. 2790 Description *string `json:"description,omitempty"` 2791 // Request - An entity containing request details. 2792 Request *RequestContract `json:"request,omitempty"` 2793 // Responses - Array of Operation responses. 2794 Responses *[]ResultContract `json:"responses,omitempty"` 2795} 2796 2797// MarshalJSON is the custom marshaler for OperationContract. 2798func (oc OperationContract) MarshalJSON() ([]byte, error) { 2799 objectMap := make(map[string]interface{}) 2800 if oc.Name != nil { 2801 objectMap["name"] = oc.Name 2802 } 2803 if oc.Method != nil { 2804 objectMap["method"] = oc.Method 2805 } 2806 if oc.URLTemplate != nil { 2807 objectMap["urlTemplate"] = oc.URLTemplate 2808 } 2809 if oc.TemplateParameters != nil { 2810 objectMap["templateParameters"] = oc.TemplateParameters 2811 } 2812 if oc.Description != nil { 2813 objectMap["description"] = oc.Description 2814 } 2815 if oc.Request != nil { 2816 objectMap["request"] = oc.Request 2817 } 2818 if oc.Responses != nil { 2819 objectMap["responses"] = oc.Responses 2820 } 2821 return json.Marshal(objectMap) 2822} 2823 2824// OperationDisplay the object that describes the operation. 2825type OperationDisplay struct { 2826 // Provider - Friendly name of the resource provider 2827 Provider *string `json:"provider,omitempty"` 2828 // Operation - Operation type: read, write, delete, listKeys/action, etc. 2829 Operation *string `json:"operation,omitempty"` 2830 // Resource - Resource type on which the operation is performed. 2831 Resource *string `json:"resource,omitempty"` 2832 // Description - Friendly name of the operation 2833 Description *string `json:"description,omitempty"` 2834} 2835 2836// OperationEntityBaseContract api Operation Entity Base Contract details. 2837type OperationEntityBaseContract struct { 2838 // TemplateParameters - Collection of URL template parameters. 2839 TemplateParameters *[]ParameterContract `json:"templateParameters,omitempty"` 2840 // Description - Description of the operation. May include HTML formatting tags. 2841 Description *string `json:"description,omitempty"` 2842 // Request - An entity containing request details. 2843 Request *RequestContract `json:"request,omitempty"` 2844 // Responses - Array of Operation responses. 2845 Responses *[]ResultContract `json:"responses,omitempty"` 2846} 2847 2848// OperationListResult result of the request to list REST API operations. It contains a list of operations 2849// and a URL nextLink to get the next set of results. 2850type OperationListResult struct { 2851 autorest.Response `json:"-"` 2852 // Value - List of operations supported by the resource provider. 2853 Value *[]Operation `json:"value,omitempty"` 2854 // NextLink - URL to get the next set of operation list results if there are any. 2855 NextLink *string `json:"nextLink,omitempty"` 2856} 2857 2858// OperationListResultIterator provides access to a complete listing of Operation values. 2859type OperationListResultIterator struct { 2860 i int 2861 page OperationListResultPage 2862} 2863 2864// NextWithContext advances to the next value. If there was an error making 2865// the request the iterator does not advance and the error is returned. 2866func (iter *OperationListResultIterator) NextWithContext(ctx context.Context) (err error) { 2867 if tracing.IsEnabled() { 2868 ctx = tracing.StartSpan(ctx, fqdn+"/OperationListResultIterator.NextWithContext") 2869 defer func() { 2870 sc := -1 2871 if iter.Response().Response.Response != nil { 2872 sc = iter.Response().Response.Response.StatusCode 2873 } 2874 tracing.EndSpan(ctx, sc, err) 2875 }() 2876 } 2877 iter.i++ 2878 if iter.i < len(iter.page.Values()) { 2879 return nil 2880 } 2881 err = iter.page.NextWithContext(ctx) 2882 if err != nil { 2883 iter.i-- 2884 return err 2885 } 2886 iter.i = 0 2887 return nil 2888} 2889 2890// Next advances to the next value. If there was an error making 2891// the request the iterator does not advance and the error is returned. 2892// Deprecated: Use NextWithContext() instead. 2893func (iter *OperationListResultIterator) Next() error { 2894 return iter.NextWithContext(context.Background()) 2895} 2896 2897// NotDone returns true if the enumeration should be started or is not yet complete. 2898func (iter OperationListResultIterator) NotDone() bool { 2899 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 2900} 2901 2902// Response returns the raw server response from the last page request. 2903func (iter OperationListResultIterator) Response() OperationListResult { 2904 return iter.page.Response() 2905} 2906 2907// Value returns the current value or a zero-initialized value if the 2908// iterator has advanced beyond the end of the collection. 2909func (iter OperationListResultIterator) Value() Operation { 2910 if !iter.page.NotDone() { 2911 return Operation{} 2912 } 2913 return iter.page.Values()[iter.i] 2914} 2915 2916// Creates a new instance of the OperationListResultIterator type. 2917func NewOperationListResultIterator(page OperationListResultPage) OperationListResultIterator { 2918 return OperationListResultIterator{page: page} 2919} 2920 2921// IsEmpty returns true if the ListResult contains no values. 2922func (olr OperationListResult) IsEmpty() bool { 2923 return olr.Value == nil || len(*olr.Value) == 0 2924} 2925 2926// hasNextLink returns true if the NextLink is not empty. 2927func (olr OperationListResult) hasNextLink() bool { 2928 return olr.NextLink != nil && len(*olr.NextLink) != 0 2929} 2930 2931// operationListResultPreparer prepares a request to retrieve the next set of results. 2932// It returns nil if no more results exist. 2933func (olr OperationListResult) operationListResultPreparer(ctx context.Context) (*http.Request, error) { 2934 if !olr.hasNextLink() { 2935 return nil, nil 2936 } 2937 return autorest.Prepare((&http.Request{}).WithContext(ctx), 2938 autorest.AsJSON(), 2939 autorest.AsGet(), 2940 autorest.WithBaseURL(to.String(olr.NextLink))) 2941} 2942 2943// OperationListResultPage contains a page of Operation values. 2944type OperationListResultPage struct { 2945 fn func(context.Context, OperationListResult) (OperationListResult, error) 2946 olr OperationListResult 2947} 2948 2949// NextWithContext advances to the next page of values. If there was an error making 2950// the request the page does not advance and the error is returned. 2951func (page *OperationListResultPage) NextWithContext(ctx context.Context) (err error) { 2952 if tracing.IsEnabled() { 2953 ctx = tracing.StartSpan(ctx, fqdn+"/OperationListResultPage.NextWithContext") 2954 defer func() { 2955 sc := -1 2956 if page.Response().Response.Response != nil { 2957 sc = page.Response().Response.Response.StatusCode 2958 } 2959 tracing.EndSpan(ctx, sc, err) 2960 }() 2961 } 2962 for { 2963 next, err := page.fn(ctx, page.olr) 2964 if err != nil { 2965 return err 2966 } 2967 page.olr = next 2968 if !next.hasNextLink() || !next.IsEmpty() { 2969 break 2970 } 2971 } 2972 return nil 2973} 2974 2975// Next advances to the next page of values. If there was an error making 2976// the request the page does not advance and the error is returned. 2977// Deprecated: Use NextWithContext() instead. 2978func (page *OperationListResultPage) Next() error { 2979 return page.NextWithContext(context.Background()) 2980} 2981 2982// NotDone returns true if the page enumeration should be started or is not yet complete. 2983func (page OperationListResultPage) NotDone() bool { 2984 return !page.olr.IsEmpty() 2985} 2986 2987// Response returns the raw server response from the last page request. 2988func (page OperationListResultPage) Response() OperationListResult { 2989 return page.olr 2990} 2991 2992// Values returns the slice of values for the current page or nil if there are no values. 2993func (page OperationListResultPage) Values() []Operation { 2994 if page.olr.IsEmpty() { 2995 return nil 2996 } 2997 return *page.olr.Value 2998} 2999 3000// Creates a new instance of the OperationListResultPage type. 3001func NewOperationListResultPage(cur OperationListResult, getNextPage func(context.Context, OperationListResult) (OperationListResult, error)) OperationListResultPage { 3002 return OperationListResultPage{ 3003 fn: getNextPage, 3004 olr: cur, 3005 } 3006} 3007 3008// OperationResultContract operation Result. 3009type OperationResultContract struct { 3010 autorest.Response `json:"-"` 3011 // ID - Operation result identifier. 3012 ID *string `json:"id,omitempty"` 3013 // Status - Status of an async operation. Possible values include: 'Started', 'InProgress', 'Succeeded', 'Failed' 3014 Status AsyncOperationState `json:"status,omitempty"` 3015 // 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. 3016 Started *date.Time `json:"started,omitempty"` 3017 // 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. 3018 Updated *date.Time `json:"updated,omitempty"` 3019 // ResultInfo - Optional result info. 3020 ResultInfo *string `json:"resultInfo,omitempty"` 3021 Error *ErrorBodyContract `json:"error,omitempty"` 3022} 3023 3024// OperationUpdateContract api Operation Update Contract details. 3025type OperationUpdateContract struct { 3026 // ID - READ-ONLY; Uniquely identifies the operation within the current API Management service instance. The value is a valid relative URL in the format of /apis/{aid}/operations/{id} where {aid} is an API identifier and {id} is an operation identifier. 3027 ID *string `json:"id,omitempty"` 3028 // Name - Operation Name. 3029 Name *string `json:"name,omitempty"` 3030 // Method - A Valid HTTP Operation Method. Typical Http Methods like GET, PUT, POST but not limited by only them. 3031 Method *string `json:"method,omitempty"` 3032 // URLTemplate - Relative URL template identifying the target resource for this operation. May include parameters. Example: /customers/{cid}/orders/{oid}/?date={date} 3033 URLTemplate *string `json:"urlTemplate,omitempty"` 3034 // TemplateParameters - Collection of URL template parameters. 3035 TemplateParameters *[]ParameterContract `json:"templateParameters,omitempty"` 3036 // Description - Description of the operation. May include HTML formatting tags. 3037 Description *string `json:"description,omitempty"` 3038 // Request - An entity containing request details. 3039 Request *RequestContract `json:"request,omitempty"` 3040 // Responses - Array of Operation responses. 3041 Responses *[]ResultContract `json:"responses,omitempty"` 3042} 3043 3044// MarshalJSON is the custom marshaler for OperationUpdateContract. 3045func (ouc OperationUpdateContract) MarshalJSON() ([]byte, error) { 3046 objectMap := make(map[string]interface{}) 3047 if ouc.Name != nil { 3048 objectMap["name"] = ouc.Name 3049 } 3050 if ouc.Method != nil { 3051 objectMap["method"] = ouc.Method 3052 } 3053 if ouc.URLTemplate != nil { 3054 objectMap["urlTemplate"] = ouc.URLTemplate 3055 } 3056 if ouc.TemplateParameters != nil { 3057 objectMap["templateParameters"] = ouc.TemplateParameters 3058 } 3059 if ouc.Description != nil { 3060 objectMap["description"] = ouc.Description 3061 } 3062 if ouc.Request != nil { 3063 objectMap["request"] = ouc.Request 3064 } 3065 if ouc.Responses != nil { 3066 objectMap["responses"] = ouc.Responses 3067 } 3068 return json.Marshal(objectMap) 3069} 3070 3071// ParameterContract operation parameters details. 3072type ParameterContract struct { 3073 // Name - Parameter name. 3074 Name *string `json:"name,omitempty"` 3075 // Description - Parameter description. 3076 Description *string `json:"description,omitempty"` 3077 // Type - Parameter type. 3078 Type *string `json:"type,omitempty"` 3079 // DefaultValue - Default parameter value. 3080 DefaultValue *string `json:"defaultValue,omitempty"` 3081 // Required - whether parameter is required or not. 3082 Required *bool `json:"required,omitempty"` 3083 // Values - Parameter values. 3084 Values *[]string `json:"values,omitempty"` 3085} 3086 3087// PolicySnippetContract policy snippet. 3088type PolicySnippetContract struct { 3089 // Name - READ-ONLY; Snippet name. 3090 Name *string `json:"name,omitempty"` 3091 // Content - READ-ONLY; Snippet content. 3092 Content *string `json:"content,omitempty"` 3093 // ToolTip - READ-ONLY; Snippet toolTip. 3094 ToolTip *string `json:"toolTip,omitempty"` 3095 // Scope - READ-ONLY; Snippet scope. Possible values include: 'PolicyScopeContractTenant', 'PolicyScopeContractProduct', 'PolicyScopeContractAPI', 'PolicyScopeContractOperation', 'PolicyScopeContractAll' 3096 Scope PolicyScopeContract `json:"scope,omitempty"` 3097} 3098 3099// MarshalJSON is the custom marshaler for PolicySnippetContract. 3100func (psc PolicySnippetContract) MarshalJSON() ([]byte, error) { 3101 objectMap := make(map[string]interface{}) 3102 return json.Marshal(objectMap) 3103} 3104 3105// PolicySnippetsCollection the response of the list policy snippets operation. 3106type PolicySnippetsCollection struct { 3107 autorest.Response `json:"-"` 3108 // Value - Policy snippet value. 3109 Value *[]PolicySnippetContract `json:"value,omitempty"` 3110} 3111 3112// ProductCollection paged Products list representation. 3113type ProductCollection struct { 3114 autorest.Response `json:"-"` 3115 // Value - Page values. 3116 Value *[]ProductContract `json:"value,omitempty"` 3117 // Count - Total record count number across all pages. 3118 Count *int64 `json:"count,omitempty"` 3119 // NextLink - Next page link if any. 3120 NextLink *string `json:"nextLink,omitempty"` 3121} 3122 3123// ProductCollectionIterator provides access to a complete listing of ProductContract values. 3124type ProductCollectionIterator struct { 3125 i int 3126 page ProductCollectionPage 3127} 3128 3129// NextWithContext advances to the next value. If there was an error making 3130// the request the iterator does not advance and the error is returned. 3131func (iter *ProductCollectionIterator) NextWithContext(ctx context.Context) (err error) { 3132 if tracing.IsEnabled() { 3133 ctx = tracing.StartSpan(ctx, fqdn+"/ProductCollectionIterator.NextWithContext") 3134 defer func() { 3135 sc := -1 3136 if iter.Response().Response.Response != nil { 3137 sc = iter.Response().Response.Response.StatusCode 3138 } 3139 tracing.EndSpan(ctx, sc, err) 3140 }() 3141 } 3142 iter.i++ 3143 if iter.i < len(iter.page.Values()) { 3144 return nil 3145 } 3146 err = iter.page.NextWithContext(ctx) 3147 if err != nil { 3148 iter.i-- 3149 return err 3150 } 3151 iter.i = 0 3152 return nil 3153} 3154 3155// Next advances to the next value. If there was an error making 3156// the request the iterator does not advance and the error is returned. 3157// Deprecated: Use NextWithContext() instead. 3158func (iter *ProductCollectionIterator) Next() error { 3159 return iter.NextWithContext(context.Background()) 3160} 3161 3162// NotDone returns true if the enumeration should be started or is not yet complete. 3163func (iter ProductCollectionIterator) NotDone() bool { 3164 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 3165} 3166 3167// Response returns the raw server response from the last page request. 3168func (iter ProductCollectionIterator) Response() ProductCollection { 3169 return iter.page.Response() 3170} 3171 3172// Value returns the current value or a zero-initialized value if the 3173// iterator has advanced beyond the end of the collection. 3174func (iter ProductCollectionIterator) Value() ProductContract { 3175 if !iter.page.NotDone() { 3176 return ProductContract{} 3177 } 3178 return iter.page.Values()[iter.i] 3179} 3180 3181// Creates a new instance of the ProductCollectionIterator type. 3182func NewProductCollectionIterator(page ProductCollectionPage) ProductCollectionIterator { 3183 return ProductCollectionIterator{page: page} 3184} 3185 3186// IsEmpty returns true if the ListResult contains no values. 3187func (pc ProductCollection) IsEmpty() bool { 3188 return pc.Value == nil || len(*pc.Value) == 0 3189} 3190 3191// hasNextLink returns true if the NextLink is not empty. 3192func (pc ProductCollection) hasNextLink() bool { 3193 return pc.NextLink != nil && len(*pc.NextLink) != 0 3194} 3195 3196// productCollectionPreparer prepares a request to retrieve the next set of results. 3197// It returns nil if no more results exist. 3198func (pc ProductCollection) productCollectionPreparer(ctx context.Context) (*http.Request, error) { 3199 if !pc.hasNextLink() { 3200 return nil, nil 3201 } 3202 return autorest.Prepare((&http.Request{}).WithContext(ctx), 3203 autorest.AsJSON(), 3204 autorest.AsGet(), 3205 autorest.WithBaseURL(to.String(pc.NextLink))) 3206} 3207 3208// ProductCollectionPage contains a page of ProductContract values. 3209type ProductCollectionPage struct { 3210 fn func(context.Context, ProductCollection) (ProductCollection, error) 3211 pc ProductCollection 3212} 3213 3214// NextWithContext advances to the next page of values. If there was an error making 3215// the request the page does not advance and the error is returned. 3216func (page *ProductCollectionPage) NextWithContext(ctx context.Context) (err error) { 3217 if tracing.IsEnabled() { 3218 ctx = tracing.StartSpan(ctx, fqdn+"/ProductCollectionPage.NextWithContext") 3219 defer func() { 3220 sc := -1 3221 if page.Response().Response.Response != nil { 3222 sc = page.Response().Response.Response.StatusCode 3223 } 3224 tracing.EndSpan(ctx, sc, err) 3225 }() 3226 } 3227 for { 3228 next, err := page.fn(ctx, page.pc) 3229 if err != nil { 3230 return err 3231 } 3232 page.pc = next 3233 if !next.hasNextLink() || !next.IsEmpty() { 3234 break 3235 } 3236 } 3237 return nil 3238} 3239 3240// Next advances to the next page of values. If there was an error making 3241// the request the page does not advance and the error is returned. 3242// Deprecated: Use NextWithContext() instead. 3243func (page *ProductCollectionPage) Next() error { 3244 return page.NextWithContext(context.Background()) 3245} 3246 3247// NotDone returns true if the page enumeration should be started or is not yet complete. 3248func (page ProductCollectionPage) NotDone() bool { 3249 return !page.pc.IsEmpty() 3250} 3251 3252// Response returns the raw server response from the last page request. 3253func (page ProductCollectionPage) Response() ProductCollection { 3254 return page.pc 3255} 3256 3257// Values returns the slice of values for the current page or nil if there are no values. 3258func (page ProductCollectionPage) Values() []ProductContract { 3259 if page.pc.IsEmpty() { 3260 return nil 3261 } 3262 return *page.pc.Value 3263} 3264 3265// Creates a new instance of the ProductCollectionPage type. 3266func NewProductCollectionPage(cur ProductCollection, getNextPage func(context.Context, ProductCollection) (ProductCollection, error)) ProductCollectionPage { 3267 return ProductCollectionPage{ 3268 fn: getNextPage, 3269 pc: cur, 3270 } 3271} 3272 3273// ProductContract product profile. 3274type ProductContract struct { 3275 autorest.Response `json:"-"` 3276 // ID - READ-ONLY; Uniquely identifies the product within the current API Management service instance. The value is a valid relative URL in the format of /products/{productId} where {productId} is a product identifier. 3277 ID *string `json:"id,omitempty"` 3278 // Name - Product name. 3279 Name *string `json:"name,omitempty"` 3280 // Description - Product description. May include HTML formatting tags. 3281 Description *string `json:"description,omitempty"` 3282 // 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. 3283 Terms *string `json:"terms,omitempty"` 3284 // 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. 3285 SubscriptionRequired *bool `json:"subscriptionRequired,omitempty"` 3286 // 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 true. 3287 ApprovalRequired *bool `json:"approvalRequired,omitempty"` 3288 // 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 true. 3289 SubscriptionsLimit *int32 `json:"subscriptionsLimit,omitempty"` 3290 // 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' 3291 State ProductStateContract `json:"state,omitempty"` 3292} 3293 3294// MarshalJSON is the custom marshaler for ProductContract. 3295func (pc ProductContract) MarshalJSON() ([]byte, error) { 3296 objectMap := make(map[string]interface{}) 3297 if pc.Name != nil { 3298 objectMap["name"] = pc.Name 3299 } 3300 if pc.Description != nil { 3301 objectMap["description"] = pc.Description 3302 } 3303 if pc.Terms != nil { 3304 objectMap["terms"] = pc.Terms 3305 } 3306 if pc.SubscriptionRequired != nil { 3307 objectMap["subscriptionRequired"] = pc.SubscriptionRequired 3308 } 3309 if pc.ApprovalRequired != nil { 3310 objectMap["approvalRequired"] = pc.ApprovalRequired 3311 } 3312 if pc.SubscriptionsLimit != nil { 3313 objectMap["subscriptionsLimit"] = pc.SubscriptionsLimit 3314 } 3315 if pc.State != "" { 3316 objectMap["state"] = pc.State 3317 } 3318 return json.Marshal(objectMap) 3319} 3320 3321// ProductUpdateParameters parameters supplied to the CreateOrUpdate Product operation. 3322type ProductUpdateParameters struct { 3323 // Name - Product name. 3324 Name *string `json:"name,omitempty"` 3325 // Description - Product description. 3326 Description *string `json:"description,omitempty"` 3327 // Terms - Product terms and conditions. Developer will have to accept these terms before he's allowed to call product API. 3328 Terms *string `json:"terms,omitempty"` 3329 // 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. 3330 SubscriptionRequired *bool `json:"subscriptionRequired,omitempty"` 3331 // 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 true. 3332 ApprovalRequired *bool `json:"approvalRequired,omitempty"` 3333 // 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 true. 3334 SubscriptionsLimit *int32 `json:"subscriptionsLimit,omitempty"` 3335 // State - whether product is published or not. Published products are discoverable by users of developer portal. Non published products are visible only to administrators. Possible values include: 'NotPublished', 'Published' 3336 State ProductStateContract `json:"state,omitempty"` 3337} 3338 3339// PropertyCollection paged Property list representation. 3340type PropertyCollection struct { 3341 autorest.Response `json:"-"` 3342 // Value - Page values. 3343 Value *[]PropertyContract `json:"value,omitempty"` 3344 // Count - Total record count number across all pages. 3345 Count *int64 `json:"count,omitempty"` 3346 // NextLink - Next page link if any. 3347 NextLink *string `json:"nextLink,omitempty"` 3348} 3349 3350// PropertyCollectionIterator provides access to a complete listing of PropertyContract values. 3351type PropertyCollectionIterator struct { 3352 i int 3353 page PropertyCollectionPage 3354} 3355 3356// NextWithContext advances to the next value. If there was an error making 3357// the request the iterator does not advance and the error is returned. 3358func (iter *PropertyCollectionIterator) NextWithContext(ctx context.Context) (err error) { 3359 if tracing.IsEnabled() { 3360 ctx = tracing.StartSpan(ctx, fqdn+"/PropertyCollectionIterator.NextWithContext") 3361 defer func() { 3362 sc := -1 3363 if iter.Response().Response.Response != nil { 3364 sc = iter.Response().Response.Response.StatusCode 3365 } 3366 tracing.EndSpan(ctx, sc, err) 3367 }() 3368 } 3369 iter.i++ 3370 if iter.i < len(iter.page.Values()) { 3371 return nil 3372 } 3373 err = iter.page.NextWithContext(ctx) 3374 if err != nil { 3375 iter.i-- 3376 return err 3377 } 3378 iter.i = 0 3379 return nil 3380} 3381 3382// Next advances to the next value. If there was an error making 3383// the request the iterator does not advance and the error is returned. 3384// Deprecated: Use NextWithContext() instead. 3385func (iter *PropertyCollectionIterator) Next() error { 3386 return iter.NextWithContext(context.Background()) 3387} 3388 3389// NotDone returns true if the enumeration should be started or is not yet complete. 3390func (iter PropertyCollectionIterator) NotDone() bool { 3391 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 3392} 3393 3394// Response returns the raw server response from the last page request. 3395func (iter PropertyCollectionIterator) Response() PropertyCollection { 3396 return iter.page.Response() 3397} 3398 3399// Value returns the current value or a zero-initialized value if the 3400// iterator has advanced beyond the end of the collection. 3401func (iter PropertyCollectionIterator) Value() PropertyContract { 3402 if !iter.page.NotDone() { 3403 return PropertyContract{} 3404 } 3405 return iter.page.Values()[iter.i] 3406} 3407 3408// Creates a new instance of the PropertyCollectionIterator type. 3409func NewPropertyCollectionIterator(page PropertyCollectionPage) PropertyCollectionIterator { 3410 return PropertyCollectionIterator{page: page} 3411} 3412 3413// IsEmpty returns true if the ListResult contains no values. 3414func (pc PropertyCollection) IsEmpty() bool { 3415 return pc.Value == nil || len(*pc.Value) == 0 3416} 3417 3418// hasNextLink returns true if the NextLink is not empty. 3419func (pc PropertyCollection) hasNextLink() bool { 3420 return pc.NextLink != nil && len(*pc.NextLink) != 0 3421} 3422 3423// propertyCollectionPreparer prepares a request to retrieve the next set of results. 3424// It returns nil if no more results exist. 3425func (pc PropertyCollection) propertyCollectionPreparer(ctx context.Context) (*http.Request, error) { 3426 if !pc.hasNextLink() { 3427 return nil, nil 3428 } 3429 return autorest.Prepare((&http.Request{}).WithContext(ctx), 3430 autorest.AsJSON(), 3431 autorest.AsGet(), 3432 autorest.WithBaseURL(to.String(pc.NextLink))) 3433} 3434 3435// PropertyCollectionPage contains a page of PropertyContract values. 3436type PropertyCollectionPage struct { 3437 fn func(context.Context, PropertyCollection) (PropertyCollection, error) 3438 pc PropertyCollection 3439} 3440 3441// NextWithContext advances to the next page of values. If there was an error making 3442// the request the page does not advance and the error is returned. 3443func (page *PropertyCollectionPage) NextWithContext(ctx context.Context) (err error) { 3444 if tracing.IsEnabled() { 3445 ctx = tracing.StartSpan(ctx, fqdn+"/PropertyCollectionPage.NextWithContext") 3446 defer func() { 3447 sc := -1 3448 if page.Response().Response.Response != nil { 3449 sc = page.Response().Response.Response.StatusCode 3450 } 3451 tracing.EndSpan(ctx, sc, err) 3452 }() 3453 } 3454 for { 3455 next, err := page.fn(ctx, page.pc) 3456 if err != nil { 3457 return err 3458 } 3459 page.pc = next 3460 if !next.hasNextLink() || !next.IsEmpty() { 3461 break 3462 } 3463 } 3464 return nil 3465} 3466 3467// Next advances to the next page of values. If there was an error making 3468// the request the page does not advance and the error is returned. 3469// Deprecated: Use NextWithContext() instead. 3470func (page *PropertyCollectionPage) Next() error { 3471 return page.NextWithContext(context.Background()) 3472} 3473 3474// NotDone returns true if the page enumeration should be started or is not yet complete. 3475func (page PropertyCollectionPage) NotDone() bool { 3476 return !page.pc.IsEmpty() 3477} 3478 3479// Response returns the raw server response from the last page request. 3480func (page PropertyCollectionPage) Response() PropertyCollection { 3481 return page.pc 3482} 3483 3484// Values returns the slice of values for the current page or nil if there are no values. 3485func (page PropertyCollectionPage) Values() []PropertyContract { 3486 if page.pc.IsEmpty() { 3487 return nil 3488 } 3489 return *page.pc.Value 3490} 3491 3492// Creates a new instance of the PropertyCollectionPage type. 3493func NewPropertyCollectionPage(cur PropertyCollection, getNextPage func(context.Context, PropertyCollection) (PropertyCollection, error)) PropertyCollectionPage { 3494 return PropertyCollectionPage{ 3495 fn: getNextPage, 3496 pc: cur, 3497 } 3498} 3499 3500// PropertyContract property details. 3501type PropertyContract struct { 3502 autorest.Response `json:"-"` 3503 // ID - READ-ONLY; Uniquely identifies the property within the current API Management service instance. The value is a valid relative URL in the format of /properties/{propId} where {propId} is a property identifier. 3504 ID *string `json:"id,omitempty"` 3505 // Name - Unique name of Property. It may contain only letters, digits, period, dash, and underscore characters. 3506 Name *string `json:"name,omitempty"` 3507 // Value - Value of the property. Can contain policy expressions. It may not be empty or consist only of whitespace. 3508 Value *string `json:"value,omitempty"` 3509 // Tags - Optional tags that when provided can be used to filter the property list. 3510 Tags *[]string `json:"tags,omitempty"` 3511 // Secret - Determines whether the value is a secret and should be encrypted or not. Default value is false. 3512 Secret *bool `json:"secret,omitempty"` 3513} 3514 3515// MarshalJSON is the custom marshaler for PropertyContract. 3516func (pc PropertyContract) MarshalJSON() ([]byte, error) { 3517 objectMap := make(map[string]interface{}) 3518 if pc.Name != nil { 3519 objectMap["name"] = pc.Name 3520 } 3521 if pc.Value != nil { 3522 objectMap["value"] = pc.Value 3523 } 3524 if pc.Tags != nil { 3525 objectMap["tags"] = pc.Tags 3526 } 3527 if pc.Secret != nil { 3528 objectMap["secret"] = pc.Secret 3529 } 3530 return json.Marshal(objectMap) 3531} 3532 3533// PropertyCreateParameters parameters supplied to the Create Property operation. 3534type PropertyCreateParameters struct { 3535 // Name - Unique name of Property. It may contain only letters, digits, period, dash, and underscore characters. 3536 Name *string `json:"name,omitempty"` 3537 // Value - Value of the property. Can contain policy expressions. It may not be empty or consist only of whitespace. 3538 Value *string `json:"value,omitempty"` 3539 // Tags - Optional tags that when provided can be used to filter the property list. 3540 Tags *[]string `json:"tags,omitempty"` 3541 // Secret - Determines whether the value is a secret and should be encrypted or not. Default value is false. 3542 Secret *bool `json:"secret,omitempty"` 3543} 3544 3545// PropertyUpdateParameters parameters supplied to the Update Property operation. 3546type PropertyUpdateParameters struct { 3547 // Name - Unique name of Property. It may contain only letters, digits, period, dash, and underscore characters. 3548 Name *string `json:"name,omitempty"` 3549 // Value - Value of the property. Can contain policy expressions. It may not be empty or consist only of whitespace. 3550 Value *string `json:"value,omitempty"` 3551 // Tags - Optional tags that when provided can be used to filter the property list. 3552 Tags *[]string `json:"tags,omitempty"` 3553 // Secret - Determines whether the value is a secret and should be encrypted or not. Default value is false. 3554 Secret *bool `json:"secret,omitempty"` 3555} 3556 3557// QuotaCounterCollection paged Quota Counter list representation. 3558type QuotaCounterCollection struct { 3559 autorest.Response `json:"-"` 3560 // Value - Quota counter values. 3561 Value *[]QuotaCounterContract `json:"value,omitempty"` 3562 // Count - Total record count number across all pages. 3563 Count *int64 `json:"count,omitempty"` 3564 // NextLink - Next page link if any. 3565 NextLink *string `json:"nextLink,omitempty"` 3566} 3567 3568// QuotaCounterContract quota counter details. 3569type QuotaCounterContract struct { 3570 autorest.Response `json:"-"` 3571 // CounterKey - The Key value of the Counter. Must not be empty. 3572 CounterKey *string `json:"counterKey,omitempty"` 3573 // PeriodKey - Identifier of the Period for which the counter was collected. Must not be empty. 3574 PeriodKey *string `json:"periodKey,omitempty"` 3575 // 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. 3576 PeriodStartTime *date.Time `json:"periodStartTime,omitempty"` 3577 // 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. 3578 PeriodEndTime *date.Time `json:"periodEndTime,omitempty"` 3579 // CallsCount - Number of times Counter was called. 3580 CallsCount *int32 `json:"callsCount,omitempty"` 3581 // KbTransferred - Data Transferred in KiloBytes. 3582 KbTransferred *float64 `json:"kbTransferred,omitempty"` 3583} 3584 3585// QuotaCounterValueContract quota counter value details. 3586type QuotaCounterValueContract struct { 3587 // CallsCount - Number of times Counter was called. 3588 CallsCount *int32 `json:"callsCount,omitempty"` 3589 // KbTransferred - Data Transferred in KiloBytes. 3590 KbTransferred *float64 `json:"kbTransferred,omitempty"` 3591} 3592 3593// ReadCloser ... 3594type ReadCloser struct { 3595 autorest.Response `json:"-"` 3596 Value *io.ReadCloser `json:"value,omitempty"` 3597} 3598 3599// RegionContract region profile. 3600type RegionContract struct { 3601 // Name - Region name. 3602 Name *string `json:"name,omitempty"` 3603 // IsMasterRegion - whether Region is the master region. 3604 IsMasterRegion *bool `json:"isMasterRegion,omitempty"` 3605} 3606 3607// RegionListResult lists Regions operation response details. 3608type RegionListResult struct { 3609 autorest.Response `json:"-"` 3610 // Value - Lists of Regions. 3611 Value *[]RegionContract `json:"value,omitempty"` 3612} 3613 3614// ReportCollection paged Report records list representation. 3615type ReportCollection struct { 3616 autorest.Response `json:"-"` 3617 // Value - Page values. 3618 Value *[]ReportRecordContract `json:"value,omitempty"` 3619 // Count - Total record count number across all pages. 3620 Count *int64 `json:"count,omitempty"` 3621 // NextLink - Next page link if any. 3622 NextLink *string `json:"nextLink,omitempty"` 3623} 3624 3625// ReportCollectionIterator provides access to a complete listing of ReportRecordContract values. 3626type ReportCollectionIterator struct { 3627 i int 3628 page ReportCollectionPage 3629} 3630 3631// NextWithContext advances to the next value. If there was an error making 3632// the request the iterator does not advance and the error is returned. 3633func (iter *ReportCollectionIterator) NextWithContext(ctx context.Context) (err error) { 3634 if tracing.IsEnabled() { 3635 ctx = tracing.StartSpan(ctx, fqdn+"/ReportCollectionIterator.NextWithContext") 3636 defer func() { 3637 sc := -1 3638 if iter.Response().Response.Response != nil { 3639 sc = iter.Response().Response.Response.StatusCode 3640 } 3641 tracing.EndSpan(ctx, sc, err) 3642 }() 3643 } 3644 iter.i++ 3645 if iter.i < len(iter.page.Values()) { 3646 return nil 3647 } 3648 err = iter.page.NextWithContext(ctx) 3649 if err != nil { 3650 iter.i-- 3651 return err 3652 } 3653 iter.i = 0 3654 return nil 3655} 3656 3657// Next advances to the next value. If there was an error making 3658// the request the iterator does not advance and the error is returned. 3659// Deprecated: Use NextWithContext() instead. 3660func (iter *ReportCollectionIterator) Next() error { 3661 return iter.NextWithContext(context.Background()) 3662} 3663 3664// NotDone returns true if the enumeration should be started or is not yet complete. 3665func (iter ReportCollectionIterator) NotDone() bool { 3666 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 3667} 3668 3669// Response returns the raw server response from the last page request. 3670func (iter ReportCollectionIterator) Response() ReportCollection { 3671 return iter.page.Response() 3672} 3673 3674// Value returns the current value or a zero-initialized value if the 3675// iterator has advanced beyond the end of the collection. 3676func (iter ReportCollectionIterator) Value() ReportRecordContract { 3677 if !iter.page.NotDone() { 3678 return ReportRecordContract{} 3679 } 3680 return iter.page.Values()[iter.i] 3681} 3682 3683// Creates a new instance of the ReportCollectionIterator type. 3684func NewReportCollectionIterator(page ReportCollectionPage) ReportCollectionIterator { 3685 return ReportCollectionIterator{page: page} 3686} 3687 3688// IsEmpty returns true if the ListResult contains no values. 3689func (rc ReportCollection) IsEmpty() bool { 3690 return rc.Value == nil || len(*rc.Value) == 0 3691} 3692 3693// hasNextLink returns true if the NextLink is not empty. 3694func (rc ReportCollection) hasNextLink() bool { 3695 return rc.NextLink != nil && len(*rc.NextLink) != 0 3696} 3697 3698// reportCollectionPreparer prepares a request to retrieve the next set of results. 3699// It returns nil if no more results exist. 3700func (rc ReportCollection) reportCollectionPreparer(ctx context.Context) (*http.Request, error) { 3701 if !rc.hasNextLink() { 3702 return nil, nil 3703 } 3704 return autorest.Prepare((&http.Request{}).WithContext(ctx), 3705 autorest.AsJSON(), 3706 autorest.AsGet(), 3707 autorest.WithBaseURL(to.String(rc.NextLink))) 3708} 3709 3710// ReportCollectionPage contains a page of ReportRecordContract values. 3711type ReportCollectionPage struct { 3712 fn func(context.Context, ReportCollection) (ReportCollection, error) 3713 rc ReportCollection 3714} 3715 3716// NextWithContext advances to the next page of values. If there was an error making 3717// the request the page does not advance and the error is returned. 3718func (page *ReportCollectionPage) NextWithContext(ctx context.Context) (err error) { 3719 if tracing.IsEnabled() { 3720 ctx = tracing.StartSpan(ctx, fqdn+"/ReportCollectionPage.NextWithContext") 3721 defer func() { 3722 sc := -1 3723 if page.Response().Response.Response != nil { 3724 sc = page.Response().Response.Response.StatusCode 3725 } 3726 tracing.EndSpan(ctx, sc, err) 3727 }() 3728 } 3729 for { 3730 next, err := page.fn(ctx, page.rc) 3731 if err != nil { 3732 return err 3733 } 3734 page.rc = next 3735 if !next.hasNextLink() || !next.IsEmpty() { 3736 break 3737 } 3738 } 3739 return nil 3740} 3741 3742// Next advances to the next page of values. If there was an error making 3743// the request the page does not advance and the error is returned. 3744// Deprecated: Use NextWithContext() instead. 3745func (page *ReportCollectionPage) Next() error { 3746 return page.NextWithContext(context.Background()) 3747} 3748 3749// NotDone returns true if the page enumeration should be started or is not yet complete. 3750func (page ReportCollectionPage) NotDone() bool { 3751 return !page.rc.IsEmpty() 3752} 3753 3754// Response returns the raw server response from the last page request. 3755func (page ReportCollectionPage) Response() ReportCollection { 3756 return page.rc 3757} 3758 3759// Values returns the slice of values for the current page or nil if there are no values. 3760func (page ReportCollectionPage) Values() []ReportRecordContract { 3761 if page.rc.IsEmpty() { 3762 return nil 3763 } 3764 return *page.rc.Value 3765} 3766 3767// Creates a new instance of the ReportCollectionPage type. 3768func NewReportCollectionPage(cur ReportCollection, getNextPage func(context.Context, ReportCollection) (ReportCollection, error)) ReportCollectionPage { 3769 return ReportCollectionPage{ 3770 fn: getNextPage, 3771 rc: cur, 3772 } 3773} 3774 3775// ReportRecordContract report data. 3776type ReportRecordContract struct { 3777 // Name - Name depending on report endpoint specifies product, API, operation or developer name. 3778 Name *string `json:"name,omitempty"` 3779 // Timestamp - Start of aggregation period. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. 3780 Timestamp *date.Time `json:"timestamp,omitempty"` 3781 // Interval - Length of aggregation period. 3782 Interval *int64 `json:"interval,omitempty"` 3783 // Country - Country to which this record data is related. 3784 Country *string `json:"country,omitempty"` 3785 // Region - Country region to which this record data is related. 3786 Region *string `json:"region,omitempty"` 3787 // Zip - Zip code to which this record data is related. 3788 Zip *string `json:"zip,omitempty"` 3789 // UserID - READ-ONLY; User identifier path. /users/{userId} 3790 UserID *string `json:"userId,omitempty"` 3791 // ProductID - READ-ONLY; Product identifier path. /products/{productId} 3792 ProductID *string `json:"productId,omitempty"` 3793 // APIID - API identifier path. /apis/{apiId} 3794 APIID *string `json:"apiId,omitempty"` 3795 // OperationID - Operation identifier path. /apis/{apiId}/operations/{operationId} 3796 OperationID *string `json:"operationId,omitempty"` 3797 // APIRegion - API region identifier. 3798 APIRegion *string `json:"apiRegion,omitempty"` 3799 // SubscriptionID - Subscription identifier path. /subscriptions/{subscriptionId} 3800 SubscriptionID *string `json:"subscriptionId,omitempty"` 3801 // CallCountSuccess - Number of successful calls. This includes calls returning HttpStatusCode <= 301 and HttpStatusCode.NotModified and HttpStatusCode.TemporaryRedirect 3802 CallCountSuccess *int32 `json:"callCountSuccess,omitempty"` 3803 // CallCountBlocked - Number of calls blocked due to invalid credentials. This includes calls returning HttpStatusCode.Unauthorized and HttpStatusCode.Forbidden and HttpStatusCode.TooManyRequests 3804 CallCountBlocked *int32 `json:"callCountBlocked,omitempty"` 3805 // 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 3806 CallCountFailed *int32 `json:"callCountFailed,omitempty"` 3807 // CallCountOther - Number of other calls. 3808 CallCountOther *int32 `json:"callCountOther,omitempty"` 3809 // CallCountTotal - Total number of calls. 3810 CallCountTotal *int32 `json:"callCountTotal,omitempty"` 3811 // Bandwidth - Bandwidth consumed. 3812 Bandwidth *int64 `json:"bandwidth,omitempty"` 3813 // CacheHitCount - Number of times when content was served from cache policy. 3814 CacheHitCount *int32 `json:"cacheHitCount,omitempty"` 3815 // CacheMissCount - Number of times content was fetched from backend. 3816 CacheMissCount *int32 `json:"cacheMissCount,omitempty"` 3817 // APITimeAvg - Average time it took to process request. 3818 APITimeAvg *float64 `json:"apiTimeAvg,omitempty"` 3819 // APITimeMin - Minimum time it took to process request. 3820 APITimeMin *float64 `json:"apiTimeMin,omitempty"` 3821 // APITimeMax - Maximum time it took to process request. 3822 APITimeMax *float64 `json:"apiTimeMax,omitempty"` 3823 // ServiceTimeAvg - Average time it took to process request on backend. 3824 ServiceTimeAvg *float64 `json:"serviceTimeAvg,omitempty"` 3825 // ServiceTimeMin - Minimum time it took to process request on backend. 3826 ServiceTimeMin *float64 `json:"serviceTimeMin,omitempty"` 3827 // ServiceTimeMax - Maximum time it took to process request on backend. 3828 ServiceTimeMax *float64 `json:"serviceTimeMax,omitempty"` 3829} 3830 3831// MarshalJSON is the custom marshaler for ReportRecordContract. 3832func (rrc ReportRecordContract) MarshalJSON() ([]byte, error) { 3833 objectMap := make(map[string]interface{}) 3834 if rrc.Name != nil { 3835 objectMap["name"] = rrc.Name 3836 } 3837 if rrc.Timestamp != nil { 3838 objectMap["timestamp"] = rrc.Timestamp 3839 } 3840 if rrc.Interval != nil { 3841 objectMap["interval"] = rrc.Interval 3842 } 3843 if rrc.Country != nil { 3844 objectMap["country"] = rrc.Country 3845 } 3846 if rrc.Region != nil { 3847 objectMap["region"] = rrc.Region 3848 } 3849 if rrc.Zip != nil { 3850 objectMap["zip"] = rrc.Zip 3851 } 3852 if rrc.APIID != nil { 3853 objectMap["apiId"] = rrc.APIID 3854 } 3855 if rrc.OperationID != nil { 3856 objectMap["operationId"] = rrc.OperationID 3857 } 3858 if rrc.APIRegion != nil { 3859 objectMap["apiRegion"] = rrc.APIRegion 3860 } 3861 if rrc.SubscriptionID != nil { 3862 objectMap["subscriptionId"] = rrc.SubscriptionID 3863 } 3864 if rrc.CallCountSuccess != nil { 3865 objectMap["callCountSuccess"] = rrc.CallCountSuccess 3866 } 3867 if rrc.CallCountBlocked != nil { 3868 objectMap["callCountBlocked"] = rrc.CallCountBlocked 3869 } 3870 if rrc.CallCountFailed != nil { 3871 objectMap["callCountFailed"] = rrc.CallCountFailed 3872 } 3873 if rrc.CallCountOther != nil { 3874 objectMap["callCountOther"] = rrc.CallCountOther 3875 } 3876 if rrc.CallCountTotal != nil { 3877 objectMap["callCountTotal"] = rrc.CallCountTotal 3878 } 3879 if rrc.Bandwidth != nil { 3880 objectMap["bandwidth"] = rrc.Bandwidth 3881 } 3882 if rrc.CacheHitCount != nil { 3883 objectMap["cacheHitCount"] = rrc.CacheHitCount 3884 } 3885 if rrc.CacheMissCount != nil { 3886 objectMap["cacheMissCount"] = rrc.CacheMissCount 3887 } 3888 if rrc.APITimeAvg != nil { 3889 objectMap["apiTimeAvg"] = rrc.APITimeAvg 3890 } 3891 if rrc.APITimeMin != nil { 3892 objectMap["apiTimeMin"] = rrc.APITimeMin 3893 } 3894 if rrc.APITimeMax != nil { 3895 objectMap["apiTimeMax"] = rrc.APITimeMax 3896 } 3897 if rrc.ServiceTimeAvg != nil { 3898 objectMap["serviceTimeAvg"] = rrc.ServiceTimeAvg 3899 } 3900 if rrc.ServiceTimeMin != nil { 3901 objectMap["serviceTimeMin"] = rrc.ServiceTimeMin 3902 } 3903 if rrc.ServiceTimeMax != nil { 3904 objectMap["serviceTimeMax"] = rrc.ServiceTimeMax 3905 } 3906 return json.Marshal(objectMap) 3907} 3908 3909// RepresentationContract operation request/response representation details. 3910type RepresentationContract struct { 3911 // ContentType - Specifies a registered or custom content type for this representation, e.g. application/xml. 3912 ContentType *string `json:"contentType,omitempty"` 3913 // Sample - An example of the representation. 3914 Sample *string `json:"sample,omitempty"` 3915} 3916 3917// RequestContract operation request details. 3918type RequestContract struct { 3919 // Description - Operation request description. 3920 Description *string `json:"description,omitempty"` 3921 // QueryParameters - Collection of operation request query parameters. 3922 QueryParameters *[]ParameterContract `json:"queryParameters,omitempty"` 3923 // Headers - Collection of operation request headers. 3924 Headers *[]ParameterContract `json:"headers,omitempty"` 3925 // Representations - Collection of operation request representations. 3926 Representations *[]RepresentationContract `json:"representations,omitempty"` 3927} 3928 3929// Resource the Resource definition. 3930type Resource struct { 3931 // ID - READ-ONLY; Resource ID. 3932 ID *string `json:"id,omitempty"` 3933 // Name - Resource name. 3934 Name *string `json:"name,omitempty"` 3935 // Type - READ-ONLY; Resource type for API Management resource is set to Microsoft.ApiManagement. 3936 Type *string `json:"type,omitempty"` 3937 // Location - Resource location. 3938 Location *string `json:"location,omitempty"` 3939 // Tags - Resource tags. 3940 Tags map[string]*string `json:"tags"` 3941} 3942 3943// MarshalJSON is the custom marshaler for Resource. 3944func (r Resource) MarshalJSON() ([]byte, error) { 3945 objectMap := make(map[string]interface{}) 3946 if r.Name != nil { 3947 objectMap["name"] = r.Name 3948 } 3949 if r.Location != nil { 3950 objectMap["location"] = r.Location 3951 } 3952 if r.Tags != nil { 3953 objectMap["tags"] = r.Tags 3954 } 3955 return json.Marshal(objectMap) 3956} 3957 3958// ResultContract operation response details. 3959type ResultContract struct { 3960 // StatusCode - Operation response HTTP status code. 3961 StatusCode *int32 `json:"statusCode,omitempty"` 3962 // Description - Operation response description. 3963 Description *string `json:"description,omitempty"` 3964 // Representations - Collection of operation response representations. 3965 Representations *[]RepresentationContract `json:"representations,omitempty"` 3966} 3967 3968// SaveConfigurationParameter parameters supplied to the Save Tenant Configuration operation. 3969type SaveConfigurationParameter struct { 3970 // Branch - The name of the Git branch in which to commit the current configuration snapshot. 3971 Branch *string `json:"branch,omitempty"` 3972 // 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. 3973 Force *bool `json:"force,omitempty"` 3974} 3975 3976// ServiceBackupRestoreParameters parameters supplied to the Backup/Restore of an API Management service 3977// operation. 3978type ServiceBackupRestoreParameters struct { 3979 // StorageAccount - Azure Cloud Storage account (used to place/retrieve the backup) name. 3980 StorageAccount *string `json:"storageAccount,omitempty"` 3981 // AccessKey - Azure Cloud Storage account (used to place/retrieve the backup) access key. 3982 AccessKey *string `json:"accessKey,omitempty"` 3983 // ContainerName - Azure Cloud Storage blob container name used to place/retrieve the backup. 3984 ContainerName *string `json:"containerName,omitempty"` 3985 // BackupName - The name of the backup file to create. 3986 BackupName *string `json:"backupName,omitempty"` 3987} 3988 3989// ServiceCheckNameAvailabilityParameters parameters supplied to the CheckNameAvailability operation. 3990type ServiceCheckNameAvailabilityParameters struct { 3991 // Name - The name to check for availability. 3992 Name *string `json:"name,omitempty"` 3993} 3994 3995// ServiceGetSsoTokenResult the response of the GetSsoToken operation. 3996type ServiceGetSsoTokenResult struct { 3997 autorest.Response `json:"-"` 3998 // RedirectURI - Redirect URL containing the SSO token. 3999 RedirectURI *string `json:"redirect_uri,omitempty"` 4000} 4001 4002// ServiceListResult the response of the List API Management services operation. 4003type ServiceListResult struct { 4004 autorest.Response `json:"-"` 4005 // Value - Result of the List API Management services operation. 4006 Value *[]ServiceResource `json:"value,omitempty"` 4007 // NextLink - Link to the next set of results. Not empty if Value contains incomplete list of API Management services. 4008 NextLink *string `json:"nextLink,omitempty"` 4009} 4010 4011// ServiceListResultIterator provides access to a complete listing of ServiceResource values. 4012type ServiceListResultIterator struct { 4013 i int 4014 page ServiceListResultPage 4015} 4016 4017// NextWithContext advances to the next value. If there was an error making 4018// the request the iterator does not advance and the error is returned. 4019func (iter *ServiceListResultIterator) NextWithContext(ctx context.Context) (err error) { 4020 if tracing.IsEnabled() { 4021 ctx = tracing.StartSpan(ctx, fqdn+"/ServiceListResultIterator.NextWithContext") 4022 defer func() { 4023 sc := -1 4024 if iter.Response().Response.Response != nil { 4025 sc = iter.Response().Response.Response.StatusCode 4026 } 4027 tracing.EndSpan(ctx, sc, err) 4028 }() 4029 } 4030 iter.i++ 4031 if iter.i < len(iter.page.Values()) { 4032 return nil 4033 } 4034 err = iter.page.NextWithContext(ctx) 4035 if err != nil { 4036 iter.i-- 4037 return err 4038 } 4039 iter.i = 0 4040 return nil 4041} 4042 4043// Next advances to the next value. If there was an error making 4044// the request the iterator does not advance and the error is returned. 4045// Deprecated: Use NextWithContext() instead. 4046func (iter *ServiceListResultIterator) Next() error { 4047 return iter.NextWithContext(context.Background()) 4048} 4049 4050// NotDone returns true if the enumeration should be started or is not yet complete. 4051func (iter ServiceListResultIterator) NotDone() bool { 4052 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 4053} 4054 4055// Response returns the raw server response from the last page request. 4056func (iter ServiceListResultIterator) Response() ServiceListResult { 4057 return iter.page.Response() 4058} 4059 4060// Value returns the current value or a zero-initialized value if the 4061// iterator has advanced beyond the end of the collection. 4062func (iter ServiceListResultIterator) Value() ServiceResource { 4063 if !iter.page.NotDone() { 4064 return ServiceResource{} 4065 } 4066 return iter.page.Values()[iter.i] 4067} 4068 4069// Creates a new instance of the ServiceListResultIterator type. 4070func NewServiceListResultIterator(page ServiceListResultPage) ServiceListResultIterator { 4071 return ServiceListResultIterator{page: page} 4072} 4073 4074// IsEmpty returns true if the ListResult contains no values. 4075func (slr ServiceListResult) IsEmpty() bool { 4076 return slr.Value == nil || len(*slr.Value) == 0 4077} 4078 4079// hasNextLink returns true if the NextLink is not empty. 4080func (slr ServiceListResult) hasNextLink() bool { 4081 return slr.NextLink != nil && len(*slr.NextLink) != 0 4082} 4083 4084// serviceListResultPreparer prepares a request to retrieve the next set of results. 4085// It returns nil if no more results exist. 4086func (slr ServiceListResult) serviceListResultPreparer(ctx context.Context) (*http.Request, error) { 4087 if !slr.hasNextLink() { 4088 return nil, nil 4089 } 4090 return autorest.Prepare((&http.Request{}).WithContext(ctx), 4091 autorest.AsJSON(), 4092 autorest.AsGet(), 4093 autorest.WithBaseURL(to.String(slr.NextLink))) 4094} 4095 4096// ServiceListResultPage contains a page of ServiceResource values. 4097type ServiceListResultPage struct { 4098 fn func(context.Context, ServiceListResult) (ServiceListResult, error) 4099 slr ServiceListResult 4100} 4101 4102// NextWithContext advances to the next page of values. If there was an error making 4103// the request the page does not advance and the error is returned. 4104func (page *ServiceListResultPage) NextWithContext(ctx context.Context) (err error) { 4105 if tracing.IsEnabled() { 4106 ctx = tracing.StartSpan(ctx, fqdn+"/ServiceListResultPage.NextWithContext") 4107 defer func() { 4108 sc := -1 4109 if page.Response().Response.Response != nil { 4110 sc = page.Response().Response.Response.StatusCode 4111 } 4112 tracing.EndSpan(ctx, sc, err) 4113 }() 4114 } 4115 for { 4116 next, err := page.fn(ctx, page.slr) 4117 if err != nil { 4118 return err 4119 } 4120 page.slr = next 4121 if !next.hasNextLink() || !next.IsEmpty() { 4122 break 4123 } 4124 } 4125 return nil 4126} 4127 4128// Next advances to the next page of values. If there was an error making 4129// the request the page does not advance and the error is returned. 4130// Deprecated: Use NextWithContext() instead. 4131func (page *ServiceListResultPage) Next() error { 4132 return page.NextWithContext(context.Background()) 4133} 4134 4135// NotDone returns true if the page enumeration should be started or is not yet complete. 4136func (page ServiceListResultPage) NotDone() bool { 4137 return !page.slr.IsEmpty() 4138} 4139 4140// Response returns the raw server response from the last page request. 4141func (page ServiceListResultPage) Response() ServiceListResult { 4142 return page.slr 4143} 4144 4145// Values returns the slice of values for the current page or nil if there are no values. 4146func (page ServiceListResultPage) Values() []ServiceResource { 4147 if page.slr.IsEmpty() { 4148 return nil 4149 } 4150 return *page.slr.Value 4151} 4152 4153// Creates a new instance of the ServiceListResultPage type. 4154func NewServiceListResultPage(cur ServiceListResult, getNextPage func(context.Context, ServiceListResult) (ServiceListResult, error)) ServiceListResultPage { 4155 return ServiceListResultPage{ 4156 fn: getNextPage, 4157 slr: cur, 4158 } 4159} 4160 4161// ServiceManageDeploymentsParameters parameters supplied to the ManageDeployments operation. 4162type ServiceManageDeploymentsParameters struct { 4163 // Location - Location of the API Management service Azure data center. 4164 Location *string `json:"location,omitempty"` 4165 // SkuType - SKU type of the API Management service. Possible values include: 'Developer', 'Standard', 'Premium' 4166 SkuType SkuType `json:"skuType,omitempty"` 4167 // SkuUnitCount - SKU Unit count of the API Management service. Default value is 1. 4168 SkuUnitCount *int32 `json:"skuUnitCount,omitempty"` 4169 // AdditionalLocations - Additional data center locations for the API Management service. 4170 AdditionalLocations *[]AdditionalRegion `json:"additionalLocations,omitempty"` 4171 // VpnConfiguration - Virtual network configuration. 4172 VpnConfiguration *VirtualNetworkConfiguration `json:"vpnConfiguration,omitempty"` 4173 // VpnType - 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 the API Management service deployment is set up inside a Virtual Network having an Intranet Facing Endpoint only. When vpnConfiguration is specified, vpnType must be specified. Possible values include: 'VirtualNetworkTypeNone', 'VirtualNetworkTypeExternal', 'VirtualNetworkTypeInternal' 4174 VpnType VirtualNetworkType `json:"vpnType,omitempty"` 4175} 4176 4177// ServiceNameAvailabilityResult response of the CheckNameAvailability operation. 4178type ServiceNameAvailabilityResult struct { 4179 autorest.Response `json:"-"` 4180 // NameAvailable - True if the name is available and can be used to create a new API Management service; otherwise false. 4181 NameAvailable *bool `json:"nameAvailable,omitempty"` 4182 // Message - 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. 4183 Message *string `json:"message,omitempty"` 4184 // 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' 4185 Reason NameAvailabilityReason `json:"reason,omitempty"` 4186} 4187 4188// ServiceProperties properties of an API Management service resource description. 4189type ServiceProperties struct { 4190 // PublisherEmail - Publisher email. 4191 PublisherEmail *string `json:"publisherEmail,omitempty"` 4192 // PublisherName - Publisher name. 4193 PublisherName *string `json:"publisherName,omitempty"` 4194 // 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. 4195 ProvisioningState *string `json:"provisioningState,omitempty"` 4196 // TargetProvisioningState - READ-ONLY; The provisioning state of the API Management service, which is targeted by the long running operation started on the service. 4197 TargetProvisioningState *string `json:"targetProvisioningState,omitempty"` 4198 // 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. 4199 CreatedAtUtc *date.Time `json:"createdAtUtc,omitempty"` 4200 // RuntimeURL - READ-ONLY; Proxy endpoint URL of the API Management service. 4201 RuntimeURL *string `json:"runtimeUrl,omitempty"` 4202 // PortalURL - READ-ONLY; Publisher portal endpoint Url of the API Management service. 4203 PortalURL *string `json:"portalUrl,omitempty"` 4204 // ManagementAPIURL - READ-ONLY; Management API endpoint URL of the API Management service. 4205 ManagementAPIURL *string `json:"managementApiUrl,omitempty"` 4206 // ScmURL - READ-ONLY; SCM endpoint URL of the API Management service. 4207 ScmURL *string `json:"scmUrl,omitempty"` 4208 // AddresserEmail - Addresser email. 4209 AddresserEmail *string `json:"addresserEmail,omitempty"` 4210 // HostnameConfigurations - Custom hostname configuration of the API Management service. 4211 HostnameConfigurations *[]HostnameConfiguration `json:"hostnameConfigurations,omitempty"` 4212 // StaticIPs - READ-ONLY; Static IP addresses of the API Management service virtual machines. Available only for Standard and Premium SKU. 4213 StaticIPs *[]string `json:"staticIPs,omitempty"` 4214 // Vpnconfiguration - Virtual network configuration of the API Management service. 4215 Vpnconfiguration *VirtualNetworkConfiguration `json:"vpnconfiguration,omitempty"` 4216 // AdditionalLocations - Additional datacenter locations of the API Management service. 4217 AdditionalLocations *[]AdditionalRegion `json:"additionalLocations,omitempty"` 4218 // CustomProperties - Custom properties of the API Management service, like disabling TLS 1.0. 4219 CustomProperties map[string]*string `json:"customProperties"` 4220 // VpnType - 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' 4221 VpnType VirtualNetworkType `json:"vpnType,omitempty"` 4222} 4223 4224// MarshalJSON is the custom marshaler for ServiceProperties. 4225func (sp ServiceProperties) MarshalJSON() ([]byte, error) { 4226 objectMap := make(map[string]interface{}) 4227 if sp.PublisherEmail != nil { 4228 objectMap["publisherEmail"] = sp.PublisherEmail 4229 } 4230 if sp.PublisherName != nil { 4231 objectMap["publisherName"] = sp.PublisherName 4232 } 4233 if sp.AddresserEmail != nil { 4234 objectMap["addresserEmail"] = sp.AddresserEmail 4235 } 4236 if sp.HostnameConfigurations != nil { 4237 objectMap["hostnameConfigurations"] = sp.HostnameConfigurations 4238 } 4239 if sp.Vpnconfiguration != nil { 4240 objectMap["vpnconfiguration"] = sp.Vpnconfiguration 4241 } 4242 if sp.AdditionalLocations != nil { 4243 objectMap["additionalLocations"] = sp.AdditionalLocations 4244 } 4245 if sp.CustomProperties != nil { 4246 objectMap["customProperties"] = sp.CustomProperties 4247 } 4248 if sp.VpnType != "" { 4249 objectMap["vpnType"] = sp.VpnType 4250 } 4251 return json.Marshal(objectMap) 4252} 4253 4254// ServiceResource a single API Management service resource in List or Get response. 4255type ServiceResource struct { 4256 autorest.Response `json:"-"` 4257 // ServiceProperties - Properties of the API Management service. 4258 *ServiceProperties `json:"properties,omitempty"` 4259 // Sku - SKU properties of the API Management service. 4260 Sku *ServiceSkuProperties `json:"sku,omitempty"` 4261 // Etag - READ-ONLY; ETag of the resource. 4262 Etag *string `json:"etag,omitempty"` 4263 // ID - READ-ONLY; Resource ID. 4264 ID *string `json:"id,omitempty"` 4265 // Name - Resource name. 4266 Name *string `json:"name,omitempty"` 4267 // Type - READ-ONLY; Resource type for API Management resource is set to Microsoft.ApiManagement. 4268 Type *string `json:"type,omitempty"` 4269 // Location - Resource location. 4270 Location *string `json:"location,omitempty"` 4271 // Tags - Resource tags. 4272 Tags map[string]*string `json:"tags"` 4273} 4274 4275// MarshalJSON is the custom marshaler for ServiceResource. 4276func (sr ServiceResource) MarshalJSON() ([]byte, error) { 4277 objectMap := make(map[string]interface{}) 4278 if sr.ServiceProperties != nil { 4279 objectMap["properties"] = sr.ServiceProperties 4280 } 4281 if sr.Sku != nil { 4282 objectMap["sku"] = sr.Sku 4283 } 4284 if sr.Name != nil { 4285 objectMap["name"] = sr.Name 4286 } 4287 if sr.Location != nil { 4288 objectMap["location"] = sr.Location 4289 } 4290 if sr.Tags != nil { 4291 objectMap["tags"] = sr.Tags 4292 } 4293 return json.Marshal(objectMap) 4294} 4295 4296// UnmarshalJSON is the custom unmarshaler for ServiceResource struct. 4297func (sr *ServiceResource) UnmarshalJSON(body []byte) error { 4298 var m map[string]*json.RawMessage 4299 err := json.Unmarshal(body, &m) 4300 if err != nil { 4301 return err 4302 } 4303 for k, v := range m { 4304 switch k { 4305 case "properties": 4306 if v != nil { 4307 var serviceProperties ServiceProperties 4308 err = json.Unmarshal(*v, &serviceProperties) 4309 if err != nil { 4310 return err 4311 } 4312 sr.ServiceProperties = &serviceProperties 4313 } 4314 case "sku": 4315 if v != nil { 4316 var sku ServiceSkuProperties 4317 err = json.Unmarshal(*v, &sku) 4318 if err != nil { 4319 return err 4320 } 4321 sr.Sku = &sku 4322 } 4323 case "etag": 4324 if v != nil { 4325 var etag string 4326 err = json.Unmarshal(*v, &etag) 4327 if err != nil { 4328 return err 4329 } 4330 sr.Etag = &etag 4331 } 4332 case "id": 4333 if v != nil { 4334 var ID string 4335 err = json.Unmarshal(*v, &ID) 4336 if err != nil { 4337 return err 4338 } 4339 sr.ID = &ID 4340 } 4341 case "name": 4342 if v != nil { 4343 var name string 4344 err = json.Unmarshal(*v, &name) 4345 if err != nil { 4346 return err 4347 } 4348 sr.Name = &name 4349 } 4350 case "type": 4351 if v != nil { 4352 var typeVar string 4353 err = json.Unmarshal(*v, &typeVar) 4354 if err != nil { 4355 return err 4356 } 4357 sr.Type = &typeVar 4358 } 4359 case "location": 4360 if v != nil { 4361 var location string 4362 err = json.Unmarshal(*v, &location) 4363 if err != nil { 4364 return err 4365 } 4366 sr.Location = &location 4367 } 4368 case "tags": 4369 if v != nil { 4370 var tags map[string]*string 4371 err = json.Unmarshal(*v, &tags) 4372 if err != nil { 4373 return err 4374 } 4375 sr.Tags = tags 4376 } 4377 } 4378 } 4379 4380 return nil 4381} 4382 4383// ServicesApplyNetworkConfigurationUpdatesFuture an abstraction for monitoring and retrieving the results 4384// of a long-running operation. 4385type ServicesApplyNetworkConfigurationUpdatesFuture struct { 4386 azure.FutureAPI 4387 // Result returns the result of the asynchronous operation. 4388 // If the operation has not completed it will return an error. 4389 Result func(ServicesClient) (ServiceResource, error) 4390} 4391 4392// UnmarshalJSON is the custom unmarshaller for CreateFuture. 4393func (future *ServicesApplyNetworkConfigurationUpdatesFuture) UnmarshalJSON(body []byte) error { 4394 var azFuture azure.Future 4395 if err := json.Unmarshal(body, &azFuture); err != nil { 4396 return err 4397 } 4398 future.FutureAPI = &azFuture 4399 future.Result = future.result 4400 return nil 4401} 4402 4403// result is the default implementation for ServicesApplyNetworkConfigurationUpdatesFuture.Result. 4404func (future *ServicesApplyNetworkConfigurationUpdatesFuture) result(client ServicesClient) (sr ServiceResource, err error) { 4405 var done bool 4406 done, err = future.DoneWithContext(context.Background(), client) 4407 if err != nil { 4408 err = autorest.NewErrorWithError(err, "apimanagement.ServicesApplyNetworkConfigurationUpdatesFuture", "Result", future.Response(), "Polling failure") 4409 return 4410 } 4411 if !done { 4412 sr.Response.Response = future.Response() 4413 err = azure.NewAsyncOpIncompleteError("apimanagement.ServicesApplyNetworkConfigurationUpdatesFuture") 4414 return 4415 } 4416 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 4417 if sr.Response.Response, err = future.GetResult(sender); err == nil && sr.Response.Response.StatusCode != http.StatusNoContent { 4418 sr, err = client.ApplyNetworkConfigurationUpdatesResponder(sr.Response.Response) 4419 if err != nil { 4420 err = autorest.NewErrorWithError(err, "apimanagement.ServicesApplyNetworkConfigurationUpdatesFuture", "Result", sr.Response.Response, "Failure responding to request") 4421 } 4422 } 4423 return 4424} 4425 4426// ServicesBackupFuture an abstraction for monitoring and retrieving the results of a long-running 4427// operation. 4428type ServicesBackupFuture struct { 4429 azure.FutureAPI 4430 // Result returns the result of the asynchronous operation. 4431 // If the operation has not completed it will return an error. 4432 Result func(ServicesClient) (ServiceResource, error) 4433} 4434 4435// UnmarshalJSON is the custom unmarshaller for CreateFuture. 4436func (future *ServicesBackupFuture) UnmarshalJSON(body []byte) error { 4437 var azFuture azure.Future 4438 if err := json.Unmarshal(body, &azFuture); err != nil { 4439 return err 4440 } 4441 future.FutureAPI = &azFuture 4442 future.Result = future.result 4443 return nil 4444} 4445 4446// result is the default implementation for ServicesBackupFuture.Result. 4447func (future *ServicesBackupFuture) result(client ServicesClient) (sr ServiceResource, err error) { 4448 var done bool 4449 done, err = future.DoneWithContext(context.Background(), client) 4450 if err != nil { 4451 err = autorest.NewErrorWithError(err, "apimanagement.ServicesBackupFuture", "Result", future.Response(), "Polling failure") 4452 return 4453 } 4454 if !done { 4455 sr.Response.Response = future.Response() 4456 err = azure.NewAsyncOpIncompleteError("apimanagement.ServicesBackupFuture") 4457 return 4458 } 4459 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 4460 if sr.Response.Response, err = future.GetResult(sender); err == nil && sr.Response.Response.StatusCode != http.StatusNoContent { 4461 sr, err = client.BackupResponder(sr.Response.Response) 4462 if err != nil { 4463 err = autorest.NewErrorWithError(err, "apimanagement.ServicesBackupFuture", "Result", sr.Response.Response, "Failure responding to request") 4464 } 4465 } 4466 return 4467} 4468 4469// ServiceSkuProperties API Management service resource SKU properties. 4470type ServiceSkuProperties struct { 4471 // Name - Name of the Sku. Possible values include: 'Developer', 'Standard', 'Premium' 4472 Name SkuType `json:"name,omitempty"` 4473 // Capacity - Capacity of the SKU (number of deployed units of the SKU). The default value is 1. 4474 Capacity *int32 `json:"capacity,omitempty"` 4475} 4476 4477// ServicesManageDeploymentsFuture an abstraction for monitoring and retrieving the results of a 4478// long-running operation. 4479type ServicesManageDeploymentsFuture struct { 4480 azure.FutureAPI 4481 // Result returns the result of the asynchronous operation. 4482 // If the operation has not completed it will return an error. 4483 Result func(ServicesClient) (ServiceResource, error) 4484} 4485 4486// UnmarshalJSON is the custom unmarshaller for CreateFuture. 4487func (future *ServicesManageDeploymentsFuture) UnmarshalJSON(body []byte) error { 4488 var azFuture azure.Future 4489 if err := json.Unmarshal(body, &azFuture); err != nil { 4490 return err 4491 } 4492 future.FutureAPI = &azFuture 4493 future.Result = future.result 4494 return nil 4495} 4496 4497// result is the default implementation for ServicesManageDeploymentsFuture.Result. 4498func (future *ServicesManageDeploymentsFuture) result(client ServicesClient) (sr ServiceResource, err error) { 4499 var done bool 4500 done, err = future.DoneWithContext(context.Background(), client) 4501 if err != nil { 4502 err = autorest.NewErrorWithError(err, "apimanagement.ServicesManageDeploymentsFuture", "Result", future.Response(), "Polling failure") 4503 return 4504 } 4505 if !done { 4506 sr.Response.Response = future.Response() 4507 err = azure.NewAsyncOpIncompleteError("apimanagement.ServicesManageDeploymentsFuture") 4508 return 4509 } 4510 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 4511 if sr.Response.Response, err = future.GetResult(sender); err == nil && sr.Response.Response.StatusCode != http.StatusNoContent { 4512 sr, err = client.ManageDeploymentsResponder(sr.Response.Response) 4513 if err != nil { 4514 err = autorest.NewErrorWithError(err, "apimanagement.ServicesManageDeploymentsFuture", "Result", sr.Response.Response, "Failure responding to request") 4515 } 4516 } 4517 return 4518} 4519 4520// ServicesRestoreFuture an abstraction for monitoring and retrieving the results of a long-running 4521// operation. 4522type ServicesRestoreFuture struct { 4523 azure.FutureAPI 4524 // Result returns the result of the asynchronous operation. 4525 // If the operation has not completed it will return an error. 4526 Result func(ServicesClient) (ServiceResource, error) 4527} 4528 4529// UnmarshalJSON is the custom unmarshaller for CreateFuture. 4530func (future *ServicesRestoreFuture) UnmarshalJSON(body []byte) error { 4531 var azFuture azure.Future 4532 if err := json.Unmarshal(body, &azFuture); err != nil { 4533 return err 4534 } 4535 future.FutureAPI = &azFuture 4536 future.Result = future.result 4537 return nil 4538} 4539 4540// result is the default implementation for ServicesRestoreFuture.Result. 4541func (future *ServicesRestoreFuture) result(client ServicesClient) (sr ServiceResource, err error) { 4542 var done bool 4543 done, err = future.DoneWithContext(context.Background(), client) 4544 if err != nil { 4545 err = autorest.NewErrorWithError(err, "apimanagement.ServicesRestoreFuture", "Result", future.Response(), "Polling failure") 4546 return 4547 } 4548 if !done { 4549 sr.Response.Response = future.Response() 4550 err = azure.NewAsyncOpIncompleteError("apimanagement.ServicesRestoreFuture") 4551 return 4552 } 4553 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 4554 if sr.Response.Response, err = future.GetResult(sender); err == nil && sr.Response.Response.StatusCode != http.StatusNoContent { 4555 sr, err = client.RestoreResponder(sr.Response.Response) 4556 if err != nil { 4557 err = autorest.NewErrorWithError(err, "apimanagement.ServicesRestoreFuture", "Result", sr.Response.Response, "Failure responding to request") 4558 } 4559 } 4560 return 4561} 4562 4563// ServicesUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 4564// operation. 4565type ServicesUpdateFuture struct { 4566 azure.FutureAPI 4567 // Result returns the result of the asynchronous operation. 4568 // If the operation has not completed it will return an error. 4569 Result func(ServicesClient) (ServiceResource, error) 4570} 4571 4572// UnmarshalJSON is the custom unmarshaller for CreateFuture. 4573func (future *ServicesUpdateFuture) UnmarshalJSON(body []byte) error { 4574 var azFuture azure.Future 4575 if err := json.Unmarshal(body, &azFuture); err != nil { 4576 return err 4577 } 4578 future.FutureAPI = &azFuture 4579 future.Result = future.result 4580 return nil 4581} 4582 4583// result is the default implementation for ServicesUpdateFuture.Result. 4584func (future *ServicesUpdateFuture) result(client ServicesClient) (sr ServiceResource, err error) { 4585 var done bool 4586 done, err = future.DoneWithContext(context.Background(), client) 4587 if err != nil { 4588 err = autorest.NewErrorWithError(err, "apimanagement.ServicesUpdateFuture", "Result", future.Response(), "Polling failure") 4589 return 4590 } 4591 if !done { 4592 sr.Response.Response = future.Response() 4593 err = azure.NewAsyncOpIncompleteError("apimanagement.ServicesUpdateFuture") 4594 return 4595 } 4596 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 4597 if sr.Response.Response, err = future.GetResult(sender); err == nil && sr.Response.Response.StatusCode != http.StatusNoContent { 4598 sr, err = client.UpdateResponder(sr.Response.Response) 4599 if err != nil { 4600 err = autorest.NewErrorWithError(err, "apimanagement.ServicesUpdateFuture", "Result", sr.Response.Response, "Failure responding to request") 4601 } 4602 } 4603 return 4604} 4605 4606// ServicesUpdateHostnameFuture an abstraction for monitoring and retrieving the results of a long-running 4607// operation. 4608type ServicesUpdateHostnameFuture struct { 4609 azure.FutureAPI 4610 // Result returns the result of the asynchronous operation. 4611 // If the operation has not completed it will return an error. 4612 Result func(ServicesClient) (ServiceResource, error) 4613} 4614 4615// UnmarshalJSON is the custom unmarshaller for CreateFuture. 4616func (future *ServicesUpdateHostnameFuture) UnmarshalJSON(body []byte) error { 4617 var azFuture azure.Future 4618 if err := json.Unmarshal(body, &azFuture); err != nil { 4619 return err 4620 } 4621 future.FutureAPI = &azFuture 4622 future.Result = future.result 4623 return nil 4624} 4625 4626// result is the default implementation for ServicesUpdateHostnameFuture.Result. 4627func (future *ServicesUpdateHostnameFuture) result(client ServicesClient) (sr ServiceResource, err error) { 4628 var done bool 4629 done, err = future.DoneWithContext(context.Background(), client) 4630 if err != nil { 4631 err = autorest.NewErrorWithError(err, "apimanagement.ServicesUpdateHostnameFuture", "Result", future.Response(), "Polling failure") 4632 return 4633 } 4634 if !done { 4635 sr.Response.Response = future.Response() 4636 err = azure.NewAsyncOpIncompleteError("apimanagement.ServicesUpdateHostnameFuture") 4637 return 4638 } 4639 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 4640 if sr.Response.Response, err = future.GetResult(sender); err == nil && sr.Response.Response.StatusCode != http.StatusNoContent { 4641 sr, err = client.UpdateHostnameResponder(sr.Response.Response) 4642 if err != nil { 4643 err = autorest.NewErrorWithError(err, "apimanagement.ServicesUpdateHostnameFuture", "Result", sr.Response.Response, "Failure responding to request") 4644 } 4645 } 4646 return 4647} 4648 4649// ServiceUpdateHostnameParameters parameters supplied to the UpdateHostname operation. 4650type ServiceUpdateHostnameParameters struct { 4651 // Update - Hostnames to create or update. 4652 Update *[]HostnameConfiguration `json:"update,omitempty"` 4653 // Delete - Hostnames types to delete. 4654 Delete *[]HostnameType `json:"delete,omitempty"` 4655} 4656 4657// ServiceUpdateParameters parameters supplied to the Update API Management service operation. 4658type ServiceUpdateParameters struct { 4659 // ServiceProperties - Properties of the API Management service. 4660 *ServiceProperties `json:"properties,omitempty"` 4661 // Sku - SKU properties of the API Management service. 4662 Sku *ServiceSkuProperties `json:"sku,omitempty"` 4663 // Tags - Resource tags. 4664 Tags map[string]*string `json:"tags"` 4665} 4666 4667// MarshalJSON is the custom marshaler for ServiceUpdateParameters. 4668func (sup ServiceUpdateParameters) MarshalJSON() ([]byte, error) { 4669 objectMap := make(map[string]interface{}) 4670 if sup.ServiceProperties != nil { 4671 objectMap["properties"] = sup.ServiceProperties 4672 } 4673 if sup.Sku != nil { 4674 objectMap["sku"] = sup.Sku 4675 } 4676 if sup.Tags != nil { 4677 objectMap["tags"] = sup.Tags 4678 } 4679 return json.Marshal(objectMap) 4680} 4681 4682// UnmarshalJSON is the custom unmarshaler for ServiceUpdateParameters struct. 4683func (sup *ServiceUpdateParameters) UnmarshalJSON(body []byte) error { 4684 var m map[string]*json.RawMessage 4685 err := json.Unmarshal(body, &m) 4686 if err != nil { 4687 return err 4688 } 4689 for k, v := range m { 4690 switch k { 4691 case "properties": 4692 if v != nil { 4693 var serviceProperties ServiceProperties 4694 err = json.Unmarshal(*v, &serviceProperties) 4695 if err != nil { 4696 return err 4697 } 4698 sup.ServiceProperties = &serviceProperties 4699 } 4700 case "sku": 4701 if v != nil { 4702 var sku ServiceSkuProperties 4703 err = json.Unmarshal(*v, &sku) 4704 if err != nil { 4705 return err 4706 } 4707 sup.Sku = &sku 4708 } 4709 case "tags": 4710 if v != nil { 4711 var tags map[string]*string 4712 err = json.Unmarshal(*v, &tags) 4713 if err != nil { 4714 return err 4715 } 4716 sup.Tags = tags 4717 } 4718 } 4719 } 4720 4721 return nil 4722} 4723 4724// ServiceUploadCertificateParameters parameters supplied to the Upload SSL certificate for an API 4725// Management service operation. 4726type ServiceUploadCertificateParameters struct { 4727 // Type - Hostname type. Possible values include: 'Proxy', 'Portal', 'Management', 'Scm' 4728 Type HostnameType `json:"type,omitempty"` 4729 // Certificate - Base64 Encoded certificate. 4730 Certificate *string `json:"certificate,omitempty"` 4731 // CertificatePassword - Certificate password. 4732 CertificatePassword *string `json:"certificate_password,omitempty"` 4733} 4734 4735// SubscriptionCollection paged Subscriptions list representation. 4736type SubscriptionCollection struct { 4737 autorest.Response `json:"-"` 4738 // Value - Page values. 4739 Value *[]SubscriptionContract `json:"value,omitempty"` 4740 // Count - Total record count number across all pages. 4741 Count *int64 `json:"count,omitempty"` 4742 // NextLink - Next page link if any. 4743 NextLink *string `json:"nextLink,omitempty"` 4744} 4745 4746// SubscriptionCollectionIterator provides access to a complete listing of SubscriptionContract values. 4747type SubscriptionCollectionIterator struct { 4748 i int 4749 page SubscriptionCollectionPage 4750} 4751 4752// NextWithContext advances to the next value. If there was an error making 4753// the request the iterator does not advance and the error is returned. 4754func (iter *SubscriptionCollectionIterator) NextWithContext(ctx context.Context) (err error) { 4755 if tracing.IsEnabled() { 4756 ctx = tracing.StartSpan(ctx, fqdn+"/SubscriptionCollectionIterator.NextWithContext") 4757 defer func() { 4758 sc := -1 4759 if iter.Response().Response.Response != nil { 4760 sc = iter.Response().Response.Response.StatusCode 4761 } 4762 tracing.EndSpan(ctx, sc, err) 4763 }() 4764 } 4765 iter.i++ 4766 if iter.i < len(iter.page.Values()) { 4767 return nil 4768 } 4769 err = iter.page.NextWithContext(ctx) 4770 if err != nil { 4771 iter.i-- 4772 return err 4773 } 4774 iter.i = 0 4775 return nil 4776} 4777 4778// Next advances to the next value. If there was an error making 4779// the request the iterator does not advance and the error is returned. 4780// Deprecated: Use NextWithContext() instead. 4781func (iter *SubscriptionCollectionIterator) Next() error { 4782 return iter.NextWithContext(context.Background()) 4783} 4784 4785// NotDone returns true if the enumeration should be started or is not yet complete. 4786func (iter SubscriptionCollectionIterator) NotDone() bool { 4787 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 4788} 4789 4790// Response returns the raw server response from the last page request. 4791func (iter SubscriptionCollectionIterator) Response() SubscriptionCollection { 4792 return iter.page.Response() 4793} 4794 4795// Value returns the current value or a zero-initialized value if the 4796// iterator has advanced beyond the end of the collection. 4797func (iter SubscriptionCollectionIterator) Value() SubscriptionContract { 4798 if !iter.page.NotDone() { 4799 return SubscriptionContract{} 4800 } 4801 return iter.page.Values()[iter.i] 4802} 4803 4804// Creates a new instance of the SubscriptionCollectionIterator type. 4805func NewSubscriptionCollectionIterator(page SubscriptionCollectionPage) SubscriptionCollectionIterator { 4806 return SubscriptionCollectionIterator{page: page} 4807} 4808 4809// IsEmpty returns true if the ListResult contains no values. 4810func (sc SubscriptionCollection) IsEmpty() bool { 4811 return sc.Value == nil || len(*sc.Value) == 0 4812} 4813 4814// hasNextLink returns true if the NextLink is not empty. 4815func (sc SubscriptionCollection) hasNextLink() bool { 4816 return sc.NextLink != nil && len(*sc.NextLink) != 0 4817} 4818 4819// subscriptionCollectionPreparer prepares a request to retrieve the next set of results. 4820// It returns nil if no more results exist. 4821func (sc SubscriptionCollection) subscriptionCollectionPreparer(ctx context.Context) (*http.Request, error) { 4822 if !sc.hasNextLink() { 4823 return nil, nil 4824 } 4825 return autorest.Prepare((&http.Request{}).WithContext(ctx), 4826 autorest.AsJSON(), 4827 autorest.AsGet(), 4828 autorest.WithBaseURL(to.String(sc.NextLink))) 4829} 4830 4831// SubscriptionCollectionPage contains a page of SubscriptionContract values. 4832type SubscriptionCollectionPage struct { 4833 fn func(context.Context, SubscriptionCollection) (SubscriptionCollection, error) 4834 sc SubscriptionCollection 4835} 4836 4837// NextWithContext advances to the next page of values. If there was an error making 4838// the request the page does not advance and the error is returned. 4839func (page *SubscriptionCollectionPage) NextWithContext(ctx context.Context) (err error) { 4840 if tracing.IsEnabled() { 4841 ctx = tracing.StartSpan(ctx, fqdn+"/SubscriptionCollectionPage.NextWithContext") 4842 defer func() { 4843 sc := -1 4844 if page.Response().Response.Response != nil { 4845 sc = page.Response().Response.Response.StatusCode 4846 } 4847 tracing.EndSpan(ctx, sc, err) 4848 }() 4849 } 4850 for { 4851 next, err := page.fn(ctx, page.sc) 4852 if err != nil { 4853 return err 4854 } 4855 page.sc = next 4856 if !next.hasNextLink() || !next.IsEmpty() { 4857 break 4858 } 4859 } 4860 return nil 4861} 4862 4863// Next advances to the next page of values. If there was an error making 4864// the request the page does not advance and the error is returned. 4865// Deprecated: Use NextWithContext() instead. 4866func (page *SubscriptionCollectionPage) Next() error { 4867 return page.NextWithContext(context.Background()) 4868} 4869 4870// NotDone returns true if the page enumeration should be started or is not yet complete. 4871func (page SubscriptionCollectionPage) NotDone() bool { 4872 return !page.sc.IsEmpty() 4873} 4874 4875// Response returns the raw server response from the last page request. 4876func (page SubscriptionCollectionPage) Response() SubscriptionCollection { 4877 return page.sc 4878} 4879 4880// Values returns the slice of values for the current page or nil if there are no values. 4881func (page SubscriptionCollectionPage) Values() []SubscriptionContract { 4882 if page.sc.IsEmpty() { 4883 return nil 4884 } 4885 return *page.sc.Value 4886} 4887 4888// Creates a new instance of the SubscriptionCollectionPage type. 4889func NewSubscriptionCollectionPage(cur SubscriptionCollection, getNextPage func(context.Context, SubscriptionCollection) (SubscriptionCollection, error)) SubscriptionCollectionPage { 4890 return SubscriptionCollectionPage{ 4891 fn: getNextPage, 4892 sc: cur, 4893 } 4894} 4895 4896// SubscriptionContract subscription details. 4897type SubscriptionContract struct { 4898 autorest.Response `json:"-"` 4899 // ID - READ-ONLY; Uniquely identifies the subscription within the current API Management service instance. The value is a valid relative URL in the format of /subscriptions/{sid} where {sid} is a subscription identifier. 4900 ID *string `json:"id,omitempty"` 4901 // UserID - The user resource identifier of the subscription owner. The value is a valid relative URL in the format of /users/{uid} where {uid} is a user identifier. 4902 UserID *string `json:"userId,omitempty"` 4903 // ProductID - The product resource identifier of the subscribed product. The value is a valid relative URL in the format of /products/{productId} where {productId} is a product identifier. 4904 ProductID *string `json:"productId,omitempty"` 4905 // Name - The name of the subscription, or null if the subscription has no name. 4906 Name *string `json:"name,omitempty"` 4907 // 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' 4908 State SubscriptionStateContract `json:"state,omitempty"` 4909 // 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. 4910 CreatedDate *date.Time `json:"createdDate,omitempty"` 4911 // StartDate - Subscription activation date. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. 4912 StartDate *date.Time `json:"startDate,omitempty"` 4913 // ExpirationDate - Subscription expiration date. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. 4914 ExpirationDate *date.Time `json:"expirationDate,omitempty"` 4915 // EndDate - Date when subscription was cancelled or expired. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. 4916 EndDate *date.Time `json:"endDate,omitempty"` 4917 // 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. 4918 NotificationDate *date.Time `json:"notificationDate,omitempty"` 4919 // PrimaryKey - Subscription primary key. 4920 PrimaryKey *string `json:"primaryKey,omitempty"` 4921 // SecondaryKey - Subscription secondary key. 4922 SecondaryKey *string `json:"secondaryKey,omitempty"` 4923 // StateComment - Optional subscription comment added by an administrator. 4924 StateComment *string `json:"stateComment,omitempty"` 4925} 4926 4927// MarshalJSON is the custom marshaler for SubscriptionContract. 4928func (sc SubscriptionContract) MarshalJSON() ([]byte, error) { 4929 objectMap := make(map[string]interface{}) 4930 if sc.UserID != nil { 4931 objectMap["userId"] = sc.UserID 4932 } 4933 if sc.ProductID != nil { 4934 objectMap["productId"] = sc.ProductID 4935 } 4936 if sc.Name != nil { 4937 objectMap["name"] = sc.Name 4938 } 4939 if sc.State != "" { 4940 objectMap["state"] = sc.State 4941 } 4942 if sc.StartDate != nil { 4943 objectMap["startDate"] = sc.StartDate 4944 } 4945 if sc.ExpirationDate != nil { 4946 objectMap["expirationDate"] = sc.ExpirationDate 4947 } 4948 if sc.EndDate != nil { 4949 objectMap["endDate"] = sc.EndDate 4950 } 4951 if sc.NotificationDate != nil { 4952 objectMap["notificationDate"] = sc.NotificationDate 4953 } 4954 if sc.PrimaryKey != nil { 4955 objectMap["primaryKey"] = sc.PrimaryKey 4956 } 4957 if sc.SecondaryKey != nil { 4958 objectMap["secondaryKey"] = sc.SecondaryKey 4959 } 4960 if sc.StateComment != nil { 4961 objectMap["stateComment"] = sc.StateComment 4962 } 4963 return json.Marshal(objectMap) 4964} 4965 4966// SubscriptionCreateParameters parameters supplied to the Create subscription operation. 4967type SubscriptionCreateParameters struct { 4968 // UserID - User (user id path) for whom subscription is being created in form /users/{uid} 4969 UserID *string `json:"userId,omitempty"` 4970 // ProductID - Product (product id path) for which subscription is being created in form /products/{productId} 4971 ProductID *string `json:"productId,omitempty"` 4972 // Name - Subscription name. 4973 Name *string `json:"name,omitempty"` 4974 // PrimaryKey - Primary subscription key. If not specified during request key will be generated automatically. 4975 PrimaryKey *string `json:"primaryKey,omitempty"` 4976 // SecondaryKey - Secondary subscription key. If not specified during request key will be generated automatically. 4977 SecondaryKey *string `json:"secondaryKey,omitempty"` 4978 // 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' 4979 State SubscriptionStateContract `json:"state,omitempty"` 4980} 4981 4982// SubscriptionKeyParameterNamesContract subscription key parameter names details. 4983type SubscriptionKeyParameterNamesContract struct { 4984 // Header - Subscription key header name. 4985 Header *string `json:"header,omitempty"` 4986 // Query - Subscription key query string parameter name. 4987 Query *string `json:"query,omitempty"` 4988} 4989 4990// SubscriptionUpdateParameters parameters supplied to the Update subscription operation. 4991type SubscriptionUpdateParameters struct { 4992 // UserID - User identifier path: /users/{uid} 4993 UserID *string `json:"userId,omitempty"` 4994 // ProductID - Product identifier path: /products/{productId} 4995 ProductID *string `json:"productId,omitempty"` 4996 // ExpirationDate - New subscription expiration date. 4997 ExpirationDate *date.Time `json:"expirationDate,omitempty"` 4998 // Name - Subscription name. 4999 Name *string `json:"name,omitempty"` 5000 // PrimaryKey - Primary subscription key. 5001 PrimaryKey *string `json:"primaryKey,omitempty"` 5002 // SecondaryKey - Secondary subscription key. 5003 SecondaryKey *string `json:"secondaryKey,omitempty"` 5004 // 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' 5005 State SubscriptionStateContract `json:"state,omitempty"` 5006 // StateComment - Comments describing subscription state change by the administrator. 5007 StateComment *string `json:"stateComment,omitempty"` 5008} 5009 5010// TenantConfigurationDeployFuture an abstraction for monitoring and retrieving the results of a 5011// long-running operation. 5012type TenantConfigurationDeployFuture struct { 5013 azure.FutureAPI 5014 // Result returns the result of the asynchronous operation. 5015 // If the operation has not completed it will return an error. 5016 Result func(TenantConfigurationClient) (OperationResultContract, error) 5017} 5018 5019// UnmarshalJSON is the custom unmarshaller for CreateFuture. 5020func (future *TenantConfigurationDeployFuture) UnmarshalJSON(body []byte) error { 5021 var azFuture azure.Future 5022 if err := json.Unmarshal(body, &azFuture); err != nil { 5023 return err 5024 } 5025 future.FutureAPI = &azFuture 5026 future.Result = future.result 5027 return nil 5028} 5029 5030// result is the default implementation for TenantConfigurationDeployFuture.Result. 5031func (future *TenantConfigurationDeployFuture) result(client TenantConfigurationClient) (orc OperationResultContract, err error) { 5032 var done bool 5033 done, err = future.DoneWithContext(context.Background(), client) 5034 if err != nil { 5035 err = autorest.NewErrorWithError(err, "apimanagement.TenantConfigurationDeployFuture", "Result", future.Response(), "Polling failure") 5036 return 5037 } 5038 if !done { 5039 orc.Response.Response = future.Response() 5040 err = azure.NewAsyncOpIncompleteError("apimanagement.TenantConfigurationDeployFuture") 5041 return 5042 } 5043 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 5044 if orc.Response.Response, err = future.GetResult(sender); err == nil && orc.Response.Response.StatusCode != http.StatusNoContent { 5045 orc, err = client.DeployResponder(orc.Response.Response) 5046 if err != nil { 5047 err = autorest.NewErrorWithError(err, "apimanagement.TenantConfigurationDeployFuture", "Result", orc.Response.Response, "Failure responding to request") 5048 } 5049 } 5050 return 5051} 5052 5053// TenantConfigurationSaveFuture an abstraction for monitoring and retrieving the results of a long-running 5054// operation. 5055type TenantConfigurationSaveFuture struct { 5056 azure.FutureAPI 5057 // Result returns the result of the asynchronous operation. 5058 // If the operation has not completed it will return an error. 5059 Result func(TenantConfigurationClient) (OperationResultContract, error) 5060} 5061 5062// UnmarshalJSON is the custom unmarshaller for CreateFuture. 5063func (future *TenantConfigurationSaveFuture) UnmarshalJSON(body []byte) error { 5064 var azFuture azure.Future 5065 if err := json.Unmarshal(body, &azFuture); err != nil { 5066 return err 5067 } 5068 future.FutureAPI = &azFuture 5069 future.Result = future.result 5070 return nil 5071} 5072 5073// result is the default implementation for TenantConfigurationSaveFuture.Result. 5074func (future *TenantConfigurationSaveFuture) result(client TenantConfigurationClient) (orc OperationResultContract, err error) { 5075 var done bool 5076 done, err = future.DoneWithContext(context.Background(), client) 5077 if err != nil { 5078 err = autorest.NewErrorWithError(err, "apimanagement.TenantConfigurationSaveFuture", "Result", future.Response(), "Polling failure") 5079 return 5080 } 5081 if !done { 5082 orc.Response.Response = future.Response() 5083 err = azure.NewAsyncOpIncompleteError("apimanagement.TenantConfigurationSaveFuture") 5084 return 5085 } 5086 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 5087 if orc.Response.Response, err = future.GetResult(sender); err == nil && orc.Response.Response.StatusCode != http.StatusNoContent { 5088 orc, err = client.SaveResponder(orc.Response.Response) 5089 if err != nil { 5090 err = autorest.NewErrorWithError(err, "apimanagement.TenantConfigurationSaveFuture", "Result", orc.Response.Response, "Failure responding to request") 5091 } 5092 } 5093 return 5094} 5095 5096// TenantConfigurationSyncStateContract tenant Configuration Synchronization State. 5097type TenantConfigurationSyncStateContract struct { 5098 autorest.Response `json:"-"` 5099 // Branch - The name of Git branch. 5100 Branch *string `json:"branch,omitempty"` 5101 // CommitID - The latest commit Id. 5102 CommitID *string `json:"commitId,omitempty"` 5103 // IsExport - value indicating if last sync was save (true) or deploy (false) operation. 5104 IsExport *bool `json:"isExport,omitempty"` 5105 // IsSynced - value indicating if last synchronization was later than the configuration change. 5106 IsSynced *bool `json:"isSynced,omitempty"` 5107 // IsGitEnabled - value indicating whether Git configuration access is enabled. 5108 IsGitEnabled *bool `json:"isGitEnabled,omitempty"` 5109 // 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. 5110 SyncDate *date.Time `json:"syncDate,omitempty"` 5111 // 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. 5112 ConfigurationChangeDate *date.Time `json:"configurationChangeDate,omitempty"` 5113} 5114 5115// TenantConfigurationValidateFuture an abstraction for monitoring and retrieving the results of a 5116// long-running operation. 5117type TenantConfigurationValidateFuture struct { 5118 azure.FutureAPI 5119 // Result returns the result of the asynchronous operation. 5120 // If the operation has not completed it will return an error. 5121 Result func(TenantConfigurationClient) (OperationResultContract, error) 5122} 5123 5124// UnmarshalJSON is the custom unmarshaller for CreateFuture. 5125func (future *TenantConfigurationValidateFuture) UnmarshalJSON(body []byte) error { 5126 var azFuture azure.Future 5127 if err := json.Unmarshal(body, &azFuture); err != nil { 5128 return err 5129 } 5130 future.FutureAPI = &azFuture 5131 future.Result = future.result 5132 return nil 5133} 5134 5135// result is the default implementation for TenantConfigurationValidateFuture.Result. 5136func (future *TenantConfigurationValidateFuture) result(client TenantConfigurationClient) (orc OperationResultContract, err error) { 5137 var done bool 5138 done, err = future.DoneWithContext(context.Background(), client) 5139 if err != nil { 5140 err = autorest.NewErrorWithError(err, "apimanagement.TenantConfigurationValidateFuture", "Result", future.Response(), "Polling failure") 5141 return 5142 } 5143 if !done { 5144 orc.Response.Response = future.Response() 5145 err = azure.NewAsyncOpIncompleteError("apimanagement.TenantConfigurationValidateFuture") 5146 return 5147 } 5148 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 5149 if orc.Response.Response, err = future.GetResult(sender); err == nil && orc.Response.Response.StatusCode != http.StatusNoContent { 5150 orc, err = client.ValidateResponder(orc.Response.Response) 5151 if err != nil { 5152 err = autorest.NewErrorWithError(err, "apimanagement.TenantConfigurationValidateFuture", "Result", orc.Response.Response, "Failure responding to request") 5153 } 5154 } 5155 return 5156} 5157 5158// TokenBodyParameterContract oAuth acquire token request body parameter (www-url-form-encoded). 5159type TokenBodyParameterContract struct { 5160 // Name - body parameter name. 5161 Name *string `json:"name,omitempty"` 5162 // Value - body parameter value. 5163 Value *string `json:"value,omitempty"` 5164} 5165 5166// UserCollection paged Users list representation. 5167type UserCollection struct { 5168 autorest.Response `json:"-"` 5169 // Value - Page values. 5170 Value *[]UserContract `json:"value,omitempty"` 5171 // Count - Total record count number across all pages. 5172 Count *int64 `json:"count,omitempty"` 5173 // NextLink - Next page link if any. 5174 NextLink *string `json:"nextLink,omitempty"` 5175} 5176 5177// UserCollectionIterator provides access to a complete listing of UserContract values. 5178type UserCollectionIterator struct { 5179 i int 5180 page UserCollectionPage 5181} 5182 5183// NextWithContext advances to the next value. If there was an error making 5184// the request the iterator does not advance and the error is returned. 5185func (iter *UserCollectionIterator) NextWithContext(ctx context.Context) (err error) { 5186 if tracing.IsEnabled() { 5187 ctx = tracing.StartSpan(ctx, fqdn+"/UserCollectionIterator.NextWithContext") 5188 defer func() { 5189 sc := -1 5190 if iter.Response().Response.Response != nil { 5191 sc = iter.Response().Response.Response.StatusCode 5192 } 5193 tracing.EndSpan(ctx, sc, err) 5194 }() 5195 } 5196 iter.i++ 5197 if iter.i < len(iter.page.Values()) { 5198 return nil 5199 } 5200 err = iter.page.NextWithContext(ctx) 5201 if err != nil { 5202 iter.i-- 5203 return err 5204 } 5205 iter.i = 0 5206 return nil 5207} 5208 5209// Next advances to the next value. If there was an error making 5210// the request the iterator does not advance and the error is returned. 5211// Deprecated: Use NextWithContext() instead. 5212func (iter *UserCollectionIterator) Next() error { 5213 return iter.NextWithContext(context.Background()) 5214} 5215 5216// NotDone returns true if the enumeration should be started or is not yet complete. 5217func (iter UserCollectionIterator) NotDone() bool { 5218 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 5219} 5220 5221// Response returns the raw server response from the last page request. 5222func (iter UserCollectionIterator) Response() UserCollection { 5223 return iter.page.Response() 5224} 5225 5226// Value returns the current value or a zero-initialized value if the 5227// iterator has advanced beyond the end of the collection. 5228func (iter UserCollectionIterator) Value() UserContract { 5229 if !iter.page.NotDone() { 5230 return UserContract{} 5231 } 5232 return iter.page.Values()[iter.i] 5233} 5234 5235// Creates a new instance of the UserCollectionIterator type. 5236func NewUserCollectionIterator(page UserCollectionPage) UserCollectionIterator { 5237 return UserCollectionIterator{page: page} 5238} 5239 5240// IsEmpty returns true if the ListResult contains no values. 5241func (uc UserCollection) IsEmpty() bool { 5242 return uc.Value == nil || len(*uc.Value) == 0 5243} 5244 5245// hasNextLink returns true if the NextLink is not empty. 5246func (uc UserCollection) hasNextLink() bool { 5247 return uc.NextLink != nil && len(*uc.NextLink) != 0 5248} 5249 5250// userCollectionPreparer prepares a request to retrieve the next set of results. 5251// It returns nil if no more results exist. 5252func (uc UserCollection) userCollectionPreparer(ctx context.Context) (*http.Request, error) { 5253 if !uc.hasNextLink() { 5254 return nil, nil 5255 } 5256 return autorest.Prepare((&http.Request{}).WithContext(ctx), 5257 autorest.AsJSON(), 5258 autorest.AsGet(), 5259 autorest.WithBaseURL(to.String(uc.NextLink))) 5260} 5261 5262// UserCollectionPage contains a page of UserContract values. 5263type UserCollectionPage struct { 5264 fn func(context.Context, UserCollection) (UserCollection, error) 5265 uc UserCollection 5266} 5267 5268// NextWithContext advances to the next page of values. If there was an error making 5269// the request the page does not advance and the error is returned. 5270func (page *UserCollectionPage) NextWithContext(ctx context.Context) (err error) { 5271 if tracing.IsEnabled() { 5272 ctx = tracing.StartSpan(ctx, fqdn+"/UserCollectionPage.NextWithContext") 5273 defer func() { 5274 sc := -1 5275 if page.Response().Response.Response != nil { 5276 sc = page.Response().Response.Response.StatusCode 5277 } 5278 tracing.EndSpan(ctx, sc, err) 5279 }() 5280 } 5281 for { 5282 next, err := page.fn(ctx, page.uc) 5283 if err != nil { 5284 return err 5285 } 5286 page.uc = next 5287 if !next.hasNextLink() || !next.IsEmpty() { 5288 break 5289 } 5290 } 5291 return nil 5292} 5293 5294// Next advances to the next page of values. If there was an error making 5295// the request the page does not advance and the error is returned. 5296// Deprecated: Use NextWithContext() instead. 5297func (page *UserCollectionPage) Next() error { 5298 return page.NextWithContext(context.Background()) 5299} 5300 5301// NotDone returns true if the page enumeration should be started or is not yet complete. 5302func (page UserCollectionPage) NotDone() bool { 5303 return !page.uc.IsEmpty() 5304} 5305 5306// Response returns the raw server response from the last page request. 5307func (page UserCollectionPage) Response() UserCollection { 5308 return page.uc 5309} 5310 5311// Values returns the slice of values for the current page or nil if there are no values. 5312func (page UserCollectionPage) Values() []UserContract { 5313 if page.uc.IsEmpty() { 5314 return nil 5315 } 5316 return *page.uc.Value 5317} 5318 5319// Creates a new instance of the UserCollectionPage type. 5320func NewUserCollectionPage(cur UserCollection, getNextPage func(context.Context, UserCollection) (UserCollection, error)) UserCollectionPage { 5321 return UserCollectionPage{ 5322 fn: getNextPage, 5323 uc: cur, 5324 } 5325} 5326 5327// UserContract user profile. 5328type UserContract struct { 5329 autorest.Response `json:"-"` 5330 // ID - User identifier path. 5331 ID *string `json:"id,omitempty"` 5332 // FirstName - First name. 5333 FirstName *string `json:"firstName,omitempty"` 5334 // LastName - Last name. 5335 LastName *string `json:"lastName,omitempty"` 5336 // Email - Email address. 5337 Email *string `json:"email,omitempty"` 5338 // State - User state. Possible values include: 'UserStateContractActive', 'UserStateContractBlocked' 5339 State UserStateContract `json:"state,omitempty"` 5340 // RegistrationDate - Date of user registration. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. 5341 RegistrationDate *date.Time `json:"registrationDate,omitempty"` 5342 // Note - Administrator's note about given user. 5343 Note *string `json:"note,omitempty"` 5344 // Identities - READ-ONLY; Collection of user identities. 5345 Identities *[]UserIdentityContract `json:"identities,omitempty"` 5346} 5347 5348// MarshalJSON is the custom marshaler for UserContract. 5349func (uc UserContract) MarshalJSON() ([]byte, error) { 5350 objectMap := make(map[string]interface{}) 5351 if uc.ID != nil { 5352 objectMap["id"] = uc.ID 5353 } 5354 if uc.FirstName != nil { 5355 objectMap["firstName"] = uc.FirstName 5356 } 5357 if uc.LastName != nil { 5358 objectMap["lastName"] = uc.LastName 5359 } 5360 if uc.Email != nil { 5361 objectMap["email"] = uc.Email 5362 } 5363 if uc.State != "" { 5364 objectMap["state"] = uc.State 5365 } 5366 if uc.RegistrationDate != nil { 5367 objectMap["registrationDate"] = uc.RegistrationDate 5368 } 5369 if uc.Note != nil { 5370 objectMap["note"] = uc.Note 5371 } 5372 return json.Marshal(objectMap) 5373} 5374 5375// UserCreateParameters parameters supplied to the Create User operation. 5376type UserCreateParameters struct { 5377 // Email - Email address. Must not be empty and must be unique within the service instance. 5378 Email *string `json:"email,omitempty"` 5379 // Password - User Password. 5380 Password *string `json:"password,omitempty"` 5381 // FirstName - First name. 5382 FirstName *string `json:"firstName,omitempty"` 5383 // LastName - Last name. 5384 LastName *string `json:"lastName,omitempty"` 5385 // 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: 'UserStateContractActive', 'UserStateContractBlocked' 5386 State UserStateContract `json:"state,omitempty"` 5387 // Note - Optional note about a user set by the administrator. 5388 Note *string `json:"note,omitempty"` 5389} 5390 5391// UserIdentityCollection list of Users Identity list representation. 5392type UserIdentityCollection struct { 5393 autorest.Response `json:"-"` 5394 // Value - User Identity values. 5395 Value *[]UserIdentityContract `json:"value,omitempty"` 5396} 5397 5398// UserIdentityContract user identity details. 5399type UserIdentityContract struct { 5400 // Provider - Identity provider name. 5401 Provider *string `json:"provider,omitempty"` 5402 // ID - Identifier value within provider. 5403 ID *string `json:"id,omitempty"` 5404} 5405 5406// UserTokenParameters parameters supplied to the Get User Token operation. 5407type UserTokenParameters struct { 5408 // KeyType - The Key to be used to generate token for user. Possible values include: 'Primary', 'Secondary' 5409 KeyType KeyTypeContract `json:"keyType,omitempty"` 5410 // 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. 5411 Expiry *date.Time `json:"expiry,omitempty"` 5412} 5413 5414// UserTokenResult get User Token response details. 5415type UserTokenResult struct { 5416 autorest.Response `json:"-"` 5417 // Value - Shared Access Authorization token for the User. 5418 Value *string `json:"value,omitempty"` 5419} 5420 5421// UserUpdateParameters parameters supplied to the Update User operation. 5422type UserUpdateParameters struct { 5423 // Email - Email address. 5424 Email *string `json:"email,omitempty"` 5425 // Password - Password. 5426 Password *string `json:"password,omitempty"` 5427 // FirstName - First name. 5428 FirstName *string `json:"firstName,omitempty"` 5429 // LastName - Last name. 5430 LastName *string `json:"lastName,omitempty"` 5431 // State - Account state. Possible values include: 'UserStateContractActive', 'UserStateContractBlocked' 5432 State UserStateContract `json:"state,omitempty"` 5433 // Note - Note about user. 5434 Note *string `json:"note,omitempty"` 5435} 5436 5437// VirtualNetworkConfiguration configuration of a virtual network to which API Management service is 5438// deployed. 5439type VirtualNetworkConfiguration struct { 5440 // Vnetid - READ-ONLY; The virtual network ID. This is typically a GUID. Expect a null GUID by default. 5441 Vnetid *string `json:"vnetid,omitempty"` 5442 // Subnetname - READ-ONLY; The name of the subnet. 5443 Subnetname *string `json:"subnetname,omitempty"` 5444 // SubnetResourceID - The full resource ID of a subnet in a virtual network to deploy the API Management service in. 5445 SubnetResourceID *string `json:"subnetResourceId,omitempty"` 5446 // Location - The location of the virtual network. 5447 Location *string `json:"location,omitempty"` 5448} 5449 5450// MarshalJSON is the custom marshaler for VirtualNetworkConfiguration. 5451func (vnc VirtualNetworkConfiguration) MarshalJSON() ([]byte, error) { 5452 objectMap := make(map[string]interface{}) 5453 if vnc.SubnetResourceID != nil { 5454 objectMap["subnetResourceId"] = vnc.SubnetResourceID 5455 } 5456 if vnc.Location != nil { 5457 objectMap["location"] = vnc.Location 5458 } 5459 return json.Marshal(objectMap) 5460} 5461