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