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/apimanagement/mgmt/2019-01-01/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 // ExportFormatOpenapi Export the Api Definition in OpenApi Specification 3.0 to Storage Blob. 236 ExportFormatOpenapi 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{ExportFormatOpenapi, ExportFormatSwagger, ExportFormatWadl, ExportFormatWsdl} 249} 250 251// ExportResultFormat enumerates the values for export result format. 252type ExportResultFormat string 253 254const ( 255 // ExportResultFormatOpenAPI Export the Api Definition in OpenApi Specification 3.0 to Storage Blob. 256 ExportResultFormatOpenAPI ExportResultFormat = "openapi-link" 257 // ExportResultFormatSwagger The Api Definition is exported in OpenApi Specification 2.0 format to the 258 // Storage Blob. 259 ExportResultFormatSwagger ExportResultFormat = "swagger-link-json" 260 // ExportResultFormatWadl Export the Api Definition in WADL Schema to Storage Blob. 261 ExportResultFormatWadl ExportResultFormat = "wadl-link-json" 262 // ExportResultFormatWsdl The Api Definition is exported in WSDL Schema to Storage Blob. This is only 263 // supported for APIs of Type `soap` 264 ExportResultFormatWsdl ExportResultFormat = "wsdl-link+xml" 265) 266 267// PossibleExportResultFormatValues returns an array of possible values for the ExportResultFormat const type. 268func PossibleExportResultFormatValues() []ExportResultFormat { 269 return []ExportResultFormat{ExportResultFormatOpenAPI, ExportResultFormatSwagger, ExportResultFormatWadl, ExportResultFormatWsdl} 270} 271 272// GrantType enumerates the values for grant type. 273type GrantType string 274 275const ( 276 // AuthorizationCode Authorization Code Grant flow as described 277 // https://tools.ietf.org/html/rfc6749#section-4.1. 278 AuthorizationCode GrantType = "authorizationCode" 279 // ClientCredentials Client Credentials Grant flow as described 280 // https://tools.ietf.org/html/rfc6749#section-4.4. 281 ClientCredentials GrantType = "clientCredentials" 282 // Implicit Implicit Code Grant flow as described https://tools.ietf.org/html/rfc6749#section-4.2. 283 Implicit GrantType = "implicit" 284 // ResourceOwnerPassword Resource Owner Password Grant flow as described 285 // https://tools.ietf.org/html/rfc6749#section-4.3. 286 ResourceOwnerPassword GrantType = "resourceOwnerPassword" 287) 288 289// PossibleGrantTypeValues returns an array of possible values for the GrantType const type. 290func PossibleGrantTypeValues() []GrantType { 291 return []GrantType{AuthorizationCode, ClientCredentials, Implicit, ResourceOwnerPassword} 292} 293 294// GroupType enumerates the values for group type. 295type GroupType string 296 297const ( 298 // Custom ... 299 Custom GroupType = "custom" 300 // External ... 301 External GroupType = "external" 302 // System ... 303 System GroupType = "system" 304) 305 306// PossibleGroupTypeValues returns an array of possible values for the GroupType const type. 307func PossibleGroupTypeValues() []GroupType { 308 return []GroupType{Custom, External, System} 309} 310 311// HostnameType enumerates the values for hostname type. 312type HostnameType string 313 314const ( 315 // DeveloperPortal ... 316 DeveloperPortal HostnameType = "DeveloperPortal" 317 // Management ... 318 Management HostnameType = "Management" 319 // Portal ... 320 Portal HostnameType = "Portal" 321 // Proxy ... 322 Proxy HostnameType = "Proxy" 323 // Scm ... 324 Scm HostnameType = "Scm" 325) 326 327// PossibleHostnameTypeValues returns an array of possible values for the HostnameType const type. 328func PossibleHostnameTypeValues() []HostnameType { 329 return []HostnameType{DeveloperPortal, Management, Portal, Proxy, Scm} 330} 331 332// IdentityProviderType enumerates the values for identity provider type. 333type IdentityProviderType string 334 335const ( 336 // Aad Azure Active Directory as Identity provider. 337 Aad IdentityProviderType = "aad" 338 // AadB2C Azure Active Directory B2C as Identity provider. 339 AadB2C IdentityProviderType = "aadB2C" 340 // Facebook Facebook as Identity provider. 341 Facebook IdentityProviderType = "facebook" 342 // Google Google as Identity provider. 343 Google IdentityProviderType = "google" 344 // Microsoft Microsoft Live as Identity provider. 345 Microsoft IdentityProviderType = "microsoft" 346 // Twitter Twitter as Identity provider. 347 Twitter IdentityProviderType = "twitter" 348) 349 350// PossibleIdentityProviderTypeValues returns an array of possible values for the IdentityProviderType const type. 351func PossibleIdentityProviderTypeValues() []IdentityProviderType { 352 return []IdentityProviderType{Aad, AadB2C, Facebook, Google, Microsoft, Twitter} 353} 354 355// KeyType enumerates the values for key type. 356type KeyType string 357 358const ( 359 // Primary ... 360 Primary KeyType = "primary" 361 // Secondary ... 362 Secondary KeyType = "secondary" 363) 364 365// PossibleKeyTypeValues returns an array of possible values for the KeyType const type. 366func PossibleKeyTypeValues() []KeyType { 367 return []KeyType{Primary, Secondary} 368} 369 370// LoggerType enumerates the values for logger type. 371type LoggerType string 372 373const ( 374 // ApplicationInsights Azure Application Insights as log destination. 375 ApplicationInsights LoggerType = "applicationInsights" 376 // AzureEventHub Azure Event Hub as log destination. 377 AzureEventHub LoggerType = "azureEventHub" 378) 379 380// PossibleLoggerTypeValues returns an array of possible values for the LoggerType const type. 381func PossibleLoggerTypeValues() []LoggerType { 382 return []LoggerType{ApplicationInsights, AzureEventHub} 383} 384 385// NameAvailabilityReason enumerates the values for name availability reason. 386type NameAvailabilityReason string 387 388const ( 389 // AlreadyExists ... 390 AlreadyExists NameAvailabilityReason = "AlreadyExists" 391 // Invalid ... 392 Invalid NameAvailabilityReason = "Invalid" 393 // Valid ... 394 Valid NameAvailabilityReason = "Valid" 395) 396 397// PossibleNameAvailabilityReasonValues returns an array of possible values for the NameAvailabilityReason const type. 398func PossibleNameAvailabilityReasonValues() []NameAvailabilityReason { 399 return []NameAvailabilityReason{AlreadyExists, Invalid, Valid} 400} 401 402// NotificationName enumerates the values for notification name. 403type NotificationName string 404 405const ( 406 // AccountClosedPublisher The following email recipients and users will receive email notifications when 407 // developer closes his account. 408 AccountClosedPublisher NotificationName = "AccountClosedPublisher" 409 // BCC The following recipients will receive blind carbon copies of all emails sent to developers. 410 BCC NotificationName = "BCC" 411 // NewApplicationNotificationMessage The following email recipients and users will receive email 412 // notifications when new applications are submitted to the application gallery. 413 NewApplicationNotificationMessage NotificationName = "NewApplicationNotificationMessage" 414 // NewIssuePublisherNotificationMessage The following email recipients and users will receive email 415 // notifications when a new issue or comment is submitted on the developer portal. 416 NewIssuePublisherNotificationMessage NotificationName = "NewIssuePublisherNotificationMessage" 417 // PurchasePublisherNotificationMessage The following email recipients and users will receive email 418 // notifications about new API product subscriptions. 419 PurchasePublisherNotificationMessage NotificationName = "PurchasePublisherNotificationMessage" 420 // QuotaLimitApproachingPublisherNotificationMessage The following email recipients and users will receive 421 // email notifications when subscription usage gets close to usage quota. 422 QuotaLimitApproachingPublisherNotificationMessage NotificationName = "QuotaLimitApproachingPublisherNotificationMessage" 423 // RequestPublisherNotificationMessage The following email recipients and users will receive email 424 // notifications about subscription requests for API products requiring approval. 425 RequestPublisherNotificationMessage NotificationName = "RequestPublisherNotificationMessage" 426) 427 428// PossibleNotificationNameValues returns an array of possible values for the NotificationName const type. 429func PossibleNotificationNameValues() []NotificationName { 430 return []NotificationName{AccountClosedPublisher, BCC, NewApplicationNotificationMessage, NewIssuePublisherNotificationMessage, PurchasePublisherNotificationMessage, QuotaLimitApproachingPublisherNotificationMessage, RequestPublisherNotificationMessage} 431} 432 433// PolicyContentFormat enumerates the values for policy content format. 434type PolicyContentFormat string 435 436const ( 437 // Rawxml The contents are inline and Content type is a non XML encoded policy document. 438 Rawxml PolicyContentFormat = "rawxml" 439 // RawxmlLink The policy document is not Xml encoded and is hosted on a http endpoint accessible from the 440 // API Management service. 441 RawxmlLink PolicyContentFormat = "rawxml-link" 442 // XML The contents are inline and Content type is an XML document. 443 XML PolicyContentFormat = "xml" 444 // XMLLink The policy XML document is hosted on a http endpoint accessible from the API Management service. 445 XMLLink PolicyContentFormat = "xml-link" 446) 447 448// PossiblePolicyContentFormatValues returns an array of possible values for the PolicyContentFormat const type. 449func PossiblePolicyContentFormatValues() []PolicyContentFormat { 450 return []PolicyContentFormat{Rawxml, RawxmlLink, XML, XMLLink} 451} 452 453// PolicyExportFormat enumerates the values for policy export format. 454type PolicyExportFormat string 455 456const ( 457 // PolicyExportFormatRawxml The contents are inline and Content type is a non XML encoded policy document. 458 PolicyExportFormatRawxml PolicyExportFormat = "rawxml" 459 // PolicyExportFormatXML The contents are inline and Content type is an XML document. 460 PolicyExportFormatXML PolicyExportFormat = "xml" 461) 462 463// PossiblePolicyExportFormatValues returns an array of possible values for the PolicyExportFormat const type. 464func PossiblePolicyExportFormatValues() []PolicyExportFormat { 465 return []PolicyExportFormat{PolicyExportFormatRawxml, PolicyExportFormatXML} 466} 467 468// PolicyScopeContract enumerates the values for policy scope contract. 469type PolicyScopeContract string 470 471const ( 472 // PolicyScopeContractAll ... 473 PolicyScopeContractAll PolicyScopeContract = "All" 474 // PolicyScopeContractAPI ... 475 PolicyScopeContractAPI PolicyScopeContract = "Api" 476 // PolicyScopeContractOperation ... 477 PolicyScopeContractOperation PolicyScopeContract = "Operation" 478 // PolicyScopeContractProduct ... 479 PolicyScopeContractProduct PolicyScopeContract = "Product" 480 // PolicyScopeContractTenant ... 481 PolicyScopeContractTenant PolicyScopeContract = "Tenant" 482) 483 484// PossiblePolicyScopeContractValues returns an array of possible values for the PolicyScopeContract const type. 485func PossiblePolicyScopeContractValues() []PolicyScopeContract { 486 return []PolicyScopeContract{PolicyScopeContractAll, PolicyScopeContractAPI, PolicyScopeContractOperation, PolicyScopeContractProduct, PolicyScopeContractTenant} 487} 488 489// ProductState enumerates the values for product state. 490type ProductState string 491 492const ( 493 // NotPublished ... 494 NotPublished ProductState = "notPublished" 495 // Published ... 496 Published ProductState = "published" 497) 498 499// PossibleProductStateValues returns an array of possible values for the ProductState const type. 500func PossibleProductStateValues() []ProductState { 501 return []ProductState{NotPublished, Published} 502} 503 504// Protocol enumerates the values for protocol. 505type Protocol string 506 507const ( 508 // ProtocolHTTP ... 509 ProtocolHTTP Protocol = "http" 510 // ProtocolHTTPS ... 511 ProtocolHTTPS Protocol = "https" 512) 513 514// PossibleProtocolValues returns an array of possible values for the Protocol const type. 515func PossibleProtocolValues() []Protocol { 516 return []Protocol{ProtocolHTTP, ProtocolHTTPS} 517} 518 519// ResourceSkuCapacityScaleType enumerates the values for resource sku capacity scale type. 520type ResourceSkuCapacityScaleType string 521 522const ( 523 // Automatic Supported scale type automatic. 524 Automatic ResourceSkuCapacityScaleType = "automatic" 525 // Manual Supported scale type manual. 526 Manual ResourceSkuCapacityScaleType = "manual" 527 // None Scaling not supported. 528 None ResourceSkuCapacityScaleType = "none" 529) 530 531// PossibleResourceSkuCapacityScaleTypeValues returns an array of possible values for the ResourceSkuCapacityScaleType const type. 532func PossibleResourceSkuCapacityScaleTypeValues() []ResourceSkuCapacityScaleType { 533 return []ResourceSkuCapacityScaleType{Automatic, Manual, None} 534} 535 536// SamplingType enumerates the values for sampling type. 537type SamplingType string 538 539const ( 540 // Fixed Fixed-rate sampling. 541 Fixed SamplingType = "fixed" 542) 543 544// PossibleSamplingTypeValues returns an array of possible values for the SamplingType const type. 545func PossibleSamplingTypeValues() []SamplingType { 546 return []SamplingType{Fixed} 547} 548 549// SkuType enumerates the values for sku type. 550type SkuType string 551 552const ( 553 // SkuTypeBasic Basic SKU of Api Management. 554 SkuTypeBasic SkuType = "Basic" 555 // SkuTypeConsumption Consumption SKU of Api Management. 556 SkuTypeConsumption SkuType = "Consumption" 557 // SkuTypeDeveloper Developer SKU of Api Management. 558 SkuTypeDeveloper SkuType = "Developer" 559 // SkuTypePremium Premium SKU of Api Management. 560 SkuTypePremium SkuType = "Premium" 561 // SkuTypeStandard Standard SKU of Api Management. 562 SkuTypeStandard SkuType = "Standard" 563) 564 565// PossibleSkuTypeValues returns an array of possible values for the SkuType const type. 566func PossibleSkuTypeValues() []SkuType { 567 return []SkuType{SkuTypeBasic, SkuTypeConsumption, SkuTypeDeveloper, SkuTypePremium, SkuTypeStandard} 568} 569 570// SoapAPIType enumerates the values for soap api type. 571type SoapAPIType string 572 573const ( 574 // SoapPassThrough Imports the Soap API having a SOAP front end. 575 SoapPassThrough SoapAPIType = "soap" 576 // SoapToRest Imports a SOAP API having a RESTful front end. 577 SoapToRest SoapAPIType = "http" 578) 579 580// PossibleSoapAPITypeValues returns an array of possible values for the SoapAPIType const type. 581func PossibleSoapAPITypeValues() []SoapAPIType { 582 return []SoapAPIType{SoapPassThrough, SoapToRest} 583} 584 585// State enumerates the values for state. 586type State string 587 588const ( 589 // Closed The issue was closed. 590 Closed State = "closed" 591 // Open The issue is opened. 592 Open State = "open" 593 // Proposed The issue is proposed. 594 Proposed State = "proposed" 595 // Removed The issue was removed. 596 Removed State = "removed" 597 // Resolved The issue is now resolved. 598 Resolved State = "resolved" 599) 600 601// PossibleStateValues returns an array of possible values for the State const type. 602func PossibleStateValues() []State { 603 return []State{Closed, Open, Proposed, Removed, Resolved} 604} 605 606// StoreName enumerates the values for store name. 607type StoreName string 608 609const ( 610 // CertificateAuthority ... 611 CertificateAuthority StoreName = "CertificateAuthority" 612 // Root ... 613 Root StoreName = "Root" 614) 615 616// PossibleStoreNameValues returns an array of possible values for the StoreName const type. 617func PossibleStoreNameValues() []StoreName { 618 return []StoreName{CertificateAuthority, Root} 619} 620 621// SubscriptionState enumerates the values for subscription state. 622type SubscriptionState string 623 624const ( 625 // Active ... 626 Active SubscriptionState = "active" 627 // Cancelled ... 628 Cancelled SubscriptionState = "cancelled" 629 // Expired ... 630 Expired SubscriptionState = "expired" 631 // Rejected ... 632 Rejected SubscriptionState = "rejected" 633 // Submitted ... 634 Submitted SubscriptionState = "submitted" 635 // Suspended ... 636 Suspended SubscriptionState = "suspended" 637) 638 639// PossibleSubscriptionStateValues returns an array of possible values for the SubscriptionState const type. 640func PossibleSubscriptionStateValues() []SubscriptionState { 641 return []SubscriptionState{Active, Cancelled, Expired, Rejected, Submitted, Suspended} 642} 643 644// TemplateName enumerates the values for template name. 645type TemplateName string 646 647const ( 648 // AccountClosedDeveloper ... 649 AccountClosedDeveloper TemplateName = "accountClosedDeveloper" 650 // ApplicationApprovedNotificationMessage ... 651 ApplicationApprovedNotificationMessage TemplateName = "applicationApprovedNotificationMessage" 652 // ConfirmSignUpIdentityDefault ... 653 ConfirmSignUpIdentityDefault TemplateName = "confirmSignUpIdentityDefault" 654 // EmailChangeIdentityDefault ... 655 EmailChangeIdentityDefault TemplateName = "emailChangeIdentityDefault" 656 // InviteUserNotificationMessage ... 657 InviteUserNotificationMessage TemplateName = "inviteUserNotificationMessage" 658 // NewCommentNotificationMessage ... 659 NewCommentNotificationMessage TemplateName = "newCommentNotificationMessage" 660 // NewDeveloperNotificationMessage ... 661 NewDeveloperNotificationMessage TemplateName = "newDeveloperNotificationMessage" 662 // NewIssueNotificationMessage ... 663 NewIssueNotificationMessage TemplateName = "newIssueNotificationMessage" 664 // PasswordResetByAdminNotificationMessage ... 665 PasswordResetByAdminNotificationMessage TemplateName = "passwordResetByAdminNotificationMessage" 666 // PasswordResetIdentityDefault ... 667 PasswordResetIdentityDefault TemplateName = "passwordResetIdentityDefault" 668 // PurchaseDeveloperNotificationMessage ... 669 PurchaseDeveloperNotificationMessage TemplateName = "purchaseDeveloperNotificationMessage" 670 // QuotaLimitApproachingDeveloperNotificationMessage ... 671 QuotaLimitApproachingDeveloperNotificationMessage TemplateName = "quotaLimitApproachingDeveloperNotificationMessage" 672 // RejectDeveloperNotificationMessage ... 673 RejectDeveloperNotificationMessage TemplateName = "rejectDeveloperNotificationMessage" 674 // RequestDeveloperNotificationMessage ... 675 RequestDeveloperNotificationMessage TemplateName = "requestDeveloperNotificationMessage" 676) 677 678// PossibleTemplateNameValues returns an array of possible values for the TemplateName const type. 679func PossibleTemplateNameValues() []TemplateName { 680 return []TemplateName{AccountClosedDeveloper, ApplicationApprovedNotificationMessage, ConfirmSignUpIdentityDefault, EmailChangeIdentityDefault, InviteUserNotificationMessage, NewCommentNotificationMessage, NewDeveloperNotificationMessage, NewIssueNotificationMessage, PasswordResetByAdminNotificationMessage, PasswordResetIdentityDefault, PurchaseDeveloperNotificationMessage, QuotaLimitApproachingDeveloperNotificationMessage, RejectDeveloperNotificationMessage, RequestDeveloperNotificationMessage} 681} 682 683// UserState enumerates the values for user state. 684type UserState string 685 686const ( 687 // UserStateActive User state is active. 688 UserStateActive UserState = "active" 689 // UserStateBlocked User is blocked. Blocked users cannot authenticate at developer portal or call API. 690 UserStateBlocked UserState = "blocked" 691 // UserStateDeleted User account is closed. All identities and related entities are removed. 692 UserStateDeleted UserState = "deleted" 693 // UserStatePending User account is pending. Requires identity confirmation before it can be made active. 694 UserStatePending UserState = "pending" 695) 696 697// PossibleUserStateValues returns an array of possible values for the UserState const type. 698func PossibleUserStateValues() []UserState { 699 return []UserState{UserStateActive, UserStateBlocked, UserStateDeleted, UserStatePending} 700} 701 702// VersioningScheme enumerates the values for versioning scheme. 703type VersioningScheme string 704 705const ( 706 // VersioningSchemeHeader The API Version is passed in a HTTP header. 707 VersioningSchemeHeader VersioningScheme = "Header" 708 // VersioningSchemeQuery The API Version is passed in a query parameter. 709 VersioningSchemeQuery VersioningScheme = "Query" 710 // VersioningSchemeSegment The API Version is passed in a path segment. 711 VersioningSchemeSegment VersioningScheme = "Segment" 712) 713 714// PossibleVersioningSchemeValues returns an array of possible values for the VersioningScheme const type. 715func PossibleVersioningSchemeValues() []VersioningScheme { 716 return []VersioningScheme{VersioningSchemeHeader, VersioningSchemeQuery, VersioningSchemeSegment} 717} 718 719// VersioningScheme1 enumerates the values for versioning scheme 1. 720type VersioningScheme1 string 721 722const ( 723 // VersioningScheme1Header ... 724 VersioningScheme1Header VersioningScheme1 = "Header" 725 // VersioningScheme1Query ... 726 VersioningScheme1Query VersioningScheme1 = "Query" 727 // VersioningScheme1Segment ... 728 VersioningScheme1Segment VersioningScheme1 = "Segment" 729) 730 731// PossibleVersioningScheme1Values returns an array of possible values for the VersioningScheme1 const type. 732func PossibleVersioningScheme1Values() []VersioningScheme1 { 733 return []VersioningScheme1{VersioningScheme1Header, VersioningScheme1Query, VersioningScheme1Segment} 734} 735 736// VirtualNetworkType enumerates the values for virtual network type. 737type VirtualNetworkType string 738 739const ( 740 // VirtualNetworkTypeExternal The service is part of Virtual Network and it is accessible from Internet. 741 VirtualNetworkTypeExternal VirtualNetworkType = "External" 742 // VirtualNetworkTypeInternal The service is part of Virtual Network and it is only accessible from within 743 // the virtual network. 744 VirtualNetworkTypeInternal VirtualNetworkType = "Internal" 745 // VirtualNetworkTypeNone The service is not part of any Virtual Network. 746 VirtualNetworkTypeNone VirtualNetworkType = "None" 747) 748 749// PossibleVirtualNetworkTypeValues returns an array of possible values for the VirtualNetworkType const type. 750func PossibleVirtualNetworkTypeValues() []VirtualNetworkType { 751 return []VirtualNetworkType{VirtualNetworkTypeExternal, VirtualNetworkTypeInternal, VirtualNetworkTypeNone} 752} 753 754// AccessInformationContract tenant access information contract of the API Management service. 755type AccessInformationContract struct { 756 autorest.Response `json:"-"` 757 // ID - Identifier. 758 ID *string `json:"id,omitempty"` 759 // PrimaryKey - Primary access key. 760 PrimaryKey *string `json:"primaryKey,omitempty"` 761 // SecondaryKey - Secondary access key. 762 SecondaryKey *string `json:"secondaryKey,omitempty"` 763 // Enabled - Determines whether direct access is enabled. 764 Enabled *bool `json:"enabled,omitempty"` 765} 766 767// AccessInformationUpdateParameterProperties tenant access information update parameters of the API 768// Management service 769type AccessInformationUpdateParameterProperties struct { 770 // Enabled - Determines whether direct access is enabled. 771 Enabled *bool `json:"enabled,omitempty"` 772} 773 774// AccessInformationUpdateParameters tenant access information update parameters. 775type AccessInformationUpdateParameters struct { 776 // AccessInformationUpdateParameterProperties - Tenant access information update parameter properties. 777 *AccessInformationUpdateParameterProperties `json:"properties,omitempty"` 778} 779 780// MarshalJSON is the custom marshaler for AccessInformationUpdateParameters. 781func (aiup AccessInformationUpdateParameters) MarshalJSON() ([]byte, error) { 782 objectMap := make(map[string]interface{}) 783 if aiup.AccessInformationUpdateParameterProperties != nil { 784 objectMap["properties"] = aiup.AccessInformationUpdateParameterProperties 785 } 786 return json.Marshal(objectMap) 787} 788 789// UnmarshalJSON is the custom unmarshaler for AccessInformationUpdateParameters struct. 790func (aiup *AccessInformationUpdateParameters) UnmarshalJSON(body []byte) error { 791 var m map[string]*json.RawMessage 792 err := json.Unmarshal(body, &m) 793 if err != nil { 794 return err 795 } 796 for k, v := range m { 797 switch k { 798 case "properties": 799 if v != nil { 800 var accessInformationUpdateParameterProperties AccessInformationUpdateParameterProperties 801 err = json.Unmarshal(*v, &accessInformationUpdateParameterProperties) 802 if err != nil { 803 return err 804 } 805 aiup.AccessInformationUpdateParameterProperties = &accessInformationUpdateParameterProperties 806 } 807 } 808 } 809 810 return nil 811} 812 813// AdditionalLocation description of an additional API Management resource location. 814type AdditionalLocation struct { 815 // Location - The location name of the additional region among Azure Data center regions. 816 Location *string `json:"location,omitempty"` 817 // Sku - SKU properties of the API Management service. 818 Sku *ServiceSkuProperties `json:"sku,omitempty"` 819 // 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. 820 PublicIPAddresses *[]string `json:"publicIPAddresses,omitempty"` 821 // 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. 822 PrivateIPAddresses *[]string `json:"privateIPAddresses,omitempty"` 823 // VirtualNetworkConfiguration - Virtual network configuration for the location. 824 VirtualNetworkConfiguration *VirtualNetworkConfiguration `json:"virtualNetworkConfiguration,omitempty"` 825 // GatewayRegionalURL - READ-ONLY; Gateway URL of the API Management service in the Region. 826 GatewayRegionalURL *string `json:"gatewayRegionalUrl,omitempty"` 827} 828 829// APICollection paged Api list representation. 830type APICollection struct { 831 autorest.Response `json:"-"` 832 // Value - READ-ONLY; Page values. 833 Value *[]APIContract `json:"value,omitempty"` 834 // NextLink - READ-ONLY; Next page link if any. 835 NextLink *string `json:"nextLink,omitempty"` 836} 837 838// APICollectionIterator provides access to a complete listing of APIContract values. 839type APICollectionIterator struct { 840 i int 841 page APICollectionPage 842} 843 844// NextWithContext advances to the next value. If there was an error making 845// the request the iterator does not advance and the error is returned. 846func (iter *APICollectionIterator) NextWithContext(ctx context.Context) (err error) { 847 if tracing.IsEnabled() { 848 ctx = tracing.StartSpan(ctx, fqdn+"/APICollectionIterator.NextWithContext") 849 defer func() { 850 sc := -1 851 if iter.Response().Response.Response != nil { 852 sc = iter.Response().Response.Response.StatusCode 853 } 854 tracing.EndSpan(ctx, sc, err) 855 }() 856 } 857 iter.i++ 858 if iter.i < len(iter.page.Values()) { 859 return nil 860 } 861 err = iter.page.NextWithContext(ctx) 862 if err != nil { 863 iter.i-- 864 return err 865 } 866 iter.i = 0 867 return nil 868} 869 870// Next advances to the next value. If there was an error making 871// the request the iterator does not advance and the error is returned. 872// Deprecated: Use NextWithContext() instead. 873func (iter *APICollectionIterator) Next() error { 874 return iter.NextWithContext(context.Background()) 875} 876 877// NotDone returns true if the enumeration should be started or is not yet complete. 878func (iter APICollectionIterator) NotDone() bool { 879 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 880} 881 882// Response returns the raw server response from the last page request. 883func (iter APICollectionIterator) Response() APICollection { 884 return iter.page.Response() 885} 886 887// Value returns the current value or a zero-initialized value if the 888// iterator has advanced beyond the end of the collection. 889func (iter APICollectionIterator) Value() APIContract { 890 if !iter.page.NotDone() { 891 return APIContract{} 892 } 893 return iter.page.Values()[iter.i] 894} 895 896// Creates a new instance of the APICollectionIterator type. 897func NewAPICollectionIterator(page APICollectionPage) APICollectionIterator { 898 return APICollectionIterator{page: page} 899} 900 901// IsEmpty returns true if the ListResult contains no values. 902func (ac APICollection) IsEmpty() bool { 903 return ac.Value == nil || len(*ac.Value) == 0 904} 905 906// aPICollectionPreparer prepares a request to retrieve the next set of results. 907// It returns nil if no more results exist. 908func (ac APICollection) aPICollectionPreparer(ctx context.Context) (*http.Request, error) { 909 if ac.NextLink == nil || len(to.String(ac.NextLink)) < 1 { 910 return nil, nil 911 } 912 return autorest.Prepare((&http.Request{}).WithContext(ctx), 913 autorest.AsJSON(), 914 autorest.AsGet(), 915 autorest.WithBaseURL(to.String(ac.NextLink))) 916} 917 918// APICollectionPage contains a page of APIContract values. 919type APICollectionPage struct { 920 fn func(context.Context, APICollection) (APICollection, error) 921 ac APICollection 922} 923 924// NextWithContext advances to the next page of values. If there was an error making 925// the request the page does not advance and the error is returned. 926func (page *APICollectionPage) NextWithContext(ctx context.Context) (err error) { 927 if tracing.IsEnabled() { 928 ctx = tracing.StartSpan(ctx, fqdn+"/APICollectionPage.NextWithContext") 929 defer func() { 930 sc := -1 931 if page.Response().Response.Response != nil { 932 sc = page.Response().Response.Response.StatusCode 933 } 934 tracing.EndSpan(ctx, sc, err) 935 }() 936 } 937 next, err := page.fn(ctx, page.ac) 938 if err != nil { 939 return err 940 } 941 page.ac = next 942 return nil 943} 944 945// Next advances to the next page of values. If there was an error making 946// the request the page does not advance and the error is returned. 947// Deprecated: Use NextWithContext() instead. 948func (page *APICollectionPage) Next() error { 949 return page.NextWithContext(context.Background()) 950} 951 952// NotDone returns true if the page enumeration should be started or is not yet complete. 953func (page APICollectionPage) NotDone() bool { 954 return !page.ac.IsEmpty() 955} 956 957// Response returns the raw server response from the last page request. 958func (page APICollectionPage) Response() APICollection { 959 return page.ac 960} 961 962// Values returns the slice of values for the current page or nil if there are no values. 963func (page APICollectionPage) Values() []APIContract { 964 if page.ac.IsEmpty() { 965 return nil 966 } 967 return *page.ac.Value 968} 969 970// Creates a new instance of the APICollectionPage type. 971func NewAPICollectionPage(getNextPage func(context.Context, APICollection) (APICollection, error)) APICollectionPage { 972 return APICollectionPage{fn: getNextPage} 973} 974 975// APIContract api details. 976type APIContract struct { 977 autorest.Response `json:"-"` 978 // APIContractProperties - Api entity contract properties. 979 *APIContractProperties `json:"properties,omitempty"` 980 // ID - READ-ONLY; Resource ID. 981 ID *string `json:"id,omitempty"` 982 // Name - READ-ONLY; Resource name. 983 Name *string `json:"name,omitempty"` 984 // Type - READ-ONLY; Resource type for API Management resource. 985 Type *string `json:"type,omitempty"` 986} 987 988// MarshalJSON is the custom marshaler for APIContract. 989func (ac APIContract) MarshalJSON() ([]byte, error) { 990 objectMap := make(map[string]interface{}) 991 if ac.APIContractProperties != nil { 992 objectMap["properties"] = ac.APIContractProperties 993 } 994 return json.Marshal(objectMap) 995} 996 997// UnmarshalJSON is the custom unmarshaler for APIContract struct. 998func (ac *APIContract) UnmarshalJSON(body []byte) error { 999 var m map[string]*json.RawMessage 1000 err := json.Unmarshal(body, &m) 1001 if err != nil { 1002 return err 1003 } 1004 for k, v := range m { 1005 switch k { 1006 case "properties": 1007 if v != nil { 1008 var APIContractProperties APIContractProperties 1009 err = json.Unmarshal(*v, &APIContractProperties) 1010 if err != nil { 1011 return err 1012 } 1013 ac.APIContractProperties = &APIContractProperties 1014 } 1015 case "id": 1016 if v != nil { 1017 var ID string 1018 err = json.Unmarshal(*v, &ID) 1019 if err != nil { 1020 return err 1021 } 1022 ac.ID = &ID 1023 } 1024 case "name": 1025 if v != nil { 1026 var name string 1027 err = json.Unmarshal(*v, &name) 1028 if err != nil { 1029 return err 1030 } 1031 ac.Name = &name 1032 } 1033 case "type": 1034 if v != nil { 1035 var typeVar string 1036 err = json.Unmarshal(*v, &typeVar) 1037 if err != nil { 1038 return err 1039 } 1040 ac.Type = &typeVar 1041 } 1042 } 1043 } 1044 1045 return nil 1046} 1047 1048// APIContractProperties api Entity Properties 1049type APIContractProperties struct { 1050 // SourceAPIID - API identifier of the source API. 1051 SourceAPIID *string `json:"sourceApiId,omitempty"` 1052 // DisplayName - API name. Must be 1 to 300 characters long. 1053 DisplayName *string `json:"displayName,omitempty"` 1054 // ServiceURL - Absolute URL of the backend service implementing this API. Cannot be more than 2000 characters long. 1055 ServiceURL *string `json:"serviceUrl,omitempty"` 1056 // 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. 1057 Path *string `json:"path,omitempty"` 1058 // Protocols - Describes on which protocols the operations in this API can be invoked. 1059 Protocols *[]Protocol `json:"protocols,omitempty"` 1060 // APIVersionSet - Version set details 1061 APIVersionSet *APIVersionSetContractDetails `json:"apiVersionSet,omitempty"` 1062 // Description - Description of the API. May include HTML formatting tags. 1063 Description *string `json:"description,omitempty"` 1064 // AuthenticationSettings - Collection of authentication settings included into this API. 1065 AuthenticationSettings *AuthenticationSettingsContract `json:"authenticationSettings,omitempty"` 1066 // SubscriptionKeyParameterNames - Protocols over which API is made available. 1067 SubscriptionKeyParameterNames *SubscriptionKeyParameterNamesContract `json:"subscriptionKeyParameterNames,omitempty"` 1068 // APIType - Type of API. Possible values include: 'HTTP', 'Soap' 1069 APIType APIType `json:"type,omitempty"` 1070 // APIRevision - Describes the Revision of the Api. If no value is provided, default revision 1 is created 1071 APIRevision *string `json:"apiRevision,omitempty"` 1072 // APIVersion - Indicates the Version identifier of the API if the API is versioned 1073 APIVersion *string `json:"apiVersion,omitempty"` 1074 // IsCurrent - Indicates if API revision is current api revision. 1075 IsCurrent *bool `json:"isCurrent,omitempty"` 1076 // IsOnline - READ-ONLY; Indicates if API revision is accessible via the gateway. 1077 IsOnline *bool `json:"isOnline,omitempty"` 1078 // APIRevisionDescription - Description of the Api Revision. 1079 APIRevisionDescription *string `json:"apiRevisionDescription,omitempty"` 1080 // APIVersionDescription - Description of the Api Version. 1081 APIVersionDescription *string `json:"apiVersionDescription,omitempty"` 1082 // APIVersionSetID - A resource identifier for the related ApiVersionSet. 1083 APIVersionSetID *string `json:"apiVersionSetId,omitempty"` 1084 // SubscriptionRequired - Specifies whether an API or Product subscription is required for accessing the API. 1085 SubscriptionRequired *bool `json:"subscriptionRequired,omitempty"` 1086} 1087 1088// APIContractUpdateProperties API update contract properties. 1089type APIContractUpdateProperties struct { 1090 // DisplayName - API name. 1091 DisplayName *string `json:"displayName,omitempty"` 1092 // ServiceURL - Absolute URL of the backend service implementing this API. 1093 ServiceURL *string `json:"serviceUrl,omitempty"` 1094 // 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. 1095 Path *string `json:"path,omitempty"` 1096 // Protocols - Describes on which protocols the operations in this API can be invoked. 1097 Protocols *[]Protocol `json:"protocols,omitempty"` 1098 // Description - Description of the API. May include HTML formatting tags. 1099 Description *string `json:"description,omitempty"` 1100 // AuthenticationSettings - Collection of authentication settings included into this API. 1101 AuthenticationSettings *AuthenticationSettingsContract `json:"authenticationSettings,omitempty"` 1102 // SubscriptionKeyParameterNames - Protocols over which API is made available. 1103 SubscriptionKeyParameterNames *SubscriptionKeyParameterNamesContract `json:"subscriptionKeyParameterNames,omitempty"` 1104 // APIType - Type of API. Possible values include: 'HTTP', 'Soap' 1105 APIType APIType `json:"type,omitempty"` 1106 // APIRevision - Describes the Revision of the Api. If no value is provided, default revision 1 is created 1107 APIRevision *string `json:"apiRevision,omitempty"` 1108 // APIVersion - Indicates the Version identifier of the API if the API is versioned 1109 APIVersion *string `json:"apiVersion,omitempty"` 1110 // IsCurrent - Indicates if API revision is current api revision. 1111 IsCurrent *bool `json:"isCurrent,omitempty"` 1112 // IsOnline - READ-ONLY; Indicates if API revision is accessible via the gateway. 1113 IsOnline *bool `json:"isOnline,omitempty"` 1114 // APIRevisionDescription - Description of the Api Revision. 1115 APIRevisionDescription *string `json:"apiRevisionDescription,omitempty"` 1116 // APIVersionDescription - Description of the Api Version. 1117 APIVersionDescription *string `json:"apiVersionDescription,omitempty"` 1118 // APIVersionSetID - A resource identifier for the related ApiVersionSet. 1119 APIVersionSetID *string `json:"apiVersionSetId,omitempty"` 1120 // SubscriptionRequired - Specifies whether an API or Product subscription is required for accessing the API. 1121 SubscriptionRequired *bool `json:"subscriptionRequired,omitempty"` 1122} 1123 1124// APICreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 1125// operation. 1126type APICreateOrUpdateFuture struct { 1127 azure.Future 1128} 1129 1130// Result returns the result of the asynchronous operation. 1131// If the operation has not completed it will return an error. 1132func (future *APICreateOrUpdateFuture) Result(client APIClient) (ac APIContract, err error) { 1133 var done bool 1134 done, err = future.DoneWithContext(context.Background(), client) 1135 if err != nil { 1136 err = autorest.NewErrorWithError(err, "apimanagement.APICreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 1137 return 1138 } 1139 if !done { 1140 err = azure.NewAsyncOpIncompleteError("apimanagement.APICreateOrUpdateFuture") 1141 return 1142 } 1143 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 1144 if ac.Response.Response, err = future.GetResult(sender); err == nil && ac.Response.Response.StatusCode != http.StatusNoContent { 1145 ac, err = client.CreateOrUpdateResponder(ac.Response.Response) 1146 if err != nil { 1147 err = autorest.NewErrorWithError(err, "apimanagement.APICreateOrUpdateFuture", "Result", ac.Response.Response, "Failure responding to request") 1148 } 1149 } 1150 return 1151} 1152 1153// APICreateOrUpdateParameter API Create or Update Parameters. 1154type APICreateOrUpdateParameter struct { 1155 // APICreateOrUpdateProperties - Api entity create of update properties. 1156 *APICreateOrUpdateProperties `json:"properties,omitempty"` 1157} 1158 1159// MarshalJSON is the custom marshaler for APICreateOrUpdateParameter. 1160func (acoup APICreateOrUpdateParameter) MarshalJSON() ([]byte, error) { 1161 objectMap := make(map[string]interface{}) 1162 if acoup.APICreateOrUpdateProperties != nil { 1163 objectMap["properties"] = acoup.APICreateOrUpdateProperties 1164 } 1165 return json.Marshal(objectMap) 1166} 1167 1168// UnmarshalJSON is the custom unmarshaler for APICreateOrUpdateParameter struct. 1169func (acoup *APICreateOrUpdateParameter) UnmarshalJSON(body []byte) error { 1170 var m map[string]*json.RawMessage 1171 err := json.Unmarshal(body, &m) 1172 if err != nil { 1173 return err 1174 } 1175 for k, v := range m { 1176 switch k { 1177 case "properties": 1178 if v != nil { 1179 var APICreateOrUpdateProperties APICreateOrUpdateProperties 1180 err = json.Unmarshal(*v, &APICreateOrUpdateProperties) 1181 if err != nil { 1182 return err 1183 } 1184 acoup.APICreateOrUpdateProperties = &APICreateOrUpdateProperties 1185 } 1186 } 1187 } 1188 1189 return nil 1190} 1191 1192// APICreateOrUpdateProperties api Create or Update Properties. 1193type APICreateOrUpdateProperties struct { 1194 // Value - Content value when Importing an API. 1195 Value *string `json:"value,omitempty"` 1196 // Format - Format of the Content in which the API is getting imported. Possible values include: 'WadlXML', 'WadlLinkJSON', 'SwaggerJSON', 'SwaggerLinkJSON', 'Wsdl', 'WsdlLink', 'Openapi', 'Openapijson', 'OpenapiLink' 1197 Format ContentFormat `json:"format,omitempty"` 1198 // WsdlSelector - Criteria to limit import of WSDL to a subset of the document. 1199 WsdlSelector *APICreateOrUpdatePropertiesWsdlSelector `json:"wsdlSelector,omitempty"` 1200 // SoapAPIType - Type of Api to create. 1201 // * `http` creates a SOAP to REST API 1202 // * `soap` creates a SOAP pass-through API. Possible values include: 'SoapToRest', 'SoapPassThrough' 1203 SoapAPIType SoapAPIType `json:"apiType,omitempty"` 1204 // SourceAPIID - API identifier of the source API. 1205 SourceAPIID *string `json:"sourceApiId,omitempty"` 1206 // DisplayName - API name. Must be 1 to 300 characters long. 1207 DisplayName *string `json:"displayName,omitempty"` 1208 // ServiceURL - Absolute URL of the backend service implementing this API. Cannot be more than 2000 characters long. 1209 ServiceURL *string `json:"serviceUrl,omitempty"` 1210 // 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. 1211 Path *string `json:"path,omitempty"` 1212 // Protocols - Describes on which protocols the operations in this API can be invoked. 1213 Protocols *[]Protocol `json:"protocols,omitempty"` 1214 // APIVersionSet - Version set details 1215 APIVersionSet *APIVersionSetContractDetails `json:"apiVersionSet,omitempty"` 1216 // Description - Description of the API. May include HTML formatting tags. 1217 Description *string `json:"description,omitempty"` 1218 // AuthenticationSettings - Collection of authentication settings included into this API. 1219 AuthenticationSettings *AuthenticationSettingsContract `json:"authenticationSettings,omitempty"` 1220 // SubscriptionKeyParameterNames - Protocols over which API is made available. 1221 SubscriptionKeyParameterNames *SubscriptionKeyParameterNamesContract `json:"subscriptionKeyParameterNames,omitempty"` 1222 // APIType - Type of API. Possible values include: 'HTTP', 'Soap' 1223 APIType APIType `json:"type,omitempty"` 1224 // APIRevision - Describes the Revision of the Api. If no value is provided, default revision 1 is created 1225 APIRevision *string `json:"apiRevision,omitempty"` 1226 // APIVersion - Indicates the Version identifier of the API if the API is versioned 1227 APIVersion *string `json:"apiVersion,omitempty"` 1228 // IsCurrent - Indicates if API revision is current api revision. 1229 IsCurrent *bool `json:"isCurrent,omitempty"` 1230 // IsOnline - READ-ONLY; Indicates if API revision is accessible via the gateway. 1231 IsOnline *bool `json:"isOnline,omitempty"` 1232 // APIRevisionDescription - Description of the Api Revision. 1233 APIRevisionDescription *string `json:"apiRevisionDescription,omitempty"` 1234 // APIVersionDescription - Description of the Api Version. 1235 APIVersionDescription *string `json:"apiVersionDescription,omitempty"` 1236 // APIVersionSetID - A resource identifier for the related ApiVersionSet. 1237 APIVersionSetID *string `json:"apiVersionSetId,omitempty"` 1238 // SubscriptionRequired - Specifies whether an API or Product subscription is required for accessing the API. 1239 SubscriptionRequired *bool `json:"subscriptionRequired,omitempty"` 1240} 1241 1242// APICreateOrUpdatePropertiesWsdlSelector criteria to limit import of WSDL to a subset of the document. 1243type APICreateOrUpdatePropertiesWsdlSelector struct { 1244 // WsdlServiceName - Name of service to import from WSDL 1245 WsdlServiceName *string `json:"wsdlServiceName,omitempty"` 1246 // WsdlEndpointName - Name of endpoint(port) to import from WSDL 1247 WsdlEndpointName *string `json:"wsdlEndpointName,omitempty"` 1248} 1249 1250// APIEntityBaseContract API base contract details. 1251type APIEntityBaseContract struct { 1252 // Description - Description of the API. May include HTML formatting tags. 1253 Description *string `json:"description,omitempty"` 1254 // AuthenticationSettings - Collection of authentication settings included into this API. 1255 AuthenticationSettings *AuthenticationSettingsContract `json:"authenticationSettings,omitempty"` 1256 // SubscriptionKeyParameterNames - Protocols over which API is made available. 1257 SubscriptionKeyParameterNames *SubscriptionKeyParameterNamesContract `json:"subscriptionKeyParameterNames,omitempty"` 1258 // APIType - Type of API. Possible values include: 'HTTP', 'Soap' 1259 APIType APIType `json:"type,omitempty"` 1260 // APIRevision - Describes the Revision of the Api. If no value is provided, default revision 1 is created 1261 APIRevision *string `json:"apiRevision,omitempty"` 1262 // APIVersion - Indicates the Version identifier of the API if the API is versioned 1263 APIVersion *string `json:"apiVersion,omitempty"` 1264 // IsCurrent - Indicates if API revision is current api revision. 1265 IsCurrent *bool `json:"isCurrent,omitempty"` 1266 // IsOnline - READ-ONLY; Indicates if API revision is accessible via the gateway. 1267 IsOnline *bool `json:"isOnline,omitempty"` 1268 // APIRevisionDescription - Description of the Api Revision. 1269 APIRevisionDescription *string `json:"apiRevisionDescription,omitempty"` 1270 // APIVersionDescription - Description of the Api Version. 1271 APIVersionDescription *string `json:"apiVersionDescription,omitempty"` 1272 // APIVersionSetID - A resource identifier for the related ApiVersionSet. 1273 APIVersionSetID *string `json:"apiVersionSetId,omitempty"` 1274 // SubscriptionRequired - Specifies whether an API or Product subscription is required for accessing the API. 1275 SubscriptionRequired *bool `json:"subscriptionRequired,omitempty"` 1276} 1277 1278// APIExportResult API Export result. 1279type APIExportResult struct { 1280 autorest.Response `json:"-"` 1281 // ID - ResourceId of the API which was exported. 1282 ID *string `json:"id,omitempty"` 1283 // ExportResultFormat - Format in which the Api Details are exported to the Storage Blob with Sas Key valid for 5 minutes. Possible values include: 'ExportResultFormatSwagger', 'ExportResultFormatWsdl', 'ExportResultFormatWadl', 'ExportResultFormatOpenAPI' 1284 ExportResultFormat ExportResultFormat `json:"format,omitempty"` 1285 // Value - The object defining the schema of the exported Api Detail 1286 Value *APIExportResultValue `json:"value,omitempty"` 1287} 1288 1289// APIExportResultValue the object defining the schema of the exported Api Detail 1290type APIExportResultValue struct { 1291 // Link - Link to the Storage Blob containing the result of the export operation. The Blob Uri is only valid for 5 minutes. 1292 Link *string `json:"link,omitempty"` 1293} 1294 1295// ApimResource the Resource definition. 1296type ApimResource struct { 1297 // ID - READ-ONLY; Resource ID. 1298 ID *string `json:"id,omitempty"` 1299 // Name - READ-ONLY; Resource name. 1300 Name *string `json:"name,omitempty"` 1301 // Type - READ-ONLY; Resource type for API Management resource is set to Microsoft.ApiManagement. 1302 Type *string `json:"type,omitempty"` 1303 // Tags - Resource tags. 1304 Tags map[string]*string `json:"tags"` 1305} 1306 1307// MarshalJSON is the custom marshaler for ApimResource. 1308func (ar ApimResource) MarshalJSON() ([]byte, error) { 1309 objectMap := make(map[string]interface{}) 1310 if ar.Tags != nil { 1311 objectMap["tags"] = ar.Tags 1312 } 1313 return json.Marshal(objectMap) 1314} 1315 1316// APIReleaseCollection paged ApiRelease list representation. 1317type APIReleaseCollection struct { 1318 autorest.Response `json:"-"` 1319 // Value - READ-ONLY; Page values. 1320 Value *[]APIReleaseContract `json:"value,omitempty"` 1321 // NextLink - READ-ONLY; Next page link if any. 1322 NextLink *string `json:"nextLink,omitempty"` 1323} 1324 1325// APIReleaseCollectionIterator provides access to a complete listing of APIReleaseContract values. 1326type APIReleaseCollectionIterator struct { 1327 i int 1328 page APIReleaseCollectionPage 1329} 1330 1331// NextWithContext advances to the next value. If there was an error making 1332// the request the iterator does not advance and the error is returned. 1333func (iter *APIReleaseCollectionIterator) NextWithContext(ctx context.Context) (err error) { 1334 if tracing.IsEnabled() { 1335 ctx = tracing.StartSpan(ctx, fqdn+"/APIReleaseCollectionIterator.NextWithContext") 1336 defer func() { 1337 sc := -1 1338 if iter.Response().Response.Response != nil { 1339 sc = iter.Response().Response.Response.StatusCode 1340 } 1341 tracing.EndSpan(ctx, sc, err) 1342 }() 1343 } 1344 iter.i++ 1345 if iter.i < len(iter.page.Values()) { 1346 return nil 1347 } 1348 err = iter.page.NextWithContext(ctx) 1349 if err != nil { 1350 iter.i-- 1351 return err 1352 } 1353 iter.i = 0 1354 return nil 1355} 1356 1357// Next advances to the next value. If there was an error making 1358// the request the iterator does not advance and the error is returned. 1359// Deprecated: Use NextWithContext() instead. 1360func (iter *APIReleaseCollectionIterator) Next() error { 1361 return iter.NextWithContext(context.Background()) 1362} 1363 1364// NotDone returns true if the enumeration should be started or is not yet complete. 1365func (iter APIReleaseCollectionIterator) NotDone() bool { 1366 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 1367} 1368 1369// Response returns the raw server response from the last page request. 1370func (iter APIReleaseCollectionIterator) Response() APIReleaseCollection { 1371 return iter.page.Response() 1372} 1373 1374// Value returns the current value or a zero-initialized value if the 1375// iterator has advanced beyond the end of the collection. 1376func (iter APIReleaseCollectionIterator) Value() APIReleaseContract { 1377 if !iter.page.NotDone() { 1378 return APIReleaseContract{} 1379 } 1380 return iter.page.Values()[iter.i] 1381} 1382 1383// Creates a new instance of the APIReleaseCollectionIterator type. 1384func NewAPIReleaseCollectionIterator(page APIReleaseCollectionPage) APIReleaseCollectionIterator { 1385 return APIReleaseCollectionIterator{page: page} 1386} 1387 1388// IsEmpty returns true if the ListResult contains no values. 1389func (arc APIReleaseCollection) IsEmpty() bool { 1390 return arc.Value == nil || len(*arc.Value) == 0 1391} 1392 1393// aPIReleaseCollectionPreparer prepares a request to retrieve the next set of results. 1394// It returns nil if no more results exist. 1395func (arc APIReleaseCollection) aPIReleaseCollectionPreparer(ctx context.Context) (*http.Request, error) { 1396 if arc.NextLink == nil || len(to.String(arc.NextLink)) < 1 { 1397 return nil, nil 1398 } 1399 return autorest.Prepare((&http.Request{}).WithContext(ctx), 1400 autorest.AsJSON(), 1401 autorest.AsGet(), 1402 autorest.WithBaseURL(to.String(arc.NextLink))) 1403} 1404 1405// APIReleaseCollectionPage contains a page of APIReleaseContract values. 1406type APIReleaseCollectionPage struct { 1407 fn func(context.Context, APIReleaseCollection) (APIReleaseCollection, error) 1408 arc APIReleaseCollection 1409} 1410 1411// NextWithContext advances to the next page of values. If there was an error making 1412// the request the page does not advance and the error is returned. 1413func (page *APIReleaseCollectionPage) NextWithContext(ctx context.Context) (err error) { 1414 if tracing.IsEnabled() { 1415 ctx = tracing.StartSpan(ctx, fqdn+"/APIReleaseCollectionPage.NextWithContext") 1416 defer func() { 1417 sc := -1 1418 if page.Response().Response.Response != nil { 1419 sc = page.Response().Response.Response.StatusCode 1420 } 1421 tracing.EndSpan(ctx, sc, err) 1422 }() 1423 } 1424 next, err := page.fn(ctx, page.arc) 1425 if err != nil { 1426 return err 1427 } 1428 page.arc = next 1429 return nil 1430} 1431 1432// Next advances to the next page of values. If there was an error making 1433// the request the page does not advance and the error is returned. 1434// Deprecated: Use NextWithContext() instead. 1435func (page *APIReleaseCollectionPage) Next() error { 1436 return page.NextWithContext(context.Background()) 1437} 1438 1439// NotDone returns true if the page enumeration should be started or is not yet complete. 1440func (page APIReleaseCollectionPage) NotDone() bool { 1441 return !page.arc.IsEmpty() 1442} 1443 1444// Response returns the raw server response from the last page request. 1445func (page APIReleaseCollectionPage) Response() APIReleaseCollection { 1446 return page.arc 1447} 1448 1449// Values returns the slice of values for the current page or nil if there are no values. 1450func (page APIReleaseCollectionPage) Values() []APIReleaseContract { 1451 if page.arc.IsEmpty() { 1452 return nil 1453 } 1454 return *page.arc.Value 1455} 1456 1457// Creates a new instance of the APIReleaseCollectionPage type. 1458func NewAPIReleaseCollectionPage(getNextPage func(context.Context, APIReleaseCollection) (APIReleaseCollection, error)) APIReleaseCollectionPage { 1459 return APIReleaseCollectionPage{fn: getNextPage} 1460} 1461 1462// APIReleaseContract apiRelease details. 1463type APIReleaseContract struct { 1464 autorest.Response `json:"-"` 1465 // APIReleaseContractProperties - ApiRelease entity contract properties. 1466 *APIReleaseContractProperties `json:"properties,omitempty"` 1467 // ID - READ-ONLY; Resource ID. 1468 ID *string `json:"id,omitempty"` 1469 // Name - READ-ONLY; Resource name. 1470 Name *string `json:"name,omitempty"` 1471 // Type - READ-ONLY; Resource type for API Management resource. 1472 Type *string `json:"type,omitempty"` 1473} 1474 1475// MarshalJSON is the custom marshaler for APIReleaseContract. 1476func (arc APIReleaseContract) MarshalJSON() ([]byte, error) { 1477 objectMap := make(map[string]interface{}) 1478 if arc.APIReleaseContractProperties != nil { 1479 objectMap["properties"] = arc.APIReleaseContractProperties 1480 } 1481 return json.Marshal(objectMap) 1482} 1483 1484// UnmarshalJSON is the custom unmarshaler for APIReleaseContract struct. 1485func (arc *APIReleaseContract) UnmarshalJSON(body []byte) error { 1486 var m map[string]*json.RawMessage 1487 err := json.Unmarshal(body, &m) 1488 if err != nil { 1489 return err 1490 } 1491 for k, v := range m { 1492 switch k { 1493 case "properties": 1494 if v != nil { 1495 var APIReleaseContractProperties APIReleaseContractProperties 1496 err = json.Unmarshal(*v, &APIReleaseContractProperties) 1497 if err != nil { 1498 return err 1499 } 1500 arc.APIReleaseContractProperties = &APIReleaseContractProperties 1501 } 1502 case "id": 1503 if v != nil { 1504 var ID string 1505 err = json.Unmarshal(*v, &ID) 1506 if err != nil { 1507 return err 1508 } 1509 arc.ID = &ID 1510 } 1511 case "name": 1512 if v != nil { 1513 var name string 1514 err = json.Unmarshal(*v, &name) 1515 if err != nil { 1516 return err 1517 } 1518 arc.Name = &name 1519 } 1520 case "type": 1521 if v != nil { 1522 var typeVar string 1523 err = json.Unmarshal(*v, &typeVar) 1524 if err != nil { 1525 return err 1526 } 1527 arc.Type = &typeVar 1528 } 1529 } 1530 } 1531 1532 return nil 1533} 1534 1535// APIReleaseContractProperties API Release details 1536type APIReleaseContractProperties struct { 1537 // APIID - Identifier of the API the release belongs to. 1538 APIID *string `json:"apiId,omitempty"` 1539 // 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. 1540 CreatedDateTime *date.Time `json:"createdDateTime,omitempty"` 1541 // UpdatedDateTime - READ-ONLY; The time the API release was updated. 1542 UpdatedDateTime *date.Time `json:"updatedDateTime,omitempty"` 1543 // Notes - Release Notes 1544 Notes *string `json:"notes,omitempty"` 1545} 1546 1547// APIRevisionCollection paged Api Revision list representation. 1548type APIRevisionCollection struct { 1549 autorest.Response `json:"-"` 1550 // Value - READ-ONLY; Page values. 1551 Value *[]APIRevisionContract `json:"value,omitempty"` 1552 // NextLink - READ-ONLY; Next page link if any. 1553 NextLink *string `json:"nextLink,omitempty"` 1554} 1555 1556// APIRevisionCollectionIterator provides access to a complete listing of APIRevisionContract values. 1557type APIRevisionCollectionIterator struct { 1558 i int 1559 page APIRevisionCollectionPage 1560} 1561 1562// NextWithContext advances to the next value. If there was an error making 1563// the request the iterator does not advance and the error is returned. 1564func (iter *APIRevisionCollectionIterator) NextWithContext(ctx context.Context) (err error) { 1565 if tracing.IsEnabled() { 1566 ctx = tracing.StartSpan(ctx, fqdn+"/APIRevisionCollectionIterator.NextWithContext") 1567 defer func() { 1568 sc := -1 1569 if iter.Response().Response.Response != nil { 1570 sc = iter.Response().Response.Response.StatusCode 1571 } 1572 tracing.EndSpan(ctx, sc, err) 1573 }() 1574 } 1575 iter.i++ 1576 if iter.i < len(iter.page.Values()) { 1577 return nil 1578 } 1579 err = iter.page.NextWithContext(ctx) 1580 if err != nil { 1581 iter.i-- 1582 return err 1583 } 1584 iter.i = 0 1585 return nil 1586} 1587 1588// Next advances to the next value. If there was an error making 1589// the request the iterator does not advance and the error is returned. 1590// Deprecated: Use NextWithContext() instead. 1591func (iter *APIRevisionCollectionIterator) Next() error { 1592 return iter.NextWithContext(context.Background()) 1593} 1594 1595// NotDone returns true if the enumeration should be started or is not yet complete. 1596func (iter APIRevisionCollectionIterator) NotDone() bool { 1597 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 1598} 1599 1600// Response returns the raw server response from the last page request. 1601func (iter APIRevisionCollectionIterator) Response() APIRevisionCollection { 1602 return iter.page.Response() 1603} 1604 1605// Value returns the current value or a zero-initialized value if the 1606// iterator has advanced beyond the end of the collection. 1607func (iter APIRevisionCollectionIterator) Value() APIRevisionContract { 1608 if !iter.page.NotDone() { 1609 return APIRevisionContract{} 1610 } 1611 return iter.page.Values()[iter.i] 1612} 1613 1614// Creates a new instance of the APIRevisionCollectionIterator type. 1615func NewAPIRevisionCollectionIterator(page APIRevisionCollectionPage) APIRevisionCollectionIterator { 1616 return APIRevisionCollectionIterator{page: page} 1617} 1618 1619// IsEmpty returns true if the ListResult contains no values. 1620func (arc APIRevisionCollection) IsEmpty() bool { 1621 return arc.Value == nil || len(*arc.Value) == 0 1622} 1623 1624// aPIRevisionCollectionPreparer prepares a request to retrieve the next set of results. 1625// It returns nil if no more results exist. 1626func (arc APIRevisionCollection) aPIRevisionCollectionPreparer(ctx context.Context) (*http.Request, error) { 1627 if arc.NextLink == nil || len(to.String(arc.NextLink)) < 1 { 1628 return nil, nil 1629 } 1630 return autorest.Prepare((&http.Request{}).WithContext(ctx), 1631 autorest.AsJSON(), 1632 autorest.AsGet(), 1633 autorest.WithBaseURL(to.String(arc.NextLink))) 1634} 1635 1636// APIRevisionCollectionPage contains a page of APIRevisionContract values. 1637type APIRevisionCollectionPage struct { 1638 fn func(context.Context, APIRevisionCollection) (APIRevisionCollection, error) 1639 arc APIRevisionCollection 1640} 1641 1642// NextWithContext advances to the next page of values. If there was an error making 1643// the request the page does not advance and the error is returned. 1644func (page *APIRevisionCollectionPage) NextWithContext(ctx context.Context) (err error) { 1645 if tracing.IsEnabled() { 1646 ctx = tracing.StartSpan(ctx, fqdn+"/APIRevisionCollectionPage.NextWithContext") 1647 defer func() { 1648 sc := -1 1649 if page.Response().Response.Response != nil { 1650 sc = page.Response().Response.Response.StatusCode 1651 } 1652 tracing.EndSpan(ctx, sc, err) 1653 }() 1654 } 1655 next, err := page.fn(ctx, page.arc) 1656 if err != nil { 1657 return err 1658 } 1659 page.arc = next 1660 return nil 1661} 1662 1663// Next advances to the next page of values. If there was an error making 1664// the request the page does not advance and the error is returned. 1665// Deprecated: Use NextWithContext() instead. 1666func (page *APIRevisionCollectionPage) Next() error { 1667 return page.NextWithContext(context.Background()) 1668} 1669 1670// NotDone returns true if the page enumeration should be started or is not yet complete. 1671func (page APIRevisionCollectionPage) NotDone() bool { 1672 return !page.arc.IsEmpty() 1673} 1674 1675// Response returns the raw server response from the last page request. 1676func (page APIRevisionCollectionPage) Response() APIRevisionCollection { 1677 return page.arc 1678} 1679 1680// Values returns the slice of values for the current page or nil if there are no values. 1681func (page APIRevisionCollectionPage) Values() []APIRevisionContract { 1682 if page.arc.IsEmpty() { 1683 return nil 1684 } 1685 return *page.arc.Value 1686} 1687 1688// Creates a new instance of the APIRevisionCollectionPage type. 1689func NewAPIRevisionCollectionPage(getNextPage func(context.Context, APIRevisionCollection) (APIRevisionCollection, error)) APIRevisionCollectionPage { 1690 return APIRevisionCollectionPage{fn: getNextPage} 1691} 1692 1693// APIRevisionContract summary of revision metadata. 1694type APIRevisionContract struct { 1695 // APIID - READ-ONLY; Identifier of the API Revision. 1696 APIID *string `json:"apiId,omitempty"` 1697 // APIRevision - READ-ONLY; Revision number of API. 1698 APIRevision *string `json:"apiRevision,omitempty"` 1699 // 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. 1700 CreatedDateTime *date.Time `json:"createdDateTime,omitempty"` 1701 // 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. 1702 UpdatedDateTime *date.Time `json:"updatedDateTime,omitempty"` 1703 // Description - READ-ONLY; Description of the API Revision. 1704 Description *string `json:"description,omitempty"` 1705 // PrivateURL - READ-ONLY; Gateway URL for accessing the non-current API Revision. 1706 PrivateURL *string `json:"privateUrl,omitempty"` 1707 // IsOnline - READ-ONLY; Indicates if API revision is the current api revision. 1708 IsOnline *bool `json:"isOnline,omitempty"` 1709 // IsCurrent - READ-ONLY; Indicates if API revision is accessible via the gateway. 1710 IsCurrent *bool `json:"isCurrent,omitempty"` 1711} 1712 1713// APIRevisionInfoContract object used to create an API Revision or Version based on an existing API 1714// Revision 1715type APIRevisionInfoContract struct { 1716 // SourceAPIID - Resource identifier of API to be used to create the revision from. 1717 SourceAPIID *string `json:"sourceApiId,omitempty"` 1718 // APIVersionName - Version identifier for the new API Version. 1719 APIVersionName *string `json:"apiVersionName,omitempty"` 1720 // APIRevisionDescription - Description of new API Revision. 1721 APIRevisionDescription *string `json:"apiRevisionDescription,omitempty"` 1722 // APIVersionSet - Version set details 1723 APIVersionSet *APIVersionSetContractDetails `json:"apiVersionSet,omitempty"` 1724} 1725 1726// APITagResourceContractProperties API contract properties for the Tag Resources. 1727type APITagResourceContractProperties struct { 1728 // ID - API identifier in the form /apis/{apiId}. 1729 ID *string `json:"id,omitempty"` 1730 // Name - API name. 1731 Name *string `json:"name,omitempty"` 1732 // ServiceURL - Absolute URL of the backend service implementing this API. 1733 ServiceURL *string `json:"serviceUrl,omitempty"` 1734 // 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. 1735 Path *string `json:"path,omitempty"` 1736 // Protocols - Describes on which protocols the operations in this API can be invoked. 1737 Protocols *[]Protocol `json:"protocols,omitempty"` 1738 // Description - Description of the API. May include HTML formatting tags. 1739 Description *string `json:"description,omitempty"` 1740 // AuthenticationSettings - Collection of authentication settings included into this API. 1741 AuthenticationSettings *AuthenticationSettingsContract `json:"authenticationSettings,omitempty"` 1742 // SubscriptionKeyParameterNames - Protocols over which API is made available. 1743 SubscriptionKeyParameterNames *SubscriptionKeyParameterNamesContract `json:"subscriptionKeyParameterNames,omitempty"` 1744 // APIType - Type of API. Possible values include: 'HTTP', 'Soap' 1745 APIType APIType `json:"type,omitempty"` 1746 // APIRevision - Describes the Revision of the Api. If no value is provided, default revision 1 is created 1747 APIRevision *string `json:"apiRevision,omitempty"` 1748 // APIVersion - Indicates the Version identifier of the API if the API is versioned 1749 APIVersion *string `json:"apiVersion,omitempty"` 1750 // IsCurrent - Indicates if API revision is current api revision. 1751 IsCurrent *bool `json:"isCurrent,omitempty"` 1752 // IsOnline - READ-ONLY; Indicates if API revision is accessible via the gateway. 1753 IsOnline *bool `json:"isOnline,omitempty"` 1754 // APIRevisionDescription - Description of the Api Revision. 1755 APIRevisionDescription *string `json:"apiRevisionDescription,omitempty"` 1756 // APIVersionDescription - Description of the Api Version. 1757 APIVersionDescription *string `json:"apiVersionDescription,omitempty"` 1758 // APIVersionSetID - A resource identifier for the related ApiVersionSet. 1759 APIVersionSetID *string `json:"apiVersionSetId,omitempty"` 1760 // SubscriptionRequired - Specifies whether an API or Product subscription is required for accessing the API. 1761 SubscriptionRequired *bool `json:"subscriptionRequired,omitempty"` 1762} 1763 1764// APIUpdateContract API update contract details. 1765type APIUpdateContract struct { 1766 // APIContractUpdateProperties - Properties of the API entity that can be updated. 1767 *APIContractUpdateProperties `json:"properties,omitempty"` 1768} 1769 1770// MarshalJSON is the custom marshaler for APIUpdateContract. 1771func (auc APIUpdateContract) MarshalJSON() ([]byte, error) { 1772 objectMap := make(map[string]interface{}) 1773 if auc.APIContractUpdateProperties != nil { 1774 objectMap["properties"] = auc.APIContractUpdateProperties 1775 } 1776 return json.Marshal(objectMap) 1777} 1778 1779// UnmarshalJSON is the custom unmarshaler for APIUpdateContract struct. 1780func (auc *APIUpdateContract) UnmarshalJSON(body []byte) error { 1781 var m map[string]*json.RawMessage 1782 err := json.Unmarshal(body, &m) 1783 if err != nil { 1784 return err 1785 } 1786 for k, v := range m { 1787 switch k { 1788 case "properties": 1789 if v != nil { 1790 var APIContractUpdateProperties APIContractUpdateProperties 1791 err = json.Unmarshal(*v, &APIContractUpdateProperties) 1792 if err != nil { 1793 return err 1794 } 1795 auc.APIContractUpdateProperties = &APIContractUpdateProperties 1796 } 1797 } 1798 } 1799 1800 return nil 1801} 1802 1803// APIVersionSetCollection paged Api Version Set list representation. 1804type APIVersionSetCollection struct { 1805 autorest.Response `json:"-"` 1806 // Value - Page values. 1807 Value *[]APIVersionSetContract `json:"value,omitempty"` 1808 // NextLink - Next page link if any. 1809 NextLink *string `json:"nextLink,omitempty"` 1810} 1811 1812// APIVersionSetCollectionIterator provides access to a complete listing of APIVersionSetContract values. 1813type APIVersionSetCollectionIterator struct { 1814 i int 1815 page APIVersionSetCollectionPage 1816} 1817 1818// NextWithContext advances to the next value. If there was an error making 1819// the request the iterator does not advance and the error is returned. 1820func (iter *APIVersionSetCollectionIterator) NextWithContext(ctx context.Context) (err error) { 1821 if tracing.IsEnabled() { 1822 ctx = tracing.StartSpan(ctx, fqdn+"/APIVersionSetCollectionIterator.NextWithContext") 1823 defer func() { 1824 sc := -1 1825 if iter.Response().Response.Response != nil { 1826 sc = iter.Response().Response.Response.StatusCode 1827 } 1828 tracing.EndSpan(ctx, sc, err) 1829 }() 1830 } 1831 iter.i++ 1832 if iter.i < len(iter.page.Values()) { 1833 return nil 1834 } 1835 err = iter.page.NextWithContext(ctx) 1836 if err != nil { 1837 iter.i-- 1838 return err 1839 } 1840 iter.i = 0 1841 return nil 1842} 1843 1844// Next advances to the next value. If there was an error making 1845// the request the iterator does not advance and the error is returned. 1846// Deprecated: Use NextWithContext() instead. 1847func (iter *APIVersionSetCollectionIterator) Next() error { 1848 return iter.NextWithContext(context.Background()) 1849} 1850 1851// NotDone returns true if the enumeration should be started or is not yet complete. 1852func (iter APIVersionSetCollectionIterator) NotDone() bool { 1853 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 1854} 1855 1856// Response returns the raw server response from the last page request. 1857func (iter APIVersionSetCollectionIterator) Response() APIVersionSetCollection { 1858 return iter.page.Response() 1859} 1860 1861// Value returns the current value or a zero-initialized value if the 1862// iterator has advanced beyond the end of the collection. 1863func (iter APIVersionSetCollectionIterator) Value() APIVersionSetContract { 1864 if !iter.page.NotDone() { 1865 return APIVersionSetContract{} 1866 } 1867 return iter.page.Values()[iter.i] 1868} 1869 1870// Creates a new instance of the APIVersionSetCollectionIterator type. 1871func NewAPIVersionSetCollectionIterator(page APIVersionSetCollectionPage) APIVersionSetCollectionIterator { 1872 return APIVersionSetCollectionIterator{page: page} 1873} 1874 1875// IsEmpty returns true if the ListResult contains no values. 1876func (avsc APIVersionSetCollection) IsEmpty() bool { 1877 return avsc.Value == nil || len(*avsc.Value) == 0 1878} 1879 1880// aPIVersionSetCollectionPreparer prepares a request to retrieve the next set of results. 1881// It returns nil if no more results exist. 1882func (avsc APIVersionSetCollection) aPIVersionSetCollectionPreparer(ctx context.Context) (*http.Request, error) { 1883 if avsc.NextLink == nil || len(to.String(avsc.NextLink)) < 1 { 1884 return nil, nil 1885 } 1886 return autorest.Prepare((&http.Request{}).WithContext(ctx), 1887 autorest.AsJSON(), 1888 autorest.AsGet(), 1889 autorest.WithBaseURL(to.String(avsc.NextLink))) 1890} 1891 1892// APIVersionSetCollectionPage contains a page of APIVersionSetContract values. 1893type APIVersionSetCollectionPage struct { 1894 fn func(context.Context, APIVersionSetCollection) (APIVersionSetCollection, error) 1895 avsc APIVersionSetCollection 1896} 1897 1898// NextWithContext advances to the next page of values. If there was an error making 1899// the request the page does not advance and the error is returned. 1900func (page *APIVersionSetCollectionPage) NextWithContext(ctx context.Context) (err error) { 1901 if tracing.IsEnabled() { 1902 ctx = tracing.StartSpan(ctx, fqdn+"/APIVersionSetCollectionPage.NextWithContext") 1903 defer func() { 1904 sc := -1 1905 if page.Response().Response.Response != nil { 1906 sc = page.Response().Response.Response.StatusCode 1907 } 1908 tracing.EndSpan(ctx, sc, err) 1909 }() 1910 } 1911 next, err := page.fn(ctx, page.avsc) 1912 if err != nil { 1913 return err 1914 } 1915 page.avsc = next 1916 return nil 1917} 1918 1919// Next advances to the next page of values. If there was an error making 1920// the request the page does not advance and the error is returned. 1921// Deprecated: Use NextWithContext() instead. 1922func (page *APIVersionSetCollectionPage) Next() error { 1923 return page.NextWithContext(context.Background()) 1924} 1925 1926// NotDone returns true if the page enumeration should be started or is not yet complete. 1927func (page APIVersionSetCollectionPage) NotDone() bool { 1928 return !page.avsc.IsEmpty() 1929} 1930 1931// Response returns the raw server response from the last page request. 1932func (page APIVersionSetCollectionPage) Response() APIVersionSetCollection { 1933 return page.avsc 1934} 1935 1936// Values returns the slice of values for the current page or nil if there are no values. 1937func (page APIVersionSetCollectionPage) Values() []APIVersionSetContract { 1938 if page.avsc.IsEmpty() { 1939 return nil 1940 } 1941 return *page.avsc.Value 1942} 1943 1944// Creates a new instance of the APIVersionSetCollectionPage type. 1945func NewAPIVersionSetCollectionPage(getNextPage func(context.Context, APIVersionSetCollection) (APIVersionSetCollection, error)) APIVersionSetCollectionPage { 1946 return APIVersionSetCollectionPage{fn: getNextPage} 1947} 1948 1949// APIVersionSetContract api Version Set Contract details. 1950type APIVersionSetContract struct { 1951 autorest.Response `json:"-"` 1952 // APIVersionSetContractProperties - Api VersionSet contract properties. 1953 *APIVersionSetContractProperties `json:"properties,omitempty"` 1954 // ID - READ-ONLY; Resource ID. 1955 ID *string `json:"id,omitempty"` 1956 // Name - READ-ONLY; Resource name. 1957 Name *string `json:"name,omitempty"` 1958 // Type - READ-ONLY; Resource type for API Management resource. 1959 Type *string `json:"type,omitempty"` 1960} 1961 1962// MarshalJSON is the custom marshaler for APIVersionSetContract. 1963func (avsc APIVersionSetContract) MarshalJSON() ([]byte, error) { 1964 objectMap := make(map[string]interface{}) 1965 if avsc.APIVersionSetContractProperties != nil { 1966 objectMap["properties"] = avsc.APIVersionSetContractProperties 1967 } 1968 return json.Marshal(objectMap) 1969} 1970 1971// UnmarshalJSON is the custom unmarshaler for APIVersionSetContract struct. 1972func (avsc *APIVersionSetContract) UnmarshalJSON(body []byte) error { 1973 var m map[string]*json.RawMessage 1974 err := json.Unmarshal(body, &m) 1975 if err != nil { 1976 return err 1977 } 1978 for k, v := range m { 1979 switch k { 1980 case "properties": 1981 if v != nil { 1982 var APIVersionSetContractProperties APIVersionSetContractProperties 1983 err = json.Unmarshal(*v, &APIVersionSetContractProperties) 1984 if err != nil { 1985 return err 1986 } 1987 avsc.APIVersionSetContractProperties = &APIVersionSetContractProperties 1988 } 1989 case "id": 1990 if v != nil { 1991 var ID string 1992 err = json.Unmarshal(*v, &ID) 1993 if err != nil { 1994 return err 1995 } 1996 avsc.ID = &ID 1997 } 1998 case "name": 1999 if v != nil { 2000 var name string 2001 err = json.Unmarshal(*v, &name) 2002 if err != nil { 2003 return err 2004 } 2005 avsc.Name = &name 2006 } 2007 case "type": 2008 if v != nil { 2009 var typeVar string 2010 err = json.Unmarshal(*v, &typeVar) 2011 if err != nil { 2012 return err 2013 } 2014 avsc.Type = &typeVar 2015 } 2016 } 2017 } 2018 2019 return nil 2020} 2021 2022// APIVersionSetContractDetails an API Version Set contains the common configuration for a set of API 2023// Versions relating 2024type APIVersionSetContractDetails struct { 2025 // ID - Identifier for existing API Version Set. Omit this value to create a new Version Set. 2026 ID *string `json:"id,omitempty"` 2027 // Name - The display Name of the API Version Set. 2028 Name *string `json:"name,omitempty"` 2029 // Description - Description of API Version Set. 2030 Description *string `json:"description,omitempty"` 2031 // VersioningScheme - An value that determines where the API Version identifer will be located in a HTTP request. Possible values include: 'VersioningScheme1Segment', 'VersioningScheme1Query', 'VersioningScheme1Header' 2032 VersioningScheme VersioningScheme1 `json:"versioningScheme,omitempty"` 2033 // VersionQueryName - Name of query parameter that indicates the API Version if versioningScheme is set to `query`. 2034 VersionQueryName *string `json:"versionQueryName,omitempty"` 2035 // VersionHeaderName - Name of HTTP header parameter that indicates the API Version if versioningScheme is set to `header`. 2036 VersionHeaderName *string `json:"versionHeaderName,omitempty"` 2037} 2038 2039// APIVersionSetContractProperties properties of an API Version Set. 2040type APIVersionSetContractProperties struct { 2041 // DisplayName - Name of API Version Set 2042 DisplayName *string `json:"displayName,omitempty"` 2043 // VersioningScheme - An value that determines where the API Version identifer will be located in a HTTP request. Possible values include: 'VersioningSchemeSegment', 'VersioningSchemeQuery', 'VersioningSchemeHeader' 2044 VersioningScheme VersioningScheme `json:"versioningScheme,omitempty"` 2045 // Description - Description of API Version Set. 2046 Description *string `json:"description,omitempty"` 2047 // VersionQueryName - Name of query parameter that indicates the API Version if versioningScheme is set to `query`. 2048 VersionQueryName *string `json:"versionQueryName,omitempty"` 2049 // VersionHeaderName - Name of HTTP header parameter that indicates the API Version if versioningScheme is set to `header`. 2050 VersionHeaderName *string `json:"versionHeaderName,omitempty"` 2051} 2052 2053// APIVersionSetEntityBase api Version set base parameters 2054type APIVersionSetEntityBase struct { 2055 // Description - Description of API Version Set. 2056 Description *string `json:"description,omitempty"` 2057 // VersionQueryName - Name of query parameter that indicates the API Version if versioningScheme is set to `query`. 2058 VersionQueryName *string `json:"versionQueryName,omitempty"` 2059 // VersionHeaderName - Name of HTTP header parameter that indicates the API Version if versioningScheme is set to `header`. 2060 VersionHeaderName *string `json:"versionHeaderName,omitempty"` 2061} 2062 2063// APIVersionSetUpdateParameters parameters to update or create an Api Version Set Contract. 2064type APIVersionSetUpdateParameters struct { 2065 // APIVersionSetUpdateParametersProperties - Parameters to update or create an Api Version Set Contract. 2066 *APIVersionSetUpdateParametersProperties `json:"properties,omitempty"` 2067} 2068 2069// MarshalJSON is the custom marshaler for APIVersionSetUpdateParameters. 2070func (avsup APIVersionSetUpdateParameters) MarshalJSON() ([]byte, error) { 2071 objectMap := make(map[string]interface{}) 2072 if avsup.APIVersionSetUpdateParametersProperties != nil { 2073 objectMap["properties"] = avsup.APIVersionSetUpdateParametersProperties 2074 } 2075 return json.Marshal(objectMap) 2076} 2077 2078// UnmarshalJSON is the custom unmarshaler for APIVersionSetUpdateParameters struct. 2079func (avsup *APIVersionSetUpdateParameters) UnmarshalJSON(body []byte) error { 2080 var m map[string]*json.RawMessage 2081 err := json.Unmarshal(body, &m) 2082 if err != nil { 2083 return err 2084 } 2085 for k, v := range m { 2086 switch k { 2087 case "properties": 2088 if v != nil { 2089 var APIVersionSetUpdateParametersProperties APIVersionSetUpdateParametersProperties 2090 err = json.Unmarshal(*v, &APIVersionSetUpdateParametersProperties) 2091 if err != nil { 2092 return err 2093 } 2094 avsup.APIVersionSetUpdateParametersProperties = &APIVersionSetUpdateParametersProperties 2095 } 2096 } 2097 } 2098 2099 return nil 2100} 2101 2102// APIVersionSetUpdateParametersProperties properties used to create or update an API Version Set. 2103type APIVersionSetUpdateParametersProperties struct { 2104 // DisplayName - Name of API Version Set 2105 DisplayName *string `json:"displayName,omitempty"` 2106 // VersioningScheme - An value that determines where the API Version identifer will be located in a HTTP request. Possible values include: 'VersioningSchemeSegment', 'VersioningSchemeQuery', 'VersioningSchemeHeader' 2107 VersioningScheme VersioningScheme `json:"versioningScheme,omitempty"` 2108 // Description - Description of API Version Set. 2109 Description *string `json:"description,omitempty"` 2110 // VersionQueryName - Name of query parameter that indicates the API Version if versioningScheme is set to `query`. 2111 VersionQueryName *string `json:"versionQueryName,omitempty"` 2112 // VersionHeaderName - Name of HTTP header parameter that indicates the API Version if versioningScheme is set to `header`. 2113 VersionHeaderName *string `json:"versionHeaderName,omitempty"` 2114} 2115 2116// AuthenticationSettingsContract API Authentication Settings. 2117type AuthenticationSettingsContract struct { 2118 // OAuth2 - OAuth2 Authentication settings 2119 OAuth2 *OAuth2AuthenticationSettingsContract `json:"oAuth2,omitempty"` 2120 // Openid - OpenID Connect Authentication Settings 2121 Openid *OpenIDAuthenticationSettingsContract `json:"openid,omitempty"` 2122} 2123 2124// AuthorizationServerCollection paged OAuth2 Authorization Servers list representation. 2125type AuthorizationServerCollection struct { 2126 autorest.Response `json:"-"` 2127 // Value - Page values. 2128 Value *[]AuthorizationServerContract `json:"value,omitempty"` 2129 // Count - Total record count number across all pages. 2130 Count *int64 `json:"count,omitempty"` 2131 // NextLink - Next page link if any. 2132 NextLink *string `json:"nextLink,omitempty"` 2133} 2134 2135// AuthorizationServerCollectionIterator provides access to a complete listing of 2136// AuthorizationServerContract values. 2137type AuthorizationServerCollectionIterator struct { 2138 i int 2139 page AuthorizationServerCollectionPage 2140} 2141 2142// NextWithContext advances to the next value. If there was an error making 2143// the request the iterator does not advance and the error is returned. 2144func (iter *AuthorizationServerCollectionIterator) NextWithContext(ctx context.Context) (err error) { 2145 if tracing.IsEnabled() { 2146 ctx = tracing.StartSpan(ctx, fqdn+"/AuthorizationServerCollectionIterator.NextWithContext") 2147 defer func() { 2148 sc := -1 2149 if iter.Response().Response.Response != nil { 2150 sc = iter.Response().Response.Response.StatusCode 2151 } 2152 tracing.EndSpan(ctx, sc, err) 2153 }() 2154 } 2155 iter.i++ 2156 if iter.i < len(iter.page.Values()) { 2157 return nil 2158 } 2159 err = iter.page.NextWithContext(ctx) 2160 if err != nil { 2161 iter.i-- 2162 return err 2163 } 2164 iter.i = 0 2165 return nil 2166} 2167 2168// Next advances to the next value. If there was an error making 2169// the request the iterator does not advance and the error is returned. 2170// Deprecated: Use NextWithContext() instead. 2171func (iter *AuthorizationServerCollectionIterator) Next() error { 2172 return iter.NextWithContext(context.Background()) 2173} 2174 2175// NotDone returns true if the enumeration should be started or is not yet complete. 2176func (iter AuthorizationServerCollectionIterator) NotDone() bool { 2177 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 2178} 2179 2180// Response returns the raw server response from the last page request. 2181func (iter AuthorizationServerCollectionIterator) Response() AuthorizationServerCollection { 2182 return iter.page.Response() 2183} 2184 2185// Value returns the current value or a zero-initialized value if the 2186// iterator has advanced beyond the end of the collection. 2187func (iter AuthorizationServerCollectionIterator) Value() AuthorizationServerContract { 2188 if !iter.page.NotDone() { 2189 return AuthorizationServerContract{} 2190 } 2191 return iter.page.Values()[iter.i] 2192} 2193 2194// Creates a new instance of the AuthorizationServerCollectionIterator type. 2195func NewAuthorizationServerCollectionIterator(page AuthorizationServerCollectionPage) AuthorizationServerCollectionIterator { 2196 return AuthorizationServerCollectionIterator{page: page} 2197} 2198 2199// IsEmpty returns true if the ListResult contains no values. 2200func (asc AuthorizationServerCollection) IsEmpty() bool { 2201 return asc.Value == nil || len(*asc.Value) == 0 2202} 2203 2204// authorizationServerCollectionPreparer prepares a request to retrieve the next set of results. 2205// It returns nil if no more results exist. 2206func (asc AuthorizationServerCollection) authorizationServerCollectionPreparer(ctx context.Context) (*http.Request, error) { 2207 if asc.NextLink == nil || len(to.String(asc.NextLink)) < 1 { 2208 return nil, nil 2209 } 2210 return autorest.Prepare((&http.Request{}).WithContext(ctx), 2211 autorest.AsJSON(), 2212 autorest.AsGet(), 2213 autorest.WithBaseURL(to.String(asc.NextLink))) 2214} 2215 2216// AuthorizationServerCollectionPage contains a page of AuthorizationServerContract values. 2217type AuthorizationServerCollectionPage struct { 2218 fn func(context.Context, AuthorizationServerCollection) (AuthorizationServerCollection, error) 2219 asc AuthorizationServerCollection 2220} 2221 2222// NextWithContext advances to the next page of values. If there was an error making 2223// the request the page does not advance and the error is returned. 2224func (page *AuthorizationServerCollectionPage) NextWithContext(ctx context.Context) (err error) { 2225 if tracing.IsEnabled() { 2226 ctx = tracing.StartSpan(ctx, fqdn+"/AuthorizationServerCollectionPage.NextWithContext") 2227 defer func() { 2228 sc := -1 2229 if page.Response().Response.Response != nil { 2230 sc = page.Response().Response.Response.StatusCode 2231 } 2232 tracing.EndSpan(ctx, sc, err) 2233 }() 2234 } 2235 next, err := page.fn(ctx, page.asc) 2236 if err != nil { 2237 return err 2238 } 2239 page.asc = next 2240 return nil 2241} 2242 2243// Next advances to the next page of values. If there was an error making 2244// the request the page does not advance and the error is returned. 2245// Deprecated: Use NextWithContext() instead. 2246func (page *AuthorizationServerCollectionPage) Next() error { 2247 return page.NextWithContext(context.Background()) 2248} 2249 2250// NotDone returns true if the page enumeration should be started or is not yet complete. 2251func (page AuthorizationServerCollectionPage) NotDone() bool { 2252 return !page.asc.IsEmpty() 2253} 2254 2255// Response returns the raw server response from the last page request. 2256func (page AuthorizationServerCollectionPage) Response() AuthorizationServerCollection { 2257 return page.asc 2258} 2259 2260// Values returns the slice of values for the current page or nil if there are no values. 2261func (page AuthorizationServerCollectionPage) Values() []AuthorizationServerContract { 2262 if page.asc.IsEmpty() { 2263 return nil 2264 } 2265 return *page.asc.Value 2266} 2267 2268// Creates a new instance of the AuthorizationServerCollectionPage type. 2269func NewAuthorizationServerCollectionPage(getNextPage func(context.Context, AuthorizationServerCollection) (AuthorizationServerCollection, error)) AuthorizationServerCollectionPage { 2270 return AuthorizationServerCollectionPage{fn: getNextPage} 2271} 2272 2273// AuthorizationServerContract external OAuth authorization server settings. 2274type AuthorizationServerContract struct { 2275 autorest.Response `json:"-"` 2276 // AuthorizationServerContractProperties - Properties of the External OAuth authorization server Contract. 2277 *AuthorizationServerContractProperties `json:"properties,omitempty"` 2278 // ID - READ-ONLY; Resource ID. 2279 ID *string `json:"id,omitempty"` 2280 // Name - READ-ONLY; Resource name. 2281 Name *string `json:"name,omitempty"` 2282 // Type - READ-ONLY; Resource type for API Management resource. 2283 Type *string `json:"type,omitempty"` 2284} 2285 2286// MarshalJSON is the custom marshaler for AuthorizationServerContract. 2287func (asc AuthorizationServerContract) MarshalJSON() ([]byte, error) { 2288 objectMap := make(map[string]interface{}) 2289 if asc.AuthorizationServerContractProperties != nil { 2290 objectMap["properties"] = asc.AuthorizationServerContractProperties 2291 } 2292 return json.Marshal(objectMap) 2293} 2294 2295// UnmarshalJSON is the custom unmarshaler for AuthorizationServerContract struct. 2296func (asc *AuthorizationServerContract) UnmarshalJSON(body []byte) error { 2297 var m map[string]*json.RawMessage 2298 err := json.Unmarshal(body, &m) 2299 if err != nil { 2300 return err 2301 } 2302 for k, v := range m { 2303 switch k { 2304 case "properties": 2305 if v != nil { 2306 var authorizationServerContractProperties AuthorizationServerContractProperties 2307 err = json.Unmarshal(*v, &authorizationServerContractProperties) 2308 if err != nil { 2309 return err 2310 } 2311 asc.AuthorizationServerContractProperties = &authorizationServerContractProperties 2312 } 2313 case "id": 2314 if v != nil { 2315 var ID string 2316 err = json.Unmarshal(*v, &ID) 2317 if err != nil { 2318 return err 2319 } 2320 asc.ID = &ID 2321 } 2322 case "name": 2323 if v != nil { 2324 var name string 2325 err = json.Unmarshal(*v, &name) 2326 if err != nil { 2327 return err 2328 } 2329 asc.Name = &name 2330 } 2331 case "type": 2332 if v != nil { 2333 var typeVar string 2334 err = json.Unmarshal(*v, &typeVar) 2335 if err != nil { 2336 return err 2337 } 2338 asc.Type = &typeVar 2339 } 2340 } 2341 } 2342 2343 return nil 2344} 2345 2346// AuthorizationServerContractBaseProperties external OAuth authorization server Update settings contract. 2347type AuthorizationServerContractBaseProperties struct { 2348 // Description - Description of the authorization server. Can contain HTML formatting tags. 2349 Description *string `json:"description,omitempty"` 2350 // AuthorizationMethods - HTTP verbs supported by the authorization endpoint. GET must be always present. POST is optional. 2351 AuthorizationMethods *[]AuthorizationMethod `json:"authorizationMethods,omitempty"` 2352 // 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. 2353 ClientAuthenticationMethod *[]ClientAuthenticationMethod `json:"clientAuthenticationMethod,omitempty"` 2354 // 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"}. 2355 TokenBodyParameters *[]TokenBodyParameterContract `json:"tokenBodyParameters,omitempty"` 2356 // TokenEndpoint - OAuth token endpoint. Contains absolute URI to entity being referenced. 2357 TokenEndpoint *string `json:"tokenEndpoint,omitempty"` 2358 // 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. 2359 SupportState *bool `json:"supportState,omitempty"` 2360 // 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. 2361 DefaultScope *string `json:"defaultScope,omitempty"` 2362 // BearerTokenSendingMethods - Specifies the mechanism by which access token is passed to the API. 2363 BearerTokenSendingMethods *[]BearerTokenSendingMethod `json:"bearerTokenSendingMethods,omitempty"` 2364 // ClientSecret - Client or app secret registered with this authorization server. 2365 ClientSecret *string `json:"clientSecret,omitempty"` 2366 // ResourceOwnerUsername - Can be optionally specified when resource owner password grant type is supported by this authorization server. Default resource owner username. 2367 ResourceOwnerUsername *string `json:"resourceOwnerUsername,omitempty"` 2368 // ResourceOwnerPassword - Can be optionally specified when resource owner password grant type is supported by this authorization server. Default resource owner password. 2369 ResourceOwnerPassword *string `json:"resourceOwnerPassword,omitempty"` 2370} 2371 2372// AuthorizationServerContractProperties external OAuth authorization server settings Properties. 2373type AuthorizationServerContractProperties struct { 2374 // DisplayName - User-friendly authorization server name. 2375 DisplayName *string `json:"displayName,omitempty"` 2376 // ClientRegistrationEndpoint - Optional reference to a page where client or app registration for this authorization server is performed. Contains absolute URL to entity being referenced. 2377 ClientRegistrationEndpoint *string `json:"clientRegistrationEndpoint,omitempty"` 2378 // AuthorizationEndpoint - OAuth authorization endpoint. See http://tools.ietf.org/html/rfc6749#section-3.2. 2379 AuthorizationEndpoint *string `json:"authorizationEndpoint,omitempty"` 2380 // GrantTypes - Form of an authorization grant, which the client uses to request the access token. 2381 GrantTypes *[]GrantType `json:"grantTypes,omitempty"` 2382 // ClientID - Client or app id registered with this authorization server. 2383 ClientID *string `json:"clientId,omitempty"` 2384 // Description - Description of the authorization server. Can contain HTML formatting tags. 2385 Description *string `json:"description,omitempty"` 2386 // AuthorizationMethods - HTTP verbs supported by the authorization endpoint. GET must be always present. POST is optional. 2387 AuthorizationMethods *[]AuthorizationMethod `json:"authorizationMethods,omitempty"` 2388 // 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. 2389 ClientAuthenticationMethod *[]ClientAuthenticationMethod `json:"clientAuthenticationMethod,omitempty"` 2390 // 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"}. 2391 TokenBodyParameters *[]TokenBodyParameterContract `json:"tokenBodyParameters,omitempty"` 2392 // TokenEndpoint - OAuth token endpoint. Contains absolute URI to entity being referenced. 2393 TokenEndpoint *string `json:"tokenEndpoint,omitempty"` 2394 // 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. 2395 SupportState *bool `json:"supportState,omitempty"` 2396 // 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. 2397 DefaultScope *string `json:"defaultScope,omitempty"` 2398 // BearerTokenSendingMethods - Specifies the mechanism by which access token is passed to the API. 2399 BearerTokenSendingMethods *[]BearerTokenSendingMethod `json:"bearerTokenSendingMethods,omitempty"` 2400 // ClientSecret - Client or app secret registered with this authorization server. 2401 ClientSecret *string `json:"clientSecret,omitempty"` 2402 // ResourceOwnerUsername - Can be optionally specified when resource owner password grant type is supported by this authorization server. Default resource owner username. 2403 ResourceOwnerUsername *string `json:"resourceOwnerUsername,omitempty"` 2404 // ResourceOwnerPassword - Can be optionally specified when resource owner password grant type is supported by this authorization server. Default resource owner password. 2405 ResourceOwnerPassword *string `json:"resourceOwnerPassword,omitempty"` 2406} 2407 2408// AuthorizationServerUpdateContract external OAuth authorization server settings. 2409type AuthorizationServerUpdateContract struct { 2410 // AuthorizationServerUpdateContractProperties - Properties of the External OAuth authorization server update Contract. 2411 *AuthorizationServerUpdateContractProperties `json:"properties,omitempty"` 2412 // ID - READ-ONLY; Resource ID. 2413 ID *string `json:"id,omitempty"` 2414 // Name - READ-ONLY; Resource name. 2415 Name *string `json:"name,omitempty"` 2416 // Type - READ-ONLY; Resource type for API Management resource. 2417 Type *string `json:"type,omitempty"` 2418} 2419 2420// MarshalJSON is the custom marshaler for AuthorizationServerUpdateContract. 2421func (asuc AuthorizationServerUpdateContract) MarshalJSON() ([]byte, error) { 2422 objectMap := make(map[string]interface{}) 2423 if asuc.AuthorizationServerUpdateContractProperties != nil { 2424 objectMap["properties"] = asuc.AuthorizationServerUpdateContractProperties 2425 } 2426 return json.Marshal(objectMap) 2427} 2428 2429// UnmarshalJSON is the custom unmarshaler for AuthorizationServerUpdateContract struct. 2430func (asuc *AuthorizationServerUpdateContract) UnmarshalJSON(body []byte) error { 2431 var m map[string]*json.RawMessage 2432 err := json.Unmarshal(body, &m) 2433 if err != nil { 2434 return err 2435 } 2436 for k, v := range m { 2437 switch k { 2438 case "properties": 2439 if v != nil { 2440 var authorizationServerUpdateContractProperties AuthorizationServerUpdateContractProperties 2441 err = json.Unmarshal(*v, &authorizationServerUpdateContractProperties) 2442 if err != nil { 2443 return err 2444 } 2445 asuc.AuthorizationServerUpdateContractProperties = &authorizationServerUpdateContractProperties 2446 } 2447 case "id": 2448 if v != nil { 2449 var ID string 2450 err = json.Unmarshal(*v, &ID) 2451 if err != nil { 2452 return err 2453 } 2454 asuc.ID = &ID 2455 } 2456 case "name": 2457 if v != nil { 2458 var name string 2459 err = json.Unmarshal(*v, &name) 2460 if err != nil { 2461 return err 2462 } 2463 asuc.Name = &name 2464 } 2465 case "type": 2466 if v != nil { 2467 var typeVar string 2468 err = json.Unmarshal(*v, &typeVar) 2469 if err != nil { 2470 return err 2471 } 2472 asuc.Type = &typeVar 2473 } 2474 } 2475 } 2476 2477 return nil 2478} 2479 2480// AuthorizationServerUpdateContractProperties external OAuth authorization server Update settings 2481// contract. 2482type AuthorizationServerUpdateContractProperties struct { 2483 // DisplayName - User-friendly authorization server name. 2484 DisplayName *string `json:"displayName,omitempty"` 2485 // ClientRegistrationEndpoint - Optional reference to a page where client or app registration for this authorization server is performed. Contains absolute URL to entity being referenced. 2486 ClientRegistrationEndpoint *string `json:"clientRegistrationEndpoint,omitempty"` 2487 // AuthorizationEndpoint - OAuth authorization endpoint. See http://tools.ietf.org/html/rfc6749#section-3.2. 2488 AuthorizationEndpoint *string `json:"authorizationEndpoint,omitempty"` 2489 // GrantTypes - Form of an authorization grant, which the client uses to request the access token. 2490 GrantTypes *[]GrantType `json:"grantTypes,omitempty"` 2491 // ClientID - Client or app id registered with this authorization server. 2492 ClientID *string `json:"clientId,omitempty"` 2493 // Description - Description of the authorization server. Can contain HTML formatting tags. 2494 Description *string `json:"description,omitempty"` 2495 // AuthorizationMethods - HTTP verbs supported by the authorization endpoint. GET must be always present. POST is optional. 2496 AuthorizationMethods *[]AuthorizationMethod `json:"authorizationMethods,omitempty"` 2497 // 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. 2498 ClientAuthenticationMethod *[]ClientAuthenticationMethod `json:"clientAuthenticationMethod,omitempty"` 2499 // 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"}. 2500 TokenBodyParameters *[]TokenBodyParameterContract `json:"tokenBodyParameters,omitempty"` 2501 // TokenEndpoint - OAuth token endpoint. Contains absolute URI to entity being referenced. 2502 TokenEndpoint *string `json:"tokenEndpoint,omitempty"` 2503 // 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. 2504 SupportState *bool `json:"supportState,omitempty"` 2505 // 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. 2506 DefaultScope *string `json:"defaultScope,omitempty"` 2507 // BearerTokenSendingMethods - Specifies the mechanism by which access token is passed to the API. 2508 BearerTokenSendingMethods *[]BearerTokenSendingMethod `json:"bearerTokenSendingMethods,omitempty"` 2509 // ClientSecret - Client or app secret registered with this authorization server. 2510 ClientSecret *string `json:"clientSecret,omitempty"` 2511 // ResourceOwnerUsername - Can be optionally specified when resource owner password grant type is supported by this authorization server. Default resource owner username. 2512 ResourceOwnerUsername *string `json:"resourceOwnerUsername,omitempty"` 2513 // ResourceOwnerPassword - Can be optionally specified when resource owner password grant type is supported by this authorization server. Default resource owner password. 2514 ResourceOwnerPassword *string `json:"resourceOwnerPassword,omitempty"` 2515} 2516 2517// BackendAuthorizationHeaderCredentials authorization header information. 2518type BackendAuthorizationHeaderCredentials struct { 2519 // Scheme - Authentication Scheme name. 2520 Scheme *string `json:"scheme,omitempty"` 2521 // Parameter - Authentication Parameter value. 2522 Parameter *string `json:"parameter,omitempty"` 2523} 2524 2525// BackendBaseParameters backend entity base Parameter set. 2526type BackendBaseParameters struct { 2527 // Title - Backend Title. 2528 Title *string `json:"title,omitempty"` 2529 // Description - Backend Description. 2530 Description *string `json:"description,omitempty"` 2531 // 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. 2532 ResourceID *string `json:"resourceId,omitempty"` 2533 // Properties - Backend Properties contract 2534 Properties *BackendProperties `json:"properties,omitempty"` 2535 // Credentials - Backend Credentials Contract Properties 2536 Credentials *BackendCredentialsContract `json:"credentials,omitempty"` 2537 // Proxy - Backend Proxy Contract Properties 2538 Proxy *BackendProxyContract `json:"proxy,omitempty"` 2539 // TLS - Backend TLS Properties 2540 TLS *BackendTLSProperties `json:"tls,omitempty"` 2541} 2542 2543// BackendCollection paged Backend list representation. 2544type BackendCollection struct { 2545 autorest.Response `json:"-"` 2546 // Value - Backend values. 2547 Value *[]BackendContract `json:"value,omitempty"` 2548 // NextLink - Next page link if any. 2549 NextLink *string `json:"nextLink,omitempty"` 2550} 2551 2552// BackendCollectionIterator provides access to a complete listing of BackendContract values. 2553type BackendCollectionIterator struct { 2554 i int 2555 page BackendCollectionPage 2556} 2557 2558// NextWithContext advances to the next value. If there was an error making 2559// the request the iterator does not advance and the error is returned. 2560func (iter *BackendCollectionIterator) NextWithContext(ctx context.Context) (err error) { 2561 if tracing.IsEnabled() { 2562 ctx = tracing.StartSpan(ctx, fqdn+"/BackendCollectionIterator.NextWithContext") 2563 defer func() { 2564 sc := -1 2565 if iter.Response().Response.Response != nil { 2566 sc = iter.Response().Response.Response.StatusCode 2567 } 2568 tracing.EndSpan(ctx, sc, err) 2569 }() 2570 } 2571 iter.i++ 2572 if iter.i < len(iter.page.Values()) { 2573 return nil 2574 } 2575 err = iter.page.NextWithContext(ctx) 2576 if err != nil { 2577 iter.i-- 2578 return err 2579 } 2580 iter.i = 0 2581 return nil 2582} 2583 2584// Next advances to the next value. If there was an error making 2585// the request the iterator does not advance and the error is returned. 2586// Deprecated: Use NextWithContext() instead. 2587func (iter *BackendCollectionIterator) Next() error { 2588 return iter.NextWithContext(context.Background()) 2589} 2590 2591// NotDone returns true if the enumeration should be started or is not yet complete. 2592func (iter BackendCollectionIterator) NotDone() bool { 2593 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 2594} 2595 2596// Response returns the raw server response from the last page request. 2597func (iter BackendCollectionIterator) Response() BackendCollection { 2598 return iter.page.Response() 2599} 2600 2601// Value returns the current value or a zero-initialized value if the 2602// iterator has advanced beyond the end of the collection. 2603func (iter BackendCollectionIterator) Value() BackendContract { 2604 if !iter.page.NotDone() { 2605 return BackendContract{} 2606 } 2607 return iter.page.Values()[iter.i] 2608} 2609 2610// Creates a new instance of the BackendCollectionIterator type. 2611func NewBackendCollectionIterator(page BackendCollectionPage) BackendCollectionIterator { 2612 return BackendCollectionIterator{page: page} 2613} 2614 2615// IsEmpty returns true if the ListResult contains no values. 2616func (bc BackendCollection) IsEmpty() bool { 2617 return bc.Value == nil || len(*bc.Value) == 0 2618} 2619 2620// backendCollectionPreparer prepares a request to retrieve the next set of results. 2621// It returns nil if no more results exist. 2622func (bc BackendCollection) backendCollectionPreparer(ctx context.Context) (*http.Request, error) { 2623 if bc.NextLink == nil || len(to.String(bc.NextLink)) < 1 { 2624 return nil, nil 2625 } 2626 return autorest.Prepare((&http.Request{}).WithContext(ctx), 2627 autorest.AsJSON(), 2628 autorest.AsGet(), 2629 autorest.WithBaseURL(to.String(bc.NextLink))) 2630} 2631 2632// BackendCollectionPage contains a page of BackendContract values. 2633type BackendCollectionPage struct { 2634 fn func(context.Context, BackendCollection) (BackendCollection, error) 2635 bc BackendCollection 2636} 2637 2638// NextWithContext advances to the next page of values. If there was an error making 2639// the request the page does not advance and the error is returned. 2640func (page *BackendCollectionPage) NextWithContext(ctx context.Context) (err error) { 2641 if tracing.IsEnabled() { 2642 ctx = tracing.StartSpan(ctx, fqdn+"/BackendCollectionPage.NextWithContext") 2643 defer func() { 2644 sc := -1 2645 if page.Response().Response.Response != nil { 2646 sc = page.Response().Response.Response.StatusCode 2647 } 2648 tracing.EndSpan(ctx, sc, err) 2649 }() 2650 } 2651 next, err := page.fn(ctx, page.bc) 2652 if err != nil { 2653 return err 2654 } 2655 page.bc = next 2656 return nil 2657} 2658 2659// Next advances to the next page of values. If there was an error making 2660// the request the page does not advance and the error is returned. 2661// Deprecated: Use NextWithContext() instead. 2662func (page *BackendCollectionPage) Next() error { 2663 return page.NextWithContext(context.Background()) 2664} 2665 2666// NotDone returns true if the page enumeration should be started or is not yet complete. 2667func (page BackendCollectionPage) NotDone() bool { 2668 return !page.bc.IsEmpty() 2669} 2670 2671// Response returns the raw server response from the last page request. 2672func (page BackendCollectionPage) Response() BackendCollection { 2673 return page.bc 2674} 2675 2676// Values returns the slice of values for the current page or nil if there are no values. 2677func (page BackendCollectionPage) Values() []BackendContract { 2678 if page.bc.IsEmpty() { 2679 return nil 2680 } 2681 return *page.bc.Value 2682} 2683 2684// Creates a new instance of the BackendCollectionPage type. 2685func NewBackendCollectionPage(getNextPage func(context.Context, BackendCollection) (BackendCollection, error)) BackendCollectionPage { 2686 return BackendCollectionPage{fn: getNextPage} 2687} 2688 2689// BackendContract backend details. 2690type BackendContract struct { 2691 autorest.Response `json:"-"` 2692 // BackendContractProperties - Backend entity contract properties. 2693 *BackendContractProperties `json:"properties,omitempty"` 2694 // ID - READ-ONLY; Resource ID. 2695 ID *string `json:"id,omitempty"` 2696 // Name - READ-ONLY; Resource name. 2697 Name *string `json:"name,omitempty"` 2698 // Type - READ-ONLY; Resource type for API Management resource. 2699 Type *string `json:"type,omitempty"` 2700} 2701 2702// MarshalJSON is the custom marshaler for BackendContract. 2703func (bc BackendContract) MarshalJSON() ([]byte, error) { 2704 objectMap := make(map[string]interface{}) 2705 if bc.BackendContractProperties != nil { 2706 objectMap["properties"] = bc.BackendContractProperties 2707 } 2708 return json.Marshal(objectMap) 2709} 2710 2711// UnmarshalJSON is the custom unmarshaler for BackendContract struct. 2712func (bc *BackendContract) UnmarshalJSON(body []byte) error { 2713 var m map[string]*json.RawMessage 2714 err := json.Unmarshal(body, &m) 2715 if err != nil { 2716 return err 2717 } 2718 for k, v := range m { 2719 switch k { 2720 case "properties": 2721 if v != nil { 2722 var backendContractProperties BackendContractProperties 2723 err = json.Unmarshal(*v, &backendContractProperties) 2724 if err != nil { 2725 return err 2726 } 2727 bc.BackendContractProperties = &backendContractProperties 2728 } 2729 case "id": 2730 if v != nil { 2731 var ID string 2732 err = json.Unmarshal(*v, &ID) 2733 if err != nil { 2734 return err 2735 } 2736 bc.ID = &ID 2737 } 2738 case "name": 2739 if v != nil { 2740 var name string 2741 err = json.Unmarshal(*v, &name) 2742 if err != nil { 2743 return err 2744 } 2745 bc.Name = &name 2746 } 2747 case "type": 2748 if v != nil { 2749 var typeVar string 2750 err = json.Unmarshal(*v, &typeVar) 2751 if err != nil { 2752 return err 2753 } 2754 bc.Type = &typeVar 2755 } 2756 } 2757 } 2758 2759 return nil 2760} 2761 2762// BackendContractProperties parameters supplied to the Create Backend operation. 2763type BackendContractProperties struct { 2764 // URL - Runtime Url of the Backend. 2765 URL *string `json:"url,omitempty"` 2766 // Protocol - Backend communication protocol. Possible values include: 'BackendProtocolHTTP', 'BackendProtocolSoap' 2767 Protocol BackendProtocol `json:"protocol,omitempty"` 2768 // Title - Backend Title. 2769 Title *string `json:"title,omitempty"` 2770 // Description - Backend Description. 2771 Description *string `json:"description,omitempty"` 2772 // 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. 2773 ResourceID *string `json:"resourceId,omitempty"` 2774 // Properties - Backend Properties contract 2775 Properties *BackendProperties `json:"properties,omitempty"` 2776 // Credentials - Backend Credentials Contract Properties 2777 Credentials *BackendCredentialsContract `json:"credentials,omitempty"` 2778 // Proxy - Backend Proxy Contract Properties 2779 Proxy *BackendProxyContract `json:"proxy,omitempty"` 2780 // TLS - Backend TLS Properties 2781 TLS *BackendTLSProperties `json:"tls,omitempty"` 2782} 2783 2784// BackendCredentialsContract details of the Credentials used to connect to Backend. 2785type BackendCredentialsContract struct { 2786 // Certificate - List of Client Certificate Thumbprint. 2787 Certificate *[]string `json:"certificate,omitempty"` 2788 // Query - Query Parameter description. 2789 Query map[string][]string `json:"query"` 2790 // Header - Header Parameter description. 2791 Header map[string][]string `json:"header"` 2792 // Authorization - Authorization header authentication 2793 Authorization *BackendAuthorizationHeaderCredentials `json:"authorization,omitempty"` 2794} 2795 2796// MarshalJSON is the custom marshaler for BackendCredentialsContract. 2797func (bcc BackendCredentialsContract) MarshalJSON() ([]byte, error) { 2798 objectMap := make(map[string]interface{}) 2799 if bcc.Certificate != nil { 2800 objectMap["certificate"] = bcc.Certificate 2801 } 2802 if bcc.Query != nil { 2803 objectMap["query"] = bcc.Query 2804 } 2805 if bcc.Header != nil { 2806 objectMap["header"] = bcc.Header 2807 } 2808 if bcc.Authorization != nil { 2809 objectMap["authorization"] = bcc.Authorization 2810 } 2811 return json.Marshal(objectMap) 2812} 2813 2814// BackendProperties properties specific to the Backend Type. 2815type BackendProperties struct { 2816 // ServiceFabricCluster - Backend Service Fabric Cluster Properties 2817 ServiceFabricCluster *BackendServiceFabricClusterProperties `json:"serviceFabricCluster,omitempty"` 2818} 2819 2820// BackendProxyContract details of the Backend WebProxy Server to use in the Request to Backend. 2821type BackendProxyContract struct { 2822 // URL - WebProxy Server AbsoluteUri property which includes the entire URI stored in the Uri instance, including all fragments and query strings. 2823 URL *string `json:"url,omitempty"` 2824 // Username - Username to connect to the WebProxy server 2825 Username *string `json:"username,omitempty"` 2826 // Password - Password to connect to the WebProxy Server 2827 Password *string `json:"password,omitempty"` 2828} 2829 2830// BackendReconnectContract reconnect request parameters. 2831type BackendReconnectContract struct { 2832 // BackendReconnectProperties - Reconnect request properties. 2833 *BackendReconnectProperties `json:"properties,omitempty"` 2834 // ID - READ-ONLY; Resource ID. 2835 ID *string `json:"id,omitempty"` 2836 // Name - READ-ONLY; Resource name. 2837 Name *string `json:"name,omitempty"` 2838 // Type - READ-ONLY; Resource type for API Management resource. 2839 Type *string `json:"type,omitempty"` 2840} 2841 2842// MarshalJSON is the custom marshaler for BackendReconnectContract. 2843func (brc BackendReconnectContract) MarshalJSON() ([]byte, error) { 2844 objectMap := make(map[string]interface{}) 2845 if brc.BackendReconnectProperties != nil { 2846 objectMap["properties"] = brc.BackendReconnectProperties 2847 } 2848 return json.Marshal(objectMap) 2849} 2850 2851// UnmarshalJSON is the custom unmarshaler for BackendReconnectContract struct. 2852func (brc *BackendReconnectContract) UnmarshalJSON(body []byte) error { 2853 var m map[string]*json.RawMessage 2854 err := json.Unmarshal(body, &m) 2855 if err != nil { 2856 return err 2857 } 2858 for k, v := range m { 2859 switch k { 2860 case "properties": 2861 if v != nil { 2862 var backendReconnectProperties BackendReconnectProperties 2863 err = json.Unmarshal(*v, &backendReconnectProperties) 2864 if err != nil { 2865 return err 2866 } 2867 brc.BackendReconnectProperties = &backendReconnectProperties 2868 } 2869 case "id": 2870 if v != nil { 2871 var ID string 2872 err = json.Unmarshal(*v, &ID) 2873 if err != nil { 2874 return err 2875 } 2876 brc.ID = &ID 2877 } 2878 case "name": 2879 if v != nil { 2880 var name string 2881 err = json.Unmarshal(*v, &name) 2882 if err != nil { 2883 return err 2884 } 2885 brc.Name = &name 2886 } 2887 case "type": 2888 if v != nil { 2889 var typeVar string 2890 err = json.Unmarshal(*v, &typeVar) 2891 if err != nil { 2892 return err 2893 } 2894 brc.Type = &typeVar 2895 } 2896 } 2897 } 2898 2899 return nil 2900} 2901 2902// BackendReconnectProperties properties to control reconnect requests. 2903type BackendReconnectProperties struct { 2904 // After - Duration in ISO8601 format after which reconnect will be initiated. Minimum duration of the Reconnect is PT2M. 2905 After *string `json:"after,omitempty"` 2906} 2907 2908// BackendServiceFabricClusterProperties properties of the Service Fabric Type Backend. 2909type BackendServiceFabricClusterProperties struct { 2910 // ClientCertificatethumbprint - The client certificate thumbprint for the management endpoint. 2911 ClientCertificatethumbprint *string `json:"clientCertificatethumbprint,omitempty"` 2912 // MaxPartitionResolutionRetries - Maximum number of retries while attempting resolve the partition. 2913 MaxPartitionResolutionRetries *int32 `json:"maxPartitionResolutionRetries,omitempty"` 2914 // ManagementEndpoints - The cluster management endpoint. 2915 ManagementEndpoints *[]string `json:"managementEndpoints,omitempty"` 2916 // ServerCertificateThumbprints - Thumbprints of certificates cluster management service uses for tls communication 2917 ServerCertificateThumbprints *[]string `json:"serverCertificateThumbprints,omitempty"` 2918 // ServerX509Names - Server X509 Certificate Names Collection 2919 ServerX509Names *[]X509CertificateName `json:"serverX509Names,omitempty"` 2920} 2921 2922// BackendTLSProperties properties controlling TLS Certificate Validation. 2923type BackendTLSProperties struct { 2924 // ValidateCertificateChain - Flag indicating whether SSL certificate chain validation should be done when using self-signed certificates for this backend host. 2925 ValidateCertificateChain *bool `json:"validateCertificateChain,omitempty"` 2926 // ValidateCertificateName - Flag indicating whether SSL certificate name validation should be done when using self-signed certificates for this backend host. 2927 ValidateCertificateName *bool `json:"validateCertificateName,omitempty"` 2928} 2929 2930// BackendUpdateParameterProperties parameters supplied to the Update Backend operation. 2931type BackendUpdateParameterProperties struct { 2932 // URL - Runtime Url of the Backend. 2933 URL *string `json:"url,omitempty"` 2934 // Protocol - Backend communication protocol. Possible values include: 'BackendProtocolHTTP', 'BackendProtocolSoap' 2935 Protocol BackendProtocol `json:"protocol,omitempty"` 2936 // Title - Backend Title. 2937 Title *string `json:"title,omitempty"` 2938 // Description - Backend Description. 2939 Description *string `json:"description,omitempty"` 2940 // 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. 2941 ResourceID *string `json:"resourceId,omitempty"` 2942 // Properties - Backend Properties contract 2943 Properties *BackendProperties `json:"properties,omitempty"` 2944 // Credentials - Backend Credentials Contract Properties 2945 Credentials *BackendCredentialsContract `json:"credentials,omitempty"` 2946 // Proxy - Backend Proxy Contract Properties 2947 Proxy *BackendProxyContract `json:"proxy,omitempty"` 2948 // TLS - Backend TLS Properties 2949 TLS *BackendTLSProperties `json:"tls,omitempty"` 2950} 2951 2952// BackendUpdateParameters backend update parameters. 2953type BackendUpdateParameters struct { 2954 // BackendUpdateParameterProperties - Backend entity update contract properties. 2955 *BackendUpdateParameterProperties `json:"properties,omitempty"` 2956} 2957 2958// MarshalJSON is the custom marshaler for BackendUpdateParameters. 2959func (bup BackendUpdateParameters) MarshalJSON() ([]byte, error) { 2960 objectMap := make(map[string]interface{}) 2961 if bup.BackendUpdateParameterProperties != nil { 2962 objectMap["properties"] = bup.BackendUpdateParameterProperties 2963 } 2964 return json.Marshal(objectMap) 2965} 2966 2967// UnmarshalJSON is the custom unmarshaler for BackendUpdateParameters struct. 2968func (bup *BackendUpdateParameters) UnmarshalJSON(body []byte) error { 2969 var m map[string]*json.RawMessage 2970 err := json.Unmarshal(body, &m) 2971 if err != nil { 2972 return err 2973 } 2974 for k, v := range m { 2975 switch k { 2976 case "properties": 2977 if v != nil { 2978 var backendUpdateParameterProperties BackendUpdateParameterProperties 2979 err = json.Unmarshal(*v, &backendUpdateParameterProperties) 2980 if err != nil { 2981 return err 2982 } 2983 bup.BackendUpdateParameterProperties = &backendUpdateParameterProperties 2984 } 2985 } 2986 } 2987 2988 return nil 2989} 2990 2991// BodyDiagnosticSettings body logging settings. 2992type BodyDiagnosticSettings struct { 2993 // Bytes - Number of request body bytes to log. 2994 Bytes *int32 `json:"bytes,omitempty"` 2995} 2996 2997// CacheCollection paged Caches list representation. 2998type CacheCollection struct { 2999 autorest.Response `json:"-"` 3000 // Value - Page values. 3001 Value *[]CacheContract `json:"value,omitempty"` 3002 // NextLink - Next page link if any. 3003 NextLink *string `json:"nextLink,omitempty"` 3004} 3005 3006// CacheCollectionIterator provides access to a complete listing of CacheContract values. 3007type CacheCollectionIterator struct { 3008 i int 3009 page CacheCollectionPage 3010} 3011 3012// NextWithContext advances to the next value. If there was an error making 3013// the request the iterator does not advance and the error is returned. 3014func (iter *CacheCollectionIterator) NextWithContext(ctx context.Context) (err error) { 3015 if tracing.IsEnabled() { 3016 ctx = tracing.StartSpan(ctx, fqdn+"/CacheCollectionIterator.NextWithContext") 3017 defer func() { 3018 sc := -1 3019 if iter.Response().Response.Response != nil { 3020 sc = iter.Response().Response.Response.StatusCode 3021 } 3022 tracing.EndSpan(ctx, sc, err) 3023 }() 3024 } 3025 iter.i++ 3026 if iter.i < len(iter.page.Values()) { 3027 return nil 3028 } 3029 err = iter.page.NextWithContext(ctx) 3030 if err != nil { 3031 iter.i-- 3032 return err 3033 } 3034 iter.i = 0 3035 return nil 3036} 3037 3038// Next advances to the next value. If there was an error making 3039// the request the iterator does not advance and the error is returned. 3040// Deprecated: Use NextWithContext() instead. 3041func (iter *CacheCollectionIterator) Next() error { 3042 return iter.NextWithContext(context.Background()) 3043} 3044 3045// NotDone returns true if the enumeration should be started or is not yet complete. 3046func (iter CacheCollectionIterator) NotDone() bool { 3047 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 3048} 3049 3050// Response returns the raw server response from the last page request. 3051func (iter CacheCollectionIterator) Response() CacheCollection { 3052 return iter.page.Response() 3053} 3054 3055// Value returns the current value or a zero-initialized value if the 3056// iterator has advanced beyond the end of the collection. 3057func (iter CacheCollectionIterator) Value() CacheContract { 3058 if !iter.page.NotDone() { 3059 return CacheContract{} 3060 } 3061 return iter.page.Values()[iter.i] 3062} 3063 3064// Creates a new instance of the CacheCollectionIterator type. 3065func NewCacheCollectionIterator(page CacheCollectionPage) CacheCollectionIterator { 3066 return CacheCollectionIterator{page: page} 3067} 3068 3069// IsEmpty returns true if the ListResult contains no values. 3070func (cc CacheCollection) IsEmpty() bool { 3071 return cc.Value == nil || len(*cc.Value) == 0 3072} 3073 3074// cacheCollectionPreparer prepares a request to retrieve the next set of results. 3075// It returns nil if no more results exist. 3076func (cc CacheCollection) cacheCollectionPreparer(ctx context.Context) (*http.Request, error) { 3077 if cc.NextLink == nil || len(to.String(cc.NextLink)) < 1 { 3078 return nil, nil 3079 } 3080 return autorest.Prepare((&http.Request{}).WithContext(ctx), 3081 autorest.AsJSON(), 3082 autorest.AsGet(), 3083 autorest.WithBaseURL(to.String(cc.NextLink))) 3084} 3085 3086// CacheCollectionPage contains a page of CacheContract values. 3087type CacheCollectionPage struct { 3088 fn func(context.Context, CacheCollection) (CacheCollection, error) 3089 cc CacheCollection 3090} 3091 3092// NextWithContext advances to the next page of values. If there was an error making 3093// the request the page does not advance and the error is returned. 3094func (page *CacheCollectionPage) NextWithContext(ctx context.Context) (err error) { 3095 if tracing.IsEnabled() { 3096 ctx = tracing.StartSpan(ctx, fqdn+"/CacheCollectionPage.NextWithContext") 3097 defer func() { 3098 sc := -1 3099 if page.Response().Response.Response != nil { 3100 sc = page.Response().Response.Response.StatusCode 3101 } 3102 tracing.EndSpan(ctx, sc, err) 3103 }() 3104 } 3105 next, err := page.fn(ctx, page.cc) 3106 if err != nil { 3107 return err 3108 } 3109 page.cc = next 3110 return nil 3111} 3112 3113// Next advances to the next page of values. If there was an error making 3114// the request the page does not advance and the error is returned. 3115// Deprecated: Use NextWithContext() instead. 3116func (page *CacheCollectionPage) Next() error { 3117 return page.NextWithContext(context.Background()) 3118} 3119 3120// NotDone returns true if the page enumeration should be started or is not yet complete. 3121func (page CacheCollectionPage) NotDone() bool { 3122 return !page.cc.IsEmpty() 3123} 3124 3125// Response returns the raw server response from the last page request. 3126func (page CacheCollectionPage) Response() CacheCollection { 3127 return page.cc 3128} 3129 3130// Values returns the slice of values for the current page or nil if there are no values. 3131func (page CacheCollectionPage) Values() []CacheContract { 3132 if page.cc.IsEmpty() { 3133 return nil 3134 } 3135 return *page.cc.Value 3136} 3137 3138// Creates a new instance of the CacheCollectionPage type. 3139func NewCacheCollectionPage(getNextPage func(context.Context, CacheCollection) (CacheCollection, error)) CacheCollectionPage { 3140 return CacheCollectionPage{fn: getNextPage} 3141} 3142 3143// CacheContract cache details. 3144type CacheContract struct { 3145 autorest.Response `json:"-"` 3146 // CacheContractProperties - Cache properties details. 3147 *CacheContractProperties `json:"properties,omitempty"` 3148 // ID - READ-ONLY; Resource ID. 3149 ID *string `json:"id,omitempty"` 3150 // Name - READ-ONLY; Resource name. 3151 Name *string `json:"name,omitempty"` 3152 // Type - READ-ONLY; Resource type for API Management resource. 3153 Type *string `json:"type,omitempty"` 3154} 3155 3156// MarshalJSON is the custom marshaler for CacheContract. 3157func (cc CacheContract) MarshalJSON() ([]byte, error) { 3158 objectMap := make(map[string]interface{}) 3159 if cc.CacheContractProperties != nil { 3160 objectMap["properties"] = cc.CacheContractProperties 3161 } 3162 return json.Marshal(objectMap) 3163} 3164 3165// UnmarshalJSON is the custom unmarshaler for CacheContract struct. 3166func (cc *CacheContract) UnmarshalJSON(body []byte) error { 3167 var m map[string]*json.RawMessage 3168 err := json.Unmarshal(body, &m) 3169 if err != nil { 3170 return err 3171 } 3172 for k, v := range m { 3173 switch k { 3174 case "properties": 3175 if v != nil { 3176 var cacheContractProperties CacheContractProperties 3177 err = json.Unmarshal(*v, &cacheContractProperties) 3178 if err != nil { 3179 return err 3180 } 3181 cc.CacheContractProperties = &cacheContractProperties 3182 } 3183 case "id": 3184 if v != nil { 3185 var ID string 3186 err = json.Unmarshal(*v, &ID) 3187 if err != nil { 3188 return err 3189 } 3190 cc.ID = &ID 3191 } 3192 case "name": 3193 if v != nil { 3194 var name string 3195 err = json.Unmarshal(*v, &name) 3196 if err != nil { 3197 return err 3198 } 3199 cc.Name = &name 3200 } 3201 case "type": 3202 if v != nil { 3203 var typeVar string 3204 err = json.Unmarshal(*v, &typeVar) 3205 if err != nil { 3206 return err 3207 } 3208 cc.Type = &typeVar 3209 } 3210 } 3211 } 3212 3213 return nil 3214} 3215 3216// CacheContractProperties properties of the Cache contract. 3217type CacheContractProperties struct { 3218 // Description - Cache description 3219 Description *string `json:"description,omitempty"` 3220 // ConnectionString - Runtime connection string to cache 3221 ConnectionString *string `json:"connectionString,omitempty"` 3222 // ResourceID - Original uri of entity in external system cache points to 3223 ResourceID *string `json:"resourceId,omitempty"` 3224} 3225 3226// CacheUpdateParameters cache update details. 3227type CacheUpdateParameters struct { 3228 // CacheUpdateProperties - Cache update properties details. 3229 *CacheUpdateProperties `json:"properties,omitempty"` 3230} 3231 3232// MarshalJSON is the custom marshaler for CacheUpdateParameters. 3233func (cup CacheUpdateParameters) MarshalJSON() ([]byte, error) { 3234 objectMap := make(map[string]interface{}) 3235 if cup.CacheUpdateProperties != nil { 3236 objectMap["properties"] = cup.CacheUpdateProperties 3237 } 3238 return json.Marshal(objectMap) 3239} 3240 3241// UnmarshalJSON is the custom unmarshaler for CacheUpdateParameters struct. 3242func (cup *CacheUpdateParameters) UnmarshalJSON(body []byte) error { 3243 var m map[string]*json.RawMessage 3244 err := json.Unmarshal(body, &m) 3245 if err != nil { 3246 return err 3247 } 3248 for k, v := range m { 3249 switch k { 3250 case "properties": 3251 if v != nil { 3252 var cacheUpdateProperties CacheUpdateProperties 3253 err = json.Unmarshal(*v, &cacheUpdateProperties) 3254 if err != nil { 3255 return err 3256 } 3257 cup.CacheUpdateProperties = &cacheUpdateProperties 3258 } 3259 } 3260 } 3261 3262 return nil 3263} 3264 3265// CacheUpdateProperties parameters supplied to the Update Cache operation. 3266type CacheUpdateProperties struct { 3267 // Description - Cache description 3268 Description *string `json:"description,omitempty"` 3269 // ConnectionString - Runtime connection string to cache 3270 ConnectionString *string `json:"connectionString,omitempty"` 3271 // ResourceID - Original uri of entity in external system cache points to 3272 ResourceID *string `json:"resourceId,omitempty"` 3273} 3274 3275// CertificateCollection paged Certificates list representation. 3276type CertificateCollection struct { 3277 autorest.Response `json:"-"` 3278 // Value - Page values. 3279 Value *[]CertificateContract `json:"value,omitempty"` 3280 // NextLink - Next page link if any. 3281 NextLink *string `json:"nextLink,omitempty"` 3282} 3283 3284// CertificateCollectionIterator provides access to a complete listing of CertificateContract values. 3285type CertificateCollectionIterator struct { 3286 i int 3287 page CertificateCollectionPage 3288} 3289 3290// NextWithContext advances to the next value. If there was an error making 3291// the request the iterator does not advance and the error is returned. 3292func (iter *CertificateCollectionIterator) NextWithContext(ctx context.Context) (err error) { 3293 if tracing.IsEnabled() { 3294 ctx = tracing.StartSpan(ctx, fqdn+"/CertificateCollectionIterator.NextWithContext") 3295 defer func() { 3296 sc := -1 3297 if iter.Response().Response.Response != nil { 3298 sc = iter.Response().Response.Response.StatusCode 3299 } 3300 tracing.EndSpan(ctx, sc, err) 3301 }() 3302 } 3303 iter.i++ 3304 if iter.i < len(iter.page.Values()) { 3305 return nil 3306 } 3307 err = iter.page.NextWithContext(ctx) 3308 if err != nil { 3309 iter.i-- 3310 return err 3311 } 3312 iter.i = 0 3313 return nil 3314} 3315 3316// Next advances to the next value. If there was an error making 3317// the request the iterator does not advance and the error is returned. 3318// Deprecated: Use NextWithContext() instead. 3319func (iter *CertificateCollectionIterator) Next() error { 3320 return iter.NextWithContext(context.Background()) 3321} 3322 3323// NotDone returns true if the enumeration should be started or is not yet complete. 3324func (iter CertificateCollectionIterator) NotDone() bool { 3325 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 3326} 3327 3328// Response returns the raw server response from the last page request. 3329func (iter CertificateCollectionIterator) Response() CertificateCollection { 3330 return iter.page.Response() 3331} 3332 3333// Value returns the current value or a zero-initialized value if the 3334// iterator has advanced beyond the end of the collection. 3335func (iter CertificateCollectionIterator) Value() CertificateContract { 3336 if !iter.page.NotDone() { 3337 return CertificateContract{} 3338 } 3339 return iter.page.Values()[iter.i] 3340} 3341 3342// Creates a new instance of the CertificateCollectionIterator type. 3343func NewCertificateCollectionIterator(page CertificateCollectionPage) CertificateCollectionIterator { 3344 return CertificateCollectionIterator{page: page} 3345} 3346 3347// IsEmpty returns true if the ListResult contains no values. 3348func (cc CertificateCollection) IsEmpty() bool { 3349 return cc.Value == nil || len(*cc.Value) == 0 3350} 3351 3352// certificateCollectionPreparer prepares a request to retrieve the next set of results. 3353// It returns nil if no more results exist. 3354func (cc CertificateCollection) certificateCollectionPreparer(ctx context.Context) (*http.Request, error) { 3355 if cc.NextLink == nil || len(to.String(cc.NextLink)) < 1 { 3356 return nil, nil 3357 } 3358 return autorest.Prepare((&http.Request{}).WithContext(ctx), 3359 autorest.AsJSON(), 3360 autorest.AsGet(), 3361 autorest.WithBaseURL(to.String(cc.NextLink))) 3362} 3363 3364// CertificateCollectionPage contains a page of CertificateContract values. 3365type CertificateCollectionPage struct { 3366 fn func(context.Context, CertificateCollection) (CertificateCollection, error) 3367 cc CertificateCollection 3368} 3369 3370// NextWithContext advances to the next page of values. If there was an error making 3371// the request the page does not advance and the error is returned. 3372func (page *CertificateCollectionPage) NextWithContext(ctx context.Context) (err error) { 3373 if tracing.IsEnabled() { 3374 ctx = tracing.StartSpan(ctx, fqdn+"/CertificateCollectionPage.NextWithContext") 3375 defer func() { 3376 sc := -1 3377 if page.Response().Response.Response != nil { 3378 sc = page.Response().Response.Response.StatusCode 3379 } 3380 tracing.EndSpan(ctx, sc, err) 3381 }() 3382 } 3383 next, err := page.fn(ctx, page.cc) 3384 if err != nil { 3385 return err 3386 } 3387 page.cc = next 3388 return nil 3389} 3390 3391// Next advances to the next page of values. If there was an error making 3392// the request the page does not advance and the error is returned. 3393// Deprecated: Use NextWithContext() instead. 3394func (page *CertificateCollectionPage) Next() error { 3395 return page.NextWithContext(context.Background()) 3396} 3397 3398// NotDone returns true if the page enumeration should be started or is not yet complete. 3399func (page CertificateCollectionPage) NotDone() bool { 3400 return !page.cc.IsEmpty() 3401} 3402 3403// Response returns the raw server response from the last page request. 3404func (page CertificateCollectionPage) Response() CertificateCollection { 3405 return page.cc 3406} 3407 3408// Values returns the slice of values for the current page or nil if there are no values. 3409func (page CertificateCollectionPage) Values() []CertificateContract { 3410 if page.cc.IsEmpty() { 3411 return nil 3412 } 3413 return *page.cc.Value 3414} 3415 3416// Creates a new instance of the CertificateCollectionPage type. 3417func NewCertificateCollectionPage(getNextPage func(context.Context, CertificateCollection) (CertificateCollection, error)) CertificateCollectionPage { 3418 return CertificateCollectionPage{fn: getNextPage} 3419} 3420 3421// CertificateConfiguration certificate configuration which consist of non-trusted intermediates and root 3422// certificates. 3423type CertificateConfiguration struct { 3424 // EncodedCertificate - Base64 Encoded certificate. 3425 EncodedCertificate *string `json:"encodedCertificate,omitempty"` 3426 // CertificatePassword - Certificate Password. 3427 CertificatePassword *string `json:"certificatePassword,omitempty"` 3428 // StoreName - The System.Security.Cryptography.x509certificates.StoreName certificate store location. Only Root and CertificateAuthority are valid locations. Possible values include: 'CertificateAuthority', 'Root' 3429 StoreName StoreName `json:"storeName,omitempty"` 3430 // Certificate - Certificate information. 3431 Certificate *CertificateInformation `json:"certificate,omitempty"` 3432} 3433 3434// CertificateContract certificate details. 3435type CertificateContract struct { 3436 autorest.Response `json:"-"` 3437 // CertificateContractProperties - Certificate properties details. 3438 *CertificateContractProperties `json:"properties,omitempty"` 3439 // ID - READ-ONLY; Resource ID. 3440 ID *string `json:"id,omitempty"` 3441 // Name - READ-ONLY; Resource name. 3442 Name *string `json:"name,omitempty"` 3443 // Type - READ-ONLY; Resource type for API Management resource. 3444 Type *string `json:"type,omitempty"` 3445} 3446 3447// MarshalJSON is the custom marshaler for CertificateContract. 3448func (cc CertificateContract) MarshalJSON() ([]byte, error) { 3449 objectMap := make(map[string]interface{}) 3450 if cc.CertificateContractProperties != nil { 3451 objectMap["properties"] = cc.CertificateContractProperties 3452 } 3453 return json.Marshal(objectMap) 3454} 3455 3456// UnmarshalJSON is the custom unmarshaler for CertificateContract struct. 3457func (cc *CertificateContract) UnmarshalJSON(body []byte) error { 3458 var m map[string]*json.RawMessage 3459 err := json.Unmarshal(body, &m) 3460 if err != nil { 3461 return err 3462 } 3463 for k, v := range m { 3464 switch k { 3465 case "properties": 3466 if v != nil { 3467 var certificateContractProperties CertificateContractProperties 3468 err = json.Unmarshal(*v, &certificateContractProperties) 3469 if err != nil { 3470 return err 3471 } 3472 cc.CertificateContractProperties = &certificateContractProperties 3473 } 3474 case "id": 3475 if v != nil { 3476 var ID string 3477 err = json.Unmarshal(*v, &ID) 3478 if err != nil { 3479 return err 3480 } 3481 cc.ID = &ID 3482 } 3483 case "name": 3484 if v != nil { 3485 var name string 3486 err = json.Unmarshal(*v, &name) 3487 if err != nil { 3488 return err 3489 } 3490 cc.Name = &name 3491 } 3492 case "type": 3493 if v != nil { 3494 var typeVar string 3495 err = json.Unmarshal(*v, &typeVar) 3496 if err != nil { 3497 return err 3498 } 3499 cc.Type = &typeVar 3500 } 3501 } 3502 } 3503 3504 return nil 3505} 3506 3507// CertificateContractProperties properties of the Certificate contract. 3508type CertificateContractProperties struct { 3509 // Subject - Subject attribute of the certificate. 3510 Subject *string `json:"subject,omitempty"` 3511 // Thumbprint - Thumbprint of the certificate. 3512 Thumbprint *string `json:"thumbprint,omitempty"` 3513 // 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. 3514 ExpirationDate *date.Time `json:"expirationDate,omitempty"` 3515} 3516 3517// CertificateCreateOrUpdateParameters certificate create or update details. 3518type CertificateCreateOrUpdateParameters struct { 3519 // CertificateCreateOrUpdateProperties - Certificate create or update properties details. 3520 *CertificateCreateOrUpdateProperties `json:"properties,omitempty"` 3521} 3522 3523// MarshalJSON is the custom marshaler for CertificateCreateOrUpdateParameters. 3524func (ccoup CertificateCreateOrUpdateParameters) MarshalJSON() ([]byte, error) { 3525 objectMap := make(map[string]interface{}) 3526 if ccoup.CertificateCreateOrUpdateProperties != nil { 3527 objectMap["properties"] = ccoup.CertificateCreateOrUpdateProperties 3528 } 3529 return json.Marshal(objectMap) 3530} 3531 3532// UnmarshalJSON is the custom unmarshaler for CertificateCreateOrUpdateParameters struct. 3533func (ccoup *CertificateCreateOrUpdateParameters) UnmarshalJSON(body []byte) error { 3534 var m map[string]*json.RawMessage 3535 err := json.Unmarshal(body, &m) 3536 if err != nil { 3537 return err 3538 } 3539 for k, v := range m { 3540 switch k { 3541 case "properties": 3542 if v != nil { 3543 var certificateCreateOrUpdateProperties CertificateCreateOrUpdateProperties 3544 err = json.Unmarshal(*v, &certificateCreateOrUpdateProperties) 3545 if err != nil { 3546 return err 3547 } 3548 ccoup.CertificateCreateOrUpdateProperties = &certificateCreateOrUpdateProperties 3549 } 3550 } 3551 } 3552 3553 return nil 3554} 3555 3556// CertificateCreateOrUpdateProperties parameters supplied to the CreateOrUpdate certificate operation. 3557type CertificateCreateOrUpdateProperties struct { 3558 // Data - Base 64 encoded certificate using the application/x-pkcs12 representation. 3559 Data *string `json:"data,omitempty"` 3560 // Password - Password for the Certificate 3561 Password *string `json:"password,omitempty"` 3562} 3563 3564// CertificateInformation SSL certificate information. 3565type CertificateInformation struct { 3566 // 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. 3567 Expiry *date.Time `json:"expiry,omitempty"` 3568 // Thumbprint - Thumbprint of the certificate. 3569 Thumbprint *string `json:"thumbprint,omitempty"` 3570 // Subject - Subject of the certificate. 3571 Subject *string `json:"subject,omitempty"` 3572} 3573 3574// ConnectivityStatusContract details about connectivity to a resource. 3575type ConnectivityStatusContract struct { 3576 // 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. 3577 Name *string `json:"name,omitempty"` 3578 // Status - Resource Connectivity Status Type identifier. Possible values include: 'Initializing', 'Success', 'Failure' 3579 Status ConnectivityStatusType `json:"status,omitempty"` 3580 // Error - Error details of the connectivity to the resource. 3581 Error *string `json:"error,omitempty"` 3582 // 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. 3583 LastUpdated *date.Time `json:"lastUpdated,omitempty"` 3584 // 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. 3585 LastStatusChange *date.Time `json:"lastStatusChange,omitempty"` 3586} 3587 3588// DeployConfigurationParameterProperties parameters supplied to the Deploy Configuration operation. 3589type DeployConfigurationParameterProperties struct { 3590 // Branch - The name of the Git branch from which the configuration is to be deployed to the configuration database. 3591 Branch *string `json:"branch,omitempty"` 3592 // Force - The value enforcing deleting subscriptions to products that are deleted in this update. 3593 Force *bool `json:"force,omitempty"` 3594} 3595 3596// DeployConfigurationParameters deploy Tenant Configuration Contract. 3597type DeployConfigurationParameters struct { 3598 // DeployConfigurationParameterProperties - Deploy Configuration Parameter contract properties. 3599 *DeployConfigurationParameterProperties `json:"properties,omitempty"` 3600} 3601 3602// MarshalJSON is the custom marshaler for DeployConfigurationParameters. 3603func (dcp DeployConfigurationParameters) MarshalJSON() ([]byte, error) { 3604 objectMap := make(map[string]interface{}) 3605 if dcp.DeployConfigurationParameterProperties != nil { 3606 objectMap["properties"] = dcp.DeployConfigurationParameterProperties 3607 } 3608 return json.Marshal(objectMap) 3609} 3610 3611// UnmarshalJSON is the custom unmarshaler for DeployConfigurationParameters struct. 3612func (dcp *DeployConfigurationParameters) UnmarshalJSON(body []byte) error { 3613 var m map[string]*json.RawMessage 3614 err := json.Unmarshal(body, &m) 3615 if err != nil { 3616 return err 3617 } 3618 for k, v := range m { 3619 switch k { 3620 case "properties": 3621 if v != nil { 3622 var deployConfigurationParameterProperties DeployConfigurationParameterProperties 3623 err = json.Unmarshal(*v, &deployConfigurationParameterProperties) 3624 if err != nil { 3625 return err 3626 } 3627 dcp.DeployConfigurationParameterProperties = &deployConfigurationParameterProperties 3628 } 3629 } 3630 } 3631 3632 return nil 3633} 3634 3635// DiagnosticCollection paged Diagnostic list representation. 3636type DiagnosticCollection struct { 3637 autorest.Response `json:"-"` 3638 // Value - Page values. 3639 Value *[]DiagnosticContract `json:"value,omitempty"` 3640 // NextLink - Next page link if any. 3641 NextLink *string `json:"nextLink,omitempty"` 3642} 3643 3644// DiagnosticCollectionIterator provides access to a complete listing of DiagnosticContract values. 3645type DiagnosticCollectionIterator struct { 3646 i int 3647 page DiagnosticCollectionPage 3648} 3649 3650// NextWithContext advances to the next value. If there was an error making 3651// the request the iterator does not advance and the error is returned. 3652func (iter *DiagnosticCollectionIterator) NextWithContext(ctx context.Context) (err error) { 3653 if tracing.IsEnabled() { 3654 ctx = tracing.StartSpan(ctx, fqdn+"/DiagnosticCollectionIterator.NextWithContext") 3655 defer func() { 3656 sc := -1 3657 if iter.Response().Response.Response != nil { 3658 sc = iter.Response().Response.Response.StatusCode 3659 } 3660 tracing.EndSpan(ctx, sc, err) 3661 }() 3662 } 3663 iter.i++ 3664 if iter.i < len(iter.page.Values()) { 3665 return nil 3666 } 3667 err = iter.page.NextWithContext(ctx) 3668 if err != nil { 3669 iter.i-- 3670 return err 3671 } 3672 iter.i = 0 3673 return nil 3674} 3675 3676// Next advances to the next value. If there was an error making 3677// the request the iterator does not advance and the error is returned. 3678// Deprecated: Use NextWithContext() instead. 3679func (iter *DiagnosticCollectionIterator) Next() error { 3680 return iter.NextWithContext(context.Background()) 3681} 3682 3683// NotDone returns true if the enumeration should be started or is not yet complete. 3684func (iter DiagnosticCollectionIterator) NotDone() bool { 3685 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 3686} 3687 3688// Response returns the raw server response from the last page request. 3689func (iter DiagnosticCollectionIterator) Response() DiagnosticCollection { 3690 return iter.page.Response() 3691} 3692 3693// Value returns the current value or a zero-initialized value if the 3694// iterator has advanced beyond the end of the collection. 3695func (iter DiagnosticCollectionIterator) Value() DiagnosticContract { 3696 if !iter.page.NotDone() { 3697 return DiagnosticContract{} 3698 } 3699 return iter.page.Values()[iter.i] 3700} 3701 3702// Creates a new instance of the DiagnosticCollectionIterator type. 3703func NewDiagnosticCollectionIterator(page DiagnosticCollectionPage) DiagnosticCollectionIterator { 3704 return DiagnosticCollectionIterator{page: page} 3705} 3706 3707// IsEmpty returns true if the ListResult contains no values. 3708func (dc DiagnosticCollection) IsEmpty() bool { 3709 return dc.Value == nil || len(*dc.Value) == 0 3710} 3711 3712// diagnosticCollectionPreparer prepares a request to retrieve the next set of results. 3713// It returns nil if no more results exist. 3714func (dc DiagnosticCollection) diagnosticCollectionPreparer(ctx context.Context) (*http.Request, error) { 3715 if dc.NextLink == nil || len(to.String(dc.NextLink)) < 1 { 3716 return nil, nil 3717 } 3718 return autorest.Prepare((&http.Request{}).WithContext(ctx), 3719 autorest.AsJSON(), 3720 autorest.AsGet(), 3721 autorest.WithBaseURL(to.String(dc.NextLink))) 3722} 3723 3724// DiagnosticCollectionPage contains a page of DiagnosticContract values. 3725type DiagnosticCollectionPage struct { 3726 fn func(context.Context, DiagnosticCollection) (DiagnosticCollection, error) 3727 dc DiagnosticCollection 3728} 3729 3730// NextWithContext advances to the next page of values. If there was an error making 3731// the request the page does not advance and the error is returned. 3732func (page *DiagnosticCollectionPage) NextWithContext(ctx context.Context) (err error) { 3733 if tracing.IsEnabled() { 3734 ctx = tracing.StartSpan(ctx, fqdn+"/DiagnosticCollectionPage.NextWithContext") 3735 defer func() { 3736 sc := -1 3737 if page.Response().Response.Response != nil { 3738 sc = page.Response().Response.Response.StatusCode 3739 } 3740 tracing.EndSpan(ctx, sc, err) 3741 }() 3742 } 3743 next, err := page.fn(ctx, page.dc) 3744 if err != nil { 3745 return err 3746 } 3747 page.dc = next 3748 return nil 3749} 3750 3751// Next advances to the next page of values. If there was an error making 3752// the request the page does not advance and the error is returned. 3753// Deprecated: Use NextWithContext() instead. 3754func (page *DiagnosticCollectionPage) Next() error { 3755 return page.NextWithContext(context.Background()) 3756} 3757 3758// NotDone returns true if the page enumeration should be started or is not yet complete. 3759func (page DiagnosticCollectionPage) NotDone() bool { 3760 return !page.dc.IsEmpty() 3761} 3762 3763// Response returns the raw server response from the last page request. 3764func (page DiagnosticCollectionPage) Response() DiagnosticCollection { 3765 return page.dc 3766} 3767 3768// Values returns the slice of values for the current page or nil if there are no values. 3769func (page DiagnosticCollectionPage) Values() []DiagnosticContract { 3770 if page.dc.IsEmpty() { 3771 return nil 3772 } 3773 return *page.dc.Value 3774} 3775 3776// Creates a new instance of the DiagnosticCollectionPage type. 3777func NewDiagnosticCollectionPage(getNextPage func(context.Context, DiagnosticCollection) (DiagnosticCollection, error)) DiagnosticCollectionPage { 3778 return DiagnosticCollectionPage{fn: getNextPage} 3779} 3780 3781// DiagnosticContract diagnostic details. 3782type DiagnosticContract struct { 3783 autorest.Response `json:"-"` 3784 // DiagnosticContractProperties - Diagnostic entity contract properties. 3785 *DiagnosticContractProperties `json:"properties,omitempty"` 3786 // ID - READ-ONLY; Resource ID. 3787 ID *string `json:"id,omitempty"` 3788 // Name - READ-ONLY; Resource name. 3789 Name *string `json:"name,omitempty"` 3790 // Type - READ-ONLY; Resource type for API Management resource. 3791 Type *string `json:"type,omitempty"` 3792} 3793 3794// MarshalJSON is the custom marshaler for DiagnosticContract. 3795func (dc DiagnosticContract) MarshalJSON() ([]byte, error) { 3796 objectMap := make(map[string]interface{}) 3797 if dc.DiagnosticContractProperties != nil { 3798 objectMap["properties"] = dc.DiagnosticContractProperties 3799 } 3800 return json.Marshal(objectMap) 3801} 3802 3803// UnmarshalJSON is the custom unmarshaler for DiagnosticContract struct. 3804func (dc *DiagnosticContract) UnmarshalJSON(body []byte) error { 3805 var m map[string]*json.RawMessage 3806 err := json.Unmarshal(body, &m) 3807 if err != nil { 3808 return err 3809 } 3810 for k, v := range m { 3811 switch k { 3812 case "properties": 3813 if v != nil { 3814 var diagnosticContractProperties DiagnosticContractProperties 3815 err = json.Unmarshal(*v, &diagnosticContractProperties) 3816 if err != nil { 3817 return err 3818 } 3819 dc.DiagnosticContractProperties = &diagnosticContractProperties 3820 } 3821 case "id": 3822 if v != nil { 3823 var ID string 3824 err = json.Unmarshal(*v, &ID) 3825 if err != nil { 3826 return err 3827 } 3828 dc.ID = &ID 3829 } 3830 case "name": 3831 if v != nil { 3832 var name string 3833 err = json.Unmarshal(*v, &name) 3834 if err != nil { 3835 return err 3836 } 3837 dc.Name = &name 3838 } 3839 case "type": 3840 if v != nil { 3841 var typeVar string 3842 err = json.Unmarshal(*v, &typeVar) 3843 if err != nil { 3844 return err 3845 } 3846 dc.Type = &typeVar 3847 } 3848 } 3849 } 3850 3851 return nil 3852} 3853 3854// DiagnosticContractProperties diagnostic Entity Properties 3855type DiagnosticContractProperties struct { 3856 // AlwaysLog - Specifies for what type of messages sampling settings should not apply. Possible values include: 'AllErrors' 3857 AlwaysLog AlwaysLog `json:"alwaysLog,omitempty"` 3858 // LoggerID - Resource Id of a target logger. 3859 LoggerID *string `json:"loggerId,omitempty"` 3860 // Sampling - Sampling settings for Diagnostic. 3861 Sampling *SamplingSettings `json:"sampling,omitempty"` 3862 // Frontend - Diagnostic settings for incoming/outgoing HTTP messages to the Gateway. 3863 Frontend *PipelineDiagnosticSettings `json:"frontend,omitempty"` 3864 // Backend - Diagnostic settings for incoming/outgoing HTTP messages to the Backend 3865 Backend *PipelineDiagnosticSettings `json:"backend,omitempty"` 3866 // EnableHTTPCorrelationHeaders - Whether to process Correlation Headers coming to Api Management Service. Only applicable to Application Insights diagnostics. Default is true. 3867 EnableHTTPCorrelationHeaders *bool `json:"enableHttpCorrelationHeaders,omitempty"` 3868} 3869 3870// EmailTemplateCollection paged email template list representation. 3871type EmailTemplateCollection struct { 3872 autorest.Response `json:"-"` 3873 // Value - Page values. 3874 Value *[]EmailTemplateContract `json:"value,omitempty"` 3875 // NextLink - Next page link if any. 3876 NextLink *string `json:"nextLink,omitempty"` 3877} 3878 3879// EmailTemplateCollectionIterator provides access to a complete listing of EmailTemplateContract values. 3880type EmailTemplateCollectionIterator struct { 3881 i int 3882 page EmailTemplateCollectionPage 3883} 3884 3885// NextWithContext advances to the next value. If there was an error making 3886// the request the iterator does not advance and the error is returned. 3887func (iter *EmailTemplateCollectionIterator) NextWithContext(ctx context.Context) (err error) { 3888 if tracing.IsEnabled() { 3889 ctx = tracing.StartSpan(ctx, fqdn+"/EmailTemplateCollectionIterator.NextWithContext") 3890 defer func() { 3891 sc := -1 3892 if iter.Response().Response.Response != nil { 3893 sc = iter.Response().Response.Response.StatusCode 3894 } 3895 tracing.EndSpan(ctx, sc, err) 3896 }() 3897 } 3898 iter.i++ 3899 if iter.i < len(iter.page.Values()) { 3900 return nil 3901 } 3902 err = iter.page.NextWithContext(ctx) 3903 if err != nil { 3904 iter.i-- 3905 return err 3906 } 3907 iter.i = 0 3908 return nil 3909} 3910 3911// Next advances to the next value. If there was an error making 3912// the request the iterator does not advance and the error is returned. 3913// Deprecated: Use NextWithContext() instead. 3914func (iter *EmailTemplateCollectionIterator) Next() error { 3915 return iter.NextWithContext(context.Background()) 3916} 3917 3918// NotDone returns true if the enumeration should be started or is not yet complete. 3919func (iter EmailTemplateCollectionIterator) NotDone() bool { 3920 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 3921} 3922 3923// Response returns the raw server response from the last page request. 3924func (iter EmailTemplateCollectionIterator) Response() EmailTemplateCollection { 3925 return iter.page.Response() 3926} 3927 3928// Value returns the current value or a zero-initialized value if the 3929// iterator has advanced beyond the end of the collection. 3930func (iter EmailTemplateCollectionIterator) Value() EmailTemplateContract { 3931 if !iter.page.NotDone() { 3932 return EmailTemplateContract{} 3933 } 3934 return iter.page.Values()[iter.i] 3935} 3936 3937// Creates a new instance of the EmailTemplateCollectionIterator type. 3938func NewEmailTemplateCollectionIterator(page EmailTemplateCollectionPage) EmailTemplateCollectionIterator { 3939 return EmailTemplateCollectionIterator{page: page} 3940} 3941 3942// IsEmpty returns true if the ListResult contains no values. 3943func (etc EmailTemplateCollection) IsEmpty() bool { 3944 return etc.Value == nil || len(*etc.Value) == 0 3945} 3946 3947// emailTemplateCollectionPreparer prepares a request to retrieve the next set of results. 3948// It returns nil if no more results exist. 3949func (etc EmailTemplateCollection) emailTemplateCollectionPreparer(ctx context.Context) (*http.Request, error) { 3950 if etc.NextLink == nil || len(to.String(etc.NextLink)) < 1 { 3951 return nil, nil 3952 } 3953 return autorest.Prepare((&http.Request{}).WithContext(ctx), 3954 autorest.AsJSON(), 3955 autorest.AsGet(), 3956 autorest.WithBaseURL(to.String(etc.NextLink))) 3957} 3958 3959// EmailTemplateCollectionPage contains a page of EmailTemplateContract values. 3960type EmailTemplateCollectionPage struct { 3961 fn func(context.Context, EmailTemplateCollection) (EmailTemplateCollection, error) 3962 etc EmailTemplateCollection 3963} 3964 3965// NextWithContext advances to the next page of values. If there was an error making 3966// the request the page does not advance and the error is returned. 3967func (page *EmailTemplateCollectionPage) NextWithContext(ctx context.Context) (err error) { 3968 if tracing.IsEnabled() { 3969 ctx = tracing.StartSpan(ctx, fqdn+"/EmailTemplateCollectionPage.NextWithContext") 3970 defer func() { 3971 sc := -1 3972 if page.Response().Response.Response != nil { 3973 sc = page.Response().Response.Response.StatusCode 3974 } 3975 tracing.EndSpan(ctx, sc, err) 3976 }() 3977 } 3978 next, err := page.fn(ctx, page.etc) 3979 if err != nil { 3980 return err 3981 } 3982 page.etc = next 3983 return nil 3984} 3985 3986// Next advances to the next page of values. If there was an error making 3987// the request the page does not advance and the error is returned. 3988// Deprecated: Use NextWithContext() instead. 3989func (page *EmailTemplateCollectionPage) Next() error { 3990 return page.NextWithContext(context.Background()) 3991} 3992 3993// NotDone returns true if the page enumeration should be started or is not yet complete. 3994func (page EmailTemplateCollectionPage) NotDone() bool { 3995 return !page.etc.IsEmpty() 3996} 3997 3998// Response returns the raw server response from the last page request. 3999func (page EmailTemplateCollectionPage) Response() EmailTemplateCollection { 4000 return page.etc 4001} 4002 4003// Values returns the slice of values for the current page or nil if there are no values. 4004func (page EmailTemplateCollectionPage) Values() []EmailTemplateContract { 4005 if page.etc.IsEmpty() { 4006 return nil 4007 } 4008 return *page.etc.Value 4009} 4010 4011// Creates a new instance of the EmailTemplateCollectionPage type. 4012func NewEmailTemplateCollectionPage(getNextPage func(context.Context, EmailTemplateCollection) (EmailTemplateCollection, error)) EmailTemplateCollectionPage { 4013 return EmailTemplateCollectionPage{fn: getNextPage} 4014} 4015 4016// EmailTemplateContract email Template details. 4017type EmailTemplateContract struct { 4018 autorest.Response `json:"-"` 4019 // EmailTemplateContractProperties - Email Template entity contract properties. 4020 *EmailTemplateContractProperties `json:"properties,omitempty"` 4021 // ID - READ-ONLY; Resource ID. 4022 ID *string `json:"id,omitempty"` 4023 // Name - READ-ONLY; Resource name. 4024 Name *string `json:"name,omitempty"` 4025 // Type - READ-ONLY; Resource type for API Management resource. 4026 Type *string `json:"type,omitempty"` 4027} 4028 4029// MarshalJSON is the custom marshaler for EmailTemplateContract. 4030func (etc EmailTemplateContract) MarshalJSON() ([]byte, error) { 4031 objectMap := make(map[string]interface{}) 4032 if etc.EmailTemplateContractProperties != nil { 4033 objectMap["properties"] = etc.EmailTemplateContractProperties 4034 } 4035 return json.Marshal(objectMap) 4036} 4037 4038// UnmarshalJSON is the custom unmarshaler for EmailTemplateContract struct. 4039func (etc *EmailTemplateContract) UnmarshalJSON(body []byte) error { 4040 var m map[string]*json.RawMessage 4041 err := json.Unmarshal(body, &m) 4042 if err != nil { 4043 return err 4044 } 4045 for k, v := range m { 4046 switch k { 4047 case "properties": 4048 if v != nil { 4049 var emailTemplateContractProperties EmailTemplateContractProperties 4050 err = json.Unmarshal(*v, &emailTemplateContractProperties) 4051 if err != nil { 4052 return err 4053 } 4054 etc.EmailTemplateContractProperties = &emailTemplateContractProperties 4055 } 4056 case "id": 4057 if v != nil { 4058 var ID string 4059 err = json.Unmarshal(*v, &ID) 4060 if err != nil { 4061 return err 4062 } 4063 etc.ID = &ID 4064 } 4065 case "name": 4066 if v != nil { 4067 var name string 4068 err = json.Unmarshal(*v, &name) 4069 if err != nil { 4070 return err 4071 } 4072 etc.Name = &name 4073 } 4074 case "type": 4075 if v != nil { 4076 var typeVar string 4077 err = json.Unmarshal(*v, &typeVar) 4078 if err != nil { 4079 return err 4080 } 4081 etc.Type = &typeVar 4082 } 4083 } 4084 } 4085 4086 return nil 4087} 4088 4089// EmailTemplateContractProperties email Template Contract properties. 4090type EmailTemplateContractProperties struct { 4091 // Subject - Subject of the Template. 4092 Subject *string `json:"subject,omitempty"` 4093 // Body - Email Template Body. This should be a valid XDocument 4094 Body *string `json:"body,omitempty"` 4095 // Title - Title of the Template. 4096 Title *string `json:"title,omitempty"` 4097 // Description - Description of the Email Template. 4098 Description *string `json:"description,omitempty"` 4099 // IsDefault - READ-ONLY; Whether the template is the default template provided by Api Management or has been edited. 4100 IsDefault *bool `json:"isDefault,omitempty"` 4101 // Parameters - Email Template Parameter values. 4102 Parameters *[]EmailTemplateParametersContractProperties `json:"parameters,omitempty"` 4103} 4104 4105// EmailTemplateParametersContractProperties email Template Parameter contract. 4106type EmailTemplateParametersContractProperties struct { 4107 // Name - Template parameter name. 4108 Name *string `json:"name,omitempty"` 4109 // Title - Template parameter title. 4110 Title *string `json:"title,omitempty"` 4111 // Description - Template parameter description. 4112 Description *string `json:"description,omitempty"` 4113} 4114 4115// EmailTemplateUpdateParameterProperties email Template Update Contract properties. 4116type EmailTemplateUpdateParameterProperties struct { 4117 // Subject - Subject of the Template. 4118 Subject *string `json:"subject,omitempty"` 4119 // Title - Title of the Template. 4120 Title *string `json:"title,omitempty"` 4121 // Description - Description of the Email Template. 4122 Description *string `json:"description,omitempty"` 4123 // Body - Email Template Body. This should be a valid XDocument 4124 Body *string `json:"body,omitempty"` 4125 // Parameters - Email Template Parameter values. 4126 Parameters *[]EmailTemplateParametersContractProperties `json:"parameters,omitempty"` 4127} 4128 4129// EmailTemplateUpdateParameters email Template update Parameters. 4130type EmailTemplateUpdateParameters struct { 4131 // EmailTemplateUpdateParameterProperties - Email Template Update contract properties. 4132 *EmailTemplateUpdateParameterProperties `json:"properties,omitempty"` 4133} 4134 4135// MarshalJSON is the custom marshaler for EmailTemplateUpdateParameters. 4136func (etup EmailTemplateUpdateParameters) MarshalJSON() ([]byte, error) { 4137 objectMap := make(map[string]interface{}) 4138 if etup.EmailTemplateUpdateParameterProperties != nil { 4139 objectMap["properties"] = etup.EmailTemplateUpdateParameterProperties 4140 } 4141 return json.Marshal(objectMap) 4142} 4143 4144// UnmarshalJSON is the custom unmarshaler for EmailTemplateUpdateParameters struct. 4145func (etup *EmailTemplateUpdateParameters) UnmarshalJSON(body []byte) error { 4146 var m map[string]*json.RawMessage 4147 err := json.Unmarshal(body, &m) 4148 if err != nil { 4149 return err 4150 } 4151 for k, v := range m { 4152 switch k { 4153 case "properties": 4154 if v != nil { 4155 var emailTemplateUpdateParameterProperties EmailTemplateUpdateParameterProperties 4156 err = json.Unmarshal(*v, &emailTemplateUpdateParameterProperties) 4157 if err != nil { 4158 return err 4159 } 4160 etup.EmailTemplateUpdateParameterProperties = &emailTemplateUpdateParameterProperties 4161 } 4162 } 4163 } 4164 4165 return nil 4166} 4167 4168// ErrorFieldContract error Field contract. 4169type ErrorFieldContract struct { 4170 // Code - Property level error code. 4171 Code *string `json:"code,omitempty"` 4172 // Message - Human-readable representation of property-level error. 4173 Message *string `json:"message,omitempty"` 4174 // Target - Property name. 4175 Target *string `json:"target,omitempty"` 4176} 4177 4178// ErrorResponse error Response. 4179type ErrorResponse struct { 4180 // ErrorResponseBody - Properties of the Error Response. 4181 *ErrorResponseBody `json:"error,omitempty"` 4182} 4183 4184// MarshalJSON is the custom marshaler for ErrorResponse. 4185func (er ErrorResponse) MarshalJSON() ([]byte, error) { 4186 objectMap := make(map[string]interface{}) 4187 if er.ErrorResponseBody != nil { 4188 objectMap["error"] = er.ErrorResponseBody 4189 } 4190 return json.Marshal(objectMap) 4191} 4192 4193// UnmarshalJSON is the custom unmarshaler for ErrorResponse struct. 4194func (er *ErrorResponse) UnmarshalJSON(body []byte) error { 4195 var m map[string]*json.RawMessage 4196 err := json.Unmarshal(body, &m) 4197 if err != nil { 4198 return err 4199 } 4200 for k, v := range m { 4201 switch k { 4202 case "error": 4203 if v != nil { 4204 var errorResponseBody ErrorResponseBody 4205 err = json.Unmarshal(*v, &errorResponseBody) 4206 if err != nil { 4207 return err 4208 } 4209 er.ErrorResponseBody = &errorResponseBody 4210 } 4211 } 4212 } 4213 4214 return nil 4215} 4216 4217// ErrorResponseBody error Body contract. 4218type ErrorResponseBody struct { 4219 // Code - Service-defined error code. This code serves as a sub-status for the HTTP error code specified in the response. 4220 Code *string `json:"code,omitempty"` 4221 // Message - Human-readable representation of the error. 4222 Message *string `json:"message,omitempty"` 4223 // Details - The list of invalid fields send in request, in case of validation error. 4224 Details *[]ErrorFieldContract `json:"details,omitempty"` 4225} 4226 4227// GenerateSsoURLResult generate SSO Url operations response details. 4228type GenerateSsoURLResult struct { 4229 autorest.Response `json:"-"` 4230 // Value - Redirect Url containing the SSO URL value. 4231 Value *string `json:"value,omitempty"` 4232} 4233 4234// GroupCollection paged Group list representation. 4235type GroupCollection struct { 4236 autorest.Response `json:"-"` 4237 // Value - Page values. 4238 Value *[]GroupContract `json:"value,omitempty"` 4239 // NextLink - Next page link if any. 4240 NextLink *string `json:"nextLink,omitempty"` 4241} 4242 4243// GroupCollectionIterator provides access to a complete listing of GroupContract values. 4244type GroupCollectionIterator struct { 4245 i int 4246 page GroupCollectionPage 4247} 4248 4249// NextWithContext advances to the next value. If there was an error making 4250// the request the iterator does not advance and the error is returned. 4251func (iter *GroupCollectionIterator) NextWithContext(ctx context.Context) (err error) { 4252 if tracing.IsEnabled() { 4253 ctx = tracing.StartSpan(ctx, fqdn+"/GroupCollectionIterator.NextWithContext") 4254 defer func() { 4255 sc := -1 4256 if iter.Response().Response.Response != nil { 4257 sc = iter.Response().Response.Response.StatusCode 4258 } 4259 tracing.EndSpan(ctx, sc, err) 4260 }() 4261 } 4262 iter.i++ 4263 if iter.i < len(iter.page.Values()) { 4264 return nil 4265 } 4266 err = iter.page.NextWithContext(ctx) 4267 if err != nil { 4268 iter.i-- 4269 return err 4270 } 4271 iter.i = 0 4272 return nil 4273} 4274 4275// Next advances to the next value. If there was an error making 4276// the request the iterator does not advance and the error is returned. 4277// Deprecated: Use NextWithContext() instead. 4278func (iter *GroupCollectionIterator) Next() error { 4279 return iter.NextWithContext(context.Background()) 4280} 4281 4282// NotDone returns true if the enumeration should be started or is not yet complete. 4283func (iter GroupCollectionIterator) NotDone() bool { 4284 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 4285} 4286 4287// Response returns the raw server response from the last page request. 4288func (iter GroupCollectionIterator) Response() GroupCollection { 4289 return iter.page.Response() 4290} 4291 4292// Value returns the current value or a zero-initialized value if the 4293// iterator has advanced beyond the end of the collection. 4294func (iter GroupCollectionIterator) Value() GroupContract { 4295 if !iter.page.NotDone() { 4296 return GroupContract{} 4297 } 4298 return iter.page.Values()[iter.i] 4299} 4300 4301// Creates a new instance of the GroupCollectionIterator type. 4302func NewGroupCollectionIterator(page GroupCollectionPage) GroupCollectionIterator { 4303 return GroupCollectionIterator{page: page} 4304} 4305 4306// IsEmpty returns true if the ListResult contains no values. 4307func (gc GroupCollection) IsEmpty() bool { 4308 return gc.Value == nil || len(*gc.Value) == 0 4309} 4310 4311// groupCollectionPreparer prepares a request to retrieve the next set of results. 4312// It returns nil if no more results exist. 4313func (gc GroupCollection) groupCollectionPreparer(ctx context.Context) (*http.Request, error) { 4314 if gc.NextLink == nil || len(to.String(gc.NextLink)) < 1 { 4315 return nil, nil 4316 } 4317 return autorest.Prepare((&http.Request{}).WithContext(ctx), 4318 autorest.AsJSON(), 4319 autorest.AsGet(), 4320 autorest.WithBaseURL(to.String(gc.NextLink))) 4321} 4322 4323// GroupCollectionPage contains a page of GroupContract values. 4324type GroupCollectionPage struct { 4325 fn func(context.Context, GroupCollection) (GroupCollection, error) 4326 gc GroupCollection 4327} 4328 4329// NextWithContext advances to the next page of values. If there was an error making 4330// the request the page does not advance and the error is returned. 4331func (page *GroupCollectionPage) NextWithContext(ctx context.Context) (err error) { 4332 if tracing.IsEnabled() { 4333 ctx = tracing.StartSpan(ctx, fqdn+"/GroupCollectionPage.NextWithContext") 4334 defer func() { 4335 sc := -1 4336 if page.Response().Response.Response != nil { 4337 sc = page.Response().Response.Response.StatusCode 4338 } 4339 tracing.EndSpan(ctx, sc, err) 4340 }() 4341 } 4342 next, err := page.fn(ctx, page.gc) 4343 if err != nil { 4344 return err 4345 } 4346 page.gc = next 4347 return nil 4348} 4349 4350// Next advances to the next page of values. If there was an error making 4351// the request the page does not advance and the error is returned. 4352// Deprecated: Use NextWithContext() instead. 4353func (page *GroupCollectionPage) Next() error { 4354 return page.NextWithContext(context.Background()) 4355} 4356 4357// NotDone returns true if the page enumeration should be started or is not yet complete. 4358func (page GroupCollectionPage) NotDone() bool { 4359 return !page.gc.IsEmpty() 4360} 4361 4362// Response returns the raw server response from the last page request. 4363func (page GroupCollectionPage) Response() GroupCollection { 4364 return page.gc 4365} 4366 4367// Values returns the slice of values for the current page or nil if there are no values. 4368func (page GroupCollectionPage) Values() []GroupContract { 4369 if page.gc.IsEmpty() { 4370 return nil 4371 } 4372 return *page.gc.Value 4373} 4374 4375// Creates a new instance of the GroupCollectionPage type. 4376func NewGroupCollectionPage(getNextPage func(context.Context, GroupCollection) (GroupCollection, error)) GroupCollectionPage { 4377 return GroupCollectionPage{fn: getNextPage} 4378} 4379 4380// GroupContract contract details. 4381type GroupContract struct { 4382 autorest.Response `json:"-"` 4383 // GroupContractProperties - Group entity contract properties. 4384 *GroupContractProperties `json:"properties,omitempty"` 4385 // ID - READ-ONLY; Resource ID. 4386 ID *string `json:"id,omitempty"` 4387 // Name - READ-ONLY; Resource name. 4388 Name *string `json:"name,omitempty"` 4389 // Type - READ-ONLY; Resource type for API Management resource. 4390 Type *string `json:"type,omitempty"` 4391} 4392 4393// MarshalJSON is the custom marshaler for GroupContract. 4394func (gc GroupContract) MarshalJSON() ([]byte, error) { 4395 objectMap := make(map[string]interface{}) 4396 if gc.GroupContractProperties != nil { 4397 objectMap["properties"] = gc.GroupContractProperties 4398 } 4399 return json.Marshal(objectMap) 4400} 4401 4402// UnmarshalJSON is the custom unmarshaler for GroupContract struct. 4403func (gc *GroupContract) UnmarshalJSON(body []byte) error { 4404 var m map[string]*json.RawMessage 4405 err := json.Unmarshal(body, &m) 4406 if err != nil { 4407 return err 4408 } 4409 for k, v := range m { 4410 switch k { 4411 case "properties": 4412 if v != nil { 4413 var groupContractProperties GroupContractProperties 4414 err = json.Unmarshal(*v, &groupContractProperties) 4415 if err != nil { 4416 return err 4417 } 4418 gc.GroupContractProperties = &groupContractProperties 4419 } 4420 case "id": 4421 if v != nil { 4422 var ID string 4423 err = json.Unmarshal(*v, &ID) 4424 if err != nil { 4425 return err 4426 } 4427 gc.ID = &ID 4428 } 4429 case "name": 4430 if v != nil { 4431 var name string 4432 err = json.Unmarshal(*v, &name) 4433 if err != nil { 4434 return err 4435 } 4436 gc.Name = &name 4437 } 4438 case "type": 4439 if v != nil { 4440 var typeVar string 4441 err = json.Unmarshal(*v, &typeVar) 4442 if err != nil { 4443 return err 4444 } 4445 gc.Type = &typeVar 4446 } 4447 } 4448 } 4449 4450 return nil 4451} 4452 4453// GroupContractProperties group contract Properties. 4454type GroupContractProperties struct { 4455 // DisplayName - Group name. 4456 DisplayName *string `json:"displayName,omitempty"` 4457 // Description - Group description. Can contain HTML formatting tags. 4458 Description *string `json:"description,omitempty"` 4459 // BuiltIn - READ-ONLY; true if the group is one of the three system groups (Administrators, Developers, or Guests); otherwise false. 4460 BuiltIn *bool `json:"builtIn,omitempty"` 4461 // Type - Group type. Possible values include: 'Custom', 'System', 'External' 4462 Type GroupType `json:"type,omitempty"` 4463 // 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. 4464 ExternalID *string `json:"externalId,omitempty"` 4465} 4466 4467// GroupCreateParameters parameters supplied to the Create Group operation. 4468type GroupCreateParameters struct { 4469 // GroupCreateParametersProperties - Properties supplied to Create Group operation. 4470 *GroupCreateParametersProperties `json:"properties,omitempty"` 4471} 4472 4473// MarshalJSON is the custom marshaler for GroupCreateParameters. 4474func (gcp GroupCreateParameters) MarshalJSON() ([]byte, error) { 4475 objectMap := make(map[string]interface{}) 4476 if gcp.GroupCreateParametersProperties != nil { 4477 objectMap["properties"] = gcp.GroupCreateParametersProperties 4478 } 4479 return json.Marshal(objectMap) 4480} 4481 4482// UnmarshalJSON is the custom unmarshaler for GroupCreateParameters struct. 4483func (gcp *GroupCreateParameters) UnmarshalJSON(body []byte) error { 4484 var m map[string]*json.RawMessage 4485 err := json.Unmarshal(body, &m) 4486 if err != nil { 4487 return err 4488 } 4489 for k, v := range m { 4490 switch k { 4491 case "properties": 4492 if v != nil { 4493 var groupCreateParametersProperties GroupCreateParametersProperties 4494 err = json.Unmarshal(*v, &groupCreateParametersProperties) 4495 if err != nil { 4496 return err 4497 } 4498 gcp.GroupCreateParametersProperties = &groupCreateParametersProperties 4499 } 4500 } 4501 } 4502 4503 return nil 4504} 4505 4506// GroupCreateParametersProperties parameters supplied to the Create Group operation. 4507type GroupCreateParametersProperties struct { 4508 // DisplayName - Group name. 4509 DisplayName *string `json:"displayName,omitempty"` 4510 // Description - Group description. 4511 Description *string `json:"description,omitempty"` 4512 // Type - Group type. Possible values include: 'Custom', 'System', 'External' 4513 Type GroupType `json:"type,omitempty"` 4514 // 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. 4515 ExternalID *string `json:"externalId,omitempty"` 4516} 4517 4518// GroupUpdateParameters parameters supplied to the Update Group operation. 4519type GroupUpdateParameters struct { 4520 // GroupUpdateParametersProperties - Group entity update contract properties. 4521 *GroupUpdateParametersProperties `json:"properties,omitempty"` 4522} 4523 4524// MarshalJSON is the custom marshaler for GroupUpdateParameters. 4525func (gup GroupUpdateParameters) MarshalJSON() ([]byte, error) { 4526 objectMap := make(map[string]interface{}) 4527 if gup.GroupUpdateParametersProperties != nil { 4528 objectMap["properties"] = gup.GroupUpdateParametersProperties 4529 } 4530 return json.Marshal(objectMap) 4531} 4532 4533// UnmarshalJSON is the custom unmarshaler for GroupUpdateParameters struct. 4534func (gup *GroupUpdateParameters) UnmarshalJSON(body []byte) error { 4535 var m map[string]*json.RawMessage 4536 err := json.Unmarshal(body, &m) 4537 if err != nil { 4538 return err 4539 } 4540 for k, v := range m { 4541 switch k { 4542 case "properties": 4543 if v != nil { 4544 var groupUpdateParametersProperties GroupUpdateParametersProperties 4545 err = json.Unmarshal(*v, &groupUpdateParametersProperties) 4546 if err != nil { 4547 return err 4548 } 4549 gup.GroupUpdateParametersProperties = &groupUpdateParametersProperties 4550 } 4551 } 4552 } 4553 4554 return nil 4555} 4556 4557// GroupUpdateParametersProperties parameters supplied to the Update Group operation. 4558type GroupUpdateParametersProperties struct { 4559 // DisplayName - Group name. 4560 DisplayName *string `json:"displayName,omitempty"` 4561 // Description - Group description. 4562 Description *string `json:"description,omitempty"` 4563 // Type - Group type. Possible values include: 'Custom', 'System', 'External' 4564 Type GroupType `json:"type,omitempty"` 4565 // 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. 4566 ExternalID *string `json:"externalId,omitempty"` 4567} 4568 4569// HostnameConfiguration custom hostname configuration. 4570type HostnameConfiguration struct { 4571 // Type - Hostname type. Possible values include: 'Proxy', 'Portal', 'Management', 'Scm', 'DeveloperPortal' 4572 Type HostnameType `json:"type,omitempty"` 4573 // HostName - Hostname to configure on the Api Management service. 4574 HostName *string `json:"hostName,omitempty"` 4575 // 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* 4576 KeyVaultID *string `json:"keyVaultId,omitempty"` 4577 // EncodedCertificate - Base64 Encoded certificate. 4578 EncodedCertificate *string `json:"encodedCertificate,omitempty"` 4579 // CertificatePassword - Certificate Password. 4580 CertificatePassword *string `json:"certificatePassword,omitempty"` 4581 // 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. 4582 DefaultSslBinding *bool `json:"defaultSslBinding,omitempty"` 4583 // NegotiateClientCertificate - Specify true to always negotiate client certificate on the hostname. Default Value is false. 4584 NegotiateClientCertificate *bool `json:"negotiateClientCertificate,omitempty"` 4585 // Certificate - Certificate information. 4586 Certificate *CertificateInformation `json:"certificate,omitempty"` 4587} 4588 4589// HTTPMessageDiagnostic http message diagnostic settings. 4590type HTTPMessageDiagnostic struct { 4591 // Headers - Array of HTTP Headers to log. 4592 Headers *[]string `json:"headers,omitempty"` 4593 // Body - Body logging settings. 4594 Body *BodyDiagnosticSettings `json:"body,omitempty"` 4595} 4596 4597// IdentityProviderBaseParameters identity Provider Base Parameter Properties. 4598type IdentityProviderBaseParameters struct { 4599 // Type - Identity Provider Type identifier. Possible values include: 'Facebook', 'Google', 'Microsoft', 'Twitter', 'Aad', 'AadB2C' 4600 Type IdentityProviderType `json:"type,omitempty"` 4601 // SigninTenant - The TenantId to use instead of Common when logging into Active Directory 4602 SigninTenant *string `json:"signinTenant,omitempty"` 4603 // AllowedTenants - List of Allowed Tenants when configuring Azure Active Directory login. 4604 AllowedTenants *[]string `json:"allowedTenants,omitempty"` 4605 // Authority - OpenID Connect discovery endpoint hostname for AAD or AAD B2C. 4606 Authority *string `json:"authority,omitempty"` 4607 // SignupPolicyName - Signup Policy Name. Only applies to AAD B2C Identity Provider. 4608 SignupPolicyName *string `json:"signupPolicyName,omitempty"` 4609 // SigninPolicyName - Signin Policy Name. Only applies to AAD B2C Identity Provider. 4610 SigninPolicyName *string `json:"signinPolicyName,omitempty"` 4611 // ProfileEditingPolicyName - Profile Editing Policy Name. Only applies to AAD B2C Identity Provider. 4612 ProfileEditingPolicyName *string `json:"profileEditingPolicyName,omitempty"` 4613 // PasswordResetPolicyName - Password Reset Policy Name. Only applies to AAD B2C Identity Provider. 4614 PasswordResetPolicyName *string `json:"passwordResetPolicyName,omitempty"` 4615} 4616 4617// IdentityProviderContract identity Provider details. 4618type IdentityProviderContract struct { 4619 autorest.Response `json:"-"` 4620 // IdentityProviderContractProperties - Identity Provider contract properties. 4621 *IdentityProviderContractProperties `json:"properties,omitempty"` 4622 // ID - READ-ONLY; Resource ID. 4623 ID *string `json:"id,omitempty"` 4624 // Name - READ-ONLY; Resource name. 4625 Name *string `json:"name,omitempty"` 4626 // Type - READ-ONLY; Resource type for API Management resource. 4627 Type *string `json:"type,omitempty"` 4628} 4629 4630// MarshalJSON is the custom marshaler for IdentityProviderContract. 4631func (ipc IdentityProviderContract) MarshalJSON() ([]byte, error) { 4632 objectMap := make(map[string]interface{}) 4633 if ipc.IdentityProviderContractProperties != nil { 4634 objectMap["properties"] = ipc.IdentityProviderContractProperties 4635 } 4636 return json.Marshal(objectMap) 4637} 4638 4639// UnmarshalJSON is the custom unmarshaler for IdentityProviderContract struct. 4640func (ipc *IdentityProviderContract) UnmarshalJSON(body []byte) error { 4641 var m map[string]*json.RawMessage 4642 err := json.Unmarshal(body, &m) 4643 if err != nil { 4644 return err 4645 } 4646 for k, v := range m { 4647 switch k { 4648 case "properties": 4649 if v != nil { 4650 var identityProviderContractProperties IdentityProviderContractProperties 4651 err = json.Unmarshal(*v, &identityProviderContractProperties) 4652 if err != nil { 4653 return err 4654 } 4655 ipc.IdentityProviderContractProperties = &identityProviderContractProperties 4656 } 4657 case "id": 4658 if v != nil { 4659 var ID string 4660 err = json.Unmarshal(*v, &ID) 4661 if err != nil { 4662 return err 4663 } 4664 ipc.ID = &ID 4665 } 4666 case "name": 4667 if v != nil { 4668 var name string 4669 err = json.Unmarshal(*v, &name) 4670 if err != nil { 4671 return err 4672 } 4673 ipc.Name = &name 4674 } 4675 case "type": 4676 if v != nil { 4677 var typeVar string 4678 err = json.Unmarshal(*v, &typeVar) 4679 if err != nil { 4680 return err 4681 } 4682 ipc.Type = &typeVar 4683 } 4684 } 4685 } 4686 4687 return nil 4688} 4689 4690// IdentityProviderContractProperties the external Identity Providers like Facebook, Google, Microsoft, 4691// Twitter or Azure Active Directory which can be used to enable access to the API Management service 4692// developer portal for all users. 4693type IdentityProviderContractProperties struct { 4694 // 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. 4695 ClientID *string `json:"clientId,omitempty"` 4696 // 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. 4697 ClientSecret *string `json:"clientSecret,omitempty"` 4698 // Type - Identity Provider Type identifier. Possible values include: 'Facebook', 'Google', 'Microsoft', 'Twitter', 'Aad', 'AadB2C' 4699 Type IdentityProviderType `json:"type,omitempty"` 4700 // SigninTenant - The TenantId to use instead of Common when logging into Active Directory 4701 SigninTenant *string `json:"signinTenant,omitempty"` 4702 // AllowedTenants - List of Allowed Tenants when configuring Azure Active Directory login. 4703 AllowedTenants *[]string `json:"allowedTenants,omitempty"` 4704 // Authority - OpenID Connect discovery endpoint hostname for AAD or AAD B2C. 4705 Authority *string `json:"authority,omitempty"` 4706 // SignupPolicyName - Signup Policy Name. Only applies to AAD B2C Identity Provider. 4707 SignupPolicyName *string `json:"signupPolicyName,omitempty"` 4708 // SigninPolicyName - Signin Policy Name. Only applies to AAD B2C Identity Provider. 4709 SigninPolicyName *string `json:"signinPolicyName,omitempty"` 4710 // ProfileEditingPolicyName - Profile Editing Policy Name. Only applies to AAD B2C Identity Provider. 4711 ProfileEditingPolicyName *string `json:"profileEditingPolicyName,omitempty"` 4712 // PasswordResetPolicyName - Password Reset Policy Name. Only applies to AAD B2C Identity Provider. 4713 PasswordResetPolicyName *string `json:"passwordResetPolicyName,omitempty"` 4714} 4715 4716// IdentityProviderList list of all the Identity Providers configured on the service instance. 4717type IdentityProviderList struct { 4718 autorest.Response `json:"-"` 4719 // Value - Identity Provider configuration values. 4720 Value *[]IdentityProviderContract `json:"value,omitempty"` 4721 // NextLink - Next page link if any. 4722 NextLink *string `json:"nextLink,omitempty"` 4723} 4724 4725// IdentityProviderListIterator provides access to a complete listing of IdentityProviderContract values. 4726type IdentityProviderListIterator struct { 4727 i int 4728 page IdentityProviderListPage 4729} 4730 4731// NextWithContext advances to the next value. If there was an error making 4732// the request the iterator does not advance and the error is returned. 4733func (iter *IdentityProviderListIterator) NextWithContext(ctx context.Context) (err error) { 4734 if tracing.IsEnabled() { 4735 ctx = tracing.StartSpan(ctx, fqdn+"/IdentityProviderListIterator.NextWithContext") 4736 defer func() { 4737 sc := -1 4738 if iter.Response().Response.Response != nil { 4739 sc = iter.Response().Response.Response.StatusCode 4740 } 4741 tracing.EndSpan(ctx, sc, err) 4742 }() 4743 } 4744 iter.i++ 4745 if iter.i < len(iter.page.Values()) { 4746 return nil 4747 } 4748 err = iter.page.NextWithContext(ctx) 4749 if err != nil { 4750 iter.i-- 4751 return err 4752 } 4753 iter.i = 0 4754 return nil 4755} 4756 4757// Next advances to the next value. If there was an error making 4758// the request the iterator does not advance and the error is returned. 4759// Deprecated: Use NextWithContext() instead. 4760func (iter *IdentityProviderListIterator) Next() error { 4761 return iter.NextWithContext(context.Background()) 4762} 4763 4764// NotDone returns true if the enumeration should be started or is not yet complete. 4765func (iter IdentityProviderListIterator) NotDone() bool { 4766 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 4767} 4768 4769// Response returns the raw server response from the last page request. 4770func (iter IdentityProviderListIterator) Response() IdentityProviderList { 4771 return iter.page.Response() 4772} 4773 4774// Value returns the current value or a zero-initialized value if the 4775// iterator has advanced beyond the end of the collection. 4776func (iter IdentityProviderListIterator) Value() IdentityProviderContract { 4777 if !iter.page.NotDone() { 4778 return IdentityProviderContract{} 4779 } 4780 return iter.page.Values()[iter.i] 4781} 4782 4783// Creates a new instance of the IdentityProviderListIterator type. 4784func NewIdentityProviderListIterator(page IdentityProviderListPage) IdentityProviderListIterator { 4785 return IdentityProviderListIterator{page: page} 4786} 4787 4788// IsEmpty returns true if the ListResult contains no values. 4789func (ipl IdentityProviderList) IsEmpty() bool { 4790 return ipl.Value == nil || len(*ipl.Value) == 0 4791} 4792 4793// identityProviderListPreparer prepares a request to retrieve the next set of results. 4794// It returns nil if no more results exist. 4795func (ipl IdentityProviderList) identityProviderListPreparer(ctx context.Context) (*http.Request, error) { 4796 if ipl.NextLink == nil || len(to.String(ipl.NextLink)) < 1 { 4797 return nil, nil 4798 } 4799 return autorest.Prepare((&http.Request{}).WithContext(ctx), 4800 autorest.AsJSON(), 4801 autorest.AsGet(), 4802 autorest.WithBaseURL(to.String(ipl.NextLink))) 4803} 4804 4805// IdentityProviderListPage contains a page of IdentityProviderContract values. 4806type IdentityProviderListPage struct { 4807 fn func(context.Context, IdentityProviderList) (IdentityProviderList, error) 4808 ipl IdentityProviderList 4809} 4810 4811// NextWithContext advances to the next page of values. If there was an error making 4812// the request the page does not advance and the error is returned. 4813func (page *IdentityProviderListPage) NextWithContext(ctx context.Context) (err error) { 4814 if tracing.IsEnabled() { 4815 ctx = tracing.StartSpan(ctx, fqdn+"/IdentityProviderListPage.NextWithContext") 4816 defer func() { 4817 sc := -1 4818 if page.Response().Response.Response != nil { 4819 sc = page.Response().Response.Response.StatusCode 4820 } 4821 tracing.EndSpan(ctx, sc, err) 4822 }() 4823 } 4824 next, err := page.fn(ctx, page.ipl) 4825 if err != nil { 4826 return err 4827 } 4828 page.ipl = next 4829 return nil 4830} 4831 4832// Next advances to the next page of values. If there was an error making 4833// the request the page does not advance and the error is returned. 4834// Deprecated: Use NextWithContext() instead. 4835func (page *IdentityProviderListPage) Next() error { 4836 return page.NextWithContext(context.Background()) 4837} 4838 4839// NotDone returns true if the page enumeration should be started or is not yet complete. 4840func (page IdentityProviderListPage) NotDone() bool { 4841 return !page.ipl.IsEmpty() 4842} 4843 4844// Response returns the raw server response from the last page request. 4845func (page IdentityProviderListPage) Response() IdentityProviderList { 4846 return page.ipl 4847} 4848 4849// Values returns the slice of values for the current page or nil if there are no values. 4850func (page IdentityProviderListPage) Values() []IdentityProviderContract { 4851 if page.ipl.IsEmpty() { 4852 return nil 4853 } 4854 return *page.ipl.Value 4855} 4856 4857// Creates a new instance of the IdentityProviderListPage type. 4858func NewIdentityProviderListPage(getNextPage func(context.Context, IdentityProviderList) (IdentityProviderList, error)) IdentityProviderListPage { 4859 return IdentityProviderListPage{fn: getNextPage} 4860} 4861 4862// IdentityProviderUpdateParameters parameters supplied to update Identity Provider 4863type IdentityProviderUpdateParameters struct { 4864 // IdentityProviderUpdateProperties - Identity Provider update properties. 4865 *IdentityProviderUpdateProperties `json:"properties,omitempty"` 4866} 4867 4868// MarshalJSON is the custom marshaler for IdentityProviderUpdateParameters. 4869func (ipup IdentityProviderUpdateParameters) MarshalJSON() ([]byte, error) { 4870 objectMap := make(map[string]interface{}) 4871 if ipup.IdentityProviderUpdateProperties != nil { 4872 objectMap["properties"] = ipup.IdentityProviderUpdateProperties 4873 } 4874 return json.Marshal(objectMap) 4875} 4876 4877// UnmarshalJSON is the custom unmarshaler for IdentityProviderUpdateParameters struct. 4878func (ipup *IdentityProviderUpdateParameters) UnmarshalJSON(body []byte) error { 4879 var m map[string]*json.RawMessage 4880 err := json.Unmarshal(body, &m) 4881 if err != nil { 4882 return err 4883 } 4884 for k, v := range m { 4885 switch k { 4886 case "properties": 4887 if v != nil { 4888 var identityProviderUpdateProperties IdentityProviderUpdateProperties 4889 err = json.Unmarshal(*v, &identityProviderUpdateProperties) 4890 if err != nil { 4891 return err 4892 } 4893 ipup.IdentityProviderUpdateProperties = &identityProviderUpdateProperties 4894 } 4895 } 4896 } 4897 4898 return nil 4899} 4900 4901// IdentityProviderUpdateProperties parameters supplied to the Update Identity Provider operation. 4902type IdentityProviderUpdateProperties struct { 4903 // 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. 4904 ClientID *string `json:"clientId,omitempty"` 4905 // 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. 4906 ClientSecret *string `json:"clientSecret,omitempty"` 4907 // Type - Identity Provider Type identifier. Possible values include: 'Facebook', 'Google', 'Microsoft', 'Twitter', 'Aad', 'AadB2C' 4908 Type IdentityProviderType `json:"type,omitempty"` 4909 // SigninTenant - The TenantId to use instead of Common when logging into Active Directory 4910 SigninTenant *string `json:"signinTenant,omitempty"` 4911 // AllowedTenants - List of Allowed Tenants when configuring Azure Active Directory login. 4912 AllowedTenants *[]string `json:"allowedTenants,omitempty"` 4913 // Authority - OpenID Connect discovery endpoint hostname for AAD or AAD B2C. 4914 Authority *string `json:"authority,omitempty"` 4915 // SignupPolicyName - Signup Policy Name. Only applies to AAD B2C Identity Provider. 4916 SignupPolicyName *string `json:"signupPolicyName,omitempty"` 4917 // SigninPolicyName - Signin Policy Name. Only applies to AAD B2C Identity Provider. 4918 SigninPolicyName *string `json:"signinPolicyName,omitempty"` 4919 // ProfileEditingPolicyName - Profile Editing Policy Name. Only applies to AAD B2C Identity Provider. 4920 ProfileEditingPolicyName *string `json:"profileEditingPolicyName,omitempty"` 4921 // PasswordResetPolicyName - Password Reset Policy Name. Only applies to AAD B2C Identity Provider. 4922 PasswordResetPolicyName *string `json:"passwordResetPolicyName,omitempty"` 4923} 4924 4925// IssueAttachmentCollection paged Issue Attachment list representation. 4926type IssueAttachmentCollection struct { 4927 autorest.Response `json:"-"` 4928 // Value - READ-ONLY; Issue Attachment values. 4929 Value *[]IssueAttachmentContract `json:"value,omitempty"` 4930 // NextLink - READ-ONLY; Next page link if any. 4931 NextLink *string `json:"nextLink,omitempty"` 4932} 4933 4934// IssueAttachmentCollectionIterator provides access to a complete listing of IssueAttachmentContract 4935// values. 4936type IssueAttachmentCollectionIterator struct { 4937 i int 4938 page IssueAttachmentCollectionPage 4939} 4940 4941// NextWithContext advances to the next value. If there was an error making 4942// the request the iterator does not advance and the error is returned. 4943func (iter *IssueAttachmentCollectionIterator) NextWithContext(ctx context.Context) (err error) { 4944 if tracing.IsEnabled() { 4945 ctx = tracing.StartSpan(ctx, fqdn+"/IssueAttachmentCollectionIterator.NextWithContext") 4946 defer func() { 4947 sc := -1 4948 if iter.Response().Response.Response != nil { 4949 sc = iter.Response().Response.Response.StatusCode 4950 } 4951 tracing.EndSpan(ctx, sc, err) 4952 }() 4953 } 4954 iter.i++ 4955 if iter.i < len(iter.page.Values()) { 4956 return nil 4957 } 4958 err = iter.page.NextWithContext(ctx) 4959 if err != nil { 4960 iter.i-- 4961 return err 4962 } 4963 iter.i = 0 4964 return nil 4965} 4966 4967// Next advances to the next value. If there was an error making 4968// the request the iterator does not advance and the error is returned. 4969// Deprecated: Use NextWithContext() instead. 4970func (iter *IssueAttachmentCollectionIterator) Next() error { 4971 return iter.NextWithContext(context.Background()) 4972} 4973 4974// NotDone returns true if the enumeration should be started or is not yet complete. 4975func (iter IssueAttachmentCollectionIterator) NotDone() bool { 4976 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 4977} 4978 4979// Response returns the raw server response from the last page request. 4980func (iter IssueAttachmentCollectionIterator) Response() IssueAttachmentCollection { 4981 return iter.page.Response() 4982} 4983 4984// Value returns the current value or a zero-initialized value if the 4985// iterator has advanced beyond the end of the collection. 4986func (iter IssueAttachmentCollectionIterator) Value() IssueAttachmentContract { 4987 if !iter.page.NotDone() { 4988 return IssueAttachmentContract{} 4989 } 4990 return iter.page.Values()[iter.i] 4991} 4992 4993// Creates a new instance of the IssueAttachmentCollectionIterator type. 4994func NewIssueAttachmentCollectionIterator(page IssueAttachmentCollectionPage) IssueAttachmentCollectionIterator { 4995 return IssueAttachmentCollectionIterator{page: page} 4996} 4997 4998// IsEmpty returns true if the ListResult contains no values. 4999func (iac IssueAttachmentCollection) IsEmpty() bool { 5000 return iac.Value == nil || len(*iac.Value) == 0 5001} 5002 5003// issueAttachmentCollectionPreparer prepares a request to retrieve the next set of results. 5004// It returns nil if no more results exist. 5005func (iac IssueAttachmentCollection) issueAttachmentCollectionPreparer(ctx context.Context) (*http.Request, error) { 5006 if iac.NextLink == nil || len(to.String(iac.NextLink)) < 1 { 5007 return nil, nil 5008 } 5009 return autorest.Prepare((&http.Request{}).WithContext(ctx), 5010 autorest.AsJSON(), 5011 autorest.AsGet(), 5012 autorest.WithBaseURL(to.String(iac.NextLink))) 5013} 5014 5015// IssueAttachmentCollectionPage contains a page of IssueAttachmentContract values. 5016type IssueAttachmentCollectionPage struct { 5017 fn func(context.Context, IssueAttachmentCollection) (IssueAttachmentCollection, error) 5018 iac IssueAttachmentCollection 5019} 5020 5021// NextWithContext advances to the next page of values. If there was an error making 5022// the request the page does not advance and the error is returned. 5023func (page *IssueAttachmentCollectionPage) NextWithContext(ctx context.Context) (err error) { 5024 if tracing.IsEnabled() { 5025 ctx = tracing.StartSpan(ctx, fqdn+"/IssueAttachmentCollectionPage.NextWithContext") 5026 defer func() { 5027 sc := -1 5028 if page.Response().Response.Response != nil { 5029 sc = page.Response().Response.Response.StatusCode 5030 } 5031 tracing.EndSpan(ctx, sc, err) 5032 }() 5033 } 5034 next, err := page.fn(ctx, page.iac) 5035 if err != nil { 5036 return err 5037 } 5038 page.iac = next 5039 return nil 5040} 5041 5042// Next advances to the next page of values. If there was an error making 5043// the request the page does not advance and the error is returned. 5044// Deprecated: Use NextWithContext() instead. 5045func (page *IssueAttachmentCollectionPage) Next() error { 5046 return page.NextWithContext(context.Background()) 5047} 5048 5049// NotDone returns true if the page enumeration should be started or is not yet complete. 5050func (page IssueAttachmentCollectionPage) NotDone() bool { 5051 return !page.iac.IsEmpty() 5052} 5053 5054// Response returns the raw server response from the last page request. 5055func (page IssueAttachmentCollectionPage) Response() IssueAttachmentCollection { 5056 return page.iac 5057} 5058 5059// Values returns the slice of values for the current page or nil if there are no values. 5060func (page IssueAttachmentCollectionPage) Values() []IssueAttachmentContract { 5061 if page.iac.IsEmpty() { 5062 return nil 5063 } 5064 return *page.iac.Value 5065} 5066 5067// Creates a new instance of the IssueAttachmentCollectionPage type. 5068func NewIssueAttachmentCollectionPage(getNextPage func(context.Context, IssueAttachmentCollection) (IssueAttachmentCollection, error)) IssueAttachmentCollectionPage { 5069 return IssueAttachmentCollectionPage{fn: getNextPage} 5070} 5071 5072// IssueAttachmentContract issue Attachment Contract details. 5073type IssueAttachmentContract struct { 5074 autorest.Response `json:"-"` 5075 // IssueAttachmentContractProperties - Properties of the Issue Attachment. 5076 *IssueAttachmentContractProperties `json:"properties,omitempty"` 5077 // ID - READ-ONLY; Resource ID. 5078 ID *string `json:"id,omitempty"` 5079 // Name - READ-ONLY; Resource name. 5080 Name *string `json:"name,omitempty"` 5081 // Type - READ-ONLY; Resource type for API Management resource. 5082 Type *string `json:"type,omitempty"` 5083} 5084 5085// MarshalJSON is the custom marshaler for IssueAttachmentContract. 5086func (iac IssueAttachmentContract) MarshalJSON() ([]byte, error) { 5087 objectMap := make(map[string]interface{}) 5088 if iac.IssueAttachmentContractProperties != nil { 5089 objectMap["properties"] = iac.IssueAttachmentContractProperties 5090 } 5091 return json.Marshal(objectMap) 5092} 5093 5094// UnmarshalJSON is the custom unmarshaler for IssueAttachmentContract struct. 5095func (iac *IssueAttachmentContract) UnmarshalJSON(body []byte) error { 5096 var m map[string]*json.RawMessage 5097 err := json.Unmarshal(body, &m) 5098 if err != nil { 5099 return err 5100 } 5101 for k, v := range m { 5102 switch k { 5103 case "properties": 5104 if v != nil { 5105 var issueAttachmentContractProperties IssueAttachmentContractProperties 5106 err = json.Unmarshal(*v, &issueAttachmentContractProperties) 5107 if err != nil { 5108 return err 5109 } 5110 iac.IssueAttachmentContractProperties = &issueAttachmentContractProperties 5111 } 5112 case "id": 5113 if v != nil { 5114 var ID string 5115 err = json.Unmarshal(*v, &ID) 5116 if err != nil { 5117 return err 5118 } 5119 iac.ID = &ID 5120 } 5121 case "name": 5122 if v != nil { 5123 var name string 5124 err = json.Unmarshal(*v, &name) 5125 if err != nil { 5126 return err 5127 } 5128 iac.Name = &name 5129 } 5130 case "type": 5131 if v != nil { 5132 var typeVar string 5133 err = json.Unmarshal(*v, &typeVar) 5134 if err != nil { 5135 return err 5136 } 5137 iac.Type = &typeVar 5138 } 5139 } 5140 } 5141 5142 return nil 5143} 5144 5145// IssueAttachmentContractProperties issue Attachment contract Properties. 5146type IssueAttachmentContractProperties struct { 5147 // Title - Filename by which the binary data will be saved. 5148 Title *string `json:"title,omitempty"` 5149 // 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. 5150 ContentFormat *string `json:"contentFormat,omitempty"` 5151 // Content - An HTTP link or Base64-encoded binary data. 5152 Content *string `json:"content,omitempty"` 5153} 5154 5155// IssueCollection paged Issue list representation. 5156type IssueCollection struct { 5157 autorest.Response `json:"-"` 5158 // Value - READ-ONLY; Issue values. 5159 Value *[]IssueContract `json:"value,omitempty"` 5160 // NextLink - READ-ONLY; Next page link if any. 5161 NextLink *string `json:"nextLink,omitempty"` 5162} 5163 5164// IssueCollectionIterator provides access to a complete listing of IssueContract values. 5165type IssueCollectionIterator struct { 5166 i int 5167 page IssueCollectionPage 5168} 5169 5170// NextWithContext advances to the next value. If there was an error making 5171// the request the iterator does not advance and the error is returned. 5172func (iter *IssueCollectionIterator) NextWithContext(ctx context.Context) (err error) { 5173 if tracing.IsEnabled() { 5174 ctx = tracing.StartSpan(ctx, fqdn+"/IssueCollectionIterator.NextWithContext") 5175 defer func() { 5176 sc := -1 5177 if iter.Response().Response.Response != nil { 5178 sc = iter.Response().Response.Response.StatusCode 5179 } 5180 tracing.EndSpan(ctx, sc, err) 5181 }() 5182 } 5183 iter.i++ 5184 if iter.i < len(iter.page.Values()) { 5185 return nil 5186 } 5187 err = iter.page.NextWithContext(ctx) 5188 if err != nil { 5189 iter.i-- 5190 return err 5191 } 5192 iter.i = 0 5193 return nil 5194} 5195 5196// Next advances to the next value. If there was an error making 5197// the request the iterator does not advance and the error is returned. 5198// Deprecated: Use NextWithContext() instead. 5199func (iter *IssueCollectionIterator) Next() error { 5200 return iter.NextWithContext(context.Background()) 5201} 5202 5203// NotDone returns true if the enumeration should be started or is not yet complete. 5204func (iter IssueCollectionIterator) NotDone() bool { 5205 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 5206} 5207 5208// Response returns the raw server response from the last page request. 5209func (iter IssueCollectionIterator) Response() IssueCollection { 5210 return iter.page.Response() 5211} 5212 5213// Value returns the current value or a zero-initialized value if the 5214// iterator has advanced beyond the end of the collection. 5215func (iter IssueCollectionIterator) Value() IssueContract { 5216 if !iter.page.NotDone() { 5217 return IssueContract{} 5218 } 5219 return iter.page.Values()[iter.i] 5220} 5221 5222// Creates a new instance of the IssueCollectionIterator type. 5223func NewIssueCollectionIterator(page IssueCollectionPage) IssueCollectionIterator { 5224 return IssueCollectionIterator{page: page} 5225} 5226 5227// IsEmpty returns true if the ListResult contains no values. 5228func (ic IssueCollection) IsEmpty() bool { 5229 return ic.Value == nil || len(*ic.Value) == 0 5230} 5231 5232// issueCollectionPreparer prepares a request to retrieve the next set of results. 5233// It returns nil if no more results exist. 5234func (ic IssueCollection) issueCollectionPreparer(ctx context.Context) (*http.Request, error) { 5235 if ic.NextLink == nil || len(to.String(ic.NextLink)) < 1 { 5236 return nil, nil 5237 } 5238 return autorest.Prepare((&http.Request{}).WithContext(ctx), 5239 autorest.AsJSON(), 5240 autorest.AsGet(), 5241 autorest.WithBaseURL(to.String(ic.NextLink))) 5242} 5243 5244// IssueCollectionPage contains a page of IssueContract values. 5245type IssueCollectionPage struct { 5246 fn func(context.Context, IssueCollection) (IssueCollection, error) 5247 ic IssueCollection 5248} 5249 5250// NextWithContext advances to the next page of values. If there was an error making 5251// the request the page does not advance and the error is returned. 5252func (page *IssueCollectionPage) NextWithContext(ctx context.Context) (err error) { 5253 if tracing.IsEnabled() { 5254 ctx = tracing.StartSpan(ctx, fqdn+"/IssueCollectionPage.NextWithContext") 5255 defer func() { 5256 sc := -1 5257 if page.Response().Response.Response != nil { 5258 sc = page.Response().Response.Response.StatusCode 5259 } 5260 tracing.EndSpan(ctx, sc, err) 5261 }() 5262 } 5263 next, err := page.fn(ctx, page.ic) 5264 if err != nil { 5265 return err 5266 } 5267 page.ic = next 5268 return nil 5269} 5270 5271// Next advances to the next page of values. If there was an error making 5272// the request the page does not advance and the error is returned. 5273// Deprecated: Use NextWithContext() instead. 5274func (page *IssueCollectionPage) Next() error { 5275 return page.NextWithContext(context.Background()) 5276} 5277 5278// NotDone returns true if the page enumeration should be started or is not yet complete. 5279func (page IssueCollectionPage) NotDone() bool { 5280 return !page.ic.IsEmpty() 5281} 5282 5283// Response returns the raw server response from the last page request. 5284func (page IssueCollectionPage) Response() IssueCollection { 5285 return page.ic 5286} 5287 5288// Values returns the slice of values for the current page or nil if there are no values. 5289func (page IssueCollectionPage) Values() []IssueContract { 5290 if page.ic.IsEmpty() { 5291 return nil 5292 } 5293 return *page.ic.Value 5294} 5295 5296// Creates a new instance of the IssueCollectionPage type. 5297func NewIssueCollectionPage(getNextPage func(context.Context, IssueCollection) (IssueCollection, error)) IssueCollectionPage { 5298 return IssueCollectionPage{fn: getNextPage} 5299} 5300 5301// IssueCommentCollection paged Issue Comment list representation. 5302type IssueCommentCollection struct { 5303 autorest.Response `json:"-"` 5304 // Value - READ-ONLY; Issue Comment values. 5305 Value *[]IssueCommentContract `json:"value,omitempty"` 5306 // NextLink - READ-ONLY; Next page link if any. 5307 NextLink *string `json:"nextLink,omitempty"` 5308} 5309 5310// IssueCommentCollectionIterator provides access to a complete listing of IssueCommentContract values. 5311type IssueCommentCollectionIterator struct { 5312 i int 5313 page IssueCommentCollectionPage 5314} 5315 5316// NextWithContext advances to the next value. If there was an error making 5317// the request the iterator does not advance and the error is returned. 5318func (iter *IssueCommentCollectionIterator) NextWithContext(ctx context.Context) (err error) { 5319 if tracing.IsEnabled() { 5320 ctx = tracing.StartSpan(ctx, fqdn+"/IssueCommentCollectionIterator.NextWithContext") 5321 defer func() { 5322 sc := -1 5323 if iter.Response().Response.Response != nil { 5324 sc = iter.Response().Response.Response.StatusCode 5325 } 5326 tracing.EndSpan(ctx, sc, err) 5327 }() 5328 } 5329 iter.i++ 5330 if iter.i < len(iter.page.Values()) { 5331 return nil 5332 } 5333 err = iter.page.NextWithContext(ctx) 5334 if err != nil { 5335 iter.i-- 5336 return err 5337 } 5338 iter.i = 0 5339 return nil 5340} 5341 5342// Next advances to the next value. If there was an error making 5343// the request the iterator does not advance and the error is returned. 5344// Deprecated: Use NextWithContext() instead. 5345func (iter *IssueCommentCollectionIterator) Next() error { 5346 return iter.NextWithContext(context.Background()) 5347} 5348 5349// NotDone returns true if the enumeration should be started or is not yet complete. 5350func (iter IssueCommentCollectionIterator) NotDone() bool { 5351 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 5352} 5353 5354// Response returns the raw server response from the last page request. 5355func (iter IssueCommentCollectionIterator) Response() IssueCommentCollection { 5356 return iter.page.Response() 5357} 5358 5359// Value returns the current value or a zero-initialized value if the 5360// iterator has advanced beyond the end of the collection. 5361func (iter IssueCommentCollectionIterator) Value() IssueCommentContract { 5362 if !iter.page.NotDone() { 5363 return IssueCommentContract{} 5364 } 5365 return iter.page.Values()[iter.i] 5366} 5367 5368// Creates a new instance of the IssueCommentCollectionIterator type. 5369func NewIssueCommentCollectionIterator(page IssueCommentCollectionPage) IssueCommentCollectionIterator { 5370 return IssueCommentCollectionIterator{page: page} 5371} 5372 5373// IsEmpty returns true if the ListResult contains no values. 5374func (icc IssueCommentCollection) IsEmpty() bool { 5375 return icc.Value == nil || len(*icc.Value) == 0 5376} 5377 5378// issueCommentCollectionPreparer prepares a request to retrieve the next set of results. 5379// It returns nil if no more results exist. 5380func (icc IssueCommentCollection) issueCommentCollectionPreparer(ctx context.Context) (*http.Request, error) { 5381 if icc.NextLink == nil || len(to.String(icc.NextLink)) < 1 { 5382 return nil, nil 5383 } 5384 return autorest.Prepare((&http.Request{}).WithContext(ctx), 5385 autorest.AsJSON(), 5386 autorest.AsGet(), 5387 autorest.WithBaseURL(to.String(icc.NextLink))) 5388} 5389 5390// IssueCommentCollectionPage contains a page of IssueCommentContract values. 5391type IssueCommentCollectionPage struct { 5392 fn func(context.Context, IssueCommentCollection) (IssueCommentCollection, error) 5393 icc IssueCommentCollection 5394} 5395 5396// NextWithContext advances to the next page of values. If there was an error making 5397// the request the page does not advance and the error is returned. 5398func (page *IssueCommentCollectionPage) NextWithContext(ctx context.Context) (err error) { 5399 if tracing.IsEnabled() { 5400 ctx = tracing.StartSpan(ctx, fqdn+"/IssueCommentCollectionPage.NextWithContext") 5401 defer func() { 5402 sc := -1 5403 if page.Response().Response.Response != nil { 5404 sc = page.Response().Response.Response.StatusCode 5405 } 5406 tracing.EndSpan(ctx, sc, err) 5407 }() 5408 } 5409 next, err := page.fn(ctx, page.icc) 5410 if err != nil { 5411 return err 5412 } 5413 page.icc = next 5414 return nil 5415} 5416 5417// Next advances to the next page of values. If there was an error making 5418// the request the page does not advance and the error is returned. 5419// Deprecated: Use NextWithContext() instead. 5420func (page *IssueCommentCollectionPage) Next() error { 5421 return page.NextWithContext(context.Background()) 5422} 5423 5424// NotDone returns true if the page enumeration should be started or is not yet complete. 5425func (page IssueCommentCollectionPage) NotDone() bool { 5426 return !page.icc.IsEmpty() 5427} 5428 5429// Response returns the raw server response from the last page request. 5430func (page IssueCommentCollectionPage) Response() IssueCommentCollection { 5431 return page.icc 5432} 5433 5434// Values returns the slice of values for the current page or nil if there are no values. 5435func (page IssueCommentCollectionPage) Values() []IssueCommentContract { 5436 if page.icc.IsEmpty() { 5437 return nil 5438 } 5439 return *page.icc.Value 5440} 5441 5442// Creates a new instance of the IssueCommentCollectionPage type. 5443func NewIssueCommentCollectionPage(getNextPage func(context.Context, IssueCommentCollection) (IssueCommentCollection, error)) IssueCommentCollectionPage { 5444 return IssueCommentCollectionPage{fn: getNextPage} 5445} 5446 5447// IssueCommentContract issue Comment Contract details. 5448type IssueCommentContract struct { 5449 autorest.Response `json:"-"` 5450 // IssueCommentContractProperties - Properties of the Issue Comment. 5451 *IssueCommentContractProperties `json:"properties,omitempty"` 5452 // ID - READ-ONLY; Resource ID. 5453 ID *string `json:"id,omitempty"` 5454 // Name - READ-ONLY; Resource name. 5455 Name *string `json:"name,omitempty"` 5456 // Type - READ-ONLY; Resource type for API Management resource. 5457 Type *string `json:"type,omitempty"` 5458} 5459 5460// MarshalJSON is the custom marshaler for IssueCommentContract. 5461func (icc IssueCommentContract) MarshalJSON() ([]byte, error) { 5462 objectMap := make(map[string]interface{}) 5463 if icc.IssueCommentContractProperties != nil { 5464 objectMap["properties"] = icc.IssueCommentContractProperties 5465 } 5466 return json.Marshal(objectMap) 5467} 5468 5469// UnmarshalJSON is the custom unmarshaler for IssueCommentContract struct. 5470func (icc *IssueCommentContract) UnmarshalJSON(body []byte) error { 5471 var m map[string]*json.RawMessage 5472 err := json.Unmarshal(body, &m) 5473 if err != nil { 5474 return err 5475 } 5476 for k, v := range m { 5477 switch k { 5478 case "properties": 5479 if v != nil { 5480 var issueCommentContractProperties IssueCommentContractProperties 5481 err = json.Unmarshal(*v, &issueCommentContractProperties) 5482 if err != nil { 5483 return err 5484 } 5485 icc.IssueCommentContractProperties = &issueCommentContractProperties 5486 } 5487 case "id": 5488 if v != nil { 5489 var ID string 5490 err = json.Unmarshal(*v, &ID) 5491 if err != nil { 5492 return err 5493 } 5494 icc.ID = &ID 5495 } 5496 case "name": 5497 if v != nil { 5498 var name string 5499 err = json.Unmarshal(*v, &name) 5500 if err != nil { 5501 return err 5502 } 5503 icc.Name = &name 5504 } 5505 case "type": 5506 if v != nil { 5507 var typeVar string 5508 err = json.Unmarshal(*v, &typeVar) 5509 if err != nil { 5510 return err 5511 } 5512 icc.Type = &typeVar 5513 } 5514 } 5515 } 5516 5517 return nil 5518} 5519 5520// IssueCommentContractProperties issue Comment contract Properties. 5521type IssueCommentContractProperties struct { 5522 // Text - Comment text. 5523 Text *string `json:"text,omitempty"` 5524 // CreatedDate - Date and time when the comment was created. 5525 CreatedDate *date.Time `json:"createdDate,omitempty"` 5526 // UserID - A resource identifier for the user who left the comment. 5527 UserID *string `json:"userId,omitempty"` 5528} 5529 5530// IssueContract issue Contract details. 5531type IssueContract struct { 5532 autorest.Response `json:"-"` 5533 // IssueContractProperties - Properties of the Issue. 5534 *IssueContractProperties `json:"properties,omitempty"` 5535 // ID - READ-ONLY; Resource ID. 5536 ID *string `json:"id,omitempty"` 5537 // Name - READ-ONLY; Resource name. 5538 Name *string `json:"name,omitempty"` 5539 // Type - READ-ONLY; Resource type for API Management resource. 5540 Type *string `json:"type,omitempty"` 5541} 5542 5543// MarshalJSON is the custom marshaler for IssueContract. 5544func (ic IssueContract) MarshalJSON() ([]byte, error) { 5545 objectMap := make(map[string]interface{}) 5546 if ic.IssueContractProperties != nil { 5547 objectMap["properties"] = ic.IssueContractProperties 5548 } 5549 return json.Marshal(objectMap) 5550} 5551 5552// UnmarshalJSON is the custom unmarshaler for IssueContract struct. 5553func (ic *IssueContract) UnmarshalJSON(body []byte) error { 5554 var m map[string]*json.RawMessage 5555 err := json.Unmarshal(body, &m) 5556 if err != nil { 5557 return err 5558 } 5559 for k, v := range m { 5560 switch k { 5561 case "properties": 5562 if v != nil { 5563 var issueContractProperties IssueContractProperties 5564 err = json.Unmarshal(*v, &issueContractProperties) 5565 if err != nil { 5566 return err 5567 } 5568 ic.IssueContractProperties = &issueContractProperties 5569 } 5570 case "id": 5571 if v != nil { 5572 var ID string 5573 err = json.Unmarshal(*v, &ID) 5574 if err != nil { 5575 return err 5576 } 5577 ic.ID = &ID 5578 } 5579 case "name": 5580 if v != nil { 5581 var name string 5582 err = json.Unmarshal(*v, &name) 5583 if err != nil { 5584 return err 5585 } 5586 ic.Name = &name 5587 } 5588 case "type": 5589 if v != nil { 5590 var typeVar string 5591 err = json.Unmarshal(*v, &typeVar) 5592 if err != nil { 5593 return err 5594 } 5595 ic.Type = &typeVar 5596 } 5597 } 5598 } 5599 5600 return nil 5601} 5602 5603// IssueContractBaseProperties issue contract Base Properties. 5604type IssueContractBaseProperties struct { 5605 // CreatedDate - Date and time when the issue was created. 5606 CreatedDate *date.Time `json:"createdDate,omitempty"` 5607 // State - Status of the issue. Possible values include: 'Proposed', 'Open', 'Removed', 'Resolved', 'Closed' 5608 State State `json:"state,omitempty"` 5609 // APIID - A resource identifier for the API the issue was created for. 5610 APIID *string `json:"apiId,omitempty"` 5611} 5612 5613// IssueContractProperties issue contract Properties. 5614type IssueContractProperties struct { 5615 // Title - The issue title. 5616 Title *string `json:"title,omitempty"` 5617 // Description - Text describing the issue. 5618 Description *string `json:"description,omitempty"` 5619 // UserID - A resource identifier for the user created the issue. 5620 UserID *string `json:"userId,omitempty"` 5621 // CreatedDate - Date and time when the issue was created. 5622 CreatedDate *date.Time `json:"createdDate,omitempty"` 5623 // State - Status of the issue. Possible values include: 'Proposed', 'Open', 'Removed', 'Resolved', 'Closed' 5624 State State `json:"state,omitempty"` 5625 // APIID - A resource identifier for the API the issue was created for. 5626 APIID *string `json:"apiId,omitempty"` 5627} 5628 5629// IssueUpdateContract issue update Parameters. 5630type IssueUpdateContract struct { 5631 // IssueUpdateContractProperties - Issue entity Update contract properties. 5632 *IssueUpdateContractProperties `json:"properties,omitempty"` 5633} 5634 5635// MarshalJSON is the custom marshaler for IssueUpdateContract. 5636func (iuc IssueUpdateContract) MarshalJSON() ([]byte, error) { 5637 objectMap := make(map[string]interface{}) 5638 if iuc.IssueUpdateContractProperties != nil { 5639 objectMap["properties"] = iuc.IssueUpdateContractProperties 5640 } 5641 return json.Marshal(objectMap) 5642} 5643 5644// UnmarshalJSON is the custom unmarshaler for IssueUpdateContract struct. 5645func (iuc *IssueUpdateContract) UnmarshalJSON(body []byte) error { 5646 var m map[string]*json.RawMessage 5647 err := json.Unmarshal(body, &m) 5648 if err != nil { 5649 return err 5650 } 5651 for k, v := range m { 5652 switch k { 5653 case "properties": 5654 if v != nil { 5655 var issueUpdateContractProperties IssueUpdateContractProperties 5656 err = json.Unmarshal(*v, &issueUpdateContractProperties) 5657 if err != nil { 5658 return err 5659 } 5660 iuc.IssueUpdateContractProperties = &issueUpdateContractProperties 5661 } 5662 } 5663 } 5664 5665 return nil 5666} 5667 5668// IssueUpdateContractProperties issue contract Update Properties. 5669type IssueUpdateContractProperties struct { 5670 // Title - The issue title. 5671 Title *string `json:"title,omitempty"` 5672 // Description - Text describing the issue. 5673 Description *string `json:"description,omitempty"` 5674 // UserID - A resource identifier for the user created the issue. 5675 UserID *string `json:"userId,omitempty"` 5676 // CreatedDate - Date and time when the issue was created. 5677 CreatedDate *date.Time `json:"createdDate,omitempty"` 5678 // State - Status of the issue. Possible values include: 'Proposed', 'Open', 'Removed', 'Resolved', 'Closed' 5679 State State `json:"state,omitempty"` 5680 // APIID - A resource identifier for the API the issue was created for. 5681 APIID *string `json:"apiId,omitempty"` 5682} 5683 5684// ListNetworkStatusContractByLocation ... 5685type ListNetworkStatusContractByLocation struct { 5686 autorest.Response `json:"-"` 5687 Value *[]NetworkStatusContractByLocation `json:"value,omitempty"` 5688} 5689 5690// LoggerCollection paged Logger list representation. 5691type LoggerCollection struct { 5692 autorest.Response `json:"-"` 5693 // Value - Logger values. 5694 Value *[]LoggerContract `json:"value,omitempty"` 5695 // Count - Total record count number across all pages. 5696 Count *int64 `json:"count,omitempty"` 5697 // NextLink - Next page link if any. 5698 NextLink *string `json:"nextLink,omitempty"` 5699} 5700 5701// LoggerCollectionIterator provides access to a complete listing of LoggerContract values. 5702type LoggerCollectionIterator struct { 5703 i int 5704 page LoggerCollectionPage 5705} 5706 5707// NextWithContext advances to the next value. If there was an error making 5708// the request the iterator does not advance and the error is returned. 5709func (iter *LoggerCollectionIterator) NextWithContext(ctx context.Context) (err error) { 5710 if tracing.IsEnabled() { 5711 ctx = tracing.StartSpan(ctx, fqdn+"/LoggerCollectionIterator.NextWithContext") 5712 defer func() { 5713 sc := -1 5714 if iter.Response().Response.Response != nil { 5715 sc = iter.Response().Response.Response.StatusCode 5716 } 5717 tracing.EndSpan(ctx, sc, err) 5718 }() 5719 } 5720 iter.i++ 5721 if iter.i < len(iter.page.Values()) { 5722 return nil 5723 } 5724 err = iter.page.NextWithContext(ctx) 5725 if err != nil { 5726 iter.i-- 5727 return err 5728 } 5729 iter.i = 0 5730 return nil 5731} 5732 5733// Next advances to the next value. If there was an error making 5734// the request the iterator does not advance and the error is returned. 5735// Deprecated: Use NextWithContext() instead. 5736func (iter *LoggerCollectionIterator) Next() error { 5737 return iter.NextWithContext(context.Background()) 5738} 5739 5740// NotDone returns true if the enumeration should be started or is not yet complete. 5741func (iter LoggerCollectionIterator) NotDone() bool { 5742 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 5743} 5744 5745// Response returns the raw server response from the last page request. 5746func (iter LoggerCollectionIterator) Response() LoggerCollection { 5747 return iter.page.Response() 5748} 5749 5750// Value returns the current value or a zero-initialized value if the 5751// iterator has advanced beyond the end of the collection. 5752func (iter LoggerCollectionIterator) Value() LoggerContract { 5753 if !iter.page.NotDone() { 5754 return LoggerContract{} 5755 } 5756 return iter.page.Values()[iter.i] 5757} 5758 5759// Creates a new instance of the LoggerCollectionIterator type. 5760func NewLoggerCollectionIterator(page LoggerCollectionPage) LoggerCollectionIterator { 5761 return LoggerCollectionIterator{page: page} 5762} 5763 5764// IsEmpty returns true if the ListResult contains no values. 5765func (lc LoggerCollection) IsEmpty() bool { 5766 return lc.Value == nil || len(*lc.Value) == 0 5767} 5768 5769// loggerCollectionPreparer prepares a request to retrieve the next set of results. 5770// It returns nil if no more results exist. 5771func (lc LoggerCollection) loggerCollectionPreparer(ctx context.Context) (*http.Request, error) { 5772 if lc.NextLink == nil || len(to.String(lc.NextLink)) < 1 { 5773 return nil, nil 5774 } 5775 return autorest.Prepare((&http.Request{}).WithContext(ctx), 5776 autorest.AsJSON(), 5777 autorest.AsGet(), 5778 autorest.WithBaseURL(to.String(lc.NextLink))) 5779} 5780 5781// LoggerCollectionPage contains a page of LoggerContract values. 5782type LoggerCollectionPage struct { 5783 fn func(context.Context, LoggerCollection) (LoggerCollection, error) 5784 lc LoggerCollection 5785} 5786 5787// NextWithContext advances to the next page of values. If there was an error making 5788// the request the page does not advance and the error is returned. 5789func (page *LoggerCollectionPage) NextWithContext(ctx context.Context) (err error) { 5790 if tracing.IsEnabled() { 5791 ctx = tracing.StartSpan(ctx, fqdn+"/LoggerCollectionPage.NextWithContext") 5792 defer func() { 5793 sc := -1 5794 if page.Response().Response.Response != nil { 5795 sc = page.Response().Response.Response.StatusCode 5796 } 5797 tracing.EndSpan(ctx, sc, err) 5798 }() 5799 } 5800 next, err := page.fn(ctx, page.lc) 5801 if err != nil { 5802 return err 5803 } 5804 page.lc = next 5805 return nil 5806} 5807 5808// Next advances to the next page of values. If there was an error making 5809// the request the page does not advance and the error is returned. 5810// Deprecated: Use NextWithContext() instead. 5811func (page *LoggerCollectionPage) Next() error { 5812 return page.NextWithContext(context.Background()) 5813} 5814 5815// NotDone returns true if the page enumeration should be started or is not yet complete. 5816func (page LoggerCollectionPage) NotDone() bool { 5817 return !page.lc.IsEmpty() 5818} 5819 5820// Response returns the raw server response from the last page request. 5821func (page LoggerCollectionPage) Response() LoggerCollection { 5822 return page.lc 5823} 5824 5825// Values returns the slice of values for the current page or nil if there are no values. 5826func (page LoggerCollectionPage) Values() []LoggerContract { 5827 if page.lc.IsEmpty() { 5828 return nil 5829 } 5830 return *page.lc.Value 5831} 5832 5833// Creates a new instance of the LoggerCollectionPage type. 5834func NewLoggerCollectionPage(getNextPage func(context.Context, LoggerCollection) (LoggerCollection, error)) LoggerCollectionPage { 5835 return LoggerCollectionPage{fn: getNextPage} 5836} 5837 5838// LoggerContract logger details. 5839type LoggerContract struct { 5840 autorest.Response `json:"-"` 5841 // LoggerContractProperties - Logger entity contract properties. 5842 *LoggerContractProperties `json:"properties,omitempty"` 5843 // ID - READ-ONLY; Resource ID. 5844 ID *string `json:"id,omitempty"` 5845 // Name - READ-ONLY; Resource name. 5846 Name *string `json:"name,omitempty"` 5847 // Type - READ-ONLY; Resource type for API Management resource. 5848 Type *string `json:"type,omitempty"` 5849} 5850 5851// MarshalJSON is the custom marshaler for LoggerContract. 5852func (lc LoggerContract) MarshalJSON() ([]byte, error) { 5853 objectMap := make(map[string]interface{}) 5854 if lc.LoggerContractProperties != nil { 5855 objectMap["properties"] = lc.LoggerContractProperties 5856 } 5857 return json.Marshal(objectMap) 5858} 5859 5860// UnmarshalJSON is the custom unmarshaler for LoggerContract struct. 5861func (lc *LoggerContract) UnmarshalJSON(body []byte) error { 5862 var m map[string]*json.RawMessage 5863 err := json.Unmarshal(body, &m) 5864 if err != nil { 5865 return err 5866 } 5867 for k, v := range m { 5868 switch k { 5869 case "properties": 5870 if v != nil { 5871 var loggerContractProperties LoggerContractProperties 5872 err = json.Unmarshal(*v, &loggerContractProperties) 5873 if err != nil { 5874 return err 5875 } 5876 lc.LoggerContractProperties = &loggerContractProperties 5877 } 5878 case "id": 5879 if v != nil { 5880 var ID string 5881 err = json.Unmarshal(*v, &ID) 5882 if err != nil { 5883 return err 5884 } 5885 lc.ID = &ID 5886 } 5887 case "name": 5888 if v != nil { 5889 var name string 5890 err = json.Unmarshal(*v, &name) 5891 if err != nil { 5892 return err 5893 } 5894 lc.Name = &name 5895 } 5896 case "type": 5897 if v != nil { 5898 var typeVar string 5899 err = json.Unmarshal(*v, &typeVar) 5900 if err != nil { 5901 return err 5902 } 5903 lc.Type = &typeVar 5904 } 5905 } 5906 } 5907 5908 return nil 5909} 5910 5911// LoggerContractProperties the Logger entity in API Management represents an event sink that you can use 5912// to log API Management events. Currently the Logger entity supports logging API Management events to 5913// Azure Event Hubs. 5914type LoggerContractProperties struct { 5915 // LoggerType - Logger type. Possible values include: 'AzureEventHub', 'ApplicationInsights' 5916 LoggerType LoggerType `json:"loggerType,omitempty"` 5917 // Description - Logger description. 5918 Description *string `json:"description,omitempty"` 5919 // Credentials - The name and SendRule connection string of the event hub for azureEventHub logger. 5920 // Instrumentation key for applicationInsights logger. 5921 Credentials map[string]*string `json:"credentials"` 5922 // IsBuffered - Whether records are buffered in the logger before publishing. Default is assumed to be true. 5923 IsBuffered *bool `json:"isBuffered,omitempty"` 5924 // ResourceID - Azure Resource Id of a log target (either Azure Event Hub resource or Azure Application Insights resource). 5925 ResourceID *string `json:"resourceId,omitempty"` 5926} 5927 5928// MarshalJSON is the custom marshaler for LoggerContractProperties. 5929func (lcp LoggerContractProperties) MarshalJSON() ([]byte, error) { 5930 objectMap := make(map[string]interface{}) 5931 if lcp.LoggerType != "" { 5932 objectMap["loggerType"] = lcp.LoggerType 5933 } 5934 if lcp.Description != nil { 5935 objectMap["description"] = lcp.Description 5936 } 5937 if lcp.Credentials != nil { 5938 objectMap["credentials"] = lcp.Credentials 5939 } 5940 if lcp.IsBuffered != nil { 5941 objectMap["isBuffered"] = lcp.IsBuffered 5942 } 5943 if lcp.ResourceID != nil { 5944 objectMap["resourceId"] = lcp.ResourceID 5945 } 5946 return json.Marshal(objectMap) 5947} 5948 5949// LoggerUpdateContract logger update contract. 5950type LoggerUpdateContract struct { 5951 // LoggerUpdateParameters - Logger entity update contract properties. 5952 *LoggerUpdateParameters `json:"properties,omitempty"` 5953} 5954 5955// MarshalJSON is the custom marshaler for LoggerUpdateContract. 5956func (luc LoggerUpdateContract) MarshalJSON() ([]byte, error) { 5957 objectMap := make(map[string]interface{}) 5958 if luc.LoggerUpdateParameters != nil { 5959 objectMap["properties"] = luc.LoggerUpdateParameters 5960 } 5961 return json.Marshal(objectMap) 5962} 5963 5964// UnmarshalJSON is the custom unmarshaler for LoggerUpdateContract struct. 5965func (luc *LoggerUpdateContract) UnmarshalJSON(body []byte) error { 5966 var m map[string]*json.RawMessage 5967 err := json.Unmarshal(body, &m) 5968 if err != nil { 5969 return err 5970 } 5971 for k, v := range m { 5972 switch k { 5973 case "properties": 5974 if v != nil { 5975 var loggerUpdateParameters LoggerUpdateParameters 5976 err = json.Unmarshal(*v, &loggerUpdateParameters) 5977 if err != nil { 5978 return err 5979 } 5980 luc.LoggerUpdateParameters = &loggerUpdateParameters 5981 } 5982 } 5983 } 5984 5985 return nil 5986} 5987 5988// LoggerUpdateParameters parameters supplied to the Update Logger operation. 5989type LoggerUpdateParameters struct { 5990 // LoggerType - Logger type. Possible values include: 'AzureEventHub', 'ApplicationInsights' 5991 LoggerType LoggerType `json:"loggerType,omitempty"` 5992 // Description - Logger description. 5993 Description *string `json:"description,omitempty"` 5994 // Credentials - Logger credentials. 5995 Credentials map[string]*string `json:"credentials"` 5996 // IsBuffered - Whether records are buffered in the logger before publishing. Default is assumed to be true. 5997 IsBuffered *bool `json:"isBuffered,omitempty"` 5998} 5999 6000// MarshalJSON is the custom marshaler for LoggerUpdateParameters. 6001func (lup LoggerUpdateParameters) MarshalJSON() ([]byte, error) { 6002 objectMap := make(map[string]interface{}) 6003 if lup.LoggerType != "" { 6004 objectMap["loggerType"] = lup.LoggerType 6005 } 6006 if lup.Description != nil { 6007 objectMap["description"] = lup.Description 6008 } 6009 if lup.Credentials != nil { 6010 objectMap["credentials"] = lup.Credentials 6011 } 6012 if lup.IsBuffered != nil { 6013 objectMap["isBuffered"] = lup.IsBuffered 6014 } 6015 return json.Marshal(objectMap) 6016} 6017 6018// NetworkStatusContract network Status details. 6019type NetworkStatusContract struct { 6020 autorest.Response `json:"-"` 6021 // DNSServers - Gets the list of DNS servers IPV4 addresses. 6022 DNSServers *[]string `json:"dnsServers,omitempty"` 6023 // ConnectivityStatus - Gets the list of Connectivity Status to the Resources on which the service depends upon. 6024 ConnectivityStatus *[]ConnectivityStatusContract `json:"connectivityStatus,omitempty"` 6025} 6026 6027// NetworkStatusContractByLocation network Status in the Location 6028type NetworkStatusContractByLocation struct { 6029 // Location - Location of service 6030 Location *string `json:"location,omitempty"` 6031 // NetworkStatus - Network status in Location 6032 NetworkStatus *NetworkStatusContract `json:"networkStatus,omitempty"` 6033} 6034 6035// NotificationCollection paged Notification list representation. 6036type NotificationCollection struct { 6037 autorest.Response `json:"-"` 6038 // Value - Page values. 6039 Value *[]NotificationContract `json:"value,omitempty"` 6040 // NextLink - Next page link if any. 6041 NextLink *string `json:"nextLink,omitempty"` 6042} 6043 6044// NotificationCollectionIterator provides access to a complete listing of NotificationContract values. 6045type NotificationCollectionIterator struct { 6046 i int 6047 page NotificationCollectionPage 6048} 6049 6050// NextWithContext advances to the next value. If there was an error making 6051// the request the iterator does not advance and the error is returned. 6052func (iter *NotificationCollectionIterator) NextWithContext(ctx context.Context) (err error) { 6053 if tracing.IsEnabled() { 6054 ctx = tracing.StartSpan(ctx, fqdn+"/NotificationCollectionIterator.NextWithContext") 6055 defer func() { 6056 sc := -1 6057 if iter.Response().Response.Response != nil { 6058 sc = iter.Response().Response.Response.StatusCode 6059 } 6060 tracing.EndSpan(ctx, sc, err) 6061 }() 6062 } 6063 iter.i++ 6064 if iter.i < len(iter.page.Values()) { 6065 return nil 6066 } 6067 err = iter.page.NextWithContext(ctx) 6068 if err != nil { 6069 iter.i-- 6070 return err 6071 } 6072 iter.i = 0 6073 return nil 6074} 6075 6076// Next advances to the next value. If there was an error making 6077// the request the iterator does not advance and the error is returned. 6078// Deprecated: Use NextWithContext() instead. 6079func (iter *NotificationCollectionIterator) Next() error { 6080 return iter.NextWithContext(context.Background()) 6081} 6082 6083// NotDone returns true if the enumeration should be started or is not yet complete. 6084func (iter NotificationCollectionIterator) NotDone() bool { 6085 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 6086} 6087 6088// Response returns the raw server response from the last page request. 6089func (iter NotificationCollectionIterator) Response() NotificationCollection { 6090 return iter.page.Response() 6091} 6092 6093// Value returns the current value or a zero-initialized value if the 6094// iterator has advanced beyond the end of the collection. 6095func (iter NotificationCollectionIterator) Value() NotificationContract { 6096 if !iter.page.NotDone() { 6097 return NotificationContract{} 6098 } 6099 return iter.page.Values()[iter.i] 6100} 6101 6102// Creates a new instance of the NotificationCollectionIterator type. 6103func NewNotificationCollectionIterator(page NotificationCollectionPage) NotificationCollectionIterator { 6104 return NotificationCollectionIterator{page: page} 6105} 6106 6107// IsEmpty returns true if the ListResult contains no values. 6108func (nc NotificationCollection) IsEmpty() bool { 6109 return nc.Value == nil || len(*nc.Value) == 0 6110} 6111 6112// notificationCollectionPreparer prepares a request to retrieve the next set of results. 6113// It returns nil if no more results exist. 6114func (nc NotificationCollection) notificationCollectionPreparer(ctx context.Context) (*http.Request, error) { 6115 if nc.NextLink == nil || len(to.String(nc.NextLink)) < 1 { 6116 return nil, nil 6117 } 6118 return autorest.Prepare((&http.Request{}).WithContext(ctx), 6119 autorest.AsJSON(), 6120 autorest.AsGet(), 6121 autorest.WithBaseURL(to.String(nc.NextLink))) 6122} 6123 6124// NotificationCollectionPage contains a page of NotificationContract values. 6125type NotificationCollectionPage struct { 6126 fn func(context.Context, NotificationCollection) (NotificationCollection, error) 6127 nc NotificationCollection 6128} 6129 6130// NextWithContext advances to the next page of values. If there was an error making 6131// the request the page does not advance and the error is returned. 6132func (page *NotificationCollectionPage) NextWithContext(ctx context.Context) (err error) { 6133 if tracing.IsEnabled() { 6134 ctx = tracing.StartSpan(ctx, fqdn+"/NotificationCollectionPage.NextWithContext") 6135 defer func() { 6136 sc := -1 6137 if page.Response().Response.Response != nil { 6138 sc = page.Response().Response.Response.StatusCode 6139 } 6140 tracing.EndSpan(ctx, sc, err) 6141 }() 6142 } 6143 next, err := page.fn(ctx, page.nc) 6144 if err != nil { 6145 return err 6146 } 6147 page.nc = next 6148 return nil 6149} 6150 6151// Next advances to the next page of values. If there was an error making 6152// the request the page does not advance and the error is returned. 6153// Deprecated: Use NextWithContext() instead. 6154func (page *NotificationCollectionPage) Next() error { 6155 return page.NextWithContext(context.Background()) 6156} 6157 6158// NotDone returns true if the page enumeration should be started or is not yet complete. 6159func (page NotificationCollectionPage) NotDone() bool { 6160 return !page.nc.IsEmpty() 6161} 6162 6163// Response returns the raw server response from the last page request. 6164func (page NotificationCollectionPage) Response() NotificationCollection { 6165 return page.nc 6166} 6167 6168// Values returns the slice of values for the current page or nil if there are no values. 6169func (page NotificationCollectionPage) Values() []NotificationContract { 6170 if page.nc.IsEmpty() { 6171 return nil 6172 } 6173 return *page.nc.Value 6174} 6175 6176// Creates a new instance of the NotificationCollectionPage type. 6177func NewNotificationCollectionPage(getNextPage func(context.Context, NotificationCollection) (NotificationCollection, error)) NotificationCollectionPage { 6178 return NotificationCollectionPage{fn: getNextPage} 6179} 6180 6181// NotificationContract notification details. 6182type NotificationContract struct { 6183 autorest.Response `json:"-"` 6184 // NotificationContractProperties - Notification entity contract properties. 6185 *NotificationContractProperties `json:"properties,omitempty"` 6186 // ID - READ-ONLY; Resource ID. 6187 ID *string `json:"id,omitempty"` 6188 // Name - READ-ONLY; Resource name. 6189 Name *string `json:"name,omitempty"` 6190 // Type - READ-ONLY; Resource type for API Management resource. 6191 Type *string `json:"type,omitempty"` 6192} 6193 6194// MarshalJSON is the custom marshaler for NotificationContract. 6195func (nc NotificationContract) MarshalJSON() ([]byte, error) { 6196 objectMap := make(map[string]interface{}) 6197 if nc.NotificationContractProperties != nil { 6198 objectMap["properties"] = nc.NotificationContractProperties 6199 } 6200 return json.Marshal(objectMap) 6201} 6202 6203// UnmarshalJSON is the custom unmarshaler for NotificationContract struct. 6204func (nc *NotificationContract) UnmarshalJSON(body []byte) error { 6205 var m map[string]*json.RawMessage 6206 err := json.Unmarshal(body, &m) 6207 if err != nil { 6208 return err 6209 } 6210 for k, v := range m { 6211 switch k { 6212 case "properties": 6213 if v != nil { 6214 var notificationContractProperties NotificationContractProperties 6215 err = json.Unmarshal(*v, ¬ificationContractProperties) 6216 if err != nil { 6217 return err 6218 } 6219 nc.NotificationContractProperties = ¬ificationContractProperties 6220 } 6221 case "id": 6222 if v != nil { 6223 var ID string 6224 err = json.Unmarshal(*v, &ID) 6225 if err != nil { 6226 return err 6227 } 6228 nc.ID = &ID 6229 } 6230 case "name": 6231 if v != nil { 6232 var name string 6233 err = json.Unmarshal(*v, &name) 6234 if err != nil { 6235 return err 6236 } 6237 nc.Name = &name 6238 } 6239 case "type": 6240 if v != nil { 6241 var typeVar string 6242 err = json.Unmarshal(*v, &typeVar) 6243 if err != nil { 6244 return err 6245 } 6246 nc.Type = &typeVar 6247 } 6248 } 6249 } 6250 6251 return nil 6252} 6253 6254// NotificationContractProperties notification Contract properties. 6255type NotificationContractProperties struct { 6256 // Title - Title of the Notification. 6257 Title *string `json:"title,omitempty"` 6258 // Description - Description of the Notification. 6259 Description *string `json:"description,omitempty"` 6260 // Recipients - Recipient Parameter values. 6261 Recipients *RecipientsContractProperties `json:"recipients,omitempty"` 6262} 6263 6264// OAuth2AuthenticationSettingsContract API OAuth2 Authentication settings details. 6265type OAuth2AuthenticationSettingsContract struct { 6266 // AuthorizationServerID - OAuth authorization server identifier. 6267 AuthorizationServerID *string `json:"authorizationServerId,omitempty"` 6268 // Scope - operations scope. 6269 Scope *string `json:"scope,omitempty"` 6270} 6271 6272// OpenIDAuthenticationSettingsContract API OAuth2 Authentication settings details. 6273type OpenIDAuthenticationSettingsContract struct { 6274 // OpenidProviderID - OAuth authorization server identifier. 6275 OpenidProviderID *string `json:"openidProviderId,omitempty"` 6276 // BearerTokenSendingMethods - How to send token to the server. 6277 BearerTokenSendingMethods *[]BearerTokenSendingMethods `json:"bearerTokenSendingMethods,omitempty"` 6278} 6279 6280// OpenIDConnectProviderCollection paged OpenIdProviders list representation. 6281type OpenIDConnectProviderCollection struct { 6282 autorest.Response `json:"-"` 6283 // Value - Page values. 6284 Value *[]OpenidConnectProviderContract `json:"value,omitempty"` 6285 // NextLink - Next page link if any. 6286 NextLink *string `json:"nextLink,omitempty"` 6287} 6288 6289// OpenIDConnectProviderCollectionIterator provides access to a complete listing of 6290// OpenidConnectProviderContract values. 6291type OpenIDConnectProviderCollectionIterator struct { 6292 i int 6293 page OpenIDConnectProviderCollectionPage 6294} 6295 6296// NextWithContext advances to the next value. If there was an error making 6297// the request the iterator does not advance and the error is returned. 6298func (iter *OpenIDConnectProviderCollectionIterator) NextWithContext(ctx context.Context) (err error) { 6299 if tracing.IsEnabled() { 6300 ctx = tracing.StartSpan(ctx, fqdn+"/OpenIDConnectProviderCollectionIterator.NextWithContext") 6301 defer func() { 6302 sc := -1 6303 if iter.Response().Response.Response != nil { 6304 sc = iter.Response().Response.Response.StatusCode 6305 } 6306 tracing.EndSpan(ctx, sc, err) 6307 }() 6308 } 6309 iter.i++ 6310 if iter.i < len(iter.page.Values()) { 6311 return nil 6312 } 6313 err = iter.page.NextWithContext(ctx) 6314 if err != nil { 6315 iter.i-- 6316 return err 6317 } 6318 iter.i = 0 6319 return nil 6320} 6321 6322// Next advances to the next value. If there was an error making 6323// the request the iterator does not advance and the error is returned. 6324// Deprecated: Use NextWithContext() instead. 6325func (iter *OpenIDConnectProviderCollectionIterator) Next() error { 6326 return iter.NextWithContext(context.Background()) 6327} 6328 6329// NotDone returns true if the enumeration should be started or is not yet complete. 6330func (iter OpenIDConnectProviderCollectionIterator) NotDone() bool { 6331 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 6332} 6333 6334// Response returns the raw server response from the last page request. 6335func (iter OpenIDConnectProviderCollectionIterator) Response() OpenIDConnectProviderCollection { 6336 return iter.page.Response() 6337} 6338 6339// Value returns the current value or a zero-initialized value if the 6340// iterator has advanced beyond the end of the collection. 6341func (iter OpenIDConnectProviderCollectionIterator) Value() OpenidConnectProviderContract { 6342 if !iter.page.NotDone() { 6343 return OpenidConnectProviderContract{} 6344 } 6345 return iter.page.Values()[iter.i] 6346} 6347 6348// Creates a new instance of the OpenIDConnectProviderCollectionIterator type. 6349func NewOpenIDConnectProviderCollectionIterator(page OpenIDConnectProviderCollectionPage) OpenIDConnectProviderCollectionIterator { 6350 return OpenIDConnectProviderCollectionIterator{page: page} 6351} 6352 6353// IsEmpty returns true if the ListResult contains no values. 6354func (oicpc OpenIDConnectProviderCollection) IsEmpty() bool { 6355 return oicpc.Value == nil || len(*oicpc.Value) == 0 6356} 6357 6358// openIDConnectProviderCollectionPreparer prepares a request to retrieve the next set of results. 6359// It returns nil if no more results exist. 6360func (oicpc OpenIDConnectProviderCollection) openIDConnectProviderCollectionPreparer(ctx context.Context) (*http.Request, error) { 6361 if oicpc.NextLink == nil || len(to.String(oicpc.NextLink)) < 1 { 6362 return nil, nil 6363 } 6364 return autorest.Prepare((&http.Request{}).WithContext(ctx), 6365 autorest.AsJSON(), 6366 autorest.AsGet(), 6367 autorest.WithBaseURL(to.String(oicpc.NextLink))) 6368} 6369 6370// OpenIDConnectProviderCollectionPage contains a page of OpenidConnectProviderContract values. 6371type OpenIDConnectProviderCollectionPage struct { 6372 fn func(context.Context, OpenIDConnectProviderCollection) (OpenIDConnectProviderCollection, error) 6373 oicpc OpenIDConnectProviderCollection 6374} 6375 6376// NextWithContext advances to the next page of values. If there was an error making 6377// the request the page does not advance and the error is returned. 6378func (page *OpenIDConnectProviderCollectionPage) NextWithContext(ctx context.Context) (err error) { 6379 if tracing.IsEnabled() { 6380 ctx = tracing.StartSpan(ctx, fqdn+"/OpenIDConnectProviderCollectionPage.NextWithContext") 6381 defer func() { 6382 sc := -1 6383 if page.Response().Response.Response != nil { 6384 sc = page.Response().Response.Response.StatusCode 6385 } 6386 tracing.EndSpan(ctx, sc, err) 6387 }() 6388 } 6389 next, err := page.fn(ctx, page.oicpc) 6390 if err != nil { 6391 return err 6392 } 6393 page.oicpc = next 6394 return nil 6395} 6396 6397// Next advances to the next page of values. If there was an error making 6398// the request the page does not advance and the error is returned. 6399// Deprecated: Use NextWithContext() instead. 6400func (page *OpenIDConnectProviderCollectionPage) Next() error { 6401 return page.NextWithContext(context.Background()) 6402} 6403 6404// NotDone returns true if the page enumeration should be started or is not yet complete. 6405func (page OpenIDConnectProviderCollectionPage) NotDone() bool { 6406 return !page.oicpc.IsEmpty() 6407} 6408 6409// Response returns the raw server response from the last page request. 6410func (page OpenIDConnectProviderCollectionPage) Response() OpenIDConnectProviderCollection { 6411 return page.oicpc 6412} 6413 6414// Values returns the slice of values for the current page or nil if there are no values. 6415func (page OpenIDConnectProviderCollectionPage) Values() []OpenidConnectProviderContract { 6416 if page.oicpc.IsEmpty() { 6417 return nil 6418 } 6419 return *page.oicpc.Value 6420} 6421 6422// Creates a new instance of the OpenIDConnectProviderCollectionPage type. 6423func NewOpenIDConnectProviderCollectionPage(getNextPage func(context.Context, OpenIDConnectProviderCollection) (OpenIDConnectProviderCollection, error)) OpenIDConnectProviderCollectionPage { 6424 return OpenIDConnectProviderCollectionPage{fn: getNextPage} 6425} 6426 6427// OpenidConnectProviderContract openId Connect Provider details. 6428type OpenidConnectProviderContract struct { 6429 autorest.Response `json:"-"` 6430 // OpenidConnectProviderContractProperties - OpenId Connect Provider contract properties. 6431 *OpenidConnectProviderContractProperties `json:"properties,omitempty"` 6432 // ID - READ-ONLY; Resource ID. 6433 ID *string `json:"id,omitempty"` 6434 // Name - READ-ONLY; Resource name. 6435 Name *string `json:"name,omitempty"` 6436 // Type - READ-ONLY; Resource type for API Management resource. 6437 Type *string `json:"type,omitempty"` 6438} 6439 6440// MarshalJSON is the custom marshaler for OpenidConnectProviderContract. 6441func (ocpc OpenidConnectProviderContract) MarshalJSON() ([]byte, error) { 6442 objectMap := make(map[string]interface{}) 6443 if ocpc.OpenidConnectProviderContractProperties != nil { 6444 objectMap["properties"] = ocpc.OpenidConnectProviderContractProperties 6445 } 6446 return json.Marshal(objectMap) 6447} 6448 6449// UnmarshalJSON is the custom unmarshaler for OpenidConnectProviderContract struct. 6450func (ocpc *OpenidConnectProviderContract) UnmarshalJSON(body []byte) error { 6451 var m map[string]*json.RawMessage 6452 err := json.Unmarshal(body, &m) 6453 if err != nil { 6454 return err 6455 } 6456 for k, v := range m { 6457 switch k { 6458 case "properties": 6459 if v != nil { 6460 var openidConnectProviderContractProperties OpenidConnectProviderContractProperties 6461 err = json.Unmarshal(*v, &openidConnectProviderContractProperties) 6462 if err != nil { 6463 return err 6464 } 6465 ocpc.OpenidConnectProviderContractProperties = &openidConnectProviderContractProperties 6466 } 6467 case "id": 6468 if v != nil { 6469 var ID string 6470 err = json.Unmarshal(*v, &ID) 6471 if err != nil { 6472 return err 6473 } 6474 ocpc.ID = &ID 6475 } 6476 case "name": 6477 if v != nil { 6478 var name string 6479 err = json.Unmarshal(*v, &name) 6480 if err != nil { 6481 return err 6482 } 6483 ocpc.Name = &name 6484 } 6485 case "type": 6486 if v != nil { 6487 var typeVar string 6488 err = json.Unmarshal(*v, &typeVar) 6489 if err != nil { 6490 return err 6491 } 6492 ocpc.Type = &typeVar 6493 } 6494 } 6495 } 6496 6497 return nil 6498} 6499 6500// OpenidConnectProviderContractProperties openID Connect Providers Contract. 6501type OpenidConnectProviderContractProperties struct { 6502 // DisplayName - User-friendly OpenID Connect Provider name. 6503 DisplayName *string `json:"displayName,omitempty"` 6504 // Description - User-friendly description of OpenID Connect Provider. 6505 Description *string `json:"description,omitempty"` 6506 // MetadataEndpoint - Metadata endpoint URI. 6507 MetadataEndpoint *string `json:"metadataEndpoint,omitempty"` 6508 // ClientID - Client ID of developer console which is the client application. 6509 ClientID *string `json:"clientId,omitempty"` 6510 // ClientSecret - Client Secret of developer console which is the client application. 6511 ClientSecret *string `json:"clientSecret,omitempty"` 6512} 6513 6514// OpenidConnectProviderUpdateContract parameters supplied to the Update OpenID Connect Provider operation. 6515type OpenidConnectProviderUpdateContract struct { 6516 // OpenidConnectProviderUpdateContractProperties - OpenId Connect Provider Update contract properties. 6517 *OpenidConnectProviderUpdateContractProperties `json:"properties,omitempty"` 6518} 6519 6520// MarshalJSON is the custom marshaler for OpenidConnectProviderUpdateContract. 6521func (ocpuc OpenidConnectProviderUpdateContract) MarshalJSON() ([]byte, error) { 6522 objectMap := make(map[string]interface{}) 6523 if ocpuc.OpenidConnectProviderUpdateContractProperties != nil { 6524 objectMap["properties"] = ocpuc.OpenidConnectProviderUpdateContractProperties 6525 } 6526 return json.Marshal(objectMap) 6527} 6528 6529// UnmarshalJSON is the custom unmarshaler for OpenidConnectProviderUpdateContract struct. 6530func (ocpuc *OpenidConnectProviderUpdateContract) UnmarshalJSON(body []byte) error { 6531 var m map[string]*json.RawMessage 6532 err := json.Unmarshal(body, &m) 6533 if err != nil { 6534 return err 6535 } 6536 for k, v := range m { 6537 switch k { 6538 case "properties": 6539 if v != nil { 6540 var openidConnectProviderUpdateContractProperties OpenidConnectProviderUpdateContractProperties 6541 err = json.Unmarshal(*v, &openidConnectProviderUpdateContractProperties) 6542 if err != nil { 6543 return err 6544 } 6545 ocpuc.OpenidConnectProviderUpdateContractProperties = &openidConnectProviderUpdateContractProperties 6546 } 6547 } 6548 } 6549 6550 return nil 6551} 6552 6553// OpenidConnectProviderUpdateContractProperties parameters supplied to the Update OpenID Connect Provider 6554// operation. 6555type OpenidConnectProviderUpdateContractProperties struct { 6556 // DisplayName - User-friendly OpenID Connect Provider name. 6557 DisplayName *string `json:"displayName,omitempty"` 6558 // Description - User-friendly description of OpenID Connect Provider. 6559 Description *string `json:"description,omitempty"` 6560 // MetadataEndpoint - Metadata endpoint URI. 6561 MetadataEndpoint *string `json:"metadataEndpoint,omitempty"` 6562 // ClientID - Client ID of developer console which is the client application. 6563 ClientID *string `json:"clientId,omitempty"` 6564 // ClientSecret - Client Secret of developer console which is the client application. 6565 ClientSecret *string `json:"clientSecret,omitempty"` 6566} 6567 6568// Operation REST API operation 6569type Operation struct { 6570 // Name - Operation name: {provider}/{resource}/{operation} 6571 Name *string `json:"name,omitempty"` 6572 // Display - The object that describes the operation. 6573 Display *OperationDisplay `json:"display,omitempty"` 6574 // Origin - The operation origin. 6575 Origin *string `json:"origin,omitempty"` 6576 // Properties - The operation properties. 6577 Properties interface{} `json:"properties,omitempty"` 6578} 6579 6580// OperationCollection paged Operation list representation. 6581type OperationCollection struct { 6582 autorest.Response `json:"-"` 6583 // Value - READ-ONLY; Page values. 6584 Value *[]OperationContract `json:"value,omitempty"` 6585 // NextLink - READ-ONLY; Next page link if any. 6586 NextLink *string `json:"nextLink,omitempty"` 6587} 6588 6589// OperationCollectionIterator provides access to a complete listing of OperationContract values. 6590type OperationCollectionIterator struct { 6591 i int 6592 page OperationCollectionPage 6593} 6594 6595// NextWithContext advances to the next value. If there was an error making 6596// the request the iterator does not advance and the error is returned. 6597func (iter *OperationCollectionIterator) NextWithContext(ctx context.Context) (err error) { 6598 if tracing.IsEnabled() { 6599 ctx = tracing.StartSpan(ctx, fqdn+"/OperationCollectionIterator.NextWithContext") 6600 defer func() { 6601 sc := -1 6602 if iter.Response().Response.Response != nil { 6603 sc = iter.Response().Response.Response.StatusCode 6604 } 6605 tracing.EndSpan(ctx, sc, err) 6606 }() 6607 } 6608 iter.i++ 6609 if iter.i < len(iter.page.Values()) { 6610 return nil 6611 } 6612 err = iter.page.NextWithContext(ctx) 6613 if err != nil { 6614 iter.i-- 6615 return err 6616 } 6617 iter.i = 0 6618 return nil 6619} 6620 6621// Next advances to the next value. If there was an error making 6622// the request the iterator does not advance and the error is returned. 6623// Deprecated: Use NextWithContext() instead. 6624func (iter *OperationCollectionIterator) Next() error { 6625 return iter.NextWithContext(context.Background()) 6626} 6627 6628// NotDone returns true if the enumeration should be started or is not yet complete. 6629func (iter OperationCollectionIterator) NotDone() bool { 6630 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 6631} 6632 6633// Response returns the raw server response from the last page request. 6634func (iter OperationCollectionIterator) Response() OperationCollection { 6635 return iter.page.Response() 6636} 6637 6638// Value returns the current value or a zero-initialized value if the 6639// iterator has advanced beyond the end of the collection. 6640func (iter OperationCollectionIterator) Value() OperationContract { 6641 if !iter.page.NotDone() { 6642 return OperationContract{} 6643 } 6644 return iter.page.Values()[iter.i] 6645} 6646 6647// Creates a new instance of the OperationCollectionIterator type. 6648func NewOperationCollectionIterator(page OperationCollectionPage) OperationCollectionIterator { 6649 return OperationCollectionIterator{page: page} 6650} 6651 6652// IsEmpty returns true if the ListResult contains no values. 6653func (oc OperationCollection) IsEmpty() bool { 6654 return oc.Value == nil || len(*oc.Value) == 0 6655} 6656 6657// operationCollectionPreparer prepares a request to retrieve the next set of results. 6658// It returns nil if no more results exist. 6659func (oc OperationCollection) operationCollectionPreparer(ctx context.Context) (*http.Request, error) { 6660 if oc.NextLink == nil || len(to.String(oc.NextLink)) < 1 { 6661 return nil, nil 6662 } 6663 return autorest.Prepare((&http.Request{}).WithContext(ctx), 6664 autorest.AsJSON(), 6665 autorest.AsGet(), 6666 autorest.WithBaseURL(to.String(oc.NextLink))) 6667} 6668 6669// OperationCollectionPage contains a page of OperationContract values. 6670type OperationCollectionPage struct { 6671 fn func(context.Context, OperationCollection) (OperationCollection, error) 6672 oc OperationCollection 6673} 6674 6675// NextWithContext advances to the next page of values. If there was an error making 6676// the request the page does not advance and the error is returned. 6677func (page *OperationCollectionPage) NextWithContext(ctx context.Context) (err error) { 6678 if tracing.IsEnabled() { 6679 ctx = tracing.StartSpan(ctx, fqdn+"/OperationCollectionPage.NextWithContext") 6680 defer func() { 6681 sc := -1 6682 if page.Response().Response.Response != nil { 6683 sc = page.Response().Response.Response.StatusCode 6684 } 6685 tracing.EndSpan(ctx, sc, err) 6686 }() 6687 } 6688 next, err := page.fn(ctx, page.oc) 6689 if err != nil { 6690 return err 6691 } 6692 page.oc = next 6693 return nil 6694} 6695 6696// Next advances to the next page of values. If there was an error making 6697// the request the page does not advance and the error is returned. 6698// Deprecated: Use NextWithContext() instead. 6699func (page *OperationCollectionPage) Next() error { 6700 return page.NextWithContext(context.Background()) 6701} 6702 6703// NotDone returns true if the page enumeration should be started or is not yet complete. 6704func (page OperationCollectionPage) NotDone() bool { 6705 return !page.oc.IsEmpty() 6706} 6707 6708// Response returns the raw server response from the last page request. 6709func (page OperationCollectionPage) Response() OperationCollection { 6710 return page.oc 6711} 6712 6713// Values returns the slice of values for the current page or nil if there are no values. 6714func (page OperationCollectionPage) Values() []OperationContract { 6715 if page.oc.IsEmpty() { 6716 return nil 6717 } 6718 return *page.oc.Value 6719} 6720 6721// Creates a new instance of the OperationCollectionPage type. 6722func NewOperationCollectionPage(getNextPage func(context.Context, OperationCollection) (OperationCollection, error)) OperationCollectionPage { 6723 return OperationCollectionPage{fn: getNextPage} 6724} 6725 6726// OperationContract api Operation details. 6727type OperationContract struct { 6728 autorest.Response `json:"-"` 6729 // OperationContractProperties - Properties of the Operation Contract. 6730 *OperationContractProperties `json:"properties,omitempty"` 6731 // ID - READ-ONLY; Resource ID. 6732 ID *string `json:"id,omitempty"` 6733 // Name - READ-ONLY; Resource name. 6734 Name *string `json:"name,omitempty"` 6735 // Type - READ-ONLY; Resource type for API Management resource. 6736 Type *string `json:"type,omitempty"` 6737} 6738 6739// MarshalJSON is the custom marshaler for OperationContract. 6740func (oc OperationContract) MarshalJSON() ([]byte, error) { 6741 objectMap := make(map[string]interface{}) 6742 if oc.OperationContractProperties != nil { 6743 objectMap["properties"] = oc.OperationContractProperties 6744 } 6745 return json.Marshal(objectMap) 6746} 6747 6748// UnmarshalJSON is the custom unmarshaler for OperationContract struct. 6749func (oc *OperationContract) UnmarshalJSON(body []byte) error { 6750 var m map[string]*json.RawMessage 6751 err := json.Unmarshal(body, &m) 6752 if err != nil { 6753 return err 6754 } 6755 for k, v := range m { 6756 switch k { 6757 case "properties": 6758 if v != nil { 6759 var operationContractProperties OperationContractProperties 6760 err = json.Unmarshal(*v, &operationContractProperties) 6761 if err != nil { 6762 return err 6763 } 6764 oc.OperationContractProperties = &operationContractProperties 6765 } 6766 case "id": 6767 if v != nil { 6768 var ID string 6769 err = json.Unmarshal(*v, &ID) 6770 if err != nil { 6771 return err 6772 } 6773 oc.ID = &ID 6774 } 6775 case "name": 6776 if v != nil { 6777 var name string 6778 err = json.Unmarshal(*v, &name) 6779 if err != nil { 6780 return err 6781 } 6782 oc.Name = &name 6783 } 6784 case "type": 6785 if v != nil { 6786 var typeVar string 6787 err = json.Unmarshal(*v, &typeVar) 6788 if err != nil { 6789 return err 6790 } 6791 oc.Type = &typeVar 6792 } 6793 } 6794 } 6795 6796 return nil 6797} 6798 6799// OperationContractProperties operation Contract Properties 6800type OperationContractProperties struct { 6801 // DisplayName - Operation Name. 6802 DisplayName *string `json:"displayName,omitempty"` 6803 // Method - A Valid HTTP Operation Method. Typical Http Methods like GET, PUT, POST but not limited by only them. 6804 Method *string `json:"method,omitempty"` 6805 // URLTemplate - Relative URL template identifying the target resource for this operation. May include parameters. Example: /customers/{cid}/orders/{oid}/?date={date} 6806 URLTemplate *string `json:"urlTemplate,omitempty"` 6807 // TemplateParameters - Collection of URL template parameters. 6808 TemplateParameters *[]ParameterContract `json:"templateParameters,omitempty"` 6809 // Description - Description of the operation. May include HTML formatting tags. 6810 Description *string `json:"description,omitempty"` 6811 // Request - An entity containing request details. 6812 Request *RequestContract `json:"request,omitempty"` 6813 // Responses - Array of Operation responses. 6814 Responses *[]ResponseContract `json:"responses,omitempty"` 6815 // Policies - Operation Policies 6816 Policies *string `json:"policies,omitempty"` 6817} 6818 6819// OperationDisplay the object that describes the operation. 6820type OperationDisplay struct { 6821 // Provider - Friendly name of the resource provider 6822 Provider *string `json:"provider,omitempty"` 6823 // Operation - Operation type: read, write, delete, listKeys/action, etc. 6824 Operation *string `json:"operation,omitempty"` 6825 // Resource - Resource type on which the operation is performed. 6826 Resource *string `json:"resource,omitempty"` 6827 // Description - Friendly name of the operation 6828 Description *string `json:"description,omitempty"` 6829} 6830 6831// OperationEntityBaseContract api Operation Entity Base Contract details. 6832type OperationEntityBaseContract struct { 6833 // TemplateParameters - Collection of URL template parameters. 6834 TemplateParameters *[]ParameterContract `json:"templateParameters,omitempty"` 6835 // Description - Description of the operation. May include HTML formatting tags. 6836 Description *string `json:"description,omitempty"` 6837 // Request - An entity containing request details. 6838 Request *RequestContract `json:"request,omitempty"` 6839 // Responses - Array of Operation responses. 6840 Responses *[]ResponseContract `json:"responses,omitempty"` 6841 // Policies - Operation Policies 6842 Policies *string `json:"policies,omitempty"` 6843} 6844 6845// OperationListResult result of the request to list REST API operations. It contains a list of operations 6846// and a URL nextLink to get the next set of results. 6847type OperationListResult struct { 6848 autorest.Response `json:"-"` 6849 // Value - List of operations supported by the resource provider. 6850 Value *[]Operation `json:"value,omitempty"` 6851 // NextLink - URL to get the next set of operation list results if there are any. 6852 NextLink *string `json:"nextLink,omitempty"` 6853} 6854 6855// OperationListResultIterator provides access to a complete listing of Operation values. 6856type OperationListResultIterator struct { 6857 i int 6858 page OperationListResultPage 6859} 6860 6861// NextWithContext advances to the next value. If there was an error making 6862// the request the iterator does not advance and the error is returned. 6863func (iter *OperationListResultIterator) NextWithContext(ctx context.Context) (err error) { 6864 if tracing.IsEnabled() { 6865 ctx = tracing.StartSpan(ctx, fqdn+"/OperationListResultIterator.NextWithContext") 6866 defer func() { 6867 sc := -1 6868 if iter.Response().Response.Response != nil { 6869 sc = iter.Response().Response.Response.StatusCode 6870 } 6871 tracing.EndSpan(ctx, sc, err) 6872 }() 6873 } 6874 iter.i++ 6875 if iter.i < len(iter.page.Values()) { 6876 return nil 6877 } 6878 err = iter.page.NextWithContext(ctx) 6879 if err != nil { 6880 iter.i-- 6881 return err 6882 } 6883 iter.i = 0 6884 return nil 6885} 6886 6887// Next advances to the next value. If there was an error making 6888// the request the iterator does not advance and the error is returned. 6889// Deprecated: Use NextWithContext() instead. 6890func (iter *OperationListResultIterator) Next() error { 6891 return iter.NextWithContext(context.Background()) 6892} 6893 6894// NotDone returns true if the enumeration should be started or is not yet complete. 6895func (iter OperationListResultIterator) NotDone() bool { 6896 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 6897} 6898 6899// Response returns the raw server response from the last page request. 6900func (iter OperationListResultIterator) Response() OperationListResult { 6901 return iter.page.Response() 6902} 6903 6904// Value returns the current value or a zero-initialized value if the 6905// iterator has advanced beyond the end of the collection. 6906func (iter OperationListResultIterator) Value() Operation { 6907 if !iter.page.NotDone() { 6908 return Operation{} 6909 } 6910 return iter.page.Values()[iter.i] 6911} 6912 6913// Creates a new instance of the OperationListResultIterator type. 6914func NewOperationListResultIterator(page OperationListResultPage) OperationListResultIterator { 6915 return OperationListResultIterator{page: page} 6916} 6917 6918// IsEmpty returns true if the ListResult contains no values. 6919func (olr OperationListResult) IsEmpty() bool { 6920 return olr.Value == nil || len(*olr.Value) == 0 6921} 6922 6923// operationListResultPreparer prepares a request to retrieve the next set of results. 6924// It returns nil if no more results exist. 6925func (olr OperationListResult) operationListResultPreparer(ctx context.Context) (*http.Request, error) { 6926 if olr.NextLink == nil || len(to.String(olr.NextLink)) < 1 { 6927 return nil, nil 6928 } 6929 return autorest.Prepare((&http.Request{}).WithContext(ctx), 6930 autorest.AsJSON(), 6931 autorest.AsGet(), 6932 autorest.WithBaseURL(to.String(olr.NextLink))) 6933} 6934 6935// OperationListResultPage contains a page of Operation values. 6936type OperationListResultPage struct { 6937 fn func(context.Context, OperationListResult) (OperationListResult, error) 6938 olr OperationListResult 6939} 6940 6941// NextWithContext advances to the next page of values. If there was an error making 6942// the request the page does not advance and the error is returned. 6943func (page *OperationListResultPage) NextWithContext(ctx context.Context) (err error) { 6944 if tracing.IsEnabled() { 6945 ctx = tracing.StartSpan(ctx, fqdn+"/OperationListResultPage.NextWithContext") 6946 defer func() { 6947 sc := -1 6948 if page.Response().Response.Response != nil { 6949 sc = page.Response().Response.Response.StatusCode 6950 } 6951 tracing.EndSpan(ctx, sc, err) 6952 }() 6953 } 6954 next, err := page.fn(ctx, page.olr) 6955 if err != nil { 6956 return err 6957 } 6958 page.olr = next 6959 return nil 6960} 6961 6962// Next advances to the next page of values. If there was an error making 6963// the request the page does not advance and the error is returned. 6964// Deprecated: Use NextWithContext() instead. 6965func (page *OperationListResultPage) Next() error { 6966 return page.NextWithContext(context.Background()) 6967} 6968 6969// NotDone returns true if the page enumeration should be started or is not yet complete. 6970func (page OperationListResultPage) NotDone() bool { 6971 return !page.olr.IsEmpty() 6972} 6973 6974// Response returns the raw server response from the last page request. 6975func (page OperationListResultPage) Response() OperationListResult { 6976 return page.olr 6977} 6978 6979// Values returns the slice of values for the current page or nil if there are no values. 6980func (page OperationListResultPage) Values() []Operation { 6981 if page.olr.IsEmpty() { 6982 return nil 6983 } 6984 return *page.olr.Value 6985} 6986 6987// Creates a new instance of the OperationListResultPage type. 6988func NewOperationListResultPage(getNextPage func(context.Context, OperationListResult) (OperationListResult, error)) OperationListResultPage { 6989 return OperationListResultPage{fn: getNextPage} 6990} 6991 6992// OperationResultContract operation Result. 6993type OperationResultContract struct { 6994 autorest.Response `json:"-"` 6995 // ID - Operation result identifier. 6996 ID *string `json:"id,omitempty"` 6997 // Status - Status of an async operation. Possible values include: 'Started', 'InProgress', 'Succeeded', 'Failed' 6998 Status AsyncOperationStatus `json:"status,omitempty"` 6999 // 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. 7000 Started *date.Time `json:"started,omitempty"` 7001 // 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. 7002 Updated *date.Time `json:"updated,omitempty"` 7003 // ResultInfo - Optional result info. 7004 ResultInfo *string `json:"resultInfo,omitempty"` 7005 // Error - Error Body Contract 7006 Error *ErrorResponseBody `json:"error,omitempty"` 7007 // 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. 7008 ActionLog *[]OperationResultLogItemContract `json:"actionLog,omitempty"` 7009} 7010 7011// OperationResultLogItemContract log of the entity being created, updated or deleted. 7012type OperationResultLogItemContract struct { 7013 // ObjectType - The type of entity contract. 7014 ObjectType *string `json:"objectType,omitempty"` 7015 // Action - Action like create/update/delete. 7016 Action *string `json:"action,omitempty"` 7017 // ObjectKey - Identifier of the entity being created/updated/deleted. 7018 ObjectKey *string `json:"objectKey,omitempty"` 7019} 7020 7021// OperationTagResourceContractProperties operation Entity contract Properties. 7022type OperationTagResourceContractProperties struct { 7023 // ID - Identifier of the operation in form /operations/{operationId}. 7024 ID *string `json:"id,omitempty"` 7025 // Name - READ-ONLY; Operation name. 7026 Name *string `json:"name,omitempty"` 7027 // APIName - READ-ONLY; Api Name. 7028 APIName *string `json:"apiName,omitempty"` 7029 // APIRevision - READ-ONLY; Api Revision. 7030 APIRevision *string `json:"apiRevision,omitempty"` 7031 // APIVersion - READ-ONLY; Api Version. 7032 APIVersion *string `json:"apiVersion,omitempty"` 7033 // Description - READ-ONLY; Operation Description. 7034 Description *string `json:"description,omitempty"` 7035 // Method - READ-ONLY; A Valid HTTP Operation Method. Typical Http Methods like GET, PUT, POST but not limited by only them. 7036 Method *string `json:"method,omitempty"` 7037 // URLTemplate - READ-ONLY; Relative URL template identifying the target resource for this operation. May include parameters. Example: /customers/{cid}/orders/{oid}/?date={date} 7038 URLTemplate *string `json:"urlTemplate,omitempty"` 7039} 7040 7041// OperationUpdateContract api Operation Update Contract details. 7042type OperationUpdateContract struct { 7043 // OperationUpdateContractProperties - Properties of the API Operation entity that can be updated. 7044 *OperationUpdateContractProperties `json:"properties,omitempty"` 7045} 7046 7047// MarshalJSON is the custom marshaler for OperationUpdateContract. 7048func (ouc OperationUpdateContract) MarshalJSON() ([]byte, error) { 7049 objectMap := make(map[string]interface{}) 7050 if ouc.OperationUpdateContractProperties != nil { 7051 objectMap["properties"] = ouc.OperationUpdateContractProperties 7052 } 7053 return json.Marshal(objectMap) 7054} 7055 7056// UnmarshalJSON is the custom unmarshaler for OperationUpdateContract struct. 7057func (ouc *OperationUpdateContract) UnmarshalJSON(body []byte) error { 7058 var m map[string]*json.RawMessage 7059 err := json.Unmarshal(body, &m) 7060 if err != nil { 7061 return err 7062 } 7063 for k, v := range m { 7064 switch k { 7065 case "properties": 7066 if v != nil { 7067 var operationUpdateContractProperties OperationUpdateContractProperties 7068 err = json.Unmarshal(*v, &operationUpdateContractProperties) 7069 if err != nil { 7070 return err 7071 } 7072 ouc.OperationUpdateContractProperties = &operationUpdateContractProperties 7073 } 7074 } 7075 } 7076 7077 return nil 7078} 7079 7080// OperationUpdateContractProperties operation Update Contract Properties. 7081type OperationUpdateContractProperties struct { 7082 // DisplayName - Operation Name. 7083 DisplayName *string `json:"displayName,omitempty"` 7084 // Method - A Valid HTTP Operation Method. Typical Http Methods like GET, PUT, POST but not limited by only them. 7085 Method *string `json:"method,omitempty"` 7086 // URLTemplate - Relative URL template identifying the target resource for this operation. May include parameters. Example: /customers/{cid}/orders/{oid}/?date={date} 7087 URLTemplate *string `json:"urlTemplate,omitempty"` 7088 // TemplateParameters - Collection of URL template parameters. 7089 TemplateParameters *[]ParameterContract `json:"templateParameters,omitempty"` 7090 // Description - Description of the operation. May include HTML formatting tags. 7091 Description *string `json:"description,omitempty"` 7092 // Request - An entity containing request details. 7093 Request *RequestContract `json:"request,omitempty"` 7094 // Responses - Array of Operation responses. 7095 Responses *[]ResponseContract `json:"responses,omitempty"` 7096 // Policies - Operation Policies 7097 Policies *string `json:"policies,omitempty"` 7098} 7099 7100// ParameterContract operation parameters details. 7101type ParameterContract struct { 7102 // Name - Parameter name. 7103 Name *string `json:"name,omitempty"` 7104 // Description - Parameter description. 7105 Description *string `json:"description,omitempty"` 7106 // Type - Parameter type. 7107 Type *string `json:"type,omitempty"` 7108 // DefaultValue - Default parameter value. 7109 DefaultValue *string `json:"defaultValue,omitempty"` 7110 // Required - Specifies whether parameter is required or not. 7111 Required *bool `json:"required,omitempty"` 7112 // Values - Parameter values. 7113 Values *[]string `json:"values,omitempty"` 7114} 7115 7116// PipelineDiagnosticSettings diagnostic settings for incoming/outgoing HTTP messages to the Gateway. 7117type PipelineDiagnosticSettings struct { 7118 // Request - Diagnostic settings for request. 7119 Request *HTTPMessageDiagnostic `json:"request,omitempty"` 7120 // Response - Diagnostic settings for response. 7121 Response *HTTPMessageDiagnostic `json:"response,omitempty"` 7122} 7123 7124// PolicyCollection the response of the list policy operation. 7125type PolicyCollection struct { 7126 autorest.Response `json:"-"` 7127 // Value - Policy Contract value. 7128 Value *[]PolicyContract `json:"value,omitempty"` 7129 // NextLink - Next page link if any. 7130 NextLink *string `json:"nextLink,omitempty"` 7131} 7132 7133// PolicyContract policy Contract details. 7134type PolicyContract struct { 7135 autorest.Response `json:"-"` 7136 // PolicyContractProperties - Properties of the Policy. 7137 *PolicyContractProperties `json:"properties,omitempty"` 7138 // ID - READ-ONLY; Resource ID. 7139 ID *string `json:"id,omitempty"` 7140 // Name - READ-ONLY; Resource name. 7141 Name *string `json:"name,omitempty"` 7142 // Type - READ-ONLY; Resource type for API Management resource. 7143 Type *string `json:"type,omitempty"` 7144} 7145 7146// MarshalJSON is the custom marshaler for PolicyContract. 7147func (pc PolicyContract) MarshalJSON() ([]byte, error) { 7148 objectMap := make(map[string]interface{}) 7149 if pc.PolicyContractProperties != nil { 7150 objectMap["properties"] = pc.PolicyContractProperties 7151 } 7152 return json.Marshal(objectMap) 7153} 7154 7155// UnmarshalJSON is the custom unmarshaler for PolicyContract struct. 7156func (pc *PolicyContract) UnmarshalJSON(body []byte) error { 7157 var m map[string]*json.RawMessage 7158 err := json.Unmarshal(body, &m) 7159 if err != nil { 7160 return err 7161 } 7162 for k, v := range m { 7163 switch k { 7164 case "properties": 7165 if v != nil { 7166 var policyContractProperties PolicyContractProperties 7167 err = json.Unmarshal(*v, &policyContractProperties) 7168 if err != nil { 7169 return err 7170 } 7171 pc.PolicyContractProperties = &policyContractProperties 7172 } 7173 case "id": 7174 if v != nil { 7175 var ID string 7176 err = json.Unmarshal(*v, &ID) 7177 if err != nil { 7178 return err 7179 } 7180 pc.ID = &ID 7181 } 7182 case "name": 7183 if v != nil { 7184 var name string 7185 err = json.Unmarshal(*v, &name) 7186 if err != nil { 7187 return err 7188 } 7189 pc.Name = &name 7190 } 7191 case "type": 7192 if v != nil { 7193 var typeVar string 7194 err = json.Unmarshal(*v, &typeVar) 7195 if err != nil { 7196 return err 7197 } 7198 pc.Type = &typeVar 7199 } 7200 } 7201 } 7202 7203 return nil 7204} 7205 7206// PolicyContractProperties policy contract Properties. 7207type PolicyContractProperties struct { 7208 // Value - Contents of the Policy as defined by the format. 7209 Value *string `json:"value,omitempty"` 7210 // Format - Format of the policyContent. Possible values include: 'XML', 'XMLLink', 'Rawxml', 'RawxmlLink' 7211 Format PolicyContentFormat `json:"format,omitempty"` 7212} 7213 7214// PolicySnippetContract policy snippet. 7215type PolicySnippetContract struct { 7216 // Name - READ-ONLY; Snippet name. 7217 Name *string `json:"name,omitempty"` 7218 // Content - READ-ONLY; Snippet content. 7219 Content *string `json:"content,omitempty"` 7220 // ToolTip - READ-ONLY; Snippet toolTip. 7221 ToolTip *string `json:"toolTip,omitempty"` 7222 // Scope - READ-ONLY; Binary OR value of the Snippet scope. 7223 Scope *int32 `json:"scope,omitempty"` 7224} 7225 7226// PolicySnippetsCollection the response of the list policy snippets operation. 7227type PolicySnippetsCollection struct { 7228 autorest.Response `json:"-"` 7229 // Value - Policy snippet value. 7230 Value *[]PolicySnippetContract `json:"value,omitempty"` 7231} 7232 7233// PortalDelegationSettings delegation settings for a developer portal. 7234type PortalDelegationSettings struct { 7235 autorest.Response `json:"-"` 7236 // PortalDelegationSettingsProperties - Delegation settings contract properties. 7237 *PortalDelegationSettingsProperties `json:"properties,omitempty"` 7238 // ID - READ-ONLY; Resource ID. 7239 ID *string `json:"id,omitempty"` 7240 // Name - READ-ONLY; Resource name. 7241 Name *string `json:"name,omitempty"` 7242 // Type - READ-ONLY; Resource type for API Management resource. 7243 Type *string `json:"type,omitempty"` 7244} 7245 7246// MarshalJSON is the custom marshaler for PortalDelegationSettings. 7247func (pds PortalDelegationSettings) MarshalJSON() ([]byte, error) { 7248 objectMap := make(map[string]interface{}) 7249 if pds.PortalDelegationSettingsProperties != nil { 7250 objectMap["properties"] = pds.PortalDelegationSettingsProperties 7251 } 7252 return json.Marshal(objectMap) 7253} 7254 7255// UnmarshalJSON is the custom unmarshaler for PortalDelegationSettings struct. 7256func (pds *PortalDelegationSettings) UnmarshalJSON(body []byte) error { 7257 var m map[string]*json.RawMessage 7258 err := json.Unmarshal(body, &m) 7259 if err != nil { 7260 return err 7261 } 7262 for k, v := range m { 7263 switch k { 7264 case "properties": 7265 if v != nil { 7266 var portalDelegationSettingsProperties PortalDelegationSettingsProperties 7267 err = json.Unmarshal(*v, &portalDelegationSettingsProperties) 7268 if err != nil { 7269 return err 7270 } 7271 pds.PortalDelegationSettingsProperties = &portalDelegationSettingsProperties 7272 } 7273 case "id": 7274 if v != nil { 7275 var ID string 7276 err = json.Unmarshal(*v, &ID) 7277 if err != nil { 7278 return err 7279 } 7280 pds.ID = &ID 7281 } 7282 case "name": 7283 if v != nil { 7284 var name string 7285 err = json.Unmarshal(*v, &name) 7286 if err != nil { 7287 return err 7288 } 7289 pds.Name = &name 7290 } 7291 case "type": 7292 if v != nil { 7293 var typeVar string 7294 err = json.Unmarshal(*v, &typeVar) 7295 if err != nil { 7296 return err 7297 } 7298 pds.Type = &typeVar 7299 } 7300 } 7301 } 7302 7303 return nil 7304} 7305 7306// PortalDelegationSettingsProperties delegation settings contract properties. 7307type PortalDelegationSettingsProperties struct { 7308 // URL - A delegation Url. 7309 URL *string `json:"url,omitempty"` 7310 // ValidationKey - A base64-encoded validation key to validate, that a request is coming from Azure API Management. 7311 ValidationKey *string `json:"validationKey,omitempty"` 7312 // Subscriptions - Subscriptions delegation settings. 7313 Subscriptions *SubscriptionsDelegationSettingsProperties `json:"subscriptions,omitempty"` 7314 // UserRegistration - User registration delegation settings. 7315 UserRegistration *RegistrationDelegationSettingsProperties `json:"userRegistration,omitempty"` 7316} 7317 7318// PortalSigninSettingProperties sign-in settings contract properties. 7319type PortalSigninSettingProperties struct { 7320 // Enabled - Redirect Anonymous users to the Sign-In page. 7321 Enabled *bool `json:"enabled,omitempty"` 7322} 7323 7324// PortalSigninSettings sign-In settings for the Developer Portal. 7325type PortalSigninSettings struct { 7326 autorest.Response `json:"-"` 7327 // PortalSigninSettingProperties - Sign-in settings contract properties. 7328 *PortalSigninSettingProperties `json:"properties,omitempty"` 7329 // ID - READ-ONLY; Resource ID. 7330 ID *string `json:"id,omitempty"` 7331 // Name - READ-ONLY; Resource name. 7332 Name *string `json:"name,omitempty"` 7333 // Type - READ-ONLY; Resource type for API Management resource. 7334 Type *string `json:"type,omitempty"` 7335} 7336 7337// MarshalJSON is the custom marshaler for PortalSigninSettings. 7338func (pss PortalSigninSettings) MarshalJSON() ([]byte, error) { 7339 objectMap := make(map[string]interface{}) 7340 if pss.PortalSigninSettingProperties != nil { 7341 objectMap["properties"] = pss.PortalSigninSettingProperties 7342 } 7343 return json.Marshal(objectMap) 7344} 7345 7346// UnmarshalJSON is the custom unmarshaler for PortalSigninSettings struct. 7347func (pss *PortalSigninSettings) UnmarshalJSON(body []byte) error { 7348 var m map[string]*json.RawMessage 7349 err := json.Unmarshal(body, &m) 7350 if err != nil { 7351 return err 7352 } 7353 for k, v := range m { 7354 switch k { 7355 case "properties": 7356 if v != nil { 7357 var portalSigninSettingProperties PortalSigninSettingProperties 7358 err = json.Unmarshal(*v, &portalSigninSettingProperties) 7359 if err != nil { 7360 return err 7361 } 7362 pss.PortalSigninSettingProperties = &portalSigninSettingProperties 7363 } 7364 case "id": 7365 if v != nil { 7366 var ID string 7367 err = json.Unmarshal(*v, &ID) 7368 if err != nil { 7369 return err 7370 } 7371 pss.ID = &ID 7372 } 7373 case "name": 7374 if v != nil { 7375 var name string 7376 err = json.Unmarshal(*v, &name) 7377 if err != nil { 7378 return err 7379 } 7380 pss.Name = &name 7381 } 7382 case "type": 7383 if v != nil { 7384 var typeVar string 7385 err = json.Unmarshal(*v, &typeVar) 7386 if err != nil { 7387 return err 7388 } 7389 pss.Type = &typeVar 7390 } 7391 } 7392 } 7393 7394 return nil 7395} 7396 7397// PortalSignupSettings sign-Up settings for a developer portal. 7398type PortalSignupSettings struct { 7399 autorest.Response `json:"-"` 7400 // PortalSignupSettingsProperties - Sign-up settings contract properties. 7401 *PortalSignupSettingsProperties `json:"properties,omitempty"` 7402 // ID - READ-ONLY; Resource ID. 7403 ID *string `json:"id,omitempty"` 7404 // Name - READ-ONLY; Resource name. 7405 Name *string `json:"name,omitempty"` 7406 // Type - READ-ONLY; Resource type for API Management resource. 7407 Type *string `json:"type,omitempty"` 7408} 7409 7410// MarshalJSON is the custom marshaler for PortalSignupSettings. 7411func (pss PortalSignupSettings) MarshalJSON() ([]byte, error) { 7412 objectMap := make(map[string]interface{}) 7413 if pss.PortalSignupSettingsProperties != nil { 7414 objectMap["properties"] = pss.PortalSignupSettingsProperties 7415 } 7416 return json.Marshal(objectMap) 7417} 7418 7419// UnmarshalJSON is the custom unmarshaler for PortalSignupSettings struct. 7420func (pss *PortalSignupSettings) UnmarshalJSON(body []byte) error { 7421 var m map[string]*json.RawMessage 7422 err := json.Unmarshal(body, &m) 7423 if err != nil { 7424 return err 7425 } 7426 for k, v := range m { 7427 switch k { 7428 case "properties": 7429 if v != nil { 7430 var portalSignupSettingsProperties PortalSignupSettingsProperties 7431 err = json.Unmarshal(*v, &portalSignupSettingsProperties) 7432 if err != nil { 7433 return err 7434 } 7435 pss.PortalSignupSettingsProperties = &portalSignupSettingsProperties 7436 } 7437 case "id": 7438 if v != nil { 7439 var ID string 7440 err = json.Unmarshal(*v, &ID) 7441 if err != nil { 7442 return err 7443 } 7444 pss.ID = &ID 7445 } 7446 case "name": 7447 if v != nil { 7448 var name string 7449 err = json.Unmarshal(*v, &name) 7450 if err != nil { 7451 return err 7452 } 7453 pss.Name = &name 7454 } 7455 case "type": 7456 if v != nil { 7457 var typeVar string 7458 err = json.Unmarshal(*v, &typeVar) 7459 if err != nil { 7460 return err 7461 } 7462 pss.Type = &typeVar 7463 } 7464 } 7465 } 7466 7467 return nil 7468} 7469 7470// PortalSignupSettingsProperties sign-up settings contract properties. 7471type PortalSignupSettingsProperties struct { 7472 // Enabled - Allow users to sign up on a developer portal. 7473 Enabled *bool `json:"enabled,omitempty"` 7474 // TermsOfService - Terms of service contract properties. 7475 TermsOfService *TermsOfServiceProperties `json:"termsOfService,omitempty"` 7476} 7477 7478// ProductCollection paged Products list representation. 7479type ProductCollection struct { 7480 autorest.Response `json:"-"` 7481 // Value - Page values. 7482 Value *[]ProductContract `json:"value,omitempty"` 7483 // NextLink - Next page link if any. 7484 NextLink *string `json:"nextLink,omitempty"` 7485} 7486 7487// ProductCollectionIterator provides access to a complete listing of ProductContract values. 7488type ProductCollectionIterator struct { 7489 i int 7490 page ProductCollectionPage 7491} 7492 7493// NextWithContext advances to the next value. If there was an error making 7494// the request the iterator does not advance and the error is returned. 7495func (iter *ProductCollectionIterator) NextWithContext(ctx context.Context) (err error) { 7496 if tracing.IsEnabled() { 7497 ctx = tracing.StartSpan(ctx, fqdn+"/ProductCollectionIterator.NextWithContext") 7498 defer func() { 7499 sc := -1 7500 if iter.Response().Response.Response != nil { 7501 sc = iter.Response().Response.Response.StatusCode 7502 } 7503 tracing.EndSpan(ctx, sc, err) 7504 }() 7505 } 7506 iter.i++ 7507 if iter.i < len(iter.page.Values()) { 7508 return nil 7509 } 7510 err = iter.page.NextWithContext(ctx) 7511 if err != nil { 7512 iter.i-- 7513 return err 7514 } 7515 iter.i = 0 7516 return nil 7517} 7518 7519// Next advances to the next value. If there was an error making 7520// the request the iterator does not advance and the error is returned. 7521// Deprecated: Use NextWithContext() instead. 7522func (iter *ProductCollectionIterator) Next() error { 7523 return iter.NextWithContext(context.Background()) 7524} 7525 7526// NotDone returns true if the enumeration should be started or is not yet complete. 7527func (iter ProductCollectionIterator) NotDone() bool { 7528 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 7529} 7530 7531// Response returns the raw server response from the last page request. 7532func (iter ProductCollectionIterator) Response() ProductCollection { 7533 return iter.page.Response() 7534} 7535 7536// Value returns the current value or a zero-initialized value if the 7537// iterator has advanced beyond the end of the collection. 7538func (iter ProductCollectionIterator) Value() ProductContract { 7539 if !iter.page.NotDone() { 7540 return ProductContract{} 7541 } 7542 return iter.page.Values()[iter.i] 7543} 7544 7545// Creates a new instance of the ProductCollectionIterator type. 7546func NewProductCollectionIterator(page ProductCollectionPage) ProductCollectionIterator { 7547 return ProductCollectionIterator{page: page} 7548} 7549 7550// IsEmpty returns true if the ListResult contains no values. 7551func (pc ProductCollection) IsEmpty() bool { 7552 return pc.Value == nil || len(*pc.Value) == 0 7553} 7554 7555// productCollectionPreparer prepares a request to retrieve the next set of results. 7556// It returns nil if no more results exist. 7557func (pc ProductCollection) productCollectionPreparer(ctx context.Context) (*http.Request, error) { 7558 if pc.NextLink == nil || len(to.String(pc.NextLink)) < 1 { 7559 return nil, nil 7560 } 7561 return autorest.Prepare((&http.Request{}).WithContext(ctx), 7562 autorest.AsJSON(), 7563 autorest.AsGet(), 7564 autorest.WithBaseURL(to.String(pc.NextLink))) 7565} 7566 7567// ProductCollectionPage contains a page of ProductContract values. 7568type ProductCollectionPage struct { 7569 fn func(context.Context, ProductCollection) (ProductCollection, error) 7570 pc ProductCollection 7571} 7572 7573// NextWithContext advances to the next page of values. If there was an error making 7574// the request the page does not advance and the error is returned. 7575func (page *ProductCollectionPage) NextWithContext(ctx context.Context) (err error) { 7576 if tracing.IsEnabled() { 7577 ctx = tracing.StartSpan(ctx, fqdn+"/ProductCollectionPage.NextWithContext") 7578 defer func() { 7579 sc := -1 7580 if page.Response().Response.Response != nil { 7581 sc = page.Response().Response.Response.StatusCode 7582 } 7583 tracing.EndSpan(ctx, sc, err) 7584 }() 7585 } 7586 next, err := page.fn(ctx, page.pc) 7587 if err != nil { 7588 return err 7589 } 7590 page.pc = next 7591 return nil 7592} 7593 7594// Next advances to the next page of values. If there was an error making 7595// the request the page does not advance and the error is returned. 7596// Deprecated: Use NextWithContext() instead. 7597func (page *ProductCollectionPage) Next() error { 7598 return page.NextWithContext(context.Background()) 7599} 7600 7601// NotDone returns true if the page enumeration should be started or is not yet complete. 7602func (page ProductCollectionPage) NotDone() bool { 7603 return !page.pc.IsEmpty() 7604} 7605 7606// Response returns the raw server response from the last page request. 7607func (page ProductCollectionPage) Response() ProductCollection { 7608 return page.pc 7609} 7610 7611// Values returns the slice of values for the current page or nil if there are no values. 7612func (page ProductCollectionPage) Values() []ProductContract { 7613 if page.pc.IsEmpty() { 7614 return nil 7615 } 7616 return *page.pc.Value 7617} 7618 7619// Creates a new instance of the ProductCollectionPage type. 7620func NewProductCollectionPage(getNextPage func(context.Context, ProductCollection) (ProductCollection, error)) ProductCollectionPage { 7621 return ProductCollectionPage{fn: getNextPage} 7622} 7623 7624// ProductContract product details. 7625type ProductContract struct { 7626 autorest.Response `json:"-"` 7627 // ProductContractProperties - Product entity contract properties. 7628 *ProductContractProperties `json:"properties,omitempty"` 7629 // ID - READ-ONLY; Resource ID. 7630 ID *string `json:"id,omitempty"` 7631 // Name - READ-ONLY; Resource name. 7632 Name *string `json:"name,omitempty"` 7633 // Type - READ-ONLY; Resource type for API Management resource. 7634 Type *string `json:"type,omitempty"` 7635} 7636 7637// MarshalJSON is the custom marshaler for ProductContract. 7638func (pc ProductContract) MarshalJSON() ([]byte, error) { 7639 objectMap := make(map[string]interface{}) 7640 if pc.ProductContractProperties != nil { 7641 objectMap["properties"] = pc.ProductContractProperties 7642 } 7643 return json.Marshal(objectMap) 7644} 7645 7646// UnmarshalJSON is the custom unmarshaler for ProductContract struct. 7647func (pc *ProductContract) UnmarshalJSON(body []byte) error { 7648 var m map[string]*json.RawMessage 7649 err := json.Unmarshal(body, &m) 7650 if err != nil { 7651 return err 7652 } 7653 for k, v := range m { 7654 switch k { 7655 case "properties": 7656 if v != nil { 7657 var productContractProperties ProductContractProperties 7658 err = json.Unmarshal(*v, &productContractProperties) 7659 if err != nil { 7660 return err 7661 } 7662 pc.ProductContractProperties = &productContractProperties 7663 } 7664 case "id": 7665 if v != nil { 7666 var ID string 7667 err = json.Unmarshal(*v, &ID) 7668 if err != nil { 7669 return err 7670 } 7671 pc.ID = &ID 7672 } 7673 case "name": 7674 if v != nil { 7675 var name string 7676 err = json.Unmarshal(*v, &name) 7677 if err != nil { 7678 return err 7679 } 7680 pc.Name = &name 7681 } 7682 case "type": 7683 if v != nil { 7684 var typeVar string 7685 err = json.Unmarshal(*v, &typeVar) 7686 if err != nil { 7687 return err 7688 } 7689 pc.Type = &typeVar 7690 } 7691 } 7692 } 7693 7694 return nil 7695} 7696 7697// ProductContractProperties product profile. 7698type ProductContractProperties struct { 7699 // DisplayName - Product name. 7700 DisplayName *string `json:"displayName,omitempty"` 7701 // Description - Product description. May include HTML formatting tags. 7702 Description *string `json:"description,omitempty"` 7703 // 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. 7704 Terms *string `json:"terms,omitempty"` 7705 // 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. 7706 SubscriptionRequired *bool `json:"subscriptionRequired,omitempty"` 7707 // 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. 7708 ApprovalRequired *bool `json:"approvalRequired,omitempty"` 7709 // 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. 7710 SubscriptionsLimit *int32 `json:"subscriptionsLimit,omitempty"` 7711 // 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' 7712 State ProductState `json:"state,omitempty"` 7713} 7714 7715// ProductEntityBaseParameters product Entity Base Parameters 7716type ProductEntityBaseParameters struct { 7717 // Description - Product description. May include HTML formatting tags. 7718 Description *string `json:"description,omitempty"` 7719 // 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. 7720 Terms *string `json:"terms,omitempty"` 7721 // 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. 7722 SubscriptionRequired *bool `json:"subscriptionRequired,omitempty"` 7723 // 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. 7724 ApprovalRequired *bool `json:"approvalRequired,omitempty"` 7725 // 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. 7726 SubscriptionsLimit *int32 `json:"subscriptionsLimit,omitempty"` 7727 // 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' 7728 State ProductState `json:"state,omitempty"` 7729} 7730 7731// ProductTagResourceContractProperties product profile. 7732type ProductTagResourceContractProperties struct { 7733 // ID - Identifier of the product in the form of /products/{productId} 7734 ID *string `json:"id,omitempty"` 7735 // Name - Product name. 7736 Name *string `json:"name,omitempty"` 7737 // Description - Product description. May include HTML formatting tags. 7738 Description *string `json:"description,omitempty"` 7739 // 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. 7740 Terms *string `json:"terms,omitempty"` 7741 // 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. 7742 SubscriptionRequired *bool `json:"subscriptionRequired,omitempty"` 7743 // 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. 7744 ApprovalRequired *bool `json:"approvalRequired,omitempty"` 7745 // 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. 7746 SubscriptionsLimit *int32 `json:"subscriptionsLimit,omitempty"` 7747 // 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' 7748 State ProductState `json:"state,omitempty"` 7749} 7750 7751// ProductUpdateParameters product Update parameters. 7752type ProductUpdateParameters struct { 7753 // ProductUpdateProperties - Product entity Update contract properties. 7754 *ProductUpdateProperties `json:"properties,omitempty"` 7755} 7756 7757// MarshalJSON is the custom marshaler for ProductUpdateParameters. 7758func (pup ProductUpdateParameters) MarshalJSON() ([]byte, error) { 7759 objectMap := make(map[string]interface{}) 7760 if pup.ProductUpdateProperties != nil { 7761 objectMap["properties"] = pup.ProductUpdateProperties 7762 } 7763 return json.Marshal(objectMap) 7764} 7765 7766// UnmarshalJSON is the custom unmarshaler for ProductUpdateParameters struct. 7767func (pup *ProductUpdateParameters) UnmarshalJSON(body []byte) error { 7768 var m map[string]*json.RawMessage 7769 err := json.Unmarshal(body, &m) 7770 if err != nil { 7771 return err 7772 } 7773 for k, v := range m { 7774 switch k { 7775 case "properties": 7776 if v != nil { 7777 var productUpdateProperties ProductUpdateProperties 7778 err = json.Unmarshal(*v, &productUpdateProperties) 7779 if err != nil { 7780 return err 7781 } 7782 pup.ProductUpdateProperties = &productUpdateProperties 7783 } 7784 } 7785 } 7786 7787 return nil 7788} 7789 7790// ProductUpdateProperties parameters supplied to the Update Product operation. 7791type ProductUpdateProperties struct { 7792 // DisplayName - Product name. 7793 DisplayName *string `json:"displayName,omitempty"` 7794 // Description - Product description. May include HTML formatting tags. 7795 Description *string `json:"description,omitempty"` 7796 // 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. 7797 Terms *string `json:"terms,omitempty"` 7798 // 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. 7799 SubscriptionRequired *bool `json:"subscriptionRequired,omitempty"` 7800 // 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. 7801 ApprovalRequired *bool `json:"approvalRequired,omitempty"` 7802 // 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. 7803 SubscriptionsLimit *int32 `json:"subscriptionsLimit,omitempty"` 7804 // 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' 7805 State ProductState `json:"state,omitempty"` 7806} 7807 7808// PropertyCollection paged Property list representation. 7809type PropertyCollection struct { 7810 autorest.Response `json:"-"` 7811 // Value - Page values. 7812 Value *[]PropertyContract `json:"value,omitempty"` 7813 // NextLink - Next page link if any. 7814 NextLink *string `json:"nextLink,omitempty"` 7815} 7816 7817// PropertyCollectionIterator provides access to a complete listing of PropertyContract values. 7818type PropertyCollectionIterator struct { 7819 i int 7820 page PropertyCollectionPage 7821} 7822 7823// NextWithContext advances to the next value. If there was an error making 7824// the request the iterator does not advance and the error is returned. 7825func (iter *PropertyCollectionIterator) NextWithContext(ctx context.Context) (err error) { 7826 if tracing.IsEnabled() { 7827 ctx = tracing.StartSpan(ctx, fqdn+"/PropertyCollectionIterator.NextWithContext") 7828 defer func() { 7829 sc := -1 7830 if iter.Response().Response.Response != nil { 7831 sc = iter.Response().Response.Response.StatusCode 7832 } 7833 tracing.EndSpan(ctx, sc, err) 7834 }() 7835 } 7836 iter.i++ 7837 if iter.i < len(iter.page.Values()) { 7838 return nil 7839 } 7840 err = iter.page.NextWithContext(ctx) 7841 if err != nil { 7842 iter.i-- 7843 return err 7844 } 7845 iter.i = 0 7846 return nil 7847} 7848 7849// Next advances to the next value. If there was an error making 7850// the request the iterator does not advance and the error is returned. 7851// Deprecated: Use NextWithContext() instead. 7852func (iter *PropertyCollectionIterator) Next() error { 7853 return iter.NextWithContext(context.Background()) 7854} 7855 7856// NotDone returns true if the enumeration should be started or is not yet complete. 7857func (iter PropertyCollectionIterator) NotDone() bool { 7858 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 7859} 7860 7861// Response returns the raw server response from the last page request. 7862func (iter PropertyCollectionIterator) Response() PropertyCollection { 7863 return iter.page.Response() 7864} 7865 7866// Value returns the current value or a zero-initialized value if the 7867// iterator has advanced beyond the end of the collection. 7868func (iter PropertyCollectionIterator) Value() PropertyContract { 7869 if !iter.page.NotDone() { 7870 return PropertyContract{} 7871 } 7872 return iter.page.Values()[iter.i] 7873} 7874 7875// Creates a new instance of the PropertyCollectionIterator type. 7876func NewPropertyCollectionIterator(page PropertyCollectionPage) PropertyCollectionIterator { 7877 return PropertyCollectionIterator{page: page} 7878} 7879 7880// IsEmpty returns true if the ListResult contains no values. 7881func (pc PropertyCollection) IsEmpty() bool { 7882 return pc.Value == nil || len(*pc.Value) == 0 7883} 7884 7885// propertyCollectionPreparer prepares a request to retrieve the next set of results. 7886// It returns nil if no more results exist. 7887func (pc PropertyCollection) propertyCollectionPreparer(ctx context.Context) (*http.Request, error) { 7888 if pc.NextLink == nil || len(to.String(pc.NextLink)) < 1 { 7889 return nil, nil 7890 } 7891 return autorest.Prepare((&http.Request{}).WithContext(ctx), 7892 autorest.AsJSON(), 7893 autorest.AsGet(), 7894 autorest.WithBaseURL(to.String(pc.NextLink))) 7895} 7896 7897// PropertyCollectionPage contains a page of PropertyContract values. 7898type PropertyCollectionPage struct { 7899 fn func(context.Context, PropertyCollection) (PropertyCollection, error) 7900 pc PropertyCollection 7901} 7902 7903// NextWithContext advances to the next page of values. If there was an error making 7904// the request the page does not advance and the error is returned. 7905func (page *PropertyCollectionPage) NextWithContext(ctx context.Context) (err error) { 7906 if tracing.IsEnabled() { 7907 ctx = tracing.StartSpan(ctx, fqdn+"/PropertyCollectionPage.NextWithContext") 7908 defer func() { 7909 sc := -1 7910 if page.Response().Response.Response != nil { 7911 sc = page.Response().Response.Response.StatusCode 7912 } 7913 tracing.EndSpan(ctx, sc, err) 7914 }() 7915 } 7916 next, err := page.fn(ctx, page.pc) 7917 if err != nil { 7918 return err 7919 } 7920 page.pc = next 7921 return nil 7922} 7923 7924// Next advances to the next page of values. If there was an error making 7925// the request the page does not advance and the error is returned. 7926// Deprecated: Use NextWithContext() instead. 7927func (page *PropertyCollectionPage) Next() error { 7928 return page.NextWithContext(context.Background()) 7929} 7930 7931// NotDone returns true if the page enumeration should be started or is not yet complete. 7932func (page PropertyCollectionPage) NotDone() bool { 7933 return !page.pc.IsEmpty() 7934} 7935 7936// Response returns the raw server response from the last page request. 7937func (page PropertyCollectionPage) Response() PropertyCollection { 7938 return page.pc 7939} 7940 7941// Values returns the slice of values for the current page or nil if there are no values. 7942func (page PropertyCollectionPage) Values() []PropertyContract { 7943 if page.pc.IsEmpty() { 7944 return nil 7945 } 7946 return *page.pc.Value 7947} 7948 7949// Creates a new instance of the PropertyCollectionPage type. 7950func NewPropertyCollectionPage(getNextPage func(context.Context, PropertyCollection) (PropertyCollection, error)) PropertyCollectionPage { 7951 return PropertyCollectionPage{fn: getNextPage} 7952} 7953 7954// PropertyContract property details. 7955type PropertyContract struct { 7956 autorest.Response `json:"-"` 7957 // PropertyContractProperties - Property entity contract properties. 7958 *PropertyContractProperties `json:"properties,omitempty"` 7959 // ID - READ-ONLY; Resource ID. 7960 ID *string `json:"id,omitempty"` 7961 // Name - READ-ONLY; Resource name. 7962 Name *string `json:"name,omitempty"` 7963 // Type - READ-ONLY; Resource type for API Management resource. 7964 Type *string `json:"type,omitempty"` 7965} 7966 7967// MarshalJSON is the custom marshaler for PropertyContract. 7968func (pc PropertyContract) MarshalJSON() ([]byte, error) { 7969 objectMap := make(map[string]interface{}) 7970 if pc.PropertyContractProperties != nil { 7971 objectMap["properties"] = pc.PropertyContractProperties 7972 } 7973 return json.Marshal(objectMap) 7974} 7975 7976// UnmarshalJSON is the custom unmarshaler for PropertyContract struct. 7977func (pc *PropertyContract) UnmarshalJSON(body []byte) error { 7978 var m map[string]*json.RawMessage 7979 err := json.Unmarshal(body, &m) 7980 if err != nil { 7981 return err 7982 } 7983 for k, v := range m { 7984 switch k { 7985 case "properties": 7986 if v != nil { 7987 var propertyContractProperties PropertyContractProperties 7988 err = json.Unmarshal(*v, &propertyContractProperties) 7989 if err != nil { 7990 return err 7991 } 7992 pc.PropertyContractProperties = &propertyContractProperties 7993 } 7994 case "id": 7995 if v != nil { 7996 var ID string 7997 err = json.Unmarshal(*v, &ID) 7998 if err != nil { 7999 return err 8000 } 8001 pc.ID = &ID 8002 } 8003 case "name": 8004 if v != nil { 8005 var name string 8006 err = json.Unmarshal(*v, &name) 8007 if err != nil { 8008 return err 8009 } 8010 pc.Name = &name 8011 } 8012 case "type": 8013 if v != nil { 8014 var typeVar string 8015 err = json.Unmarshal(*v, &typeVar) 8016 if err != nil { 8017 return err 8018 } 8019 pc.Type = &typeVar 8020 } 8021 } 8022 } 8023 8024 return nil 8025} 8026 8027// PropertyContractProperties property Contract properties. 8028type PropertyContractProperties struct { 8029 // DisplayName - Unique name of Property. It may contain only letters, digits, period, dash, and underscore characters. 8030 DisplayName *string `json:"displayName,omitempty"` 8031 // Value - Value of the property. Can contain policy expressions. It may not be empty or consist only of whitespace. 8032 Value *string `json:"value,omitempty"` 8033 // Tags - Optional tags that when provided can be used to filter the property list. 8034 Tags *[]string `json:"tags,omitempty"` 8035 // Secret - Determines whether the value is a secret and should be encrypted or not. Default value is false. 8036 Secret *bool `json:"secret,omitempty"` 8037} 8038 8039// PropertyEntityBaseParameters property Entity Base Parameters set. 8040type PropertyEntityBaseParameters struct { 8041 // Tags - Optional tags that when provided can be used to filter the property list. 8042 Tags *[]string `json:"tags,omitempty"` 8043 // Secret - Determines whether the value is a secret and should be encrypted or not. Default value is false. 8044 Secret *bool `json:"secret,omitempty"` 8045} 8046 8047// PropertyUpdateParameterProperties property Contract properties. 8048type PropertyUpdateParameterProperties struct { 8049 // DisplayName - Unique name of Property. It may contain only letters, digits, period, dash, and underscore characters. 8050 DisplayName *string `json:"displayName,omitempty"` 8051 // Value - Value of the property. Can contain policy expressions. It may not be empty or consist only of whitespace. 8052 Value *string `json:"value,omitempty"` 8053 // Tags - Optional tags that when provided can be used to filter the property list. 8054 Tags *[]string `json:"tags,omitempty"` 8055 // Secret - Determines whether the value is a secret and should be encrypted or not. Default value is false. 8056 Secret *bool `json:"secret,omitempty"` 8057} 8058 8059// PropertyUpdateParameters property update Parameters. 8060type PropertyUpdateParameters struct { 8061 // PropertyUpdateParameterProperties - Property entity Update contract properties. 8062 *PropertyUpdateParameterProperties `json:"properties,omitempty"` 8063} 8064 8065// MarshalJSON is the custom marshaler for PropertyUpdateParameters. 8066func (pup PropertyUpdateParameters) MarshalJSON() ([]byte, error) { 8067 objectMap := make(map[string]interface{}) 8068 if pup.PropertyUpdateParameterProperties != nil { 8069 objectMap["properties"] = pup.PropertyUpdateParameterProperties 8070 } 8071 return json.Marshal(objectMap) 8072} 8073 8074// UnmarshalJSON is the custom unmarshaler for PropertyUpdateParameters struct. 8075func (pup *PropertyUpdateParameters) UnmarshalJSON(body []byte) error { 8076 var m map[string]*json.RawMessage 8077 err := json.Unmarshal(body, &m) 8078 if err != nil { 8079 return err 8080 } 8081 for k, v := range m { 8082 switch k { 8083 case "properties": 8084 if v != nil { 8085 var propertyUpdateParameterProperties PropertyUpdateParameterProperties 8086 err = json.Unmarshal(*v, &propertyUpdateParameterProperties) 8087 if err != nil { 8088 return err 8089 } 8090 pup.PropertyUpdateParameterProperties = &propertyUpdateParameterProperties 8091 } 8092 } 8093 } 8094 8095 return nil 8096} 8097 8098// QuotaCounterCollection paged Quota Counter list representation. 8099type QuotaCounterCollection struct { 8100 autorest.Response `json:"-"` 8101 // Value - Quota counter values. 8102 Value *[]QuotaCounterContract `json:"value,omitempty"` 8103 // Count - Total record count number across all pages. 8104 Count *int64 `json:"count,omitempty"` 8105 // NextLink - Next page link if any. 8106 NextLink *string `json:"nextLink,omitempty"` 8107} 8108 8109// QuotaCounterContract quota counter details. 8110type QuotaCounterContract struct { 8111 autorest.Response `json:"-"` 8112 // CounterKey - The Key value of the Counter. Must not be empty. 8113 CounterKey *string `json:"counterKey,omitempty"` 8114 // PeriodKey - Identifier of the Period for which the counter was collected. Must not be empty. 8115 PeriodKey *string `json:"periodKey,omitempty"` 8116 // 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. 8117 PeriodStartTime *date.Time `json:"periodStartTime,omitempty"` 8118 // 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. 8119 PeriodEndTime *date.Time `json:"periodEndTime,omitempty"` 8120 // Value - Quota Value Properties 8121 Value *QuotaCounterValueContractProperties `json:"value,omitempty"` 8122} 8123 8124// QuotaCounterValueContract quota counter value details. 8125type QuotaCounterValueContract struct { 8126 // QuotaCounterValueContractProperties - Quota counter Value Properties. 8127 *QuotaCounterValueContractProperties `json:"value,omitempty"` 8128} 8129 8130// MarshalJSON is the custom marshaler for QuotaCounterValueContract. 8131func (qcvc QuotaCounterValueContract) MarshalJSON() ([]byte, error) { 8132 objectMap := make(map[string]interface{}) 8133 if qcvc.QuotaCounterValueContractProperties != nil { 8134 objectMap["value"] = qcvc.QuotaCounterValueContractProperties 8135 } 8136 return json.Marshal(objectMap) 8137} 8138 8139// UnmarshalJSON is the custom unmarshaler for QuotaCounterValueContract struct. 8140func (qcvc *QuotaCounterValueContract) UnmarshalJSON(body []byte) error { 8141 var m map[string]*json.RawMessage 8142 err := json.Unmarshal(body, &m) 8143 if err != nil { 8144 return err 8145 } 8146 for k, v := range m { 8147 switch k { 8148 case "value": 8149 if v != nil { 8150 var quotaCounterValueContractProperties QuotaCounterValueContractProperties 8151 err = json.Unmarshal(*v, "aCounterValueContractProperties) 8152 if err != nil { 8153 return err 8154 } 8155 qcvc.QuotaCounterValueContractProperties = "aCounterValueContractProperties 8156 } 8157 } 8158 } 8159 8160 return nil 8161} 8162 8163// QuotaCounterValueContractProperties quota counter value details. 8164type QuotaCounterValueContractProperties struct { 8165 // CallsCount - Number of times Counter was called. 8166 CallsCount *int32 `json:"callsCount,omitempty"` 8167 // KbTransferred - Data Transferred in KiloBytes. 8168 KbTransferred *float64 `json:"kbTransferred,omitempty"` 8169} 8170 8171// RecipientEmailCollection paged Recipient User list representation. 8172type RecipientEmailCollection struct { 8173 autorest.Response `json:"-"` 8174 // Value - Page values. 8175 Value *[]RecipientEmailContract `json:"value,omitempty"` 8176 // NextLink - Next page link if any. 8177 NextLink *string `json:"nextLink,omitempty"` 8178} 8179 8180// RecipientEmailContract recipient Email details. 8181type RecipientEmailContract struct { 8182 autorest.Response `json:"-"` 8183 // RecipientEmailContractProperties - Recipient Email contract properties. 8184 *RecipientEmailContractProperties `json:"properties,omitempty"` 8185 // ID - READ-ONLY; Resource ID. 8186 ID *string `json:"id,omitempty"` 8187 // Name - READ-ONLY; Resource name. 8188 Name *string `json:"name,omitempty"` 8189 // Type - READ-ONLY; Resource type for API Management resource. 8190 Type *string `json:"type,omitempty"` 8191} 8192 8193// MarshalJSON is the custom marshaler for RecipientEmailContract. 8194func (rec RecipientEmailContract) MarshalJSON() ([]byte, error) { 8195 objectMap := make(map[string]interface{}) 8196 if rec.RecipientEmailContractProperties != nil { 8197 objectMap["properties"] = rec.RecipientEmailContractProperties 8198 } 8199 return json.Marshal(objectMap) 8200} 8201 8202// UnmarshalJSON is the custom unmarshaler for RecipientEmailContract struct. 8203func (rec *RecipientEmailContract) UnmarshalJSON(body []byte) error { 8204 var m map[string]*json.RawMessage 8205 err := json.Unmarshal(body, &m) 8206 if err != nil { 8207 return err 8208 } 8209 for k, v := range m { 8210 switch k { 8211 case "properties": 8212 if v != nil { 8213 var recipientEmailContractProperties RecipientEmailContractProperties 8214 err = json.Unmarshal(*v, &recipientEmailContractProperties) 8215 if err != nil { 8216 return err 8217 } 8218 rec.RecipientEmailContractProperties = &recipientEmailContractProperties 8219 } 8220 case "id": 8221 if v != nil { 8222 var ID string 8223 err = json.Unmarshal(*v, &ID) 8224 if err != nil { 8225 return err 8226 } 8227 rec.ID = &ID 8228 } 8229 case "name": 8230 if v != nil { 8231 var name string 8232 err = json.Unmarshal(*v, &name) 8233 if err != nil { 8234 return err 8235 } 8236 rec.Name = &name 8237 } 8238 case "type": 8239 if v != nil { 8240 var typeVar string 8241 err = json.Unmarshal(*v, &typeVar) 8242 if err != nil { 8243 return err 8244 } 8245 rec.Type = &typeVar 8246 } 8247 } 8248 } 8249 8250 return nil 8251} 8252 8253// RecipientEmailContractProperties recipient Email Contract Properties. 8254type RecipientEmailContractProperties struct { 8255 // Email - User Email subscribed to notification. 8256 Email *string `json:"email,omitempty"` 8257} 8258 8259// RecipientsContractProperties notification Parameter contract. 8260type RecipientsContractProperties struct { 8261 // Emails - List of Emails subscribed for the notification. 8262 Emails *[]string `json:"emails,omitempty"` 8263 // Users - List of Users subscribed for the notification. 8264 Users *[]string `json:"users,omitempty"` 8265} 8266 8267// RecipientUserCollection paged Recipient User list representation. 8268type RecipientUserCollection struct { 8269 autorest.Response `json:"-"` 8270 // Value - Page values. 8271 Value *[]RecipientUserContract `json:"value,omitempty"` 8272 // NextLink - Next page link if any. 8273 NextLink *string `json:"nextLink,omitempty"` 8274} 8275 8276// RecipientUserContract recipient User details. 8277type RecipientUserContract struct { 8278 autorest.Response `json:"-"` 8279 // RecipientUsersContractProperties - Recipient User entity contract properties. 8280 *RecipientUsersContractProperties `json:"properties,omitempty"` 8281 // ID - READ-ONLY; Resource ID. 8282 ID *string `json:"id,omitempty"` 8283 // Name - READ-ONLY; Resource name. 8284 Name *string `json:"name,omitempty"` 8285 // Type - READ-ONLY; Resource type for API Management resource. 8286 Type *string `json:"type,omitempty"` 8287} 8288 8289// MarshalJSON is the custom marshaler for RecipientUserContract. 8290func (ruc RecipientUserContract) MarshalJSON() ([]byte, error) { 8291 objectMap := make(map[string]interface{}) 8292 if ruc.RecipientUsersContractProperties != nil { 8293 objectMap["properties"] = ruc.RecipientUsersContractProperties 8294 } 8295 return json.Marshal(objectMap) 8296} 8297 8298// UnmarshalJSON is the custom unmarshaler for RecipientUserContract struct. 8299func (ruc *RecipientUserContract) UnmarshalJSON(body []byte) error { 8300 var m map[string]*json.RawMessage 8301 err := json.Unmarshal(body, &m) 8302 if err != nil { 8303 return err 8304 } 8305 for k, v := range m { 8306 switch k { 8307 case "properties": 8308 if v != nil { 8309 var recipientUsersContractProperties RecipientUsersContractProperties 8310 err = json.Unmarshal(*v, &recipientUsersContractProperties) 8311 if err != nil { 8312 return err 8313 } 8314 ruc.RecipientUsersContractProperties = &recipientUsersContractProperties 8315 } 8316 case "id": 8317 if v != nil { 8318 var ID string 8319 err = json.Unmarshal(*v, &ID) 8320 if err != nil { 8321 return err 8322 } 8323 ruc.ID = &ID 8324 } 8325 case "name": 8326 if v != nil { 8327 var name string 8328 err = json.Unmarshal(*v, &name) 8329 if err != nil { 8330 return err 8331 } 8332 ruc.Name = &name 8333 } 8334 case "type": 8335 if v != nil { 8336 var typeVar string 8337 err = json.Unmarshal(*v, &typeVar) 8338 if err != nil { 8339 return err 8340 } 8341 ruc.Type = &typeVar 8342 } 8343 } 8344 } 8345 8346 return nil 8347} 8348 8349// RecipientUsersContractProperties recipient User Contract Properties. 8350type RecipientUsersContractProperties struct { 8351 // UserID - API Management UserId subscribed to notification. 8352 UserID *string `json:"userId,omitempty"` 8353} 8354 8355// RegionContract region profile. 8356type RegionContract struct { 8357 // Name - READ-ONLY; Region name. 8358 Name *string `json:"name,omitempty"` 8359 // IsMasterRegion - whether Region is the master region. 8360 IsMasterRegion *bool `json:"isMasterRegion,omitempty"` 8361 // IsDeleted - whether Region is deleted. 8362 IsDeleted *bool `json:"isDeleted,omitempty"` 8363} 8364 8365// RegionListResult lists Regions operation response details. 8366type RegionListResult struct { 8367 autorest.Response `json:"-"` 8368 // Value - Lists of Regions. 8369 Value *[]RegionContract `json:"value,omitempty"` 8370 // Count - Total record count number across all pages. 8371 Count *int64 `json:"count,omitempty"` 8372 // NextLink - Next page link if any. 8373 NextLink *string `json:"nextLink,omitempty"` 8374} 8375 8376// RegionListResultIterator provides access to a complete listing of RegionContract values. 8377type RegionListResultIterator struct { 8378 i int 8379 page RegionListResultPage 8380} 8381 8382// NextWithContext advances to the next value. If there was an error making 8383// the request the iterator does not advance and the error is returned. 8384func (iter *RegionListResultIterator) NextWithContext(ctx context.Context) (err error) { 8385 if tracing.IsEnabled() { 8386 ctx = tracing.StartSpan(ctx, fqdn+"/RegionListResultIterator.NextWithContext") 8387 defer func() { 8388 sc := -1 8389 if iter.Response().Response.Response != nil { 8390 sc = iter.Response().Response.Response.StatusCode 8391 } 8392 tracing.EndSpan(ctx, sc, err) 8393 }() 8394 } 8395 iter.i++ 8396 if iter.i < len(iter.page.Values()) { 8397 return nil 8398 } 8399 err = iter.page.NextWithContext(ctx) 8400 if err != nil { 8401 iter.i-- 8402 return err 8403 } 8404 iter.i = 0 8405 return nil 8406} 8407 8408// Next advances to the next value. If there was an error making 8409// the request the iterator does not advance and the error is returned. 8410// Deprecated: Use NextWithContext() instead. 8411func (iter *RegionListResultIterator) Next() error { 8412 return iter.NextWithContext(context.Background()) 8413} 8414 8415// NotDone returns true if the enumeration should be started or is not yet complete. 8416func (iter RegionListResultIterator) NotDone() bool { 8417 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 8418} 8419 8420// Response returns the raw server response from the last page request. 8421func (iter RegionListResultIterator) Response() RegionListResult { 8422 return iter.page.Response() 8423} 8424 8425// Value returns the current value or a zero-initialized value if the 8426// iterator has advanced beyond the end of the collection. 8427func (iter RegionListResultIterator) Value() RegionContract { 8428 if !iter.page.NotDone() { 8429 return RegionContract{} 8430 } 8431 return iter.page.Values()[iter.i] 8432} 8433 8434// Creates a new instance of the RegionListResultIterator type. 8435func NewRegionListResultIterator(page RegionListResultPage) RegionListResultIterator { 8436 return RegionListResultIterator{page: page} 8437} 8438 8439// IsEmpty returns true if the ListResult contains no values. 8440func (rlr RegionListResult) IsEmpty() bool { 8441 return rlr.Value == nil || len(*rlr.Value) == 0 8442} 8443 8444// regionListResultPreparer prepares a request to retrieve the next set of results. 8445// It returns nil if no more results exist. 8446func (rlr RegionListResult) regionListResultPreparer(ctx context.Context) (*http.Request, error) { 8447 if rlr.NextLink == nil || len(to.String(rlr.NextLink)) < 1 { 8448 return nil, nil 8449 } 8450 return autorest.Prepare((&http.Request{}).WithContext(ctx), 8451 autorest.AsJSON(), 8452 autorest.AsGet(), 8453 autorest.WithBaseURL(to.String(rlr.NextLink))) 8454} 8455 8456// RegionListResultPage contains a page of RegionContract values. 8457type RegionListResultPage struct { 8458 fn func(context.Context, RegionListResult) (RegionListResult, error) 8459 rlr RegionListResult 8460} 8461 8462// NextWithContext advances to the next page of values. If there was an error making 8463// the request the page does not advance and the error is returned. 8464func (page *RegionListResultPage) NextWithContext(ctx context.Context) (err error) { 8465 if tracing.IsEnabled() { 8466 ctx = tracing.StartSpan(ctx, fqdn+"/RegionListResultPage.NextWithContext") 8467 defer func() { 8468 sc := -1 8469 if page.Response().Response.Response != nil { 8470 sc = page.Response().Response.Response.StatusCode 8471 } 8472 tracing.EndSpan(ctx, sc, err) 8473 }() 8474 } 8475 next, err := page.fn(ctx, page.rlr) 8476 if err != nil { 8477 return err 8478 } 8479 page.rlr = next 8480 return nil 8481} 8482 8483// Next advances to the next page of values. If there was an error making 8484// the request the page does not advance and the error is returned. 8485// Deprecated: Use NextWithContext() instead. 8486func (page *RegionListResultPage) Next() error { 8487 return page.NextWithContext(context.Background()) 8488} 8489 8490// NotDone returns true if the page enumeration should be started or is not yet complete. 8491func (page RegionListResultPage) NotDone() bool { 8492 return !page.rlr.IsEmpty() 8493} 8494 8495// Response returns the raw server response from the last page request. 8496func (page RegionListResultPage) Response() RegionListResult { 8497 return page.rlr 8498} 8499 8500// Values returns the slice of values for the current page or nil if there are no values. 8501func (page RegionListResultPage) Values() []RegionContract { 8502 if page.rlr.IsEmpty() { 8503 return nil 8504 } 8505 return *page.rlr.Value 8506} 8507 8508// Creates a new instance of the RegionListResultPage type. 8509func NewRegionListResultPage(getNextPage func(context.Context, RegionListResult) (RegionListResult, error)) RegionListResultPage { 8510 return RegionListResultPage{fn: getNextPage} 8511} 8512 8513// RegistrationDelegationSettingsProperties user registration delegation settings properties. 8514type RegistrationDelegationSettingsProperties struct { 8515 // Enabled - Enable or disable delegation for user registration. 8516 Enabled *bool `json:"enabled,omitempty"` 8517} 8518 8519// ReportCollection paged Report records list representation. 8520type ReportCollection struct { 8521 autorest.Response `json:"-"` 8522 // Value - Page values. 8523 Value *[]ReportRecordContract `json:"value,omitempty"` 8524 // Count - Total record count number across all pages. 8525 Count *int64 `json:"count,omitempty"` 8526 // NextLink - Next page link if any. 8527 NextLink *string `json:"nextLink,omitempty"` 8528} 8529 8530// ReportCollectionIterator provides access to a complete listing of ReportRecordContract values. 8531type ReportCollectionIterator struct { 8532 i int 8533 page ReportCollectionPage 8534} 8535 8536// NextWithContext advances to the next value. If there was an error making 8537// the request the iterator does not advance and the error is returned. 8538func (iter *ReportCollectionIterator) NextWithContext(ctx context.Context) (err error) { 8539 if tracing.IsEnabled() { 8540 ctx = tracing.StartSpan(ctx, fqdn+"/ReportCollectionIterator.NextWithContext") 8541 defer func() { 8542 sc := -1 8543 if iter.Response().Response.Response != nil { 8544 sc = iter.Response().Response.Response.StatusCode 8545 } 8546 tracing.EndSpan(ctx, sc, err) 8547 }() 8548 } 8549 iter.i++ 8550 if iter.i < len(iter.page.Values()) { 8551 return nil 8552 } 8553 err = iter.page.NextWithContext(ctx) 8554 if err != nil { 8555 iter.i-- 8556 return err 8557 } 8558 iter.i = 0 8559 return nil 8560} 8561 8562// Next advances to the next value. If there was an error making 8563// the request the iterator does not advance and the error is returned. 8564// Deprecated: Use NextWithContext() instead. 8565func (iter *ReportCollectionIterator) Next() error { 8566 return iter.NextWithContext(context.Background()) 8567} 8568 8569// NotDone returns true if the enumeration should be started or is not yet complete. 8570func (iter ReportCollectionIterator) NotDone() bool { 8571 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 8572} 8573 8574// Response returns the raw server response from the last page request. 8575func (iter ReportCollectionIterator) Response() ReportCollection { 8576 return iter.page.Response() 8577} 8578 8579// Value returns the current value or a zero-initialized value if the 8580// iterator has advanced beyond the end of the collection. 8581func (iter ReportCollectionIterator) Value() ReportRecordContract { 8582 if !iter.page.NotDone() { 8583 return ReportRecordContract{} 8584 } 8585 return iter.page.Values()[iter.i] 8586} 8587 8588// Creates a new instance of the ReportCollectionIterator type. 8589func NewReportCollectionIterator(page ReportCollectionPage) ReportCollectionIterator { 8590 return ReportCollectionIterator{page: page} 8591} 8592 8593// IsEmpty returns true if the ListResult contains no values. 8594func (rc ReportCollection) IsEmpty() bool { 8595 return rc.Value == nil || len(*rc.Value) == 0 8596} 8597 8598// reportCollectionPreparer prepares a request to retrieve the next set of results. 8599// It returns nil if no more results exist. 8600func (rc ReportCollection) reportCollectionPreparer(ctx context.Context) (*http.Request, error) { 8601 if rc.NextLink == nil || len(to.String(rc.NextLink)) < 1 { 8602 return nil, nil 8603 } 8604 return autorest.Prepare((&http.Request{}).WithContext(ctx), 8605 autorest.AsJSON(), 8606 autorest.AsGet(), 8607 autorest.WithBaseURL(to.String(rc.NextLink))) 8608} 8609 8610// ReportCollectionPage contains a page of ReportRecordContract values. 8611type ReportCollectionPage struct { 8612 fn func(context.Context, ReportCollection) (ReportCollection, error) 8613 rc ReportCollection 8614} 8615 8616// NextWithContext advances to the next page of values. If there was an error making 8617// the request the page does not advance and the error is returned. 8618func (page *ReportCollectionPage) NextWithContext(ctx context.Context) (err error) { 8619 if tracing.IsEnabled() { 8620 ctx = tracing.StartSpan(ctx, fqdn+"/ReportCollectionPage.NextWithContext") 8621 defer func() { 8622 sc := -1 8623 if page.Response().Response.Response != nil { 8624 sc = page.Response().Response.Response.StatusCode 8625 } 8626 tracing.EndSpan(ctx, sc, err) 8627 }() 8628 } 8629 next, err := page.fn(ctx, page.rc) 8630 if err != nil { 8631 return err 8632 } 8633 page.rc = next 8634 return nil 8635} 8636 8637// Next advances to the next page of values. If there was an error making 8638// the request the page does not advance and the error is returned. 8639// Deprecated: Use NextWithContext() instead. 8640func (page *ReportCollectionPage) Next() error { 8641 return page.NextWithContext(context.Background()) 8642} 8643 8644// NotDone returns true if the page enumeration should be started or is not yet complete. 8645func (page ReportCollectionPage) NotDone() bool { 8646 return !page.rc.IsEmpty() 8647} 8648 8649// Response returns the raw server response from the last page request. 8650func (page ReportCollectionPage) Response() ReportCollection { 8651 return page.rc 8652} 8653 8654// Values returns the slice of values for the current page or nil if there are no values. 8655func (page ReportCollectionPage) Values() []ReportRecordContract { 8656 if page.rc.IsEmpty() { 8657 return nil 8658 } 8659 return *page.rc.Value 8660} 8661 8662// Creates a new instance of the ReportCollectionPage type. 8663func NewReportCollectionPage(getNextPage func(context.Context, ReportCollection) (ReportCollection, error)) ReportCollectionPage { 8664 return ReportCollectionPage{fn: getNextPage} 8665} 8666 8667// ReportRecordContract report data. 8668type ReportRecordContract struct { 8669 // Name - Name depending on report endpoint specifies product, API, operation or developer name. 8670 Name *string `json:"name,omitempty"` 8671 // Timestamp - Start of aggregation period. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. 8672 Timestamp *date.Time `json:"timestamp,omitempty"` 8673 // 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). 8674 Interval *string `json:"interval,omitempty"` 8675 // Country - Country to which this record data is related. 8676 Country *string `json:"country,omitempty"` 8677 // Region - Country region to which this record data is related. 8678 Region *string `json:"region,omitempty"` 8679 // Zip - Zip code to which this record data is related. 8680 Zip *string `json:"zip,omitempty"` 8681 // UserID - READ-ONLY; User identifier path. /users/{userId} 8682 UserID *string `json:"userId,omitempty"` 8683 // ProductID - READ-ONLY; Product identifier path. /products/{productId} 8684 ProductID *string `json:"productId,omitempty"` 8685 // APIID - API identifier path. /apis/{apiId} 8686 APIID *string `json:"apiId,omitempty"` 8687 // OperationID - Operation identifier path. /apis/{apiId}/operations/{operationId} 8688 OperationID *string `json:"operationId,omitempty"` 8689 // APIRegion - API region identifier. 8690 APIRegion *string `json:"apiRegion,omitempty"` 8691 // SubscriptionID - Subscription identifier path. /subscriptions/{subscriptionId} 8692 SubscriptionID *string `json:"subscriptionId,omitempty"` 8693 // CallCountSuccess - Number of successful calls. This includes calls returning HttpStatusCode <= 301 and HttpStatusCode.NotModified and HttpStatusCode.TemporaryRedirect 8694 CallCountSuccess *int32 `json:"callCountSuccess,omitempty"` 8695 // CallCountBlocked - Number of calls blocked due to invalid credentials. This includes calls returning HttpStatusCode.Unauthorized and HttpStatusCode.Forbidden and HttpStatusCode.TooManyRequests 8696 CallCountBlocked *int32 `json:"callCountBlocked,omitempty"` 8697 // 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 8698 CallCountFailed *int32 `json:"callCountFailed,omitempty"` 8699 // CallCountOther - Number of other calls. 8700 CallCountOther *int32 `json:"callCountOther,omitempty"` 8701 // CallCountTotal - Total number of calls. 8702 CallCountTotal *int32 `json:"callCountTotal,omitempty"` 8703 // Bandwidth - Bandwidth consumed. 8704 Bandwidth *int64 `json:"bandwidth,omitempty"` 8705 // CacheHitCount - Number of times when content was served from cache policy. 8706 CacheHitCount *int32 `json:"cacheHitCount,omitempty"` 8707 // CacheMissCount - Number of times content was fetched from backend. 8708 CacheMissCount *int32 `json:"cacheMissCount,omitempty"` 8709 // APITimeAvg - Average time it took to process request. 8710 APITimeAvg *float64 `json:"apiTimeAvg,omitempty"` 8711 // APITimeMin - Minimum time it took to process request. 8712 APITimeMin *float64 `json:"apiTimeMin,omitempty"` 8713 // APITimeMax - Maximum time it took to process request. 8714 APITimeMax *float64 `json:"apiTimeMax,omitempty"` 8715 // ServiceTimeAvg - Average time it took to process request on backend. 8716 ServiceTimeAvg *float64 `json:"serviceTimeAvg,omitempty"` 8717 // ServiceTimeMin - Minimum time it took to process request on backend. 8718 ServiceTimeMin *float64 `json:"serviceTimeMin,omitempty"` 8719 // ServiceTimeMax - Maximum time it took to process request on backend. 8720 ServiceTimeMax *float64 `json:"serviceTimeMax,omitempty"` 8721} 8722 8723// RepresentationContract operation request/response representation details. 8724type RepresentationContract struct { 8725 // ContentType - Specifies a registered or custom content type for this representation, e.g. application/xml. 8726 ContentType *string `json:"contentType,omitempty"` 8727 // Sample - An example of the representation. 8728 Sample *string `json:"sample,omitempty"` 8729 // SchemaID - Schema identifier. Applicable only if 'contentType' value is neither 'application/x-www-form-urlencoded' nor 'multipart/form-data'. 8730 SchemaID *string `json:"schemaId,omitempty"` 8731 // TypeName - Type name defined by the schema. Applicable only if 'contentType' value is neither 'application/x-www-form-urlencoded' nor 'multipart/form-data'. 8732 TypeName *string `json:"typeName,omitempty"` 8733 // FormParameters - Collection of form parameters. Required if 'contentType' value is either 'application/x-www-form-urlencoded' or 'multipart/form-data'.. 8734 FormParameters *[]ParameterContract `json:"formParameters,omitempty"` 8735} 8736 8737// RequestContract operation request details. 8738type RequestContract struct { 8739 // Description - Operation request description. 8740 Description *string `json:"description,omitempty"` 8741 // QueryParameters - Collection of operation request query parameters. 8742 QueryParameters *[]ParameterContract `json:"queryParameters,omitempty"` 8743 // Headers - Collection of operation request headers. 8744 Headers *[]ParameterContract `json:"headers,omitempty"` 8745 // Representations - Collection of operation request representations. 8746 Representations *[]RepresentationContract `json:"representations,omitempty"` 8747} 8748 8749// RequestReportCollection paged Report records list representation. 8750type RequestReportCollection struct { 8751 autorest.Response `json:"-"` 8752 // Value - Page values. 8753 Value *[]RequestReportRecordContract `json:"value,omitempty"` 8754 // Count - Total record count number across all pages. 8755 Count *int64 `json:"count,omitempty"` 8756} 8757 8758// RequestReportRecordContract request Report data. 8759type RequestReportRecordContract struct { 8760 // APIID - API identifier path. /apis/{apiId} 8761 APIID *string `json:"apiId,omitempty"` 8762 // OperationID - Operation identifier path. /apis/{apiId}/operations/{operationId} 8763 OperationID *string `json:"operationId,omitempty"` 8764 // ProductID - READ-ONLY; Product identifier path. /products/{productId} 8765 ProductID *string `json:"productId,omitempty"` 8766 // UserID - READ-ONLY; User identifier path. /users/{userId} 8767 UserID *string `json:"userId,omitempty"` 8768 // Method - The HTTP method associated with this request.. 8769 Method *string `json:"method,omitempty"` 8770 // URL - The full URL associated with this request. 8771 URL *string `json:"url,omitempty"` 8772 // IPAddress - The client IP address associated with this request. 8773 IPAddress *string `json:"ipAddress,omitempty"` 8774 // BackendResponseCode - The HTTP status code received by the gateway as a result of forwarding this request to the backend. 8775 BackendResponseCode *string `json:"backendResponseCode,omitempty"` 8776 // ResponseCode - The HTTP status code returned by the gateway. 8777 ResponseCode *int32 `json:"responseCode,omitempty"` 8778 // ResponseSize - The size of the response returned by the gateway. 8779 ResponseSize *int32 `json:"responseSize,omitempty"` 8780 // Timestamp - The date and time when this request was received by the gateway in ISO 8601 format. 8781 Timestamp *date.Time `json:"timestamp,omitempty"` 8782 // 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. 8783 Cache *string `json:"cache,omitempty"` 8784 // APITime - The total time it took to process this request. 8785 APITime *float64 `json:"apiTime,omitempty"` 8786 // ServiceTime - he time it took to forward this request to the backend and get the response back. 8787 ServiceTime *float64 `json:"serviceTime,omitempty"` 8788 // APIRegion - Azure region where the gateway that processed this request is located. 8789 APIRegion *string `json:"apiRegion,omitempty"` 8790 // SubscriptionID - Subscription identifier path. /subscriptions/{subscriptionId} 8791 SubscriptionID *string `json:"subscriptionId,omitempty"` 8792 // RequestID - Request Identifier. 8793 RequestID *string `json:"requestId,omitempty"` 8794 // RequestSize - The size of this request.. 8795 RequestSize *int32 `json:"requestSize,omitempty"` 8796} 8797 8798// Resource the Resource definition. 8799type Resource struct { 8800 // ID - READ-ONLY; Resource ID. 8801 ID *string `json:"id,omitempty"` 8802 // Name - READ-ONLY; Resource name. 8803 Name *string `json:"name,omitempty"` 8804 // Type - READ-ONLY; Resource type for API Management resource. 8805 Type *string `json:"type,omitempty"` 8806} 8807 8808// ResourceSku describes an available API Management SKU. 8809type ResourceSku struct { 8810 // Name - Name of the Sku. Possible values include: 'SkuTypeDeveloper', 'SkuTypeStandard', 'SkuTypePremium', 'SkuTypeBasic', 'SkuTypeConsumption' 8811 Name SkuType `json:"name,omitempty"` 8812} 8813 8814// ResourceSkuCapacity describes scaling information of a SKU. 8815type ResourceSkuCapacity struct { 8816 // Minimum - READ-ONLY; The minimum capacity. 8817 Minimum *int32 `json:"minimum,omitempty"` 8818 // Maximum - READ-ONLY; The maximum capacity that can be set. 8819 Maximum *int32 `json:"maximum,omitempty"` 8820 // Default - READ-ONLY; The default capacity. 8821 Default *int32 `json:"default,omitempty"` 8822 // ScaleType - READ-ONLY; The scale type applicable to the sku. Possible values include: 'Automatic', 'Manual', 'None' 8823 ScaleType ResourceSkuCapacityScaleType `json:"scaleType,omitempty"` 8824} 8825 8826// ResourceSkuResult describes an available API Management service SKU. 8827type ResourceSkuResult struct { 8828 // ResourceType - READ-ONLY; The type of resource the SKU applies to. 8829 ResourceType *string `json:"resourceType,omitempty"` 8830 // Sku - READ-ONLY; Specifies API Management SKU. 8831 Sku *ResourceSku `json:"sku,omitempty"` 8832 // Capacity - READ-ONLY; Specifies the number of API Management units. 8833 Capacity *ResourceSkuCapacity `json:"capacity,omitempty"` 8834} 8835 8836// ResourceSkuResults the API Management service SKUs operation response. 8837type ResourceSkuResults struct { 8838 autorest.Response `json:"-"` 8839 // Value - The list of skus available for the service. 8840 Value *[]ResourceSkuResult `json:"value,omitempty"` 8841 // NextLink - The uri to fetch the next page of API Management service Skus. 8842 NextLink *string `json:"nextLink,omitempty"` 8843} 8844 8845// ResourceSkuResultsIterator provides access to a complete listing of ResourceSkuResult values. 8846type ResourceSkuResultsIterator struct { 8847 i int 8848 page ResourceSkuResultsPage 8849} 8850 8851// NextWithContext advances to the next value. If there was an error making 8852// the request the iterator does not advance and the error is returned. 8853func (iter *ResourceSkuResultsIterator) NextWithContext(ctx context.Context) (err error) { 8854 if tracing.IsEnabled() { 8855 ctx = tracing.StartSpan(ctx, fqdn+"/ResourceSkuResultsIterator.NextWithContext") 8856 defer func() { 8857 sc := -1 8858 if iter.Response().Response.Response != nil { 8859 sc = iter.Response().Response.Response.StatusCode 8860 } 8861 tracing.EndSpan(ctx, sc, err) 8862 }() 8863 } 8864 iter.i++ 8865 if iter.i < len(iter.page.Values()) { 8866 return nil 8867 } 8868 err = iter.page.NextWithContext(ctx) 8869 if err != nil { 8870 iter.i-- 8871 return err 8872 } 8873 iter.i = 0 8874 return nil 8875} 8876 8877// Next advances to the next value. If there was an error making 8878// the request the iterator does not advance and the error is returned. 8879// Deprecated: Use NextWithContext() instead. 8880func (iter *ResourceSkuResultsIterator) Next() error { 8881 return iter.NextWithContext(context.Background()) 8882} 8883 8884// NotDone returns true if the enumeration should be started or is not yet complete. 8885func (iter ResourceSkuResultsIterator) NotDone() bool { 8886 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 8887} 8888 8889// Response returns the raw server response from the last page request. 8890func (iter ResourceSkuResultsIterator) Response() ResourceSkuResults { 8891 return iter.page.Response() 8892} 8893 8894// Value returns the current value or a zero-initialized value if the 8895// iterator has advanced beyond the end of the collection. 8896func (iter ResourceSkuResultsIterator) Value() ResourceSkuResult { 8897 if !iter.page.NotDone() { 8898 return ResourceSkuResult{} 8899 } 8900 return iter.page.Values()[iter.i] 8901} 8902 8903// Creates a new instance of the ResourceSkuResultsIterator type. 8904func NewResourceSkuResultsIterator(page ResourceSkuResultsPage) ResourceSkuResultsIterator { 8905 return ResourceSkuResultsIterator{page: page} 8906} 8907 8908// IsEmpty returns true if the ListResult contains no values. 8909func (rsr ResourceSkuResults) IsEmpty() bool { 8910 return rsr.Value == nil || len(*rsr.Value) == 0 8911} 8912 8913// resourceSkuResultsPreparer prepares a request to retrieve the next set of results. 8914// It returns nil if no more results exist. 8915func (rsr ResourceSkuResults) resourceSkuResultsPreparer(ctx context.Context) (*http.Request, error) { 8916 if rsr.NextLink == nil || len(to.String(rsr.NextLink)) < 1 { 8917 return nil, nil 8918 } 8919 return autorest.Prepare((&http.Request{}).WithContext(ctx), 8920 autorest.AsJSON(), 8921 autorest.AsGet(), 8922 autorest.WithBaseURL(to.String(rsr.NextLink))) 8923} 8924 8925// ResourceSkuResultsPage contains a page of ResourceSkuResult values. 8926type ResourceSkuResultsPage struct { 8927 fn func(context.Context, ResourceSkuResults) (ResourceSkuResults, error) 8928 rsr ResourceSkuResults 8929} 8930 8931// NextWithContext advances to the next page of values. If there was an error making 8932// the request the page does not advance and the error is returned. 8933func (page *ResourceSkuResultsPage) NextWithContext(ctx context.Context) (err error) { 8934 if tracing.IsEnabled() { 8935 ctx = tracing.StartSpan(ctx, fqdn+"/ResourceSkuResultsPage.NextWithContext") 8936 defer func() { 8937 sc := -1 8938 if page.Response().Response.Response != nil { 8939 sc = page.Response().Response.Response.StatusCode 8940 } 8941 tracing.EndSpan(ctx, sc, err) 8942 }() 8943 } 8944 next, err := page.fn(ctx, page.rsr) 8945 if err != nil { 8946 return err 8947 } 8948 page.rsr = next 8949 return nil 8950} 8951 8952// Next advances to the next page of values. If there was an error making 8953// the request the page does not advance and the error is returned. 8954// Deprecated: Use NextWithContext() instead. 8955func (page *ResourceSkuResultsPage) Next() error { 8956 return page.NextWithContext(context.Background()) 8957} 8958 8959// NotDone returns true if the page enumeration should be started or is not yet complete. 8960func (page ResourceSkuResultsPage) NotDone() bool { 8961 return !page.rsr.IsEmpty() 8962} 8963 8964// Response returns the raw server response from the last page request. 8965func (page ResourceSkuResultsPage) Response() ResourceSkuResults { 8966 return page.rsr 8967} 8968 8969// Values returns the slice of values for the current page or nil if there are no values. 8970func (page ResourceSkuResultsPage) Values() []ResourceSkuResult { 8971 if page.rsr.IsEmpty() { 8972 return nil 8973 } 8974 return *page.rsr.Value 8975} 8976 8977// Creates a new instance of the ResourceSkuResultsPage type. 8978func NewResourceSkuResultsPage(getNextPage func(context.Context, ResourceSkuResults) (ResourceSkuResults, error)) ResourceSkuResultsPage { 8979 return ResourceSkuResultsPage{fn: getNextPage} 8980} 8981 8982// ResponseContract operation response details. 8983type ResponseContract struct { 8984 // StatusCode - Operation response HTTP status code. 8985 StatusCode *int32 `json:"statusCode,omitempty"` 8986 // Description - Operation response description. 8987 Description *string `json:"description,omitempty"` 8988 // Representations - Collection of operation response representations. 8989 Representations *[]RepresentationContract `json:"representations,omitempty"` 8990 // Headers - Collection of operation response headers. 8991 Headers *[]ParameterContract `json:"headers,omitempty"` 8992} 8993 8994// SamplingSettings sampling settings for Diagnostic. 8995type SamplingSettings struct { 8996 // SamplingType - Sampling type. Possible values include: 'Fixed' 8997 SamplingType SamplingType `json:"samplingType,omitempty"` 8998 // Percentage - Rate of sampling for fixed-rate sampling. 8999 Percentage *float64 `json:"percentage,omitempty"` 9000} 9001 9002// SaveConfigurationParameter save Tenant Configuration Contract details. 9003type SaveConfigurationParameter struct { 9004 // SaveConfigurationParameterProperties - Properties of the Save Configuration Parameters. 9005 *SaveConfigurationParameterProperties `json:"properties,omitempty"` 9006} 9007 9008// MarshalJSON is the custom marshaler for SaveConfigurationParameter. 9009func (scp SaveConfigurationParameter) MarshalJSON() ([]byte, error) { 9010 objectMap := make(map[string]interface{}) 9011 if scp.SaveConfigurationParameterProperties != nil { 9012 objectMap["properties"] = scp.SaveConfigurationParameterProperties 9013 } 9014 return json.Marshal(objectMap) 9015} 9016 9017// UnmarshalJSON is the custom unmarshaler for SaveConfigurationParameter struct. 9018func (scp *SaveConfigurationParameter) UnmarshalJSON(body []byte) error { 9019 var m map[string]*json.RawMessage 9020 err := json.Unmarshal(body, &m) 9021 if err != nil { 9022 return err 9023 } 9024 for k, v := range m { 9025 switch k { 9026 case "properties": 9027 if v != nil { 9028 var saveConfigurationParameterProperties SaveConfigurationParameterProperties 9029 err = json.Unmarshal(*v, &saveConfigurationParameterProperties) 9030 if err != nil { 9031 return err 9032 } 9033 scp.SaveConfigurationParameterProperties = &saveConfigurationParameterProperties 9034 } 9035 } 9036 } 9037 9038 return nil 9039} 9040 9041// SaveConfigurationParameterProperties parameters supplied to the Save Tenant Configuration operation. 9042type SaveConfigurationParameterProperties struct { 9043 // Branch - The name of the Git branch in which to commit the current configuration snapshot. 9044 Branch *string `json:"branch,omitempty"` 9045 // 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. 9046 Force *bool `json:"force,omitempty"` 9047} 9048 9049// SchemaCollection the response of the list schema operation. 9050type SchemaCollection struct { 9051 autorest.Response `json:"-"` 9052 // Value - READ-ONLY; Api Schema Contract value. 9053 Value *[]SchemaContract `json:"value,omitempty"` 9054 // NextLink - READ-ONLY; Next page link if any. 9055 NextLink *string `json:"nextLink,omitempty"` 9056} 9057 9058// SchemaCollectionIterator provides access to a complete listing of SchemaContract values. 9059type SchemaCollectionIterator struct { 9060 i int 9061 page SchemaCollectionPage 9062} 9063 9064// NextWithContext advances to the next value. If there was an error making 9065// the request the iterator does not advance and the error is returned. 9066func (iter *SchemaCollectionIterator) NextWithContext(ctx context.Context) (err error) { 9067 if tracing.IsEnabled() { 9068 ctx = tracing.StartSpan(ctx, fqdn+"/SchemaCollectionIterator.NextWithContext") 9069 defer func() { 9070 sc := -1 9071 if iter.Response().Response.Response != nil { 9072 sc = iter.Response().Response.Response.StatusCode 9073 } 9074 tracing.EndSpan(ctx, sc, err) 9075 }() 9076 } 9077 iter.i++ 9078 if iter.i < len(iter.page.Values()) { 9079 return nil 9080 } 9081 err = iter.page.NextWithContext(ctx) 9082 if err != nil { 9083 iter.i-- 9084 return err 9085 } 9086 iter.i = 0 9087 return nil 9088} 9089 9090// Next advances to the next value. If there was an error making 9091// the request the iterator does not advance and the error is returned. 9092// Deprecated: Use NextWithContext() instead. 9093func (iter *SchemaCollectionIterator) Next() error { 9094 return iter.NextWithContext(context.Background()) 9095} 9096 9097// NotDone returns true if the enumeration should be started or is not yet complete. 9098func (iter SchemaCollectionIterator) NotDone() bool { 9099 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 9100} 9101 9102// Response returns the raw server response from the last page request. 9103func (iter SchemaCollectionIterator) Response() SchemaCollection { 9104 return iter.page.Response() 9105} 9106 9107// Value returns the current value or a zero-initialized value if the 9108// iterator has advanced beyond the end of the collection. 9109func (iter SchemaCollectionIterator) Value() SchemaContract { 9110 if !iter.page.NotDone() { 9111 return SchemaContract{} 9112 } 9113 return iter.page.Values()[iter.i] 9114} 9115 9116// Creates a new instance of the SchemaCollectionIterator type. 9117func NewSchemaCollectionIterator(page SchemaCollectionPage) SchemaCollectionIterator { 9118 return SchemaCollectionIterator{page: page} 9119} 9120 9121// IsEmpty returns true if the ListResult contains no values. 9122func (sc SchemaCollection) IsEmpty() bool { 9123 return sc.Value == nil || len(*sc.Value) == 0 9124} 9125 9126// schemaCollectionPreparer prepares a request to retrieve the next set of results. 9127// It returns nil if no more results exist. 9128func (sc SchemaCollection) schemaCollectionPreparer(ctx context.Context) (*http.Request, error) { 9129 if sc.NextLink == nil || len(to.String(sc.NextLink)) < 1 { 9130 return nil, nil 9131 } 9132 return autorest.Prepare((&http.Request{}).WithContext(ctx), 9133 autorest.AsJSON(), 9134 autorest.AsGet(), 9135 autorest.WithBaseURL(to.String(sc.NextLink))) 9136} 9137 9138// SchemaCollectionPage contains a page of SchemaContract values. 9139type SchemaCollectionPage struct { 9140 fn func(context.Context, SchemaCollection) (SchemaCollection, error) 9141 sc SchemaCollection 9142} 9143 9144// NextWithContext advances to the next page of values. If there was an error making 9145// the request the page does not advance and the error is returned. 9146func (page *SchemaCollectionPage) NextWithContext(ctx context.Context) (err error) { 9147 if tracing.IsEnabled() { 9148 ctx = tracing.StartSpan(ctx, fqdn+"/SchemaCollectionPage.NextWithContext") 9149 defer func() { 9150 sc := -1 9151 if page.Response().Response.Response != nil { 9152 sc = page.Response().Response.Response.StatusCode 9153 } 9154 tracing.EndSpan(ctx, sc, err) 9155 }() 9156 } 9157 next, err := page.fn(ctx, page.sc) 9158 if err != nil { 9159 return err 9160 } 9161 page.sc = next 9162 return nil 9163} 9164 9165// Next advances to the next page of values. If there was an error making 9166// the request the page does not advance and the error is returned. 9167// Deprecated: Use NextWithContext() instead. 9168func (page *SchemaCollectionPage) Next() error { 9169 return page.NextWithContext(context.Background()) 9170} 9171 9172// NotDone returns true if the page enumeration should be started or is not yet complete. 9173func (page SchemaCollectionPage) NotDone() bool { 9174 return !page.sc.IsEmpty() 9175} 9176 9177// Response returns the raw server response from the last page request. 9178func (page SchemaCollectionPage) Response() SchemaCollection { 9179 return page.sc 9180} 9181 9182// Values returns the slice of values for the current page or nil if there are no values. 9183func (page SchemaCollectionPage) Values() []SchemaContract { 9184 if page.sc.IsEmpty() { 9185 return nil 9186 } 9187 return *page.sc.Value 9188} 9189 9190// Creates a new instance of the SchemaCollectionPage type. 9191func NewSchemaCollectionPage(getNextPage func(context.Context, SchemaCollection) (SchemaCollection, error)) SchemaCollectionPage { 9192 return SchemaCollectionPage{fn: getNextPage} 9193} 9194 9195// SchemaContract schema Contract details. 9196type SchemaContract struct { 9197 autorest.Response `json:"-"` 9198 // SchemaContractProperties - Properties of the Schema. 9199 *SchemaContractProperties `json:"properties,omitempty"` 9200 // ID - READ-ONLY; Resource ID. 9201 ID *string `json:"id,omitempty"` 9202 // Name - READ-ONLY; Resource name. 9203 Name *string `json:"name,omitempty"` 9204 // Type - READ-ONLY; Resource type for API Management resource. 9205 Type *string `json:"type,omitempty"` 9206} 9207 9208// MarshalJSON is the custom marshaler for SchemaContract. 9209func (sc SchemaContract) MarshalJSON() ([]byte, error) { 9210 objectMap := make(map[string]interface{}) 9211 if sc.SchemaContractProperties != nil { 9212 objectMap["properties"] = sc.SchemaContractProperties 9213 } 9214 return json.Marshal(objectMap) 9215} 9216 9217// UnmarshalJSON is the custom unmarshaler for SchemaContract struct. 9218func (sc *SchemaContract) UnmarshalJSON(body []byte) error { 9219 var m map[string]*json.RawMessage 9220 err := json.Unmarshal(body, &m) 9221 if err != nil { 9222 return err 9223 } 9224 for k, v := range m { 9225 switch k { 9226 case "properties": 9227 if v != nil { 9228 var schemaContractProperties SchemaContractProperties 9229 err = json.Unmarshal(*v, &schemaContractProperties) 9230 if err != nil { 9231 return err 9232 } 9233 sc.SchemaContractProperties = &schemaContractProperties 9234 } 9235 case "id": 9236 if v != nil { 9237 var ID string 9238 err = json.Unmarshal(*v, &ID) 9239 if err != nil { 9240 return err 9241 } 9242 sc.ID = &ID 9243 } 9244 case "name": 9245 if v != nil { 9246 var name string 9247 err = json.Unmarshal(*v, &name) 9248 if err != nil { 9249 return err 9250 } 9251 sc.Name = &name 9252 } 9253 case "type": 9254 if v != nil { 9255 var typeVar string 9256 err = json.Unmarshal(*v, &typeVar) 9257 if err != nil { 9258 return err 9259 } 9260 sc.Type = &typeVar 9261 } 9262 } 9263 } 9264 9265 return nil 9266} 9267 9268// SchemaContractProperties schema contract Properties. 9269type SchemaContractProperties struct { 9270 // 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). </br> - `Swagger` Schema use `application/vnd.ms-azure-apim.swagger.definitions+json` </br> - `WSDL` Schema use `application/vnd.ms-azure-apim.xsd+xml` </br> - `OpenApi` Schema use `application/vnd.oai.openapi.components+json` </br> - `WADL Schema` use `application/vnd.ms-azure-apim.wadl.grammars+xml`. 9271 ContentType *string `json:"contentType,omitempty"` 9272 // Document - Properties of the Schema Document. 9273 Document interface{} `json:"document,omitempty"` 9274} 9275 9276// SchemaCreateOrUpdateContract schema Contract details. 9277type SchemaCreateOrUpdateContract struct { 9278 // SchemaCreateOrUpdateProperties - Properties of the Schema. 9279 *SchemaCreateOrUpdateProperties `json:"properties,omitempty"` 9280 // ID - READ-ONLY; Resource ID. 9281 ID *string `json:"id,omitempty"` 9282 // Name - READ-ONLY; Resource name. 9283 Name *string `json:"name,omitempty"` 9284 // Type - READ-ONLY; Resource type for API Management resource. 9285 Type *string `json:"type,omitempty"` 9286} 9287 9288// MarshalJSON is the custom marshaler for SchemaCreateOrUpdateContract. 9289func (scouc SchemaCreateOrUpdateContract) MarshalJSON() ([]byte, error) { 9290 objectMap := make(map[string]interface{}) 9291 if scouc.SchemaCreateOrUpdateProperties != nil { 9292 objectMap["properties"] = scouc.SchemaCreateOrUpdateProperties 9293 } 9294 return json.Marshal(objectMap) 9295} 9296 9297// UnmarshalJSON is the custom unmarshaler for SchemaCreateOrUpdateContract struct. 9298func (scouc *SchemaCreateOrUpdateContract) UnmarshalJSON(body []byte) error { 9299 var m map[string]*json.RawMessage 9300 err := json.Unmarshal(body, &m) 9301 if err != nil { 9302 return err 9303 } 9304 for k, v := range m { 9305 switch k { 9306 case "properties": 9307 if v != nil { 9308 var schemaCreateOrUpdateProperties SchemaCreateOrUpdateProperties 9309 err = json.Unmarshal(*v, &schemaCreateOrUpdateProperties) 9310 if err != nil { 9311 return err 9312 } 9313 scouc.SchemaCreateOrUpdateProperties = &schemaCreateOrUpdateProperties 9314 } 9315 case "id": 9316 if v != nil { 9317 var ID string 9318 err = json.Unmarshal(*v, &ID) 9319 if err != nil { 9320 return err 9321 } 9322 scouc.ID = &ID 9323 } 9324 case "name": 9325 if v != nil { 9326 var name string 9327 err = json.Unmarshal(*v, &name) 9328 if err != nil { 9329 return err 9330 } 9331 scouc.Name = &name 9332 } 9333 case "type": 9334 if v != nil { 9335 var typeVar string 9336 err = json.Unmarshal(*v, &typeVar) 9337 if err != nil { 9338 return err 9339 } 9340 scouc.Type = &typeVar 9341 } 9342 } 9343 } 9344 9345 return nil 9346} 9347 9348// SchemaCreateOrUpdateProperties API Schema create or update contract Properties. 9349type SchemaCreateOrUpdateProperties struct { 9350 // 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). </br> - `Swagger` Schema use `application/vnd.ms-azure-apim.swagger.definitions+json` </br> - `WSDL` Schema use `application/vnd.ms-azure-apim.xsd+xml` </br> - `OpenApi` Schema use `application/vnd.oai.openapi.components+json` </br> - `WADL Schema` use `application/vnd.ms-azure-apim.wadl.grammars+xml`. 9351 ContentType *string `json:"contentType,omitempty"` 9352 // SchemaDocumentProperties - Create or update Properties of the Schema Document. 9353 *SchemaDocumentProperties `json:"document,omitempty"` 9354} 9355 9356// MarshalJSON is the custom marshaler for SchemaCreateOrUpdateProperties. 9357func (scoup SchemaCreateOrUpdateProperties) MarshalJSON() ([]byte, error) { 9358 objectMap := make(map[string]interface{}) 9359 if scoup.ContentType != nil { 9360 objectMap["contentType"] = scoup.ContentType 9361 } 9362 if scoup.SchemaDocumentProperties != nil { 9363 objectMap["document"] = scoup.SchemaDocumentProperties 9364 } 9365 return json.Marshal(objectMap) 9366} 9367 9368// UnmarshalJSON is the custom unmarshaler for SchemaCreateOrUpdateProperties struct. 9369func (scoup *SchemaCreateOrUpdateProperties) UnmarshalJSON(body []byte) error { 9370 var m map[string]*json.RawMessage 9371 err := json.Unmarshal(body, &m) 9372 if err != nil { 9373 return err 9374 } 9375 for k, v := range m { 9376 switch k { 9377 case "contentType": 9378 if v != nil { 9379 var contentType string 9380 err = json.Unmarshal(*v, &contentType) 9381 if err != nil { 9382 return err 9383 } 9384 scoup.ContentType = &contentType 9385 } 9386 case "document": 9387 if v != nil { 9388 var schemaDocumentProperties SchemaDocumentProperties 9389 err = json.Unmarshal(*v, &schemaDocumentProperties) 9390 if err != nil { 9391 return err 9392 } 9393 scoup.SchemaDocumentProperties = &schemaDocumentProperties 9394 } 9395 } 9396 } 9397 9398 return nil 9399} 9400 9401// SchemaDocumentProperties schema Document Properties. 9402type SchemaDocumentProperties struct { 9403 // Value - Json escaped string defining the document representing the Schema. 9404 Value *string `json:"value,omitempty"` 9405} 9406 9407// ServiceApplyNetworkConfigurationParameters parameter supplied to the Apply Network configuration 9408// operation. 9409type ServiceApplyNetworkConfigurationParameters struct { 9410 // 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. 9411 Location *string `json:"location,omitempty"` 9412} 9413 9414// ServiceApplyNetworkConfigurationUpdatesFuture an abstraction for monitoring and retrieving the results 9415// of a long-running operation. 9416type ServiceApplyNetworkConfigurationUpdatesFuture struct { 9417 azure.Future 9418} 9419 9420// Result returns the result of the asynchronous operation. 9421// If the operation has not completed it will return an error. 9422func (future *ServiceApplyNetworkConfigurationUpdatesFuture) Result(client ServiceClient) (sr ServiceResource, err error) { 9423 var done bool 9424 done, err = future.DoneWithContext(context.Background(), client) 9425 if err != nil { 9426 err = autorest.NewErrorWithError(err, "apimanagement.ServiceApplyNetworkConfigurationUpdatesFuture", "Result", future.Response(), "Polling failure") 9427 return 9428 } 9429 if !done { 9430 err = azure.NewAsyncOpIncompleteError("apimanagement.ServiceApplyNetworkConfigurationUpdatesFuture") 9431 return 9432 } 9433 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 9434 if sr.Response.Response, err = future.GetResult(sender); err == nil && sr.Response.Response.StatusCode != http.StatusNoContent { 9435 sr, err = client.ApplyNetworkConfigurationUpdatesResponder(sr.Response.Response) 9436 if err != nil { 9437 err = autorest.NewErrorWithError(err, "apimanagement.ServiceApplyNetworkConfigurationUpdatesFuture", "Result", sr.Response.Response, "Failure responding to request") 9438 } 9439 } 9440 return 9441} 9442 9443// ServiceBackupFuture an abstraction for monitoring and retrieving the results of a long-running 9444// operation. 9445type ServiceBackupFuture struct { 9446 azure.Future 9447} 9448 9449// Result returns the result of the asynchronous operation. 9450// If the operation has not completed it will return an error. 9451func (future *ServiceBackupFuture) Result(client ServiceClient) (sr ServiceResource, err error) { 9452 var done bool 9453 done, err = future.DoneWithContext(context.Background(), client) 9454 if err != nil { 9455 err = autorest.NewErrorWithError(err, "apimanagement.ServiceBackupFuture", "Result", future.Response(), "Polling failure") 9456 return 9457 } 9458 if !done { 9459 err = azure.NewAsyncOpIncompleteError("apimanagement.ServiceBackupFuture") 9460 return 9461 } 9462 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 9463 if sr.Response.Response, err = future.GetResult(sender); err == nil && sr.Response.Response.StatusCode != http.StatusNoContent { 9464 sr, err = client.BackupResponder(sr.Response.Response) 9465 if err != nil { 9466 err = autorest.NewErrorWithError(err, "apimanagement.ServiceBackupFuture", "Result", sr.Response.Response, "Failure responding to request") 9467 } 9468 } 9469 return 9470} 9471 9472// ServiceBackupRestoreParameters parameters supplied to the Backup/Restore of an API Management service 9473// operation. 9474type ServiceBackupRestoreParameters struct { 9475 // StorageAccount - Azure Cloud Storage account (used to place/retrieve the backup) name. 9476 StorageAccount *string `json:"storageAccount,omitempty"` 9477 // AccessKey - Azure Cloud Storage account (used to place/retrieve the backup) access key. 9478 AccessKey *string `json:"accessKey,omitempty"` 9479 // ContainerName - Azure Cloud Storage blob container name used to place/retrieve the backup. 9480 ContainerName *string `json:"containerName,omitempty"` 9481 // BackupName - The name of the backup file to create. 9482 BackupName *string `json:"backupName,omitempty"` 9483} 9484 9485// ServiceBaseProperties base Properties of an API Management service resource description. 9486type ServiceBaseProperties struct { 9487 // NotificationSenderEmail - Email address from which the notification will be sent. 9488 NotificationSenderEmail *string `json:"notificationSenderEmail,omitempty"` 9489 // 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. 9490 ProvisioningState *string `json:"provisioningState,omitempty"` 9491 // TargetProvisioningState - READ-ONLY; The provisioning state of the API Management service, which is targeted by the long running operation started on the service. 9492 TargetProvisioningState *string `json:"targetProvisioningState,omitempty"` 9493 // 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. 9494 CreatedAtUtc *date.Time `json:"createdAtUtc,omitempty"` 9495 // GatewayURL - READ-ONLY; Gateway URL of the API Management service. 9496 GatewayURL *string `json:"gatewayUrl,omitempty"` 9497 // GatewayRegionalURL - READ-ONLY; Gateway URL of the API Management service in the Default Region. 9498 GatewayRegionalURL *string `json:"gatewayRegionalUrl,omitempty"` 9499 // PortalURL - READ-ONLY; Publisher portal endpoint Url of the API Management service. 9500 PortalURL *string `json:"portalUrl,omitempty"` 9501 // ManagementAPIURL - READ-ONLY; Management API endpoint URL of the API Management service. 9502 ManagementAPIURL *string `json:"managementApiUrl,omitempty"` 9503 // ScmURL - READ-ONLY; SCM endpoint URL of the API Management service. 9504 ScmURL *string `json:"scmUrl,omitempty"` 9505 // HostnameConfigurations - Custom hostname configuration of the API Management service. 9506 HostnameConfigurations *[]HostnameConfiguration `json:"hostnameConfigurations,omitempty"` 9507 // 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. 9508 PublicIPAddresses *[]string `json:"publicIPAddresses,omitempty"` 9509 // 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. 9510 PrivateIPAddresses *[]string `json:"privateIPAddresses,omitempty"` 9511 // VirtualNetworkConfiguration - Virtual network configuration of the API Management service. 9512 VirtualNetworkConfiguration *VirtualNetworkConfiguration `json:"virtualNetworkConfiguration,omitempty"` 9513 // AdditionalLocations - Additional datacenter locations of the API Management service. 9514 AdditionalLocations *[]AdditionalLocation `json:"additionalLocations,omitempty"` 9515 // CustomProperties - Custom properties of the API Management service.</br>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).</br>Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls11` can be used to disable just TLS 1.1.</br>Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls10` can be used to disable TLS 1.0 on an API Management service.</br>Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls11` can be used to disable just TLS 1.1 for communications with backends.</br>Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls10` can be used to disable TLS 1.0 for communications with backends.</br>Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Protocols.Server.Http2` can be used to enable HTTP2 protocol on an API Management service.</br>Not specifying any of these properties on PATCH operation will reset omitted properties' values to their defaults. For all the settings except Http2 the default value is `True` if the service was created on or before April 1st 2018 and `False` otherwise. Http2 setting's default value is `False`.</br></br>You can disable any of next ciphers by using settings `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.[cipher_name]`: TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA, TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA, TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA, TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA, TLS_RSA_WITH_AES_128_GCM_SHA256, TLS_RSA_WITH_AES_256_CBC_SHA256, TLS_RSA_WITH_AES_128_CBC_SHA256, TLS_RSA_WITH_AES_256_CBC_SHA, TLS_RSA_WITH_AES_128_CBC_SHA. For example, `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TLS_RSA_WITH_AES_128_CBC_SHA256`:`false`. The default value is `true` for them. 9516 CustomProperties map[string]*string `json:"customProperties"` 9517 // Certificates - List of Certificates that need to be installed in the API Management service. Max supported certificates that can be installed is 10. 9518 Certificates *[]CertificateConfiguration `json:"certificates,omitempty"` 9519 // EnableClientCertificate - Property only meant to be used for Consumption SKU Service. This enforces a client certificate to be presented on each request to the gateway. This also enables the ability to authenticate the certificate in the policy on the gateway. 9520 EnableClientCertificate *bool `json:"enableClientCertificate,omitempty"` 9521 // 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' 9522 VirtualNetworkType VirtualNetworkType `json:"virtualNetworkType,omitempty"` 9523} 9524 9525// MarshalJSON is the custom marshaler for ServiceBaseProperties. 9526func (sbp ServiceBaseProperties) MarshalJSON() ([]byte, error) { 9527 objectMap := make(map[string]interface{}) 9528 if sbp.NotificationSenderEmail != nil { 9529 objectMap["notificationSenderEmail"] = sbp.NotificationSenderEmail 9530 } 9531 if sbp.HostnameConfigurations != nil { 9532 objectMap["hostnameConfigurations"] = sbp.HostnameConfigurations 9533 } 9534 if sbp.VirtualNetworkConfiguration != nil { 9535 objectMap["virtualNetworkConfiguration"] = sbp.VirtualNetworkConfiguration 9536 } 9537 if sbp.AdditionalLocations != nil { 9538 objectMap["additionalLocations"] = sbp.AdditionalLocations 9539 } 9540 if sbp.CustomProperties != nil { 9541 objectMap["customProperties"] = sbp.CustomProperties 9542 } 9543 if sbp.Certificates != nil { 9544 objectMap["certificates"] = sbp.Certificates 9545 } 9546 if sbp.EnableClientCertificate != nil { 9547 objectMap["enableClientCertificate"] = sbp.EnableClientCertificate 9548 } 9549 if sbp.VirtualNetworkType != "" { 9550 objectMap["virtualNetworkType"] = sbp.VirtualNetworkType 9551 } 9552 return json.Marshal(objectMap) 9553} 9554 9555// ServiceCheckNameAvailabilityParameters parameters supplied to the CheckNameAvailability operation. 9556type ServiceCheckNameAvailabilityParameters struct { 9557 // Name - The name to check for availability. 9558 Name *string `json:"name,omitempty"` 9559} 9560 9561// ServiceCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 9562// operation. 9563type ServiceCreateOrUpdateFuture struct { 9564 azure.Future 9565} 9566 9567// Result returns the result of the asynchronous operation. 9568// If the operation has not completed it will return an error. 9569func (future *ServiceCreateOrUpdateFuture) Result(client ServiceClient) (sr ServiceResource, err error) { 9570 var done bool 9571 done, err = future.DoneWithContext(context.Background(), client) 9572 if err != nil { 9573 err = autorest.NewErrorWithError(err, "apimanagement.ServiceCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 9574 return 9575 } 9576 if !done { 9577 err = azure.NewAsyncOpIncompleteError("apimanagement.ServiceCreateOrUpdateFuture") 9578 return 9579 } 9580 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 9581 if sr.Response.Response, err = future.GetResult(sender); err == nil && sr.Response.Response.StatusCode != http.StatusNoContent { 9582 sr, err = client.CreateOrUpdateResponder(sr.Response.Response) 9583 if err != nil { 9584 err = autorest.NewErrorWithError(err, "apimanagement.ServiceCreateOrUpdateFuture", "Result", sr.Response.Response, "Failure responding to request") 9585 } 9586 } 9587 return 9588} 9589 9590// ServiceDeleteFuture an abstraction for monitoring and retrieving the results of a long-running 9591// operation. 9592type ServiceDeleteFuture struct { 9593 azure.Future 9594} 9595 9596// Result returns the result of the asynchronous operation. 9597// If the operation has not completed it will return an error. 9598func (future *ServiceDeleteFuture) Result(client ServiceClient) (sr ServiceResource, err error) { 9599 var done bool 9600 done, err = future.DoneWithContext(context.Background(), client) 9601 if err != nil { 9602 err = autorest.NewErrorWithError(err, "apimanagement.ServiceDeleteFuture", "Result", future.Response(), "Polling failure") 9603 return 9604 } 9605 if !done { 9606 err = azure.NewAsyncOpIncompleteError("apimanagement.ServiceDeleteFuture") 9607 return 9608 } 9609 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 9610 if sr.Response.Response, err = future.GetResult(sender); err == nil && sr.Response.Response.StatusCode != http.StatusNoContent { 9611 sr, err = client.DeleteResponder(sr.Response.Response) 9612 if err != nil { 9613 err = autorest.NewErrorWithError(err, "apimanagement.ServiceDeleteFuture", "Result", sr.Response.Response, "Failure responding to request") 9614 } 9615 } 9616 return 9617} 9618 9619// ServiceGetSsoTokenResult the response of the GetSsoToken operation. 9620type ServiceGetSsoTokenResult struct { 9621 autorest.Response `json:"-"` 9622 // RedirectURI - Redirect URL to the Publisher Portal containing the SSO token. 9623 RedirectURI *string `json:"redirectUri,omitempty"` 9624} 9625 9626// ServiceIdentity identity properties of the Api Management service resource. 9627type ServiceIdentity struct { 9628 // Type - The identity type. Currently the only supported type is 'SystemAssigned'. 9629 Type *string `json:"type,omitempty"` 9630 // PrincipalID - READ-ONLY; The principal id of the identity. 9631 PrincipalID *uuid.UUID `json:"principalId,omitempty"` 9632 // TenantID - READ-ONLY; The client tenant id of the identity. 9633 TenantID *uuid.UUID `json:"tenantId,omitempty"` 9634} 9635 9636// ServiceListResult the response of the List API Management services operation. 9637type ServiceListResult struct { 9638 autorest.Response `json:"-"` 9639 // Value - Result of the List API Management services operation. 9640 Value *[]ServiceResource `json:"value,omitempty"` 9641 // NextLink - Link to the next set of results. Not empty if Value contains incomplete list of API Management services. 9642 NextLink *string `json:"nextLink,omitempty"` 9643} 9644 9645// ServiceListResultIterator provides access to a complete listing of ServiceResource values. 9646type ServiceListResultIterator struct { 9647 i int 9648 page ServiceListResultPage 9649} 9650 9651// NextWithContext advances to the next value. If there was an error making 9652// the request the iterator does not advance and the error is returned. 9653func (iter *ServiceListResultIterator) NextWithContext(ctx context.Context) (err error) { 9654 if tracing.IsEnabled() { 9655 ctx = tracing.StartSpan(ctx, fqdn+"/ServiceListResultIterator.NextWithContext") 9656 defer func() { 9657 sc := -1 9658 if iter.Response().Response.Response != nil { 9659 sc = iter.Response().Response.Response.StatusCode 9660 } 9661 tracing.EndSpan(ctx, sc, err) 9662 }() 9663 } 9664 iter.i++ 9665 if iter.i < len(iter.page.Values()) { 9666 return nil 9667 } 9668 err = iter.page.NextWithContext(ctx) 9669 if err != nil { 9670 iter.i-- 9671 return err 9672 } 9673 iter.i = 0 9674 return nil 9675} 9676 9677// Next advances to the next value. If there was an error making 9678// the request the iterator does not advance and the error is returned. 9679// Deprecated: Use NextWithContext() instead. 9680func (iter *ServiceListResultIterator) Next() error { 9681 return iter.NextWithContext(context.Background()) 9682} 9683 9684// NotDone returns true if the enumeration should be started or is not yet complete. 9685func (iter ServiceListResultIterator) NotDone() bool { 9686 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 9687} 9688 9689// Response returns the raw server response from the last page request. 9690func (iter ServiceListResultIterator) Response() ServiceListResult { 9691 return iter.page.Response() 9692} 9693 9694// Value returns the current value or a zero-initialized value if the 9695// iterator has advanced beyond the end of the collection. 9696func (iter ServiceListResultIterator) Value() ServiceResource { 9697 if !iter.page.NotDone() { 9698 return ServiceResource{} 9699 } 9700 return iter.page.Values()[iter.i] 9701} 9702 9703// Creates a new instance of the ServiceListResultIterator type. 9704func NewServiceListResultIterator(page ServiceListResultPage) ServiceListResultIterator { 9705 return ServiceListResultIterator{page: page} 9706} 9707 9708// IsEmpty returns true if the ListResult contains no values. 9709func (slr ServiceListResult) IsEmpty() bool { 9710 return slr.Value == nil || len(*slr.Value) == 0 9711} 9712 9713// serviceListResultPreparer prepares a request to retrieve the next set of results. 9714// It returns nil if no more results exist. 9715func (slr ServiceListResult) serviceListResultPreparer(ctx context.Context) (*http.Request, error) { 9716 if slr.NextLink == nil || len(to.String(slr.NextLink)) < 1 { 9717 return nil, nil 9718 } 9719 return autorest.Prepare((&http.Request{}).WithContext(ctx), 9720 autorest.AsJSON(), 9721 autorest.AsGet(), 9722 autorest.WithBaseURL(to.String(slr.NextLink))) 9723} 9724 9725// ServiceListResultPage contains a page of ServiceResource values. 9726type ServiceListResultPage struct { 9727 fn func(context.Context, ServiceListResult) (ServiceListResult, error) 9728 slr ServiceListResult 9729} 9730 9731// NextWithContext advances to the next page of values. If there was an error making 9732// the request the page does not advance and the error is returned. 9733func (page *ServiceListResultPage) NextWithContext(ctx context.Context) (err error) { 9734 if tracing.IsEnabled() { 9735 ctx = tracing.StartSpan(ctx, fqdn+"/ServiceListResultPage.NextWithContext") 9736 defer func() { 9737 sc := -1 9738 if page.Response().Response.Response != nil { 9739 sc = page.Response().Response.Response.StatusCode 9740 } 9741 tracing.EndSpan(ctx, sc, err) 9742 }() 9743 } 9744 next, err := page.fn(ctx, page.slr) 9745 if err != nil { 9746 return err 9747 } 9748 page.slr = next 9749 return nil 9750} 9751 9752// Next advances to the next page of values. If there was an error making 9753// the request the page does not advance and the error is returned. 9754// Deprecated: Use NextWithContext() instead. 9755func (page *ServiceListResultPage) Next() error { 9756 return page.NextWithContext(context.Background()) 9757} 9758 9759// NotDone returns true if the page enumeration should be started or is not yet complete. 9760func (page ServiceListResultPage) NotDone() bool { 9761 return !page.slr.IsEmpty() 9762} 9763 9764// Response returns the raw server response from the last page request. 9765func (page ServiceListResultPage) Response() ServiceListResult { 9766 return page.slr 9767} 9768 9769// Values returns the slice of values for the current page or nil if there are no values. 9770func (page ServiceListResultPage) Values() []ServiceResource { 9771 if page.slr.IsEmpty() { 9772 return nil 9773 } 9774 return *page.slr.Value 9775} 9776 9777// Creates a new instance of the ServiceListResultPage type. 9778func NewServiceListResultPage(getNextPage func(context.Context, ServiceListResult) (ServiceListResult, error)) ServiceListResultPage { 9779 return ServiceListResultPage{fn: getNextPage} 9780} 9781 9782// ServiceNameAvailabilityResult response of the CheckNameAvailability operation. 9783type ServiceNameAvailabilityResult struct { 9784 autorest.Response `json:"-"` 9785 // NameAvailable - READ-ONLY; True if the name is available and can be used to create a new API Management service; otherwise false. 9786 NameAvailable *bool `json:"nameAvailable,omitempty"` 9787 // 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. 9788 Message *string `json:"message,omitempty"` 9789 // 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' 9790 Reason NameAvailabilityReason `json:"reason,omitempty"` 9791} 9792 9793// ServiceProperties properties of an API Management service resource description. 9794type ServiceProperties struct { 9795 // PublisherEmail - Publisher email. 9796 PublisherEmail *string `json:"publisherEmail,omitempty"` 9797 // PublisherName - Publisher name. 9798 PublisherName *string `json:"publisherName,omitempty"` 9799 // NotificationSenderEmail - Email address from which the notification will be sent. 9800 NotificationSenderEmail *string `json:"notificationSenderEmail,omitempty"` 9801 // 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. 9802 ProvisioningState *string `json:"provisioningState,omitempty"` 9803 // TargetProvisioningState - READ-ONLY; The provisioning state of the API Management service, which is targeted by the long running operation started on the service. 9804 TargetProvisioningState *string `json:"targetProvisioningState,omitempty"` 9805 // 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. 9806 CreatedAtUtc *date.Time `json:"createdAtUtc,omitempty"` 9807 // GatewayURL - READ-ONLY; Gateway URL of the API Management service. 9808 GatewayURL *string `json:"gatewayUrl,omitempty"` 9809 // GatewayRegionalURL - READ-ONLY; Gateway URL of the API Management service in the Default Region. 9810 GatewayRegionalURL *string `json:"gatewayRegionalUrl,omitempty"` 9811 // PortalURL - READ-ONLY; Publisher portal endpoint Url of the API Management service. 9812 PortalURL *string `json:"portalUrl,omitempty"` 9813 // ManagementAPIURL - READ-ONLY; Management API endpoint URL of the API Management service. 9814 ManagementAPIURL *string `json:"managementApiUrl,omitempty"` 9815 // ScmURL - READ-ONLY; SCM endpoint URL of the API Management service. 9816 ScmURL *string `json:"scmUrl,omitempty"` 9817 // HostnameConfigurations - Custom hostname configuration of the API Management service. 9818 HostnameConfigurations *[]HostnameConfiguration `json:"hostnameConfigurations,omitempty"` 9819 // 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. 9820 PublicIPAddresses *[]string `json:"publicIPAddresses,omitempty"` 9821 // 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. 9822 PrivateIPAddresses *[]string `json:"privateIPAddresses,omitempty"` 9823 // VirtualNetworkConfiguration - Virtual network configuration of the API Management service. 9824 VirtualNetworkConfiguration *VirtualNetworkConfiguration `json:"virtualNetworkConfiguration,omitempty"` 9825 // AdditionalLocations - Additional datacenter locations of the API Management service. 9826 AdditionalLocations *[]AdditionalLocation `json:"additionalLocations,omitempty"` 9827 // CustomProperties - Custom properties of the API Management service.</br>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).</br>Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls11` can be used to disable just TLS 1.1.</br>Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls10` can be used to disable TLS 1.0 on an API Management service.</br>Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls11` can be used to disable just TLS 1.1 for communications with backends.</br>Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls10` can be used to disable TLS 1.0 for communications with backends.</br>Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Protocols.Server.Http2` can be used to enable HTTP2 protocol on an API Management service.</br>Not specifying any of these properties on PATCH operation will reset omitted properties' values to their defaults. For all the settings except Http2 the default value is `True` if the service was created on or before April 1st 2018 and `False` otherwise. Http2 setting's default value is `False`.</br></br>You can disable any of next ciphers by using settings `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.[cipher_name]`: TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA, TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA, TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA, TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA, TLS_RSA_WITH_AES_128_GCM_SHA256, TLS_RSA_WITH_AES_256_CBC_SHA256, TLS_RSA_WITH_AES_128_CBC_SHA256, TLS_RSA_WITH_AES_256_CBC_SHA, TLS_RSA_WITH_AES_128_CBC_SHA. For example, `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TLS_RSA_WITH_AES_128_CBC_SHA256`:`false`. The default value is `true` for them. 9828 CustomProperties map[string]*string `json:"customProperties"` 9829 // Certificates - List of Certificates that need to be installed in the API Management service. Max supported certificates that can be installed is 10. 9830 Certificates *[]CertificateConfiguration `json:"certificates,omitempty"` 9831 // EnableClientCertificate - Property only meant to be used for Consumption SKU Service. This enforces a client certificate to be presented on each request to the gateway. This also enables the ability to authenticate the certificate in the policy on the gateway. 9832 EnableClientCertificate *bool `json:"enableClientCertificate,omitempty"` 9833 // 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' 9834 VirtualNetworkType VirtualNetworkType `json:"virtualNetworkType,omitempty"` 9835} 9836 9837// MarshalJSON is the custom marshaler for ServiceProperties. 9838func (sp ServiceProperties) MarshalJSON() ([]byte, error) { 9839 objectMap := make(map[string]interface{}) 9840 if sp.PublisherEmail != nil { 9841 objectMap["publisherEmail"] = sp.PublisherEmail 9842 } 9843 if sp.PublisherName != nil { 9844 objectMap["publisherName"] = sp.PublisherName 9845 } 9846 if sp.NotificationSenderEmail != nil { 9847 objectMap["notificationSenderEmail"] = sp.NotificationSenderEmail 9848 } 9849 if sp.HostnameConfigurations != nil { 9850 objectMap["hostnameConfigurations"] = sp.HostnameConfigurations 9851 } 9852 if sp.VirtualNetworkConfiguration != nil { 9853 objectMap["virtualNetworkConfiguration"] = sp.VirtualNetworkConfiguration 9854 } 9855 if sp.AdditionalLocations != nil { 9856 objectMap["additionalLocations"] = sp.AdditionalLocations 9857 } 9858 if sp.CustomProperties != nil { 9859 objectMap["customProperties"] = sp.CustomProperties 9860 } 9861 if sp.Certificates != nil { 9862 objectMap["certificates"] = sp.Certificates 9863 } 9864 if sp.EnableClientCertificate != nil { 9865 objectMap["enableClientCertificate"] = sp.EnableClientCertificate 9866 } 9867 if sp.VirtualNetworkType != "" { 9868 objectMap["virtualNetworkType"] = sp.VirtualNetworkType 9869 } 9870 return json.Marshal(objectMap) 9871} 9872 9873// ServiceResource a single API Management service resource in List or Get response. 9874type ServiceResource struct { 9875 autorest.Response `json:"-"` 9876 // ServiceProperties - Properties of the API Management service. 9877 *ServiceProperties `json:"properties,omitempty"` 9878 // Sku - SKU properties of the API Management service. 9879 Sku *ServiceSkuProperties `json:"sku,omitempty"` 9880 // Identity - Managed service identity of the Api Management service. 9881 Identity *ServiceIdentity `json:"identity,omitempty"` 9882 // Location - Resource location. 9883 Location *string `json:"location,omitempty"` 9884 // Etag - READ-ONLY; ETag of the resource. 9885 Etag *string `json:"etag,omitempty"` 9886 // ID - READ-ONLY; Resource ID. 9887 ID *string `json:"id,omitempty"` 9888 // Name - READ-ONLY; Resource name. 9889 Name *string `json:"name,omitempty"` 9890 // Type - READ-ONLY; Resource type for API Management resource is set to Microsoft.ApiManagement. 9891 Type *string `json:"type,omitempty"` 9892 // Tags - Resource tags. 9893 Tags map[string]*string `json:"tags"` 9894} 9895 9896// MarshalJSON is the custom marshaler for ServiceResource. 9897func (sr ServiceResource) MarshalJSON() ([]byte, error) { 9898 objectMap := make(map[string]interface{}) 9899 if sr.ServiceProperties != nil { 9900 objectMap["properties"] = sr.ServiceProperties 9901 } 9902 if sr.Sku != nil { 9903 objectMap["sku"] = sr.Sku 9904 } 9905 if sr.Identity != nil { 9906 objectMap["identity"] = sr.Identity 9907 } 9908 if sr.Location != nil { 9909 objectMap["location"] = sr.Location 9910 } 9911 if sr.Tags != nil { 9912 objectMap["tags"] = sr.Tags 9913 } 9914 return json.Marshal(objectMap) 9915} 9916 9917// UnmarshalJSON is the custom unmarshaler for ServiceResource struct. 9918func (sr *ServiceResource) UnmarshalJSON(body []byte) error { 9919 var m map[string]*json.RawMessage 9920 err := json.Unmarshal(body, &m) 9921 if err != nil { 9922 return err 9923 } 9924 for k, v := range m { 9925 switch k { 9926 case "properties": 9927 if v != nil { 9928 var serviceProperties ServiceProperties 9929 err = json.Unmarshal(*v, &serviceProperties) 9930 if err != nil { 9931 return err 9932 } 9933 sr.ServiceProperties = &serviceProperties 9934 } 9935 case "sku": 9936 if v != nil { 9937 var sku ServiceSkuProperties 9938 err = json.Unmarshal(*v, &sku) 9939 if err != nil { 9940 return err 9941 } 9942 sr.Sku = &sku 9943 } 9944 case "identity": 9945 if v != nil { 9946 var identity ServiceIdentity 9947 err = json.Unmarshal(*v, &identity) 9948 if err != nil { 9949 return err 9950 } 9951 sr.Identity = &identity 9952 } 9953 case "location": 9954 if v != nil { 9955 var location string 9956 err = json.Unmarshal(*v, &location) 9957 if err != nil { 9958 return err 9959 } 9960 sr.Location = &location 9961 } 9962 case "etag": 9963 if v != nil { 9964 var etag string 9965 err = json.Unmarshal(*v, &etag) 9966 if err != nil { 9967 return err 9968 } 9969 sr.Etag = &etag 9970 } 9971 case "id": 9972 if v != nil { 9973 var ID string 9974 err = json.Unmarshal(*v, &ID) 9975 if err != nil { 9976 return err 9977 } 9978 sr.ID = &ID 9979 } 9980 case "name": 9981 if v != nil { 9982 var name string 9983 err = json.Unmarshal(*v, &name) 9984 if err != nil { 9985 return err 9986 } 9987 sr.Name = &name 9988 } 9989 case "type": 9990 if v != nil { 9991 var typeVar string 9992 err = json.Unmarshal(*v, &typeVar) 9993 if err != nil { 9994 return err 9995 } 9996 sr.Type = &typeVar 9997 } 9998 case "tags": 9999 if v != nil { 10000 var tags map[string]*string 10001 err = json.Unmarshal(*v, &tags) 10002 if err != nil { 10003 return err 10004 } 10005 sr.Tags = tags 10006 } 10007 } 10008 } 10009 10010 return nil 10011} 10012 10013// ServiceRestoreFuture an abstraction for monitoring and retrieving the results of a long-running 10014// operation. 10015type ServiceRestoreFuture struct { 10016 azure.Future 10017} 10018 10019// Result returns the result of the asynchronous operation. 10020// If the operation has not completed it will return an error. 10021func (future *ServiceRestoreFuture) Result(client ServiceClient) (sr ServiceResource, err error) { 10022 var done bool 10023 done, err = future.DoneWithContext(context.Background(), client) 10024 if err != nil { 10025 err = autorest.NewErrorWithError(err, "apimanagement.ServiceRestoreFuture", "Result", future.Response(), "Polling failure") 10026 return 10027 } 10028 if !done { 10029 err = azure.NewAsyncOpIncompleteError("apimanagement.ServiceRestoreFuture") 10030 return 10031 } 10032 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 10033 if sr.Response.Response, err = future.GetResult(sender); err == nil && sr.Response.Response.StatusCode != http.StatusNoContent { 10034 sr, err = client.RestoreResponder(sr.Response.Response) 10035 if err != nil { 10036 err = autorest.NewErrorWithError(err, "apimanagement.ServiceRestoreFuture", "Result", sr.Response.Response, "Failure responding to request") 10037 } 10038 } 10039 return 10040} 10041 10042// ServiceSkuProperties API Management service resource SKU properties. 10043type ServiceSkuProperties struct { 10044 // Name - Name of the Sku. Possible values include: 'SkuTypeDeveloper', 'SkuTypeStandard', 'SkuTypePremium', 'SkuTypeBasic', 'SkuTypeConsumption' 10045 Name SkuType `json:"name,omitempty"` 10046 // Capacity - Capacity of the SKU (number of deployed units of the SKU). 10047 Capacity *int32 `json:"capacity,omitempty"` 10048} 10049 10050// ServiceUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 10051// operation. 10052type ServiceUpdateFuture struct { 10053 azure.Future 10054} 10055 10056// Result returns the result of the asynchronous operation. 10057// If the operation has not completed it will return an error. 10058func (future *ServiceUpdateFuture) Result(client ServiceClient) (sr ServiceResource, err error) { 10059 var done bool 10060 done, err = future.DoneWithContext(context.Background(), client) 10061 if err != nil { 10062 err = autorest.NewErrorWithError(err, "apimanagement.ServiceUpdateFuture", "Result", future.Response(), "Polling failure") 10063 return 10064 } 10065 if !done { 10066 err = azure.NewAsyncOpIncompleteError("apimanagement.ServiceUpdateFuture") 10067 return 10068 } 10069 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 10070 if sr.Response.Response, err = future.GetResult(sender); err == nil && sr.Response.Response.StatusCode != http.StatusNoContent { 10071 sr, err = client.UpdateResponder(sr.Response.Response) 10072 if err != nil { 10073 err = autorest.NewErrorWithError(err, "apimanagement.ServiceUpdateFuture", "Result", sr.Response.Response, "Failure responding to request") 10074 } 10075 } 10076 return 10077} 10078 10079// ServiceUpdateParameters parameter supplied to Update Api Management Service. 10080type ServiceUpdateParameters struct { 10081 // ServiceUpdateProperties - Properties of the API Management service. 10082 *ServiceUpdateProperties `json:"properties,omitempty"` 10083 // Sku - SKU properties of the API Management service. 10084 Sku *ServiceSkuProperties `json:"sku,omitempty"` 10085 // Identity - Managed service identity of the Api Management service. 10086 Identity *ServiceIdentity `json:"identity,omitempty"` 10087 // Etag - READ-ONLY; ETag of the resource. 10088 Etag *string `json:"etag,omitempty"` 10089 // ID - READ-ONLY; Resource ID. 10090 ID *string `json:"id,omitempty"` 10091 // Name - READ-ONLY; Resource name. 10092 Name *string `json:"name,omitempty"` 10093 // Type - READ-ONLY; Resource type for API Management resource is set to Microsoft.ApiManagement. 10094 Type *string `json:"type,omitempty"` 10095 // Tags - Resource tags. 10096 Tags map[string]*string `json:"tags"` 10097} 10098 10099// MarshalJSON is the custom marshaler for ServiceUpdateParameters. 10100func (sup ServiceUpdateParameters) MarshalJSON() ([]byte, error) { 10101 objectMap := make(map[string]interface{}) 10102 if sup.ServiceUpdateProperties != nil { 10103 objectMap["properties"] = sup.ServiceUpdateProperties 10104 } 10105 if sup.Sku != nil { 10106 objectMap["sku"] = sup.Sku 10107 } 10108 if sup.Identity != nil { 10109 objectMap["identity"] = sup.Identity 10110 } 10111 if sup.Tags != nil { 10112 objectMap["tags"] = sup.Tags 10113 } 10114 return json.Marshal(objectMap) 10115} 10116 10117// UnmarshalJSON is the custom unmarshaler for ServiceUpdateParameters struct. 10118func (sup *ServiceUpdateParameters) UnmarshalJSON(body []byte) error { 10119 var m map[string]*json.RawMessage 10120 err := json.Unmarshal(body, &m) 10121 if err != nil { 10122 return err 10123 } 10124 for k, v := range m { 10125 switch k { 10126 case "properties": 10127 if v != nil { 10128 var serviceUpdateProperties ServiceUpdateProperties 10129 err = json.Unmarshal(*v, &serviceUpdateProperties) 10130 if err != nil { 10131 return err 10132 } 10133 sup.ServiceUpdateProperties = &serviceUpdateProperties 10134 } 10135 case "sku": 10136 if v != nil { 10137 var sku ServiceSkuProperties 10138 err = json.Unmarshal(*v, &sku) 10139 if err != nil { 10140 return err 10141 } 10142 sup.Sku = &sku 10143 } 10144 case "identity": 10145 if v != nil { 10146 var identity ServiceIdentity 10147 err = json.Unmarshal(*v, &identity) 10148 if err != nil { 10149 return err 10150 } 10151 sup.Identity = &identity 10152 } 10153 case "etag": 10154 if v != nil { 10155 var etag string 10156 err = json.Unmarshal(*v, &etag) 10157 if err != nil { 10158 return err 10159 } 10160 sup.Etag = &etag 10161 } 10162 case "id": 10163 if v != nil { 10164 var ID string 10165 err = json.Unmarshal(*v, &ID) 10166 if err != nil { 10167 return err 10168 } 10169 sup.ID = &ID 10170 } 10171 case "name": 10172 if v != nil { 10173 var name string 10174 err = json.Unmarshal(*v, &name) 10175 if err != nil { 10176 return err 10177 } 10178 sup.Name = &name 10179 } 10180 case "type": 10181 if v != nil { 10182 var typeVar string 10183 err = json.Unmarshal(*v, &typeVar) 10184 if err != nil { 10185 return err 10186 } 10187 sup.Type = &typeVar 10188 } 10189 case "tags": 10190 if v != nil { 10191 var tags map[string]*string 10192 err = json.Unmarshal(*v, &tags) 10193 if err != nil { 10194 return err 10195 } 10196 sup.Tags = tags 10197 } 10198 } 10199 } 10200 10201 return nil 10202} 10203 10204// ServiceUpdateProperties properties of an API Management service resource description. 10205type ServiceUpdateProperties struct { 10206 // PublisherEmail - Publisher email. 10207 PublisherEmail *string `json:"publisherEmail,omitempty"` 10208 // PublisherName - Publisher name. 10209 PublisherName *string `json:"publisherName,omitempty"` 10210 // NotificationSenderEmail - Email address from which the notification will be sent. 10211 NotificationSenderEmail *string `json:"notificationSenderEmail,omitempty"` 10212 // 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. 10213 ProvisioningState *string `json:"provisioningState,omitempty"` 10214 // TargetProvisioningState - READ-ONLY; The provisioning state of the API Management service, which is targeted by the long running operation started on the service. 10215 TargetProvisioningState *string `json:"targetProvisioningState,omitempty"` 10216 // 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. 10217 CreatedAtUtc *date.Time `json:"createdAtUtc,omitempty"` 10218 // GatewayURL - READ-ONLY; Gateway URL of the API Management service. 10219 GatewayURL *string `json:"gatewayUrl,omitempty"` 10220 // GatewayRegionalURL - READ-ONLY; Gateway URL of the API Management service in the Default Region. 10221 GatewayRegionalURL *string `json:"gatewayRegionalUrl,omitempty"` 10222 // PortalURL - READ-ONLY; Publisher portal endpoint Url of the API Management service. 10223 PortalURL *string `json:"portalUrl,omitempty"` 10224 // ManagementAPIURL - READ-ONLY; Management API endpoint URL of the API Management service. 10225 ManagementAPIURL *string `json:"managementApiUrl,omitempty"` 10226 // ScmURL - READ-ONLY; SCM endpoint URL of the API Management service. 10227 ScmURL *string `json:"scmUrl,omitempty"` 10228 // HostnameConfigurations - Custom hostname configuration of the API Management service. 10229 HostnameConfigurations *[]HostnameConfiguration `json:"hostnameConfigurations,omitempty"` 10230 // 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. 10231 PublicIPAddresses *[]string `json:"publicIPAddresses,omitempty"` 10232 // 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. 10233 PrivateIPAddresses *[]string `json:"privateIPAddresses,omitempty"` 10234 // VirtualNetworkConfiguration - Virtual network configuration of the API Management service. 10235 VirtualNetworkConfiguration *VirtualNetworkConfiguration `json:"virtualNetworkConfiguration,omitempty"` 10236 // AdditionalLocations - Additional datacenter locations of the API Management service. 10237 AdditionalLocations *[]AdditionalLocation `json:"additionalLocations,omitempty"` 10238 // CustomProperties - Custom properties of the API Management service.</br>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).</br>Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls11` can be used to disable just TLS 1.1.</br>Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls10` can be used to disable TLS 1.0 on an API Management service.</br>Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls11` can be used to disable just TLS 1.1 for communications with backends.</br>Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls10` can be used to disable TLS 1.0 for communications with backends.</br>Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Protocols.Server.Http2` can be used to enable HTTP2 protocol on an API Management service.</br>Not specifying any of these properties on PATCH operation will reset omitted properties' values to their defaults. For all the settings except Http2 the default value is `True` if the service was created on or before April 1st 2018 and `False` otherwise. Http2 setting's default value is `False`.</br></br>You can disable any of next ciphers by using settings `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.[cipher_name]`: TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA, TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA, TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA, TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA, TLS_RSA_WITH_AES_128_GCM_SHA256, TLS_RSA_WITH_AES_256_CBC_SHA256, TLS_RSA_WITH_AES_128_CBC_SHA256, TLS_RSA_WITH_AES_256_CBC_SHA, TLS_RSA_WITH_AES_128_CBC_SHA. For example, `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TLS_RSA_WITH_AES_128_CBC_SHA256`:`false`. The default value is `true` for them. 10239 CustomProperties map[string]*string `json:"customProperties"` 10240 // Certificates - List of Certificates that need to be installed in the API Management service. Max supported certificates that can be installed is 10. 10241 Certificates *[]CertificateConfiguration `json:"certificates,omitempty"` 10242 // EnableClientCertificate - Property only meant to be used for Consumption SKU Service. This enforces a client certificate to be presented on each request to the gateway. This also enables the ability to authenticate the certificate in the policy on the gateway. 10243 EnableClientCertificate *bool `json:"enableClientCertificate,omitempty"` 10244 // 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' 10245 VirtualNetworkType VirtualNetworkType `json:"virtualNetworkType,omitempty"` 10246} 10247 10248// MarshalJSON is the custom marshaler for ServiceUpdateProperties. 10249func (sup ServiceUpdateProperties) MarshalJSON() ([]byte, error) { 10250 objectMap := make(map[string]interface{}) 10251 if sup.PublisherEmail != nil { 10252 objectMap["publisherEmail"] = sup.PublisherEmail 10253 } 10254 if sup.PublisherName != nil { 10255 objectMap["publisherName"] = sup.PublisherName 10256 } 10257 if sup.NotificationSenderEmail != nil { 10258 objectMap["notificationSenderEmail"] = sup.NotificationSenderEmail 10259 } 10260 if sup.HostnameConfigurations != nil { 10261 objectMap["hostnameConfigurations"] = sup.HostnameConfigurations 10262 } 10263 if sup.VirtualNetworkConfiguration != nil { 10264 objectMap["virtualNetworkConfiguration"] = sup.VirtualNetworkConfiguration 10265 } 10266 if sup.AdditionalLocations != nil { 10267 objectMap["additionalLocations"] = sup.AdditionalLocations 10268 } 10269 if sup.CustomProperties != nil { 10270 objectMap["customProperties"] = sup.CustomProperties 10271 } 10272 if sup.Certificates != nil { 10273 objectMap["certificates"] = sup.Certificates 10274 } 10275 if sup.EnableClientCertificate != nil { 10276 objectMap["enableClientCertificate"] = sup.EnableClientCertificate 10277 } 10278 if sup.VirtualNetworkType != "" { 10279 objectMap["virtualNetworkType"] = sup.VirtualNetworkType 10280 } 10281 return json.Marshal(objectMap) 10282} 10283 10284// SubscriptionCollection paged Subscriptions list representation. 10285type SubscriptionCollection struct { 10286 autorest.Response `json:"-"` 10287 // Value - Page values. 10288 Value *[]SubscriptionContract `json:"value,omitempty"` 10289 // NextLink - Next page link if any. 10290 NextLink *string `json:"nextLink,omitempty"` 10291} 10292 10293// SubscriptionCollectionIterator provides access to a complete listing of SubscriptionContract values. 10294type SubscriptionCollectionIterator struct { 10295 i int 10296 page SubscriptionCollectionPage 10297} 10298 10299// NextWithContext advances to the next value. If there was an error making 10300// the request the iterator does not advance and the error is returned. 10301func (iter *SubscriptionCollectionIterator) NextWithContext(ctx context.Context) (err error) { 10302 if tracing.IsEnabled() { 10303 ctx = tracing.StartSpan(ctx, fqdn+"/SubscriptionCollectionIterator.NextWithContext") 10304 defer func() { 10305 sc := -1 10306 if iter.Response().Response.Response != nil { 10307 sc = iter.Response().Response.Response.StatusCode 10308 } 10309 tracing.EndSpan(ctx, sc, err) 10310 }() 10311 } 10312 iter.i++ 10313 if iter.i < len(iter.page.Values()) { 10314 return nil 10315 } 10316 err = iter.page.NextWithContext(ctx) 10317 if err != nil { 10318 iter.i-- 10319 return err 10320 } 10321 iter.i = 0 10322 return nil 10323} 10324 10325// Next advances to the next value. If there was an error making 10326// the request the iterator does not advance and the error is returned. 10327// Deprecated: Use NextWithContext() instead. 10328func (iter *SubscriptionCollectionIterator) Next() error { 10329 return iter.NextWithContext(context.Background()) 10330} 10331 10332// NotDone returns true if the enumeration should be started or is not yet complete. 10333func (iter SubscriptionCollectionIterator) NotDone() bool { 10334 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 10335} 10336 10337// Response returns the raw server response from the last page request. 10338func (iter SubscriptionCollectionIterator) Response() SubscriptionCollection { 10339 return iter.page.Response() 10340} 10341 10342// Value returns the current value or a zero-initialized value if the 10343// iterator has advanced beyond the end of the collection. 10344func (iter SubscriptionCollectionIterator) Value() SubscriptionContract { 10345 if !iter.page.NotDone() { 10346 return SubscriptionContract{} 10347 } 10348 return iter.page.Values()[iter.i] 10349} 10350 10351// Creates a new instance of the SubscriptionCollectionIterator type. 10352func NewSubscriptionCollectionIterator(page SubscriptionCollectionPage) SubscriptionCollectionIterator { 10353 return SubscriptionCollectionIterator{page: page} 10354} 10355 10356// IsEmpty returns true if the ListResult contains no values. 10357func (sc SubscriptionCollection) IsEmpty() bool { 10358 return sc.Value == nil || len(*sc.Value) == 0 10359} 10360 10361// subscriptionCollectionPreparer prepares a request to retrieve the next set of results. 10362// It returns nil if no more results exist. 10363func (sc SubscriptionCollection) subscriptionCollectionPreparer(ctx context.Context) (*http.Request, error) { 10364 if sc.NextLink == nil || len(to.String(sc.NextLink)) < 1 { 10365 return nil, nil 10366 } 10367 return autorest.Prepare((&http.Request{}).WithContext(ctx), 10368 autorest.AsJSON(), 10369 autorest.AsGet(), 10370 autorest.WithBaseURL(to.String(sc.NextLink))) 10371} 10372 10373// SubscriptionCollectionPage contains a page of SubscriptionContract values. 10374type SubscriptionCollectionPage struct { 10375 fn func(context.Context, SubscriptionCollection) (SubscriptionCollection, error) 10376 sc SubscriptionCollection 10377} 10378 10379// NextWithContext advances to the next page of values. If there was an error making 10380// the request the page does not advance and the error is returned. 10381func (page *SubscriptionCollectionPage) NextWithContext(ctx context.Context) (err error) { 10382 if tracing.IsEnabled() { 10383 ctx = tracing.StartSpan(ctx, fqdn+"/SubscriptionCollectionPage.NextWithContext") 10384 defer func() { 10385 sc := -1 10386 if page.Response().Response.Response != nil { 10387 sc = page.Response().Response.Response.StatusCode 10388 } 10389 tracing.EndSpan(ctx, sc, err) 10390 }() 10391 } 10392 next, err := page.fn(ctx, page.sc) 10393 if err != nil { 10394 return err 10395 } 10396 page.sc = next 10397 return nil 10398} 10399 10400// Next advances to the next page of values. If there was an error making 10401// the request the page does not advance and the error is returned. 10402// Deprecated: Use NextWithContext() instead. 10403func (page *SubscriptionCollectionPage) Next() error { 10404 return page.NextWithContext(context.Background()) 10405} 10406 10407// NotDone returns true if the page enumeration should be started or is not yet complete. 10408func (page SubscriptionCollectionPage) NotDone() bool { 10409 return !page.sc.IsEmpty() 10410} 10411 10412// Response returns the raw server response from the last page request. 10413func (page SubscriptionCollectionPage) Response() SubscriptionCollection { 10414 return page.sc 10415} 10416 10417// Values returns the slice of values for the current page or nil if there are no values. 10418func (page SubscriptionCollectionPage) Values() []SubscriptionContract { 10419 if page.sc.IsEmpty() { 10420 return nil 10421 } 10422 return *page.sc.Value 10423} 10424 10425// Creates a new instance of the SubscriptionCollectionPage type. 10426func NewSubscriptionCollectionPage(getNextPage func(context.Context, SubscriptionCollection) (SubscriptionCollection, error)) SubscriptionCollectionPage { 10427 return SubscriptionCollectionPage{fn: getNextPage} 10428} 10429 10430// SubscriptionContract subscription details. 10431type SubscriptionContract struct { 10432 autorest.Response `json:"-"` 10433 // SubscriptionContractProperties - Subscription contract properties. 10434 *SubscriptionContractProperties `json:"properties,omitempty"` 10435 // ID - READ-ONLY; Resource ID. 10436 ID *string `json:"id,omitempty"` 10437 // Name - READ-ONLY; Resource name. 10438 Name *string `json:"name,omitempty"` 10439 // Type - READ-ONLY; Resource type for API Management resource. 10440 Type *string `json:"type,omitempty"` 10441} 10442 10443// MarshalJSON is the custom marshaler for SubscriptionContract. 10444func (sc SubscriptionContract) MarshalJSON() ([]byte, error) { 10445 objectMap := make(map[string]interface{}) 10446 if sc.SubscriptionContractProperties != nil { 10447 objectMap["properties"] = sc.SubscriptionContractProperties 10448 } 10449 return json.Marshal(objectMap) 10450} 10451 10452// UnmarshalJSON is the custom unmarshaler for SubscriptionContract struct. 10453func (sc *SubscriptionContract) UnmarshalJSON(body []byte) error { 10454 var m map[string]*json.RawMessage 10455 err := json.Unmarshal(body, &m) 10456 if err != nil { 10457 return err 10458 } 10459 for k, v := range m { 10460 switch k { 10461 case "properties": 10462 if v != nil { 10463 var subscriptionContractProperties SubscriptionContractProperties 10464 err = json.Unmarshal(*v, &subscriptionContractProperties) 10465 if err != nil { 10466 return err 10467 } 10468 sc.SubscriptionContractProperties = &subscriptionContractProperties 10469 } 10470 case "id": 10471 if v != nil { 10472 var ID string 10473 err = json.Unmarshal(*v, &ID) 10474 if err != nil { 10475 return err 10476 } 10477 sc.ID = &ID 10478 } 10479 case "name": 10480 if v != nil { 10481 var name string 10482 err = json.Unmarshal(*v, &name) 10483 if err != nil { 10484 return err 10485 } 10486 sc.Name = &name 10487 } 10488 case "type": 10489 if v != nil { 10490 var typeVar string 10491 err = json.Unmarshal(*v, &typeVar) 10492 if err != nil { 10493 return err 10494 } 10495 sc.Type = &typeVar 10496 } 10497 } 10498 } 10499 10500 return nil 10501} 10502 10503// SubscriptionContractProperties subscription details. 10504type SubscriptionContractProperties struct { 10505 // 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. 10506 OwnerID *string `json:"ownerId,omitempty"` 10507 // Scope - Scope like /products/{productId} or /apis or /apis/{apiId}. 10508 Scope *string `json:"scope,omitempty"` 10509 // DisplayName - The name of the subscription, or null if the subscription has no name. 10510 DisplayName *string `json:"displayName,omitempty"` 10511 // 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' 10512 State SubscriptionState `json:"state,omitempty"` 10513 // 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. 10514 CreatedDate *date.Time `json:"createdDate,omitempty"` 10515 // 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. 10516 StartDate *date.Time `json:"startDate,omitempty"` 10517 // 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. 10518 ExpirationDate *date.Time `json:"expirationDate,omitempty"` 10519 // 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. 10520 EndDate *date.Time `json:"endDate,omitempty"` 10521 // 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. 10522 NotificationDate *date.Time `json:"notificationDate,omitempty"` 10523 // PrimaryKey - Subscription primary key. 10524 PrimaryKey *string `json:"primaryKey,omitempty"` 10525 // SecondaryKey - Subscription secondary key. 10526 SecondaryKey *string `json:"secondaryKey,omitempty"` 10527 // StateComment - Optional subscription comment added by an administrator. 10528 StateComment *string `json:"stateComment,omitempty"` 10529 // AllowTracing - Determines whether tracing is enabled 10530 AllowTracing *bool `json:"allowTracing,omitempty"` 10531} 10532 10533// SubscriptionCreateParameterProperties parameters supplied to the Create subscription operation. 10534type SubscriptionCreateParameterProperties struct { 10535 // OwnerID - User (user id path) for whom subscription is being created in form /users/{userId} 10536 OwnerID *string `json:"ownerId,omitempty"` 10537 // Scope - Scope like /products/{productId} or /apis or /apis/{apiId}. 10538 Scope *string `json:"scope,omitempty"` 10539 // DisplayName - Subscription name. 10540 DisplayName *string `json:"displayName,omitempty"` 10541 // PrimaryKey - Primary subscription key. If not specified during request key will be generated automatically. 10542 PrimaryKey *string `json:"primaryKey,omitempty"` 10543 // SecondaryKey - Secondary subscription key. If not specified during request key will be generated automatically. 10544 SecondaryKey *string `json:"secondaryKey,omitempty"` 10545 // 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' 10546 State SubscriptionState `json:"state,omitempty"` 10547 // AllowTracing - Determines whether tracing can be enabled 10548 AllowTracing *bool `json:"allowTracing,omitempty"` 10549} 10550 10551// SubscriptionCreateParameters subscription create details. 10552type SubscriptionCreateParameters struct { 10553 // SubscriptionCreateParameterProperties - Subscription contract properties. 10554 *SubscriptionCreateParameterProperties `json:"properties,omitempty"` 10555} 10556 10557// MarshalJSON is the custom marshaler for SubscriptionCreateParameters. 10558func (scp SubscriptionCreateParameters) MarshalJSON() ([]byte, error) { 10559 objectMap := make(map[string]interface{}) 10560 if scp.SubscriptionCreateParameterProperties != nil { 10561 objectMap["properties"] = scp.SubscriptionCreateParameterProperties 10562 } 10563 return json.Marshal(objectMap) 10564} 10565 10566// UnmarshalJSON is the custom unmarshaler for SubscriptionCreateParameters struct. 10567func (scp *SubscriptionCreateParameters) UnmarshalJSON(body []byte) error { 10568 var m map[string]*json.RawMessage 10569 err := json.Unmarshal(body, &m) 10570 if err != nil { 10571 return err 10572 } 10573 for k, v := range m { 10574 switch k { 10575 case "properties": 10576 if v != nil { 10577 var subscriptionCreateParameterProperties SubscriptionCreateParameterProperties 10578 err = json.Unmarshal(*v, &subscriptionCreateParameterProperties) 10579 if err != nil { 10580 return err 10581 } 10582 scp.SubscriptionCreateParameterProperties = &subscriptionCreateParameterProperties 10583 } 10584 } 10585 } 10586 10587 return nil 10588} 10589 10590// SubscriptionKeyParameterNamesContract subscription key parameter names details. 10591type SubscriptionKeyParameterNamesContract struct { 10592 // Header - Subscription key header name. 10593 Header *string `json:"header,omitempty"` 10594 // Query - Subscription key query string parameter name. 10595 Query *string `json:"query,omitempty"` 10596} 10597 10598// SubscriptionsDelegationSettingsProperties subscriptions delegation settings properties. 10599type SubscriptionsDelegationSettingsProperties struct { 10600 // Enabled - Enable or disable delegation for subscriptions. 10601 Enabled *bool `json:"enabled,omitempty"` 10602} 10603 10604// SubscriptionUpdateParameterProperties parameters supplied to the Update subscription operation. 10605type SubscriptionUpdateParameterProperties struct { 10606 // OwnerID - User identifier path: /users/{userId} 10607 OwnerID *string `json:"ownerId,omitempty"` 10608 // Scope - Scope like /products/{productId} or /apis or /apis/{apiId} 10609 Scope *string `json:"scope,omitempty"` 10610 // 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. 10611 ExpirationDate *date.Time `json:"expirationDate,omitempty"` 10612 // DisplayName - Subscription name. 10613 DisplayName *string `json:"displayName,omitempty"` 10614 // PrimaryKey - Primary subscription key. 10615 PrimaryKey *string `json:"primaryKey,omitempty"` 10616 // SecondaryKey - Secondary subscription key. 10617 SecondaryKey *string `json:"secondaryKey,omitempty"` 10618 // 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' 10619 State SubscriptionState `json:"state,omitempty"` 10620 // StateComment - Comments describing subscription state change by the administrator. 10621 StateComment *string `json:"stateComment,omitempty"` 10622 // AllowTracing - Determines whether tracing can be enabled 10623 AllowTracing *bool `json:"allowTracing,omitempty"` 10624} 10625 10626// SubscriptionUpdateParameters subscription update details. 10627type SubscriptionUpdateParameters struct { 10628 // SubscriptionUpdateParameterProperties - Subscription Update contract properties. 10629 *SubscriptionUpdateParameterProperties `json:"properties,omitempty"` 10630} 10631 10632// MarshalJSON is the custom marshaler for SubscriptionUpdateParameters. 10633func (sup SubscriptionUpdateParameters) MarshalJSON() ([]byte, error) { 10634 objectMap := make(map[string]interface{}) 10635 if sup.SubscriptionUpdateParameterProperties != nil { 10636 objectMap["properties"] = sup.SubscriptionUpdateParameterProperties 10637 } 10638 return json.Marshal(objectMap) 10639} 10640 10641// UnmarshalJSON is the custom unmarshaler for SubscriptionUpdateParameters struct. 10642func (sup *SubscriptionUpdateParameters) UnmarshalJSON(body []byte) error { 10643 var m map[string]*json.RawMessage 10644 err := json.Unmarshal(body, &m) 10645 if err != nil { 10646 return err 10647 } 10648 for k, v := range m { 10649 switch k { 10650 case "properties": 10651 if v != nil { 10652 var subscriptionUpdateParameterProperties SubscriptionUpdateParameterProperties 10653 err = json.Unmarshal(*v, &subscriptionUpdateParameterProperties) 10654 if err != nil { 10655 return err 10656 } 10657 sup.SubscriptionUpdateParameterProperties = &subscriptionUpdateParameterProperties 10658 } 10659 } 10660 } 10661 10662 return nil 10663} 10664 10665// TagCollection paged Tag list representation. 10666type TagCollection struct { 10667 autorest.Response `json:"-"` 10668 // Value - Page values. 10669 Value *[]TagContract `json:"value,omitempty"` 10670 // NextLink - Next page link if any. 10671 NextLink *string `json:"nextLink,omitempty"` 10672} 10673 10674// TagCollectionIterator provides access to a complete listing of TagContract values. 10675type TagCollectionIterator struct { 10676 i int 10677 page TagCollectionPage 10678} 10679 10680// NextWithContext advances to the next value. If there was an error making 10681// the request the iterator does not advance and the error is returned. 10682func (iter *TagCollectionIterator) NextWithContext(ctx context.Context) (err error) { 10683 if tracing.IsEnabled() { 10684 ctx = tracing.StartSpan(ctx, fqdn+"/TagCollectionIterator.NextWithContext") 10685 defer func() { 10686 sc := -1 10687 if iter.Response().Response.Response != nil { 10688 sc = iter.Response().Response.Response.StatusCode 10689 } 10690 tracing.EndSpan(ctx, sc, err) 10691 }() 10692 } 10693 iter.i++ 10694 if iter.i < len(iter.page.Values()) { 10695 return nil 10696 } 10697 err = iter.page.NextWithContext(ctx) 10698 if err != nil { 10699 iter.i-- 10700 return err 10701 } 10702 iter.i = 0 10703 return nil 10704} 10705 10706// Next advances to the next value. If there was an error making 10707// the request the iterator does not advance and the error is returned. 10708// Deprecated: Use NextWithContext() instead. 10709func (iter *TagCollectionIterator) Next() error { 10710 return iter.NextWithContext(context.Background()) 10711} 10712 10713// NotDone returns true if the enumeration should be started or is not yet complete. 10714func (iter TagCollectionIterator) NotDone() bool { 10715 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 10716} 10717 10718// Response returns the raw server response from the last page request. 10719func (iter TagCollectionIterator) Response() TagCollection { 10720 return iter.page.Response() 10721} 10722 10723// Value returns the current value or a zero-initialized value if the 10724// iterator has advanced beyond the end of the collection. 10725func (iter TagCollectionIterator) Value() TagContract { 10726 if !iter.page.NotDone() { 10727 return TagContract{} 10728 } 10729 return iter.page.Values()[iter.i] 10730} 10731 10732// Creates a new instance of the TagCollectionIterator type. 10733func NewTagCollectionIterator(page TagCollectionPage) TagCollectionIterator { 10734 return TagCollectionIterator{page: page} 10735} 10736 10737// IsEmpty returns true if the ListResult contains no values. 10738func (tc TagCollection) IsEmpty() bool { 10739 return tc.Value == nil || len(*tc.Value) == 0 10740} 10741 10742// tagCollectionPreparer prepares a request to retrieve the next set of results. 10743// It returns nil if no more results exist. 10744func (tc TagCollection) tagCollectionPreparer(ctx context.Context) (*http.Request, error) { 10745 if tc.NextLink == nil || len(to.String(tc.NextLink)) < 1 { 10746 return nil, nil 10747 } 10748 return autorest.Prepare((&http.Request{}).WithContext(ctx), 10749 autorest.AsJSON(), 10750 autorest.AsGet(), 10751 autorest.WithBaseURL(to.String(tc.NextLink))) 10752} 10753 10754// TagCollectionPage contains a page of TagContract values. 10755type TagCollectionPage struct { 10756 fn func(context.Context, TagCollection) (TagCollection, error) 10757 tc TagCollection 10758} 10759 10760// NextWithContext advances to the next page of values. If there was an error making 10761// the request the page does not advance and the error is returned. 10762func (page *TagCollectionPage) NextWithContext(ctx context.Context) (err error) { 10763 if tracing.IsEnabled() { 10764 ctx = tracing.StartSpan(ctx, fqdn+"/TagCollectionPage.NextWithContext") 10765 defer func() { 10766 sc := -1 10767 if page.Response().Response.Response != nil { 10768 sc = page.Response().Response.Response.StatusCode 10769 } 10770 tracing.EndSpan(ctx, sc, err) 10771 }() 10772 } 10773 next, err := page.fn(ctx, page.tc) 10774 if err != nil { 10775 return err 10776 } 10777 page.tc = next 10778 return nil 10779} 10780 10781// Next advances to the next page of values. If there was an error making 10782// the request the page does not advance and the error is returned. 10783// Deprecated: Use NextWithContext() instead. 10784func (page *TagCollectionPage) Next() error { 10785 return page.NextWithContext(context.Background()) 10786} 10787 10788// NotDone returns true if the page enumeration should be started or is not yet complete. 10789func (page TagCollectionPage) NotDone() bool { 10790 return !page.tc.IsEmpty() 10791} 10792 10793// Response returns the raw server response from the last page request. 10794func (page TagCollectionPage) Response() TagCollection { 10795 return page.tc 10796} 10797 10798// Values returns the slice of values for the current page or nil if there are no values. 10799func (page TagCollectionPage) Values() []TagContract { 10800 if page.tc.IsEmpty() { 10801 return nil 10802 } 10803 return *page.tc.Value 10804} 10805 10806// Creates a new instance of the TagCollectionPage type. 10807func NewTagCollectionPage(getNextPage func(context.Context, TagCollection) (TagCollection, error)) TagCollectionPage { 10808 return TagCollectionPage{fn: getNextPage} 10809} 10810 10811// TagContract tag Contract details. 10812type TagContract struct { 10813 autorest.Response `json:"-"` 10814 // TagContractProperties - Tag entity contract properties. 10815 *TagContractProperties `json:"properties,omitempty"` 10816 // ID - READ-ONLY; Resource ID. 10817 ID *string `json:"id,omitempty"` 10818 // Name - READ-ONLY; Resource name. 10819 Name *string `json:"name,omitempty"` 10820 // Type - READ-ONLY; Resource type for API Management resource. 10821 Type *string `json:"type,omitempty"` 10822} 10823 10824// MarshalJSON is the custom marshaler for TagContract. 10825func (tc TagContract) MarshalJSON() ([]byte, error) { 10826 objectMap := make(map[string]interface{}) 10827 if tc.TagContractProperties != nil { 10828 objectMap["properties"] = tc.TagContractProperties 10829 } 10830 return json.Marshal(objectMap) 10831} 10832 10833// UnmarshalJSON is the custom unmarshaler for TagContract struct. 10834func (tc *TagContract) UnmarshalJSON(body []byte) error { 10835 var m map[string]*json.RawMessage 10836 err := json.Unmarshal(body, &m) 10837 if err != nil { 10838 return err 10839 } 10840 for k, v := range m { 10841 switch k { 10842 case "properties": 10843 if v != nil { 10844 var tagContractProperties TagContractProperties 10845 err = json.Unmarshal(*v, &tagContractProperties) 10846 if err != nil { 10847 return err 10848 } 10849 tc.TagContractProperties = &tagContractProperties 10850 } 10851 case "id": 10852 if v != nil { 10853 var ID string 10854 err = json.Unmarshal(*v, &ID) 10855 if err != nil { 10856 return err 10857 } 10858 tc.ID = &ID 10859 } 10860 case "name": 10861 if v != nil { 10862 var name string 10863 err = json.Unmarshal(*v, &name) 10864 if err != nil { 10865 return err 10866 } 10867 tc.Name = &name 10868 } 10869 case "type": 10870 if v != nil { 10871 var typeVar string 10872 err = json.Unmarshal(*v, &typeVar) 10873 if err != nil { 10874 return err 10875 } 10876 tc.Type = &typeVar 10877 } 10878 } 10879 } 10880 10881 return nil 10882} 10883 10884// TagContractProperties tag contract Properties. 10885type TagContractProperties struct { 10886 // DisplayName - Tag name. 10887 DisplayName *string `json:"displayName,omitempty"` 10888} 10889 10890// TagCreateUpdateParameters parameters supplied to Create/Update Tag operations. 10891type TagCreateUpdateParameters struct { 10892 // TagContractProperties - Properties supplied to Create Tag operation. 10893 *TagContractProperties `json:"properties,omitempty"` 10894} 10895 10896// MarshalJSON is the custom marshaler for TagCreateUpdateParameters. 10897func (tcup TagCreateUpdateParameters) MarshalJSON() ([]byte, error) { 10898 objectMap := make(map[string]interface{}) 10899 if tcup.TagContractProperties != nil { 10900 objectMap["properties"] = tcup.TagContractProperties 10901 } 10902 return json.Marshal(objectMap) 10903} 10904 10905// UnmarshalJSON is the custom unmarshaler for TagCreateUpdateParameters struct. 10906func (tcup *TagCreateUpdateParameters) UnmarshalJSON(body []byte) error { 10907 var m map[string]*json.RawMessage 10908 err := json.Unmarshal(body, &m) 10909 if err != nil { 10910 return err 10911 } 10912 for k, v := range m { 10913 switch k { 10914 case "properties": 10915 if v != nil { 10916 var tagContractProperties TagContractProperties 10917 err = json.Unmarshal(*v, &tagContractProperties) 10918 if err != nil { 10919 return err 10920 } 10921 tcup.TagContractProperties = &tagContractProperties 10922 } 10923 } 10924 } 10925 10926 return nil 10927} 10928 10929// TagDescriptionBaseProperties parameters supplied to the Create TagDescription operation. 10930type TagDescriptionBaseProperties struct { 10931 // Description - Description of the Tag. 10932 Description *string `json:"description,omitempty"` 10933 // ExternalDocsURL - Absolute URL of external resources describing the tag. 10934 ExternalDocsURL *string `json:"externalDocsUrl,omitempty"` 10935 // ExternalDocsDescription - Description of the external resources describing the tag. 10936 ExternalDocsDescription *string `json:"externalDocsDescription,omitempty"` 10937} 10938 10939// TagDescriptionCollection paged TagDescription list representation. 10940type TagDescriptionCollection struct { 10941 autorest.Response `json:"-"` 10942 // Value - Page values. 10943 Value *[]TagDescriptionContract `json:"value,omitempty"` 10944 // NextLink - Next page link if any. 10945 NextLink *string `json:"nextLink,omitempty"` 10946} 10947 10948// TagDescriptionCollectionIterator provides access to a complete listing of TagDescriptionContract values. 10949type TagDescriptionCollectionIterator struct { 10950 i int 10951 page TagDescriptionCollectionPage 10952} 10953 10954// NextWithContext advances to the next value. If there was an error making 10955// the request the iterator does not advance and the error is returned. 10956func (iter *TagDescriptionCollectionIterator) NextWithContext(ctx context.Context) (err error) { 10957 if tracing.IsEnabled() { 10958 ctx = tracing.StartSpan(ctx, fqdn+"/TagDescriptionCollectionIterator.NextWithContext") 10959 defer func() { 10960 sc := -1 10961 if iter.Response().Response.Response != nil { 10962 sc = iter.Response().Response.Response.StatusCode 10963 } 10964 tracing.EndSpan(ctx, sc, err) 10965 }() 10966 } 10967 iter.i++ 10968 if iter.i < len(iter.page.Values()) { 10969 return nil 10970 } 10971 err = iter.page.NextWithContext(ctx) 10972 if err != nil { 10973 iter.i-- 10974 return err 10975 } 10976 iter.i = 0 10977 return nil 10978} 10979 10980// Next advances to the next value. If there was an error making 10981// the request the iterator does not advance and the error is returned. 10982// Deprecated: Use NextWithContext() instead. 10983func (iter *TagDescriptionCollectionIterator) Next() error { 10984 return iter.NextWithContext(context.Background()) 10985} 10986 10987// NotDone returns true if the enumeration should be started or is not yet complete. 10988func (iter TagDescriptionCollectionIterator) NotDone() bool { 10989 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 10990} 10991 10992// Response returns the raw server response from the last page request. 10993func (iter TagDescriptionCollectionIterator) Response() TagDescriptionCollection { 10994 return iter.page.Response() 10995} 10996 10997// Value returns the current value or a zero-initialized value if the 10998// iterator has advanced beyond the end of the collection. 10999func (iter TagDescriptionCollectionIterator) Value() TagDescriptionContract { 11000 if !iter.page.NotDone() { 11001 return TagDescriptionContract{} 11002 } 11003 return iter.page.Values()[iter.i] 11004} 11005 11006// Creates a new instance of the TagDescriptionCollectionIterator type. 11007func NewTagDescriptionCollectionIterator(page TagDescriptionCollectionPage) TagDescriptionCollectionIterator { 11008 return TagDescriptionCollectionIterator{page: page} 11009} 11010 11011// IsEmpty returns true if the ListResult contains no values. 11012func (tdc TagDescriptionCollection) IsEmpty() bool { 11013 return tdc.Value == nil || len(*tdc.Value) == 0 11014} 11015 11016// tagDescriptionCollectionPreparer prepares a request to retrieve the next set of results. 11017// It returns nil if no more results exist. 11018func (tdc TagDescriptionCollection) tagDescriptionCollectionPreparer(ctx context.Context) (*http.Request, error) { 11019 if tdc.NextLink == nil || len(to.String(tdc.NextLink)) < 1 { 11020 return nil, nil 11021 } 11022 return autorest.Prepare((&http.Request{}).WithContext(ctx), 11023 autorest.AsJSON(), 11024 autorest.AsGet(), 11025 autorest.WithBaseURL(to.String(tdc.NextLink))) 11026} 11027 11028// TagDescriptionCollectionPage contains a page of TagDescriptionContract values. 11029type TagDescriptionCollectionPage struct { 11030 fn func(context.Context, TagDescriptionCollection) (TagDescriptionCollection, error) 11031 tdc TagDescriptionCollection 11032} 11033 11034// NextWithContext advances to the next page of values. If there was an error making 11035// the request the page does not advance and the error is returned. 11036func (page *TagDescriptionCollectionPage) NextWithContext(ctx context.Context) (err error) { 11037 if tracing.IsEnabled() { 11038 ctx = tracing.StartSpan(ctx, fqdn+"/TagDescriptionCollectionPage.NextWithContext") 11039 defer func() { 11040 sc := -1 11041 if page.Response().Response.Response != nil { 11042 sc = page.Response().Response.Response.StatusCode 11043 } 11044 tracing.EndSpan(ctx, sc, err) 11045 }() 11046 } 11047 next, err := page.fn(ctx, page.tdc) 11048 if err != nil { 11049 return err 11050 } 11051 page.tdc = next 11052 return nil 11053} 11054 11055// Next advances to the next page of values. If there was an error making 11056// the request the page does not advance and the error is returned. 11057// Deprecated: Use NextWithContext() instead. 11058func (page *TagDescriptionCollectionPage) Next() error { 11059 return page.NextWithContext(context.Background()) 11060} 11061 11062// NotDone returns true if the page enumeration should be started or is not yet complete. 11063func (page TagDescriptionCollectionPage) NotDone() bool { 11064 return !page.tdc.IsEmpty() 11065} 11066 11067// Response returns the raw server response from the last page request. 11068func (page TagDescriptionCollectionPage) Response() TagDescriptionCollection { 11069 return page.tdc 11070} 11071 11072// Values returns the slice of values for the current page or nil if there are no values. 11073func (page TagDescriptionCollectionPage) Values() []TagDescriptionContract { 11074 if page.tdc.IsEmpty() { 11075 return nil 11076 } 11077 return *page.tdc.Value 11078} 11079 11080// Creates a new instance of the TagDescriptionCollectionPage type. 11081func NewTagDescriptionCollectionPage(getNextPage func(context.Context, TagDescriptionCollection) (TagDescriptionCollection, error)) TagDescriptionCollectionPage { 11082 return TagDescriptionCollectionPage{fn: getNextPage} 11083} 11084 11085// TagDescriptionContract contract details. 11086type TagDescriptionContract struct { 11087 autorest.Response `json:"-"` 11088 // TagDescriptionContractProperties - TagDescription entity contract properties. 11089 *TagDescriptionContractProperties `json:"properties,omitempty"` 11090 // ID - READ-ONLY; Resource ID. 11091 ID *string `json:"id,omitempty"` 11092 // Name - READ-ONLY; Resource name. 11093 Name *string `json:"name,omitempty"` 11094 // Type - READ-ONLY; Resource type for API Management resource. 11095 Type *string `json:"type,omitempty"` 11096} 11097 11098// MarshalJSON is the custom marshaler for TagDescriptionContract. 11099func (tdc TagDescriptionContract) MarshalJSON() ([]byte, error) { 11100 objectMap := make(map[string]interface{}) 11101 if tdc.TagDescriptionContractProperties != nil { 11102 objectMap["properties"] = tdc.TagDescriptionContractProperties 11103 } 11104 return json.Marshal(objectMap) 11105} 11106 11107// UnmarshalJSON is the custom unmarshaler for TagDescriptionContract struct. 11108func (tdc *TagDescriptionContract) UnmarshalJSON(body []byte) error { 11109 var m map[string]*json.RawMessage 11110 err := json.Unmarshal(body, &m) 11111 if err != nil { 11112 return err 11113 } 11114 for k, v := range m { 11115 switch k { 11116 case "properties": 11117 if v != nil { 11118 var tagDescriptionContractProperties TagDescriptionContractProperties 11119 err = json.Unmarshal(*v, &tagDescriptionContractProperties) 11120 if err != nil { 11121 return err 11122 } 11123 tdc.TagDescriptionContractProperties = &tagDescriptionContractProperties 11124 } 11125 case "id": 11126 if v != nil { 11127 var ID string 11128 err = json.Unmarshal(*v, &ID) 11129 if err != nil { 11130 return err 11131 } 11132 tdc.ID = &ID 11133 } 11134 case "name": 11135 if v != nil { 11136 var name string 11137 err = json.Unmarshal(*v, &name) 11138 if err != nil { 11139 return err 11140 } 11141 tdc.Name = &name 11142 } 11143 case "type": 11144 if v != nil { 11145 var typeVar string 11146 err = json.Unmarshal(*v, &typeVar) 11147 if err != nil { 11148 return err 11149 } 11150 tdc.Type = &typeVar 11151 } 11152 } 11153 } 11154 11155 return nil 11156} 11157 11158// TagDescriptionContractProperties tagDescription contract Properties. 11159type TagDescriptionContractProperties struct { 11160 // DisplayName - Tag name. 11161 DisplayName *string `json:"displayName,omitempty"` 11162 // Description - Description of the Tag. 11163 Description *string `json:"description,omitempty"` 11164 // ExternalDocsURL - Absolute URL of external resources describing the tag. 11165 ExternalDocsURL *string `json:"externalDocsUrl,omitempty"` 11166 // ExternalDocsDescription - Description of the external resources describing the tag. 11167 ExternalDocsDescription *string `json:"externalDocsDescription,omitempty"` 11168} 11169 11170// TagDescriptionCreateParameters parameters supplied to the Create TagDescription operation. 11171type TagDescriptionCreateParameters struct { 11172 // TagDescriptionBaseProperties - Properties supplied to Create TagDescription operation. 11173 *TagDescriptionBaseProperties `json:"properties,omitempty"` 11174} 11175 11176// MarshalJSON is the custom marshaler for TagDescriptionCreateParameters. 11177func (tdcp TagDescriptionCreateParameters) MarshalJSON() ([]byte, error) { 11178 objectMap := make(map[string]interface{}) 11179 if tdcp.TagDescriptionBaseProperties != nil { 11180 objectMap["properties"] = tdcp.TagDescriptionBaseProperties 11181 } 11182 return json.Marshal(objectMap) 11183} 11184 11185// UnmarshalJSON is the custom unmarshaler for TagDescriptionCreateParameters struct. 11186func (tdcp *TagDescriptionCreateParameters) UnmarshalJSON(body []byte) error { 11187 var m map[string]*json.RawMessage 11188 err := json.Unmarshal(body, &m) 11189 if err != nil { 11190 return err 11191 } 11192 for k, v := range m { 11193 switch k { 11194 case "properties": 11195 if v != nil { 11196 var tagDescriptionBaseProperties TagDescriptionBaseProperties 11197 err = json.Unmarshal(*v, &tagDescriptionBaseProperties) 11198 if err != nil { 11199 return err 11200 } 11201 tdcp.TagDescriptionBaseProperties = &tagDescriptionBaseProperties 11202 } 11203 } 11204 } 11205 11206 return nil 11207} 11208 11209// TagResourceCollection paged Tag list representation. 11210type TagResourceCollection struct { 11211 autorest.Response `json:"-"` 11212 // Value - Page values. 11213 Value *[]TagResourceContract `json:"value,omitempty"` 11214 // NextLink - Next page link if any. 11215 NextLink *string `json:"nextLink,omitempty"` 11216} 11217 11218// TagResourceCollectionIterator provides access to a complete listing of TagResourceContract values. 11219type TagResourceCollectionIterator struct { 11220 i int 11221 page TagResourceCollectionPage 11222} 11223 11224// NextWithContext advances to the next value. If there was an error making 11225// the request the iterator does not advance and the error is returned. 11226func (iter *TagResourceCollectionIterator) NextWithContext(ctx context.Context) (err error) { 11227 if tracing.IsEnabled() { 11228 ctx = tracing.StartSpan(ctx, fqdn+"/TagResourceCollectionIterator.NextWithContext") 11229 defer func() { 11230 sc := -1 11231 if iter.Response().Response.Response != nil { 11232 sc = iter.Response().Response.Response.StatusCode 11233 } 11234 tracing.EndSpan(ctx, sc, err) 11235 }() 11236 } 11237 iter.i++ 11238 if iter.i < len(iter.page.Values()) { 11239 return nil 11240 } 11241 err = iter.page.NextWithContext(ctx) 11242 if err != nil { 11243 iter.i-- 11244 return err 11245 } 11246 iter.i = 0 11247 return nil 11248} 11249 11250// Next advances to the next value. If there was an error making 11251// the request the iterator does not advance and the error is returned. 11252// Deprecated: Use NextWithContext() instead. 11253func (iter *TagResourceCollectionIterator) Next() error { 11254 return iter.NextWithContext(context.Background()) 11255} 11256 11257// NotDone returns true if the enumeration should be started or is not yet complete. 11258func (iter TagResourceCollectionIterator) NotDone() bool { 11259 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 11260} 11261 11262// Response returns the raw server response from the last page request. 11263func (iter TagResourceCollectionIterator) Response() TagResourceCollection { 11264 return iter.page.Response() 11265} 11266 11267// Value returns the current value or a zero-initialized value if the 11268// iterator has advanced beyond the end of the collection. 11269func (iter TagResourceCollectionIterator) Value() TagResourceContract { 11270 if !iter.page.NotDone() { 11271 return TagResourceContract{} 11272 } 11273 return iter.page.Values()[iter.i] 11274} 11275 11276// Creates a new instance of the TagResourceCollectionIterator type. 11277func NewTagResourceCollectionIterator(page TagResourceCollectionPage) TagResourceCollectionIterator { 11278 return TagResourceCollectionIterator{page: page} 11279} 11280 11281// IsEmpty returns true if the ListResult contains no values. 11282func (trc TagResourceCollection) IsEmpty() bool { 11283 return trc.Value == nil || len(*trc.Value) == 0 11284} 11285 11286// tagResourceCollectionPreparer prepares a request to retrieve the next set of results. 11287// It returns nil if no more results exist. 11288func (trc TagResourceCollection) tagResourceCollectionPreparer(ctx context.Context) (*http.Request, error) { 11289 if trc.NextLink == nil || len(to.String(trc.NextLink)) < 1 { 11290 return nil, nil 11291 } 11292 return autorest.Prepare((&http.Request{}).WithContext(ctx), 11293 autorest.AsJSON(), 11294 autorest.AsGet(), 11295 autorest.WithBaseURL(to.String(trc.NextLink))) 11296} 11297 11298// TagResourceCollectionPage contains a page of TagResourceContract values. 11299type TagResourceCollectionPage struct { 11300 fn func(context.Context, TagResourceCollection) (TagResourceCollection, error) 11301 trc TagResourceCollection 11302} 11303 11304// NextWithContext advances to the next page of values. If there was an error making 11305// the request the page does not advance and the error is returned. 11306func (page *TagResourceCollectionPage) NextWithContext(ctx context.Context) (err error) { 11307 if tracing.IsEnabled() { 11308 ctx = tracing.StartSpan(ctx, fqdn+"/TagResourceCollectionPage.NextWithContext") 11309 defer func() { 11310 sc := -1 11311 if page.Response().Response.Response != nil { 11312 sc = page.Response().Response.Response.StatusCode 11313 } 11314 tracing.EndSpan(ctx, sc, err) 11315 }() 11316 } 11317 next, err := page.fn(ctx, page.trc) 11318 if err != nil { 11319 return err 11320 } 11321 page.trc = next 11322 return nil 11323} 11324 11325// Next advances to the next page of values. If there was an error making 11326// the request the page does not advance and the error is returned. 11327// Deprecated: Use NextWithContext() instead. 11328func (page *TagResourceCollectionPage) Next() error { 11329 return page.NextWithContext(context.Background()) 11330} 11331 11332// NotDone returns true if the page enumeration should be started or is not yet complete. 11333func (page TagResourceCollectionPage) NotDone() bool { 11334 return !page.trc.IsEmpty() 11335} 11336 11337// Response returns the raw server response from the last page request. 11338func (page TagResourceCollectionPage) Response() TagResourceCollection { 11339 return page.trc 11340} 11341 11342// Values returns the slice of values for the current page or nil if there are no values. 11343func (page TagResourceCollectionPage) Values() []TagResourceContract { 11344 if page.trc.IsEmpty() { 11345 return nil 11346 } 11347 return *page.trc.Value 11348} 11349 11350// Creates a new instance of the TagResourceCollectionPage type. 11351func NewTagResourceCollectionPage(getNextPage func(context.Context, TagResourceCollection) (TagResourceCollection, error)) TagResourceCollectionPage { 11352 return TagResourceCollectionPage{fn: getNextPage} 11353} 11354 11355// TagResourceContract tagResource contract properties. 11356type TagResourceContract struct { 11357 // Tag - Tag associated with the resource. 11358 Tag *TagTagResourceContractProperties `json:"tag,omitempty"` 11359 // API - Api associated with the tag. 11360 API *APITagResourceContractProperties `json:"api,omitempty"` 11361 // Operation - Operation associated with the tag. 11362 Operation *OperationTagResourceContractProperties `json:"operation,omitempty"` 11363 // Product - Product associated with the tag. 11364 Product *ProductTagResourceContractProperties `json:"product,omitempty"` 11365} 11366 11367// TagTagResourceContractProperties contract defining the Tag property in the Tag Resource Contract 11368type TagTagResourceContractProperties struct { 11369 // ID - Tag identifier 11370 ID *string `json:"id,omitempty"` 11371 // Name - Tag Name 11372 Name *string `json:"name,omitempty"` 11373} 11374 11375// TenantConfigurationDeployFuture an abstraction for monitoring and retrieving the results of a 11376// long-running operation. 11377type TenantConfigurationDeployFuture struct { 11378 azure.Future 11379} 11380 11381// Result returns the result of the asynchronous operation. 11382// If the operation has not completed it will return an error. 11383func (future *TenantConfigurationDeployFuture) Result(client TenantConfigurationClient) (orc OperationResultContract, err error) { 11384 var done bool 11385 done, err = future.DoneWithContext(context.Background(), client) 11386 if err != nil { 11387 err = autorest.NewErrorWithError(err, "apimanagement.TenantConfigurationDeployFuture", "Result", future.Response(), "Polling failure") 11388 return 11389 } 11390 if !done { 11391 err = azure.NewAsyncOpIncompleteError("apimanagement.TenantConfigurationDeployFuture") 11392 return 11393 } 11394 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 11395 if orc.Response.Response, err = future.GetResult(sender); err == nil && orc.Response.Response.StatusCode != http.StatusNoContent { 11396 orc, err = client.DeployResponder(orc.Response.Response) 11397 if err != nil { 11398 err = autorest.NewErrorWithError(err, "apimanagement.TenantConfigurationDeployFuture", "Result", orc.Response.Response, "Failure responding to request") 11399 } 11400 } 11401 return 11402} 11403 11404// TenantConfigurationSaveFuture an abstraction for monitoring and retrieving the results of a long-running 11405// operation. 11406type TenantConfigurationSaveFuture struct { 11407 azure.Future 11408} 11409 11410// Result returns the result of the asynchronous operation. 11411// If the operation has not completed it will return an error. 11412func (future *TenantConfigurationSaveFuture) Result(client TenantConfigurationClient) (orc OperationResultContract, err error) { 11413 var done bool 11414 done, err = future.DoneWithContext(context.Background(), client) 11415 if err != nil { 11416 err = autorest.NewErrorWithError(err, "apimanagement.TenantConfigurationSaveFuture", "Result", future.Response(), "Polling failure") 11417 return 11418 } 11419 if !done { 11420 err = azure.NewAsyncOpIncompleteError("apimanagement.TenantConfigurationSaveFuture") 11421 return 11422 } 11423 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 11424 if orc.Response.Response, err = future.GetResult(sender); err == nil && orc.Response.Response.StatusCode != http.StatusNoContent { 11425 orc, err = client.SaveResponder(orc.Response.Response) 11426 if err != nil { 11427 err = autorest.NewErrorWithError(err, "apimanagement.TenantConfigurationSaveFuture", "Result", orc.Response.Response, "Failure responding to request") 11428 } 11429 } 11430 return 11431} 11432 11433// TenantConfigurationSyncStateContract tenant Configuration Synchronization State. 11434type TenantConfigurationSyncStateContract struct { 11435 autorest.Response `json:"-"` 11436 // Branch - The name of Git branch. 11437 Branch *string `json:"branch,omitempty"` 11438 // CommitID - The latest commit Id. 11439 CommitID *string `json:"commitId,omitempty"` 11440 // IsExport - value indicating if last sync was save (true) or deploy (false) operation. 11441 IsExport *bool `json:"isExport,omitempty"` 11442 // IsSynced - value indicating if last synchronization was later than the configuration change. 11443 IsSynced *bool `json:"isSynced,omitempty"` 11444 // IsGitEnabled - value indicating whether Git configuration access is enabled. 11445 IsGitEnabled *bool `json:"isGitEnabled,omitempty"` 11446 // 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. 11447 SyncDate *date.Time `json:"syncDate,omitempty"` 11448 // 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. 11449 ConfigurationChangeDate *date.Time `json:"configurationChangeDate,omitempty"` 11450} 11451 11452// TenantConfigurationValidateFuture an abstraction for monitoring and retrieving the results of a 11453// long-running operation. 11454type TenantConfigurationValidateFuture struct { 11455 azure.Future 11456} 11457 11458// Result returns the result of the asynchronous operation. 11459// If the operation has not completed it will return an error. 11460func (future *TenantConfigurationValidateFuture) Result(client TenantConfigurationClient) (orc OperationResultContract, err error) { 11461 var done bool 11462 done, err = future.DoneWithContext(context.Background(), client) 11463 if err != nil { 11464 err = autorest.NewErrorWithError(err, "apimanagement.TenantConfigurationValidateFuture", "Result", future.Response(), "Polling failure") 11465 return 11466 } 11467 if !done { 11468 err = azure.NewAsyncOpIncompleteError("apimanagement.TenantConfigurationValidateFuture") 11469 return 11470 } 11471 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 11472 if orc.Response.Response, err = future.GetResult(sender); err == nil && orc.Response.Response.StatusCode != http.StatusNoContent { 11473 orc, err = client.ValidateResponder(orc.Response.Response) 11474 if err != nil { 11475 err = autorest.NewErrorWithError(err, "apimanagement.TenantConfigurationValidateFuture", "Result", orc.Response.Response, "Failure responding to request") 11476 } 11477 } 11478 return 11479} 11480 11481// TermsOfServiceProperties terms of service contract properties. 11482type TermsOfServiceProperties struct { 11483 // Text - A terms of service text. 11484 Text *string `json:"text,omitempty"` 11485 // Enabled - Display terms of service during a sign-up process. 11486 Enabled *bool `json:"enabled,omitempty"` 11487 // ConsentRequired - Ask user for consent to the terms of service. 11488 ConsentRequired *bool `json:"consentRequired,omitempty"` 11489} 11490 11491// TokenBodyParameterContract oAuth acquire token request body parameter (www-url-form-encoded). 11492type TokenBodyParameterContract struct { 11493 // Name - body parameter name. 11494 Name *string `json:"name,omitempty"` 11495 // Value - body parameter value. 11496 Value *string `json:"value,omitempty"` 11497} 11498 11499// UserCollection paged Users list representation. 11500type UserCollection struct { 11501 autorest.Response `json:"-"` 11502 // Value - Page values. 11503 Value *[]UserContract `json:"value,omitempty"` 11504 // NextLink - Next page link if any. 11505 NextLink *string `json:"nextLink,omitempty"` 11506} 11507 11508// UserCollectionIterator provides access to a complete listing of UserContract values. 11509type UserCollectionIterator struct { 11510 i int 11511 page UserCollectionPage 11512} 11513 11514// NextWithContext advances to the next value. If there was an error making 11515// the request the iterator does not advance and the error is returned. 11516func (iter *UserCollectionIterator) NextWithContext(ctx context.Context) (err error) { 11517 if tracing.IsEnabled() { 11518 ctx = tracing.StartSpan(ctx, fqdn+"/UserCollectionIterator.NextWithContext") 11519 defer func() { 11520 sc := -1 11521 if iter.Response().Response.Response != nil { 11522 sc = iter.Response().Response.Response.StatusCode 11523 } 11524 tracing.EndSpan(ctx, sc, err) 11525 }() 11526 } 11527 iter.i++ 11528 if iter.i < len(iter.page.Values()) { 11529 return nil 11530 } 11531 err = iter.page.NextWithContext(ctx) 11532 if err != nil { 11533 iter.i-- 11534 return err 11535 } 11536 iter.i = 0 11537 return nil 11538} 11539 11540// Next advances to the next value. If there was an error making 11541// the request the iterator does not advance and the error is returned. 11542// Deprecated: Use NextWithContext() instead. 11543func (iter *UserCollectionIterator) Next() error { 11544 return iter.NextWithContext(context.Background()) 11545} 11546 11547// NotDone returns true if the enumeration should be started or is not yet complete. 11548func (iter UserCollectionIterator) NotDone() bool { 11549 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 11550} 11551 11552// Response returns the raw server response from the last page request. 11553func (iter UserCollectionIterator) Response() UserCollection { 11554 return iter.page.Response() 11555} 11556 11557// Value returns the current value or a zero-initialized value if the 11558// iterator has advanced beyond the end of the collection. 11559func (iter UserCollectionIterator) Value() UserContract { 11560 if !iter.page.NotDone() { 11561 return UserContract{} 11562 } 11563 return iter.page.Values()[iter.i] 11564} 11565 11566// Creates a new instance of the UserCollectionIterator type. 11567func NewUserCollectionIterator(page UserCollectionPage) UserCollectionIterator { 11568 return UserCollectionIterator{page: page} 11569} 11570 11571// IsEmpty returns true if the ListResult contains no values. 11572func (uc UserCollection) IsEmpty() bool { 11573 return uc.Value == nil || len(*uc.Value) == 0 11574} 11575 11576// userCollectionPreparer prepares a request to retrieve the next set of results. 11577// It returns nil if no more results exist. 11578func (uc UserCollection) userCollectionPreparer(ctx context.Context) (*http.Request, error) { 11579 if uc.NextLink == nil || len(to.String(uc.NextLink)) < 1 { 11580 return nil, nil 11581 } 11582 return autorest.Prepare((&http.Request{}).WithContext(ctx), 11583 autorest.AsJSON(), 11584 autorest.AsGet(), 11585 autorest.WithBaseURL(to.String(uc.NextLink))) 11586} 11587 11588// UserCollectionPage contains a page of UserContract values. 11589type UserCollectionPage struct { 11590 fn func(context.Context, UserCollection) (UserCollection, error) 11591 uc UserCollection 11592} 11593 11594// NextWithContext advances to the next page of values. If there was an error making 11595// the request the page does not advance and the error is returned. 11596func (page *UserCollectionPage) NextWithContext(ctx context.Context) (err error) { 11597 if tracing.IsEnabled() { 11598 ctx = tracing.StartSpan(ctx, fqdn+"/UserCollectionPage.NextWithContext") 11599 defer func() { 11600 sc := -1 11601 if page.Response().Response.Response != nil { 11602 sc = page.Response().Response.Response.StatusCode 11603 } 11604 tracing.EndSpan(ctx, sc, err) 11605 }() 11606 } 11607 next, err := page.fn(ctx, page.uc) 11608 if err != nil { 11609 return err 11610 } 11611 page.uc = next 11612 return nil 11613} 11614 11615// Next advances to the next page of values. If there was an error making 11616// the request the page does not advance and the error is returned. 11617// Deprecated: Use NextWithContext() instead. 11618func (page *UserCollectionPage) Next() error { 11619 return page.NextWithContext(context.Background()) 11620} 11621 11622// NotDone returns true if the page enumeration should be started or is not yet complete. 11623func (page UserCollectionPage) NotDone() bool { 11624 return !page.uc.IsEmpty() 11625} 11626 11627// Response returns the raw server response from the last page request. 11628func (page UserCollectionPage) Response() UserCollection { 11629 return page.uc 11630} 11631 11632// Values returns the slice of values for the current page or nil if there are no values. 11633func (page UserCollectionPage) Values() []UserContract { 11634 if page.uc.IsEmpty() { 11635 return nil 11636 } 11637 return *page.uc.Value 11638} 11639 11640// Creates a new instance of the UserCollectionPage type. 11641func NewUserCollectionPage(getNextPage func(context.Context, UserCollection) (UserCollection, error)) UserCollectionPage { 11642 return UserCollectionPage{fn: getNextPage} 11643} 11644 11645// UserContract user details. 11646type UserContract struct { 11647 autorest.Response `json:"-"` 11648 // UserContractProperties - User entity contract properties. 11649 *UserContractProperties `json:"properties,omitempty"` 11650 // ID - READ-ONLY; Resource ID. 11651 ID *string `json:"id,omitempty"` 11652 // Name - READ-ONLY; Resource name. 11653 Name *string `json:"name,omitempty"` 11654 // Type - READ-ONLY; Resource type for API Management resource. 11655 Type *string `json:"type,omitempty"` 11656} 11657 11658// MarshalJSON is the custom marshaler for UserContract. 11659func (uc UserContract) MarshalJSON() ([]byte, error) { 11660 objectMap := make(map[string]interface{}) 11661 if uc.UserContractProperties != nil { 11662 objectMap["properties"] = uc.UserContractProperties 11663 } 11664 return json.Marshal(objectMap) 11665} 11666 11667// UnmarshalJSON is the custom unmarshaler for UserContract struct. 11668func (uc *UserContract) UnmarshalJSON(body []byte) error { 11669 var m map[string]*json.RawMessage 11670 err := json.Unmarshal(body, &m) 11671 if err != nil { 11672 return err 11673 } 11674 for k, v := range m { 11675 switch k { 11676 case "properties": 11677 if v != nil { 11678 var userContractProperties UserContractProperties 11679 err = json.Unmarshal(*v, &userContractProperties) 11680 if err != nil { 11681 return err 11682 } 11683 uc.UserContractProperties = &userContractProperties 11684 } 11685 case "id": 11686 if v != nil { 11687 var ID string 11688 err = json.Unmarshal(*v, &ID) 11689 if err != nil { 11690 return err 11691 } 11692 uc.ID = &ID 11693 } 11694 case "name": 11695 if v != nil { 11696 var name string 11697 err = json.Unmarshal(*v, &name) 11698 if err != nil { 11699 return err 11700 } 11701 uc.Name = &name 11702 } 11703 case "type": 11704 if v != nil { 11705 var typeVar string 11706 err = json.Unmarshal(*v, &typeVar) 11707 if err != nil { 11708 return err 11709 } 11710 uc.Type = &typeVar 11711 } 11712 } 11713 } 11714 11715 return nil 11716} 11717 11718// UserContractProperties user profile. 11719type UserContractProperties struct { 11720 // FirstName - First name. 11721 FirstName *string `json:"firstName,omitempty"` 11722 // LastName - Last name. 11723 LastName *string `json:"lastName,omitempty"` 11724 // Email - Email address. 11725 Email *string `json:"email,omitempty"` 11726 // RegistrationDate - Date of user registration. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. 11727 RegistrationDate *date.Time `json:"registrationDate,omitempty"` 11728 // Groups - READ-ONLY; Collection of groups user is part of. 11729 Groups *[]GroupContractProperties `json:"groups,omitempty"` 11730 // 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' 11731 State UserState `json:"state,omitempty"` 11732 // Note - Optional note about a user set by the administrator. 11733 Note *string `json:"note,omitempty"` 11734 // Identities - Collection of user identities. 11735 Identities *[]UserIdentityContract `json:"identities,omitempty"` 11736} 11737 11738// UserCreateParameterProperties parameters supplied to the Create User operation. 11739type UserCreateParameterProperties struct { 11740 // Email - Email address. Must not be empty and must be unique within the service instance. 11741 Email *string `json:"email,omitempty"` 11742 // FirstName - First name. 11743 FirstName *string `json:"firstName,omitempty"` 11744 // LastName - Last name. 11745 LastName *string `json:"lastName,omitempty"` 11746 // Password - User Password. If no value is provided, a default password is generated. 11747 Password *string `json:"password,omitempty"` 11748 // Confirmation - Determines the type of confirmation e-mail that will be sent to the newly created user. Possible values include: 'Signup', 'Invite' 11749 Confirmation Confirmation `json:"confirmation,omitempty"` 11750 // 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' 11751 State UserState `json:"state,omitempty"` 11752 // Note - Optional note about a user set by the administrator. 11753 Note *string `json:"note,omitempty"` 11754 // Identities - Collection of user identities. 11755 Identities *[]UserIdentityContract `json:"identities,omitempty"` 11756} 11757 11758// UserCreateParameters user create details. 11759type UserCreateParameters struct { 11760 // UserCreateParameterProperties - User entity create contract properties. 11761 *UserCreateParameterProperties `json:"properties,omitempty"` 11762} 11763 11764// MarshalJSON is the custom marshaler for UserCreateParameters. 11765func (ucp UserCreateParameters) MarshalJSON() ([]byte, error) { 11766 objectMap := make(map[string]interface{}) 11767 if ucp.UserCreateParameterProperties != nil { 11768 objectMap["properties"] = ucp.UserCreateParameterProperties 11769 } 11770 return json.Marshal(objectMap) 11771} 11772 11773// UnmarshalJSON is the custom unmarshaler for UserCreateParameters struct. 11774func (ucp *UserCreateParameters) UnmarshalJSON(body []byte) error { 11775 var m map[string]*json.RawMessage 11776 err := json.Unmarshal(body, &m) 11777 if err != nil { 11778 return err 11779 } 11780 for k, v := range m { 11781 switch k { 11782 case "properties": 11783 if v != nil { 11784 var userCreateParameterProperties UserCreateParameterProperties 11785 err = json.Unmarshal(*v, &userCreateParameterProperties) 11786 if err != nil { 11787 return err 11788 } 11789 ucp.UserCreateParameterProperties = &userCreateParameterProperties 11790 } 11791 } 11792 } 11793 11794 return nil 11795} 11796 11797// UserEntityBaseParameters user Entity Base Parameters set. 11798type UserEntityBaseParameters struct { 11799 // 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' 11800 State UserState `json:"state,omitempty"` 11801 // Note - Optional note about a user set by the administrator. 11802 Note *string `json:"note,omitempty"` 11803 // Identities - Collection of user identities. 11804 Identities *[]UserIdentityContract `json:"identities,omitempty"` 11805} 11806 11807// UserIdentityCollection list of Users Identity list representation. 11808type UserIdentityCollection struct { 11809 autorest.Response `json:"-"` 11810 // Value - User Identity values. 11811 Value *[]UserIdentityContract `json:"value,omitempty"` 11812 // Count - Total record count number across all pages. 11813 Count *int64 `json:"count,omitempty"` 11814 // NextLink - Next page link if any. 11815 NextLink *string `json:"nextLink,omitempty"` 11816} 11817 11818// UserIdentityCollectionIterator provides access to a complete listing of UserIdentityContract values. 11819type UserIdentityCollectionIterator struct { 11820 i int 11821 page UserIdentityCollectionPage 11822} 11823 11824// NextWithContext advances to the next value. If there was an error making 11825// the request the iterator does not advance and the error is returned. 11826func (iter *UserIdentityCollectionIterator) NextWithContext(ctx context.Context) (err error) { 11827 if tracing.IsEnabled() { 11828 ctx = tracing.StartSpan(ctx, fqdn+"/UserIdentityCollectionIterator.NextWithContext") 11829 defer func() { 11830 sc := -1 11831 if iter.Response().Response.Response != nil { 11832 sc = iter.Response().Response.Response.StatusCode 11833 } 11834 tracing.EndSpan(ctx, sc, err) 11835 }() 11836 } 11837 iter.i++ 11838 if iter.i < len(iter.page.Values()) { 11839 return nil 11840 } 11841 err = iter.page.NextWithContext(ctx) 11842 if err != nil { 11843 iter.i-- 11844 return err 11845 } 11846 iter.i = 0 11847 return nil 11848} 11849 11850// Next advances to the next value. If there was an error making 11851// the request the iterator does not advance and the error is returned. 11852// Deprecated: Use NextWithContext() instead. 11853func (iter *UserIdentityCollectionIterator) Next() error { 11854 return iter.NextWithContext(context.Background()) 11855} 11856 11857// NotDone returns true if the enumeration should be started or is not yet complete. 11858func (iter UserIdentityCollectionIterator) NotDone() bool { 11859 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 11860} 11861 11862// Response returns the raw server response from the last page request. 11863func (iter UserIdentityCollectionIterator) Response() UserIdentityCollection { 11864 return iter.page.Response() 11865} 11866 11867// Value returns the current value or a zero-initialized value if the 11868// iterator has advanced beyond the end of the collection. 11869func (iter UserIdentityCollectionIterator) Value() UserIdentityContract { 11870 if !iter.page.NotDone() { 11871 return UserIdentityContract{} 11872 } 11873 return iter.page.Values()[iter.i] 11874} 11875 11876// Creates a new instance of the UserIdentityCollectionIterator type. 11877func NewUserIdentityCollectionIterator(page UserIdentityCollectionPage) UserIdentityCollectionIterator { 11878 return UserIdentityCollectionIterator{page: page} 11879} 11880 11881// IsEmpty returns true if the ListResult contains no values. 11882func (uic UserIdentityCollection) IsEmpty() bool { 11883 return uic.Value == nil || len(*uic.Value) == 0 11884} 11885 11886// userIdentityCollectionPreparer prepares a request to retrieve the next set of results. 11887// It returns nil if no more results exist. 11888func (uic UserIdentityCollection) userIdentityCollectionPreparer(ctx context.Context) (*http.Request, error) { 11889 if uic.NextLink == nil || len(to.String(uic.NextLink)) < 1 { 11890 return nil, nil 11891 } 11892 return autorest.Prepare((&http.Request{}).WithContext(ctx), 11893 autorest.AsJSON(), 11894 autorest.AsGet(), 11895 autorest.WithBaseURL(to.String(uic.NextLink))) 11896} 11897 11898// UserIdentityCollectionPage contains a page of UserIdentityContract values. 11899type UserIdentityCollectionPage struct { 11900 fn func(context.Context, UserIdentityCollection) (UserIdentityCollection, error) 11901 uic UserIdentityCollection 11902} 11903 11904// NextWithContext advances to the next page of values. If there was an error making 11905// the request the page does not advance and the error is returned. 11906func (page *UserIdentityCollectionPage) NextWithContext(ctx context.Context) (err error) { 11907 if tracing.IsEnabled() { 11908 ctx = tracing.StartSpan(ctx, fqdn+"/UserIdentityCollectionPage.NextWithContext") 11909 defer func() { 11910 sc := -1 11911 if page.Response().Response.Response != nil { 11912 sc = page.Response().Response.Response.StatusCode 11913 } 11914 tracing.EndSpan(ctx, sc, err) 11915 }() 11916 } 11917 next, err := page.fn(ctx, page.uic) 11918 if err != nil { 11919 return err 11920 } 11921 page.uic = next 11922 return nil 11923} 11924 11925// Next advances to the next page of values. If there was an error making 11926// the request the page does not advance and the error is returned. 11927// Deprecated: Use NextWithContext() instead. 11928func (page *UserIdentityCollectionPage) Next() error { 11929 return page.NextWithContext(context.Background()) 11930} 11931 11932// NotDone returns true if the page enumeration should be started or is not yet complete. 11933func (page UserIdentityCollectionPage) NotDone() bool { 11934 return !page.uic.IsEmpty() 11935} 11936 11937// Response returns the raw server response from the last page request. 11938func (page UserIdentityCollectionPage) Response() UserIdentityCollection { 11939 return page.uic 11940} 11941 11942// Values returns the slice of values for the current page or nil if there are no values. 11943func (page UserIdentityCollectionPage) Values() []UserIdentityContract { 11944 if page.uic.IsEmpty() { 11945 return nil 11946 } 11947 return *page.uic.Value 11948} 11949 11950// Creates a new instance of the UserIdentityCollectionPage type. 11951func NewUserIdentityCollectionPage(getNextPage func(context.Context, UserIdentityCollection) (UserIdentityCollection, error)) UserIdentityCollectionPage { 11952 return UserIdentityCollectionPage{fn: getNextPage} 11953} 11954 11955// UserIdentityContract user identity details. 11956type UserIdentityContract struct { 11957 // Provider - Identity provider name. 11958 Provider *string `json:"provider,omitempty"` 11959 // ID - Identifier value within provider. 11960 ID *string `json:"id,omitempty"` 11961} 11962 11963// UserTokenParameterProperties parameters supplied to the Get User Token operation. 11964type UserTokenParameterProperties struct { 11965 // KeyType - The Key to be used to generate token for user. Possible values include: 'Primary', 'Secondary' 11966 KeyType KeyType `json:"keyType,omitempty"` 11967 // 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. 11968 Expiry *date.Time `json:"expiry,omitempty"` 11969} 11970 11971// UserTokenParameters get User Token parameters. 11972type UserTokenParameters struct { 11973 // UserTokenParameterProperties - User Token Parameter contract properties. 11974 *UserTokenParameterProperties `json:"properties,omitempty"` 11975} 11976 11977// MarshalJSON is the custom marshaler for UserTokenParameters. 11978func (utp UserTokenParameters) MarshalJSON() ([]byte, error) { 11979 objectMap := make(map[string]interface{}) 11980 if utp.UserTokenParameterProperties != nil { 11981 objectMap["properties"] = utp.UserTokenParameterProperties 11982 } 11983 return json.Marshal(objectMap) 11984} 11985 11986// UnmarshalJSON is the custom unmarshaler for UserTokenParameters struct. 11987func (utp *UserTokenParameters) UnmarshalJSON(body []byte) error { 11988 var m map[string]*json.RawMessage 11989 err := json.Unmarshal(body, &m) 11990 if err != nil { 11991 return err 11992 } 11993 for k, v := range m { 11994 switch k { 11995 case "properties": 11996 if v != nil { 11997 var userTokenParameterProperties UserTokenParameterProperties 11998 err = json.Unmarshal(*v, &userTokenParameterProperties) 11999 if err != nil { 12000 return err 12001 } 12002 utp.UserTokenParameterProperties = &userTokenParameterProperties 12003 } 12004 } 12005 } 12006 12007 return nil 12008} 12009 12010// UserTokenResult get User Token response details. 12011type UserTokenResult struct { 12012 autorest.Response `json:"-"` 12013 // Value - Shared Access Authorization token for the User. 12014 Value *string `json:"value,omitempty"` 12015} 12016 12017// UserUpdateParameters user update parameters. 12018type UserUpdateParameters struct { 12019 // UserUpdateParametersProperties - User entity update contract properties. 12020 *UserUpdateParametersProperties `json:"properties,omitempty"` 12021} 12022 12023// MarshalJSON is the custom marshaler for UserUpdateParameters. 12024func (uup UserUpdateParameters) MarshalJSON() ([]byte, error) { 12025 objectMap := make(map[string]interface{}) 12026 if uup.UserUpdateParametersProperties != nil { 12027 objectMap["properties"] = uup.UserUpdateParametersProperties 12028 } 12029 return json.Marshal(objectMap) 12030} 12031 12032// UnmarshalJSON is the custom unmarshaler for UserUpdateParameters struct. 12033func (uup *UserUpdateParameters) UnmarshalJSON(body []byte) error { 12034 var m map[string]*json.RawMessage 12035 err := json.Unmarshal(body, &m) 12036 if err != nil { 12037 return err 12038 } 12039 for k, v := range m { 12040 switch k { 12041 case "properties": 12042 if v != nil { 12043 var userUpdateParametersProperties UserUpdateParametersProperties 12044 err = json.Unmarshal(*v, &userUpdateParametersProperties) 12045 if err != nil { 12046 return err 12047 } 12048 uup.UserUpdateParametersProperties = &userUpdateParametersProperties 12049 } 12050 } 12051 } 12052 12053 return nil 12054} 12055 12056// UserUpdateParametersProperties parameters supplied to the Update User operation. 12057type UserUpdateParametersProperties struct { 12058 // Email - Email address. Must not be empty and must be unique within the service instance. 12059 Email *string `json:"email,omitempty"` 12060 // Password - User Password. 12061 Password *string `json:"password,omitempty"` 12062 // FirstName - First name. 12063 FirstName *string `json:"firstName,omitempty"` 12064 // LastName - Last name. 12065 LastName *string `json:"lastName,omitempty"` 12066 // 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' 12067 State UserState `json:"state,omitempty"` 12068 // Note - Optional note about a user set by the administrator. 12069 Note *string `json:"note,omitempty"` 12070 // Identities - Collection of user identities. 12071 Identities *[]UserIdentityContract `json:"identities,omitempty"` 12072} 12073 12074// VirtualNetworkConfiguration configuration of a virtual network to which API Management service is 12075// deployed. 12076type VirtualNetworkConfiguration struct { 12077 // Vnetid - READ-ONLY; The virtual network ID. This is typically a GUID. Expect a null GUID by default. 12078 Vnetid *string `json:"vnetid,omitempty"` 12079 // Subnetname - READ-ONLY; The name of the subnet. 12080 Subnetname *string `json:"subnetname,omitempty"` 12081 // SubnetResourceID - The full resource ID of a subnet in a virtual network to deploy the API Management service in. 12082 SubnetResourceID *string `json:"subnetResourceId,omitempty"` 12083} 12084 12085// X509CertificateName properties of server X509Names. 12086type X509CertificateName struct { 12087 // Name - Common Name of the Certificate. 12088 Name *string `json:"name,omitempty"` 12089 // IssuerCertificateThumbprint - Thumbprint for the Issuer of the Certificate. 12090 IssuerCertificateThumbprint *string `json:"issuerCertificateThumbprint,omitempty"` 12091} 12092