1package apimanagement 2 3// Copyright (c) Microsoft and contributors. All rights reserved. 4// 5// Licensed under the Apache License, Version 2.0 (the "License"); 6// you may not use this file except in compliance with the License. 7// You may obtain a copy of the License at 8// http://www.apache.org/licenses/LICENSE-2.0 9// 10// Unless required by applicable law or agreed to in writing, software 11// distributed under the License is distributed on an "AS IS" BASIS, 12// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13// 14// See the License for the specific language governing permissions and 15// limitations under the License. 16// 17// Code generated by Microsoft (R) AutoRest Code Generator. 18// Changes may cause incorrect behavior and will be lost if the code is regenerated. 19 20import ( 21 "context" 22 "encoding/json" 23 "github.com/Azure/go-autorest/autorest" 24 "github.com/Azure/go-autorest/autorest/azure" 25 "github.com/Azure/go-autorest/autorest/date" 26 "github.com/Azure/go-autorest/autorest/to" 27 "github.com/Azure/go-autorest/tracing" 28 "net/http" 29) 30 31// The package's fully qualified name. 32const fqdn = "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2016-07-07/apimanagement" 33 34// APIProtocolContract enumerates the values for api protocol contract. 35type APIProtocolContract string 36 37const ( 38 // HTTP ... 39 HTTP APIProtocolContract = "Http" 40 // HTTPS ... 41 HTTPS APIProtocolContract = "Https" 42) 43 44// PossibleAPIProtocolContractValues returns an array of possible values for the APIProtocolContract const type. 45func PossibleAPIProtocolContractValues() []APIProtocolContract { 46 return []APIProtocolContract{HTTP, HTTPS} 47} 48 49// APITypeContract enumerates the values for api type contract. 50type APITypeContract string 51 52const ( 53 // APITypeContractHTTP ... 54 APITypeContractHTTP APITypeContract = "Http" 55 // APITypeContractSoap ... 56 APITypeContractSoap APITypeContract = "Soap" 57) 58 59// PossibleAPITypeContractValues returns an array of possible values for the APITypeContract const type. 60func PossibleAPITypeContractValues() []APITypeContract { 61 return []APITypeContract{APITypeContractHTTP, APITypeContractSoap} 62} 63 64// AsyncOperationState enumerates the values for async operation state. 65type AsyncOperationState string 66 67const ( 68 // Failed ... 69 Failed AsyncOperationState = "Failed" 70 // InProgress ... 71 InProgress AsyncOperationState = "InProgress" 72 // Started ... 73 Started AsyncOperationState = "Started" 74 // Succeeded ... 75 Succeeded AsyncOperationState = "Succeeded" 76) 77 78// PossibleAsyncOperationStateValues returns an array of possible values for the AsyncOperationState const type. 79func PossibleAsyncOperationStateValues() []AsyncOperationState { 80 return []AsyncOperationState{Failed, InProgress, Started, Succeeded} 81} 82 83// BearerTokenSendingMethodsContract enumerates the values for bearer token sending methods contract. 84type BearerTokenSendingMethodsContract string 85 86const ( 87 // AuthorizationHeader ... 88 AuthorizationHeader BearerTokenSendingMethodsContract = "authorizationHeader" 89 // Query ... 90 Query BearerTokenSendingMethodsContract = "query" 91) 92 93// PossibleBearerTokenSendingMethodsContractValues returns an array of possible values for the BearerTokenSendingMethodsContract const type. 94func PossibleBearerTokenSendingMethodsContractValues() []BearerTokenSendingMethodsContract { 95 return []BearerTokenSendingMethodsContract{AuthorizationHeader, Query} 96} 97 98// ClientAuthenticationMethodContract enumerates the values for client authentication method contract. 99type ClientAuthenticationMethodContract string 100 101const ( 102 // Basic ... 103 Basic ClientAuthenticationMethodContract = "Basic" 104 // Body ... 105 Body ClientAuthenticationMethodContract = "Body" 106) 107 108// PossibleClientAuthenticationMethodContractValues returns an array of possible values for the ClientAuthenticationMethodContract const type. 109func PossibleClientAuthenticationMethodContractValues() []ClientAuthenticationMethodContract { 110 return []ClientAuthenticationMethodContract{Basic, Body} 111} 112 113// GrantTypesContract enumerates the values for grant types contract. 114type GrantTypesContract string 115 116const ( 117 // AuthorizationCode ... 118 AuthorizationCode GrantTypesContract = "authorizationCode" 119 // ClientCredentials ... 120 ClientCredentials GrantTypesContract = "clientCredentials" 121 // Implicit ... 122 Implicit GrantTypesContract = "implicit" 123 // ResourceOwnerPassword ... 124 ResourceOwnerPassword GrantTypesContract = "resourceOwnerPassword" 125) 126 127// PossibleGrantTypesContractValues returns an array of possible values for the GrantTypesContract const type. 128func PossibleGrantTypesContractValues() []GrantTypesContract { 129 return []GrantTypesContract{AuthorizationCode, ClientCredentials, Implicit, ResourceOwnerPassword} 130} 131 132// GroupTypeContract enumerates the values for group type contract. 133type GroupTypeContract string 134 135const ( 136 // Custom ... 137 Custom GroupTypeContract = "Custom" 138 // External ... 139 External GroupTypeContract = "External" 140 // System ... 141 System GroupTypeContract = "System" 142) 143 144// PossibleGroupTypeContractValues returns an array of possible values for the GroupTypeContract const type. 145func PossibleGroupTypeContractValues() []GroupTypeContract { 146 return []GroupTypeContract{Custom, External, System} 147} 148 149// HostnameType enumerates the values for hostname type. 150type HostnameType string 151 152const ( 153 // Management ... 154 Management HostnameType = "Management" 155 // Portal ... 156 Portal HostnameType = "Portal" 157 // Proxy ... 158 Proxy HostnameType = "Proxy" 159 // Scm ... 160 Scm HostnameType = "Scm" 161) 162 163// PossibleHostnameTypeValues returns an array of possible values for the HostnameType const type. 164func PossibleHostnameTypeValues() []HostnameType { 165 return []HostnameType{Management, Portal, Proxy, Scm} 166} 167 168// HTTPStatusCode enumerates the values for http status code. 169type HTTPStatusCode string 170 171const ( 172 // Accepted ... 173 Accepted HTTPStatusCode = "Accepted" 174 // Conflict ... 175 Conflict HTTPStatusCode = "Conflict" 176 // Continue ... 177 Continue HTTPStatusCode = "Continue" 178 // Created ... 179 Created HTTPStatusCode = "Created" 180 // NotFound ... 181 NotFound HTTPStatusCode = "NotFound" 182 // OK ... 183 OK HTTPStatusCode = "OK" 184) 185 186// PossibleHTTPStatusCodeValues returns an array of possible values for the HTTPStatusCode const type. 187func PossibleHTTPStatusCodeValues() []HTTPStatusCode { 188 return []HTTPStatusCode{Accepted, Conflict, Continue, Created, NotFound, OK} 189} 190 191// IdentityProviderNameType enumerates the values for identity provider name type. 192type IdentityProviderNameType string 193 194const ( 195 // Aad ... 196 Aad IdentityProviderNameType = "aad" 197 // Facebook ... 198 Facebook IdentityProviderNameType = "facebook" 199 // Google ... 200 Google IdentityProviderNameType = "google" 201 // Microsoft ... 202 Microsoft IdentityProviderNameType = "microsoft" 203 // Twitter ... 204 Twitter IdentityProviderNameType = "twitter" 205) 206 207// PossibleIdentityProviderNameTypeValues returns an array of possible values for the IdentityProviderNameType const type. 208func PossibleIdentityProviderNameTypeValues() []IdentityProviderNameType { 209 return []IdentityProviderNameType{Aad, Facebook, Google, Microsoft, Twitter} 210} 211 212// MethodContract enumerates the values for method contract. 213type MethodContract string 214 215const ( 216 // DELETE ... 217 DELETE MethodContract = "DELETE" 218 // GET ... 219 GET MethodContract = "GET" 220 // HEAD ... 221 HEAD MethodContract = "HEAD" 222 // OPTIONS ... 223 OPTIONS MethodContract = "OPTIONS" 224 // PATCH ... 225 PATCH MethodContract = "PATCH" 226 // POST ... 227 POST MethodContract = "POST" 228 // PUT ... 229 PUT MethodContract = "PUT" 230 // TRACE ... 231 TRACE MethodContract = "TRACE" 232) 233 234// PossibleMethodContractValues returns an array of possible values for the MethodContract const type. 235func PossibleMethodContractValues() []MethodContract { 236 return []MethodContract{DELETE, GET, HEAD, OPTIONS, PATCH, POST, PUT, TRACE} 237} 238 239// NameAvailabilityReason enumerates the values for name availability reason. 240type NameAvailabilityReason string 241 242const ( 243 // AlreadyExists ... 244 AlreadyExists NameAvailabilityReason = "AlreadyExists" 245 // Invalid ... 246 Invalid NameAvailabilityReason = "Invalid" 247 // Valid ... 248 Valid NameAvailabilityReason = "Valid" 249) 250 251// PossibleNameAvailabilityReasonValues returns an array of possible values for the NameAvailabilityReason const type. 252func PossibleNameAvailabilityReasonValues() []NameAvailabilityReason { 253 return []NameAvailabilityReason{AlreadyExists, Invalid, Valid} 254} 255 256// OperationStatus enumerates the values for operation status. 257type OperationStatus string 258 259const ( 260 // OperationStatusFailed ... 261 OperationStatusFailed OperationStatus = "Failed" 262 // OperationStatusInProgress ... 263 OperationStatusInProgress OperationStatus = "InProgress" 264 // OperationStatusSucceeded ... 265 OperationStatusSucceeded OperationStatus = "Succeeded" 266) 267 268// PossibleOperationStatusValues returns an array of possible values for the OperationStatus const type. 269func PossibleOperationStatusValues() []OperationStatus { 270 return []OperationStatus{OperationStatusFailed, OperationStatusInProgress, OperationStatusSucceeded} 271} 272 273// PolicyScopeContract enumerates the values for policy scope contract. 274type PolicyScopeContract string 275 276const ( 277 // All ... 278 All PolicyScopeContract = "All" 279 // API ... 280 API PolicyScopeContract = "Api" 281 // Operation ... 282 Operation PolicyScopeContract = "Operation" 283 // Product ... 284 Product PolicyScopeContract = "Product" 285 // Tenant ... 286 Tenant PolicyScopeContract = "Tenant" 287) 288 289// PossiblePolicyScopeContractValues returns an array of possible values for the PolicyScopeContract const type. 290func PossiblePolicyScopeContractValues() []PolicyScopeContract { 291 return []PolicyScopeContract{All, API, Operation, Product, Tenant} 292} 293 294// ProductStateContract enumerates the values for product state contract. 295type ProductStateContract string 296 297const ( 298 // NotPublished ... 299 NotPublished ProductStateContract = "NotPublished" 300 // Published ... 301 Published ProductStateContract = "Published" 302) 303 304// PossibleProductStateContractValues returns an array of possible values for the ProductStateContract const type. 305func PossibleProductStateContractValues() []ProductStateContract { 306 return []ProductStateContract{NotPublished, Published} 307} 308 309// ReportsAggregation enumerates the values for reports aggregation. 310type ReportsAggregation string 311 312const ( 313 // ByAPI ... 314 ByAPI ReportsAggregation = "byApi" 315 // ByGeo ... 316 ByGeo ReportsAggregation = "byGeo" 317 // ByOperation ... 318 ByOperation ReportsAggregation = "byOperation" 319 // ByProduct ... 320 ByProduct ReportsAggregation = "byProduct" 321 // BySubscription ... 322 BySubscription ReportsAggregation = "bySubscription" 323 // ByTime ... 324 ByTime ReportsAggregation = "byTime" 325 // ByUser ... 326 ByUser ReportsAggregation = "byUser" 327) 328 329// PossibleReportsAggregationValues returns an array of possible values for the ReportsAggregation const type. 330func PossibleReportsAggregationValues() []ReportsAggregation { 331 return []ReportsAggregation{ByAPI, ByGeo, ByOperation, ByProduct, BySubscription, ByTime, ByUser} 332} 333 334// SkuType enumerates the values for sku type. 335type SkuType string 336 337const ( 338 // Developer ... 339 Developer SkuType = "Developer" 340 // Premium ... 341 Premium SkuType = "Premium" 342 // Standard ... 343 Standard SkuType = "Standard" 344) 345 346// PossibleSkuTypeValues returns an array of possible values for the SkuType const type. 347func PossibleSkuTypeValues() []SkuType { 348 return []SkuType{Developer, Premium, Standard} 349} 350 351// SubscriptionStateContract enumerates the values for subscription state contract. 352type SubscriptionStateContract string 353 354const ( 355 // Active ... 356 Active SubscriptionStateContract = "Active" 357 // Cancelled ... 358 Cancelled SubscriptionStateContract = "Cancelled" 359 // Expired ... 360 Expired SubscriptionStateContract = "Expired" 361 // Rejected ... 362 Rejected SubscriptionStateContract = "Rejected" 363 // Submitted ... 364 Submitted SubscriptionStateContract = "Submitted" 365 // Suspended ... 366 Suspended SubscriptionStateContract = "Suspended" 367) 368 369// PossibleSubscriptionStateContractValues returns an array of possible values for the SubscriptionStateContract const type. 370func PossibleSubscriptionStateContractValues() []SubscriptionStateContract { 371 return []SubscriptionStateContract{Active, Cancelled, Expired, Rejected, Submitted, Suspended} 372} 373 374// UserStateContract enumerates the values for user state contract. 375type UserStateContract string 376 377const ( 378 // UserStateContractActive ... 379 UserStateContractActive UserStateContract = "Active" 380 // UserStateContractBlocked ... 381 UserStateContractBlocked UserStateContract = "Blocked" 382) 383 384// PossibleUserStateContractValues returns an array of possible values for the UserStateContract const type. 385func PossibleUserStateContractValues() []UserStateContract { 386 return []UserStateContract{UserStateContractActive, UserStateContractBlocked} 387} 388 389// VirtualNetworkType enumerates the values for virtual network type. 390type VirtualNetworkType string 391 392const ( 393 // VirtualNetworkTypeExternal ... 394 VirtualNetworkTypeExternal VirtualNetworkType = "External" 395 // VirtualNetworkTypeInternal ... 396 VirtualNetworkTypeInternal VirtualNetworkType = "Internal" 397 // VirtualNetworkTypeNone ... 398 VirtualNetworkTypeNone VirtualNetworkType = "None" 399) 400 401// PossibleVirtualNetworkTypeValues returns an array of possible values for the VirtualNetworkType const type. 402func PossibleVirtualNetworkTypeValues() []VirtualNetworkType { 403 return []VirtualNetworkType{VirtualNetworkTypeExternal, VirtualNetworkTypeInternal, VirtualNetworkTypeNone} 404} 405 406// AccessInformationContract tenant access information contract of the API Management service. 407type AccessInformationContract struct { 408 autorest.Response `json:"-"` 409 // ID - Identifier. 410 ID *string `json:"id,omitempty"` 411 // PrimaryKey - Primary access key. 412 PrimaryKey *string `json:"primaryKey,omitempty"` 413 // SecondaryKey - Secondary access key. 414 SecondaryKey *string `json:"secondaryKey,omitempty"` 415 // Enabled - Tenant access information of the API Management service. 416 Enabled *bool `json:"enabled,omitempty"` 417} 418 419// AccessInformationUpdateParameters tenant access information update parameters of the API Management 420// service. 421type AccessInformationUpdateParameters struct { 422 // Enabled - Tenant access information of the API Management service. 423 Enabled *bool `json:"enabled,omitempty"` 424} 425 426// AdditionalRegion description of an additional API Management resource location. 427type AdditionalRegion struct { 428 // Location - The location name of the additional region among Azure Data center regions. 429 Location *string `json:"location,omitempty"` 430 // SkuType - The SKU type in the location. Possible values include: 'Developer', 'Standard', 'Premium' 431 SkuType SkuType `json:"skuType,omitempty"` 432 // 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. 433 SkuUnitCount *int32 `json:"skuUnitCount,omitempty"` 434 // StaticIPs - READ-ONLY; Static IP addresses of the location's virtual machines. 435 StaticIPs *[]string `json:"staticIPs,omitempty"` 436 // Vpnconfiguration - Virtual network configuration for the location. 437 Vpnconfiguration *VirtualNetworkConfiguration `json:"vpnconfiguration,omitempty"` 438} 439 440// APICollection paged Api list representation. 441type APICollection struct { 442 autorest.Response `json:"-"` 443 // Value - Page values. 444 Value *[]APIContract `json:"value,omitempty"` 445 // Count - Total records count number. 446 Count *int64 `json:"count,omitempty"` 447 // NextLink - Next page link if any. 448 NextLink *string `json:"nextLink,omitempty"` 449} 450 451// APICollectionIterator provides access to a complete listing of APIContract values. 452type APICollectionIterator struct { 453 i int 454 page APICollectionPage 455} 456 457// NextWithContext advances to the next value. If there was an error making 458// the request the iterator does not advance and the error is returned. 459func (iter *APICollectionIterator) NextWithContext(ctx context.Context) (err error) { 460 if tracing.IsEnabled() { 461 ctx = tracing.StartSpan(ctx, fqdn+"/APICollectionIterator.NextWithContext") 462 defer func() { 463 sc := -1 464 if iter.Response().Response.Response != nil { 465 sc = iter.Response().Response.Response.StatusCode 466 } 467 tracing.EndSpan(ctx, sc, err) 468 }() 469 } 470 iter.i++ 471 if iter.i < len(iter.page.Values()) { 472 return nil 473 } 474 err = iter.page.NextWithContext(ctx) 475 if err != nil { 476 iter.i-- 477 return err 478 } 479 iter.i = 0 480 return nil 481} 482 483// Next advances to the next value. If there was an error making 484// the request the iterator does not advance and the error is returned. 485// Deprecated: Use NextWithContext() instead. 486func (iter *APICollectionIterator) Next() error { 487 return iter.NextWithContext(context.Background()) 488} 489 490// NotDone returns true if the enumeration should be started or is not yet complete. 491func (iter APICollectionIterator) NotDone() bool { 492 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 493} 494 495// Response returns the raw server response from the last page request. 496func (iter APICollectionIterator) Response() APICollection { 497 return iter.page.Response() 498} 499 500// Value returns the current value or a zero-initialized value if the 501// iterator has advanced beyond the end of the collection. 502func (iter APICollectionIterator) Value() APIContract { 503 if !iter.page.NotDone() { 504 return APIContract{} 505 } 506 return iter.page.Values()[iter.i] 507} 508 509// Creates a new instance of the APICollectionIterator type. 510func NewAPICollectionIterator(page APICollectionPage) APICollectionIterator { 511 return APICollectionIterator{page: page} 512} 513 514// IsEmpty returns true if the ListResult contains no values. 515func (ac APICollection) IsEmpty() bool { 516 return ac.Value == nil || len(*ac.Value) == 0 517} 518 519// aPICollectionPreparer prepares a request to retrieve the next set of results. 520// It returns nil if no more results exist. 521func (ac APICollection) aPICollectionPreparer(ctx context.Context) (*http.Request, error) { 522 if ac.NextLink == nil || len(to.String(ac.NextLink)) < 1 { 523 return nil, nil 524 } 525 return autorest.Prepare((&http.Request{}).WithContext(ctx), 526 autorest.AsJSON(), 527 autorest.AsGet(), 528 autorest.WithBaseURL(to.String(ac.NextLink))) 529} 530 531// APICollectionPage contains a page of APIContract values. 532type APICollectionPage struct { 533 fn func(context.Context, APICollection) (APICollection, error) 534 ac APICollection 535} 536 537// NextWithContext advances to the next page of values. If there was an error making 538// the request the page does not advance and the error is returned. 539func (page *APICollectionPage) NextWithContext(ctx context.Context) (err error) { 540 if tracing.IsEnabled() { 541 ctx = tracing.StartSpan(ctx, fqdn+"/APICollectionPage.NextWithContext") 542 defer func() { 543 sc := -1 544 if page.Response().Response.Response != nil { 545 sc = page.Response().Response.Response.StatusCode 546 } 547 tracing.EndSpan(ctx, sc, err) 548 }() 549 } 550 next, err := page.fn(ctx, page.ac) 551 if err != nil { 552 return err 553 } 554 page.ac = next 555 return nil 556} 557 558// Next advances to the next page of values. If there was an error making 559// the request the page does not advance and the error is returned. 560// Deprecated: Use NextWithContext() instead. 561func (page *APICollectionPage) Next() error { 562 return page.NextWithContext(context.Background()) 563} 564 565// NotDone returns true if the page enumeration should be started or is not yet complete. 566func (page APICollectionPage) NotDone() bool { 567 return !page.ac.IsEmpty() 568} 569 570// Response returns the raw server response from the last page request. 571func (page APICollectionPage) Response() APICollection { 572 return page.ac 573} 574 575// Values returns the slice of values for the current page or nil if there are no values. 576func (page APICollectionPage) Values() []APIContract { 577 if page.ac.IsEmpty() { 578 return nil 579 } 580 return *page.ac.Value 581} 582 583// Creates a new instance of the APICollectionPage type. 584func NewAPICollectionPage(getNextPage func(context.Context, APICollection) (APICollection, error)) APICollectionPage { 585 return APICollectionPage{fn: getNextPage} 586} 587 588// APIContract API details. 589type APIContract struct { 590 autorest.Response `json:"-"` 591 // ID - READ-ONLY; API identifier path: /apis/{apiId} 592 ID *string `json:"id,omitempty"` 593 // Name - API name. 594 Name *string `json:"name,omitempty"` 595 // Description - Description of the API. May include HTML formatting tags. 596 Description *string `json:"description,omitempty"` 597 // ServiceURL - Absolute URL of the backend service implementing this API. 598 ServiceURL *string `json:"serviceUrl,omitempty"` 599 // 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. 600 Path *string `json:"path,omitempty"` 601 // Protocols - Describes on which protocols the operations in this API can be invoked. 602 Protocols *[]APIProtocolContract `json:"protocols,omitempty"` 603 // AuthenticationSettings - Collection of authentication settings included into this API. 604 AuthenticationSettings *AuthenticationSettingsContract `json:"authenticationSettings,omitempty"` 605 // SubscriptionKeyParameterNames - Protocols over which API is made available. 606 SubscriptionKeyParameterNames *SubscriptionKeyParameterNamesContract `json:"subscriptionKeyParameterNames,omitempty"` 607 // Type - Type of API. Possible values include: 'APITypeContractHTTP', 'APITypeContractSoap' 608 Type APITypeContract `json:"type,omitempty"` 609} 610 611// APIExportResult the response model for the export API output operation. 612type APIExportResult struct { 613 autorest.Response `json:"-"` 614 // Content - Response content bytes. 615 Content *[]byte `json:"content,omitempty"` 616 // StatusCode - Possible values include: 'Continue', 'OK', 'Created', 'Accepted', 'NotFound', 'Conflict' 617 StatusCode HTTPStatusCode `json:"statusCode,omitempty"` 618 RequestID *string `json:"requestId,omitempty"` 619} 620 621// AuthenticationSettingsContract API Authentication Settings. 622type AuthenticationSettingsContract struct { 623 OAuth2 *OAuth2AuthenticationSettingsContract `json:"oAuth2,omitempty"` 624} 625 626// AuthorizationServerCollection paged OAuth2 Authorization Servers list representation. 627type AuthorizationServerCollection struct { 628 autorest.Response `json:"-"` 629 // Value - Page values. 630 Value *[]OAuth2AuthorizationServerContract `json:"value,omitempty"` 631 // Count - Total records count number. 632 Count *int64 `json:"count,omitempty"` 633 // NextLink - Next page link if any. 634 NextLink *string `json:"nextLink,omitempty"` 635} 636 637// AuthorizationServerCollectionIterator provides access to a complete listing of 638// OAuth2AuthorizationServerContract values. 639type AuthorizationServerCollectionIterator struct { 640 i int 641 page AuthorizationServerCollectionPage 642} 643 644// NextWithContext advances to the next value. If there was an error making 645// the request the iterator does not advance and the error is returned. 646func (iter *AuthorizationServerCollectionIterator) NextWithContext(ctx context.Context) (err error) { 647 if tracing.IsEnabled() { 648 ctx = tracing.StartSpan(ctx, fqdn+"/AuthorizationServerCollectionIterator.NextWithContext") 649 defer func() { 650 sc := -1 651 if iter.Response().Response.Response != nil { 652 sc = iter.Response().Response.Response.StatusCode 653 } 654 tracing.EndSpan(ctx, sc, err) 655 }() 656 } 657 iter.i++ 658 if iter.i < len(iter.page.Values()) { 659 return nil 660 } 661 err = iter.page.NextWithContext(ctx) 662 if err != nil { 663 iter.i-- 664 return err 665 } 666 iter.i = 0 667 return nil 668} 669 670// Next advances to the next value. If there was an error making 671// the request the iterator does not advance and the error is returned. 672// Deprecated: Use NextWithContext() instead. 673func (iter *AuthorizationServerCollectionIterator) Next() error { 674 return iter.NextWithContext(context.Background()) 675} 676 677// NotDone returns true if the enumeration should be started or is not yet complete. 678func (iter AuthorizationServerCollectionIterator) NotDone() bool { 679 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 680} 681 682// Response returns the raw server response from the last page request. 683func (iter AuthorizationServerCollectionIterator) Response() AuthorizationServerCollection { 684 return iter.page.Response() 685} 686 687// Value returns the current value or a zero-initialized value if the 688// iterator has advanced beyond the end of the collection. 689func (iter AuthorizationServerCollectionIterator) Value() OAuth2AuthorizationServerContract { 690 if !iter.page.NotDone() { 691 return OAuth2AuthorizationServerContract{} 692 } 693 return iter.page.Values()[iter.i] 694} 695 696// Creates a new instance of the AuthorizationServerCollectionIterator type. 697func NewAuthorizationServerCollectionIterator(page AuthorizationServerCollectionPage) AuthorizationServerCollectionIterator { 698 return AuthorizationServerCollectionIterator{page: page} 699} 700 701// IsEmpty returns true if the ListResult contains no values. 702func (asc AuthorizationServerCollection) IsEmpty() bool { 703 return asc.Value == nil || len(*asc.Value) == 0 704} 705 706// authorizationServerCollectionPreparer prepares a request to retrieve the next set of results. 707// It returns nil if no more results exist. 708func (asc AuthorizationServerCollection) authorizationServerCollectionPreparer(ctx context.Context) (*http.Request, error) { 709 if asc.NextLink == nil || len(to.String(asc.NextLink)) < 1 { 710 return nil, nil 711 } 712 return autorest.Prepare((&http.Request{}).WithContext(ctx), 713 autorest.AsJSON(), 714 autorest.AsGet(), 715 autorest.WithBaseURL(to.String(asc.NextLink))) 716} 717 718// AuthorizationServerCollectionPage contains a page of OAuth2AuthorizationServerContract values. 719type AuthorizationServerCollectionPage struct { 720 fn func(context.Context, AuthorizationServerCollection) (AuthorizationServerCollection, error) 721 asc AuthorizationServerCollection 722} 723 724// NextWithContext advances to the next page of values. If there was an error making 725// the request the page does not advance and the error is returned. 726func (page *AuthorizationServerCollectionPage) NextWithContext(ctx context.Context) (err error) { 727 if tracing.IsEnabled() { 728 ctx = tracing.StartSpan(ctx, fqdn+"/AuthorizationServerCollectionPage.NextWithContext") 729 defer func() { 730 sc := -1 731 if page.Response().Response.Response != nil { 732 sc = page.Response().Response.Response.StatusCode 733 } 734 tracing.EndSpan(ctx, sc, err) 735 }() 736 } 737 next, err := page.fn(ctx, page.asc) 738 if err != nil { 739 return err 740 } 741 page.asc = next 742 return nil 743} 744 745// Next advances to the next page of values. If there was an error making 746// the request the page does not advance and the error is returned. 747// Deprecated: Use NextWithContext() instead. 748func (page *AuthorizationServerCollectionPage) Next() error { 749 return page.NextWithContext(context.Background()) 750} 751 752// NotDone returns true if the page enumeration should be started or is not yet complete. 753func (page AuthorizationServerCollectionPage) NotDone() bool { 754 return !page.asc.IsEmpty() 755} 756 757// Response returns the raw server response from the last page request. 758func (page AuthorizationServerCollectionPage) Response() AuthorizationServerCollection { 759 return page.asc 760} 761 762// Values returns the slice of values for the current page or nil if there are no values. 763func (page AuthorizationServerCollectionPage) Values() []OAuth2AuthorizationServerContract { 764 if page.asc.IsEmpty() { 765 return nil 766 } 767 return *page.asc.Value 768} 769 770// Creates a new instance of the AuthorizationServerCollectionPage type. 771func NewAuthorizationServerCollectionPage(getNextPage func(context.Context, AuthorizationServerCollection) (AuthorizationServerCollection, error)) AuthorizationServerCollectionPage { 772 return AuthorizationServerCollectionPage{fn: getNextPage} 773} 774 775// BackendCollection paged Backend list representation. 776type BackendCollection struct { 777 autorest.Response `json:"-"` 778 // Value - Backend values. 779 Value *[]BackendResponse `json:"value,omitempty"` 780 // Count - Total records count number. 781 Count *int64 `json:"count,omitempty"` 782 // NextLink - Next page link if any. 783 NextLink *string `json:"nextLink,omitempty"` 784} 785 786// BackendCollectionIterator provides access to a complete listing of BackendResponse values. 787type BackendCollectionIterator struct { 788 i int 789 page BackendCollectionPage 790} 791 792// NextWithContext advances to the next value. If there was an error making 793// the request the iterator does not advance and the error is returned. 794func (iter *BackendCollectionIterator) NextWithContext(ctx context.Context) (err error) { 795 if tracing.IsEnabled() { 796 ctx = tracing.StartSpan(ctx, fqdn+"/BackendCollectionIterator.NextWithContext") 797 defer func() { 798 sc := -1 799 if iter.Response().Response.Response != nil { 800 sc = iter.Response().Response.Response.StatusCode 801 } 802 tracing.EndSpan(ctx, sc, err) 803 }() 804 } 805 iter.i++ 806 if iter.i < len(iter.page.Values()) { 807 return nil 808 } 809 err = iter.page.NextWithContext(ctx) 810 if err != nil { 811 iter.i-- 812 return err 813 } 814 iter.i = 0 815 return nil 816} 817 818// Next advances to the next value. If there was an error making 819// the request the iterator does not advance and the error is returned. 820// Deprecated: Use NextWithContext() instead. 821func (iter *BackendCollectionIterator) Next() error { 822 return iter.NextWithContext(context.Background()) 823} 824 825// NotDone returns true if the enumeration should be started or is not yet complete. 826func (iter BackendCollectionIterator) NotDone() bool { 827 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 828} 829 830// Response returns the raw server response from the last page request. 831func (iter BackendCollectionIterator) Response() BackendCollection { 832 return iter.page.Response() 833} 834 835// Value returns the current value or a zero-initialized value if the 836// iterator has advanced beyond the end of the collection. 837func (iter BackendCollectionIterator) Value() BackendResponse { 838 if !iter.page.NotDone() { 839 return BackendResponse{} 840 } 841 return iter.page.Values()[iter.i] 842} 843 844// Creates a new instance of the BackendCollectionIterator type. 845func NewBackendCollectionIterator(page BackendCollectionPage) BackendCollectionIterator { 846 return BackendCollectionIterator{page: page} 847} 848 849// IsEmpty returns true if the ListResult contains no values. 850func (bc BackendCollection) IsEmpty() bool { 851 return bc.Value == nil || len(*bc.Value) == 0 852} 853 854// backendCollectionPreparer prepares a request to retrieve the next set of results. 855// It returns nil if no more results exist. 856func (bc BackendCollection) backendCollectionPreparer(ctx context.Context) (*http.Request, error) { 857 if bc.NextLink == nil || len(to.String(bc.NextLink)) < 1 { 858 return nil, nil 859 } 860 return autorest.Prepare((&http.Request{}).WithContext(ctx), 861 autorest.AsJSON(), 862 autorest.AsGet(), 863 autorest.WithBaseURL(to.String(bc.NextLink))) 864} 865 866// BackendCollectionPage contains a page of BackendResponse values. 867type BackendCollectionPage struct { 868 fn func(context.Context, BackendCollection) (BackendCollection, error) 869 bc BackendCollection 870} 871 872// NextWithContext advances to the next page of values. If there was an error making 873// the request the page does not advance and the error is returned. 874func (page *BackendCollectionPage) NextWithContext(ctx context.Context) (err error) { 875 if tracing.IsEnabled() { 876 ctx = tracing.StartSpan(ctx, fqdn+"/BackendCollectionPage.NextWithContext") 877 defer func() { 878 sc := -1 879 if page.Response().Response.Response != nil { 880 sc = page.Response().Response.Response.StatusCode 881 } 882 tracing.EndSpan(ctx, sc, err) 883 }() 884 } 885 next, err := page.fn(ctx, page.bc) 886 if err != nil { 887 return err 888 } 889 page.bc = next 890 return nil 891} 892 893// Next advances to the next page of values. If there was an error making 894// the request the page does not advance and the error is returned. 895// Deprecated: Use NextWithContext() instead. 896func (page *BackendCollectionPage) Next() error { 897 return page.NextWithContext(context.Background()) 898} 899 900// NotDone returns true if the page enumeration should be started or is not yet complete. 901func (page BackendCollectionPage) NotDone() bool { 902 return !page.bc.IsEmpty() 903} 904 905// Response returns the raw server response from the last page request. 906func (page BackendCollectionPage) Response() BackendCollection { 907 return page.bc 908} 909 910// Values returns the slice of values for the current page or nil if there are no values. 911func (page BackendCollectionPage) Values() []BackendResponse { 912 if page.bc.IsEmpty() { 913 return nil 914 } 915 return *page.bc.Value 916} 917 918// Creates a new instance of the BackendCollectionPage type. 919func NewBackendCollectionPage(getNextPage func(context.Context, BackendCollection) (BackendCollection, error)) BackendCollectionPage { 920 return BackendCollectionPage{fn: getNextPage} 921} 922 923// BackendContract parameters supplied to the Create Backend operation. 924type BackendContract struct { 925 // Host - Host attribute of the backend. Host is a pure hostname without a port or suffix, for example backend.contoso.com. Must not be empty. 926 Host *string `json:"host,omitempty"` 927 // SkipCertificateChainValidation - Flag indicating whether SSL certificate chain validation should be skipped when using self-signed certificates for this backend host. 928 SkipCertificateChainValidation *bool `json:"skipCertificateChainValidation,omitempty"` 929} 930 931// BackendResponse the Backend entity in API Management represents a backend service that is configured to 932// skip certification chain validation when using a self-signed certificate to test mutual certificate 933// authentication. 934type BackendResponse struct { 935 autorest.Response `json:"-"` 936 // 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. 937 ID *string `json:"id,omitempty"` 938 // Host - Host attribute of the backend. Host is a pure hostname without a port or suffix, for example backend.contoso.com. Must not be empty. 939 Host *string `json:"host,omitempty"` 940 // SkipCertificateChainValidation - Flag indicating whether SSL certificate chain validation should be skipped when using self-signed certificates for this backend host. 941 SkipCertificateChainValidation *bool `json:"skipCertificateChainValidation,omitempty"` 942} 943 944// BackendUpdateParameters parameters supplied to the Update Backend operation. 945type BackendUpdateParameters struct { 946 // Host - Host attribute of the backend. Host is a pure hostname without a port or suffix, for example backend.contoso.com. Must not be empty. 947 Host *string `json:"host,omitempty"` 948 // SkipCertificateChainValidation - Flag indicating whether SSL certificate chain validation should be skipped when using self-signed certificates for this backend host. 949 SkipCertificateChainValidation *bool `json:"skipCertificateChainValidation,omitempty"` 950} 951 952// CertificateCollection paged Certificates list representation. 953type CertificateCollection struct { 954 autorest.Response `json:"-"` 955 // Value - Page values. 956 Value *[]CertificateContract `json:"value,omitempty"` 957 // Count - Total records count number. 958 Count *int64 `json:"count,omitempty"` 959 // NextLink - Next page link if any. 960 NextLink *string `json:"nextLink,omitempty"` 961} 962 963// CertificateCollectionIterator provides access to a complete listing of CertificateContract values. 964type CertificateCollectionIterator struct { 965 i int 966 page CertificateCollectionPage 967} 968 969// NextWithContext advances to the next value. If there was an error making 970// the request the iterator does not advance and the error is returned. 971func (iter *CertificateCollectionIterator) NextWithContext(ctx context.Context) (err error) { 972 if tracing.IsEnabled() { 973 ctx = tracing.StartSpan(ctx, fqdn+"/CertificateCollectionIterator.NextWithContext") 974 defer func() { 975 sc := -1 976 if iter.Response().Response.Response != nil { 977 sc = iter.Response().Response.Response.StatusCode 978 } 979 tracing.EndSpan(ctx, sc, err) 980 }() 981 } 982 iter.i++ 983 if iter.i < len(iter.page.Values()) { 984 return nil 985 } 986 err = iter.page.NextWithContext(ctx) 987 if err != nil { 988 iter.i-- 989 return err 990 } 991 iter.i = 0 992 return nil 993} 994 995// Next advances to the next value. If there was an error making 996// the request the iterator does not advance and the error is returned. 997// Deprecated: Use NextWithContext() instead. 998func (iter *CertificateCollectionIterator) Next() error { 999 return iter.NextWithContext(context.Background()) 1000} 1001 1002// NotDone returns true if the enumeration should be started or is not yet complete. 1003func (iter CertificateCollectionIterator) NotDone() bool { 1004 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 1005} 1006 1007// Response returns the raw server response from the last page request. 1008func (iter CertificateCollectionIterator) Response() CertificateCollection { 1009 return iter.page.Response() 1010} 1011 1012// Value returns the current value or a zero-initialized value if the 1013// iterator has advanced beyond the end of the collection. 1014func (iter CertificateCollectionIterator) Value() CertificateContract { 1015 if !iter.page.NotDone() { 1016 return CertificateContract{} 1017 } 1018 return iter.page.Values()[iter.i] 1019} 1020 1021// Creates a new instance of the CertificateCollectionIterator type. 1022func NewCertificateCollectionIterator(page CertificateCollectionPage) CertificateCollectionIterator { 1023 return CertificateCollectionIterator{page: page} 1024} 1025 1026// IsEmpty returns true if the ListResult contains no values. 1027func (cc CertificateCollection) IsEmpty() bool { 1028 return cc.Value == nil || len(*cc.Value) == 0 1029} 1030 1031// certificateCollectionPreparer prepares a request to retrieve the next set of results. 1032// It returns nil if no more results exist. 1033func (cc CertificateCollection) certificateCollectionPreparer(ctx context.Context) (*http.Request, error) { 1034 if cc.NextLink == nil || len(to.String(cc.NextLink)) < 1 { 1035 return nil, nil 1036 } 1037 return autorest.Prepare((&http.Request{}).WithContext(ctx), 1038 autorest.AsJSON(), 1039 autorest.AsGet(), 1040 autorest.WithBaseURL(to.String(cc.NextLink))) 1041} 1042 1043// CertificateCollectionPage contains a page of CertificateContract values. 1044type CertificateCollectionPage struct { 1045 fn func(context.Context, CertificateCollection) (CertificateCollection, error) 1046 cc CertificateCollection 1047} 1048 1049// NextWithContext advances to the next page of values. If there was an error making 1050// the request the page does not advance and the error is returned. 1051func (page *CertificateCollectionPage) NextWithContext(ctx context.Context) (err error) { 1052 if tracing.IsEnabled() { 1053 ctx = tracing.StartSpan(ctx, fqdn+"/CertificateCollectionPage.NextWithContext") 1054 defer func() { 1055 sc := -1 1056 if page.Response().Response.Response != nil { 1057 sc = page.Response().Response.Response.StatusCode 1058 } 1059 tracing.EndSpan(ctx, sc, err) 1060 }() 1061 } 1062 next, err := page.fn(ctx, page.cc) 1063 if err != nil { 1064 return err 1065 } 1066 page.cc = next 1067 return nil 1068} 1069 1070// Next advances to the next page of values. If there was an error making 1071// the request the page does not advance and the error is returned. 1072// Deprecated: Use NextWithContext() instead. 1073func (page *CertificateCollectionPage) Next() error { 1074 return page.NextWithContext(context.Background()) 1075} 1076 1077// NotDone returns true if the page enumeration should be started or is not yet complete. 1078func (page CertificateCollectionPage) NotDone() bool { 1079 return !page.cc.IsEmpty() 1080} 1081 1082// Response returns the raw server response from the last page request. 1083func (page CertificateCollectionPage) Response() CertificateCollection { 1084 return page.cc 1085} 1086 1087// Values returns the slice of values for the current page or nil if there are no values. 1088func (page CertificateCollectionPage) Values() []CertificateContract { 1089 if page.cc.IsEmpty() { 1090 return nil 1091 } 1092 return *page.cc.Value 1093} 1094 1095// Creates a new instance of the CertificateCollectionPage type. 1096func NewCertificateCollectionPage(getNextPage func(context.Context, CertificateCollection) (CertificateCollection, error)) CertificateCollectionPage { 1097 return CertificateCollectionPage{fn: getNextPage} 1098} 1099 1100// CertificateContract certificate details. 1101type CertificateContract struct { 1102 autorest.Response `json:"-"` 1103 // ID - READ-ONLY; Certificate identifier path: /certificates/{certificateId} 1104 ID *string `json:"id,omitempty"` 1105 // Subject - Subject attribute of the certificate. 1106 Subject *string `json:"subject,omitempty"` 1107 // Thumbprint - Thumbprint of the certificate. 1108 Thumbprint *string `json:"thumbprint,omitempty"` 1109 // 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. 1110 ExpirationDate *date.Time `json:"expirationDate,omitempty"` 1111} 1112 1113// CertificateCreateOrUpdateParameters parameters supplied to the CreateOrUpdate certificate operation. 1114type CertificateCreateOrUpdateParameters struct { 1115 // Data - Base 64 encoded certificate using the application/x-pkcs12 representation. 1116 Data *string `json:"data,omitempty"` 1117 // Password - Password for the Certificate 1118 Password *string `json:"password,omitempty"` 1119} 1120 1121// CertificateInformation SSL certificate information. 1122type CertificateInformation struct { 1123 autorest.Response `json:"-"` 1124 // 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. 1125 Expiry *date.Time `json:"expiry,omitempty"` 1126 // Thumbprint - Thumbprint of the certificate. 1127 Thumbprint *string `json:"thumbprint,omitempty"` 1128 // Subject - Subject of the certificate. 1129 Subject *string `json:"subject,omitempty"` 1130} 1131 1132// DeployConfigurationParameters parameters supplied to the Deploy Configuration operation. 1133type DeployConfigurationParameters struct { 1134 // Branch - The name of the Git branch from which the configuration is to be deployed to the configuration database. 1135 Branch *string `json:"branch,omitempty"` 1136 // Force - The value enforcing deleting subscriptions to products that are deleted in this update. 1137 Force *bool `json:"force,omitempty"` 1138} 1139 1140// ErrorBodyContract error Body contract. 1141type ErrorBodyContract struct { 1142 autorest.Response `json:"-"` 1143 // Code - Service-defined error code. This code serves as a sub-status for the HTTP error code specified in the response. 1144 Code *string `json:"code,omitempty"` 1145 // Message - Human-readable representation of the error. 1146 Message *string `json:"message,omitempty"` 1147 // Details - The list of invalid fields send in request, in case of validation error. 1148 Details *[]ErrorFieldContract `json:"details,omitempty"` 1149} 1150 1151// ErrorFieldContract error Field contract. 1152type ErrorFieldContract struct { 1153 // Code - Property level error code. 1154 Code *string `json:"code,omitempty"` 1155 // Message - Human-readable representation of property-level error. 1156 Message *string `json:"message,omitempty"` 1157 // Target - Property name. 1158 Target *string `json:"target,omitempty"` 1159} 1160 1161// ErrorResponse error Response. 1162type ErrorResponse struct { 1163 autorest.Response `json:"-"` 1164 // Code - Error code. 1165 Code *string `json:"code,omitempty"` 1166 // Message - Error message indicating why the operation failed. 1167 Message *string `json:"message,omitempty"` 1168} 1169 1170// GenerateSsoURLResult generate SSO Url operations response details. 1171type GenerateSsoURLResult struct { 1172 autorest.Response `json:"-"` 1173 // Value - Redirect Url containing the SSO URL value. 1174 Value *string `json:"value,omitempty"` 1175} 1176 1177// GroupCollection paged Group list representation. 1178type GroupCollection struct { 1179 autorest.Response `json:"-"` 1180 // Value - Page values. 1181 Value *[]GroupContract `json:"value,omitempty"` 1182 // Count - Total records count number. 1183 Count *int64 `json:"count,omitempty"` 1184 // NextLink - Next page link if any. 1185 NextLink *string `json:"nextLink,omitempty"` 1186} 1187 1188// GroupCollectionIterator provides access to a complete listing of GroupContract values. 1189type GroupCollectionIterator struct { 1190 i int 1191 page GroupCollectionPage 1192} 1193 1194// NextWithContext advances to the next value. If there was an error making 1195// the request the iterator does not advance and the error is returned. 1196func (iter *GroupCollectionIterator) NextWithContext(ctx context.Context) (err error) { 1197 if tracing.IsEnabled() { 1198 ctx = tracing.StartSpan(ctx, fqdn+"/GroupCollectionIterator.NextWithContext") 1199 defer func() { 1200 sc := -1 1201 if iter.Response().Response.Response != nil { 1202 sc = iter.Response().Response.Response.StatusCode 1203 } 1204 tracing.EndSpan(ctx, sc, err) 1205 }() 1206 } 1207 iter.i++ 1208 if iter.i < len(iter.page.Values()) { 1209 return nil 1210 } 1211 err = iter.page.NextWithContext(ctx) 1212 if err != nil { 1213 iter.i-- 1214 return err 1215 } 1216 iter.i = 0 1217 return nil 1218} 1219 1220// Next advances to the next value. If there was an error making 1221// the request the iterator does not advance and the error is returned. 1222// Deprecated: Use NextWithContext() instead. 1223func (iter *GroupCollectionIterator) Next() error { 1224 return iter.NextWithContext(context.Background()) 1225} 1226 1227// NotDone returns true if the enumeration should be started or is not yet complete. 1228func (iter GroupCollectionIterator) NotDone() bool { 1229 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 1230} 1231 1232// Response returns the raw server response from the last page request. 1233func (iter GroupCollectionIterator) Response() GroupCollection { 1234 return iter.page.Response() 1235} 1236 1237// Value returns the current value or a zero-initialized value if the 1238// iterator has advanced beyond the end of the collection. 1239func (iter GroupCollectionIterator) Value() GroupContract { 1240 if !iter.page.NotDone() { 1241 return GroupContract{} 1242 } 1243 return iter.page.Values()[iter.i] 1244} 1245 1246// Creates a new instance of the GroupCollectionIterator type. 1247func NewGroupCollectionIterator(page GroupCollectionPage) GroupCollectionIterator { 1248 return GroupCollectionIterator{page: page} 1249} 1250 1251// IsEmpty returns true if the ListResult contains no values. 1252func (gc GroupCollection) IsEmpty() bool { 1253 return gc.Value == nil || len(*gc.Value) == 0 1254} 1255 1256// groupCollectionPreparer prepares a request to retrieve the next set of results. 1257// It returns nil if no more results exist. 1258func (gc GroupCollection) groupCollectionPreparer(ctx context.Context) (*http.Request, error) { 1259 if gc.NextLink == nil || len(to.String(gc.NextLink)) < 1 { 1260 return nil, nil 1261 } 1262 return autorest.Prepare((&http.Request{}).WithContext(ctx), 1263 autorest.AsJSON(), 1264 autorest.AsGet(), 1265 autorest.WithBaseURL(to.String(gc.NextLink))) 1266} 1267 1268// GroupCollectionPage contains a page of GroupContract values. 1269type GroupCollectionPage struct { 1270 fn func(context.Context, GroupCollection) (GroupCollection, error) 1271 gc GroupCollection 1272} 1273 1274// NextWithContext advances to the next page of values. If there was an error making 1275// the request the page does not advance and the error is returned. 1276func (page *GroupCollectionPage) NextWithContext(ctx context.Context) (err error) { 1277 if tracing.IsEnabled() { 1278 ctx = tracing.StartSpan(ctx, fqdn+"/GroupCollectionPage.NextWithContext") 1279 defer func() { 1280 sc := -1 1281 if page.Response().Response.Response != nil { 1282 sc = page.Response().Response.Response.StatusCode 1283 } 1284 tracing.EndSpan(ctx, sc, err) 1285 }() 1286 } 1287 next, err := page.fn(ctx, page.gc) 1288 if err != nil { 1289 return err 1290 } 1291 page.gc = next 1292 return nil 1293} 1294 1295// Next advances to the next page of values. If there was an error making 1296// the request the page does not advance and the error is returned. 1297// Deprecated: Use NextWithContext() instead. 1298func (page *GroupCollectionPage) Next() error { 1299 return page.NextWithContext(context.Background()) 1300} 1301 1302// NotDone returns true if the page enumeration should be started or is not yet complete. 1303func (page GroupCollectionPage) NotDone() bool { 1304 return !page.gc.IsEmpty() 1305} 1306 1307// Response returns the raw server response from the last page request. 1308func (page GroupCollectionPage) Response() GroupCollection { 1309 return page.gc 1310} 1311 1312// Values returns the slice of values for the current page or nil if there are no values. 1313func (page GroupCollectionPage) Values() []GroupContract { 1314 if page.gc.IsEmpty() { 1315 return nil 1316 } 1317 return *page.gc.Value 1318} 1319 1320// Creates a new instance of the GroupCollectionPage type. 1321func NewGroupCollectionPage(getNextPage func(context.Context, GroupCollection) (GroupCollection, error)) GroupCollectionPage { 1322 return GroupCollectionPage{fn: getNextPage} 1323} 1324 1325// GroupContract developer group. 1326type GroupContract struct { 1327 autorest.Response `json:"-"` 1328 // 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. 1329 ID *string `json:"id,omitempty"` 1330 // Name - Group name. 1331 Name *string `json:"name,omitempty"` 1332 // Description - Group description. Can contain HTML formatting tags. 1333 Description *string `json:"description,omitempty"` 1334 // BuiltIn - READ-ONLY; true if the group is one of the three system groups (Administrators, Developers, or Guests); otherwise false. 1335 BuiltIn *bool `json:"builtIn,omitempty"` 1336 // Type - READ-ONLY; Group type. Possible values include: 'Custom', 'System', 'External' 1337 Type GroupTypeContract `json:"type,omitempty"` 1338 // ExternalID - READ-ONLY; For external groups, this property contains the id of the group from the external identity provider, e.g. Azure Active Directory; otherwise the value is null. 1339 ExternalID *string `json:"externalId,omitempty"` 1340} 1341 1342// GroupCreateParameters parameters supplied to the Create Group operation. 1343type GroupCreateParameters struct { 1344 // Name - Group name. 1345 Name *string `json:"name,omitempty"` 1346 // Description - Group description. 1347 Description *string `json:"description,omitempty"` 1348 // Type - Group type. Possible values include: 'Custom', 'System', 'External' 1349 Type GroupTypeContract `json:"type,omitempty"` 1350 // ExternalID - Identifier for an external group. 1351 ExternalID *string `json:"externalId,omitempty"` 1352} 1353 1354// GroupUpdateParameters parameters supplied to the Update Group operation. 1355type GroupUpdateParameters struct { 1356 // Name - Group name. 1357 Name *string `json:"name,omitempty"` 1358 // Description - Group description. 1359 Description *string `json:"description,omitempty"` 1360 // Type - Group type. Possible values include: 'Custom', 'System', 'External' 1361 Type GroupTypeContract `json:"type,omitempty"` 1362 // ExternalID - Identifier for an external group. 1363 ExternalID *string `json:"externalId,omitempty"` 1364} 1365 1366// HostnameConfiguration custom hostname configuration. 1367type HostnameConfiguration struct { 1368 // Type - Hostname type. Possible values include: 'Proxy', 'Portal', 'Management', 'Scm' 1369 Type HostnameType `json:"type,omitempty"` 1370 // Hostname - Hostname. 1371 Hostname *string `json:"hostname,omitempty"` 1372 // Certificate - Certificate information. 1373 Certificate *CertificateInformation `json:"certificate,omitempty"` 1374} 1375 1376// IdentityProviderContract the external Identity Providers like Facebook, Google, Microsoft, Twitter or 1377// Azure Active Directory which can be used to enable access to the API Management service developer portal 1378// for all users. 1379type IdentityProviderContract struct { 1380 autorest.Response `json:"-"` 1381 // 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. 1382 ClientID *string `json:"clientId,omitempty"` 1383 // 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. 1384 ClientSecret *string `json:"clientSecret,omitempty"` 1385 // Type - Identity Provider Type identifier. Possible values include: 'Facebook', 'Google', 'Microsoft', 'Twitter', 'Aad' 1386 Type IdentityProviderNameType `json:"type,omitempty"` 1387 // AllowedTenants - List of Allowed Tenants when configuring Azure Active Directory login. 1388 AllowedTenants *[]string `json:"allowedTenants,omitempty"` 1389} 1390 1391// IdentityProviderList list of all the Identity Providers configured on the service instance. 1392type IdentityProviderList struct { 1393 autorest.Response `json:"-"` 1394 // Value - Identity Provider configuration values. 1395 Value *[]IdentityProviderContract `json:"value,omitempty"` 1396} 1397 1398// IdentityProviderUpdateParameters parameters supplied to the Update Identity Provider operation. 1399type IdentityProviderUpdateParameters struct { 1400 // 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. 1401 ClientID *string `json:"clientId,omitempty"` 1402 // 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. 1403 ClientSecret *string `json:"clientSecret,omitempty"` 1404 // AllowedTenants - List of Allowed Tenants when configuring Azure Active Directory login. 1405 AllowedTenants *[]string `json:"allowedTenants,omitempty"` 1406} 1407 1408// ListPolicySnippetContract ... 1409type ListPolicySnippetContract struct { 1410 autorest.Response `json:"-"` 1411 Value *[]PolicySnippetContract `json:"value,omitempty"` 1412} 1413 1414// ListUserIdentityContract ... 1415type ListUserIdentityContract struct { 1416 autorest.Response `json:"-"` 1417 Value *[]UserIdentityContract `json:"value,omitempty"` 1418} 1419 1420// LoggerCollection paged Logger list representation. 1421type LoggerCollection struct { 1422 autorest.Response `json:"-"` 1423 // Value - Logger values. 1424 Value *[]LoggerResponse `json:"value,omitempty"` 1425 // Count - Total records count number. 1426 Count *int64 `json:"count,omitempty"` 1427 // NextLink - Next page link if any. 1428 NextLink *string `json:"nextLink,omitempty"` 1429} 1430 1431// LoggerCollectionIterator provides access to a complete listing of LoggerResponse values. 1432type LoggerCollectionIterator struct { 1433 i int 1434 page LoggerCollectionPage 1435} 1436 1437// NextWithContext advances to the next value. If there was an error making 1438// the request the iterator does not advance and the error is returned. 1439func (iter *LoggerCollectionIterator) NextWithContext(ctx context.Context) (err error) { 1440 if tracing.IsEnabled() { 1441 ctx = tracing.StartSpan(ctx, fqdn+"/LoggerCollectionIterator.NextWithContext") 1442 defer func() { 1443 sc := -1 1444 if iter.Response().Response.Response != nil { 1445 sc = iter.Response().Response.Response.StatusCode 1446 } 1447 tracing.EndSpan(ctx, sc, err) 1448 }() 1449 } 1450 iter.i++ 1451 if iter.i < len(iter.page.Values()) { 1452 return nil 1453 } 1454 err = iter.page.NextWithContext(ctx) 1455 if err != nil { 1456 iter.i-- 1457 return err 1458 } 1459 iter.i = 0 1460 return nil 1461} 1462 1463// Next advances to the next value. If there was an error making 1464// the request the iterator does not advance and the error is returned. 1465// Deprecated: Use NextWithContext() instead. 1466func (iter *LoggerCollectionIterator) Next() error { 1467 return iter.NextWithContext(context.Background()) 1468} 1469 1470// NotDone returns true if the enumeration should be started or is not yet complete. 1471func (iter LoggerCollectionIterator) NotDone() bool { 1472 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 1473} 1474 1475// Response returns the raw server response from the last page request. 1476func (iter LoggerCollectionIterator) Response() LoggerCollection { 1477 return iter.page.Response() 1478} 1479 1480// Value returns the current value or a zero-initialized value if the 1481// iterator has advanced beyond the end of the collection. 1482func (iter LoggerCollectionIterator) Value() LoggerResponse { 1483 if !iter.page.NotDone() { 1484 return LoggerResponse{} 1485 } 1486 return iter.page.Values()[iter.i] 1487} 1488 1489// Creates a new instance of the LoggerCollectionIterator type. 1490func NewLoggerCollectionIterator(page LoggerCollectionPage) LoggerCollectionIterator { 1491 return LoggerCollectionIterator{page: page} 1492} 1493 1494// IsEmpty returns true if the ListResult contains no values. 1495func (lc LoggerCollection) IsEmpty() bool { 1496 return lc.Value == nil || len(*lc.Value) == 0 1497} 1498 1499// loggerCollectionPreparer prepares a request to retrieve the next set of results. 1500// It returns nil if no more results exist. 1501func (lc LoggerCollection) loggerCollectionPreparer(ctx context.Context) (*http.Request, error) { 1502 if lc.NextLink == nil || len(to.String(lc.NextLink)) < 1 { 1503 return nil, nil 1504 } 1505 return autorest.Prepare((&http.Request{}).WithContext(ctx), 1506 autorest.AsJSON(), 1507 autorest.AsGet(), 1508 autorest.WithBaseURL(to.String(lc.NextLink))) 1509} 1510 1511// LoggerCollectionPage contains a page of LoggerResponse values. 1512type LoggerCollectionPage struct { 1513 fn func(context.Context, LoggerCollection) (LoggerCollection, error) 1514 lc LoggerCollection 1515} 1516 1517// NextWithContext advances to the next page of values. If there was an error making 1518// the request the page does not advance and the error is returned. 1519func (page *LoggerCollectionPage) NextWithContext(ctx context.Context) (err error) { 1520 if tracing.IsEnabled() { 1521 ctx = tracing.StartSpan(ctx, fqdn+"/LoggerCollectionPage.NextWithContext") 1522 defer func() { 1523 sc := -1 1524 if page.Response().Response.Response != nil { 1525 sc = page.Response().Response.Response.StatusCode 1526 } 1527 tracing.EndSpan(ctx, sc, err) 1528 }() 1529 } 1530 next, err := page.fn(ctx, page.lc) 1531 if err != nil { 1532 return err 1533 } 1534 page.lc = next 1535 return nil 1536} 1537 1538// Next advances to the next page of values. If there was an error making 1539// the request the page does not advance and the error is returned. 1540// Deprecated: Use NextWithContext() instead. 1541func (page *LoggerCollectionPage) Next() error { 1542 return page.NextWithContext(context.Background()) 1543} 1544 1545// NotDone returns true if the page enumeration should be started or is not yet complete. 1546func (page LoggerCollectionPage) NotDone() bool { 1547 return !page.lc.IsEmpty() 1548} 1549 1550// Response returns the raw server response from the last page request. 1551func (page LoggerCollectionPage) Response() LoggerCollection { 1552 return page.lc 1553} 1554 1555// Values returns the slice of values for the current page or nil if there are no values. 1556func (page LoggerCollectionPage) Values() []LoggerResponse { 1557 if page.lc.IsEmpty() { 1558 return nil 1559 } 1560 return *page.lc.Value 1561} 1562 1563// Creates a new instance of the LoggerCollectionPage type. 1564func NewLoggerCollectionPage(getNextPage func(context.Context, LoggerCollection) (LoggerCollection, error)) LoggerCollectionPage { 1565 return LoggerCollectionPage{fn: getNextPage} 1566} 1567 1568// LoggerCreateParameters parameters supplied to the Create Logger operation. 1569type LoggerCreateParameters struct { 1570 // Type - Logger type. 1571 Type *string `json:"type,omitempty"` 1572 // Description - Logger description. 1573 Description *string `json:"description,omitempty"` 1574 // Credentials - The name and SendRule connection string of the event hub. 1575 Credentials map[string]*string `json:"credentials"` 1576 // IsBuffered - Whether records are buffered in the logger before publishing. Default is assumed to be true. 1577 IsBuffered *bool `json:"isBuffered,omitempty"` 1578} 1579 1580// MarshalJSON is the custom marshaler for LoggerCreateParameters. 1581func (lcp LoggerCreateParameters) MarshalJSON() ([]byte, error) { 1582 objectMap := make(map[string]interface{}) 1583 if lcp.Type != nil { 1584 objectMap["type"] = lcp.Type 1585 } 1586 if lcp.Description != nil { 1587 objectMap["description"] = lcp.Description 1588 } 1589 if lcp.Credentials != nil { 1590 objectMap["credentials"] = lcp.Credentials 1591 } 1592 if lcp.IsBuffered != nil { 1593 objectMap["isBuffered"] = lcp.IsBuffered 1594 } 1595 return json.Marshal(objectMap) 1596} 1597 1598// LoggerResponse the Logger entity in API Management represents an event sink that you can use to log API 1599// Management events. Currently the Logger entity supports logging API Management events to Azure Event 1600// Hubs. 1601type LoggerResponse struct { 1602 autorest.Response `json:"-"` 1603 // 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. 1604 ID *string `json:"id,omitempty"` 1605 // Type - Logger type. 1606 Type *string `json:"type,omitempty"` 1607 // Description - Logger description. 1608 Description *string `json:"description,omitempty"` 1609 // Credentials - The name and SendRule connection string of the event hub. 1610 Credentials map[string]*string `json:"credentials"` 1611 // IsBuffered - Whether records are buffered in the logger before publishing. Default is assumed to be true. 1612 IsBuffered *bool `json:"isBuffered,omitempty"` 1613} 1614 1615// MarshalJSON is the custom marshaler for LoggerResponse. 1616func (lr LoggerResponse) MarshalJSON() ([]byte, error) { 1617 objectMap := make(map[string]interface{}) 1618 if lr.Type != nil { 1619 objectMap["type"] = lr.Type 1620 } 1621 if lr.Description != nil { 1622 objectMap["description"] = lr.Description 1623 } 1624 if lr.Credentials != nil { 1625 objectMap["credentials"] = lr.Credentials 1626 } 1627 if lr.IsBuffered != nil { 1628 objectMap["isBuffered"] = lr.IsBuffered 1629 } 1630 return json.Marshal(objectMap) 1631} 1632 1633// LoggerUpdateParameters parameters supplied to the Update Logger operation. 1634type LoggerUpdateParameters struct { 1635 // Type - Logger type. 1636 Type *string `json:"type,omitempty"` 1637 // Description - Logger description. 1638 Description *string `json:"description,omitempty"` 1639 // Credentials - Logger credentials. 1640 Credentials map[string]*string `json:"credentials"` 1641 // IsBuffered - whether records are buffered in the logger before publishing. Default is assumed to be true. 1642 IsBuffered *bool `json:"isBuffered,omitempty"` 1643} 1644 1645// MarshalJSON is the custom marshaler for LoggerUpdateParameters. 1646func (lup LoggerUpdateParameters) MarshalJSON() ([]byte, error) { 1647 objectMap := make(map[string]interface{}) 1648 if lup.Type != nil { 1649 objectMap["type"] = lup.Type 1650 } 1651 if lup.Description != nil { 1652 objectMap["description"] = lup.Description 1653 } 1654 if lup.Credentials != nil { 1655 objectMap["credentials"] = lup.Credentials 1656 } 1657 if lup.IsBuffered != nil { 1658 objectMap["isBuffered"] = lup.IsBuffered 1659 } 1660 return json.Marshal(objectMap) 1661} 1662 1663// OAuth2AuthenticationSettingsContract API OAuth2 Authentication settings details. 1664type OAuth2AuthenticationSettingsContract struct { 1665 // AuthorizationServerID - OAuth authorization server identifier. 1666 AuthorizationServerID *string `json:"authorizationServerId,omitempty"` 1667 // Scope - operations scope. 1668 Scope *string `json:"scope,omitempty"` 1669} 1670 1671// OAuth2AuthorizationServerContract external OAuth authorization server settings. 1672type OAuth2AuthorizationServerContract struct { 1673 autorest.Response `json:"-"` 1674 // 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. 1675 ID *string `json:"id,omitempty"` 1676 // Name - User-friendly authorization server name. 1677 Name *string `json:"name,omitempty"` 1678 // Description - Description of the authorization server. Can contain HTML formatting tags. 1679 Description *string `json:"description,omitempty"` 1680 // ClientRegistrationEndpoint - Optional reference to a page where client or app registration for this authorization server is performed. Contains absolute URL to entity being referenced. 1681 ClientRegistrationEndpoint *string `json:"clientRegistrationEndpoint,omitempty"` 1682 // AuthorizationEndpoint - OAuth authorization endpoint. See http://tools.ietf.org/html/rfc6749#section-3.2. 1683 AuthorizationEndpoint *string `json:"authorizationEndpoint,omitempty"` 1684 // AuthorizationMethods - HTTP verbs supported by the authorization endpoint. GET must be always present. POST is optional. 1685 AuthorizationMethods *[]MethodContract `json:"authorizationMethods,omitempty"` 1686 // 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. 1687 ClientAuthenticationMethod *[]ClientAuthenticationMethodContract `json:"clientAuthenticationMethod,omitempty"` 1688 // 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"}. 1689 TokenBodyParameters *[]TokenBodyParameterContract `json:"tokenBodyParameters,omitempty"` 1690 // TokenEndpoint - OAuth token endpoint. Contains absolute URI to entity being referenced. 1691 TokenEndpoint *string `json:"tokenEndpoint,omitempty"` 1692 // 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. 1693 SupportState *bool `json:"supportState,omitempty"` 1694 // 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. 1695 DefaultScope *string `json:"defaultScope,omitempty"` 1696 // GrantTypes - Form of an authorization grant, which the client uses to request the access token. 1697 GrantTypes *[]GrantTypesContract `json:"grantTypes,omitempty"` 1698 // BearerTokenSendingMethods - Specifies the mechanism by which access token is passed to the API. 1699 BearerTokenSendingMethods *[]BearerTokenSendingMethodsContract `json:"bearerTokenSendingMethods,omitempty"` 1700 // ClientID - Client or app id registered with this authorization server. 1701 ClientID *string `json:"clientId,omitempty"` 1702 // ClientSecret - Client or app secret registered with this authorization server. 1703 ClientSecret *string `json:"clientSecret,omitempty"` 1704 // ResourceOwnerUsername - Can be optionally specified when resource owner password grant type is supported by this authorization server. Default resource owner username. 1705 ResourceOwnerUsername *string `json:"resourceOwnerUsername,omitempty"` 1706 // ResourceOwnerPassword - Can be optionally specified when resource owner password grant type is supported by this authorization server. Default resource owner password. 1707 ResourceOwnerPassword *string `json:"resourceOwnerPassword,omitempty"` 1708} 1709 1710// OAuth2AuthorizationServerUpdateContract external OAuth authorization server Update settings contract. 1711type OAuth2AuthorizationServerUpdateContract struct { 1712 // Name - User-friendly authorization server name. 1713 Name *string `json:"name,omitempty"` 1714 // Description - Description of the authorization server. Can contain HTML formatting tags. 1715 Description *string `json:"description,omitempty"` 1716 // ClientRegistrationEndpoint - Optional reference to a page where client or app registration for this authorization server is performed. Contains absolute URL to entity being referenced. 1717 ClientRegistrationEndpoint *string `json:"clientRegistrationEndpoint,omitempty"` 1718 // AuthorizationEndpoint - OAuth authorization endpoint. See http://tools.ietf.org/html/rfc6749#section-3.2. 1719 AuthorizationEndpoint *string `json:"authorizationEndpoint,omitempty"` 1720 // AuthorizationMethods - HTTP verbs supported by the authorization endpoint. GET must be always present. POST is optional. 1721 AuthorizationMethods *[]MethodContract `json:"authorizationMethods,omitempty"` 1722 // 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. 1723 ClientAuthenticationMethod *[]ClientAuthenticationMethodContract `json:"clientAuthenticationMethod,omitempty"` 1724 // 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"}. 1725 TokenBodyParameters *[]TokenBodyParameterContract `json:"tokenBodyParameters,omitempty"` 1726 // TokenEndpoint - OAuth token endpoint. Contains absolute URI to entity being referenced. 1727 TokenEndpoint *string `json:"tokenEndpoint,omitempty"` 1728 // 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. 1729 SupportState *bool `json:"supportState,omitempty"` 1730 // 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. 1731 DefaultScope *string `json:"defaultScope,omitempty"` 1732 // GrantTypes - Form of an authorization grant, which the client uses to request the access token. 1733 GrantTypes *[]GrantTypesContract `json:"grantTypes,omitempty"` 1734 // BearerTokenSendingMethods - Specifies the mechanism by which access token is passed to the API. 1735 BearerTokenSendingMethods *[]BearerTokenSendingMethodsContract `json:"bearerTokenSendingMethods,omitempty"` 1736 // ClientID - Client or app id registered with this authorization server. 1737 ClientID *string `json:"clientId,omitempty"` 1738 // ClientSecret - Client or app secret registered with this authorization server. 1739 ClientSecret *string `json:"clientSecret,omitempty"` 1740 // ResourceOwnerUsername - Can be optionally specified when resource owner password grant type is supported by this authorization server. Default resource owner username. 1741 ResourceOwnerUsername *string `json:"resourceOwnerUsername,omitempty"` 1742 // ResourceOwnerPassword - Can be optionally specified when resource owner password grant type is supported by this authorization server. Default resource owner password. 1743 ResourceOwnerPassword *string `json:"resourceOwnerPassword,omitempty"` 1744} 1745 1746// OpenIDConnectProviderCollection paged OpenIdProviders list representation. 1747type OpenIDConnectProviderCollection struct { 1748 autorest.Response `json:"-"` 1749 // Value - Page values. 1750 Value *[]OpenidConnectProviderContract `json:"value,omitempty"` 1751 // Count - Total records count number. 1752 Count *int64 `json:"count,omitempty"` 1753 // NextLink - Next page link if any. 1754 NextLink *string `json:"nextLink,omitempty"` 1755} 1756 1757// OpenIDConnectProviderCollectionIterator provides access to a complete listing of 1758// OpenidConnectProviderContract values. 1759type OpenIDConnectProviderCollectionIterator struct { 1760 i int 1761 page OpenIDConnectProviderCollectionPage 1762} 1763 1764// NextWithContext advances to the next value. If there was an error making 1765// the request the iterator does not advance and the error is returned. 1766func (iter *OpenIDConnectProviderCollectionIterator) NextWithContext(ctx context.Context) (err error) { 1767 if tracing.IsEnabled() { 1768 ctx = tracing.StartSpan(ctx, fqdn+"/OpenIDConnectProviderCollectionIterator.NextWithContext") 1769 defer func() { 1770 sc := -1 1771 if iter.Response().Response.Response != nil { 1772 sc = iter.Response().Response.Response.StatusCode 1773 } 1774 tracing.EndSpan(ctx, sc, err) 1775 }() 1776 } 1777 iter.i++ 1778 if iter.i < len(iter.page.Values()) { 1779 return nil 1780 } 1781 err = iter.page.NextWithContext(ctx) 1782 if err != nil { 1783 iter.i-- 1784 return err 1785 } 1786 iter.i = 0 1787 return nil 1788} 1789 1790// Next advances to the next value. If there was an error making 1791// the request the iterator does not advance and the error is returned. 1792// Deprecated: Use NextWithContext() instead. 1793func (iter *OpenIDConnectProviderCollectionIterator) Next() error { 1794 return iter.NextWithContext(context.Background()) 1795} 1796 1797// NotDone returns true if the enumeration should be started or is not yet complete. 1798func (iter OpenIDConnectProviderCollectionIterator) NotDone() bool { 1799 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 1800} 1801 1802// Response returns the raw server response from the last page request. 1803func (iter OpenIDConnectProviderCollectionIterator) Response() OpenIDConnectProviderCollection { 1804 return iter.page.Response() 1805} 1806 1807// Value returns the current value or a zero-initialized value if the 1808// iterator has advanced beyond the end of the collection. 1809func (iter OpenIDConnectProviderCollectionIterator) Value() OpenidConnectProviderContract { 1810 if !iter.page.NotDone() { 1811 return OpenidConnectProviderContract{} 1812 } 1813 return iter.page.Values()[iter.i] 1814} 1815 1816// Creates a new instance of the OpenIDConnectProviderCollectionIterator type. 1817func NewOpenIDConnectProviderCollectionIterator(page OpenIDConnectProviderCollectionPage) OpenIDConnectProviderCollectionIterator { 1818 return OpenIDConnectProviderCollectionIterator{page: page} 1819} 1820 1821// IsEmpty returns true if the ListResult contains no values. 1822func (oicpc OpenIDConnectProviderCollection) IsEmpty() bool { 1823 return oicpc.Value == nil || len(*oicpc.Value) == 0 1824} 1825 1826// openIDConnectProviderCollectionPreparer prepares a request to retrieve the next set of results. 1827// It returns nil if no more results exist. 1828func (oicpc OpenIDConnectProviderCollection) openIDConnectProviderCollectionPreparer(ctx context.Context) (*http.Request, error) { 1829 if oicpc.NextLink == nil || len(to.String(oicpc.NextLink)) < 1 { 1830 return nil, nil 1831 } 1832 return autorest.Prepare((&http.Request{}).WithContext(ctx), 1833 autorest.AsJSON(), 1834 autorest.AsGet(), 1835 autorest.WithBaseURL(to.String(oicpc.NextLink))) 1836} 1837 1838// OpenIDConnectProviderCollectionPage contains a page of OpenidConnectProviderContract values. 1839type OpenIDConnectProviderCollectionPage struct { 1840 fn func(context.Context, OpenIDConnectProviderCollection) (OpenIDConnectProviderCollection, error) 1841 oicpc OpenIDConnectProviderCollection 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 *OpenIDConnectProviderCollectionPage) NextWithContext(ctx context.Context) (err error) { 1847 if tracing.IsEnabled() { 1848 ctx = tracing.StartSpan(ctx, fqdn+"/OpenIDConnectProviderCollectionPage.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 next, err := page.fn(ctx, page.oicpc) 1858 if err != nil { 1859 return err 1860 } 1861 page.oicpc = next 1862 return nil 1863} 1864 1865// Next advances to the next page of values. If there was an error making 1866// the request the page does not advance and the error is returned. 1867// Deprecated: Use NextWithContext() instead. 1868func (page *OpenIDConnectProviderCollectionPage) Next() error { 1869 return page.NextWithContext(context.Background()) 1870} 1871 1872// NotDone returns true if the page enumeration should be started or is not yet complete. 1873func (page OpenIDConnectProviderCollectionPage) NotDone() bool { 1874 return !page.oicpc.IsEmpty() 1875} 1876 1877// Response returns the raw server response from the last page request. 1878func (page OpenIDConnectProviderCollectionPage) Response() OpenIDConnectProviderCollection { 1879 return page.oicpc 1880} 1881 1882// Values returns the slice of values for the current page or nil if there are no values. 1883func (page OpenIDConnectProviderCollectionPage) Values() []OpenidConnectProviderContract { 1884 if page.oicpc.IsEmpty() { 1885 return nil 1886 } 1887 return *page.oicpc.Value 1888} 1889 1890// Creates a new instance of the OpenIDConnectProviderCollectionPage type. 1891func NewOpenIDConnectProviderCollectionPage(getNextPage func(context.Context, OpenIDConnectProviderCollection) (OpenIDConnectProviderCollection, error)) OpenIDConnectProviderCollectionPage { 1892 return OpenIDConnectProviderCollectionPage{fn: getNextPage} 1893} 1894 1895// OpenidConnectProviderContract openID Connect Providers Contract. 1896type OpenidConnectProviderContract struct { 1897 autorest.Response `json:"-"` 1898 // ID - OpenID Connect Provider identifier. 1899 ID *string `json:"id,omitempty"` 1900 // Name - User-friendly OpenID Connect Provider name. 1901 Name *string `json:"name,omitempty"` 1902 // Description - User-friendly description of OpenID Connect Provider. 1903 Description *string `json:"description,omitempty"` 1904 // MetadataEndpoint - Metadata endpoint URI. 1905 MetadataEndpoint *string `json:"metadataEndpoint,omitempty"` 1906 // ClientID - Client ID of developer console which is the client application. 1907 ClientID *string `json:"clientId,omitempty"` 1908 // ClientSecret - Client Secret of developer console which is the client application. 1909 ClientSecret *string `json:"clientSecret,omitempty"` 1910} 1911 1912// OpenidConnectProviderCreateContract parameters supplied to the Create OpenID Connect Provider operation. 1913type OpenidConnectProviderCreateContract struct { 1914 // Name - User-friendly OpenID Connect Provider name. 1915 Name *string `json:"name,omitempty"` 1916 // Description - User-friendly description of OpenID Connect Provider. 1917 Description *string `json:"description,omitempty"` 1918 // MetadataEndpoint - Metadata endpoint URI. 1919 MetadataEndpoint *string `json:"metadataEndpoint,omitempty"` 1920 // ClientID - Client ID of developer console which is the client application. 1921 ClientID *string `json:"clientId,omitempty"` 1922 // ClientSecret - Client Secret of developer console which is the client application. 1923 ClientSecret *string `json:"clientSecret,omitempty"` 1924} 1925 1926// OpenidConnectProviderUpdateContract parameters supplied to the Update OpenID Connect Provider operation. 1927type OpenidConnectProviderUpdateContract struct { 1928 // Name - User-friendly OpenID Connect Provider name. 1929 Name *string `json:"name,omitempty"` 1930 // Description - User-friendly description of OpenID Connect Provider. 1931 Description *string `json:"description,omitempty"` 1932 // MetadataEndpoint - Metadata endpoint URI. 1933 MetadataEndpoint *string `json:"metadataEndpoint,omitempty"` 1934 // ClientID - Client ID of developer console which is the client application. 1935 ClientID *string `json:"clientId,omitempty"` 1936 // ClientSecret - Client Secret of developer console which is the client application. 1937 ClientSecret *string `json:"clientSecret,omitempty"` 1938} 1939 1940// OperationCollection paged Operation list representation. 1941type OperationCollection struct { 1942 autorest.Response `json:"-"` 1943 // Value - Page values. 1944 Value *[]OperationContract `json:"value,omitempty"` 1945 // Count - Total records count number. 1946 Count *int64 `json:"count,omitempty"` 1947 // NextLink - Next page link if any. 1948 NextLink *string `json:"nextLink,omitempty"` 1949} 1950 1951// OperationCollectionIterator provides access to a complete listing of OperationContract values. 1952type OperationCollectionIterator struct { 1953 i int 1954 page OperationCollectionPage 1955} 1956 1957// NextWithContext advances to the next value. If there was an error making 1958// the request the iterator does not advance and the error is returned. 1959func (iter *OperationCollectionIterator) NextWithContext(ctx context.Context) (err error) { 1960 if tracing.IsEnabled() { 1961 ctx = tracing.StartSpan(ctx, fqdn+"/OperationCollectionIterator.NextWithContext") 1962 defer func() { 1963 sc := -1 1964 if iter.Response().Response.Response != nil { 1965 sc = iter.Response().Response.Response.StatusCode 1966 } 1967 tracing.EndSpan(ctx, sc, err) 1968 }() 1969 } 1970 iter.i++ 1971 if iter.i < len(iter.page.Values()) { 1972 return nil 1973 } 1974 err = iter.page.NextWithContext(ctx) 1975 if err != nil { 1976 iter.i-- 1977 return err 1978 } 1979 iter.i = 0 1980 return nil 1981} 1982 1983// Next advances to the next value. If there was an error making 1984// the request the iterator does not advance and the error is returned. 1985// Deprecated: Use NextWithContext() instead. 1986func (iter *OperationCollectionIterator) Next() error { 1987 return iter.NextWithContext(context.Background()) 1988} 1989 1990// NotDone returns true if the enumeration should be started or is not yet complete. 1991func (iter OperationCollectionIterator) NotDone() bool { 1992 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 1993} 1994 1995// Response returns the raw server response from the last page request. 1996func (iter OperationCollectionIterator) Response() OperationCollection { 1997 return iter.page.Response() 1998} 1999 2000// Value returns the current value or a zero-initialized value if the 2001// iterator has advanced beyond the end of the collection. 2002func (iter OperationCollectionIterator) Value() OperationContract { 2003 if !iter.page.NotDone() { 2004 return OperationContract{} 2005 } 2006 return iter.page.Values()[iter.i] 2007} 2008 2009// Creates a new instance of the OperationCollectionIterator type. 2010func NewOperationCollectionIterator(page OperationCollectionPage) OperationCollectionIterator { 2011 return OperationCollectionIterator{page: page} 2012} 2013 2014// IsEmpty returns true if the ListResult contains no values. 2015func (oc OperationCollection) IsEmpty() bool { 2016 return oc.Value == nil || len(*oc.Value) == 0 2017} 2018 2019// operationCollectionPreparer prepares a request to retrieve the next set of results. 2020// It returns nil if no more results exist. 2021func (oc OperationCollection) operationCollectionPreparer(ctx context.Context) (*http.Request, error) { 2022 if oc.NextLink == nil || len(to.String(oc.NextLink)) < 1 { 2023 return nil, nil 2024 } 2025 return autorest.Prepare((&http.Request{}).WithContext(ctx), 2026 autorest.AsJSON(), 2027 autorest.AsGet(), 2028 autorest.WithBaseURL(to.String(oc.NextLink))) 2029} 2030 2031// OperationCollectionPage contains a page of OperationContract values. 2032type OperationCollectionPage struct { 2033 fn func(context.Context, OperationCollection) (OperationCollection, error) 2034 oc OperationCollection 2035} 2036 2037// NextWithContext advances to the next page of values. If there was an error making 2038// the request the page does not advance and the error is returned. 2039func (page *OperationCollectionPage) NextWithContext(ctx context.Context) (err error) { 2040 if tracing.IsEnabled() { 2041 ctx = tracing.StartSpan(ctx, fqdn+"/OperationCollectionPage.NextWithContext") 2042 defer func() { 2043 sc := -1 2044 if page.Response().Response.Response != nil { 2045 sc = page.Response().Response.Response.StatusCode 2046 } 2047 tracing.EndSpan(ctx, sc, err) 2048 }() 2049 } 2050 next, err := page.fn(ctx, page.oc) 2051 if err != nil { 2052 return err 2053 } 2054 page.oc = next 2055 return nil 2056} 2057 2058// Next advances to the next page of values. If there was an error making 2059// the request the page does not advance and the error is returned. 2060// Deprecated: Use NextWithContext() instead. 2061func (page *OperationCollectionPage) Next() error { 2062 return page.NextWithContext(context.Background()) 2063} 2064 2065// NotDone returns true if the page enumeration should be started or is not yet complete. 2066func (page OperationCollectionPage) NotDone() bool { 2067 return !page.oc.IsEmpty() 2068} 2069 2070// Response returns the raw server response from the last page request. 2071func (page OperationCollectionPage) Response() OperationCollection { 2072 return page.oc 2073} 2074 2075// Values returns the slice of values for the current page or nil if there are no values. 2076func (page OperationCollectionPage) Values() []OperationContract { 2077 if page.oc.IsEmpty() { 2078 return nil 2079 } 2080 return *page.oc.Value 2081} 2082 2083// Creates a new instance of the OperationCollectionPage type. 2084func NewOperationCollectionPage(getNextPage func(context.Context, OperationCollection) (OperationCollection, error)) OperationCollectionPage { 2085 return OperationCollectionPage{fn: getNextPage} 2086} 2087 2088// OperationContract api Operation details. 2089type OperationContract struct { 2090 autorest.Response `json:"-"` 2091 // 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. 2092 ID *string `json:"id,omitempty"` 2093 // Name - Operation Name. 2094 Name *string `json:"name,omitempty"` 2095 // Method - A Valid HTTP Operation Method. Typical Http Methods like GET, PUT, POST but not limited by only them. 2096 Method *string `json:"method,omitempty"` 2097 // URLTemplate - Relative URL template identifying the target resource for this operation. May include parameters. Example: /customers/{cid}/orders/{oid}/?date={date} 2098 URLTemplate *string `json:"urlTemplate,omitempty"` 2099 // TemplateParameters - Collection of URL template parameters. 2100 TemplateParameters *[]ParameterContract `json:"templateParameters,omitempty"` 2101 // Description - Description of the operation. May include HTML formatting tags. 2102 Description *string `json:"description,omitempty"` 2103 // Request - An entity containing request details. 2104 Request *RequestContract `json:"request,omitempty"` 2105 // Responses - Array of Operation responses. 2106 Responses *[]ResultContract `json:"responses,omitempty"` 2107} 2108 2109// OperationResultContract operation Result. 2110type OperationResultContract struct { 2111 autorest.Response `json:"-"` 2112 // ID - Operation result identifier. 2113 ID *string `json:"id,omitempty"` 2114 // Status - Status of an async operation. Possible values include: 'Started', 'InProgress', 'Succeeded', 'Failed' 2115 Status AsyncOperationState `json:"status,omitempty"` 2116 // 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. 2117 Started *date.Time `json:"started,omitempty"` 2118 // 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. 2119 Updated *date.Time `json:"updated,omitempty"` 2120 // ResultInfo - Optional result info. 2121 ResultInfo *string `json:"resultInfo,omitempty"` 2122 Error *ErrorBodyContract `json:"error,omitempty"` 2123} 2124 2125// ParameterContract operation parameters details. 2126type ParameterContract struct { 2127 // Name - Parameter name. 2128 Name *string `json:"name,omitempty"` 2129 // Description - Parameter description. 2130 Description *string `json:"description,omitempty"` 2131 // Type - Parameter type. 2132 Type *string `json:"type,omitempty"` 2133 // DefaultValue - Default parameter value. 2134 DefaultValue *string `json:"defaultValue,omitempty"` 2135 // Required - whether parameter is required or not. 2136 Required *bool `json:"required,omitempty"` 2137 // Values - Parameter values. 2138 Values *[]string `json:"values,omitempty"` 2139} 2140 2141// PatchParameters parameters supplied to the Patch operations. 2142type PatchParameters struct { 2143 // RawJSON - json value. 2144 RawJSON interface{} `json:"RawJson,omitempty"` 2145} 2146 2147// PolicySnippetContract policy snippet. 2148type PolicySnippetContract struct { 2149 // Name - READ-ONLY; Snippet name. 2150 Name *string `json:"name,omitempty"` 2151 // Content - READ-ONLY; Snippet content. 2152 Content *string `json:"content,omitempty"` 2153 // ToolTip - READ-ONLY; Snippet toolTip. 2154 ToolTip *string `json:"toolTip,omitempty"` 2155 // Scope - READ-ONLY; Snippet scope. Possible values include: 'Tenant', 'Product', 'API', 'Operation', 'All' 2156 Scope PolicyScopeContract `json:"scope,omitempty"` 2157} 2158 2159// ProductCollection paged Products list representation. 2160type ProductCollection struct { 2161 autorest.Response `json:"-"` 2162 // Value - Page values. 2163 Value *[]ProductContract `json:"value,omitempty"` 2164 // Count - Total records count number. 2165 Count *int64 `json:"count,omitempty"` 2166 // NextLink - Next page link if any. 2167 NextLink *string `json:"nextLink,omitempty"` 2168} 2169 2170// ProductCollectionIterator provides access to a complete listing of ProductContract values. 2171type ProductCollectionIterator struct { 2172 i int 2173 page ProductCollectionPage 2174} 2175 2176// NextWithContext advances to the next value. If there was an error making 2177// the request the iterator does not advance and the error is returned. 2178func (iter *ProductCollectionIterator) NextWithContext(ctx context.Context) (err error) { 2179 if tracing.IsEnabled() { 2180 ctx = tracing.StartSpan(ctx, fqdn+"/ProductCollectionIterator.NextWithContext") 2181 defer func() { 2182 sc := -1 2183 if iter.Response().Response.Response != nil { 2184 sc = iter.Response().Response.Response.StatusCode 2185 } 2186 tracing.EndSpan(ctx, sc, err) 2187 }() 2188 } 2189 iter.i++ 2190 if iter.i < len(iter.page.Values()) { 2191 return nil 2192 } 2193 err = iter.page.NextWithContext(ctx) 2194 if err != nil { 2195 iter.i-- 2196 return err 2197 } 2198 iter.i = 0 2199 return nil 2200} 2201 2202// Next advances to the next value. If there was an error making 2203// the request the iterator does not advance and the error is returned. 2204// Deprecated: Use NextWithContext() instead. 2205func (iter *ProductCollectionIterator) Next() error { 2206 return iter.NextWithContext(context.Background()) 2207} 2208 2209// NotDone returns true if the enumeration should be started or is not yet complete. 2210func (iter ProductCollectionIterator) NotDone() bool { 2211 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 2212} 2213 2214// Response returns the raw server response from the last page request. 2215func (iter ProductCollectionIterator) Response() ProductCollection { 2216 return iter.page.Response() 2217} 2218 2219// Value returns the current value or a zero-initialized value if the 2220// iterator has advanced beyond the end of the collection. 2221func (iter ProductCollectionIterator) Value() ProductContract { 2222 if !iter.page.NotDone() { 2223 return ProductContract{} 2224 } 2225 return iter.page.Values()[iter.i] 2226} 2227 2228// Creates a new instance of the ProductCollectionIterator type. 2229func NewProductCollectionIterator(page ProductCollectionPage) ProductCollectionIterator { 2230 return ProductCollectionIterator{page: page} 2231} 2232 2233// IsEmpty returns true if the ListResult contains no values. 2234func (pc ProductCollection) IsEmpty() bool { 2235 return pc.Value == nil || len(*pc.Value) == 0 2236} 2237 2238// productCollectionPreparer prepares a request to retrieve the next set of results. 2239// It returns nil if no more results exist. 2240func (pc ProductCollection) productCollectionPreparer(ctx context.Context) (*http.Request, error) { 2241 if pc.NextLink == nil || len(to.String(pc.NextLink)) < 1 { 2242 return nil, nil 2243 } 2244 return autorest.Prepare((&http.Request{}).WithContext(ctx), 2245 autorest.AsJSON(), 2246 autorest.AsGet(), 2247 autorest.WithBaseURL(to.String(pc.NextLink))) 2248} 2249 2250// ProductCollectionPage contains a page of ProductContract values. 2251type ProductCollectionPage struct { 2252 fn func(context.Context, ProductCollection) (ProductCollection, error) 2253 pc ProductCollection 2254} 2255 2256// NextWithContext advances to the next page of values. If there was an error making 2257// the request the page does not advance and the error is returned. 2258func (page *ProductCollectionPage) NextWithContext(ctx context.Context) (err error) { 2259 if tracing.IsEnabled() { 2260 ctx = tracing.StartSpan(ctx, fqdn+"/ProductCollectionPage.NextWithContext") 2261 defer func() { 2262 sc := -1 2263 if page.Response().Response.Response != nil { 2264 sc = page.Response().Response.Response.StatusCode 2265 } 2266 tracing.EndSpan(ctx, sc, err) 2267 }() 2268 } 2269 next, err := page.fn(ctx, page.pc) 2270 if err != nil { 2271 return err 2272 } 2273 page.pc = next 2274 return nil 2275} 2276 2277// Next advances to the next page of values. If there was an error making 2278// the request the page does not advance and the error is returned. 2279// Deprecated: Use NextWithContext() instead. 2280func (page *ProductCollectionPage) Next() error { 2281 return page.NextWithContext(context.Background()) 2282} 2283 2284// NotDone returns true if the page enumeration should be started or is not yet complete. 2285func (page ProductCollectionPage) NotDone() bool { 2286 return !page.pc.IsEmpty() 2287} 2288 2289// Response returns the raw server response from the last page request. 2290func (page ProductCollectionPage) Response() ProductCollection { 2291 return page.pc 2292} 2293 2294// Values returns the slice of values for the current page or nil if there are no values. 2295func (page ProductCollectionPage) Values() []ProductContract { 2296 if page.pc.IsEmpty() { 2297 return nil 2298 } 2299 return *page.pc.Value 2300} 2301 2302// Creates a new instance of the ProductCollectionPage type. 2303func NewProductCollectionPage(getNextPage func(context.Context, ProductCollection) (ProductCollection, error)) ProductCollectionPage { 2304 return ProductCollectionPage{fn: getNextPage} 2305} 2306 2307// ProductContract product profile. 2308type ProductContract struct { 2309 autorest.Response `json:"-"` 2310 // 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. 2311 ID *string `json:"id,omitempty"` 2312 // Name - Product name. 2313 Name *string `json:"name,omitempty"` 2314 // Description - Product description. May include HTML formatting tags. 2315 Description *string `json:"description,omitempty"` 2316 // 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. 2317 Terms *string `json:"terms,omitempty"` 2318 // 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. 2319 SubscriptionRequired *bool `json:"subscriptionRequired,omitempty"` 2320 // ApprovalRequired - whether subscription approval is required. If false, new subscriptions will be approved automatically enabling developers to call the product’s APIs immediately after subscribing. If true, administrators must manually approve the subscription before the developer can any of the product’s APIs. Can be present only if subscriptionRequired property is present and has a value of false. 2321 ApprovalRequired *bool `json:"approvalRequired,omitempty"` 2322 // SubscriptionsLimit - Whether the number of subscriptions a user can have to this product at the same time. Set to null or omit to allow unlimited per user subscriptions. Can be present only if subscriptionRequired property is present and has a value of false. 2323 SubscriptionsLimit *int32 `json:"subscriptionsLimit,omitempty"` 2324 // 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' 2325 State ProductStateContract `json:"state,omitempty"` 2326} 2327 2328// ProductUpdateParameters parameters supplied to the CreateOrUpdate Product operation. 2329type ProductUpdateParameters struct { 2330 // Name - Product name. 2331 Name *string `json:"name,omitempty"` 2332 // Description - Product description. 2333 Description *string `json:"description,omitempty"` 2334 // Terms - Product terms and conditions. Developer will have to accept these terms before he's allowed to call product API. 2335 Terms *string `json:"terms,omitempty"` 2336 // 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. 2337 SubscriptionRequired *bool `json:"subscriptionRequired,omitempty"` 2338 // ApprovalRequired - whether subscription approval is required. If false, new subscriptions will be approved automatically enabling developers to call the product’s APIs immediately after subscribing. If true, administrators must manually approve the subscription before the developer can any of the product’s APIs. Can be present only if subscriptionRequired property is present and has a value of false. 2339 ApprovalRequired *bool `json:"approvalRequired,omitempty"` 2340 // SubscriptionsLimit - whether the number of subscriptions a user can have to this product at the same time. Set to null or omit to allow unlimited per user subscriptions. Can be present only if subscriptionRequired property is present and has a value of false. 2341 SubscriptionsLimit *int32 `json:"subscriptionsLimit,omitempty"` 2342 // 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' 2343 State ProductStateContract `json:"state,omitempty"` 2344} 2345 2346// PropertyCollection paged Property list representation. 2347type PropertyCollection struct { 2348 autorest.Response `json:"-"` 2349 // Value - Page values. 2350 Value *[]PropertyContract `json:"value,omitempty"` 2351 // Count - Total records count number. 2352 Count *int64 `json:"count,omitempty"` 2353 // NextLink - Next page link if any. 2354 NextLink *string `json:"nextLink,omitempty"` 2355} 2356 2357// PropertyCollectionIterator provides access to a complete listing of PropertyContract values. 2358type PropertyCollectionIterator struct { 2359 i int 2360 page PropertyCollectionPage 2361} 2362 2363// NextWithContext advances to the next value. If there was an error making 2364// the request the iterator does not advance and the error is returned. 2365func (iter *PropertyCollectionIterator) NextWithContext(ctx context.Context) (err error) { 2366 if tracing.IsEnabled() { 2367 ctx = tracing.StartSpan(ctx, fqdn+"/PropertyCollectionIterator.NextWithContext") 2368 defer func() { 2369 sc := -1 2370 if iter.Response().Response.Response != nil { 2371 sc = iter.Response().Response.Response.StatusCode 2372 } 2373 tracing.EndSpan(ctx, sc, err) 2374 }() 2375 } 2376 iter.i++ 2377 if iter.i < len(iter.page.Values()) { 2378 return nil 2379 } 2380 err = iter.page.NextWithContext(ctx) 2381 if err != nil { 2382 iter.i-- 2383 return err 2384 } 2385 iter.i = 0 2386 return nil 2387} 2388 2389// Next advances to the next value. If there was an error making 2390// the request the iterator does not advance and the error is returned. 2391// Deprecated: Use NextWithContext() instead. 2392func (iter *PropertyCollectionIterator) Next() error { 2393 return iter.NextWithContext(context.Background()) 2394} 2395 2396// NotDone returns true if the enumeration should be started or is not yet complete. 2397func (iter PropertyCollectionIterator) NotDone() bool { 2398 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 2399} 2400 2401// Response returns the raw server response from the last page request. 2402func (iter PropertyCollectionIterator) Response() PropertyCollection { 2403 return iter.page.Response() 2404} 2405 2406// Value returns the current value or a zero-initialized value if the 2407// iterator has advanced beyond the end of the collection. 2408func (iter PropertyCollectionIterator) Value() PropertyContract { 2409 if !iter.page.NotDone() { 2410 return PropertyContract{} 2411 } 2412 return iter.page.Values()[iter.i] 2413} 2414 2415// Creates a new instance of the PropertyCollectionIterator type. 2416func NewPropertyCollectionIterator(page PropertyCollectionPage) PropertyCollectionIterator { 2417 return PropertyCollectionIterator{page: page} 2418} 2419 2420// IsEmpty returns true if the ListResult contains no values. 2421func (pc PropertyCollection) IsEmpty() bool { 2422 return pc.Value == nil || len(*pc.Value) == 0 2423} 2424 2425// propertyCollectionPreparer prepares a request to retrieve the next set of results. 2426// It returns nil if no more results exist. 2427func (pc PropertyCollection) propertyCollectionPreparer(ctx context.Context) (*http.Request, error) { 2428 if pc.NextLink == nil || len(to.String(pc.NextLink)) < 1 { 2429 return nil, nil 2430 } 2431 return autorest.Prepare((&http.Request{}).WithContext(ctx), 2432 autorest.AsJSON(), 2433 autorest.AsGet(), 2434 autorest.WithBaseURL(to.String(pc.NextLink))) 2435} 2436 2437// PropertyCollectionPage contains a page of PropertyContract values. 2438type PropertyCollectionPage struct { 2439 fn func(context.Context, PropertyCollection) (PropertyCollection, error) 2440 pc PropertyCollection 2441} 2442 2443// NextWithContext advances to the next page of values. If there was an error making 2444// the request the page does not advance and the error is returned. 2445func (page *PropertyCollectionPage) NextWithContext(ctx context.Context) (err error) { 2446 if tracing.IsEnabled() { 2447 ctx = tracing.StartSpan(ctx, fqdn+"/PropertyCollectionPage.NextWithContext") 2448 defer func() { 2449 sc := -1 2450 if page.Response().Response.Response != nil { 2451 sc = page.Response().Response.Response.StatusCode 2452 } 2453 tracing.EndSpan(ctx, sc, err) 2454 }() 2455 } 2456 next, err := page.fn(ctx, page.pc) 2457 if err != nil { 2458 return err 2459 } 2460 page.pc = next 2461 return nil 2462} 2463 2464// Next advances to the next page of values. If there was an error making 2465// the request the page does not advance and the error is returned. 2466// Deprecated: Use NextWithContext() instead. 2467func (page *PropertyCollectionPage) Next() error { 2468 return page.NextWithContext(context.Background()) 2469} 2470 2471// NotDone returns true if the page enumeration should be started or is not yet complete. 2472func (page PropertyCollectionPage) NotDone() bool { 2473 return !page.pc.IsEmpty() 2474} 2475 2476// Response returns the raw server response from the last page request. 2477func (page PropertyCollectionPage) Response() PropertyCollection { 2478 return page.pc 2479} 2480 2481// Values returns the slice of values for the current page or nil if there are no values. 2482func (page PropertyCollectionPage) Values() []PropertyContract { 2483 if page.pc.IsEmpty() { 2484 return nil 2485 } 2486 return *page.pc.Value 2487} 2488 2489// Creates a new instance of the PropertyCollectionPage type. 2490func NewPropertyCollectionPage(getNextPage func(context.Context, PropertyCollection) (PropertyCollection, error)) PropertyCollectionPage { 2491 return PropertyCollectionPage{fn: getNextPage} 2492} 2493 2494// PropertyContract property details. 2495type PropertyContract struct { 2496 autorest.Response `json:"-"` 2497 // 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. 2498 ID *string `json:"id,omitempty"` 2499 // Name - Unique name of Property. It may contain only letters, digits, period, dash, and underscore characters. 2500 Name *string `json:"name,omitempty"` 2501 // Value - Value of the property. Can contain policy expressions. It may not be empty or consist only of whitespace. 2502 Value *string `json:"value,omitempty"` 2503 // Tags - Optional tags that when provided can be used to filter the property list. 2504 Tags *[]string `json:"tags,omitempty"` 2505 // Secret - Determines whether the value is a secret and should be encrypted or not. Default value is false. 2506 Secret *bool `json:"secret,omitempty"` 2507} 2508 2509// PropertyCreateParameters parameters supplied to the Create Property operation. 2510type PropertyCreateParameters struct { 2511 // Name - Unique name of Property. It may contain only letters, digits, period, dash, and underscore characters. 2512 Name *string `json:"name,omitempty"` 2513 // Value - Value of the property. Can contain policy expressions. It may not be empty or consist only of whitespace. 2514 Value *string `json:"value,omitempty"` 2515 // Tags - Optional tags that when provided can be used to filter the property list. 2516 Tags *[]string `json:"tags,omitempty"` 2517 // Secret - Determines whether the value is a secret and should be encrypted or not. Default value is false. 2518 Secret *bool `json:"secret,omitempty"` 2519} 2520 2521// PropertyUpdateParameters parameters supplied to the Update Property operation. 2522type PropertyUpdateParameters struct { 2523 // Name - Unique name of Property. It may contain only letters, digits, period, dash, and underscore characters. 2524 Name *string `json:"name,omitempty"` 2525 // Value - Value of the property. Can contain policy expressions. It may not be empty or consist only of whitespace. 2526 Value *string `json:"value,omitempty"` 2527 // Tags - Optional tags that when provided can be used to filter the property list. 2528 Tags *[]string `json:"tags,omitempty"` 2529 // Secret - Determines whether the value is a secret and should be encrypted or not. Default value is false. 2530 Secret *bool `json:"secret,omitempty"` 2531} 2532 2533// QuotaCounterCollection paged Quota Counter list representation. 2534type QuotaCounterCollection struct { 2535 autorest.Response `json:"-"` 2536 // Value - Quota counter values. 2537 Value *[]QuotaCounterContract `json:"value,omitempty"` 2538 // Count - Total records count number. 2539 Count *int64 `json:"count,omitempty"` 2540 // NextLink - Next page link if any. 2541 NextLink *string `json:"nextLink,omitempty"` 2542} 2543 2544// QuotaCounterContract quota counter details. 2545type QuotaCounterContract struct { 2546 autorest.Response `json:"-"` 2547 // CounterKey - The Key value of the Counter. Must not be empty. 2548 CounterKey *string `json:"counterKey,omitempty"` 2549 // PeriodKey - Identifier of the Period for which the counter was collected. Must not be empty. 2550 PeriodKey *string `json:"periodKey,omitempty"` 2551 // 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. 2552 PeriodStartTime *date.Time `json:"periodStartTime,omitempty"` 2553 // 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. 2554 PeriodEndTime *date.Time `json:"periodEndTime,omitempty"` 2555 // CallsCount - Number of times Counter was called. 2556 CallsCount *int32 `json:"callsCount,omitempty"` 2557 // KbTransferred - Data Transferred in KiloBytes. 2558 KbTransferred *float64 `json:"kbTransferred,omitempty"` 2559} 2560 2561// QuotaCounterValueContract quota counter value details. 2562type QuotaCounterValueContract struct { 2563 // CallsCount - Number of times Counter was called. 2564 CallsCount *int32 `json:"callsCount,omitempty"` 2565 // KbTransferred - Data Transferred in KiloBytes. 2566 KbTransferred *float64 `json:"kbTransferred,omitempty"` 2567} 2568 2569// RegionContract region profile. 2570type RegionContract struct { 2571 // Name - Region name. 2572 Name *string `json:"name,omitempty"` 2573 // IsMasterRegion - whether Region is the master region. 2574 IsMasterRegion *bool `json:"isMasterRegion,omitempty"` 2575} 2576 2577// RegionListResult lists Regions operation response details. 2578type RegionListResult struct { 2579 autorest.Response `json:"-"` 2580 // Value - Lists of Regions. 2581 Value *[]RegionContract `json:"value,omitempty"` 2582} 2583 2584// ReportCollection paged Report records list representation. 2585type ReportCollection struct { 2586 autorest.Response `json:"-"` 2587 // Value - Page values. 2588 Value *[]ReportRecordContract `json:"value,omitempty"` 2589 // Count - Total records count number. 2590 Count *int64 `json:"count,omitempty"` 2591 // NextLink - Next page link if any. 2592 NextLink *string `json:"nextLink,omitempty"` 2593} 2594 2595// ReportCollectionIterator provides access to a complete listing of ReportRecordContract values. 2596type ReportCollectionIterator struct { 2597 i int 2598 page ReportCollectionPage 2599} 2600 2601// NextWithContext advances to the next value. If there was an error making 2602// the request the iterator does not advance and the error is returned. 2603func (iter *ReportCollectionIterator) NextWithContext(ctx context.Context) (err error) { 2604 if tracing.IsEnabled() { 2605 ctx = tracing.StartSpan(ctx, fqdn+"/ReportCollectionIterator.NextWithContext") 2606 defer func() { 2607 sc := -1 2608 if iter.Response().Response.Response != nil { 2609 sc = iter.Response().Response.Response.StatusCode 2610 } 2611 tracing.EndSpan(ctx, sc, err) 2612 }() 2613 } 2614 iter.i++ 2615 if iter.i < len(iter.page.Values()) { 2616 return nil 2617 } 2618 err = iter.page.NextWithContext(ctx) 2619 if err != nil { 2620 iter.i-- 2621 return err 2622 } 2623 iter.i = 0 2624 return nil 2625} 2626 2627// Next advances to the next value. If there was an error making 2628// the request the iterator does not advance and the error is returned. 2629// Deprecated: Use NextWithContext() instead. 2630func (iter *ReportCollectionIterator) Next() error { 2631 return iter.NextWithContext(context.Background()) 2632} 2633 2634// NotDone returns true if the enumeration should be started or is not yet complete. 2635func (iter ReportCollectionIterator) NotDone() bool { 2636 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 2637} 2638 2639// Response returns the raw server response from the last page request. 2640func (iter ReportCollectionIterator) Response() ReportCollection { 2641 return iter.page.Response() 2642} 2643 2644// Value returns the current value or a zero-initialized value if the 2645// iterator has advanced beyond the end of the collection. 2646func (iter ReportCollectionIterator) Value() ReportRecordContract { 2647 if !iter.page.NotDone() { 2648 return ReportRecordContract{} 2649 } 2650 return iter.page.Values()[iter.i] 2651} 2652 2653// Creates a new instance of the ReportCollectionIterator type. 2654func NewReportCollectionIterator(page ReportCollectionPage) ReportCollectionIterator { 2655 return ReportCollectionIterator{page: page} 2656} 2657 2658// IsEmpty returns true if the ListResult contains no values. 2659func (rc ReportCollection) IsEmpty() bool { 2660 return rc.Value == nil || len(*rc.Value) == 0 2661} 2662 2663// reportCollectionPreparer prepares a request to retrieve the next set of results. 2664// It returns nil if no more results exist. 2665func (rc ReportCollection) reportCollectionPreparer(ctx context.Context) (*http.Request, error) { 2666 if rc.NextLink == nil || len(to.String(rc.NextLink)) < 1 { 2667 return nil, nil 2668 } 2669 return autorest.Prepare((&http.Request{}).WithContext(ctx), 2670 autorest.AsJSON(), 2671 autorest.AsGet(), 2672 autorest.WithBaseURL(to.String(rc.NextLink))) 2673} 2674 2675// ReportCollectionPage contains a page of ReportRecordContract values. 2676type ReportCollectionPage struct { 2677 fn func(context.Context, ReportCollection) (ReportCollection, error) 2678 rc ReportCollection 2679} 2680 2681// NextWithContext advances to the next page of values. If there was an error making 2682// the request the page does not advance and the error is returned. 2683func (page *ReportCollectionPage) NextWithContext(ctx context.Context) (err error) { 2684 if tracing.IsEnabled() { 2685 ctx = tracing.StartSpan(ctx, fqdn+"/ReportCollectionPage.NextWithContext") 2686 defer func() { 2687 sc := -1 2688 if page.Response().Response.Response != nil { 2689 sc = page.Response().Response.Response.StatusCode 2690 } 2691 tracing.EndSpan(ctx, sc, err) 2692 }() 2693 } 2694 next, err := page.fn(ctx, page.rc) 2695 if err != nil { 2696 return err 2697 } 2698 page.rc = next 2699 return nil 2700} 2701 2702// Next advances to the next page of values. If there was an error making 2703// the request the page does not advance and the error is returned. 2704// Deprecated: Use NextWithContext() instead. 2705func (page *ReportCollectionPage) Next() error { 2706 return page.NextWithContext(context.Background()) 2707} 2708 2709// NotDone returns true if the page enumeration should be started or is not yet complete. 2710func (page ReportCollectionPage) NotDone() bool { 2711 return !page.rc.IsEmpty() 2712} 2713 2714// Response returns the raw server response from the last page request. 2715func (page ReportCollectionPage) Response() ReportCollection { 2716 return page.rc 2717} 2718 2719// Values returns the slice of values for the current page or nil if there are no values. 2720func (page ReportCollectionPage) Values() []ReportRecordContract { 2721 if page.rc.IsEmpty() { 2722 return nil 2723 } 2724 return *page.rc.Value 2725} 2726 2727// Creates a new instance of the ReportCollectionPage type. 2728func NewReportCollectionPage(getNextPage func(context.Context, ReportCollection) (ReportCollection, error)) ReportCollectionPage { 2729 return ReportCollectionPage{fn: getNextPage} 2730} 2731 2732// ReportRecordContract report data. 2733type ReportRecordContract struct { 2734 // Name - Name depending on report endpoint specifies product, API, operation or developer name. 2735 Name *string `json:"name,omitempty"` 2736 // Timestamp - Start of aggregation period. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. 2737 Timestamp *date.Time `json:"timestamp,omitempty"` 2738 // Interval - Length of aggregation period. 2739 Interval *int64 `json:"interval,omitempty"` 2740 // Country - Country to which this record data is related. 2741 Country *string `json:"country,omitempty"` 2742 // Region - Country region to which this record data is related. 2743 Region *string `json:"region,omitempty"` 2744 // Zip - Zip code to which this record data is related. 2745 Zip *string `json:"zip,omitempty"` 2746 // UserID - READ-ONLY; User identifier path. /users/{userId} 2747 UserID *string `json:"userId,omitempty"` 2748 // ProductID - READ-ONLY; Product identifier path. /products/{productId} 2749 ProductID *string `json:"productId,omitempty"` 2750 // APIID - API identifier path. /apis/{apiId} 2751 APIID *string `json:"apiId,omitempty"` 2752 // OperationID - Operation identifier path. /apis/{apiId}/operations/{operationId} 2753 OperationID *string `json:"operationId,omitempty"` 2754 // APIRegion - API region identifier. 2755 APIRegion *string `json:"apiRegion,omitempty"` 2756 // SubscriptionID - Subscription identifier path. /subscriptions/{subscriptionId} 2757 SubscriptionID *string `json:"subscriptionId,omitempty"` 2758 // CallCountSuccess - Number of successful calls. 2759 CallCountSuccess *int32 `json:"callCountSuccess,omitempty"` 2760 // CallCountBlocked - Number of calls blocked due to invalid credentials. 2761 CallCountBlocked *int32 `json:"callCountBlocked,omitempty"` 2762 // CallCountFailed - Number of calls failed due to proxy or backend errors. 2763 CallCountFailed *int32 `json:"callCountFailed,omitempty"` 2764 // CallCountOther - Number of other calls. 2765 CallCountOther *int32 `json:"callCountOther,omitempty"` 2766 // CallCountTotal - Total number of calls. 2767 CallCountTotal *int32 `json:"callCountTotal,omitempty"` 2768 // Bandwidth - Bandwidth consumed. 2769 Bandwidth *int64 `json:"bandwidth,omitempty"` 2770 // CacheHitCount - Number of times when content was served from cache policy. 2771 CacheHitCount *int32 `json:"cacheHitCount,omitempty"` 2772 // CacheMissCount - Number of times content was fetched from backend. 2773 CacheMissCount *int32 `json:"cacheMissCount,omitempty"` 2774 // APITimeAvg - Average time it took to process request. 2775 APITimeAvg *float64 `json:"apiTimeAvg,omitempty"` 2776 // APITimeMin - Minimum time it took to process request. 2777 APITimeMin *float64 `json:"apiTimeMin,omitempty"` 2778 // APITimeMax - Maximum time it took to process request. 2779 APITimeMax *float64 `json:"apiTimeMax,omitempty"` 2780 // ServiceTimeAvg - Average time it took to process request on backend. 2781 ServiceTimeAvg *float64 `json:"serviceTimeAvg,omitempty"` 2782 // ServiceTimeMin - Minimum time it took to process request on backend. 2783 ServiceTimeMin *float64 `json:"serviceTimeMin,omitempty"` 2784 // ServiceTimeMax - Maximum time it took to process request on backend. 2785 ServiceTimeMax *float64 `json:"serviceTimeMax,omitempty"` 2786} 2787 2788// RepresentationContract operation request/response representation details. 2789type RepresentationContract struct { 2790 // ContentType - Specifies a registered or custom content type for this representation, e.g. application/xml. 2791 ContentType *string `json:"contentType,omitempty"` 2792 // Sample - An example of the representation. 2793 Sample *string `json:"sample,omitempty"` 2794} 2795 2796// RequestContract operation request details. 2797type RequestContract struct { 2798 // Description - Operation request description. 2799 Description *string `json:"description,omitempty"` 2800 // QueryParameters - Collection of operation request query parameters. 2801 QueryParameters *[]ParameterContract `json:"queryParameters,omitempty"` 2802 // Headers - Collection of operation request headers. 2803 Headers *[]ParameterContract `json:"headers,omitempty"` 2804 // Representations - Collection of operation request representations. 2805 Representations *[]RepresentationContract `json:"representations,omitempty"` 2806} 2807 2808// ResultContract operation response details. 2809type ResultContract struct { 2810 // StatusCode - Operation response HTTP status code. 2811 StatusCode *int32 `json:"statusCode,omitempty"` 2812 // Description - Operation response description. 2813 Description *string `json:"description,omitempty"` 2814 // Representations - Collection of operation response representations. 2815 Representations *[]RepresentationContract `json:"representations,omitempty"` 2816} 2817 2818// SaveConfigurationParameter parameters supplied to the Save Tenant Configuration operation. 2819type SaveConfigurationParameter struct { 2820 // Branch - The name of the Git branch in which to commit the current configuration snapshot. 2821 Branch *string `json:"branch,omitempty"` 2822 // 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. 2823 Force *bool `json:"force,omitempty"` 2824} 2825 2826// ServiceBackupRestoreParameters parameters supplied to the Backup/Restore of an API Management service 2827// operation. 2828type ServiceBackupRestoreParameters struct { 2829 // StorageAccount - Azure Cloud Storage account (used to place/retrieve the backup) name. 2830 StorageAccount *string `json:"storageAccount,omitempty"` 2831 // AccessKey - Azure Cloud Storage account (used to place/retrieve the backup) access key. 2832 AccessKey *string `json:"accessKey,omitempty"` 2833 // ContainerName - Azure Cloud Storage blob container name used to place/retrieve the backup. 2834 ContainerName *string `json:"containerName,omitempty"` 2835 // BackupName - The name of the backup file to create. 2836 BackupName *string `json:"backupName,omitempty"` 2837} 2838 2839// ServiceBaseParameters parameters supplied to the Update API Management service operation. 2840type ServiceBaseParameters struct { 2841 // Tags - API Management service tags. A maximum of 10 tags can be provided for a resource, and each tag must have a key no greater than 128 characters (and a value no greater than 256 characters). 2842 Tags map[string]*string `json:"tags"` 2843 // ServiceProperties - Properties of the API Management service. 2844 *ServiceProperties `json:"properties,omitempty"` 2845 // Sku - SKU properties of the API Management service. 2846 Sku *ServiceSkuProperties `json:"sku,omitempty"` 2847} 2848 2849// MarshalJSON is the custom marshaler for ServiceBaseParameters. 2850func (sbp ServiceBaseParameters) MarshalJSON() ([]byte, error) { 2851 objectMap := make(map[string]interface{}) 2852 if sbp.Tags != nil { 2853 objectMap["tags"] = sbp.Tags 2854 } 2855 if sbp.ServiceProperties != nil { 2856 objectMap["properties"] = sbp.ServiceProperties 2857 } 2858 if sbp.Sku != nil { 2859 objectMap["sku"] = sbp.Sku 2860 } 2861 return json.Marshal(objectMap) 2862} 2863 2864// UnmarshalJSON is the custom unmarshaler for ServiceBaseParameters struct. 2865func (sbp *ServiceBaseParameters) UnmarshalJSON(body []byte) error { 2866 var m map[string]*json.RawMessage 2867 err := json.Unmarshal(body, &m) 2868 if err != nil { 2869 return err 2870 } 2871 for k, v := range m { 2872 switch k { 2873 case "tags": 2874 if v != nil { 2875 var tags map[string]*string 2876 err = json.Unmarshal(*v, &tags) 2877 if err != nil { 2878 return err 2879 } 2880 sbp.Tags = tags 2881 } 2882 case "properties": 2883 if v != nil { 2884 var serviceProperties ServiceProperties 2885 err = json.Unmarshal(*v, &serviceProperties) 2886 if err != nil { 2887 return err 2888 } 2889 sbp.ServiceProperties = &serviceProperties 2890 } 2891 case "sku": 2892 if v != nil { 2893 var sku ServiceSkuProperties 2894 err = json.Unmarshal(*v, &sku) 2895 if err != nil { 2896 return err 2897 } 2898 sbp.Sku = &sku 2899 } 2900 } 2901 } 2902 2903 return nil 2904} 2905 2906// ServiceCheckNameAvailabilityParameters parameters supplied to the CheckNameAvailability operation. 2907type ServiceCheckNameAvailabilityParameters struct { 2908 // Name - The name to check for availability. 2909 Name *string `json:"name,omitempty"` 2910} 2911 2912// ServiceGetSsoTokenResult the response of the GetSsoToken operation. 2913type ServiceGetSsoTokenResult struct { 2914 autorest.Response `json:"-"` 2915 // RedirectURI - Redirect URL containing the SSO token. 2916 RedirectURI *string `json:"redirect_uri,omitempty"` 2917} 2918 2919// ServiceListResult the response of the List API Management services operation. 2920type ServiceListResult struct { 2921 autorest.Response `json:"-"` 2922 // Value - Result of the List API Management services operation. 2923 Value *[]ServiceResource `json:"value,omitempty"` 2924 // NextLink - Link to the next set of results. Not empty if Value contains incomplete list of API Management services. 2925 NextLink *string `json:"nextLink,omitempty"` 2926} 2927 2928// ServiceListResultIterator provides access to a complete listing of ServiceResource values. 2929type ServiceListResultIterator struct { 2930 i int 2931 page ServiceListResultPage 2932} 2933 2934// NextWithContext advances to the next value. If there was an error making 2935// the request the iterator does not advance and the error is returned. 2936func (iter *ServiceListResultIterator) NextWithContext(ctx context.Context) (err error) { 2937 if tracing.IsEnabled() { 2938 ctx = tracing.StartSpan(ctx, fqdn+"/ServiceListResultIterator.NextWithContext") 2939 defer func() { 2940 sc := -1 2941 if iter.Response().Response.Response != nil { 2942 sc = iter.Response().Response.Response.StatusCode 2943 } 2944 tracing.EndSpan(ctx, sc, err) 2945 }() 2946 } 2947 iter.i++ 2948 if iter.i < len(iter.page.Values()) { 2949 return nil 2950 } 2951 err = iter.page.NextWithContext(ctx) 2952 if err != nil { 2953 iter.i-- 2954 return err 2955 } 2956 iter.i = 0 2957 return nil 2958} 2959 2960// Next advances to the next value. If there was an error making 2961// the request the iterator does not advance and the error is returned. 2962// Deprecated: Use NextWithContext() instead. 2963func (iter *ServiceListResultIterator) Next() error { 2964 return iter.NextWithContext(context.Background()) 2965} 2966 2967// NotDone returns true if the enumeration should be started or is not yet complete. 2968func (iter ServiceListResultIterator) NotDone() bool { 2969 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 2970} 2971 2972// Response returns the raw server response from the last page request. 2973func (iter ServiceListResultIterator) Response() ServiceListResult { 2974 return iter.page.Response() 2975} 2976 2977// Value returns the current value or a zero-initialized value if the 2978// iterator has advanced beyond the end of the collection. 2979func (iter ServiceListResultIterator) Value() ServiceResource { 2980 if !iter.page.NotDone() { 2981 return ServiceResource{} 2982 } 2983 return iter.page.Values()[iter.i] 2984} 2985 2986// Creates a new instance of the ServiceListResultIterator type. 2987func NewServiceListResultIterator(page ServiceListResultPage) ServiceListResultIterator { 2988 return ServiceListResultIterator{page: page} 2989} 2990 2991// IsEmpty returns true if the ListResult contains no values. 2992func (slr ServiceListResult) IsEmpty() bool { 2993 return slr.Value == nil || len(*slr.Value) == 0 2994} 2995 2996// serviceListResultPreparer prepares a request to retrieve the next set of results. 2997// It returns nil if no more results exist. 2998func (slr ServiceListResult) serviceListResultPreparer(ctx context.Context) (*http.Request, error) { 2999 if slr.NextLink == nil || len(to.String(slr.NextLink)) < 1 { 3000 return nil, nil 3001 } 3002 return autorest.Prepare((&http.Request{}).WithContext(ctx), 3003 autorest.AsJSON(), 3004 autorest.AsGet(), 3005 autorest.WithBaseURL(to.String(slr.NextLink))) 3006} 3007 3008// ServiceListResultPage contains a page of ServiceResource values. 3009type ServiceListResultPage struct { 3010 fn func(context.Context, ServiceListResult) (ServiceListResult, error) 3011 slr ServiceListResult 3012} 3013 3014// NextWithContext advances to the next page of values. If there was an error making 3015// the request the page does not advance and the error is returned. 3016func (page *ServiceListResultPage) NextWithContext(ctx context.Context) (err error) { 3017 if tracing.IsEnabled() { 3018 ctx = tracing.StartSpan(ctx, fqdn+"/ServiceListResultPage.NextWithContext") 3019 defer func() { 3020 sc := -1 3021 if page.Response().Response.Response != nil { 3022 sc = page.Response().Response.Response.StatusCode 3023 } 3024 tracing.EndSpan(ctx, sc, err) 3025 }() 3026 } 3027 next, err := page.fn(ctx, page.slr) 3028 if err != nil { 3029 return err 3030 } 3031 page.slr = next 3032 return nil 3033} 3034 3035// Next advances to the next page of values. If there was an error making 3036// the request the page does not advance and the error is returned. 3037// Deprecated: Use NextWithContext() instead. 3038func (page *ServiceListResultPage) Next() error { 3039 return page.NextWithContext(context.Background()) 3040} 3041 3042// NotDone returns true if the page enumeration should be started or is not yet complete. 3043func (page ServiceListResultPage) NotDone() bool { 3044 return !page.slr.IsEmpty() 3045} 3046 3047// Response returns the raw server response from the last page request. 3048func (page ServiceListResultPage) Response() ServiceListResult { 3049 return page.slr 3050} 3051 3052// Values returns the slice of values for the current page or nil if there are no values. 3053func (page ServiceListResultPage) Values() []ServiceResource { 3054 if page.slr.IsEmpty() { 3055 return nil 3056 } 3057 return *page.slr.Value 3058} 3059 3060// Creates a new instance of the ServiceListResultPage type. 3061func NewServiceListResultPage(getNextPage func(context.Context, ServiceListResult) (ServiceListResult, error)) ServiceListResultPage { 3062 return ServiceListResultPage{fn: getNextPage} 3063} 3064 3065// ServiceManageDeploymentsParameters parameters supplied to the ManageDeployments operation. 3066type ServiceManageDeploymentsParameters struct { 3067 // Location - Location of the API Management service Azure data center. 3068 Location *string `json:"location,omitempty"` 3069 // SkuType - SKU type of the API Management service. Possible values include: 'Developer', 'Standard', 'Premium' 3070 SkuType SkuType `json:"skuType,omitempty"` 3071 // SkuUnitCount - SKU Unit count of the API Management service. Default value is 1. 3072 SkuUnitCount *int32 `json:"skuUnitCount,omitempty"` 3073 // AdditionalLocations - Additional data center locations for the API Management service. 3074 AdditionalLocations *[]AdditionalRegion `json:"additionalLocations,omitempty"` 3075 // VpnConfiguration - Virtual network configuration. 3076 VpnConfiguration *VirtualNetworkConfiguration `json:"vpnConfiguration,omitempty"` 3077 // 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' 3078 VpnType VirtualNetworkType `json:"vpnType,omitempty"` 3079} 3080 3081// ServiceNameAvailabilityResult response of the CheckNameAvailability operation. 3082type ServiceNameAvailabilityResult struct { 3083 autorest.Response `json:"-"` 3084 // NameAvailable - True if the name is available and can be used to create a new API Management service; otherwise false. 3085 NameAvailable *bool `json:"nameAvailable,omitempty"` 3086 // 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. 3087 Message *string `json:"message,omitempty"` 3088 // 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' 3089 Reason NameAvailabilityReason `json:"reason,omitempty"` 3090} 3091 3092// ServiceProperties properties of an API Management service resource description. 3093type ServiceProperties struct { 3094 // PublisherEmail - Publisher email. 3095 PublisherEmail *string `json:"publisherEmail,omitempty"` 3096 // PublisherName - Publisher name. 3097 PublisherName *string `json:"publisherName,omitempty"` 3098 // 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. 3099 ProvisioningState *string `json:"provisioningState,omitempty"` 3100 // TargetProvisioningState - READ-ONLY; The provisioning state of the API Management service, which is targeted by the long running operation started on the service. 3101 TargetProvisioningState *string `json:"targetProvisioningState,omitempty"` 3102 // 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. 3103 CreatedAtUtc *date.Time `json:"createdAtUtc,omitempty"` 3104 // RuntimeURL - READ-ONLY; Proxy endpoint URL of the API Management service. 3105 RuntimeURL *string `json:"runtimeUrl,omitempty"` 3106 // PortalURL - READ-ONLY; Publisher portal endpoint Url of the API Management service. 3107 PortalURL *string `json:"portalUrl,omitempty"` 3108 // ManagementAPIURL - READ-ONLY; Management API endpoint URL of the API Management service. 3109 ManagementAPIURL *string `json:"managementApiUrl,omitempty"` 3110 // ScmURL - READ-ONLY; SCM endpoint URL of the API Management service. 3111 ScmURL *string `json:"scmUrl,omitempty"` 3112 // AddresserEmail - Addresser email. 3113 AddresserEmail *string `json:"addresserEmail,omitempty"` 3114 // HostnameConfigurations - Custom hostname configuration of the API Management service. 3115 HostnameConfigurations *[]HostnameConfiguration `json:"hostnameConfigurations,omitempty"` 3116 // StaticIPs - READ-ONLY; Static IP addresses of the API Management service virtual machines. Available only for Standard and Premium SKU. 3117 StaticIPs *[]string `json:"staticIPs,omitempty"` 3118 // Vpnconfiguration - Virtual network configuration of the API Management service. 3119 Vpnconfiguration *VirtualNetworkConfiguration `json:"vpnconfiguration,omitempty"` 3120 // AdditionalLocations - Additional datacenter locations of the API Management service. 3121 AdditionalLocations *[]AdditionalRegion `json:"additionalLocations,omitempty"` 3122 // CustomProperties - Custom properties of the API Management service, like disabling TLS 1.0. 3123 CustomProperties map[string]*string `json:"customProperties"` 3124 // 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' 3125 VpnType VirtualNetworkType `json:"vpnType,omitempty"` 3126} 3127 3128// MarshalJSON is the custom marshaler for ServiceProperties. 3129func (sp ServiceProperties) MarshalJSON() ([]byte, error) { 3130 objectMap := make(map[string]interface{}) 3131 if sp.PublisherEmail != nil { 3132 objectMap["publisherEmail"] = sp.PublisherEmail 3133 } 3134 if sp.PublisherName != nil { 3135 objectMap["publisherName"] = sp.PublisherName 3136 } 3137 if sp.AddresserEmail != nil { 3138 objectMap["addresserEmail"] = sp.AddresserEmail 3139 } 3140 if sp.HostnameConfigurations != nil { 3141 objectMap["hostnameConfigurations"] = sp.HostnameConfigurations 3142 } 3143 if sp.Vpnconfiguration != nil { 3144 objectMap["vpnconfiguration"] = sp.Vpnconfiguration 3145 } 3146 if sp.AdditionalLocations != nil { 3147 objectMap["additionalLocations"] = sp.AdditionalLocations 3148 } 3149 if sp.CustomProperties != nil { 3150 objectMap["customProperties"] = sp.CustomProperties 3151 } 3152 if sp.VpnType != "" { 3153 objectMap["vpnType"] = sp.VpnType 3154 } 3155 return json.Marshal(objectMap) 3156} 3157 3158// ServiceResource description of an API Management service resource. 3159type ServiceResource struct { 3160 autorest.Response `json:"-"` 3161 // ID - READ-ONLY; The ID of the created API Management service. 3162 ID *string `json:"id,omitempty"` 3163 // Location - Datacenter location of the API Management service. 3164 Location *string `json:"location,omitempty"` 3165 // Name - READ-ONLY; Name of the API Management service. 3166 Name *string `json:"name,omitempty"` 3167 // Type - READ-ONLY; Resource type of the API Management service. 3168 Type *string `json:"type,omitempty"` 3169 // Etag - ETag of the resource. 3170 Etag *string `json:"etag,omitempty"` 3171 // Tags - API Management service tags. A maximum of 10 tags can be provided for a resource, and each tag must have a key no greater than 128 characters (and a value no greater than 256 characters). 3172 Tags map[string]*string `json:"tags"` 3173 // ServiceProperties - Properties of the API Management service. 3174 *ServiceProperties `json:"properties,omitempty"` 3175 // Sku - SKU properties of the API Management service. 3176 Sku *ServiceSkuProperties `json:"sku,omitempty"` 3177} 3178 3179// MarshalJSON is the custom marshaler for ServiceResource. 3180func (sr ServiceResource) MarshalJSON() ([]byte, error) { 3181 objectMap := make(map[string]interface{}) 3182 if sr.Location != nil { 3183 objectMap["location"] = sr.Location 3184 } 3185 if sr.Etag != nil { 3186 objectMap["etag"] = sr.Etag 3187 } 3188 if sr.Tags != nil { 3189 objectMap["tags"] = sr.Tags 3190 } 3191 if sr.ServiceProperties != nil { 3192 objectMap["properties"] = sr.ServiceProperties 3193 } 3194 if sr.Sku != nil { 3195 objectMap["sku"] = sr.Sku 3196 } 3197 return json.Marshal(objectMap) 3198} 3199 3200// ServicesBackupFuture an abstraction for monitoring and retrieving the results of a long-running 3201// operation. 3202type ServicesBackupFuture struct { 3203 azure.Future 3204} 3205 3206// Result returns the result of the asynchronous operation. 3207// If the operation has not completed it will return an error. 3208func (future *ServicesBackupFuture) Result(client ServicesClient) (sr ServiceResource, err error) { 3209 var done bool 3210 done, err = future.DoneWithContext(context.Background(), client) 3211 if err != nil { 3212 err = autorest.NewErrorWithError(err, "apimanagement.ServicesBackupFuture", "Result", future.Response(), "Polling failure") 3213 return 3214 } 3215 if !done { 3216 err = azure.NewAsyncOpIncompleteError("apimanagement.ServicesBackupFuture") 3217 return 3218 } 3219 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 3220 if sr.Response.Response, err = future.GetResult(sender); err == nil && sr.Response.Response.StatusCode != http.StatusNoContent { 3221 sr, err = client.BackupResponder(sr.Response.Response) 3222 if err != nil { 3223 err = autorest.NewErrorWithError(err, "apimanagement.ServicesBackupFuture", "Result", sr.Response.Response, "Failure responding to request") 3224 } 3225 } 3226 return 3227} 3228 3229// ServiceSkuProperties API Management service resource SKU properties. 3230type ServiceSkuProperties struct { 3231 // Name - Name of the Sku. Possible values include: 'Developer', 'Standard', 'Premium' 3232 Name SkuType `json:"name,omitempty"` 3233 // Capacity - Capacity of the SKU (number of deployed units of the SKU). The default value is 1. 3234 Capacity *int32 `json:"capacity,omitempty"` 3235} 3236 3237// ServicesManageDeploymentsFuture an abstraction for monitoring and retrieving the results of a 3238// long-running operation. 3239type ServicesManageDeploymentsFuture struct { 3240 azure.Future 3241} 3242 3243// Result returns the result of the asynchronous operation. 3244// If the operation has not completed it will return an error. 3245func (future *ServicesManageDeploymentsFuture) Result(client ServicesClient) (sr ServiceResource, err error) { 3246 var done bool 3247 done, err = future.DoneWithContext(context.Background(), client) 3248 if err != nil { 3249 err = autorest.NewErrorWithError(err, "apimanagement.ServicesManageDeploymentsFuture", "Result", future.Response(), "Polling failure") 3250 return 3251 } 3252 if !done { 3253 err = azure.NewAsyncOpIncompleteError("apimanagement.ServicesManageDeploymentsFuture") 3254 return 3255 } 3256 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 3257 if sr.Response.Response, err = future.GetResult(sender); err == nil && sr.Response.Response.StatusCode != http.StatusNoContent { 3258 sr, err = client.ManageDeploymentsResponder(sr.Response.Response) 3259 if err != nil { 3260 err = autorest.NewErrorWithError(err, "apimanagement.ServicesManageDeploymentsFuture", "Result", sr.Response.Response, "Failure responding to request") 3261 } 3262 } 3263 return 3264} 3265 3266// ServicesRestoreFuture an abstraction for monitoring and retrieving the results of a long-running 3267// operation. 3268type ServicesRestoreFuture struct { 3269 azure.Future 3270} 3271 3272// Result returns the result of the asynchronous operation. 3273// If the operation has not completed it will return an error. 3274func (future *ServicesRestoreFuture) Result(client ServicesClient) (sr ServiceResource, err error) { 3275 var done bool 3276 done, err = future.DoneWithContext(context.Background(), client) 3277 if err != nil { 3278 err = autorest.NewErrorWithError(err, "apimanagement.ServicesRestoreFuture", "Result", future.Response(), "Polling failure") 3279 return 3280 } 3281 if !done { 3282 err = azure.NewAsyncOpIncompleteError("apimanagement.ServicesRestoreFuture") 3283 return 3284 } 3285 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 3286 if sr.Response.Response, err = future.GetResult(sender); err == nil && sr.Response.Response.StatusCode != http.StatusNoContent { 3287 sr, err = client.RestoreResponder(sr.Response.Response) 3288 if err != nil { 3289 err = autorest.NewErrorWithError(err, "apimanagement.ServicesRestoreFuture", "Result", sr.Response.Response, "Failure responding to request") 3290 } 3291 } 3292 return 3293} 3294 3295// ServicesUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 3296// operation. 3297type ServicesUpdateFuture struct { 3298 azure.Future 3299} 3300 3301// Result returns the result of the asynchronous operation. 3302// If the operation has not completed it will return an error. 3303func (future *ServicesUpdateFuture) Result(client ServicesClient) (sr ServiceResource, err error) { 3304 var done bool 3305 done, err = future.DoneWithContext(context.Background(), client) 3306 if err != nil { 3307 err = autorest.NewErrorWithError(err, "apimanagement.ServicesUpdateFuture", "Result", future.Response(), "Polling failure") 3308 return 3309 } 3310 if !done { 3311 err = azure.NewAsyncOpIncompleteError("apimanagement.ServicesUpdateFuture") 3312 return 3313 } 3314 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 3315 if sr.Response.Response, err = future.GetResult(sender); err == nil && sr.Response.Response.StatusCode != http.StatusNoContent { 3316 sr, err = client.UpdateResponder(sr.Response.Response) 3317 if err != nil { 3318 err = autorest.NewErrorWithError(err, "apimanagement.ServicesUpdateFuture", "Result", sr.Response.Response, "Failure responding to request") 3319 } 3320 } 3321 return 3322} 3323 3324// ServicesUpdateHostnameFuture an abstraction for monitoring and retrieving the results of a long-running 3325// operation. 3326type ServicesUpdateHostnameFuture struct { 3327 azure.Future 3328} 3329 3330// Result returns the result of the asynchronous operation. 3331// If the operation has not completed it will return an error. 3332func (future *ServicesUpdateHostnameFuture) Result(client ServicesClient) (sr ServiceResource, err error) { 3333 var done bool 3334 done, err = future.DoneWithContext(context.Background(), client) 3335 if err != nil { 3336 err = autorest.NewErrorWithError(err, "apimanagement.ServicesUpdateHostnameFuture", "Result", future.Response(), "Polling failure") 3337 return 3338 } 3339 if !done { 3340 err = azure.NewAsyncOpIncompleteError("apimanagement.ServicesUpdateHostnameFuture") 3341 return 3342 } 3343 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 3344 if sr.Response.Response, err = future.GetResult(sender); err == nil && sr.Response.Response.StatusCode != http.StatusNoContent { 3345 sr, err = client.UpdateHostnameResponder(sr.Response.Response) 3346 if err != nil { 3347 err = autorest.NewErrorWithError(err, "apimanagement.ServicesUpdateHostnameFuture", "Result", sr.Response.Response, "Failure responding to request") 3348 } 3349 } 3350 return 3351} 3352 3353// ServiceUpdateHostnameParameters parameters supplied to the UpdateHostname operation. 3354type ServiceUpdateHostnameParameters struct { 3355 // Update - Hostnames to create or update. 3356 Update *[]HostnameConfiguration `json:"update,omitempty"` 3357 // Delete - Hostnames types to delete. 3358 Delete *[]HostnameType `json:"delete,omitempty"` 3359} 3360 3361// ServiceUploadCertificateParameters parameters supplied to the Upload SSL certificate for an API 3362// Management service operation. 3363type ServiceUploadCertificateParameters struct { 3364 // Type - Hostname type. Possible values include: 'Proxy', 'Portal', 'Management', 'Scm' 3365 Type HostnameType `json:"type,omitempty"` 3366 // Certificate - Base64 Encoded certificate. 3367 Certificate *string `json:"certificate,omitempty"` 3368 // CertificatePassword - Certificate password. 3369 CertificatePassword *string `json:"certificate_password,omitempty"` 3370} 3371 3372// SetObject ... 3373type SetObject struct { 3374 autorest.Response `json:"-"` 3375 Value interface{} `json:"value,omitempty"` 3376} 3377 3378// SubscriptionCollection paged Subscriptions list representation. 3379type SubscriptionCollection struct { 3380 autorest.Response `json:"-"` 3381 // Value - Page values. 3382 Value *[]SubscriptionContract `json:"value,omitempty"` 3383 // Count - Total records count number. 3384 Count *int64 `json:"count,omitempty"` 3385 // NextLink - Next page link if any. 3386 NextLink *string `json:"nextLink,omitempty"` 3387} 3388 3389// SubscriptionCollectionIterator provides access to a complete listing of SubscriptionContract values. 3390type SubscriptionCollectionIterator struct { 3391 i int 3392 page SubscriptionCollectionPage 3393} 3394 3395// NextWithContext advances to the next value. If there was an error making 3396// the request the iterator does not advance and the error is returned. 3397func (iter *SubscriptionCollectionIterator) NextWithContext(ctx context.Context) (err error) { 3398 if tracing.IsEnabled() { 3399 ctx = tracing.StartSpan(ctx, fqdn+"/SubscriptionCollectionIterator.NextWithContext") 3400 defer func() { 3401 sc := -1 3402 if iter.Response().Response.Response != nil { 3403 sc = iter.Response().Response.Response.StatusCode 3404 } 3405 tracing.EndSpan(ctx, sc, err) 3406 }() 3407 } 3408 iter.i++ 3409 if iter.i < len(iter.page.Values()) { 3410 return nil 3411 } 3412 err = iter.page.NextWithContext(ctx) 3413 if err != nil { 3414 iter.i-- 3415 return err 3416 } 3417 iter.i = 0 3418 return nil 3419} 3420 3421// Next advances to the next value. If there was an error making 3422// the request the iterator does not advance and the error is returned. 3423// Deprecated: Use NextWithContext() instead. 3424func (iter *SubscriptionCollectionIterator) Next() error { 3425 return iter.NextWithContext(context.Background()) 3426} 3427 3428// NotDone returns true if the enumeration should be started or is not yet complete. 3429func (iter SubscriptionCollectionIterator) NotDone() bool { 3430 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 3431} 3432 3433// Response returns the raw server response from the last page request. 3434func (iter SubscriptionCollectionIterator) Response() SubscriptionCollection { 3435 return iter.page.Response() 3436} 3437 3438// Value returns the current value or a zero-initialized value if the 3439// iterator has advanced beyond the end of the collection. 3440func (iter SubscriptionCollectionIterator) Value() SubscriptionContract { 3441 if !iter.page.NotDone() { 3442 return SubscriptionContract{} 3443 } 3444 return iter.page.Values()[iter.i] 3445} 3446 3447// Creates a new instance of the SubscriptionCollectionIterator type. 3448func NewSubscriptionCollectionIterator(page SubscriptionCollectionPage) SubscriptionCollectionIterator { 3449 return SubscriptionCollectionIterator{page: page} 3450} 3451 3452// IsEmpty returns true if the ListResult contains no values. 3453func (sc SubscriptionCollection) IsEmpty() bool { 3454 return sc.Value == nil || len(*sc.Value) == 0 3455} 3456 3457// subscriptionCollectionPreparer prepares a request to retrieve the next set of results. 3458// It returns nil if no more results exist. 3459func (sc SubscriptionCollection) subscriptionCollectionPreparer(ctx context.Context) (*http.Request, error) { 3460 if sc.NextLink == nil || len(to.String(sc.NextLink)) < 1 { 3461 return nil, nil 3462 } 3463 return autorest.Prepare((&http.Request{}).WithContext(ctx), 3464 autorest.AsJSON(), 3465 autorest.AsGet(), 3466 autorest.WithBaseURL(to.String(sc.NextLink))) 3467} 3468 3469// SubscriptionCollectionPage contains a page of SubscriptionContract values. 3470type SubscriptionCollectionPage struct { 3471 fn func(context.Context, SubscriptionCollection) (SubscriptionCollection, error) 3472 sc SubscriptionCollection 3473} 3474 3475// NextWithContext advances to the next page of values. If there was an error making 3476// the request the page does not advance and the error is returned. 3477func (page *SubscriptionCollectionPage) NextWithContext(ctx context.Context) (err error) { 3478 if tracing.IsEnabled() { 3479 ctx = tracing.StartSpan(ctx, fqdn+"/SubscriptionCollectionPage.NextWithContext") 3480 defer func() { 3481 sc := -1 3482 if page.Response().Response.Response != nil { 3483 sc = page.Response().Response.Response.StatusCode 3484 } 3485 tracing.EndSpan(ctx, sc, err) 3486 }() 3487 } 3488 next, err := page.fn(ctx, page.sc) 3489 if err != nil { 3490 return err 3491 } 3492 page.sc = next 3493 return nil 3494} 3495 3496// Next advances to the next page of values. If there was an error making 3497// the request the page does not advance and the error is returned. 3498// Deprecated: Use NextWithContext() instead. 3499func (page *SubscriptionCollectionPage) Next() error { 3500 return page.NextWithContext(context.Background()) 3501} 3502 3503// NotDone returns true if the page enumeration should be started or is not yet complete. 3504func (page SubscriptionCollectionPage) NotDone() bool { 3505 return !page.sc.IsEmpty() 3506} 3507 3508// Response returns the raw server response from the last page request. 3509func (page SubscriptionCollectionPage) Response() SubscriptionCollection { 3510 return page.sc 3511} 3512 3513// Values returns the slice of values for the current page or nil if there are no values. 3514func (page SubscriptionCollectionPage) Values() []SubscriptionContract { 3515 if page.sc.IsEmpty() { 3516 return nil 3517 } 3518 return *page.sc.Value 3519} 3520 3521// Creates a new instance of the SubscriptionCollectionPage type. 3522func NewSubscriptionCollectionPage(getNextPage func(context.Context, SubscriptionCollection) (SubscriptionCollection, error)) SubscriptionCollectionPage { 3523 return SubscriptionCollectionPage{fn: getNextPage} 3524} 3525 3526// SubscriptionContract subscription details. 3527type SubscriptionContract struct { 3528 autorest.Response `json:"-"` 3529 // 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. 3530 ID *string `json:"id,omitempty"` 3531 // 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. 3532 UserID *string `json:"userId,omitempty"` 3533 // 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. 3534 ProductID *string `json:"productId,omitempty"` 3535 // Name - The name of the subscription, or null if the subscription has no name. 3536 Name *string `json:"name,omitempty"` 3537 // 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' 3538 State SubscriptionStateContract `json:"state,omitempty"` 3539 // 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. 3540 CreatedDate *date.Time `json:"createdDate,omitempty"` 3541 // StartDate - Subscription activation date. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. 3542 StartDate *date.Time `json:"startDate,omitempty"` 3543 // ExpirationDate - Subscription expiration date. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. 3544 ExpirationDate *date.Time `json:"expirationDate,omitempty"` 3545 // 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. 3546 EndDate *date.Time `json:"endDate,omitempty"` 3547 // 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. 3548 NotificationDate *date.Time `json:"notificationDate,omitempty"` 3549 // PrimaryKey - Subscription primary key. 3550 PrimaryKey *string `json:"primaryKey,omitempty"` 3551 // SecondaryKey - Subscription secondary key. 3552 SecondaryKey *string `json:"secondaryKey,omitempty"` 3553 // StateComment - Optional subscription comment added by an administrator. 3554 StateComment *string `json:"stateComment,omitempty"` 3555} 3556 3557// SubscriptionCreateParameters parameters supplied to the Create subscription operation. 3558type SubscriptionCreateParameters struct { 3559 // UserID - User (user id path) for whom subscription is being created in form /users/{uid} 3560 UserID *string `json:"userId,omitempty"` 3561 // ProductID - Product (product id path) for which subscription is being created in form /products/{productId} 3562 ProductID *string `json:"productId,omitempty"` 3563 // Name - Subscription name. 3564 Name *string `json:"name,omitempty"` 3565 // PrimaryKey - Primary subscription key. If not specified during request key will be generated automatically. 3566 PrimaryKey *string `json:"primaryKey,omitempty"` 3567 // SecondaryKey - Secondary subscription key. If not specified during request key will be generated automatically. 3568 SecondaryKey *string `json:"secondaryKey,omitempty"` 3569 // 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' 3570 State SubscriptionStateContract `json:"state,omitempty"` 3571} 3572 3573// SubscriptionKeyParameterNamesContract subscription key parameter names details. 3574type SubscriptionKeyParameterNamesContract struct { 3575 // Header - Subscription key header name. 3576 Header *string `json:"header,omitempty"` 3577 // Query - Subscription key query string parameter name. 3578 Query *string `json:"query,omitempty"` 3579} 3580 3581// SubscriptionUpdateParameters parameters supplied to the Update subscription operation. 3582type SubscriptionUpdateParameters struct { 3583 // UserID - User identifier path: /users/{uid} 3584 UserID *string `json:"userId,omitempty"` 3585 // ProductID - Product identifier path: /products/{productId} 3586 ProductID *string `json:"productId,omitempty"` 3587 // ExpirationDate - New subscription expiration date. 3588 ExpirationDate *date.Time `json:"expirationDate,omitempty"` 3589 // Name - Subscription name. 3590 Name *string `json:"name,omitempty"` 3591 // PrimaryKey - Primary subscription key. 3592 PrimaryKey *string `json:"primaryKey,omitempty"` 3593 // SecondaryKey - Secondary subscription key. 3594 SecondaryKey *string `json:"secondaryKey,omitempty"` 3595 // 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' 3596 State SubscriptionStateContract `json:"state,omitempty"` 3597 // StateComment - Comments describing subscription state change by the administrator. 3598 StateComment *string `json:"stateComment,omitempty"` 3599} 3600 3601// TenantConfigurationDeployFuture an abstraction for monitoring and retrieving the results of a 3602// long-running operation. 3603type TenantConfigurationDeployFuture struct { 3604 azure.Future 3605} 3606 3607// Result returns the result of the asynchronous operation. 3608// If the operation has not completed it will return an error. 3609func (future *TenantConfigurationDeployFuture) Result(client TenantConfigurationClient) (orc OperationResultContract, err error) { 3610 var done bool 3611 done, err = future.DoneWithContext(context.Background(), client) 3612 if err != nil { 3613 err = autorest.NewErrorWithError(err, "apimanagement.TenantConfigurationDeployFuture", "Result", future.Response(), "Polling failure") 3614 return 3615 } 3616 if !done { 3617 err = azure.NewAsyncOpIncompleteError("apimanagement.TenantConfigurationDeployFuture") 3618 return 3619 } 3620 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 3621 if orc.Response.Response, err = future.GetResult(sender); err == nil && orc.Response.Response.StatusCode != http.StatusNoContent { 3622 orc, err = client.DeployResponder(orc.Response.Response) 3623 if err != nil { 3624 err = autorest.NewErrorWithError(err, "apimanagement.TenantConfigurationDeployFuture", "Result", orc.Response.Response, "Failure responding to request") 3625 } 3626 } 3627 return 3628} 3629 3630// TenantConfigurationSaveFuture an abstraction for monitoring and retrieving the results of a long-running 3631// operation. 3632type TenantConfigurationSaveFuture struct { 3633 azure.Future 3634} 3635 3636// Result returns the result of the asynchronous operation. 3637// If the operation has not completed it will return an error. 3638func (future *TenantConfigurationSaveFuture) Result(client TenantConfigurationClient) (orc OperationResultContract, err error) { 3639 var done bool 3640 done, err = future.DoneWithContext(context.Background(), client) 3641 if err != nil { 3642 err = autorest.NewErrorWithError(err, "apimanagement.TenantConfigurationSaveFuture", "Result", future.Response(), "Polling failure") 3643 return 3644 } 3645 if !done { 3646 err = azure.NewAsyncOpIncompleteError("apimanagement.TenantConfigurationSaveFuture") 3647 return 3648 } 3649 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 3650 if orc.Response.Response, err = future.GetResult(sender); err == nil && orc.Response.Response.StatusCode != http.StatusNoContent { 3651 orc, err = client.SaveResponder(orc.Response.Response) 3652 if err != nil { 3653 err = autorest.NewErrorWithError(err, "apimanagement.TenantConfigurationSaveFuture", "Result", orc.Response.Response, "Failure responding to request") 3654 } 3655 } 3656 return 3657} 3658 3659// TenantConfigurationSyncStateContract tenant Configuration Synchronization State. 3660type TenantConfigurationSyncStateContract struct { 3661 autorest.Response `json:"-"` 3662 // Branch - The name of Git branch. 3663 Branch *string `json:"branch,omitempty"` 3664 // CommitID - The latest commit Id. 3665 CommitID *string `json:"commitId,omitempty"` 3666 // IsExport - value indicating if last sync was save (true) or deploy (false) operation. 3667 IsExport *bool `json:"isExport,omitempty"` 3668 // IsSynced - value indicating if last synchronization was later than the configuration change. 3669 IsSynced *bool `json:"isSynced,omitempty"` 3670 // IsGitEnabled - value indicating whether Git configuration access is enabled. 3671 IsGitEnabled *bool `json:"isGitEnabled,omitempty"` 3672 // 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. 3673 SyncDate *date.Time `json:"syncDate,omitempty"` 3674 // 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. 3675 ConfigurationChangeDate *date.Time `json:"configurationChangeDate,omitempty"` 3676} 3677 3678// TenantConfigurationValidateFuture an abstraction for monitoring and retrieving the results of a 3679// long-running operation. 3680type TenantConfigurationValidateFuture struct { 3681 azure.Future 3682} 3683 3684// Result returns the result of the asynchronous operation. 3685// If the operation has not completed it will return an error. 3686func (future *TenantConfigurationValidateFuture) Result(client TenantConfigurationClient) (orc OperationResultContract, err error) { 3687 var done bool 3688 done, err = future.DoneWithContext(context.Background(), client) 3689 if err != nil { 3690 err = autorest.NewErrorWithError(err, "apimanagement.TenantConfigurationValidateFuture", "Result", future.Response(), "Polling failure") 3691 return 3692 } 3693 if !done { 3694 err = azure.NewAsyncOpIncompleteError("apimanagement.TenantConfigurationValidateFuture") 3695 return 3696 } 3697 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 3698 if orc.Response.Response, err = future.GetResult(sender); err == nil && orc.Response.Response.StatusCode != http.StatusNoContent { 3699 orc, err = client.ValidateResponder(orc.Response.Response) 3700 if err != nil { 3701 err = autorest.NewErrorWithError(err, "apimanagement.TenantConfigurationValidateFuture", "Result", orc.Response.Response, "Failure responding to request") 3702 } 3703 } 3704 return 3705} 3706 3707// TenantLongRunningOperationResult a standard service response for long running tenant operations. 3708type TenantLongRunningOperationResult struct { 3709 // OperationStatusLink - operation status link. 3710 OperationStatusLink *string `json:"operationStatusLink,omitempty"` 3711 // RetryAfter - The number of minutes to retry the operation after. 3712 RetryAfter *int32 `json:"retryAfter,omitempty"` 3713 // Status - Current status of the operation. Possible values include: 'OperationStatusInProgress', 'OperationStatusSucceeded', 'OperationStatusFailed' 3714 Status OperationStatus `json:"status,omitempty"` 3715 // StatusCode - Possible values include: 'Continue', 'OK', 'Created', 'Accepted', 'NotFound', 'Conflict' 3716 StatusCode HTTPStatusCode `json:"statusCode,omitempty"` 3717 RequestID *string `json:"requestId,omitempty"` 3718} 3719 3720// TokenBodyParameterContract oAuth acquire token request body parameter (www-url-form-encoded). 3721type TokenBodyParameterContract struct { 3722 // Name - body parameter name. 3723 Name *string `json:"name,omitempty"` 3724 // Value - body parameter value. 3725 Value *string `json:"value,omitempty"` 3726} 3727 3728// UserCollection paged Users list representation. 3729type UserCollection struct { 3730 autorest.Response `json:"-"` 3731 // Value - Page values. 3732 Value *[]UserContract `json:"value,omitempty"` 3733 // Count - Total records count number. 3734 Count *int64 `json:"count,omitempty"` 3735 // NextLink - Next page link if any. 3736 NextLink *string `json:"nextLink,omitempty"` 3737} 3738 3739// UserCollectionIterator provides access to a complete listing of UserContract values. 3740type UserCollectionIterator struct { 3741 i int 3742 page UserCollectionPage 3743} 3744 3745// NextWithContext advances to the next value. If there was an error making 3746// the request the iterator does not advance and the error is returned. 3747func (iter *UserCollectionIterator) NextWithContext(ctx context.Context) (err error) { 3748 if tracing.IsEnabled() { 3749 ctx = tracing.StartSpan(ctx, fqdn+"/UserCollectionIterator.NextWithContext") 3750 defer func() { 3751 sc := -1 3752 if iter.Response().Response.Response != nil { 3753 sc = iter.Response().Response.Response.StatusCode 3754 } 3755 tracing.EndSpan(ctx, sc, err) 3756 }() 3757 } 3758 iter.i++ 3759 if iter.i < len(iter.page.Values()) { 3760 return nil 3761 } 3762 err = iter.page.NextWithContext(ctx) 3763 if err != nil { 3764 iter.i-- 3765 return err 3766 } 3767 iter.i = 0 3768 return nil 3769} 3770 3771// Next advances to the next value. If there was an error making 3772// the request the iterator does not advance and the error is returned. 3773// Deprecated: Use NextWithContext() instead. 3774func (iter *UserCollectionIterator) Next() error { 3775 return iter.NextWithContext(context.Background()) 3776} 3777 3778// NotDone returns true if the enumeration should be started or is not yet complete. 3779func (iter UserCollectionIterator) NotDone() bool { 3780 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 3781} 3782 3783// Response returns the raw server response from the last page request. 3784func (iter UserCollectionIterator) Response() UserCollection { 3785 return iter.page.Response() 3786} 3787 3788// Value returns the current value or a zero-initialized value if the 3789// iterator has advanced beyond the end of the collection. 3790func (iter UserCollectionIterator) Value() UserContract { 3791 if !iter.page.NotDone() { 3792 return UserContract{} 3793 } 3794 return iter.page.Values()[iter.i] 3795} 3796 3797// Creates a new instance of the UserCollectionIterator type. 3798func NewUserCollectionIterator(page UserCollectionPage) UserCollectionIterator { 3799 return UserCollectionIterator{page: page} 3800} 3801 3802// IsEmpty returns true if the ListResult contains no values. 3803func (uc UserCollection) IsEmpty() bool { 3804 return uc.Value == nil || len(*uc.Value) == 0 3805} 3806 3807// userCollectionPreparer prepares a request to retrieve the next set of results. 3808// It returns nil if no more results exist. 3809func (uc UserCollection) userCollectionPreparer(ctx context.Context) (*http.Request, error) { 3810 if uc.NextLink == nil || len(to.String(uc.NextLink)) < 1 { 3811 return nil, nil 3812 } 3813 return autorest.Prepare((&http.Request{}).WithContext(ctx), 3814 autorest.AsJSON(), 3815 autorest.AsGet(), 3816 autorest.WithBaseURL(to.String(uc.NextLink))) 3817} 3818 3819// UserCollectionPage contains a page of UserContract values. 3820type UserCollectionPage struct { 3821 fn func(context.Context, UserCollection) (UserCollection, error) 3822 uc UserCollection 3823} 3824 3825// NextWithContext advances to the next page of values. If there was an error making 3826// the request the page does not advance and the error is returned. 3827func (page *UserCollectionPage) NextWithContext(ctx context.Context) (err error) { 3828 if tracing.IsEnabled() { 3829 ctx = tracing.StartSpan(ctx, fqdn+"/UserCollectionPage.NextWithContext") 3830 defer func() { 3831 sc := -1 3832 if page.Response().Response.Response != nil { 3833 sc = page.Response().Response.Response.StatusCode 3834 } 3835 tracing.EndSpan(ctx, sc, err) 3836 }() 3837 } 3838 next, err := page.fn(ctx, page.uc) 3839 if err != nil { 3840 return err 3841 } 3842 page.uc = next 3843 return nil 3844} 3845 3846// Next advances to the next page of values. If there was an error making 3847// the request the page does not advance and the error is returned. 3848// Deprecated: Use NextWithContext() instead. 3849func (page *UserCollectionPage) Next() error { 3850 return page.NextWithContext(context.Background()) 3851} 3852 3853// NotDone returns true if the page enumeration should be started or is not yet complete. 3854func (page UserCollectionPage) NotDone() bool { 3855 return !page.uc.IsEmpty() 3856} 3857 3858// Response returns the raw server response from the last page request. 3859func (page UserCollectionPage) Response() UserCollection { 3860 return page.uc 3861} 3862 3863// Values returns the slice of values for the current page or nil if there are no values. 3864func (page UserCollectionPage) Values() []UserContract { 3865 if page.uc.IsEmpty() { 3866 return nil 3867 } 3868 return *page.uc.Value 3869} 3870 3871// Creates a new instance of the UserCollectionPage type. 3872func NewUserCollectionPage(getNextPage func(context.Context, UserCollection) (UserCollection, error)) UserCollectionPage { 3873 return UserCollectionPage{fn: getNextPage} 3874} 3875 3876// UserContract user profile. 3877type UserContract struct { 3878 autorest.Response `json:"-"` 3879 // ID - User identifier path. 3880 ID *string `json:"id,omitempty"` 3881 // FirstName - First name. 3882 FirstName *string `json:"firstName,omitempty"` 3883 // LastName - Last name. 3884 LastName *string `json:"lastName,omitempty"` 3885 // Email - Email address. 3886 Email *string `json:"email,omitempty"` 3887 // State - User state. Possible values include: 'UserStateContractActive', 'UserStateContractBlocked' 3888 State UserStateContract `json:"state,omitempty"` 3889 // RegistrationDate - Date of user registration. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. 3890 RegistrationDate *date.Time `json:"registrationDate,omitempty"` 3891 // Note - Administrator's note about given user. 3892 Note *string `json:"note,omitempty"` 3893 // Identities - READ-ONLY; Collection of user identities. 3894 Identities *[]UserIdentityContract `json:"identities,omitempty"` 3895} 3896 3897// UserCreateParameters parameters supplied to the Create User operation. 3898type UserCreateParameters struct { 3899 // Email - Email address. Must not be empty and must be unique within the service instance. 3900 Email *string `json:"email,omitempty"` 3901 // Password - User Password. 3902 Password *string `json:"password,omitempty"` 3903 // FirstName - First name. 3904 FirstName *string `json:"firstName,omitempty"` 3905 // LastName - Last name. 3906 LastName *string `json:"lastName,omitempty"` 3907 // 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' 3908 State UserStateContract `json:"state,omitempty"` 3909 // Note - Optional note about a user set by the administrator. 3910 Note *string `json:"note,omitempty"` 3911} 3912 3913// UserIdentityContract user identity details. 3914type UserIdentityContract struct { 3915 // Provider - Identity provider name. 3916 Provider *string `json:"provider,omitempty"` 3917 // ID - Identifier value within provider. 3918 ID *string `json:"id,omitempty"` 3919} 3920 3921// UserUpdateParameters parameters supplied to the Update User operation. 3922type UserUpdateParameters struct { 3923 // Email - Email address. 3924 Email *string `json:"email,omitempty"` 3925 // Password - Password. 3926 Password *string `json:"password,omitempty"` 3927 // FirstName - First name. 3928 FirstName *string `json:"firstName,omitempty"` 3929 // LastName - Last name. 3930 LastName *string `json:"lastName,omitempty"` 3931 // State - Account state. Possible values include: 'UserStateContractActive', 'UserStateContractBlocked' 3932 State UserStateContract `json:"state,omitempty"` 3933 // Note - Note about user. 3934 Note *string `json:"note,omitempty"` 3935} 3936 3937// VirtualNetworkConfiguration configuration of a virtual network to which API Management service is 3938// deployed. 3939type VirtualNetworkConfiguration struct { 3940 // Vnetid - READ-ONLY; The virtual network ID. This is typically a GUID. Expect a null GUID by default. 3941 Vnetid *string `json:"vnetid,omitempty"` 3942 // Subnetname - READ-ONLY; The name of the subnet. 3943 Subnetname *string `json:"subnetname,omitempty"` 3944 // SubnetResourceID - The name of the subnet Resource ID. This has format /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/Microsoft.{Network|ClassicNetwork}/VirtualNetworks/{virtual network name}/subnets/{subnet name}. 3945 SubnetResourceID *string `json:"subnetResourceId,omitempty"` 3946 // Location - The location of the virtual network. 3947 Location *string `json:"location,omitempty"` 3948} 3949