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