1package apimanagement 2 3// Copyright (c) Microsoft and contributors. All rights reserved. 4// 5// Licensed under the Apache License, Version 2.0 (the "License"); 6// you may not use this file except in compliance with the License. 7// You may obtain a copy of the License at 8// http://www.apache.org/licenses/LICENSE-2.0 9// 10// Unless required by applicable law or agreed to in writing, software 11// distributed under the License is distributed on an "AS IS" BASIS, 12// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13// 14// See the License for the specific language governing permissions and 15// limitations under the License. 16// 17// Code generated by Microsoft (R) AutoRest Code Generator. 18// Changes may cause incorrect behavior and will be lost if the code is regenerated. 19 20import ( 21 "context" 22 "encoding/json" 23 "github.com/Azure/go-autorest/autorest" 24 "github.com/Azure/go-autorest/autorest/azure" 25 "github.com/Azure/go-autorest/autorest/date" 26 "github.com/Azure/go-autorest/autorest/to" 27 "github.com/Azure/go-autorest/tracing" 28 "github.com/satori/go.uuid" 29 "net/http" 30) 31 32// The package's fully qualified name. 33const fqdn = "github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement" 34 35// AlwaysLog enumerates the values for always log. 36type AlwaysLog string 37 38const ( 39 // AllErrors Always log all erroneous request regardless of sampling settings. 40 AllErrors AlwaysLog = "allErrors" 41) 42 43// PossibleAlwaysLogValues returns an array of possible values for the AlwaysLog const type. 44func PossibleAlwaysLogValues() []AlwaysLog { 45 return []AlwaysLog{AllErrors} 46} 47 48// APIType enumerates the values for api type. 49type APIType string 50 51const ( 52 // HTTP ... 53 HTTP APIType = "http" 54 // Soap ... 55 Soap APIType = "soap" 56) 57 58// PossibleAPITypeValues returns an array of possible values for the APIType const type. 59func PossibleAPITypeValues() []APIType { 60 return []APIType{HTTP, Soap} 61} 62 63// AsyncOperationStatus enumerates the values for async operation status. 64type AsyncOperationStatus string 65 66const ( 67 // Failed ... 68 Failed AsyncOperationStatus = "Failed" 69 // InProgress ... 70 InProgress AsyncOperationStatus = "InProgress" 71 // Started ... 72 Started AsyncOperationStatus = "Started" 73 // Succeeded ... 74 Succeeded AsyncOperationStatus = "Succeeded" 75) 76 77// PossibleAsyncOperationStatusValues returns an array of possible values for the AsyncOperationStatus const type. 78func PossibleAsyncOperationStatusValues() []AsyncOperationStatus { 79 return []AsyncOperationStatus{Failed, InProgress, Started, Succeeded} 80} 81 82// AuthorizationMethod enumerates the values for authorization method. 83type AuthorizationMethod string 84 85const ( 86 // DELETE ... 87 DELETE AuthorizationMethod = "DELETE" 88 // GET ... 89 GET AuthorizationMethod = "GET" 90 // HEAD ... 91 HEAD AuthorizationMethod = "HEAD" 92 // OPTIONS ... 93 OPTIONS AuthorizationMethod = "OPTIONS" 94 // PATCH ... 95 PATCH AuthorizationMethod = "PATCH" 96 // POST ... 97 POST AuthorizationMethod = "POST" 98 // PUT ... 99 PUT AuthorizationMethod = "PUT" 100 // TRACE ... 101 TRACE AuthorizationMethod = "TRACE" 102) 103 104// PossibleAuthorizationMethodValues returns an array of possible values for the AuthorizationMethod const type. 105func PossibleAuthorizationMethodValues() []AuthorizationMethod { 106 return []AuthorizationMethod{DELETE, GET, HEAD, OPTIONS, PATCH, POST, PUT, TRACE} 107} 108 109// BackendProtocol enumerates the values for backend protocol. 110type BackendProtocol string 111 112const ( 113 // BackendProtocolHTTP The Backend is a RESTful service. 114 BackendProtocolHTTP BackendProtocol = "http" 115 // BackendProtocolSoap The Backend is a SOAP service. 116 BackendProtocolSoap BackendProtocol = "soap" 117) 118 119// PossibleBackendProtocolValues returns an array of possible values for the BackendProtocol const type. 120func PossibleBackendProtocolValues() []BackendProtocol { 121 return []BackendProtocol{BackendProtocolHTTP, BackendProtocolSoap} 122} 123 124// BearerTokenSendingMethod enumerates the values for bearer token sending method. 125type BearerTokenSendingMethod string 126 127const ( 128 // AuthorizationHeader ... 129 AuthorizationHeader BearerTokenSendingMethod = "authorizationHeader" 130 // Query ... 131 Query BearerTokenSendingMethod = "query" 132) 133 134// PossibleBearerTokenSendingMethodValues returns an array of possible values for the BearerTokenSendingMethod const type. 135func PossibleBearerTokenSendingMethodValues() []BearerTokenSendingMethod { 136 return []BearerTokenSendingMethod{AuthorizationHeader, Query} 137} 138 139// BearerTokenSendingMethods enumerates the values for bearer token sending methods. 140type BearerTokenSendingMethods string 141 142const ( 143 // BearerTokenSendingMethodsAuthorizationHeader Access token will be transmitted in the Authorization 144 // header using Bearer schema 145 BearerTokenSendingMethodsAuthorizationHeader BearerTokenSendingMethods = "authorizationHeader" 146 // BearerTokenSendingMethodsQuery Access token will be transmitted as query parameters. 147 BearerTokenSendingMethodsQuery BearerTokenSendingMethods = "query" 148) 149 150// PossibleBearerTokenSendingMethodsValues returns an array of possible values for the BearerTokenSendingMethods const type. 151func PossibleBearerTokenSendingMethodsValues() []BearerTokenSendingMethods { 152 return []BearerTokenSendingMethods{BearerTokenSendingMethodsAuthorizationHeader, BearerTokenSendingMethodsQuery} 153} 154 155// ClientAuthenticationMethod enumerates the values for client authentication method. 156type ClientAuthenticationMethod string 157 158const ( 159 // Basic Basic Client Authentication method. 160 Basic ClientAuthenticationMethod = "Basic" 161 // Body Body based Authentication method. 162 Body ClientAuthenticationMethod = "Body" 163) 164 165// PossibleClientAuthenticationMethodValues returns an array of possible values for the ClientAuthenticationMethod const type. 166func PossibleClientAuthenticationMethodValues() []ClientAuthenticationMethod { 167 return []ClientAuthenticationMethod{Basic, Body} 168} 169 170// Confirmation enumerates the values for confirmation. 171type Confirmation string 172 173const ( 174 // Invite Send an e-mail inviting the user to sign-up and complete registration. 175 Invite Confirmation = "invite" 176 // Signup Send an e-mail to the user confirming they have successfully signed up. 177 Signup Confirmation = "signup" 178) 179 180// PossibleConfirmationValues returns an array of possible values for the Confirmation const type. 181func PossibleConfirmationValues() []Confirmation { 182 return []Confirmation{Invite, Signup} 183} 184 185// ConnectivityStatusType enumerates the values for connectivity status type. 186type ConnectivityStatusType string 187 188const ( 189 // Failure ... 190 Failure ConnectivityStatusType = "failure" 191 // Initializing ... 192 Initializing ConnectivityStatusType = "initializing" 193 // Success ... 194 Success ConnectivityStatusType = "success" 195) 196 197// PossibleConnectivityStatusTypeValues returns an array of possible values for the ConnectivityStatusType const type. 198func PossibleConnectivityStatusTypeValues() []ConnectivityStatusType { 199 return []ConnectivityStatusType{Failure, Initializing, Success} 200} 201 202// ContentFormat enumerates the values for content format. 203type ContentFormat string 204 205const ( 206 // Openapi The contents are inline and Content Type is a OpenApi 3.0 Document in YAML format. 207 Openapi ContentFormat = "openapi" 208 // Openapijson The contents are inline and Content Type is a OpenApi 3.0 Document in JSON format. 209 Openapijson ContentFormat = "openapi+json" 210 // OpenapiLink The Open Api 3.0 document is hosted on a publicly accessible internet address. 211 OpenapiLink ContentFormat = "openapi-link" 212 // SwaggerJSON The contents are inline and Content Type is a OpenApi 2.0 Document. 213 SwaggerJSON ContentFormat = "swagger-json" 214 // SwaggerLinkJSON The Open Api 2.0 document is hosted on a publicly accessible internet address. 215 SwaggerLinkJSON ContentFormat = "swagger-link-json" 216 // WadlLinkJSON The WADL document is hosted on a publicly accessible internet address. 217 WadlLinkJSON ContentFormat = "wadl-link-json" 218 // WadlXML The contents are inline and Content type is a WADL document. 219 WadlXML ContentFormat = "wadl-xml" 220 // Wsdl The contents are inline and the document is a WSDL/Soap document. 221 Wsdl ContentFormat = "wsdl" 222 // WsdlLink The WSDL document is hosted on a publicly accessible internet address. 223 WsdlLink ContentFormat = "wsdl-link" 224) 225 226// PossibleContentFormatValues returns an array of possible values for the ContentFormat const type. 227func PossibleContentFormatValues() []ContentFormat { 228 return []ContentFormat{Openapi, Openapijson, OpenapiLink, SwaggerJSON, SwaggerLinkJSON, WadlLinkJSON, WadlXML, Wsdl, WsdlLink} 229} 230 231// ExportFormat enumerates the values for export format. 232type ExportFormat string 233 234const ( 235 // ExportFormatOpenAPI3 Export the Api Definition in OpenApi Specification 3.0 to Storage Blob. 236 ExportFormatOpenAPI3 ExportFormat = "openapi-link" 237 // ExportFormatSwagger Export the Api Definition in OpenApi Specification 2.0 format to the Storage Blob. 238 ExportFormatSwagger ExportFormat = "swagger-link" 239 // ExportFormatWadl Export the Api Definition in WADL Schema to Storage Blob. 240 ExportFormatWadl ExportFormat = "wadl-link" 241 // ExportFormatWsdl Export the Api Definition in WSDL Schema to Storage Blob. This is only supported for 242 // APIs of Type `soap` 243 ExportFormatWsdl ExportFormat = "wsdl-link" 244) 245 246// PossibleExportFormatValues returns an array of possible values for the ExportFormat const type. 247func PossibleExportFormatValues() []ExportFormat { 248 return []ExportFormat{ExportFormatOpenAPI3, ExportFormatSwagger, ExportFormatWadl, ExportFormatWsdl} 249} 250 251// GrantType enumerates the values for grant type. 252type GrantType string 253 254const ( 255 // AuthorizationCode Authorization Code Grant flow as described 256 // https://tools.ietf.org/html/rfc6749#section-4.1. 257 AuthorizationCode GrantType = "authorizationCode" 258 // ClientCredentials Client Credentials Grant flow as described 259 // https://tools.ietf.org/html/rfc6749#section-4.4. 260 ClientCredentials GrantType = "clientCredentials" 261 // Implicit Implicit Code Grant flow as described https://tools.ietf.org/html/rfc6749#section-4.2. 262 Implicit GrantType = "implicit" 263 // ResourceOwnerPassword Resource Owner Password Grant flow as described 264 // https://tools.ietf.org/html/rfc6749#section-4.3. 265 ResourceOwnerPassword GrantType = "resourceOwnerPassword" 266) 267 268// PossibleGrantTypeValues returns an array of possible values for the GrantType const type. 269func PossibleGrantTypeValues() []GrantType { 270 return []GrantType{AuthorizationCode, ClientCredentials, Implicit, ResourceOwnerPassword} 271} 272 273// GroupType enumerates the values for group type. 274type GroupType string 275 276const ( 277 // Custom ... 278 Custom GroupType = "custom" 279 // External ... 280 External GroupType = "external" 281 // System ... 282 System GroupType = "system" 283) 284 285// PossibleGroupTypeValues returns an array of possible values for the GroupType const type. 286func PossibleGroupTypeValues() []GroupType { 287 return []GroupType{Custom, External, System} 288} 289 290// HostnameType enumerates the values for hostname type. 291type HostnameType string 292 293const ( 294 // Management ... 295 Management HostnameType = "Management" 296 // Portal ... 297 Portal HostnameType = "Portal" 298 // Proxy ... 299 Proxy HostnameType = "Proxy" 300 // Scm ... 301 Scm HostnameType = "Scm" 302) 303 304// PossibleHostnameTypeValues returns an array of possible values for the HostnameType const type. 305func PossibleHostnameTypeValues() []HostnameType { 306 return []HostnameType{Management, Portal, Proxy, Scm} 307} 308 309// IdentityProviderType enumerates the values for identity provider type. 310type IdentityProviderType string 311 312const ( 313 // Aad Azure Active Directory as Identity provider. 314 Aad IdentityProviderType = "aad" 315 // AadB2C Azure Active Directory B2C as Identity provider. 316 AadB2C IdentityProviderType = "aadB2C" 317 // Facebook Facebook as Identity provider. 318 Facebook IdentityProviderType = "facebook" 319 // Google Google as Identity provider. 320 Google IdentityProviderType = "google" 321 // Microsoft Microsoft Live as Identity provider. 322 Microsoft IdentityProviderType = "microsoft" 323 // Twitter Twitter as Identity provider. 324 Twitter IdentityProviderType = "twitter" 325) 326 327// PossibleIdentityProviderTypeValues returns an array of possible values for the IdentityProviderType const type. 328func PossibleIdentityProviderTypeValues() []IdentityProviderType { 329 return []IdentityProviderType{Aad, AadB2C, Facebook, Google, Microsoft, Twitter} 330} 331 332// KeyType enumerates the values for key type. 333type KeyType string 334 335const ( 336 // Primary ... 337 Primary KeyType = "primary" 338 // Secondary ... 339 Secondary KeyType = "secondary" 340) 341 342// PossibleKeyTypeValues returns an array of possible values for the KeyType const type. 343func PossibleKeyTypeValues() []KeyType { 344 return []KeyType{Primary, Secondary} 345} 346 347// LoggerType enumerates the values for logger type. 348type LoggerType string 349 350const ( 351 // ApplicationInsights Azure Application Insights as log destination. 352 ApplicationInsights LoggerType = "applicationInsights" 353 // AzureEventHub Azure Event Hub as log destination. 354 AzureEventHub LoggerType = "azureEventHub" 355) 356 357// PossibleLoggerTypeValues returns an array of possible values for the LoggerType const type. 358func PossibleLoggerTypeValues() []LoggerType { 359 return []LoggerType{ApplicationInsights, AzureEventHub} 360} 361 362// NameAvailabilityReason enumerates the values for name availability reason. 363type NameAvailabilityReason string 364 365const ( 366 // AlreadyExists ... 367 AlreadyExists NameAvailabilityReason = "AlreadyExists" 368 // Invalid ... 369 Invalid NameAvailabilityReason = "Invalid" 370 // Valid ... 371 Valid NameAvailabilityReason = "Valid" 372) 373 374// PossibleNameAvailabilityReasonValues returns an array of possible values for the NameAvailabilityReason const type. 375func PossibleNameAvailabilityReasonValues() []NameAvailabilityReason { 376 return []NameAvailabilityReason{AlreadyExists, Invalid, Valid} 377} 378 379// NotificationName enumerates the values for notification name. 380type NotificationName string 381 382const ( 383 // AccountClosedPublisher The following email recipients and users will receive email notifications when 384 // developer closes his account. 385 AccountClosedPublisher NotificationName = "AccountClosedPublisher" 386 // BCC The following recipients will receive blind carbon copies of all emails sent to developers. 387 BCC NotificationName = "BCC" 388 // NewApplicationNotificationMessage The following email recipients and users will receive email 389 // notifications when new applications are submitted to the application gallery. 390 NewApplicationNotificationMessage NotificationName = "NewApplicationNotificationMessage" 391 // NewIssuePublisherNotificationMessage The following email recipients and users will receive email 392 // notifications when a new issue or comment is submitted on the developer portal. 393 NewIssuePublisherNotificationMessage NotificationName = "NewIssuePublisherNotificationMessage" 394 // PurchasePublisherNotificationMessage The following email recipients and users will receive email 395 // notifications about new API product subscriptions. 396 PurchasePublisherNotificationMessage NotificationName = "PurchasePublisherNotificationMessage" 397 // QuotaLimitApproachingPublisherNotificationMessage The following email recipients and users will receive 398 // email notifications when subscription usage gets close to usage quota. 399 QuotaLimitApproachingPublisherNotificationMessage NotificationName = "QuotaLimitApproachingPublisherNotificationMessage" 400 // RequestPublisherNotificationMessage The following email recipients and users will receive email 401 // notifications about subscription requests for API products requiring approval. 402 RequestPublisherNotificationMessage NotificationName = "RequestPublisherNotificationMessage" 403) 404 405// PossibleNotificationNameValues returns an array of possible values for the NotificationName const type. 406func PossibleNotificationNameValues() []NotificationName { 407 return []NotificationName{AccountClosedPublisher, BCC, NewApplicationNotificationMessage, NewIssuePublisherNotificationMessage, PurchasePublisherNotificationMessage, QuotaLimitApproachingPublisherNotificationMessage, RequestPublisherNotificationMessage} 408} 409 410// PolicyContentFormat enumerates the values for policy content format. 411type PolicyContentFormat string 412 413const ( 414 // Rawxml The contents are inline and Content type is a non XML encoded policy document. 415 Rawxml PolicyContentFormat = "rawxml" 416 // RawxmlLink The policy document is not Xml encoded and is hosted on a http endpoint accessible from the 417 // API Management service. 418 RawxmlLink PolicyContentFormat = "rawxml-link" 419 // XML The contents are inline and Content type is an XML document. 420 XML PolicyContentFormat = "xml" 421 // XMLLink The policy XML document is hosted on a http endpoint accessible from the API Management service. 422 XMLLink PolicyContentFormat = "xml-link" 423) 424 425// PossiblePolicyContentFormatValues returns an array of possible values for the PolicyContentFormat const type. 426func PossiblePolicyContentFormatValues() []PolicyContentFormat { 427 return []PolicyContentFormat{Rawxml, RawxmlLink, XML, XMLLink} 428} 429 430// PolicyScopeContract enumerates the values for policy scope contract. 431type PolicyScopeContract string 432 433const ( 434 // PolicyScopeContractAll ... 435 PolicyScopeContractAll PolicyScopeContract = "All" 436 // PolicyScopeContractAPI ... 437 PolicyScopeContractAPI PolicyScopeContract = "Api" 438 // PolicyScopeContractOperation ... 439 PolicyScopeContractOperation PolicyScopeContract = "Operation" 440 // PolicyScopeContractProduct ... 441 PolicyScopeContractProduct PolicyScopeContract = "Product" 442 // PolicyScopeContractTenant ... 443 PolicyScopeContractTenant PolicyScopeContract = "Tenant" 444) 445 446// PossiblePolicyScopeContractValues returns an array of possible values for the PolicyScopeContract const type. 447func PossiblePolicyScopeContractValues() []PolicyScopeContract { 448 return []PolicyScopeContract{PolicyScopeContractAll, PolicyScopeContractAPI, PolicyScopeContractOperation, PolicyScopeContractProduct, PolicyScopeContractTenant} 449} 450 451// ProductState enumerates the values for product state. 452type ProductState string 453 454const ( 455 // NotPublished ... 456 NotPublished ProductState = "notPublished" 457 // Published ... 458 Published ProductState = "published" 459) 460 461// PossibleProductStateValues returns an array of possible values for the ProductState const type. 462func PossibleProductStateValues() []ProductState { 463 return []ProductState{NotPublished, Published} 464} 465 466// Protocol enumerates the values for protocol. 467type Protocol string 468 469const ( 470 // ProtocolHTTP ... 471 ProtocolHTTP Protocol = "http" 472 // ProtocolHTTPS ... 473 ProtocolHTTPS Protocol = "https" 474) 475 476// PossibleProtocolValues returns an array of possible values for the Protocol const type. 477func PossibleProtocolValues() []Protocol { 478 return []Protocol{ProtocolHTTP, ProtocolHTTPS} 479} 480 481// ResourceSkuCapacityScaleType enumerates the values for resource sku capacity scale type. 482type ResourceSkuCapacityScaleType string 483 484const ( 485 // Automatic Supported scale type automatic. 486 Automatic ResourceSkuCapacityScaleType = "automatic" 487 // Manual Supported scale type manual. 488 Manual ResourceSkuCapacityScaleType = "manual" 489 // None Scaling not supported. 490 None ResourceSkuCapacityScaleType = "none" 491) 492 493// PossibleResourceSkuCapacityScaleTypeValues returns an array of possible values for the ResourceSkuCapacityScaleType const type. 494func PossibleResourceSkuCapacityScaleTypeValues() []ResourceSkuCapacityScaleType { 495 return []ResourceSkuCapacityScaleType{Automatic, Manual, None} 496} 497 498// SamplingType enumerates the values for sampling type. 499type SamplingType string 500 501const ( 502 // Fixed Fixed-rate sampling. 503 Fixed SamplingType = "fixed" 504) 505 506// PossibleSamplingTypeValues returns an array of possible values for the SamplingType const type. 507func PossibleSamplingTypeValues() []SamplingType { 508 return []SamplingType{Fixed} 509} 510 511// SkuType enumerates the values for sku type. 512type SkuType string 513 514const ( 515 // SkuTypeBasic Basic SKU of Api Management. 516 SkuTypeBasic SkuType = "Basic" 517 // SkuTypeConsumption Consumption SKU of Api Management. 518 SkuTypeConsumption SkuType = "Consumption" 519 // SkuTypeDeveloper Developer SKU of Api Management. 520 SkuTypeDeveloper SkuType = "Developer" 521 // SkuTypePremium Premium SKU of Api Management. 522 SkuTypePremium SkuType = "Premium" 523 // SkuTypeStandard Standard SKU of Api Management. 524 SkuTypeStandard SkuType = "Standard" 525) 526 527// PossibleSkuTypeValues returns an array of possible values for the SkuType const type. 528func PossibleSkuTypeValues() []SkuType { 529 return []SkuType{SkuTypeBasic, SkuTypeConsumption, SkuTypeDeveloper, SkuTypePremium, SkuTypeStandard} 530} 531 532// SoapAPIType enumerates the values for soap api type. 533type SoapAPIType string 534 535const ( 536 // SoapPassThrough Imports the Soap API having a SOAP front end. 537 SoapPassThrough SoapAPIType = "soap" 538 // SoapToRest Imports a SOAP API having a RESTful front end. 539 SoapToRest SoapAPIType = "http" 540) 541 542// PossibleSoapAPITypeValues returns an array of possible values for the SoapAPIType const type. 543func PossibleSoapAPITypeValues() []SoapAPIType { 544 return []SoapAPIType{SoapPassThrough, SoapToRest} 545} 546 547// State enumerates the values for state. 548type State string 549 550const ( 551 // Closed The issue was closed. 552 Closed State = "closed" 553 // Open The issue is opened. 554 Open State = "open" 555 // Proposed The issue is proposed. 556 Proposed State = "proposed" 557 // Removed The issue was removed. 558 Removed State = "removed" 559 // Resolved The issue is now resolved. 560 Resolved State = "resolved" 561) 562 563// PossibleStateValues returns an array of possible values for the State const type. 564func PossibleStateValues() []State { 565 return []State{Closed, Open, Proposed, Removed, Resolved} 566} 567 568// StoreName enumerates the values for store name. 569type StoreName string 570 571const ( 572 // CertificateAuthority ... 573 CertificateAuthority StoreName = "CertificateAuthority" 574 // Root ... 575 Root StoreName = "Root" 576) 577 578// PossibleStoreNameValues returns an array of possible values for the StoreName const type. 579func PossibleStoreNameValues() []StoreName { 580 return []StoreName{CertificateAuthority, Root} 581} 582 583// SubscriptionState enumerates the values for subscription state. 584type SubscriptionState string 585 586const ( 587 // Active ... 588 Active SubscriptionState = "active" 589 // Cancelled ... 590 Cancelled SubscriptionState = "cancelled" 591 // Expired ... 592 Expired SubscriptionState = "expired" 593 // Rejected ... 594 Rejected SubscriptionState = "rejected" 595 // Submitted ... 596 Submitted SubscriptionState = "submitted" 597 // Suspended ... 598 Suspended SubscriptionState = "suspended" 599) 600 601// PossibleSubscriptionStateValues returns an array of possible values for the SubscriptionState const type. 602func PossibleSubscriptionStateValues() []SubscriptionState { 603 return []SubscriptionState{Active, Cancelled, Expired, Rejected, Submitted, Suspended} 604} 605 606// TemplateName enumerates the values for template name. 607type TemplateName string 608 609const ( 610 // AccountClosedDeveloper ... 611 AccountClosedDeveloper TemplateName = "accountClosedDeveloper" 612 // ApplicationApprovedNotificationMessage ... 613 ApplicationApprovedNotificationMessage TemplateName = "applicationApprovedNotificationMessage" 614 // ConfirmSignUpIdentityDefault ... 615 ConfirmSignUpIdentityDefault TemplateName = "confirmSignUpIdentityDefault" 616 // EmailChangeIdentityDefault ... 617 EmailChangeIdentityDefault TemplateName = "emailChangeIdentityDefault" 618 // InviteUserNotificationMessage ... 619 InviteUserNotificationMessage TemplateName = "inviteUserNotificationMessage" 620 // NewCommentNotificationMessage ... 621 NewCommentNotificationMessage TemplateName = "newCommentNotificationMessage" 622 // NewDeveloperNotificationMessage ... 623 NewDeveloperNotificationMessage TemplateName = "newDeveloperNotificationMessage" 624 // NewIssueNotificationMessage ... 625 NewIssueNotificationMessage TemplateName = "newIssueNotificationMessage" 626 // PasswordResetByAdminNotificationMessage ... 627 PasswordResetByAdminNotificationMessage TemplateName = "passwordResetByAdminNotificationMessage" 628 // PasswordResetIdentityDefault ... 629 PasswordResetIdentityDefault TemplateName = "passwordResetIdentityDefault" 630 // PurchaseDeveloperNotificationMessage ... 631 PurchaseDeveloperNotificationMessage TemplateName = "purchaseDeveloperNotificationMessage" 632 // QuotaLimitApproachingDeveloperNotificationMessage ... 633 QuotaLimitApproachingDeveloperNotificationMessage TemplateName = "quotaLimitApproachingDeveloperNotificationMessage" 634 // RejectDeveloperNotificationMessage ... 635 RejectDeveloperNotificationMessage TemplateName = "rejectDeveloperNotificationMessage" 636 // RequestDeveloperNotificationMessage ... 637 RequestDeveloperNotificationMessage TemplateName = "requestDeveloperNotificationMessage" 638) 639 640// PossibleTemplateNameValues returns an array of possible values for the TemplateName const type. 641func PossibleTemplateNameValues() []TemplateName { 642 return []TemplateName{AccountClosedDeveloper, ApplicationApprovedNotificationMessage, ConfirmSignUpIdentityDefault, EmailChangeIdentityDefault, InviteUserNotificationMessage, NewCommentNotificationMessage, NewDeveloperNotificationMessage, NewIssueNotificationMessage, PasswordResetByAdminNotificationMessage, PasswordResetIdentityDefault, PurchaseDeveloperNotificationMessage, QuotaLimitApproachingDeveloperNotificationMessage, RejectDeveloperNotificationMessage, RequestDeveloperNotificationMessage} 643} 644 645// UserState enumerates the values for user state. 646type UserState string 647 648const ( 649 // UserStateActive User state is active. 650 UserStateActive UserState = "active" 651 // UserStateBlocked User is blocked. Blocked users cannot authenticate at developer portal or call API. 652 UserStateBlocked UserState = "blocked" 653 // UserStateDeleted User account is closed. All identities and related entities are removed. 654 UserStateDeleted UserState = "deleted" 655 // UserStatePending User account is pending. Requires identity confirmation before it can be made active. 656 UserStatePending UserState = "pending" 657) 658 659// PossibleUserStateValues returns an array of possible values for the UserState const type. 660func PossibleUserStateValues() []UserState { 661 return []UserState{UserStateActive, UserStateBlocked, UserStateDeleted, UserStatePending} 662} 663 664// VersioningScheme enumerates the values for versioning scheme. 665type VersioningScheme string 666 667const ( 668 // VersioningSchemeHeader The API Version is passed in a HTTP header. 669 VersioningSchemeHeader VersioningScheme = "Header" 670 // VersioningSchemeQuery The API Version is passed in a query parameter. 671 VersioningSchemeQuery VersioningScheme = "Query" 672 // VersioningSchemeSegment The API Version is passed in a path segment. 673 VersioningSchemeSegment VersioningScheme = "Segment" 674) 675 676// PossibleVersioningSchemeValues returns an array of possible values for the VersioningScheme const type. 677func PossibleVersioningSchemeValues() []VersioningScheme { 678 return []VersioningScheme{VersioningSchemeHeader, VersioningSchemeQuery, VersioningSchemeSegment} 679} 680 681// VersioningScheme1 enumerates the values for versioning scheme 1. 682type VersioningScheme1 string 683 684const ( 685 // VersioningScheme1Header ... 686 VersioningScheme1Header VersioningScheme1 = "Header" 687 // VersioningScheme1Query ... 688 VersioningScheme1Query VersioningScheme1 = "Query" 689 // VersioningScheme1Segment ... 690 VersioningScheme1Segment VersioningScheme1 = "Segment" 691) 692 693// PossibleVersioningScheme1Values returns an array of possible values for the VersioningScheme1 const type. 694func PossibleVersioningScheme1Values() []VersioningScheme1 { 695 return []VersioningScheme1{VersioningScheme1Header, VersioningScheme1Query, VersioningScheme1Segment} 696} 697 698// VirtualNetworkType enumerates the values for virtual network type. 699type VirtualNetworkType string 700 701const ( 702 // VirtualNetworkTypeExternal The service is part of Virtual Network and it is accessible from Internet. 703 VirtualNetworkTypeExternal VirtualNetworkType = "External" 704 // VirtualNetworkTypeInternal The service is part of Virtual Network and it is only accessible from within 705 // the virtual network. 706 VirtualNetworkTypeInternal VirtualNetworkType = "Internal" 707 // VirtualNetworkTypeNone The service is not part of any Virtual Network. 708 VirtualNetworkTypeNone VirtualNetworkType = "None" 709) 710 711// PossibleVirtualNetworkTypeValues returns an array of possible values for the VirtualNetworkType const type. 712func PossibleVirtualNetworkTypeValues() []VirtualNetworkType { 713 return []VirtualNetworkType{VirtualNetworkTypeExternal, VirtualNetworkTypeInternal, VirtualNetworkTypeNone} 714} 715 716// AccessInformationContract tenant access information contract of the API Management service. 717type AccessInformationContract struct { 718 autorest.Response `json:"-"` 719 // ID - Identifier. 720 ID *string `json:"id,omitempty"` 721 // PrimaryKey - Primary access key. 722 PrimaryKey *string `json:"primaryKey,omitempty"` 723 // SecondaryKey - Secondary access key. 724 SecondaryKey *string `json:"secondaryKey,omitempty"` 725 // Enabled - Tenant access information of the API Management service. 726 Enabled *bool `json:"enabled,omitempty"` 727} 728 729// AccessInformationUpdateParameters tenant access information update parameters of the API Management 730// service. 731type AccessInformationUpdateParameters struct { 732 // Enabled - Tenant access information of the API Management service. 733 Enabled *bool `json:"enabled,omitempty"` 734} 735 736// AdditionalLocation description of an additional API Management resource location. 737type AdditionalLocation struct { 738 // Location - The location name of the additional region among Azure Data center regions. 739 Location *string `json:"location,omitempty"` 740 // Sku - SKU properties of the API Management service. 741 Sku *ServiceSkuProperties `json:"sku,omitempty"` 742 // PublicIPAddresses - READ-ONLY; Public Static Load Balanced IP addresses of the API Management service in the additional location. Available only for Basic, Standard and Premium SKU. 743 PublicIPAddresses *[]string `json:"publicIPAddresses,omitempty"` 744 // PrivateIPAddresses - READ-ONLY; Private Static Load Balanced IP addresses of the API Management service which is deployed in an Internal Virtual Network in a particular additional location. Available only for Basic, Standard and Premium SKU. 745 PrivateIPAddresses *[]string `json:"privateIPAddresses,omitempty"` 746 // VirtualNetworkConfiguration - Virtual network configuration for the location. 747 VirtualNetworkConfiguration *VirtualNetworkConfiguration `json:"virtualNetworkConfiguration,omitempty"` 748 // GatewayRegionalURL - READ-ONLY; Gateway URL of the API Management service in the Region. 749 GatewayRegionalURL *string `json:"gatewayRegionalUrl,omitempty"` 750} 751 752// APICollection paged Api list representation. 753type APICollection struct { 754 autorest.Response `json:"-"` 755 // Value - READ-ONLY; Page values. 756 Value *[]APIContract `json:"value,omitempty"` 757 // NextLink - READ-ONLY; Next page link if any. 758 NextLink *string `json:"nextLink,omitempty"` 759} 760 761// APICollectionIterator provides access to a complete listing of APIContract values. 762type APICollectionIterator struct { 763 i int 764 page APICollectionPage 765} 766 767// NextWithContext advances to the next value. If there was an error making 768// the request the iterator does not advance and the error is returned. 769func (iter *APICollectionIterator) NextWithContext(ctx context.Context) (err error) { 770 if tracing.IsEnabled() { 771 ctx = tracing.StartSpan(ctx, fqdn+"/APICollectionIterator.NextWithContext") 772 defer func() { 773 sc := -1 774 if iter.Response().Response.Response != nil { 775 sc = iter.Response().Response.Response.StatusCode 776 } 777 tracing.EndSpan(ctx, sc, err) 778 }() 779 } 780 iter.i++ 781 if iter.i < len(iter.page.Values()) { 782 return nil 783 } 784 err = iter.page.NextWithContext(ctx) 785 if err != nil { 786 iter.i-- 787 return err 788 } 789 iter.i = 0 790 return nil 791} 792 793// Next advances to the next value. If there was an error making 794// the request the iterator does not advance and the error is returned. 795// Deprecated: Use NextWithContext() instead. 796func (iter *APICollectionIterator) Next() error { 797 return iter.NextWithContext(context.Background()) 798} 799 800// NotDone returns true if the enumeration should be started or is not yet complete. 801func (iter APICollectionIterator) NotDone() bool { 802 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 803} 804 805// Response returns the raw server response from the last page request. 806func (iter APICollectionIterator) Response() APICollection { 807 return iter.page.Response() 808} 809 810// Value returns the current value or a zero-initialized value if the 811// iterator has advanced beyond the end of the collection. 812func (iter APICollectionIterator) Value() APIContract { 813 if !iter.page.NotDone() { 814 return APIContract{} 815 } 816 return iter.page.Values()[iter.i] 817} 818 819// Creates a new instance of the APICollectionIterator type. 820func NewAPICollectionIterator(page APICollectionPage) APICollectionIterator { 821 return APICollectionIterator{page: page} 822} 823 824// IsEmpty returns true if the ListResult contains no values. 825func (ac APICollection) IsEmpty() bool { 826 return ac.Value == nil || len(*ac.Value) == 0 827} 828 829// aPICollectionPreparer prepares a request to retrieve the next set of results. 830// It returns nil if no more results exist. 831func (ac APICollection) aPICollectionPreparer(ctx context.Context) (*http.Request, error) { 832 if ac.NextLink == nil || len(to.String(ac.NextLink)) < 1 { 833 return nil, nil 834 } 835 return autorest.Prepare((&http.Request{}).WithContext(ctx), 836 autorest.AsJSON(), 837 autorest.AsGet(), 838 autorest.WithBaseURL(to.String(ac.NextLink))) 839} 840 841// APICollectionPage contains a page of APIContract values. 842type APICollectionPage struct { 843 fn func(context.Context, APICollection) (APICollection, error) 844 ac APICollection 845} 846 847// NextWithContext advances to the next page of values. If there was an error making 848// the request the page does not advance and the error is returned. 849func (page *APICollectionPage) NextWithContext(ctx context.Context) (err error) { 850 if tracing.IsEnabled() { 851 ctx = tracing.StartSpan(ctx, fqdn+"/APICollectionPage.NextWithContext") 852 defer func() { 853 sc := -1 854 if page.Response().Response.Response != nil { 855 sc = page.Response().Response.Response.StatusCode 856 } 857 tracing.EndSpan(ctx, sc, err) 858 }() 859 } 860 next, err := page.fn(ctx, page.ac) 861 if err != nil { 862 return err 863 } 864 page.ac = next 865 return nil 866} 867 868// Next advances to the next page of values. If there was an error making 869// the request the page does not advance and the error is returned. 870// Deprecated: Use NextWithContext() instead. 871func (page *APICollectionPage) Next() error { 872 return page.NextWithContext(context.Background()) 873} 874 875// NotDone returns true if the page enumeration should be started or is not yet complete. 876func (page APICollectionPage) NotDone() bool { 877 return !page.ac.IsEmpty() 878} 879 880// Response returns the raw server response from the last page request. 881func (page APICollectionPage) Response() APICollection { 882 return page.ac 883} 884 885// Values returns the slice of values for the current page or nil if there are no values. 886func (page APICollectionPage) Values() []APIContract { 887 if page.ac.IsEmpty() { 888 return nil 889 } 890 return *page.ac.Value 891} 892 893// Creates a new instance of the APICollectionPage type. 894func NewAPICollectionPage(getNextPage func(context.Context, APICollection) (APICollection, error)) APICollectionPage { 895 return APICollectionPage{fn: getNextPage} 896} 897 898// APIContract API details. 899type APIContract struct { 900 autorest.Response `json:"-"` 901 // APIContractProperties - Api entity contract properties. 902 *APIContractProperties `json:"properties,omitempty"` 903 // ID - READ-ONLY; Resource ID. 904 ID *string `json:"id,omitempty"` 905 // Name - READ-ONLY; Resource name. 906 Name *string `json:"name,omitempty"` 907 // Type - READ-ONLY; Resource type for API Management resource. 908 Type *string `json:"type,omitempty"` 909} 910 911// MarshalJSON is the custom marshaler for APIContract. 912func (ac APIContract) MarshalJSON() ([]byte, error) { 913 objectMap := make(map[string]interface{}) 914 if ac.APIContractProperties != nil { 915 objectMap["properties"] = ac.APIContractProperties 916 } 917 return json.Marshal(objectMap) 918} 919 920// UnmarshalJSON is the custom unmarshaler for APIContract struct. 921func (ac *APIContract) UnmarshalJSON(body []byte) error { 922 var m map[string]*json.RawMessage 923 err := json.Unmarshal(body, &m) 924 if err != nil { 925 return err 926 } 927 for k, v := range m { 928 switch k { 929 case "properties": 930 if v != nil { 931 var APIContractProperties APIContractProperties 932 err = json.Unmarshal(*v, &APIContractProperties) 933 if err != nil { 934 return err 935 } 936 ac.APIContractProperties = &APIContractProperties 937 } 938 case "id": 939 if v != nil { 940 var ID string 941 err = json.Unmarshal(*v, &ID) 942 if err != nil { 943 return err 944 } 945 ac.ID = &ID 946 } 947 case "name": 948 if v != nil { 949 var name string 950 err = json.Unmarshal(*v, &name) 951 if err != nil { 952 return err 953 } 954 ac.Name = &name 955 } 956 case "type": 957 if v != nil { 958 var typeVar string 959 err = json.Unmarshal(*v, &typeVar) 960 if err != nil { 961 return err 962 } 963 ac.Type = &typeVar 964 } 965 } 966 } 967 968 return nil 969} 970 971// APIContractProperties api Entity Properties 972type APIContractProperties struct { 973 // DisplayName - API name. 974 DisplayName *string `json:"displayName,omitempty"` 975 // ServiceURL - Absolute URL of the backend service implementing this API. 976 ServiceURL *string `json:"serviceUrl,omitempty"` 977 // 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. 978 Path *string `json:"path,omitempty"` 979 // Protocols - Describes on which protocols the operations in this API can be invoked. 980 Protocols *[]Protocol `json:"protocols,omitempty"` 981 APIVersionSet *APIVersionSetContractDetails `json:"apiVersionSet,omitempty"` 982 // Description - Description of the API. May include HTML formatting tags. 983 Description *string `json:"description,omitempty"` 984 // AuthenticationSettings - Collection of authentication settings included into this API. 985 AuthenticationSettings *AuthenticationSettingsContract `json:"authenticationSettings,omitempty"` 986 // SubscriptionKeyParameterNames - Protocols over which API is made available. 987 SubscriptionKeyParameterNames *SubscriptionKeyParameterNamesContract `json:"subscriptionKeyParameterNames,omitempty"` 988 // APIType - Type of API. Possible values include: 'HTTP', 'Soap' 989 APIType APIType `json:"type,omitempty"` 990 // APIRevision - Describes the Revision of the Api. If no value is provided, default revision 1 is created 991 APIRevision *string `json:"apiRevision,omitempty"` 992 // APIVersion - Indicates the Version identifier of the API if the API is versioned 993 APIVersion *string `json:"apiVersion,omitempty"` 994 // IsCurrent - READ-ONLY; Indicates if API revision is current api revision. 995 IsCurrent *bool `json:"isCurrent,omitempty"` 996 // IsOnline - READ-ONLY; Indicates if API revision is accessible via the gateway. 997 IsOnline *bool `json:"isOnline,omitempty"` 998 // APIRevisionDescription - Description of the Api Revision. 999 APIRevisionDescription *string `json:"apiRevisionDescription,omitempty"` 1000 // APIVersionDescription - Description of the Api Version. 1001 APIVersionDescription *string `json:"apiVersionDescription,omitempty"` 1002 // APIVersionSetID - A resource identifier for the related ApiVersionSet. 1003 APIVersionSetID *string `json:"apiVersionSetId,omitempty"` 1004 // SubscriptionRequired - Specifies whether an API or Product subscription is required for accessing the API. 1005 SubscriptionRequired *bool `json:"subscriptionRequired,omitempty"` 1006} 1007 1008// APIContractUpdateProperties API update contract properties. 1009type APIContractUpdateProperties struct { 1010 // DisplayName - API name. 1011 DisplayName *string `json:"displayName,omitempty"` 1012 // ServiceURL - Absolute URL of the backend service implementing this API. 1013 ServiceURL *string `json:"serviceUrl,omitempty"` 1014 // 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. 1015 Path *string `json:"path,omitempty"` 1016 // Protocols - Describes on which protocols the operations in this API can be invoked. 1017 Protocols *[]Protocol `json:"protocols,omitempty"` 1018 // Description - Description of the API. May include HTML formatting tags. 1019 Description *string `json:"description,omitempty"` 1020 // AuthenticationSettings - Collection of authentication settings included into this API. 1021 AuthenticationSettings *AuthenticationSettingsContract `json:"authenticationSettings,omitempty"` 1022 // SubscriptionKeyParameterNames - Protocols over which API is made available. 1023 SubscriptionKeyParameterNames *SubscriptionKeyParameterNamesContract `json:"subscriptionKeyParameterNames,omitempty"` 1024 // APIType - Type of API. Possible values include: 'HTTP', 'Soap' 1025 APIType APIType `json:"type,omitempty"` 1026 // APIRevision - Describes the Revision of the Api. If no value is provided, default revision 1 is created 1027 APIRevision *string `json:"apiRevision,omitempty"` 1028 // APIVersion - Indicates the Version identifier of the API if the API is versioned 1029 APIVersion *string `json:"apiVersion,omitempty"` 1030 // IsCurrent - READ-ONLY; Indicates if API revision is current api revision. 1031 IsCurrent *bool `json:"isCurrent,omitempty"` 1032 // IsOnline - READ-ONLY; Indicates if API revision is accessible via the gateway. 1033 IsOnline *bool `json:"isOnline,omitempty"` 1034 // APIRevisionDescription - Description of the Api Revision. 1035 APIRevisionDescription *string `json:"apiRevisionDescription,omitempty"` 1036 // APIVersionDescription - Description of the Api Version. 1037 APIVersionDescription *string `json:"apiVersionDescription,omitempty"` 1038 // APIVersionSetID - A resource identifier for the related ApiVersionSet. 1039 APIVersionSetID *string `json:"apiVersionSetId,omitempty"` 1040 // SubscriptionRequired - Specifies whether an API or Product subscription is required for accessing the API. 1041 SubscriptionRequired *bool `json:"subscriptionRequired,omitempty"` 1042} 1043 1044// APICreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 1045// operation. 1046type APICreateOrUpdateFuture struct { 1047 azure.Future 1048} 1049 1050// Result returns the result of the asynchronous operation. 1051// If the operation has not completed it will return an error. 1052func (future *APICreateOrUpdateFuture) Result(client APIClient) (ac APIContract, err error) { 1053 var done bool 1054 done, err = future.DoneWithContext(context.Background(), client) 1055 if err != nil { 1056 err = autorest.NewErrorWithError(err, "apimanagement.APICreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 1057 return 1058 } 1059 if !done { 1060 err = azure.NewAsyncOpIncompleteError("apimanagement.APICreateOrUpdateFuture") 1061 return 1062 } 1063 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 1064 if ac.Response.Response, err = future.GetResult(sender); err == nil && ac.Response.Response.StatusCode != http.StatusNoContent { 1065 ac, err = client.CreateOrUpdateResponder(ac.Response.Response) 1066 if err != nil { 1067 err = autorest.NewErrorWithError(err, "apimanagement.APICreateOrUpdateFuture", "Result", ac.Response.Response, "Failure responding to request") 1068 } 1069 } 1070 return 1071} 1072 1073// APICreateOrUpdateParameter API Create or Update Parameters. 1074type APICreateOrUpdateParameter struct { 1075 // APICreateOrUpdateProperties - Api entity create of update properties. 1076 *APICreateOrUpdateProperties `json:"properties,omitempty"` 1077} 1078 1079// MarshalJSON is the custom marshaler for APICreateOrUpdateParameter. 1080func (acoup APICreateOrUpdateParameter) MarshalJSON() ([]byte, error) { 1081 objectMap := make(map[string]interface{}) 1082 if acoup.APICreateOrUpdateProperties != nil { 1083 objectMap["properties"] = acoup.APICreateOrUpdateProperties 1084 } 1085 return json.Marshal(objectMap) 1086} 1087 1088// UnmarshalJSON is the custom unmarshaler for APICreateOrUpdateParameter struct. 1089func (acoup *APICreateOrUpdateParameter) UnmarshalJSON(body []byte) error { 1090 var m map[string]*json.RawMessage 1091 err := json.Unmarshal(body, &m) 1092 if err != nil { 1093 return err 1094 } 1095 for k, v := range m { 1096 switch k { 1097 case "properties": 1098 if v != nil { 1099 var APICreateOrUpdateProperties APICreateOrUpdateProperties 1100 err = json.Unmarshal(*v, &APICreateOrUpdateProperties) 1101 if err != nil { 1102 return err 1103 } 1104 acoup.APICreateOrUpdateProperties = &APICreateOrUpdateProperties 1105 } 1106 } 1107 } 1108 1109 return nil 1110} 1111 1112// APICreateOrUpdateProperties api Create or Update Properties. 1113type APICreateOrUpdateProperties struct { 1114 // ContentValue - Content value when Importing an API. 1115 ContentValue *string `json:"contentValue,omitempty"` 1116 // ContentFormat - Format of the Content in which the API is getting imported. Possible values include: 'WadlXML', 'WadlLinkJSON', 'SwaggerJSON', 'SwaggerLinkJSON', 'Wsdl', 'WsdlLink', 'Openapi', 'Openapijson', 'OpenapiLink' 1117 ContentFormat ContentFormat `json:"contentFormat,omitempty"` 1118 // WsdlSelector - Criteria to limit import of WSDL to a subset of the document. 1119 WsdlSelector *APICreateOrUpdatePropertiesWsdlSelector `json:"wsdlSelector,omitempty"` 1120 // SoapAPIType - Type of Api to create. 1121 // * `http` creates a SOAP to REST API 1122 // * `soap` creates a SOAP pass-through API. Possible values include: 'SoapToRest', 'SoapPassThrough' 1123 SoapAPIType SoapAPIType `json:"apiType,omitempty"` 1124 // DisplayName - API name. 1125 DisplayName *string `json:"displayName,omitempty"` 1126 // ServiceURL - Absolute URL of the backend service implementing this API. 1127 ServiceURL *string `json:"serviceUrl,omitempty"` 1128 // 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. 1129 Path *string `json:"path,omitempty"` 1130 // Protocols - Describes on which protocols the operations in this API can be invoked. 1131 Protocols *[]Protocol `json:"protocols,omitempty"` 1132 APIVersionSet *APIVersionSetContractDetails `json:"apiVersionSet,omitempty"` 1133 // Description - Description of the API. May include HTML formatting tags. 1134 Description *string `json:"description,omitempty"` 1135 // AuthenticationSettings - Collection of authentication settings included into this API. 1136 AuthenticationSettings *AuthenticationSettingsContract `json:"authenticationSettings,omitempty"` 1137 // SubscriptionKeyParameterNames - Protocols over which API is made available. 1138 SubscriptionKeyParameterNames *SubscriptionKeyParameterNamesContract `json:"subscriptionKeyParameterNames,omitempty"` 1139 // APIType - Type of API. Possible values include: 'HTTP', 'Soap' 1140 APIType APIType `json:"type,omitempty"` 1141 // APIRevision - Describes the Revision of the Api. If no value is provided, default revision 1 is created 1142 APIRevision *string `json:"apiRevision,omitempty"` 1143 // APIVersion - Indicates the Version identifier of the API if the API is versioned 1144 APIVersion *string `json:"apiVersion,omitempty"` 1145 // IsCurrent - READ-ONLY; Indicates if API revision is current api revision. 1146 IsCurrent *bool `json:"isCurrent,omitempty"` 1147 // IsOnline - READ-ONLY; Indicates if API revision is accessible via the gateway. 1148 IsOnline *bool `json:"isOnline,omitempty"` 1149 // APIRevisionDescription - Description of the Api Revision. 1150 APIRevisionDescription *string `json:"apiRevisionDescription,omitempty"` 1151 // APIVersionDescription - Description of the Api Version. 1152 APIVersionDescription *string `json:"apiVersionDescription,omitempty"` 1153 // APIVersionSetID - A resource identifier for the related ApiVersionSet. 1154 APIVersionSetID *string `json:"apiVersionSetId,omitempty"` 1155 // SubscriptionRequired - Specifies whether an API or Product subscription is required for accessing the API. 1156 SubscriptionRequired *bool `json:"subscriptionRequired,omitempty"` 1157} 1158 1159// APICreateOrUpdatePropertiesWsdlSelector criteria to limit import of WSDL to a subset of the document. 1160type APICreateOrUpdatePropertiesWsdlSelector struct { 1161 // WsdlServiceName - Name of service to import from WSDL 1162 WsdlServiceName *string `json:"wsdlServiceName,omitempty"` 1163 // WsdlEndpointName - Name of endpoint(port) to import from WSDL 1164 WsdlEndpointName *string `json:"wsdlEndpointName,omitempty"` 1165} 1166 1167// APIEntityBaseContract API base contract details. 1168type APIEntityBaseContract struct { 1169 // Description - Description of the API. May include HTML formatting tags. 1170 Description *string `json:"description,omitempty"` 1171 // AuthenticationSettings - Collection of authentication settings included into this API. 1172 AuthenticationSettings *AuthenticationSettingsContract `json:"authenticationSettings,omitempty"` 1173 // SubscriptionKeyParameterNames - Protocols over which API is made available. 1174 SubscriptionKeyParameterNames *SubscriptionKeyParameterNamesContract `json:"subscriptionKeyParameterNames,omitempty"` 1175 // APIType - Type of API. Possible values include: 'HTTP', 'Soap' 1176 APIType APIType `json:"type,omitempty"` 1177 // APIRevision - Describes the Revision of the Api. If no value is provided, default revision 1 is created 1178 APIRevision *string `json:"apiRevision,omitempty"` 1179 // APIVersion - Indicates the Version identifier of the API if the API is versioned 1180 APIVersion *string `json:"apiVersion,omitempty"` 1181 // IsCurrent - READ-ONLY; Indicates if API revision is current api revision. 1182 IsCurrent *bool `json:"isCurrent,omitempty"` 1183 // IsOnline - READ-ONLY; Indicates if API revision is accessible via the gateway. 1184 IsOnline *bool `json:"isOnline,omitempty"` 1185 // APIRevisionDescription - Description of the Api Revision. 1186 APIRevisionDescription *string `json:"apiRevisionDescription,omitempty"` 1187 // APIVersionDescription - Description of the Api Version. 1188 APIVersionDescription *string `json:"apiVersionDescription,omitempty"` 1189 // APIVersionSetID - A resource identifier for the related ApiVersionSet. 1190 APIVersionSetID *string `json:"apiVersionSetId,omitempty"` 1191 // SubscriptionRequired - Specifies whether an API or Product subscription is required for accessing the API. 1192 SubscriptionRequired *bool `json:"subscriptionRequired,omitempty"` 1193} 1194 1195// APIExportResult API Export result Blob Uri. 1196type APIExportResult struct { 1197 autorest.Response `json:"-"` 1198 // Link - Link to the Storage Blob containing the result of the export operation. The Blob Uri is only valid for 5 minutes. 1199 Link *string `json:"link,omitempty"` 1200} 1201 1202// ApimResource the Resource definition. 1203type ApimResource struct { 1204 // ID - READ-ONLY; Resource ID. 1205 ID *string `json:"id,omitempty"` 1206 // Name - READ-ONLY; Resource name. 1207 Name *string `json:"name,omitempty"` 1208 // Type - READ-ONLY; Resource type for API Management resource is set to Microsoft.ApiManagement. 1209 Type *string `json:"type,omitempty"` 1210 // Tags - Resource tags. 1211 Tags map[string]*string `json:"tags"` 1212} 1213 1214// MarshalJSON is the custom marshaler for ApimResource. 1215func (ar ApimResource) MarshalJSON() ([]byte, error) { 1216 objectMap := make(map[string]interface{}) 1217 if ar.Tags != nil { 1218 objectMap["tags"] = ar.Tags 1219 } 1220 return json.Marshal(objectMap) 1221} 1222 1223// APIReleaseCollection paged Api Revision list representation. 1224type APIReleaseCollection struct { 1225 autorest.Response `json:"-"` 1226 // Value - READ-ONLY; Page values. 1227 Value *[]APIReleaseContract `json:"value,omitempty"` 1228 // NextLink - READ-ONLY; Next page link if any. 1229 NextLink *string `json:"nextLink,omitempty"` 1230} 1231 1232// APIReleaseCollectionIterator provides access to a complete listing of APIReleaseContract values. 1233type APIReleaseCollectionIterator struct { 1234 i int 1235 page APIReleaseCollectionPage 1236} 1237 1238// NextWithContext advances to the next value. If there was an error making 1239// the request the iterator does not advance and the error is returned. 1240func (iter *APIReleaseCollectionIterator) NextWithContext(ctx context.Context) (err error) { 1241 if tracing.IsEnabled() { 1242 ctx = tracing.StartSpan(ctx, fqdn+"/APIReleaseCollectionIterator.NextWithContext") 1243 defer func() { 1244 sc := -1 1245 if iter.Response().Response.Response != nil { 1246 sc = iter.Response().Response.Response.StatusCode 1247 } 1248 tracing.EndSpan(ctx, sc, err) 1249 }() 1250 } 1251 iter.i++ 1252 if iter.i < len(iter.page.Values()) { 1253 return nil 1254 } 1255 err = iter.page.NextWithContext(ctx) 1256 if err != nil { 1257 iter.i-- 1258 return err 1259 } 1260 iter.i = 0 1261 return nil 1262} 1263 1264// Next advances to the next value. If there was an error making 1265// the request the iterator does not advance and the error is returned. 1266// Deprecated: Use NextWithContext() instead. 1267func (iter *APIReleaseCollectionIterator) Next() error { 1268 return iter.NextWithContext(context.Background()) 1269} 1270 1271// NotDone returns true if the enumeration should be started or is not yet complete. 1272func (iter APIReleaseCollectionIterator) NotDone() bool { 1273 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 1274} 1275 1276// Response returns the raw server response from the last page request. 1277func (iter APIReleaseCollectionIterator) Response() APIReleaseCollection { 1278 return iter.page.Response() 1279} 1280 1281// Value returns the current value or a zero-initialized value if the 1282// iterator has advanced beyond the end of the collection. 1283func (iter APIReleaseCollectionIterator) Value() APIReleaseContract { 1284 if !iter.page.NotDone() { 1285 return APIReleaseContract{} 1286 } 1287 return iter.page.Values()[iter.i] 1288} 1289 1290// Creates a new instance of the APIReleaseCollectionIterator type. 1291func NewAPIReleaseCollectionIterator(page APIReleaseCollectionPage) APIReleaseCollectionIterator { 1292 return APIReleaseCollectionIterator{page: page} 1293} 1294 1295// IsEmpty returns true if the ListResult contains no values. 1296func (arc APIReleaseCollection) IsEmpty() bool { 1297 return arc.Value == nil || len(*arc.Value) == 0 1298} 1299 1300// aPIReleaseCollectionPreparer prepares a request to retrieve the next set of results. 1301// It returns nil if no more results exist. 1302func (arc APIReleaseCollection) aPIReleaseCollectionPreparer(ctx context.Context) (*http.Request, error) { 1303 if arc.NextLink == nil || len(to.String(arc.NextLink)) < 1 { 1304 return nil, nil 1305 } 1306 return autorest.Prepare((&http.Request{}).WithContext(ctx), 1307 autorest.AsJSON(), 1308 autorest.AsGet(), 1309 autorest.WithBaseURL(to.String(arc.NextLink))) 1310} 1311 1312// APIReleaseCollectionPage contains a page of APIReleaseContract values. 1313type APIReleaseCollectionPage struct { 1314 fn func(context.Context, APIReleaseCollection) (APIReleaseCollection, error) 1315 arc APIReleaseCollection 1316} 1317 1318// NextWithContext advances to the next page of values. If there was an error making 1319// the request the page does not advance and the error is returned. 1320func (page *APIReleaseCollectionPage) NextWithContext(ctx context.Context) (err error) { 1321 if tracing.IsEnabled() { 1322 ctx = tracing.StartSpan(ctx, fqdn+"/APIReleaseCollectionPage.NextWithContext") 1323 defer func() { 1324 sc := -1 1325 if page.Response().Response.Response != nil { 1326 sc = page.Response().Response.Response.StatusCode 1327 } 1328 tracing.EndSpan(ctx, sc, err) 1329 }() 1330 } 1331 next, err := page.fn(ctx, page.arc) 1332 if err != nil { 1333 return err 1334 } 1335 page.arc = next 1336 return nil 1337} 1338 1339// Next advances to the next page of values. If there was an error making 1340// the request the page does not advance and the error is returned. 1341// Deprecated: Use NextWithContext() instead. 1342func (page *APIReleaseCollectionPage) Next() error { 1343 return page.NextWithContext(context.Background()) 1344} 1345 1346// NotDone returns true if the page enumeration should be started or is not yet complete. 1347func (page APIReleaseCollectionPage) NotDone() bool { 1348 return !page.arc.IsEmpty() 1349} 1350 1351// Response returns the raw server response from the last page request. 1352func (page APIReleaseCollectionPage) Response() APIReleaseCollection { 1353 return page.arc 1354} 1355 1356// Values returns the slice of values for the current page or nil if there are no values. 1357func (page APIReleaseCollectionPage) Values() []APIReleaseContract { 1358 if page.arc.IsEmpty() { 1359 return nil 1360 } 1361 return *page.arc.Value 1362} 1363 1364// Creates a new instance of the APIReleaseCollectionPage type. 1365func NewAPIReleaseCollectionPage(getNextPage func(context.Context, APIReleaseCollection) (APIReleaseCollection, error)) APIReleaseCollectionPage { 1366 return APIReleaseCollectionPage{fn: getNextPage} 1367} 1368 1369// APIReleaseContract api Release details. 1370type APIReleaseContract struct { 1371 autorest.Response `json:"-"` 1372 // APIReleaseContractProperties - Properties of the Api Release Contract. 1373 *APIReleaseContractProperties `json:"properties,omitempty"` 1374 // ID - READ-ONLY; Resource ID. 1375 ID *string `json:"id,omitempty"` 1376 // Name - READ-ONLY; Resource name. 1377 Name *string `json:"name,omitempty"` 1378 // Type - READ-ONLY; Resource type for API Management resource. 1379 Type *string `json:"type,omitempty"` 1380} 1381 1382// MarshalJSON is the custom marshaler for APIReleaseContract. 1383func (arc APIReleaseContract) MarshalJSON() ([]byte, error) { 1384 objectMap := make(map[string]interface{}) 1385 if arc.APIReleaseContractProperties != nil { 1386 objectMap["properties"] = arc.APIReleaseContractProperties 1387 } 1388 return json.Marshal(objectMap) 1389} 1390 1391// UnmarshalJSON is the custom unmarshaler for APIReleaseContract struct. 1392func (arc *APIReleaseContract) UnmarshalJSON(body []byte) error { 1393 var m map[string]*json.RawMessage 1394 err := json.Unmarshal(body, &m) 1395 if err != nil { 1396 return err 1397 } 1398 for k, v := range m { 1399 switch k { 1400 case "properties": 1401 if v != nil { 1402 var APIReleaseContractProperties APIReleaseContractProperties 1403 err = json.Unmarshal(*v, &APIReleaseContractProperties) 1404 if err != nil { 1405 return err 1406 } 1407 arc.APIReleaseContractProperties = &APIReleaseContractProperties 1408 } 1409 case "id": 1410 if v != nil { 1411 var ID string 1412 err = json.Unmarshal(*v, &ID) 1413 if err != nil { 1414 return err 1415 } 1416 arc.ID = &ID 1417 } 1418 case "name": 1419 if v != nil { 1420 var name string 1421 err = json.Unmarshal(*v, &name) 1422 if err != nil { 1423 return err 1424 } 1425 arc.Name = &name 1426 } 1427 case "type": 1428 if v != nil { 1429 var typeVar string 1430 err = json.Unmarshal(*v, &typeVar) 1431 if err != nil { 1432 return err 1433 } 1434 arc.Type = &typeVar 1435 } 1436 } 1437 } 1438 1439 return nil 1440} 1441 1442// APIReleaseContractProperties API Release details 1443type APIReleaseContractProperties struct { 1444 // APIID - Identifier of the API the release belongs to. 1445 APIID *string `json:"apiId,omitempty"` 1446 // CreatedDateTime - READ-ONLY; The time the API was released. The date conforms to the following format: yyyy-MM-ddTHH:mm:ssZ as specified by the ISO 8601 standard. 1447 CreatedDateTime *date.Time `json:"createdDateTime,omitempty"` 1448 // UpdatedDateTime - READ-ONLY; The time the API release was updated. 1449 UpdatedDateTime *date.Time `json:"updatedDateTime,omitempty"` 1450 // Notes - Release Notes 1451 Notes *string `json:"notes,omitempty"` 1452} 1453 1454// APIRevisionCollection paged Api Revision list representation. 1455type APIRevisionCollection struct { 1456 autorest.Response `json:"-"` 1457 // Value - READ-ONLY; Page values. 1458 Value *[]APIRevisionContract `json:"value,omitempty"` 1459 // NextLink - READ-ONLY; Next page link if any. 1460 NextLink *string `json:"nextLink,omitempty"` 1461} 1462 1463// APIRevisionCollectionIterator provides access to a complete listing of APIRevisionContract values. 1464type APIRevisionCollectionIterator struct { 1465 i int 1466 page APIRevisionCollectionPage 1467} 1468 1469// NextWithContext advances to the next value. If there was an error making 1470// the request the iterator does not advance and the error is returned. 1471func (iter *APIRevisionCollectionIterator) NextWithContext(ctx context.Context) (err error) { 1472 if tracing.IsEnabled() { 1473 ctx = tracing.StartSpan(ctx, fqdn+"/APIRevisionCollectionIterator.NextWithContext") 1474 defer func() { 1475 sc := -1 1476 if iter.Response().Response.Response != nil { 1477 sc = iter.Response().Response.Response.StatusCode 1478 } 1479 tracing.EndSpan(ctx, sc, err) 1480 }() 1481 } 1482 iter.i++ 1483 if iter.i < len(iter.page.Values()) { 1484 return nil 1485 } 1486 err = iter.page.NextWithContext(ctx) 1487 if err != nil { 1488 iter.i-- 1489 return err 1490 } 1491 iter.i = 0 1492 return nil 1493} 1494 1495// Next advances to the next value. If there was an error making 1496// the request the iterator does not advance and the error is returned. 1497// Deprecated: Use NextWithContext() instead. 1498func (iter *APIRevisionCollectionIterator) Next() error { 1499 return iter.NextWithContext(context.Background()) 1500} 1501 1502// NotDone returns true if the enumeration should be started or is not yet complete. 1503func (iter APIRevisionCollectionIterator) NotDone() bool { 1504 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 1505} 1506 1507// Response returns the raw server response from the last page request. 1508func (iter APIRevisionCollectionIterator) Response() APIRevisionCollection { 1509 return iter.page.Response() 1510} 1511 1512// Value returns the current value or a zero-initialized value if the 1513// iterator has advanced beyond the end of the collection. 1514func (iter APIRevisionCollectionIterator) Value() APIRevisionContract { 1515 if !iter.page.NotDone() { 1516 return APIRevisionContract{} 1517 } 1518 return iter.page.Values()[iter.i] 1519} 1520 1521// Creates a new instance of the APIRevisionCollectionIterator type. 1522func NewAPIRevisionCollectionIterator(page APIRevisionCollectionPage) APIRevisionCollectionIterator { 1523 return APIRevisionCollectionIterator{page: page} 1524} 1525 1526// IsEmpty returns true if the ListResult contains no values. 1527func (arc APIRevisionCollection) IsEmpty() bool { 1528 return arc.Value == nil || len(*arc.Value) == 0 1529} 1530 1531// aPIRevisionCollectionPreparer prepares a request to retrieve the next set of results. 1532// It returns nil if no more results exist. 1533func (arc APIRevisionCollection) aPIRevisionCollectionPreparer(ctx context.Context) (*http.Request, error) { 1534 if arc.NextLink == nil || len(to.String(arc.NextLink)) < 1 { 1535 return nil, nil 1536 } 1537 return autorest.Prepare((&http.Request{}).WithContext(ctx), 1538 autorest.AsJSON(), 1539 autorest.AsGet(), 1540 autorest.WithBaseURL(to.String(arc.NextLink))) 1541} 1542 1543// APIRevisionCollectionPage contains a page of APIRevisionContract values. 1544type APIRevisionCollectionPage struct { 1545 fn func(context.Context, APIRevisionCollection) (APIRevisionCollection, error) 1546 arc APIRevisionCollection 1547} 1548 1549// NextWithContext advances to the next page of values. If there was an error making 1550// the request the page does not advance and the error is returned. 1551func (page *APIRevisionCollectionPage) NextWithContext(ctx context.Context) (err error) { 1552 if tracing.IsEnabled() { 1553 ctx = tracing.StartSpan(ctx, fqdn+"/APIRevisionCollectionPage.NextWithContext") 1554 defer func() { 1555 sc := -1 1556 if page.Response().Response.Response != nil { 1557 sc = page.Response().Response.Response.StatusCode 1558 } 1559 tracing.EndSpan(ctx, sc, err) 1560 }() 1561 } 1562 next, err := page.fn(ctx, page.arc) 1563 if err != nil { 1564 return err 1565 } 1566 page.arc = next 1567 return nil 1568} 1569 1570// Next advances to the next page of values. If there was an error making 1571// the request the page does not advance and the error is returned. 1572// Deprecated: Use NextWithContext() instead. 1573func (page *APIRevisionCollectionPage) Next() error { 1574 return page.NextWithContext(context.Background()) 1575} 1576 1577// NotDone returns true if the page enumeration should be started or is not yet complete. 1578func (page APIRevisionCollectionPage) NotDone() bool { 1579 return !page.arc.IsEmpty() 1580} 1581 1582// Response returns the raw server response from the last page request. 1583func (page APIRevisionCollectionPage) Response() APIRevisionCollection { 1584 return page.arc 1585} 1586 1587// Values returns the slice of values for the current page or nil if there are no values. 1588func (page APIRevisionCollectionPage) Values() []APIRevisionContract { 1589 if page.arc.IsEmpty() { 1590 return nil 1591 } 1592 return *page.arc.Value 1593} 1594 1595// Creates a new instance of the APIRevisionCollectionPage type. 1596func NewAPIRevisionCollectionPage(getNextPage func(context.Context, APIRevisionCollection) (APIRevisionCollection, error)) APIRevisionCollectionPage { 1597 return APIRevisionCollectionPage{fn: getNextPage} 1598} 1599 1600// APIRevisionContract summary of revision metadata. 1601type APIRevisionContract struct { 1602 // APIID - READ-ONLY; Identifier of the API Revision. 1603 APIID *string `json:"apiId,omitempty"` 1604 // APIRevision - READ-ONLY; Revision number of API. 1605 APIRevision *string `json:"apiRevision,omitempty"` 1606 // CreatedDateTime - READ-ONLY; The time the API Revision was created. The date conforms to the following format: yyyy-MM-ddTHH:mm:ssZ as specified by the ISO 8601 standard. 1607 CreatedDateTime *date.Time `json:"createdDateTime,omitempty"` 1608 // UpdatedDateTime - READ-ONLY; The time the API Revision were updated. The date conforms to the following format: yyyy-MM-ddTHH:mm:ssZ as specified by the ISO 8601 standard. 1609 UpdatedDateTime *date.Time `json:"updatedDateTime,omitempty"` 1610 // Description - READ-ONLY; Description of the API Revision. 1611 Description *string `json:"description,omitempty"` 1612 // PrivateURL - READ-ONLY; Gateway URL for accessing the non-current API Revision. 1613 PrivateURL *string `json:"privateUrl,omitempty"` 1614 // IsOnline - READ-ONLY; Indicates if API revision is the current api revision. 1615 IsOnline *bool `json:"isOnline,omitempty"` 1616 // IsCurrent - READ-ONLY; Indicates if API revision is accessible via the gateway. 1617 IsCurrent *bool `json:"isCurrent,omitempty"` 1618} 1619 1620// APIRevisionInfoContract object used to create an API Revision or Version based on an existing API 1621// Revision 1622type APIRevisionInfoContract struct { 1623 // SourceAPIID - Resource identifier of API to be used to create the revision from. 1624 SourceAPIID *string `json:"sourceApiId,omitempty"` 1625 // APIVersionName - Version identifier for the new API Version. 1626 APIVersionName *string `json:"apiVersionName,omitempty"` 1627 // APIRevisionDescription - Description of new API Revision. 1628 APIRevisionDescription *string `json:"apiRevisionDescription,omitempty"` 1629 // APIVersionSet - Version set details 1630 APIVersionSet *APIVersionSetContractDetails `json:"apiVersionSet,omitempty"` 1631} 1632 1633// APITagResourceContractProperties API contract properties for the Tag Resources. 1634type APITagResourceContractProperties struct { 1635 // ID - API identifier in the form /apis/{apiId}. 1636 ID *string `json:"id,omitempty"` 1637 // Name - API name. 1638 Name *string `json:"name,omitempty"` 1639 // ServiceURL - Absolute URL of the backend service implementing this API. 1640 ServiceURL *string `json:"serviceUrl,omitempty"` 1641 // 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. 1642 Path *string `json:"path,omitempty"` 1643 // Protocols - Describes on which protocols the operations in this API can be invoked. 1644 Protocols *[]Protocol `json:"protocols,omitempty"` 1645 // Description - Description of the API. May include HTML formatting tags. 1646 Description *string `json:"description,omitempty"` 1647 // AuthenticationSettings - Collection of authentication settings included into this API. 1648 AuthenticationSettings *AuthenticationSettingsContract `json:"authenticationSettings,omitempty"` 1649 // SubscriptionKeyParameterNames - Protocols over which API is made available. 1650 SubscriptionKeyParameterNames *SubscriptionKeyParameterNamesContract `json:"subscriptionKeyParameterNames,omitempty"` 1651 // APIType - Type of API. Possible values include: 'HTTP', 'Soap' 1652 APIType APIType `json:"type,omitempty"` 1653 // APIRevision - Describes the Revision of the Api. If no value is provided, default revision 1 is created 1654 APIRevision *string `json:"apiRevision,omitempty"` 1655 // APIVersion - Indicates the Version identifier of the API if the API is versioned 1656 APIVersion *string `json:"apiVersion,omitempty"` 1657 // IsCurrent - READ-ONLY; Indicates if API revision is current api revision. 1658 IsCurrent *bool `json:"isCurrent,omitempty"` 1659 // IsOnline - READ-ONLY; Indicates if API revision is accessible via the gateway. 1660 IsOnline *bool `json:"isOnline,omitempty"` 1661 // APIRevisionDescription - Description of the Api Revision. 1662 APIRevisionDescription *string `json:"apiRevisionDescription,omitempty"` 1663 // APIVersionDescription - Description of the Api Version. 1664 APIVersionDescription *string `json:"apiVersionDescription,omitempty"` 1665 // APIVersionSetID - A resource identifier for the related ApiVersionSet. 1666 APIVersionSetID *string `json:"apiVersionSetId,omitempty"` 1667 // SubscriptionRequired - Specifies whether an API or Product subscription is required for accessing the API. 1668 SubscriptionRequired *bool `json:"subscriptionRequired,omitempty"` 1669} 1670 1671// APIUpdateContract API update contract details. 1672type APIUpdateContract struct { 1673 // APIContractUpdateProperties - Properties of the API entity that can be updated. 1674 *APIContractUpdateProperties `json:"properties,omitempty"` 1675} 1676 1677// MarshalJSON is the custom marshaler for APIUpdateContract. 1678func (auc APIUpdateContract) MarshalJSON() ([]byte, error) { 1679 objectMap := make(map[string]interface{}) 1680 if auc.APIContractUpdateProperties != nil { 1681 objectMap["properties"] = auc.APIContractUpdateProperties 1682 } 1683 return json.Marshal(objectMap) 1684} 1685 1686// UnmarshalJSON is the custom unmarshaler for APIUpdateContract struct. 1687func (auc *APIUpdateContract) UnmarshalJSON(body []byte) error { 1688 var m map[string]*json.RawMessage 1689 err := json.Unmarshal(body, &m) 1690 if err != nil { 1691 return err 1692 } 1693 for k, v := range m { 1694 switch k { 1695 case "properties": 1696 if v != nil { 1697 var APIContractUpdateProperties APIContractUpdateProperties 1698 err = json.Unmarshal(*v, &APIContractUpdateProperties) 1699 if err != nil { 1700 return err 1701 } 1702 auc.APIContractUpdateProperties = &APIContractUpdateProperties 1703 } 1704 } 1705 } 1706 1707 return nil 1708} 1709 1710// APIVersionSetCollection paged Api Version Set list representation. 1711type APIVersionSetCollection struct { 1712 autorest.Response `json:"-"` 1713 // Value - Page values. 1714 Value *[]APIVersionSetContract `json:"value,omitempty"` 1715 // NextLink - Next page link if any. 1716 NextLink *string `json:"nextLink,omitempty"` 1717} 1718 1719// APIVersionSetCollectionIterator provides access to a complete listing of APIVersionSetContract values. 1720type APIVersionSetCollectionIterator struct { 1721 i int 1722 page APIVersionSetCollectionPage 1723} 1724 1725// NextWithContext advances to the next value. If there was an error making 1726// the request the iterator does not advance and the error is returned. 1727func (iter *APIVersionSetCollectionIterator) NextWithContext(ctx context.Context) (err error) { 1728 if tracing.IsEnabled() { 1729 ctx = tracing.StartSpan(ctx, fqdn+"/APIVersionSetCollectionIterator.NextWithContext") 1730 defer func() { 1731 sc := -1 1732 if iter.Response().Response.Response != nil { 1733 sc = iter.Response().Response.Response.StatusCode 1734 } 1735 tracing.EndSpan(ctx, sc, err) 1736 }() 1737 } 1738 iter.i++ 1739 if iter.i < len(iter.page.Values()) { 1740 return nil 1741 } 1742 err = iter.page.NextWithContext(ctx) 1743 if err != nil { 1744 iter.i-- 1745 return err 1746 } 1747 iter.i = 0 1748 return nil 1749} 1750 1751// Next advances to the next value. If there was an error making 1752// the request the iterator does not advance and the error is returned. 1753// Deprecated: Use NextWithContext() instead. 1754func (iter *APIVersionSetCollectionIterator) Next() error { 1755 return iter.NextWithContext(context.Background()) 1756} 1757 1758// NotDone returns true if the enumeration should be started or is not yet complete. 1759func (iter APIVersionSetCollectionIterator) NotDone() bool { 1760 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 1761} 1762 1763// Response returns the raw server response from the last page request. 1764func (iter APIVersionSetCollectionIterator) Response() APIVersionSetCollection { 1765 return iter.page.Response() 1766} 1767 1768// Value returns the current value or a zero-initialized value if the 1769// iterator has advanced beyond the end of the collection. 1770func (iter APIVersionSetCollectionIterator) Value() APIVersionSetContract { 1771 if !iter.page.NotDone() { 1772 return APIVersionSetContract{} 1773 } 1774 return iter.page.Values()[iter.i] 1775} 1776 1777// Creates a new instance of the APIVersionSetCollectionIterator type. 1778func NewAPIVersionSetCollectionIterator(page APIVersionSetCollectionPage) APIVersionSetCollectionIterator { 1779 return APIVersionSetCollectionIterator{page: page} 1780} 1781 1782// IsEmpty returns true if the ListResult contains no values. 1783func (avsc APIVersionSetCollection) IsEmpty() bool { 1784 return avsc.Value == nil || len(*avsc.Value) == 0 1785} 1786 1787// aPIVersionSetCollectionPreparer prepares a request to retrieve the next set of results. 1788// It returns nil if no more results exist. 1789func (avsc APIVersionSetCollection) aPIVersionSetCollectionPreparer(ctx context.Context) (*http.Request, error) { 1790 if avsc.NextLink == nil || len(to.String(avsc.NextLink)) < 1 { 1791 return nil, nil 1792 } 1793 return autorest.Prepare((&http.Request{}).WithContext(ctx), 1794 autorest.AsJSON(), 1795 autorest.AsGet(), 1796 autorest.WithBaseURL(to.String(avsc.NextLink))) 1797} 1798 1799// APIVersionSetCollectionPage contains a page of APIVersionSetContract values. 1800type APIVersionSetCollectionPage struct { 1801 fn func(context.Context, APIVersionSetCollection) (APIVersionSetCollection, error) 1802 avsc APIVersionSetCollection 1803} 1804 1805// NextWithContext advances to the next page of values. If there was an error making 1806// the request the page does not advance and the error is returned. 1807func (page *APIVersionSetCollectionPage) NextWithContext(ctx context.Context) (err error) { 1808 if tracing.IsEnabled() { 1809 ctx = tracing.StartSpan(ctx, fqdn+"/APIVersionSetCollectionPage.NextWithContext") 1810 defer func() { 1811 sc := -1 1812 if page.Response().Response.Response != nil { 1813 sc = page.Response().Response.Response.StatusCode 1814 } 1815 tracing.EndSpan(ctx, sc, err) 1816 }() 1817 } 1818 next, err := page.fn(ctx, page.avsc) 1819 if err != nil { 1820 return err 1821 } 1822 page.avsc = next 1823 return nil 1824} 1825 1826// Next advances to the next page of values. If there was an error making 1827// the request the page does not advance and the error is returned. 1828// Deprecated: Use NextWithContext() instead. 1829func (page *APIVersionSetCollectionPage) Next() error { 1830 return page.NextWithContext(context.Background()) 1831} 1832 1833// NotDone returns true if the page enumeration should be started or is not yet complete. 1834func (page APIVersionSetCollectionPage) NotDone() bool { 1835 return !page.avsc.IsEmpty() 1836} 1837 1838// Response returns the raw server response from the last page request. 1839func (page APIVersionSetCollectionPage) Response() APIVersionSetCollection { 1840 return page.avsc 1841} 1842 1843// Values returns the slice of values for the current page or nil if there are no values. 1844func (page APIVersionSetCollectionPage) Values() []APIVersionSetContract { 1845 if page.avsc.IsEmpty() { 1846 return nil 1847 } 1848 return *page.avsc.Value 1849} 1850 1851// Creates a new instance of the APIVersionSetCollectionPage type. 1852func NewAPIVersionSetCollectionPage(getNextPage func(context.Context, APIVersionSetCollection) (APIVersionSetCollection, error)) APIVersionSetCollectionPage { 1853 return APIVersionSetCollectionPage{fn: getNextPage} 1854} 1855 1856// APIVersionSetContract api Version Set Contract details. 1857type APIVersionSetContract struct { 1858 autorest.Response `json:"-"` 1859 // APIVersionSetContractProperties - Api VersionSet contract properties. 1860 *APIVersionSetContractProperties `json:"properties,omitempty"` 1861 // ID - READ-ONLY; Resource ID. 1862 ID *string `json:"id,omitempty"` 1863 // Name - READ-ONLY; Resource name. 1864 Name *string `json:"name,omitempty"` 1865 // Type - READ-ONLY; Resource type for API Management resource. 1866 Type *string `json:"type,omitempty"` 1867} 1868 1869// MarshalJSON is the custom marshaler for APIVersionSetContract. 1870func (avsc APIVersionSetContract) MarshalJSON() ([]byte, error) { 1871 objectMap := make(map[string]interface{}) 1872 if avsc.APIVersionSetContractProperties != nil { 1873 objectMap["properties"] = avsc.APIVersionSetContractProperties 1874 } 1875 return json.Marshal(objectMap) 1876} 1877 1878// UnmarshalJSON is the custom unmarshaler for APIVersionSetContract struct. 1879func (avsc *APIVersionSetContract) UnmarshalJSON(body []byte) error { 1880 var m map[string]*json.RawMessage 1881 err := json.Unmarshal(body, &m) 1882 if err != nil { 1883 return err 1884 } 1885 for k, v := range m { 1886 switch k { 1887 case "properties": 1888 if v != nil { 1889 var APIVersionSetContractProperties APIVersionSetContractProperties 1890 err = json.Unmarshal(*v, &APIVersionSetContractProperties) 1891 if err != nil { 1892 return err 1893 } 1894 avsc.APIVersionSetContractProperties = &APIVersionSetContractProperties 1895 } 1896 case "id": 1897 if v != nil { 1898 var ID string 1899 err = json.Unmarshal(*v, &ID) 1900 if err != nil { 1901 return err 1902 } 1903 avsc.ID = &ID 1904 } 1905 case "name": 1906 if v != nil { 1907 var name string 1908 err = json.Unmarshal(*v, &name) 1909 if err != nil { 1910 return err 1911 } 1912 avsc.Name = &name 1913 } 1914 case "type": 1915 if v != nil { 1916 var typeVar string 1917 err = json.Unmarshal(*v, &typeVar) 1918 if err != nil { 1919 return err 1920 } 1921 avsc.Type = &typeVar 1922 } 1923 } 1924 } 1925 1926 return nil 1927} 1928 1929// APIVersionSetContractDetails an API Version Set contains the common configuration for a set of API 1930// Versions relating 1931type APIVersionSetContractDetails struct { 1932 // ID - Identifier for existing API Version Set. Omit this value to create a new Version Set. 1933 ID *string `json:"id,omitempty"` 1934 // Description - Description of API Version Set. 1935 Description *string `json:"description,omitempty"` 1936 // VersioningScheme - An value that determines where the API Version identifer will be located in a HTTP request. Possible values include: 'VersioningScheme1Segment', 'VersioningScheme1Query', 'VersioningScheme1Header' 1937 VersioningScheme VersioningScheme1 `json:"versioningScheme,omitempty"` 1938 // VersionQueryName - Name of query parameter that indicates the API Version if versioningScheme is set to `query`. 1939 VersionQueryName *string `json:"versionQueryName,omitempty"` 1940 // VersionHeaderName - Name of HTTP header parameter that indicates the API Version if versioningScheme is set to `header`. 1941 VersionHeaderName *string `json:"versionHeaderName,omitempty"` 1942} 1943 1944// APIVersionSetContractProperties properties of an API Version Set. 1945type APIVersionSetContractProperties struct { 1946 // DisplayName - Name of API Version Set 1947 DisplayName *string `json:"displayName,omitempty"` 1948 // VersioningScheme - An value that determines where the API Version identifer will be located in a HTTP request. Possible values include: 'VersioningSchemeSegment', 'VersioningSchemeQuery', 'VersioningSchemeHeader' 1949 VersioningScheme VersioningScheme `json:"versioningScheme,omitempty"` 1950 // Description - Description of API Version Set. 1951 Description *string `json:"description,omitempty"` 1952 // VersionQueryName - Name of query parameter that indicates the API Version if versioningScheme is set to `query`. 1953 VersionQueryName *string `json:"versionQueryName,omitempty"` 1954 // VersionHeaderName - Name of HTTP header parameter that indicates the API Version if versioningScheme is set to `header`. 1955 VersionHeaderName *string `json:"versionHeaderName,omitempty"` 1956} 1957 1958// APIVersionSetEntityBase api Version set base parameters 1959type APIVersionSetEntityBase struct { 1960 // Description - Description of API Version Set. 1961 Description *string `json:"description,omitempty"` 1962 // VersionQueryName - Name of query parameter that indicates the API Version if versioningScheme is set to `query`. 1963 VersionQueryName *string `json:"versionQueryName,omitempty"` 1964 // VersionHeaderName - Name of HTTP header parameter that indicates the API Version if versioningScheme is set to `header`. 1965 VersionHeaderName *string `json:"versionHeaderName,omitempty"` 1966} 1967 1968// APIVersionSetUpdateParameters parameters to update or create an Api Version Set Contract. 1969type APIVersionSetUpdateParameters struct { 1970 // APIVersionSetUpdateParametersProperties - Parameters to update or create an Api Version Set Contract. 1971 *APIVersionSetUpdateParametersProperties `json:"properties,omitempty"` 1972} 1973 1974// MarshalJSON is the custom marshaler for APIVersionSetUpdateParameters. 1975func (avsup APIVersionSetUpdateParameters) MarshalJSON() ([]byte, error) { 1976 objectMap := make(map[string]interface{}) 1977 if avsup.APIVersionSetUpdateParametersProperties != nil { 1978 objectMap["properties"] = avsup.APIVersionSetUpdateParametersProperties 1979 } 1980 return json.Marshal(objectMap) 1981} 1982 1983// UnmarshalJSON is the custom unmarshaler for APIVersionSetUpdateParameters struct. 1984func (avsup *APIVersionSetUpdateParameters) UnmarshalJSON(body []byte) error { 1985 var m map[string]*json.RawMessage 1986 err := json.Unmarshal(body, &m) 1987 if err != nil { 1988 return err 1989 } 1990 for k, v := range m { 1991 switch k { 1992 case "properties": 1993 if v != nil { 1994 var APIVersionSetUpdateParametersProperties APIVersionSetUpdateParametersProperties 1995 err = json.Unmarshal(*v, &APIVersionSetUpdateParametersProperties) 1996 if err != nil { 1997 return err 1998 } 1999 avsup.APIVersionSetUpdateParametersProperties = &APIVersionSetUpdateParametersProperties 2000 } 2001 } 2002 } 2003 2004 return nil 2005} 2006 2007// APIVersionSetUpdateParametersProperties properties used to create or update an API Version Set. 2008type APIVersionSetUpdateParametersProperties struct { 2009 // DisplayName - Name of API Version Set 2010 DisplayName *string `json:"displayName,omitempty"` 2011 // VersioningScheme - An value that determines where the API Version identifer will be located in a HTTP request. Possible values include: 'VersioningSchemeSegment', 'VersioningSchemeQuery', 'VersioningSchemeHeader' 2012 VersioningScheme VersioningScheme `json:"versioningScheme,omitempty"` 2013 // Description - Description of API Version Set. 2014 Description *string `json:"description,omitempty"` 2015 // VersionQueryName - Name of query parameter that indicates the API Version if versioningScheme is set to `query`. 2016 VersionQueryName *string `json:"versionQueryName,omitempty"` 2017 // VersionHeaderName - Name of HTTP header parameter that indicates the API Version if versioningScheme is set to `header`. 2018 VersionHeaderName *string `json:"versionHeaderName,omitempty"` 2019} 2020 2021// AuthenticationSettingsContract API Authentication Settings. 2022type AuthenticationSettingsContract struct { 2023 // OAuth2 - OAuth2 Authentication settings 2024 OAuth2 *OAuth2AuthenticationSettingsContract `json:"oAuth2,omitempty"` 2025 // Openid - OpenID Connect Authentication Settings 2026 Openid *OpenIDAuthenticationSettingsContract `json:"openid,omitempty"` 2027 // SubscriptionKeyRequired - Specifies whether subscription key is required during call to this API, true - API is included into closed products only, false - API is included into open products alone, null - there is a mix of products. 2028 SubscriptionKeyRequired *bool `json:"subscriptionKeyRequired,omitempty"` 2029} 2030 2031// AuthorizationServerCollection paged OAuth2 Authorization Servers list representation. 2032type AuthorizationServerCollection struct { 2033 autorest.Response `json:"-"` 2034 // Value - Page values. 2035 Value *[]AuthorizationServerContract `json:"value,omitempty"` 2036 // Count - Total record count number across all pages. 2037 Count *int64 `json:"count,omitempty"` 2038 // NextLink - Next page link if any. 2039 NextLink *string `json:"nextLink,omitempty"` 2040} 2041 2042// AuthorizationServerCollectionIterator provides access to a complete listing of 2043// AuthorizationServerContract values. 2044type AuthorizationServerCollectionIterator struct { 2045 i int 2046 page AuthorizationServerCollectionPage 2047} 2048 2049// NextWithContext advances to the next value. If there was an error making 2050// the request the iterator does not advance and the error is returned. 2051func (iter *AuthorizationServerCollectionIterator) NextWithContext(ctx context.Context) (err error) { 2052 if tracing.IsEnabled() { 2053 ctx = tracing.StartSpan(ctx, fqdn+"/AuthorizationServerCollectionIterator.NextWithContext") 2054 defer func() { 2055 sc := -1 2056 if iter.Response().Response.Response != nil { 2057 sc = iter.Response().Response.Response.StatusCode 2058 } 2059 tracing.EndSpan(ctx, sc, err) 2060 }() 2061 } 2062 iter.i++ 2063 if iter.i < len(iter.page.Values()) { 2064 return nil 2065 } 2066 err = iter.page.NextWithContext(ctx) 2067 if err != nil { 2068 iter.i-- 2069 return err 2070 } 2071 iter.i = 0 2072 return nil 2073} 2074 2075// Next advances to the next value. If there was an error making 2076// the request the iterator does not advance and the error is returned. 2077// Deprecated: Use NextWithContext() instead. 2078func (iter *AuthorizationServerCollectionIterator) Next() error { 2079 return iter.NextWithContext(context.Background()) 2080} 2081 2082// NotDone returns true if the enumeration should be started or is not yet complete. 2083func (iter AuthorizationServerCollectionIterator) NotDone() bool { 2084 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 2085} 2086 2087// Response returns the raw server response from the last page request. 2088func (iter AuthorizationServerCollectionIterator) Response() AuthorizationServerCollection { 2089 return iter.page.Response() 2090} 2091 2092// Value returns the current value or a zero-initialized value if the 2093// iterator has advanced beyond the end of the collection. 2094func (iter AuthorizationServerCollectionIterator) Value() AuthorizationServerContract { 2095 if !iter.page.NotDone() { 2096 return AuthorizationServerContract{} 2097 } 2098 return iter.page.Values()[iter.i] 2099} 2100 2101// Creates a new instance of the AuthorizationServerCollectionIterator type. 2102func NewAuthorizationServerCollectionIterator(page AuthorizationServerCollectionPage) AuthorizationServerCollectionIterator { 2103 return AuthorizationServerCollectionIterator{page: page} 2104} 2105 2106// IsEmpty returns true if the ListResult contains no values. 2107func (asc AuthorizationServerCollection) IsEmpty() bool { 2108 return asc.Value == nil || len(*asc.Value) == 0 2109} 2110 2111// authorizationServerCollectionPreparer prepares a request to retrieve the next set of results. 2112// It returns nil if no more results exist. 2113func (asc AuthorizationServerCollection) authorizationServerCollectionPreparer(ctx context.Context) (*http.Request, error) { 2114 if asc.NextLink == nil || len(to.String(asc.NextLink)) < 1 { 2115 return nil, nil 2116 } 2117 return autorest.Prepare((&http.Request{}).WithContext(ctx), 2118 autorest.AsJSON(), 2119 autorest.AsGet(), 2120 autorest.WithBaseURL(to.String(asc.NextLink))) 2121} 2122 2123// AuthorizationServerCollectionPage contains a page of AuthorizationServerContract values. 2124type AuthorizationServerCollectionPage struct { 2125 fn func(context.Context, AuthorizationServerCollection) (AuthorizationServerCollection, error) 2126 asc AuthorizationServerCollection 2127} 2128 2129// NextWithContext advances to the next page of values. If there was an error making 2130// the request the page does not advance and the error is returned. 2131func (page *AuthorizationServerCollectionPage) NextWithContext(ctx context.Context) (err error) { 2132 if tracing.IsEnabled() { 2133 ctx = tracing.StartSpan(ctx, fqdn+"/AuthorizationServerCollectionPage.NextWithContext") 2134 defer func() { 2135 sc := -1 2136 if page.Response().Response.Response != nil { 2137 sc = page.Response().Response.Response.StatusCode 2138 } 2139 tracing.EndSpan(ctx, sc, err) 2140 }() 2141 } 2142 next, err := page.fn(ctx, page.asc) 2143 if err != nil { 2144 return err 2145 } 2146 page.asc = next 2147 return nil 2148} 2149 2150// Next advances to the next page of values. If there was an error making 2151// the request the page does not advance and the error is returned. 2152// Deprecated: Use NextWithContext() instead. 2153func (page *AuthorizationServerCollectionPage) Next() error { 2154 return page.NextWithContext(context.Background()) 2155} 2156 2157// NotDone returns true if the page enumeration should be started or is not yet complete. 2158func (page AuthorizationServerCollectionPage) NotDone() bool { 2159 return !page.asc.IsEmpty() 2160} 2161 2162// Response returns the raw server response from the last page request. 2163func (page AuthorizationServerCollectionPage) Response() AuthorizationServerCollection { 2164 return page.asc 2165} 2166 2167// Values returns the slice of values for the current page or nil if there are no values. 2168func (page AuthorizationServerCollectionPage) Values() []AuthorizationServerContract { 2169 if page.asc.IsEmpty() { 2170 return nil 2171 } 2172 return *page.asc.Value 2173} 2174 2175// Creates a new instance of the AuthorizationServerCollectionPage type. 2176func NewAuthorizationServerCollectionPage(getNextPage func(context.Context, AuthorizationServerCollection) (AuthorizationServerCollection, error)) AuthorizationServerCollectionPage { 2177 return AuthorizationServerCollectionPage{fn: getNextPage} 2178} 2179 2180// AuthorizationServerContract external OAuth authorization server settings. 2181type AuthorizationServerContract struct { 2182 autorest.Response `json:"-"` 2183 // AuthorizationServerContractProperties - Properties of the External OAuth authorization server Contract. 2184 *AuthorizationServerContractProperties `json:"properties,omitempty"` 2185 // ID - READ-ONLY; Resource ID. 2186 ID *string `json:"id,omitempty"` 2187 // Name - READ-ONLY; Resource name. 2188 Name *string `json:"name,omitempty"` 2189 // Type - READ-ONLY; Resource type for API Management resource. 2190 Type *string `json:"type,omitempty"` 2191} 2192 2193// MarshalJSON is the custom marshaler for AuthorizationServerContract. 2194func (asc AuthorizationServerContract) MarshalJSON() ([]byte, error) { 2195 objectMap := make(map[string]interface{}) 2196 if asc.AuthorizationServerContractProperties != nil { 2197 objectMap["properties"] = asc.AuthorizationServerContractProperties 2198 } 2199 return json.Marshal(objectMap) 2200} 2201 2202// UnmarshalJSON is the custom unmarshaler for AuthorizationServerContract struct. 2203func (asc *AuthorizationServerContract) UnmarshalJSON(body []byte) error { 2204 var m map[string]*json.RawMessage 2205 err := json.Unmarshal(body, &m) 2206 if err != nil { 2207 return err 2208 } 2209 for k, v := range m { 2210 switch k { 2211 case "properties": 2212 if v != nil { 2213 var authorizationServerContractProperties AuthorizationServerContractProperties 2214 err = json.Unmarshal(*v, &authorizationServerContractProperties) 2215 if err != nil { 2216 return err 2217 } 2218 asc.AuthorizationServerContractProperties = &authorizationServerContractProperties 2219 } 2220 case "id": 2221 if v != nil { 2222 var ID string 2223 err = json.Unmarshal(*v, &ID) 2224 if err != nil { 2225 return err 2226 } 2227 asc.ID = &ID 2228 } 2229 case "name": 2230 if v != nil { 2231 var name string 2232 err = json.Unmarshal(*v, &name) 2233 if err != nil { 2234 return err 2235 } 2236 asc.Name = &name 2237 } 2238 case "type": 2239 if v != nil { 2240 var typeVar string 2241 err = json.Unmarshal(*v, &typeVar) 2242 if err != nil { 2243 return err 2244 } 2245 asc.Type = &typeVar 2246 } 2247 } 2248 } 2249 2250 return nil 2251} 2252 2253// AuthorizationServerContractBaseProperties external OAuth authorization server Update settings contract. 2254type AuthorizationServerContractBaseProperties struct { 2255 // Description - Description of the authorization server. Can contain HTML formatting tags. 2256 Description *string `json:"description,omitempty"` 2257 // AuthorizationMethods - HTTP verbs supported by the authorization endpoint. GET must be always present. POST is optional. 2258 AuthorizationMethods *[]AuthorizationMethod `json:"authorizationMethods,omitempty"` 2259 // 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. 2260 ClientAuthenticationMethod *[]ClientAuthenticationMethod `json:"clientAuthenticationMethod,omitempty"` 2261 // 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"}. 2262 TokenBodyParameters *[]TokenBodyParameterContract `json:"tokenBodyParameters,omitempty"` 2263 // TokenEndpoint - OAuth token endpoint. Contains absolute URI to entity being referenced. 2264 TokenEndpoint *string `json:"tokenEndpoint,omitempty"` 2265 // 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. 2266 SupportState *bool `json:"supportState,omitempty"` 2267 // 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. 2268 DefaultScope *string `json:"defaultScope,omitempty"` 2269 // BearerTokenSendingMethods - Specifies the mechanism by which access token is passed to the API. 2270 BearerTokenSendingMethods *[]BearerTokenSendingMethod `json:"bearerTokenSendingMethods,omitempty"` 2271 // ClientSecret - Client or app secret registered with this authorization server. 2272 ClientSecret *string `json:"clientSecret,omitempty"` 2273 // ResourceOwnerUsername - Can be optionally specified when resource owner password grant type is supported by this authorization server. Default resource owner username. 2274 ResourceOwnerUsername *string `json:"resourceOwnerUsername,omitempty"` 2275 // ResourceOwnerPassword - Can be optionally specified when resource owner password grant type is supported by this authorization server. Default resource owner password. 2276 ResourceOwnerPassword *string `json:"resourceOwnerPassword,omitempty"` 2277} 2278 2279// AuthorizationServerContractProperties external OAuth authorization server settings Properties. 2280type AuthorizationServerContractProperties struct { 2281 // DisplayName - User-friendly authorization server name. 2282 DisplayName *string `json:"displayName,omitempty"` 2283 // ClientRegistrationEndpoint - Optional reference to a page where client or app registration for this authorization server is performed. Contains absolute URL to entity being referenced. 2284 ClientRegistrationEndpoint *string `json:"clientRegistrationEndpoint,omitempty"` 2285 // AuthorizationEndpoint - OAuth authorization endpoint. See http://tools.ietf.org/html/rfc6749#section-3.2. 2286 AuthorizationEndpoint *string `json:"authorizationEndpoint,omitempty"` 2287 // GrantTypes - Form of an authorization grant, which the client uses to request the access token. 2288 GrantTypes *[]GrantType `json:"grantTypes,omitempty"` 2289 // ClientID - Client or app id registered with this authorization server. 2290 ClientID *string `json:"clientId,omitempty"` 2291 // Description - Description of the authorization server. Can contain HTML formatting tags. 2292 Description *string `json:"description,omitempty"` 2293 // AuthorizationMethods - HTTP verbs supported by the authorization endpoint. GET must be always present. POST is optional. 2294 AuthorizationMethods *[]AuthorizationMethod `json:"authorizationMethods,omitempty"` 2295 // 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. 2296 ClientAuthenticationMethod *[]ClientAuthenticationMethod `json:"clientAuthenticationMethod,omitempty"` 2297 // 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"}. 2298 TokenBodyParameters *[]TokenBodyParameterContract `json:"tokenBodyParameters,omitempty"` 2299 // TokenEndpoint - OAuth token endpoint. Contains absolute URI to entity being referenced. 2300 TokenEndpoint *string `json:"tokenEndpoint,omitempty"` 2301 // 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. 2302 SupportState *bool `json:"supportState,omitempty"` 2303 // 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. 2304 DefaultScope *string `json:"defaultScope,omitempty"` 2305 // BearerTokenSendingMethods - Specifies the mechanism by which access token is passed to the API. 2306 BearerTokenSendingMethods *[]BearerTokenSendingMethod `json:"bearerTokenSendingMethods,omitempty"` 2307 // ClientSecret - Client or app secret registered with this authorization server. 2308 ClientSecret *string `json:"clientSecret,omitempty"` 2309 // ResourceOwnerUsername - Can be optionally specified when resource owner password grant type is supported by this authorization server. Default resource owner username. 2310 ResourceOwnerUsername *string `json:"resourceOwnerUsername,omitempty"` 2311 // ResourceOwnerPassword - Can be optionally specified when resource owner password grant type is supported by this authorization server. Default resource owner password. 2312 ResourceOwnerPassword *string `json:"resourceOwnerPassword,omitempty"` 2313} 2314 2315// AuthorizationServerUpdateContract external OAuth authorization server settings. 2316type AuthorizationServerUpdateContract struct { 2317 // AuthorizationServerUpdateContractProperties - Properties of the External OAuth authorization server update Contract. 2318 *AuthorizationServerUpdateContractProperties `json:"properties,omitempty"` 2319 // ID - READ-ONLY; Resource ID. 2320 ID *string `json:"id,omitempty"` 2321 // Name - READ-ONLY; Resource name. 2322 Name *string `json:"name,omitempty"` 2323 // Type - READ-ONLY; Resource type for API Management resource. 2324 Type *string `json:"type,omitempty"` 2325} 2326 2327// MarshalJSON is the custom marshaler for AuthorizationServerUpdateContract. 2328func (asuc AuthorizationServerUpdateContract) MarshalJSON() ([]byte, error) { 2329 objectMap := make(map[string]interface{}) 2330 if asuc.AuthorizationServerUpdateContractProperties != nil { 2331 objectMap["properties"] = asuc.AuthorizationServerUpdateContractProperties 2332 } 2333 return json.Marshal(objectMap) 2334} 2335 2336// UnmarshalJSON is the custom unmarshaler for AuthorizationServerUpdateContract struct. 2337func (asuc *AuthorizationServerUpdateContract) UnmarshalJSON(body []byte) error { 2338 var m map[string]*json.RawMessage 2339 err := json.Unmarshal(body, &m) 2340 if err != nil { 2341 return err 2342 } 2343 for k, v := range m { 2344 switch k { 2345 case "properties": 2346 if v != nil { 2347 var authorizationServerUpdateContractProperties AuthorizationServerUpdateContractProperties 2348 err = json.Unmarshal(*v, &authorizationServerUpdateContractProperties) 2349 if err != nil { 2350 return err 2351 } 2352 asuc.AuthorizationServerUpdateContractProperties = &authorizationServerUpdateContractProperties 2353 } 2354 case "id": 2355 if v != nil { 2356 var ID string 2357 err = json.Unmarshal(*v, &ID) 2358 if err != nil { 2359 return err 2360 } 2361 asuc.ID = &ID 2362 } 2363 case "name": 2364 if v != nil { 2365 var name string 2366 err = json.Unmarshal(*v, &name) 2367 if err != nil { 2368 return err 2369 } 2370 asuc.Name = &name 2371 } 2372 case "type": 2373 if v != nil { 2374 var typeVar string 2375 err = json.Unmarshal(*v, &typeVar) 2376 if err != nil { 2377 return err 2378 } 2379 asuc.Type = &typeVar 2380 } 2381 } 2382 } 2383 2384 return nil 2385} 2386 2387// AuthorizationServerUpdateContractProperties external OAuth authorization server Update settings 2388// contract. 2389type AuthorizationServerUpdateContractProperties struct { 2390 // DisplayName - User-friendly authorization server name. 2391 DisplayName *string `json:"displayName,omitempty"` 2392 // ClientRegistrationEndpoint - Optional reference to a page where client or app registration for this authorization server is performed. Contains absolute URL to entity being referenced. 2393 ClientRegistrationEndpoint *string `json:"clientRegistrationEndpoint,omitempty"` 2394 // AuthorizationEndpoint - OAuth authorization endpoint. See http://tools.ietf.org/html/rfc6749#section-3.2. 2395 AuthorizationEndpoint *string `json:"authorizationEndpoint,omitempty"` 2396 // GrantTypes - Form of an authorization grant, which the client uses to request the access token. 2397 GrantTypes *[]GrantType `json:"grantTypes,omitempty"` 2398 // ClientID - Client or app id registered with this authorization server. 2399 ClientID *string `json:"clientId,omitempty"` 2400 // Description - Description of the authorization server. Can contain HTML formatting tags. 2401 Description *string `json:"description,omitempty"` 2402 // AuthorizationMethods - HTTP verbs supported by the authorization endpoint. GET must be always present. POST is optional. 2403 AuthorizationMethods *[]AuthorizationMethod `json:"authorizationMethods,omitempty"` 2404 // 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. 2405 ClientAuthenticationMethod *[]ClientAuthenticationMethod `json:"clientAuthenticationMethod,omitempty"` 2406 // 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"}. 2407 TokenBodyParameters *[]TokenBodyParameterContract `json:"tokenBodyParameters,omitempty"` 2408 // TokenEndpoint - OAuth token endpoint. Contains absolute URI to entity being referenced. 2409 TokenEndpoint *string `json:"tokenEndpoint,omitempty"` 2410 // 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. 2411 SupportState *bool `json:"supportState,omitempty"` 2412 // 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. 2413 DefaultScope *string `json:"defaultScope,omitempty"` 2414 // BearerTokenSendingMethods - Specifies the mechanism by which access token is passed to the API. 2415 BearerTokenSendingMethods *[]BearerTokenSendingMethod `json:"bearerTokenSendingMethods,omitempty"` 2416 // ClientSecret - Client or app secret registered with this authorization server. 2417 ClientSecret *string `json:"clientSecret,omitempty"` 2418 // ResourceOwnerUsername - Can be optionally specified when resource owner password grant type is supported by this authorization server. Default resource owner username. 2419 ResourceOwnerUsername *string `json:"resourceOwnerUsername,omitempty"` 2420 // ResourceOwnerPassword - Can be optionally specified when resource owner password grant type is supported by this authorization server. Default resource owner password. 2421 ResourceOwnerPassword *string `json:"resourceOwnerPassword,omitempty"` 2422} 2423 2424// BackendAuthorizationHeaderCredentials authorization header information. 2425type BackendAuthorizationHeaderCredentials struct { 2426 // Scheme - Authentication Scheme name. 2427 Scheme *string `json:"scheme,omitempty"` 2428 // Parameter - Authentication Parameter value. 2429 Parameter *string `json:"parameter,omitempty"` 2430} 2431 2432// BackendBaseParameters backend entity base Parameter set. 2433type BackendBaseParameters struct { 2434 // Title - Backend Title. 2435 Title *string `json:"title,omitempty"` 2436 // Description - Backend Description. 2437 Description *string `json:"description,omitempty"` 2438 // 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. 2439 ResourceID *string `json:"resourceId,omitempty"` 2440 // Properties - Backend Properties contract 2441 Properties *BackendProperties `json:"properties,omitempty"` 2442 // Credentials - Backend Credentials Contract Properties 2443 Credentials *BackendCredentialsContract `json:"credentials,omitempty"` 2444 // Proxy - Backend Proxy Contract Properties 2445 Proxy *BackendProxyContract `json:"proxy,omitempty"` 2446 // TLS - Backend TLS Properties 2447 TLS *BackendTLSProperties `json:"tls,omitempty"` 2448} 2449 2450// BackendCollection paged Backend list representation. 2451type BackendCollection struct { 2452 autorest.Response `json:"-"` 2453 // Value - Backend values. 2454 Value *[]BackendContract `json:"value,omitempty"` 2455 // NextLink - Next page link if any. 2456 NextLink *string `json:"nextLink,omitempty"` 2457} 2458 2459// BackendCollectionIterator provides access to a complete listing of BackendContract values. 2460type BackendCollectionIterator struct { 2461 i int 2462 page BackendCollectionPage 2463} 2464 2465// NextWithContext advances to the next value. If there was an error making 2466// the request the iterator does not advance and the error is returned. 2467func (iter *BackendCollectionIterator) NextWithContext(ctx context.Context) (err error) { 2468 if tracing.IsEnabled() { 2469 ctx = tracing.StartSpan(ctx, fqdn+"/BackendCollectionIterator.NextWithContext") 2470 defer func() { 2471 sc := -1 2472 if iter.Response().Response.Response != nil { 2473 sc = iter.Response().Response.Response.StatusCode 2474 } 2475 tracing.EndSpan(ctx, sc, err) 2476 }() 2477 } 2478 iter.i++ 2479 if iter.i < len(iter.page.Values()) { 2480 return nil 2481 } 2482 err = iter.page.NextWithContext(ctx) 2483 if err != nil { 2484 iter.i-- 2485 return err 2486 } 2487 iter.i = 0 2488 return nil 2489} 2490 2491// Next advances to the next value. If there was an error making 2492// the request the iterator does not advance and the error is returned. 2493// Deprecated: Use NextWithContext() instead. 2494func (iter *BackendCollectionIterator) Next() error { 2495 return iter.NextWithContext(context.Background()) 2496} 2497 2498// NotDone returns true if the enumeration should be started or is not yet complete. 2499func (iter BackendCollectionIterator) NotDone() bool { 2500 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 2501} 2502 2503// Response returns the raw server response from the last page request. 2504func (iter BackendCollectionIterator) Response() BackendCollection { 2505 return iter.page.Response() 2506} 2507 2508// Value returns the current value or a zero-initialized value if the 2509// iterator has advanced beyond the end of the collection. 2510func (iter BackendCollectionIterator) Value() BackendContract { 2511 if !iter.page.NotDone() { 2512 return BackendContract{} 2513 } 2514 return iter.page.Values()[iter.i] 2515} 2516 2517// Creates a new instance of the BackendCollectionIterator type. 2518func NewBackendCollectionIterator(page BackendCollectionPage) BackendCollectionIterator { 2519 return BackendCollectionIterator{page: page} 2520} 2521 2522// IsEmpty returns true if the ListResult contains no values. 2523func (bc BackendCollection) IsEmpty() bool { 2524 return bc.Value == nil || len(*bc.Value) == 0 2525} 2526 2527// backendCollectionPreparer prepares a request to retrieve the next set of results. 2528// It returns nil if no more results exist. 2529func (bc BackendCollection) backendCollectionPreparer(ctx context.Context) (*http.Request, error) { 2530 if bc.NextLink == nil || len(to.String(bc.NextLink)) < 1 { 2531 return nil, nil 2532 } 2533 return autorest.Prepare((&http.Request{}).WithContext(ctx), 2534 autorest.AsJSON(), 2535 autorest.AsGet(), 2536 autorest.WithBaseURL(to.String(bc.NextLink))) 2537} 2538 2539// BackendCollectionPage contains a page of BackendContract values. 2540type BackendCollectionPage struct { 2541 fn func(context.Context, BackendCollection) (BackendCollection, error) 2542 bc BackendCollection 2543} 2544 2545// NextWithContext advances to the next page of values. If there was an error making 2546// the request the page does not advance and the error is returned. 2547func (page *BackendCollectionPage) NextWithContext(ctx context.Context) (err error) { 2548 if tracing.IsEnabled() { 2549 ctx = tracing.StartSpan(ctx, fqdn+"/BackendCollectionPage.NextWithContext") 2550 defer func() { 2551 sc := -1 2552 if page.Response().Response.Response != nil { 2553 sc = page.Response().Response.Response.StatusCode 2554 } 2555 tracing.EndSpan(ctx, sc, err) 2556 }() 2557 } 2558 next, err := page.fn(ctx, page.bc) 2559 if err != nil { 2560 return err 2561 } 2562 page.bc = next 2563 return nil 2564} 2565 2566// Next advances to the next page of values. If there was an error making 2567// the request the page does not advance and the error is returned. 2568// Deprecated: Use NextWithContext() instead. 2569func (page *BackendCollectionPage) Next() error { 2570 return page.NextWithContext(context.Background()) 2571} 2572 2573// NotDone returns true if the page enumeration should be started or is not yet complete. 2574func (page BackendCollectionPage) NotDone() bool { 2575 return !page.bc.IsEmpty() 2576} 2577 2578// Response returns the raw server response from the last page request. 2579func (page BackendCollectionPage) Response() BackendCollection { 2580 return page.bc 2581} 2582 2583// Values returns the slice of values for the current page or nil if there are no values. 2584func (page BackendCollectionPage) Values() []BackendContract { 2585 if page.bc.IsEmpty() { 2586 return nil 2587 } 2588 return *page.bc.Value 2589} 2590 2591// Creates a new instance of the BackendCollectionPage type. 2592func NewBackendCollectionPage(getNextPage func(context.Context, BackendCollection) (BackendCollection, error)) BackendCollectionPage { 2593 return BackendCollectionPage{fn: getNextPage} 2594} 2595 2596// BackendContract backend details. 2597type BackendContract struct { 2598 autorest.Response `json:"-"` 2599 // BackendContractProperties - Backend entity contract properties. 2600 *BackendContractProperties `json:"properties,omitempty"` 2601 // ID - READ-ONLY; Resource ID. 2602 ID *string `json:"id,omitempty"` 2603 // Name - READ-ONLY; Resource name. 2604 Name *string `json:"name,omitempty"` 2605 // Type - READ-ONLY; Resource type for API Management resource. 2606 Type *string `json:"type,omitempty"` 2607} 2608 2609// MarshalJSON is the custom marshaler for BackendContract. 2610func (bc BackendContract) MarshalJSON() ([]byte, error) { 2611 objectMap := make(map[string]interface{}) 2612 if bc.BackendContractProperties != nil { 2613 objectMap["properties"] = bc.BackendContractProperties 2614 } 2615 return json.Marshal(objectMap) 2616} 2617 2618// UnmarshalJSON is the custom unmarshaler for BackendContract struct. 2619func (bc *BackendContract) UnmarshalJSON(body []byte) error { 2620 var m map[string]*json.RawMessage 2621 err := json.Unmarshal(body, &m) 2622 if err != nil { 2623 return err 2624 } 2625 for k, v := range m { 2626 switch k { 2627 case "properties": 2628 if v != nil { 2629 var backendContractProperties BackendContractProperties 2630 err = json.Unmarshal(*v, &backendContractProperties) 2631 if err != nil { 2632 return err 2633 } 2634 bc.BackendContractProperties = &backendContractProperties 2635 } 2636 case "id": 2637 if v != nil { 2638 var ID string 2639 err = json.Unmarshal(*v, &ID) 2640 if err != nil { 2641 return err 2642 } 2643 bc.ID = &ID 2644 } 2645 case "name": 2646 if v != nil { 2647 var name string 2648 err = json.Unmarshal(*v, &name) 2649 if err != nil { 2650 return err 2651 } 2652 bc.Name = &name 2653 } 2654 case "type": 2655 if v != nil { 2656 var typeVar string 2657 err = json.Unmarshal(*v, &typeVar) 2658 if err != nil { 2659 return err 2660 } 2661 bc.Type = &typeVar 2662 } 2663 } 2664 } 2665 2666 return nil 2667} 2668 2669// BackendContractProperties parameters supplied to the Create Backend operation. 2670type BackendContractProperties struct { 2671 // URL - Runtime Url of the Backend. 2672 URL *string `json:"url,omitempty"` 2673 // Protocol - Backend communication protocol. Possible values include: 'BackendProtocolHTTP', 'BackendProtocolSoap' 2674 Protocol BackendProtocol `json:"protocol,omitempty"` 2675 // Title - Backend Title. 2676 Title *string `json:"title,omitempty"` 2677 // Description - Backend Description. 2678 Description *string `json:"description,omitempty"` 2679 // 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. 2680 ResourceID *string `json:"resourceId,omitempty"` 2681 // Properties - Backend Properties contract 2682 Properties *BackendProperties `json:"properties,omitempty"` 2683 // Credentials - Backend Credentials Contract Properties 2684 Credentials *BackendCredentialsContract `json:"credentials,omitempty"` 2685 // Proxy - Backend Proxy Contract Properties 2686 Proxy *BackendProxyContract `json:"proxy,omitempty"` 2687 // TLS - Backend TLS Properties 2688 TLS *BackendTLSProperties `json:"tls,omitempty"` 2689} 2690 2691// BackendCredentialsContract details of the Credentials used to connect to Backend. 2692type BackendCredentialsContract struct { 2693 // Certificate - List of Client Certificate Thumbprint. 2694 Certificate *[]string `json:"certificate,omitempty"` 2695 // Query - Query Parameter description. 2696 Query map[string][]string `json:"query"` 2697 // Header - Header Parameter description. 2698 Header map[string][]string `json:"header"` 2699 // Authorization - Authorization header authentication 2700 Authorization *BackendAuthorizationHeaderCredentials `json:"authorization,omitempty"` 2701} 2702 2703// MarshalJSON is the custom marshaler for BackendCredentialsContract. 2704func (bcc BackendCredentialsContract) MarshalJSON() ([]byte, error) { 2705 objectMap := make(map[string]interface{}) 2706 if bcc.Certificate != nil { 2707 objectMap["certificate"] = bcc.Certificate 2708 } 2709 if bcc.Query != nil { 2710 objectMap["query"] = bcc.Query 2711 } 2712 if bcc.Header != nil { 2713 objectMap["header"] = bcc.Header 2714 } 2715 if bcc.Authorization != nil { 2716 objectMap["authorization"] = bcc.Authorization 2717 } 2718 return json.Marshal(objectMap) 2719} 2720 2721// BackendProperties properties specific to the Backend Type. 2722type BackendProperties struct { 2723 // ServiceFabricCluster - Backend Service Fabric Cluster Properties 2724 ServiceFabricCluster *BackendServiceFabricClusterProperties `json:"serviceFabricCluster,omitempty"` 2725} 2726 2727// BackendProxyContract details of the Backend WebProxy Server to use in the Request to Backend. 2728type BackendProxyContract struct { 2729 // URL - WebProxy Server AbsoluteUri property which includes the entire URI stored in the Uri instance, including all fragments and query strings. 2730 URL *string `json:"url,omitempty"` 2731 // Username - Username to connect to the WebProxy server 2732 Username *string `json:"username,omitempty"` 2733 // Password - Password to connect to the WebProxy Server 2734 Password *string `json:"password,omitempty"` 2735} 2736 2737// BackendReconnectContract reconnect request parameters. 2738type BackendReconnectContract struct { 2739 // BackendReconnectProperties - Reconnect request properties. 2740 *BackendReconnectProperties `json:"properties,omitempty"` 2741 // ID - READ-ONLY; Resource ID. 2742 ID *string `json:"id,omitempty"` 2743 // Name - READ-ONLY; Resource name. 2744 Name *string `json:"name,omitempty"` 2745 // Type - READ-ONLY; Resource type for API Management resource. 2746 Type *string `json:"type,omitempty"` 2747} 2748 2749// MarshalJSON is the custom marshaler for BackendReconnectContract. 2750func (brc BackendReconnectContract) MarshalJSON() ([]byte, error) { 2751 objectMap := make(map[string]interface{}) 2752 if brc.BackendReconnectProperties != nil { 2753 objectMap["properties"] = brc.BackendReconnectProperties 2754 } 2755 return json.Marshal(objectMap) 2756} 2757 2758// UnmarshalJSON is the custom unmarshaler for BackendReconnectContract struct. 2759func (brc *BackendReconnectContract) UnmarshalJSON(body []byte) error { 2760 var m map[string]*json.RawMessage 2761 err := json.Unmarshal(body, &m) 2762 if err != nil { 2763 return err 2764 } 2765 for k, v := range m { 2766 switch k { 2767 case "properties": 2768 if v != nil { 2769 var backendReconnectProperties BackendReconnectProperties 2770 err = json.Unmarshal(*v, &backendReconnectProperties) 2771 if err != nil { 2772 return err 2773 } 2774 brc.BackendReconnectProperties = &backendReconnectProperties 2775 } 2776 case "id": 2777 if v != nil { 2778 var ID string 2779 err = json.Unmarshal(*v, &ID) 2780 if err != nil { 2781 return err 2782 } 2783 brc.ID = &ID 2784 } 2785 case "name": 2786 if v != nil { 2787 var name string 2788 err = json.Unmarshal(*v, &name) 2789 if err != nil { 2790 return err 2791 } 2792 brc.Name = &name 2793 } 2794 case "type": 2795 if v != nil { 2796 var typeVar string 2797 err = json.Unmarshal(*v, &typeVar) 2798 if err != nil { 2799 return err 2800 } 2801 brc.Type = &typeVar 2802 } 2803 } 2804 } 2805 2806 return nil 2807} 2808 2809// BackendReconnectProperties properties to control reconnect requests. 2810type BackendReconnectProperties struct { 2811 // After - Duration in ISO8601 format after which reconnect will be initiated. Minimum duration of the Reconnect is PT2M. 2812 After *string `json:"after,omitempty"` 2813} 2814 2815// BackendServiceFabricClusterProperties properties of the Service Fabric Type Backend. 2816type BackendServiceFabricClusterProperties struct { 2817 // ClientCertificatethumbprint - The client certificate thumbprint for the management endpoint. 2818 ClientCertificatethumbprint *string `json:"clientCertificatethumbprint,omitempty"` 2819 // MaxPartitionResolutionRetries - Maximum number of retries while attempting resolve the partition. 2820 MaxPartitionResolutionRetries *int32 `json:"maxPartitionResolutionRetries,omitempty"` 2821 // ManagementEndpoints - The cluster management endpoint. 2822 ManagementEndpoints *[]string `json:"managementEndpoints,omitempty"` 2823 // ServerCertificateThumbprints - Thumbprints of certificates cluster management service uses for tls communication 2824 ServerCertificateThumbprints *[]string `json:"serverCertificateThumbprints,omitempty"` 2825 // ServerX509Names - Server X509 Certificate Names Collection 2826 ServerX509Names *[]X509CertificateName `json:"serverX509Names,omitempty"` 2827} 2828 2829// BackendTLSProperties properties controlling TLS Certificate Validation. 2830type BackendTLSProperties struct { 2831 // ValidateCertificateChain - Flag indicating whether SSL certificate chain validation should be done when using self-signed certificates for this backend host. 2832 ValidateCertificateChain *bool `json:"validateCertificateChain,omitempty"` 2833 // ValidateCertificateName - Flag indicating whether SSL certificate name validation should be done when using self-signed certificates for this backend host. 2834 ValidateCertificateName *bool `json:"validateCertificateName,omitempty"` 2835} 2836 2837// BackendUpdateParameterProperties parameters supplied to the Update Backend operation. 2838type BackendUpdateParameterProperties struct { 2839 // URL - Runtime Url of the Backend. 2840 URL *string `json:"url,omitempty"` 2841 // Protocol - Backend communication protocol. Possible values include: 'BackendProtocolHTTP', 'BackendProtocolSoap' 2842 Protocol BackendProtocol `json:"protocol,omitempty"` 2843 // Title - Backend Title. 2844 Title *string `json:"title,omitempty"` 2845 // Description - Backend Description. 2846 Description *string `json:"description,omitempty"` 2847 // 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. 2848 ResourceID *string `json:"resourceId,omitempty"` 2849 // Properties - Backend Properties contract 2850 Properties *BackendProperties `json:"properties,omitempty"` 2851 // Credentials - Backend Credentials Contract Properties 2852 Credentials *BackendCredentialsContract `json:"credentials,omitempty"` 2853 // Proxy - Backend Proxy Contract Properties 2854 Proxy *BackendProxyContract `json:"proxy,omitempty"` 2855 // TLS - Backend TLS Properties 2856 TLS *BackendTLSProperties `json:"tls,omitempty"` 2857} 2858 2859// BackendUpdateParameters backend update parameters. 2860type BackendUpdateParameters struct { 2861 // BackendUpdateParameterProperties - Backend entity update contract properties. 2862 *BackendUpdateParameterProperties `json:"properties,omitempty"` 2863} 2864 2865// MarshalJSON is the custom marshaler for BackendUpdateParameters. 2866func (bup BackendUpdateParameters) MarshalJSON() ([]byte, error) { 2867 objectMap := make(map[string]interface{}) 2868 if bup.BackendUpdateParameterProperties != nil { 2869 objectMap["properties"] = bup.BackendUpdateParameterProperties 2870 } 2871 return json.Marshal(objectMap) 2872} 2873 2874// UnmarshalJSON is the custom unmarshaler for BackendUpdateParameters struct. 2875func (bup *BackendUpdateParameters) UnmarshalJSON(body []byte) error { 2876 var m map[string]*json.RawMessage 2877 err := json.Unmarshal(body, &m) 2878 if err != nil { 2879 return err 2880 } 2881 for k, v := range m { 2882 switch k { 2883 case "properties": 2884 if v != nil { 2885 var backendUpdateParameterProperties BackendUpdateParameterProperties 2886 err = json.Unmarshal(*v, &backendUpdateParameterProperties) 2887 if err != nil { 2888 return err 2889 } 2890 bup.BackendUpdateParameterProperties = &backendUpdateParameterProperties 2891 } 2892 } 2893 } 2894 2895 return nil 2896} 2897 2898// BodyDiagnosticSettings body logging settings. 2899type BodyDiagnosticSettings struct { 2900 // Bytes - Number of request body bytes to log. 2901 Bytes *int32 `json:"bytes,omitempty"` 2902} 2903 2904// CacheCollection paged Caches list representation. 2905type CacheCollection struct { 2906 autorest.Response `json:"-"` 2907 // Value - Page values. 2908 Value *[]CacheContract `json:"value,omitempty"` 2909 // NextLink - Next page link if any. 2910 NextLink *string `json:"nextLink,omitempty"` 2911} 2912 2913// CacheCollectionIterator provides access to a complete listing of CacheContract values. 2914type CacheCollectionIterator struct { 2915 i int 2916 page CacheCollectionPage 2917} 2918 2919// NextWithContext advances to the next value. If there was an error making 2920// the request the iterator does not advance and the error is returned. 2921func (iter *CacheCollectionIterator) NextWithContext(ctx context.Context) (err error) { 2922 if tracing.IsEnabled() { 2923 ctx = tracing.StartSpan(ctx, fqdn+"/CacheCollectionIterator.NextWithContext") 2924 defer func() { 2925 sc := -1 2926 if iter.Response().Response.Response != nil { 2927 sc = iter.Response().Response.Response.StatusCode 2928 } 2929 tracing.EndSpan(ctx, sc, err) 2930 }() 2931 } 2932 iter.i++ 2933 if iter.i < len(iter.page.Values()) { 2934 return nil 2935 } 2936 err = iter.page.NextWithContext(ctx) 2937 if err != nil { 2938 iter.i-- 2939 return err 2940 } 2941 iter.i = 0 2942 return nil 2943} 2944 2945// Next advances to the next value. If there was an error making 2946// the request the iterator does not advance and the error is returned. 2947// Deprecated: Use NextWithContext() instead. 2948func (iter *CacheCollectionIterator) Next() error { 2949 return iter.NextWithContext(context.Background()) 2950} 2951 2952// NotDone returns true if the enumeration should be started or is not yet complete. 2953func (iter CacheCollectionIterator) NotDone() bool { 2954 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 2955} 2956 2957// Response returns the raw server response from the last page request. 2958func (iter CacheCollectionIterator) Response() CacheCollection { 2959 return iter.page.Response() 2960} 2961 2962// Value returns the current value or a zero-initialized value if the 2963// iterator has advanced beyond the end of the collection. 2964func (iter CacheCollectionIterator) Value() CacheContract { 2965 if !iter.page.NotDone() { 2966 return CacheContract{} 2967 } 2968 return iter.page.Values()[iter.i] 2969} 2970 2971// Creates a new instance of the CacheCollectionIterator type. 2972func NewCacheCollectionIterator(page CacheCollectionPage) CacheCollectionIterator { 2973 return CacheCollectionIterator{page: page} 2974} 2975 2976// IsEmpty returns true if the ListResult contains no values. 2977func (cc CacheCollection) IsEmpty() bool { 2978 return cc.Value == nil || len(*cc.Value) == 0 2979} 2980 2981// cacheCollectionPreparer prepares a request to retrieve the next set of results. 2982// It returns nil if no more results exist. 2983func (cc CacheCollection) cacheCollectionPreparer(ctx context.Context) (*http.Request, error) { 2984 if cc.NextLink == nil || len(to.String(cc.NextLink)) < 1 { 2985 return nil, nil 2986 } 2987 return autorest.Prepare((&http.Request{}).WithContext(ctx), 2988 autorest.AsJSON(), 2989 autorest.AsGet(), 2990 autorest.WithBaseURL(to.String(cc.NextLink))) 2991} 2992 2993// CacheCollectionPage contains a page of CacheContract values. 2994type CacheCollectionPage struct { 2995 fn func(context.Context, CacheCollection) (CacheCollection, error) 2996 cc CacheCollection 2997} 2998 2999// NextWithContext advances to the next page of values. If there was an error making 3000// the request the page does not advance and the error is returned. 3001func (page *CacheCollectionPage) NextWithContext(ctx context.Context) (err error) { 3002 if tracing.IsEnabled() { 3003 ctx = tracing.StartSpan(ctx, fqdn+"/CacheCollectionPage.NextWithContext") 3004 defer func() { 3005 sc := -1 3006 if page.Response().Response.Response != nil { 3007 sc = page.Response().Response.Response.StatusCode 3008 } 3009 tracing.EndSpan(ctx, sc, err) 3010 }() 3011 } 3012 next, err := page.fn(ctx, page.cc) 3013 if err != nil { 3014 return err 3015 } 3016 page.cc = next 3017 return nil 3018} 3019 3020// Next advances to the next page of values. If there was an error making 3021// the request the page does not advance and the error is returned. 3022// Deprecated: Use NextWithContext() instead. 3023func (page *CacheCollectionPage) Next() error { 3024 return page.NextWithContext(context.Background()) 3025} 3026 3027// NotDone returns true if the page enumeration should be started or is not yet complete. 3028func (page CacheCollectionPage) NotDone() bool { 3029 return !page.cc.IsEmpty() 3030} 3031 3032// Response returns the raw server response from the last page request. 3033func (page CacheCollectionPage) Response() CacheCollection { 3034 return page.cc 3035} 3036 3037// Values returns the slice of values for the current page or nil if there are no values. 3038func (page CacheCollectionPage) Values() []CacheContract { 3039 if page.cc.IsEmpty() { 3040 return nil 3041 } 3042 return *page.cc.Value 3043} 3044 3045// Creates a new instance of the CacheCollectionPage type. 3046func NewCacheCollectionPage(getNextPage func(context.Context, CacheCollection) (CacheCollection, error)) CacheCollectionPage { 3047 return CacheCollectionPage{fn: getNextPage} 3048} 3049 3050// CacheContract cache details. 3051type CacheContract struct { 3052 autorest.Response `json:"-"` 3053 // CacheContractProperties - Cache properties details. 3054 *CacheContractProperties `json:"properties,omitempty"` 3055 // ID - READ-ONLY; Resource ID. 3056 ID *string `json:"id,omitempty"` 3057 // Name - READ-ONLY; Resource name. 3058 Name *string `json:"name,omitempty"` 3059 // Type - READ-ONLY; Resource type for API Management resource. 3060 Type *string `json:"type,omitempty"` 3061} 3062 3063// MarshalJSON is the custom marshaler for CacheContract. 3064func (cc CacheContract) MarshalJSON() ([]byte, error) { 3065 objectMap := make(map[string]interface{}) 3066 if cc.CacheContractProperties != nil { 3067 objectMap["properties"] = cc.CacheContractProperties 3068 } 3069 return json.Marshal(objectMap) 3070} 3071 3072// UnmarshalJSON is the custom unmarshaler for CacheContract struct. 3073func (cc *CacheContract) UnmarshalJSON(body []byte) error { 3074 var m map[string]*json.RawMessage 3075 err := json.Unmarshal(body, &m) 3076 if err != nil { 3077 return err 3078 } 3079 for k, v := range m { 3080 switch k { 3081 case "properties": 3082 if v != nil { 3083 var cacheContractProperties CacheContractProperties 3084 err = json.Unmarshal(*v, &cacheContractProperties) 3085 if err != nil { 3086 return err 3087 } 3088 cc.CacheContractProperties = &cacheContractProperties 3089 } 3090 case "id": 3091 if v != nil { 3092 var ID string 3093 err = json.Unmarshal(*v, &ID) 3094 if err != nil { 3095 return err 3096 } 3097 cc.ID = &ID 3098 } 3099 case "name": 3100 if v != nil { 3101 var name string 3102 err = json.Unmarshal(*v, &name) 3103 if err != nil { 3104 return err 3105 } 3106 cc.Name = &name 3107 } 3108 case "type": 3109 if v != nil { 3110 var typeVar string 3111 err = json.Unmarshal(*v, &typeVar) 3112 if err != nil { 3113 return err 3114 } 3115 cc.Type = &typeVar 3116 } 3117 } 3118 } 3119 3120 return nil 3121} 3122 3123// CacheContractProperties properties of the Cache contract. 3124type CacheContractProperties struct { 3125 // Description - Cache description 3126 Description *string `json:"description,omitempty"` 3127 // ConnectionString - Runtime connection string to cache 3128 ConnectionString *string `json:"connectionString,omitempty"` 3129 // ResourceID - Original uri of entity in external system cache points to 3130 ResourceID *string `json:"resourceId,omitempty"` 3131} 3132 3133// CacheUpdateParameters cache update details. 3134type CacheUpdateParameters struct { 3135 // CacheUpdateProperties - Cache update properties details. 3136 *CacheUpdateProperties `json:"properties,omitempty"` 3137} 3138 3139// MarshalJSON is the custom marshaler for CacheUpdateParameters. 3140func (cup CacheUpdateParameters) MarshalJSON() ([]byte, error) { 3141 objectMap := make(map[string]interface{}) 3142 if cup.CacheUpdateProperties != nil { 3143 objectMap["properties"] = cup.CacheUpdateProperties 3144 } 3145 return json.Marshal(objectMap) 3146} 3147 3148// UnmarshalJSON is the custom unmarshaler for CacheUpdateParameters struct. 3149func (cup *CacheUpdateParameters) UnmarshalJSON(body []byte) error { 3150 var m map[string]*json.RawMessage 3151 err := json.Unmarshal(body, &m) 3152 if err != nil { 3153 return err 3154 } 3155 for k, v := range m { 3156 switch k { 3157 case "properties": 3158 if v != nil { 3159 var cacheUpdateProperties CacheUpdateProperties 3160 err = json.Unmarshal(*v, &cacheUpdateProperties) 3161 if err != nil { 3162 return err 3163 } 3164 cup.CacheUpdateProperties = &cacheUpdateProperties 3165 } 3166 } 3167 } 3168 3169 return nil 3170} 3171 3172// CacheUpdateProperties parameters supplied to the Update Cache operation. 3173type CacheUpdateProperties struct { 3174 // Description - Cache description 3175 Description *string `json:"description,omitempty"` 3176 // ConnectionString - Runtime connection string to cache 3177 ConnectionString *string `json:"connectionString,omitempty"` 3178 // ResourceID - Original uri of entity in external system cache points to 3179 ResourceID *string `json:"resourceId,omitempty"` 3180} 3181 3182// CertificateCollection paged Certificates list representation. 3183type CertificateCollection struct { 3184 autorest.Response `json:"-"` 3185 // Value - Page values. 3186 Value *[]CertificateContract `json:"value,omitempty"` 3187 // NextLink - Next page link if any. 3188 NextLink *string `json:"nextLink,omitempty"` 3189} 3190 3191// CertificateCollectionIterator provides access to a complete listing of CertificateContract values. 3192type CertificateCollectionIterator struct { 3193 i int 3194 page CertificateCollectionPage 3195} 3196 3197// NextWithContext advances to the next value. If there was an error making 3198// the request the iterator does not advance and the error is returned. 3199func (iter *CertificateCollectionIterator) NextWithContext(ctx context.Context) (err error) { 3200 if tracing.IsEnabled() { 3201 ctx = tracing.StartSpan(ctx, fqdn+"/CertificateCollectionIterator.NextWithContext") 3202 defer func() { 3203 sc := -1 3204 if iter.Response().Response.Response != nil { 3205 sc = iter.Response().Response.Response.StatusCode 3206 } 3207 tracing.EndSpan(ctx, sc, err) 3208 }() 3209 } 3210 iter.i++ 3211 if iter.i < len(iter.page.Values()) { 3212 return nil 3213 } 3214 err = iter.page.NextWithContext(ctx) 3215 if err != nil { 3216 iter.i-- 3217 return err 3218 } 3219 iter.i = 0 3220 return nil 3221} 3222 3223// Next advances to the next value. If there was an error making 3224// the request the iterator does not advance and the error is returned. 3225// Deprecated: Use NextWithContext() instead. 3226func (iter *CertificateCollectionIterator) Next() error { 3227 return iter.NextWithContext(context.Background()) 3228} 3229 3230// NotDone returns true if the enumeration should be started or is not yet complete. 3231func (iter CertificateCollectionIterator) NotDone() bool { 3232 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 3233} 3234 3235// Response returns the raw server response from the last page request. 3236func (iter CertificateCollectionIterator) Response() CertificateCollection { 3237 return iter.page.Response() 3238} 3239 3240// Value returns the current value or a zero-initialized value if the 3241// iterator has advanced beyond the end of the collection. 3242func (iter CertificateCollectionIterator) Value() CertificateContract { 3243 if !iter.page.NotDone() { 3244 return CertificateContract{} 3245 } 3246 return iter.page.Values()[iter.i] 3247} 3248 3249// Creates a new instance of the CertificateCollectionIterator type. 3250func NewCertificateCollectionIterator(page CertificateCollectionPage) CertificateCollectionIterator { 3251 return CertificateCollectionIterator{page: page} 3252} 3253 3254// IsEmpty returns true if the ListResult contains no values. 3255func (cc CertificateCollection) IsEmpty() bool { 3256 return cc.Value == nil || len(*cc.Value) == 0 3257} 3258 3259// certificateCollectionPreparer prepares a request to retrieve the next set of results. 3260// It returns nil if no more results exist. 3261func (cc CertificateCollection) certificateCollectionPreparer(ctx context.Context) (*http.Request, error) { 3262 if cc.NextLink == nil || len(to.String(cc.NextLink)) < 1 { 3263 return nil, nil 3264 } 3265 return autorest.Prepare((&http.Request{}).WithContext(ctx), 3266 autorest.AsJSON(), 3267 autorest.AsGet(), 3268 autorest.WithBaseURL(to.String(cc.NextLink))) 3269} 3270 3271// CertificateCollectionPage contains a page of CertificateContract values. 3272type CertificateCollectionPage struct { 3273 fn func(context.Context, CertificateCollection) (CertificateCollection, error) 3274 cc CertificateCollection 3275} 3276 3277// NextWithContext advances to the next page of values. If there was an error making 3278// the request the page does not advance and the error is returned. 3279func (page *CertificateCollectionPage) NextWithContext(ctx context.Context) (err error) { 3280 if tracing.IsEnabled() { 3281 ctx = tracing.StartSpan(ctx, fqdn+"/CertificateCollectionPage.NextWithContext") 3282 defer func() { 3283 sc := -1 3284 if page.Response().Response.Response != nil { 3285 sc = page.Response().Response.Response.StatusCode 3286 } 3287 tracing.EndSpan(ctx, sc, err) 3288 }() 3289 } 3290 next, err := page.fn(ctx, page.cc) 3291 if err != nil { 3292 return err 3293 } 3294 page.cc = next 3295 return nil 3296} 3297 3298// Next advances to the next page of values. If there was an error making 3299// the request the page does not advance and the error is returned. 3300// Deprecated: Use NextWithContext() instead. 3301func (page *CertificateCollectionPage) Next() error { 3302 return page.NextWithContext(context.Background()) 3303} 3304 3305// NotDone returns true if the page enumeration should be started or is not yet complete. 3306func (page CertificateCollectionPage) NotDone() bool { 3307 return !page.cc.IsEmpty() 3308} 3309 3310// Response returns the raw server response from the last page request. 3311func (page CertificateCollectionPage) Response() CertificateCollection { 3312 return page.cc 3313} 3314 3315// Values returns the slice of values for the current page or nil if there are no values. 3316func (page CertificateCollectionPage) Values() []CertificateContract { 3317 if page.cc.IsEmpty() { 3318 return nil 3319 } 3320 return *page.cc.Value 3321} 3322 3323// Creates a new instance of the CertificateCollectionPage type. 3324func NewCertificateCollectionPage(getNextPage func(context.Context, CertificateCollection) (CertificateCollection, error)) CertificateCollectionPage { 3325 return CertificateCollectionPage{fn: getNextPage} 3326} 3327 3328// CertificateConfiguration certificate configuration which consist of non-trusted intermediates and root 3329// certificates. 3330type CertificateConfiguration struct { 3331 // EncodedCertificate - Base64 Encoded certificate. 3332 EncodedCertificate *string `json:"encodedCertificate,omitempty"` 3333 // CertificatePassword - Certificate Password. 3334 CertificatePassword *string `json:"certificatePassword,omitempty"` 3335 // StoreName - The System.Security.Cryptography.x509certificates.StoreName certificate store location. Only Root and CertificateAuthority are valid locations. Possible values include: 'CertificateAuthority', 'Root' 3336 StoreName StoreName `json:"storeName,omitempty"` 3337 // Certificate - Certificate information. 3338 Certificate *CertificateInformation `json:"certificate,omitempty"` 3339} 3340 3341// CertificateContract certificate details. 3342type CertificateContract struct { 3343 autorest.Response `json:"-"` 3344 // CertificateContractProperties - Certificate properties details. 3345 *CertificateContractProperties `json:"properties,omitempty"` 3346 // ID - READ-ONLY; Resource ID. 3347 ID *string `json:"id,omitempty"` 3348 // Name - READ-ONLY; Resource name. 3349 Name *string `json:"name,omitempty"` 3350 // Type - READ-ONLY; Resource type for API Management resource. 3351 Type *string `json:"type,omitempty"` 3352} 3353 3354// MarshalJSON is the custom marshaler for CertificateContract. 3355func (cc CertificateContract) MarshalJSON() ([]byte, error) { 3356 objectMap := make(map[string]interface{}) 3357 if cc.CertificateContractProperties != nil { 3358 objectMap["properties"] = cc.CertificateContractProperties 3359 } 3360 return json.Marshal(objectMap) 3361} 3362 3363// UnmarshalJSON is the custom unmarshaler for CertificateContract struct. 3364func (cc *CertificateContract) UnmarshalJSON(body []byte) error { 3365 var m map[string]*json.RawMessage 3366 err := json.Unmarshal(body, &m) 3367 if err != nil { 3368 return err 3369 } 3370 for k, v := range m { 3371 switch k { 3372 case "properties": 3373 if v != nil { 3374 var certificateContractProperties CertificateContractProperties 3375 err = json.Unmarshal(*v, &certificateContractProperties) 3376 if err != nil { 3377 return err 3378 } 3379 cc.CertificateContractProperties = &certificateContractProperties 3380 } 3381 case "id": 3382 if v != nil { 3383 var ID string 3384 err = json.Unmarshal(*v, &ID) 3385 if err != nil { 3386 return err 3387 } 3388 cc.ID = &ID 3389 } 3390 case "name": 3391 if v != nil { 3392 var name string 3393 err = json.Unmarshal(*v, &name) 3394 if err != nil { 3395 return err 3396 } 3397 cc.Name = &name 3398 } 3399 case "type": 3400 if v != nil { 3401 var typeVar string 3402 err = json.Unmarshal(*v, &typeVar) 3403 if err != nil { 3404 return err 3405 } 3406 cc.Type = &typeVar 3407 } 3408 } 3409 } 3410 3411 return nil 3412} 3413 3414// CertificateContractProperties properties of the Certificate contract. 3415type CertificateContractProperties struct { 3416 // Subject - Subject attribute of the certificate. 3417 Subject *string `json:"subject,omitempty"` 3418 // Thumbprint - Thumbprint of the certificate. 3419 Thumbprint *string `json:"thumbprint,omitempty"` 3420 // 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. 3421 ExpirationDate *date.Time `json:"expirationDate,omitempty"` 3422} 3423 3424// CertificateCreateOrUpdateParameters certificate create or update details. 3425type CertificateCreateOrUpdateParameters struct { 3426 // CertificateCreateOrUpdateProperties - Certificate create or update properties details. 3427 *CertificateCreateOrUpdateProperties `json:"properties,omitempty"` 3428} 3429 3430// MarshalJSON is the custom marshaler for CertificateCreateOrUpdateParameters. 3431func (ccoup CertificateCreateOrUpdateParameters) MarshalJSON() ([]byte, error) { 3432 objectMap := make(map[string]interface{}) 3433 if ccoup.CertificateCreateOrUpdateProperties != nil { 3434 objectMap["properties"] = ccoup.CertificateCreateOrUpdateProperties 3435 } 3436 return json.Marshal(objectMap) 3437} 3438 3439// UnmarshalJSON is the custom unmarshaler for CertificateCreateOrUpdateParameters struct. 3440func (ccoup *CertificateCreateOrUpdateParameters) UnmarshalJSON(body []byte) error { 3441 var m map[string]*json.RawMessage 3442 err := json.Unmarshal(body, &m) 3443 if err != nil { 3444 return err 3445 } 3446 for k, v := range m { 3447 switch k { 3448 case "properties": 3449 if v != nil { 3450 var certificateCreateOrUpdateProperties CertificateCreateOrUpdateProperties 3451 err = json.Unmarshal(*v, &certificateCreateOrUpdateProperties) 3452 if err != nil { 3453 return err 3454 } 3455 ccoup.CertificateCreateOrUpdateProperties = &certificateCreateOrUpdateProperties 3456 } 3457 } 3458 } 3459 3460 return nil 3461} 3462 3463// CertificateCreateOrUpdateProperties parameters supplied to the CreateOrUpdate certificate operation. 3464type CertificateCreateOrUpdateProperties struct { 3465 // Data - Base 64 encoded certificate using the application/x-pkcs12 representation. 3466 Data *string `json:"data,omitempty"` 3467 // Password - Password for the Certificate 3468 Password *string `json:"password,omitempty"` 3469} 3470 3471// CertificateInformation SSL certificate information. 3472type CertificateInformation struct { 3473 autorest.Response `json:"-"` 3474 // 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. 3475 Expiry *date.Time `json:"expiry,omitempty"` 3476 // Thumbprint - Thumbprint of the certificate. 3477 Thumbprint *string `json:"thumbprint,omitempty"` 3478 // Subject - Subject of the certificate. 3479 Subject *string `json:"subject,omitempty"` 3480} 3481 3482// ConnectivityStatusContract details about connectivity to a resource. 3483type ConnectivityStatusContract struct { 3484 // 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. 3485 Name *string `json:"name,omitempty"` 3486 // Status - Resource Connectivity Status Type identifier. Possible values include: 'Initializing', 'Success', 'Failure' 3487 Status ConnectivityStatusType `json:"status,omitempty"` 3488 // Error - Error details of the connectivity to the resource. 3489 Error *string `json:"error,omitempty"` 3490 // LastUpdated - The date when the resource connectivity status was last updated. This status should be updated every 15 minutes. If this status has not been updated, then it means that the service has lost network connectivity to the resource, from inside the Virtual Network.The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. 3491 LastUpdated *date.Time `json:"lastUpdated,omitempty"` 3492 // 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. 3493 LastStatusChange *date.Time `json:"lastStatusChange,omitempty"` 3494} 3495 3496// CurrentUserIdentity ... 3497type CurrentUserIdentity struct { 3498 // ID - API Management service user id. 3499 ID *string `json:"id,omitempty"` 3500} 3501 3502// DeployConfigurationParameters parameters supplied to the Deploy Configuration operation. 3503type DeployConfigurationParameters struct { 3504 // Branch - The name of the Git branch from which the configuration is to be deployed to the configuration database. 3505 Branch *string `json:"branch,omitempty"` 3506 // Force - The value enforcing deleting subscriptions to products that are deleted in this update. 3507 Force *bool `json:"force,omitempty"` 3508} 3509 3510// DiagnosticCollection paged Diagnostic list representation. 3511type DiagnosticCollection struct { 3512 autorest.Response `json:"-"` 3513 // Value - Page values. 3514 Value *[]DiagnosticContract `json:"value,omitempty"` 3515 // NextLink - Next page link if any. 3516 NextLink *string `json:"nextLink,omitempty"` 3517} 3518 3519// DiagnosticCollectionIterator provides access to a complete listing of DiagnosticContract values. 3520type DiagnosticCollectionIterator struct { 3521 i int 3522 page DiagnosticCollectionPage 3523} 3524 3525// NextWithContext advances to the next value. If there was an error making 3526// the request the iterator does not advance and the error is returned. 3527func (iter *DiagnosticCollectionIterator) NextWithContext(ctx context.Context) (err error) { 3528 if tracing.IsEnabled() { 3529 ctx = tracing.StartSpan(ctx, fqdn+"/DiagnosticCollectionIterator.NextWithContext") 3530 defer func() { 3531 sc := -1 3532 if iter.Response().Response.Response != nil { 3533 sc = iter.Response().Response.Response.StatusCode 3534 } 3535 tracing.EndSpan(ctx, sc, err) 3536 }() 3537 } 3538 iter.i++ 3539 if iter.i < len(iter.page.Values()) { 3540 return nil 3541 } 3542 err = iter.page.NextWithContext(ctx) 3543 if err != nil { 3544 iter.i-- 3545 return err 3546 } 3547 iter.i = 0 3548 return nil 3549} 3550 3551// Next advances to the next value. If there was an error making 3552// the request the iterator does not advance and the error is returned. 3553// Deprecated: Use NextWithContext() instead. 3554func (iter *DiagnosticCollectionIterator) Next() error { 3555 return iter.NextWithContext(context.Background()) 3556} 3557 3558// NotDone returns true if the enumeration should be started or is not yet complete. 3559func (iter DiagnosticCollectionIterator) NotDone() bool { 3560 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 3561} 3562 3563// Response returns the raw server response from the last page request. 3564func (iter DiagnosticCollectionIterator) Response() DiagnosticCollection { 3565 return iter.page.Response() 3566} 3567 3568// Value returns the current value or a zero-initialized value if the 3569// iterator has advanced beyond the end of the collection. 3570func (iter DiagnosticCollectionIterator) Value() DiagnosticContract { 3571 if !iter.page.NotDone() { 3572 return DiagnosticContract{} 3573 } 3574 return iter.page.Values()[iter.i] 3575} 3576 3577// Creates a new instance of the DiagnosticCollectionIterator type. 3578func NewDiagnosticCollectionIterator(page DiagnosticCollectionPage) DiagnosticCollectionIterator { 3579 return DiagnosticCollectionIterator{page: page} 3580} 3581 3582// IsEmpty returns true if the ListResult contains no values. 3583func (dc DiagnosticCollection) IsEmpty() bool { 3584 return dc.Value == nil || len(*dc.Value) == 0 3585} 3586 3587// diagnosticCollectionPreparer prepares a request to retrieve the next set of results. 3588// It returns nil if no more results exist. 3589func (dc DiagnosticCollection) diagnosticCollectionPreparer(ctx context.Context) (*http.Request, error) { 3590 if dc.NextLink == nil || len(to.String(dc.NextLink)) < 1 { 3591 return nil, nil 3592 } 3593 return autorest.Prepare((&http.Request{}).WithContext(ctx), 3594 autorest.AsJSON(), 3595 autorest.AsGet(), 3596 autorest.WithBaseURL(to.String(dc.NextLink))) 3597} 3598 3599// DiagnosticCollectionPage contains a page of DiagnosticContract values. 3600type DiagnosticCollectionPage struct { 3601 fn func(context.Context, DiagnosticCollection) (DiagnosticCollection, error) 3602 dc DiagnosticCollection 3603} 3604 3605// NextWithContext advances to the next page of values. If there was an error making 3606// the request the page does not advance and the error is returned. 3607func (page *DiagnosticCollectionPage) NextWithContext(ctx context.Context) (err error) { 3608 if tracing.IsEnabled() { 3609 ctx = tracing.StartSpan(ctx, fqdn+"/DiagnosticCollectionPage.NextWithContext") 3610 defer func() { 3611 sc := -1 3612 if page.Response().Response.Response != nil { 3613 sc = page.Response().Response.Response.StatusCode 3614 } 3615 tracing.EndSpan(ctx, sc, err) 3616 }() 3617 } 3618 next, err := page.fn(ctx, page.dc) 3619 if err != nil { 3620 return err 3621 } 3622 page.dc = next 3623 return nil 3624} 3625 3626// Next advances to the next page of values. If there was an error making 3627// the request the page does not advance and the error is returned. 3628// Deprecated: Use NextWithContext() instead. 3629func (page *DiagnosticCollectionPage) Next() error { 3630 return page.NextWithContext(context.Background()) 3631} 3632 3633// NotDone returns true if the page enumeration should be started or is not yet complete. 3634func (page DiagnosticCollectionPage) NotDone() bool { 3635 return !page.dc.IsEmpty() 3636} 3637 3638// Response returns the raw server response from the last page request. 3639func (page DiagnosticCollectionPage) Response() DiagnosticCollection { 3640 return page.dc 3641} 3642 3643// Values returns the slice of values for the current page or nil if there are no values. 3644func (page DiagnosticCollectionPage) Values() []DiagnosticContract { 3645 if page.dc.IsEmpty() { 3646 return nil 3647 } 3648 return *page.dc.Value 3649} 3650 3651// Creates a new instance of the DiagnosticCollectionPage type. 3652func NewDiagnosticCollectionPage(getNextPage func(context.Context, DiagnosticCollection) (DiagnosticCollection, error)) DiagnosticCollectionPage { 3653 return DiagnosticCollectionPage{fn: getNextPage} 3654} 3655 3656// DiagnosticContract diagnostic details. 3657type DiagnosticContract struct { 3658 autorest.Response `json:"-"` 3659 // DiagnosticContractProperties - Diagnostic entity contract properties. 3660 *DiagnosticContractProperties `json:"properties,omitempty"` 3661 // ID - READ-ONLY; Resource ID. 3662 ID *string `json:"id,omitempty"` 3663 // Name - READ-ONLY; Resource name. 3664 Name *string `json:"name,omitempty"` 3665 // Type - READ-ONLY; Resource type for API Management resource. 3666 Type *string `json:"type,omitempty"` 3667} 3668 3669// MarshalJSON is the custom marshaler for DiagnosticContract. 3670func (dc DiagnosticContract) MarshalJSON() ([]byte, error) { 3671 objectMap := make(map[string]interface{}) 3672 if dc.DiagnosticContractProperties != nil { 3673 objectMap["properties"] = dc.DiagnosticContractProperties 3674 } 3675 return json.Marshal(objectMap) 3676} 3677 3678// UnmarshalJSON is the custom unmarshaler for DiagnosticContract struct. 3679func (dc *DiagnosticContract) UnmarshalJSON(body []byte) error { 3680 var m map[string]*json.RawMessage 3681 err := json.Unmarshal(body, &m) 3682 if err != nil { 3683 return err 3684 } 3685 for k, v := range m { 3686 switch k { 3687 case "properties": 3688 if v != nil { 3689 var diagnosticContractProperties DiagnosticContractProperties 3690 err = json.Unmarshal(*v, &diagnosticContractProperties) 3691 if err != nil { 3692 return err 3693 } 3694 dc.DiagnosticContractProperties = &diagnosticContractProperties 3695 } 3696 case "id": 3697 if v != nil { 3698 var ID string 3699 err = json.Unmarshal(*v, &ID) 3700 if err != nil { 3701 return err 3702 } 3703 dc.ID = &ID 3704 } 3705 case "name": 3706 if v != nil { 3707 var name string 3708 err = json.Unmarshal(*v, &name) 3709 if err != nil { 3710 return err 3711 } 3712 dc.Name = &name 3713 } 3714 case "type": 3715 if v != nil { 3716 var typeVar string 3717 err = json.Unmarshal(*v, &typeVar) 3718 if err != nil { 3719 return err 3720 } 3721 dc.Type = &typeVar 3722 } 3723 } 3724 } 3725 3726 return nil 3727} 3728 3729// DiagnosticContractProperties diagnostic Entity Properties 3730type DiagnosticContractProperties struct { 3731 // AlwaysLog - Specifies for what type of messages sampling settings should not apply. Possible values include: 'AllErrors' 3732 AlwaysLog AlwaysLog `json:"alwaysLog,omitempty"` 3733 // LoggerID - Resource Id of a target logger. 3734 LoggerID *string `json:"loggerId,omitempty"` 3735 // Sampling - Sampling settings for Diagnostic. 3736 Sampling *SamplingSettings `json:"sampling,omitempty"` 3737 // Frontend - Diagnostic settings for incoming/outgoing HTTP messages to the Gateway. 3738 Frontend *PipelineDiagnosticSettings `json:"frontend,omitempty"` 3739 // Backend - Diagnostic settings for incoming/outgoing HTTP messages to the Backend 3740 Backend *PipelineDiagnosticSettings `json:"backend,omitempty"` 3741 // EnableHTTPCorrelationHeaders - Whether to process Correlation Headers coming to Api Management Service. Only applicable to Application Insights diagnostics. Default is true. 3742 EnableHTTPCorrelationHeaders *bool `json:"enableHttpCorrelationHeaders,omitempty"` 3743} 3744 3745// EmailTemplateCollection paged email template list representation. 3746type EmailTemplateCollection struct { 3747 autorest.Response `json:"-"` 3748 // Value - Page values. 3749 Value *[]EmailTemplateContract `json:"value,omitempty"` 3750 // NextLink - Next page link if any. 3751 NextLink *string `json:"nextLink,omitempty"` 3752} 3753 3754// EmailTemplateCollectionIterator provides access to a complete listing of EmailTemplateContract values. 3755type EmailTemplateCollectionIterator struct { 3756 i int 3757 page EmailTemplateCollectionPage 3758} 3759 3760// NextWithContext advances to the next value. If there was an error making 3761// the request the iterator does not advance and the error is returned. 3762func (iter *EmailTemplateCollectionIterator) NextWithContext(ctx context.Context) (err error) { 3763 if tracing.IsEnabled() { 3764 ctx = tracing.StartSpan(ctx, fqdn+"/EmailTemplateCollectionIterator.NextWithContext") 3765 defer func() { 3766 sc := -1 3767 if iter.Response().Response.Response != nil { 3768 sc = iter.Response().Response.Response.StatusCode 3769 } 3770 tracing.EndSpan(ctx, sc, err) 3771 }() 3772 } 3773 iter.i++ 3774 if iter.i < len(iter.page.Values()) { 3775 return nil 3776 } 3777 err = iter.page.NextWithContext(ctx) 3778 if err != nil { 3779 iter.i-- 3780 return err 3781 } 3782 iter.i = 0 3783 return nil 3784} 3785 3786// Next advances to the next value. If there was an error making 3787// the request the iterator does not advance and the error is returned. 3788// Deprecated: Use NextWithContext() instead. 3789func (iter *EmailTemplateCollectionIterator) Next() error { 3790 return iter.NextWithContext(context.Background()) 3791} 3792 3793// NotDone returns true if the enumeration should be started or is not yet complete. 3794func (iter EmailTemplateCollectionIterator) NotDone() bool { 3795 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 3796} 3797 3798// Response returns the raw server response from the last page request. 3799func (iter EmailTemplateCollectionIterator) Response() EmailTemplateCollection { 3800 return iter.page.Response() 3801} 3802 3803// Value returns the current value or a zero-initialized value if the 3804// iterator has advanced beyond the end of the collection. 3805func (iter EmailTemplateCollectionIterator) Value() EmailTemplateContract { 3806 if !iter.page.NotDone() { 3807 return EmailTemplateContract{} 3808 } 3809 return iter.page.Values()[iter.i] 3810} 3811 3812// Creates a new instance of the EmailTemplateCollectionIterator type. 3813func NewEmailTemplateCollectionIterator(page EmailTemplateCollectionPage) EmailTemplateCollectionIterator { 3814 return EmailTemplateCollectionIterator{page: page} 3815} 3816 3817// IsEmpty returns true if the ListResult contains no values. 3818func (etc EmailTemplateCollection) IsEmpty() bool { 3819 return etc.Value == nil || len(*etc.Value) == 0 3820} 3821 3822// emailTemplateCollectionPreparer prepares a request to retrieve the next set of results. 3823// It returns nil if no more results exist. 3824func (etc EmailTemplateCollection) emailTemplateCollectionPreparer(ctx context.Context) (*http.Request, error) { 3825 if etc.NextLink == nil || len(to.String(etc.NextLink)) < 1 { 3826 return nil, nil 3827 } 3828 return autorest.Prepare((&http.Request{}).WithContext(ctx), 3829 autorest.AsJSON(), 3830 autorest.AsGet(), 3831 autorest.WithBaseURL(to.String(etc.NextLink))) 3832} 3833 3834// EmailTemplateCollectionPage contains a page of EmailTemplateContract values. 3835type EmailTemplateCollectionPage struct { 3836 fn func(context.Context, EmailTemplateCollection) (EmailTemplateCollection, error) 3837 etc EmailTemplateCollection 3838} 3839 3840// NextWithContext advances to the next page of values. If there was an error making 3841// the request the page does not advance and the error is returned. 3842func (page *EmailTemplateCollectionPage) NextWithContext(ctx context.Context) (err error) { 3843 if tracing.IsEnabled() { 3844 ctx = tracing.StartSpan(ctx, fqdn+"/EmailTemplateCollectionPage.NextWithContext") 3845 defer func() { 3846 sc := -1 3847 if page.Response().Response.Response != nil { 3848 sc = page.Response().Response.Response.StatusCode 3849 } 3850 tracing.EndSpan(ctx, sc, err) 3851 }() 3852 } 3853 next, err := page.fn(ctx, page.etc) 3854 if err != nil { 3855 return err 3856 } 3857 page.etc = next 3858 return nil 3859} 3860 3861// Next advances to the next page of values. If there was an error making 3862// the request the page does not advance and the error is returned. 3863// Deprecated: Use NextWithContext() instead. 3864func (page *EmailTemplateCollectionPage) Next() error { 3865 return page.NextWithContext(context.Background()) 3866} 3867 3868// NotDone returns true if the page enumeration should be started or is not yet complete. 3869func (page EmailTemplateCollectionPage) NotDone() bool { 3870 return !page.etc.IsEmpty() 3871} 3872 3873// Response returns the raw server response from the last page request. 3874func (page EmailTemplateCollectionPage) Response() EmailTemplateCollection { 3875 return page.etc 3876} 3877 3878// Values returns the slice of values for the current page or nil if there are no values. 3879func (page EmailTemplateCollectionPage) Values() []EmailTemplateContract { 3880 if page.etc.IsEmpty() { 3881 return nil 3882 } 3883 return *page.etc.Value 3884} 3885 3886// Creates a new instance of the EmailTemplateCollectionPage type. 3887func NewEmailTemplateCollectionPage(getNextPage func(context.Context, EmailTemplateCollection) (EmailTemplateCollection, error)) EmailTemplateCollectionPage { 3888 return EmailTemplateCollectionPage{fn: getNextPage} 3889} 3890 3891// EmailTemplateContract email Template details. 3892type EmailTemplateContract struct { 3893 autorest.Response `json:"-"` 3894 // EmailTemplateContractProperties - Email Template entity contract properties. 3895 *EmailTemplateContractProperties `json:"properties,omitempty"` 3896 // ID - READ-ONLY; Resource ID. 3897 ID *string `json:"id,omitempty"` 3898 // Name - READ-ONLY; Resource name. 3899 Name *string `json:"name,omitempty"` 3900 // Type - READ-ONLY; Resource type for API Management resource. 3901 Type *string `json:"type,omitempty"` 3902} 3903 3904// MarshalJSON is the custom marshaler for EmailTemplateContract. 3905func (etc EmailTemplateContract) MarshalJSON() ([]byte, error) { 3906 objectMap := make(map[string]interface{}) 3907 if etc.EmailTemplateContractProperties != nil { 3908 objectMap["properties"] = etc.EmailTemplateContractProperties 3909 } 3910 return json.Marshal(objectMap) 3911} 3912 3913// UnmarshalJSON is the custom unmarshaler for EmailTemplateContract struct. 3914func (etc *EmailTemplateContract) UnmarshalJSON(body []byte) error { 3915 var m map[string]*json.RawMessage 3916 err := json.Unmarshal(body, &m) 3917 if err != nil { 3918 return err 3919 } 3920 for k, v := range m { 3921 switch k { 3922 case "properties": 3923 if v != nil { 3924 var emailTemplateContractProperties EmailTemplateContractProperties 3925 err = json.Unmarshal(*v, &emailTemplateContractProperties) 3926 if err != nil { 3927 return err 3928 } 3929 etc.EmailTemplateContractProperties = &emailTemplateContractProperties 3930 } 3931 case "id": 3932 if v != nil { 3933 var ID string 3934 err = json.Unmarshal(*v, &ID) 3935 if err != nil { 3936 return err 3937 } 3938 etc.ID = &ID 3939 } 3940 case "name": 3941 if v != nil { 3942 var name string 3943 err = json.Unmarshal(*v, &name) 3944 if err != nil { 3945 return err 3946 } 3947 etc.Name = &name 3948 } 3949 case "type": 3950 if v != nil { 3951 var typeVar string 3952 err = json.Unmarshal(*v, &typeVar) 3953 if err != nil { 3954 return err 3955 } 3956 etc.Type = &typeVar 3957 } 3958 } 3959 } 3960 3961 return nil 3962} 3963 3964// EmailTemplateContractProperties email Template Contract properties. 3965type EmailTemplateContractProperties struct { 3966 // Subject - Subject of the Template. 3967 Subject *string `json:"subject,omitempty"` 3968 // Body - Email Template Body. This should be a valid XDocument 3969 Body *string `json:"body,omitempty"` 3970 // Title - Title of the Template. 3971 Title *string `json:"title,omitempty"` 3972 // Description - Description of the Email Template. 3973 Description *string `json:"description,omitempty"` 3974 // IsDefault - READ-ONLY; Whether the template is the default template provided by Api Management or has been edited. 3975 IsDefault *bool `json:"isDefault,omitempty"` 3976 // Parameters - Email Template Parameter values. 3977 Parameters *[]EmailTemplateParametersContractProperties `json:"parameters,omitempty"` 3978} 3979 3980// EmailTemplateParametersContractProperties email Template Parameter contract. 3981type EmailTemplateParametersContractProperties struct { 3982 // Name - Template parameter name. 3983 Name *string `json:"name,omitempty"` 3984 // Title - Template parameter title. 3985 Title *string `json:"title,omitempty"` 3986 // Description - Template parameter description. 3987 Description *string `json:"description,omitempty"` 3988} 3989 3990// EmailTemplateUpdateParameterProperties email Template Update Contract properties. 3991type EmailTemplateUpdateParameterProperties struct { 3992 // Subject - Subject of the Template. 3993 Subject *string `json:"subject,omitempty"` 3994 // Title - Title of the Template. 3995 Title *string `json:"title,omitempty"` 3996 // Description - Description of the Email Template. 3997 Description *string `json:"description,omitempty"` 3998 // Body - Email Template Body. This should be a valid XDocument 3999 Body *string `json:"body,omitempty"` 4000 // Parameters - Email Template Parameter values. 4001 Parameters *[]EmailTemplateParametersContractProperties `json:"parameters,omitempty"` 4002} 4003 4004// EmailTemplateUpdateParameters email Template update Parameters. 4005type EmailTemplateUpdateParameters struct { 4006 // EmailTemplateUpdateParameterProperties - Email Template Update contract properties. 4007 *EmailTemplateUpdateParameterProperties `json:"properties,omitempty"` 4008} 4009 4010// MarshalJSON is the custom marshaler for EmailTemplateUpdateParameters. 4011func (etup EmailTemplateUpdateParameters) MarshalJSON() ([]byte, error) { 4012 objectMap := make(map[string]interface{}) 4013 if etup.EmailTemplateUpdateParameterProperties != nil { 4014 objectMap["properties"] = etup.EmailTemplateUpdateParameterProperties 4015 } 4016 return json.Marshal(objectMap) 4017} 4018 4019// UnmarshalJSON is the custom unmarshaler for EmailTemplateUpdateParameters struct. 4020func (etup *EmailTemplateUpdateParameters) UnmarshalJSON(body []byte) error { 4021 var m map[string]*json.RawMessage 4022 err := json.Unmarshal(body, &m) 4023 if err != nil { 4024 return err 4025 } 4026 for k, v := range m { 4027 switch k { 4028 case "properties": 4029 if v != nil { 4030 var emailTemplateUpdateParameterProperties EmailTemplateUpdateParameterProperties 4031 err = json.Unmarshal(*v, &emailTemplateUpdateParameterProperties) 4032 if err != nil { 4033 return err 4034 } 4035 etup.EmailTemplateUpdateParameterProperties = &emailTemplateUpdateParameterProperties 4036 } 4037 } 4038 } 4039 4040 return nil 4041} 4042 4043// ErrorFieldContract error Field contract. 4044type ErrorFieldContract struct { 4045 // Code - Property level error code. 4046 Code *string `json:"code,omitempty"` 4047 // Message - Human-readable representation of property-level error. 4048 Message *string `json:"message,omitempty"` 4049 // Target - Property name. 4050 Target *string `json:"target,omitempty"` 4051} 4052 4053// ErrorResponse error Response. 4054type ErrorResponse struct { 4055 // ErrorResponseBody - Properties of the Error Response. 4056 *ErrorResponseBody `json:"error,omitempty"` 4057} 4058 4059// MarshalJSON is the custom marshaler for ErrorResponse. 4060func (er ErrorResponse) MarshalJSON() ([]byte, error) { 4061 objectMap := make(map[string]interface{}) 4062 if er.ErrorResponseBody != nil { 4063 objectMap["error"] = er.ErrorResponseBody 4064 } 4065 return json.Marshal(objectMap) 4066} 4067 4068// UnmarshalJSON is the custom unmarshaler for ErrorResponse struct. 4069func (er *ErrorResponse) UnmarshalJSON(body []byte) error { 4070 var m map[string]*json.RawMessage 4071 err := json.Unmarshal(body, &m) 4072 if err != nil { 4073 return err 4074 } 4075 for k, v := range m { 4076 switch k { 4077 case "error": 4078 if v != nil { 4079 var errorResponseBody ErrorResponseBody 4080 err = json.Unmarshal(*v, &errorResponseBody) 4081 if err != nil { 4082 return err 4083 } 4084 er.ErrorResponseBody = &errorResponseBody 4085 } 4086 } 4087 } 4088 4089 return nil 4090} 4091 4092// ErrorResponseBody error Body contract. 4093type ErrorResponseBody struct { 4094 // Code - Service-defined error code. This code serves as a sub-status for the HTTP error code specified in the response. 4095 Code *string `json:"code,omitempty"` 4096 // Message - Human-readable representation of the error. 4097 Message *string `json:"message,omitempty"` 4098 // Details - The list of invalid fields send in request, in case of validation error. 4099 Details *[]ErrorFieldContract `json:"details,omitempty"` 4100} 4101 4102// GenerateSsoURLResult generate SSO Url operations response details. 4103type GenerateSsoURLResult struct { 4104 autorest.Response `json:"-"` 4105 // Value - Redirect Url containing the SSO URL value. 4106 Value *string `json:"value,omitempty"` 4107} 4108 4109// GroupCollection paged Group list representation. 4110type GroupCollection struct { 4111 autorest.Response `json:"-"` 4112 // Value - Page values. 4113 Value *[]GroupContract `json:"value,omitempty"` 4114 // NextLink - Next page link if any. 4115 NextLink *string `json:"nextLink,omitempty"` 4116} 4117 4118// GroupCollectionIterator provides access to a complete listing of GroupContract values. 4119type GroupCollectionIterator struct { 4120 i int 4121 page GroupCollectionPage 4122} 4123 4124// NextWithContext advances to the next value. If there was an error making 4125// the request the iterator does not advance and the error is returned. 4126func (iter *GroupCollectionIterator) NextWithContext(ctx context.Context) (err error) { 4127 if tracing.IsEnabled() { 4128 ctx = tracing.StartSpan(ctx, fqdn+"/GroupCollectionIterator.NextWithContext") 4129 defer func() { 4130 sc := -1 4131 if iter.Response().Response.Response != nil { 4132 sc = iter.Response().Response.Response.StatusCode 4133 } 4134 tracing.EndSpan(ctx, sc, err) 4135 }() 4136 } 4137 iter.i++ 4138 if iter.i < len(iter.page.Values()) { 4139 return nil 4140 } 4141 err = iter.page.NextWithContext(ctx) 4142 if err != nil { 4143 iter.i-- 4144 return err 4145 } 4146 iter.i = 0 4147 return nil 4148} 4149 4150// Next advances to the next value. If there was an error making 4151// the request the iterator does not advance and the error is returned. 4152// Deprecated: Use NextWithContext() instead. 4153func (iter *GroupCollectionIterator) Next() error { 4154 return iter.NextWithContext(context.Background()) 4155} 4156 4157// NotDone returns true if the enumeration should be started or is not yet complete. 4158func (iter GroupCollectionIterator) NotDone() bool { 4159 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 4160} 4161 4162// Response returns the raw server response from the last page request. 4163func (iter GroupCollectionIterator) Response() GroupCollection { 4164 return iter.page.Response() 4165} 4166 4167// Value returns the current value or a zero-initialized value if the 4168// iterator has advanced beyond the end of the collection. 4169func (iter GroupCollectionIterator) Value() GroupContract { 4170 if !iter.page.NotDone() { 4171 return GroupContract{} 4172 } 4173 return iter.page.Values()[iter.i] 4174} 4175 4176// Creates a new instance of the GroupCollectionIterator type. 4177func NewGroupCollectionIterator(page GroupCollectionPage) GroupCollectionIterator { 4178 return GroupCollectionIterator{page: page} 4179} 4180 4181// IsEmpty returns true if the ListResult contains no values. 4182func (gc GroupCollection) IsEmpty() bool { 4183 return gc.Value == nil || len(*gc.Value) == 0 4184} 4185 4186// groupCollectionPreparer prepares a request to retrieve the next set of results. 4187// It returns nil if no more results exist. 4188func (gc GroupCollection) groupCollectionPreparer(ctx context.Context) (*http.Request, error) { 4189 if gc.NextLink == nil || len(to.String(gc.NextLink)) < 1 { 4190 return nil, nil 4191 } 4192 return autorest.Prepare((&http.Request{}).WithContext(ctx), 4193 autorest.AsJSON(), 4194 autorest.AsGet(), 4195 autorest.WithBaseURL(to.String(gc.NextLink))) 4196} 4197 4198// GroupCollectionPage contains a page of GroupContract values. 4199type GroupCollectionPage struct { 4200 fn func(context.Context, GroupCollection) (GroupCollection, error) 4201 gc GroupCollection 4202} 4203 4204// NextWithContext advances to the next page of values. If there was an error making 4205// the request the page does not advance and the error is returned. 4206func (page *GroupCollectionPage) NextWithContext(ctx context.Context) (err error) { 4207 if tracing.IsEnabled() { 4208 ctx = tracing.StartSpan(ctx, fqdn+"/GroupCollectionPage.NextWithContext") 4209 defer func() { 4210 sc := -1 4211 if page.Response().Response.Response != nil { 4212 sc = page.Response().Response.Response.StatusCode 4213 } 4214 tracing.EndSpan(ctx, sc, err) 4215 }() 4216 } 4217 next, err := page.fn(ctx, page.gc) 4218 if err != nil { 4219 return err 4220 } 4221 page.gc = next 4222 return nil 4223} 4224 4225// Next advances to the next page of values. If there was an error making 4226// the request the page does not advance and the error is returned. 4227// Deprecated: Use NextWithContext() instead. 4228func (page *GroupCollectionPage) Next() error { 4229 return page.NextWithContext(context.Background()) 4230} 4231 4232// NotDone returns true if the page enumeration should be started or is not yet complete. 4233func (page GroupCollectionPage) NotDone() bool { 4234 return !page.gc.IsEmpty() 4235} 4236 4237// Response returns the raw server response from the last page request. 4238func (page GroupCollectionPage) Response() GroupCollection { 4239 return page.gc 4240} 4241 4242// Values returns the slice of values for the current page or nil if there are no values. 4243func (page GroupCollectionPage) Values() []GroupContract { 4244 if page.gc.IsEmpty() { 4245 return nil 4246 } 4247 return *page.gc.Value 4248} 4249 4250// Creates a new instance of the GroupCollectionPage type. 4251func NewGroupCollectionPage(getNextPage func(context.Context, GroupCollection) (GroupCollection, error)) GroupCollectionPage { 4252 return GroupCollectionPage{fn: getNextPage} 4253} 4254 4255// GroupContract contract details. 4256type GroupContract struct { 4257 autorest.Response `json:"-"` 4258 // GroupContractProperties - Group entity contract properties. 4259 *GroupContractProperties `json:"properties,omitempty"` 4260 // ID - READ-ONLY; Resource ID. 4261 ID *string `json:"id,omitempty"` 4262 // Name - READ-ONLY; Resource name. 4263 Name *string `json:"name,omitempty"` 4264 // Type - READ-ONLY; Resource type for API Management resource. 4265 Type *string `json:"type,omitempty"` 4266} 4267 4268// MarshalJSON is the custom marshaler for GroupContract. 4269func (gc GroupContract) MarshalJSON() ([]byte, error) { 4270 objectMap := make(map[string]interface{}) 4271 if gc.GroupContractProperties != nil { 4272 objectMap["properties"] = gc.GroupContractProperties 4273 } 4274 return json.Marshal(objectMap) 4275} 4276 4277// UnmarshalJSON is the custom unmarshaler for GroupContract struct. 4278func (gc *GroupContract) UnmarshalJSON(body []byte) error { 4279 var m map[string]*json.RawMessage 4280 err := json.Unmarshal(body, &m) 4281 if err != nil { 4282 return err 4283 } 4284 for k, v := range m { 4285 switch k { 4286 case "properties": 4287 if v != nil { 4288 var groupContractProperties GroupContractProperties 4289 err = json.Unmarshal(*v, &groupContractProperties) 4290 if err != nil { 4291 return err 4292 } 4293 gc.GroupContractProperties = &groupContractProperties 4294 } 4295 case "id": 4296 if v != nil { 4297 var ID string 4298 err = json.Unmarshal(*v, &ID) 4299 if err != nil { 4300 return err 4301 } 4302 gc.ID = &ID 4303 } 4304 case "name": 4305 if v != nil { 4306 var name string 4307 err = json.Unmarshal(*v, &name) 4308 if err != nil { 4309 return err 4310 } 4311 gc.Name = &name 4312 } 4313 case "type": 4314 if v != nil { 4315 var typeVar string 4316 err = json.Unmarshal(*v, &typeVar) 4317 if err != nil { 4318 return err 4319 } 4320 gc.Type = &typeVar 4321 } 4322 } 4323 } 4324 4325 return nil 4326} 4327 4328// GroupContractProperties group contract Properties. 4329type GroupContractProperties struct { 4330 // DisplayName - Group name. 4331 DisplayName *string `json:"displayName,omitempty"` 4332 // Description - Group description. Can contain HTML formatting tags. 4333 Description *string `json:"description,omitempty"` 4334 // BuiltIn - READ-ONLY; true if the group is one of the three system groups (Administrators, Developers, or Guests); otherwise false. 4335 BuiltIn *bool `json:"builtIn,omitempty"` 4336 // Type - Group type. Possible values include: 'Custom', 'System', 'External' 4337 Type GroupType `json:"type,omitempty"` 4338 // ExternalID - For external groups, this property contains the id of the group from the external identity provider, e.g. for Azure Active Directory `aad://<tenant>.onmicrosoft.com/groups/<group object id>`; otherwise the value is null. 4339 ExternalID *string `json:"externalId,omitempty"` 4340} 4341 4342// GroupCreateParameters parameters supplied to the Create Group operation. 4343type GroupCreateParameters struct { 4344 // GroupCreateParametersProperties - Properties supplied to Create Group operation. 4345 *GroupCreateParametersProperties `json:"properties,omitempty"` 4346} 4347 4348// MarshalJSON is the custom marshaler for GroupCreateParameters. 4349func (gcp GroupCreateParameters) MarshalJSON() ([]byte, error) { 4350 objectMap := make(map[string]interface{}) 4351 if gcp.GroupCreateParametersProperties != nil { 4352 objectMap["properties"] = gcp.GroupCreateParametersProperties 4353 } 4354 return json.Marshal(objectMap) 4355} 4356 4357// UnmarshalJSON is the custom unmarshaler for GroupCreateParameters struct. 4358func (gcp *GroupCreateParameters) UnmarshalJSON(body []byte) error { 4359 var m map[string]*json.RawMessage 4360 err := json.Unmarshal(body, &m) 4361 if err != nil { 4362 return err 4363 } 4364 for k, v := range m { 4365 switch k { 4366 case "properties": 4367 if v != nil { 4368 var groupCreateParametersProperties GroupCreateParametersProperties 4369 err = json.Unmarshal(*v, &groupCreateParametersProperties) 4370 if err != nil { 4371 return err 4372 } 4373 gcp.GroupCreateParametersProperties = &groupCreateParametersProperties 4374 } 4375 } 4376 } 4377 4378 return nil 4379} 4380 4381// GroupCreateParametersProperties parameters supplied to the Create Group operation. 4382type GroupCreateParametersProperties struct { 4383 // DisplayName - Group name. 4384 DisplayName *string `json:"displayName,omitempty"` 4385 // Description - Group description. 4386 Description *string `json:"description,omitempty"` 4387 // Type - Group type. Possible values include: 'Custom', 'System', 'External' 4388 Type GroupType `json:"type,omitempty"` 4389 // 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. 4390 ExternalID *string `json:"externalId,omitempty"` 4391} 4392 4393// GroupUpdateParameters parameters supplied to the Update Group operation. 4394type GroupUpdateParameters struct { 4395 // GroupUpdateParametersProperties - Group entity update contract properties. 4396 *GroupUpdateParametersProperties `json:"properties,omitempty"` 4397} 4398 4399// MarshalJSON is the custom marshaler for GroupUpdateParameters. 4400func (gup GroupUpdateParameters) MarshalJSON() ([]byte, error) { 4401 objectMap := make(map[string]interface{}) 4402 if gup.GroupUpdateParametersProperties != nil { 4403 objectMap["properties"] = gup.GroupUpdateParametersProperties 4404 } 4405 return json.Marshal(objectMap) 4406} 4407 4408// UnmarshalJSON is the custom unmarshaler for GroupUpdateParameters struct. 4409func (gup *GroupUpdateParameters) UnmarshalJSON(body []byte) error { 4410 var m map[string]*json.RawMessage 4411 err := json.Unmarshal(body, &m) 4412 if err != nil { 4413 return err 4414 } 4415 for k, v := range m { 4416 switch k { 4417 case "properties": 4418 if v != nil { 4419 var groupUpdateParametersProperties GroupUpdateParametersProperties 4420 err = json.Unmarshal(*v, &groupUpdateParametersProperties) 4421 if err != nil { 4422 return err 4423 } 4424 gup.GroupUpdateParametersProperties = &groupUpdateParametersProperties 4425 } 4426 } 4427 } 4428 4429 return nil 4430} 4431 4432// GroupUpdateParametersProperties parameters supplied to the Update Group operation. 4433type GroupUpdateParametersProperties struct { 4434 // DisplayName - Group name. 4435 DisplayName *string `json:"displayName,omitempty"` 4436 // Description - Group description. 4437 Description *string `json:"description,omitempty"` 4438 // Type - Group type. Possible values include: 'Custom', 'System', 'External' 4439 Type GroupType `json:"type,omitempty"` 4440 // 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. 4441 ExternalID *string `json:"externalId,omitempty"` 4442} 4443 4444// HostnameConfiguration custom hostname configuration. 4445type HostnameConfiguration struct { 4446 // Type - Hostname type. Possible values include: 'Proxy', 'Portal', 'Management', 'Scm' 4447 Type HostnameType `json:"type,omitempty"` 4448 // HostName - Hostname to configure on the Api Management service. 4449 HostName *string `json:"hostName,omitempty"` 4450 // KeyVaultID - Url to the KeyVault Secret containing the Ssl Certificate. If absolute Url containing version is provided, auto-update of ssl certificate will not work. This requires Api Management service to be configured with MSI. The secret should be of type *application/x-pkcs12* 4451 KeyVaultID *string `json:"keyVaultId,omitempty"` 4452 // EncodedCertificate - Base64 Encoded certificate. 4453 EncodedCertificate *string `json:"encodedCertificate,omitempty"` 4454 // CertificatePassword - Certificate Password. 4455 CertificatePassword *string `json:"certificatePassword,omitempty"` 4456 // DefaultSslBinding - Specify true to setup the certificate associated with this Hostname as the Default SSL Certificate. If a client does not send the SNI header, then this will be the certificate that will be challenged. The property is useful if a service has multiple custom hostname enabled and it needs to decide on the default ssl certificate. The setting only applied to Proxy Hostname Type. 4457 DefaultSslBinding *bool `json:"defaultSslBinding,omitempty"` 4458 // NegotiateClientCertificate - Specify true to always negotiate client certificate on the hostname. Default Value is false. 4459 NegotiateClientCertificate *bool `json:"negotiateClientCertificate,omitempty"` 4460 // Certificate - Certificate information. 4461 Certificate *CertificateInformation `json:"certificate,omitempty"` 4462} 4463 4464// HostnameConfigurationOld custom hostname configuration. 4465type HostnameConfigurationOld struct { 4466 // Type - Hostname type. Possible values include: 'Proxy', 'Portal', 'Management', 'Scm' 4467 Type HostnameType `json:"type,omitempty"` 4468 // Hostname - Hostname to configure. 4469 Hostname *string `json:"hostname,omitempty"` 4470 // Certificate - Certificate information. 4471 Certificate *CertificateInformation `json:"certificate,omitempty"` 4472} 4473 4474// HTTPMessageDiagnostic http message diagnostic settings. 4475type HTTPMessageDiagnostic struct { 4476 // Headers - Array of HTTP Headers to log. 4477 Headers *[]string `json:"headers,omitempty"` 4478 // Body - Body logging settings. 4479 Body *BodyDiagnosticSettings `json:"body,omitempty"` 4480} 4481 4482// IdentityProviderBaseParameters identity Provider Base Parameter Properties. 4483type IdentityProviderBaseParameters struct { 4484 // Type - Identity Provider Type identifier. Possible values include: 'Facebook', 'Google', 'Microsoft', 'Twitter', 'Aad', 'AadB2C' 4485 Type IdentityProviderType `json:"type,omitempty"` 4486 // AllowedTenants - List of Allowed Tenants when configuring Azure Active Directory login. 4487 AllowedTenants *[]string `json:"allowedTenants,omitempty"` 4488 // Authority - OpenID Connect discovery endpoint hostname for AAD or AAD B2C. 4489 Authority *string `json:"authority,omitempty"` 4490 // SignupPolicyName - Signup Policy Name. Only applies to AAD B2C Identity Provider. 4491 SignupPolicyName *string `json:"signupPolicyName,omitempty"` 4492 // SigninPolicyName - Signin Policy Name. Only applies to AAD B2C Identity Provider. 4493 SigninPolicyName *string `json:"signinPolicyName,omitempty"` 4494 // ProfileEditingPolicyName - Profile Editing Policy Name. Only applies to AAD B2C Identity Provider. 4495 ProfileEditingPolicyName *string `json:"profileEditingPolicyName,omitempty"` 4496 // PasswordResetPolicyName - Password Reset Policy Name. Only applies to AAD B2C Identity Provider. 4497 PasswordResetPolicyName *string `json:"passwordResetPolicyName,omitempty"` 4498} 4499 4500// IdentityProviderContract identity Provider details. 4501type IdentityProviderContract struct { 4502 autorest.Response `json:"-"` 4503 // IdentityProviderContractProperties - Identity Provider contract properties. 4504 *IdentityProviderContractProperties `json:"properties,omitempty"` 4505 // ID - READ-ONLY; Resource ID. 4506 ID *string `json:"id,omitempty"` 4507 // Name - READ-ONLY; Resource name. 4508 Name *string `json:"name,omitempty"` 4509 // Type - READ-ONLY; Resource type for API Management resource. 4510 Type *string `json:"type,omitempty"` 4511} 4512 4513// MarshalJSON is the custom marshaler for IdentityProviderContract. 4514func (ipc IdentityProviderContract) MarshalJSON() ([]byte, error) { 4515 objectMap := make(map[string]interface{}) 4516 if ipc.IdentityProviderContractProperties != nil { 4517 objectMap["properties"] = ipc.IdentityProviderContractProperties 4518 } 4519 return json.Marshal(objectMap) 4520} 4521 4522// UnmarshalJSON is the custom unmarshaler for IdentityProviderContract struct. 4523func (ipc *IdentityProviderContract) UnmarshalJSON(body []byte) error { 4524 var m map[string]*json.RawMessage 4525 err := json.Unmarshal(body, &m) 4526 if err != nil { 4527 return err 4528 } 4529 for k, v := range m { 4530 switch k { 4531 case "properties": 4532 if v != nil { 4533 var identityProviderContractProperties IdentityProviderContractProperties 4534 err = json.Unmarshal(*v, &identityProviderContractProperties) 4535 if err != nil { 4536 return err 4537 } 4538 ipc.IdentityProviderContractProperties = &identityProviderContractProperties 4539 } 4540 case "id": 4541 if v != nil { 4542 var ID string 4543 err = json.Unmarshal(*v, &ID) 4544 if err != nil { 4545 return err 4546 } 4547 ipc.ID = &ID 4548 } 4549 case "name": 4550 if v != nil { 4551 var name string 4552 err = json.Unmarshal(*v, &name) 4553 if err != nil { 4554 return err 4555 } 4556 ipc.Name = &name 4557 } 4558 case "type": 4559 if v != nil { 4560 var typeVar string 4561 err = json.Unmarshal(*v, &typeVar) 4562 if err != nil { 4563 return err 4564 } 4565 ipc.Type = &typeVar 4566 } 4567 } 4568 } 4569 4570 return nil 4571} 4572 4573// IdentityProviderContractProperties the external Identity Providers like Facebook, Google, Microsoft, 4574// Twitter or Azure Active Directory which can be used to enable access to the API Management service 4575// developer portal for all users. 4576type IdentityProviderContractProperties struct { 4577 // 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. 4578 ClientID *string `json:"clientId,omitempty"` 4579 // 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. 4580 ClientSecret *string `json:"clientSecret,omitempty"` 4581 // Type - Identity Provider Type identifier. Possible values include: 'Facebook', 'Google', 'Microsoft', 'Twitter', 'Aad', 'AadB2C' 4582 Type IdentityProviderType `json:"type,omitempty"` 4583 // AllowedTenants - List of Allowed Tenants when configuring Azure Active Directory login. 4584 AllowedTenants *[]string `json:"allowedTenants,omitempty"` 4585 // Authority - OpenID Connect discovery endpoint hostname for AAD or AAD B2C. 4586 Authority *string `json:"authority,omitempty"` 4587 // SignupPolicyName - Signup Policy Name. Only applies to AAD B2C Identity Provider. 4588 SignupPolicyName *string `json:"signupPolicyName,omitempty"` 4589 // SigninPolicyName - Signin Policy Name. Only applies to AAD B2C Identity Provider. 4590 SigninPolicyName *string `json:"signinPolicyName,omitempty"` 4591 // ProfileEditingPolicyName - Profile Editing Policy Name. Only applies to AAD B2C Identity Provider. 4592 ProfileEditingPolicyName *string `json:"profileEditingPolicyName,omitempty"` 4593 // PasswordResetPolicyName - Password Reset Policy Name. Only applies to AAD B2C Identity Provider. 4594 PasswordResetPolicyName *string `json:"passwordResetPolicyName,omitempty"` 4595} 4596 4597// IdentityProviderList list of all the Identity Providers configured on the service instance. 4598type IdentityProviderList struct { 4599 autorest.Response `json:"-"` 4600 // Value - Identity Provider configuration values. 4601 Value *[]IdentityProviderContract `json:"value,omitempty"` 4602 // NextLink - Next page link if any. 4603 NextLink *string `json:"nextLink,omitempty"` 4604} 4605 4606// IdentityProviderListIterator provides access to a complete listing of IdentityProviderContract values. 4607type IdentityProviderListIterator struct { 4608 i int 4609 page IdentityProviderListPage 4610} 4611 4612// NextWithContext advances to the next value. If there was an error making 4613// the request the iterator does not advance and the error is returned. 4614func (iter *IdentityProviderListIterator) NextWithContext(ctx context.Context) (err error) { 4615 if tracing.IsEnabled() { 4616 ctx = tracing.StartSpan(ctx, fqdn+"/IdentityProviderListIterator.NextWithContext") 4617 defer func() { 4618 sc := -1 4619 if iter.Response().Response.Response != nil { 4620 sc = iter.Response().Response.Response.StatusCode 4621 } 4622 tracing.EndSpan(ctx, sc, err) 4623 }() 4624 } 4625 iter.i++ 4626 if iter.i < len(iter.page.Values()) { 4627 return nil 4628 } 4629 err = iter.page.NextWithContext(ctx) 4630 if err != nil { 4631 iter.i-- 4632 return err 4633 } 4634 iter.i = 0 4635 return nil 4636} 4637 4638// Next advances to the next value. If there was an error making 4639// the request the iterator does not advance and the error is returned. 4640// Deprecated: Use NextWithContext() instead. 4641func (iter *IdentityProviderListIterator) Next() error { 4642 return iter.NextWithContext(context.Background()) 4643} 4644 4645// NotDone returns true if the enumeration should be started or is not yet complete. 4646func (iter IdentityProviderListIterator) NotDone() bool { 4647 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 4648} 4649 4650// Response returns the raw server response from the last page request. 4651func (iter IdentityProviderListIterator) Response() IdentityProviderList { 4652 return iter.page.Response() 4653} 4654 4655// Value returns the current value or a zero-initialized value if the 4656// iterator has advanced beyond the end of the collection. 4657func (iter IdentityProviderListIterator) Value() IdentityProviderContract { 4658 if !iter.page.NotDone() { 4659 return IdentityProviderContract{} 4660 } 4661 return iter.page.Values()[iter.i] 4662} 4663 4664// Creates a new instance of the IdentityProviderListIterator type. 4665func NewIdentityProviderListIterator(page IdentityProviderListPage) IdentityProviderListIterator { 4666 return IdentityProviderListIterator{page: page} 4667} 4668 4669// IsEmpty returns true if the ListResult contains no values. 4670func (ipl IdentityProviderList) IsEmpty() bool { 4671 return ipl.Value == nil || len(*ipl.Value) == 0 4672} 4673 4674// identityProviderListPreparer prepares a request to retrieve the next set of results. 4675// It returns nil if no more results exist. 4676func (ipl IdentityProviderList) identityProviderListPreparer(ctx context.Context) (*http.Request, error) { 4677 if ipl.NextLink == nil || len(to.String(ipl.NextLink)) < 1 { 4678 return nil, nil 4679 } 4680 return autorest.Prepare((&http.Request{}).WithContext(ctx), 4681 autorest.AsJSON(), 4682 autorest.AsGet(), 4683 autorest.WithBaseURL(to.String(ipl.NextLink))) 4684} 4685 4686// IdentityProviderListPage contains a page of IdentityProviderContract values. 4687type IdentityProviderListPage struct { 4688 fn func(context.Context, IdentityProviderList) (IdentityProviderList, error) 4689 ipl IdentityProviderList 4690} 4691 4692// NextWithContext advances to the next page of values. If there was an error making 4693// the request the page does not advance and the error is returned. 4694func (page *IdentityProviderListPage) NextWithContext(ctx context.Context) (err error) { 4695 if tracing.IsEnabled() { 4696 ctx = tracing.StartSpan(ctx, fqdn+"/IdentityProviderListPage.NextWithContext") 4697 defer func() { 4698 sc := -1 4699 if page.Response().Response.Response != nil { 4700 sc = page.Response().Response.Response.StatusCode 4701 } 4702 tracing.EndSpan(ctx, sc, err) 4703 }() 4704 } 4705 next, err := page.fn(ctx, page.ipl) 4706 if err != nil { 4707 return err 4708 } 4709 page.ipl = next 4710 return nil 4711} 4712 4713// Next advances to the next page of values. If there was an error making 4714// the request the page does not advance and the error is returned. 4715// Deprecated: Use NextWithContext() instead. 4716func (page *IdentityProviderListPage) Next() error { 4717 return page.NextWithContext(context.Background()) 4718} 4719 4720// NotDone returns true if the page enumeration should be started or is not yet complete. 4721func (page IdentityProviderListPage) NotDone() bool { 4722 return !page.ipl.IsEmpty() 4723} 4724 4725// Response returns the raw server response from the last page request. 4726func (page IdentityProviderListPage) Response() IdentityProviderList { 4727 return page.ipl 4728} 4729 4730// Values returns the slice of values for the current page or nil if there are no values. 4731func (page IdentityProviderListPage) Values() []IdentityProviderContract { 4732 if page.ipl.IsEmpty() { 4733 return nil 4734 } 4735 return *page.ipl.Value 4736} 4737 4738// Creates a new instance of the IdentityProviderListPage type. 4739func NewIdentityProviderListPage(getNextPage func(context.Context, IdentityProviderList) (IdentityProviderList, error)) IdentityProviderListPage { 4740 return IdentityProviderListPage{fn: getNextPage} 4741} 4742 4743// IdentityProviderUpdateParameters parameters supplied to update Identity Provider 4744type IdentityProviderUpdateParameters struct { 4745 // IdentityProviderUpdateProperties - Identity Provider update properties. 4746 *IdentityProviderUpdateProperties `json:"properties,omitempty"` 4747} 4748 4749// MarshalJSON is the custom marshaler for IdentityProviderUpdateParameters. 4750func (ipup IdentityProviderUpdateParameters) MarshalJSON() ([]byte, error) { 4751 objectMap := make(map[string]interface{}) 4752 if ipup.IdentityProviderUpdateProperties != nil { 4753 objectMap["properties"] = ipup.IdentityProviderUpdateProperties 4754 } 4755 return json.Marshal(objectMap) 4756} 4757 4758// UnmarshalJSON is the custom unmarshaler for IdentityProviderUpdateParameters struct. 4759func (ipup *IdentityProviderUpdateParameters) UnmarshalJSON(body []byte) error { 4760 var m map[string]*json.RawMessage 4761 err := json.Unmarshal(body, &m) 4762 if err != nil { 4763 return err 4764 } 4765 for k, v := range m { 4766 switch k { 4767 case "properties": 4768 if v != nil { 4769 var identityProviderUpdateProperties IdentityProviderUpdateProperties 4770 err = json.Unmarshal(*v, &identityProviderUpdateProperties) 4771 if err != nil { 4772 return err 4773 } 4774 ipup.IdentityProviderUpdateProperties = &identityProviderUpdateProperties 4775 } 4776 } 4777 } 4778 4779 return nil 4780} 4781 4782// IdentityProviderUpdateProperties parameters supplied to the Update Identity Provider operation. 4783type IdentityProviderUpdateProperties struct { 4784 // 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. 4785 ClientID *string `json:"clientId,omitempty"` 4786 // 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. 4787 ClientSecret *string `json:"clientSecret,omitempty"` 4788 // Type - Identity Provider Type identifier. Possible values include: 'Facebook', 'Google', 'Microsoft', 'Twitter', 'Aad', 'AadB2C' 4789 Type IdentityProviderType `json:"type,omitempty"` 4790 // AllowedTenants - List of Allowed Tenants when configuring Azure Active Directory login. 4791 AllowedTenants *[]string `json:"allowedTenants,omitempty"` 4792 // Authority - OpenID Connect discovery endpoint hostname for AAD or AAD B2C. 4793 Authority *string `json:"authority,omitempty"` 4794 // SignupPolicyName - Signup Policy Name. Only applies to AAD B2C Identity Provider. 4795 SignupPolicyName *string `json:"signupPolicyName,omitempty"` 4796 // SigninPolicyName - Signin Policy Name. Only applies to AAD B2C Identity Provider. 4797 SigninPolicyName *string `json:"signinPolicyName,omitempty"` 4798 // ProfileEditingPolicyName - Profile Editing Policy Name. Only applies to AAD B2C Identity Provider. 4799 ProfileEditingPolicyName *string `json:"profileEditingPolicyName,omitempty"` 4800 // PasswordResetPolicyName - Password Reset Policy Name. Only applies to AAD B2C Identity Provider. 4801 PasswordResetPolicyName *string `json:"passwordResetPolicyName,omitempty"` 4802} 4803 4804// IssueAttachmentCollection paged Issue Attachment list representation. 4805type IssueAttachmentCollection struct { 4806 autorest.Response `json:"-"` 4807 // Value - READ-ONLY; Issue Attachment values. 4808 Value *[]IssueAttachmentContract `json:"value,omitempty"` 4809 // NextLink - READ-ONLY; Next page link if any. 4810 NextLink *string `json:"nextLink,omitempty"` 4811} 4812 4813// IssueAttachmentCollectionIterator provides access to a complete listing of IssueAttachmentContract 4814// values. 4815type IssueAttachmentCollectionIterator struct { 4816 i int 4817 page IssueAttachmentCollectionPage 4818} 4819 4820// NextWithContext advances to the next value. If there was an error making 4821// the request the iterator does not advance and the error is returned. 4822func (iter *IssueAttachmentCollectionIterator) NextWithContext(ctx context.Context) (err error) { 4823 if tracing.IsEnabled() { 4824 ctx = tracing.StartSpan(ctx, fqdn+"/IssueAttachmentCollectionIterator.NextWithContext") 4825 defer func() { 4826 sc := -1 4827 if iter.Response().Response.Response != nil { 4828 sc = iter.Response().Response.Response.StatusCode 4829 } 4830 tracing.EndSpan(ctx, sc, err) 4831 }() 4832 } 4833 iter.i++ 4834 if iter.i < len(iter.page.Values()) { 4835 return nil 4836 } 4837 err = iter.page.NextWithContext(ctx) 4838 if err != nil { 4839 iter.i-- 4840 return err 4841 } 4842 iter.i = 0 4843 return nil 4844} 4845 4846// Next advances to the next value. If there was an error making 4847// the request the iterator does not advance and the error is returned. 4848// Deprecated: Use NextWithContext() instead. 4849func (iter *IssueAttachmentCollectionIterator) Next() error { 4850 return iter.NextWithContext(context.Background()) 4851} 4852 4853// NotDone returns true if the enumeration should be started or is not yet complete. 4854func (iter IssueAttachmentCollectionIterator) NotDone() bool { 4855 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 4856} 4857 4858// Response returns the raw server response from the last page request. 4859func (iter IssueAttachmentCollectionIterator) Response() IssueAttachmentCollection { 4860 return iter.page.Response() 4861} 4862 4863// Value returns the current value or a zero-initialized value if the 4864// iterator has advanced beyond the end of the collection. 4865func (iter IssueAttachmentCollectionIterator) Value() IssueAttachmentContract { 4866 if !iter.page.NotDone() { 4867 return IssueAttachmentContract{} 4868 } 4869 return iter.page.Values()[iter.i] 4870} 4871 4872// Creates a new instance of the IssueAttachmentCollectionIterator type. 4873func NewIssueAttachmentCollectionIterator(page IssueAttachmentCollectionPage) IssueAttachmentCollectionIterator { 4874 return IssueAttachmentCollectionIterator{page: page} 4875} 4876 4877// IsEmpty returns true if the ListResult contains no values. 4878func (iac IssueAttachmentCollection) IsEmpty() bool { 4879 return iac.Value == nil || len(*iac.Value) == 0 4880} 4881 4882// issueAttachmentCollectionPreparer prepares a request to retrieve the next set of results. 4883// It returns nil if no more results exist. 4884func (iac IssueAttachmentCollection) issueAttachmentCollectionPreparer(ctx context.Context) (*http.Request, error) { 4885 if iac.NextLink == nil || len(to.String(iac.NextLink)) < 1 { 4886 return nil, nil 4887 } 4888 return autorest.Prepare((&http.Request{}).WithContext(ctx), 4889 autorest.AsJSON(), 4890 autorest.AsGet(), 4891 autorest.WithBaseURL(to.String(iac.NextLink))) 4892} 4893 4894// IssueAttachmentCollectionPage contains a page of IssueAttachmentContract values. 4895type IssueAttachmentCollectionPage struct { 4896 fn func(context.Context, IssueAttachmentCollection) (IssueAttachmentCollection, error) 4897 iac IssueAttachmentCollection 4898} 4899 4900// NextWithContext advances to the next page of values. If there was an error making 4901// the request the page does not advance and the error is returned. 4902func (page *IssueAttachmentCollectionPage) NextWithContext(ctx context.Context) (err error) { 4903 if tracing.IsEnabled() { 4904 ctx = tracing.StartSpan(ctx, fqdn+"/IssueAttachmentCollectionPage.NextWithContext") 4905 defer func() { 4906 sc := -1 4907 if page.Response().Response.Response != nil { 4908 sc = page.Response().Response.Response.StatusCode 4909 } 4910 tracing.EndSpan(ctx, sc, err) 4911 }() 4912 } 4913 next, err := page.fn(ctx, page.iac) 4914 if err != nil { 4915 return err 4916 } 4917 page.iac = next 4918 return nil 4919} 4920 4921// Next advances to the next page of values. If there was an error making 4922// the request the page does not advance and the error is returned. 4923// Deprecated: Use NextWithContext() instead. 4924func (page *IssueAttachmentCollectionPage) Next() error { 4925 return page.NextWithContext(context.Background()) 4926} 4927 4928// NotDone returns true if the page enumeration should be started or is not yet complete. 4929func (page IssueAttachmentCollectionPage) NotDone() bool { 4930 return !page.iac.IsEmpty() 4931} 4932 4933// Response returns the raw server response from the last page request. 4934func (page IssueAttachmentCollectionPage) Response() IssueAttachmentCollection { 4935 return page.iac 4936} 4937 4938// Values returns the slice of values for the current page or nil if there are no values. 4939func (page IssueAttachmentCollectionPage) Values() []IssueAttachmentContract { 4940 if page.iac.IsEmpty() { 4941 return nil 4942 } 4943 return *page.iac.Value 4944} 4945 4946// Creates a new instance of the IssueAttachmentCollectionPage type. 4947func NewIssueAttachmentCollectionPage(getNextPage func(context.Context, IssueAttachmentCollection) (IssueAttachmentCollection, error)) IssueAttachmentCollectionPage { 4948 return IssueAttachmentCollectionPage{fn: getNextPage} 4949} 4950 4951// IssueAttachmentContract issue Attachment Contract details. 4952type IssueAttachmentContract struct { 4953 autorest.Response `json:"-"` 4954 // IssueAttachmentContractProperties - Properties of the Issue Attachment. 4955 *IssueAttachmentContractProperties `json:"properties,omitempty"` 4956 // ID - READ-ONLY; Resource ID. 4957 ID *string `json:"id,omitempty"` 4958 // Name - READ-ONLY; Resource name. 4959 Name *string `json:"name,omitempty"` 4960 // Type - READ-ONLY; Resource type for API Management resource. 4961 Type *string `json:"type,omitempty"` 4962} 4963 4964// MarshalJSON is the custom marshaler for IssueAttachmentContract. 4965func (iac IssueAttachmentContract) MarshalJSON() ([]byte, error) { 4966 objectMap := make(map[string]interface{}) 4967 if iac.IssueAttachmentContractProperties != nil { 4968 objectMap["properties"] = iac.IssueAttachmentContractProperties 4969 } 4970 return json.Marshal(objectMap) 4971} 4972 4973// UnmarshalJSON is the custom unmarshaler for IssueAttachmentContract struct. 4974func (iac *IssueAttachmentContract) UnmarshalJSON(body []byte) error { 4975 var m map[string]*json.RawMessage 4976 err := json.Unmarshal(body, &m) 4977 if err != nil { 4978 return err 4979 } 4980 for k, v := range m { 4981 switch k { 4982 case "properties": 4983 if v != nil { 4984 var issueAttachmentContractProperties IssueAttachmentContractProperties 4985 err = json.Unmarshal(*v, &issueAttachmentContractProperties) 4986 if err != nil { 4987 return err 4988 } 4989 iac.IssueAttachmentContractProperties = &issueAttachmentContractProperties 4990 } 4991 case "id": 4992 if v != nil { 4993 var ID string 4994 err = json.Unmarshal(*v, &ID) 4995 if err != nil { 4996 return err 4997 } 4998 iac.ID = &ID 4999 } 5000 case "name": 5001 if v != nil { 5002 var name string 5003 err = json.Unmarshal(*v, &name) 5004 if err != nil { 5005 return err 5006 } 5007 iac.Name = &name 5008 } 5009 case "type": 5010 if v != nil { 5011 var typeVar string 5012 err = json.Unmarshal(*v, &typeVar) 5013 if err != nil { 5014 return err 5015 } 5016 iac.Type = &typeVar 5017 } 5018 } 5019 } 5020 5021 return nil 5022} 5023 5024// IssueAttachmentContractProperties issue Attachment contract Properties. 5025type IssueAttachmentContractProperties struct { 5026 // Title - Filename by which the binary data will be saved. 5027 Title *string `json:"title,omitempty"` 5028 // ContentFormat - Either 'link' if content is provided via an HTTP link or the MIME type of the Base64-encoded binary data provided in the 'content' property. 5029 ContentFormat *string `json:"contentFormat,omitempty"` 5030 // Content - An HTTP link or Base64-encoded binary data. 5031 Content *string `json:"content,omitempty"` 5032} 5033 5034// IssueCollection paged Issue list representation. 5035type IssueCollection struct { 5036 autorest.Response `json:"-"` 5037 // Value - READ-ONLY; Issue values. 5038 Value *[]IssueContract `json:"value,omitempty"` 5039 // NextLink - READ-ONLY; Next page link if any. 5040 NextLink *string `json:"nextLink,omitempty"` 5041} 5042 5043// IssueCollectionIterator provides access to a complete listing of IssueContract values. 5044type IssueCollectionIterator struct { 5045 i int 5046 page IssueCollectionPage 5047} 5048 5049// NextWithContext advances to the next value. If there was an error making 5050// the request the iterator does not advance and the error is returned. 5051func (iter *IssueCollectionIterator) NextWithContext(ctx context.Context) (err error) { 5052 if tracing.IsEnabled() { 5053 ctx = tracing.StartSpan(ctx, fqdn+"/IssueCollectionIterator.NextWithContext") 5054 defer func() { 5055 sc := -1 5056 if iter.Response().Response.Response != nil { 5057 sc = iter.Response().Response.Response.StatusCode 5058 } 5059 tracing.EndSpan(ctx, sc, err) 5060 }() 5061 } 5062 iter.i++ 5063 if iter.i < len(iter.page.Values()) { 5064 return nil 5065 } 5066 err = iter.page.NextWithContext(ctx) 5067 if err != nil { 5068 iter.i-- 5069 return err 5070 } 5071 iter.i = 0 5072 return nil 5073} 5074 5075// Next advances to the next value. If there was an error making 5076// the request the iterator does not advance and the error is returned. 5077// Deprecated: Use NextWithContext() instead. 5078func (iter *IssueCollectionIterator) Next() error { 5079 return iter.NextWithContext(context.Background()) 5080} 5081 5082// NotDone returns true if the enumeration should be started or is not yet complete. 5083func (iter IssueCollectionIterator) NotDone() bool { 5084 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 5085} 5086 5087// Response returns the raw server response from the last page request. 5088func (iter IssueCollectionIterator) Response() IssueCollection { 5089 return iter.page.Response() 5090} 5091 5092// Value returns the current value or a zero-initialized value if the 5093// iterator has advanced beyond the end of the collection. 5094func (iter IssueCollectionIterator) Value() IssueContract { 5095 if !iter.page.NotDone() { 5096 return IssueContract{} 5097 } 5098 return iter.page.Values()[iter.i] 5099} 5100 5101// Creates a new instance of the IssueCollectionIterator type. 5102func NewIssueCollectionIterator(page IssueCollectionPage) IssueCollectionIterator { 5103 return IssueCollectionIterator{page: page} 5104} 5105 5106// IsEmpty returns true if the ListResult contains no values. 5107func (ic IssueCollection) IsEmpty() bool { 5108 return ic.Value == nil || len(*ic.Value) == 0 5109} 5110 5111// issueCollectionPreparer prepares a request to retrieve the next set of results. 5112// It returns nil if no more results exist. 5113func (ic IssueCollection) issueCollectionPreparer(ctx context.Context) (*http.Request, error) { 5114 if ic.NextLink == nil || len(to.String(ic.NextLink)) < 1 { 5115 return nil, nil 5116 } 5117 return autorest.Prepare((&http.Request{}).WithContext(ctx), 5118 autorest.AsJSON(), 5119 autorest.AsGet(), 5120 autorest.WithBaseURL(to.String(ic.NextLink))) 5121} 5122 5123// IssueCollectionPage contains a page of IssueContract values. 5124type IssueCollectionPage struct { 5125 fn func(context.Context, IssueCollection) (IssueCollection, error) 5126 ic IssueCollection 5127} 5128 5129// NextWithContext advances to the next page of values. If there was an error making 5130// the request the page does not advance and the error is returned. 5131func (page *IssueCollectionPage) NextWithContext(ctx context.Context) (err error) { 5132 if tracing.IsEnabled() { 5133 ctx = tracing.StartSpan(ctx, fqdn+"/IssueCollectionPage.NextWithContext") 5134 defer func() { 5135 sc := -1 5136 if page.Response().Response.Response != nil { 5137 sc = page.Response().Response.Response.StatusCode 5138 } 5139 tracing.EndSpan(ctx, sc, err) 5140 }() 5141 } 5142 next, err := page.fn(ctx, page.ic) 5143 if err != nil { 5144 return err 5145 } 5146 page.ic = next 5147 return nil 5148} 5149 5150// Next advances to the next page of values. If there was an error making 5151// the request the page does not advance and the error is returned. 5152// Deprecated: Use NextWithContext() instead. 5153func (page *IssueCollectionPage) Next() error { 5154 return page.NextWithContext(context.Background()) 5155} 5156 5157// NotDone returns true if the page enumeration should be started or is not yet complete. 5158func (page IssueCollectionPage) NotDone() bool { 5159 return !page.ic.IsEmpty() 5160} 5161 5162// Response returns the raw server response from the last page request. 5163func (page IssueCollectionPage) Response() IssueCollection { 5164 return page.ic 5165} 5166 5167// Values returns the slice of values for the current page or nil if there are no values. 5168func (page IssueCollectionPage) Values() []IssueContract { 5169 if page.ic.IsEmpty() { 5170 return nil 5171 } 5172 return *page.ic.Value 5173} 5174 5175// Creates a new instance of the IssueCollectionPage type. 5176func NewIssueCollectionPage(getNextPage func(context.Context, IssueCollection) (IssueCollection, error)) IssueCollectionPage { 5177 return IssueCollectionPage{fn: getNextPage} 5178} 5179 5180// IssueCommentCollection paged Issue Comment list representation. 5181type IssueCommentCollection struct { 5182 autorest.Response `json:"-"` 5183 // Value - READ-ONLY; Issue Comment values. 5184 Value *[]IssueCommentContract `json:"value,omitempty"` 5185 // NextLink - READ-ONLY; Next page link if any. 5186 NextLink *string `json:"nextLink,omitempty"` 5187} 5188 5189// IssueCommentCollectionIterator provides access to a complete listing of IssueCommentContract values. 5190type IssueCommentCollectionIterator struct { 5191 i int 5192 page IssueCommentCollectionPage 5193} 5194 5195// NextWithContext advances to the next value. If there was an error making 5196// the request the iterator does not advance and the error is returned. 5197func (iter *IssueCommentCollectionIterator) NextWithContext(ctx context.Context) (err error) { 5198 if tracing.IsEnabled() { 5199 ctx = tracing.StartSpan(ctx, fqdn+"/IssueCommentCollectionIterator.NextWithContext") 5200 defer func() { 5201 sc := -1 5202 if iter.Response().Response.Response != nil { 5203 sc = iter.Response().Response.Response.StatusCode 5204 } 5205 tracing.EndSpan(ctx, sc, err) 5206 }() 5207 } 5208 iter.i++ 5209 if iter.i < len(iter.page.Values()) { 5210 return nil 5211 } 5212 err = iter.page.NextWithContext(ctx) 5213 if err != nil { 5214 iter.i-- 5215 return err 5216 } 5217 iter.i = 0 5218 return nil 5219} 5220 5221// Next advances to the next value. If there was an error making 5222// the request the iterator does not advance and the error is returned. 5223// Deprecated: Use NextWithContext() instead. 5224func (iter *IssueCommentCollectionIterator) Next() error { 5225 return iter.NextWithContext(context.Background()) 5226} 5227 5228// NotDone returns true if the enumeration should be started or is not yet complete. 5229func (iter IssueCommentCollectionIterator) NotDone() bool { 5230 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 5231} 5232 5233// Response returns the raw server response from the last page request. 5234func (iter IssueCommentCollectionIterator) Response() IssueCommentCollection { 5235 return iter.page.Response() 5236} 5237 5238// Value returns the current value or a zero-initialized value if the 5239// iterator has advanced beyond the end of the collection. 5240func (iter IssueCommentCollectionIterator) Value() IssueCommentContract { 5241 if !iter.page.NotDone() { 5242 return IssueCommentContract{} 5243 } 5244 return iter.page.Values()[iter.i] 5245} 5246 5247// Creates a new instance of the IssueCommentCollectionIterator type. 5248func NewIssueCommentCollectionIterator(page IssueCommentCollectionPage) IssueCommentCollectionIterator { 5249 return IssueCommentCollectionIterator{page: page} 5250} 5251 5252// IsEmpty returns true if the ListResult contains no values. 5253func (icc IssueCommentCollection) IsEmpty() bool { 5254 return icc.Value == nil || len(*icc.Value) == 0 5255} 5256 5257// issueCommentCollectionPreparer prepares a request to retrieve the next set of results. 5258// It returns nil if no more results exist. 5259func (icc IssueCommentCollection) issueCommentCollectionPreparer(ctx context.Context) (*http.Request, error) { 5260 if icc.NextLink == nil || len(to.String(icc.NextLink)) < 1 { 5261 return nil, nil 5262 } 5263 return autorest.Prepare((&http.Request{}).WithContext(ctx), 5264 autorest.AsJSON(), 5265 autorest.AsGet(), 5266 autorest.WithBaseURL(to.String(icc.NextLink))) 5267} 5268 5269// IssueCommentCollectionPage contains a page of IssueCommentContract values. 5270type IssueCommentCollectionPage struct { 5271 fn func(context.Context, IssueCommentCollection) (IssueCommentCollection, error) 5272 icc IssueCommentCollection 5273} 5274 5275// NextWithContext advances to the next page of values. If there was an error making 5276// the request the page does not advance and the error is returned. 5277func (page *IssueCommentCollectionPage) NextWithContext(ctx context.Context) (err error) { 5278 if tracing.IsEnabled() { 5279 ctx = tracing.StartSpan(ctx, fqdn+"/IssueCommentCollectionPage.NextWithContext") 5280 defer func() { 5281 sc := -1 5282 if page.Response().Response.Response != nil { 5283 sc = page.Response().Response.Response.StatusCode 5284 } 5285 tracing.EndSpan(ctx, sc, err) 5286 }() 5287 } 5288 next, err := page.fn(ctx, page.icc) 5289 if err != nil { 5290 return err 5291 } 5292 page.icc = next 5293 return nil 5294} 5295 5296// Next advances to the next page of values. If there was an error making 5297// the request the page does not advance and the error is returned. 5298// Deprecated: Use NextWithContext() instead. 5299func (page *IssueCommentCollectionPage) Next() error { 5300 return page.NextWithContext(context.Background()) 5301} 5302 5303// NotDone returns true if the page enumeration should be started or is not yet complete. 5304func (page IssueCommentCollectionPage) NotDone() bool { 5305 return !page.icc.IsEmpty() 5306} 5307 5308// Response returns the raw server response from the last page request. 5309func (page IssueCommentCollectionPage) Response() IssueCommentCollection { 5310 return page.icc 5311} 5312 5313// Values returns the slice of values for the current page or nil if there are no values. 5314func (page IssueCommentCollectionPage) Values() []IssueCommentContract { 5315 if page.icc.IsEmpty() { 5316 return nil 5317 } 5318 return *page.icc.Value 5319} 5320 5321// Creates a new instance of the IssueCommentCollectionPage type. 5322func NewIssueCommentCollectionPage(getNextPage func(context.Context, IssueCommentCollection) (IssueCommentCollection, error)) IssueCommentCollectionPage { 5323 return IssueCommentCollectionPage{fn: getNextPage} 5324} 5325 5326// IssueCommentContract issue Comment Contract details. 5327type IssueCommentContract struct { 5328 autorest.Response `json:"-"` 5329 // IssueCommentContractProperties - Properties of the Issue Comment. 5330 *IssueCommentContractProperties `json:"properties,omitempty"` 5331 // ID - READ-ONLY; Resource ID. 5332 ID *string `json:"id,omitempty"` 5333 // Name - READ-ONLY; Resource name. 5334 Name *string `json:"name,omitempty"` 5335 // Type - READ-ONLY; Resource type for API Management resource. 5336 Type *string `json:"type,omitempty"` 5337} 5338 5339// MarshalJSON is the custom marshaler for IssueCommentContract. 5340func (icc IssueCommentContract) MarshalJSON() ([]byte, error) { 5341 objectMap := make(map[string]interface{}) 5342 if icc.IssueCommentContractProperties != nil { 5343 objectMap["properties"] = icc.IssueCommentContractProperties 5344 } 5345 return json.Marshal(objectMap) 5346} 5347 5348// UnmarshalJSON is the custom unmarshaler for IssueCommentContract struct. 5349func (icc *IssueCommentContract) UnmarshalJSON(body []byte) error { 5350 var m map[string]*json.RawMessage 5351 err := json.Unmarshal(body, &m) 5352 if err != nil { 5353 return err 5354 } 5355 for k, v := range m { 5356 switch k { 5357 case "properties": 5358 if v != nil { 5359 var issueCommentContractProperties IssueCommentContractProperties 5360 err = json.Unmarshal(*v, &issueCommentContractProperties) 5361 if err != nil { 5362 return err 5363 } 5364 icc.IssueCommentContractProperties = &issueCommentContractProperties 5365 } 5366 case "id": 5367 if v != nil { 5368 var ID string 5369 err = json.Unmarshal(*v, &ID) 5370 if err != nil { 5371 return err 5372 } 5373 icc.ID = &ID 5374 } 5375 case "name": 5376 if v != nil { 5377 var name string 5378 err = json.Unmarshal(*v, &name) 5379 if err != nil { 5380 return err 5381 } 5382 icc.Name = &name 5383 } 5384 case "type": 5385 if v != nil { 5386 var typeVar string 5387 err = json.Unmarshal(*v, &typeVar) 5388 if err != nil { 5389 return err 5390 } 5391 icc.Type = &typeVar 5392 } 5393 } 5394 } 5395 5396 return nil 5397} 5398 5399// IssueCommentContractProperties issue Comment contract Properties. 5400type IssueCommentContractProperties struct { 5401 // Text - Comment text. 5402 Text *string `json:"text,omitempty"` 5403 // CreatedDate - Date and time when the comment was created. 5404 CreatedDate *date.Time `json:"createdDate,omitempty"` 5405 // UserID - A resource identifier for the user who left the comment. 5406 UserID *string `json:"userId,omitempty"` 5407} 5408 5409// IssueContract issue Contract details. 5410type IssueContract struct { 5411 autorest.Response `json:"-"` 5412 // IssueContractProperties - Properties of the Issue. 5413 *IssueContractProperties `json:"properties,omitempty"` 5414 // ID - READ-ONLY; Resource ID. 5415 ID *string `json:"id,omitempty"` 5416 // Name - READ-ONLY; Resource name. 5417 Name *string `json:"name,omitempty"` 5418 // Type - READ-ONLY; Resource type for API Management resource. 5419 Type *string `json:"type,omitempty"` 5420} 5421 5422// MarshalJSON is the custom marshaler for IssueContract. 5423func (ic IssueContract) MarshalJSON() ([]byte, error) { 5424 objectMap := make(map[string]interface{}) 5425 if ic.IssueContractProperties != nil { 5426 objectMap["properties"] = ic.IssueContractProperties 5427 } 5428 return json.Marshal(objectMap) 5429} 5430 5431// UnmarshalJSON is the custom unmarshaler for IssueContract struct. 5432func (ic *IssueContract) UnmarshalJSON(body []byte) error { 5433 var m map[string]*json.RawMessage 5434 err := json.Unmarshal(body, &m) 5435 if err != nil { 5436 return err 5437 } 5438 for k, v := range m { 5439 switch k { 5440 case "properties": 5441 if v != nil { 5442 var issueContractProperties IssueContractProperties 5443 err = json.Unmarshal(*v, &issueContractProperties) 5444 if err != nil { 5445 return err 5446 } 5447 ic.IssueContractProperties = &issueContractProperties 5448 } 5449 case "id": 5450 if v != nil { 5451 var ID string 5452 err = json.Unmarshal(*v, &ID) 5453 if err != nil { 5454 return err 5455 } 5456 ic.ID = &ID 5457 } 5458 case "name": 5459 if v != nil { 5460 var name string 5461 err = json.Unmarshal(*v, &name) 5462 if err != nil { 5463 return err 5464 } 5465 ic.Name = &name 5466 } 5467 case "type": 5468 if v != nil { 5469 var typeVar string 5470 err = json.Unmarshal(*v, &typeVar) 5471 if err != nil { 5472 return err 5473 } 5474 ic.Type = &typeVar 5475 } 5476 } 5477 } 5478 5479 return nil 5480} 5481 5482// IssueContractBaseProperties issue contract Base Properties. 5483type IssueContractBaseProperties struct { 5484 // CreatedDate - Date and time when the issue was created. 5485 CreatedDate *date.Time `json:"createdDate,omitempty"` 5486 // State - Status of the issue. Possible values include: 'Proposed', 'Open', 'Removed', 'Resolved', 'Closed' 5487 State State `json:"state,omitempty"` 5488 // APIID - A resource identifier for the API the issue was created for. 5489 APIID *string `json:"apiId,omitempty"` 5490} 5491 5492// IssueContractProperties issue contract Properties. 5493type IssueContractProperties struct { 5494 // Title - The issue title. 5495 Title *string `json:"title,omitempty"` 5496 // Description - Text describing the issue. 5497 Description *string `json:"description,omitempty"` 5498 // UserID - A resource identifier for the user created the issue. 5499 UserID *string `json:"userId,omitempty"` 5500 // CreatedDate - Date and time when the issue was created. 5501 CreatedDate *date.Time `json:"createdDate,omitempty"` 5502 // State - Status of the issue. Possible values include: 'Proposed', 'Open', 'Removed', 'Resolved', 'Closed' 5503 State State `json:"state,omitempty"` 5504 // APIID - A resource identifier for the API the issue was created for. 5505 APIID *string `json:"apiId,omitempty"` 5506} 5507 5508// IssueUpdateContract issue update Parameters. 5509type IssueUpdateContract struct { 5510 // IssueUpdateContractProperties - Issue entity Update contract properties. 5511 *IssueUpdateContractProperties `json:"properties,omitempty"` 5512} 5513 5514// MarshalJSON is the custom marshaler for IssueUpdateContract. 5515func (iuc IssueUpdateContract) MarshalJSON() ([]byte, error) { 5516 objectMap := make(map[string]interface{}) 5517 if iuc.IssueUpdateContractProperties != nil { 5518 objectMap["properties"] = iuc.IssueUpdateContractProperties 5519 } 5520 return json.Marshal(objectMap) 5521} 5522 5523// UnmarshalJSON is the custom unmarshaler for IssueUpdateContract struct. 5524func (iuc *IssueUpdateContract) UnmarshalJSON(body []byte) error { 5525 var m map[string]*json.RawMessage 5526 err := json.Unmarshal(body, &m) 5527 if err != nil { 5528 return err 5529 } 5530 for k, v := range m { 5531 switch k { 5532 case "properties": 5533 if v != nil { 5534 var issueUpdateContractProperties IssueUpdateContractProperties 5535 err = json.Unmarshal(*v, &issueUpdateContractProperties) 5536 if err != nil { 5537 return err 5538 } 5539 iuc.IssueUpdateContractProperties = &issueUpdateContractProperties 5540 } 5541 } 5542 } 5543 5544 return nil 5545} 5546 5547// IssueUpdateContractProperties issue contract Update Properties. 5548type IssueUpdateContractProperties struct { 5549 // Title - The issue title. 5550 Title *string `json:"title,omitempty"` 5551 // Description - Text describing the issue. 5552 Description *string `json:"description,omitempty"` 5553 // UserID - A resource identifier for the user created the issue. 5554 UserID *string `json:"userId,omitempty"` 5555 // CreatedDate - Date and time when the issue was created. 5556 CreatedDate *date.Time `json:"createdDate,omitempty"` 5557 // State - Status of the issue. Possible values include: 'Proposed', 'Open', 'Removed', 'Resolved', 'Closed' 5558 State State `json:"state,omitempty"` 5559 // APIID - A resource identifier for the API the issue was created for. 5560 APIID *string `json:"apiId,omitempty"` 5561} 5562 5563// ListNetworkStatusContractByLocation ... 5564type ListNetworkStatusContractByLocation struct { 5565 autorest.Response `json:"-"` 5566 Value *[]NetworkStatusContractByLocation `json:"value,omitempty"` 5567} 5568 5569// LoggerCollection paged Logger list representation. 5570type LoggerCollection struct { 5571 autorest.Response `json:"-"` 5572 // Value - Logger values. 5573 Value *[]LoggerContract `json:"value,omitempty"` 5574 // Count - Total record count number across all pages. 5575 Count *int64 `json:"count,omitempty"` 5576 // NextLink - Next page link if any. 5577 NextLink *string `json:"nextLink,omitempty"` 5578} 5579 5580// LoggerCollectionIterator provides access to a complete listing of LoggerContract values. 5581type LoggerCollectionIterator struct { 5582 i int 5583 page LoggerCollectionPage 5584} 5585 5586// NextWithContext advances to the next value. If there was an error making 5587// the request the iterator does not advance and the error is returned. 5588func (iter *LoggerCollectionIterator) NextWithContext(ctx context.Context) (err error) { 5589 if tracing.IsEnabled() { 5590 ctx = tracing.StartSpan(ctx, fqdn+"/LoggerCollectionIterator.NextWithContext") 5591 defer func() { 5592 sc := -1 5593 if iter.Response().Response.Response != nil { 5594 sc = iter.Response().Response.Response.StatusCode 5595 } 5596 tracing.EndSpan(ctx, sc, err) 5597 }() 5598 } 5599 iter.i++ 5600 if iter.i < len(iter.page.Values()) { 5601 return nil 5602 } 5603 err = iter.page.NextWithContext(ctx) 5604 if err != nil { 5605 iter.i-- 5606 return err 5607 } 5608 iter.i = 0 5609 return nil 5610} 5611 5612// Next advances to the next value. If there was an error making 5613// the request the iterator does not advance and the error is returned. 5614// Deprecated: Use NextWithContext() instead. 5615func (iter *LoggerCollectionIterator) Next() error { 5616 return iter.NextWithContext(context.Background()) 5617} 5618 5619// NotDone returns true if the enumeration should be started or is not yet complete. 5620func (iter LoggerCollectionIterator) NotDone() bool { 5621 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 5622} 5623 5624// Response returns the raw server response from the last page request. 5625func (iter LoggerCollectionIterator) Response() LoggerCollection { 5626 return iter.page.Response() 5627} 5628 5629// Value returns the current value or a zero-initialized value if the 5630// iterator has advanced beyond the end of the collection. 5631func (iter LoggerCollectionIterator) Value() LoggerContract { 5632 if !iter.page.NotDone() { 5633 return LoggerContract{} 5634 } 5635 return iter.page.Values()[iter.i] 5636} 5637 5638// Creates a new instance of the LoggerCollectionIterator type. 5639func NewLoggerCollectionIterator(page LoggerCollectionPage) LoggerCollectionIterator { 5640 return LoggerCollectionIterator{page: page} 5641} 5642 5643// IsEmpty returns true if the ListResult contains no values. 5644func (lc LoggerCollection) IsEmpty() bool { 5645 return lc.Value == nil || len(*lc.Value) == 0 5646} 5647 5648// loggerCollectionPreparer prepares a request to retrieve the next set of results. 5649// It returns nil if no more results exist. 5650func (lc LoggerCollection) loggerCollectionPreparer(ctx context.Context) (*http.Request, error) { 5651 if lc.NextLink == nil || len(to.String(lc.NextLink)) < 1 { 5652 return nil, nil 5653 } 5654 return autorest.Prepare((&http.Request{}).WithContext(ctx), 5655 autorest.AsJSON(), 5656 autorest.AsGet(), 5657 autorest.WithBaseURL(to.String(lc.NextLink))) 5658} 5659 5660// LoggerCollectionPage contains a page of LoggerContract values. 5661type LoggerCollectionPage struct { 5662 fn func(context.Context, LoggerCollection) (LoggerCollection, error) 5663 lc LoggerCollection 5664} 5665 5666// NextWithContext advances to the next page of values. If there was an error making 5667// the request the page does not advance and the error is returned. 5668func (page *LoggerCollectionPage) NextWithContext(ctx context.Context) (err error) { 5669 if tracing.IsEnabled() { 5670 ctx = tracing.StartSpan(ctx, fqdn+"/LoggerCollectionPage.NextWithContext") 5671 defer func() { 5672 sc := -1 5673 if page.Response().Response.Response != nil { 5674 sc = page.Response().Response.Response.StatusCode 5675 } 5676 tracing.EndSpan(ctx, sc, err) 5677 }() 5678 } 5679 next, err := page.fn(ctx, page.lc) 5680 if err != nil { 5681 return err 5682 } 5683 page.lc = next 5684 return nil 5685} 5686 5687// Next advances to the next page of values. If there was an error making 5688// the request the page does not advance and the error is returned. 5689// Deprecated: Use NextWithContext() instead. 5690func (page *LoggerCollectionPage) Next() error { 5691 return page.NextWithContext(context.Background()) 5692} 5693 5694// NotDone returns true if the page enumeration should be started or is not yet complete. 5695func (page LoggerCollectionPage) NotDone() bool { 5696 return !page.lc.IsEmpty() 5697} 5698 5699// Response returns the raw server response from the last page request. 5700func (page LoggerCollectionPage) Response() LoggerCollection { 5701 return page.lc 5702} 5703 5704// Values returns the slice of values for the current page or nil if there are no values. 5705func (page LoggerCollectionPage) Values() []LoggerContract { 5706 if page.lc.IsEmpty() { 5707 return nil 5708 } 5709 return *page.lc.Value 5710} 5711 5712// Creates a new instance of the LoggerCollectionPage type. 5713func NewLoggerCollectionPage(getNextPage func(context.Context, LoggerCollection) (LoggerCollection, error)) LoggerCollectionPage { 5714 return LoggerCollectionPage{fn: getNextPage} 5715} 5716 5717// LoggerContract logger details. 5718type LoggerContract struct { 5719 autorest.Response `json:"-"` 5720 // LoggerContractProperties - Logger entity contract properties. 5721 *LoggerContractProperties `json:"properties,omitempty"` 5722 // ID - READ-ONLY; Resource ID. 5723 ID *string `json:"id,omitempty"` 5724 // Name - READ-ONLY; Resource name. 5725 Name *string `json:"name,omitempty"` 5726 // Type - READ-ONLY; Resource type for API Management resource. 5727 Type *string `json:"type,omitempty"` 5728} 5729 5730// MarshalJSON is the custom marshaler for LoggerContract. 5731func (lc LoggerContract) MarshalJSON() ([]byte, error) { 5732 objectMap := make(map[string]interface{}) 5733 if lc.LoggerContractProperties != nil { 5734 objectMap["properties"] = lc.LoggerContractProperties 5735 } 5736 return json.Marshal(objectMap) 5737} 5738 5739// UnmarshalJSON is the custom unmarshaler for LoggerContract struct. 5740func (lc *LoggerContract) UnmarshalJSON(body []byte) error { 5741 var m map[string]*json.RawMessage 5742 err := json.Unmarshal(body, &m) 5743 if err != nil { 5744 return err 5745 } 5746 for k, v := range m { 5747 switch k { 5748 case "properties": 5749 if v != nil { 5750 var loggerContractProperties LoggerContractProperties 5751 err = json.Unmarshal(*v, &loggerContractProperties) 5752 if err != nil { 5753 return err 5754 } 5755 lc.LoggerContractProperties = &loggerContractProperties 5756 } 5757 case "id": 5758 if v != nil { 5759 var ID string 5760 err = json.Unmarshal(*v, &ID) 5761 if err != nil { 5762 return err 5763 } 5764 lc.ID = &ID 5765 } 5766 case "name": 5767 if v != nil { 5768 var name string 5769 err = json.Unmarshal(*v, &name) 5770 if err != nil { 5771 return err 5772 } 5773 lc.Name = &name 5774 } 5775 case "type": 5776 if v != nil { 5777 var typeVar string 5778 err = json.Unmarshal(*v, &typeVar) 5779 if err != nil { 5780 return err 5781 } 5782 lc.Type = &typeVar 5783 } 5784 } 5785 } 5786 5787 return nil 5788} 5789 5790// LoggerContractProperties the Logger entity in API Management represents an event sink that you can use 5791// to log API Management events. Currently the Logger entity supports logging API Management events to 5792// Azure Event Hubs. 5793type LoggerContractProperties struct { 5794 // LoggerType - Logger type. Possible values include: 'AzureEventHub', 'ApplicationInsights' 5795 LoggerType LoggerType `json:"loggerType,omitempty"` 5796 // Description - Logger description. 5797 Description *string `json:"description,omitempty"` 5798 // Credentials - The name and SendRule connection string of the event hub for azureEventHub logger. 5799 // Instrumentation key for applicationInsights logger. 5800 Credentials map[string]*string `json:"credentials"` 5801 // IsBuffered - Whether records are buffered in the logger before publishing. Default is assumed to be true. 5802 IsBuffered *bool `json:"isBuffered,omitempty"` 5803 // ResourceID - Azure Resource Id of a log target (either Azure Event Hub resource or Azure Application Insights resource). 5804 ResourceID *string `json:"resourceId,omitempty"` 5805} 5806 5807// MarshalJSON is the custom marshaler for LoggerContractProperties. 5808func (lcp LoggerContractProperties) MarshalJSON() ([]byte, error) { 5809 objectMap := make(map[string]interface{}) 5810 if lcp.LoggerType != "" { 5811 objectMap["loggerType"] = lcp.LoggerType 5812 } 5813 if lcp.Description != nil { 5814 objectMap["description"] = lcp.Description 5815 } 5816 if lcp.Credentials != nil { 5817 objectMap["credentials"] = lcp.Credentials 5818 } 5819 if lcp.IsBuffered != nil { 5820 objectMap["isBuffered"] = lcp.IsBuffered 5821 } 5822 if lcp.ResourceID != nil { 5823 objectMap["resourceId"] = lcp.ResourceID 5824 } 5825 return json.Marshal(objectMap) 5826} 5827 5828// LoggerUpdateContract logger update contract. 5829type LoggerUpdateContract struct { 5830 // LoggerUpdateParameters - Logger entity update contract properties. 5831 *LoggerUpdateParameters `json:"properties,omitempty"` 5832} 5833 5834// MarshalJSON is the custom marshaler for LoggerUpdateContract. 5835func (luc LoggerUpdateContract) MarshalJSON() ([]byte, error) { 5836 objectMap := make(map[string]interface{}) 5837 if luc.LoggerUpdateParameters != nil { 5838 objectMap["properties"] = luc.LoggerUpdateParameters 5839 } 5840 return json.Marshal(objectMap) 5841} 5842 5843// UnmarshalJSON is the custom unmarshaler for LoggerUpdateContract struct. 5844func (luc *LoggerUpdateContract) UnmarshalJSON(body []byte) error { 5845 var m map[string]*json.RawMessage 5846 err := json.Unmarshal(body, &m) 5847 if err != nil { 5848 return err 5849 } 5850 for k, v := range m { 5851 switch k { 5852 case "properties": 5853 if v != nil { 5854 var loggerUpdateParameters LoggerUpdateParameters 5855 err = json.Unmarshal(*v, &loggerUpdateParameters) 5856 if err != nil { 5857 return err 5858 } 5859 luc.LoggerUpdateParameters = &loggerUpdateParameters 5860 } 5861 } 5862 } 5863 5864 return nil 5865} 5866 5867// LoggerUpdateParameters parameters supplied to the Update Logger operation. 5868type LoggerUpdateParameters struct { 5869 // LoggerType - Logger type. Possible values include: 'AzureEventHub', 'ApplicationInsights' 5870 LoggerType LoggerType `json:"loggerType,omitempty"` 5871 // Description - Logger description. 5872 Description *string `json:"description,omitempty"` 5873 // Credentials - Logger credentials. 5874 Credentials map[string]*string `json:"credentials"` 5875 // IsBuffered - Whether records are buffered in the logger before publishing. Default is assumed to be true. 5876 IsBuffered *bool `json:"isBuffered,omitempty"` 5877} 5878 5879// MarshalJSON is the custom marshaler for LoggerUpdateParameters. 5880func (lup LoggerUpdateParameters) MarshalJSON() ([]byte, error) { 5881 objectMap := make(map[string]interface{}) 5882 if lup.LoggerType != "" { 5883 objectMap["loggerType"] = lup.LoggerType 5884 } 5885 if lup.Description != nil { 5886 objectMap["description"] = lup.Description 5887 } 5888 if lup.Credentials != nil { 5889 objectMap["credentials"] = lup.Credentials 5890 } 5891 if lup.IsBuffered != nil { 5892 objectMap["isBuffered"] = lup.IsBuffered 5893 } 5894 return json.Marshal(objectMap) 5895} 5896 5897// NetworkStatusContract network Status details. 5898type NetworkStatusContract struct { 5899 autorest.Response `json:"-"` 5900 // DNSServers - Gets the list of DNS servers IPV4 addresses. 5901 DNSServers *[]string `json:"dnsServers,omitempty"` 5902 // ConnectivityStatus - Gets the list of Connectivity Status to the Resources on which the service depends upon. 5903 ConnectivityStatus *[]ConnectivityStatusContract `json:"connectivityStatus,omitempty"` 5904} 5905 5906// NetworkStatusContractByLocation network Status in the Location 5907type NetworkStatusContractByLocation struct { 5908 // Location - Location of service 5909 Location *string `json:"location,omitempty"` 5910 // NetworkStatus - Network status in Location 5911 NetworkStatus *NetworkStatusContract `json:"networkStatus,omitempty"` 5912} 5913 5914// NotificationCollection paged Notification list representation. 5915type NotificationCollection struct { 5916 autorest.Response `json:"-"` 5917 // Value - Page values. 5918 Value *[]NotificationContract `json:"value,omitempty"` 5919 // NextLink - Next page link if any. 5920 NextLink *string `json:"nextLink,omitempty"` 5921} 5922 5923// NotificationCollectionIterator provides access to a complete listing of NotificationContract values. 5924type NotificationCollectionIterator struct { 5925 i int 5926 page NotificationCollectionPage 5927} 5928 5929// NextWithContext advances to the next value. If there was an error making 5930// the request the iterator does not advance and the error is returned. 5931func (iter *NotificationCollectionIterator) NextWithContext(ctx context.Context) (err error) { 5932 if tracing.IsEnabled() { 5933 ctx = tracing.StartSpan(ctx, fqdn+"/NotificationCollectionIterator.NextWithContext") 5934 defer func() { 5935 sc := -1 5936 if iter.Response().Response.Response != nil { 5937 sc = iter.Response().Response.Response.StatusCode 5938 } 5939 tracing.EndSpan(ctx, sc, err) 5940 }() 5941 } 5942 iter.i++ 5943 if iter.i < len(iter.page.Values()) { 5944 return nil 5945 } 5946 err = iter.page.NextWithContext(ctx) 5947 if err != nil { 5948 iter.i-- 5949 return err 5950 } 5951 iter.i = 0 5952 return nil 5953} 5954 5955// Next advances to the next value. If there was an error making 5956// the request the iterator does not advance and the error is returned. 5957// Deprecated: Use NextWithContext() instead. 5958func (iter *NotificationCollectionIterator) Next() error { 5959 return iter.NextWithContext(context.Background()) 5960} 5961 5962// NotDone returns true if the enumeration should be started or is not yet complete. 5963func (iter NotificationCollectionIterator) NotDone() bool { 5964 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 5965} 5966 5967// Response returns the raw server response from the last page request. 5968func (iter NotificationCollectionIterator) Response() NotificationCollection { 5969 return iter.page.Response() 5970} 5971 5972// Value returns the current value or a zero-initialized value if the 5973// iterator has advanced beyond the end of the collection. 5974func (iter NotificationCollectionIterator) Value() NotificationContract { 5975 if !iter.page.NotDone() { 5976 return NotificationContract{} 5977 } 5978 return iter.page.Values()[iter.i] 5979} 5980 5981// Creates a new instance of the NotificationCollectionIterator type. 5982func NewNotificationCollectionIterator(page NotificationCollectionPage) NotificationCollectionIterator { 5983 return NotificationCollectionIterator{page: page} 5984} 5985 5986// IsEmpty returns true if the ListResult contains no values. 5987func (nc NotificationCollection) IsEmpty() bool { 5988 return nc.Value == nil || len(*nc.Value) == 0 5989} 5990 5991// notificationCollectionPreparer prepares a request to retrieve the next set of results. 5992// It returns nil if no more results exist. 5993func (nc NotificationCollection) notificationCollectionPreparer(ctx context.Context) (*http.Request, error) { 5994 if nc.NextLink == nil || len(to.String(nc.NextLink)) < 1 { 5995 return nil, nil 5996 } 5997 return autorest.Prepare((&http.Request{}).WithContext(ctx), 5998 autorest.AsJSON(), 5999 autorest.AsGet(), 6000 autorest.WithBaseURL(to.String(nc.NextLink))) 6001} 6002 6003// NotificationCollectionPage contains a page of NotificationContract values. 6004type NotificationCollectionPage struct { 6005 fn func(context.Context, NotificationCollection) (NotificationCollection, error) 6006 nc NotificationCollection 6007} 6008 6009// NextWithContext advances to the next page of values. If there was an error making 6010// the request the page does not advance and the error is returned. 6011func (page *NotificationCollectionPage) NextWithContext(ctx context.Context) (err error) { 6012 if tracing.IsEnabled() { 6013 ctx = tracing.StartSpan(ctx, fqdn+"/NotificationCollectionPage.NextWithContext") 6014 defer func() { 6015 sc := -1 6016 if page.Response().Response.Response != nil { 6017 sc = page.Response().Response.Response.StatusCode 6018 } 6019 tracing.EndSpan(ctx, sc, err) 6020 }() 6021 } 6022 next, err := page.fn(ctx, page.nc) 6023 if err != nil { 6024 return err 6025 } 6026 page.nc = next 6027 return nil 6028} 6029 6030// Next advances to the next page of values. If there was an error making 6031// the request the page does not advance and the error is returned. 6032// Deprecated: Use NextWithContext() instead. 6033func (page *NotificationCollectionPage) Next() error { 6034 return page.NextWithContext(context.Background()) 6035} 6036 6037// NotDone returns true if the page enumeration should be started or is not yet complete. 6038func (page NotificationCollectionPage) NotDone() bool { 6039 return !page.nc.IsEmpty() 6040} 6041 6042// Response returns the raw server response from the last page request. 6043func (page NotificationCollectionPage) Response() NotificationCollection { 6044 return page.nc 6045} 6046 6047// Values returns the slice of values for the current page or nil if there are no values. 6048func (page NotificationCollectionPage) Values() []NotificationContract { 6049 if page.nc.IsEmpty() { 6050 return nil 6051 } 6052 return *page.nc.Value 6053} 6054 6055// Creates a new instance of the NotificationCollectionPage type. 6056func NewNotificationCollectionPage(getNextPage func(context.Context, NotificationCollection) (NotificationCollection, error)) NotificationCollectionPage { 6057 return NotificationCollectionPage{fn: getNextPage} 6058} 6059 6060// NotificationContract notification details. 6061type NotificationContract struct { 6062 autorest.Response `json:"-"` 6063 // NotificationContractProperties - Notification entity contract properties. 6064 *NotificationContractProperties `json:"properties,omitempty"` 6065 // ID - READ-ONLY; Resource ID. 6066 ID *string `json:"id,omitempty"` 6067 // Name - READ-ONLY; Resource name. 6068 Name *string `json:"name,omitempty"` 6069 // Type - READ-ONLY; Resource type for API Management resource. 6070 Type *string `json:"type,omitempty"` 6071} 6072 6073// MarshalJSON is the custom marshaler for NotificationContract. 6074func (nc NotificationContract) MarshalJSON() ([]byte, error) { 6075 objectMap := make(map[string]interface{}) 6076 if nc.NotificationContractProperties != nil { 6077 objectMap["properties"] = nc.NotificationContractProperties 6078 } 6079 return json.Marshal(objectMap) 6080} 6081 6082// UnmarshalJSON is the custom unmarshaler for NotificationContract struct. 6083func (nc *NotificationContract) UnmarshalJSON(body []byte) error { 6084 var m map[string]*json.RawMessage 6085 err := json.Unmarshal(body, &m) 6086 if err != nil { 6087 return err 6088 } 6089 for k, v := range m { 6090 switch k { 6091 case "properties": 6092 if v != nil { 6093 var notificationContractProperties NotificationContractProperties 6094 err = json.Unmarshal(*v, ¬ificationContractProperties) 6095 if err != nil { 6096 return err 6097 } 6098 nc.NotificationContractProperties = ¬ificationContractProperties 6099 } 6100 case "id": 6101 if v != nil { 6102 var ID string 6103 err = json.Unmarshal(*v, &ID) 6104 if err != nil { 6105 return err 6106 } 6107 nc.ID = &ID 6108 } 6109 case "name": 6110 if v != nil { 6111 var name string 6112 err = json.Unmarshal(*v, &name) 6113 if err != nil { 6114 return err 6115 } 6116 nc.Name = &name 6117 } 6118 case "type": 6119 if v != nil { 6120 var typeVar string 6121 err = json.Unmarshal(*v, &typeVar) 6122 if err != nil { 6123 return err 6124 } 6125 nc.Type = &typeVar 6126 } 6127 } 6128 } 6129 6130 return nil 6131} 6132 6133// NotificationContractProperties notification Contract properties. 6134type NotificationContractProperties struct { 6135 // Title - Title of the Notification. 6136 Title *string `json:"title,omitempty"` 6137 // Description - Description of the Notification. 6138 Description *string `json:"description,omitempty"` 6139 // Recipients - Recipient Parameter values. 6140 Recipients *RecipientsContractProperties `json:"recipients,omitempty"` 6141} 6142 6143// OAuth2AuthenticationSettingsContract API OAuth2 Authentication settings details. 6144type OAuth2AuthenticationSettingsContract struct { 6145 // AuthorizationServerID - OAuth authorization server identifier. 6146 AuthorizationServerID *string `json:"authorizationServerId,omitempty"` 6147 // Scope - operations scope. 6148 Scope *string `json:"scope,omitempty"` 6149} 6150 6151// OpenIDAuthenticationSettingsContract API OAuth2 Authentication settings details. 6152type OpenIDAuthenticationSettingsContract struct { 6153 // OpenidProviderID - OAuth authorization server identifier. 6154 OpenidProviderID *string `json:"openidProviderId,omitempty"` 6155 // BearerTokenSendingMethods - How to send token to the server. 6156 BearerTokenSendingMethods *[]BearerTokenSendingMethods `json:"bearerTokenSendingMethods,omitempty"` 6157} 6158 6159// OpenIDConnectProviderCollection paged OpenIdProviders list representation. 6160type OpenIDConnectProviderCollection struct { 6161 autorest.Response `json:"-"` 6162 // Value - Page values. 6163 Value *[]OpenidConnectProviderContract `json:"value,omitempty"` 6164 // NextLink - Next page link if any. 6165 NextLink *string `json:"nextLink,omitempty"` 6166} 6167 6168// OpenIDConnectProviderCollectionIterator provides access to a complete listing of 6169// OpenidConnectProviderContract values. 6170type OpenIDConnectProviderCollectionIterator struct { 6171 i int 6172 page OpenIDConnectProviderCollectionPage 6173} 6174 6175// NextWithContext advances to the next value. If there was an error making 6176// the request the iterator does not advance and the error is returned. 6177func (iter *OpenIDConnectProviderCollectionIterator) NextWithContext(ctx context.Context) (err error) { 6178 if tracing.IsEnabled() { 6179 ctx = tracing.StartSpan(ctx, fqdn+"/OpenIDConnectProviderCollectionIterator.NextWithContext") 6180 defer func() { 6181 sc := -1 6182 if iter.Response().Response.Response != nil { 6183 sc = iter.Response().Response.Response.StatusCode 6184 } 6185 tracing.EndSpan(ctx, sc, err) 6186 }() 6187 } 6188 iter.i++ 6189 if iter.i < len(iter.page.Values()) { 6190 return nil 6191 } 6192 err = iter.page.NextWithContext(ctx) 6193 if err != nil { 6194 iter.i-- 6195 return err 6196 } 6197 iter.i = 0 6198 return nil 6199} 6200 6201// Next advances to the next value. If there was an error making 6202// the request the iterator does not advance and the error is returned. 6203// Deprecated: Use NextWithContext() instead. 6204func (iter *OpenIDConnectProviderCollectionIterator) Next() error { 6205 return iter.NextWithContext(context.Background()) 6206} 6207 6208// NotDone returns true if the enumeration should be started or is not yet complete. 6209func (iter OpenIDConnectProviderCollectionIterator) NotDone() bool { 6210 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 6211} 6212 6213// Response returns the raw server response from the last page request. 6214func (iter OpenIDConnectProviderCollectionIterator) Response() OpenIDConnectProviderCollection { 6215 return iter.page.Response() 6216} 6217 6218// Value returns the current value or a zero-initialized value if the 6219// iterator has advanced beyond the end of the collection. 6220func (iter OpenIDConnectProviderCollectionIterator) Value() OpenidConnectProviderContract { 6221 if !iter.page.NotDone() { 6222 return OpenidConnectProviderContract{} 6223 } 6224 return iter.page.Values()[iter.i] 6225} 6226 6227// Creates a new instance of the OpenIDConnectProviderCollectionIterator type. 6228func NewOpenIDConnectProviderCollectionIterator(page OpenIDConnectProviderCollectionPage) OpenIDConnectProviderCollectionIterator { 6229 return OpenIDConnectProviderCollectionIterator{page: page} 6230} 6231 6232// IsEmpty returns true if the ListResult contains no values. 6233func (oicpc OpenIDConnectProviderCollection) IsEmpty() bool { 6234 return oicpc.Value == nil || len(*oicpc.Value) == 0 6235} 6236 6237// openIDConnectProviderCollectionPreparer prepares a request to retrieve the next set of results. 6238// It returns nil if no more results exist. 6239func (oicpc OpenIDConnectProviderCollection) openIDConnectProviderCollectionPreparer(ctx context.Context) (*http.Request, error) { 6240 if oicpc.NextLink == nil || len(to.String(oicpc.NextLink)) < 1 { 6241 return nil, nil 6242 } 6243 return autorest.Prepare((&http.Request{}).WithContext(ctx), 6244 autorest.AsJSON(), 6245 autorest.AsGet(), 6246 autorest.WithBaseURL(to.String(oicpc.NextLink))) 6247} 6248 6249// OpenIDConnectProviderCollectionPage contains a page of OpenidConnectProviderContract values. 6250type OpenIDConnectProviderCollectionPage struct { 6251 fn func(context.Context, OpenIDConnectProviderCollection) (OpenIDConnectProviderCollection, error) 6252 oicpc OpenIDConnectProviderCollection 6253} 6254 6255// NextWithContext advances to the next page of values. If there was an error making 6256// the request the page does not advance and the error is returned. 6257func (page *OpenIDConnectProviderCollectionPage) NextWithContext(ctx context.Context) (err error) { 6258 if tracing.IsEnabled() { 6259 ctx = tracing.StartSpan(ctx, fqdn+"/OpenIDConnectProviderCollectionPage.NextWithContext") 6260 defer func() { 6261 sc := -1 6262 if page.Response().Response.Response != nil { 6263 sc = page.Response().Response.Response.StatusCode 6264 } 6265 tracing.EndSpan(ctx, sc, err) 6266 }() 6267 } 6268 next, err := page.fn(ctx, page.oicpc) 6269 if err != nil { 6270 return err 6271 } 6272 page.oicpc = next 6273 return nil 6274} 6275 6276// Next advances to the next page of values. If there was an error making 6277// the request the page does not advance and the error is returned. 6278// Deprecated: Use NextWithContext() instead. 6279func (page *OpenIDConnectProviderCollectionPage) Next() error { 6280 return page.NextWithContext(context.Background()) 6281} 6282 6283// NotDone returns true if the page enumeration should be started or is not yet complete. 6284func (page OpenIDConnectProviderCollectionPage) NotDone() bool { 6285 return !page.oicpc.IsEmpty() 6286} 6287 6288// Response returns the raw server response from the last page request. 6289func (page OpenIDConnectProviderCollectionPage) Response() OpenIDConnectProviderCollection { 6290 return page.oicpc 6291} 6292 6293// Values returns the slice of values for the current page or nil if there are no values. 6294func (page OpenIDConnectProviderCollectionPage) Values() []OpenidConnectProviderContract { 6295 if page.oicpc.IsEmpty() { 6296 return nil 6297 } 6298 return *page.oicpc.Value 6299} 6300 6301// Creates a new instance of the OpenIDConnectProviderCollectionPage type. 6302func NewOpenIDConnectProviderCollectionPage(getNextPage func(context.Context, OpenIDConnectProviderCollection) (OpenIDConnectProviderCollection, error)) OpenIDConnectProviderCollectionPage { 6303 return OpenIDConnectProviderCollectionPage{fn: getNextPage} 6304} 6305 6306// OpenidConnectProviderContract openId Connect Provider details. 6307type OpenidConnectProviderContract struct { 6308 autorest.Response `json:"-"` 6309 // OpenidConnectProviderContractProperties - OpenId Connect Provider contract properties. 6310 *OpenidConnectProviderContractProperties `json:"properties,omitempty"` 6311 // ID - READ-ONLY; Resource ID. 6312 ID *string `json:"id,omitempty"` 6313 // Name - READ-ONLY; Resource name. 6314 Name *string `json:"name,omitempty"` 6315 // Type - READ-ONLY; Resource type for API Management resource. 6316 Type *string `json:"type,omitempty"` 6317} 6318 6319// MarshalJSON is the custom marshaler for OpenidConnectProviderContract. 6320func (ocpc OpenidConnectProviderContract) MarshalJSON() ([]byte, error) { 6321 objectMap := make(map[string]interface{}) 6322 if ocpc.OpenidConnectProviderContractProperties != nil { 6323 objectMap["properties"] = ocpc.OpenidConnectProviderContractProperties 6324 } 6325 return json.Marshal(objectMap) 6326} 6327 6328// UnmarshalJSON is the custom unmarshaler for OpenidConnectProviderContract struct. 6329func (ocpc *OpenidConnectProviderContract) UnmarshalJSON(body []byte) error { 6330 var m map[string]*json.RawMessage 6331 err := json.Unmarshal(body, &m) 6332 if err != nil { 6333 return err 6334 } 6335 for k, v := range m { 6336 switch k { 6337 case "properties": 6338 if v != nil { 6339 var openidConnectProviderContractProperties OpenidConnectProviderContractProperties 6340 err = json.Unmarshal(*v, &openidConnectProviderContractProperties) 6341 if err != nil { 6342 return err 6343 } 6344 ocpc.OpenidConnectProviderContractProperties = &openidConnectProviderContractProperties 6345 } 6346 case "id": 6347 if v != nil { 6348 var ID string 6349 err = json.Unmarshal(*v, &ID) 6350 if err != nil { 6351 return err 6352 } 6353 ocpc.ID = &ID 6354 } 6355 case "name": 6356 if v != nil { 6357 var name string 6358 err = json.Unmarshal(*v, &name) 6359 if err != nil { 6360 return err 6361 } 6362 ocpc.Name = &name 6363 } 6364 case "type": 6365 if v != nil { 6366 var typeVar string 6367 err = json.Unmarshal(*v, &typeVar) 6368 if err != nil { 6369 return err 6370 } 6371 ocpc.Type = &typeVar 6372 } 6373 } 6374 } 6375 6376 return nil 6377} 6378 6379// OpenidConnectProviderContractProperties openID Connect Providers Contract. 6380type OpenidConnectProviderContractProperties struct { 6381 // DisplayName - User-friendly OpenID Connect Provider name. 6382 DisplayName *string `json:"displayName,omitempty"` 6383 // Description - User-friendly description of OpenID Connect Provider. 6384 Description *string `json:"description,omitempty"` 6385 // MetadataEndpoint - Metadata endpoint URI. 6386 MetadataEndpoint *string `json:"metadataEndpoint,omitempty"` 6387 // ClientID - Client ID of developer console which is the client application. 6388 ClientID *string `json:"clientId,omitempty"` 6389 // ClientSecret - Client Secret of developer console which is the client application. 6390 ClientSecret *string `json:"clientSecret,omitempty"` 6391} 6392 6393// OpenidConnectProviderUpdateContract parameters supplied to the Update OpenID Connect Provider operation. 6394type OpenidConnectProviderUpdateContract struct { 6395 // OpenidConnectProviderUpdateContractProperties - OpenId Connect Provider Update contract properties. 6396 *OpenidConnectProviderUpdateContractProperties `json:"properties,omitempty"` 6397} 6398 6399// MarshalJSON is the custom marshaler for OpenidConnectProviderUpdateContract. 6400func (ocpuc OpenidConnectProviderUpdateContract) MarshalJSON() ([]byte, error) { 6401 objectMap := make(map[string]interface{}) 6402 if ocpuc.OpenidConnectProviderUpdateContractProperties != nil { 6403 objectMap["properties"] = ocpuc.OpenidConnectProviderUpdateContractProperties 6404 } 6405 return json.Marshal(objectMap) 6406} 6407 6408// UnmarshalJSON is the custom unmarshaler for OpenidConnectProviderUpdateContract struct. 6409func (ocpuc *OpenidConnectProviderUpdateContract) UnmarshalJSON(body []byte) error { 6410 var m map[string]*json.RawMessage 6411 err := json.Unmarshal(body, &m) 6412 if err != nil { 6413 return err 6414 } 6415 for k, v := range m { 6416 switch k { 6417 case "properties": 6418 if v != nil { 6419 var openidConnectProviderUpdateContractProperties OpenidConnectProviderUpdateContractProperties 6420 err = json.Unmarshal(*v, &openidConnectProviderUpdateContractProperties) 6421 if err != nil { 6422 return err 6423 } 6424 ocpuc.OpenidConnectProviderUpdateContractProperties = &openidConnectProviderUpdateContractProperties 6425 } 6426 } 6427 } 6428 6429 return nil 6430} 6431 6432// OpenidConnectProviderUpdateContractProperties parameters supplied to the Update OpenID Connect Provider 6433// operation. 6434type OpenidConnectProviderUpdateContractProperties struct { 6435 // DisplayName - User-friendly OpenID Connect Provider name. 6436 DisplayName *string `json:"displayName,omitempty"` 6437 // Description - User-friendly description of OpenID Connect Provider. 6438 Description *string `json:"description,omitempty"` 6439 // MetadataEndpoint - Metadata endpoint URI. 6440 MetadataEndpoint *string `json:"metadataEndpoint,omitempty"` 6441 // ClientID - Client ID of developer console which is the client application. 6442 ClientID *string `json:"clientId,omitempty"` 6443 // ClientSecret - Client Secret of developer console which is the client application. 6444 ClientSecret *string `json:"clientSecret,omitempty"` 6445} 6446 6447// Operation REST API operation 6448type Operation struct { 6449 // Name - Operation name: {provider}/{resource}/{operation} 6450 Name *string `json:"name,omitempty"` 6451 // Display - The object that describes the operation. 6452 Display *OperationDisplay `json:"display,omitempty"` 6453 // Origin - The operation origin. 6454 Origin *string `json:"origin,omitempty"` 6455 // Properties - The operation properties. 6456 Properties interface{} `json:"properties,omitempty"` 6457} 6458 6459// OperationCollection paged Operation list representation. 6460type OperationCollection struct { 6461 autorest.Response `json:"-"` 6462 // Value - READ-ONLY; Page values. 6463 Value *[]OperationContract `json:"value,omitempty"` 6464 // NextLink - READ-ONLY; Next page link if any. 6465 NextLink *string `json:"nextLink,omitempty"` 6466} 6467 6468// OperationCollectionIterator provides access to a complete listing of OperationContract values. 6469type OperationCollectionIterator struct { 6470 i int 6471 page OperationCollectionPage 6472} 6473 6474// NextWithContext advances to the next value. If there was an error making 6475// the request the iterator does not advance and the error is returned. 6476func (iter *OperationCollectionIterator) NextWithContext(ctx context.Context) (err error) { 6477 if tracing.IsEnabled() { 6478 ctx = tracing.StartSpan(ctx, fqdn+"/OperationCollectionIterator.NextWithContext") 6479 defer func() { 6480 sc := -1 6481 if iter.Response().Response.Response != nil { 6482 sc = iter.Response().Response.Response.StatusCode 6483 } 6484 tracing.EndSpan(ctx, sc, err) 6485 }() 6486 } 6487 iter.i++ 6488 if iter.i < len(iter.page.Values()) { 6489 return nil 6490 } 6491 err = iter.page.NextWithContext(ctx) 6492 if err != nil { 6493 iter.i-- 6494 return err 6495 } 6496 iter.i = 0 6497 return nil 6498} 6499 6500// Next advances to the next value. If there was an error making 6501// the request the iterator does not advance and the error is returned. 6502// Deprecated: Use NextWithContext() instead. 6503func (iter *OperationCollectionIterator) Next() error { 6504 return iter.NextWithContext(context.Background()) 6505} 6506 6507// NotDone returns true if the enumeration should be started or is not yet complete. 6508func (iter OperationCollectionIterator) NotDone() bool { 6509 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 6510} 6511 6512// Response returns the raw server response from the last page request. 6513func (iter OperationCollectionIterator) Response() OperationCollection { 6514 return iter.page.Response() 6515} 6516 6517// Value returns the current value or a zero-initialized value if the 6518// iterator has advanced beyond the end of the collection. 6519func (iter OperationCollectionIterator) Value() OperationContract { 6520 if !iter.page.NotDone() { 6521 return OperationContract{} 6522 } 6523 return iter.page.Values()[iter.i] 6524} 6525 6526// Creates a new instance of the OperationCollectionIterator type. 6527func NewOperationCollectionIterator(page OperationCollectionPage) OperationCollectionIterator { 6528 return OperationCollectionIterator{page: page} 6529} 6530 6531// IsEmpty returns true if the ListResult contains no values. 6532func (oc OperationCollection) IsEmpty() bool { 6533 return oc.Value == nil || len(*oc.Value) == 0 6534} 6535 6536// operationCollectionPreparer prepares a request to retrieve the next set of results. 6537// It returns nil if no more results exist. 6538func (oc OperationCollection) operationCollectionPreparer(ctx context.Context) (*http.Request, error) { 6539 if oc.NextLink == nil || len(to.String(oc.NextLink)) < 1 { 6540 return nil, nil 6541 } 6542 return autorest.Prepare((&http.Request{}).WithContext(ctx), 6543 autorest.AsJSON(), 6544 autorest.AsGet(), 6545 autorest.WithBaseURL(to.String(oc.NextLink))) 6546} 6547 6548// OperationCollectionPage contains a page of OperationContract values. 6549type OperationCollectionPage struct { 6550 fn func(context.Context, OperationCollection) (OperationCollection, error) 6551 oc OperationCollection 6552} 6553 6554// NextWithContext advances to the next page of values. If there was an error making 6555// the request the page does not advance and the error is returned. 6556func (page *OperationCollectionPage) NextWithContext(ctx context.Context) (err error) { 6557 if tracing.IsEnabled() { 6558 ctx = tracing.StartSpan(ctx, fqdn+"/OperationCollectionPage.NextWithContext") 6559 defer func() { 6560 sc := -1 6561 if page.Response().Response.Response != nil { 6562 sc = page.Response().Response.Response.StatusCode 6563 } 6564 tracing.EndSpan(ctx, sc, err) 6565 }() 6566 } 6567 next, err := page.fn(ctx, page.oc) 6568 if err != nil { 6569 return err 6570 } 6571 page.oc = next 6572 return nil 6573} 6574 6575// Next advances to the next page of values. If there was an error making 6576// the request the page does not advance and the error is returned. 6577// Deprecated: Use NextWithContext() instead. 6578func (page *OperationCollectionPage) Next() error { 6579 return page.NextWithContext(context.Background()) 6580} 6581 6582// NotDone returns true if the page enumeration should be started or is not yet complete. 6583func (page OperationCollectionPage) NotDone() bool { 6584 return !page.oc.IsEmpty() 6585} 6586 6587// Response returns the raw server response from the last page request. 6588func (page OperationCollectionPage) Response() OperationCollection { 6589 return page.oc 6590} 6591 6592// Values returns the slice of values for the current page or nil if there are no values. 6593func (page OperationCollectionPage) Values() []OperationContract { 6594 if page.oc.IsEmpty() { 6595 return nil 6596 } 6597 return *page.oc.Value 6598} 6599 6600// Creates a new instance of the OperationCollectionPage type. 6601func NewOperationCollectionPage(getNextPage func(context.Context, OperationCollection) (OperationCollection, error)) OperationCollectionPage { 6602 return OperationCollectionPage{fn: getNextPage} 6603} 6604 6605// OperationContract api Operation details. 6606type OperationContract struct { 6607 autorest.Response `json:"-"` 6608 // OperationContractProperties - Properties of the Operation Contract. 6609 *OperationContractProperties `json:"properties,omitempty"` 6610 // ID - READ-ONLY; Resource ID. 6611 ID *string `json:"id,omitempty"` 6612 // Name - READ-ONLY; Resource name. 6613 Name *string `json:"name,omitempty"` 6614 // Type - READ-ONLY; Resource type for API Management resource. 6615 Type *string `json:"type,omitempty"` 6616} 6617 6618// MarshalJSON is the custom marshaler for OperationContract. 6619func (oc OperationContract) MarshalJSON() ([]byte, error) { 6620 objectMap := make(map[string]interface{}) 6621 if oc.OperationContractProperties != nil { 6622 objectMap["properties"] = oc.OperationContractProperties 6623 } 6624 return json.Marshal(objectMap) 6625} 6626 6627// UnmarshalJSON is the custom unmarshaler for OperationContract struct. 6628func (oc *OperationContract) UnmarshalJSON(body []byte) error { 6629 var m map[string]*json.RawMessage 6630 err := json.Unmarshal(body, &m) 6631 if err != nil { 6632 return err 6633 } 6634 for k, v := range m { 6635 switch k { 6636 case "properties": 6637 if v != nil { 6638 var operationContractProperties OperationContractProperties 6639 err = json.Unmarshal(*v, &operationContractProperties) 6640 if err != nil { 6641 return err 6642 } 6643 oc.OperationContractProperties = &operationContractProperties 6644 } 6645 case "id": 6646 if v != nil { 6647 var ID string 6648 err = json.Unmarshal(*v, &ID) 6649 if err != nil { 6650 return err 6651 } 6652 oc.ID = &ID 6653 } 6654 case "name": 6655 if v != nil { 6656 var name string 6657 err = json.Unmarshal(*v, &name) 6658 if err != nil { 6659 return err 6660 } 6661 oc.Name = &name 6662 } 6663 case "type": 6664 if v != nil { 6665 var typeVar string 6666 err = json.Unmarshal(*v, &typeVar) 6667 if err != nil { 6668 return err 6669 } 6670 oc.Type = &typeVar 6671 } 6672 } 6673 } 6674 6675 return nil 6676} 6677 6678// OperationContractProperties operation Contract Properties 6679type OperationContractProperties struct { 6680 // DisplayName - Operation Name. 6681 DisplayName *string `json:"displayName,omitempty"` 6682 // Method - A Valid HTTP Operation Method. Typical Http Methods like GET, PUT, POST but not limited by only them. 6683 Method *string `json:"method,omitempty"` 6684 // URLTemplate - Relative URL template identifying the target resource for this operation. May include parameters. Example: /customers/{cid}/orders/{oid}/?date={date} 6685 URLTemplate *string `json:"urlTemplate,omitempty"` 6686 // TemplateParameters - Collection of URL template parameters. 6687 TemplateParameters *[]ParameterContract `json:"templateParameters,omitempty"` 6688 // Description - Description of the operation. May include HTML formatting tags. 6689 Description *string `json:"description,omitempty"` 6690 // Request - An entity containing request details. 6691 Request *RequestContract `json:"request,omitempty"` 6692 // Responses - Array of Operation responses. 6693 Responses *[]ResponseContract `json:"responses,omitempty"` 6694 // Policies - Operation Policies 6695 Policies *string `json:"policies,omitempty"` 6696} 6697 6698// OperationDisplay the object that describes the operation. 6699type OperationDisplay struct { 6700 // Provider - Friendly name of the resource provider 6701 Provider *string `json:"provider,omitempty"` 6702 // Operation - Operation type: read, write, delete, listKeys/action, etc. 6703 Operation *string `json:"operation,omitempty"` 6704 // Resource - Resource type on which the operation is performed. 6705 Resource *string `json:"resource,omitempty"` 6706 // Description - Friendly name of the operation 6707 Description *string `json:"description,omitempty"` 6708} 6709 6710// OperationEntityBaseContract api Operation Entity Base Contract details. 6711type OperationEntityBaseContract struct { 6712 // TemplateParameters - Collection of URL template parameters. 6713 TemplateParameters *[]ParameterContract `json:"templateParameters,omitempty"` 6714 // Description - Description of the operation. May include HTML formatting tags. 6715 Description *string `json:"description,omitempty"` 6716 // Request - An entity containing request details. 6717 Request *RequestContract `json:"request,omitempty"` 6718 // Responses - Array of Operation responses. 6719 Responses *[]ResponseContract `json:"responses,omitempty"` 6720 // Policies - Operation Policies 6721 Policies *string `json:"policies,omitempty"` 6722} 6723 6724// OperationListResult result of the request to list REST API operations. It contains a list of operations 6725// and a URL nextLink to get the next set of results. 6726type OperationListResult struct { 6727 autorest.Response `json:"-"` 6728 // Value - List of operations supported by the resource provider. 6729 Value *[]Operation `json:"value,omitempty"` 6730 // NextLink - URL to get the next set of operation list results if there are any. 6731 NextLink *string `json:"nextLink,omitempty"` 6732} 6733 6734// OperationListResultIterator provides access to a complete listing of Operation values. 6735type OperationListResultIterator struct { 6736 i int 6737 page OperationListResultPage 6738} 6739 6740// NextWithContext advances to the next value. If there was an error making 6741// the request the iterator does not advance and the error is returned. 6742func (iter *OperationListResultIterator) NextWithContext(ctx context.Context) (err error) { 6743 if tracing.IsEnabled() { 6744 ctx = tracing.StartSpan(ctx, fqdn+"/OperationListResultIterator.NextWithContext") 6745 defer func() { 6746 sc := -1 6747 if iter.Response().Response.Response != nil { 6748 sc = iter.Response().Response.Response.StatusCode 6749 } 6750 tracing.EndSpan(ctx, sc, err) 6751 }() 6752 } 6753 iter.i++ 6754 if iter.i < len(iter.page.Values()) { 6755 return nil 6756 } 6757 err = iter.page.NextWithContext(ctx) 6758 if err != nil { 6759 iter.i-- 6760 return err 6761 } 6762 iter.i = 0 6763 return nil 6764} 6765 6766// Next advances to the next value. If there was an error making 6767// the request the iterator does not advance and the error is returned. 6768// Deprecated: Use NextWithContext() instead. 6769func (iter *OperationListResultIterator) Next() error { 6770 return iter.NextWithContext(context.Background()) 6771} 6772 6773// NotDone returns true if the enumeration should be started or is not yet complete. 6774func (iter OperationListResultIterator) NotDone() bool { 6775 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 6776} 6777 6778// Response returns the raw server response from the last page request. 6779func (iter OperationListResultIterator) Response() OperationListResult { 6780 return iter.page.Response() 6781} 6782 6783// Value returns the current value or a zero-initialized value if the 6784// iterator has advanced beyond the end of the collection. 6785func (iter OperationListResultIterator) Value() Operation { 6786 if !iter.page.NotDone() { 6787 return Operation{} 6788 } 6789 return iter.page.Values()[iter.i] 6790} 6791 6792// Creates a new instance of the OperationListResultIterator type. 6793func NewOperationListResultIterator(page OperationListResultPage) OperationListResultIterator { 6794 return OperationListResultIterator{page: page} 6795} 6796 6797// IsEmpty returns true if the ListResult contains no values. 6798func (olr OperationListResult) IsEmpty() bool { 6799 return olr.Value == nil || len(*olr.Value) == 0 6800} 6801 6802// operationListResultPreparer prepares a request to retrieve the next set of results. 6803// It returns nil if no more results exist. 6804func (olr OperationListResult) operationListResultPreparer(ctx context.Context) (*http.Request, error) { 6805 if olr.NextLink == nil || len(to.String(olr.NextLink)) < 1 { 6806 return nil, nil 6807 } 6808 return autorest.Prepare((&http.Request{}).WithContext(ctx), 6809 autorest.AsJSON(), 6810 autorest.AsGet(), 6811 autorest.WithBaseURL(to.String(olr.NextLink))) 6812} 6813 6814// OperationListResultPage contains a page of Operation values. 6815type OperationListResultPage struct { 6816 fn func(context.Context, OperationListResult) (OperationListResult, error) 6817 olr OperationListResult 6818} 6819 6820// NextWithContext advances to the next page of values. If there was an error making 6821// the request the page does not advance and the error is returned. 6822func (page *OperationListResultPage) NextWithContext(ctx context.Context) (err error) { 6823 if tracing.IsEnabled() { 6824 ctx = tracing.StartSpan(ctx, fqdn+"/OperationListResultPage.NextWithContext") 6825 defer func() { 6826 sc := -1 6827 if page.Response().Response.Response != nil { 6828 sc = page.Response().Response.Response.StatusCode 6829 } 6830 tracing.EndSpan(ctx, sc, err) 6831 }() 6832 } 6833 next, err := page.fn(ctx, page.olr) 6834 if err != nil { 6835 return err 6836 } 6837 page.olr = next 6838 return nil 6839} 6840 6841// Next advances to the next page of values. If there was an error making 6842// the request the page does not advance and the error is returned. 6843// Deprecated: Use NextWithContext() instead. 6844func (page *OperationListResultPage) Next() error { 6845 return page.NextWithContext(context.Background()) 6846} 6847 6848// NotDone returns true if the page enumeration should be started or is not yet complete. 6849func (page OperationListResultPage) NotDone() bool { 6850 return !page.olr.IsEmpty() 6851} 6852 6853// Response returns the raw server response from the last page request. 6854func (page OperationListResultPage) Response() OperationListResult { 6855 return page.olr 6856} 6857 6858// Values returns the slice of values for the current page or nil if there are no values. 6859func (page OperationListResultPage) Values() []Operation { 6860 if page.olr.IsEmpty() { 6861 return nil 6862 } 6863 return *page.olr.Value 6864} 6865 6866// Creates a new instance of the OperationListResultPage type. 6867func NewOperationListResultPage(getNextPage func(context.Context, OperationListResult) (OperationListResult, error)) OperationListResultPage { 6868 return OperationListResultPage{fn: getNextPage} 6869} 6870 6871// OperationResultContract operation Result. 6872type OperationResultContract struct { 6873 autorest.Response `json:"-"` 6874 // ID - Operation result identifier. 6875 ID *string `json:"id,omitempty"` 6876 // Status - Status of an async operation. Possible values include: 'Started', 'InProgress', 'Succeeded', 'Failed' 6877 Status AsyncOperationStatus `json:"status,omitempty"` 6878 // 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. 6879 Started *date.Time `json:"started,omitempty"` 6880 // 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. 6881 Updated *date.Time `json:"updated,omitempty"` 6882 // ResultInfo - Optional result info. 6883 ResultInfo *string `json:"resultInfo,omitempty"` 6884 // Error - Error Body Contract 6885 Error *ErrorResponseBody `json:"error,omitempty"` 6886 // ActionLog - READ-ONLY; This property if only provided as part of the TenantConfiguration_Validate operation. It contains the log the entities which will be updated/created/deleted as part of the TenantConfiguration_Deploy operation. 6887 ActionLog *[]OperationResultLogItemContract `json:"actionLog,omitempty"` 6888} 6889 6890// OperationResultLogItemContract log of the entity being created, updated or deleted. 6891type OperationResultLogItemContract struct { 6892 // ObjectType - The type of entity contract. 6893 ObjectType *string `json:"objectType,omitempty"` 6894 // Action - Action like create/update/delete. 6895 Action *string `json:"action,omitempty"` 6896 // ObjectKey - Identifier of the entity being created/updated/deleted. 6897 ObjectKey *string `json:"objectKey,omitempty"` 6898} 6899 6900// OperationTagResourceContractProperties operation Entity contract Properties. 6901type OperationTagResourceContractProperties struct { 6902 // ID - Identifier of the operation in form /operations/{operationId}. 6903 ID *string `json:"id,omitempty"` 6904 // Name - READ-ONLY; Operation name. 6905 Name *string `json:"name,omitempty"` 6906 // APIName - READ-ONLY; Api Name. 6907 APIName *string `json:"apiName,omitempty"` 6908 // APIRevision - READ-ONLY; Api Revision. 6909 APIRevision *string `json:"apiRevision,omitempty"` 6910 // APIVersion - READ-ONLY; Api Version. 6911 APIVersion *string `json:"apiVersion,omitempty"` 6912 // Description - READ-ONLY; Operation Description. 6913 Description *string `json:"description,omitempty"` 6914 // Method - READ-ONLY; A Valid HTTP Operation Method. Typical Http Methods like GET, PUT, POST but not limited by only them. 6915 Method *string `json:"method,omitempty"` 6916 // URLTemplate - READ-ONLY; Relative URL template identifying the target resource for this operation. May include parameters. Example: /customers/{cid}/orders/{oid}/?date={date} 6917 URLTemplate *string `json:"urlTemplate,omitempty"` 6918} 6919 6920// OperationUpdateContract api Operation Update Contract details. 6921type OperationUpdateContract struct { 6922 // OperationUpdateContractProperties - Properties of the API Operation entity that can be updated. 6923 *OperationUpdateContractProperties `json:"properties,omitempty"` 6924} 6925 6926// MarshalJSON is the custom marshaler for OperationUpdateContract. 6927func (ouc OperationUpdateContract) MarshalJSON() ([]byte, error) { 6928 objectMap := make(map[string]interface{}) 6929 if ouc.OperationUpdateContractProperties != nil { 6930 objectMap["properties"] = ouc.OperationUpdateContractProperties 6931 } 6932 return json.Marshal(objectMap) 6933} 6934 6935// UnmarshalJSON is the custom unmarshaler for OperationUpdateContract struct. 6936func (ouc *OperationUpdateContract) UnmarshalJSON(body []byte) error { 6937 var m map[string]*json.RawMessage 6938 err := json.Unmarshal(body, &m) 6939 if err != nil { 6940 return err 6941 } 6942 for k, v := range m { 6943 switch k { 6944 case "properties": 6945 if v != nil { 6946 var operationUpdateContractProperties OperationUpdateContractProperties 6947 err = json.Unmarshal(*v, &operationUpdateContractProperties) 6948 if err != nil { 6949 return err 6950 } 6951 ouc.OperationUpdateContractProperties = &operationUpdateContractProperties 6952 } 6953 } 6954 } 6955 6956 return nil 6957} 6958 6959// OperationUpdateContractProperties operation Update Contract Properties. 6960type OperationUpdateContractProperties struct { 6961 // DisplayName - Operation Name. 6962 DisplayName *string `json:"displayName,omitempty"` 6963 // Method - A Valid HTTP Operation Method. Typical Http Methods like GET, PUT, POST but not limited by only them. 6964 Method *string `json:"method,omitempty"` 6965 // URLTemplate - Relative URL template identifying the target resource for this operation. May include parameters. Example: /customers/{cid}/orders/{oid}/?date={date} 6966 URLTemplate *string `json:"urlTemplate,omitempty"` 6967 // TemplateParameters - Collection of URL template parameters. 6968 TemplateParameters *[]ParameterContract `json:"templateParameters,omitempty"` 6969 // Description - Description of the operation. May include HTML formatting tags. 6970 Description *string `json:"description,omitempty"` 6971 // Request - An entity containing request details. 6972 Request *RequestContract `json:"request,omitempty"` 6973 // Responses - Array of Operation responses. 6974 Responses *[]ResponseContract `json:"responses,omitempty"` 6975 // Policies - Operation Policies 6976 Policies *string `json:"policies,omitempty"` 6977} 6978 6979// ParameterContract operation parameters details. 6980type ParameterContract struct { 6981 // Name - Parameter name. 6982 Name *string `json:"name,omitempty"` 6983 // Description - Parameter description. 6984 Description *string `json:"description,omitempty"` 6985 // Type - Parameter type. 6986 Type *string `json:"type,omitempty"` 6987 // DefaultValue - Default parameter value. 6988 DefaultValue *string `json:"defaultValue,omitempty"` 6989 // Required - whether parameter is required or not. 6990 Required *bool `json:"required,omitempty"` 6991 // Values - Parameter values. 6992 Values *[]string `json:"values,omitempty"` 6993} 6994 6995// PipelineDiagnosticSettings diagnostic settings for incoming/outgoing HTTP messages to the Gateway. 6996type PipelineDiagnosticSettings struct { 6997 // Request - Diagnostic settings for request. 6998 Request *HTTPMessageDiagnostic `json:"request,omitempty"` 6999 // Response - Diagnostic settings for response. 7000 Response *HTTPMessageDiagnostic `json:"response,omitempty"` 7001} 7002 7003// PolicyCollection the response of the list policy operation. 7004type PolicyCollection struct { 7005 autorest.Response `json:"-"` 7006 // Value - Policy Contract value. 7007 Value *[]PolicyContract `json:"value,omitempty"` 7008 // NextLink - Next page link if any. 7009 NextLink *string `json:"nextLink,omitempty"` 7010} 7011 7012// PolicyContract policy Contract details. 7013type PolicyContract struct { 7014 autorest.Response `json:"-"` 7015 // PolicyContractProperties - Properties of the Policy. 7016 *PolicyContractProperties `json:"properties,omitempty"` 7017 // ID - READ-ONLY; Resource ID. 7018 ID *string `json:"id,omitempty"` 7019 // Name - READ-ONLY; Resource name. 7020 Name *string `json:"name,omitempty"` 7021 // Type - READ-ONLY; Resource type for API Management resource. 7022 Type *string `json:"type,omitempty"` 7023} 7024 7025// MarshalJSON is the custom marshaler for PolicyContract. 7026func (pc PolicyContract) MarshalJSON() ([]byte, error) { 7027 objectMap := make(map[string]interface{}) 7028 if pc.PolicyContractProperties != nil { 7029 objectMap["properties"] = pc.PolicyContractProperties 7030 } 7031 return json.Marshal(objectMap) 7032} 7033 7034// UnmarshalJSON is the custom unmarshaler for PolicyContract struct. 7035func (pc *PolicyContract) UnmarshalJSON(body []byte) error { 7036 var m map[string]*json.RawMessage 7037 err := json.Unmarshal(body, &m) 7038 if err != nil { 7039 return err 7040 } 7041 for k, v := range m { 7042 switch k { 7043 case "properties": 7044 if v != nil { 7045 var policyContractProperties PolicyContractProperties 7046 err = json.Unmarshal(*v, &policyContractProperties) 7047 if err != nil { 7048 return err 7049 } 7050 pc.PolicyContractProperties = &policyContractProperties 7051 } 7052 case "id": 7053 if v != nil { 7054 var ID string 7055 err = json.Unmarshal(*v, &ID) 7056 if err != nil { 7057 return err 7058 } 7059 pc.ID = &ID 7060 } 7061 case "name": 7062 if v != nil { 7063 var name string 7064 err = json.Unmarshal(*v, &name) 7065 if err != nil { 7066 return err 7067 } 7068 pc.Name = &name 7069 } 7070 case "type": 7071 if v != nil { 7072 var typeVar string 7073 err = json.Unmarshal(*v, &typeVar) 7074 if err != nil { 7075 return err 7076 } 7077 pc.Type = &typeVar 7078 } 7079 } 7080 } 7081 7082 return nil 7083} 7084 7085// PolicyContractProperties policy contract Properties. 7086type PolicyContractProperties struct { 7087 // PolicyContent - Json escaped Xml Encoded contents of the Policy. 7088 PolicyContent *string `json:"policyContent,omitempty"` 7089 // ContentFormat - Format of the policyContent. Possible values include: 'XML', 'XMLLink', 'Rawxml', 'RawxmlLink' 7090 ContentFormat PolicyContentFormat `json:"contentFormat,omitempty"` 7091} 7092 7093// PolicySnippetContract policy snippet. 7094type PolicySnippetContract struct { 7095 // Name - READ-ONLY; Snippet name. 7096 Name *string `json:"name,omitempty"` 7097 // Content - READ-ONLY; Snippet content. 7098 Content *string `json:"content,omitempty"` 7099 // ToolTip - READ-ONLY; Snippet toolTip. 7100 ToolTip *string `json:"toolTip,omitempty"` 7101 // Scope - READ-ONLY; Binary OR value of the Snippet scope. 7102 Scope *int32 `json:"scope,omitempty"` 7103} 7104 7105// PolicySnippetsCollection the response of the list policy snippets operation. 7106type PolicySnippetsCollection struct { 7107 autorest.Response `json:"-"` 7108 // Value - Policy snippet value. 7109 Value *[]PolicySnippetContract `json:"value,omitempty"` 7110} 7111 7112// PortalDelegationSettings delegation settings for a developer portal. 7113type PortalDelegationSettings struct { 7114 autorest.Response `json:"-"` 7115 // PortalDelegationSettingsProperties - Delegation settings contract properties. 7116 *PortalDelegationSettingsProperties `json:"properties,omitempty"` 7117 // ID - READ-ONLY; Resource ID. 7118 ID *string `json:"id,omitempty"` 7119 // Name - READ-ONLY; Resource name. 7120 Name *string `json:"name,omitempty"` 7121 // Type - READ-ONLY; Resource type for API Management resource. 7122 Type *string `json:"type,omitempty"` 7123} 7124 7125// MarshalJSON is the custom marshaler for PortalDelegationSettings. 7126func (pds PortalDelegationSettings) MarshalJSON() ([]byte, error) { 7127 objectMap := make(map[string]interface{}) 7128 if pds.PortalDelegationSettingsProperties != nil { 7129 objectMap["properties"] = pds.PortalDelegationSettingsProperties 7130 } 7131 return json.Marshal(objectMap) 7132} 7133 7134// UnmarshalJSON is the custom unmarshaler for PortalDelegationSettings struct. 7135func (pds *PortalDelegationSettings) UnmarshalJSON(body []byte) error { 7136 var m map[string]*json.RawMessage 7137 err := json.Unmarshal(body, &m) 7138 if err != nil { 7139 return err 7140 } 7141 for k, v := range m { 7142 switch k { 7143 case "properties": 7144 if v != nil { 7145 var portalDelegationSettingsProperties PortalDelegationSettingsProperties 7146 err = json.Unmarshal(*v, &portalDelegationSettingsProperties) 7147 if err != nil { 7148 return err 7149 } 7150 pds.PortalDelegationSettingsProperties = &portalDelegationSettingsProperties 7151 } 7152 case "id": 7153 if v != nil { 7154 var ID string 7155 err = json.Unmarshal(*v, &ID) 7156 if err != nil { 7157 return err 7158 } 7159 pds.ID = &ID 7160 } 7161 case "name": 7162 if v != nil { 7163 var name string 7164 err = json.Unmarshal(*v, &name) 7165 if err != nil { 7166 return err 7167 } 7168 pds.Name = &name 7169 } 7170 case "type": 7171 if v != nil { 7172 var typeVar string 7173 err = json.Unmarshal(*v, &typeVar) 7174 if err != nil { 7175 return err 7176 } 7177 pds.Type = &typeVar 7178 } 7179 } 7180 } 7181 7182 return nil 7183} 7184 7185// PortalDelegationSettingsProperties delegation settings contract properties. 7186type PortalDelegationSettingsProperties struct { 7187 // URL - A delegation Url. 7188 URL *string `json:"url,omitempty"` 7189 // ValidationKey - A base64-encoded validation key to validate, that a request is coming from Azure API Management. 7190 ValidationKey *string `json:"validationKey,omitempty"` 7191 // Subscriptions - Subscriptions delegation settings. 7192 Subscriptions *SubscriptionsDelegationSettingsProperties `json:"subscriptions,omitempty"` 7193 // UserRegistration - User registration delegation settings. 7194 UserRegistration *RegistrationDelegationSettingsProperties `json:"userRegistration,omitempty"` 7195} 7196 7197// PortalSigninSettingProperties sign-in settings contract properties. 7198type PortalSigninSettingProperties struct { 7199 // Enabled - Redirect Anonymous users to the Sign-In page. 7200 Enabled *bool `json:"enabled,omitempty"` 7201} 7202 7203// PortalSigninSettings sign-In settings for the Developer Portal. 7204type PortalSigninSettings struct { 7205 autorest.Response `json:"-"` 7206 // PortalSigninSettingProperties - Sign-in settings contract properties. 7207 *PortalSigninSettingProperties `json:"properties,omitempty"` 7208 // ID - READ-ONLY; Resource ID. 7209 ID *string `json:"id,omitempty"` 7210 // Name - READ-ONLY; Resource name. 7211 Name *string `json:"name,omitempty"` 7212 // Type - READ-ONLY; Resource type for API Management resource. 7213 Type *string `json:"type,omitempty"` 7214} 7215 7216// MarshalJSON is the custom marshaler for PortalSigninSettings. 7217func (pss PortalSigninSettings) MarshalJSON() ([]byte, error) { 7218 objectMap := make(map[string]interface{}) 7219 if pss.PortalSigninSettingProperties != nil { 7220 objectMap["properties"] = pss.PortalSigninSettingProperties 7221 } 7222 return json.Marshal(objectMap) 7223} 7224 7225// UnmarshalJSON is the custom unmarshaler for PortalSigninSettings struct. 7226func (pss *PortalSigninSettings) UnmarshalJSON(body []byte) error { 7227 var m map[string]*json.RawMessage 7228 err := json.Unmarshal(body, &m) 7229 if err != nil { 7230 return err 7231 } 7232 for k, v := range m { 7233 switch k { 7234 case "properties": 7235 if v != nil { 7236 var portalSigninSettingProperties PortalSigninSettingProperties 7237 err = json.Unmarshal(*v, &portalSigninSettingProperties) 7238 if err != nil { 7239 return err 7240 } 7241 pss.PortalSigninSettingProperties = &portalSigninSettingProperties 7242 } 7243 case "id": 7244 if v != nil { 7245 var ID string 7246 err = json.Unmarshal(*v, &ID) 7247 if err != nil { 7248 return err 7249 } 7250 pss.ID = &ID 7251 } 7252 case "name": 7253 if v != nil { 7254 var name string 7255 err = json.Unmarshal(*v, &name) 7256 if err != nil { 7257 return err 7258 } 7259 pss.Name = &name 7260 } 7261 case "type": 7262 if v != nil { 7263 var typeVar string 7264 err = json.Unmarshal(*v, &typeVar) 7265 if err != nil { 7266 return err 7267 } 7268 pss.Type = &typeVar 7269 } 7270 } 7271 } 7272 7273 return nil 7274} 7275 7276// PortalSignupSettings sign-Up settings for a developer portal. 7277type PortalSignupSettings struct { 7278 autorest.Response `json:"-"` 7279 // PortalSignupSettingsProperties - Sign-up settings contract properties. 7280 *PortalSignupSettingsProperties `json:"properties,omitempty"` 7281 // ID - READ-ONLY; Resource ID. 7282 ID *string `json:"id,omitempty"` 7283 // Name - READ-ONLY; Resource name. 7284 Name *string `json:"name,omitempty"` 7285 // Type - READ-ONLY; Resource type for API Management resource. 7286 Type *string `json:"type,omitempty"` 7287} 7288 7289// MarshalJSON is the custom marshaler for PortalSignupSettings. 7290func (pss PortalSignupSettings) MarshalJSON() ([]byte, error) { 7291 objectMap := make(map[string]interface{}) 7292 if pss.PortalSignupSettingsProperties != nil { 7293 objectMap["properties"] = pss.PortalSignupSettingsProperties 7294 } 7295 return json.Marshal(objectMap) 7296} 7297 7298// UnmarshalJSON is the custom unmarshaler for PortalSignupSettings struct. 7299func (pss *PortalSignupSettings) UnmarshalJSON(body []byte) error { 7300 var m map[string]*json.RawMessage 7301 err := json.Unmarshal(body, &m) 7302 if err != nil { 7303 return err 7304 } 7305 for k, v := range m { 7306 switch k { 7307 case "properties": 7308 if v != nil { 7309 var portalSignupSettingsProperties PortalSignupSettingsProperties 7310 err = json.Unmarshal(*v, &portalSignupSettingsProperties) 7311 if err != nil { 7312 return err 7313 } 7314 pss.PortalSignupSettingsProperties = &portalSignupSettingsProperties 7315 } 7316 case "id": 7317 if v != nil { 7318 var ID string 7319 err = json.Unmarshal(*v, &ID) 7320 if err != nil { 7321 return err 7322 } 7323 pss.ID = &ID 7324 } 7325 case "name": 7326 if v != nil { 7327 var name string 7328 err = json.Unmarshal(*v, &name) 7329 if err != nil { 7330 return err 7331 } 7332 pss.Name = &name 7333 } 7334 case "type": 7335 if v != nil { 7336 var typeVar string 7337 err = json.Unmarshal(*v, &typeVar) 7338 if err != nil { 7339 return err 7340 } 7341 pss.Type = &typeVar 7342 } 7343 } 7344 } 7345 7346 return nil 7347} 7348 7349// PortalSignupSettingsProperties sign-up settings contract properties. 7350type PortalSignupSettingsProperties struct { 7351 // Enabled - Allow users to sign up on a developer portal. 7352 Enabled *bool `json:"enabled,omitempty"` 7353 // TermsOfService - Terms of service contract properties. 7354 TermsOfService *TermsOfServiceProperties `json:"termsOfService,omitempty"` 7355} 7356 7357// ProductCollection paged Products list representation. 7358type ProductCollection struct { 7359 autorest.Response `json:"-"` 7360 // Value - Page values. 7361 Value *[]ProductContract `json:"value,omitempty"` 7362 // NextLink - Next page link if any. 7363 NextLink *string `json:"nextLink,omitempty"` 7364} 7365 7366// ProductCollectionIterator provides access to a complete listing of ProductContract values. 7367type ProductCollectionIterator struct { 7368 i int 7369 page ProductCollectionPage 7370} 7371 7372// NextWithContext advances to the next value. If there was an error making 7373// the request the iterator does not advance and the error is returned. 7374func (iter *ProductCollectionIterator) NextWithContext(ctx context.Context) (err error) { 7375 if tracing.IsEnabled() { 7376 ctx = tracing.StartSpan(ctx, fqdn+"/ProductCollectionIterator.NextWithContext") 7377 defer func() { 7378 sc := -1 7379 if iter.Response().Response.Response != nil { 7380 sc = iter.Response().Response.Response.StatusCode 7381 } 7382 tracing.EndSpan(ctx, sc, err) 7383 }() 7384 } 7385 iter.i++ 7386 if iter.i < len(iter.page.Values()) { 7387 return nil 7388 } 7389 err = iter.page.NextWithContext(ctx) 7390 if err != nil { 7391 iter.i-- 7392 return err 7393 } 7394 iter.i = 0 7395 return nil 7396} 7397 7398// Next advances to the next value. If there was an error making 7399// the request the iterator does not advance and the error is returned. 7400// Deprecated: Use NextWithContext() instead. 7401func (iter *ProductCollectionIterator) Next() error { 7402 return iter.NextWithContext(context.Background()) 7403} 7404 7405// NotDone returns true if the enumeration should be started or is not yet complete. 7406func (iter ProductCollectionIterator) NotDone() bool { 7407 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 7408} 7409 7410// Response returns the raw server response from the last page request. 7411func (iter ProductCollectionIterator) Response() ProductCollection { 7412 return iter.page.Response() 7413} 7414 7415// Value returns the current value or a zero-initialized value if the 7416// iterator has advanced beyond the end of the collection. 7417func (iter ProductCollectionIterator) Value() ProductContract { 7418 if !iter.page.NotDone() { 7419 return ProductContract{} 7420 } 7421 return iter.page.Values()[iter.i] 7422} 7423 7424// Creates a new instance of the ProductCollectionIterator type. 7425func NewProductCollectionIterator(page ProductCollectionPage) ProductCollectionIterator { 7426 return ProductCollectionIterator{page: page} 7427} 7428 7429// IsEmpty returns true if the ListResult contains no values. 7430func (pc ProductCollection) IsEmpty() bool { 7431 return pc.Value == nil || len(*pc.Value) == 0 7432} 7433 7434// productCollectionPreparer prepares a request to retrieve the next set of results. 7435// It returns nil if no more results exist. 7436func (pc ProductCollection) productCollectionPreparer(ctx context.Context) (*http.Request, error) { 7437 if pc.NextLink == nil || len(to.String(pc.NextLink)) < 1 { 7438 return nil, nil 7439 } 7440 return autorest.Prepare((&http.Request{}).WithContext(ctx), 7441 autorest.AsJSON(), 7442 autorest.AsGet(), 7443 autorest.WithBaseURL(to.String(pc.NextLink))) 7444} 7445 7446// ProductCollectionPage contains a page of ProductContract values. 7447type ProductCollectionPage struct { 7448 fn func(context.Context, ProductCollection) (ProductCollection, error) 7449 pc ProductCollection 7450} 7451 7452// NextWithContext advances to the next page of values. If there was an error making 7453// the request the page does not advance and the error is returned. 7454func (page *ProductCollectionPage) NextWithContext(ctx context.Context) (err error) { 7455 if tracing.IsEnabled() { 7456 ctx = tracing.StartSpan(ctx, fqdn+"/ProductCollectionPage.NextWithContext") 7457 defer func() { 7458 sc := -1 7459 if page.Response().Response.Response != nil { 7460 sc = page.Response().Response.Response.StatusCode 7461 } 7462 tracing.EndSpan(ctx, sc, err) 7463 }() 7464 } 7465 next, err := page.fn(ctx, page.pc) 7466 if err != nil { 7467 return err 7468 } 7469 page.pc = next 7470 return nil 7471} 7472 7473// Next advances to the next page of values. If there was an error making 7474// the request the page does not advance and the error is returned. 7475// Deprecated: Use NextWithContext() instead. 7476func (page *ProductCollectionPage) Next() error { 7477 return page.NextWithContext(context.Background()) 7478} 7479 7480// NotDone returns true if the page enumeration should be started or is not yet complete. 7481func (page ProductCollectionPage) NotDone() bool { 7482 return !page.pc.IsEmpty() 7483} 7484 7485// Response returns the raw server response from the last page request. 7486func (page ProductCollectionPage) Response() ProductCollection { 7487 return page.pc 7488} 7489 7490// Values returns the slice of values for the current page or nil if there are no values. 7491func (page ProductCollectionPage) Values() []ProductContract { 7492 if page.pc.IsEmpty() { 7493 return nil 7494 } 7495 return *page.pc.Value 7496} 7497 7498// Creates a new instance of the ProductCollectionPage type. 7499func NewProductCollectionPage(getNextPage func(context.Context, ProductCollection) (ProductCollection, error)) ProductCollectionPage { 7500 return ProductCollectionPage{fn: getNextPage} 7501} 7502 7503// ProductContract product details. 7504type ProductContract struct { 7505 autorest.Response `json:"-"` 7506 // ProductContractProperties - Product entity contract properties. 7507 *ProductContractProperties `json:"properties,omitempty"` 7508 // ID - READ-ONLY; Resource ID. 7509 ID *string `json:"id,omitempty"` 7510 // Name - READ-ONLY; Resource name. 7511 Name *string `json:"name,omitempty"` 7512 // Type - READ-ONLY; Resource type for API Management resource. 7513 Type *string `json:"type,omitempty"` 7514} 7515 7516// MarshalJSON is the custom marshaler for ProductContract. 7517func (pc ProductContract) MarshalJSON() ([]byte, error) { 7518 objectMap := make(map[string]interface{}) 7519 if pc.ProductContractProperties != nil { 7520 objectMap["properties"] = pc.ProductContractProperties 7521 } 7522 return json.Marshal(objectMap) 7523} 7524 7525// UnmarshalJSON is the custom unmarshaler for ProductContract struct. 7526func (pc *ProductContract) UnmarshalJSON(body []byte) error { 7527 var m map[string]*json.RawMessage 7528 err := json.Unmarshal(body, &m) 7529 if err != nil { 7530 return err 7531 } 7532 for k, v := range m { 7533 switch k { 7534 case "properties": 7535 if v != nil { 7536 var productContractProperties ProductContractProperties 7537 err = json.Unmarshal(*v, &productContractProperties) 7538 if err != nil { 7539 return err 7540 } 7541 pc.ProductContractProperties = &productContractProperties 7542 } 7543 case "id": 7544 if v != nil { 7545 var ID string 7546 err = json.Unmarshal(*v, &ID) 7547 if err != nil { 7548 return err 7549 } 7550 pc.ID = &ID 7551 } 7552 case "name": 7553 if v != nil { 7554 var name string 7555 err = json.Unmarshal(*v, &name) 7556 if err != nil { 7557 return err 7558 } 7559 pc.Name = &name 7560 } 7561 case "type": 7562 if v != nil { 7563 var typeVar string 7564 err = json.Unmarshal(*v, &typeVar) 7565 if err != nil { 7566 return err 7567 } 7568 pc.Type = &typeVar 7569 } 7570 } 7571 } 7572 7573 return nil 7574} 7575 7576// ProductContractProperties product profile. 7577type ProductContractProperties struct { 7578 // DisplayName - Product name. 7579 DisplayName *string `json:"displayName,omitempty"` 7580 // Description - Product description. May include HTML formatting tags. 7581 Description *string `json:"description,omitempty"` 7582 // 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. 7583 Terms *string `json:"terms,omitempty"` 7584 // 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. 7585 SubscriptionRequired *bool `json:"subscriptionRequired,omitempty"` 7586 // 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. 7587 ApprovalRequired *bool `json:"approvalRequired,omitempty"` 7588 // 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. 7589 SubscriptionsLimit *int32 `json:"subscriptionsLimit,omitempty"` 7590 // 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' 7591 State ProductState `json:"state,omitempty"` 7592} 7593 7594// ProductEntityBaseParameters product Entity Base Parameters 7595type ProductEntityBaseParameters struct { 7596 // Description - Product description. May include HTML formatting tags. 7597 Description *string `json:"description,omitempty"` 7598 // 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. 7599 Terms *string `json:"terms,omitempty"` 7600 // 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. 7601 SubscriptionRequired *bool `json:"subscriptionRequired,omitempty"` 7602 // 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. 7603 ApprovalRequired *bool `json:"approvalRequired,omitempty"` 7604 // 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. 7605 SubscriptionsLimit *int32 `json:"subscriptionsLimit,omitempty"` 7606 // 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' 7607 State ProductState `json:"state,omitempty"` 7608} 7609 7610// ProductTagResourceContractProperties product profile. 7611type ProductTagResourceContractProperties struct { 7612 // ID - Identifier of the product in the form of /products/{productId} 7613 ID *string `json:"id,omitempty"` 7614 // Name - Product name. 7615 Name *string `json:"name,omitempty"` 7616 // Description - Product description. May include HTML formatting tags. 7617 Description *string `json:"description,omitempty"` 7618 // 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. 7619 Terms *string `json:"terms,omitempty"` 7620 // 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. 7621 SubscriptionRequired *bool `json:"subscriptionRequired,omitempty"` 7622 // 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. 7623 ApprovalRequired *bool `json:"approvalRequired,omitempty"` 7624 // 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. 7625 SubscriptionsLimit *int32 `json:"subscriptionsLimit,omitempty"` 7626 // 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' 7627 State ProductState `json:"state,omitempty"` 7628} 7629 7630// ProductUpdateParameters product Update parameters. 7631type ProductUpdateParameters struct { 7632 // ProductUpdateProperties - Product entity Update contract properties. 7633 *ProductUpdateProperties `json:"properties,omitempty"` 7634} 7635 7636// MarshalJSON is the custom marshaler for ProductUpdateParameters. 7637func (pup ProductUpdateParameters) MarshalJSON() ([]byte, error) { 7638 objectMap := make(map[string]interface{}) 7639 if pup.ProductUpdateProperties != nil { 7640 objectMap["properties"] = pup.ProductUpdateProperties 7641 } 7642 return json.Marshal(objectMap) 7643} 7644 7645// UnmarshalJSON is the custom unmarshaler for ProductUpdateParameters struct. 7646func (pup *ProductUpdateParameters) UnmarshalJSON(body []byte) error { 7647 var m map[string]*json.RawMessage 7648 err := json.Unmarshal(body, &m) 7649 if err != nil { 7650 return err 7651 } 7652 for k, v := range m { 7653 switch k { 7654 case "properties": 7655 if v != nil { 7656 var productUpdateProperties ProductUpdateProperties 7657 err = json.Unmarshal(*v, &productUpdateProperties) 7658 if err != nil { 7659 return err 7660 } 7661 pup.ProductUpdateProperties = &productUpdateProperties 7662 } 7663 } 7664 } 7665 7666 return nil 7667} 7668 7669// ProductUpdateProperties parameters supplied to the Update Product operation. 7670type ProductUpdateProperties struct { 7671 // DisplayName - Product name. 7672 DisplayName *string `json:"displayName,omitempty"` 7673 // Description - Product description. May include HTML formatting tags. 7674 Description *string `json:"description,omitempty"` 7675 // 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. 7676 Terms *string `json:"terms,omitempty"` 7677 // 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. 7678 SubscriptionRequired *bool `json:"subscriptionRequired,omitempty"` 7679 // 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. 7680 ApprovalRequired *bool `json:"approvalRequired,omitempty"` 7681 // 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. 7682 SubscriptionsLimit *int32 `json:"subscriptionsLimit,omitempty"` 7683 // 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' 7684 State ProductState `json:"state,omitempty"` 7685} 7686 7687// PropertyCollection paged Property list representation. 7688type PropertyCollection struct { 7689 autorest.Response `json:"-"` 7690 // Value - Page values. 7691 Value *[]PropertyContract `json:"value,omitempty"` 7692 // NextLink - Next page link if any. 7693 NextLink *string `json:"nextLink,omitempty"` 7694} 7695 7696// PropertyCollectionIterator provides access to a complete listing of PropertyContract values. 7697type PropertyCollectionIterator struct { 7698 i int 7699 page PropertyCollectionPage 7700} 7701 7702// NextWithContext advances to the next value. If there was an error making 7703// the request the iterator does not advance and the error is returned. 7704func (iter *PropertyCollectionIterator) NextWithContext(ctx context.Context) (err error) { 7705 if tracing.IsEnabled() { 7706 ctx = tracing.StartSpan(ctx, fqdn+"/PropertyCollectionIterator.NextWithContext") 7707 defer func() { 7708 sc := -1 7709 if iter.Response().Response.Response != nil { 7710 sc = iter.Response().Response.Response.StatusCode 7711 } 7712 tracing.EndSpan(ctx, sc, err) 7713 }() 7714 } 7715 iter.i++ 7716 if iter.i < len(iter.page.Values()) { 7717 return nil 7718 } 7719 err = iter.page.NextWithContext(ctx) 7720 if err != nil { 7721 iter.i-- 7722 return err 7723 } 7724 iter.i = 0 7725 return nil 7726} 7727 7728// Next advances to the next value. If there was an error making 7729// the request the iterator does not advance and the error is returned. 7730// Deprecated: Use NextWithContext() instead. 7731func (iter *PropertyCollectionIterator) Next() error { 7732 return iter.NextWithContext(context.Background()) 7733} 7734 7735// NotDone returns true if the enumeration should be started or is not yet complete. 7736func (iter PropertyCollectionIterator) NotDone() bool { 7737 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 7738} 7739 7740// Response returns the raw server response from the last page request. 7741func (iter PropertyCollectionIterator) Response() PropertyCollection { 7742 return iter.page.Response() 7743} 7744 7745// Value returns the current value or a zero-initialized value if the 7746// iterator has advanced beyond the end of the collection. 7747func (iter PropertyCollectionIterator) Value() PropertyContract { 7748 if !iter.page.NotDone() { 7749 return PropertyContract{} 7750 } 7751 return iter.page.Values()[iter.i] 7752} 7753 7754// Creates a new instance of the PropertyCollectionIterator type. 7755func NewPropertyCollectionIterator(page PropertyCollectionPage) PropertyCollectionIterator { 7756 return PropertyCollectionIterator{page: page} 7757} 7758 7759// IsEmpty returns true if the ListResult contains no values. 7760func (pc PropertyCollection) IsEmpty() bool { 7761 return pc.Value == nil || len(*pc.Value) == 0 7762} 7763 7764// propertyCollectionPreparer prepares a request to retrieve the next set of results. 7765// It returns nil if no more results exist. 7766func (pc PropertyCollection) propertyCollectionPreparer(ctx context.Context) (*http.Request, error) { 7767 if pc.NextLink == nil || len(to.String(pc.NextLink)) < 1 { 7768 return nil, nil 7769 } 7770 return autorest.Prepare((&http.Request{}).WithContext(ctx), 7771 autorest.AsJSON(), 7772 autorest.AsGet(), 7773 autorest.WithBaseURL(to.String(pc.NextLink))) 7774} 7775 7776// PropertyCollectionPage contains a page of PropertyContract values. 7777type PropertyCollectionPage struct { 7778 fn func(context.Context, PropertyCollection) (PropertyCollection, error) 7779 pc PropertyCollection 7780} 7781 7782// NextWithContext advances to the next page of values. If there was an error making 7783// the request the page does not advance and the error is returned. 7784func (page *PropertyCollectionPage) NextWithContext(ctx context.Context) (err error) { 7785 if tracing.IsEnabled() { 7786 ctx = tracing.StartSpan(ctx, fqdn+"/PropertyCollectionPage.NextWithContext") 7787 defer func() { 7788 sc := -1 7789 if page.Response().Response.Response != nil { 7790 sc = page.Response().Response.Response.StatusCode 7791 } 7792 tracing.EndSpan(ctx, sc, err) 7793 }() 7794 } 7795 next, err := page.fn(ctx, page.pc) 7796 if err != nil { 7797 return err 7798 } 7799 page.pc = next 7800 return nil 7801} 7802 7803// Next advances to the next page of values. If there was an error making 7804// the request the page does not advance and the error is returned. 7805// Deprecated: Use NextWithContext() instead. 7806func (page *PropertyCollectionPage) Next() error { 7807 return page.NextWithContext(context.Background()) 7808} 7809 7810// NotDone returns true if the page enumeration should be started or is not yet complete. 7811func (page PropertyCollectionPage) NotDone() bool { 7812 return !page.pc.IsEmpty() 7813} 7814 7815// Response returns the raw server response from the last page request. 7816func (page PropertyCollectionPage) Response() PropertyCollection { 7817 return page.pc 7818} 7819 7820// Values returns the slice of values for the current page or nil if there are no values. 7821func (page PropertyCollectionPage) Values() []PropertyContract { 7822 if page.pc.IsEmpty() { 7823 return nil 7824 } 7825 return *page.pc.Value 7826} 7827 7828// Creates a new instance of the PropertyCollectionPage type. 7829func NewPropertyCollectionPage(getNextPage func(context.Context, PropertyCollection) (PropertyCollection, error)) PropertyCollectionPage { 7830 return PropertyCollectionPage{fn: getNextPage} 7831} 7832 7833// PropertyContract property details. 7834type PropertyContract struct { 7835 autorest.Response `json:"-"` 7836 // PropertyContractProperties - Property entity contract properties. 7837 *PropertyContractProperties `json:"properties,omitempty"` 7838 // ID - READ-ONLY; Resource ID. 7839 ID *string `json:"id,omitempty"` 7840 // Name - READ-ONLY; Resource name. 7841 Name *string `json:"name,omitempty"` 7842 // Type - READ-ONLY; Resource type for API Management resource. 7843 Type *string `json:"type,omitempty"` 7844} 7845 7846// MarshalJSON is the custom marshaler for PropertyContract. 7847func (pc PropertyContract) MarshalJSON() ([]byte, error) { 7848 objectMap := make(map[string]interface{}) 7849 if pc.PropertyContractProperties != nil { 7850 objectMap["properties"] = pc.PropertyContractProperties 7851 } 7852 return json.Marshal(objectMap) 7853} 7854 7855// UnmarshalJSON is the custom unmarshaler for PropertyContract struct. 7856func (pc *PropertyContract) UnmarshalJSON(body []byte) error { 7857 var m map[string]*json.RawMessage 7858 err := json.Unmarshal(body, &m) 7859 if err != nil { 7860 return err 7861 } 7862 for k, v := range m { 7863 switch k { 7864 case "properties": 7865 if v != nil { 7866 var propertyContractProperties PropertyContractProperties 7867 err = json.Unmarshal(*v, &propertyContractProperties) 7868 if err != nil { 7869 return err 7870 } 7871 pc.PropertyContractProperties = &propertyContractProperties 7872 } 7873 case "id": 7874 if v != nil { 7875 var ID string 7876 err = json.Unmarshal(*v, &ID) 7877 if err != nil { 7878 return err 7879 } 7880 pc.ID = &ID 7881 } 7882 case "name": 7883 if v != nil { 7884 var name string 7885 err = json.Unmarshal(*v, &name) 7886 if err != nil { 7887 return err 7888 } 7889 pc.Name = &name 7890 } 7891 case "type": 7892 if v != nil { 7893 var typeVar string 7894 err = json.Unmarshal(*v, &typeVar) 7895 if err != nil { 7896 return err 7897 } 7898 pc.Type = &typeVar 7899 } 7900 } 7901 } 7902 7903 return nil 7904} 7905 7906// PropertyContractProperties property Contract properties. 7907type PropertyContractProperties struct { 7908 // DisplayName - Unique name of Property. It may contain only letters, digits, period, dash, and underscore characters. 7909 DisplayName *string `json:"displayName,omitempty"` 7910 // Value - Value of the property. Can contain policy expressions. It may not be empty or consist only of whitespace. 7911 Value *string `json:"value,omitempty"` 7912 // Tags - Optional tags that when provided can be used to filter the property list. 7913 Tags *[]string `json:"tags,omitempty"` 7914 // Secret - Determines whether the value is a secret and should be encrypted or not. Default value is false. 7915 Secret *bool `json:"secret,omitempty"` 7916} 7917 7918// PropertyEntityBaseParameters property Entity Base Parameters set. 7919type PropertyEntityBaseParameters struct { 7920 // Tags - Optional tags that when provided can be used to filter the property list. 7921 Tags *[]string `json:"tags,omitempty"` 7922 // Secret - Determines whether the value is a secret and should be encrypted or not. Default value is false. 7923 Secret *bool `json:"secret,omitempty"` 7924} 7925 7926// PropertyUpdateParameterProperties property Contract properties. 7927type PropertyUpdateParameterProperties struct { 7928 // DisplayName - Unique name of Property. It may contain only letters, digits, period, dash, and underscore characters. 7929 DisplayName *string `json:"displayName,omitempty"` 7930 // Value - Value of the property. Can contain policy expressions. It may not be empty or consist only of whitespace. 7931 Value *string `json:"value,omitempty"` 7932 // Tags - Optional tags that when provided can be used to filter the property list. 7933 Tags *[]string `json:"tags,omitempty"` 7934 // Secret - Determines whether the value is a secret and should be encrypted or not. Default value is false. 7935 Secret *bool `json:"secret,omitempty"` 7936} 7937 7938// PropertyUpdateParameters property update Parameters. 7939type PropertyUpdateParameters struct { 7940 // PropertyUpdateParameterProperties - Property entity Update contract properties. 7941 *PropertyUpdateParameterProperties `json:"properties,omitempty"` 7942} 7943 7944// MarshalJSON is the custom marshaler for PropertyUpdateParameters. 7945func (pup PropertyUpdateParameters) MarshalJSON() ([]byte, error) { 7946 objectMap := make(map[string]interface{}) 7947 if pup.PropertyUpdateParameterProperties != nil { 7948 objectMap["properties"] = pup.PropertyUpdateParameterProperties 7949 } 7950 return json.Marshal(objectMap) 7951} 7952 7953// UnmarshalJSON is the custom unmarshaler for PropertyUpdateParameters struct. 7954func (pup *PropertyUpdateParameters) UnmarshalJSON(body []byte) error { 7955 var m map[string]*json.RawMessage 7956 err := json.Unmarshal(body, &m) 7957 if err != nil { 7958 return err 7959 } 7960 for k, v := range m { 7961 switch k { 7962 case "properties": 7963 if v != nil { 7964 var propertyUpdateParameterProperties PropertyUpdateParameterProperties 7965 err = json.Unmarshal(*v, &propertyUpdateParameterProperties) 7966 if err != nil { 7967 return err 7968 } 7969 pup.PropertyUpdateParameterProperties = &propertyUpdateParameterProperties 7970 } 7971 } 7972 } 7973 7974 return nil 7975} 7976 7977// QuotaCounterCollection paged Quota Counter list representation. 7978type QuotaCounterCollection struct { 7979 autorest.Response `json:"-"` 7980 // Value - Quota counter values. 7981 Value *[]QuotaCounterContract `json:"value,omitempty"` 7982 // Count - Total record count number across all pages. 7983 Count *int64 `json:"count,omitempty"` 7984 // NextLink - Next page link if any. 7985 NextLink *string `json:"nextLink,omitempty"` 7986} 7987 7988// QuotaCounterContract quota counter details. 7989type QuotaCounterContract struct { 7990 autorest.Response `json:"-"` 7991 // CounterKey - The Key value of the Counter. Must not be empty. 7992 CounterKey *string `json:"counterKey,omitempty"` 7993 // PeriodKey - Identifier of the Period for which the counter was collected. Must not be empty. 7994 PeriodKey *string `json:"periodKey,omitempty"` 7995 // 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. 7996 PeriodStartTime *date.Time `json:"periodStartTime,omitempty"` 7997 // 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. 7998 PeriodEndTime *date.Time `json:"periodEndTime,omitempty"` 7999 // Value - Quota Value Properties 8000 Value *QuotaCounterValueContractProperties `json:"value,omitempty"` 8001} 8002 8003// QuotaCounterValueContract quota counter value details. 8004type QuotaCounterValueContract struct { 8005 // QuotaCounterValueContractProperties - Quota counter Value Properties. 8006 *QuotaCounterValueContractProperties `json:"value,omitempty"` 8007} 8008 8009// MarshalJSON is the custom marshaler for QuotaCounterValueContract. 8010func (qcvc QuotaCounterValueContract) MarshalJSON() ([]byte, error) { 8011 objectMap := make(map[string]interface{}) 8012 if qcvc.QuotaCounterValueContractProperties != nil { 8013 objectMap["value"] = qcvc.QuotaCounterValueContractProperties 8014 } 8015 return json.Marshal(objectMap) 8016} 8017 8018// UnmarshalJSON is the custom unmarshaler for QuotaCounterValueContract struct. 8019func (qcvc *QuotaCounterValueContract) UnmarshalJSON(body []byte) error { 8020 var m map[string]*json.RawMessage 8021 err := json.Unmarshal(body, &m) 8022 if err != nil { 8023 return err 8024 } 8025 for k, v := range m { 8026 switch k { 8027 case "value": 8028 if v != nil { 8029 var quotaCounterValueContractProperties QuotaCounterValueContractProperties 8030 err = json.Unmarshal(*v, "aCounterValueContractProperties) 8031 if err != nil { 8032 return err 8033 } 8034 qcvc.QuotaCounterValueContractProperties = "aCounterValueContractProperties 8035 } 8036 } 8037 } 8038 8039 return nil 8040} 8041 8042// QuotaCounterValueContractProperties quota counter value details. 8043type QuotaCounterValueContractProperties struct { 8044 // CallsCount - Number of times Counter was called. 8045 CallsCount *int32 `json:"callsCount,omitempty"` 8046 // KbTransferred - Data Transferred in KiloBytes. 8047 KbTransferred *float64 `json:"kbTransferred,omitempty"` 8048} 8049 8050// RecipientEmailCollection paged Recipient User list representation. 8051type RecipientEmailCollection struct { 8052 autorest.Response `json:"-"` 8053 // Value - Page values. 8054 Value *[]RecipientEmailContract `json:"value,omitempty"` 8055 // NextLink - Next page link if any. 8056 NextLink *string `json:"nextLink,omitempty"` 8057} 8058 8059// RecipientEmailContract recipient Email details. 8060type RecipientEmailContract struct { 8061 autorest.Response `json:"-"` 8062 // RecipientEmailContractProperties - Recipient Email contract properties. 8063 *RecipientEmailContractProperties `json:"properties,omitempty"` 8064 // ID - READ-ONLY; Resource ID. 8065 ID *string `json:"id,omitempty"` 8066 // Name - READ-ONLY; Resource name. 8067 Name *string `json:"name,omitempty"` 8068 // Type - READ-ONLY; Resource type for API Management resource. 8069 Type *string `json:"type,omitempty"` 8070} 8071 8072// MarshalJSON is the custom marshaler for RecipientEmailContract. 8073func (rec RecipientEmailContract) MarshalJSON() ([]byte, error) { 8074 objectMap := make(map[string]interface{}) 8075 if rec.RecipientEmailContractProperties != nil { 8076 objectMap["properties"] = rec.RecipientEmailContractProperties 8077 } 8078 return json.Marshal(objectMap) 8079} 8080 8081// UnmarshalJSON is the custom unmarshaler for RecipientEmailContract struct. 8082func (rec *RecipientEmailContract) UnmarshalJSON(body []byte) error { 8083 var m map[string]*json.RawMessage 8084 err := json.Unmarshal(body, &m) 8085 if err != nil { 8086 return err 8087 } 8088 for k, v := range m { 8089 switch k { 8090 case "properties": 8091 if v != nil { 8092 var recipientEmailContractProperties RecipientEmailContractProperties 8093 err = json.Unmarshal(*v, &recipientEmailContractProperties) 8094 if err != nil { 8095 return err 8096 } 8097 rec.RecipientEmailContractProperties = &recipientEmailContractProperties 8098 } 8099 case "id": 8100 if v != nil { 8101 var ID string 8102 err = json.Unmarshal(*v, &ID) 8103 if err != nil { 8104 return err 8105 } 8106 rec.ID = &ID 8107 } 8108 case "name": 8109 if v != nil { 8110 var name string 8111 err = json.Unmarshal(*v, &name) 8112 if err != nil { 8113 return err 8114 } 8115 rec.Name = &name 8116 } 8117 case "type": 8118 if v != nil { 8119 var typeVar string 8120 err = json.Unmarshal(*v, &typeVar) 8121 if err != nil { 8122 return err 8123 } 8124 rec.Type = &typeVar 8125 } 8126 } 8127 } 8128 8129 return nil 8130} 8131 8132// RecipientEmailContractProperties recipient Email Contract Properties. 8133type RecipientEmailContractProperties struct { 8134 // Email - User Email subscribed to notification. 8135 Email *string `json:"email,omitempty"` 8136} 8137 8138// RecipientsContractProperties notification Parameter contract. 8139type RecipientsContractProperties struct { 8140 // Emails - List of Emails subscribed for the notification. 8141 Emails *[]string `json:"emails,omitempty"` 8142 // Users - List of Users subscribed for the notification. 8143 Users *[]string `json:"users,omitempty"` 8144} 8145 8146// RecipientUserCollection paged Recipient User list representation. 8147type RecipientUserCollection struct { 8148 autorest.Response `json:"-"` 8149 // Value - Page values. 8150 Value *[]RecipientUserContract `json:"value,omitempty"` 8151 // NextLink - Next page link if any. 8152 NextLink *string `json:"nextLink,omitempty"` 8153} 8154 8155// RecipientUserContract recipient User details. 8156type RecipientUserContract struct { 8157 autorest.Response `json:"-"` 8158 // RecipientUsersContractProperties - Recipient User entity contract properties. 8159 *RecipientUsersContractProperties `json:"properties,omitempty"` 8160 // ID - READ-ONLY; Resource ID. 8161 ID *string `json:"id,omitempty"` 8162 // Name - READ-ONLY; Resource name. 8163 Name *string `json:"name,omitempty"` 8164 // Type - READ-ONLY; Resource type for API Management resource. 8165 Type *string `json:"type,omitempty"` 8166} 8167 8168// MarshalJSON is the custom marshaler for RecipientUserContract. 8169func (ruc RecipientUserContract) MarshalJSON() ([]byte, error) { 8170 objectMap := make(map[string]interface{}) 8171 if ruc.RecipientUsersContractProperties != nil { 8172 objectMap["properties"] = ruc.RecipientUsersContractProperties 8173 } 8174 return json.Marshal(objectMap) 8175} 8176 8177// UnmarshalJSON is the custom unmarshaler for RecipientUserContract struct. 8178func (ruc *RecipientUserContract) UnmarshalJSON(body []byte) error { 8179 var m map[string]*json.RawMessage 8180 err := json.Unmarshal(body, &m) 8181 if err != nil { 8182 return err 8183 } 8184 for k, v := range m { 8185 switch k { 8186 case "properties": 8187 if v != nil { 8188 var recipientUsersContractProperties RecipientUsersContractProperties 8189 err = json.Unmarshal(*v, &recipientUsersContractProperties) 8190 if err != nil { 8191 return err 8192 } 8193 ruc.RecipientUsersContractProperties = &recipientUsersContractProperties 8194 } 8195 case "id": 8196 if v != nil { 8197 var ID string 8198 err = json.Unmarshal(*v, &ID) 8199 if err != nil { 8200 return err 8201 } 8202 ruc.ID = &ID 8203 } 8204 case "name": 8205 if v != nil { 8206 var name string 8207 err = json.Unmarshal(*v, &name) 8208 if err != nil { 8209 return err 8210 } 8211 ruc.Name = &name 8212 } 8213 case "type": 8214 if v != nil { 8215 var typeVar string 8216 err = json.Unmarshal(*v, &typeVar) 8217 if err != nil { 8218 return err 8219 } 8220 ruc.Type = &typeVar 8221 } 8222 } 8223 } 8224 8225 return nil 8226} 8227 8228// RecipientUsersContractProperties recipient User Contract Properties. 8229type RecipientUsersContractProperties struct { 8230 // UserID - API Management UserId subscribed to notification. 8231 UserID *string `json:"userId,omitempty"` 8232} 8233 8234// RegionContract region profile. 8235type RegionContract struct { 8236 // Name - READ-ONLY; Region name. 8237 Name *string `json:"name,omitempty"` 8238 // IsMasterRegion - whether Region is the master region. 8239 IsMasterRegion *bool `json:"isMasterRegion,omitempty"` 8240 // IsDeleted - whether Region is deleted. 8241 IsDeleted *bool `json:"isDeleted,omitempty"` 8242} 8243 8244// RegionListResult lists Regions operation response details. 8245type RegionListResult struct { 8246 autorest.Response `json:"-"` 8247 // Value - Lists of Regions. 8248 Value *[]RegionContract `json:"value,omitempty"` 8249 // Count - Total record count number across all pages. 8250 Count *int64 `json:"count,omitempty"` 8251 // NextLink - Next page link if any. 8252 NextLink *string `json:"nextLink,omitempty"` 8253} 8254 8255// RegionListResultIterator provides access to a complete listing of RegionContract values. 8256type RegionListResultIterator struct { 8257 i int 8258 page RegionListResultPage 8259} 8260 8261// NextWithContext advances to the next value. If there was an error making 8262// the request the iterator does not advance and the error is returned. 8263func (iter *RegionListResultIterator) NextWithContext(ctx context.Context) (err error) { 8264 if tracing.IsEnabled() { 8265 ctx = tracing.StartSpan(ctx, fqdn+"/RegionListResultIterator.NextWithContext") 8266 defer func() { 8267 sc := -1 8268 if iter.Response().Response.Response != nil { 8269 sc = iter.Response().Response.Response.StatusCode 8270 } 8271 tracing.EndSpan(ctx, sc, err) 8272 }() 8273 } 8274 iter.i++ 8275 if iter.i < len(iter.page.Values()) { 8276 return nil 8277 } 8278 err = iter.page.NextWithContext(ctx) 8279 if err != nil { 8280 iter.i-- 8281 return err 8282 } 8283 iter.i = 0 8284 return nil 8285} 8286 8287// Next advances to the next value. If there was an error making 8288// the request the iterator does not advance and the error is returned. 8289// Deprecated: Use NextWithContext() instead. 8290func (iter *RegionListResultIterator) Next() error { 8291 return iter.NextWithContext(context.Background()) 8292} 8293 8294// NotDone returns true if the enumeration should be started or is not yet complete. 8295func (iter RegionListResultIterator) NotDone() bool { 8296 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 8297} 8298 8299// Response returns the raw server response from the last page request. 8300func (iter RegionListResultIterator) Response() RegionListResult { 8301 return iter.page.Response() 8302} 8303 8304// Value returns the current value or a zero-initialized value if the 8305// iterator has advanced beyond the end of the collection. 8306func (iter RegionListResultIterator) Value() RegionContract { 8307 if !iter.page.NotDone() { 8308 return RegionContract{} 8309 } 8310 return iter.page.Values()[iter.i] 8311} 8312 8313// Creates a new instance of the RegionListResultIterator type. 8314func NewRegionListResultIterator(page RegionListResultPage) RegionListResultIterator { 8315 return RegionListResultIterator{page: page} 8316} 8317 8318// IsEmpty returns true if the ListResult contains no values. 8319func (rlr RegionListResult) IsEmpty() bool { 8320 return rlr.Value == nil || len(*rlr.Value) == 0 8321} 8322 8323// regionListResultPreparer prepares a request to retrieve the next set of results. 8324// It returns nil if no more results exist. 8325func (rlr RegionListResult) regionListResultPreparer(ctx context.Context) (*http.Request, error) { 8326 if rlr.NextLink == nil || len(to.String(rlr.NextLink)) < 1 { 8327 return nil, nil 8328 } 8329 return autorest.Prepare((&http.Request{}).WithContext(ctx), 8330 autorest.AsJSON(), 8331 autorest.AsGet(), 8332 autorest.WithBaseURL(to.String(rlr.NextLink))) 8333} 8334 8335// RegionListResultPage contains a page of RegionContract values. 8336type RegionListResultPage struct { 8337 fn func(context.Context, RegionListResult) (RegionListResult, error) 8338 rlr RegionListResult 8339} 8340 8341// NextWithContext advances to the next page of values. If there was an error making 8342// the request the page does not advance and the error is returned. 8343func (page *RegionListResultPage) NextWithContext(ctx context.Context) (err error) { 8344 if tracing.IsEnabled() { 8345 ctx = tracing.StartSpan(ctx, fqdn+"/RegionListResultPage.NextWithContext") 8346 defer func() { 8347 sc := -1 8348 if page.Response().Response.Response != nil { 8349 sc = page.Response().Response.Response.StatusCode 8350 } 8351 tracing.EndSpan(ctx, sc, err) 8352 }() 8353 } 8354 next, err := page.fn(ctx, page.rlr) 8355 if err != nil { 8356 return err 8357 } 8358 page.rlr = next 8359 return nil 8360} 8361 8362// Next advances to the next page of values. If there was an error making 8363// the request the page does not advance and the error is returned. 8364// Deprecated: Use NextWithContext() instead. 8365func (page *RegionListResultPage) Next() error { 8366 return page.NextWithContext(context.Background()) 8367} 8368 8369// NotDone returns true if the page enumeration should be started or is not yet complete. 8370func (page RegionListResultPage) NotDone() bool { 8371 return !page.rlr.IsEmpty() 8372} 8373 8374// Response returns the raw server response from the last page request. 8375func (page RegionListResultPage) Response() RegionListResult { 8376 return page.rlr 8377} 8378 8379// Values returns the slice of values for the current page or nil if there are no values. 8380func (page RegionListResultPage) Values() []RegionContract { 8381 if page.rlr.IsEmpty() { 8382 return nil 8383 } 8384 return *page.rlr.Value 8385} 8386 8387// Creates a new instance of the RegionListResultPage type. 8388func NewRegionListResultPage(getNextPage func(context.Context, RegionListResult) (RegionListResult, error)) RegionListResultPage { 8389 return RegionListResultPage{fn: getNextPage} 8390} 8391 8392// RegistrationDelegationSettingsProperties user registration delegation settings properties. 8393type RegistrationDelegationSettingsProperties struct { 8394 // Enabled - Enable or disable delegation for user registration. 8395 Enabled *bool `json:"enabled,omitempty"` 8396} 8397 8398// ReportCollection paged Report records list representation. 8399type ReportCollection struct { 8400 autorest.Response `json:"-"` 8401 // Value - Page values. 8402 Value *[]ReportRecordContract `json:"value,omitempty"` 8403 // Count - Total record count number across all pages. 8404 Count *int64 `json:"count,omitempty"` 8405 // NextLink - Next page link if any. 8406 NextLink *string `json:"nextLink,omitempty"` 8407} 8408 8409// ReportCollectionIterator provides access to a complete listing of ReportRecordContract values. 8410type ReportCollectionIterator struct { 8411 i int 8412 page ReportCollectionPage 8413} 8414 8415// NextWithContext advances to the next value. If there was an error making 8416// the request the iterator does not advance and the error is returned. 8417func (iter *ReportCollectionIterator) NextWithContext(ctx context.Context) (err error) { 8418 if tracing.IsEnabled() { 8419 ctx = tracing.StartSpan(ctx, fqdn+"/ReportCollectionIterator.NextWithContext") 8420 defer func() { 8421 sc := -1 8422 if iter.Response().Response.Response != nil { 8423 sc = iter.Response().Response.Response.StatusCode 8424 } 8425 tracing.EndSpan(ctx, sc, err) 8426 }() 8427 } 8428 iter.i++ 8429 if iter.i < len(iter.page.Values()) { 8430 return nil 8431 } 8432 err = iter.page.NextWithContext(ctx) 8433 if err != nil { 8434 iter.i-- 8435 return err 8436 } 8437 iter.i = 0 8438 return nil 8439} 8440 8441// Next advances to the next value. If there was an error making 8442// the request the iterator does not advance and the error is returned. 8443// Deprecated: Use NextWithContext() instead. 8444func (iter *ReportCollectionIterator) Next() error { 8445 return iter.NextWithContext(context.Background()) 8446} 8447 8448// NotDone returns true if the enumeration should be started or is not yet complete. 8449func (iter ReportCollectionIterator) NotDone() bool { 8450 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 8451} 8452 8453// Response returns the raw server response from the last page request. 8454func (iter ReportCollectionIterator) Response() ReportCollection { 8455 return iter.page.Response() 8456} 8457 8458// Value returns the current value or a zero-initialized value if the 8459// iterator has advanced beyond the end of the collection. 8460func (iter ReportCollectionIterator) Value() ReportRecordContract { 8461 if !iter.page.NotDone() { 8462 return ReportRecordContract{} 8463 } 8464 return iter.page.Values()[iter.i] 8465} 8466 8467// Creates a new instance of the ReportCollectionIterator type. 8468func NewReportCollectionIterator(page ReportCollectionPage) ReportCollectionIterator { 8469 return ReportCollectionIterator{page: page} 8470} 8471 8472// IsEmpty returns true if the ListResult contains no values. 8473func (rc ReportCollection) IsEmpty() bool { 8474 return rc.Value == nil || len(*rc.Value) == 0 8475} 8476 8477// reportCollectionPreparer prepares a request to retrieve the next set of results. 8478// It returns nil if no more results exist. 8479func (rc ReportCollection) reportCollectionPreparer(ctx context.Context) (*http.Request, error) { 8480 if rc.NextLink == nil || len(to.String(rc.NextLink)) < 1 { 8481 return nil, nil 8482 } 8483 return autorest.Prepare((&http.Request{}).WithContext(ctx), 8484 autorest.AsJSON(), 8485 autorest.AsGet(), 8486 autorest.WithBaseURL(to.String(rc.NextLink))) 8487} 8488 8489// ReportCollectionPage contains a page of ReportRecordContract values. 8490type ReportCollectionPage struct { 8491 fn func(context.Context, ReportCollection) (ReportCollection, error) 8492 rc ReportCollection 8493} 8494 8495// NextWithContext advances to the next page of values. If there was an error making 8496// the request the page does not advance and the error is returned. 8497func (page *ReportCollectionPage) NextWithContext(ctx context.Context) (err error) { 8498 if tracing.IsEnabled() { 8499 ctx = tracing.StartSpan(ctx, fqdn+"/ReportCollectionPage.NextWithContext") 8500 defer func() { 8501 sc := -1 8502 if page.Response().Response.Response != nil { 8503 sc = page.Response().Response.Response.StatusCode 8504 } 8505 tracing.EndSpan(ctx, sc, err) 8506 }() 8507 } 8508 next, err := page.fn(ctx, page.rc) 8509 if err != nil { 8510 return err 8511 } 8512 page.rc = next 8513 return nil 8514} 8515 8516// Next advances to the next page of values. If there was an error making 8517// the request the page does not advance and the error is returned. 8518// Deprecated: Use NextWithContext() instead. 8519func (page *ReportCollectionPage) Next() error { 8520 return page.NextWithContext(context.Background()) 8521} 8522 8523// NotDone returns true if the page enumeration should be started or is not yet complete. 8524func (page ReportCollectionPage) NotDone() bool { 8525 return !page.rc.IsEmpty() 8526} 8527 8528// Response returns the raw server response from the last page request. 8529func (page ReportCollectionPage) Response() ReportCollection { 8530 return page.rc 8531} 8532 8533// Values returns the slice of values for the current page or nil if there are no values. 8534func (page ReportCollectionPage) Values() []ReportRecordContract { 8535 if page.rc.IsEmpty() { 8536 return nil 8537 } 8538 return *page.rc.Value 8539} 8540 8541// Creates a new instance of the ReportCollectionPage type. 8542func NewReportCollectionPage(getNextPage func(context.Context, ReportCollection) (ReportCollection, error)) ReportCollectionPage { 8543 return ReportCollectionPage{fn: getNextPage} 8544} 8545 8546// ReportRecordContract report data. 8547type ReportRecordContract struct { 8548 // Name - Name depending on report endpoint specifies product, API, operation or developer name. 8549 Name *string `json:"name,omitempty"` 8550 // Timestamp - Start of aggregation period. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. 8551 Timestamp *date.Time `json:"timestamp,omitempty"` 8552 // Interval - Length of aggregation period. Interval must be multiple of 15 minutes and may not be zero. The value should be in ISO 8601 format (http://en.wikipedia.org/wiki/ISO_8601#Durations). 8553 Interval *string `json:"interval,omitempty"` 8554 // Country - Country to which this record data is related. 8555 Country *string `json:"country,omitempty"` 8556 // Region - Country region to which this record data is related. 8557 Region *string `json:"region,omitempty"` 8558 // Zip - Zip code to which this record data is related. 8559 Zip *string `json:"zip,omitempty"` 8560 // UserID - READ-ONLY; User identifier path. /users/{userId} 8561 UserID *string `json:"userId,omitempty"` 8562 // ProductID - READ-ONLY; Product identifier path. /products/{productId} 8563 ProductID *string `json:"productId,omitempty"` 8564 // APIID - API identifier path. /apis/{apiId} 8565 APIID *string `json:"apiId,omitempty"` 8566 // OperationID - Operation identifier path. /apis/{apiId}/operations/{operationId} 8567 OperationID *string `json:"operationId,omitempty"` 8568 // APIRegion - API region identifier. 8569 APIRegion *string `json:"apiRegion,omitempty"` 8570 // SubscriptionID - Subscription identifier path. /subscriptions/{subscriptionId} 8571 SubscriptionID *string `json:"subscriptionId,omitempty"` 8572 // CallCountSuccess - Number of successful calls. This includes calls returning HttpStatusCode <= 301 and HttpStatusCode.NotModified and HttpStatusCode.TemporaryRedirect 8573 CallCountSuccess *int32 `json:"callCountSuccess,omitempty"` 8574 // CallCountBlocked - Number of calls blocked due to invalid credentials. This includes calls returning HttpStatusCode.Unauthorized and HttpStatusCode.Forbidden and HttpStatusCode.TooManyRequests 8575 CallCountBlocked *int32 `json:"callCountBlocked,omitempty"` 8576 // 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 8577 CallCountFailed *int32 `json:"callCountFailed,omitempty"` 8578 // CallCountOther - Number of other calls. 8579 CallCountOther *int32 `json:"callCountOther,omitempty"` 8580 // CallCountTotal - Total number of calls. 8581 CallCountTotal *int32 `json:"callCountTotal,omitempty"` 8582 // Bandwidth - Bandwidth consumed. 8583 Bandwidth *int64 `json:"bandwidth,omitempty"` 8584 // CacheHitCount - Number of times when content was served from cache policy. 8585 CacheHitCount *int32 `json:"cacheHitCount,omitempty"` 8586 // CacheMissCount - Number of times content was fetched from backend. 8587 CacheMissCount *int32 `json:"cacheMissCount,omitempty"` 8588 // APITimeAvg - Average time it took to process request. 8589 APITimeAvg *float64 `json:"apiTimeAvg,omitempty"` 8590 // APITimeMin - Minimum time it took to process request. 8591 APITimeMin *float64 `json:"apiTimeMin,omitempty"` 8592 // APITimeMax - Maximum time it took to process request. 8593 APITimeMax *float64 `json:"apiTimeMax,omitempty"` 8594 // ServiceTimeAvg - Average time it took to process request on backend. 8595 ServiceTimeAvg *float64 `json:"serviceTimeAvg,omitempty"` 8596 // ServiceTimeMin - Minimum time it took to process request on backend. 8597 ServiceTimeMin *float64 `json:"serviceTimeMin,omitempty"` 8598 // ServiceTimeMax - Maximum time it took to process request on backend. 8599 ServiceTimeMax *float64 `json:"serviceTimeMax,omitempty"` 8600} 8601 8602// RepresentationContract operation request/response representation details. 8603type RepresentationContract struct { 8604 // ContentType - Specifies a registered or custom content type for this representation, e.g. application/xml. 8605 ContentType *string `json:"contentType,omitempty"` 8606 // Sample - An example of the representation. 8607 Sample *string `json:"sample,omitempty"` 8608 // SchemaID - Schema identifier. Applicable only if 'contentType' value is neither 'application/x-www-form-urlencoded' nor 'multipart/form-data'. 8609 SchemaID *string `json:"schemaId,omitempty"` 8610 // TypeName - Type name defined by the schema. Applicable only if 'contentType' value is neither 'application/x-www-form-urlencoded' nor 'multipart/form-data'. 8611 TypeName *string `json:"typeName,omitempty"` 8612 // FormParameters - Collection of form parameters. Required if 'contentType' value is either 'application/x-www-form-urlencoded' or 'multipart/form-data'.. 8613 FormParameters *[]ParameterContract `json:"formParameters,omitempty"` 8614} 8615 8616// RequestContract operation request details. 8617type RequestContract struct { 8618 // Description - Operation request description. 8619 Description *string `json:"description,omitempty"` 8620 // QueryParameters - Collection of operation request query parameters. 8621 QueryParameters *[]ParameterContract `json:"queryParameters,omitempty"` 8622 // Headers - Collection of operation request headers. 8623 Headers *[]ParameterContract `json:"headers,omitempty"` 8624 // Representations - Collection of operation request representations. 8625 Representations *[]RepresentationContract `json:"representations,omitempty"` 8626} 8627 8628// RequestReportCollection paged Report records list representation. 8629type RequestReportCollection struct { 8630 autorest.Response `json:"-"` 8631 // Value - Page values. 8632 Value *[]RequestReportRecordContract `json:"value,omitempty"` 8633 // Count - Total record count number across all pages. 8634 Count *int64 `json:"count,omitempty"` 8635} 8636 8637// RequestReportRecordContract request Report data. 8638type RequestReportRecordContract struct { 8639 // APIID - API identifier path. /apis/{apiId} 8640 APIID *string `json:"apiId,omitempty"` 8641 // OperationID - Operation identifier path. /apis/{apiId}/operations/{operationId} 8642 OperationID *string `json:"operationId,omitempty"` 8643 // ProductID - READ-ONLY; Product identifier path. /products/{productId} 8644 ProductID *string `json:"productId,omitempty"` 8645 // UserID - READ-ONLY; User identifier path. /users/{userId} 8646 UserID *string `json:"userId,omitempty"` 8647 // Method - The HTTP method associated with this request.. 8648 Method *string `json:"method,omitempty"` 8649 // URL - The full URL associated with this request. 8650 URL *string `json:"url,omitempty"` 8651 // IPAddress - The client IP address associated with this request. 8652 IPAddress *string `json:"ipAddress,omitempty"` 8653 // BackendResponseCode - The HTTP status code received by the gateway as a result of forwarding this request to the backend. 8654 BackendResponseCode *string `json:"backendResponseCode,omitempty"` 8655 // ResponseCode - The HTTP status code returned by the gateway. 8656 ResponseCode *int32 `json:"responseCode,omitempty"` 8657 // ResponseSize - The size of the response returned by the gateway. 8658 ResponseSize *int32 `json:"responseSize,omitempty"` 8659 // Timestamp - The date and time when this request was received by the gateway in ISO 8601 format. 8660 Timestamp *date.Time `json:"timestamp,omitempty"` 8661 // Cache - Specifies if response cache was involved in generating the response. If the value is none, the cache was not used. If the value is hit, cached response was returned. If the value is miss, the cache was used but lookup resulted in a miss and request was fulfilled by the backend. 8662 Cache *string `json:"cache,omitempty"` 8663 // APITime - The total time it took to process this request. 8664 APITime *float64 `json:"apiTime,omitempty"` 8665 // ServiceTime - he time it took to forward this request to the backend and get the response back. 8666 ServiceTime *float64 `json:"serviceTime,omitempty"` 8667 // APIRegion - Azure region where the gateway that processed this request is located. 8668 APIRegion *string `json:"apiRegion,omitempty"` 8669 // SubscriptionID - Subscription identifier path. /subscriptions/{subscriptionId} 8670 SubscriptionID *string `json:"subscriptionId,omitempty"` 8671 // RequestID - Request Identifier. 8672 RequestID *string `json:"requestId,omitempty"` 8673 // RequestSize - The size of this request.. 8674 RequestSize *int32 `json:"requestSize,omitempty"` 8675} 8676 8677// Resource the Resource definition. 8678type Resource struct { 8679 // ID - READ-ONLY; Resource ID. 8680 ID *string `json:"id,omitempty"` 8681 // Name - READ-ONLY; Resource name. 8682 Name *string `json:"name,omitempty"` 8683 // Type - READ-ONLY; Resource type for API Management resource. 8684 Type *string `json:"type,omitempty"` 8685} 8686 8687// ResourceSku describes an available API Management SKU. 8688type ResourceSku struct { 8689 // Name - Name of the Sku. Possible values include: 'SkuTypeDeveloper', 'SkuTypeStandard', 'SkuTypePremium', 'SkuTypeBasic', 'SkuTypeConsumption' 8690 Name SkuType `json:"name,omitempty"` 8691} 8692 8693// ResourceSkuCapacity describes scaling information of a SKU. 8694type ResourceSkuCapacity struct { 8695 // Minimum - READ-ONLY; The minimum capacity. 8696 Minimum *int32 `json:"minimum,omitempty"` 8697 // Maximum - READ-ONLY; The maximum capacity that can be set. 8698 Maximum *int32 `json:"maximum,omitempty"` 8699 // Default - READ-ONLY; The default capacity. 8700 Default *int32 `json:"default,omitempty"` 8701 // ScaleType - READ-ONLY; The scale type applicable to the sku. Possible values include: 'Automatic', 'Manual', 'None' 8702 ScaleType ResourceSkuCapacityScaleType `json:"scaleType,omitempty"` 8703} 8704 8705// ResourceSkuResult describes an available API Management service SKU. 8706type ResourceSkuResult struct { 8707 // ResourceType - READ-ONLY; The type of resource the SKU applies to. 8708 ResourceType *string `json:"resourceType,omitempty"` 8709 // Sku - READ-ONLY; Specifies API Management SKU. 8710 Sku *ResourceSku `json:"sku,omitempty"` 8711 // Capacity - READ-ONLY; Specifies the number of API Management units. 8712 Capacity *ResourceSkuCapacity `json:"capacity,omitempty"` 8713} 8714 8715// ResourceSkuResults the API Management service SKUs operation response. 8716type ResourceSkuResults struct { 8717 autorest.Response `json:"-"` 8718 // Value - The list of skus available for the service. 8719 Value *[]ResourceSkuResult `json:"value,omitempty"` 8720 // NextLink - The uri to fetch the next page of API Management service Skus. 8721 NextLink *string `json:"nextLink,omitempty"` 8722} 8723 8724// ResourceSkuResultsIterator provides access to a complete listing of ResourceSkuResult values. 8725type ResourceSkuResultsIterator struct { 8726 i int 8727 page ResourceSkuResultsPage 8728} 8729 8730// NextWithContext advances to the next value. If there was an error making 8731// the request the iterator does not advance and the error is returned. 8732func (iter *ResourceSkuResultsIterator) NextWithContext(ctx context.Context) (err error) { 8733 if tracing.IsEnabled() { 8734 ctx = tracing.StartSpan(ctx, fqdn+"/ResourceSkuResultsIterator.NextWithContext") 8735 defer func() { 8736 sc := -1 8737 if iter.Response().Response.Response != nil { 8738 sc = iter.Response().Response.Response.StatusCode 8739 } 8740 tracing.EndSpan(ctx, sc, err) 8741 }() 8742 } 8743 iter.i++ 8744 if iter.i < len(iter.page.Values()) { 8745 return nil 8746 } 8747 err = iter.page.NextWithContext(ctx) 8748 if err != nil { 8749 iter.i-- 8750 return err 8751 } 8752 iter.i = 0 8753 return nil 8754} 8755 8756// Next advances to the next value. If there was an error making 8757// the request the iterator does not advance and the error is returned. 8758// Deprecated: Use NextWithContext() instead. 8759func (iter *ResourceSkuResultsIterator) Next() error { 8760 return iter.NextWithContext(context.Background()) 8761} 8762 8763// NotDone returns true if the enumeration should be started or is not yet complete. 8764func (iter ResourceSkuResultsIterator) NotDone() bool { 8765 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 8766} 8767 8768// Response returns the raw server response from the last page request. 8769func (iter ResourceSkuResultsIterator) Response() ResourceSkuResults { 8770 return iter.page.Response() 8771} 8772 8773// Value returns the current value or a zero-initialized value if the 8774// iterator has advanced beyond the end of the collection. 8775func (iter ResourceSkuResultsIterator) Value() ResourceSkuResult { 8776 if !iter.page.NotDone() { 8777 return ResourceSkuResult{} 8778 } 8779 return iter.page.Values()[iter.i] 8780} 8781 8782// Creates a new instance of the ResourceSkuResultsIterator type. 8783func NewResourceSkuResultsIterator(page ResourceSkuResultsPage) ResourceSkuResultsIterator { 8784 return ResourceSkuResultsIterator{page: page} 8785} 8786 8787// IsEmpty returns true if the ListResult contains no values. 8788func (rsr ResourceSkuResults) IsEmpty() bool { 8789 return rsr.Value == nil || len(*rsr.Value) == 0 8790} 8791 8792// resourceSkuResultsPreparer prepares a request to retrieve the next set of results. 8793// It returns nil if no more results exist. 8794func (rsr ResourceSkuResults) resourceSkuResultsPreparer(ctx context.Context) (*http.Request, error) { 8795 if rsr.NextLink == nil || len(to.String(rsr.NextLink)) < 1 { 8796 return nil, nil 8797 } 8798 return autorest.Prepare((&http.Request{}).WithContext(ctx), 8799 autorest.AsJSON(), 8800 autorest.AsGet(), 8801 autorest.WithBaseURL(to.String(rsr.NextLink))) 8802} 8803 8804// ResourceSkuResultsPage contains a page of ResourceSkuResult values. 8805type ResourceSkuResultsPage struct { 8806 fn func(context.Context, ResourceSkuResults) (ResourceSkuResults, error) 8807 rsr ResourceSkuResults 8808} 8809 8810// NextWithContext advances to the next page of values. If there was an error making 8811// the request the page does not advance and the error is returned. 8812func (page *ResourceSkuResultsPage) NextWithContext(ctx context.Context) (err error) { 8813 if tracing.IsEnabled() { 8814 ctx = tracing.StartSpan(ctx, fqdn+"/ResourceSkuResultsPage.NextWithContext") 8815 defer func() { 8816 sc := -1 8817 if page.Response().Response.Response != nil { 8818 sc = page.Response().Response.Response.StatusCode 8819 } 8820 tracing.EndSpan(ctx, sc, err) 8821 }() 8822 } 8823 next, err := page.fn(ctx, page.rsr) 8824 if err != nil { 8825 return err 8826 } 8827 page.rsr = next 8828 return nil 8829} 8830 8831// Next advances to the next page of values. If there was an error making 8832// the request the page does not advance and the error is returned. 8833// Deprecated: Use NextWithContext() instead. 8834func (page *ResourceSkuResultsPage) Next() error { 8835 return page.NextWithContext(context.Background()) 8836} 8837 8838// NotDone returns true if the page enumeration should be started or is not yet complete. 8839func (page ResourceSkuResultsPage) NotDone() bool { 8840 return !page.rsr.IsEmpty() 8841} 8842 8843// Response returns the raw server response from the last page request. 8844func (page ResourceSkuResultsPage) Response() ResourceSkuResults { 8845 return page.rsr 8846} 8847 8848// Values returns the slice of values for the current page or nil if there are no values. 8849func (page ResourceSkuResultsPage) Values() []ResourceSkuResult { 8850 if page.rsr.IsEmpty() { 8851 return nil 8852 } 8853 return *page.rsr.Value 8854} 8855 8856// Creates a new instance of the ResourceSkuResultsPage type. 8857func NewResourceSkuResultsPage(getNextPage func(context.Context, ResourceSkuResults) (ResourceSkuResults, error)) ResourceSkuResultsPage { 8858 return ResourceSkuResultsPage{fn: getNextPage} 8859} 8860 8861// ResponseContract operation response details. 8862type ResponseContract struct { 8863 // StatusCode - Operation response HTTP status code. 8864 StatusCode *int32 `json:"statusCode,omitempty"` 8865 // Description - Operation response description. 8866 Description *string `json:"description,omitempty"` 8867 // Representations - Collection of operation response representations. 8868 Representations *[]RepresentationContract `json:"representations,omitempty"` 8869 // Headers - Collection of operation response headers. 8870 Headers *[]ParameterContract `json:"headers,omitempty"` 8871} 8872 8873// SamplingSettings sampling settings for Diagnostic. 8874type SamplingSettings struct { 8875 // SamplingType - Sampling type. Possible values include: 'Fixed' 8876 SamplingType SamplingType `json:"samplingType,omitempty"` 8877 // Percentage - Rate of sampling for fixed-rate sampling. 8878 Percentage *float64 `json:"percentage,omitempty"` 8879} 8880 8881// SaveConfigurationParameter parameters supplied to the Save Tenant Configuration operation. 8882type SaveConfigurationParameter struct { 8883 // Branch - The name of the Git branch in which to commit the current configuration snapshot. 8884 Branch *string `json:"branch,omitempty"` 8885 // 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. 8886 Force *bool `json:"force,omitempty"` 8887} 8888 8889// SchemaCollection the response of the list schema operation. 8890type SchemaCollection struct { 8891 autorest.Response `json:"-"` 8892 // Value - READ-ONLY; Api Schema Contract value. 8893 Value *[]SchemaContract `json:"value,omitempty"` 8894 // NextLink - READ-ONLY; Next page link if any. 8895 NextLink *string `json:"nextLink,omitempty"` 8896} 8897 8898// SchemaCollectionIterator provides access to a complete listing of SchemaContract values. 8899type SchemaCollectionIterator struct { 8900 i int 8901 page SchemaCollectionPage 8902} 8903 8904// NextWithContext advances to the next value. If there was an error making 8905// the request the iterator does not advance and the error is returned. 8906func (iter *SchemaCollectionIterator) NextWithContext(ctx context.Context) (err error) { 8907 if tracing.IsEnabled() { 8908 ctx = tracing.StartSpan(ctx, fqdn+"/SchemaCollectionIterator.NextWithContext") 8909 defer func() { 8910 sc := -1 8911 if iter.Response().Response.Response != nil { 8912 sc = iter.Response().Response.Response.StatusCode 8913 } 8914 tracing.EndSpan(ctx, sc, err) 8915 }() 8916 } 8917 iter.i++ 8918 if iter.i < len(iter.page.Values()) { 8919 return nil 8920 } 8921 err = iter.page.NextWithContext(ctx) 8922 if err != nil { 8923 iter.i-- 8924 return err 8925 } 8926 iter.i = 0 8927 return nil 8928} 8929 8930// Next advances to the next value. If there was an error making 8931// the request the iterator does not advance and the error is returned. 8932// Deprecated: Use NextWithContext() instead. 8933func (iter *SchemaCollectionIterator) Next() error { 8934 return iter.NextWithContext(context.Background()) 8935} 8936 8937// NotDone returns true if the enumeration should be started or is not yet complete. 8938func (iter SchemaCollectionIterator) NotDone() bool { 8939 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 8940} 8941 8942// Response returns the raw server response from the last page request. 8943func (iter SchemaCollectionIterator) Response() SchemaCollection { 8944 return iter.page.Response() 8945} 8946 8947// Value returns the current value or a zero-initialized value if the 8948// iterator has advanced beyond the end of the collection. 8949func (iter SchemaCollectionIterator) Value() SchemaContract { 8950 if !iter.page.NotDone() { 8951 return SchemaContract{} 8952 } 8953 return iter.page.Values()[iter.i] 8954} 8955 8956// Creates a new instance of the SchemaCollectionIterator type. 8957func NewSchemaCollectionIterator(page SchemaCollectionPage) SchemaCollectionIterator { 8958 return SchemaCollectionIterator{page: page} 8959} 8960 8961// IsEmpty returns true if the ListResult contains no values. 8962func (sc SchemaCollection) IsEmpty() bool { 8963 return sc.Value == nil || len(*sc.Value) == 0 8964} 8965 8966// schemaCollectionPreparer prepares a request to retrieve the next set of results. 8967// It returns nil if no more results exist. 8968func (sc SchemaCollection) schemaCollectionPreparer(ctx context.Context) (*http.Request, error) { 8969 if sc.NextLink == nil || len(to.String(sc.NextLink)) < 1 { 8970 return nil, nil 8971 } 8972 return autorest.Prepare((&http.Request{}).WithContext(ctx), 8973 autorest.AsJSON(), 8974 autorest.AsGet(), 8975 autorest.WithBaseURL(to.String(sc.NextLink))) 8976} 8977 8978// SchemaCollectionPage contains a page of SchemaContract values. 8979type SchemaCollectionPage struct { 8980 fn func(context.Context, SchemaCollection) (SchemaCollection, error) 8981 sc SchemaCollection 8982} 8983 8984// NextWithContext advances to the next page of values. If there was an error making 8985// the request the page does not advance and the error is returned. 8986func (page *SchemaCollectionPage) NextWithContext(ctx context.Context) (err error) { 8987 if tracing.IsEnabled() { 8988 ctx = tracing.StartSpan(ctx, fqdn+"/SchemaCollectionPage.NextWithContext") 8989 defer func() { 8990 sc := -1 8991 if page.Response().Response.Response != nil { 8992 sc = page.Response().Response.Response.StatusCode 8993 } 8994 tracing.EndSpan(ctx, sc, err) 8995 }() 8996 } 8997 next, err := page.fn(ctx, page.sc) 8998 if err != nil { 8999 return err 9000 } 9001 page.sc = next 9002 return nil 9003} 9004 9005// Next advances to the next page of values. If there was an error making 9006// the request the page does not advance and the error is returned. 9007// Deprecated: Use NextWithContext() instead. 9008func (page *SchemaCollectionPage) Next() error { 9009 return page.NextWithContext(context.Background()) 9010} 9011 9012// NotDone returns true if the page enumeration should be started or is not yet complete. 9013func (page SchemaCollectionPage) NotDone() bool { 9014 return !page.sc.IsEmpty() 9015} 9016 9017// Response returns the raw server response from the last page request. 9018func (page SchemaCollectionPage) Response() SchemaCollection { 9019 return page.sc 9020} 9021 9022// Values returns the slice of values for the current page or nil if there are no values. 9023func (page SchemaCollectionPage) Values() []SchemaContract { 9024 if page.sc.IsEmpty() { 9025 return nil 9026 } 9027 return *page.sc.Value 9028} 9029 9030// Creates a new instance of the SchemaCollectionPage type. 9031func NewSchemaCollectionPage(getNextPage func(context.Context, SchemaCollection) (SchemaCollection, error)) SchemaCollectionPage { 9032 return SchemaCollectionPage{fn: getNextPage} 9033} 9034 9035// SchemaContract schema Contract details. 9036type SchemaContract struct { 9037 autorest.Response `json:"-"` 9038 // SchemaContractProperties - Properties of the Schema. 9039 *SchemaContractProperties `json:"properties,omitempty"` 9040 // ID - READ-ONLY; Resource ID. 9041 ID *string `json:"id,omitempty"` 9042 // Name - READ-ONLY; Resource name. 9043 Name *string `json:"name,omitempty"` 9044 // Type - READ-ONLY; Resource type for API Management resource. 9045 Type *string `json:"type,omitempty"` 9046} 9047 9048// MarshalJSON is the custom marshaler for SchemaContract. 9049func (sc SchemaContract) MarshalJSON() ([]byte, error) { 9050 objectMap := make(map[string]interface{}) 9051 if sc.SchemaContractProperties != nil { 9052 objectMap["properties"] = sc.SchemaContractProperties 9053 } 9054 return json.Marshal(objectMap) 9055} 9056 9057// UnmarshalJSON is the custom unmarshaler for SchemaContract struct. 9058func (sc *SchemaContract) UnmarshalJSON(body []byte) error { 9059 var m map[string]*json.RawMessage 9060 err := json.Unmarshal(body, &m) 9061 if err != nil { 9062 return err 9063 } 9064 for k, v := range m { 9065 switch k { 9066 case "properties": 9067 if v != nil { 9068 var schemaContractProperties SchemaContractProperties 9069 err = json.Unmarshal(*v, &schemaContractProperties) 9070 if err != nil { 9071 return err 9072 } 9073 sc.SchemaContractProperties = &schemaContractProperties 9074 } 9075 case "id": 9076 if v != nil { 9077 var ID string 9078 err = json.Unmarshal(*v, &ID) 9079 if err != nil { 9080 return err 9081 } 9082 sc.ID = &ID 9083 } 9084 case "name": 9085 if v != nil { 9086 var name string 9087 err = json.Unmarshal(*v, &name) 9088 if err != nil { 9089 return err 9090 } 9091 sc.Name = &name 9092 } 9093 case "type": 9094 if v != nil { 9095 var typeVar string 9096 err = json.Unmarshal(*v, &typeVar) 9097 if err != nil { 9098 return err 9099 } 9100 sc.Type = &typeVar 9101 } 9102 } 9103 } 9104 9105 return nil 9106} 9107 9108// SchemaContractProperties schema contract Properties. 9109type SchemaContractProperties struct { 9110 // ContentType - Must be a valid a media type used in a Content-Type header as defined in the RFC 2616. Media type of the schema document (e.g. application/json, application/xml). 9111 ContentType *string `json:"contentType,omitempty"` 9112 // SchemaDocumentProperties - Properties of the Schema Document. 9113 *SchemaDocumentProperties `json:"document,omitempty"` 9114} 9115 9116// MarshalJSON is the custom marshaler for SchemaContractProperties. 9117func (scp SchemaContractProperties) MarshalJSON() ([]byte, error) { 9118 objectMap := make(map[string]interface{}) 9119 if scp.ContentType != nil { 9120 objectMap["contentType"] = scp.ContentType 9121 } 9122 if scp.SchemaDocumentProperties != nil { 9123 objectMap["document"] = scp.SchemaDocumentProperties 9124 } 9125 return json.Marshal(objectMap) 9126} 9127 9128// UnmarshalJSON is the custom unmarshaler for SchemaContractProperties struct. 9129func (scp *SchemaContractProperties) UnmarshalJSON(body []byte) error { 9130 var m map[string]*json.RawMessage 9131 err := json.Unmarshal(body, &m) 9132 if err != nil { 9133 return err 9134 } 9135 for k, v := range m { 9136 switch k { 9137 case "contentType": 9138 if v != nil { 9139 var contentType string 9140 err = json.Unmarshal(*v, &contentType) 9141 if err != nil { 9142 return err 9143 } 9144 scp.ContentType = &contentType 9145 } 9146 case "document": 9147 if v != nil { 9148 var schemaDocumentProperties SchemaDocumentProperties 9149 err = json.Unmarshal(*v, &schemaDocumentProperties) 9150 if err != nil { 9151 return err 9152 } 9153 scp.SchemaDocumentProperties = &schemaDocumentProperties 9154 } 9155 } 9156 } 9157 9158 return nil 9159} 9160 9161// SchemaDocumentProperties schema Document Properties. 9162type SchemaDocumentProperties struct { 9163 // Value - Json escaped string defining the document representing the Schema. 9164 Value *string `json:"value,omitempty"` 9165} 9166 9167// ServiceApplyNetworkConfigurationParameters parameter supplied to the Apply Network configuration 9168// operation. 9169type ServiceApplyNetworkConfigurationParameters struct { 9170 // Location - Location of the Api Management service to update for a multi-region service. For a service deployed in a single region, this parameter is not required. 9171 Location *string `json:"location,omitempty"` 9172} 9173 9174// ServiceApplyNetworkConfigurationUpdatesFuture an abstraction for monitoring and retrieving the results 9175// of a long-running operation. 9176type ServiceApplyNetworkConfigurationUpdatesFuture struct { 9177 azure.Future 9178} 9179 9180// Result returns the result of the asynchronous operation. 9181// If the operation has not completed it will return an error. 9182func (future *ServiceApplyNetworkConfigurationUpdatesFuture) Result(client ServiceClient) (sr ServiceResource, err error) { 9183 var done bool 9184 done, err = future.DoneWithContext(context.Background(), client) 9185 if err != nil { 9186 err = autorest.NewErrorWithError(err, "apimanagement.ServiceApplyNetworkConfigurationUpdatesFuture", "Result", future.Response(), "Polling failure") 9187 return 9188 } 9189 if !done { 9190 err = azure.NewAsyncOpIncompleteError("apimanagement.ServiceApplyNetworkConfigurationUpdatesFuture") 9191 return 9192 } 9193 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 9194 if sr.Response.Response, err = future.GetResult(sender); err == nil && sr.Response.Response.StatusCode != http.StatusNoContent { 9195 sr, err = client.ApplyNetworkConfigurationUpdatesResponder(sr.Response.Response) 9196 if err != nil { 9197 err = autorest.NewErrorWithError(err, "apimanagement.ServiceApplyNetworkConfigurationUpdatesFuture", "Result", sr.Response.Response, "Failure responding to request") 9198 } 9199 } 9200 return 9201} 9202 9203// ServiceBackupFuture an abstraction for monitoring and retrieving the results of a long-running 9204// operation. 9205type ServiceBackupFuture struct { 9206 azure.Future 9207} 9208 9209// Result returns the result of the asynchronous operation. 9210// If the operation has not completed it will return an error. 9211func (future *ServiceBackupFuture) Result(client ServiceClient) (sr ServiceResource, err error) { 9212 var done bool 9213 done, err = future.DoneWithContext(context.Background(), client) 9214 if err != nil { 9215 err = autorest.NewErrorWithError(err, "apimanagement.ServiceBackupFuture", "Result", future.Response(), "Polling failure") 9216 return 9217 } 9218 if !done { 9219 err = azure.NewAsyncOpIncompleteError("apimanagement.ServiceBackupFuture") 9220 return 9221 } 9222 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 9223 if sr.Response.Response, err = future.GetResult(sender); err == nil && sr.Response.Response.StatusCode != http.StatusNoContent { 9224 sr, err = client.BackupResponder(sr.Response.Response) 9225 if err != nil { 9226 err = autorest.NewErrorWithError(err, "apimanagement.ServiceBackupFuture", "Result", sr.Response.Response, "Failure responding to request") 9227 } 9228 } 9229 return 9230} 9231 9232// ServiceBackupRestoreParameters parameters supplied to the Backup/Restore of an API Management service 9233// operation. 9234type ServiceBackupRestoreParameters struct { 9235 // StorageAccount - Azure Cloud Storage account (used to place/retrieve the backup) name. 9236 StorageAccount *string `json:"storageAccount,omitempty"` 9237 // AccessKey - Azure Cloud Storage account (used to place/retrieve the backup) access key. 9238 AccessKey *string `json:"accessKey,omitempty"` 9239 // ContainerName - Azure Cloud Storage blob container name used to place/retrieve the backup. 9240 ContainerName *string `json:"containerName,omitempty"` 9241 // BackupName - The name of the backup file to create. 9242 BackupName *string `json:"backupName,omitempty"` 9243} 9244 9245// ServiceBaseProperties base Properties of an API Management service resource description. 9246type ServiceBaseProperties struct { 9247 // NotificationSenderEmail - Email address from which the notification will be sent. 9248 NotificationSenderEmail *string `json:"notificationSenderEmail,omitempty"` 9249 // 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. 9250 ProvisioningState *string `json:"provisioningState,omitempty"` 9251 // TargetProvisioningState - READ-ONLY; The provisioning state of the API Management service, which is targeted by the long running operation started on the service. 9252 TargetProvisioningState *string `json:"targetProvisioningState,omitempty"` 9253 // 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. 9254 CreatedAtUtc *date.Time `json:"createdAtUtc,omitempty"` 9255 // GatewayURL - READ-ONLY; Gateway URL of the API Management service. 9256 GatewayURL *string `json:"gatewayUrl,omitempty"` 9257 // GatewayRegionalURL - READ-ONLY; Gateway URL of the API Management service in the Default Region. 9258 GatewayRegionalURL *string `json:"gatewayRegionalUrl,omitempty"` 9259 // PortalURL - READ-ONLY; Publisher portal endpoint Url of the API Management service. 9260 PortalURL *string `json:"portalUrl,omitempty"` 9261 // ManagementAPIURL - READ-ONLY; Management API endpoint URL of the API Management service. 9262 ManagementAPIURL *string `json:"managementApiUrl,omitempty"` 9263 // ScmURL - READ-ONLY; SCM endpoint URL of the API Management service. 9264 ScmURL *string `json:"scmUrl,omitempty"` 9265 // HostnameConfigurations - Custom hostname configuration of the API Management service. 9266 HostnameConfigurations *[]HostnameConfiguration `json:"hostnameConfigurations,omitempty"` 9267 // PublicIPAddresses - READ-ONLY; Public Static Load Balanced IP addresses of the API Management service in Primary region. Available only for Basic, Standard and Premium SKU. 9268 PublicIPAddresses *[]string `json:"publicIPAddresses,omitempty"` 9269 // PrivateIPAddresses - READ-ONLY; Private Static Load Balanced IP addresses of the API Management service in Primary region which is deployed in an Internal Virtual Network. Available only for Basic, Standard and Premium SKU. 9270 PrivateIPAddresses *[]string `json:"privateIPAddresses,omitempty"` 9271 // VirtualNetworkConfiguration - Virtual network configuration of the API Management service. 9272 VirtualNetworkConfiguration *VirtualNetworkConfiguration `json:"virtualNetworkConfiguration,omitempty"` 9273 // AdditionalLocations - Additional datacenter locations of the API Management service. 9274 AdditionalLocations *[]AdditionalLocation `json:"additionalLocations,omitempty"` 9275 // CustomProperties - Custom properties of the API Management service. Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TripleDes168` will disable the cipher TLS_RSA_WITH_3DES_EDE_CBC_SHA for all TLS(1.0, 1.1 and 1.2). Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls11` can be used to disable just TLS 1.1 and setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls10` can be used to disable TLS 1.0 on an API Management service. 9276 CustomProperties map[string]*string `json:"customProperties"` 9277 // Certificates - List of Certificates that need to be installed in the API Management service. Max supported certificates that can be installed is 10. 9278 Certificates *[]CertificateConfiguration `json:"certificates,omitempty"` 9279 // VirtualNetworkType - The type of VPN in which API Management service needs to be configured in. None (Default Value) means the API Management service is not part of any Virtual Network, External means the API Management deployment is set up inside a Virtual Network having an Internet Facing Endpoint, and Internal means that API Management deployment is setup inside a Virtual Network having an Intranet Facing Endpoint only. Possible values include: 'VirtualNetworkTypeNone', 'VirtualNetworkTypeExternal', 'VirtualNetworkTypeInternal' 9280 VirtualNetworkType VirtualNetworkType `json:"virtualNetworkType,omitempty"` 9281} 9282 9283// MarshalJSON is the custom marshaler for ServiceBaseProperties. 9284func (sbp ServiceBaseProperties) MarshalJSON() ([]byte, error) { 9285 objectMap := make(map[string]interface{}) 9286 if sbp.NotificationSenderEmail != nil { 9287 objectMap["notificationSenderEmail"] = sbp.NotificationSenderEmail 9288 } 9289 if sbp.HostnameConfigurations != nil { 9290 objectMap["hostnameConfigurations"] = sbp.HostnameConfigurations 9291 } 9292 if sbp.VirtualNetworkConfiguration != nil { 9293 objectMap["virtualNetworkConfiguration"] = sbp.VirtualNetworkConfiguration 9294 } 9295 if sbp.AdditionalLocations != nil { 9296 objectMap["additionalLocations"] = sbp.AdditionalLocations 9297 } 9298 if sbp.CustomProperties != nil { 9299 objectMap["customProperties"] = sbp.CustomProperties 9300 } 9301 if sbp.Certificates != nil { 9302 objectMap["certificates"] = sbp.Certificates 9303 } 9304 if sbp.VirtualNetworkType != "" { 9305 objectMap["virtualNetworkType"] = sbp.VirtualNetworkType 9306 } 9307 return json.Marshal(objectMap) 9308} 9309 9310// ServiceCheckNameAvailabilityParameters parameters supplied to the CheckNameAvailability operation. 9311type ServiceCheckNameAvailabilityParameters struct { 9312 // Name - The name to check for availability. 9313 Name *string `json:"name,omitempty"` 9314} 9315 9316// ServiceCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 9317// operation. 9318type ServiceCreateOrUpdateFuture struct { 9319 azure.Future 9320} 9321 9322// Result returns the result of the asynchronous operation. 9323// If the operation has not completed it will return an error. 9324func (future *ServiceCreateOrUpdateFuture) Result(client ServiceClient) (sr ServiceResource, err error) { 9325 var done bool 9326 done, err = future.DoneWithContext(context.Background(), client) 9327 if err != nil { 9328 err = autorest.NewErrorWithError(err, "apimanagement.ServiceCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 9329 return 9330 } 9331 if !done { 9332 err = azure.NewAsyncOpIncompleteError("apimanagement.ServiceCreateOrUpdateFuture") 9333 return 9334 } 9335 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 9336 if sr.Response.Response, err = future.GetResult(sender); err == nil && sr.Response.Response.StatusCode != http.StatusNoContent { 9337 sr, err = client.CreateOrUpdateResponder(sr.Response.Response) 9338 if err != nil { 9339 err = autorest.NewErrorWithError(err, "apimanagement.ServiceCreateOrUpdateFuture", "Result", sr.Response.Response, "Failure responding to request") 9340 } 9341 } 9342 return 9343} 9344 9345// ServiceDeleteFuture an abstraction for monitoring and retrieving the results of a long-running 9346// operation. 9347type ServiceDeleteFuture struct { 9348 azure.Future 9349} 9350 9351// Result returns the result of the asynchronous operation. 9352// If the operation has not completed it will return an error. 9353func (future *ServiceDeleteFuture) Result(client ServiceClient) (sr ServiceResource, err error) { 9354 var done bool 9355 done, err = future.DoneWithContext(context.Background(), client) 9356 if err != nil { 9357 err = autorest.NewErrorWithError(err, "apimanagement.ServiceDeleteFuture", "Result", future.Response(), "Polling failure") 9358 return 9359 } 9360 if !done { 9361 err = azure.NewAsyncOpIncompleteError("apimanagement.ServiceDeleteFuture") 9362 return 9363 } 9364 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 9365 if sr.Response.Response, err = future.GetResult(sender); err == nil && sr.Response.Response.StatusCode != http.StatusNoContent { 9366 sr, err = client.DeleteResponder(sr.Response.Response) 9367 if err != nil { 9368 err = autorest.NewErrorWithError(err, "apimanagement.ServiceDeleteFuture", "Result", sr.Response.Response, "Failure responding to request") 9369 } 9370 } 9371 return 9372} 9373 9374// ServiceGetSsoTokenResult the response of the GetSsoToken operation. 9375type ServiceGetSsoTokenResult struct { 9376 autorest.Response `json:"-"` 9377 // RedirectURI - Redirect URL to the Publisher Portal containing the SSO token. 9378 RedirectURI *string `json:"redirectUri,omitempty"` 9379} 9380 9381// ServiceIdentity identity properties of the Api Management service resource. 9382type ServiceIdentity struct { 9383 // Type - The identity type. Currently the only supported type is 'SystemAssigned'. 9384 Type *string `json:"type,omitempty"` 9385 // PrincipalID - READ-ONLY; The principal id of the identity. 9386 PrincipalID *uuid.UUID `json:"principalId,omitempty"` 9387 // TenantID - READ-ONLY; The client tenant id of the identity. 9388 TenantID *uuid.UUID `json:"tenantId,omitempty"` 9389} 9390 9391// ServiceListResult the response of the List API Management services operation. 9392type ServiceListResult struct { 9393 autorest.Response `json:"-"` 9394 // Value - Result of the List API Management services operation. 9395 Value *[]ServiceResource `json:"value,omitempty"` 9396 // NextLink - Link to the next set of results. Not empty if Value contains incomplete list of API Management services. 9397 NextLink *string `json:"nextLink,omitempty"` 9398} 9399 9400// ServiceListResultIterator provides access to a complete listing of ServiceResource values. 9401type ServiceListResultIterator struct { 9402 i int 9403 page ServiceListResultPage 9404} 9405 9406// NextWithContext advances to the next value. If there was an error making 9407// the request the iterator does not advance and the error is returned. 9408func (iter *ServiceListResultIterator) NextWithContext(ctx context.Context) (err error) { 9409 if tracing.IsEnabled() { 9410 ctx = tracing.StartSpan(ctx, fqdn+"/ServiceListResultIterator.NextWithContext") 9411 defer func() { 9412 sc := -1 9413 if iter.Response().Response.Response != nil { 9414 sc = iter.Response().Response.Response.StatusCode 9415 } 9416 tracing.EndSpan(ctx, sc, err) 9417 }() 9418 } 9419 iter.i++ 9420 if iter.i < len(iter.page.Values()) { 9421 return nil 9422 } 9423 err = iter.page.NextWithContext(ctx) 9424 if err != nil { 9425 iter.i-- 9426 return err 9427 } 9428 iter.i = 0 9429 return nil 9430} 9431 9432// Next advances to the next value. If there was an error making 9433// the request the iterator does not advance and the error is returned. 9434// Deprecated: Use NextWithContext() instead. 9435func (iter *ServiceListResultIterator) Next() error { 9436 return iter.NextWithContext(context.Background()) 9437} 9438 9439// NotDone returns true if the enumeration should be started or is not yet complete. 9440func (iter ServiceListResultIterator) NotDone() bool { 9441 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 9442} 9443 9444// Response returns the raw server response from the last page request. 9445func (iter ServiceListResultIterator) Response() ServiceListResult { 9446 return iter.page.Response() 9447} 9448 9449// Value returns the current value or a zero-initialized value if the 9450// iterator has advanced beyond the end of the collection. 9451func (iter ServiceListResultIterator) Value() ServiceResource { 9452 if !iter.page.NotDone() { 9453 return ServiceResource{} 9454 } 9455 return iter.page.Values()[iter.i] 9456} 9457 9458// Creates a new instance of the ServiceListResultIterator type. 9459func NewServiceListResultIterator(page ServiceListResultPage) ServiceListResultIterator { 9460 return ServiceListResultIterator{page: page} 9461} 9462 9463// IsEmpty returns true if the ListResult contains no values. 9464func (slr ServiceListResult) IsEmpty() bool { 9465 return slr.Value == nil || len(*slr.Value) == 0 9466} 9467 9468// serviceListResultPreparer prepares a request to retrieve the next set of results. 9469// It returns nil if no more results exist. 9470func (slr ServiceListResult) serviceListResultPreparer(ctx context.Context) (*http.Request, error) { 9471 if slr.NextLink == nil || len(to.String(slr.NextLink)) < 1 { 9472 return nil, nil 9473 } 9474 return autorest.Prepare((&http.Request{}).WithContext(ctx), 9475 autorest.AsJSON(), 9476 autorest.AsGet(), 9477 autorest.WithBaseURL(to.String(slr.NextLink))) 9478} 9479 9480// ServiceListResultPage contains a page of ServiceResource values. 9481type ServiceListResultPage struct { 9482 fn func(context.Context, ServiceListResult) (ServiceListResult, error) 9483 slr ServiceListResult 9484} 9485 9486// NextWithContext advances to the next page of values. If there was an error making 9487// the request the page does not advance and the error is returned. 9488func (page *ServiceListResultPage) NextWithContext(ctx context.Context) (err error) { 9489 if tracing.IsEnabled() { 9490 ctx = tracing.StartSpan(ctx, fqdn+"/ServiceListResultPage.NextWithContext") 9491 defer func() { 9492 sc := -1 9493 if page.Response().Response.Response != nil { 9494 sc = page.Response().Response.Response.StatusCode 9495 } 9496 tracing.EndSpan(ctx, sc, err) 9497 }() 9498 } 9499 next, err := page.fn(ctx, page.slr) 9500 if err != nil { 9501 return err 9502 } 9503 page.slr = next 9504 return nil 9505} 9506 9507// Next advances to the next page of values. If there was an error making 9508// the request the page does not advance and the error is returned. 9509// Deprecated: Use NextWithContext() instead. 9510func (page *ServiceListResultPage) Next() error { 9511 return page.NextWithContext(context.Background()) 9512} 9513 9514// NotDone returns true if the page enumeration should be started or is not yet complete. 9515func (page ServiceListResultPage) NotDone() bool { 9516 return !page.slr.IsEmpty() 9517} 9518 9519// Response returns the raw server response from the last page request. 9520func (page ServiceListResultPage) Response() ServiceListResult { 9521 return page.slr 9522} 9523 9524// Values returns the slice of values for the current page or nil if there are no values. 9525func (page ServiceListResultPage) Values() []ServiceResource { 9526 if page.slr.IsEmpty() { 9527 return nil 9528 } 9529 return *page.slr.Value 9530} 9531 9532// Creates a new instance of the ServiceListResultPage type. 9533func NewServiceListResultPage(getNextPage func(context.Context, ServiceListResult) (ServiceListResult, error)) ServiceListResultPage { 9534 return ServiceListResultPage{fn: getNextPage} 9535} 9536 9537// ServiceNameAvailabilityResult response of the CheckNameAvailability operation. 9538type ServiceNameAvailabilityResult struct { 9539 autorest.Response `json:"-"` 9540 // NameAvailable - READ-ONLY; True if the name is available and can be used to create a new API Management service; otherwise false. 9541 NameAvailable *bool `json:"nameAvailable,omitempty"` 9542 // Message - READ-ONLY; If reason == invalid, provide the user with the reason why the given name is invalid, and provide the resource naming requirements so that the user can select a valid name. If reason == AlreadyExists, explain that <resourceName> is already in use, and direct them to select a different name. 9543 Message *string `json:"message,omitempty"` 9544 // 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' 9545 Reason NameAvailabilityReason `json:"reason,omitempty"` 9546} 9547 9548// ServiceProperties properties of an API Management service resource description. 9549type ServiceProperties struct { 9550 // PublisherEmail - Publisher email. 9551 PublisherEmail *string `json:"publisherEmail,omitempty"` 9552 // PublisherName - Publisher name. 9553 PublisherName *string `json:"publisherName,omitempty"` 9554 // NotificationSenderEmail - Email address from which the notification will be sent. 9555 NotificationSenderEmail *string `json:"notificationSenderEmail,omitempty"` 9556 // 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. 9557 ProvisioningState *string `json:"provisioningState,omitempty"` 9558 // TargetProvisioningState - READ-ONLY; The provisioning state of the API Management service, which is targeted by the long running operation started on the service. 9559 TargetProvisioningState *string `json:"targetProvisioningState,omitempty"` 9560 // 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. 9561 CreatedAtUtc *date.Time `json:"createdAtUtc,omitempty"` 9562 // GatewayURL - READ-ONLY; Gateway URL of the API Management service. 9563 GatewayURL *string `json:"gatewayUrl,omitempty"` 9564 // GatewayRegionalURL - READ-ONLY; Gateway URL of the API Management service in the Default Region. 9565 GatewayRegionalURL *string `json:"gatewayRegionalUrl,omitempty"` 9566 // PortalURL - READ-ONLY; Publisher portal endpoint Url of the API Management service. 9567 PortalURL *string `json:"portalUrl,omitempty"` 9568 // ManagementAPIURL - READ-ONLY; Management API endpoint URL of the API Management service. 9569 ManagementAPIURL *string `json:"managementApiUrl,omitempty"` 9570 // ScmURL - READ-ONLY; SCM endpoint URL of the API Management service. 9571 ScmURL *string `json:"scmUrl,omitempty"` 9572 // HostnameConfigurations - Custom hostname configuration of the API Management service. 9573 HostnameConfigurations *[]HostnameConfiguration `json:"hostnameConfigurations,omitempty"` 9574 // PublicIPAddresses - READ-ONLY; Public Static Load Balanced IP addresses of the API Management service in Primary region. Available only for Basic, Standard and Premium SKU. 9575 PublicIPAddresses *[]string `json:"publicIPAddresses,omitempty"` 9576 // PrivateIPAddresses - READ-ONLY; Private Static Load Balanced IP addresses of the API Management service in Primary region which is deployed in an Internal Virtual Network. Available only for Basic, Standard and Premium SKU. 9577 PrivateIPAddresses *[]string `json:"privateIPAddresses,omitempty"` 9578 // VirtualNetworkConfiguration - Virtual network configuration of the API Management service. 9579 VirtualNetworkConfiguration *VirtualNetworkConfiguration `json:"virtualNetworkConfiguration,omitempty"` 9580 // AdditionalLocations - Additional datacenter locations of the API Management service. 9581 AdditionalLocations *[]AdditionalLocation `json:"additionalLocations,omitempty"` 9582 // CustomProperties - Custom properties of the API Management service. Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TripleDes168` will disable the cipher TLS_RSA_WITH_3DES_EDE_CBC_SHA for all TLS(1.0, 1.1 and 1.2). Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls11` can be used to disable just TLS 1.1 and setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls10` can be used to disable TLS 1.0 on an API Management service. 9583 CustomProperties map[string]*string `json:"customProperties"` 9584 // Certificates - List of Certificates that need to be installed in the API Management service. Max supported certificates that can be installed is 10. 9585 Certificates *[]CertificateConfiguration `json:"certificates,omitempty"` 9586 // VirtualNetworkType - The type of VPN in which API Management service needs to be configured in. None (Default Value) means the API Management service is not part of any Virtual Network, External means the API Management deployment is set up inside a Virtual Network having an Internet Facing Endpoint, and Internal means that API Management deployment is setup inside a Virtual Network having an Intranet Facing Endpoint only. Possible values include: 'VirtualNetworkTypeNone', 'VirtualNetworkTypeExternal', 'VirtualNetworkTypeInternal' 9587 VirtualNetworkType VirtualNetworkType `json:"virtualNetworkType,omitempty"` 9588} 9589 9590// MarshalJSON is the custom marshaler for ServiceProperties. 9591func (sp ServiceProperties) MarshalJSON() ([]byte, error) { 9592 objectMap := make(map[string]interface{}) 9593 if sp.PublisherEmail != nil { 9594 objectMap["publisherEmail"] = sp.PublisherEmail 9595 } 9596 if sp.PublisherName != nil { 9597 objectMap["publisherName"] = sp.PublisherName 9598 } 9599 if sp.NotificationSenderEmail != nil { 9600 objectMap["notificationSenderEmail"] = sp.NotificationSenderEmail 9601 } 9602 if sp.HostnameConfigurations != nil { 9603 objectMap["hostnameConfigurations"] = sp.HostnameConfigurations 9604 } 9605 if sp.VirtualNetworkConfiguration != nil { 9606 objectMap["virtualNetworkConfiguration"] = sp.VirtualNetworkConfiguration 9607 } 9608 if sp.AdditionalLocations != nil { 9609 objectMap["additionalLocations"] = sp.AdditionalLocations 9610 } 9611 if sp.CustomProperties != nil { 9612 objectMap["customProperties"] = sp.CustomProperties 9613 } 9614 if sp.Certificates != nil { 9615 objectMap["certificates"] = sp.Certificates 9616 } 9617 if sp.VirtualNetworkType != "" { 9618 objectMap["virtualNetworkType"] = sp.VirtualNetworkType 9619 } 9620 return json.Marshal(objectMap) 9621} 9622 9623// ServiceResource a single API Management service resource in List or Get response. 9624type ServiceResource struct { 9625 autorest.Response `json:"-"` 9626 // ServiceProperties - Properties of the API Management service. 9627 *ServiceProperties `json:"properties,omitempty"` 9628 // Sku - SKU properties of the API Management service. 9629 Sku *ServiceSkuProperties `json:"sku,omitempty"` 9630 // Identity - Managed service identity of the Api Management service. 9631 Identity *ServiceIdentity `json:"identity,omitempty"` 9632 // Location - Resource location. 9633 Location *string `json:"location,omitempty"` 9634 // Etag - READ-ONLY; ETag of the resource. 9635 Etag *string `json:"etag,omitempty"` 9636 // ID - READ-ONLY; Resource ID. 9637 ID *string `json:"id,omitempty"` 9638 // Name - READ-ONLY; Resource name. 9639 Name *string `json:"name,omitempty"` 9640 // Type - READ-ONLY; Resource type for API Management resource is set to Microsoft.ApiManagement. 9641 Type *string `json:"type,omitempty"` 9642 // Tags - Resource tags. 9643 Tags map[string]*string `json:"tags"` 9644} 9645 9646// MarshalJSON is the custom marshaler for ServiceResource. 9647func (sr ServiceResource) MarshalJSON() ([]byte, error) { 9648 objectMap := make(map[string]interface{}) 9649 if sr.ServiceProperties != nil { 9650 objectMap["properties"] = sr.ServiceProperties 9651 } 9652 if sr.Sku != nil { 9653 objectMap["sku"] = sr.Sku 9654 } 9655 if sr.Identity != nil { 9656 objectMap["identity"] = sr.Identity 9657 } 9658 if sr.Location != nil { 9659 objectMap["location"] = sr.Location 9660 } 9661 if sr.Tags != nil { 9662 objectMap["tags"] = sr.Tags 9663 } 9664 return json.Marshal(objectMap) 9665} 9666 9667// UnmarshalJSON is the custom unmarshaler for ServiceResource struct. 9668func (sr *ServiceResource) UnmarshalJSON(body []byte) error { 9669 var m map[string]*json.RawMessage 9670 err := json.Unmarshal(body, &m) 9671 if err != nil { 9672 return err 9673 } 9674 for k, v := range m { 9675 switch k { 9676 case "properties": 9677 if v != nil { 9678 var serviceProperties ServiceProperties 9679 err = json.Unmarshal(*v, &serviceProperties) 9680 if err != nil { 9681 return err 9682 } 9683 sr.ServiceProperties = &serviceProperties 9684 } 9685 case "sku": 9686 if v != nil { 9687 var sku ServiceSkuProperties 9688 err = json.Unmarshal(*v, &sku) 9689 if err != nil { 9690 return err 9691 } 9692 sr.Sku = &sku 9693 } 9694 case "identity": 9695 if v != nil { 9696 var identity ServiceIdentity 9697 err = json.Unmarshal(*v, &identity) 9698 if err != nil { 9699 return err 9700 } 9701 sr.Identity = &identity 9702 } 9703 case "location": 9704 if v != nil { 9705 var location string 9706 err = json.Unmarshal(*v, &location) 9707 if err != nil { 9708 return err 9709 } 9710 sr.Location = &location 9711 } 9712 case "etag": 9713 if v != nil { 9714 var etag string 9715 err = json.Unmarshal(*v, &etag) 9716 if err != nil { 9717 return err 9718 } 9719 sr.Etag = &etag 9720 } 9721 case "id": 9722 if v != nil { 9723 var ID string 9724 err = json.Unmarshal(*v, &ID) 9725 if err != nil { 9726 return err 9727 } 9728 sr.ID = &ID 9729 } 9730 case "name": 9731 if v != nil { 9732 var name string 9733 err = json.Unmarshal(*v, &name) 9734 if err != nil { 9735 return err 9736 } 9737 sr.Name = &name 9738 } 9739 case "type": 9740 if v != nil { 9741 var typeVar string 9742 err = json.Unmarshal(*v, &typeVar) 9743 if err != nil { 9744 return err 9745 } 9746 sr.Type = &typeVar 9747 } 9748 case "tags": 9749 if v != nil { 9750 var tags map[string]*string 9751 err = json.Unmarshal(*v, &tags) 9752 if err != nil { 9753 return err 9754 } 9755 sr.Tags = tags 9756 } 9757 } 9758 } 9759 9760 return nil 9761} 9762 9763// ServiceRestoreFuture an abstraction for monitoring and retrieving the results of a long-running 9764// operation. 9765type ServiceRestoreFuture struct { 9766 azure.Future 9767} 9768 9769// Result returns the result of the asynchronous operation. 9770// If the operation has not completed it will return an error. 9771func (future *ServiceRestoreFuture) Result(client ServiceClient) (sr ServiceResource, err error) { 9772 var done bool 9773 done, err = future.DoneWithContext(context.Background(), client) 9774 if err != nil { 9775 err = autorest.NewErrorWithError(err, "apimanagement.ServiceRestoreFuture", "Result", future.Response(), "Polling failure") 9776 return 9777 } 9778 if !done { 9779 err = azure.NewAsyncOpIncompleteError("apimanagement.ServiceRestoreFuture") 9780 return 9781 } 9782 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 9783 if sr.Response.Response, err = future.GetResult(sender); err == nil && sr.Response.Response.StatusCode != http.StatusNoContent { 9784 sr, err = client.RestoreResponder(sr.Response.Response) 9785 if err != nil { 9786 err = autorest.NewErrorWithError(err, "apimanagement.ServiceRestoreFuture", "Result", sr.Response.Response, "Failure responding to request") 9787 } 9788 } 9789 return 9790} 9791 9792// ServiceSkuProperties API Management service resource SKU properties. 9793type ServiceSkuProperties struct { 9794 // Name - Name of the Sku. Possible values include: 'SkuTypeDeveloper', 'SkuTypeStandard', 'SkuTypePremium', 'SkuTypeBasic', 'SkuTypeConsumption' 9795 Name SkuType `json:"name,omitempty"` 9796 // Capacity - Capacity of the SKU (number of deployed units of the SKU). The default value is 1. 9797 Capacity *int32 `json:"capacity,omitempty"` 9798} 9799 9800// ServiceUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 9801// operation. 9802type ServiceUpdateFuture struct { 9803 azure.Future 9804} 9805 9806// Result returns the result of the asynchronous operation. 9807// If the operation has not completed it will return an error. 9808func (future *ServiceUpdateFuture) Result(client ServiceClient) (sr ServiceResource, err error) { 9809 var done bool 9810 done, err = future.DoneWithContext(context.Background(), client) 9811 if err != nil { 9812 err = autorest.NewErrorWithError(err, "apimanagement.ServiceUpdateFuture", "Result", future.Response(), "Polling failure") 9813 return 9814 } 9815 if !done { 9816 err = azure.NewAsyncOpIncompleteError("apimanagement.ServiceUpdateFuture") 9817 return 9818 } 9819 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 9820 if sr.Response.Response, err = future.GetResult(sender); err == nil && sr.Response.Response.StatusCode != http.StatusNoContent { 9821 sr, err = client.UpdateResponder(sr.Response.Response) 9822 if err != nil { 9823 err = autorest.NewErrorWithError(err, "apimanagement.ServiceUpdateFuture", "Result", sr.Response.Response, "Failure responding to request") 9824 } 9825 } 9826 return 9827} 9828 9829// ServiceUpdateHostnameFuture an abstraction for monitoring and retrieving the results of a long-running 9830// operation. 9831type ServiceUpdateHostnameFuture struct { 9832 azure.Future 9833} 9834 9835// Result returns the result of the asynchronous operation. 9836// If the operation has not completed it will return an error. 9837func (future *ServiceUpdateHostnameFuture) Result(client ServiceClient) (sr ServiceResource, err error) { 9838 var done bool 9839 done, err = future.DoneWithContext(context.Background(), client) 9840 if err != nil { 9841 err = autorest.NewErrorWithError(err, "apimanagement.ServiceUpdateHostnameFuture", "Result", future.Response(), "Polling failure") 9842 return 9843 } 9844 if !done { 9845 err = azure.NewAsyncOpIncompleteError("apimanagement.ServiceUpdateHostnameFuture") 9846 return 9847 } 9848 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 9849 if sr.Response.Response, err = future.GetResult(sender); err == nil && sr.Response.Response.StatusCode != http.StatusNoContent { 9850 sr, err = client.UpdateHostnameResponder(sr.Response.Response) 9851 if err != nil { 9852 err = autorest.NewErrorWithError(err, "apimanagement.ServiceUpdateHostnameFuture", "Result", sr.Response.Response, "Failure responding to request") 9853 } 9854 } 9855 return 9856} 9857 9858// ServiceUpdateHostnameParameters parameters supplied to the UpdateHostname operation. 9859type ServiceUpdateHostnameParameters struct { 9860 // Update - Hostnames to create or update. 9861 Update *[]HostnameConfigurationOld `json:"update,omitempty"` 9862 // Delete - Hostnames types to delete. 9863 Delete *[]HostnameType `json:"delete,omitempty"` 9864} 9865 9866// ServiceUpdateParameters parameter supplied to Update Api Management Service. 9867type ServiceUpdateParameters struct { 9868 // ServiceUpdateProperties - Properties of the API Management service. 9869 *ServiceUpdateProperties `json:"properties,omitempty"` 9870 // Sku - SKU properties of the API Management service. 9871 Sku *ServiceSkuProperties `json:"sku,omitempty"` 9872 // Identity - Managed service identity of the Api Management service. 9873 Identity *ServiceIdentity `json:"identity,omitempty"` 9874 // Etag - READ-ONLY; ETag of the resource. 9875 Etag *string `json:"etag,omitempty"` 9876 // ID - READ-ONLY; Resource ID. 9877 ID *string `json:"id,omitempty"` 9878 // Name - READ-ONLY; Resource name. 9879 Name *string `json:"name,omitempty"` 9880 // Type - READ-ONLY; Resource type for API Management resource is set to Microsoft.ApiManagement. 9881 Type *string `json:"type,omitempty"` 9882 // Tags - Resource tags. 9883 Tags map[string]*string `json:"tags"` 9884} 9885 9886// MarshalJSON is the custom marshaler for ServiceUpdateParameters. 9887func (sup ServiceUpdateParameters) MarshalJSON() ([]byte, error) { 9888 objectMap := make(map[string]interface{}) 9889 if sup.ServiceUpdateProperties != nil { 9890 objectMap["properties"] = sup.ServiceUpdateProperties 9891 } 9892 if sup.Sku != nil { 9893 objectMap["sku"] = sup.Sku 9894 } 9895 if sup.Identity != nil { 9896 objectMap["identity"] = sup.Identity 9897 } 9898 if sup.Tags != nil { 9899 objectMap["tags"] = sup.Tags 9900 } 9901 return json.Marshal(objectMap) 9902} 9903 9904// UnmarshalJSON is the custom unmarshaler for ServiceUpdateParameters struct. 9905func (sup *ServiceUpdateParameters) UnmarshalJSON(body []byte) error { 9906 var m map[string]*json.RawMessage 9907 err := json.Unmarshal(body, &m) 9908 if err != nil { 9909 return err 9910 } 9911 for k, v := range m { 9912 switch k { 9913 case "properties": 9914 if v != nil { 9915 var serviceUpdateProperties ServiceUpdateProperties 9916 err = json.Unmarshal(*v, &serviceUpdateProperties) 9917 if err != nil { 9918 return err 9919 } 9920 sup.ServiceUpdateProperties = &serviceUpdateProperties 9921 } 9922 case "sku": 9923 if v != nil { 9924 var sku ServiceSkuProperties 9925 err = json.Unmarshal(*v, &sku) 9926 if err != nil { 9927 return err 9928 } 9929 sup.Sku = &sku 9930 } 9931 case "identity": 9932 if v != nil { 9933 var identity ServiceIdentity 9934 err = json.Unmarshal(*v, &identity) 9935 if err != nil { 9936 return err 9937 } 9938 sup.Identity = &identity 9939 } 9940 case "etag": 9941 if v != nil { 9942 var etag string 9943 err = json.Unmarshal(*v, &etag) 9944 if err != nil { 9945 return err 9946 } 9947 sup.Etag = &etag 9948 } 9949 case "id": 9950 if v != nil { 9951 var ID string 9952 err = json.Unmarshal(*v, &ID) 9953 if err != nil { 9954 return err 9955 } 9956 sup.ID = &ID 9957 } 9958 case "name": 9959 if v != nil { 9960 var name string 9961 err = json.Unmarshal(*v, &name) 9962 if err != nil { 9963 return err 9964 } 9965 sup.Name = &name 9966 } 9967 case "type": 9968 if v != nil { 9969 var typeVar string 9970 err = json.Unmarshal(*v, &typeVar) 9971 if err != nil { 9972 return err 9973 } 9974 sup.Type = &typeVar 9975 } 9976 case "tags": 9977 if v != nil { 9978 var tags map[string]*string 9979 err = json.Unmarshal(*v, &tags) 9980 if err != nil { 9981 return err 9982 } 9983 sup.Tags = tags 9984 } 9985 } 9986 } 9987 9988 return nil 9989} 9990 9991// ServiceUpdateProperties properties of an API Management service resource description. 9992type ServiceUpdateProperties struct { 9993 // PublisherEmail - Publisher email. 9994 PublisherEmail *string `json:"publisherEmail,omitempty"` 9995 // PublisherName - Publisher name. 9996 PublisherName *string `json:"publisherName,omitempty"` 9997 // NotificationSenderEmail - Email address from which the notification will be sent. 9998 NotificationSenderEmail *string `json:"notificationSenderEmail,omitempty"` 9999 // 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. 10000 ProvisioningState *string `json:"provisioningState,omitempty"` 10001 // TargetProvisioningState - READ-ONLY; The provisioning state of the API Management service, which is targeted by the long running operation started on the service. 10002 TargetProvisioningState *string `json:"targetProvisioningState,omitempty"` 10003 // 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. 10004 CreatedAtUtc *date.Time `json:"createdAtUtc,omitempty"` 10005 // GatewayURL - READ-ONLY; Gateway URL of the API Management service. 10006 GatewayURL *string `json:"gatewayUrl,omitempty"` 10007 // GatewayRegionalURL - READ-ONLY; Gateway URL of the API Management service in the Default Region. 10008 GatewayRegionalURL *string `json:"gatewayRegionalUrl,omitempty"` 10009 // PortalURL - READ-ONLY; Publisher portal endpoint Url of the API Management service. 10010 PortalURL *string `json:"portalUrl,omitempty"` 10011 // ManagementAPIURL - READ-ONLY; Management API endpoint URL of the API Management service. 10012 ManagementAPIURL *string `json:"managementApiUrl,omitempty"` 10013 // ScmURL - READ-ONLY; SCM endpoint URL of the API Management service. 10014 ScmURL *string `json:"scmUrl,omitempty"` 10015 // HostnameConfigurations - Custom hostname configuration of the API Management service. 10016 HostnameConfigurations *[]HostnameConfiguration `json:"hostnameConfigurations,omitempty"` 10017 // PublicIPAddresses - READ-ONLY; Public Static Load Balanced IP addresses of the API Management service in Primary region. Available only for Basic, Standard and Premium SKU. 10018 PublicIPAddresses *[]string `json:"publicIPAddresses,omitempty"` 10019 // PrivateIPAddresses - READ-ONLY; Private Static Load Balanced IP addresses of the API Management service in Primary region which is deployed in an Internal Virtual Network. Available only for Basic, Standard and Premium SKU. 10020 PrivateIPAddresses *[]string `json:"privateIPAddresses,omitempty"` 10021 // VirtualNetworkConfiguration - Virtual network configuration of the API Management service. 10022 VirtualNetworkConfiguration *VirtualNetworkConfiguration `json:"virtualNetworkConfiguration,omitempty"` 10023 // AdditionalLocations - Additional datacenter locations of the API Management service. 10024 AdditionalLocations *[]AdditionalLocation `json:"additionalLocations,omitempty"` 10025 // CustomProperties - Custom properties of the API Management service. Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TripleDes168` will disable the cipher TLS_RSA_WITH_3DES_EDE_CBC_SHA for all TLS(1.0, 1.1 and 1.2). Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls11` can be used to disable just TLS 1.1 and setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls10` can be used to disable TLS 1.0 on an API Management service. 10026 CustomProperties map[string]*string `json:"customProperties"` 10027 // Certificates - List of Certificates that need to be installed in the API Management service. Max supported certificates that can be installed is 10. 10028 Certificates *[]CertificateConfiguration `json:"certificates,omitempty"` 10029 // VirtualNetworkType - The type of VPN in which API Management service needs to be configured in. None (Default Value) means the API Management service is not part of any Virtual Network, External means the API Management deployment is set up inside a Virtual Network having an Internet Facing Endpoint, and Internal means that API Management deployment is setup inside a Virtual Network having an Intranet Facing Endpoint only. Possible values include: 'VirtualNetworkTypeNone', 'VirtualNetworkTypeExternal', 'VirtualNetworkTypeInternal' 10030 VirtualNetworkType VirtualNetworkType `json:"virtualNetworkType,omitempty"` 10031} 10032 10033// MarshalJSON is the custom marshaler for ServiceUpdateProperties. 10034func (sup ServiceUpdateProperties) MarshalJSON() ([]byte, error) { 10035 objectMap := make(map[string]interface{}) 10036 if sup.PublisherEmail != nil { 10037 objectMap["publisherEmail"] = sup.PublisherEmail 10038 } 10039 if sup.PublisherName != nil { 10040 objectMap["publisherName"] = sup.PublisherName 10041 } 10042 if sup.NotificationSenderEmail != nil { 10043 objectMap["notificationSenderEmail"] = sup.NotificationSenderEmail 10044 } 10045 if sup.HostnameConfigurations != nil { 10046 objectMap["hostnameConfigurations"] = sup.HostnameConfigurations 10047 } 10048 if sup.VirtualNetworkConfiguration != nil { 10049 objectMap["virtualNetworkConfiguration"] = sup.VirtualNetworkConfiguration 10050 } 10051 if sup.AdditionalLocations != nil { 10052 objectMap["additionalLocations"] = sup.AdditionalLocations 10053 } 10054 if sup.CustomProperties != nil { 10055 objectMap["customProperties"] = sup.CustomProperties 10056 } 10057 if sup.Certificates != nil { 10058 objectMap["certificates"] = sup.Certificates 10059 } 10060 if sup.VirtualNetworkType != "" { 10061 objectMap["virtualNetworkType"] = sup.VirtualNetworkType 10062 } 10063 return json.Marshal(objectMap) 10064} 10065 10066// ServiceUploadCertificateParameters parameters supplied to the Upload SSL certificate for an API 10067// Management service operation. 10068type ServiceUploadCertificateParameters struct { 10069 // Type - Hostname type. Possible values include: 'Proxy', 'Portal', 'Management', 'Scm' 10070 Type HostnameType `json:"type,omitempty"` 10071 // Certificate - Base64 Encoded certificate. 10072 Certificate *string `json:"certificate,omitempty"` 10073 // CertificatePassword - Certificate password. 10074 CertificatePassword *string `json:"certificate_password,omitempty"` 10075} 10076 10077// SubscriptionCollection paged Subscriptions list representation. 10078type SubscriptionCollection struct { 10079 autorest.Response `json:"-"` 10080 // Value - Page values. 10081 Value *[]SubscriptionContract `json:"value,omitempty"` 10082 // NextLink - Next page link if any. 10083 NextLink *string `json:"nextLink,omitempty"` 10084} 10085 10086// SubscriptionCollectionIterator provides access to a complete listing of SubscriptionContract values. 10087type SubscriptionCollectionIterator struct { 10088 i int 10089 page SubscriptionCollectionPage 10090} 10091 10092// NextWithContext advances to the next value. If there was an error making 10093// the request the iterator does not advance and the error is returned. 10094func (iter *SubscriptionCollectionIterator) NextWithContext(ctx context.Context) (err error) { 10095 if tracing.IsEnabled() { 10096 ctx = tracing.StartSpan(ctx, fqdn+"/SubscriptionCollectionIterator.NextWithContext") 10097 defer func() { 10098 sc := -1 10099 if iter.Response().Response.Response != nil { 10100 sc = iter.Response().Response.Response.StatusCode 10101 } 10102 tracing.EndSpan(ctx, sc, err) 10103 }() 10104 } 10105 iter.i++ 10106 if iter.i < len(iter.page.Values()) { 10107 return nil 10108 } 10109 err = iter.page.NextWithContext(ctx) 10110 if err != nil { 10111 iter.i-- 10112 return err 10113 } 10114 iter.i = 0 10115 return nil 10116} 10117 10118// Next advances to the next value. If there was an error making 10119// the request the iterator does not advance and the error is returned. 10120// Deprecated: Use NextWithContext() instead. 10121func (iter *SubscriptionCollectionIterator) Next() error { 10122 return iter.NextWithContext(context.Background()) 10123} 10124 10125// NotDone returns true if the enumeration should be started or is not yet complete. 10126func (iter SubscriptionCollectionIterator) NotDone() bool { 10127 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 10128} 10129 10130// Response returns the raw server response from the last page request. 10131func (iter SubscriptionCollectionIterator) Response() SubscriptionCollection { 10132 return iter.page.Response() 10133} 10134 10135// Value returns the current value or a zero-initialized value if the 10136// iterator has advanced beyond the end of the collection. 10137func (iter SubscriptionCollectionIterator) Value() SubscriptionContract { 10138 if !iter.page.NotDone() { 10139 return SubscriptionContract{} 10140 } 10141 return iter.page.Values()[iter.i] 10142} 10143 10144// Creates a new instance of the SubscriptionCollectionIterator type. 10145func NewSubscriptionCollectionIterator(page SubscriptionCollectionPage) SubscriptionCollectionIterator { 10146 return SubscriptionCollectionIterator{page: page} 10147} 10148 10149// IsEmpty returns true if the ListResult contains no values. 10150func (sc SubscriptionCollection) IsEmpty() bool { 10151 return sc.Value == nil || len(*sc.Value) == 0 10152} 10153 10154// subscriptionCollectionPreparer prepares a request to retrieve the next set of results. 10155// It returns nil if no more results exist. 10156func (sc SubscriptionCollection) subscriptionCollectionPreparer(ctx context.Context) (*http.Request, error) { 10157 if sc.NextLink == nil || len(to.String(sc.NextLink)) < 1 { 10158 return nil, nil 10159 } 10160 return autorest.Prepare((&http.Request{}).WithContext(ctx), 10161 autorest.AsJSON(), 10162 autorest.AsGet(), 10163 autorest.WithBaseURL(to.String(sc.NextLink))) 10164} 10165 10166// SubscriptionCollectionPage contains a page of SubscriptionContract values. 10167type SubscriptionCollectionPage struct { 10168 fn func(context.Context, SubscriptionCollection) (SubscriptionCollection, error) 10169 sc SubscriptionCollection 10170} 10171 10172// NextWithContext advances to the next page of values. If there was an error making 10173// the request the page does not advance and the error is returned. 10174func (page *SubscriptionCollectionPage) NextWithContext(ctx context.Context) (err error) { 10175 if tracing.IsEnabled() { 10176 ctx = tracing.StartSpan(ctx, fqdn+"/SubscriptionCollectionPage.NextWithContext") 10177 defer func() { 10178 sc := -1 10179 if page.Response().Response.Response != nil { 10180 sc = page.Response().Response.Response.StatusCode 10181 } 10182 tracing.EndSpan(ctx, sc, err) 10183 }() 10184 } 10185 next, err := page.fn(ctx, page.sc) 10186 if err != nil { 10187 return err 10188 } 10189 page.sc = next 10190 return nil 10191} 10192 10193// Next advances to the next page of values. If there was an error making 10194// the request the page does not advance and the error is returned. 10195// Deprecated: Use NextWithContext() instead. 10196func (page *SubscriptionCollectionPage) Next() error { 10197 return page.NextWithContext(context.Background()) 10198} 10199 10200// NotDone returns true if the page enumeration should be started or is not yet complete. 10201func (page SubscriptionCollectionPage) NotDone() bool { 10202 return !page.sc.IsEmpty() 10203} 10204 10205// Response returns the raw server response from the last page request. 10206func (page SubscriptionCollectionPage) Response() SubscriptionCollection { 10207 return page.sc 10208} 10209 10210// Values returns the slice of values for the current page or nil if there are no values. 10211func (page SubscriptionCollectionPage) Values() []SubscriptionContract { 10212 if page.sc.IsEmpty() { 10213 return nil 10214 } 10215 return *page.sc.Value 10216} 10217 10218// Creates a new instance of the SubscriptionCollectionPage type. 10219func NewSubscriptionCollectionPage(getNextPage func(context.Context, SubscriptionCollection) (SubscriptionCollection, error)) SubscriptionCollectionPage { 10220 return SubscriptionCollectionPage{fn: getNextPage} 10221} 10222 10223// SubscriptionContract subscription details. 10224type SubscriptionContract struct { 10225 autorest.Response `json:"-"` 10226 // SubscriptionContractProperties - Subscription contract properties. 10227 *SubscriptionContractProperties `json:"properties,omitempty"` 10228 // ID - READ-ONLY; Resource ID. 10229 ID *string `json:"id,omitempty"` 10230 // Name - READ-ONLY; Resource name. 10231 Name *string `json:"name,omitempty"` 10232 // Type - READ-ONLY; Resource type for API Management resource. 10233 Type *string `json:"type,omitempty"` 10234} 10235 10236// MarshalJSON is the custom marshaler for SubscriptionContract. 10237func (sc SubscriptionContract) MarshalJSON() ([]byte, error) { 10238 objectMap := make(map[string]interface{}) 10239 if sc.SubscriptionContractProperties != nil { 10240 objectMap["properties"] = sc.SubscriptionContractProperties 10241 } 10242 return json.Marshal(objectMap) 10243} 10244 10245// UnmarshalJSON is the custom unmarshaler for SubscriptionContract struct. 10246func (sc *SubscriptionContract) UnmarshalJSON(body []byte) error { 10247 var m map[string]*json.RawMessage 10248 err := json.Unmarshal(body, &m) 10249 if err != nil { 10250 return err 10251 } 10252 for k, v := range m { 10253 switch k { 10254 case "properties": 10255 if v != nil { 10256 var subscriptionContractProperties SubscriptionContractProperties 10257 err = json.Unmarshal(*v, &subscriptionContractProperties) 10258 if err != nil { 10259 return err 10260 } 10261 sc.SubscriptionContractProperties = &subscriptionContractProperties 10262 } 10263 case "id": 10264 if v != nil { 10265 var ID string 10266 err = json.Unmarshal(*v, &ID) 10267 if err != nil { 10268 return err 10269 } 10270 sc.ID = &ID 10271 } 10272 case "name": 10273 if v != nil { 10274 var name string 10275 err = json.Unmarshal(*v, &name) 10276 if err != nil { 10277 return err 10278 } 10279 sc.Name = &name 10280 } 10281 case "type": 10282 if v != nil { 10283 var typeVar string 10284 err = json.Unmarshal(*v, &typeVar) 10285 if err != nil { 10286 return err 10287 } 10288 sc.Type = &typeVar 10289 } 10290 } 10291 } 10292 10293 return nil 10294} 10295 10296// SubscriptionContractProperties subscription details. 10297type SubscriptionContractProperties struct { 10298 // OwnerID - The user resource identifier of the subscription owner. The value is a valid relative URL in the format of /users/{userId} where {userId} is a user identifier. 10299 OwnerID *string `json:"ownerId,omitempty"` 10300 // Scope - Scope like /products/{productId} or /apis or /apis/{apiId}. 10301 Scope *string `json:"scope,omitempty"` 10302 // DisplayName - The name of the subscription, or null if the subscription has no name. 10303 DisplayName *string `json:"displayName,omitempty"` 10304 // 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' 10305 State SubscriptionState `json:"state,omitempty"` 10306 // 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. 10307 CreatedDate *date.Time `json:"createdDate,omitempty"` 10308 // StartDate - Subscription activation date. The setting is for audit purposes only and the subscription is not automatically activated. The subscription lifecycle can be managed by using the `state` property. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. 10309 StartDate *date.Time `json:"startDate,omitempty"` 10310 // ExpirationDate - Subscription expiration date. The setting is for audit purposes only and the subscription is not automatically expired. The subscription lifecycle can be managed by using the `state` property. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. 10311 ExpirationDate *date.Time `json:"expirationDate,omitempty"` 10312 // EndDate - Date when subscription was cancelled or expired. The setting is for audit purposes only and the subscription is not automatically cancelled. The subscription lifecycle can be managed by using the `state` property. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. 10313 EndDate *date.Time `json:"endDate,omitempty"` 10314 // 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. 10315 NotificationDate *date.Time `json:"notificationDate,omitempty"` 10316 // PrimaryKey - Subscription primary key. 10317 PrimaryKey *string `json:"primaryKey,omitempty"` 10318 // SecondaryKey - Subscription secondary key. 10319 SecondaryKey *string `json:"secondaryKey,omitempty"` 10320 // StateComment - Optional subscription comment added by an administrator. 10321 StateComment *string `json:"stateComment,omitempty"` 10322 // AllowTracing - Determines whether tracing is enabled 10323 AllowTracing *bool `json:"allowTracing,omitempty"` 10324} 10325 10326// SubscriptionCreateParameterProperties parameters supplied to the Create subscription operation. 10327type SubscriptionCreateParameterProperties struct { 10328 // OwnerID - User (user id path) for whom subscription is being created in form /users/{userId} 10329 OwnerID *string `json:"ownerId,omitempty"` 10330 // Scope - Scope like /products/{productId} or /apis or /apis/{apiId}. 10331 Scope *string `json:"scope,omitempty"` 10332 // DisplayName - Subscription name. 10333 DisplayName *string `json:"displayName,omitempty"` 10334 // PrimaryKey - Primary subscription key. If not specified during request key will be generated automatically. 10335 PrimaryKey *string `json:"primaryKey,omitempty"` 10336 // SecondaryKey - Secondary subscription key. If not specified during request key will be generated automatically. 10337 SecondaryKey *string `json:"secondaryKey,omitempty"` 10338 // 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' 10339 State SubscriptionState `json:"state,omitempty"` 10340 // AllowTracing - Determines whether tracing can be enabled 10341 AllowTracing *bool `json:"allowTracing,omitempty"` 10342} 10343 10344// SubscriptionCreateParameters subscription create details. 10345type SubscriptionCreateParameters struct { 10346 // SubscriptionCreateParameterProperties - Subscription contract properties. 10347 *SubscriptionCreateParameterProperties `json:"properties,omitempty"` 10348} 10349 10350// MarshalJSON is the custom marshaler for SubscriptionCreateParameters. 10351func (scp SubscriptionCreateParameters) MarshalJSON() ([]byte, error) { 10352 objectMap := make(map[string]interface{}) 10353 if scp.SubscriptionCreateParameterProperties != nil { 10354 objectMap["properties"] = scp.SubscriptionCreateParameterProperties 10355 } 10356 return json.Marshal(objectMap) 10357} 10358 10359// UnmarshalJSON is the custom unmarshaler for SubscriptionCreateParameters struct. 10360func (scp *SubscriptionCreateParameters) UnmarshalJSON(body []byte) error { 10361 var m map[string]*json.RawMessage 10362 err := json.Unmarshal(body, &m) 10363 if err != nil { 10364 return err 10365 } 10366 for k, v := range m { 10367 switch k { 10368 case "properties": 10369 if v != nil { 10370 var subscriptionCreateParameterProperties SubscriptionCreateParameterProperties 10371 err = json.Unmarshal(*v, &subscriptionCreateParameterProperties) 10372 if err != nil { 10373 return err 10374 } 10375 scp.SubscriptionCreateParameterProperties = &subscriptionCreateParameterProperties 10376 } 10377 } 10378 } 10379 10380 return nil 10381} 10382 10383// SubscriptionKeyParameterNamesContract subscription key parameter names details. 10384type SubscriptionKeyParameterNamesContract struct { 10385 // Header - Subscription key header name. 10386 Header *string `json:"header,omitempty"` 10387 // Query - Subscription key query string parameter name. 10388 Query *string `json:"query,omitempty"` 10389} 10390 10391// SubscriptionsDelegationSettingsProperties subscriptions delegation settings properties. 10392type SubscriptionsDelegationSettingsProperties struct { 10393 // Enabled - Enable or disable delegation for subscriptions. 10394 Enabled *bool `json:"enabled,omitempty"` 10395} 10396 10397// SubscriptionUpdateParameterProperties parameters supplied to the Update subscription operation. 10398type SubscriptionUpdateParameterProperties struct { 10399 // OwnerID - User identifier path: /users/{userId} 10400 OwnerID *string `json:"ownerId,omitempty"` 10401 // Scope - Scope like /products/{productId} or /apis or /apis/{apiId} 10402 Scope *string `json:"scope,omitempty"` 10403 // ExpirationDate - Subscription expiration date. The setting is for audit purposes only and the subscription is not automatically expired. The subscription lifecycle can be managed by using the `state` property. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. 10404 ExpirationDate *date.Time `json:"expirationDate,omitempty"` 10405 // DisplayName - Subscription name. 10406 DisplayName *string `json:"displayName,omitempty"` 10407 // PrimaryKey - Primary subscription key. 10408 PrimaryKey *string `json:"primaryKey,omitempty"` 10409 // SecondaryKey - Secondary subscription key. 10410 SecondaryKey *string `json:"secondaryKey,omitempty"` 10411 // 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' 10412 State SubscriptionState `json:"state,omitempty"` 10413 // StateComment - Comments describing subscription state change by the administrator. 10414 StateComment *string `json:"stateComment,omitempty"` 10415 // AllowTracing - Determines whether tracing can be enabled 10416 AllowTracing *bool `json:"allowTracing,omitempty"` 10417} 10418 10419// SubscriptionUpdateParameters subscription update details. 10420type SubscriptionUpdateParameters struct { 10421 // SubscriptionUpdateParameterProperties - Subscription Update contract properties. 10422 *SubscriptionUpdateParameterProperties `json:"properties,omitempty"` 10423} 10424 10425// MarshalJSON is the custom marshaler for SubscriptionUpdateParameters. 10426func (sup SubscriptionUpdateParameters) MarshalJSON() ([]byte, error) { 10427 objectMap := make(map[string]interface{}) 10428 if sup.SubscriptionUpdateParameterProperties != nil { 10429 objectMap["properties"] = sup.SubscriptionUpdateParameterProperties 10430 } 10431 return json.Marshal(objectMap) 10432} 10433 10434// UnmarshalJSON is the custom unmarshaler for SubscriptionUpdateParameters struct. 10435func (sup *SubscriptionUpdateParameters) UnmarshalJSON(body []byte) error { 10436 var m map[string]*json.RawMessage 10437 err := json.Unmarshal(body, &m) 10438 if err != nil { 10439 return err 10440 } 10441 for k, v := range m { 10442 switch k { 10443 case "properties": 10444 if v != nil { 10445 var subscriptionUpdateParameterProperties SubscriptionUpdateParameterProperties 10446 err = json.Unmarshal(*v, &subscriptionUpdateParameterProperties) 10447 if err != nil { 10448 return err 10449 } 10450 sup.SubscriptionUpdateParameterProperties = &subscriptionUpdateParameterProperties 10451 } 10452 } 10453 } 10454 10455 return nil 10456} 10457 10458// TagCollection paged Tag list representation. 10459type TagCollection struct { 10460 autorest.Response `json:"-"` 10461 // Value - Page values. 10462 Value *[]TagContract `json:"value,omitempty"` 10463 // NextLink - Next page link if any. 10464 NextLink *string `json:"nextLink,omitempty"` 10465} 10466 10467// TagCollectionIterator provides access to a complete listing of TagContract values. 10468type TagCollectionIterator struct { 10469 i int 10470 page TagCollectionPage 10471} 10472 10473// NextWithContext advances to the next value. If there was an error making 10474// the request the iterator does not advance and the error is returned. 10475func (iter *TagCollectionIterator) NextWithContext(ctx context.Context) (err error) { 10476 if tracing.IsEnabled() { 10477 ctx = tracing.StartSpan(ctx, fqdn+"/TagCollectionIterator.NextWithContext") 10478 defer func() { 10479 sc := -1 10480 if iter.Response().Response.Response != nil { 10481 sc = iter.Response().Response.Response.StatusCode 10482 } 10483 tracing.EndSpan(ctx, sc, err) 10484 }() 10485 } 10486 iter.i++ 10487 if iter.i < len(iter.page.Values()) { 10488 return nil 10489 } 10490 err = iter.page.NextWithContext(ctx) 10491 if err != nil { 10492 iter.i-- 10493 return err 10494 } 10495 iter.i = 0 10496 return nil 10497} 10498 10499// Next advances to the next value. If there was an error making 10500// the request the iterator does not advance and the error is returned. 10501// Deprecated: Use NextWithContext() instead. 10502func (iter *TagCollectionIterator) Next() error { 10503 return iter.NextWithContext(context.Background()) 10504} 10505 10506// NotDone returns true if the enumeration should be started or is not yet complete. 10507func (iter TagCollectionIterator) NotDone() bool { 10508 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 10509} 10510 10511// Response returns the raw server response from the last page request. 10512func (iter TagCollectionIterator) Response() TagCollection { 10513 return iter.page.Response() 10514} 10515 10516// Value returns the current value or a zero-initialized value if the 10517// iterator has advanced beyond the end of the collection. 10518func (iter TagCollectionIterator) Value() TagContract { 10519 if !iter.page.NotDone() { 10520 return TagContract{} 10521 } 10522 return iter.page.Values()[iter.i] 10523} 10524 10525// Creates a new instance of the TagCollectionIterator type. 10526func NewTagCollectionIterator(page TagCollectionPage) TagCollectionIterator { 10527 return TagCollectionIterator{page: page} 10528} 10529 10530// IsEmpty returns true if the ListResult contains no values. 10531func (tc TagCollection) IsEmpty() bool { 10532 return tc.Value == nil || len(*tc.Value) == 0 10533} 10534 10535// tagCollectionPreparer prepares a request to retrieve the next set of results. 10536// It returns nil if no more results exist. 10537func (tc TagCollection) tagCollectionPreparer(ctx context.Context) (*http.Request, error) { 10538 if tc.NextLink == nil || len(to.String(tc.NextLink)) < 1 { 10539 return nil, nil 10540 } 10541 return autorest.Prepare((&http.Request{}).WithContext(ctx), 10542 autorest.AsJSON(), 10543 autorest.AsGet(), 10544 autorest.WithBaseURL(to.String(tc.NextLink))) 10545} 10546 10547// TagCollectionPage contains a page of TagContract values. 10548type TagCollectionPage struct { 10549 fn func(context.Context, TagCollection) (TagCollection, error) 10550 tc TagCollection 10551} 10552 10553// NextWithContext advances to the next page of values. If there was an error making 10554// the request the page does not advance and the error is returned. 10555func (page *TagCollectionPage) NextWithContext(ctx context.Context) (err error) { 10556 if tracing.IsEnabled() { 10557 ctx = tracing.StartSpan(ctx, fqdn+"/TagCollectionPage.NextWithContext") 10558 defer func() { 10559 sc := -1 10560 if page.Response().Response.Response != nil { 10561 sc = page.Response().Response.Response.StatusCode 10562 } 10563 tracing.EndSpan(ctx, sc, err) 10564 }() 10565 } 10566 next, err := page.fn(ctx, page.tc) 10567 if err != nil { 10568 return err 10569 } 10570 page.tc = next 10571 return nil 10572} 10573 10574// Next advances to the next page of values. If there was an error making 10575// the request the page does not advance and the error is returned. 10576// Deprecated: Use NextWithContext() instead. 10577func (page *TagCollectionPage) Next() error { 10578 return page.NextWithContext(context.Background()) 10579} 10580 10581// NotDone returns true if the page enumeration should be started or is not yet complete. 10582func (page TagCollectionPage) NotDone() bool { 10583 return !page.tc.IsEmpty() 10584} 10585 10586// Response returns the raw server response from the last page request. 10587func (page TagCollectionPage) Response() TagCollection { 10588 return page.tc 10589} 10590 10591// Values returns the slice of values for the current page or nil if there are no values. 10592func (page TagCollectionPage) Values() []TagContract { 10593 if page.tc.IsEmpty() { 10594 return nil 10595 } 10596 return *page.tc.Value 10597} 10598 10599// Creates a new instance of the TagCollectionPage type. 10600func NewTagCollectionPage(getNextPage func(context.Context, TagCollection) (TagCollection, error)) TagCollectionPage { 10601 return TagCollectionPage{fn: getNextPage} 10602} 10603 10604// TagContract tag Contract details. 10605type TagContract struct { 10606 autorest.Response `json:"-"` 10607 // TagContractProperties - Tag entity contract properties. 10608 *TagContractProperties `json:"properties,omitempty"` 10609 // ID - READ-ONLY; Resource ID. 10610 ID *string `json:"id,omitempty"` 10611 // Name - READ-ONLY; Resource name. 10612 Name *string `json:"name,omitempty"` 10613 // Type - READ-ONLY; Resource type for API Management resource. 10614 Type *string `json:"type,omitempty"` 10615} 10616 10617// MarshalJSON is the custom marshaler for TagContract. 10618func (tc TagContract) MarshalJSON() ([]byte, error) { 10619 objectMap := make(map[string]interface{}) 10620 if tc.TagContractProperties != nil { 10621 objectMap["properties"] = tc.TagContractProperties 10622 } 10623 return json.Marshal(objectMap) 10624} 10625 10626// UnmarshalJSON is the custom unmarshaler for TagContract struct. 10627func (tc *TagContract) UnmarshalJSON(body []byte) error { 10628 var m map[string]*json.RawMessage 10629 err := json.Unmarshal(body, &m) 10630 if err != nil { 10631 return err 10632 } 10633 for k, v := range m { 10634 switch k { 10635 case "properties": 10636 if v != nil { 10637 var tagContractProperties TagContractProperties 10638 err = json.Unmarshal(*v, &tagContractProperties) 10639 if err != nil { 10640 return err 10641 } 10642 tc.TagContractProperties = &tagContractProperties 10643 } 10644 case "id": 10645 if v != nil { 10646 var ID string 10647 err = json.Unmarshal(*v, &ID) 10648 if err != nil { 10649 return err 10650 } 10651 tc.ID = &ID 10652 } 10653 case "name": 10654 if v != nil { 10655 var name string 10656 err = json.Unmarshal(*v, &name) 10657 if err != nil { 10658 return err 10659 } 10660 tc.Name = &name 10661 } 10662 case "type": 10663 if v != nil { 10664 var typeVar string 10665 err = json.Unmarshal(*v, &typeVar) 10666 if err != nil { 10667 return err 10668 } 10669 tc.Type = &typeVar 10670 } 10671 } 10672 } 10673 10674 return nil 10675} 10676 10677// TagContractProperties tag contract Properties. 10678type TagContractProperties struct { 10679 // DisplayName - Tag name. 10680 DisplayName *string `json:"displayName,omitempty"` 10681} 10682 10683// TagCreateUpdateParameters parameters supplied to Create/Update Tag operations. 10684type TagCreateUpdateParameters struct { 10685 // TagContractProperties - Properties supplied to Create Tag operation. 10686 *TagContractProperties `json:"properties,omitempty"` 10687} 10688 10689// MarshalJSON is the custom marshaler for TagCreateUpdateParameters. 10690func (tcup TagCreateUpdateParameters) MarshalJSON() ([]byte, error) { 10691 objectMap := make(map[string]interface{}) 10692 if tcup.TagContractProperties != nil { 10693 objectMap["properties"] = tcup.TagContractProperties 10694 } 10695 return json.Marshal(objectMap) 10696} 10697 10698// UnmarshalJSON is the custom unmarshaler for TagCreateUpdateParameters struct. 10699func (tcup *TagCreateUpdateParameters) UnmarshalJSON(body []byte) error { 10700 var m map[string]*json.RawMessage 10701 err := json.Unmarshal(body, &m) 10702 if err != nil { 10703 return err 10704 } 10705 for k, v := range m { 10706 switch k { 10707 case "properties": 10708 if v != nil { 10709 var tagContractProperties TagContractProperties 10710 err = json.Unmarshal(*v, &tagContractProperties) 10711 if err != nil { 10712 return err 10713 } 10714 tcup.TagContractProperties = &tagContractProperties 10715 } 10716 } 10717 } 10718 10719 return nil 10720} 10721 10722// TagDescriptionBaseProperties parameters supplied to the Create TagDescription operation. 10723type TagDescriptionBaseProperties struct { 10724 // Description - Description of the Tag. 10725 Description *string `json:"description,omitempty"` 10726 // ExternalDocsURL - Absolute URL of external resources describing the tag. 10727 ExternalDocsURL *string `json:"externalDocsUrl,omitempty"` 10728 // ExternalDocsDescription - Description of the external resources describing the tag. 10729 ExternalDocsDescription *string `json:"externalDocsDescription,omitempty"` 10730} 10731 10732// TagDescriptionCollection paged TagDescription list representation. 10733type TagDescriptionCollection struct { 10734 autorest.Response `json:"-"` 10735 // Value - Page values. 10736 Value *[]TagDescriptionContract `json:"value,omitempty"` 10737 // NextLink - Next page link if any. 10738 NextLink *string `json:"nextLink,omitempty"` 10739} 10740 10741// TagDescriptionCollectionIterator provides access to a complete listing of TagDescriptionContract values. 10742type TagDescriptionCollectionIterator struct { 10743 i int 10744 page TagDescriptionCollectionPage 10745} 10746 10747// NextWithContext advances to the next value. If there was an error making 10748// the request the iterator does not advance and the error is returned. 10749func (iter *TagDescriptionCollectionIterator) NextWithContext(ctx context.Context) (err error) { 10750 if tracing.IsEnabled() { 10751 ctx = tracing.StartSpan(ctx, fqdn+"/TagDescriptionCollectionIterator.NextWithContext") 10752 defer func() { 10753 sc := -1 10754 if iter.Response().Response.Response != nil { 10755 sc = iter.Response().Response.Response.StatusCode 10756 } 10757 tracing.EndSpan(ctx, sc, err) 10758 }() 10759 } 10760 iter.i++ 10761 if iter.i < len(iter.page.Values()) { 10762 return nil 10763 } 10764 err = iter.page.NextWithContext(ctx) 10765 if err != nil { 10766 iter.i-- 10767 return err 10768 } 10769 iter.i = 0 10770 return nil 10771} 10772 10773// Next advances to the next value. If there was an error making 10774// the request the iterator does not advance and the error is returned. 10775// Deprecated: Use NextWithContext() instead. 10776func (iter *TagDescriptionCollectionIterator) Next() error { 10777 return iter.NextWithContext(context.Background()) 10778} 10779 10780// NotDone returns true if the enumeration should be started or is not yet complete. 10781func (iter TagDescriptionCollectionIterator) NotDone() bool { 10782 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 10783} 10784 10785// Response returns the raw server response from the last page request. 10786func (iter TagDescriptionCollectionIterator) Response() TagDescriptionCollection { 10787 return iter.page.Response() 10788} 10789 10790// Value returns the current value or a zero-initialized value if the 10791// iterator has advanced beyond the end of the collection. 10792func (iter TagDescriptionCollectionIterator) Value() TagDescriptionContract { 10793 if !iter.page.NotDone() { 10794 return TagDescriptionContract{} 10795 } 10796 return iter.page.Values()[iter.i] 10797} 10798 10799// Creates a new instance of the TagDescriptionCollectionIterator type. 10800func NewTagDescriptionCollectionIterator(page TagDescriptionCollectionPage) TagDescriptionCollectionIterator { 10801 return TagDescriptionCollectionIterator{page: page} 10802} 10803 10804// IsEmpty returns true if the ListResult contains no values. 10805func (tdc TagDescriptionCollection) IsEmpty() bool { 10806 return tdc.Value == nil || len(*tdc.Value) == 0 10807} 10808 10809// tagDescriptionCollectionPreparer prepares a request to retrieve the next set of results. 10810// It returns nil if no more results exist. 10811func (tdc TagDescriptionCollection) tagDescriptionCollectionPreparer(ctx context.Context) (*http.Request, error) { 10812 if tdc.NextLink == nil || len(to.String(tdc.NextLink)) < 1 { 10813 return nil, nil 10814 } 10815 return autorest.Prepare((&http.Request{}).WithContext(ctx), 10816 autorest.AsJSON(), 10817 autorest.AsGet(), 10818 autorest.WithBaseURL(to.String(tdc.NextLink))) 10819} 10820 10821// TagDescriptionCollectionPage contains a page of TagDescriptionContract values. 10822type TagDescriptionCollectionPage struct { 10823 fn func(context.Context, TagDescriptionCollection) (TagDescriptionCollection, error) 10824 tdc TagDescriptionCollection 10825} 10826 10827// NextWithContext advances to the next page of values. If there was an error making 10828// the request the page does not advance and the error is returned. 10829func (page *TagDescriptionCollectionPage) NextWithContext(ctx context.Context) (err error) { 10830 if tracing.IsEnabled() { 10831 ctx = tracing.StartSpan(ctx, fqdn+"/TagDescriptionCollectionPage.NextWithContext") 10832 defer func() { 10833 sc := -1 10834 if page.Response().Response.Response != nil { 10835 sc = page.Response().Response.Response.StatusCode 10836 } 10837 tracing.EndSpan(ctx, sc, err) 10838 }() 10839 } 10840 next, err := page.fn(ctx, page.tdc) 10841 if err != nil { 10842 return err 10843 } 10844 page.tdc = next 10845 return nil 10846} 10847 10848// Next advances to the next page of values. If there was an error making 10849// the request the page does not advance and the error is returned. 10850// Deprecated: Use NextWithContext() instead. 10851func (page *TagDescriptionCollectionPage) Next() error { 10852 return page.NextWithContext(context.Background()) 10853} 10854 10855// NotDone returns true if the page enumeration should be started or is not yet complete. 10856func (page TagDescriptionCollectionPage) NotDone() bool { 10857 return !page.tdc.IsEmpty() 10858} 10859 10860// Response returns the raw server response from the last page request. 10861func (page TagDescriptionCollectionPage) Response() TagDescriptionCollection { 10862 return page.tdc 10863} 10864 10865// Values returns the slice of values for the current page or nil if there are no values. 10866func (page TagDescriptionCollectionPage) Values() []TagDescriptionContract { 10867 if page.tdc.IsEmpty() { 10868 return nil 10869 } 10870 return *page.tdc.Value 10871} 10872 10873// Creates a new instance of the TagDescriptionCollectionPage type. 10874func NewTagDescriptionCollectionPage(getNextPage func(context.Context, TagDescriptionCollection) (TagDescriptionCollection, error)) TagDescriptionCollectionPage { 10875 return TagDescriptionCollectionPage{fn: getNextPage} 10876} 10877 10878// TagDescriptionContract contract details. 10879type TagDescriptionContract struct { 10880 autorest.Response `json:"-"` 10881 // TagDescriptionContractProperties - TagDescription entity contract properties. 10882 *TagDescriptionContractProperties `json:"properties,omitempty"` 10883 // ID - READ-ONLY; Resource ID. 10884 ID *string `json:"id,omitempty"` 10885 // Name - READ-ONLY; Resource name. 10886 Name *string `json:"name,omitempty"` 10887 // Type - READ-ONLY; Resource type for API Management resource. 10888 Type *string `json:"type,omitempty"` 10889} 10890 10891// MarshalJSON is the custom marshaler for TagDescriptionContract. 10892func (tdc TagDescriptionContract) MarshalJSON() ([]byte, error) { 10893 objectMap := make(map[string]interface{}) 10894 if tdc.TagDescriptionContractProperties != nil { 10895 objectMap["properties"] = tdc.TagDescriptionContractProperties 10896 } 10897 return json.Marshal(objectMap) 10898} 10899 10900// UnmarshalJSON is the custom unmarshaler for TagDescriptionContract struct. 10901func (tdc *TagDescriptionContract) UnmarshalJSON(body []byte) error { 10902 var m map[string]*json.RawMessage 10903 err := json.Unmarshal(body, &m) 10904 if err != nil { 10905 return err 10906 } 10907 for k, v := range m { 10908 switch k { 10909 case "properties": 10910 if v != nil { 10911 var tagDescriptionContractProperties TagDescriptionContractProperties 10912 err = json.Unmarshal(*v, &tagDescriptionContractProperties) 10913 if err != nil { 10914 return err 10915 } 10916 tdc.TagDescriptionContractProperties = &tagDescriptionContractProperties 10917 } 10918 case "id": 10919 if v != nil { 10920 var ID string 10921 err = json.Unmarshal(*v, &ID) 10922 if err != nil { 10923 return err 10924 } 10925 tdc.ID = &ID 10926 } 10927 case "name": 10928 if v != nil { 10929 var name string 10930 err = json.Unmarshal(*v, &name) 10931 if err != nil { 10932 return err 10933 } 10934 tdc.Name = &name 10935 } 10936 case "type": 10937 if v != nil { 10938 var typeVar string 10939 err = json.Unmarshal(*v, &typeVar) 10940 if err != nil { 10941 return err 10942 } 10943 tdc.Type = &typeVar 10944 } 10945 } 10946 } 10947 10948 return nil 10949} 10950 10951// TagDescriptionContractProperties tagDescription contract Properties. 10952type TagDescriptionContractProperties struct { 10953 // DisplayName - Tag name. 10954 DisplayName *string `json:"displayName,omitempty"` 10955 // Description - Description of the Tag. 10956 Description *string `json:"description,omitempty"` 10957 // ExternalDocsURL - Absolute URL of external resources describing the tag. 10958 ExternalDocsURL *string `json:"externalDocsUrl,omitempty"` 10959 // ExternalDocsDescription - Description of the external resources describing the tag. 10960 ExternalDocsDescription *string `json:"externalDocsDescription,omitempty"` 10961} 10962 10963// TagDescriptionCreateParameters parameters supplied to the Create TagDescription operation. 10964type TagDescriptionCreateParameters struct { 10965 // TagDescriptionBaseProperties - Properties supplied to Create TagDescription operation. 10966 *TagDescriptionBaseProperties `json:"properties,omitempty"` 10967} 10968 10969// MarshalJSON is the custom marshaler for TagDescriptionCreateParameters. 10970func (tdcp TagDescriptionCreateParameters) MarshalJSON() ([]byte, error) { 10971 objectMap := make(map[string]interface{}) 10972 if tdcp.TagDescriptionBaseProperties != nil { 10973 objectMap["properties"] = tdcp.TagDescriptionBaseProperties 10974 } 10975 return json.Marshal(objectMap) 10976} 10977 10978// UnmarshalJSON is the custom unmarshaler for TagDescriptionCreateParameters struct. 10979func (tdcp *TagDescriptionCreateParameters) UnmarshalJSON(body []byte) error { 10980 var m map[string]*json.RawMessage 10981 err := json.Unmarshal(body, &m) 10982 if err != nil { 10983 return err 10984 } 10985 for k, v := range m { 10986 switch k { 10987 case "properties": 10988 if v != nil { 10989 var tagDescriptionBaseProperties TagDescriptionBaseProperties 10990 err = json.Unmarshal(*v, &tagDescriptionBaseProperties) 10991 if err != nil { 10992 return err 10993 } 10994 tdcp.TagDescriptionBaseProperties = &tagDescriptionBaseProperties 10995 } 10996 } 10997 } 10998 10999 return nil 11000} 11001 11002// TagResourceCollection paged Tag list representation. 11003type TagResourceCollection struct { 11004 autorest.Response `json:"-"` 11005 // Value - Page values. 11006 Value *[]TagResourceContract `json:"value,omitempty"` 11007 // NextLink - Next page link if any. 11008 NextLink *string `json:"nextLink,omitempty"` 11009} 11010 11011// TagResourceCollectionIterator provides access to a complete listing of TagResourceContract values. 11012type TagResourceCollectionIterator struct { 11013 i int 11014 page TagResourceCollectionPage 11015} 11016 11017// NextWithContext advances to the next value. If there was an error making 11018// the request the iterator does not advance and the error is returned. 11019func (iter *TagResourceCollectionIterator) NextWithContext(ctx context.Context) (err error) { 11020 if tracing.IsEnabled() { 11021 ctx = tracing.StartSpan(ctx, fqdn+"/TagResourceCollectionIterator.NextWithContext") 11022 defer func() { 11023 sc := -1 11024 if iter.Response().Response.Response != nil { 11025 sc = iter.Response().Response.Response.StatusCode 11026 } 11027 tracing.EndSpan(ctx, sc, err) 11028 }() 11029 } 11030 iter.i++ 11031 if iter.i < len(iter.page.Values()) { 11032 return nil 11033 } 11034 err = iter.page.NextWithContext(ctx) 11035 if err != nil { 11036 iter.i-- 11037 return err 11038 } 11039 iter.i = 0 11040 return nil 11041} 11042 11043// Next advances to the next value. If there was an error making 11044// the request the iterator does not advance and the error is returned. 11045// Deprecated: Use NextWithContext() instead. 11046func (iter *TagResourceCollectionIterator) Next() error { 11047 return iter.NextWithContext(context.Background()) 11048} 11049 11050// NotDone returns true if the enumeration should be started or is not yet complete. 11051func (iter TagResourceCollectionIterator) NotDone() bool { 11052 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 11053} 11054 11055// Response returns the raw server response from the last page request. 11056func (iter TagResourceCollectionIterator) Response() TagResourceCollection { 11057 return iter.page.Response() 11058} 11059 11060// Value returns the current value or a zero-initialized value if the 11061// iterator has advanced beyond the end of the collection. 11062func (iter TagResourceCollectionIterator) Value() TagResourceContract { 11063 if !iter.page.NotDone() { 11064 return TagResourceContract{} 11065 } 11066 return iter.page.Values()[iter.i] 11067} 11068 11069// Creates a new instance of the TagResourceCollectionIterator type. 11070func NewTagResourceCollectionIterator(page TagResourceCollectionPage) TagResourceCollectionIterator { 11071 return TagResourceCollectionIterator{page: page} 11072} 11073 11074// IsEmpty returns true if the ListResult contains no values. 11075func (trc TagResourceCollection) IsEmpty() bool { 11076 return trc.Value == nil || len(*trc.Value) == 0 11077} 11078 11079// tagResourceCollectionPreparer prepares a request to retrieve the next set of results. 11080// It returns nil if no more results exist. 11081func (trc TagResourceCollection) tagResourceCollectionPreparer(ctx context.Context) (*http.Request, error) { 11082 if trc.NextLink == nil || len(to.String(trc.NextLink)) < 1 { 11083 return nil, nil 11084 } 11085 return autorest.Prepare((&http.Request{}).WithContext(ctx), 11086 autorest.AsJSON(), 11087 autorest.AsGet(), 11088 autorest.WithBaseURL(to.String(trc.NextLink))) 11089} 11090 11091// TagResourceCollectionPage contains a page of TagResourceContract values. 11092type TagResourceCollectionPage struct { 11093 fn func(context.Context, TagResourceCollection) (TagResourceCollection, error) 11094 trc TagResourceCollection 11095} 11096 11097// NextWithContext advances to the next page of values. If there was an error making 11098// the request the page does not advance and the error is returned. 11099func (page *TagResourceCollectionPage) NextWithContext(ctx context.Context) (err error) { 11100 if tracing.IsEnabled() { 11101 ctx = tracing.StartSpan(ctx, fqdn+"/TagResourceCollectionPage.NextWithContext") 11102 defer func() { 11103 sc := -1 11104 if page.Response().Response.Response != nil { 11105 sc = page.Response().Response.Response.StatusCode 11106 } 11107 tracing.EndSpan(ctx, sc, err) 11108 }() 11109 } 11110 next, err := page.fn(ctx, page.trc) 11111 if err != nil { 11112 return err 11113 } 11114 page.trc = next 11115 return nil 11116} 11117 11118// Next advances to the next page of values. If there was an error making 11119// the request the page does not advance and the error is returned. 11120// Deprecated: Use NextWithContext() instead. 11121func (page *TagResourceCollectionPage) Next() error { 11122 return page.NextWithContext(context.Background()) 11123} 11124 11125// NotDone returns true if the page enumeration should be started or is not yet complete. 11126func (page TagResourceCollectionPage) NotDone() bool { 11127 return !page.trc.IsEmpty() 11128} 11129 11130// Response returns the raw server response from the last page request. 11131func (page TagResourceCollectionPage) Response() TagResourceCollection { 11132 return page.trc 11133} 11134 11135// Values returns the slice of values for the current page or nil if there are no values. 11136func (page TagResourceCollectionPage) Values() []TagResourceContract { 11137 if page.trc.IsEmpty() { 11138 return nil 11139 } 11140 return *page.trc.Value 11141} 11142 11143// Creates a new instance of the TagResourceCollectionPage type. 11144func NewTagResourceCollectionPage(getNextPage func(context.Context, TagResourceCollection) (TagResourceCollection, error)) TagResourceCollectionPage { 11145 return TagResourceCollectionPage{fn: getNextPage} 11146} 11147 11148// TagResourceContract tagResource contract properties. 11149type TagResourceContract struct { 11150 // Tag - Tag associated with the resource. 11151 Tag *TagTagResourceContractProperties `json:"tag,omitempty"` 11152 // API - Api associated with the tag. 11153 API *APITagResourceContractProperties `json:"api,omitempty"` 11154 // Operation - Operation associated with the tag. 11155 Operation *OperationTagResourceContractProperties `json:"operation,omitempty"` 11156 // Product - Product associated with the tag. 11157 Product *ProductTagResourceContractProperties `json:"product,omitempty"` 11158} 11159 11160// TagTagResourceContractProperties contract defining the Tag property in the Tag Resource Contract 11161type TagTagResourceContractProperties struct { 11162 // ID - Tag identifier 11163 ID *string `json:"id,omitempty"` 11164 // Name - Tag Name 11165 Name *string `json:"name,omitempty"` 11166} 11167 11168// TenantConfigurationDeployFuture an abstraction for monitoring and retrieving the results of a 11169// long-running operation. 11170type TenantConfigurationDeployFuture struct { 11171 azure.Future 11172} 11173 11174// Result returns the result of the asynchronous operation. 11175// If the operation has not completed it will return an error. 11176func (future *TenantConfigurationDeployFuture) Result(client TenantConfigurationClient) (orc OperationResultContract, err error) { 11177 var done bool 11178 done, err = future.DoneWithContext(context.Background(), client) 11179 if err != nil { 11180 err = autorest.NewErrorWithError(err, "apimanagement.TenantConfigurationDeployFuture", "Result", future.Response(), "Polling failure") 11181 return 11182 } 11183 if !done { 11184 err = azure.NewAsyncOpIncompleteError("apimanagement.TenantConfigurationDeployFuture") 11185 return 11186 } 11187 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 11188 if orc.Response.Response, err = future.GetResult(sender); err == nil && orc.Response.Response.StatusCode != http.StatusNoContent { 11189 orc, err = client.DeployResponder(orc.Response.Response) 11190 if err != nil { 11191 err = autorest.NewErrorWithError(err, "apimanagement.TenantConfigurationDeployFuture", "Result", orc.Response.Response, "Failure responding to request") 11192 } 11193 } 11194 return 11195} 11196 11197// TenantConfigurationSaveFuture an abstraction for monitoring and retrieving the results of a long-running 11198// operation. 11199type TenantConfigurationSaveFuture struct { 11200 azure.Future 11201} 11202 11203// Result returns the result of the asynchronous operation. 11204// If the operation has not completed it will return an error. 11205func (future *TenantConfigurationSaveFuture) Result(client TenantConfigurationClient) (orc OperationResultContract, err error) { 11206 var done bool 11207 done, err = future.DoneWithContext(context.Background(), client) 11208 if err != nil { 11209 err = autorest.NewErrorWithError(err, "apimanagement.TenantConfigurationSaveFuture", "Result", future.Response(), "Polling failure") 11210 return 11211 } 11212 if !done { 11213 err = azure.NewAsyncOpIncompleteError("apimanagement.TenantConfigurationSaveFuture") 11214 return 11215 } 11216 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 11217 if orc.Response.Response, err = future.GetResult(sender); err == nil && orc.Response.Response.StatusCode != http.StatusNoContent { 11218 orc, err = client.SaveResponder(orc.Response.Response) 11219 if err != nil { 11220 err = autorest.NewErrorWithError(err, "apimanagement.TenantConfigurationSaveFuture", "Result", orc.Response.Response, "Failure responding to request") 11221 } 11222 } 11223 return 11224} 11225 11226// TenantConfigurationSyncStateContract tenant Configuration Synchronization State. 11227type TenantConfigurationSyncStateContract struct { 11228 autorest.Response `json:"-"` 11229 // Branch - The name of Git branch. 11230 Branch *string `json:"branch,omitempty"` 11231 // CommitID - The latest commit Id. 11232 CommitID *string `json:"commitId,omitempty"` 11233 // IsExport - value indicating if last sync was save (true) or deploy (false) operation. 11234 IsExport *bool `json:"isExport,omitempty"` 11235 // IsSynced - value indicating if last synchronization was later than the configuration change. 11236 IsSynced *bool `json:"isSynced,omitempty"` 11237 // IsGitEnabled - value indicating whether Git configuration access is enabled. 11238 IsGitEnabled *bool `json:"isGitEnabled,omitempty"` 11239 // 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. 11240 SyncDate *date.Time `json:"syncDate,omitempty"` 11241 // 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. 11242 ConfigurationChangeDate *date.Time `json:"configurationChangeDate,omitempty"` 11243} 11244 11245// TenantConfigurationValidateFuture an abstraction for monitoring and retrieving the results of a 11246// long-running operation. 11247type TenantConfigurationValidateFuture struct { 11248 azure.Future 11249} 11250 11251// Result returns the result of the asynchronous operation. 11252// If the operation has not completed it will return an error. 11253func (future *TenantConfigurationValidateFuture) Result(client TenantConfigurationClient) (orc OperationResultContract, err error) { 11254 var done bool 11255 done, err = future.DoneWithContext(context.Background(), client) 11256 if err != nil { 11257 err = autorest.NewErrorWithError(err, "apimanagement.TenantConfigurationValidateFuture", "Result", future.Response(), "Polling failure") 11258 return 11259 } 11260 if !done { 11261 err = azure.NewAsyncOpIncompleteError("apimanagement.TenantConfigurationValidateFuture") 11262 return 11263 } 11264 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 11265 if orc.Response.Response, err = future.GetResult(sender); err == nil && orc.Response.Response.StatusCode != http.StatusNoContent { 11266 orc, err = client.ValidateResponder(orc.Response.Response) 11267 if err != nil { 11268 err = autorest.NewErrorWithError(err, "apimanagement.TenantConfigurationValidateFuture", "Result", orc.Response.Response, "Failure responding to request") 11269 } 11270 } 11271 return 11272} 11273 11274// TermsOfServiceProperties terms of service contract properties. 11275type TermsOfServiceProperties struct { 11276 // Text - A terms of service text. 11277 Text *string `json:"text,omitempty"` 11278 // Enabled - Display terms of service during a sign-up process. 11279 Enabled *bool `json:"enabled,omitempty"` 11280 // ConsentRequired - Ask user for consent to the terms of service. 11281 ConsentRequired *bool `json:"consentRequired,omitempty"` 11282} 11283 11284// TokenBodyParameterContract oAuth acquire token request body parameter (www-url-form-encoded). 11285type TokenBodyParameterContract struct { 11286 // Name - body parameter name. 11287 Name *string `json:"name,omitempty"` 11288 // Value - body parameter value. 11289 Value *string `json:"value,omitempty"` 11290} 11291 11292// UserCollection paged Users list representation. 11293type UserCollection struct { 11294 autorest.Response `json:"-"` 11295 // Value - Page values. 11296 Value *[]UserContract `json:"value,omitempty"` 11297 // NextLink - Next page link if any. 11298 NextLink *string `json:"nextLink,omitempty"` 11299} 11300 11301// UserCollectionIterator provides access to a complete listing of UserContract values. 11302type UserCollectionIterator struct { 11303 i int 11304 page UserCollectionPage 11305} 11306 11307// NextWithContext advances to the next value. If there was an error making 11308// the request the iterator does not advance and the error is returned. 11309func (iter *UserCollectionIterator) NextWithContext(ctx context.Context) (err error) { 11310 if tracing.IsEnabled() { 11311 ctx = tracing.StartSpan(ctx, fqdn+"/UserCollectionIterator.NextWithContext") 11312 defer func() { 11313 sc := -1 11314 if iter.Response().Response.Response != nil { 11315 sc = iter.Response().Response.Response.StatusCode 11316 } 11317 tracing.EndSpan(ctx, sc, err) 11318 }() 11319 } 11320 iter.i++ 11321 if iter.i < len(iter.page.Values()) { 11322 return nil 11323 } 11324 err = iter.page.NextWithContext(ctx) 11325 if err != nil { 11326 iter.i-- 11327 return err 11328 } 11329 iter.i = 0 11330 return nil 11331} 11332 11333// Next advances to the next value. If there was an error making 11334// the request the iterator does not advance and the error is returned. 11335// Deprecated: Use NextWithContext() instead. 11336func (iter *UserCollectionIterator) Next() error { 11337 return iter.NextWithContext(context.Background()) 11338} 11339 11340// NotDone returns true if the enumeration should be started or is not yet complete. 11341func (iter UserCollectionIterator) NotDone() bool { 11342 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 11343} 11344 11345// Response returns the raw server response from the last page request. 11346func (iter UserCollectionIterator) Response() UserCollection { 11347 return iter.page.Response() 11348} 11349 11350// Value returns the current value or a zero-initialized value if the 11351// iterator has advanced beyond the end of the collection. 11352func (iter UserCollectionIterator) Value() UserContract { 11353 if !iter.page.NotDone() { 11354 return UserContract{} 11355 } 11356 return iter.page.Values()[iter.i] 11357} 11358 11359// Creates a new instance of the UserCollectionIterator type. 11360func NewUserCollectionIterator(page UserCollectionPage) UserCollectionIterator { 11361 return UserCollectionIterator{page: page} 11362} 11363 11364// IsEmpty returns true if the ListResult contains no values. 11365func (uc UserCollection) IsEmpty() bool { 11366 return uc.Value == nil || len(*uc.Value) == 0 11367} 11368 11369// userCollectionPreparer prepares a request to retrieve the next set of results. 11370// It returns nil if no more results exist. 11371func (uc UserCollection) userCollectionPreparer(ctx context.Context) (*http.Request, error) { 11372 if uc.NextLink == nil || len(to.String(uc.NextLink)) < 1 { 11373 return nil, nil 11374 } 11375 return autorest.Prepare((&http.Request{}).WithContext(ctx), 11376 autorest.AsJSON(), 11377 autorest.AsGet(), 11378 autorest.WithBaseURL(to.String(uc.NextLink))) 11379} 11380 11381// UserCollectionPage contains a page of UserContract values. 11382type UserCollectionPage struct { 11383 fn func(context.Context, UserCollection) (UserCollection, error) 11384 uc UserCollection 11385} 11386 11387// NextWithContext advances to the next page of values. If there was an error making 11388// the request the page does not advance and the error is returned. 11389func (page *UserCollectionPage) NextWithContext(ctx context.Context) (err error) { 11390 if tracing.IsEnabled() { 11391 ctx = tracing.StartSpan(ctx, fqdn+"/UserCollectionPage.NextWithContext") 11392 defer func() { 11393 sc := -1 11394 if page.Response().Response.Response != nil { 11395 sc = page.Response().Response.Response.StatusCode 11396 } 11397 tracing.EndSpan(ctx, sc, err) 11398 }() 11399 } 11400 next, err := page.fn(ctx, page.uc) 11401 if err != nil { 11402 return err 11403 } 11404 page.uc = next 11405 return nil 11406} 11407 11408// Next advances to the next page of values. If there was an error making 11409// the request the page does not advance and the error is returned. 11410// Deprecated: Use NextWithContext() instead. 11411func (page *UserCollectionPage) Next() error { 11412 return page.NextWithContext(context.Background()) 11413} 11414 11415// NotDone returns true if the page enumeration should be started or is not yet complete. 11416func (page UserCollectionPage) NotDone() bool { 11417 return !page.uc.IsEmpty() 11418} 11419 11420// Response returns the raw server response from the last page request. 11421func (page UserCollectionPage) Response() UserCollection { 11422 return page.uc 11423} 11424 11425// Values returns the slice of values for the current page or nil if there are no values. 11426func (page UserCollectionPage) Values() []UserContract { 11427 if page.uc.IsEmpty() { 11428 return nil 11429 } 11430 return *page.uc.Value 11431} 11432 11433// Creates a new instance of the UserCollectionPage type. 11434func NewUserCollectionPage(getNextPage func(context.Context, UserCollection) (UserCollection, error)) UserCollectionPage { 11435 return UserCollectionPage{fn: getNextPage} 11436} 11437 11438// UserContract user details. 11439type UserContract struct { 11440 autorest.Response `json:"-"` 11441 // UserContractProperties - User entity contract properties. 11442 *UserContractProperties `json:"properties,omitempty"` 11443 // ID - READ-ONLY; Resource ID. 11444 ID *string `json:"id,omitempty"` 11445 // Name - READ-ONLY; Resource name. 11446 Name *string `json:"name,omitempty"` 11447 // Type - READ-ONLY; Resource type for API Management resource. 11448 Type *string `json:"type,omitempty"` 11449} 11450 11451// MarshalJSON is the custom marshaler for UserContract. 11452func (uc UserContract) MarshalJSON() ([]byte, error) { 11453 objectMap := make(map[string]interface{}) 11454 if uc.UserContractProperties != nil { 11455 objectMap["properties"] = uc.UserContractProperties 11456 } 11457 return json.Marshal(objectMap) 11458} 11459 11460// UnmarshalJSON is the custom unmarshaler for UserContract struct. 11461func (uc *UserContract) UnmarshalJSON(body []byte) error { 11462 var m map[string]*json.RawMessage 11463 err := json.Unmarshal(body, &m) 11464 if err != nil { 11465 return err 11466 } 11467 for k, v := range m { 11468 switch k { 11469 case "properties": 11470 if v != nil { 11471 var userContractProperties UserContractProperties 11472 err = json.Unmarshal(*v, &userContractProperties) 11473 if err != nil { 11474 return err 11475 } 11476 uc.UserContractProperties = &userContractProperties 11477 } 11478 case "id": 11479 if v != nil { 11480 var ID string 11481 err = json.Unmarshal(*v, &ID) 11482 if err != nil { 11483 return err 11484 } 11485 uc.ID = &ID 11486 } 11487 case "name": 11488 if v != nil { 11489 var name string 11490 err = json.Unmarshal(*v, &name) 11491 if err != nil { 11492 return err 11493 } 11494 uc.Name = &name 11495 } 11496 case "type": 11497 if v != nil { 11498 var typeVar string 11499 err = json.Unmarshal(*v, &typeVar) 11500 if err != nil { 11501 return err 11502 } 11503 uc.Type = &typeVar 11504 } 11505 } 11506 } 11507 11508 return nil 11509} 11510 11511// UserContractProperties user profile. 11512type UserContractProperties struct { 11513 // FirstName - First name. 11514 FirstName *string `json:"firstName,omitempty"` 11515 // LastName - Last name. 11516 LastName *string `json:"lastName,omitempty"` 11517 // Email - Email address. 11518 Email *string `json:"email,omitempty"` 11519 // RegistrationDate - Date of user registration. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. 11520 RegistrationDate *date.Time `json:"registrationDate,omitempty"` 11521 // Groups - READ-ONLY; Collection of groups user is part of. 11522 Groups *[]GroupContractProperties `json:"groups,omitempty"` 11523 // State - Account state. Specifies whether the user is active or not. Blocked users are unable to sign into the developer portal or call any APIs of subscribed products. Default state is Active. Possible values include: 'UserStateActive', 'UserStateBlocked', 'UserStatePending', 'UserStateDeleted' 11524 State UserState `json:"state,omitempty"` 11525 // Note - Optional note about a user set by the administrator. 11526 Note *string `json:"note,omitempty"` 11527 // Identities - Collection of user identities. 11528 Identities *[]UserIdentityContract `json:"identities,omitempty"` 11529} 11530 11531// UserCreateParameterProperties parameters supplied to the Create User operation. 11532type UserCreateParameterProperties struct { 11533 // Email - Email address. Must not be empty and must be unique within the service instance. 11534 Email *string `json:"email,omitempty"` 11535 // FirstName - First name. 11536 FirstName *string `json:"firstName,omitempty"` 11537 // LastName - Last name. 11538 LastName *string `json:"lastName,omitempty"` 11539 // Password - User Password. If no value is provided, a default password is generated. 11540 Password *string `json:"password,omitempty"` 11541 // Confirmation - Determines the type of confirmation e-mail that will be sent to the newly created user. Possible values include: 'Signup', 'Invite' 11542 Confirmation Confirmation `json:"confirmation,omitempty"` 11543 // State - Account state. Specifies whether the user is active or not. Blocked users are unable to sign into the developer portal or call any APIs of subscribed products. Default state is Active. Possible values include: 'UserStateActive', 'UserStateBlocked', 'UserStatePending', 'UserStateDeleted' 11544 State UserState `json:"state,omitempty"` 11545 // Note - Optional note about a user set by the administrator. 11546 Note *string `json:"note,omitempty"` 11547 // Identities - Collection of user identities. 11548 Identities *[]UserIdentityContract `json:"identities,omitempty"` 11549} 11550 11551// UserCreateParameters user create details. 11552type UserCreateParameters struct { 11553 // UserCreateParameterProperties - User entity create contract properties. 11554 *UserCreateParameterProperties `json:"properties,omitempty"` 11555} 11556 11557// MarshalJSON is the custom marshaler for UserCreateParameters. 11558func (ucp UserCreateParameters) MarshalJSON() ([]byte, error) { 11559 objectMap := make(map[string]interface{}) 11560 if ucp.UserCreateParameterProperties != nil { 11561 objectMap["properties"] = ucp.UserCreateParameterProperties 11562 } 11563 return json.Marshal(objectMap) 11564} 11565 11566// UnmarshalJSON is the custom unmarshaler for UserCreateParameters struct. 11567func (ucp *UserCreateParameters) UnmarshalJSON(body []byte) error { 11568 var m map[string]*json.RawMessage 11569 err := json.Unmarshal(body, &m) 11570 if err != nil { 11571 return err 11572 } 11573 for k, v := range m { 11574 switch k { 11575 case "properties": 11576 if v != nil { 11577 var userCreateParameterProperties UserCreateParameterProperties 11578 err = json.Unmarshal(*v, &userCreateParameterProperties) 11579 if err != nil { 11580 return err 11581 } 11582 ucp.UserCreateParameterProperties = &userCreateParameterProperties 11583 } 11584 } 11585 } 11586 11587 return nil 11588} 11589 11590// UserEntityBaseParameters user Entity Base Parameters set. 11591type UserEntityBaseParameters struct { 11592 // State - Account state. Specifies whether the user is active or not. Blocked users are unable to sign into the developer portal or call any APIs of subscribed products. Default state is Active. Possible values include: 'UserStateActive', 'UserStateBlocked', 'UserStatePending', 'UserStateDeleted' 11593 State UserState `json:"state,omitempty"` 11594 // Note - Optional note about a user set by the administrator. 11595 Note *string `json:"note,omitempty"` 11596 // Identities - Collection of user identities. 11597 Identities *[]UserIdentityContract `json:"identities,omitempty"` 11598} 11599 11600// UserIdentityCollection list of Users Identity list representation. 11601type UserIdentityCollection struct { 11602 autorest.Response `json:"-"` 11603 // Value - User Identity values. 11604 Value *[]UserIdentityContract `json:"value,omitempty"` 11605 // Count - Total record count number across all pages. 11606 Count *int64 `json:"count,omitempty"` 11607 // NextLink - Next page link if any. 11608 NextLink *string `json:"nextLink,omitempty"` 11609} 11610 11611// UserIdentityCollectionIterator provides access to a complete listing of UserIdentityContract values. 11612type UserIdentityCollectionIterator struct { 11613 i int 11614 page UserIdentityCollectionPage 11615} 11616 11617// NextWithContext advances to the next value. If there was an error making 11618// the request the iterator does not advance and the error is returned. 11619func (iter *UserIdentityCollectionIterator) NextWithContext(ctx context.Context) (err error) { 11620 if tracing.IsEnabled() { 11621 ctx = tracing.StartSpan(ctx, fqdn+"/UserIdentityCollectionIterator.NextWithContext") 11622 defer func() { 11623 sc := -1 11624 if iter.Response().Response.Response != nil { 11625 sc = iter.Response().Response.Response.StatusCode 11626 } 11627 tracing.EndSpan(ctx, sc, err) 11628 }() 11629 } 11630 iter.i++ 11631 if iter.i < len(iter.page.Values()) { 11632 return nil 11633 } 11634 err = iter.page.NextWithContext(ctx) 11635 if err != nil { 11636 iter.i-- 11637 return err 11638 } 11639 iter.i = 0 11640 return nil 11641} 11642 11643// Next advances to the next value. If there was an error making 11644// the request the iterator does not advance and the error is returned. 11645// Deprecated: Use NextWithContext() instead. 11646func (iter *UserIdentityCollectionIterator) Next() error { 11647 return iter.NextWithContext(context.Background()) 11648} 11649 11650// NotDone returns true if the enumeration should be started or is not yet complete. 11651func (iter UserIdentityCollectionIterator) NotDone() bool { 11652 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 11653} 11654 11655// Response returns the raw server response from the last page request. 11656func (iter UserIdentityCollectionIterator) Response() UserIdentityCollection { 11657 return iter.page.Response() 11658} 11659 11660// Value returns the current value or a zero-initialized value if the 11661// iterator has advanced beyond the end of the collection. 11662func (iter UserIdentityCollectionIterator) Value() UserIdentityContract { 11663 if !iter.page.NotDone() { 11664 return UserIdentityContract{} 11665 } 11666 return iter.page.Values()[iter.i] 11667} 11668 11669// Creates a new instance of the UserIdentityCollectionIterator type. 11670func NewUserIdentityCollectionIterator(page UserIdentityCollectionPage) UserIdentityCollectionIterator { 11671 return UserIdentityCollectionIterator{page: page} 11672} 11673 11674// IsEmpty returns true if the ListResult contains no values. 11675func (uic UserIdentityCollection) IsEmpty() bool { 11676 return uic.Value == nil || len(*uic.Value) == 0 11677} 11678 11679// userIdentityCollectionPreparer prepares a request to retrieve the next set of results. 11680// It returns nil if no more results exist. 11681func (uic UserIdentityCollection) userIdentityCollectionPreparer(ctx context.Context) (*http.Request, error) { 11682 if uic.NextLink == nil || len(to.String(uic.NextLink)) < 1 { 11683 return nil, nil 11684 } 11685 return autorest.Prepare((&http.Request{}).WithContext(ctx), 11686 autorest.AsJSON(), 11687 autorest.AsGet(), 11688 autorest.WithBaseURL(to.String(uic.NextLink))) 11689} 11690 11691// UserIdentityCollectionPage contains a page of UserIdentityContract values. 11692type UserIdentityCollectionPage struct { 11693 fn func(context.Context, UserIdentityCollection) (UserIdentityCollection, error) 11694 uic UserIdentityCollection 11695} 11696 11697// NextWithContext advances to the next page of values. If there was an error making 11698// the request the page does not advance and the error is returned. 11699func (page *UserIdentityCollectionPage) NextWithContext(ctx context.Context) (err error) { 11700 if tracing.IsEnabled() { 11701 ctx = tracing.StartSpan(ctx, fqdn+"/UserIdentityCollectionPage.NextWithContext") 11702 defer func() { 11703 sc := -1 11704 if page.Response().Response.Response != nil { 11705 sc = page.Response().Response.Response.StatusCode 11706 } 11707 tracing.EndSpan(ctx, sc, err) 11708 }() 11709 } 11710 next, err := page.fn(ctx, page.uic) 11711 if err != nil { 11712 return err 11713 } 11714 page.uic = next 11715 return nil 11716} 11717 11718// Next advances to the next page of values. If there was an error making 11719// the request the page does not advance and the error is returned. 11720// Deprecated: Use NextWithContext() instead. 11721func (page *UserIdentityCollectionPage) Next() error { 11722 return page.NextWithContext(context.Background()) 11723} 11724 11725// NotDone returns true if the page enumeration should be started or is not yet complete. 11726func (page UserIdentityCollectionPage) NotDone() bool { 11727 return !page.uic.IsEmpty() 11728} 11729 11730// Response returns the raw server response from the last page request. 11731func (page UserIdentityCollectionPage) Response() UserIdentityCollection { 11732 return page.uic 11733} 11734 11735// Values returns the slice of values for the current page or nil if there are no values. 11736func (page UserIdentityCollectionPage) Values() []UserIdentityContract { 11737 if page.uic.IsEmpty() { 11738 return nil 11739 } 11740 return *page.uic.Value 11741} 11742 11743// Creates a new instance of the UserIdentityCollectionPage type. 11744func NewUserIdentityCollectionPage(getNextPage func(context.Context, UserIdentityCollection) (UserIdentityCollection, error)) UserIdentityCollectionPage { 11745 return UserIdentityCollectionPage{fn: getNextPage} 11746} 11747 11748// UserIdentityContract user identity details. 11749type UserIdentityContract struct { 11750 // Provider - Identity provider name. 11751 Provider *string `json:"provider,omitempty"` 11752 // ID - Identifier value within provider. 11753 ID *string `json:"id,omitempty"` 11754} 11755 11756// UserTokenParameters parameters supplied to the Get User Token operation. 11757type UserTokenParameters struct { 11758 // KeyType - The Key to be used to generate token for user. Possible values include: 'Primary', 'Secondary' 11759 KeyType KeyType `json:"keyType,omitempty"` 11760 // 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. 11761 Expiry *date.Time `json:"expiry,omitempty"` 11762} 11763 11764// UserTokenResult get User Token response details. 11765type UserTokenResult struct { 11766 autorest.Response `json:"-"` 11767 // Value - Shared Access Authorization token for the User. 11768 Value *string `json:"value,omitempty"` 11769} 11770 11771// UserUpdateParameters user update parameters. 11772type UserUpdateParameters struct { 11773 // UserUpdateParametersProperties - User entity update contract properties. 11774 *UserUpdateParametersProperties `json:"properties,omitempty"` 11775} 11776 11777// MarshalJSON is the custom marshaler for UserUpdateParameters. 11778func (uup UserUpdateParameters) MarshalJSON() ([]byte, error) { 11779 objectMap := make(map[string]interface{}) 11780 if uup.UserUpdateParametersProperties != nil { 11781 objectMap["properties"] = uup.UserUpdateParametersProperties 11782 } 11783 return json.Marshal(objectMap) 11784} 11785 11786// UnmarshalJSON is the custom unmarshaler for UserUpdateParameters struct. 11787func (uup *UserUpdateParameters) UnmarshalJSON(body []byte) error { 11788 var m map[string]*json.RawMessage 11789 err := json.Unmarshal(body, &m) 11790 if err != nil { 11791 return err 11792 } 11793 for k, v := range m { 11794 switch k { 11795 case "properties": 11796 if v != nil { 11797 var userUpdateParametersProperties UserUpdateParametersProperties 11798 err = json.Unmarshal(*v, &userUpdateParametersProperties) 11799 if err != nil { 11800 return err 11801 } 11802 uup.UserUpdateParametersProperties = &userUpdateParametersProperties 11803 } 11804 } 11805 } 11806 11807 return nil 11808} 11809 11810// UserUpdateParametersProperties parameters supplied to the Update User operation. 11811type UserUpdateParametersProperties struct { 11812 // Email - Email address. Must not be empty and must be unique within the service instance. 11813 Email *string `json:"email,omitempty"` 11814 // Password - User Password. 11815 Password *string `json:"password,omitempty"` 11816 // FirstName - First name. 11817 FirstName *string `json:"firstName,omitempty"` 11818 // LastName - Last name. 11819 LastName *string `json:"lastName,omitempty"` 11820 // State - Account state. Specifies whether the user is active or not. Blocked users are unable to sign into the developer portal or call any APIs of subscribed products. Default state is Active. Possible values include: 'UserStateActive', 'UserStateBlocked', 'UserStatePending', 'UserStateDeleted' 11821 State UserState `json:"state,omitempty"` 11822 // Note - Optional note about a user set by the administrator. 11823 Note *string `json:"note,omitempty"` 11824 // Identities - Collection of user identities. 11825 Identities *[]UserIdentityContract `json:"identities,omitempty"` 11826} 11827 11828// VirtualNetworkConfiguration configuration of a virtual network to which API Management service is 11829// deployed. 11830type VirtualNetworkConfiguration struct { 11831 // Vnetid - READ-ONLY; The virtual network ID. This is typically a GUID. Expect a null GUID by default. 11832 Vnetid *string `json:"vnetid,omitempty"` 11833 // Subnetname - READ-ONLY; The name of the subnet. 11834 Subnetname *string `json:"subnetname,omitempty"` 11835 // SubnetResourceID - The full resource ID of a subnet in a virtual network to deploy the API Management service in. 11836 SubnetResourceID *string `json:"subnetResourceId,omitempty"` 11837} 11838 11839// X509CertificateName properties of server X509Names. 11840type X509CertificateName struct { 11841 // Name - Common Name of the Certificate. 11842 Name *string `json:"name,omitempty"` 11843 // IssuerCertificateThumbprint - Thumbprint for the Issuer of the Certificate. 11844 IssuerCertificateThumbprint *string `json:"issuerCertificateThumbprint,omitempty"` 11845} 11846