1package apimanagement 2 3// Copyright (c) Microsoft and contributors. All rights reserved. 4// 5// Licensed under the Apache License, Version 2.0 (the "License"); 6// you may not use this file except in compliance with the License. 7// You may obtain a copy of the License at 8// http://www.apache.org/licenses/LICENSE-2.0 9// 10// Unless required by applicable law or agreed to in writing, software 11// distributed under the License is distributed on an "AS IS" BASIS, 12// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13// 14// See the License for the specific language governing permissions and 15// limitations under the License. 16// 17// Code generated by Microsoft (R) AutoRest Code Generator. 18// Changes may cause incorrect behavior and will be lost if the code is regenerated. 19 20import ( 21 "encoding/json" 22 "github.com/Azure/go-autorest/autorest" 23 "github.com/Azure/go-autorest/autorest/azure" 24 "github.com/Azure/go-autorest/autorest/date" 25 "github.com/Azure/go-autorest/autorest/to" 26 "github.com/satori/go.uuid" 27 "net/http" 28) 29 30// APIType enumerates the values for api type. 31type APIType string 32 33const ( 34 // HTTP ... 35 HTTP APIType = "http" 36 // Soap ... 37 Soap APIType = "soap" 38) 39 40// PossibleAPITypeValues returns an array of possible values for the APIType const type. 41func PossibleAPITypeValues() []APIType { 42 return []APIType{HTTP, Soap} 43} 44 45// AsyncOperationStatus enumerates the values for async operation status. 46type AsyncOperationStatus string 47 48const ( 49 // Failed ... 50 Failed AsyncOperationStatus = "Failed" 51 // InProgress ... 52 InProgress AsyncOperationStatus = "InProgress" 53 // Started ... 54 Started AsyncOperationStatus = "Started" 55 // Succeeded ... 56 Succeeded AsyncOperationStatus = "Succeeded" 57) 58 59// PossibleAsyncOperationStatusValues returns an array of possible values for the AsyncOperationStatus const type. 60func PossibleAsyncOperationStatusValues() []AsyncOperationStatus { 61 return []AsyncOperationStatus{Failed, InProgress, Started, Succeeded} 62} 63 64// AuthorizationMethod enumerates the values for authorization method. 65type AuthorizationMethod string 66 67const ( 68 // DELETE ... 69 DELETE AuthorizationMethod = "DELETE" 70 // GET ... 71 GET AuthorizationMethod = "GET" 72 // HEAD ... 73 HEAD AuthorizationMethod = "HEAD" 74 // OPTIONS ... 75 OPTIONS AuthorizationMethod = "OPTIONS" 76 // PATCH ... 77 PATCH AuthorizationMethod = "PATCH" 78 // POST ... 79 POST AuthorizationMethod = "POST" 80 // PUT ... 81 PUT AuthorizationMethod = "PUT" 82 // TRACE ... 83 TRACE AuthorizationMethod = "TRACE" 84) 85 86// PossibleAuthorizationMethodValues returns an array of possible values for the AuthorizationMethod const type. 87func PossibleAuthorizationMethodValues() []AuthorizationMethod { 88 return []AuthorizationMethod{DELETE, GET, HEAD, OPTIONS, PATCH, POST, PUT, TRACE} 89} 90 91// BackendProtocol enumerates the values for backend protocol. 92type BackendProtocol string 93 94const ( 95 // BackendProtocolHTTP The Backend is a RESTful service. 96 BackendProtocolHTTP BackendProtocol = "http" 97 // BackendProtocolSoap The Backend is a SOAP service. 98 BackendProtocolSoap BackendProtocol = "soap" 99) 100 101// PossibleBackendProtocolValues returns an array of possible values for the BackendProtocol const type. 102func PossibleBackendProtocolValues() []BackendProtocol { 103 return []BackendProtocol{BackendProtocolHTTP, BackendProtocolSoap} 104} 105 106// BearerTokenSendingMethod enumerates the values for bearer token sending method. 107type BearerTokenSendingMethod string 108 109const ( 110 // AuthorizationHeader ... 111 AuthorizationHeader BearerTokenSendingMethod = "authorizationHeader" 112 // Query ... 113 Query BearerTokenSendingMethod = "query" 114) 115 116// PossibleBearerTokenSendingMethodValues returns an array of possible values for the BearerTokenSendingMethod const type. 117func PossibleBearerTokenSendingMethodValues() []BearerTokenSendingMethod { 118 return []BearerTokenSendingMethod{AuthorizationHeader, Query} 119} 120 121// ClientAuthenticationMethod enumerates the values for client authentication method. 122type ClientAuthenticationMethod string 123 124const ( 125 // Basic Basic Client Authentication method. 126 Basic ClientAuthenticationMethod = "Basic" 127 // Body Body based Authentication method. 128 Body ClientAuthenticationMethod = "Body" 129) 130 131// PossibleClientAuthenticationMethodValues returns an array of possible values for the ClientAuthenticationMethod const type. 132func PossibleClientAuthenticationMethodValues() []ClientAuthenticationMethod { 133 return []ClientAuthenticationMethod{Basic, Body} 134} 135 136// Confirmation enumerates the values for confirmation. 137type Confirmation string 138 139const ( 140 // Invite Send an e-mail inviting the user to sign-up and complete registration. 141 Invite Confirmation = "invite" 142 // Signup Send an e-mail to the user confirming they have successfully signed up. 143 Signup Confirmation = "signup" 144) 145 146// PossibleConfirmationValues returns an array of possible values for the Confirmation const type. 147func PossibleConfirmationValues() []Confirmation { 148 return []Confirmation{Invite, Signup} 149} 150 151// ConnectivityStatusType enumerates the values for connectivity status type. 152type ConnectivityStatusType string 153 154const ( 155 // Failure ... 156 Failure ConnectivityStatusType = "failure" 157 // Initializing ... 158 Initializing ConnectivityStatusType = "initializing" 159 // Success ... 160 Success ConnectivityStatusType = "success" 161) 162 163// PossibleConnectivityStatusTypeValues returns an array of possible values for the ConnectivityStatusType const type. 164func PossibleConnectivityStatusTypeValues() []ConnectivityStatusType { 165 return []ConnectivityStatusType{Failure, Initializing, Success} 166} 167 168// ContentFormat enumerates the values for content format. 169type ContentFormat string 170 171const ( 172 // SwaggerJSON The contents are inline and Content Type is a OpenApi 2.0 Document. 173 SwaggerJSON ContentFormat = "swagger-json" 174 // SwaggerLinkJSON The Open Api 2.0 document is hosted on a publicly accessible internet address. 175 SwaggerLinkJSON ContentFormat = "swagger-link-json" 176 // WadlLinkJSON The WADL document is hosted on a publicly accessible internet address. 177 WadlLinkJSON ContentFormat = "wadl-link-json" 178 // WadlXML The contents are inline and Content type is a WADL document. 179 WadlXML ContentFormat = "wadl-xml" 180 // Wsdl The contents are inline and the document is a WSDL/Soap document. 181 Wsdl ContentFormat = "wsdl" 182 // WsdlLink The WSDL document is hosted on a publicly accessible internet address. 183 WsdlLink ContentFormat = "wsdl-link" 184) 185 186// PossibleContentFormatValues returns an array of possible values for the ContentFormat const type. 187func PossibleContentFormatValues() []ContentFormat { 188 return []ContentFormat{SwaggerJSON, SwaggerLinkJSON, WadlLinkJSON, WadlXML, Wsdl, WsdlLink} 189} 190 191// ExportFormat enumerates the values for export format. 192type ExportFormat string 193 194const ( 195 // ExportFormatSwagger Export the Api Definition in OpenApi Specification 2.0 format to the Storage Blob. 196 ExportFormatSwagger ExportFormat = "swagger-link" 197 // ExportFormatWadl Export the Api Definition in WADL Schema to Storage Blob. 198 ExportFormatWadl ExportFormat = "wadl-link" 199 // ExportFormatWsdl Export the Api Definition in WSDL Schema to Storage Blob. This is only supported for 200 // APIs of Type `soap` 201 ExportFormatWsdl ExportFormat = "wsdl-link" 202) 203 204// PossibleExportFormatValues returns an array of possible values for the ExportFormat const type. 205func PossibleExportFormatValues() []ExportFormat { 206 return []ExportFormat{ExportFormatSwagger, ExportFormatWadl, ExportFormatWsdl} 207} 208 209// GrantType enumerates the values for grant type. 210type GrantType string 211 212const ( 213 // AuthorizationCode Authorization Code Grant flow as described 214 // https://tools.ietf.org/html/rfc6749#section-4.1. 215 AuthorizationCode GrantType = "authorizationCode" 216 // ClientCredentials Client Credentials Grant flow as described 217 // https://tools.ietf.org/html/rfc6749#section-4.4. 218 ClientCredentials GrantType = "clientCredentials" 219 // Implicit Implicit Code Grant flow as described https://tools.ietf.org/html/rfc6749#section-4.2. 220 Implicit GrantType = "implicit" 221 // ResourceOwnerPassword Resource Owner Password Grant flow as described 222 // https://tools.ietf.org/html/rfc6749#section-4.3. 223 ResourceOwnerPassword GrantType = "resourceOwnerPassword" 224) 225 226// PossibleGrantTypeValues returns an array of possible values for the GrantType const type. 227func PossibleGrantTypeValues() []GrantType { 228 return []GrantType{AuthorizationCode, ClientCredentials, Implicit, ResourceOwnerPassword} 229} 230 231// GroupType enumerates the values for group type. 232type GroupType string 233 234const ( 235 // Custom ... 236 Custom GroupType = "custom" 237 // External ... 238 External GroupType = "external" 239 // System ... 240 System GroupType = "system" 241) 242 243// PossibleGroupTypeValues returns an array of possible values for the GroupType const type. 244func PossibleGroupTypeValues() []GroupType { 245 return []GroupType{Custom, External, System} 246} 247 248// HostnameType enumerates the values for hostname type. 249type HostnameType string 250 251const ( 252 // Management ... 253 Management HostnameType = "Management" 254 // Portal ... 255 Portal HostnameType = "Portal" 256 // Proxy ... 257 Proxy HostnameType = "Proxy" 258 // Scm ... 259 Scm HostnameType = "Scm" 260) 261 262// PossibleHostnameTypeValues returns an array of possible values for the HostnameType const type. 263func PossibleHostnameTypeValues() []HostnameType { 264 return []HostnameType{Management, Portal, Proxy, Scm} 265} 266 267// IdentityProviderType enumerates the values for identity provider type. 268type IdentityProviderType string 269 270const ( 271 // Aad Azure Active Directory as Identity provider. 272 Aad IdentityProviderType = "aad" 273 // AadB2C Azure Active Directory B2C as Identity provider. 274 AadB2C IdentityProviderType = "aadB2C" 275 // Facebook Facebook as Identity provider. 276 Facebook IdentityProviderType = "facebook" 277 // Google Google as Identity provider. 278 Google IdentityProviderType = "google" 279 // Microsoft Microsoft Live as Identity provider. 280 Microsoft IdentityProviderType = "microsoft" 281 // Twitter Twitter as Identity provider. 282 Twitter IdentityProviderType = "twitter" 283) 284 285// PossibleIdentityProviderTypeValues returns an array of possible values for the IdentityProviderType const type. 286func PossibleIdentityProviderTypeValues() []IdentityProviderType { 287 return []IdentityProviderType{Aad, AadB2C, Facebook, Google, Microsoft, Twitter} 288} 289 290// KeyType enumerates the values for key type. 291type KeyType string 292 293const ( 294 // Primary ... 295 Primary KeyType = "primary" 296 // Secondary ... 297 Secondary KeyType = "secondary" 298) 299 300// PossibleKeyTypeValues returns an array of possible values for the KeyType const type. 301func PossibleKeyTypeValues() []KeyType { 302 return []KeyType{Primary, Secondary} 303} 304 305// LoggerType enumerates the values for logger type. 306type LoggerType string 307 308const ( 309 // ApplicationInsights Azure Application Insights as log destination. 310 ApplicationInsights LoggerType = "applicationInsights" 311 // AzureEventHub Azure Event Hub as log destination. 312 AzureEventHub LoggerType = "azureEventHub" 313) 314 315// PossibleLoggerTypeValues returns an array of possible values for the LoggerType const type. 316func PossibleLoggerTypeValues() []LoggerType { 317 return []LoggerType{ApplicationInsights, AzureEventHub} 318} 319 320// NameAvailabilityReason enumerates the values for name availability reason. 321type NameAvailabilityReason string 322 323const ( 324 // AlreadyExists ... 325 AlreadyExists NameAvailabilityReason = "AlreadyExists" 326 // Invalid ... 327 Invalid NameAvailabilityReason = "Invalid" 328 // Valid ... 329 Valid NameAvailabilityReason = "Valid" 330) 331 332// PossibleNameAvailabilityReasonValues returns an array of possible values for the NameAvailabilityReason const type. 333func PossibleNameAvailabilityReasonValues() []NameAvailabilityReason { 334 return []NameAvailabilityReason{AlreadyExists, Invalid, Valid} 335} 336 337// NotificationName enumerates the values for notification name. 338type NotificationName string 339 340const ( 341 // AccountClosedPublisher The following email recipients and users will receive email notifications when 342 // developer closes his account. 343 AccountClosedPublisher NotificationName = "AccountClosedPublisher" 344 // BCC The following recipients will receive blind carbon copies of all emails sent to developers. 345 BCC NotificationName = "BCC" 346 // NewApplicationNotificationMessage The following email recipients and users will receive email 347 // notifications when new applications are submitted to the application gallery. 348 NewApplicationNotificationMessage NotificationName = "NewApplicationNotificationMessage" 349 // NewIssuePublisherNotificationMessage The following email recipients and users will receive email 350 // notifications when a new issue or comment is submitted on the developer portal. 351 NewIssuePublisherNotificationMessage NotificationName = "NewIssuePublisherNotificationMessage" 352 // PurchasePublisherNotificationMessage The following email recipients and users will receive email 353 // notifications about new API product subscriptions. 354 PurchasePublisherNotificationMessage NotificationName = "PurchasePublisherNotificationMessage" 355 // QuotaLimitApproachingPublisherNotificationMessage The following email recipients and users will receive 356 // email notifications when subscription usage gets close to usage quota. 357 QuotaLimitApproachingPublisherNotificationMessage NotificationName = "QuotaLimitApproachingPublisherNotificationMessage" 358 // RequestPublisherNotificationMessage The following email recipients and users will receive email 359 // notifications about subscription requests for API products requiring approval. 360 RequestPublisherNotificationMessage NotificationName = "RequestPublisherNotificationMessage" 361) 362 363// PossibleNotificationNameValues returns an array of possible values for the NotificationName const type. 364func PossibleNotificationNameValues() []NotificationName { 365 return []NotificationName{AccountClosedPublisher, BCC, NewApplicationNotificationMessage, NewIssuePublisherNotificationMessage, PurchasePublisherNotificationMessage, QuotaLimitApproachingPublisherNotificationMessage, RequestPublisherNotificationMessage} 366} 367 368// PolicyContentFormat enumerates the values for policy content format. 369type PolicyContentFormat string 370 371const ( 372 // Rawxml The contents are inline and Content type is a non XML encoded policy document. 373 Rawxml PolicyContentFormat = "rawxml" 374 // RawxmlLink The policy document is not Xml encoded and is hosted on a http endpoint accessible from the 375 // API Management service. 376 RawxmlLink PolicyContentFormat = "rawxml-link" 377 // XML The contents are inline and Content type is an XML document. 378 XML PolicyContentFormat = "xml" 379 // XMLLink The policy XML document is hosted on a http endpoint accessible from the API Management service. 380 XMLLink PolicyContentFormat = "xml-link" 381) 382 383// PossiblePolicyContentFormatValues returns an array of possible values for the PolicyContentFormat const type. 384func PossiblePolicyContentFormatValues() []PolicyContentFormat { 385 return []PolicyContentFormat{Rawxml, RawxmlLink, XML, XMLLink} 386} 387 388// PolicyScopeContract enumerates the values for policy scope contract. 389type PolicyScopeContract string 390 391const ( 392 // PolicyScopeContractAll ... 393 PolicyScopeContractAll PolicyScopeContract = "All" 394 // PolicyScopeContractAPI ... 395 PolicyScopeContractAPI PolicyScopeContract = "Api" 396 // PolicyScopeContractOperation ... 397 PolicyScopeContractOperation PolicyScopeContract = "Operation" 398 // PolicyScopeContractProduct ... 399 PolicyScopeContractProduct PolicyScopeContract = "Product" 400 // PolicyScopeContractTenant ... 401 PolicyScopeContractTenant PolicyScopeContract = "Tenant" 402) 403 404// PossiblePolicyScopeContractValues returns an array of possible values for the PolicyScopeContract const type. 405func PossiblePolicyScopeContractValues() []PolicyScopeContract { 406 return []PolicyScopeContract{PolicyScopeContractAll, PolicyScopeContractAPI, PolicyScopeContractOperation, PolicyScopeContractProduct, PolicyScopeContractTenant} 407} 408 409// ProductState enumerates the values for product state. 410type ProductState string 411 412const ( 413 // NotPublished ... 414 NotPublished ProductState = "notPublished" 415 // Published ... 416 Published ProductState = "published" 417) 418 419// PossibleProductStateValues returns an array of possible values for the ProductState const type. 420func PossibleProductStateValues() []ProductState { 421 return []ProductState{NotPublished, Published} 422} 423 424// Protocol enumerates the values for protocol. 425type Protocol string 426 427const ( 428 // ProtocolHTTP ... 429 ProtocolHTTP Protocol = "http" 430 // ProtocolHTTPS ... 431 ProtocolHTTPS Protocol = "https" 432) 433 434// PossibleProtocolValues returns an array of possible values for the Protocol const type. 435func PossibleProtocolValues() []Protocol { 436 return []Protocol{ProtocolHTTP, ProtocolHTTPS} 437} 438 439// SkuType enumerates the values for sku type. 440type SkuType string 441 442const ( 443 // SkuTypeBasic Basic SKU of Api Management. 444 SkuTypeBasic SkuType = "Basic" 445 // SkuTypeDeveloper Developer SKU of Api Management. 446 SkuTypeDeveloper SkuType = "Developer" 447 // SkuTypePremium Premium SKU of Api Management. 448 SkuTypePremium SkuType = "Premium" 449 // SkuTypeStandard Standard SKU of Api Management. 450 SkuTypeStandard SkuType = "Standard" 451) 452 453// PossibleSkuTypeValues returns an array of possible values for the SkuType const type. 454func PossibleSkuTypeValues() []SkuType { 455 return []SkuType{SkuTypeBasic, SkuTypeDeveloper, SkuTypePremium, SkuTypeStandard} 456} 457 458// SoapAPIType enumerates the values for soap api type. 459type SoapAPIType string 460 461const ( 462 // SoapPassThrough Imports the Soap API having a SOAP front end. 463 SoapPassThrough SoapAPIType = "soap" 464 // SoapToRest Imports a SOAP API having a RESTful front end. 465 SoapToRest SoapAPIType = "http" 466) 467 468// PossibleSoapAPITypeValues returns an array of possible values for the SoapAPIType const type. 469func PossibleSoapAPITypeValues() []SoapAPIType { 470 return []SoapAPIType{SoapPassThrough, SoapToRest} 471} 472 473// State enumerates the values for state. 474type State string 475 476const ( 477 // Closed The issue was closed. 478 Closed State = "closed" 479 // Open The issue is opened. 480 Open State = "open" 481 // Proposed The issue is proposed. 482 Proposed State = "proposed" 483 // Removed The issue was removed. 484 Removed State = "removed" 485 // Resolved The issue is now resolved. 486 Resolved State = "resolved" 487) 488 489// PossibleStateValues returns an array of possible values for the State const type. 490func PossibleStateValues() []State { 491 return []State{Closed, Open, Proposed, Removed, Resolved} 492} 493 494// StoreName enumerates the values for store name. 495type StoreName string 496 497const ( 498 // CertificateAuthority ... 499 CertificateAuthority StoreName = "CertificateAuthority" 500 // Root ... 501 Root StoreName = "Root" 502) 503 504// PossibleStoreNameValues returns an array of possible values for the StoreName const type. 505func PossibleStoreNameValues() []StoreName { 506 return []StoreName{CertificateAuthority, Root} 507} 508 509// SubscriptionState enumerates the values for subscription state. 510type SubscriptionState string 511 512const ( 513 // Active ... 514 Active SubscriptionState = "active" 515 // Cancelled ... 516 Cancelled SubscriptionState = "cancelled" 517 // Expired ... 518 Expired SubscriptionState = "expired" 519 // Rejected ... 520 Rejected SubscriptionState = "rejected" 521 // Submitted ... 522 Submitted SubscriptionState = "submitted" 523 // Suspended ... 524 Suspended SubscriptionState = "suspended" 525) 526 527// PossibleSubscriptionStateValues returns an array of possible values for the SubscriptionState const type. 528func PossibleSubscriptionStateValues() []SubscriptionState { 529 return []SubscriptionState{Active, Cancelled, Expired, Rejected, Submitted, Suspended} 530} 531 532// TemplateName enumerates the values for template name. 533type TemplateName string 534 535const ( 536 // AccountClosedDeveloper ... 537 AccountClosedDeveloper TemplateName = "accountClosedDeveloper" 538 // ApplicationApprovedNotificationMessage ... 539 ApplicationApprovedNotificationMessage TemplateName = "applicationApprovedNotificationMessage" 540 // ConfirmSignUpIdentityDefault ... 541 ConfirmSignUpIdentityDefault TemplateName = "confirmSignUpIdentityDefault" 542 // EmailChangeIdentityDefault ... 543 EmailChangeIdentityDefault TemplateName = "emailChangeIdentityDefault" 544 // InviteUserNotificationMessage ... 545 InviteUserNotificationMessage TemplateName = "inviteUserNotificationMessage" 546 // NewCommentNotificationMessage ... 547 NewCommentNotificationMessage TemplateName = "newCommentNotificationMessage" 548 // NewDeveloperNotificationMessage ... 549 NewDeveloperNotificationMessage TemplateName = "newDeveloperNotificationMessage" 550 // NewIssueNotificationMessage ... 551 NewIssueNotificationMessage TemplateName = "newIssueNotificationMessage" 552 // PasswordResetByAdminNotificationMessage ... 553 PasswordResetByAdminNotificationMessage TemplateName = "passwordResetByAdminNotificationMessage" 554 // PasswordResetIdentityDefault ... 555 PasswordResetIdentityDefault TemplateName = "passwordResetIdentityDefault" 556 // PurchaseDeveloperNotificationMessage ... 557 PurchaseDeveloperNotificationMessage TemplateName = "purchaseDeveloperNotificationMessage" 558 // QuotaLimitApproachingDeveloperNotificationMessage ... 559 QuotaLimitApproachingDeveloperNotificationMessage TemplateName = "quotaLimitApproachingDeveloperNotificationMessage" 560 // RejectDeveloperNotificationMessage ... 561 RejectDeveloperNotificationMessage TemplateName = "rejectDeveloperNotificationMessage" 562 // RequestDeveloperNotificationMessage ... 563 RequestDeveloperNotificationMessage TemplateName = "requestDeveloperNotificationMessage" 564) 565 566// PossibleTemplateNameValues returns an array of possible values for the TemplateName const type. 567func PossibleTemplateNameValues() []TemplateName { 568 return []TemplateName{AccountClosedDeveloper, ApplicationApprovedNotificationMessage, ConfirmSignUpIdentityDefault, EmailChangeIdentityDefault, InviteUserNotificationMessage, NewCommentNotificationMessage, NewDeveloperNotificationMessage, NewIssueNotificationMessage, PasswordResetByAdminNotificationMessage, PasswordResetIdentityDefault, PurchaseDeveloperNotificationMessage, QuotaLimitApproachingDeveloperNotificationMessage, RejectDeveloperNotificationMessage, RequestDeveloperNotificationMessage} 569} 570 571// UserState enumerates the values for user state. 572type UserState string 573 574const ( 575 // UserStateActive User state is active. 576 UserStateActive UserState = "active" 577 // UserStateBlocked User is blocked. Blocked users cannot authenticate at developer portal or call API. 578 UserStateBlocked UserState = "blocked" 579 // UserStateDeleted User account is closed. All identities and related entities are removed. 580 UserStateDeleted UserState = "deleted" 581 // UserStatePending User account is pending. Requires identity confirmation before it can be made active. 582 UserStatePending UserState = "pending" 583) 584 585// PossibleUserStateValues returns an array of possible values for the UserState const type. 586func PossibleUserStateValues() []UserState { 587 return []UserState{UserStateActive, UserStateBlocked, UserStateDeleted, UserStatePending} 588} 589 590// VersioningScheme enumerates the values for versioning scheme. 591type VersioningScheme string 592 593const ( 594 // VersioningSchemeHeader The API Version is passed in a HTTP header. 595 VersioningSchemeHeader VersioningScheme = "Header" 596 // VersioningSchemeQuery The API Version is passed in a query parameter. 597 VersioningSchemeQuery VersioningScheme = "Query" 598 // VersioningSchemeSegment The API Version is passed in a path segment. 599 VersioningSchemeSegment VersioningScheme = "Segment" 600) 601 602// PossibleVersioningSchemeValues returns an array of possible values for the VersioningScheme const type. 603func PossibleVersioningSchemeValues() []VersioningScheme { 604 return []VersioningScheme{VersioningSchemeHeader, VersioningSchemeQuery, VersioningSchemeSegment} 605} 606 607// VersioningScheme1 enumerates the values for versioning scheme 1. 608type VersioningScheme1 string 609 610const ( 611 // VersioningScheme1Header ... 612 VersioningScheme1Header VersioningScheme1 = "Header" 613 // VersioningScheme1Query ... 614 VersioningScheme1Query VersioningScheme1 = "Query" 615 // VersioningScheme1Segment ... 616 VersioningScheme1Segment VersioningScheme1 = "Segment" 617) 618 619// PossibleVersioningScheme1Values returns an array of possible values for the VersioningScheme1 const type. 620func PossibleVersioningScheme1Values() []VersioningScheme1 { 621 return []VersioningScheme1{VersioningScheme1Header, VersioningScheme1Query, VersioningScheme1Segment} 622} 623 624// VirtualNetworkType enumerates the values for virtual network type. 625type VirtualNetworkType string 626 627const ( 628 // VirtualNetworkTypeExternal The service is part of Virtual Network and it is accessible from Internet. 629 VirtualNetworkTypeExternal VirtualNetworkType = "External" 630 // VirtualNetworkTypeInternal The service is part of Virtual Network and it is only accessible from within 631 // the virtual network. 632 VirtualNetworkTypeInternal VirtualNetworkType = "Internal" 633 // VirtualNetworkTypeNone The service is not part of any Virtual Network. 634 VirtualNetworkTypeNone VirtualNetworkType = "None" 635) 636 637// PossibleVirtualNetworkTypeValues returns an array of possible values for the VirtualNetworkType const type. 638func PossibleVirtualNetworkTypeValues() []VirtualNetworkType { 639 return []VirtualNetworkType{VirtualNetworkTypeExternal, VirtualNetworkTypeInternal, VirtualNetworkTypeNone} 640} 641 642// AccessInformationContract tenant access information contract of the API Management service. 643type AccessInformationContract struct { 644 autorest.Response `json:"-"` 645 // ID - Identifier. 646 ID *string `json:"id,omitempty"` 647 // PrimaryKey - Primary access key. 648 PrimaryKey *string `json:"primaryKey,omitempty"` 649 // SecondaryKey - Secondary access key. 650 SecondaryKey *string `json:"secondaryKey,omitempty"` 651 // Enabled - Tenant access information of the API Management service. 652 Enabled *bool `json:"enabled,omitempty"` 653} 654 655// AccessInformationUpdateParameters tenant access information update parameters of the API Management service. 656type AccessInformationUpdateParameters struct { 657 // Enabled - Tenant access information of the API Management service. 658 Enabled *bool `json:"enabled,omitempty"` 659} 660 661// AdditionalLocation description of an additional API Management resource location. 662type AdditionalLocation struct { 663 // Location - The location name of the additional region among Azure Data center regions. 664 Location *string `json:"location,omitempty"` 665 // Sku - SKU properties of the API Management service. 666 Sku *ServiceSkuProperties `json:"sku,omitempty"` 667 // PublicIPAddresses - Public Static Load Balanced IP addresses of the API Management service in the additional location. Available only for Basic, Standard and Premium SKU. 668 PublicIPAddresses *[]string `json:"publicIPAddresses,omitempty"` 669 // PrivateIPAddresses - 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. 670 PrivateIPAddresses *[]string `json:"privateIPAddresses,omitempty"` 671 // VirtualNetworkConfiguration - Virtual network configuration for the location. 672 VirtualNetworkConfiguration *VirtualNetworkConfiguration `json:"virtualNetworkConfiguration,omitempty"` 673 // GatewayRegionalURL - Gateway URL of the API Management service in the Region. 674 GatewayRegionalURL *string `json:"gatewayRegionalUrl,omitempty"` 675} 676 677// APICollection paged Api list representation. 678type APICollection struct { 679 autorest.Response `json:"-"` 680 // Value - Page values. 681 Value *[]APIContract `json:"value,omitempty"` 682 // NextLink - Next page link if any. 683 NextLink *string `json:"nextLink,omitempty"` 684} 685 686// APICollectionIterator provides access to a complete listing of APIContract values. 687type APICollectionIterator struct { 688 i int 689 page APICollectionPage 690} 691 692// Next advances to the next value. If there was an error making 693// the request the iterator does not advance and the error is returned. 694func (iter *APICollectionIterator) Next() error { 695 iter.i++ 696 if iter.i < len(iter.page.Values()) { 697 return nil 698 } 699 err := iter.page.Next() 700 if err != nil { 701 iter.i-- 702 return err 703 } 704 iter.i = 0 705 return nil 706} 707 708// NotDone returns true if the enumeration should be started or is not yet complete. 709func (iter APICollectionIterator) NotDone() bool { 710 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 711} 712 713// Response returns the raw server response from the last page request. 714func (iter APICollectionIterator) Response() APICollection { 715 return iter.page.Response() 716} 717 718// Value returns the current value or a zero-initialized value if the 719// iterator has advanced beyond the end of the collection. 720func (iter APICollectionIterator) Value() APIContract { 721 if !iter.page.NotDone() { 722 return APIContract{} 723 } 724 return iter.page.Values()[iter.i] 725} 726 727// IsEmpty returns true if the ListResult contains no values. 728func (ac APICollection) IsEmpty() bool { 729 return ac.Value == nil || len(*ac.Value) == 0 730} 731 732// aPICollectionPreparer prepares a request to retrieve the next set of results. 733// It returns nil if no more results exist. 734func (ac APICollection) aPICollectionPreparer() (*http.Request, error) { 735 if ac.NextLink == nil || len(to.String(ac.NextLink)) < 1 { 736 return nil, nil 737 } 738 return autorest.Prepare(&http.Request{}, 739 autorest.AsJSON(), 740 autorest.AsGet(), 741 autorest.WithBaseURL(to.String(ac.NextLink))) 742} 743 744// APICollectionPage contains a page of APIContract values. 745type APICollectionPage struct { 746 fn func(APICollection) (APICollection, error) 747 ac APICollection 748} 749 750// Next advances to the next page of values. If there was an error making 751// the request the page does not advance and the error is returned. 752func (page *APICollectionPage) Next() error { 753 next, err := page.fn(page.ac) 754 if err != nil { 755 return err 756 } 757 page.ac = next 758 return nil 759} 760 761// NotDone returns true if the page enumeration should be started or is not yet complete. 762func (page APICollectionPage) NotDone() bool { 763 return !page.ac.IsEmpty() 764} 765 766// Response returns the raw server response from the last page request. 767func (page APICollectionPage) Response() APICollection { 768 return page.ac 769} 770 771// Values returns the slice of values for the current page or nil if there are no values. 772func (page APICollectionPage) Values() []APIContract { 773 if page.ac.IsEmpty() { 774 return nil 775 } 776 return *page.ac.Value 777} 778 779// APIContract API details. 780type APIContract struct { 781 autorest.Response `json:"-"` 782 // APIContractProperties - Api entity contract properties. 783 *APIContractProperties `json:"properties,omitempty"` 784 // ID - Resource ID. 785 ID *string `json:"id,omitempty"` 786 // Name - Resource name. 787 Name *string `json:"name,omitempty"` 788 // Type - Resource type for API Management resource. 789 Type *string `json:"type,omitempty"` 790} 791 792// MarshalJSON is the custom marshaler for APIContract. 793func (ac APIContract) MarshalJSON() ([]byte, error) { 794 objectMap := make(map[string]interface{}) 795 if ac.APIContractProperties != nil { 796 objectMap["properties"] = ac.APIContractProperties 797 } 798 if ac.ID != nil { 799 objectMap["id"] = ac.ID 800 } 801 if ac.Name != nil { 802 objectMap["name"] = ac.Name 803 } 804 if ac.Type != nil { 805 objectMap["type"] = ac.Type 806 } 807 return json.Marshal(objectMap) 808} 809 810// UnmarshalJSON is the custom unmarshaler for APIContract struct. 811func (ac *APIContract) UnmarshalJSON(body []byte) error { 812 var m map[string]*json.RawMessage 813 err := json.Unmarshal(body, &m) 814 if err != nil { 815 return err 816 } 817 for k, v := range m { 818 switch k { 819 case "properties": 820 if v != nil { 821 var APIContractProperties APIContractProperties 822 err = json.Unmarshal(*v, &APIContractProperties) 823 if err != nil { 824 return err 825 } 826 ac.APIContractProperties = &APIContractProperties 827 } 828 case "id": 829 if v != nil { 830 var ID string 831 err = json.Unmarshal(*v, &ID) 832 if err != nil { 833 return err 834 } 835 ac.ID = &ID 836 } 837 case "name": 838 if v != nil { 839 var name string 840 err = json.Unmarshal(*v, &name) 841 if err != nil { 842 return err 843 } 844 ac.Name = &name 845 } 846 case "type": 847 if v != nil { 848 var typeVar string 849 err = json.Unmarshal(*v, &typeVar) 850 if err != nil { 851 return err 852 } 853 ac.Type = &typeVar 854 } 855 } 856 } 857 858 return nil 859} 860 861// APIContractProperties api Entity Properties 862type APIContractProperties struct { 863 // DisplayName - API name. 864 DisplayName *string `json:"displayName,omitempty"` 865 // ServiceURL - Absolute URL of the backend service implementing this API. 866 ServiceURL *string `json:"serviceUrl,omitempty"` 867 // 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. 868 Path *string `json:"path,omitempty"` 869 // Protocols - Describes on which protocols the operations in this API can be invoked. 870 Protocols *[]Protocol `json:"protocols,omitempty"` 871 APIVersionSet *APIVersionSetContractDetails `json:"apiVersionSet,omitempty"` 872 // Description - Description of the API. May include HTML formatting tags. 873 Description *string `json:"description,omitempty"` 874 // AuthenticationSettings - Collection of authentication settings included into this API. 875 AuthenticationSettings *AuthenticationSettingsContract `json:"authenticationSettings,omitempty"` 876 // SubscriptionKeyParameterNames - Protocols over which API is made available. 877 SubscriptionKeyParameterNames *SubscriptionKeyParameterNamesContract `json:"subscriptionKeyParameterNames,omitempty"` 878 // APIType - Type of API. Possible values include: 'HTTP', 'Soap' 879 APIType APIType `json:"type,omitempty"` 880 // APIRevision - Describes the Revision of the Api. If no value is provided, default revision 1 is created 881 APIRevision *string `json:"apiRevision,omitempty"` 882 // APIVersion - Indicates the Version identifier of the API if the API is versioned 883 APIVersion *string `json:"apiVersion,omitempty"` 884 // IsCurrent - Indicates if API revision is current api revision. 885 IsCurrent *bool `json:"isCurrent,omitempty"` 886 // IsOnline - Indicates if API revision is accessible via the gateway. 887 IsOnline *bool `json:"isOnline,omitempty"` 888 // APIRevisionDescription - Description of the Api Revision. 889 APIRevisionDescription *string `json:"apiRevisionDescription,omitempty"` 890 // APIVersionDescription - Description of the Api Version. 891 APIVersionDescription *string `json:"apiVersionDescription,omitempty"` 892 // APIVersionSetID - A resource identifier for the related ApiVersionSet. 893 APIVersionSetID *string `json:"apiVersionSetId,omitempty"` 894} 895 896// APIContractUpdateProperties API update contract properties. 897type APIContractUpdateProperties struct { 898 // DisplayName - API name. 899 DisplayName *string `json:"displayName,omitempty"` 900 // ServiceURL - Absolute URL of the backend service implementing this API. 901 ServiceURL *string `json:"serviceUrl,omitempty"` 902 // 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. 903 Path *string `json:"path,omitempty"` 904 // Protocols - Describes on which protocols the operations in this API can be invoked. 905 Protocols *[]Protocol `json:"protocols,omitempty"` 906 // Description - Description of the API. May include HTML formatting tags. 907 Description *string `json:"description,omitempty"` 908 // AuthenticationSettings - Collection of authentication settings included into this API. 909 AuthenticationSettings *AuthenticationSettingsContract `json:"authenticationSettings,omitempty"` 910 // SubscriptionKeyParameterNames - Protocols over which API is made available. 911 SubscriptionKeyParameterNames *SubscriptionKeyParameterNamesContract `json:"subscriptionKeyParameterNames,omitempty"` 912 // APIType - Type of API. Possible values include: 'HTTP', 'Soap' 913 APIType APIType `json:"type,omitempty"` 914 // APIRevision - Describes the Revision of the Api. If no value is provided, default revision 1 is created 915 APIRevision *string `json:"apiRevision,omitempty"` 916 // APIVersion - Indicates the Version identifier of the API if the API is versioned 917 APIVersion *string `json:"apiVersion,omitempty"` 918 // IsCurrent - Indicates if API revision is current api revision. 919 IsCurrent *bool `json:"isCurrent,omitempty"` 920 // IsOnline - Indicates if API revision is accessible via the gateway. 921 IsOnline *bool `json:"isOnline,omitempty"` 922 // APIRevisionDescription - Description of the Api Revision. 923 APIRevisionDescription *string `json:"apiRevisionDescription,omitempty"` 924 // APIVersionDescription - Description of the Api Version. 925 APIVersionDescription *string `json:"apiVersionDescription,omitempty"` 926 // APIVersionSetID - A resource identifier for the related ApiVersionSet. 927 APIVersionSetID *string `json:"apiVersionSetId,omitempty"` 928} 929 930// APICreateOrUpdateParameter API Create or Update Parameters. 931type APICreateOrUpdateParameter struct { 932 // APICreateOrUpdateProperties - Api entity create of update properties. 933 *APICreateOrUpdateProperties `json:"properties,omitempty"` 934} 935 936// MarshalJSON is the custom marshaler for APICreateOrUpdateParameter. 937func (acoup APICreateOrUpdateParameter) MarshalJSON() ([]byte, error) { 938 objectMap := make(map[string]interface{}) 939 if acoup.APICreateOrUpdateProperties != nil { 940 objectMap["properties"] = acoup.APICreateOrUpdateProperties 941 } 942 return json.Marshal(objectMap) 943} 944 945// UnmarshalJSON is the custom unmarshaler for APICreateOrUpdateParameter struct. 946func (acoup *APICreateOrUpdateParameter) UnmarshalJSON(body []byte) error { 947 var m map[string]*json.RawMessage 948 err := json.Unmarshal(body, &m) 949 if err != nil { 950 return err 951 } 952 for k, v := range m { 953 switch k { 954 case "properties": 955 if v != nil { 956 var APICreateOrUpdateProperties APICreateOrUpdateProperties 957 err = json.Unmarshal(*v, &APICreateOrUpdateProperties) 958 if err != nil { 959 return err 960 } 961 acoup.APICreateOrUpdateProperties = &APICreateOrUpdateProperties 962 } 963 } 964 } 965 966 return nil 967} 968 969// APICreateOrUpdateProperties api Create or Update Properties. 970type APICreateOrUpdateProperties struct { 971 // ContentValue - Content value when Importing an API. 972 ContentValue *string `json:"contentValue,omitempty"` 973 // ContentFormat - Format of the Content in which the API is getting imported. Possible values include: 'WadlXML', 'WadlLinkJSON', 'SwaggerJSON', 'SwaggerLinkJSON', 'Wsdl', 'WsdlLink' 974 ContentFormat ContentFormat `json:"contentFormat,omitempty"` 975 // WsdlSelector - Criteria to limit import of WSDL to a subset of the document. 976 WsdlSelector *APICreateOrUpdatePropertiesWsdlSelector `json:"wsdlSelector,omitempty"` 977 // SoapAPIType - Type of Api to create. 978 // * `http` creates a SOAP to REST API 979 // * `soap` creates a SOAP pass-through API. Possible values include: 'SoapToRest', 'SoapPassThrough' 980 SoapAPIType SoapAPIType `json:"apiType,omitempty"` 981 // DisplayName - API name. 982 DisplayName *string `json:"displayName,omitempty"` 983 // ServiceURL - Absolute URL of the backend service implementing this API. 984 ServiceURL *string `json:"serviceUrl,omitempty"` 985 // 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. 986 Path *string `json:"path,omitempty"` 987 // Protocols - Describes on which protocols the operations in this API can be invoked. 988 Protocols *[]Protocol `json:"protocols,omitempty"` 989 APIVersionSet *APIVersionSetContractDetails `json:"apiVersionSet,omitempty"` 990 // Description - Description of the API. May include HTML formatting tags. 991 Description *string `json:"description,omitempty"` 992 // AuthenticationSettings - Collection of authentication settings included into this API. 993 AuthenticationSettings *AuthenticationSettingsContract `json:"authenticationSettings,omitempty"` 994 // SubscriptionKeyParameterNames - Protocols over which API is made available. 995 SubscriptionKeyParameterNames *SubscriptionKeyParameterNamesContract `json:"subscriptionKeyParameterNames,omitempty"` 996 // APIType - Type of API. Possible values include: 'HTTP', 'Soap' 997 APIType APIType `json:"type,omitempty"` 998 // APIRevision - Describes the Revision of the Api. If no value is provided, default revision 1 is created 999 APIRevision *string `json:"apiRevision,omitempty"` 1000 // APIVersion - Indicates the Version identifier of the API if the API is versioned 1001 APIVersion *string `json:"apiVersion,omitempty"` 1002 // IsCurrent - Indicates if API revision is current api revision. 1003 IsCurrent *bool `json:"isCurrent,omitempty"` 1004 // IsOnline - Indicates if API revision is accessible via the gateway. 1005 IsOnline *bool `json:"isOnline,omitempty"` 1006 // APIRevisionDescription - Description of the Api Revision. 1007 APIRevisionDescription *string `json:"apiRevisionDescription,omitempty"` 1008 // APIVersionDescription - Description of the Api Version. 1009 APIVersionDescription *string `json:"apiVersionDescription,omitempty"` 1010 // APIVersionSetID - A resource identifier for the related ApiVersionSet. 1011 APIVersionSetID *string `json:"apiVersionSetId,omitempty"` 1012} 1013 1014// APICreateOrUpdatePropertiesWsdlSelector criteria to limit import of WSDL to a subset of the document. 1015type APICreateOrUpdatePropertiesWsdlSelector struct { 1016 // WsdlServiceName - Name of service to import from WSDL 1017 WsdlServiceName *string `json:"wsdlServiceName,omitempty"` 1018 // WsdlEndpointName - Name of endpoint(port) to import from WSDL 1019 WsdlEndpointName *string `json:"wsdlEndpointName,omitempty"` 1020} 1021 1022// APIEntityBaseContract API base contract details. 1023type APIEntityBaseContract struct { 1024 // Description - Description of the API. May include HTML formatting tags. 1025 Description *string `json:"description,omitempty"` 1026 // AuthenticationSettings - Collection of authentication settings included into this API. 1027 AuthenticationSettings *AuthenticationSettingsContract `json:"authenticationSettings,omitempty"` 1028 // SubscriptionKeyParameterNames - Protocols over which API is made available. 1029 SubscriptionKeyParameterNames *SubscriptionKeyParameterNamesContract `json:"subscriptionKeyParameterNames,omitempty"` 1030 // APIType - Type of API. Possible values include: 'HTTP', 'Soap' 1031 APIType APIType `json:"type,omitempty"` 1032 // APIRevision - Describes the Revision of the Api. If no value is provided, default revision 1 is created 1033 APIRevision *string `json:"apiRevision,omitempty"` 1034 // APIVersion - Indicates the Version identifier of the API if the API is versioned 1035 APIVersion *string `json:"apiVersion,omitempty"` 1036 // IsCurrent - Indicates if API revision is current api revision. 1037 IsCurrent *bool `json:"isCurrent,omitempty"` 1038 // IsOnline - Indicates if API revision is accessible via the gateway. 1039 IsOnline *bool `json:"isOnline,omitempty"` 1040 // APIRevisionDescription - Description of the Api Revision. 1041 APIRevisionDescription *string `json:"apiRevisionDescription,omitempty"` 1042 // APIVersionDescription - Description of the Api Version. 1043 APIVersionDescription *string `json:"apiVersionDescription,omitempty"` 1044 // APIVersionSetID - A resource identifier for the related ApiVersionSet. 1045 APIVersionSetID *string `json:"apiVersionSetId,omitempty"` 1046} 1047 1048// APIExportResult API Export result Blob Uri. 1049type APIExportResult struct { 1050 autorest.Response `json:"-"` 1051 // Link - Link to the Storage Blob containing the result of the export operation. The Blob Uri is only valid for 5 minutes. 1052 Link *string `json:"link,omitempty"` 1053} 1054 1055// ApimResource the Resource definition. 1056type ApimResource struct { 1057 // ID - Resource ID. 1058 ID *string `json:"id,omitempty"` 1059 // Name - Resource name. 1060 Name *string `json:"name,omitempty"` 1061 // Type - Resource type for API Management resource is set to Microsoft.ApiManagement. 1062 Type *string `json:"type,omitempty"` 1063 // Tags - Resource tags. 1064 Tags map[string]*string `json:"tags"` 1065} 1066 1067// MarshalJSON is the custom marshaler for ApimResource. 1068func (ar ApimResource) MarshalJSON() ([]byte, error) { 1069 objectMap := make(map[string]interface{}) 1070 if ar.ID != nil { 1071 objectMap["id"] = ar.ID 1072 } 1073 if ar.Name != nil { 1074 objectMap["name"] = ar.Name 1075 } 1076 if ar.Type != nil { 1077 objectMap["type"] = ar.Type 1078 } 1079 if ar.Tags != nil { 1080 objectMap["tags"] = ar.Tags 1081 } 1082 return json.Marshal(objectMap) 1083} 1084 1085// APIReleaseCollection paged Api Revision list representation. 1086type APIReleaseCollection struct { 1087 autorest.Response `json:"-"` 1088 // Value - Page values. 1089 Value *[]APIReleaseContract `json:"value,omitempty"` 1090 // NextLink - Next page link if any. 1091 NextLink *string `json:"nextLink,omitempty"` 1092} 1093 1094// APIReleaseCollectionIterator provides access to a complete listing of APIReleaseContract values. 1095type APIReleaseCollectionIterator struct { 1096 i int 1097 page APIReleaseCollectionPage 1098} 1099 1100// Next advances to the next value. If there was an error making 1101// the request the iterator does not advance and the error is returned. 1102func (iter *APIReleaseCollectionIterator) Next() error { 1103 iter.i++ 1104 if iter.i < len(iter.page.Values()) { 1105 return nil 1106 } 1107 err := iter.page.Next() 1108 if err != nil { 1109 iter.i-- 1110 return err 1111 } 1112 iter.i = 0 1113 return nil 1114} 1115 1116// NotDone returns true if the enumeration should be started or is not yet complete. 1117func (iter APIReleaseCollectionIterator) NotDone() bool { 1118 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 1119} 1120 1121// Response returns the raw server response from the last page request. 1122func (iter APIReleaseCollectionIterator) Response() APIReleaseCollection { 1123 return iter.page.Response() 1124} 1125 1126// Value returns the current value or a zero-initialized value if the 1127// iterator has advanced beyond the end of the collection. 1128func (iter APIReleaseCollectionIterator) Value() APIReleaseContract { 1129 if !iter.page.NotDone() { 1130 return APIReleaseContract{} 1131 } 1132 return iter.page.Values()[iter.i] 1133} 1134 1135// IsEmpty returns true if the ListResult contains no values. 1136func (arc APIReleaseCollection) IsEmpty() bool { 1137 return arc.Value == nil || len(*arc.Value) == 0 1138} 1139 1140// aPIReleaseCollectionPreparer prepares a request to retrieve the next set of results. 1141// It returns nil if no more results exist. 1142func (arc APIReleaseCollection) aPIReleaseCollectionPreparer() (*http.Request, error) { 1143 if arc.NextLink == nil || len(to.String(arc.NextLink)) < 1 { 1144 return nil, nil 1145 } 1146 return autorest.Prepare(&http.Request{}, 1147 autorest.AsJSON(), 1148 autorest.AsGet(), 1149 autorest.WithBaseURL(to.String(arc.NextLink))) 1150} 1151 1152// APIReleaseCollectionPage contains a page of APIReleaseContract values. 1153type APIReleaseCollectionPage struct { 1154 fn func(APIReleaseCollection) (APIReleaseCollection, error) 1155 arc APIReleaseCollection 1156} 1157 1158// Next advances to the next page of values. If there was an error making 1159// the request the page does not advance and the error is returned. 1160func (page *APIReleaseCollectionPage) Next() error { 1161 next, err := page.fn(page.arc) 1162 if err != nil { 1163 return err 1164 } 1165 page.arc = next 1166 return nil 1167} 1168 1169// NotDone returns true if the page enumeration should be started or is not yet complete. 1170func (page APIReleaseCollectionPage) NotDone() bool { 1171 return !page.arc.IsEmpty() 1172} 1173 1174// Response returns the raw server response from the last page request. 1175func (page APIReleaseCollectionPage) Response() APIReleaseCollection { 1176 return page.arc 1177} 1178 1179// Values returns the slice of values for the current page or nil if there are no values. 1180func (page APIReleaseCollectionPage) Values() []APIReleaseContract { 1181 if page.arc.IsEmpty() { 1182 return nil 1183 } 1184 return *page.arc.Value 1185} 1186 1187// APIReleaseContract api Release details. 1188type APIReleaseContract struct { 1189 autorest.Response `json:"-"` 1190 // APIReleaseContractProperties - Properties of the Api Release Contract. 1191 *APIReleaseContractProperties `json:"properties,omitempty"` 1192 // ID - Resource ID. 1193 ID *string `json:"id,omitempty"` 1194 // Name - Resource name. 1195 Name *string `json:"name,omitempty"` 1196 // Type - Resource type for API Management resource. 1197 Type *string `json:"type,omitempty"` 1198} 1199 1200// MarshalJSON is the custom marshaler for APIReleaseContract. 1201func (arc APIReleaseContract) MarshalJSON() ([]byte, error) { 1202 objectMap := make(map[string]interface{}) 1203 if arc.APIReleaseContractProperties != nil { 1204 objectMap["properties"] = arc.APIReleaseContractProperties 1205 } 1206 if arc.ID != nil { 1207 objectMap["id"] = arc.ID 1208 } 1209 if arc.Name != nil { 1210 objectMap["name"] = arc.Name 1211 } 1212 if arc.Type != nil { 1213 objectMap["type"] = arc.Type 1214 } 1215 return json.Marshal(objectMap) 1216} 1217 1218// UnmarshalJSON is the custom unmarshaler for APIReleaseContract struct. 1219func (arc *APIReleaseContract) UnmarshalJSON(body []byte) error { 1220 var m map[string]*json.RawMessage 1221 err := json.Unmarshal(body, &m) 1222 if err != nil { 1223 return err 1224 } 1225 for k, v := range m { 1226 switch k { 1227 case "properties": 1228 if v != nil { 1229 var APIReleaseContractProperties APIReleaseContractProperties 1230 err = json.Unmarshal(*v, &APIReleaseContractProperties) 1231 if err != nil { 1232 return err 1233 } 1234 arc.APIReleaseContractProperties = &APIReleaseContractProperties 1235 } 1236 case "id": 1237 if v != nil { 1238 var ID string 1239 err = json.Unmarshal(*v, &ID) 1240 if err != nil { 1241 return err 1242 } 1243 arc.ID = &ID 1244 } 1245 case "name": 1246 if v != nil { 1247 var name string 1248 err = json.Unmarshal(*v, &name) 1249 if err != nil { 1250 return err 1251 } 1252 arc.Name = &name 1253 } 1254 case "type": 1255 if v != nil { 1256 var typeVar string 1257 err = json.Unmarshal(*v, &typeVar) 1258 if err != nil { 1259 return err 1260 } 1261 arc.Type = &typeVar 1262 } 1263 } 1264 } 1265 1266 return nil 1267} 1268 1269// APIReleaseContractProperties API Release details 1270type APIReleaseContractProperties struct { 1271 // APIID - Identifier of the API the release belongs to. 1272 APIID *string `json:"apiId,omitempty"` 1273 // CreatedDateTime - 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. 1274 CreatedDateTime *date.Time `json:"createdDateTime,omitempty"` 1275 // UpdatedDateTime - The time the API release was updated. 1276 UpdatedDateTime *date.Time `json:"updatedDateTime,omitempty"` 1277 // Notes - Release Notes 1278 Notes *string `json:"notes,omitempty"` 1279} 1280 1281// APIRevisionCollection paged Api Revision list representation. 1282type APIRevisionCollection struct { 1283 autorest.Response `json:"-"` 1284 // Value - Page values. 1285 Value *[]APIRevisionContract `json:"value,omitempty"` 1286 // NextLink - Next page link if any. 1287 NextLink *string `json:"nextLink,omitempty"` 1288} 1289 1290// APIRevisionCollectionIterator provides access to a complete listing of APIRevisionContract values. 1291type APIRevisionCollectionIterator struct { 1292 i int 1293 page APIRevisionCollectionPage 1294} 1295 1296// Next advances to the next value. If there was an error making 1297// the request the iterator does not advance and the error is returned. 1298func (iter *APIRevisionCollectionIterator) Next() error { 1299 iter.i++ 1300 if iter.i < len(iter.page.Values()) { 1301 return nil 1302 } 1303 err := iter.page.Next() 1304 if err != nil { 1305 iter.i-- 1306 return err 1307 } 1308 iter.i = 0 1309 return nil 1310} 1311 1312// NotDone returns true if the enumeration should be started or is not yet complete. 1313func (iter APIRevisionCollectionIterator) NotDone() bool { 1314 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 1315} 1316 1317// Response returns the raw server response from the last page request. 1318func (iter APIRevisionCollectionIterator) Response() APIRevisionCollection { 1319 return iter.page.Response() 1320} 1321 1322// Value returns the current value or a zero-initialized value if the 1323// iterator has advanced beyond the end of the collection. 1324func (iter APIRevisionCollectionIterator) Value() APIRevisionContract { 1325 if !iter.page.NotDone() { 1326 return APIRevisionContract{} 1327 } 1328 return iter.page.Values()[iter.i] 1329} 1330 1331// IsEmpty returns true if the ListResult contains no values. 1332func (arc APIRevisionCollection) IsEmpty() bool { 1333 return arc.Value == nil || len(*arc.Value) == 0 1334} 1335 1336// aPIRevisionCollectionPreparer prepares a request to retrieve the next set of results. 1337// It returns nil if no more results exist. 1338func (arc APIRevisionCollection) aPIRevisionCollectionPreparer() (*http.Request, error) { 1339 if arc.NextLink == nil || len(to.String(arc.NextLink)) < 1 { 1340 return nil, nil 1341 } 1342 return autorest.Prepare(&http.Request{}, 1343 autorest.AsJSON(), 1344 autorest.AsGet(), 1345 autorest.WithBaseURL(to.String(arc.NextLink))) 1346} 1347 1348// APIRevisionCollectionPage contains a page of APIRevisionContract values. 1349type APIRevisionCollectionPage struct { 1350 fn func(APIRevisionCollection) (APIRevisionCollection, error) 1351 arc APIRevisionCollection 1352} 1353 1354// Next advances to the next page of values. If there was an error making 1355// the request the page does not advance and the error is returned. 1356func (page *APIRevisionCollectionPage) Next() error { 1357 next, err := page.fn(page.arc) 1358 if err != nil { 1359 return err 1360 } 1361 page.arc = next 1362 return nil 1363} 1364 1365// NotDone returns true if the page enumeration should be started or is not yet complete. 1366func (page APIRevisionCollectionPage) NotDone() bool { 1367 return !page.arc.IsEmpty() 1368} 1369 1370// Response returns the raw server response from the last page request. 1371func (page APIRevisionCollectionPage) Response() APIRevisionCollection { 1372 return page.arc 1373} 1374 1375// Values returns the slice of values for the current page or nil if there are no values. 1376func (page APIRevisionCollectionPage) Values() []APIRevisionContract { 1377 if page.arc.IsEmpty() { 1378 return nil 1379 } 1380 return *page.arc.Value 1381} 1382 1383// APIRevisionContract summary of revision metadata. 1384type APIRevisionContract struct { 1385 // APIID - Identifier of the API Revision. 1386 APIID *string `json:"apiId,omitempty"` 1387 // APIRevision - Revision number of API. 1388 APIRevision *string `json:"apiRevision,omitempty"` 1389 // CreatedDateTime - 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. 1390 CreatedDateTime *date.Time `json:"createdDateTime,omitempty"` 1391 // UpdatedDateTime - 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. 1392 UpdatedDateTime *date.Time `json:"updatedDateTime,omitempty"` 1393 // Description - Description of the API Revision. 1394 Description *string `json:"description,omitempty"` 1395 // PrivateURL - Gateway URL for accessing the non-current API Revision. 1396 PrivateURL *string `json:"privateUrl,omitempty"` 1397 // IsOnline - Indicates if API revision is the current api revision. 1398 IsOnline *bool `json:"isOnline,omitempty"` 1399 // IsCurrent - Indicates if API revision is accessible via the gateway. 1400 IsCurrent *bool `json:"isCurrent,omitempty"` 1401} 1402 1403// APIRevisionInfoContract object used to create an API Revision or Version based on an existing API Revision 1404type APIRevisionInfoContract struct { 1405 // SourceAPIID - Resource identifier of API to be used to create the revision from. 1406 SourceAPIID *string `json:"sourceApiId,omitempty"` 1407 // APIVersionName - Version identifier for the new API Version. 1408 APIVersionName *string `json:"apiVersionName,omitempty"` 1409 // APIRevisionDescription - Description of new API Revision. 1410 APIRevisionDescription *string `json:"apiRevisionDescription,omitempty"` 1411 // APIVersionSet - Version set details 1412 APIVersionSet *APIVersionSetContractDetails `json:"apiVersionSet,omitempty"` 1413} 1414 1415// APITagResourceContractProperties API contract properties for the Tag Resources. 1416type APITagResourceContractProperties struct { 1417 // ID - API identifier in the form /apis/{apiId}. 1418 ID *string `json:"id,omitempty"` 1419 // Name - API name. 1420 Name *string `json:"name,omitempty"` 1421 // ServiceURL - Absolute URL of the backend service implementing this API. 1422 ServiceURL *string `json:"serviceUrl,omitempty"` 1423 // 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. 1424 Path *string `json:"path,omitempty"` 1425 // Protocols - Describes on which protocols the operations in this API can be invoked. 1426 Protocols *[]Protocol `json:"protocols,omitempty"` 1427 // Description - Description of the API. May include HTML formatting tags. 1428 Description *string `json:"description,omitempty"` 1429 // AuthenticationSettings - Collection of authentication settings included into this API. 1430 AuthenticationSettings *AuthenticationSettingsContract `json:"authenticationSettings,omitempty"` 1431 // SubscriptionKeyParameterNames - Protocols over which API is made available. 1432 SubscriptionKeyParameterNames *SubscriptionKeyParameterNamesContract `json:"subscriptionKeyParameterNames,omitempty"` 1433 // APIType - Type of API. Possible values include: 'HTTP', 'Soap' 1434 APIType APIType `json:"type,omitempty"` 1435 // APIRevision - Describes the Revision of the Api. If no value is provided, default revision 1 is created 1436 APIRevision *string `json:"apiRevision,omitempty"` 1437 // APIVersion - Indicates the Version identifier of the API if the API is versioned 1438 APIVersion *string `json:"apiVersion,omitempty"` 1439 // IsCurrent - Indicates if API revision is current api revision. 1440 IsCurrent *bool `json:"isCurrent,omitempty"` 1441 // IsOnline - Indicates if API revision is accessible via the gateway. 1442 IsOnline *bool `json:"isOnline,omitempty"` 1443 // APIRevisionDescription - Description of the Api Revision. 1444 APIRevisionDescription *string `json:"apiRevisionDescription,omitempty"` 1445 // APIVersionDescription - Description of the Api Version. 1446 APIVersionDescription *string `json:"apiVersionDescription,omitempty"` 1447 // APIVersionSetID - A resource identifier for the related ApiVersionSet. 1448 APIVersionSetID *string `json:"apiVersionSetId,omitempty"` 1449} 1450 1451// APIUpdateContract API update contract details. 1452type APIUpdateContract struct { 1453 // APIContractUpdateProperties - Properties of the API entity that can be updated. 1454 *APIContractUpdateProperties `json:"properties,omitempty"` 1455} 1456 1457// MarshalJSON is the custom marshaler for APIUpdateContract. 1458func (auc APIUpdateContract) MarshalJSON() ([]byte, error) { 1459 objectMap := make(map[string]interface{}) 1460 if auc.APIContractUpdateProperties != nil { 1461 objectMap["properties"] = auc.APIContractUpdateProperties 1462 } 1463 return json.Marshal(objectMap) 1464} 1465 1466// UnmarshalJSON is the custom unmarshaler for APIUpdateContract struct. 1467func (auc *APIUpdateContract) UnmarshalJSON(body []byte) error { 1468 var m map[string]*json.RawMessage 1469 err := json.Unmarshal(body, &m) 1470 if err != nil { 1471 return err 1472 } 1473 for k, v := range m { 1474 switch k { 1475 case "properties": 1476 if v != nil { 1477 var APIContractUpdateProperties APIContractUpdateProperties 1478 err = json.Unmarshal(*v, &APIContractUpdateProperties) 1479 if err != nil { 1480 return err 1481 } 1482 auc.APIContractUpdateProperties = &APIContractUpdateProperties 1483 } 1484 } 1485 } 1486 1487 return nil 1488} 1489 1490// APIVersionSetCollection paged Api Version Set list representation. 1491type APIVersionSetCollection struct { 1492 autorest.Response `json:"-"` 1493 // Value - Page values. 1494 Value *[]APIVersionSetContract `json:"value,omitempty"` 1495 // NextLink - Next page link if any. 1496 NextLink *string `json:"nextLink,omitempty"` 1497} 1498 1499// APIVersionSetCollectionIterator provides access to a complete listing of APIVersionSetContract values. 1500type APIVersionSetCollectionIterator struct { 1501 i int 1502 page APIVersionSetCollectionPage 1503} 1504 1505// Next advances to the next value. If there was an error making 1506// the request the iterator does not advance and the error is returned. 1507func (iter *APIVersionSetCollectionIterator) Next() error { 1508 iter.i++ 1509 if iter.i < len(iter.page.Values()) { 1510 return nil 1511 } 1512 err := iter.page.Next() 1513 if err != nil { 1514 iter.i-- 1515 return err 1516 } 1517 iter.i = 0 1518 return nil 1519} 1520 1521// NotDone returns true if the enumeration should be started or is not yet complete. 1522func (iter APIVersionSetCollectionIterator) NotDone() bool { 1523 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 1524} 1525 1526// Response returns the raw server response from the last page request. 1527func (iter APIVersionSetCollectionIterator) Response() APIVersionSetCollection { 1528 return iter.page.Response() 1529} 1530 1531// Value returns the current value or a zero-initialized value if the 1532// iterator has advanced beyond the end of the collection. 1533func (iter APIVersionSetCollectionIterator) Value() APIVersionSetContract { 1534 if !iter.page.NotDone() { 1535 return APIVersionSetContract{} 1536 } 1537 return iter.page.Values()[iter.i] 1538} 1539 1540// IsEmpty returns true if the ListResult contains no values. 1541func (avsc APIVersionSetCollection) IsEmpty() bool { 1542 return avsc.Value == nil || len(*avsc.Value) == 0 1543} 1544 1545// aPIVersionSetCollectionPreparer prepares a request to retrieve the next set of results. 1546// It returns nil if no more results exist. 1547func (avsc APIVersionSetCollection) aPIVersionSetCollectionPreparer() (*http.Request, error) { 1548 if avsc.NextLink == nil || len(to.String(avsc.NextLink)) < 1 { 1549 return nil, nil 1550 } 1551 return autorest.Prepare(&http.Request{}, 1552 autorest.AsJSON(), 1553 autorest.AsGet(), 1554 autorest.WithBaseURL(to.String(avsc.NextLink))) 1555} 1556 1557// APIVersionSetCollectionPage contains a page of APIVersionSetContract values. 1558type APIVersionSetCollectionPage struct { 1559 fn func(APIVersionSetCollection) (APIVersionSetCollection, error) 1560 avsc APIVersionSetCollection 1561} 1562 1563// Next advances to the next page of values. If there was an error making 1564// the request the page does not advance and the error is returned. 1565func (page *APIVersionSetCollectionPage) Next() error { 1566 next, err := page.fn(page.avsc) 1567 if err != nil { 1568 return err 1569 } 1570 page.avsc = next 1571 return nil 1572} 1573 1574// NotDone returns true if the page enumeration should be started or is not yet complete. 1575func (page APIVersionSetCollectionPage) NotDone() bool { 1576 return !page.avsc.IsEmpty() 1577} 1578 1579// Response returns the raw server response from the last page request. 1580func (page APIVersionSetCollectionPage) Response() APIVersionSetCollection { 1581 return page.avsc 1582} 1583 1584// Values returns the slice of values for the current page or nil if there are no values. 1585func (page APIVersionSetCollectionPage) Values() []APIVersionSetContract { 1586 if page.avsc.IsEmpty() { 1587 return nil 1588 } 1589 return *page.avsc.Value 1590} 1591 1592// APIVersionSetContract api Version Set Contract details. 1593type APIVersionSetContract struct { 1594 autorest.Response `json:"-"` 1595 // APIVersionSetContractProperties - Api VersionSet contract properties. 1596 *APIVersionSetContractProperties `json:"properties,omitempty"` 1597 // ID - Resource ID. 1598 ID *string `json:"id,omitempty"` 1599 // Name - Resource name. 1600 Name *string `json:"name,omitempty"` 1601 // Type - Resource type for API Management resource. 1602 Type *string `json:"type,omitempty"` 1603} 1604 1605// MarshalJSON is the custom marshaler for APIVersionSetContract. 1606func (avsc APIVersionSetContract) MarshalJSON() ([]byte, error) { 1607 objectMap := make(map[string]interface{}) 1608 if avsc.APIVersionSetContractProperties != nil { 1609 objectMap["properties"] = avsc.APIVersionSetContractProperties 1610 } 1611 if avsc.ID != nil { 1612 objectMap["id"] = avsc.ID 1613 } 1614 if avsc.Name != nil { 1615 objectMap["name"] = avsc.Name 1616 } 1617 if avsc.Type != nil { 1618 objectMap["type"] = avsc.Type 1619 } 1620 return json.Marshal(objectMap) 1621} 1622 1623// UnmarshalJSON is the custom unmarshaler for APIVersionSetContract struct. 1624func (avsc *APIVersionSetContract) UnmarshalJSON(body []byte) error { 1625 var m map[string]*json.RawMessage 1626 err := json.Unmarshal(body, &m) 1627 if err != nil { 1628 return err 1629 } 1630 for k, v := range m { 1631 switch k { 1632 case "properties": 1633 if v != nil { 1634 var APIVersionSetContractProperties APIVersionSetContractProperties 1635 err = json.Unmarshal(*v, &APIVersionSetContractProperties) 1636 if err != nil { 1637 return err 1638 } 1639 avsc.APIVersionSetContractProperties = &APIVersionSetContractProperties 1640 } 1641 case "id": 1642 if v != nil { 1643 var ID string 1644 err = json.Unmarshal(*v, &ID) 1645 if err != nil { 1646 return err 1647 } 1648 avsc.ID = &ID 1649 } 1650 case "name": 1651 if v != nil { 1652 var name string 1653 err = json.Unmarshal(*v, &name) 1654 if err != nil { 1655 return err 1656 } 1657 avsc.Name = &name 1658 } 1659 case "type": 1660 if v != nil { 1661 var typeVar string 1662 err = json.Unmarshal(*v, &typeVar) 1663 if err != nil { 1664 return err 1665 } 1666 avsc.Type = &typeVar 1667 } 1668 } 1669 } 1670 1671 return nil 1672} 1673 1674// APIVersionSetContractDetails an API Version Set contains the common configuration for a set of API Versions 1675// relating 1676type APIVersionSetContractDetails struct { 1677 // ID - Identifier for existing API Version Set. Omit this value to create a new Version Set. 1678 ID *string `json:"id,omitempty"` 1679 // Description - Description of API Version Set. 1680 Description *string `json:"description,omitempty"` 1681 // VersioningScheme - An value that determines where the API Version identifer will be located in a HTTP request. Possible values include: 'VersioningScheme1Segment', 'VersioningScheme1Query', 'VersioningScheme1Header' 1682 VersioningScheme VersioningScheme1 `json:"versioningScheme,omitempty"` 1683 // VersionQueryName - Name of query parameter that indicates the API Version if versioningScheme is set to `query`. 1684 VersionQueryName *string `json:"versionQueryName,omitempty"` 1685 // VersionHeaderName - Name of HTTP header parameter that indicates the API Version if versioningScheme is set to `header`. 1686 VersionHeaderName *string `json:"versionHeaderName,omitempty"` 1687} 1688 1689// APIVersionSetContractProperties properties of an API Version Set. 1690type APIVersionSetContractProperties struct { 1691 // DisplayName - Name of API Version Set 1692 DisplayName *string `json:"displayName,omitempty"` 1693 // VersioningScheme - An value that determines where the API Version identifer will be located in a HTTP request. Possible values include: 'VersioningSchemeSegment', 'VersioningSchemeQuery', 'VersioningSchemeHeader' 1694 VersioningScheme VersioningScheme `json:"versioningScheme,omitempty"` 1695 // Description - Description of API Version Set. 1696 Description *string `json:"description,omitempty"` 1697 // VersionQueryName - Name of query parameter that indicates the API Version if versioningScheme is set to `query`. 1698 VersionQueryName *string `json:"versionQueryName,omitempty"` 1699 // VersionHeaderName - Name of HTTP header parameter that indicates the API Version if versioningScheme is set to `header`. 1700 VersionHeaderName *string `json:"versionHeaderName,omitempty"` 1701} 1702 1703// APIVersionSetEntityBase api Version set base parameters 1704type APIVersionSetEntityBase struct { 1705 // Description - Description of API Version Set. 1706 Description *string `json:"description,omitempty"` 1707 // VersionQueryName - Name of query parameter that indicates the API Version if versioningScheme is set to `query`. 1708 VersionQueryName *string `json:"versionQueryName,omitempty"` 1709 // VersionHeaderName - Name of HTTP header parameter that indicates the API Version if versioningScheme is set to `header`. 1710 VersionHeaderName *string `json:"versionHeaderName,omitempty"` 1711} 1712 1713// APIVersionSetUpdateParameters parameters to update or create an Api Version Set Contract. 1714type APIVersionSetUpdateParameters struct { 1715 // APIVersionSetUpdateParametersProperties - Parameters to update or create an Api Version Set Contract. 1716 *APIVersionSetUpdateParametersProperties `json:"properties,omitempty"` 1717} 1718 1719// MarshalJSON is the custom marshaler for APIVersionSetUpdateParameters. 1720func (avsup APIVersionSetUpdateParameters) MarshalJSON() ([]byte, error) { 1721 objectMap := make(map[string]interface{}) 1722 if avsup.APIVersionSetUpdateParametersProperties != nil { 1723 objectMap["properties"] = avsup.APIVersionSetUpdateParametersProperties 1724 } 1725 return json.Marshal(objectMap) 1726} 1727 1728// UnmarshalJSON is the custom unmarshaler for APIVersionSetUpdateParameters struct. 1729func (avsup *APIVersionSetUpdateParameters) UnmarshalJSON(body []byte) error { 1730 var m map[string]*json.RawMessage 1731 err := json.Unmarshal(body, &m) 1732 if err != nil { 1733 return err 1734 } 1735 for k, v := range m { 1736 switch k { 1737 case "properties": 1738 if v != nil { 1739 var APIVersionSetUpdateParametersProperties APIVersionSetUpdateParametersProperties 1740 err = json.Unmarshal(*v, &APIVersionSetUpdateParametersProperties) 1741 if err != nil { 1742 return err 1743 } 1744 avsup.APIVersionSetUpdateParametersProperties = &APIVersionSetUpdateParametersProperties 1745 } 1746 } 1747 } 1748 1749 return nil 1750} 1751 1752// APIVersionSetUpdateParametersProperties properties used to create or update an API Version Set. 1753type APIVersionSetUpdateParametersProperties struct { 1754 // DisplayName - Name of API Version Set 1755 DisplayName *string `json:"displayName,omitempty"` 1756 // VersioningScheme - An value that determines where the API Version identifer will be located in a HTTP request. Possible values include: 'VersioningSchemeSegment', 'VersioningSchemeQuery', 'VersioningSchemeHeader' 1757 VersioningScheme VersioningScheme `json:"versioningScheme,omitempty"` 1758 // Description - Description of API Version Set. 1759 Description *string `json:"description,omitempty"` 1760 // VersionQueryName - Name of query parameter that indicates the API Version if versioningScheme is set to `query`. 1761 VersionQueryName *string `json:"versionQueryName,omitempty"` 1762 // VersionHeaderName - Name of HTTP header parameter that indicates the API Version if versioningScheme is set to `header`. 1763 VersionHeaderName *string `json:"versionHeaderName,omitempty"` 1764} 1765 1766// AuthenticationSettingsContract API Authentication Settings. 1767type AuthenticationSettingsContract struct { 1768 // OAuth2 - OAuth2 Authentication settings 1769 OAuth2 *OAuth2AuthenticationSettingsContract `json:"oAuth2,omitempty"` 1770} 1771 1772// AuthorizationServerCollection paged OAuth2 Authorization Servers list representation. 1773type AuthorizationServerCollection struct { 1774 autorest.Response `json:"-"` 1775 // Value - Page values. 1776 Value *[]AuthorizationServerContract `json:"value,omitempty"` 1777 // Count - Total record count number across all pages. 1778 Count *int64 `json:"count,omitempty"` 1779 // NextLink - Next page link if any. 1780 NextLink *string `json:"nextLink,omitempty"` 1781} 1782 1783// AuthorizationServerCollectionIterator provides access to a complete listing of AuthorizationServerContract 1784// values. 1785type AuthorizationServerCollectionIterator struct { 1786 i int 1787 page AuthorizationServerCollectionPage 1788} 1789 1790// Next advances to the next value. If there was an error making 1791// the request the iterator does not advance and the error is returned. 1792func (iter *AuthorizationServerCollectionIterator) Next() error { 1793 iter.i++ 1794 if iter.i < len(iter.page.Values()) { 1795 return nil 1796 } 1797 err := iter.page.Next() 1798 if err != nil { 1799 iter.i-- 1800 return err 1801 } 1802 iter.i = 0 1803 return nil 1804} 1805 1806// NotDone returns true if the enumeration should be started or is not yet complete. 1807func (iter AuthorizationServerCollectionIterator) NotDone() bool { 1808 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 1809} 1810 1811// Response returns the raw server response from the last page request. 1812func (iter AuthorizationServerCollectionIterator) Response() AuthorizationServerCollection { 1813 return iter.page.Response() 1814} 1815 1816// Value returns the current value or a zero-initialized value if the 1817// iterator has advanced beyond the end of the collection. 1818func (iter AuthorizationServerCollectionIterator) Value() AuthorizationServerContract { 1819 if !iter.page.NotDone() { 1820 return AuthorizationServerContract{} 1821 } 1822 return iter.page.Values()[iter.i] 1823} 1824 1825// IsEmpty returns true if the ListResult contains no values. 1826func (asc AuthorizationServerCollection) IsEmpty() bool { 1827 return asc.Value == nil || len(*asc.Value) == 0 1828} 1829 1830// authorizationServerCollectionPreparer prepares a request to retrieve the next set of results. 1831// It returns nil if no more results exist. 1832func (asc AuthorizationServerCollection) authorizationServerCollectionPreparer() (*http.Request, error) { 1833 if asc.NextLink == nil || len(to.String(asc.NextLink)) < 1 { 1834 return nil, nil 1835 } 1836 return autorest.Prepare(&http.Request{}, 1837 autorest.AsJSON(), 1838 autorest.AsGet(), 1839 autorest.WithBaseURL(to.String(asc.NextLink))) 1840} 1841 1842// AuthorizationServerCollectionPage contains a page of AuthorizationServerContract values. 1843type AuthorizationServerCollectionPage struct { 1844 fn func(AuthorizationServerCollection) (AuthorizationServerCollection, error) 1845 asc AuthorizationServerCollection 1846} 1847 1848// Next advances to the next page of values. If there was an error making 1849// the request the page does not advance and the error is returned. 1850func (page *AuthorizationServerCollectionPage) Next() error { 1851 next, err := page.fn(page.asc) 1852 if err != nil { 1853 return err 1854 } 1855 page.asc = next 1856 return nil 1857} 1858 1859// NotDone returns true if the page enumeration should be started or is not yet complete. 1860func (page AuthorizationServerCollectionPage) NotDone() bool { 1861 return !page.asc.IsEmpty() 1862} 1863 1864// Response returns the raw server response from the last page request. 1865func (page AuthorizationServerCollectionPage) Response() AuthorizationServerCollection { 1866 return page.asc 1867} 1868 1869// Values returns the slice of values for the current page or nil if there are no values. 1870func (page AuthorizationServerCollectionPage) Values() []AuthorizationServerContract { 1871 if page.asc.IsEmpty() { 1872 return nil 1873 } 1874 return *page.asc.Value 1875} 1876 1877// AuthorizationServerContract external OAuth authorization server settings. 1878type AuthorizationServerContract struct { 1879 autorest.Response `json:"-"` 1880 // AuthorizationServerContractProperties - Properties of the External OAuth authorization server Contract. 1881 *AuthorizationServerContractProperties `json:"properties,omitempty"` 1882 // ID - Resource ID. 1883 ID *string `json:"id,omitempty"` 1884 // Name - Resource name. 1885 Name *string `json:"name,omitempty"` 1886 // Type - Resource type for API Management resource. 1887 Type *string `json:"type,omitempty"` 1888} 1889 1890// MarshalJSON is the custom marshaler for AuthorizationServerContract. 1891func (asc AuthorizationServerContract) MarshalJSON() ([]byte, error) { 1892 objectMap := make(map[string]interface{}) 1893 if asc.AuthorizationServerContractProperties != nil { 1894 objectMap["properties"] = asc.AuthorizationServerContractProperties 1895 } 1896 if asc.ID != nil { 1897 objectMap["id"] = asc.ID 1898 } 1899 if asc.Name != nil { 1900 objectMap["name"] = asc.Name 1901 } 1902 if asc.Type != nil { 1903 objectMap["type"] = asc.Type 1904 } 1905 return json.Marshal(objectMap) 1906} 1907 1908// UnmarshalJSON is the custom unmarshaler for AuthorizationServerContract struct. 1909func (asc *AuthorizationServerContract) UnmarshalJSON(body []byte) error { 1910 var m map[string]*json.RawMessage 1911 err := json.Unmarshal(body, &m) 1912 if err != nil { 1913 return err 1914 } 1915 for k, v := range m { 1916 switch k { 1917 case "properties": 1918 if v != nil { 1919 var authorizationServerContractProperties AuthorizationServerContractProperties 1920 err = json.Unmarshal(*v, &authorizationServerContractProperties) 1921 if err != nil { 1922 return err 1923 } 1924 asc.AuthorizationServerContractProperties = &authorizationServerContractProperties 1925 } 1926 case "id": 1927 if v != nil { 1928 var ID string 1929 err = json.Unmarshal(*v, &ID) 1930 if err != nil { 1931 return err 1932 } 1933 asc.ID = &ID 1934 } 1935 case "name": 1936 if v != nil { 1937 var name string 1938 err = json.Unmarshal(*v, &name) 1939 if err != nil { 1940 return err 1941 } 1942 asc.Name = &name 1943 } 1944 case "type": 1945 if v != nil { 1946 var typeVar string 1947 err = json.Unmarshal(*v, &typeVar) 1948 if err != nil { 1949 return err 1950 } 1951 asc.Type = &typeVar 1952 } 1953 } 1954 } 1955 1956 return nil 1957} 1958 1959// AuthorizationServerContractBaseProperties external OAuth authorization server Update settings contract. 1960type AuthorizationServerContractBaseProperties struct { 1961 // Description - Description of the authorization server. Can contain HTML formatting tags. 1962 Description *string `json:"description,omitempty"` 1963 // AuthorizationMethods - HTTP verbs supported by the authorization endpoint. GET must be always present. POST is optional. 1964 AuthorizationMethods *[]AuthorizationMethod `json:"authorizationMethods,omitempty"` 1965 // 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. 1966 ClientAuthenticationMethod *[]ClientAuthenticationMethod `json:"clientAuthenticationMethod,omitempty"` 1967 // 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"}. 1968 TokenBodyParameters *[]TokenBodyParameterContract `json:"tokenBodyParameters,omitempty"` 1969 // TokenEndpoint - OAuth token endpoint. Contains absolute URI to entity being referenced. 1970 TokenEndpoint *string `json:"tokenEndpoint,omitempty"` 1971 // 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. 1972 SupportState *bool `json:"supportState,omitempty"` 1973 // 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. 1974 DefaultScope *string `json:"defaultScope,omitempty"` 1975 // BearerTokenSendingMethods - Specifies the mechanism by which access token is passed to the API. 1976 BearerTokenSendingMethods *[]BearerTokenSendingMethod `json:"bearerTokenSendingMethods,omitempty"` 1977 // ClientSecret - Client or app secret registered with this authorization server. 1978 ClientSecret *string `json:"clientSecret,omitempty"` 1979 // ResourceOwnerUsername - Can be optionally specified when resource owner password grant type is supported by this authorization server. Default resource owner username. 1980 ResourceOwnerUsername *string `json:"resourceOwnerUsername,omitempty"` 1981 // ResourceOwnerPassword - Can be optionally specified when resource owner password grant type is supported by this authorization server. Default resource owner password. 1982 ResourceOwnerPassword *string `json:"resourceOwnerPassword,omitempty"` 1983} 1984 1985// AuthorizationServerContractProperties external OAuth authorization server settings Properties. 1986type AuthorizationServerContractProperties struct { 1987 // DisplayName - User-friendly authorization server name. 1988 DisplayName *string `json:"displayName,omitempty"` 1989 // ClientRegistrationEndpoint - Optional reference to a page where client or app registration for this authorization server is performed. Contains absolute URL to entity being referenced. 1990 ClientRegistrationEndpoint *string `json:"clientRegistrationEndpoint,omitempty"` 1991 // AuthorizationEndpoint - OAuth authorization endpoint. See http://tools.ietf.org/html/rfc6749#section-3.2. 1992 AuthorizationEndpoint *string `json:"authorizationEndpoint,omitempty"` 1993 // GrantTypes - Form of an authorization grant, which the client uses to request the access token. 1994 GrantTypes *[]GrantType `json:"grantTypes,omitempty"` 1995 // ClientID - Client or app id registered with this authorization server. 1996 ClientID *string `json:"clientId,omitempty"` 1997 // Description - Description of the authorization server. Can contain HTML formatting tags. 1998 Description *string `json:"description,omitempty"` 1999 // AuthorizationMethods - HTTP verbs supported by the authorization endpoint. GET must be always present. POST is optional. 2000 AuthorizationMethods *[]AuthorizationMethod `json:"authorizationMethods,omitempty"` 2001 // 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. 2002 ClientAuthenticationMethod *[]ClientAuthenticationMethod `json:"clientAuthenticationMethod,omitempty"` 2003 // 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"}. 2004 TokenBodyParameters *[]TokenBodyParameterContract `json:"tokenBodyParameters,omitempty"` 2005 // TokenEndpoint - OAuth token endpoint. Contains absolute URI to entity being referenced. 2006 TokenEndpoint *string `json:"tokenEndpoint,omitempty"` 2007 // 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. 2008 SupportState *bool `json:"supportState,omitempty"` 2009 // 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. 2010 DefaultScope *string `json:"defaultScope,omitempty"` 2011 // BearerTokenSendingMethods - Specifies the mechanism by which access token is passed to the API. 2012 BearerTokenSendingMethods *[]BearerTokenSendingMethod `json:"bearerTokenSendingMethods,omitempty"` 2013 // ClientSecret - Client or app secret registered with this authorization server. 2014 ClientSecret *string `json:"clientSecret,omitempty"` 2015 // ResourceOwnerUsername - Can be optionally specified when resource owner password grant type is supported by this authorization server. Default resource owner username. 2016 ResourceOwnerUsername *string `json:"resourceOwnerUsername,omitempty"` 2017 // ResourceOwnerPassword - Can be optionally specified when resource owner password grant type is supported by this authorization server. Default resource owner password. 2018 ResourceOwnerPassword *string `json:"resourceOwnerPassword,omitempty"` 2019} 2020 2021// AuthorizationServerUpdateContract external OAuth authorization server settings. 2022type AuthorizationServerUpdateContract struct { 2023 // AuthorizationServerUpdateContractProperties - Properties of the External OAuth authorization server update Contract. 2024 *AuthorizationServerUpdateContractProperties `json:"properties,omitempty"` 2025 // ID - Resource ID. 2026 ID *string `json:"id,omitempty"` 2027 // Name - Resource name. 2028 Name *string `json:"name,omitempty"` 2029 // Type - Resource type for API Management resource. 2030 Type *string `json:"type,omitempty"` 2031} 2032 2033// MarshalJSON is the custom marshaler for AuthorizationServerUpdateContract. 2034func (asuc AuthorizationServerUpdateContract) MarshalJSON() ([]byte, error) { 2035 objectMap := make(map[string]interface{}) 2036 if asuc.AuthorizationServerUpdateContractProperties != nil { 2037 objectMap["properties"] = asuc.AuthorizationServerUpdateContractProperties 2038 } 2039 if asuc.ID != nil { 2040 objectMap["id"] = asuc.ID 2041 } 2042 if asuc.Name != nil { 2043 objectMap["name"] = asuc.Name 2044 } 2045 if asuc.Type != nil { 2046 objectMap["type"] = asuc.Type 2047 } 2048 return json.Marshal(objectMap) 2049} 2050 2051// UnmarshalJSON is the custom unmarshaler for AuthorizationServerUpdateContract struct. 2052func (asuc *AuthorizationServerUpdateContract) UnmarshalJSON(body []byte) error { 2053 var m map[string]*json.RawMessage 2054 err := json.Unmarshal(body, &m) 2055 if err != nil { 2056 return err 2057 } 2058 for k, v := range m { 2059 switch k { 2060 case "properties": 2061 if v != nil { 2062 var authorizationServerUpdateContractProperties AuthorizationServerUpdateContractProperties 2063 err = json.Unmarshal(*v, &authorizationServerUpdateContractProperties) 2064 if err != nil { 2065 return err 2066 } 2067 asuc.AuthorizationServerUpdateContractProperties = &authorizationServerUpdateContractProperties 2068 } 2069 case "id": 2070 if v != nil { 2071 var ID string 2072 err = json.Unmarshal(*v, &ID) 2073 if err != nil { 2074 return err 2075 } 2076 asuc.ID = &ID 2077 } 2078 case "name": 2079 if v != nil { 2080 var name string 2081 err = json.Unmarshal(*v, &name) 2082 if err != nil { 2083 return err 2084 } 2085 asuc.Name = &name 2086 } 2087 case "type": 2088 if v != nil { 2089 var typeVar string 2090 err = json.Unmarshal(*v, &typeVar) 2091 if err != nil { 2092 return err 2093 } 2094 asuc.Type = &typeVar 2095 } 2096 } 2097 } 2098 2099 return nil 2100} 2101 2102// AuthorizationServerUpdateContractProperties external OAuth authorization server Update settings contract. 2103type AuthorizationServerUpdateContractProperties struct { 2104 // DisplayName - User-friendly authorization server name. 2105 DisplayName *string `json:"displayName,omitempty"` 2106 // ClientRegistrationEndpoint - Optional reference to a page where client or app registration for this authorization server is performed. Contains absolute URL to entity being referenced. 2107 ClientRegistrationEndpoint *string `json:"clientRegistrationEndpoint,omitempty"` 2108 // AuthorizationEndpoint - OAuth authorization endpoint. See http://tools.ietf.org/html/rfc6749#section-3.2. 2109 AuthorizationEndpoint *string `json:"authorizationEndpoint,omitempty"` 2110 // GrantTypes - Form of an authorization grant, which the client uses to request the access token. 2111 GrantTypes *[]GrantType `json:"grantTypes,omitempty"` 2112 // ClientID - Client or app id registered with this authorization server. 2113 ClientID *string `json:"clientId,omitempty"` 2114 // Description - Description of the authorization server. Can contain HTML formatting tags. 2115 Description *string `json:"description,omitempty"` 2116 // AuthorizationMethods - HTTP verbs supported by the authorization endpoint. GET must be always present. POST is optional. 2117 AuthorizationMethods *[]AuthorizationMethod `json:"authorizationMethods,omitempty"` 2118 // 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. 2119 ClientAuthenticationMethod *[]ClientAuthenticationMethod `json:"clientAuthenticationMethod,omitempty"` 2120 // 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"}. 2121 TokenBodyParameters *[]TokenBodyParameterContract `json:"tokenBodyParameters,omitempty"` 2122 // TokenEndpoint - OAuth token endpoint. Contains absolute URI to entity being referenced. 2123 TokenEndpoint *string `json:"tokenEndpoint,omitempty"` 2124 // 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. 2125 SupportState *bool `json:"supportState,omitempty"` 2126 // 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. 2127 DefaultScope *string `json:"defaultScope,omitempty"` 2128 // BearerTokenSendingMethods - Specifies the mechanism by which access token is passed to the API. 2129 BearerTokenSendingMethods *[]BearerTokenSendingMethod `json:"bearerTokenSendingMethods,omitempty"` 2130 // ClientSecret - Client or app secret registered with this authorization server. 2131 ClientSecret *string `json:"clientSecret,omitempty"` 2132 // ResourceOwnerUsername - Can be optionally specified when resource owner password grant type is supported by this authorization server. Default resource owner username. 2133 ResourceOwnerUsername *string `json:"resourceOwnerUsername,omitempty"` 2134 // ResourceOwnerPassword - Can be optionally specified when resource owner password grant type is supported by this authorization server. Default resource owner password. 2135 ResourceOwnerPassword *string `json:"resourceOwnerPassword,omitempty"` 2136} 2137 2138// BackendAuthorizationHeaderCredentials authorization header information. 2139type BackendAuthorizationHeaderCredentials struct { 2140 // Scheme - Authentication Scheme name. 2141 Scheme *string `json:"scheme,omitempty"` 2142 // Parameter - Authentication Parameter value. 2143 Parameter *string `json:"parameter,omitempty"` 2144} 2145 2146// BackendBaseParameters backend entity base Parameter set. 2147type BackendBaseParameters struct { 2148 // Title - Backend Title. 2149 Title *string `json:"title,omitempty"` 2150 // Description - Backend Description. 2151 Description *string `json:"description,omitempty"` 2152 // 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. 2153 ResourceID *string `json:"resourceId,omitempty"` 2154 // Properties - Backend Properties contract 2155 Properties *BackendProperties `json:"properties,omitempty"` 2156 // Credentials - Backend Credentials Contract Properties 2157 Credentials *BackendCredentialsContract `json:"credentials,omitempty"` 2158 // Proxy - Backend Proxy Contract Properties 2159 Proxy *BackendProxyContract `json:"proxy,omitempty"` 2160 // TLS - Backend TLS Properties 2161 TLS *BackendTLSProperties `json:"tls,omitempty"` 2162} 2163 2164// BackendCollection paged Backend list representation. 2165type BackendCollection struct { 2166 autorest.Response `json:"-"` 2167 // Value - Backend values. 2168 Value *[]BackendContract `json:"value,omitempty"` 2169 // NextLink - Next page link if any. 2170 NextLink *string `json:"nextLink,omitempty"` 2171} 2172 2173// BackendCollectionIterator provides access to a complete listing of BackendContract values. 2174type BackendCollectionIterator struct { 2175 i int 2176 page BackendCollectionPage 2177} 2178 2179// Next advances to the next value. If there was an error making 2180// the request the iterator does not advance and the error is returned. 2181func (iter *BackendCollectionIterator) Next() error { 2182 iter.i++ 2183 if iter.i < len(iter.page.Values()) { 2184 return nil 2185 } 2186 err := iter.page.Next() 2187 if err != nil { 2188 iter.i-- 2189 return err 2190 } 2191 iter.i = 0 2192 return nil 2193} 2194 2195// NotDone returns true if the enumeration should be started or is not yet complete. 2196func (iter BackendCollectionIterator) NotDone() bool { 2197 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 2198} 2199 2200// Response returns the raw server response from the last page request. 2201func (iter BackendCollectionIterator) Response() BackendCollection { 2202 return iter.page.Response() 2203} 2204 2205// Value returns the current value or a zero-initialized value if the 2206// iterator has advanced beyond the end of the collection. 2207func (iter BackendCollectionIterator) Value() BackendContract { 2208 if !iter.page.NotDone() { 2209 return BackendContract{} 2210 } 2211 return iter.page.Values()[iter.i] 2212} 2213 2214// IsEmpty returns true if the ListResult contains no values. 2215func (bc BackendCollection) IsEmpty() bool { 2216 return bc.Value == nil || len(*bc.Value) == 0 2217} 2218 2219// backendCollectionPreparer prepares a request to retrieve the next set of results. 2220// It returns nil if no more results exist. 2221func (bc BackendCollection) backendCollectionPreparer() (*http.Request, error) { 2222 if bc.NextLink == nil || len(to.String(bc.NextLink)) < 1 { 2223 return nil, nil 2224 } 2225 return autorest.Prepare(&http.Request{}, 2226 autorest.AsJSON(), 2227 autorest.AsGet(), 2228 autorest.WithBaseURL(to.String(bc.NextLink))) 2229} 2230 2231// BackendCollectionPage contains a page of BackendContract values. 2232type BackendCollectionPage struct { 2233 fn func(BackendCollection) (BackendCollection, error) 2234 bc BackendCollection 2235} 2236 2237// Next advances to the next page of values. If there was an error making 2238// the request the page does not advance and the error is returned. 2239func (page *BackendCollectionPage) Next() error { 2240 next, err := page.fn(page.bc) 2241 if err != nil { 2242 return err 2243 } 2244 page.bc = next 2245 return nil 2246} 2247 2248// NotDone returns true if the page enumeration should be started or is not yet complete. 2249func (page BackendCollectionPage) NotDone() bool { 2250 return !page.bc.IsEmpty() 2251} 2252 2253// Response returns the raw server response from the last page request. 2254func (page BackendCollectionPage) Response() BackendCollection { 2255 return page.bc 2256} 2257 2258// Values returns the slice of values for the current page or nil if there are no values. 2259func (page BackendCollectionPage) Values() []BackendContract { 2260 if page.bc.IsEmpty() { 2261 return nil 2262 } 2263 return *page.bc.Value 2264} 2265 2266// BackendContract backend details. 2267type BackendContract struct { 2268 autorest.Response `json:"-"` 2269 // BackendContractProperties - Backend entity contract properties. 2270 *BackendContractProperties `json:"properties,omitempty"` 2271 // ID - Resource ID. 2272 ID *string `json:"id,omitempty"` 2273 // Name - Resource name. 2274 Name *string `json:"name,omitempty"` 2275 // Type - Resource type for API Management resource. 2276 Type *string `json:"type,omitempty"` 2277} 2278 2279// MarshalJSON is the custom marshaler for BackendContract. 2280func (bc BackendContract) MarshalJSON() ([]byte, error) { 2281 objectMap := make(map[string]interface{}) 2282 if bc.BackendContractProperties != nil { 2283 objectMap["properties"] = bc.BackendContractProperties 2284 } 2285 if bc.ID != nil { 2286 objectMap["id"] = bc.ID 2287 } 2288 if bc.Name != nil { 2289 objectMap["name"] = bc.Name 2290 } 2291 if bc.Type != nil { 2292 objectMap["type"] = bc.Type 2293 } 2294 return json.Marshal(objectMap) 2295} 2296 2297// UnmarshalJSON is the custom unmarshaler for BackendContract struct. 2298func (bc *BackendContract) UnmarshalJSON(body []byte) error { 2299 var m map[string]*json.RawMessage 2300 err := json.Unmarshal(body, &m) 2301 if err != nil { 2302 return err 2303 } 2304 for k, v := range m { 2305 switch k { 2306 case "properties": 2307 if v != nil { 2308 var backendContractProperties BackendContractProperties 2309 err = json.Unmarshal(*v, &backendContractProperties) 2310 if err != nil { 2311 return err 2312 } 2313 bc.BackendContractProperties = &backendContractProperties 2314 } 2315 case "id": 2316 if v != nil { 2317 var ID string 2318 err = json.Unmarshal(*v, &ID) 2319 if err != nil { 2320 return err 2321 } 2322 bc.ID = &ID 2323 } 2324 case "name": 2325 if v != nil { 2326 var name string 2327 err = json.Unmarshal(*v, &name) 2328 if err != nil { 2329 return err 2330 } 2331 bc.Name = &name 2332 } 2333 case "type": 2334 if v != nil { 2335 var typeVar string 2336 err = json.Unmarshal(*v, &typeVar) 2337 if err != nil { 2338 return err 2339 } 2340 bc.Type = &typeVar 2341 } 2342 } 2343 } 2344 2345 return nil 2346} 2347 2348// BackendContractProperties parameters supplied to the Create Backend operation. 2349type BackendContractProperties struct { 2350 // URL - Runtime Url of the Backend. 2351 URL *string `json:"url,omitempty"` 2352 // Protocol - Backend communication protocol. Possible values include: 'BackendProtocolHTTP', 'BackendProtocolSoap' 2353 Protocol BackendProtocol `json:"protocol,omitempty"` 2354 // Title - Backend Title. 2355 Title *string `json:"title,omitempty"` 2356 // Description - Backend Description. 2357 Description *string `json:"description,omitempty"` 2358 // 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. 2359 ResourceID *string `json:"resourceId,omitempty"` 2360 // Properties - Backend Properties contract 2361 Properties *BackendProperties `json:"properties,omitempty"` 2362 // Credentials - Backend Credentials Contract Properties 2363 Credentials *BackendCredentialsContract `json:"credentials,omitempty"` 2364 // Proxy - Backend Proxy Contract Properties 2365 Proxy *BackendProxyContract `json:"proxy,omitempty"` 2366 // TLS - Backend TLS Properties 2367 TLS *BackendTLSProperties `json:"tls,omitempty"` 2368} 2369 2370// BackendCredentialsContract details of the Credentials used to connect to Backend. 2371type BackendCredentialsContract struct { 2372 // Certificate - List of Client Certificate Thumbprint. 2373 Certificate *[]string `json:"certificate,omitempty"` 2374 // Query - Query Parameter description. 2375 Query map[string][]string `json:"query"` 2376 // Header - Header Parameter description. 2377 Header map[string][]string `json:"header"` 2378 // Authorization - Authorization header authentication 2379 Authorization *BackendAuthorizationHeaderCredentials `json:"authorization,omitempty"` 2380} 2381 2382// MarshalJSON is the custom marshaler for BackendCredentialsContract. 2383func (bcc BackendCredentialsContract) MarshalJSON() ([]byte, error) { 2384 objectMap := make(map[string]interface{}) 2385 if bcc.Certificate != nil { 2386 objectMap["certificate"] = bcc.Certificate 2387 } 2388 if bcc.Query != nil { 2389 objectMap["query"] = bcc.Query 2390 } 2391 if bcc.Header != nil { 2392 objectMap["header"] = bcc.Header 2393 } 2394 if bcc.Authorization != nil { 2395 objectMap["authorization"] = bcc.Authorization 2396 } 2397 return json.Marshal(objectMap) 2398} 2399 2400// BackendProperties properties specific to the Backend Type. 2401type BackendProperties struct { 2402 // ServiceFabricCluster - Backend Service Fabric Cluster Properties 2403 ServiceFabricCluster *BackendServiceFabricClusterProperties `json:"serviceFabricCluster,omitempty"` 2404} 2405 2406// BackendProxyContract details of the Backend WebProxy Server to use in the Request to Backend. 2407type BackendProxyContract struct { 2408 // URL - WebProxy Server AbsoluteUri property which includes the entire URI stored in the Uri instance, including all fragments and query strings. 2409 URL *string `json:"url,omitempty"` 2410 // Username - Username to connect to the WebProxy server 2411 Username *string `json:"username,omitempty"` 2412 // Password - Password to connect to the WebProxy Server 2413 Password *string `json:"password,omitempty"` 2414} 2415 2416// BackendReconnectContract reconnect request parameters. 2417type BackendReconnectContract struct { 2418 // BackendReconnectProperties - Reconnect request properties. 2419 *BackendReconnectProperties `json:"properties,omitempty"` 2420 // ID - Resource ID. 2421 ID *string `json:"id,omitempty"` 2422 // Name - Resource name. 2423 Name *string `json:"name,omitempty"` 2424 // Type - Resource type for API Management resource. 2425 Type *string `json:"type,omitempty"` 2426} 2427 2428// MarshalJSON is the custom marshaler for BackendReconnectContract. 2429func (brc BackendReconnectContract) MarshalJSON() ([]byte, error) { 2430 objectMap := make(map[string]interface{}) 2431 if brc.BackendReconnectProperties != nil { 2432 objectMap["properties"] = brc.BackendReconnectProperties 2433 } 2434 if brc.ID != nil { 2435 objectMap["id"] = brc.ID 2436 } 2437 if brc.Name != nil { 2438 objectMap["name"] = brc.Name 2439 } 2440 if brc.Type != nil { 2441 objectMap["type"] = brc.Type 2442 } 2443 return json.Marshal(objectMap) 2444} 2445 2446// UnmarshalJSON is the custom unmarshaler for BackendReconnectContract struct. 2447func (brc *BackendReconnectContract) UnmarshalJSON(body []byte) error { 2448 var m map[string]*json.RawMessage 2449 err := json.Unmarshal(body, &m) 2450 if err != nil { 2451 return err 2452 } 2453 for k, v := range m { 2454 switch k { 2455 case "properties": 2456 if v != nil { 2457 var backendReconnectProperties BackendReconnectProperties 2458 err = json.Unmarshal(*v, &backendReconnectProperties) 2459 if err != nil { 2460 return err 2461 } 2462 brc.BackendReconnectProperties = &backendReconnectProperties 2463 } 2464 case "id": 2465 if v != nil { 2466 var ID string 2467 err = json.Unmarshal(*v, &ID) 2468 if err != nil { 2469 return err 2470 } 2471 brc.ID = &ID 2472 } 2473 case "name": 2474 if v != nil { 2475 var name string 2476 err = json.Unmarshal(*v, &name) 2477 if err != nil { 2478 return err 2479 } 2480 brc.Name = &name 2481 } 2482 case "type": 2483 if v != nil { 2484 var typeVar string 2485 err = json.Unmarshal(*v, &typeVar) 2486 if err != nil { 2487 return err 2488 } 2489 brc.Type = &typeVar 2490 } 2491 } 2492 } 2493 2494 return nil 2495} 2496 2497// BackendReconnectProperties properties to control reconnect requests. 2498type BackendReconnectProperties struct { 2499 // After - Duration in ISO8601 format after which reconnect will be initiated. Minimum duration of the Reconect is PT2M. 2500 After *string `json:"after,omitempty"` 2501} 2502 2503// BackendServiceFabricClusterProperties properties of the Service Fabric Type Backend. 2504type BackendServiceFabricClusterProperties struct { 2505 // ClientCertificatethumbprint - The client certificate thumbprint for the management endpoint. 2506 ClientCertificatethumbprint *string `json:"clientCertificatethumbprint,omitempty"` 2507 // MaxPartitionResolutionRetries - Maximum number of retries while attempting resolve the parition. 2508 MaxPartitionResolutionRetries *int32 `json:"maxPartitionResolutionRetries,omitempty"` 2509 // ManagementEndpoints - The cluster management endpoint. 2510 ManagementEndpoints *[]string `json:"managementEndpoints,omitempty"` 2511 // ServerCertificateThumbprints - Thumbprints of certificates cluster management service uses for tls communication 2512 ServerCertificateThumbprints *[]string `json:"serverCertificateThumbprints,omitempty"` 2513 // ServerX509Names - Server X509 Certificate Names Collection 2514 ServerX509Names *[]X509CertificateName `json:"serverX509Names,omitempty"` 2515} 2516 2517// BackendTLSProperties properties controlling TLS Certificate Validation. 2518type BackendTLSProperties struct { 2519 // ValidateCertificateChain - Flag indicating whether SSL certificate chain validation should be done when using self-signed certificates for this backend host. 2520 ValidateCertificateChain *bool `json:"validateCertificateChain,omitempty"` 2521 // ValidateCertificateName - Flag indicating whether SSL certificate name validation should be done when using self-signed certificates for this backend host. 2522 ValidateCertificateName *bool `json:"validateCertificateName,omitempty"` 2523} 2524 2525// BackendUpdateParameterProperties parameters supplied to the Update Backend operation. 2526type BackendUpdateParameterProperties struct { 2527 // URL - Runtime Url of the Backend. 2528 URL *string `json:"url,omitempty"` 2529 // Protocol - Backend communication protocol. Possible values include: 'BackendProtocolHTTP', 'BackendProtocolSoap' 2530 Protocol BackendProtocol `json:"protocol,omitempty"` 2531 // Title - Backend Title. 2532 Title *string `json:"title,omitempty"` 2533 // Description - Backend Description. 2534 Description *string `json:"description,omitempty"` 2535 // 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. 2536 ResourceID *string `json:"resourceId,omitempty"` 2537 // Properties - Backend Properties contract 2538 Properties *BackendProperties `json:"properties,omitempty"` 2539 // Credentials - Backend Credentials Contract Properties 2540 Credentials *BackendCredentialsContract `json:"credentials,omitempty"` 2541 // Proxy - Backend Proxy Contract Properties 2542 Proxy *BackendProxyContract `json:"proxy,omitempty"` 2543 // TLS - Backend TLS Properties 2544 TLS *BackendTLSProperties `json:"tls,omitempty"` 2545} 2546 2547// BackendUpdateParameters backend update parameters. 2548type BackendUpdateParameters struct { 2549 // BackendUpdateParameterProperties - Backend entity update contract properties. 2550 *BackendUpdateParameterProperties `json:"properties,omitempty"` 2551} 2552 2553// MarshalJSON is the custom marshaler for BackendUpdateParameters. 2554func (bup BackendUpdateParameters) MarshalJSON() ([]byte, error) { 2555 objectMap := make(map[string]interface{}) 2556 if bup.BackendUpdateParameterProperties != nil { 2557 objectMap["properties"] = bup.BackendUpdateParameterProperties 2558 } 2559 return json.Marshal(objectMap) 2560} 2561 2562// UnmarshalJSON is the custom unmarshaler for BackendUpdateParameters struct. 2563func (bup *BackendUpdateParameters) UnmarshalJSON(body []byte) error { 2564 var m map[string]*json.RawMessage 2565 err := json.Unmarshal(body, &m) 2566 if err != nil { 2567 return err 2568 } 2569 for k, v := range m { 2570 switch k { 2571 case "properties": 2572 if v != nil { 2573 var backendUpdateParameterProperties BackendUpdateParameterProperties 2574 err = json.Unmarshal(*v, &backendUpdateParameterProperties) 2575 if err != nil { 2576 return err 2577 } 2578 bup.BackendUpdateParameterProperties = &backendUpdateParameterProperties 2579 } 2580 } 2581 } 2582 2583 return nil 2584} 2585 2586// CertificateCollection paged Certificates list representation. 2587type CertificateCollection struct { 2588 autorest.Response `json:"-"` 2589 // Value - Page values. 2590 Value *[]CertificateContract `json:"value,omitempty"` 2591 // NextLink - Next page link if any. 2592 NextLink *string `json:"nextLink,omitempty"` 2593} 2594 2595// CertificateCollectionIterator provides access to a complete listing of CertificateContract values. 2596type CertificateCollectionIterator struct { 2597 i int 2598 page CertificateCollectionPage 2599} 2600 2601// Next advances to the next value. If there was an error making 2602// the request the iterator does not advance and the error is returned. 2603func (iter *CertificateCollectionIterator) Next() error { 2604 iter.i++ 2605 if iter.i < len(iter.page.Values()) { 2606 return nil 2607 } 2608 err := iter.page.Next() 2609 if err != nil { 2610 iter.i-- 2611 return err 2612 } 2613 iter.i = 0 2614 return nil 2615} 2616 2617// NotDone returns true if the enumeration should be started or is not yet complete. 2618func (iter CertificateCollectionIterator) NotDone() bool { 2619 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 2620} 2621 2622// Response returns the raw server response from the last page request. 2623func (iter CertificateCollectionIterator) Response() CertificateCollection { 2624 return iter.page.Response() 2625} 2626 2627// Value returns the current value or a zero-initialized value if the 2628// iterator has advanced beyond the end of the collection. 2629func (iter CertificateCollectionIterator) Value() CertificateContract { 2630 if !iter.page.NotDone() { 2631 return CertificateContract{} 2632 } 2633 return iter.page.Values()[iter.i] 2634} 2635 2636// IsEmpty returns true if the ListResult contains no values. 2637func (cc CertificateCollection) IsEmpty() bool { 2638 return cc.Value == nil || len(*cc.Value) == 0 2639} 2640 2641// certificateCollectionPreparer prepares a request to retrieve the next set of results. 2642// It returns nil if no more results exist. 2643func (cc CertificateCollection) certificateCollectionPreparer() (*http.Request, error) { 2644 if cc.NextLink == nil || len(to.String(cc.NextLink)) < 1 { 2645 return nil, nil 2646 } 2647 return autorest.Prepare(&http.Request{}, 2648 autorest.AsJSON(), 2649 autorest.AsGet(), 2650 autorest.WithBaseURL(to.String(cc.NextLink))) 2651} 2652 2653// CertificateCollectionPage contains a page of CertificateContract values. 2654type CertificateCollectionPage struct { 2655 fn func(CertificateCollection) (CertificateCollection, error) 2656 cc CertificateCollection 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. 2661func (page *CertificateCollectionPage) Next() error { 2662 next, err := page.fn(page.cc) 2663 if err != nil { 2664 return err 2665 } 2666 page.cc = next 2667 return nil 2668} 2669 2670// NotDone returns true if the page enumeration should be started or is not yet complete. 2671func (page CertificateCollectionPage) NotDone() bool { 2672 return !page.cc.IsEmpty() 2673} 2674 2675// Response returns the raw server response from the last page request. 2676func (page CertificateCollectionPage) Response() CertificateCollection { 2677 return page.cc 2678} 2679 2680// Values returns the slice of values for the current page or nil if there are no values. 2681func (page CertificateCollectionPage) Values() []CertificateContract { 2682 if page.cc.IsEmpty() { 2683 return nil 2684 } 2685 return *page.cc.Value 2686} 2687 2688// CertificateConfiguration certificate configuration which consist of non-trusted intermediates and root 2689// certificates. 2690type CertificateConfiguration struct { 2691 // EncodedCertificate - Base64 Encoded certificate. 2692 EncodedCertificate *string `json:"encodedCertificate,omitempty"` 2693 // CertificatePassword - Certificate Password. 2694 CertificatePassword *string `json:"certificatePassword,omitempty"` 2695 // StoreName - The System.Security.Cryptography.x509certificates.Storename certificate store location. Only Root and CertificateAuthority are valid locations. Possible values include: 'CertificateAuthority', 'Root' 2696 StoreName StoreName `json:"storeName,omitempty"` 2697 // Certificate - Certificate information. 2698 Certificate *CertificateInformation `json:"certificate,omitempty"` 2699} 2700 2701// CertificateContract certificate details. 2702type CertificateContract struct { 2703 autorest.Response `json:"-"` 2704 // CertificateContractProperties - Certificate properties details. 2705 *CertificateContractProperties `json:"properties,omitempty"` 2706 // ID - Resource ID. 2707 ID *string `json:"id,omitempty"` 2708 // Name - Resource name. 2709 Name *string `json:"name,omitempty"` 2710 // Type - Resource type for API Management resource. 2711 Type *string `json:"type,omitempty"` 2712} 2713 2714// MarshalJSON is the custom marshaler for CertificateContract. 2715func (cc CertificateContract) MarshalJSON() ([]byte, error) { 2716 objectMap := make(map[string]interface{}) 2717 if cc.CertificateContractProperties != nil { 2718 objectMap["properties"] = cc.CertificateContractProperties 2719 } 2720 if cc.ID != nil { 2721 objectMap["id"] = cc.ID 2722 } 2723 if cc.Name != nil { 2724 objectMap["name"] = cc.Name 2725 } 2726 if cc.Type != nil { 2727 objectMap["type"] = cc.Type 2728 } 2729 return json.Marshal(objectMap) 2730} 2731 2732// UnmarshalJSON is the custom unmarshaler for CertificateContract struct. 2733func (cc *CertificateContract) UnmarshalJSON(body []byte) error { 2734 var m map[string]*json.RawMessage 2735 err := json.Unmarshal(body, &m) 2736 if err != nil { 2737 return err 2738 } 2739 for k, v := range m { 2740 switch k { 2741 case "properties": 2742 if v != nil { 2743 var certificateContractProperties CertificateContractProperties 2744 err = json.Unmarshal(*v, &certificateContractProperties) 2745 if err != nil { 2746 return err 2747 } 2748 cc.CertificateContractProperties = &certificateContractProperties 2749 } 2750 case "id": 2751 if v != nil { 2752 var ID string 2753 err = json.Unmarshal(*v, &ID) 2754 if err != nil { 2755 return err 2756 } 2757 cc.ID = &ID 2758 } 2759 case "name": 2760 if v != nil { 2761 var name string 2762 err = json.Unmarshal(*v, &name) 2763 if err != nil { 2764 return err 2765 } 2766 cc.Name = &name 2767 } 2768 case "type": 2769 if v != nil { 2770 var typeVar string 2771 err = json.Unmarshal(*v, &typeVar) 2772 if err != nil { 2773 return err 2774 } 2775 cc.Type = &typeVar 2776 } 2777 } 2778 } 2779 2780 return nil 2781} 2782 2783// CertificateContractProperties properties of the Certificate contract. 2784type CertificateContractProperties struct { 2785 // Subject - Subject attribute of the certificate. 2786 Subject *string `json:"subject,omitempty"` 2787 // Thumbprint - Thumbprint of the certificate. 2788 Thumbprint *string `json:"thumbprint,omitempty"` 2789 // 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. 2790 ExpirationDate *date.Time `json:"expirationDate,omitempty"` 2791} 2792 2793// CertificateCreateOrUpdateParameters certificate create or update details. 2794type CertificateCreateOrUpdateParameters struct { 2795 // CertificateCreateOrUpdateProperties - Certificate create or update properties details. 2796 *CertificateCreateOrUpdateProperties `json:"properties,omitempty"` 2797} 2798 2799// MarshalJSON is the custom marshaler for CertificateCreateOrUpdateParameters. 2800func (ccoup CertificateCreateOrUpdateParameters) MarshalJSON() ([]byte, error) { 2801 objectMap := make(map[string]interface{}) 2802 if ccoup.CertificateCreateOrUpdateProperties != nil { 2803 objectMap["properties"] = ccoup.CertificateCreateOrUpdateProperties 2804 } 2805 return json.Marshal(objectMap) 2806} 2807 2808// UnmarshalJSON is the custom unmarshaler for CertificateCreateOrUpdateParameters struct. 2809func (ccoup *CertificateCreateOrUpdateParameters) UnmarshalJSON(body []byte) error { 2810 var m map[string]*json.RawMessage 2811 err := json.Unmarshal(body, &m) 2812 if err != nil { 2813 return err 2814 } 2815 for k, v := range m { 2816 switch k { 2817 case "properties": 2818 if v != nil { 2819 var certificateCreateOrUpdateProperties CertificateCreateOrUpdateProperties 2820 err = json.Unmarshal(*v, &certificateCreateOrUpdateProperties) 2821 if err != nil { 2822 return err 2823 } 2824 ccoup.CertificateCreateOrUpdateProperties = &certificateCreateOrUpdateProperties 2825 } 2826 } 2827 } 2828 2829 return nil 2830} 2831 2832// CertificateCreateOrUpdateProperties parameters supplied to the CreateOrUpdate certificate operation. 2833type CertificateCreateOrUpdateProperties struct { 2834 // Data - Base 64 encoded certificate using the application/x-pkcs12 representation. 2835 Data *string `json:"data,omitempty"` 2836 // Password - Password for the Certificate 2837 Password *string `json:"password,omitempty"` 2838} 2839 2840// CertificateInformation SSL certificate information. 2841type CertificateInformation struct { 2842 autorest.Response `json:"-"` 2843 // 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. 2844 Expiry *date.Time `json:"expiry,omitempty"` 2845 // Thumbprint - Thumbprint of the certificate. 2846 Thumbprint *string `json:"thumbprint,omitempty"` 2847 // Subject - Subject of the certificate. 2848 Subject *string `json:"subject,omitempty"` 2849} 2850 2851// ConnectivityStatusContract details about connectivity to a resource. 2852type ConnectivityStatusContract struct { 2853 // 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. 2854 Name *string `json:"name,omitempty"` 2855 // Status - Resource Connectivity Status Type identifier. Possible values include: 'Initializing', 'Success', 'Failure' 2856 Status ConnectivityStatusType `json:"status,omitempty"` 2857 // Error - Error details of the connectivity to the resource. 2858 Error *string `json:"error,omitempty"` 2859 // 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. 2860 LastUpdated *date.Time `json:"lastUpdated,omitempty"` 2861 // 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. 2862 LastStatusChange *date.Time `json:"lastStatusChange,omitempty"` 2863} 2864 2865// DeployConfigurationParameters parameters supplied to the Deploy Configuration operation. 2866type DeployConfigurationParameters struct { 2867 // Branch - The name of the Git branch from which the configuration is to be deployed to the configuration database. 2868 Branch *string `json:"branch,omitempty"` 2869 // Force - The value enforcing deleting subscriptions to products that are deleted in this update. 2870 Force *bool `json:"force,omitempty"` 2871} 2872 2873// DiagnosticCollection paged Diagnostic list representation. 2874type DiagnosticCollection struct { 2875 autorest.Response `json:"-"` 2876 // Value - Page values. 2877 Value *[]DiagnosticContract `json:"value,omitempty"` 2878 // NextLink - Next page link if any. 2879 NextLink *string `json:"nextLink,omitempty"` 2880} 2881 2882// DiagnosticCollectionIterator provides access to a complete listing of DiagnosticContract values. 2883type DiagnosticCollectionIterator struct { 2884 i int 2885 page DiagnosticCollectionPage 2886} 2887 2888// Next advances to the next value. If there was an error making 2889// the request the iterator does not advance and the error is returned. 2890func (iter *DiagnosticCollectionIterator) Next() error { 2891 iter.i++ 2892 if iter.i < len(iter.page.Values()) { 2893 return nil 2894 } 2895 err := iter.page.Next() 2896 if err != nil { 2897 iter.i-- 2898 return err 2899 } 2900 iter.i = 0 2901 return nil 2902} 2903 2904// NotDone returns true if the enumeration should be started or is not yet complete. 2905func (iter DiagnosticCollectionIterator) NotDone() bool { 2906 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 2907} 2908 2909// Response returns the raw server response from the last page request. 2910func (iter DiagnosticCollectionIterator) Response() DiagnosticCollection { 2911 return iter.page.Response() 2912} 2913 2914// Value returns the current value or a zero-initialized value if the 2915// iterator has advanced beyond the end of the collection. 2916func (iter DiagnosticCollectionIterator) Value() DiagnosticContract { 2917 if !iter.page.NotDone() { 2918 return DiagnosticContract{} 2919 } 2920 return iter.page.Values()[iter.i] 2921} 2922 2923// IsEmpty returns true if the ListResult contains no values. 2924func (dc DiagnosticCollection) IsEmpty() bool { 2925 return dc.Value == nil || len(*dc.Value) == 0 2926} 2927 2928// diagnosticCollectionPreparer prepares a request to retrieve the next set of results. 2929// It returns nil if no more results exist. 2930func (dc DiagnosticCollection) diagnosticCollectionPreparer() (*http.Request, error) { 2931 if dc.NextLink == nil || len(to.String(dc.NextLink)) < 1 { 2932 return nil, nil 2933 } 2934 return autorest.Prepare(&http.Request{}, 2935 autorest.AsJSON(), 2936 autorest.AsGet(), 2937 autorest.WithBaseURL(to.String(dc.NextLink))) 2938} 2939 2940// DiagnosticCollectionPage contains a page of DiagnosticContract values. 2941type DiagnosticCollectionPage struct { 2942 fn func(DiagnosticCollection) (DiagnosticCollection, error) 2943 dc DiagnosticCollection 2944} 2945 2946// Next advances to the next page of values. If there was an error making 2947// the request the page does not advance and the error is returned. 2948func (page *DiagnosticCollectionPage) Next() error { 2949 next, err := page.fn(page.dc) 2950 if err != nil { 2951 return err 2952 } 2953 page.dc = next 2954 return nil 2955} 2956 2957// NotDone returns true if the page enumeration should be started or is not yet complete. 2958func (page DiagnosticCollectionPage) NotDone() bool { 2959 return !page.dc.IsEmpty() 2960} 2961 2962// Response returns the raw server response from the last page request. 2963func (page DiagnosticCollectionPage) Response() DiagnosticCollection { 2964 return page.dc 2965} 2966 2967// Values returns the slice of values for the current page or nil if there are no values. 2968func (page DiagnosticCollectionPage) Values() []DiagnosticContract { 2969 if page.dc.IsEmpty() { 2970 return nil 2971 } 2972 return *page.dc.Value 2973} 2974 2975// DiagnosticContract diagnostic details. 2976type DiagnosticContract struct { 2977 autorest.Response `json:"-"` 2978 // DiagnosticContractProperties - Diagnostic entity contract properties. 2979 *DiagnosticContractProperties `json:"properties,omitempty"` 2980 // ID - Resource ID. 2981 ID *string `json:"id,omitempty"` 2982 // Name - Resource name. 2983 Name *string `json:"name,omitempty"` 2984 // Type - Resource type for API Management resource. 2985 Type *string `json:"type,omitempty"` 2986} 2987 2988// MarshalJSON is the custom marshaler for DiagnosticContract. 2989func (dc DiagnosticContract) MarshalJSON() ([]byte, error) { 2990 objectMap := make(map[string]interface{}) 2991 if dc.DiagnosticContractProperties != nil { 2992 objectMap["properties"] = dc.DiagnosticContractProperties 2993 } 2994 if dc.ID != nil { 2995 objectMap["id"] = dc.ID 2996 } 2997 if dc.Name != nil { 2998 objectMap["name"] = dc.Name 2999 } 3000 if dc.Type != nil { 3001 objectMap["type"] = dc.Type 3002 } 3003 return json.Marshal(objectMap) 3004} 3005 3006// UnmarshalJSON is the custom unmarshaler for DiagnosticContract struct. 3007func (dc *DiagnosticContract) UnmarshalJSON(body []byte) error { 3008 var m map[string]*json.RawMessage 3009 err := json.Unmarshal(body, &m) 3010 if err != nil { 3011 return err 3012 } 3013 for k, v := range m { 3014 switch k { 3015 case "properties": 3016 if v != nil { 3017 var diagnosticContractProperties DiagnosticContractProperties 3018 err = json.Unmarshal(*v, &diagnosticContractProperties) 3019 if err != nil { 3020 return err 3021 } 3022 dc.DiagnosticContractProperties = &diagnosticContractProperties 3023 } 3024 case "id": 3025 if v != nil { 3026 var ID string 3027 err = json.Unmarshal(*v, &ID) 3028 if err != nil { 3029 return err 3030 } 3031 dc.ID = &ID 3032 } 3033 case "name": 3034 if v != nil { 3035 var name string 3036 err = json.Unmarshal(*v, &name) 3037 if err != nil { 3038 return err 3039 } 3040 dc.Name = &name 3041 } 3042 case "type": 3043 if v != nil { 3044 var typeVar string 3045 err = json.Unmarshal(*v, &typeVar) 3046 if err != nil { 3047 return err 3048 } 3049 dc.Type = &typeVar 3050 } 3051 } 3052 } 3053 3054 return nil 3055} 3056 3057// DiagnosticContractProperties diagnostic Entity Properties 3058type DiagnosticContractProperties struct { 3059 // Enabled - Indicates whether a diagnostic should receive data or not. 3060 Enabled *bool `json:"enabled,omitempty"` 3061} 3062 3063// EmailTemplateCollection paged email template list representation. 3064type EmailTemplateCollection struct { 3065 autorest.Response `json:"-"` 3066 // Value - Page values. 3067 Value *[]EmailTemplateContract `json:"value,omitempty"` 3068 // NextLink - Next page link if any. 3069 NextLink *string `json:"nextLink,omitempty"` 3070} 3071 3072// EmailTemplateCollectionIterator provides access to a complete listing of EmailTemplateContract values. 3073type EmailTemplateCollectionIterator struct { 3074 i int 3075 page EmailTemplateCollectionPage 3076} 3077 3078// Next advances to the next value. If there was an error making 3079// the request the iterator does not advance and the error is returned. 3080func (iter *EmailTemplateCollectionIterator) Next() error { 3081 iter.i++ 3082 if iter.i < len(iter.page.Values()) { 3083 return nil 3084 } 3085 err := iter.page.Next() 3086 if err != nil { 3087 iter.i-- 3088 return err 3089 } 3090 iter.i = 0 3091 return nil 3092} 3093 3094// NotDone returns true if the enumeration should be started or is not yet complete. 3095func (iter EmailTemplateCollectionIterator) NotDone() bool { 3096 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 3097} 3098 3099// Response returns the raw server response from the last page request. 3100func (iter EmailTemplateCollectionIterator) Response() EmailTemplateCollection { 3101 return iter.page.Response() 3102} 3103 3104// Value returns the current value or a zero-initialized value if the 3105// iterator has advanced beyond the end of the collection. 3106func (iter EmailTemplateCollectionIterator) Value() EmailTemplateContract { 3107 if !iter.page.NotDone() { 3108 return EmailTemplateContract{} 3109 } 3110 return iter.page.Values()[iter.i] 3111} 3112 3113// IsEmpty returns true if the ListResult contains no values. 3114func (etc EmailTemplateCollection) IsEmpty() bool { 3115 return etc.Value == nil || len(*etc.Value) == 0 3116} 3117 3118// emailTemplateCollectionPreparer prepares a request to retrieve the next set of results. 3119// It returns nil if no more results exist. 3120func (etc EmailTemplateCollection) emailTemplateCollectionPreparer() (*http.Request, error) { 3121 if etc.NextLink == nil || len(to.String(etc.NextLink)) < 1 { 3122 return nil, nil 3123 } 3124 return autorest.Prepare(&http.Request{}, 3125 autorest.AsJSON(), 3126 autorest.AsGet(), 3127 autorest.WithBaseURL(to.String(etc.NextLink))) 3128} 3129 3130// EmailTemplateCollectionPage contains a page of EmailTemplateContract values. 3131type EmailTemplateCollectionPage struct { 3132 fn func(EmailTemplateCollection) (EmailTemplateCollection, error) 3133 etc EmailTemplateCollection 3134} 3135 3136// Next advances to the next page of values. If there was an error making 3137// the request the page does not advance and the error is returned. 3138func (page *EmailTemplateCollectionPage) Next() error { 3139 next, err := page.fn(page.etc) 3140 if err != nil { 3141 return err 3142 } 3143 page.etc = next 3144 return nil 3145} 3146 3147// NotDone returns true if the page enumeration should be started or is not yet complete. 3148func (page EmailTemplateCollectionPage) NotDone() bool { 3149 return !page.etc.IsEmpty() 3150} 3151 3152// Response returns the raw server response from the last page request. 3153func (page EmailTemplateCollectionPage) Response() EmailTemplateCollection { 3154 return page.etc 3155} 3156 3157// Values returns the slice of values for the current page or nil if there are no values. 3158func (page EmailTemplateCollectionPage) Values() []EmailTemplateContract { 3159 if page.etc.IsEmpty() { 3160 return nil 3161 } 3162 return *page.etc.Value 3163} 3164 3165// EmailTemplateContract email Template details. 3166type EmailTemplateContract struct { 3167 autorest.Response `json:"-"` 3168 // EmailTemplateContractProperties - Email Template entity contract properties. 3169 *EmailTemplateContractProperties `json:"properties,omitempty"` 3170 // ID - Resource ID. 3171 ID *string `json:"id,omitempty"` 3172 // Name - Resource name. 3173 Name *string `json:"name,omitempty"` 3174 // Type - Resource type for API Management resource. 3175 Type *string `json:"type,omitempty"` 3176} 3177 3178// MarshalJSON is the custom marshaler for EmailTemplateContract. 3179func (etc EmailTemplateContract) MarshalJSON() ([]byte, error) { 3180 objectMap := make(map[string]interface{}) 3181 if etc.EmailTemplateContractProperties != nil { 3182 objectMap["properties"] = etc.EmailTemplateContractProperties 3183 } 3184 if etc.ID != nil { 3185 objectMap["id"] = etc.ID 3186 } 3187 if etc.Name != nil { 3188 objectMap["name"] = etc.Name 3189 } 3190 if etc.Type != nil { 3191 objectMap["type"] = etc.Type 3192 } 3193 return json.Marshal(objectMap) 3194} 3195 3196// UnmarshalJSON is the custom unmarshaler for EmailTemplateContract struct. 3197func (etc *EmailTemplateContract) UnmarshalJSON(body []byte) error { 3198 var m map[string]*json.RawMessage 3199 err := json.Unmarshal(body, &m) 3200 if err != nil { 3201 return err 3202 } 3203 for k, v := range m { 3204 switch k { 3205 case "properties": 3206 if v != nil { 3207 var emailTemplateContractProperties EmailTemplateContractProperties 3208 err = json.Unmarshal(*v, &emailTemplateContractProperties) 3209 if err != nil { 3210 return err 3211 } 3212 etc.EmailTemplateContractProperties = &emailTemplateContractProperties 3213 } 3214 case "id": 3215 if v != nil { 3216 var ID string 3217 err = json.Unmarshal(*v, &ID) 3218 if err != nil { 3219 return err 3220 } 3221 etc.ID = &ID 3222 } 3223 case "name": 3224 if v != nil { 3225 var name string 3226 err = json.Unmarshal(*v, &name) 3227 if err != nil { 3228 return err 3229 } 3230 etc.Name = &name 3231 } 3232 case "type": 3233 if v != nil { 3234 var typeVar string 3235 err = json.Unmarshal(*v, &typeVar) 3236 if err != nil { 3237 return err 3238 } 3239 etc.Type = &typeVar 3240 } 3241 } 3242 } 3243 3244 return nil 3245} 3246 3247// EmailTemplateContractProperties email Template Contract properties. 3248type EmailTemplateContractProperties struct { 3249 // Subject - Subject of the Template. 3250 Subject *string `json:"subject,omitempty"` 3251 // Body - Email Template Body. This should be a valid XDocument 3252 Body *string `json:"body,omitempty"` 3253 // Title - Title of the Template. 3254 Title *string `json:"title,omitempty"` 3255 // Description - Description of the Email Template. 3256 Description *string `json:"description,omitempty"` 3257 // IsDefault - Whether the template is the default template provided by Api Management or has been edited. 3258 IsDefault *bool `json:"isDefault,omitempty"` 3259 // Parameters - Email Template Parameter values. 3260 Parameters *[]EmailTemplateParametersContractProperties `json:"parameters,omitempty"` 3261} 3262 3263// EmailTemplateParametersContractProperties email Template Parameter contract. 3264type EmailTemplateParametersContractProperties struct { 3265 // Name - Template parameter name. 3266 Name *string `json:"name,omitempty"` 3267 // Title - Template parameter title. 3268 Title *string `json:"title,omitempty"` 3269 // Description - Template parameter description. 3270 Description *string `json:"description,omitempty"` 3271} 3272 3273// EmailTemplateUpdateParameterProperties email Template Update Contract properties. 3274type EmailTemplateUpdateParameterProperties struct { 3275 // Subject - Subject of the Template. 3276 Subject *string `json:"subject,omitempty"` 3277 // Title - Title of the Template. 3278 Title *string `json:"title,omitempty"` 3279 // Description - Description of the Email Template. 3280 Description *string `json:"description,omitempty"` 3281 // Body - Email Template Body. This should be a valid XDocument 3282 Body *string `json:"body,omitempty"` 3283 // Parameters - Email Template Parameter values. 3284 Parameters *[]EmailTemplateParametersContractProperties `json:"parameters,omitempty"` 3285} 3286 3287// EmailTemplateUpdateParameters email Template update Parameters. 3288type EmailTemplateUpdateParameters struct { 3289 // EmailTemplateUpdateParameterProperties - Email Template Update contract properties. 3290 *EmailTemplateUpdateParameterProperties `json:"properties,omitempty"` 3291} 3292 3293// MarshalJSON is the custom marshaler for EmailTemplateUpdateParameters. 3294func (etup EmailTemplateUpdateParameters) MarshalJSON() ([]byte, error) { 3295 objectMap := make(map[string]interface{}) 3296 if etup.EmailTemplateUpdateParameterProperties != nil { 3297 objectMap["properties"] = etup.EmailTemplateUpdateParameterProperties 3298 } 3299 return json.Marshal(objectMap) 3300} 3301 3302// UnmarshalJSON is the custom unmarshaler for EmailTemplateUpdateParameters struct. 3303func (etup *EmailTemplateUpdateParameters) UnmarshalJSON(body []byte) error { 3304 var m map[string]*json.RawMessage 3305 err := json.Unmarshal(body, &m) 3306 if err != nil { 3307 return err 3308 } 3309 for k, v := range m { 3310 switch k { 3311 case "properties": 3312 if v != nil { 3313 var emailTemplateUpdateParameterProperties EmailTemplateUpdateParameterProperties 3314 err = json.Unmarshal(*v, &emailTemplateUpdateParameterProperties) 3315 if err != nil { 3316 return err 3317 } 3318 etup.EmailTemplateUpdateParameterProperties = &emailTemplateUpdateParameterProperties 3319 } 3320 } 3321 } 3322 3323 return nil 3324} 3325 3326// ErrorFieldContract error Field contract. 3327type ErrorFieldContract struct { 3328 // Code - Property level error code. 3329 Code *string `json:"code,omitempty"` 3330 // Message - Human-readable representation of property-level error. 3331 Message *string `json:"message,omitempty"` 3332 // Target - Property name. 3333 Target *string `json:"target,omitempty"` 3334} 3335 3336// ErrorResponse error Response. 3337type ErrorResponse struct { 3338 // ErrorResponseBody - Properties of the Error Response. 3339 *ErrorResponseBody `json:"error,omitempty"` 3340} 3341 3342// MarshalJSON is the custom marshaler for ErrorResponse. 3343func (er ErrorResponse) MarshalJSON() ([]byte, error) { 3344 objectMap := make(map[string]interface{}) 3345 if er.ErrorResponseBody != nil { 3346 objectMap["error"] = er.ErrorResponseBody 3347 } 3348 return json.Marshal(objectMap) 3349} 3350 3351// UnmarshalJSON is the custom unmarshaler for ErrorResponse struct. 3352func (er *ErrorResponse) UnmarshalJSON(body []byte) error { 3353 var m map[string]*json.RawMessage 3354 err := json.Unmarshal(body, &m) 3355 if err != nil { 3356 return err 3357 } 3358 for k, v := range m { 3359 switch k { 3360 case "error": 3361 if v != nil { 3362 var errorResponseBody ErrorResponseBody 3363 err = json.Unmarshal(*v, &errorResponseBody) 3364 if err != nil { 3365 return err 3366 } 3367 er.ErrorResponseBody = &errorResponseBody 3368 } 3369 } 3370 } 3371 3372 return nil 3373} 3374 3375// ErrorResponseBody error Body contract. 3376type ErrorResponseBody struct { 3377 // Code - Service-defined error code. This code serves as a sub-status for the HTTP error code specified in the response. 3378 Code *string `json:"code,omitempty"` 3379 // Message - Human-readable representation of the error. 3380 Message *string `json:"message,omitempty"` 3381 // Details - The list of invalid fields send in request, in case of validation error. 3382 Details *[]ErrorFieldContract `json:"details,omitempty"` 3383} 3384 3385// GenerateSsoURLResult generate SSO Url operations response details. 3386type GenerateSsoURLResult struct { 3387 autorest.Response `json:"-"` 3388 // Value - Redirect Url containing the SSO URL value. 3389 Value *string `json:"value,omitempty"` 3390} 3391 3392// GroupCollection paged Group list representation. 3393type GroupCollection struct { 3394 autorest.Response `json:"-"` 3395 // Value - Page values. 3396 Value *[]GroupContract `json:"value,omitempty"` 3397 // NextLink - Next page link if any. 3398 NextLink *string `json:"nextLink,omitempty"` 3399} 3400 3401// GroupCollectionIterator provides access to a complete listing of GroupContract values. 3402type GroupCollectionIterator struct { 3403 i int 3404 page GroupCollectionPage 3405} 3406 3407// Next advances to the next value. If there was an error making 3408// the request the iterator does not advance and the error is returned. 3409func (iter *GroupCollectionIterator) Next() error { 3410 iter.i++ 3411 if iter.i < len(iter.page.Values()) { 3412 return nil 3413 } 3414 err := iter.page.Next() 3415 if err != nil { 3416 iter.i-- 3417 return err 3418 } 3419 iter.i = 0 3420 return nil 3421} 3422 3423// NotDone returns true if the enumeration should be started or is not yet complete. 3424func (iter GroupCollectionIterator) NotDone() bool { 3425 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 3426} 3427 3428// Response returns the raw server response from the last page request. 3429func (iter GroupCollectionIterator) Response() GroupCollection { 3430 return iter.page.Response() 3431} 3432 3433// Value returns the current value or a zero-initialized value if the 3434// iterator has advanced beyond the end of the collection. 3435func (iter GroupCollectionIterator) Value() GroupContract { 3436 if !iter.page.NotDone() { 3437 return GroupContract{} 3438 } 3439 return iter.page.Values()[iter.i] 3440} 3441 3442// IsEmpty returns true if the ListResult contains no values. 3443func (gc GroupCollection) IsEmpty() bool { 3444 return gc.Value == nil || len(*gc.Value) == 0 3445} 3446 3447// groupCollectionPreparer prepares a request to retrieve the next set of results. 3448// It returns nil if no more results exist. 3449func (gc GroupCollection) groupCollectionPreparer() (*http.Request, error) { 3450 if gc.NextLink == nil || len(to.String(gc.NextLink)) < 1 { 3451 return nil, nil 3452 } 3453 return autorest.Prepare(&http.Request{}, 3454 autorest.AsJSON(), 3455 autorest.AsGet(), 3456 autorest.WithBaseURL(to.String(gc.NextLink))) 3457} 3458 3459// GroupCollectionPage contains a page of GroupContract values. 3460type GroupCollectionPage struct { 3461 fn func(GroupCollection) (GroupCollection, error) 3462 gc GroupCollection 3463} 3464 3465// Next advances to the next page of values. If there was an error making 3466// the request the page does not advance and the error is returned. 3467func (page *GroupCollectionPage) Next() error { 3468 next, err := page.fn(page.gc) 3469 if err != nil { 3470 return err 3471 } 3472 page.gc = next 3473 return nil 3474} 3475 3476// NotDone returns true if the page enumeration should be started or is not yet complete. 3477func (page GroupCollectionPage) NotDone() bool { 3478 return !page.gc.IsEmpty() 3479} 3480 3481// Response returns the raw server response from the last page request. 3482func (page GroupCollectionPage) Response() GroupCollection { 3483 return page.gc 3484} 3485 3486// Values returns the slice of values for the current page or nil if there are no values. 3487func (page GroupCollectionPage) Values() []GroupContract { 3488 if page.gc.IsEmpty() { 3489 return nil 3490 } 3491 return *page.gc.Value 3492} 3493 3494// GroupContract contract details. 3495type GroupContract struct { 3496 autorest.Response `json:"-"` 3497 // GroupContractProperties - Group entity contract properties. 3498 *GroupContractProperties `json:"properties,omitempty"` 3499 // ID - Resource ID. 3500 ID *string `json:"id,omitempty"` 3501 // Name - Resource name. 3502 Name *string `json:"name,omitempty"` 3503 // Type - Resource type for API Management resource. 3504 Type *string `json:"type,omitempty"` 3505} 3506 3507// MarshalJSON is the custom marshaler for GroupContract. 3508func (gc GroupContract) MarshalJSON() ([]byte, error) { 3509 objectMap := make(map[string]interface{}) 3510 if gc.GroupContractProperties != nil { 3511 objectMap["properties"] = gc.GroupContractProperties 3512 } 3513 if gc.ID != nil { 3514 objectMap["id"] = gc.ID 3515 } 3516 if gc.Name != nil { 3517 objectMap["name"] = gc.Name 3518 } 3519 if gc.Type != nil { 3520 objectMap["type"] = gc.Type 3521 } 3522 return json.Marshal(objectMap) 3523} 3524 3525// UnmarshalJSON is the custom unmarshaler for GroupContract struct. 3526func (gc *GroupContract) UnmarshalJSON(body []byte) error { 3527 var m map[string]*json.RawMessage 3528 err := json.Unmarshal(body, &m) 3529 if err != nil { 3530 return err 3531 } 3532 for k, v := range m { 3533 switch k { 3534 case "properties": 3535 if v != nil { 3536 var groupContractProperties GroupContractProperties 3537 err = json.Unmarshal(*v, &groupContractProperties) 3538 if err != nil { 3539 return err 3540 } 3541 gc.GroupContractProperties = &groupContractProperties 3542 } 3543 case "id": 3544 if v != nil { 3545 var ID string 3546 err = json.Unmarshal(*v, &ID) 3547 if err != nil { 3548 return err 3549 } 3550 gc.ID = &ID 3551 } 3552 case "name": 3553 if v != nil { 3554 var name string 3555 err = json.Unmarshal(*v, &name) 3556 if err != nil { 3557 return err 3558 } 3559 gc.Name = &name 3560 } 3561 case "type": 3562 if v != nil { 3563 var typeVar string 3564 err = json.Unmarshal(*v, &typeVar) 3565 if err != nil { 3566 return err 3567 } 3568 gc.Type = &typeVar 3569 } 3570 } 3571 } 3572 3573 return nil 3574} 3575 3576// GroupContractProperties group contract Properties. 3577type GroupContractProperties struct { 3578 // DisplayName - Group name. 3579 DisplayName *string `json:"displayName,omitempty"` 3580 // Description - Group description. Can contain HTML formatting tags. 3581 Description *string `json:"description,omitempty"` 3582 // BuiltIn - true if the group is one of the three system groups (Administrators, Developers, or Guests); otherwise false. 3583 BuiltIn *bool `json:"builtIn,omitempty"` 3584 // Type - Group type. Possible values include: 'Custom', 'System', 'External' 3585 Type GroupType `json:"type,omitempty"` 3586 // 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. 3587 ExternalID *string `json:"externalId,omitempty"` 3588} 3589 3590// GroupCreateParameters parameters supplied to the Create Group operation. 3591type GroupCreateParameters struct { 3592 // GroupCreateParametersProperties - Properties supplied to Create Group operation. 3593 *GroupCreateParametersProperties `json:"properties,omitempty"` 3594} 3595 3596// MarshalJSON is the custom marshaler for GroupCreateParameters. 3597func (gcp GroupCreateParameters) MarshalJSON() ([]byte, error) { 3598 objectMap := make(map[string]interface{}) 3599 if gcp.GroupCreateParametersProperties != nil { 3600 objectMap["properties"] = gcp.GroupCreateParametersProperties 3601 } 3602 return json.Marshal(objectMap) 3603} 3604 3605// UnmarshalJSON is the custom unmarshaler for GroupCreateParameters struct. 3606func (gcp *GroupCreateParameters) UnmarshalJSON(body []byte) error { 3607 var m map[string]*json.RawMessage 3608 err := json.Unmarshal(body, &m) 3609 if err != nil { 3610 return err 3611 } 3612 for k, v := range m { 3613 switch k { 3614 case "properties": 3615 if v != nil { 3616 var groupCreateParametersProperties GroupCreateParametersProperties 3617 err = json.Unmarshal(*v, &groupCreateParametersProperties) 3618 if err != nil { 3619 return err 3620 } 3621 gcp.GroupCreateParametersProperties = &groupCreateParametersProperties 3622 } 3623 } 3624 } 3625 3626 return nil 3627} 3628 3629// GroupCreateParametersProperties parameters supplied to the Create Group operation. 3630type GroupCreateParametersProperties struct { 3631 // DisplayName - Group name. 3632 DisplayName *string `json:"displayName,omitempty"` 3633 // Description - Group description. 3634 Description *string `json:"description,omitempty"` 3635 // Type - Group type. Possible values include: 'Custom', 'System', 'External' 3636 Type GroupType `json:"type,omitempty"` 3637 // 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. 3638 ExternalID *string `json:"externalId,omitempty"` 3639} 3640 3641// GroupUpdateParameters parameters supplied to the Update Group operation. 3642type GroupUpdateParameters struct { 3643 // GroupUpdateParametersProperties - Group entity update contract properties. 3644 *GroupUpdateParametersProperties `json:"properties,omitempty"` 3645} 3646 3647// MarshalJSON is the custom marshaler for GroupUpdateParameters. 3648func (gup GroupUpdateParameters) MarshalJSON() ([]byte, error) { 3649 objectMap := make(map[string]interface{}) 3650 if gup.GroupUpdateParametersProperties != nil { 3651 objectMap["properties"] = gup.GroupUpdateParametersProperties 3652 } 3653 return json.Marshal(objectMap) 3654} 3655 3656// UnmarshalJSON is the custom unmarshaler for GroupUpdateParameters struct. 3657func (gup *GroupUpdateParameters) UnmarshalJSON(body []byte) error { 3658 var m map[string]*json.RawMessage 3659 err := json.Unmarshal(body, &m) 3660 if err != nil { 3661 return err 3662 } 3663 for k, v := range m { 3664 switch k { 3665 case "properties": 3666 if v != nil { 3667 var groupUpdateParametersProperties GroupUpdateParametersProperties 3668 err = json.Unmarshal(*v, &groupUpdateParametersProperties) 3669 if err != nil { 3670 return err 3671 } 3672 gup.GroupUpdateParametersProperties = &groupUpdateParametersProperties 3673 } 3674 } 3675 } 3676 3677 return nil 3678} 3679 3680// GroupUpdateParametersProperties parameters supplied to the Update Group operation. 3681type GroupUpdateParametersProperties struct { 3682 // DisplayName - Group name. 3683 DisplayName *string `json:"displayName,omitempty"` 3684 // Description - Group description. 3685 Description *string `json:"description,omitempty"` 3686 // Type - Group type. Possible values include: 'Custom', 'System', 'External' 3687 Type GroupType `json:"type,omitempty"` 3688 // 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. 3689 ExternalID *string `json:"externalId,omitempty"` 3690} 3691 3692// HostnameConfiguration custom hostname configuration. 3693type HostnameConfiguration struct { 3694 // Type - Hostname type. Possible values include: 'Proxy', 'Portal', 'Management', 'Scm' 3695 Type HostnameType `json:"type,omitempty"` 3696 // HostName - Hostname to configure on the Api Management service. 3697 HostName *string `json:"hostName,omitempty"` 3698 // 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* 3699 KeyVaultID *string `json:"keyVaultId,omitempty"` 3700 // EncodedCertificate - Base64 Encoded certificate. 3701 EncodedCertificate *string `json:"encodedCertificate,omitempty"` 3702 // CertificatePassword - Certificate Password. 3703 CertificatePassword *string `json:"certificatePassword,omitempty"` 3704 // 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. 3705 DefaultSslBinding *bool `json:"defaultSslBinding,omitempty"` 3706 // NegotiateClientCertificate - Specify true to always negotiate client certificate on the hostname. Default Value is false. 3707 NegotiateClientCertificate *bool `json:"negotiateClientCertificate,omitempty"` 3708 // Certificate - Certificate information. 3709 Certificate *CertificateInformation `json:"certificate,omitempty"` 3710} 3711 3712// HostnameConfigurationOld custom hostname configuration. 3713type HostnameConfigurationOld struct { 3714 // Type - Hostname type. Possible values include: 'Proxy', 'Portal', 'Management', 'Scm' 3715 Type HostnameType `json:"type,omitempty"` 3716 // Hostname - Hostname to configure. 3717 Hostname *string `json:"hostname,omitempty"` 3718 // Certificate - Certificate information. 3719 Certificate *CertificateInformation `json:"certificate,omitempty"` 3720} 3721 3722// IdentityProviderBaseParameters identity Provider Base Parameter Properties. 3723type IdentityProviderBaseParameters struct { 3724 // Type - Identity Provider Type identifier. Possible values include: 'Facebook', 'Google', 'Microsoft', 'Twitter', 'Aad', 'AadB2C' 3725 Type IdentityProviderType `json:"type,omitempty"` 3726 // AllowedTenants - List of Allowed Tenants when configuring Azure Active Directory login. 3727 AllowedTenants *[]string `json:"allowedTenants,omitempty"` 3728 // SignupPolicyName - Signup Policy Name. Only applies to AAD B2C Identity Provider. 3729 SignupPolicyName *string `json:"signupPolicyName,omitempty"` 3730 // SigninPolicyName - Signin Policy Name. Only applies to AAD B2C Identity Provider. 3731 SigninPolicyName *string `json:"signinPolicyName,omitempty"` 3732 // ProfileEditingPolicyName - Profile Editing Policy Name. Only applies to AAD B2C Identity Provider. 3733 ProfileEditingPolicyName *string `json:"profileEditingPolicyName,omitempty"` 3734 // PasswordResetPolicyName - Password Reset Policy Name. Only applies to AAD B2C Identity Provider. 3735 PasswordResetPolicyName *string `json:"passwordResetPolicyName,omitempty"` 3736} 3737 3738// IdentityProviderContract identity Provider details. 3739type IdentityProviderContract struct { 3740 autorest.Response `json:"-"` 3741 // IdentityProviderContractProperties - Identity Provider contract properties. 3742 *IdentityProviderContractProperties `json:"properties,omitempty"` 3743 // ID - Resource ID. 3744 ID *string `json:"id,omitempty"` 3745 // Name - Resource name. 3746 Name *string `json:"name,omitempty"` 3747 // Type - Resource type for API Management resource. 3748 Type *string `json:"type,omitempty"` 3749} 3750 3751// MarshalJSON is the custom marshaler for IdentityProviderContract. 3752func (ipc IdentityProviderContract) MarshalJSON() ([]byte, error) { 3753 objectMap := make(map[string]interface{}) 3754 if ipc.IdentityProviderContractProperties != nil { 3755 objectMap["properties"] = ipc.IdentityProviderContractProperties 3756 } 3757 if ipc.ID != nil { 3758 objectMap["id"] = ipc.ID 3759 } 3760 if ipc.Name != nil { 3761 objectMap["name"] = ipc.Name 3762 } 3763 if ipc.Type != nil { 3764 objectMap["type"] = ipc.Type 3765 } 3766 return json.Marshal(objectMap) 3767} 3768 3769// UnmarshalJSON is the custom unmarshaler for IdentityProviderContract struct. 3770func (ipc *IdentityProviderContract) UnmarshalJSON(body []byte) error { 3771 var m map[string]*json.RawMessage 3772 err := json.Unmarshal(body, &m) 3773 if err != nil { 3774 return err 3775 } 3776 for k, v := range m { 3777 switch k { 3778 case "properties": 3779 if v != nil { 3780 var identityProviderContractProperties IdentityProviderContractProperties 3781 err = json.Unmarshal(*v, &identityProviderContractProperties) 3782 if err != nil { 3783 return err 3784 } 3785 ipc.IdentityProviderContractProperties = &identityProviderContractProperties 3786 } 3787 case "id": 3788 if v != nil { 3789 var ID string 3790 err = json.Unmarshal(*v, &ID) 3791 if err != nil { 3792 return err 3793 } 3794 ipc.ID = &ID 3795 } 3796 case "name": 3797 if v != nil { 3798 var name string 3799 err = json.Unmarshal(*v, &name) 3800 if err != nil { 3801 return err 3802 } 3803 ipc.Name = &name 3804 } 3805 case "type": 3806 if v != nil { 3807 var typeVar string 3808 err = json.Unmarshal(*v, &typeVar) 3809 if err != nil { 3810 return err 3811 } 3812 ipc.Type = &typeVar 3813 } 3814 } 3815 } 3816 3817 return nil 3818} 3819 3820// IdentityProviderContractProperties the external Identity Providers like Facebook, Google, Microsoft, Twitter or 3821// Azure Active Directory which can be used to enable access to the API Management service developer portal for all 3822// users. 3823type IdentityProviderContractProperties struct { 3824 // 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. 3825 ClientID *string `json:"clientId,omitempty"` 3826 // 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. 3827 ClientSecret *string `json:"clientSecret,omitempty"` 3828 // Type - Identity Provider Type identifier. Possible values include: 'Facebook', 'Google', 'Microsoft', 'Twitter', 'Aad', 'AadB2C' 3829 Type IdentityProviderType `json:"type,omitempty"` 3830 // AllowedTenants - List of Allowed Tenants when configuring Azure Active Directory login. 3831 AllowedTenants *[]string `json:"allowedTenants,omitempty"` 3832 // SignupPolicyName - Signup Policy Name. Only applies to AAD B2C Identity Provider. 3833 SignupPolicyName *string `json:"signupPolicyName,omitempty"` 3834 // SigninPolicyName - Signin Policy Name. Only applies to AAD B2C Identity Provider. 3835 SigninPolicyName *string `json:"signinPolicyName,omitempty"` 3836 // ProfileEditingPolicyName - Profile Editing Policy Name. Only applies to AAD B2C Identity Provider. 3837 ProfileEditingPolicyName *string `json:"profileEditingPolicyName,omitempty"` 3838 // PasswordResetPolicyName - Password Reset Policy Name. Only applies to AAD B2C Identity Provider. 3839 PasswordResetPolicyName *string `json:"passwordResetPolicyName,omitempty"` 3840} 3841 3842// IdentityProviderList list of all the Identity Providers configured on the service instance. 3843type IdentityProviderList struct { 3844 autorest.Response `json:"-"` 3845 // Value - Identity Provider configuration values. 3846 Value *[]IdentityProviderContract `json:"value,omitempty"` 3847 // NextLink - Next page link if any. 3848 NextLink *string `json:"nextLink,omitempty"` 3849} 3850 3851// IdentityProviderListIterator provides access to a complete listing of IdentityProviderContract values. 3852type IdentityProviderListIterator struct { 3853 i int 3854 page IdentityProviderListPage 3855} 3856 3857// Next advances to the next value. If there was an error making 3858// the request the iterator does not advance and the error is returned. 3859func (iter *IdentityProviderListIterator) Next() error { 3860 iter.i++ 3861 if iter.i < len(iter.page.Values()) { 3862 return nil 3863 } 3864 err := iter.page.Next() 3865 if err != nil { 3866 iter.i-- 3867 return err 3868 } 3869 iter.i = 0 3870 return nil 3871} 3872 3873// NotDone returns true if the enumeration should be started or is not yet complete. 3874func (iter IdentityProviderListIterator) NotDone() bool { 3875 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 3876} 3877 3878// Response returns the raw server response from the last page request. 3879func (iter IdentityProviderListIterator) Response() IdentityProviderList { 3880 return iter.page.Response() 3881} 3882 3883// Value returns the current value or a zero-initialized value if the 3884// iterator has advanced beyond the end of the collection. 3885func (iter IdentityProviderListIterator) Value() IdentityProviderContract { 3886 if !iter.page.NotDone() { 3887 return IdentityProviderContract{} 3888 } 3889 return iter.page.Values()[iter.i] 3890} 3891 3892// IsEmpty returns true if the ListResult contains no values. 3893func (ipl IdentityProviderList) IsEmpty() bool { 3894 return ipl.Value == nil || len(*ipl.Value) == 0 3895} 3896 3897// identityProviderListPreparer prepares a request to retrieve the next set of results. 3898// It returns nil if no more results exist. 3899func (ipl IdentityProviderList) identityProviderListPreparer() (*http.Request, error) { 3900 if ipl.NextLink == nil || len(to.String(ipl.NextLink)) < 1 { 3901 return nil, nil 3902 } 3903 return autorest.Prepare(&http.Request{}, 3904 autorest.AsJSON(), 3905 autorest.AsGet(), 3906 autorest.WithBaseURL(to.String(ipl.NextLink))) 3907} 3908 3909// IdentityProviderListPage contains a page of IdentityProviderContract values. 3910type IdentityProviderListPage struct { 3911 fn func(IdentityProviderList) (IdentityProviderList, error) 3912 ipl IdentityProviderList 3913} 3914 3915// Next advances to the next page of values. If there was an error making 3916// the request the page does not advance and the error is returned. 3917func (page *IdentityProviderListPage) Next() error { 3918 next, err := page.fn(page.ipl) 3919 if err != nil { 3920 return err 3921 } 3922 page.ipl = next 3923 return nil 3924} 3925 3926// NotDone returns true if the page enumeration should be started or is not yet complete. 3927func (page IdentityProviderListPage) NotDone() bool { 3928 return !page.ipl.IsEmpty() 3929} 3930 3931// Response returns the raw server response from the last page request. 3932func (page IdentityProviderListPage) Response() IdentityProviderList { 3933 return page.ipl 3934} 3935 3936// Values returns the slice of values for the current page or nil if there are no values. 3937func (page IdentityProviderListPage) Values() []IdentityProviderContract { 3938 if page.ipl.IsEmpty() { 3939 return nil 3940 } 3941 return *page.ipl.Value 3942} 3943 3944// IdentityProviderUpdateParameters parameters supplied to update Identity Provider 3945type IdentityProviderUpdateParameters struct { 3946 // IdentityProviderUpdateProperties - Identity Provider update properties. 3947 *IdentityProviderUpdateProperties `json:"properties,omitempty"` 3948} 3949 3950// MarshalJSON is the custom marshaler for IdentityProviderUpdateParameters. 3951func (ipup IdentityProviderUpdateParameters) MarshalJSON() ([]byte, error) { 3952 objectMap := make(map[string]interface{}) 3953 if ipup.IdentityProviderUpdateProperties != nil { 3954 objectMap["properties"] = ipup.IdentityProviderUpdateProperties 3955 } 3956 return json.Marshal(objectMap) 3957} 3958 3959// UnmarshalJSON is the custom unmarshaler for IdentityProviderUpdateParameters struct. 3960func (ipup *IdentityProviderUpdateParameters) UnmarshalJSON(body []byte) error { 3961 var m map[string]*json.RawMessage 3962 err := json.Unmarshal(body, &m) 3963 if err != nil { 3964 return err 3965 } 3966 for k, v := range m { 3967 switch k { 3968 case "properties": 3969 if v != nil { 3970 var identityProviderUpdateProperties IdentityProviderUpdateProperties 3971 err = json.Unmarshal(*v, &identityProviderUpdateProperties) 3972 if err != nil { 3973 return err 3974 } 3975 ipup.IdentityProviderUpdateProperties = &identityProviderUpdateProperties 3976 } 3977 } 3978 } 3979 3980 return nil 3981} 3982 3983// IdentityProviderUpdateProperties parameters supplied to the Update Identity Provider operation. 3984type IdentityProviderUpdateProperties struct { 3985 // 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. 3986 ClientID *string `json:"clientId,omitempty"` 3987 // 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. 3988 ClientSecret *string `json:"clientSecret,omitempty"` 3989 // Type - Identity Provider Type identifier. Possible values include: 'Facebook', 'Google', 'Microsoft', 'Twitter', 'Aad', 'AadB2C' 3990 Type IdentityProviderType `json:"type,omitempty"` 3991 // AllowedTenants - List of Allowed Tenants when configuring Azure Active Directory login. 3992 AllowedTenants *[]string `json:"allowedTenants,omitempty"` 3993 // SignupPolicyName - Signup Policy Name. Only applies to AAD B2C Identity Provider. 3994 SignupPolicyName *string `json:"signupPolicyName,omitempty"` 3995 // SigninPolicyName - Signin Policy Name. Only applies to AAD B2C Identity Provider. 3996 SigninPolicyName *string `json:"signinPolicyName,omitempty"` 3997 // ProfileEditingPolicyName - Profile Editing Policy Name. Only applies to AAD B2C Identity Provider. 3998 ProfileEditingPolicyName *string `json:"profileEditingPolicyName,omitempty"` 3999 // PasswordResetPolicyName - Password Reset Policy Name. Only applies to AAD B2C Identity Provider. 4000 PasswordResetPolicyName *string `json:"passwordResetPolicyName,omitempty"` 4001} 4002 4003// IssueAttachmentCollection paged Issue Attachment list representation. 4004type IssueAttachmentCollection struct { 4005 autorest.Response `json:"-"` 4006 // Value - Issue Attachment values. 4007 Value *[]IssueAttachmentContract `json:"value,omitempty"` 4008 // NextLink - Next page link if any. 4009 NextLink *string `json:"nextLink,omitempty"` 4010} 4011 4012// IssueAttachmentCollectionIterator provides access to a complete listing of IssueAttachmentContract values. 4013type IssueAttachmentCollectionIterator struct { 4014 i int 4015 page IssueAttachmentCollectionPage 4016} 4017 4018// Next advances to the next value. If there was an error making 4019// the request the iterator does not advance and the error is returned. 4020func (iter *IssueAttachmentCollectionIterator) Next() error { 4021 iter.i++ 4022 if iter.i < len(iter.page.Values()) { 4023 return nil 4024 } 4025 err := iter.page.Next() 4026 if err != nil { 4027 iter.i-- 4028 return err 4029 } 4030 iter.i = 0 4031 return nil 4032} 4033 4034// NotDone returns true if the enumeration should be started or is not yet complete. 4035func (iter IssueAttachmentCollectionIterator) NotDone() bool { 4036 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 4037} 4038 4039// Response returns the raw server response from the last page request. 4040func (iter IssueAttachmentCollectionIterator) Response() IssueAttachmentCollection { 4041 return iter.page.Response() 4042} 4043 4044// Value returns the current value or a zero-initialized value if the 4045// iterator has advanced beyond the end of the collection. 4046func (iter IssueAttachmentCollectionIterator) Value() IssueAttachmentContract { 4047 if !iter.page.NotDone() { 4048 return IssueAttachmentContract{} 4049 } 4050 return iter.page.Values()[iter.i] 4051} 4052 4053// IsEmpty returns true if the ListResult contains no values. 4054func (iac IssueAttachmentCollection) IsEmpty() bool { 4055 return iac.Value == nil || len(*iac.Value) == 0 4056} 4057 4058// issueAttachmentCollectionPreparer prepares a request to retrieve the next set of results. 4059// It returns nil if no more results exist. 4060func (iac IssueAttachmentCollection) issueAttachmentCollectionPreparer() (*http.Request, error) { 4061 if iac.NextLink == nil || len(to.String(iac.NextLink)) < 1 { 4062 return nil, nil 4063 } 4064 return autorest.Prepare(&http.Request{}, 4065 autorest.AsJSON(), 4066 autorest.AsGet(), 4067 autorest.WithBaseURL(to.String(iac.NextLink))) 4068} 4069 4070// IssueAttachmentCollectionPage contains a page of IssueAttachmentContract values. 4071type IssueAttachmentCollectionPage struct { 4072 fn func(IssueAttachmentCollection) (IssueAttachmentCollection, error) 4073 iac IssueAttachmentCollection 4074} 4075 4076// Next advances to the next page of values. If there was an error making 4077// the request the page does not advance and the error is returned. 4078func (page *IssueAttachmentCollectionPage) Next() error { 4079 next, err := page.fn(page.iac) 4080 if err != nil { 4081 return err 4082 } 4083 page.iac = next 4084 return nil 4085} 4086 4087// NotDone returns true if the page enumeration should be started or is not yet complete. 4088func (page IssueAttachmentCollectionPage) NotDone() bool { 4089 return !page.iac.IsEmpty() 4090} 4091 4092// Response returns the raw server response from the last page request. 4093func (page IssueAttachmentCollectionPage) Response() IssueAttachmentCollection { 4094 return page.iac 4095} 4096 4097// Values returns the slice of values for the current page or nil if there are no values. 4098func (page IssueAttachmentCollectionPage) Values() []IssueAttachmentContract { 4099 if page.iac.IsEmpty() { 4100 return nil 4101 } 4102 return *page.iac.Value 4103} 4104 4105// IssueAttachmentContract issue Attachment Contract details. 4106type IssueAttachmentContract struct { 4107 autorest.Response `json:"-"` 4108 // IssueAttachmentContractProperties - Properties of the Issue Attachment. 4109 *IssueAttachmentContractProperties `json:"properties,omitempty"` 4110 // ID - Resource ID. 4111 ID *string `json:"id,omitempty"` 4112 // Name - Resource name. 4113 Name *string `json:"name,omitempty"` 4114 // Type - Resource type for API Management resource. 4115 Type *string `json:"type,omitempty"` 4116} 4117 4118// MarshalJSON is the custom marshaler for IssueAttachmentContract. 4119func (iac IssueAttachmentContract) MarshalJSON() ([]byte, error) { 4120 objectMap := make(map[string]interface{}) 4121 if iac.IssueAttachmentContractProperties != nil { 4122 objectMap["properties"] = iac.IssueAttachmentContractProperties 4123 } 4124 if iac.ID != nil { 4125 objectMap["id"] = iac.ID 4126 } 4127 if iac.Name != nil { 4128 objectMap["name"] = iac.Name 4129 } 4130 if iac.Type != nil { 4131 objectMap["type"] = iac.Type 4132 } 4133 return json.Marshal(objectMap) 4134} 4135 4136// UnmarshalJSON is the custom unmarshaler for IssueAttachmentContract struct. 4137func (iac *IssueAttachmentContract) UnmarshalJSON(body []byte) error { 4138 var m map[string]*json.RawMessage 4139 err := json.Unmarshal(body, &m) 4140 if err != nil { 4141 return err 4142 } 4143 for k, v := range m { 4144 switch k { 4145 case "properties": 4146 if v != nil { 4147 var issueAttachmentContractProperties IssueAttachmentContractProperties 4148 err = json.Unmarshal(*v, &issueAttachmentContractProperties) 4149 if err != nil { 4150 return err 4151 } 4152 iac.IssueAttachmentContractProperties = &issueAttachmentContractProperties 4153 } 4154 case "id": 4155 if v != nil { 4156 var ID string 4157 err = json.Unmarshal(*v, &ID) 4158 if err != nil { 4159 return err 4160 } 4161 iac.ID = &ID 4162 } 4163 case "name": 4164 if v != nil { 4165 var name string 4166 err = json.Unmarshal(*v, &name) 4167 if err != nil { 4168 return err 4169 } 4170 iac.Name = &name 4171 } 4172 case "type": 4173 if v != nil { 4174 var typeVar string 4175 err = json.Unmarshal(*v, &typeVar) 4176 if err != nil { 4177 return err 4178 } 4179 iac.Type = &typeVar 4180 } 4181 } 4182 } 4183 4184 return nil 4185} 4186 4187// IssueAttachmentContractProperties issue Attachment contract Properties. 4188type IssueAttachmentContractProperties struct { 4189 // Title - Filename by which the binary data will be saved. 4190 Title *string `json:"title,omitempty"` 4191 // 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. 4192 ContentFormat *string `json:"contentFormat,omitempty"` 4193 // Content - An HTTP link or Base64-encoded binary data. 4194 Content *string `json:"content,omitempty"` 4195} 4196 4197// IssueCollection paged Issue list representation. 4198type IssueCollection struct { 4199 autorest.Response `json:"-"` 4200 // Value - Issue values. 4201 Value *[]IssueContract `json:"value,omitempty"` 4202 // NextLink - Next page link if any. 4203 NextLink *string `json:"nextLink,omitempty"` 4204} 4205 4206// IssueCollectionIterator provides access to a complete listing of IssueContract values. 4207type IssueCollectionIterator struct { 4208 i int 4209 page IssueCollectionPage 4210} 4211 4212// Next advances to the next value. If there was an error making 4213// the request the iterator does not advance and the error is returned. 4214func (iter *IssueCollectionIterator) Next() error { 4215 iter.i++ 4216 if iter.i < len(iter.page.Values()) { 4217 return nil 4218 } 4219 err := iter.page.Next() 4220 if err != nil { 4221 iter.i-- 4222 return err 4223 } 4224 iter.i = 0 4225 return nil 4226} 4227 4228// NotDone returns true if the enumeration should be started or is not yet complete. 4229func (iter IssueCollectionIterator) NotDone() bool { 4230 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 4231} 4232 4233// Response returns the raw server response from the last page request. 4234func (iter IssueCollectionIterator) Response() IssueCollection { 4235 return iter.page.Response() 4236} 4237 4238// Value returns the current value or a zero-initialized value if the 4239// iterator has advanced beyond the end of the collection. 4240func (iter IssueCollectionIterator) Value() IssueContract { 4241 if !iter.page.NotDone() { 4242 return IssueContract{} 4243 } 4244 return iter.page.Values()[iter.i] 4245} 4246 4247// IsEmpty returns true if the ListResult contains no values. 4248func (ic IssueCollection) IsEmpty() bool { 4249 return ic.Value == nil || len(*ic.Value) == 0 4250} 4251 4252// issueCollectionPreparer prepares a request to retrieve the next set of results. 4253// It returns nil if no more results exist. 4254func (ic IssueCollection) issueCollectionPreparer() (*http.Request, error) { 4255 if ic.NextLink == nil || len(to.String(ic.NextLink)) < 1 { 4256 return nil, nil 4257 } 4258 return autorest.Prepare(&http.Request{}, 4259 autorest.AsJSON(), 4260 autorest.AsGet(), 4261 autorest.WithBaseURL(to.String(ic.NextLink))) 4262} 4263 4264// IssueCollectionPage contains a page of IssueContract values. 4265type IssueCollectionPage struct { 4266 fn func(IssueCollection) (IssueCollection, error) 4267 ic IssueCollection 4268} 4269 4270// Next advances to the next page of values. If there was an error making 4271// the request the page does not advance and the error is returned. 4272func (page *IssueCollectionPage) Next() error { 4273 next, err := page.fn(page.ic) 4274 if err != nil { 4275 return err 4276 } 4277 page.ic = next 4278 return nil 4279} 4280 4281// NotDone returns true if the page enumeration should be started or is not yet complete. 4282func (page IssueCollectionPage) NotDone() bool { 4283 return !page.ic.IsEmpty() 4284} 4285 4286// Response returns the raw server response from the last page request. 4287func (page IssueCollectionPage) Response() IssueCollection { 4288 return page.ic 4289} 4290 4291// Values returns the slice of values for the current page or nil if there are no values. 4292func (page IssueCollectionPage) Values() []IssueContract { 4293 if page.ic.IsEmpty() { 4294 return nil 4295 } 4296 return *page.ic.Value 4297} 4298 4299// IssueCommentCollection paged Issue Comment list representation. 4300type IssueCommentCollection struct { 4301 autorest.Response `json:"-"` 4302 // Value - Issue Comment values. 4303 Value *[]IssueCommentContract `json:"value,omitempty"` 4304 // NextLink - Next page link if any. 4305 NextLink *string `json:"nextLink,omitempty"` 4306} 4307 4308// IssueCommentCollectionIterator provides access to a complete listing of IssueCommentContract values. 4309type IssueCommentCollectionIterator struct { 4310 i int 4311 page IssueCommentCollectionPage 4312} 4313 4314// Next advances to the next value. If there was an error making 4315// the request the iterator does not advance and the error is returned. 4316func (iter *IssueCommentCollectionIterator) Next() error { 4317 iter.i++ 4318 if iter.i < len(iter.page.Values()) { 4319 return nil 4320 } 4321 err := iter.page.Next() 4322 if err != nil { 4323 iter.i-- 4324 return err 4325 } 4326 iter.i = 0 4327 return nil 4328} 4329 4330// NotDone returns true if the enumeration should be started or is not yet complete. 4331func (iter IssueCommentCollectionIterator) NotDone() bool { 4332 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 4333} 4334 4335// Response returns the raw server response from the last page request. 4336func (iter IssueCommentCollectionIterator) Response() IssueCommentCollection { 4337 return iter.page.Response() 4338} 4339 4340// Value returns the current value or a zero-initialized value if the 4341// iterator has advanced beyond the end of the collection. 4342func (iter IssueCommentCollectionIterator) Value() IssueCommentContract { 4343 if !iter.page.NotDone() { 4344 return IssueCommentContract{} 4345 } 4346 return iter.page.Values()[iter.i] 4347} 4348 4349// IsEmpty returns true if the ListResult contains no values. 4350func (icc IssueCommentCollection) IsEmpty() bool { 4351 return icc.Value == nil || len(*icc.Value) == 0 4352} 4353 4354// issueCommentCollectionPreparer prepares a request to retrieve the next set of results. 4355// It returns nil if no more results exist. 4356func (icc IssueCommentCollection) issueCommentCollectionPreparer() (*http.Request, error) { 4357 if icc.NextLink == nil || len(to.String(icc.NextLink)) < 1 { 4358 return nil, nil 4359 } 4360 return autorest.Prepare(&http.Request{}, 4361 autorest.AsJSON(), 4362 autorest.AsGet(), 4363 autorest.WithBaseURL(to.String(icc.NextLink))) 4364} 4365 4366// IssueCommentCollectionPage contains a page of IssueCommentContract values. 4367type IssueCommentCollectionPage struct { 4368 fn func(IssueCommentCollection) (IssueCommentCollection, error) 4369 icc IssueCommentCollection 4370} 4371 4372// Next advances to the next page of values. If there was an error making 4373// the request the page does not advance and the error is returned. 4374func (page *IssueCommentCollectionPage) Next() error { 4375 next, err := page.fn(page.icc) 4376 if err != nil { 4377 return err 4378 } 4379 page.icc = next 4380 return nil 4381} 4382 4383// NotDone returns true if the page enumeration should be started or is not yet complete. 4384func (page IssueCommentCollectionPage) NotDone() bool { 4385 return !page.icc.IsEmpty() 4386} 4387 4388// Response returns the raw server response from the last page request. 4389func (page IssueCommentCollectionPage) Response() IssueCommentCollection { 4390 return page.icc 4391} 4392 4393// Values returns the slice of values for the current page or nil if there are no values. 4394func (page IssueCommentCollectionPage) Values() []IssueCommentContract { 4395 if page.icc.IsEmpty() { 4396 return nil 4397 } 4398 return *page.icc.Value 4399} 4400 4401// IssueCommentContract issue Comment Contract details. 4402type IssueCommentContract struct { 4403 autorest.Response `json:"-"` 4404 // IssueCommentContractProperties - Properties of the Issue Comment. 4405 *IssueCommentContractProperties `json:"properties,omitempty"` 4406 // ID - Resource ID. 4407 ID *string `json:"id,omitempty"` 4408 // Name - Resource name. 4409 Name *string `json:"name,omitempty"` 4410 // Type - Resource type for API Management resource. 4411 Type *string `json:"type,omitempty"` 4412} 4413 4414// MarshalJSON is the custom marshaler for IssueCommentContract. 4415func (icc IssueCommentContract) MarshalJSON() ([]byte, error) { 4416 objectMap := make(map[string]interface{}) 4417 if icc.IssueCommentContractProperties != nil { 4418 objectMap["properties"] = icc.IssueCommentContractProperties 4419 } 4420 if icc.ID != nil { 4421 objectMap["id"] = icc.ID 4422 } 4423 if icc.Name != nil { 4424 objectMap["name"] = icc.Name 4425 } 4426 if icc.Type != nil { 4427 objectMap["type"] = icc.Type 4428 } 4429 return json.Marshal(objectMap) 4430} 4431 4432// UnmarshalJSON is the custom unmarshaler for IssueCommentContract struct. 4433func (icc *IssueCommentContract) UnmarshalJSON(body []byte) error { 4434 var m map[string]*json.RawMessage 4435 err := json.Unmarshal(body, &m) 4436 if err != nil { 4437 return err 4438 } 4439 for k, v := range m { 4440 switch k { 4441 case "properties": 4442 if v != nil { 4443 var issueCommentContractProperties IssueCommentContractProperties 4444 err = json.Unmarshal(*v, &issueCommentContractProperties) 4445 if err != nil { 4446 return err 4447 } 4448 icc.IssueCommentContractProperties = &issueCommentContractProperties 4449 } 4450 case "id": 4451 if v != nil { 4452 var ID string 4453 err = json.Unmarshal(*v, &ID) 4454 if err != nil { 4455 return err 4456 } 4457 icc.ID = &ID 4458 } 4459 case "name": 4460 if v != nil { 4461 var name string 4462 err = json.Unmarshal(*v, &name) 4463 if err != nil { 4464 return err 4465 } 4466 icc.Name = &name 4467 } 4468 case "type": 4469 if v != nil { 4470 var typeVar string 4471 err = json.Unmarshal(*v, &typeVar) 4472 if err != nil { 4473 return err 4474 } 4475 icc.Type = &typeVar 4476 } 4477 } 4478 } 4479 4480 return nil 4481} 4482 4483// IssueCommentContractProperties issue Comment contract Properties. 4484type IssueCommentContractProperties struct { 4485 // Text - Comment text. 4486 Text *string `json:"text,omitempty"` 4487 // CreatedDate - Date and time when the comment was created. 4488 CreatedDate *date.Time `json:"createdDate,omitempty"` 4489 // UserID - A resource identifier for the user who left the comment. 4490 UserID *string `json:"userId,omitempty"` 4491} 4492 4493// IssueContract issue Contract details. 4494type IssueContract struct { 4495 autorest.Response `json:"-"` 4496 // IssueContractProperties - Properties of the Issue. 4497 *IssueContractProperties `json:"properties,omitempty"` 4498 // ID - Resource ID. 4499 ID *string `json:"id,omitempty"` 4500 // Name - Resource name. 4501 Name *string `json:"name,omitempty"` 4502 // Type - Resource type for API Management resource. 4503 Type *string `json:"type,omitempty"` 4504} 4505 4506// MarshalJSON is the custom marshaler for IssueContract. 4507func (ic IssueContract) MarshalJSON() ([]byte, error) { 4508 objectMap := make(map[string]interface{}) 4509 if ic.IssueContractProperties != nil { 4510 objectMap["properties"] = ic.IssueContractProperties 4511 } 4512 if ic.ID != nil { 4513 objectMap["id"] = ic.ID 4514 } 4515 if ic.Name != nil { 4516 objectMap["name"] = ic.Name 4517 } 4518 if ic.Type != nil { 4519 objectMap["type"] = ic.Type 4520 } 4521 return json.Marshal(objectMap) 4522} 4523 4524// UnmarshalJSON is the custom unmarshaler for IssueContract struct. 4525func (ic *IssueContract) UnmarshalJSON(body []byte) error { 4526 var m map[string]*json.RawMessage 4527 err := json.Unmarshal(body, &m) 4528 if err != nil { 4529 return err 4530 } 4531 for k, v := range m { 4532 switch k { 4533 case "properties": 4534 if v != nil { 4535 var issueContractProperties IssueContractProperties 4536 err = json.Unmarshal(*v, &issueContractProperties) 4537 if err != nil { 4538 return err 4539 } 4540 ic.IssueContractProperties = &issueContractProperties 4541 } 4542 case "id": 4543 if v != nil { 4544 var ID string 4545 err = json.Unmarshal(*v, &ID) 4546 if err != nil { 4547 return err 4548 } 4549 ic.ID = &ID 4550 } 4551 case "name": 4552 if v != nil { 4553 var name string 4554 err = json.Unmarshal(*v, &name) 4555 if err != nil { 4556 return err 4557 } 4558 ic.Name = &name 4559 } 4560 case "type": 4561 if v != nil { 4562 var typeVar string 4563 err = json.Unmarshal(*v, &typeVar) 4564 if err != nil { 4565 return err 4566 } 4567 ic.Type = &typeVar 4568 } 4569 } 4570 } 4571 4572 return nil 4573} 4574 4575// IssueContractProperties issue contract Properties. 4576type IssueContractProperties struct { 4577 // Title - The issue title. 4578 Title *string `json:"title,omitempty"` 4579 // Description - Text describing the issue. 4580 Description *string `json:"description,omitempty"` 4581 // CreatedDate - Date and time when the issue was created. 4582 CreatedDate *date.Time `json:"createdDate,omitempty"` 4583 // State - Status of the issue. Possible values include: 'Proposed', 'Open', 'Removed', 'Resolved', 'Closed' 4584 State State `json:"state,omitempty"` 4585 // UserID - A resource identifier for the user created the issue. 4586 UserID *string `json:"userId,omitempty"` 4587 // APIID - A resource identifier for the API the issue was created for. 4588 APIID *string `json:"apiId,omitempty"` 4589} 4590 4591// ListNetworkStatusContractByLocation ... 4592type ListNetworkStatusContractByLocation struct { 4593 autorest.Response `json:"-"` 4594 Value *[]NetworkStatusContractByLocation `json:"value,omitempty"` 4595} 4596 4597// LoggerCollection paged Logger list representation. 4598type LoggerCollection struct { 4599 autorest.Response `json:"-"` 4600 // Value - Logger values. 4601 Value *[]LoggerContract `json:"value,omitempty"` 4602 // Count - Total record count number across all pages. 4603 Count *int64 `json:"count,omitempty"` 4604 // NextLink - Next page link if any. 4605 NextLink *string `json:"nextLink,omitempty"` 4606} 4607 4608// LoggerCollectionIterator provides access to a complete listing of LoggerContract values. 4609type LoggerCollectionIterator struct { 4610 i int 4611 page LoggerCollectionPage 4612} 4613 4614// Next advances to the next value. If there was an error making 4615// the request the iterator does not advance and the error is returned. 4616func (iter *LoggerCollectionIterator) Next() error { 4617 iter.i++ 4618 if iter.i < len(iter.page.Values()) { 4619 return nil 4620 } 4621 err := iter.page.Next() 4622 if err != nil { 4623 iter.i-- 4624 return err 4625 } 4626 iter.i = 0 4627 return nil 4628} 4629 4630// NotDone returns true if the enumeration should be started or is not yet complete. 4631func (iter LoggerCollectionIterator) NotDone() bool { 4632 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 4633} 4634 4635// Response returns the raw server response from the last page request. 4636func (iter LoggerCollectionIterator) Response() LoggerCollection { 4637 return iter.page.Response() 4638} 4639 4640// Value returns the current value or a zero-initialized value if the 4641// iterator has advanced beyond the end of the collection. 4642func (iter LoggerCollectionIterator) Value() LoggerContract { 4643 if !iter.page.NotDone() { 4644 return LoggerContract{} 4645 } 4646 return iter.page.Values()[iter.i] 4647} 4648 4649// IsEmpty returns true if the ListResult contains no values. 4650func (lc LoggerCollection) IsEmpty() bool { 4651 return lc.Value == nil || len(*lc.Value) == 0 4652} 4653 4654// loggerCollectionPreparer prepares a request to retrieve the next set of results. 4655// It returns nil if no more results exist. 4656func (lc LoggerCollection) loggerCollectionPreparer() (*http.Request, error) { 4657 if lc.NextLink == nil || len(to.String(lc.NextLink)) < 1 { 4658 return nil, nil 4659 } 4660 return autorest.Prepare(&http.Request{}, 4661 autorest.AsJSON(), 4662 autorest.AsGet(), 4663 autorest.WithBaseURL(to.String(lc.NextLink))) 4664} 4665 4666// LoggerCollectionPage contains a page of LoggerContract values. 4667type LoggerCollectionPage struct { 4668 fn func(LoggerCollection) (LoggerCollection, error) 4669 lc LoggerCollection 4670} 4671 4672// Next advances to the next page of values. If there was an error making 4673// the request the page does not advance and the error is returned. 4674func (page *LoggerCollectionPage) Next() error { 4675 next, err := page.fn(page.lc) 4676 if err != nil { 4677 return err 4678 } 4679 page.lc = next 4680 return nil 4681} 4682 4683// NotDone returns true if the page enumeration should be started or is not yet complete. 4684func (page LoggerCollectionPage) NotDone() bool { 4685 return !page.lc.IsEmpty() 4686} 4687 4688// Response returns the raw server response from the last page request. 4689func (page LoggerCollectionPage) Response() LoggerCollection { 4690 return page.lc 4691} 4692 4693// Values returns the slice of values for the current page or nil if there are no values. 4694func (page LoggerCollectionPage) Values() []LoggerContract { 4695 if page.lc.IsEmpty() { 4696 return nil 4697 } 4698 return *page.lc.Value 4699} 4700 4701// LoggerContract logger details. 4702type LoggerContract struct { 4703 autorest.Response `json:"-"` 4704 // LoggerContractProperties - Logger entity contract properties. 4705 *LoggerContractProperties `json:"properties,omitempty"` 4706 // ID - Resource ID. 4707 ID *string `json:"id,omitempty"` 4708 // Name - Resource name. 4709 Name *string `json:"name,omitempty"` 4710 // Type - Resource type for API Management resource. 4711 Type *string `json:"type,omitempty"` 4712} 4713 4714// MarshalJSON is the custom marshaler for LoggerContract. 4715func (lc LoggerContract) MarshalJSON() ([]byte, error) { 4716 objectMap := make(map[string]interface{}) 4717 if lc.LoggerContractProperties != nil { 4718 objectMap["properties"] = lc.LoggerContractProperties 4719 } 4720 if lc.ID != nil { 4721 objectMap["id"] = lc.ID 4722 } 4723 if lc.Name != nil { 4724 objectMap["name"] = lc.Name 4725 } 4726 if lc.Type != nil { 4727 objectMap["type"] = lc.Type 4728 } 4729 return json.Marshal(objectMap) 4730} 4731 4732// UnmarshalJSON is the custom unmarshaler for LoggerContract struct. 4733func (lc *LoggerContract) UnmarshalJSON(body []byte) error { 4734 var m map[string]*json.RawMessage 4735 err := json.Unmarshal(body, &m) 4736 if err != nil { 4737 return err 4738 } 4739 for k, v := range m { 4740 switch k { 4741 case "properties": 4742 if v != nil { 4743 var loggerContractProperties LoggerContractProperties 4744 err = json.Unmarshal(*v, &loggerContractProperties) 4745 if err != nil { 4746 return err 4747 } 4748 lc.LoggerContractProperties = &loggerContractProperties 4749 } 4750 case "id": 4751 if v != nil { 4752 var ID string 4753 err = json.Unmarshal(*v, &ID) 4754 if err != nil { 4755 return err 4756 } 4757 lc.ID = &ID 4758 } 4759 case "name": 4760 if v != nil { 4761 var name string 4762 err = json.Unmarshal(*v, &name) 4763 if err != nil { 4764 return err 4765 } 4766 lc.Name = &name 4767 } 4768 case "type": 4769 if v != nil { 4770 var typeVar string 4771 err = json.Unmarshal(*v, &typeVar) 4772 if err != nil { 4773 return err 4774 } 4775 lc.Type = &typeVar 4776 } 4777 } 4778 } 4779 4780 return nil 4781} 4782 4783// LoggerContractProperties the Logger entity in API Management represents an event sink that you can use to log 4784// API Management events. Currently the Logger entity supports logging API Management events to Azure Event Hubs. 4785type LoggerContractProperties struct { 4786 // LoggerType - Logger type. Possible values include: 'AzureEventHub', 'ApplicationInsights' 4787 LoggerType LoggerType `json:"loggerType,omitempty"` 4788 // Description - Logger description. 4789 Description *string `json:"description,omitempty"` 4790 // Credentials - The name and SendRule connection string of the event hub for azureEventHub logger. 4791 // Instrumentation key for applicationInsights logger. 4792 Credentials map[string]*string `json:"credentials"` 4793 // IsBuffered - Whether records are buffered in the logger before publishing. Default is assumed to be true. 4794 IsBuffered *bool `json:"isBuffered,omitempty"` 4795} 4796 4797// MarshalJSON is the custom marshaler for LoggerContractProperties. 4798func (lcp LoggerContractProperties) MarshalJSON() ([]byte, error) { 4799 objectMap := make(map[string]interface{}) 4800 if lcp.LoggerType != "" { 4801 objectMap["loggerType"] = lcp.LoggerType 4802 } 4803 if lcp.Description != nil { 4804 objectMap["description"] = lcp.Description 4805 } 4806 if lcp.Credentials != nil { 4807 objectMap["credentials"] = lcp.Credentials 4808 } 4809 if lcp.IsBuffered != nil { 4810 objectMap["isBuffered"] = lcp.IsBuffered 4811 } 4812 return json.Marshal(objectMap) 4813} 4814 4815// LoggerUpdateContract logger update contract. 4816type LoggerUpdateContract struct { 4817 // LoggerUpdateParameters - Logger entity update contract properties. 4818 *LoggerUpdateParameters `json:"properties,omitempty"` 4819} 4820 4821// MarshalJSON is the custom marshaler for LoggerUpdateContract. 4822func (luc LoggerUpdateContract) MarshalJSON() ([]byte, error) { 4823 objectMap := make(map[string]interface{}) 4824 if luc.LoggerUpdateParameters != nil { 4825 objectMap["properties"] = luc.LoggerUpdateParameters 4826 } 4827 return json.Marshal(objectMap) 4828} 4829 4830// UnmarshalJSON is the custom unmarshaler for LoggerUpdateContract struct. 4831func (luc *LoggerUpdateContract) UnmarshalJSON(body []byte) error { 4832 var m map[string]*json.RawMessage 4833 err := json.Unmarshal(body, &m) 4834 if err != nil { 4835 return err 4836 } 4837 for k, v := range m { 4838 switch k { 4839 case "properties": 4840 if v != nil { 4841 var loggerUpdateParameters LoggerUpdateParameters 4842 err = json.Unmarshal(*v, &loggerUpdateParameters) 4843 if err != nil { 4844 return err 4845 } 4846 luc.LoggerUpdateParameters = &loggerUpdateParameters 4847 } 4848 } 4849 } 4850 4851 return nil 4852} 4853 4854// LoggerUpdateParameters parameters supplied to the Update Logger operation. 4855type LoggerUpdateParameters struct { 4856 // LoggerType - Logger type. Possible values include: 'AzureEventHub', 'ApplicationInsights' 4857 LoggerType LoggerType `json:"loggerType,omitempty"` 4858 // Description - Logger description. 4859 Description *string `json:"description,omitempty"` 4860 // Credentials - Logger credentials. 4861 Credentials map[string]*string `json:"credentials"` 4862 // IsBuffered - Whether records are buffered in the logger before publishing. Default is assumed to be true. 4863 IsBuffered *bool `json:"isBuffered,omitempty"` 4864} 4865 4866// MarshalJSON is the custom marshaler for LoggerUpdateParameters. 4867func (lup LoggerUpdateParameters) MarshalJSON() ([]byte, error) { 4868 objectMap := make(map[string]interface{}) 4869 if lup.LoggerType != "" { 4870 objectMap["loggerType"] = lup.LoggerType 4871 } 4872 if lup.Description != nil { 4873 objectMap["description"] = lup.Description 4874 } 4875 if lup.Credentials != nil { 4876 objectMap["credentials"] = lup.Credentials 4877 } 4878 if lup.IsBuffered != nil { 4879 objectMap["isBuffered"] = lup.IsBuffered 4880 } 4881 return json.Marshal(objectMap) 4882} 4883 4884// NetworkStatusContract network Status details. 4885type NetworkStatusContract struct { 4886 autorest.Response `json:"-"` 4887 // DNSServers - Gets the list of DNS servers IPV4 addresses. 4888 DNSServers *[]string `json:"dnsServers,omitempty"` 4889 // ConnectivityStatus - Gets the list of Connectivity Status to the Resources on which the service depends upon. 4890 ConnectivityStatus *[]ConnectivityStatusContract `json:"connectivityStatus,omitempty"` 4891} 4892 4893// NetworkStatusContractByLocation network Status in the Location 4894type NetworkStatusContractByLocation struct { 4895 // Location - Location of service 4896 Location *string `json:"location,omitempty"` 4897 // NetworkStatus - Network status in Location 4898 NetworkStatus *NetworkStatusContract `json:"networkStatus,omitempty"` 4899} 4900 4901// NotificationCollection paged Notification list representation. 4902type NotificationCollection struct { 4903 autorest.Response `json:"-"` 4904 // Value - Page values. 4905 Value *[]NotificationContract `json:"value,omitempty"` 4906 // NextLink - Next page link if any. 4907 NextLink *string `json:"nextLink,omitempty"` 4908} 4909 4910// NotificationCollectionIterator provides access to a complete listing of NotificationContract values. 4911type NotificationCollectionIterator struct { 4912 i int 4913 page NotificationCollectionPage 4914} 4915 4916// Next advances to the next value. If there was an error making 4917// the request the iterator does not advance and the error is returned. 4918func (iter *NotificationCollectionIterator) Next() error { 4919 iter.i++ 4920 if iter.i < len(iter.page.Values()) { 4921 return nil 4922 } 4923 err := iter.page.Next() 4924 if err != nil { 4925 iter.i-- 4926 return err 4927 } 4928 iter.i = 0 4929 return nil 4930} 4931 4932// NotDone returns true if the enumeration should be started or is not yet complete. 4933func (iter NotificationCollectionIterator) NotDone() bool { 4934 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 4935} 4936 4937// Response returns the raw server response from the last page request. 4938func (iter NotificationCollectionIterator) Response() NotificationCollection { 4939 return iter.page.Response() 4940} 4941 4942// Value returns the current value or a zero-initialized value if the 4943// iterator has advanced beyond the end of the collection. 4944func (iter NotificationCollectionIterator) Value() NotificationContract { 4945 if !iter.page.NotDone() { 4946 return NotificationContract{} 4947 } 4948 return iter.page.Values()[iter.i] 4949} 4950 4951// IsEmpty returns true if the ListResult contains no values. 4952func (nc NotificationCollection) IsEmpty() bool { 4953 return nc.Value == nil || len(*nc.Value) == 0 4954} 4955 4956// notificationCollectionPreparer prepares a request to retrieve the next set of results. 4957// It returns nil if no more results exist. 4958func (nc NotificationCollection) notificationCollectionPreparer() (*http.Request, error) { 4959 if nc.NextLink == nil || len(to.String(nc.NextLink)) < 1 { 4960 return nil, nil 4961 } 4962 return autorest.Prepare(&http.Request{}, 4963 autorest.AsJSON(), 4964 autorest.AsGet(), 4965 autorest.WithBaseURL(to.String(nc.NextLink))) 4966} 4967 4968// NotificationCollectionPage contains a page of NotificationContract values. 4969type NotificationCollectionPage struct { 4970 fn func(NotificationCollection) (NotificationCollection, error) 4971 nc NotificationCollection 4972} 4973 4974// Next advances to the next page of values. If there was an error making 4975// the request the page does not advance and the error is returned. 4976func (page *NotificationCollectionPage) Next() error { 4977 next, err := page.fn(page.nc) 4978 if err != nil { 4979 return err 4980 } 4981 page.nc = next 4982 return nil 4983} 4984 4985// NotDone returns true if the page enumeration should be started or is not yet complete. 4986func (page NotificationCollectionPage) NotDone() bool { 4987 return !page.nc.IsEmpty() 4988} 4989 4990// Response returns the raw server response from the last page request. 4991func (page NotificationCollectionPage) Response() NotificationCollection { 4992 return page.nc 4993} 4994 4995// Values returns the slice of values for the current page or nil if there are no values. 4996func (page NotificationCollectionPage) Values() []NotificationContract { 4997 if page.nc.IsEmpty() { 4998 return nil 4999 } 5000 return *page.nc.Value 5001} 5002 5003// NotificationContract notification details. 5004type NotificationContract struct { 5005 autorest.Response `json:"-"` 5006 // NotificationContractProperties - Notification entity contract properties. 5007 *NotificationContractProperties `json:"properties,omitempty"` 5008 // ID - Resource ID. 5009 ID *string `json:"id,omitempty"` 5010 // Name - Resource name. 5011 Name *string `json:"name,omitempty"` 5012 // Type - Resource type for API Management resource. 5013 Type *string `json:"type,omitempty"` 5014} 5015 5016// MarshalJSON is the custom marshaler for NotificationContract. 5017func (nc NotificationContract) MarshalJSON() ([]byte, error) { 5018 objectMap := make(map[string]interface{}) 5019 if nc.NotificationContractProperties != nil { 5020 objectMap["properties"] = nc.NotificationContractProperties 5021 } 5022 if nc.ID != nil { 5023 objectMap["id"] = nc.ID 5024 } 5025 if nc.Name != nil { 5026 objectMap["name"] = nc.Name 5027 } 5028 if nc.Type != nil { 5029 objectMap["type"] = nc.Type 5030 } 5031 return json.Marshal(objectMap) 5032} 5033 5034// UnmarshalJSON is the custom unmarshaler for NotificationContract struct. 5035func (nc *NotificationContract) UnmarshalJSON(body []byte) error { 5036 var m map[string]*json.RawMessage 5037 err := json.Unmarshal(body, &m) 5038 if err != nil { 5039 return err 5040 } 5041 for k, v := range m { 5042 switch k { 5043 case "properties": 5044 if v != nil { 5045 var notificationContractProperties NotificationContractProperties 5046 err = json.Unmarshal(*v, ¬ificationContractProperties) 5047 if err != nil { 5048 return err 5049 } 5050 nc.NotificationContractProperties = ¬ificationContractProperties 5051 } 5052 case "id": 5053 if v != nil { 5054 var ID string 5055 err = json.Unmarshal(*v, &ID) 5056 if err != nil { 5057 return err 5058 } 5059 nc.ID = &ID 5060 } 5061 case "name": 5062 if v != nil { 5063 var name string 5064 err = json.Unmarshal(*v, &name) 5065 if err != nil { 5066 return err 5067 } 5068 nc.Name = &name 5069 } 5070 case "type": 5071 if v != nil { 5072 var typeVar string 5073 err = json.Unmarshal(*v, &typeVar) 5074 if err != nil { 5075 return err 5076 } 5077 nc.Type = &typeVar 5078 } 5079 } 5080 } 5081 5082 return nil 5083} 5084 5085// NotificationContractProperties notification Contract properties. 5086type NotificationContractProperties struct { 5087 // Title - Title of the Notification. 5088 Title *string `json:"title,omitempty"` 5089 // Description - Description of the Notification. 5090 Description *string `json:"description,omitempty"` 5091 // Recipients - Recipient Parameter values. 5092 Recipients *RecipientsContractProperties `json:"recipients,omitempty"` 5093} 5094 5095// OAuth2AuthenticationSettingsContract API OAuth2 Authentication settings details. 5096type OAuth2AuthenticationSettingsContract struct { 5097 // AuthorizationServerID - OAuth authorization server identifier. 5098 AuthorizationServerID *string `json:"authorizationServerId,omitempty"` 5099 // Scope - operations scope. 5100 Scope *string `json:"scope,omitempty"` 5101} 5102 5103// OpenIDConnectProviderCollection paged OpenIdProviders list representation. 5104type OpenIDConnectProviderCollection struct { 5105 autorest.Response `json:"-"` 5106 // Value - Page values. 5107 Value *[]OpenidConnectProviderContract `json:"value,omitempty"` 5108 // NextLink - Next page link if any. 5109 NextLink *string `json:"nextLink,omitempty"` 5110} 5111 5112// OpenIDConnectProviderCollectionIterator provides access to a complete listing of OpenidConnectProviderContract 5113// values. 5114type OpenIDConnectProviderCollectionIterator struct { 5115 i int 5116 page OpenIDConnectProviderCollectionPage 5117} 5118 5119// Next advances to the next value. If there was an error making 5120// the request the iterator does not advance and the error is returned. 5121func (iter *OpenIDConnectProviderCollectionIterator) Next() error { 5122 iter.i++ 5123 if iter.i < len(iter.page.Values()) { 5124 return nil 5125 } 5126 err := iter.page.Next() 5127 if err != nil { 5128 iter.i-- 5129 return err 5130 } 5131 iter.i = 0 5132 return nil 5133} 5134 5135// NotDone returns true if the enumeration should be started or is not yet complete. 5136func (iter OpenIDConnectProviderCollectionIterator) NotDone() bool { 5137 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 5138} 5139 5140// Response returns the raw server response from the last page request. 5141func (iter OpenIDConnectProviderCollectionIterator) Response() OpenIDConnectProviderCollection { 5142 return iter.page.Response() 5143} 5144 5145// Value returns the current value or a zero-initialized value if the 5146// iterator has advanced beyond the end of the collection. 5147func (iter OpenIDConnectProviderCollectionIterator) Value() OpenidConnectProviderContract { 5148 if !iter.page.NotDone() { 5149 return OpenidConnectProviderContract{} 5150 } 5151 return iter.page.Values()[iter.i] 5152} 5153 5154// IsEmpty returns true if the ListResult contains no values. 5155func (oicpc OpenIDConnectProviderCollection) IsEmpty() bool { 5156 return oicpc.Value == nil || len(*oicpc.Value) == 0 5157} 5158 5159// openIDConnectProviderCollectionPreparer prepares a request to retrieve the next set of results. 5160// It returns nil if no more results exist. 5161func (oicpc OpenIDConnectProviderCollection) openIDConnectProviderCollectionPreparer() (*http.Request, error) { 5162 if oicpc.NextLink == nil || len(to.String(oicpc.NextLink)) < 1 { 5163 return nil, nil 5164 } 5165 return autorest.Prepare(&http.Request{}, 5166 autorest.AsJSON(), 5167 autorest.AsGet(), 5168 autorest.WithBaseURL(to.String(oicpc.NextLink))) 5169} 5170 5171// OpenIDConnectProviderCollectionPage contains a page of OpenidConnectProviderContract values. 5172type OpenIDConnectProviderCollectionPage struct { 5173 fn func(OpenIDConnectProviderCollection) (OpenIDConnectProviderCollection, error) 5174 oicpc OpenIDConnectProviderCollection 5175} 5176 5177// Next advances to the next page of values. If there was an error making 5178// the request the page does not advance and the error is returned. 5179func (page *OpenIDConnectProviderCollectionPage) Next() error { 5180 next, err := page.fn(page.oicpc) 5181 if err != nil { 5182 return err 5183 } 5184 page.oicpc = next 5185 return nil 5186} 5187 5188// NotDone returns true if the page enumeration should be started or is not yet complete. 5189func (page OpenIDConnectProviderCollectionPage) NotDone() bool { 5190 return !page.oicpc.IsEmpty() 5191} 5192 5193// Response returns the raw server response from the last page request. 5194func (page OpenIDConnectProviderCollectionPage) Response() OpenIDConnectProviderCollection { 5195 return page.oicpc 5196} 5197 5198// Values returns the slice of values for the current page or nil if there are no values. 5199func (page OpenIDConnectProviderCollectionPage) Values() []OpenidConnectProviderContract { 5200 if page.oicpc.IsEmpty() { 5201 return nil 5202 } 5203 return *page.oicpc.Value 5204} 5205 5206// OpenidConnectProviderContract openId Connect Provider details. 5207type OpenidConnectProviderContract struct { 5208 autorest.Response `json:"-"` 5209 // OpenidConnectProviderContractProperties - OpenId Connect Provider contract properties. 5210 *OpenidConnectProviderContractProperties `json:"properties,omitempty"` 5211 // ID - Resource ID. 5212 ID *string `json:"id,omitempty"` 5213 // Name - Resource name. 5214 Name *string `json:"name,omitempty"` 5215 // Type - Resource type for API Management resource. 5216 Type *string `json:"type,omitempty"` 5217} 5218 5219// MarshalJSON is the custom marshaler for OpenidConnectProviderContract. 5220func (ocpc OpenidConnectProviderContract) MarshalJSON() ([]byte, error) { 5221 objectMap := make(map[string]interface{}) 5222 if ocpc.OpenidConnectProviderContractProperties != nil { 5223 objectMap["properties"] = ocpc.OpenidConnectProviderContractProperties 5224 } 5225 if ocpc.ID != nil { 5226 objectMap["id"] = ocpc.ID 5227 } 5228 if ocpc.Name != nil { 5229 objectMap["name"] = ocpc.Name 5230 } 5231 if ocpc.Type != nil { 5232 objectMap["type"] = ocpc.Type 5233 } 5234 return json.Marshal(objectMap) 5235} 5236 5237// UnmarshalJSON is the custom unmarshaler for OpenidConnectProviderContract struct. 5238func (ocpc *OpenidConnectProviderContract) UnmarshalJSON(body []byte) error { 5239 var m map[string]*json.RawMessage 5240 err := json.Unmarshal(body, &m) 5241 if err != nil { 5242 return err 5243 } 5244 for k, v := range m { 5245 switch k { 5246 case "properties": 5247 if v != nil { 5248 var openidConnectProviderContractProperties OpenidConnectProviderContractProperties 5249 err = json.Unmarshal(*v, &openidConnectProviderContractProperties) 5250 if err != nil { 5251 return err 5252 } 5253 ocpc.OpenidConnectProviderContractProperties = &openidConnectProviderContractProperties 5254 } 5255 case "id": 5256 if v != nil { 5257 var ID string 5258 err = json.Unmarshal(*v, &ID) 5259 if err != nil { 5260 return err 5261 } 5262 ocpc.ID = &ID 5263 } 5264 case "name": 5265 if v != nil { 5266 var name string 5267 err = json.Unmarshal(*v, &name) 5268 if err != nil { 5269 return err 5270 } 5271 ocpc.Name = &name 5272 } 5273 case "type": 5274 if v != nil { 5275 var typeVar string 5276 err = json.Unmarshal(*v, &typeVar) 5277 if err != nil { 5278 return err 5279 } 5280 ocpc.Type = &typeVar 5281 } 5282 } 5283 } 5284 5285 return nil 5286} 5287 5288// OpenidConnectProviderContractProperties openID Connect Providers Contract. 5289type OpenidConnectProviderContractProperties struct { 5290 // DisplayName - User-friendly OpenID Connect Provider name. 5291 DisplayName *string `json:"displayName,omitempty"` 5292 // Description - User-friendly description of OpenID Connect Provider. 5293 Description *string `json:"description,omitempty"` 5294 // MetadataEndpoint - Metadata endpoint URI. 5295 MetadataEndpoint *string `json:"metadataEndpoint,omitempty"` 5296 // ClientID - Client ID of developer console which is the client application. 5297 ClientID *string `json:"clientId,omitempty"` 5298 // ClientSecret - Client Secret of developer console which is the client application. 5299 ClientSecret *string `json:"clientSecret,omitempty"` 5300} 5301 5302// OpenidConnectProviderUpdateContract parameters supplied to the Update OpenID Connect Provider operation. 5303type OpenidConnectProviderUpdateContract struct { 5304 // OpenidConnectProviderUpdateContractProperties - OpenId Connect Provider Update contract properties. 5305 *OpenidConnectProviderUpdateContractProperties `json:"properties,omitempty"` 5306} 5307 5308// MarshalJSON is the custom marshaler for OpenidConnectProviderUpdateContract. 5309func (ocpuc OpenidConnectProviderUpdateContract) MarshalJSON() ([]byte, error) { 5310 objectMap := make(map[string]interface{}) 5311 if ocpuc.OpenidConnectProviderUpdateContractProperties != nil { 5312 objectMap["properties"] = ocpuc.OpenidConnectProviderUpdateContractProperties 5313 } 5314 return json.Marshal(objectMap) 5315} 5316 5317// UnmarshalJSON is the custom unmarshaler for OpenidConnectProviderUpdateContract struct. 5318func (ocpuc *OpenidConnectProviderUpdateContract) UnmarshalJSON(body []byte) error { 5319 var m map[string]*json.RawMessage 5320 err := json.Unmarshal(body, &m) 5321 if err != nil { 5322 return err 5323 } 5324 for k, v := range m { 5325 switch k { 5326 case "properties": 5327 if v != nil { 5328 var openidConnectProviderUpdateContractProperties OpenidConnectProviderUpdateContractProperties 5329 err = json.Unmarshal(*v, &openidConnectProviderUpdateContractProperties) 5330 if err != nil { 5331 return err 5332 } 5333 ocpuc.OpenidConnectProviderUpdateContractProperties = &openidConnectProviderUpdateContractProperties 5334 } 5335 } 5336 } 5337 5338 return nil 5339} 5340 5341// OpenidConnectProviderUpdateContractProperties parameters supplied to the Update OpenID Connect Provider 5342// operation. 5343type OpenidConnectProviderUpdateContractProperties struct { 5344 // DisplayName - User-friendly OpenID Connect Provider name. 5345 DisplayName *string `json:"displayName,omitempty"` 5346 // Description - User-friendly description of OpenID Connect Provider. 5347 Description *string `json:"description,omitempty"` 5348 // MetadataEndpoint - Metadata endpoint URI. 5349 MetadataEndpoint *string `json:"metadataEndpoint,omitempty"` 5350 // ClientID - Client ID of developer console which is the client application. 5351 ClientID *string `json:"clientId,omitempty"` 5352 // ClientSecret - Client Secret of developer console which is the client application. 5353 ClientSecret *string `json:"clientSecret,omitempty"` 5354} 5355 5356// Operation REST API operation 5357type Operation struct { 5358 // Name - Operation name: {provider}/{resource}/{operation} 5359 Name *string `json:"name,omitempty"` 5360 // Display - The object that describes the operation. 5361 Display *OperationDisplay `json:"display,omitempty"` 5362 // Origin - The operation origin. 5363 Origin *string `json:"origin,omitempty"` 5364 // Properties - The operation properties. 5365 Properties interface{} `json:"properties,omitempty"` 5366} 5367 5368// OperationCollection paged Operation list representation. 5369type OperationCollection struct { 5370 autorest.Response `json:"-"` 5371 // Value - Page values. 5372 Value *[]OperationContract `json:"value,omitempty"` 5373 // NextLink - Next page link if any. 5374 NextLink *string `json:"nextLink,omitempty"` 5375} 5376 5377// OperationCollectionIterator provides access to a complete listing of OperationContract values. 5378type OperationCollectionIterator struct { 5379 i int 5380 page OperationCollectionPage 5381} 5382 5383// Next advances to the next value. If there was an error making 5384// the request the iterator does not advance and the error is returned. 5385func (iter *OperationCollectionIterator) Next() error { 5386 iter.i++ 5387 if iter.i < len(iter.page.Values()) { 5388 return nil 5389 } 5390 err := iter.page.Next() 5391 if err != nil { 5392 iter.i-- 5393 return err 5394 } 5395 iter.i = 0 5396 return nil 5397} 5398 5399// NotDone returns true if the enumeration should be started or is not yet complete. 5400func (iter OperationCollectionIterator) NotDone() bool { 5401 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 5402} 5403 5404// Response returns the raw server response from the last page request. 5405func (iter OperationCollectionIterator) Response() OperationCollection { 5406 return iter.page.Response() 5407} 5408 5409// Value returns the current value or a zero-initialized value if the 5410// iterator has advanced beyond the end of the collection. 5411func (iter OperationCollectionIterator) Value() OperationContract { 5412 if !iter.page.NotDone() { 5413 return OperationContract{} 5414 } 5415 return iter.page.Values()[iter.i] 5416} 5417 5418// IsEmpty returns true if the ListResult contains no values. 5419func (oc OperationCollection) IsEmpty() bool { 5420 return oc.Value == nil || len(*oc.Value) == 0 5421} 5422 5423// operationCollectionPreparer prepares a request to retrieve the next set of results. 5424// It returns nil if no more results exist. 5425func (oc OperationCollection) operationCollectionPreparer() (*http.Request, error) { 5426 if oc.NextLink == nil || len(to.String(oc.NextLink)) < 1 { 5427 return nil, nil 5428 } 5429 return autorest.Prepare(&http.Request{}, 5430 autorest.AsJSON(), 5431 autorest.AsGet(), 5432 autorest.WithBaseURL(to.String(oc.NextLink))) 5433} 5434 5435// OperationCollectionPage contains a page of OperationContract values. 5436type OperationCollectionPage struct { 5437 fn func(OperationCollection) (OperationCollection, error) 5438 oc OperationCollection 5439} 5440 5441// Next advances to the next page of values. If there was an error making 5442// the request the page does not advance and the error is returned. 5443func (page *OperationCollectionPage) Next() error { 5444 next, err := page.fn(page.oc) 5445 if err != nil { 5446 return err 5447 } 5448 page.oc = next 5449 return nil 5450} 5451 5452// NotDone returns true if the page enumeration should be started or is not yet complete. 5453func (page OperationCollectionPage) NotDone() bool { 5454 return !page.oc.IsEmpty() 5455} 5456 5457// Response returns the raw server response from the last page request. 5458func (page OperationCollectionPage) Response() OperationCollection { 5459 return page.oc 5460} 5461 5462// Values returns the slice of values for the current page or nil if there are no values. 5463func (page OperationCollectionPage) Values() []OperationContract { 5464 if page.oc.IsEmpty() { 5465 return nil 5466 } 5467 return *page.oc.Value 5468} 5469 5470// OperationContract api Operation details. 5471type OperationContract struct { 5472 autorest.Response `json:"-"` 5473 // OperationContractProperties - Properties of the Operation Contract. 5474 *OperationContractProperties `json:"properties,omitempty"` 5475 // ID - Resource ID. 5476 ID *string `json:"id,omitempty"` 5477 // Name - Resource name. 5478 Name *string `json:"name,omitempty"` 5479 // Type - Resource type for API Management resource. 5480 Type *string `json:"type,omitempty"` 5481} 5482 5483// MarshalJSON is the custom marshaler for OperationContract. 5484func (oc OperationContract) MarshalJSON() ([]byte, error) { 5485 objectMap := make(map[string]interface{}) 5486 if oc.OperationContractProperties != nil { 5487 objectMap["properties"] = oc.OperationContractProperties 5488 } 5489 if oc.ID != nil { 5490 objectMap["id"] = oc.ID 5491 } 5492 if oc.Name != nil { 5493 objectMap["name"] = oc.Name 5494 } 5495 if oc.Type != nil { 5496 objectMap["type"] = oc.Type 5497 } 5498 return json.Marshal(objectMap) 5499} 5500 5501// UnmarshalJSON is the custom unmarshaler for OperationContract struct. 5502func (oc *OperationContract) UnmarshalJSON(body []byte) error { 5503 var m map[string]*json.RawMessage 5504 err := json.Unmarshal(body, &m) 5505 if err != nil { 5506 return err 5507 } 5508 for k, v := range m { 5509 switch k { 5510 case "properties": 5511 if v != nil { 5512 var operationContractProperties OperationContractProperties 5513 err = json.Unmarshal(*v, &operationContractProperties) 5514 if err != nil { 5515 return err 5516 } 5517 oc.OperationContractProperties = &operationContractProperties 5518 } 5519 case "id": 5520 if v != nil { 5521 var ID string 5522 err = json.Unmarshal(*v, &ID) 5523 if err != nil { 5524 return err 5525 } 5526 oc.ID = &ID 5527 } 5528 case "name": 5529 if v != nil { 5530 var name string 5531 err = json.Unmarshal(*v, &name) 5532 if err != nil { 5533 return err 5534 } 5535 oc.Name = &name 5536 } 5537 case "type": 5538 if v != nil { 5539 var typeVar string 5540 err = json.Unmarshal(*v, &typeVar) 5541 if err != nil { 5542 return err 5543 } 5544 oc.Type = &typeVar 5545 } 5546 } 5547 } 5548 5549 return nil 5550} 5551 5552// OperationContractProperties operation Contract Properties 5553type OperationContractProperties struct { 5554 // DisplayName - Operation Name. 5555 DisplayName *string `json:"displayName,omitempty"` 5556 // Method - A Valid HTTP Operation Method. Typical Http Methods like GET, PUT, POST but not limited by only them. 5557 Method *string `json:"method,omitempty"` 5558 // URLTemplate - Relative URL template identifying the target resource for this operation. May include parameters. Example: /customers/{cid}/orders/{oid}/?date={date} 5559 URLTemplate *string `json:"urlTemplate,omitempty"` 5560 // TemplateParameters - Collection of URL template parameters. 5561 TemplateParameters *[]ParameterContract `json:"templateParameters,omitempty"` 5562 // Description - Description of the operation. May include HTML formatting tags. 5563 Description *string `json:"description,omitempty"` 5564 // Request - An entity containing request details. 5565 Request *RequestContract `json:"request,omitempty"` 5566 // Responses - Array of Operation responses. 5567 Responses *[]ResponseContract `json:"responses,omitempty"` 5568 // Policies - Operation Policies 5569 Policies *string `json:"policies,omitempty"` 5570} 5571 5572// OperationDisplay the object that describes the operation. 5573type OperationDisplay struct { 5574 // Provider - Friendly name of the resource provider 5575 Provider *string `json:"provider,omitempty"` 5576 // Operation - Operation type: read, write, delete, listKeys/action, etc. 5577 Operation *string `json:"operation,omitempty"` 5578 // Resource - Resource type on which the operation is performed. 5579 Resource *string `json:"resource,omitempty"` 5580 // Description - Friendly name of the operation 5581 Description *string `json:"description,omitempty"` 5582} 5583 5584// OperationEntityBaseContract api Operation Entity Base Contract details. 5585type OperationEntityBaseContract struct { 5586 // TemplateParameters - Collection of URL template parameters. 5587 TemplateParameters *[]ParameterContract `json:"templateParameters,omitempty"` 5588 // Description - Description of the operation. May include HTML formatting tags. 5589 Description *string `json:"description,omitempty"` 5590 // Request - An entity containing request details. 5591 Request *RequestContract `json:"request,omitempty"` 5592 // Responses - Array of Operation responses. 5593 Responses *[]ResponseContract `json:"responses,omitempty"` 5594 // Policies - Operation Policies 5595 Policies *string `json:"policies,omitempty"` 5596} 5597 5598// OperationListResult result of the request to list REST API operations. It contains a list of operations and a 5599// URL nextLink to get the next set of results. 5600type OperationListResult struct { 5601 autorest.Response `json:"-"` 5602 // Value - List of operations supported by the resource provider. 5603 Value *[]Operation `json:"value,omitempty"` 5604 // NextLink - URL to get the next set of operation list results if there are any. 5605 NextLink *string `json:"nextLink,omitempty"` 5606} 5607 5608// OperationListResultIterator provides access to a complete listing of Operation values. 5609type OperationListResultIterator struct { 5610 i int 5611 page OperationListResultPage 5612} 5613 5614// Next advances to the next value. If there was an error making 5615// the request the iterator does not advance and the error is returned. 5616func (iter *OperationListResultIterator) Next() error { 5617 iter.i++ 5618 if iter.i < len(iter.page.Values()) { 5619 return nil 5620 } 5621 err := iter.page.Next() 5622 if err != nil { 5623 iter.i-- 5624 return err 5625 } 5626 iter.i = 0 5627 return nil 5628} 5629 5630// NotDone returns true if the enumeration should be started or is not yet complete. 5631func (iter OperationListResultIterator) NotDone() bool { 5632 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 5633} 5634 5635// Response returns the raw server response from the last page request. 5636func (iter OperationListResultIterator) Response() OperationListResult { 5637 return iter.page.Response() 5638} 5639 5640// Value returns the current value or a zero-initialized value if the 5641// iterator has advanced beyond the end of the collection. 5642func (iter OperationListResultIterator) Value() Operation { 5643 if !iter.page.NotDone() { 5644 return Operation{} 5645 } 5646 return iter.page.Values()[iter.i] 5647} 5648 5649// IsEmpty returns true if the ListResult contains no values. 5650func (olr OperationListResult) IsEmpty() bool { 5651 return olr.Value == nil || len(*olr.Value) == 0 5652} 5653 5654// operationListResultPreparer prepares a request to retrieve the next set of results. 5655// It returns nil if no more results exist. 5656func (olr OperationListResult) operationListResultPreparer() (*http.Request, error) { 5657 if olr.NextLink == nil || len(to.String(olr.NextLink)) < 1 { 5658 return nil, nil 5659 } 5660 return autorest.Prepare(&http.Request{}, 5661 autorest.AsJSON(), 5662 autorest.AsGet(), 5663 autorest.WithBaseURL(to.String(olr.NextLink))) 5664} 5665 5666// OperationListResultPage contains a page of Operation values. 5667type OperationListResultPage struct { 5668 fn func(OperationListResult) (OperationListResult, error) 5669 olr OperationListResult 5670} 5671 5672// Next advances to the next page of values. If there was an error making 5673// the request the page does not advance and the error is returned. 5674func (page *OperationListResultPage) Next() error { 5675 next, err := page.fn(page.olr) 5676 if err != nil { 5677 return err 5678 } 5679 page.olr = next 5680 return nil 5681} 5682 5683// NotDone returns true if the page enumeration should be started or is not yet complete. 5684func (page OperationListResultPage) NotDone() bool { 5685 return !page.olr.IsEmpty() 5686} 5687 5688// Response returns the raw server response from the last page request. 5689func (page OperationListResultPage) Response() OperationListResult { 5690 return page.olr 5691} 5692 5693// Values returns the slice of values for the current page or nil if there are no values. 5694func (page OperationListResultPage) Values() []Operation { 5695 if page.olr.IsEmpty() { 5696 return nil 5697 } 5698 return *page.olr.Value 5699} 5700 5701// OperationResultContract operation Result. 5702type OperationResultContract struct { 5703 autorest.Response `json:"-"` 5704 // ID - Operation result identifier. 5705 ID *string `json:"id,omitempty"` 5706 // Status - Status of an async operation. Possible values include: 'Started', 'InProgress', 'Succeeded', 'Failed' 5707 Status AsyncOperationStatus `json:"status,omitempty"` 5708 // 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. 5709 Started *date.Time `json:"started,omitempty"` 5710 // 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. 5711 Updated *date.Time `json:"updated,omitempty"` 5712 // ResultInfo - Optional result info. 5713 ResultInfo *string `json:"resultInfo,omitempty"` 5714 // Error - Error Body Contract 5715 Error *ErrorResponseBody `json:"error,omitempty"` 5716 // ActionLog - 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. 5717 ActionLog *[]OperationResultLogItemContract `json:"actionLog,omitempty"` 5718} 5719 5720// OperationResultLogItemContract log of the entity being created, updated or deleted. 5721type OperationResultLogItemContract struct { 5722 // ObjectType - The type of entity contract. 5723 ObjectType *string `json:"objectType,omitempty"` 5724 // Action - Action like create/update/delete. 5725 Action *string `json:"action,omitempty"` 5726 // ObjectKey - Identifier of the entity being created/updated/deleted. 5727 ObjectKey *string `json:"objectKey,omitempty"` 5728} 5729 5730// OperationTagResourceContractProperties operation Entity contract Properties. 5731type OperationTagResourceContractProperties struct { 5732 // ID - Identifier of the operation in form /operations/{operationId}. 5733 ID *string `json:"id,omitempty"` 5734 // Name - Operation name. 5735 Name *string `json:"name,omitempty"` 5736 // APIName - Api Name. 5737 APIName *string `json:"apiName,omitempty"` 5738 // APIRevision - Api Revision. 5739 APIRevision *string `json:"apiRevision,omitempty"` 5740 // APIVersion - Api Version. 5741 APIVersion *string `json:"apiVersion,omitempty"` 5742 // Description - Operation Description. 5743 Description *string `json:"description,omitempty"` 5744 // Method - A Valid HTTP Operation Method. Typical Http Methods like GET, PUT, POST but not limited by only them. 5745 Method *string `json:"method,omitempty"` 5746 // URLTemplate - Relative URL template identifying the target resource for this operation. May include parameters. Example: /customers/{cid}/orders/{oid}/?date={date} 5747 URLTemplate *string `json:"urlTemplate,omitempty"` 5748} 5749 5750// OperationUpdateContract api Operation Update Contract details. 5751type OperationUpdateContract struct { 5752 // OperationUpdateContractProperties - Properties of the API Operation entity that can be updated. 5753 *OperationUpdateContractProperties `json:"properties,omitempty"` 5754} 5755 5756// MarshalJSON is the custom marshaler for OperationUpdateContract. 5757func (ouc OperationUpdateContract) MarshalJSON() ([]byte, error) { 5758 objectMap := make(map[string]interface{}) 5759 if ouc.OperationUpdateContractProperties != nil { 5760 objectMap["properties"] = ouc.OperationUpdateContractProperties 5761 } 5762 return json.Marshal(objectMap) 5763} 5764 5765// UnmarshalJSON is the custom unmarshaler for OperationUpdateContract struct. 5766func (ouc *OperationUpdateContract) UnmarshalJSON(body []byte) error { 5767 var m map[string]*json.RawMessage 5768 err := json.Unmarshal(body, &m) 5769 if err != nil { 5770 return err 5771 } 5772 for k, v := range m { 5773 switch k { 5774 case "properties": 5775 if v != nil { 5776 var operationUpdateContractProperties OperationUpdateContractProperties 5777 err = json.Unmarshal(*v, &operationUpdateContractProperties) 5778 if err != nil { 5779 return err 5780 } 5781 ouc.OperationUpdateContractProperties = &operationUpdateContractProperties 5782 } 5783 } 5784 } 5785 5786 return nil 5787} 5788 5789// OperationUpdateContractProperties operation Update Contract Properties. 5790type OperationUpdateContractProperties struct { 5791 // DisplayName - Operation Name. 5792 DisplayName *string `json:"displayName,omitempty"` 5793 // Method - A Valid HTTP Operation Method. Typical Http Methods like GET, PUT, POST but not limited by only them. 5794 Method *string `json:"method,omitempty"` 5795 // URLTemplate - Relative URL template identifying the target resource for this operation. May include parameters. Example: /customers/{cid}/orders/{oid}/?date={date} 5796 URLTemplate *string `json:"urlTemplate,omitempty"` 5797 // TemplateParameters - Collection of URL template parameters. 5798 TemplateParameters *[]ParameterContract `json:"templateParameters,omitempty"` 5799 // Description - Description of the operation. May include HTML formatting tags. 5800 Description *string `json:"description,omitempty"` 5801 // Request - An entity containing request details. 5802 Request *RequestContract `json:"request,omitempty"` 5803 // Responses - Array of Operation responses. 5804 Responses *[]ResponseContract `json:"responses,omitempty"` 5805 // Policies - Operation Policies 5806 Policies *string `json:"policies,omitempty"` 5807} 5808 5809// ParameterContract operation parameters details. 5810type ParameterContract struct { 5811 // Name - Parameter name. 5812 Name *string `json:"name,omitempty"` 5813 // Description - Parameter description. 5814 Description *string `json:"description,omitempty"` 5815 // Type - Parameter type. 5816 Type *string `json:"type,omitempty"` 5817 // DefaultValue - Default parameter value. 5818 DefaultValue *string `json:"defaultValue,omitempty"` 5819 // Required - whether parameter is required or not. 5820 Required *bool `json:"required,omitempty"` 5821 // Values - Parameter values. 5822 Values *[]string `json:"values,omitempty"` 5823} 5824 5825// PolicyCollection the response of the list policy operation. 5826type PolicyCollection struct { 5827 autorest.Response `json:"-"` 5828 // Value - Policy Contract value. 5829 Value *[]PolicyContract `json:"value,omitempty"` 5830 // NextLink - Next page link if any. 5831 NextLink *string `json:"nextLink,omitempty"` 5832} 5833 5834// PolicyContract policy Contract details. 5835type PolicyContract struct { 5836 autorest.Response `json:"-"` 5837 // PolicyContractProperties - Properties of the Policy. 5838 *PolicyContractProperties `json:"properties,omitempty"` 5839 // ID - Resource ID. 5840 ID *string `json:"id,omitempty"` 5841 // Name - Resource name. 5842 Name *string `json:"name,omitempty"` 5843 // Type - Resource type for API Management resource. 5844 Type *string `json:"type,omitempty"` 5845} 5846 5847// MarshalJSON is the custom marshaler for PolicyContract. 5848func (pc PolicyContract) MarshalJSON() ([]byte, error) { 5849 objectMap := make(map[string]interface{}) 5850 if pc.PolicyContractProperties != nil { 5851 objectMap["properties"] = pc.PolicyContractProperties 5852 } 5853 if pc.ID != nil { 5854 objectMap["id"] = pc.ID 5855 } 5856 if pc.Name != nil { 5857 objectMap["name"] = pc.Name 5858 } 5859 if pc.Type != nil { 5860 objectMap["type"] = pc.Type 5861 } 5862 return json.Marshal(objectMap) 5863} 5864 5865// UnmarshalJSON is the custom unmarshaler for PolicyContract struct. 5866func (pc *PolicyContract) UnmarshalJSON(body []byte) error { 5867 var m map[string]*json.RawMessage 5868 err := json.Unmarshal(body, &m) 5869 if err != nil { 5870 return err 5871 } 5872 for k, v := range m { 5873 switch k { 5874 case "properties": 5875 if v != nil { 5876 var policyContractProperties PolicyContractProperties 5877 err = json.Unmarshal(*v, &policyContractProperties) 5878 if err != nil { 5879 return err 5880 } 5881 pc.PolicyContractProperties = &policyContractProperties 5882 } 5883 case "id": 5884 if v != nil { 5885 var ID string 5886 err = json.Unmarshal(*v, &ID) 5887 if err != nil { 5888 return err 5889 } 5890 pc.ID = &ID 5891 } 5892 case "name": 5893 if v != nil { 5894 var name string 5895 err = json.Unmarshal(*v, &name) 5896 if err != nil { 5897 return err 5898 } 5899 pc.Name = &name 5900 } 5901 case "type": 5902 if v != nil { 5903 var typeVar string 5904 err = json.Unmarshal(*v, &typeVar) 5905 if err != nil { 5906 return err 5907 } 5908 pc.Type = &typeVar 5909 } 5910 } 5911 } 5912 5913 return nil 5914} 5915 5916// PolicyContractProperties policy contract Properties. 5917type PolicyContractProperties struct { 5918 // PolicyContent - Json escaped Xml Encoded contents of the Policy. 5919 PolicyContent *string `json:"policyContent,omitempty"` 5920 // ContentFormat - Format of the policyContent. Possible values include: 'XML', 'XMLLink', 'Rawxml', 'RawxmlLink' 5921 ContentFormat PolicyContentFormat `json:"contentFormat,omitempty"` 5922} 5923 5924// PolicySnippetContract policy snippet. 5925type PolicySnippetContract struct { 5926 // Name - Snippet name. 5927 Name *string `json:"name,omitempty"` 5928 // Content - Snippet content. 5929 Content *string `json:"content,omitempty"` 5930 // ToolTip - Snippet toolTip. 5931 ToolTip *string `json:"toolTip,omitempty"` 5932 // Scope - Binary OR value of the Snippet scope. 5933 Scope *int32 `json:"scope,omitempty"` 5934} 5935 5936// PolicySnippetsCollection the response of the list policy snippets operation. 5937type PolicySnippetsCollection struct { 5938 autorest.Response `json:"-"` 5939 // Value - Policy snippet value. 5940 Value *[]PolicySnippetContract `json:"value,omitempty"` 5941} 5942 5943// PortalDelegationSettings delegation settings for a developer portal. 5944type PortalDelegationSettings struct { 5945 autorest.Response `json:"-"` 5946 // PortalDelegationSettingsProperties - Delegation settings contract properties. 5947 *PortalDelegationSettingsProperties `json:"properties,omitempty"` 5948 // ID - Resource ID. 5949 ID *string `json:"id,omitempty"` 5950 // Name - Resource name. 5951 Name *string `json:"name,omitempty"` 5952 // Type - Resource type for API Management resource. 5953 Type *string `json:"type,omitempty"` 5954} 5955 5956// MarshalJSON is the custom marshaler for PortalDelegationSettings. 5957func (pds PortalDelegationSettings) MarshalJSON() ([]byte, error) { 5958 objectMap := make(map[string]interface{}) 5959 if pds.PortalDelegationSettingsProperties != nil { 5960 objectMap["properties"] = pds.PortalDelegationSettingsProperties 5961 } 5962 if pds.ID != nil { 5963 objectMap["id"] = pds.ID 5964 } 5965 if pds.Name != nil { 5966 objectMap["name"] = pds.Name 5967 } 5968 if pds.Type != nil { 5969 objectMap["type"] = pds.Type 5970 } 5971 return json.Marshal(objectMap) 5972} 5973 5974// UnmarshalJSON is the custom unmarshaler for PortalDelegationSettings struct. 5975func (pds *PortalDelegationSettings) UnmarshalJSON(body []byte) error { 5976 var m map[string]*json.RawMessage 5977 err := json.Unmarshal(body, &m) 5978 if err != nil { 5979 return err 5980 } 5981 for k, v := range m { 5982 switch k { 5983 case "properties": 5984 if v != nil { 5985 var portalDelegationSettingsProperties PortalDelegationSettingsProperties 5986 err = json.Unmarshal(*v, &portalDelegationSettingsProperties) 5987 if err != nil { 5988 return err 5989 } 5990 pds.PortalDelegationSettingsProperties = &portalDelegationSettingsProperties 5991 } 5992 case "id": 5993 if v != nil { 5994 var ID string 5995 err = json.Unmarshal(*v, &ID) 5996 if err != nil { 5997 return err 5998 } 5999 pds.ID = &ID 6000 } 6001 case "name": 6002 if v != nil { 6003 var name string 6004 err = json.Unmarshal(*v, &name) 6005 if err != nil { 6006 return err 6007 } 6008 pds.Name = &name 6009 } 6010 case "type": 6011 if v != nil { 6012 var typeVar string 6013 err = json.Unmarshal(*v, &typeVar) 6014 if err != nil { 6015 return err 6016 } 6017 pds.Type = &typeVar 6018 } 6019 } 6020 } 6021 6022 return nil 6023} 6024 6025// PortalDelegationSettingsProperties delegation settings contract properties. 6026type PortalDelegationSettingsProperties struct { 6027 // URL - A delegation Url. 6028 URL *string `json:"url,omitempty"` 6029 // ValidationKey - A base64-encoded validation key to validate, that a request is coming from Azure API Management. 6030 ValidationKey *string `json:"validationKey,omitempty"` 6031 // Subscriptions - Subscriptions delegation settings. 6032 Subscriptions *SubscriptionsDelegationSettingsProperties `json:"subscriptions,omitempty"` 6033 // UserRegistration - User registration delegation settings. 6034 UserRegistration *RegistrationDelegationSettingsProperties `json:"userRegistration,omitempty"` 6035} 6036 6037// PortalSigninSettingProperties sign-in settings contract properties. 6038type PortalSigninSettingProperties struct { 6039 // Enabled - Redirect Anonymous users to the Sign-In page. 6040 Enabled *bool `json:"enabled,omitempty"` 6041} 6042 6043// PortalSigninSettings sign-In settings for the Developer Portal. 6044type PortalSigninSettings struct { 6045 autorest.Response `json:"-"` 6046 // PortalSigninSettingProperties - Sign-in settings contract properties. 6047 *PortalSigninSettingProperties `json:"properties,omitempty"` 6048 // ID - Resource ID. 6049 ID *string `json:"id,omitempty"` 6050 // Name - Resource name. 6051 Name *string `json:"name,omitempty"` 6052 // Type - Resource type for API Management resource. 6053 Type *string `json:"type,omitempty"` 6054} 6055 6056// MarshalJSON is the custom marshaler for PortalSigninSettings. 6057func (pss PortalSigninSettings) MarshalJSON() ([]byte, error) { 6058 objectMap := make(map[string]interface{}) 6059 if pss.PortalSigninSettingProperties != nil { 6060 objectMap["properties"] = pss.PortalSigninSettingProperties 6061 } 6062 if pss.ID != nil { 6063 objectMap["id"] = pss.ID 6064 } 6065 if pss.Name != nil { 6066 objectMap["name"] = pss.Name 6067 } 6068 if pss.Type != nil { 6069 objectMap["type"] = pss.Type 6070 } 6071 return json.Marshal(objectMap) 6072} 6073 6074// UnmarshalJSON is the custom unmarshaler for PortalSigninSettings struct. 6075func (pss *PortalSigninSettings) UnmarshalJSON(body []byte) error { 6076 var m map[string]*json.RawMessage 6077 err := json.Unmarshal(body, &m) 6078 if err != nil { 6079 return err 6080 } 6081 for k, v := range m { 6082 switch k { 6083 case "properties": 6084 if v != nil { 6085 var portalSigninSettingProperties PortalSigninSettingProperties 6086 err = json.Unmarshal(*v, &portalSigninSettingProperties) 6087 if err != nil { 6088 return err 6089 } 6090 pss.PortalSigninSettingProperties = &portalSigninSettingProperties 6091 } 6092 case "id": 6093 if v != nil { 6094 var ID string 6095 err = json.Unmarshal(*v, &ID) 6096 if err != nil { 6097 return err 6098 } 6099 pss.ID = &ID 6100 } 6101 case "name": 6102 if v != nil { 6103 var name string 6104 err = json.Unmarshal(*v, &name) 6105 if err != nil { 6106 return err 6107 } 6108 pss.Name = &name 6109 } 6110 case "type": 6111 if v != nil { 6112 var typeVar string 6113 err = json.Unmarshal(*v, &typeVar) 6114 if err != nil { 6115 return err 6116 } 6117 pss.Type = &typeVar 6118 } 6119 } 6120 } 6121 6122 return nil 6123} 6124 6125// PortalSignupSettings sign-Up settings for a developer portal. 6126type PortalSignupSettings struct { 6127 autorest.Response `json:"-"` 6128 // PortalSignupSettingsProperties - Sign-up settings contract properties. 6129 *PortalSignupSettingsProperties `json:"properties,omitempty"` 6130 // ID - Resource ID. 6131 ID *string `json:"id,omitempty"` 6132 // Name - Resource name. 6133 Name *string `json:"name,omitempty"` 6134 // Type - Resource type for API Management resource. 6135 Type *string `json:"type,omitempty"` 6136} 6137 6138// MarshalJSON is the custom marshaler for PortalSignupSettings. 6139func (pss PortalSignupSettings) MarshalJSON() ([]byte, error) { 6140 objectMap := make(map[string]interface{}) 6141 if pss.PortalSignupSettingsProperties != nil { 6142 objectMap["properties"] = pss.PortalSignupSettingsProperties 6143 } 6144 if pss.ID != nil { 6145 objectMap["id"] = pss.ID 6146 } 6147 if pss.Name != nil { 6148 objectMap["name"] = pss.Name 6149 } 6150 if pss.Type != nil { 6151 objectMap["type"] = pss.Type 6152 } 6153 return json.Marshal(objectMap) 6154} 6155 6156// UnmarshalJSON is the custom unmarshaler for PortalSignupSettings struct. 6157func (pss *PortalSignupSettings) UnmarshalJSON(body []byte) error { 6158 var m map[string]*json.RawMessage 6159 err := json.Unmarshal(body, &m) 6160 if err != nil { 6161 return err 6162 } 6163 for k, v := range m { 6164 switch k { 6165 case "properties": 6166 if v != nil { 6167 var portalSignupSettingsProperties PortalSignupSettingsProperties 6168 err = json.Unmarshal(*v, &portalSignupSettingsProperties) 6169 if err != nil { 6170 return err 6171 } 6172 pss.PortalSignupSettingsProperties = &portalSignupSettingsProperties 6173 } 6174 case "id": 6175 if v != nil { 6176 var ID string 6177 err = json.Unmarshal(*v, &ID) 6178 if err != nil { 6179 return err 6180 } 6181 pss.ID = &ID 6182 } 6183 case "name": 6184 if v != nil { 6185 var name string 6186 err = json.Unmarshal(*v, &name) 6187 if err != nil { 6188 return err 6189 } 6190 pss.Name = &name 6191 } 6192 case "type": 6193 if v != nil { 6194 var typeVar string 6195 err = json.Unmarshal(*v, &typeVar) 6196 if err != nil { 6197 return err 6198 } 6199 pss.Type = &typeVar 6200 } 6201 } 6202 } 6203 6204 return nil 6205} 6206 6207// PortalSignupSettingsProperties sign-up settings contract properties. 6208type PortalSignupSettingsProperties struct { 6209 // Enabled - Allow users to sign up on a developer portal. 6210 Enabled *bool `json:"enabled,omitempty"` 6211 // TermsOfService - Terms of service contract properties. 6212 TermsOfService *TermsOfServiceProperties `json:"termsOfService,omitempty"` 6213} 6214 6215// ProductCollection paged Products list representation. 6216type ProductCollection struct { 6217 autorest.Response `json:"-"` 6218 // Value - Page values. 6219 Value *[]ProductContract `json:"value,omitempty"` 6220 // NextLink - Next page link if any. 6221 NextLink *string `json:"nextLink,omitempty"` 6222} 6223 6224// ProductCollectionIterator provides access to a complete listing of ProductContract values. 6225type ProductCollectionIterator struct { 6226 i int 6227 page ProductCollectionPage 6228} 6229 6230// Next advances to the next value. If there was an error making 6231// the request the iterator does not advance and the error is returned. 6232func (iter *ProductCollectionIterator) Next() error { 6233 iter.i++ 6234 if iter.i < len(iter.page.Values()) { 6235 return nil 6236 } 6237 err := iter.page.Next() 6238 if err != nil { 6239 iter.i-- 6240 return err 6241 } 6242 iter.i = 0 6243 return nil 6244} 6245 6246// NotDone returns true if the enumeration should be started or is not yet complete. 6247func (iter ProductCollectionIterator) NotDone() bool { 6248 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 6249} 6250 6251// Response returns the raw server response from the last page request. 6252func (iter ProductCollectionIterator) Response() ProductCollection { 6253 return iter.page.Response() 6254} 6255 6256// Value returns the current value or a zero-initialized value if the 6257// iterator has advanced beyond the end of the collection. 6258func (iter ProductCollectionIterator) Value() ProductContract { 6259 if !iter.page.NotDone() { 6260 return ProductContract{} 6261 } 6262 return iter.page.Values()[iter.i] 6263} 6264 6265// IsEmpty returns true if the ListResult contains no values. 6266func (pc ProductCollection) IsEmpty() bool { 6267 return pc.Value == nil || len(*pc.Value) == 0 6268} 6269 6270// productCollectionPreparer prepares a request to retrieve the next set of results. 6271// It returns nil if no more results exist. 6272func (pc ProductCollection) productCollectionPreparer() (*http.Request, error) { 6273 if pc.NextLink == nil || len(to.String(pc.NextLink)) < 1 { 6274 return nil, nil 6275 } 6276 return autorest.Prepare(&http.Request{}, 6277 autorest.AsJSON(), 6278 autorest.AsGet(), 6279 autorest.WithBaseURL(to.String(pc.NextLink))) 6280} 6281 6282// ProductCollectionPage contains a page of ProductContract values. 6283type ProductCollectionPage struct { 6284 fn func(ProductCollection) (ProductCollection, error) 6285 pc ProductCollection 6286} 6287 6288// Next advances to the next page of values. If there was an error making 6289// the request the page does not advance and the error is returned. 6290func (page *ProductCollectionPage) Next() error { 6291 next, err := page.fn(page.pc) 6292 if err != nil { 6293 return err 6294 } 6295 page.pc = next 6296 return nil 6297} 6298 6299// NotDone returns true if the page enumeration should be started or is not yet complete. 6300func (page ProductCollectionPage) NotDone() bool { 6301 return !page.pc.IsEmpty() 6302} 6303 6304// Response returns the raw server response from the last page request. 6305func (page ProductCollectionPage) Response() ProductCollection { 6306 return page.pc 6307} 6308 6309// Values returns the slice of values for the current page or nil if there are no values. 6310func (page ProductCollectionPage) Values() []ProductContract { 6311 if page.pc.IsEmpty() { 6312 return nil 6313 } 6314 return *page.pc.Value 6315} 6316 6317// ProductContract product details. 6318type ProductContract struct { 6319 autorest.Response `json:"-"` 6320 // ProductContractProperties - Product entity contract properties. 6321 *ProductContractProperties `json:"properties,omitempty"` 6322 // ID - Resource ID. 6323 ID *string `json:"id,omitempty"` 6324 // Name - Resource name. 6325 Name *string `json:"name,omitempty"` 6326 // Type - Resource type for API Management resource. 6327 Type *string `json:"type,omitempty"` 6328} 6329 6330// MarshalJSON is the custom marshaler for ProductContract. 6331func (pc ProductContract) MarshalJSON() ([]byte, error) { 6332 objectMap := make(map[string]interface{}) 6333 if pc.ProductContractProperties != nil { 6334 objectMap["properties"] = pc.ProductContractProperties 6335 } 6336 if pc.ID != nil { 6337 objectMap["id"] = pc.ID 6338 } 6339 if pc.Name != nil { 6340 objectMap["name"] = pc.Name 6341 } 6342 if pc.Type != nil { 6343 objectMap["type"] = pc.Type 6344 } 6345 return json.Marshal(objectMap) 6346} 6347 6348// UnmarshalJSON is the custom unmarshaler for ProductContract struct. 6349func (pc *ProductContract) UnmarshalJSON(body []byte) error { 6350 var m map[string]*json.RawMessage 6351 err := json.Unmarshal(body, &m) 6352 if err != nil { 6353 return err 6354 } 6355 for k, v := range m { 6356 switch k { 6357 case "properties": 6358 if v != nil { 6359 var productContractProperties ProductContractProperties 6360 err = json.Unmarshal(*v, &productContractProperties) 6361 if err != nil { 6362 return err 6363 } 6364 pc.ProductContractProperties = &productContractProperties 6365 } 6366 case "id": 6367 if v != nil { 6368 var ID string 6369 err = json.Unmarshal(*v, &ID) 6370 if err != nil { 6371 return err 6372 } 6373 pc.ID = &ID 6374 } 6375 case "name": 6376 if v != nil { 6377 var name string 6378 err = json.Unmarshal(*v, &name) 6379 if err != nil { 6380 return err 6381 } 6382 pc.Name = &name 6383 } 6384 case "type": 6385 if v != nil { 6386 var typeVar string 6387 err = json.Unmarshal(*v, &typeVar) 6388 if err != nil { 6389 return err 6390 } 6391 pc.Type = &typeVar 6392 } 6393 } 6394 } 6395 6396 return nil 6397} 6398 6399// ProductContractProperties product profile. 6400type ProductContractProperties struct { 6401 // DisplayName - Product name. 6402 DisplayName *string `json:"displayName,omitempty"` 6403 // Description - Product description. May include HTML formatting tags. 6404 Description *string `json:"description,omitempty"` 6405 // 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. 6406 Terms *string `json:"terms,omitempty"` 6407 // 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. 6408 SubscriptionRequired *bool `json:"subscriptionRequired,omitempty"` 6409 // 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. 6410 ApprovalRequired *bool `json:"approvalRequired,omitempty"` 6411 // 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. 6412 SubscriptionsLimit *int32 `json:"subscriptionsLimit,omitempty"` 6413 // 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' 6414 State ProductState `json:"state,omitempty"` 6415} 6416 6417// ProductEntityBaseParameters product Entity Base Parameters 6418type ProductEntityBaseParameters struct { 6419 // Description - Product description. May include HTML formatting tags. 6420 Description *string `json:"description,omitempty"` 6421 // 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. 6422 Terms *string `json:"terms,omitempty"` 6423 // 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. 6424 SubscriptionRequired *bool `json:"subscriptionRequired,omitempty"` 6425 // 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. 6426 ApprovalRequired *bool `json:"approvalRequired,omitempty"` 6427 // 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. 6428 SubscriptionsLimit *int32 `json:"subscriptionsLimit,omitempty"` 6429 // 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' 6430 State ProductState `json:"state,omitempty"` 6431} 6432 6433// ProductTagResourceContractProperties product profile. 6434type ProductTagResourceContractProperties struct { 6435 // ID - Identifier of the product in the form of /products/{productId} 6436 ID *string `json:"id,omitempty"` 6437 // Name - Product name. 6438 Name *string `json:"name,omitempty"` 6439 // Description - Product description. May include HTML formatting tags. 6440 Description *string `json:"description,omitempty"` 6441 // 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. 6442 Terms *string `json:"terms,omitempty"` 6443 // 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. 6444 SubscriptionRequired *bool `json:"subscriptionRequired,omitempty"` 6445 // 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. 6446 ApprovalRequired *bool `json:"approvalRequired,omitempty"` 6447 // 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. 6448 SubscriptionsLimit *int32 `json:"subscriptionsLimit,omitempty"` 6449 // 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' 6450 State ProductState `json:"state,omitempty"` 6451} 6452 6453// ProductUpdateParameters product Update parameters. 6454type ProductUpdateParameters struct { 6455 // ProductUpdateProperties - Product entity Update contract properties. 6456 *ProductUpdateProperties `json:"properties,omitempty"` 6457} 6458 6459// MarshalJSON is the custom marshaler for ProductUpdateParameters. 6460func (pup ProductUpdateParameters) MarshalJSON() ([]byte, error) { 6461 objectMap := make(map[string]interface{}) 6462 if pup.ProductUpdateProperties != nil { 6463 objectMap["properties"] = pup.ProductUpdateProperties 6464 } 6465 return json.Marshal(objectMap) 6466} 6467 6468// UnmarshalJSON is the custom unmarshaler for ProductUpdateParameters struct. 6469func (pup *ProductUpdateParameters) UnmarshalJSON(body []byte) error { 6470 var m map[string]*json.RawMessage 6471 err := json.Unmarshal(body, &m) 6472 if err != nil { 6473 return err 6474 } 6475 for k, v := range m { 6476 switch k { 6477 case "properties": 6478 if v != nil { 6479 var productUpdateProperties ProductUpdateProperties 6480 err = json.Unmarshal(*v, &productUpdateProperties) 6481 if err != nil { 6482 return err 6483 } 6484 pup.ProductUpdateProperties = &productUpdateProperties 6485 } 6486 } 6487 } 6488 6489 return nil 6490} 6491 6492// ProductUpdateProperties parameters supplied to the Update Product operation. 6493type ProductUpdateProperties struct { 6494 // DisplayName - Product name. 6495 DisplayName *string `json:"displayName,omitempty"` 6496 // Description - Product description. May include HTML formatting tags. 6497 Description *string `json:"description,omitempty"` 6498 // 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. 6499 Terms *string `json:"terms,omitempty"` 6500 // 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. 6501 SubscriptionRequired *bool `json:"subscriptionRequired,omitempty"` 6502 // 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. 6503 ApprovalRequired *bool `json:"approvalRequired,omitempty"` 6504 // 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. 6505 SubscriptionsLimit *int32 `json:"subscriptionsLimit,omitempty"` 6506 // 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' 6507 State ProductState `json:"state,omitempty"` 6508} 6509 6510// PropertyCollection paged Property list representation. 6511type PropertyCollection struct { 6512 autorest.Response `json:"-"` 6513 // Value - Page values. 6514 Value *[]PropertyContract `json:"value,omitempty"` 6515 // NextLink - Next page link if any. 6516 NextLink *string `json:"nextLink,omitempty"` 6517} 6518 6519// PropertyCollectionIterator provides access to a complete listing of PropertyContract values. 6520type PropertyCollectionIterator struct { 6521 i int 6522 page PropertyCollectionPage 6523} 6524 6525// Next advances to the next value. If there was an error making 6526// the request the iterator does not advance and the error is returned. 6527func (iter *PropertyCollectionIterator) Next() error { 6528 iter.i++ 6529 if iter.i < len(iter.page.Values()) { 6530 return nil 6531 } 6532 err := iter.page.Next() 6533 if err != nil { 6534 iter.i-- 6535 return err 6536 } 6537 iter.i = 0 6538 return nil 6539} 6540 6541// NotDone returns true if the enumeration should be started or is not yet complete. 6542func (iter PropertyCollectionIterator) NotDone() bool { 6543 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 6544} 6545 6546// Response returns the raw server response from the last page request. 6547func (iter PropertyCollectionIterator) Response() PropertyCollection { 6548 return iter.page.Response() 6549} 6550 6551// Value returns the current value or a zero-initialized value if the 6552// iterator has advanced beyond the end of the collection. 6553func (iter PropertyCollectionIterator) Value() PropertyContract { 6554 if !iter.page.NotDone() { 6555 return PropertyContract{} 6556 } 6557 return iter.page.Values()[iter.i] 6558} 6559 6560// IsEmpty returns true if the ListResult contains no values. 6561func (pc PropertyCollection) IsEmpty() bool { 6562 return pc.Value == nil || len(*pc.Value) == 0 6563} 6564 6565// propertyCollectionPreparer prepares a request to retrieve the next set of results. 6566// It returns nil if no more results exist. 6567func (pc PropertyCollection) propertyCollectionPreparer() (*http.Request, error) { 6568 if pc.NextLink == nil || len(to.String(pc.NextLink)) < 1 { 6569 return nil, nil 6570 } 6571 return autorest.Prepare(&http.Request{}, 6572 autorest.AsJSON(), 6573 autorest.AsGet(), 6574 autorest.WithBaseURL(to.String(pc.NextLink))) 6575} 6576 6577// PropertyCollectionPage contains a page of PropertyContract values. 6578type PropertyCollectionPage struct { 6579 fn func(PropertyCollection) (PropertyCollection, error) 6580 pc PropertyCollection 6581} 6582 6583// Next advances to the next page of values. If there was an error making 6584// the request the page does not advance and the error is returned. 6585func (page *PropertyCollectionPage) Next() error { 6586 next, err := page.fn(page.pc) 6587 if err != nil { 6588 return err 6589 } 6590 page.pc = next 6591 return nil 6592} 6593 6594// NotDone returns true if the page enumeration should be started or is not yet complete. 6595func (page PropertyCollectionPage) NotDone() bool { 6596 return !page.pc.IsEmpty() 6597} 6598 6599// Response returns the raw server response from the last page request. 6600func (page PropertyCollectionPage) Response() PropertyCollection { 6601 return page.pc 6602} 6603 6604// Values returns the slice of values for the current page or nil if there are no values. 6605func (page PropertyCollectionPage) Values() []PropertyContract { 6606 if page.pc.IsEmpty() { 6607 return nil 6608 } 6609 return *page.pc.Value 6610} 6611 6612// PropertyContract property details. 6613type PropertyContract struct { 6614 autorest.Response `json:"-"` 6615 // PropertyContractProperties - Property entity contract properties. 6616 *PropertyContractProperties `json:"properties,omitempty"` 6617 // ID - Resource ID. 6618 ID *string `json:"id,omitempty"` 6619 // Name - Resource name. 6620 Name *string `json:"name,omitempty"` 6621 // Type - Resource type for API Management resource. 6622 Type *string `json:"type,omitempty"` 6623} 6624 6625// MarshalJSON is the custom marshaler for PropertyContract. 6626func (pc PropertyContract) MarshalJSON() ([]byte, error) { 6627 objectMap := make(map[string]interface{}) 6628 if pc.PropertyContractProperties != nil { 6629 objectMap["properties"] = pc.PropertyContractProperties 6630 } 6631 if pc.ID != nil { 6632 objectMap["id"] = pc.ID 6633 } 6634 if pc.Name != nil { 6635 objectMap["name"] = pc.Name 6636 } 6637 if pc.Type != nil { 6638 objectMap["type"] = pc.Type 6639 } 6640 return json.Marshal(objectMap) 6641} 6642 6643// UnmarshalJSON is the custom unmarshaler for PropertyContract struct. 6644func (pc *PropertyContract) UnmarshalJSON(body []byte) error { 6645 var m map[string]*json.RawMessage 6646 err := json.Unmarshal(body, &m) 6647 if err != nil { 6648 return err 6649 } 6650 for k, v := range m { 6651 switch k { 6652 case "properties": 6653 if v != nil { 6654 var propertyContractProperties PropertyContractProperties 6655 err = json.Unmarshal(*v, &propertyContractProperties) 6656 if err != nil { 6657 return err 6658 } 6659 pc.PropertyContractProperties = &propertyContractProperties 6660 } 6661 case "id": 6662 if v != nil { 6663 var ID string 6664 err = json.Unmarshal(*v, &ID) 6665 if err != nil { 6666 return err 6667 } 6668 pc.ID = &ID 6669 } 6670 case "name": 6671 if v != nil { 6672 var name string 6673 err = json.Unmarshal(*v, &name) 6674 if err != nil { 6675 return err 6676 } 6677 pc.Name = &name 6678 } 6679 case "type": 6680 if v != nil { 6681 var typeVar string 6682 err = json.Unmarshal(*v, &typeVar) 6683 if err != nil { 6684 return err 6685 } 6686 pc.Type = &typeVar 6687 } 6688 } 6689 } 6690 6691 return nil 6692} 6693 6694// PropertyContractProperties property Contract properties. 6695type PropertyContractProperties struct { 6696 // DisplayName - Unique name of Property. It may contain only letters, digits, period, dash, and underscore characters. 6697 DisplayName *string `json:"displayName,omitempty"` 6698 // Value - Value of the property. Can contain policy expressions. It may not be empty or consist only of whitespace. 6699 Value *string `json:"value,omitempty"` 6700 // Tags - Optional tags that when provided can be used to filter the property list. 6701 Tags *[]string `json:"tags,omitempty"` 6702 // Secret - Determines whether the value is a secret and should be encrypted or not. Default value is false. 6703 Secret *bool `json:"secret,omitempty"` 6704} 6705 6706// PropertyEntityBaseParameters property Entity Base Parameters set. 6707type PropertyEntityBaseParameters struct { 6708 // Tags - Optional tags that when provided can be used to filter the property list. 6709 Tags *[]string `json:"tags,omitempty"` 6710 // Secret - Determines whether the value is a secret and should be encrypted or not. Default value is false. 6711 Secret *bool `json:"secret,omitempty"` 6712} 6713 6714// PropertyUpdateParameterProperties property Contract properties. 6715type PropertyUpdateParameterProperties struct { 6716 // DisplayName - Unique name of Property. It may contain only letters, digits, period, dash, and underscore characters. 6717 DisplayName *string `json:"displayName,omitempty"` 6718 // Value - Value of the property. Can contain policy expressions. It may not be empty or consist only of whitespace. 6719 Value *string `json:"value,omitempty"` 6720 // Tags - Optional tags that when provided can be used to filter the property list. 6721 Tags *[]string `json:"tags,omitempty"` 6722 // Secret - Determines whether the value is a secret and should be encrypted or not. Default value is false. 6723 Secret *bool `json:"secret,omitempty"` 6724} 6725 6726// PropertyUpdateParameters property update Parameters. 6727type PropertyUpdateParameters struct { 6728 // PropertyUpdateParameterProperties - Property entity Update contract properties. 6729 *PropertyUpdateParameterProperties `json:"properties,omitempty"` 6730} 6731 6732// MarshalJSON is the custom marshaler for PropertyUpdateParameters. 6733func (pup PropertyUpdateParameters) MarshalJSON() ([]byte, error) { 6734 objectMap := make(map[string]interface{}) 6735 if pup.PropertyUpdateParameterProperties != nil { 6736 objectMap["properties"] = pup.PropertyUpdateParameterProperties 6737 } 6738 return json.Marshal(objectMap) 6739} 6740 6741// UnmarshalJSON is the custom unmarshaler for PropertyUpdateParameters struct. 6742func (pup *PropertyUpdateParameters) UnmarshalJSON(body []byte) error { 6743 var m map[string]*json.RawMessage 6744 err := json.Unmarshal(body, &m) 6745 if err != nil { 6746 return err 6747 } 6748 for k, v := range m { 6749 switch k { 6750 case "properties": 6751 if v != nil { 6752 var propertyUpdateParameterProperties PropertyUpdateParameterProperties 6753 err = json.Unmarshal(*v, &propertyUpdateParameterProperties) 6754 if err != nil { 6755 return err 6756 } 6757 pup.PropertyUpdateParameterProperties = &propertyUpdateParameterProperties 6758 } 6759 } 6760 } 6761 6762 return nil 6763} 6764 6765// QuotaCounterCollection paged Quota Counter list representation. 6766type QuotaCounterCollection struct { 6767 autorest.Response `json:"-"` 6768 // Value - Quota counter values. 6769 Value *[]QuotaCounterContract `json:"value,omitempty"` 6770 // Count - Total record count number across all pages. 6771 Count *int64 `json:"count,omitempty"` 6772 // NextLink - Next page link if any. 6773 NextLink *string `json:"nextLink,omitempty"` 6774} 6775 6776// QuotaCounterContract quota counter details. 6777type QuotaCounterContract struct { 6778 autorest.Response `json:"-"` 6779 // CounterKey - The Key value of the Counter. Must not be empty. 6780 CounterKey *string `json:"counterKey,omitempty"` 6781 // PeriodKey - Identifier of the Period for which the counter was collected. Must not be empty. 6782 PeriodKey *string `json:"periodKey,omitempty"` 6783 // 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. 6784 PeriodStartTime *date.Time `json:"periodStartTime,omitempty"` 6785 // 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. 6786 PeriodEndTime *date.Time `json:"periodEndTime,omitempty"` 6787 // Value - Quota Value Properties 6788 Value *QuotaCounterValueContractProperties `json:"value,omitempty"` 6789} 6790 6791// QuotaCounterValueContract quota counter value details. 6792type QuotaCounterValueContract struct { 6793 // QuotaCounterValueContractProperties - Quota counter Value Properties. 6794 *QuotaCounterValueContractProperties `json:"value,omitempty"` 6795} 6796 6797// MarshalJSON is the custom marshaler for QuotaCounterValueContract. 6798func (qcvc QuotaCounterValueContract) MarshalJSON() ([]byte, error) { 6799 objectMap := make(map[string]interface{}) 6800 if qcvc.QuotaCounterValueContractProperties != nil { 6801 objectMap["value"] = qcvc.QuotaCounterValueContractProperties 6802 } 6803 return json.Marshal(objectMap) 6804} 6805 6806// UnmarshalJSON is the custom unmarshaler for QuotaCounterValueContract struct. 6807func (qcvc *QuotaCounterValueContract) UnmarshalJSON(body []byte) error { 6808 var m map[string]*json.RawMessage 6809 err := json.Unmarshal(body, &m) 6810 if err != nil { 6811 return err 6812 } 6813 for k, v := range m { 6814 switch k { 6815 case "value": 6816 if v != nil { 6817 var quotaCounterValueContractProperties QuotaCounterValueContractProperties 6818 err = json.Unmarshal(*v, "aCounterValueContractProperties) 6819 if err != nil { 6820 return err 6821 } 6822 qcvc.QuotaCounterValueContractProperties = "aCounterValueContractProperties 6823 } 6824 } 6825 } 6826 6827 return nil 6828} 6829 6830// QuotaCounterValueContractProperties quota counter value details. 6831type QuotaCounterValueContractProperties struct { 6832 // CallsCount - Number of times Counter was called. 6833 CallsCount *int32 `json:"callsCount,omitempty"` 6834 // KbTransferred - Data Transferred in KiloBytes. 6835 KbTransferred *float64 `json:"kbTransferred,omitempty"` 6836} 6837 6838// RecipientEmailCollection paged Recipient User list representation. 6839type RecipientEmailCollection struct { 6840 autorest.Response `json:"-"` 6841 // Value - Page values. 6842 Value *[]RecipientEmailContract `json:"value,omitempty"` 6843 // NextLink - Next page link if any. 6844 NextLink *string `json:"nextLink,omitempty"` 6845} 6846 6847// RecipientEmailContract recipient Email details. 6848type RecipientEmailContract struct { 6849 autorest.Response `json:"-"` 6850 // RecipientEmailContractProperties - Recipient Email contract properties. 6851 *RecipientEmailContractProperties `json:"properties,omitempty"` 6852 // ID - Resource ID. 6853 ID *string `json:"id,omitempty"` 6854 // Name - Resource name. 6855 Name *string `json:"name,omitempty"` 6856 // Type - Resource type for API Management resource. 6857 Type *string `json:"type,omitempty"` 6858} 6859 6860// MarshalJSON is the custom marshaler for RecipientEmailContract. 6861func (rec RecipientEmailContract) MarshalJSON() ([]byte, error) { 6862 objectMap := make(map[string]interface{}) 6863 if rec.RecipientEmailContractProperties != nil { 6864 objectMap["properties"] = rec.RecipientEmailContractProperties 6865 } 6866 if rec.ID != nil { 6867 objectMap["id"] = rec.ID 6868 } 6869 if rec.Name != nil { 6870 objectMap["name"] = rec.Name 6871 } 6872 if rec.Type != nil { 6873 objectMap["type"] = rec.Type 6874 } 6875 return json.Marshal(objectMap) 6876} 6877 6878// UnmarshalJSON is the custom unmarshaler for RecipientEmailContract struct. 6879func (rec *RecipientEmailContract) UnmarshalJSON(body []byte) error { 6880 var m map[string]*json.RawMessage 6881 err := json.Unmarshal(body, &m) 6882 if err != nil { 6883 return err 6884 } 6885 for k, v := range m { 6886 switch k { 6887 case "properties": 6888 if v != nil { 6889 var recipientEmailContractProperties RecipientEmailContractProperties 6890 err = json.Unmarshal(*v, &recipientEmailContractProperties) 6891 if err != nil { 6892 return err 6893 } 6894 rec.RecipientEmailContractProperties = &recipientEmailContractProperties 6895 } 6896 case "id": 6897 if v != nil { 6898 var ID string 6899 err = json.Unmarshal(*v, &ID) 6900 if err != nil { 6901 return err 6902 } 6903 rec.ID = &ID 6904 } 6905 case "name": 6906 if v != nil { 6907 var name string 6908 err = json.Unmarshal(*v, &name) 6909 if err != nil { 6910 return err 6911 } 6912 rec.Name = &name 6913 } 6914 case "type": 6915 if v != nil { 6916 var typeVar string 6917 err = json.Unmarshal(*v, &typeVar) 6918 if err != nil { 6919 return err 6920 } 6921 rec.Type = &typeVar 6922 } 6923 } 6924 } 6925 6926 return nil 6927} 6928 6929// RecipientEmailContractProperties recipient Email Contract Properties. 6930type RecipientEmailContractProperties struct { 6931 // Email - User Email subscribed to notification. 6932 Email *string `json:"email,omitempty"` 6933} 6934 6935// RecipientsContractProperties notification Parameter contract. 6936type RecipientsContractProperties struct { 6937 // Emails - List of Emails subscribed for the notification. 6938 Emails *[]string `json:"emails,omitempty"` 6939 // Users - List of Users subscribed for the notification. 6940 Users *[]string `json:"users,omitempty"` 6941} 6942 6943// RecipientUserCollection paged Recipient User list representation. 6944type RecipientUserCollection struct { 6945 autorest.Response `json:"-"` 6946 // Value - Page values. 6947 Value *[]RecipientUserContract `json:"value,omitempty"` 6948 // NextLink - Next page link if any. 6949 NextLink *string `json:"nextLink,omitempty"` 6950} 6951 6952// RecipientUserContract recipient User details. 6953type RecipientUserContract struct { 6954 autorest.Response `json:"-"` 6955 // RecipientUsersContractProperties - Recipient User entity contract properties. 6956 *RecipientUsersContractProperties `json:"properties,omitempty"` 6957 // ID - Resource ID. 6958 ID *string `json:"id,omitempty"` 6959 // Name - Resource name. 6960 Name *string `json:"name,omitempty"` 6961 // Type - Resource type for API Management resource. 6962 Type *string `json:"type,omitempty"` 6963} 6964 6965// MarshalJSON is the custom marshaler for RecipientUserContract. 6966func (ruc RecipientUserContract) MarshalJSON() ([]byte, error) { 6967 objectMap := make(map[string]interface{}) 6968 if ruc.RecipientUsersContractProperties != nil { 6969 objectMap["properties"] = ruc.RecipientUsersContractProperties 6970 } 6971 if ruc.ID != nil { 6972 objectMap["id"] = ruc.ID 6973 } 6974 if ruc.Name != nil { 6975 objectMap["name"] = ruc.Name 6976 } 6977 if ruc.Type != nil { 6978 objectMap["type"] = ruc.Type 6979 } 6980 return json.Marshal(objectMap) 6981} 6982 6983// UnmarshalJSON is the custom unmarshaler for RecipientUserContract struct. 6984func (ruc *RecipientUserContract) UnmarshalJSON(body []byte) error { 6985 var m map[string]*json.RawMessage 6986 err := json.Unmarshal(body, &m) 6987 if err != nil { 6988 return err 6989 } 6990 for k, v := range m { 6991 switch k { 6992 case "properties": 6993 if v != nil { 6994 var recipientUsersContractProperties RecipientUsersContractProperties 6995 err = json.Unmarshal(*v, &recipientUsersContractProperties) 6996 if err != nil { 6997 return err 6998 } 6999 ruc.RecipientUsersContractProperties = &recipientUsersContractProperties 7000 } 7001 case "id": 7002 if v != nil { 7003 var ID string 7004 err = json.Unmarshal(*v, &ID) 7005 if err != nil { 7006 return err 7007 } 7008 ruc.ID = &ID 7009 } 7010 case "name": 7011 if v != nil { 7012 var name string 7013 err = json.Unmarshal(*v, &name) 7014 if err != nil { 7015 return err 7016 } 7017 ruc.Name = &name 7018 } 7019 case "type": 7020 if v != nil { 7021 var typeVar string 7022 err = json.Unmarshal(*v, &typeVar) 7023 if err != nil { 7024 return err 7025 } 7026 ruc.Type = &typeVar 7027 } 7028 } 7029 } 7030 7031 return nil 7032} 7033 7034// RecipientUsersContractProperties recipient User Contract Properties. 7035type RecipientUsersContractProperties struct { 7036 // UserID - API Management UserId subscribed to notification. 7037 UserID *string `json:"userId,omitempty"` 7038} 7039 7040// RegionContract region profile. 7041type RegionContract struct { 7042 // Name - Region name. 7043 Name *string `json:"name,omitempty"` 7044 // IsMasterRegion - whether Region is the master region. 7045 IsMasterRegion *bool `json:"isMasterRegion,omitempty"` 7046 // IsDeleted - whether Region is deleted. 7047 IsDeleted *bool `json:"isDeleted,omitempty"` 7048} 7049 7050// RegionListResult lists Regions operation response details. 7051type RegionListResult struct { 7052 autorest.Response `json:"-"` 7053 // Value - Lists of Regions. 7054 Value *[]RegionContract `json:"value,omitempty"` 7055 // Count - Total record count number across all pages. 7056 Count *int64 `json:"count,omitempty"` 7057 // NextLink - Next page link if any. 7058 NextLink *string `json:"nextLink,omitempty"` 7059} 7060 7061// RegionListResultIterator provides access to a complete listing of RegionContract values. 7062type RegionListResultIterator struct { 7063 i int 7064 page RegionListResultPage 7065} 7066 7067// Next advances to the next value. If there was an error making 7068// the request the iterator does not advance and the error is returned. 7069func (iter *RegionListResultIterator) Next() error { 7070 iter.i++ 7071 if iter.i < len(iter.page.Values()) { 7072 return nil 7073 } 7074 err := iter.page.Next() 7075 if err != nil { 7076 iter.i-- 7077 return err 7078 } 7079 iter.i = 0 7080 return nil 7081} 7082 7083// NotDone returns true if the enumeration should be started or is not yet complete. 7084func (iter RegionListResultIterator) NotDone() bool { 7085 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 7086} 7087 7088// Response returns the raw server response from the last page request. 7089func (iter RegionListResultIterator) Response() RegionListResult { 7090 return iter.page.Response() 7091} 7092 7093// Value returns the current value or a zero-initialized value if the 7094// iterator has advanced beyond the end of the collection. 7095func (iter RegionListResultIterator) Value() RegionContract { 7096 if !iter.page.NotDone() { 7097 return RegionContract{} 7098 } 7099 return iter.page.Values()[iter.i] 7100} 7101 7102// IsEmpty returns true if the ListResult contains no values. 7103func (rlr RegionListResult) IsEmpty() bool { 7104 return rlr.Value == nil || len(*rlr.Value) == 0 7105} 7106 7107// regionListResultPreparer prepares a request to retrieve the next set of results. 7108// It returns nil if no more results exist. 7109func (rlr RegionListResult) regionListResultPreparer() (*http.Request, error) { 7110 if rlr.NextLink == nil || len(to.String(rlr.NextLink)) < 1 { 7111 return nil, nil 7112 } 7113 return autorest.Prepare(&http.Request{}, 7114 autorest.AsJSON(), 7115 autorest.AsGet(), 7116 autorest.WithBaseURL(to.String(rlr.NextLink))) 7117} 7118 7119// RegionListResultPage contains a page of RegionContract values. 7120type RegionListResultPage struct { 7121 fn func(RegionListResult) (RegionListResult, error) 7122 rlr RegionListResult 7123} 7124 7125// Next advances to the next page of values. If there was an error making 7126// the request the page does not advance and the error is returned. 7127func (page *RegionListResultPage) Next() error { 7128 next, err := page.fn(page.rlr) 7129 if err != nil { 7130 return err 7131 } 7132 page.rlr = next 7133 return nil 7134} 7135 7136// NotDone returns true if the page enumeration should be started or is not yet complete. 7137func (page RegionListResultPage) NotDone() bool { 7138 return !page.rlr.IsEmpty() 7139} 7140 7141// Response returns the raw server response from the last page request. 7142func (page RegionListResultPage) Response() RegionListResult { 7143 return page.rlr 7144} 7145 7146// Values returns the slice of values for the current page or nil if there are no values. 7147func (page RegionListResultPage) Values() []RegionContract { 7148 if page.rlr.IsEmpty() { 7149 return nil 7150 } 7151 return *page.rlr.Value 7152} 7153 7154// RegistrationDelegationSettingsProperties user registration delegation settings properties. 7155type RegistrationDelegationSettingsProperties struct { 7156 // Enabled - Enable or disable delegation for user registration. 7157 Enabled *bool `json:"enabled,omitempty"` 7158} 7159 7160// ReportCollection paged Report records list representation. 7161type ReportCollection struct { 7162 autorest.Response `json:"-"` 7163 // Value - Page values. 7164 Value *[]ReportRecordContract `json:"value,omitempty"` 7165 // Count - Total record count number across all pages. 7166 Count *int64 `json:"count,omitempty"` 7167 // NextLink - Next page link if any. 7168 NextLink *string `json:"nextLink,omitempty"` 7169} 7170 7171// ReportCollectionIterator provides access to a complete listing of ReportRecordContract values. 7172type ReportCollectionIterator struct { 7173 i int 7174 page ReportCollectionPage 7175} 7176 7177// Next advances to the next value. If there was an error making 7178// the request the iterator does not advance and the error is returned. 7179func (iter *ReportCollectionIterator) Next() error { 7180 iter.i++ 7181 if iter.i < len(iter.page.Values()) { 7182 return nil 7183 } 7184 err := iter.page.Next() 7185 if err != nil { 7186 iter.i-- 7187 return err 7188 } 7189 iter.i = 0 7190 return nil 7191} 7192 7193// NotDone returns true if the enumeration should be started or is not yet complete. 7194func (iter ReportCollectionIterator) NotDone() bool { 7195 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 7196} 7197 7198// Response returns the raw server response from the last page request. 7199func (iter ReportCollectionIterator) Response() ReportCollection { 7200 return iter.page.Response() 7201} 7202 7203// Value returns the current value or a zero-initialized value if the 7204// iterator has advanced beyond the end of the collection. 7205func (iter ReportCollectionIterator) Value() ReportRecordContract { 7206 if !iter.page.NotDone() { 7207 return ReportRecordContract{} 7208 } 7209 return iter.page.Values()[iter.i] 7210} 7211 7212// IsEmpty returns true if the ListResult contains no values. 7213func (rc ReportCollection) IsEmpty() bool { 7214 return rc.Value == nil || len(*rc.Value) == 0 7215} 7216 7217// reportCollectionPreparer prepares a request to retrieve the next set of results. 7218// It returns nil if no more results exist. 7219func (rc ReportCollection) reportCollectionPreparer() (*http.Request, error) { 7220 if rc.NextLink == nil || len(to.String(rc.NextLink)) < 1 { 7221 return nil, nil 7222 } 7223 return autorest.Prepare(&http.Request{}, 7224 autorest.AsJSON(), 7225 autorest.AsGet(), 7226 autorest.WithBaseURL(to.String(rc.NextLink))) 7227} 7228 7229// ReportCollectionPage contains a page of ReportRecordContract values. 7230type ReportCollectionPage struct { 7231 fn func(ReportCollection) (ReportCollection, error) 7232 rc ReportCollection 7233} 7234 7235// Next advances to the next page of values. If there was an error making 7236// the request the page does not advance and the error is returned. 7237func (page *ReportCollectionPage) Next() error { 7238 next, err := page.fn(page.rc) 7239 if err != nil { 7240 return err 7241 } 7242 page.rc = next 7243 return nil 7244} 7245 7246// NotDone returns true if the page enumeration should be started or is not yet complete. 7247func (page ReportCollectionPage) NotDone() bool { 7248 return !page.rc.IsEmpty() 7249} 7250 7251// Response returns the raw server response from the last page request. 7252func (page ReportCollectionPage) Response() ReportCollection { 7253 return page.rc 7254} 7255 7256// Values returns the slice of values for the current page or nil if there are no values. 7257func (page ReportCollectionPage) Values() []ReportRecordContract { 7258 if page.rc.IsEmpty() { 7259 return nil 7260 } 7261 return *page.rc.Value 7262} 7263 7264// ReportRecordContract report data. 7265type ReportRecordContract struct { 7266 // Name - Name depending on report endpoint specifies product, API, operation or developer name. 7267 Name *string `json:"name,omitempty"` 7268 // Timestamp - Start of aggregation period. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. 7269 Timestamp *date.Time `json:"timestamp,omitempty"` 7270 // Interval - Length of agregation 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). 7271 Interval *string `json:"interval,omitempty"` 7272 // Country - Country to which this record data is related. 7273 Country *string `json:"country,omitempty"` 7274 // Region - Country region to which this record data is related. 7275 Region *string `json:"region,omitempty"` 7276 // Zip - Zip code to which this record data is related. 7277 Zip *string `json:"zip,omitempty"` 7278 // UserID - User identifier path. /users/{userId} 7279 UserID *string `json:"userId,omitempty"` 7280 // ProductID - Product identifier path. /products/{productId} 7281 ProductID *string `json:"productId,omitempty"` 7282 // APIID - API identifier path. /apis/{apiId} 7283 APIID *string `json:"apiId,omitempty"` 7284 // OperationID - Operation identifier path. /apis/{apiId}/operations/{operationId} 7285 OperationID *string `json:"operationId,omitempty"` 7286 // APIRegion - API region identifier. 7287 APIRegion *string `json:"apiRegion,omitempty"` 7288 // SubscriptionID - Subscription identifier path. /subscriptions/{subscriptionId} 7289 SubscriptionID *string `json:"subscriptionId,omitempty"` 7290 // CallCountSuccess - Number of succesful calls. This includes calls returning HttpStatusCode <= 301 and HttpStatusCode.NotModified and HttpStatusCode.TemporaryRedirect 7291 CallCountSuccess *int32 `json:"callCountSuccess,omitempty"` 7292 // CallCountBlocked - Number of calls blocked due to invalid credentials. This includes calls returning HttpStatusCode.Unauthorize and HttpStatusCode.Forbidden and HttpStatusCode.TooManyRequests 7293 CallCountBlocked *int32 `json:"callCountBlocked,omitempty"` 7294 // 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 7295 CallCountFailed *int32 `json:"callCountFailed,omitempty"` 7296 // CallCountOther - Number of other calls. 7297 CallCountOther *int32 `json:"callCountOther,omitempty"` 7298 // CallCountTotal - Total number of calls. 7299 CallCountTotal *int32 `json:"callCountTotal,omitempty"` 7300 // Bandwidth - Bandwidth consumed. 7301 Bandwidth *int64 `json:"bandwidth,omitempty"` 7302 // CacheHitCount - Number of times when content was served from cache policy. 7303 CacheHitCount *int32 `json:"cacheHitCount,omitempty"` 7304 // CacheMissCount - Number of times content was fetched from backend. 7305 CacheMissCount *int32 `json:"cacheMissCount,omitempty"` 7306 // APITimeAvg - Average time it took to process request. 7307 APITimeAvg *float64 `json:"apiTimeAvg,omitempty"` 7308 // APITimeMin - Minimum time it took to process request. 7309 APITimeMin *float64 `json:"apiTimeMin,omitempty"` 7310 // APITimeMax - Maximum time it took to process request. 7311 APITimeMax *float64 `json:"apiTimeMax,omitempty"` 7312 // ServiceTimeAvg - Average time it took to process request on backend. 7313 ServiceTimeAvg *float64 `json:"serviceTimeAvg,omitempty"` 7314 // ServiceTimeMin - Minimum time it took to process request on backend. 7315 ServiceTimeMin *float64 `json:"serviceTimeMin,omitempty"` 7316 // ServiceTimeMax - Maximum time it took to process request on backend. 7317 ServiceTimeMax *float64 `json:"serviceTimeMax,omitempty"` 7318} 7319 7320// RepresentationContract operation request/response representation details. 7321type RepresentationContract struct { 7322 // ContentType - Specifies a registered or custom content type for this representation, e.g. application/xml. 7323 ContentType *string `json:"contentType,omitempty"` 7324 // Sample - An example of the representation. 7325 Sample *string `json:"sample,omitempty"` 7326 // SchemaID - Schema identifier. Applicable only if 'contentType' value is neither 'application/x-www-form-urlencoded' nor 'multipart/form-data'. 7327 SchemaID *string `json:"schemaId,omitempty"` 7328 // TypeName - Type name defined by the schema. Applicable only if 'contentType' value is neither 'application/x-www-form-urlencoded' nor 'multipart/form-data'. 7329 TypeName *string `json:"typeName,omitempty"` 7330 // FormParameters - Collection of form parameters. Required if 'contentType' value is either 'application/x-www-form-urlencoded' or 'multipart/form-data'.. 7331 FormParameters *[]ParameterContract `json:"formParameters,omitempty"` 7332} 7333 7334// RequestContract operation request details. 7335type RequestContract struct { 7336 // Description - Operation request description. 7337 Description *string `json:"description,omitempty"` 7338 // QueryParameters - Collection of operation request query parameters. 7339 QueryParameters *[]ParameterContract `json:"queryParameters,omitempty"` 7340 // Headers - Collection of operation request headers. 7341 Headers *[]ParameterContract `json:"headers,omitempty"` 7342 // Representations - Collection of operation request representations. 7343 Representations *[]RepresentationContract `json:"representations,omitempty"` 7344} 7345 7346// RequestReportCollection paged Report records list representation. 7347type RequestReportCollection struct { 7348 autorest.Response `json:"-"` 7349 // Value - Page values. 7350 Value *[]RequestReportRecordContract `json:"value,omitempty"` 7351 // Count - Total record count number across all pages. 7352 Count *int64 `json:"count,omitempty"` 7353} 7354 7355// RequestReportRecordContract request Report data. 7356type RequestReportRecordContract struct { 7357 // APIID - API identifier path. /apis/{apiId} 7358 APIID *string `json:"apiId,omitempty"` 7359 // OperationID - Operation identifier path. /apis/{apiId}/operations/{operationId} 7360 OperationID *string `json:"operationId,omitempty"` 7361 // ProductID - Product identifier path. /products/{productId} 7362 ProductID *string `json:"productId,omitempty"` 7363 // UserID - User identifier path. /users/{userId} 7364 UserID *string `json:"userId,omitempty"` 7365 // Method - The HTTP method associated with this request.. 7366 Method *string `json:"method,omitempty"` 7367 // URL - The full URL associated with this request. 7368 URL *string `json:"url,omitempty"` 7369 // IPAddress - The client IP address associated with this request. 7370 IPAddress *string `json:"ipAddress,omitempty"` 7371 // BackendResponseCode - The HTTP status code received by the gateway as a result of forwarding this request to the backend. 7372 BackendResponseCode *string `json:"backendResponseCode,omitempty"` 7373 // ResponseCode - The HTTP status code returned by the gateway. 7374 ResponseCode *int32 `json:"responseCode,omitempty"` 7375 // ResponseSize - The size of the response returned by the gateway. 7376 ResponseSize *int32 `json:"responseSize,omitempty"` 7377 // Timestamp - The date and time when this request was received by the gateway in ISO 8601 format. 7378 Timestamp *date.Time `json:"timestamp,omitempty"` 7379 // 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 fullfilled by the backend. 7380 Cache *string `json:"cache,omitempty"` 7381 // APITime - The total time it took to process this request. 7382 APITime *float64 `json:"apiTime,omitempty"` 7383 // ServiceTime - he time it took to forward this request to the backend and get the response back. 7384 ServiceTime *float64 `json:"serviceTime,omitempty"` 7385 // APIRegion - Azure region where the gateway that processed this request is located. 7386 APIRegion *string `json:"apiRegion,omitempty"` 7387 // SubscriptionID - Subscription identifier path. /subscriptions/{subscriptionId} 7388 SubscriptionID *string `json:"subscriptionId,omitempty"` 7389 // RequestID - Request Identifier. 7390 RequestID *string `json:"requestId,omitempty"` 7391 // RequestSize - The size of this request.. 7392 RequestSize *int32 `json:"requestSize,omitempty"` 7393} 7394 7395// Resource the Resource definition. 7396type Resource struct { 7397 // ID - Resource ID. 7398 ID *string `json:"id,omitempty"` 7399 // Name - Resource name. 7400 Name *string `json:"name,omitempty"` 7401 // Type - Resource type for API Management resource. 7402 Type *string `json:"type,omitempty"` 7403} 7404 7405// ResponseContract operation response details. 7406type ResponseContract struct { 7407 // StatusCode - Operation response HTTP status code. 7408 StatusCode *int32 `json:"statusCode,omitempty"` 7409 // Description - Operation response description. 7410 Description *string `json:"description,omitempty"` 7411 // Representations - Collection of operation response representations. 7412 Representations *[]RepresentationContract `json:"representations,omitempty"` 7413 // Headers - Collection of operation response headers. 7414 Headers *[]ParameterContract `json:"headers,omitempty"` 7415} 7416 7417// SaveConfigurationParameter parameters supplied to the Save Tenant Configuration operation. 7418type SaveConfigurationParameter struct { 7419 // Branch - The name of the Git branch in which to commit the current configuration snapshot. 7420 Branch *string `json:"branch,omitempty"` 7421 // 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. 7422 Force *bool `json:"force,omitempty"` 7423} 7424 7425// SchemaCollection the response of the list schema operation. 7426type SchemaCollection struct { 7427 autorest.Response `json:"-"` 7428 // Value - Api Schema Contract value. 7429 Value *[]SchemaContract `json:"value,omitempty"` 7430 // NextLink - Next page link if any. 7431 NextLink *string `json:"nextLink,omitempty"` 7432} 7433 7434// SchemaCollectionIterator provides access to a complete listing of SchemaContract values. 7435type SchemaCollectionIterator struct { 7436 i int 7437 page SchemaCollectionPage 7438} 7439 7440// Next advances to the next value. If there was an error making 7441// the request the iterator does not advance and the error is returned. 7442func (iter *SchemaCollectionIterator) Next() error { 7443 iter.i++ 7444 if iter.i < len(iter.page.Values()) { 7445 return nil 7446 } 7447 err := iter.page.Next() 7448 if err != nil { 7449 iter.i-- 7450 return err 7451 } 7452 iter.i = 0 7453 return nil 7454} 7455 7456// NotDone returns true if the enumeration should be started or is not yet complete. 7457func (iter SchemaCollectionIterator) NotDone() bool { 7458 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 7459} 7460 7461// Response returns the raw server response from the last page request. 7462func (iter SchemaCollectionIterator) Response() SchemaCollection { 7463 return iter.page.Response() 7464} 7465 7466// Value returns the current value or a zero-initialized value if the 7467// iterator has advanced beyond the end of the collection. 7468func (iter SchemaCollectionIterator) Value() SchemaContract { 7469 if !iter.page.NotDone() { 7470 return SchemaContract{} 7471 } 7472 return iter.page.Values()[iter.i] 7473} 7474 7475// IsEmpty returns true if the ListResult contains no values. 7476func (sc SchemaCollection) IsEmpty() bool { 7477 return sc.Value == nil || len(*sc.Value) == 0 7478} 7479 7480// schemaCollectionPreparer prepares a request to retrieve the next set of results. 7481// It returns nil if no more results exist. 7482func (sc SchemaCollection) schemaCollectionPreparer() (*http.Request, error) { 7483 if sc.NextLink == nil || len(to.String(sc.NextLink)) < 1 { 7484 return nil, nil 7485 } 7486 return autorest.Prepare(&http.Request{}, 7487 autorest.AsJSON(), 7488 autorest.AsGet(), 7489 autorest.WithBaseURL(to.String(sc.NextLink))) 7490} 7491 7492// SchemaCollectionPage contains a page of SchemaContract values. 7493type SchemaCollectionPage struct { 7494 fn func(SchemaCollection) (SchemaCollection, error) 7495 sc SchemaCollection 7496} 7497 7498// Next advances to the next page of values. If there was an error making 7499// the request the page does not advance and the error is returned. 7500func (page *SchemaCollectionPage) Next() error { 7501 next, err := page.fn(page.sc) 7502 if err != nil { 7503 return err 7504 } 7505 page.sc = next 7506 return nil 7507} 7508 7509// NotDone returns true if the page enumeration should be started or is not yet complete. 7510func (page SchemaCollectionPage) NotDone() bool { 7511 return !page.sc.IsEmpty() 7512} 7513 7514// Response returns the raw server response from the last page request. 7515func (page SchemaCollectionPage) Response() SchemaCollection { 7516 return page.sc 7517} 7518 7519// Values returns the slice of values for the current page or nil if there are no values. 7520func (page SchemaCollectionPage) Values() []SchemaContract { 7521 if page.sc.IsEmpty() { 7522 return nil 7523 } 7524 return *page.sc.Value 7525} 7526 7527// SchemaContract schema Contract details. 7528type SchemaContract struct { 7529 autorest.Response `json:"-"` 7530 // SchemaContractProperties - Properties of the Schema. 7531 *SchemaContractProperties `json:"properties,omitempty"` 7532 // ID - Resource ID. 7533 ID *string `json:"id,omitempty"` 7534 // Name - Resource name. 7535 Name *string `json:"name,omitempty"` 7536 // Type - Resource type for API Management resource. 7537 Type *string `json:"type,omitempty"` 7538} 7539 7540// MarshalJSON is the custom marshaler for SchemaContract. 7541func (sc SchemaContract) MarshalJSON() ([]byte, error) { 7542 objectMap := make(map[string]interface{}) 7543 if sc.SchemaContractProperties != nil { 7544 objectMap["properties"] = sc.SchemaContractProperties 7545 } 7546 if sc.ID != nil { 7547 objectMap["id"] = sc.ID 7548 } 7549 if sc.Name != nil { 7550 objectMap["name"] = sc.Name 7551 } 7552 if sc.Type != nil { 7553 objectMap["type"] = sc.Type 7554 } 7555 return json.Marshal(objectMap) 7556} 7557 7558// UnmarshalJSON is the custom unmarshaler for SchemaContract struct. 7559func (sc *SchemaContract) UnmarshalJSON(body []byte) error { 7560 var m map[string]*json.RawMessage 7561 err := json.Unmarshal(body, &m) 7562 if err != nil { 7563 return err 7564 } 7565 for k, v := range m { 7566 switch k { 7567 case "properties": 7568 if v != nil { 7569 var schemaContractProperties SchemaContractProperties 7570 err = json.Unmarshal(*v, &schemaContractProperties) 7571 if err != nil { 7572 return err 7573 } 7574 sc.SchemaContractProperties = &schemaContractProperties 7575 } 7576 case "id": 7577 if v != nil { 7578 var ID string 7579 err = json.Unmarshal(*v, &ID) 7580 if err != nil { 7581 return err 7582 } 7583 sc.ID = &ID 7584 } 7585 case "name": 7586 if v != nil { 7587 var name string 7588 err = json.Unmarshal(*v, &name) 7589 if err != nil { 7590 return err 7591 } 7592 sc.Name = &name 7593 } 7594 case "type": 7595 if v != nil { 7596 var typeVar string 7597 err = json.Unmarshal(*v, &typeVar) 7598 if err != nil { 7599 return err 7600 } 7601 sc.Type = &typeVar 7602 } 7603 } 7604 } 7605 7606 return nil 7607} 7608 7609// SchemaContractProperties schema contract Properties. 7610type SchemaContractProperties struct { 7611 // 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). 7612 ContentType *string `json:"contentType,omitempty"` 7613 // SchemaDocumentProperties - Properties of the Schema Document. 7614 *SchemaDocumentProperties `json:"document,omitempty"` 7615} 7616 7617// MarshalJSON is the custom marshaler for SchemaContractProperties. 7618func (scp SchemaContractProperties) MarshalJSON() ([]byte, error) { 7619 objectMap := make(map[string]interface{}) 7620 if scp.ContentType != nil { 7621 objectMap["contentType"] = scp.ContentType 7622 } 7623 if scp.SchemaDocumentProperties != nil { 7624 objectMap["document"] = scp.SchemaDocumentProperties 7625 } 7626 return json.Marshal(objectMap) 7627} 7628 7629// UnmarshalJSON is the custom unmarshaler for SchemaContractProperties struct. 7630func (scp *SchemaContractProperties) UnmarshalJSON(body []byte) error { 7631 var m map[string]*json.RawMessage 7632 err := json.Unmarshal(body, &m) 7633 if err != nil { 7634 return err 7635 } 7636 for k, v := range m { 7637 switch k { 7638 case "contentType": 7639 if v != nil { 7640 var contentType string 7641 err = json.Unmarshal(*v, &contentType) 7642 if err != nil { 7643 return err 7644 } 7645 scp.ContentType = &contentType 7646 } 7647 case "document": 7648 if v != nil { 7649 var schemaDocumentProperties SchemaDocumentProperties 7650 err = json.Unmarshal(*v, &schemaDocumentProperties) 7651 if err != nil { 7652 return err 7653 } 7654 scp.SchemaDocumentProperties = &schemaDocumentProperties 7655 } 7656 } 7657 } 7658 7659 return nil 7660} 7661 7662// SchemaDocumentProperties schema Document Properties. 7663type SchemaDocumentProperties struct { 7664 // Value - Json escaped string defining the document representing the Schema. 7665 Value *string `json:"value,omitempty"` 7666} 7667 7668// ServiceApplyNetworkConfigurationParameters parameter supplied to the Apply Network configuration operation. 7669type ServiceApplyNetworkConfigurationParameters struct { 7670 // 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. 7671 Location *string `json:"location,omitempty"` 7672} 7673 7674// ServiceApplyNetworkConfigurationUpdatesFuture an abstraction for monitoring and retrieving the results of a 7675// long-running operation. 7676type ServiceApplyNetworkConfigurationUpdatesFuture struct { 7677 azure.Future 7678} 7679 7680// Result returns the result of the asynchronous operation. 7681// If the operation has not completed it will return an error. 7682func (future *ServiceApplyNetworkConfigurationUpdatesFuture) Result(client ServiceClient) (sr ServiceResource, err error) { 7683 var done bool 7684 done, err = future.Done(client) 7685 if err != nil { 7686 err = autorest.NewErrorWithError(err, "apimanagement.ServiceApplyNetworkConfigurationUpdatesFuture", "Result", future.Response(), "Polling failure") 7687 return 7688 } 7689 if !done { 7690 err = azure.NewAsyncOpIncompleteError("apimanagement.ServiceApplyNetworkConfigurationUpdatesFuture") 7691 return 7692 } 7693 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 7694 if sr.Response.Response, err = future.GetResult(sender); err == nil && sr.Response.Response.StatusCode != http.StatusNoContent { 7695 sr, err = client.ApplyNetworkConfigurationUpdatesResponder(sr.Response.Response) 7696 if err != nil { 7697 err = autorest.NewErrorWithError(err, "apimanagement.ServiceApplyNetworkConfigurationUpdatesFuture", "Result", sr.Response.Response, "Failure responding to request") 7698 } 7699 } 7700 return 7701} 7702 7703// ServiceBackupFuture an abstraction for monitoring and retrieving the results of a long-running operation. 7704type ServiceBackupFuture struct { 7705 azure.Future 7706} 7707 7708// Result returns the result of the asynchronous operation. 7709// If the operation has not completed it will return an error. 7710func (future *ServiceBackupFuture) Result(client ServiceClient) (sr ServiceResource, err error) { 7711 var done bool 7712 done, err = future.Done(client) 7713 if err != nil { 7714 err = autorest.NewErrorWithError(err, "apimanagement.ServiceBackupFuture", "Result", future.Response(), "Polling failure") 7715 return 7716 } 7717 if !done { 7718 err = azure.NewAsyncOpIncompleteError("apimanagement.ServiceBackupFuture") 7719 return 7720 } 7721 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 7722 if sr.Response.Response, err = future.GetResult(sender); err == nil && sr.Response.Response.StatusCode != http.StatusNoContent { 7723 sr, err = client.BackupResponder(sr.Response.Response) 7724 if err != nil { 7725 err = autorest.NewErrorWithError(err, "apimanagement.ServiceBackupFuture", "Result", sr.Response.Response, "Failure responding to request") 7726 } 7727 } 7728 return 7729} 7730 7731// ServiceBackupRestoreParameters parameters supplied to the Backup/Restore of an API Management service operation. 7732type ServiceBackupRestoreParameters struct { 7733 // StorageAccount - Azure Cloud Storage account (used to place/retrieve the backup) name. 7734 StorageAccount *string `json:"storageAccount,omitempty"` 7735 // AccessKey - Azure Cloud Storage account (used to place/retrieve the backup) access key. 7736 AccessKey *string `json:"accessKey,omitempty"` 7737 // ContainerName - Azure Cloud Storage blob container name used to place/retrieve the backup. 7738 ContainerName *string `json:"containerName,omitempty"` 7739 // BackupName - The name of the backup file to create. 7740 BackupName *string `json:"backupName,omitempty"` 7741} 7742 7743// ServiceBaseProperties base Properties of an API Management service resource description. 7744type ServiceBaseProperties struct { 7745 // NotificationSenderEmail - Email address from which the notification will be sent. 7746 NotificationSenderEmail *string `json:"notificationSenderEmail,omitempty"` 7747 // ProvisioningState - The current provisioning state of the API Management service which can be one of the following: Created/Activating/Succeeded/Updating/Failed/Stopped/Terminating/TerminationFailed/Deleted. 7748 ProvisioningState *string `json:"provisioningState,omitempty"` 7749 // TargetProvisioningState - The provisioning state of the API Management service, which is targeted by the long running operation started on the service. 7750 TargetProvisioningState *string `json:"targetProvisioningState,omitempty"` 7751 // CreatedAtUtc - Creation UTC date of the API Management service.The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. 7752 CreatedAtUtc *date.Time `json:"createdAtUtc,omitempty"` 7753 // GatewayURL - Gateway URL of the API Management service. 7754 GatewayURL *string `json:"gatewayUrl,omitempty"` 7755 // GatewayRegionalURL - Gateway URL of the API Management service in the Default Region. 7756 GatewayRegionalURL *string `json:"gatewayRegionalUrl,omitempty"` 7757 // PortalURL - Publisher portal endpoint Url of the API Management service. 7758 PortalURL *string `json:"portalUrl,omitempty"` 7759 // ManagementAPIURL - Management API endpoint URL of the API Management service. 7760 ManagementAPIURL *string `json:"managementApiUrl,omitempty"` 7761 // ScmURL - SCM endpoint URL of the API Management service. 7762 ScmURL *string `json:"scmUrl,omitempty"` 7763 // HostnameConfigurations - Custom hostname configuration of the API Management service. 7764 HostnameConfigurations *[]HostnameConfiguration `json:"hostnameConfigurations,omitempty"` 7765 // PublicIPAddresses - Public Static Load Balanced IP addresses of the API Management service in Primary region. Available only for Basic, Standard and Premium SKU. 7766 PublicIPAddresses *[]string `json:"publicIPAddresses,omitempty"` 7767 // PrivateIPAddresses - 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. 7768 PrivateIPAddresses *[]string `json:"privateIPAddresses,omitempty"` 7769 // VirtualNetworkConfiguration - Virtual network configuration of the API Management service. 7770 VirtualNetworkConfiguration *VirtualNetworkConfiguration `json:"virtualNetworkConfiguration,omitempty"` 7771 // AdditionalLocations - Additional datacenter locations of the API Management service. 7772 AdditionalLocations *[]AdditionalLocation `json:"additionalLocations,omitempty"` 7773 // CustomProperties - Custom properties of the API Management service. Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TripleDes168` will disable the cipher TLS_RSA_WITH_3DES_EDE_CBC_SHA for all TLS(1.0, 1.1 and 1.2). Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls11` can be used to disable just TLS 1.1 and setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls10` can be used to disable TLS 1.0 on an API Management service. 7774 CustomProperties map[string]*string `json:"customProperties"` 7775 // Certificates - List of Certificates that need to be installed in the API Management service. Max supported certificates that can be installed is 10. 7776 Certificates *[]CertificateConfiguration `json:"certificates,omitempty"` 7777 // VirtualNetworkType - The type of VPN in which API Managemet service needs to be configured in. None (Default Value) means the API Management service is not part of any Virtual Network, External means the API Management deployment is set up inside a Virtual Network having an Internet Facing Endpoint, and Internal means that API Management deployment is setup inside a Virtual Network having an Intranet Facing Endpoint only. Possible values include: 'VirtualNetworkTypeNone', 'VirtualNetworkTypeExternal', 'VirtualNetworkTypeInternal' 7778 VirtualNetworkType VirtualNetworkType `json:"virtualNetworkType,omitempty"` 7779} 7780 7781// MarshalJSON is the custom marshaler for ServiceBaseProperties. 7782func (sbp ServiceBaseProperties) MarshalJSON() ([]byte, error) { 7783 objectMap := make(map[string]interface{}) 7784 if sbp.NotificationSenderEmail != nil { 7785 objectMap["notificationSenderEmail"] = sbp.NotificationSenderEmail 7786 } 7787 if sbp.ProvisioningState != nil { 7788 objectMap["provisioningState"] = sbp.ProvisioningState 7789 } 7790 if sbp.TargetProvisioningState != nil { 7791 objectMap["targetProvisioningState"] = sbp.TargetProvisioningState 7792 } 7793 if sbp.CreatedAtUtc != nil { 7794 objectMap["createdAtUtc"] = sbp.CreatedAtUtc 7795 } 7796 if sbp.GatewayURL != nil { 7797 objectMap["gatewayUrl"] = sbp.GatewayURL 7798 } 7799 if sbp.GatewayRegionalURL != nil { 7800 objectMap["gatewayRegionalUrl"] = sbp.GatewayRegionalURL 7801 } 7802 if sbp.PortalURL != nil { 7803 objectMap["portalUrl"] = sbp.PortalURL 7804 } 7805 if sbp.ManagementAPIURL != nil { 7806 objectMap["managementApiUrl"] = sbp.ManagementAPIURL 7807 } 7808 if sbp.ScmURL != nil { 7809 objectMap["scmUrl"] = sbp.ScmURL 7810 } 7811 if sbp.HostnameConfigurations != nil { 7812 objectMap["hostnameConfigurations"] = sbp.HostnameConfigurations 7813 } 7814 if sbp.PublicIPAddresses != nil { 7815 objectMap["publicIPAddresses"] = sbp.PublicIPAddresses 7816 } 7817 if sbp.PrivateIPAddresses != nil { 7818 objectMap["privateIPAddresses"] = sbp.PrivateIPAddresses 7819 } 7820 if sbp.VirtualNetworkConfiguration != nil { 7821 objectMap["virtualNetworkConfiguration"] = sbp.VirtualNetworkConfiguration 7822 } 7823 if sbp.AdditionalLocations != nil { 7824 objectMap["additionalLocations"] = sbp.AdditionalLocations 7825 } 7826 if sbp.CustomProperties != nil { 7827 objectMap["customProperties"] = sbp.CustomProperties 7828 } 7829 if sbp.Certificates != nil { 7830 objectMap["certificates"] = sbp.Certificates 7831 } 7832 if sbp.VirtualNetworkType != "" { 7833 objectMap["virtualNetworkType"] = sbp.VirtualNetworkType 7834 } 7835 return json.Marshal(objectMap) 7836} 7837 7838// ServiceCheckNameAvailabilityParameters parameters supplied to the CheckNameAvailability operation. 7839type ServiceCheckNameAvailabilityParameters struct { 7840 // Name - The name to check for availability. 7841 Name *string `json:"name,omitempty"` 7842} 7843 7844// ServiceCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 7845// operation. 7846type ServiceCreateOrUpdateFuture struct { 7847 azure.Future 7848} 7849 7850// Result returns the result of the asynchronous operation. 7851// If the operation has not completed it will return an error. 7852func (future *ServiceCreateOrUpdateFuture) Result(client ServiceClient) (sr ServiceResource, err error) { 7853 var done bool 7854 done, err = future.Done(client) 7855 if err != nil { 7856 err = autorest.NewErrorWithError(err, "apimanagement.ServiceCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 7857 return 7858 } 7859 if !done { 7860 err = azure.NewAsyncOpIncompleteError("apimanagement.ServiceCreateOrUpdateFuture") 7861 return 7862 } 7863 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 7864 if sr.Response.Response, err = future.GetResult(sender); err == nil && sr.Response.Response.StatusCode != http.StatusNoContent { 7865 sr, err = client.CreateOrUpdateResponder(sr.Response.Response) 7866 if err != nil { 7867 err = autorest.NewErrorWithError(err, "apimanagement.ServiceCreateOrUpdateFuture", "Result", sr.Response.Response, "Failure responding to request") 7868 } 7869 } 7870 return 7871} 7872 7873// ServiceGetSsoTokenResult the response of the GetSsoToken operation. 7874type ServiceGetSsoTokenResult struct { 7875 autorest.Response `json:"-"` 7876 // RedirectURI - Redirect URL to the Publisher Portal containing the SSO token. 7877 RedirectURI *string `json:"redirectUri,omitempty"` 7878} 7879 7880// ServiceIdentity identity properties of the Api Management service resource. 7881type ServiceIdentity struct { 7882 // Type - The identity type. Currently the only supported type is 'SystemAssigned'. 7883 Type *string `json:"type,omitempty"` 7884 // PrincipalID - The principal id of the identity. 7885 PrincipalID *uuid.UUID `json:"principalId,omitempty"` 7886 // TenantID - The client tenant id of the identity. 7887 TenantID *uuid.UUID `json:"tenantId,omitempty"` 7888} 7889 7890// ServiceListResult the response of the List API Management services operation. 7891type ServiceListResult struct { 7892 autorest.Response `json:"-"` 7893 // Value - Result of the List API Management services operation. 7894 Value *[]ServiceResource `json:"value,omitempty"` 7895 // NextLink - Link to the next set of results. Not empty if Value contains incomplete list of API Management services. 7896 NextLink *string `json:"nextLink,omitempty"` 7897} 7898 7899// ServiceListResultIterator provides access to a complete listing of ServiceResource values. 7900type ServiceListResultIterator struct { 7901 i int 7902 page ServiceListResultPage 7903} 7904 7905// Next advances to the next value. If there was an error making 7906// the request the iterator does not advance and the error is returned. 7907func (iter *ServiceListResultIterator) Next() error { 7908 iter.i++ 7909 if iter.i < len(iter.page.Values()) { 7910 return nil 7911 } 7912 err := iter.page.Next() 7913 if err != nil { 7914 iter.i-- 7915 return err 7916 } 7917 iter.i = 0 7918 return nil 7919} 7920 7921// NotDone returns true if the enumeration should be started or is not yet complete. 7922func (iter ServiceListResultIterator) NotDone() bool { 7923 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 7924} 7925 7926// Response returns the raw server response from the last page request. 7927func (iter ServiceListResultIterator) Response() ServiceListResult { 7928 return iter.page.Response() 7929} 7930 7931// Value returns the current value or a zero-initialized value if the 7932// iterator has advanced beyond the end of the collection. 7933func (iter ServiceListResultIterator) Value() ServiceResource { 7934 if !iter.page.NotDone() { 7935 return ServiceResource{} 7936 } 7937 return iter.page.Values()[iter.i] 7938} 7939 7940// IsEmpty returns true if the ListResult contains no values. 7941func (slr ServiceListResult) IsEmpty() bool { 7942 return slr.Value == nil || len(*slr.Value) == 0 7943} 7944 7945// serviceListResultPreparer prepares a request to retrieve the next set of results. 7946// It returns nil if no more results exist. 7947func (slr ServiceListResult) serviceListResultPreparer() (*http.Request, error) { 7948 if slr.NextLink == nil || len(to.String(slr.NextLink)) < 1 { 7949 return nil, nil 7950 } 7951 return autorest.Prepare(&http.Request{}, 7952 autorest.AsJSON(), 7953 autorest.AsGet(), 7954 autorest.WithBaseURL(to.String(slr.NextLink))) 7955} 7956 7957// ServiceListResultPage contains a page of ServiceResource values. 7958type ServiceListResultPage struct { 7959 fn func(ServiceListResult) (ServiceListResult, error) 7960 slr ServiceListResult 7961} 7962 7963// Next advances to the next page of values. If there was an error making 7964// the request the page does not advance and the error is returned. 7965func (page *ServiceListResultPage) Next() error { 7966 next, err := page.fn(page.slr) 7967 if err != nil { 7968 return err 7969 } 7970 page.slr = next 7971 return nil 7972} 7973 7974// NotDone returns true if the page enumeration should be started or is not yet complete. 7975func (page ServiceListResultPage) NotDone() bool { 7976 return !page.slr.IsEmpty() 7977} 7978 7979// Response returns the raw server response from the last page request. 7980func (page ServiceListResultPage) Response() ServiceListResult { 7981 return page.slr 7982} 7983 7984// Values returns the slice of values for the current page or nil if there are no values. 7985func (page ServiceListResultPage) Values() []ServiceResource { 7986 if page.slr.IsEmpty() { 7987 return nil 7988 } 7989 return *page.slr.Value 7990} 7991 7992// ServiceNameAvailabilityResult response of the CheckNameAvailability operation. 7993type ServiceNameAvailabilityResult struct { 7994 autorest.Response `json:"-"` 7995 // NameAvailable - True if the name is available and can be used to create a new API Management service; otherwise false. 7996 NameAvailable *bool `json:"nameAvailable,omitempty"` 7997 // Message - If reason == invalid, provide the user with the reason why the given name is invalid, and provide the resource naming requirements so that the user can select a valid name. If reason == AlreadyExists, explain that <resourceName> is already in use, and direct them to select a different name. 7998 Message *string `json:"message,omitempty"` 7999 // 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' 8000 Reason NameAvailabilityReason `json:"reason,omitempty"` 8001} 8002 8003// ServiceProperties properties of an API Management service resource description. 8004type ServiceProperties struct { 8005 // PublisherEmail - Publisher email. 8006 PublisherEmail *string `json:"publisherEmail,omitempty"` 8007 // PublisherName - Publisher name. 8008 PublisherName *string `json:"publisherName,omitempty"` 8009 // NotificationSenderEmail - Email address from which the notification will be sent. 8010 NotificationSenderEmail *string `json:"notificationSenderEmail,omitempty"` 8011 // ProvisioningState - The current provisioning state of the API Management service which can be one of the following: Created/Activating/Succeeded/Updating/Failed/Stopped/Terminating/TerminationFailed/Deleted. 8012 ProvisioningState *string `json:"provisioningState,omitempty"` 8013 // TargetProvisioningState - The provisioning state of the API Management service, which is targeted by the long running operation started on the service. 8014 TargetProvisioningState *string `json:"targetProvisioningState,omitempty"` 8015 // CreatedAtUtc - Creation UTC date of the API Management service.The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. 8016 CreatedAtUtc *date.Time `json:"createdAtUtc,omitempty"` 8017 // GatewayURL - Gateway URL of the API Management service. 8018 GatewayURL *string `json:"gatewayUrl,omitempty"` 8019 // GatewayRegionalURL - Gateway URL of the API Management service in the Default Region. 8020 GatewayRegionalURL *string `json:"gatewayRegionalUrl,omitempty"` 8021 // PortalURL - Publisher portal endpoint Url of the API Management service. 8022 PortalURL *string `json:"portalUrl,omitempty"` 8023 // ManagementAPIURL - Management API endpoint URL of the API Management service. 8024 ManagementAPIURL *string `json:"managementApiUrl,omitempty"` 8025 // ScmURL - SCM endpoint URL of the API Management service. 8026 ScmURL *string `json:"scmUrl,omitempty"` 8027 // HostnameConfigurations - Custom hostname configuration of the API Management service. 8028 HostnameConfigurations *[]HostnameConfiguration `json:"hostnameConfigurations,omitempty"` 8029 // PublicIPAddresses - Public Static Load Balanced IP addresses of the API Management service in Primary region. Available only for Basic, Standard and Premium SKU. 8030 PublicIPAddresses *[]string `json:"publicIPAddresses,omitempty"` 8031 // PrivateIPAddresses - 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. 8032 PrivateIPAddresses *[]string `json:"privateIPAddresses,omitempty"` 8033 // VirtualNetworkConfiguration - Virtual network configuration of the API Management service. 8034 VirtualNetworkConfiguration *VirtualNetworkConfiguration `json:"virtualNetworkConfiguration,omitempty"` 8035 // AdditionalLocations - Additional datacenter locations of the API Management service. 8036 AdditionalLocations *[]AdditionalLocation `json:"additionalLocations,omitempty"` 8037 // CustomProperties - Custom properties of the API Management service. Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TripleDes168` will disable the cipher TLS_RSA_WITH_3DES_EDE_CBC_SHA for all TLS(1.0, 1.1 and 1.2). Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls11` can be used to disable just TLS 1.1 and setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls10` can be used to disable TLS 1.0 on an API Management service. 8038 CustomProperties map[string]*string `json:"customProperties"` 8039 // Certificates - List of Certificates that need to be installed in the API Management service. Max supported certificates that can be installed is 10. 8040 Certificates *[]CertificateConfiguration `json:"certificates,omitempty"` 8041 // VirtualNetworkType - The type of VPN in which API Managemet service needs to be configured in. None (Default Value) means the API Management service is not part of any Virtual Network, External means the API Management deployment is set up inside a Virtual Network having an Internet Facing Endpoint, and Internal means that API Management deployment is setup inside a Virtual Network having an Intranet Facing Endpoint only. Possible values include: 'VirtualNetworkTypeNone', 'VirtualNetworkTypeExternal', 'VirtualNetworkTypeInternal' 8042 VirtualNetworkType VirtualNetworkType `json:"virtualNetworkType,omitempty"` 8043} 8044 8045// MarshalJSON is the custom marshaler for ServiceProperties. 8046func (sp ServiceProperties) MarshalJSON() ([]byte, error) { 8047 objectMap := make(map[string]interface{}) 8048 if sp.PublisherEmail != nil { 8049 objectMap["publisherEmail"] = sp.PublisherEmail 8050 } 8051 if sp.PublisherName != nil { 8052 objectMap["publisherName"] = sp.PublisherName 8053 } 8054 if sp.NotificationSenderEmail != nil { 8055 objectMap["notificationSenderEmail"] = sp.NotificationSenderEmail 8056 } 8057 if sp.ProvisioningState != nil { 8058 objectMap["provisioningState"] = sp.ProvisioningState 8059 } 8060 if sp.TargetProvisioningState != nil { 8061 objectMap["targetProvisioningState"] = sp.TargetProvisioningState 8062 } 8063 if sp.CreatedAtUtc != nil { 8064 objectMap["createdAtUtc"] = sp.CreatedAtUtc 8065 } 8066 if sp.GatewayURL != nil { 8067 objectMap["gatewayUrl"] = sp.GatewayURL 8068 } 8069 if sp.GatewayRegionalURL != nil { 8070 objectMap["gatewayRegionalUrl"] = sp.GatewayRegionalURL 8071 } 8072 if sp.PortalURL != nil { 8073 objectMap["portalUrl"] = sp.PortalURL 8074 } 8075 if sp.ManagementAPIURL != nil { 8076 objectMap["managementApiUrl"] = sp.ManagementAPIURL 8077 } 8078 if sp.ScmURL != nil { 8079 objectMap["scmUrl"] = sp.ScmURL 8080 } 8081 if sp.HostnameConfigurations != nil { 8082 objectMap["hostnameConfigurations"] = sp.HostnameConfigurations 8083 } 8084 if sp.PublicIPAddresses != nil { 8085 objectMap["publicIPAddresses"] = sp.PublicIPAddresses 8086 } 8087 if sp.PrivateIPAddresses != nil { 8088 objectMap["privateIPAddresses"] = sp.PrivateIPAddresses 8089 } 8090 if sp.VirtualNetworkConfiguration != nil { 8091 objectMap["virtualNetworkConfiguration"] = sp.VirtualNetworkConfiguration 8092 } 8093 if sp.AdditionalLocations != nil { 8094 objectMap["additionalLocations"] = sp.AdditionalLocations 8095 } 8096 if sp.CustomProperties != nil { 8097 objectMap["customProperties"] = sp.CustomProperties 8098 } 8099 if sp.Certificates != nil { 8100 objectMap["certificates"] = sp.Certificates 8101 } 8102 if sp.VirtualNetworkType != "" { 8103 objectMap["virtualNetworkType"] = sp.VirtualNetworkType 8104 } 8105 return json.Marshal(objectMap) 8106} 8107 8108// ServiceResource a single API Management service resource in List or Get response. 8109type ServiceResource struct { 8110 autorest.Response `json:"-"` 8111 // ServiceProperties - Properties of the API Management service. 8112 *ServiceProperties `json:"properties,omitempty"` 8113 // Sku - SKU properties of the API Management service. 8114 Sku *ServiceSkuProperties `json:"sku,omitempty"` 8115 // Identity - Managed service identity of the Api Management service. 8116 Identity *ServiceIdentity `json:"identity,omitempty"` 8117 // Location - Resource location. 8118 Location *string `json:"location,omitempty"` 8119 // Etag - ETag of the resource. 8120 Etag *string `json:"etag,omitempty"` 8121 // ID - Resource ID. 8122 ID *string `json:"id,omitempty"` 8123 // Name - Resource name. 8124 Name *string `json:"name,omitempty"` 8125 // Type - Resource type for API Management resource is set to Microsoft.ApiManagement. 8126 Type *string `json:"type,omitempty"` 8127 // Tags - Resource tags. 8128 Tags map[string]*string `json:"tags"` 8129} 8130 8131// MarshalJSON is the custom marshaler for ServiceResource. 8132func (sr ServiceResource) MarshalJSON() ([]byte, error) { 8133 objectMap := make(map[string]interface{}) 8134 if sr.ServiceProperties != nil { 8135 objectMap["properties"] = sr.ServiceProperties 8136 } 8137 if sr.Sku != nil { 8138 objectMap["sku"] = sr.Sku 8139 } 8140 if sr.Identity != nil { 8141 objectMap["identity"] = sr.Identity 8142 } 8143 if sr.Location != nil { 8144 objectMap["location"] = sr.Location 8145 } 8146 if sr.Etag != nil { 8147 objectMap["etag"] = sr.Etag 8148 } 8149 if sr.ID != nil { 8150 objectMap["id"] = sr.ID 8151 } 8152 if sr.Name != nil { 8153 objectMap["name"] = sr.Name 8154 } 8155 if sr.Type != nil { 8156 objectMap["type"] = sr.Type 8157 } 8158 if sr.Tags != nil { 8159 objectMap["tags"] = sr.Tags 8160 } 8161 return json.Marshal(objectMap) 8162} 8163 8164// UnmarshalJSON is the custom unmarshaler for ServiceResource struct. 8165func (sr *ServiceResource) UnmarshalJSON(body []byte) error { 8166 var m map[string]*json.RawMessage 8167 err := json.Unmarshal(body, &m) 8168 if err != nil { 8169 return err 8170 } 8171 for k, v := range m { 8172 switch k { 8173 case "properties": 8174 if v != nil { 8175 var serviceProperties ServiceProperties 8176 err = json.Unmarshal(*v, &serviceProperties) 8177 if err != nil { 8178 return err 8179 } 8180 sr.ServiceProperties = &serviceProperties 8181 } 8182 case "sku": 8183 if v != nil { 8184 var sku ServiceSkuProperties 8185 err = json.Unmarshal(*v, &sku) 8186 if err != nil { 8187 return err 8188 } 8189 sr.Sku = &sku 8190 } 8191 case "identity": 8192 if v != nil { 8193 var identity ServiceIdentity 8194 err = json.Unmarshal(*v, &identity) 8195 if err != nil { 8196 return err 8197 } 8198 sr.Identity = &identity 8199 } 8200 case "location": 8201 if v != nil { 8202 var location string 8203 err = json.Unmarshal(*v, &location) 8204 if err != nil { 8205 return err 8206 } 8207 sr.Location = &location 8208 } 8209 case "etag": 8210 if v != nil { 8211 var etag string 8212 err = json.Unmarshal(*v, &etag) 8213 if err != nil { 8214 return err 8215 } 8216 sr.Etag = &etag 8217 } 8218 case "id": 8219 if v != nil { 8220 var ID string 8221 err = json.Unmarshal(*v, &ID) 8222 if err != nil { 8223 return err 8224 } 8225 sr.ID = &ID 8226 } 8227 case "name": 8228 if v != nil { 8229 var name string 8230 err = json.Unmarshal(*v, &name) 8231 if err != nil { 8232 return err 8233 } 8234 sr.Name = &name 8235 } 8236 case "type": 8237 if v != nil { 8238 var typeVar string 8239 err = json.Unmarshal(*v, &typeVar) 8240 if err != nil { 8241 return err 8242 } 8243 sr.Type = &typeVar 8244 } 8245 case "tags": 8246 if v != nil { 8247 var tags map[string]*string 8248 err = json.Unmarshal(*v, &tags) 8249 if err != nil { 8250 return err 8251 } 8252 sr.Tags = tags 8253 } 8254 } 8255 } 8256 8257 return nil 8258} 8259 8260// ServiceRestoreFuture an abstraction for monitoring and retrieving the results of a long-running operation. 8261type ServiceRestoreFuture struct { 8262 azure.Future 8263} 8264 8265// Result returns the result of the asynchronous operation. 8266// If the operation has not completed it will return an error. 8267func (future *ServiceRestoreFuture) Result(client ServiceClient) (sr ServiceResource, err error) { 8268 var done bool 8269 done, err = future.Done(client) 8270 if err != nil { 8271 err = autorest.NewErrorWithError(err, "apimanagement.ServiceRestoreFuture", "Result", future.Response(), "Polling failure") 8272 return 8273 } 8274 if !done { 8275 err = azure.NewAsyncOpIncompleteError("apimanagement.ServiceRestoreFuture") 8276 return 8277 } 8278 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 8279 if sr.Response.Response, err = future.GetResult(sender); err == nil && sr.Response.Response.StatusCode != http.StatusNoContent { 8280 sr, err = client.RestoreResponder(sr.Response.Response) 8281 if err != nil { 8282 err = autorest.NewErrorWithError(err, "apimanagement.ServiceRestoreFuture", "Result", sr.Response.Response, "Failure responding to request") 8283 } 8284 } 8285 return 8286} 8287 8288// ServiceSkuProperties API Management service resource SKU properties. 8289type ServiceSkuProperties struct { 8290 // Name - Name of the Sku. Possible values include: 'SkuTypeDeveloper', 'SkuTypeStandard', 'SkuTypePremium', 'SkuTypeBasic' 8291 Name SkuType `json:"name,omitempty"` 8292 // Capacity - Capacity of the SKU (number of deployed units of the SKU). The default value is 1. 8293 Capacity *int32 `json:"capacity,omitempty"` 8294} 8295 8296// ServiceUpdateFuture an abstraction for monitoring and retrieving the results of a long-running operation. 8297type ServiceUpdateFuture struct { 8298 azure.Future 8299} 8300 8301// Result returns the result of the asynchronous operation. 8302// If the operation has not completed it will return an error. 8303func (future *ServiceUpdateFuture) Result(client ServiceClient) (sr ServiceResource, err error) { 8304 var done bool 8305 done, err = future.Done(client) 8306 if err != nil { 8307 err = autorest.NewErrorWithError(err, "apimanagement.ServiceUpdateFuture", "Result", future.Response(), "Polling failure") 8308 return 8309 } 8310 if !done { 8311 err = azure.NewAsyncOpIncompleteError("apimanagement.ServiceUpdateFuture") 8312 return 8313 } 8314 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 8315 if sr.Response.Response, err = future.GetResult(sender); err == nil && sr.Response.Response.StatusCode != http.StatusNoContent { 8316 sr, err = client.UpdateResponder(sr.Response.Response) 8317 if err != nil { 8318 err = autorest.NewErrorWithError(err, "apimanagement.ServiceUpdateFuture", "Result", sr.Response.Response, "Failure responding to request") 8319 } 8320 } 8321 return 8322} 8323 8324// ServiceUpdateHostnameFuture an abstraction for monitoring and retrieving the results of a long-running 8325// operation. 8326type ServiceUpdateHostnameFuture struct { 8327 azure.Future 8328} 8329 8330// Result returns the result of the asynchronous operation. 8331// If the operation has not completed it will return an error. 8332func (future *ServiceUpdateHostnameFuture) Result(client ServiceClient) (sr ServiceResource, err error) { 8333 var done bool 8334 done, err = future.Done(client) 8335 if err != nil { 8336 err = autorest.NewErrorWithError(err, "apimanagement.ServiceUpdateHostnameFuture", "Result", future.Response(), "Polling failure") 8337 return 8338 } 8339 if !done { 8340 err = azure.NewAsyncOpIncompleteError("apimanagement.ServiceUpdateHostnameFuture") 8341 return 8342 } 8343 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 8344 if sr.Response.Response, err = future.GetResult(sender); err == nil && sr.Response.Response.StatusCode != http.StatusNoContent { 8345 sr, err = client.UpdateHostnameResponder(sr.Response.Response) 8346 if err != nil { 8347 err = autorest.NewErrorWithError(err, "apimanagement.ServiceUpdateHostnameFuture", "Result", sr.Response.Response, "Failure responding to request") 8348 } 8349 } 8350 return 8351} 8352 8353// ServiceUpdateHostnameParameters parameters supplied to the UpdateHostname operation. 8354type ServiceUpdateHostnameParameters struct { 8355 // Update - Hostnames to create or update. 8356 Update *[]HostnameConfigurationOld `json:"update,omitempty"` 8357 // Delete - Hostnames types to delete. 8358 Delete *[]HostnameType `json:"delete,omitempty"` 8359} 8360 8361// ServiceUpdateParameters parameter supplied to Update Api Management Service. 8362type ServiceUpdateParameters struct { 8363 // ServiceUpdateProperties - Properties of the API Management service. 8364 *ServiceUpdateProperties `json:"properties,omitempty"` 8365 // Sku - SKU properties of the API Management service. 8366 Sku *ServiceSkuProperties `json:"sku,omitempty"` 8367 // Identity - Managed service identity of the Api Management service. 8368 Identity *ServiceIdentity `json:"identity,omitempty"` 8369 // Etag - ETag of the resource. 8370 Etag *string `json:"etag,omitempty"` 8371 // ID - Resource ID. 8372 ID *string `json:"id,omitempty"` 8373 // Name - Resource name. 8374 Name *string `json:"name,omitempty"` 8375 // Type - Resource type for API Management resource is set to Microsoft.ApiManagement. 8376 Type *string `json:"type,omitempty"` 8377 // Tags - Resource tags. 8378 Tags map[string]*string `json:"tags"` 8379} 8380 8381// MarshalJSON is the custom marshaler for ServiceUpdateParameters. 8382func (sup ServiceUpdateParameters) MarshalJSON() ([]byte, error) { 8383 objectMap := make(map[string]interface{}) 8384 if sup.ServiceUpdateProperties != nil { 8385 objectMap["properties"] = sup.ServiceUpdateProperties 8386 } 8387 if sup.Sku != nil { 8388 objectMap["sku"] = sup.Sku 8389 } 8390 if sup.Identity != nil { 8391 objectMap["identity"] = sup.Identity 8392 } 8393 if sup.Etag != nil { 8394 objectMap["etag"] = sup.Etag 8395 } 8396 if sup.ID != nil { 8397 objectMap["id"] = sup.ID 8398 } 8399 if sup.Name != nil { 8400 objectMap["name"] = sup.Name 8401 } 8402 if sup.Type != nil { 8403 objectMap["type"] = sup.Type 8404 } 8405 if sup.Tags != nil { 8406 objectMap["tags"] = sup.Tags 8407 } 8408 return json.Marshal(objectMap) 8409} 8410 8411// UnmarshalJSON is the custom unmarshaler for ServiceUpdateParameters struct. 8412func (sup *ServiceUpdateParameters) UnmarshalJSON(body []byte) error { 8413 var m map[string]*json.RawMessage 8414 err := json.Unmarshal(body, &m) 8415 if err != nil { 8416 return err 8417 } 8418 for k, v := range m { 8419 switch k { 8420 case "properties": 8421 if v != nil { 8422 var serviceUpdateProperties ServiceUpdateProperties 8423 err = json.Unmarshal(*v, &serviceUpdateProperties) 8424 if err != nil { 8425 return err 8426 } 8427 sup.ServiceUpdateProperties = &serviceUpdateProperties 8428 } 8429 case "sku": 8430 if v != nil { 8431 var sku ServiceSkuProperties 8432 err = json.Unmarshal(*v, &sku) 8433 if err != nil { 8434 return err 8435 } 8436 sup.Sku = &sku 8437 } 8438 case "identity": 8439 if v != nil { 8440 var identity ServiceIdentity 8441 err = json.Unmarshal(*v, &identity) 8442 if err != nil { 8443 return err 8444 } 8445 sup.Identity = &identity 8446 } 8447 case "etag": 8448 if v != nil { 8449 var etag string 8450 err = json.Unmarshal(*v, &etag) 8451 if err != nil { 8452 return err 8453 } 8454 sup.Etag = &etag 8455 } 8456 case "id": 8457 if v != nil { 8458 var ID string 8459 err = json.Unmarshal(*v, &ID) 8460 if err != nil { 8461 return err 8462 } 8463 sup.ID = &ID 8464 } 8465 case "name": 8466 if v != nil { 8467 var name string 8468 err = json.Unmarshal(*v, &name) 8469 if err != nil { 8470 return err 8471 } 8472 sup.Name = &name 8473 } 8474 case "type": 8475 if v != nil { 8476 var typeVar string 8477 err = json.Unmarshal(*v, &typeVar) 8478 if err != nil { 8479 return err 8480 } 8481 sup.Type = &typeVar 8482 } 8483 case "tags": 8484 if v != nil { 8485 var tags map[string]*string 8486 err = json.Unmarshal(*v, &tags) 8487 if err != nil { 8488 return err 8489 } 8490 sup.Tags = tags 8491 } 8492 } 8493 } 8494 8495 return nil 8496} 8497 8498// ServiceUpdateProperties properties of an API Management service resource description. 8499type ServiceUpdateProperties struct { 8500 // PublisherEmail - Publisher email. 8501 PublisherEmail *string `json:"publisherEmail,omitempty"` 8502 // PublisherName - Publisher name. 8503 PublisherName *string `json:"publisherName,omitempty"` 8504 // NotificationSenderEmail - Email address from which the notification will be sent. 8505 NotificationSenderEmail *string `json:"notificationSenderEmail,omitempty"` 8506 // ProvisioningState - The current provisioning state of the API Management service which can be one of the following: Created/Activating/Succeeded/Updating/Failed/Stopped/Terminating/TerminationFailed/Deleted. 8507 ProvisioningState *string `json:"provisioningState,omitempty"` 8508 // TargetProvisioningState - The provisioning state of the API Management service, which is targeted by the long running operation started on the service. 8509 TargetProvisioningState *string `json:"targetProvisioningState,omitempty"` 8510 // CreatedAtUtc - Creation UTC date of the API Management service.The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. 8511 CreatedAtUtc *date.Time `json:"createdAtUtc,omitempty"` 8512 // GatewayURL - Gateway URL of the API Management service. 8513 GatewayURL *string `json:"gatewayUrl,omitempty"` 8514 // GatewayRegionalURL - Gateway URL of the API Management service in the Default Region. 8515 GatewayRegionalURL *string `json:"gatewayRegionalUrl,omitempty"` 8516 // PortalURL - Publisher portal endpoint Url of the API Management service. 8517 PortalURL *string `json:"portalUrl,omitempty"` 8518 // ManagementAPIURL - Management API endpoint URL of the API Management service. 8519 ManagementAPIURL *string `json:"managementApiUrl,omitempty"` 8520 // ScmURL - SCM endpoint URL of the API Management service. 8521 ScmURL *string `json:"scmUrl,omitempty"` 8522 // HostnameConfigurations - Custom hostname configuration of the API Management service. 8523 HostnameConfigurations *[]HostnameConfiguration `json:"hostnameConfigurations,omitempty"` 8524 // PublicIPAddresses - Public Static Load Balanced IP addresses of the API Management service in Primary region. Available only for Basic, Standard and Premium SKU. 8525 PublicIPAddresses *[]string `json:"publicIPAddresses,omitempty"` 8526 // PrivateIPAddresses - 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. 8527 PrivateIPAddresses *[]string `json:"privateIPAddresses,omitempty"` 8528 // VirtualNetworkConfiguration - Virtual network configuration of the API Management service. 8529 VirtualNetworkConfiguration *VirtualNetworkConfiguration `json:"virtualNetworkConfiguration,omitempty"` 8530 // AdditionalLocations - Additional datacenter locations of the API Management service. 8531 AdditionalLocations *[]AdditionalLocation `json:"additionalLocations,omitempty"` 8532 // CustomProperties - Custom properties of the API Management service. Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TripleDes168` will disable the cipher TLS_RSA_WITH_3DES_EDE_CBC_SHA for all TLS(1.0, 1.1 and 1.2). Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls11` can be used to disable just TLS 1.1 and setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls10` can be used to disable TLS 1.0 on an API Management service. 8533 CustomProperties map[string]*string `json:"customProperties"` 8534 // Certificates - List of Certificates that need to be installed in the API Management service. Max supported certificates that can be installed is 10. 8535 Certificates *[]CertificateConfiguration `json:"certificates,omitempty"` 8536 // VirtualNetworkType - The type of VPN in which API Managemet service needs to be configured in. None (Default Value) means the API Management service is not part of any Virtual Network, External means the API Management deployment is set up inside a Virtual Network having an Internet Facing Endpoint, and Internal means that API Management deployment is setup inside a Virtual Network having an Intranet Facing Endpoint only. Possible values include: 'VirtualNetworkTypeNone', 'VirtualNetworkTypeExternal', 'VirtualNetworkTypeInternal' 8537 VirtualNetworkType VirtualNetworkType `json:"virtualNetworkType,omitempty"` 8538} 8539 8540// MarshalJSON is the custom marshaler for ServiceUpdateProperties. 8541func (sup ServiceUpdateProperties) MarshalJSON() ([]byte, error) { 8542 objectMap := make(map[string]interface{}) 8543 if sup.PublisherEmail != nil { 8544 objectMap["publisherEmail"] = sup.PublisherEmail 8545 } 8546 if sup.PublisherName != nil { 8547 objectMap["publisherName"] = sup.PublisherName 8548 } 8549 if sup.NotificationSenderEmail != nil { 8550 objectMap["notificationSenderEmail"] = sup.NotificationSenderEmail 8551 } 8552 if sup.ProvisioningState != nil { 8553 objectMap["provisioningState"] = sup.ProvisioningState 8554 } 8555 if sup.TargetProvisioningState != nil { 8556 objectMap["targetProvisioningState"] = sup.TargetProvisioningState 8557 } 8558 if sup.CreatedAtUtc != nil { 8559 objectMap["createdAtUtc"] = sup.CreatedAtUtc 8560 } 8561 if sup.GatewayURL != nil { 8562 objectMap["gatewayUrl"] = sup.GatewayURL 8563 } 8564 if sup.GatewayRegionalURL != nil { 8565 objectMap["gatewayRegionalUrl"] = sup.GatewayRegionalURL 8566 } 8567 if sup.PortalURL != nil { 8568 objectMap["portalUrl"] = sup.PortalURL 8569 } 8570 if sup.ManagementAPIURL != nil { 8571 objectMap["managementApiUrl"] = sup.ManagementAPIURL 8572 } 8573 if sup.ScmURL != nil { 8574 objectMap["scmUrl"] = sup.ScmURL 8575 } 8576 if sup.HostnameConfigurations != nil { 8577 objectMap["hostnameConfigurations"] = sup.HostnameConfigurations 8578 } 8579 if sup.PublicIPAddresses != nil { 8580 objectMap["publicIPAddresses"] = sup.PublicIPAddresses 8581 } 8582 if sup.PrivateIPAddresses != nil { 8583 objectMap["privateIPAddresses"] = sup.PrivateIPAddresses 8584 } 8585 if sup.VirtualNetworkConfiguration != nil { 8586 objectMap["virtualNetworkConfiguration"] = sup.VirtualNetworkConfiguration 8587 } 8588 if sup.AdditionalLocations != nil { 8589 objectMap["additionalLocations"] = sup.AdditionalLocations 8590 } 8591 if sup.CustomProperties != nil { 8592 objectMap["customProperties"] = sup.CustomProperties 8593 } 8594 if sup.Certificates != nil { 8595 objectMap["certificates"] = sup.Certificates 8596 } 8597 if sup.VirtualNetworkType != "" { 8598 objectMap["virtualNetworkType"] = sup.VirtualNetworkType 8599 } 8600 return json.Marshal(objectMap) 8601} 8602 8603// ServiceUploadCertificateParameters parameters supplied to the Upload SSL certificate for an API Management 8604// service operation. 8605type ServiceUploadCertificateParameters struct { 8606 // Type - Hostname type. Possible values include: 'Proxy', 'Portal', 'Management', 'Scm' 8607 Type HostnameType `json:"type,omitempty"` 8608 // Certificate - Base64 Encoded certificate. 8609 Certificate *string `json:"certificate,omitempty"` 8610 // CertificatePassword - Certificate password. 8611 CertificatePassword *string `json:"certificate_password,omitempty"` 8612} 8613 8614// SubscriptionCollection paged Subscriptions list representation. 8615type SubscriptionCollection struct { 8616 autorest.Response `json:"-"` 8617 // Value - Page values. 8618 Value *[]SubscriptionContract `json:"value,omitempty"` 8619 // NextLink - Next page link if any. 8620 NextLink *string `json:"nextLink,omitempty"` 8621} 8622 8623// SubscriptionCollectionIterator provides access to a complete listing of SubscriptionContract values. 8624type SubscriptionCollectionIterator struct { 8625 i int 8626 page SubscriptionCollectionPage 8627} 8628 8629// Next advances to the next value. If there was an error making 8630// the request the iterator does not advance and the error is returned. 8631func (iter *SubscriptionCollectionIterator) Next() error { 8632 iter.i++ 8633 if iter.i < len(iter.page.Values()) { 8634 return nil 8635 } 8636 err := iter.page.Next() 8637 if err != nil { 8638 iter.i-- 8639 return err 8640 } 8641 iter.i = 0 8642 return nil 8643} 8644 8645// NotDone returns true if the enumeration should be started or is not yet complete. 8646func (iter SubscriptionCollectionIterator) NotDone() bool { 8647 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 8648} 8649 8650// Response returns the raw server response from the last page request. 8651func (iter SubscriptionCollectionIterator) Response() SubscriptionCollection { 8652 return iter.page.Response() 8653} 8654 8655// Value returns the current value or a zero-initialized value if the 8656// iterator has advanced beyond the end of the collection. 8657func (iter SubscriptionCollectionIterator) Value() SubscriptionContract { 8658 if !iter.page.NotDone() { 8659 return SubscriptionContract{} 8660 } 8661 return iter.page.Values()[iter.i] 8662} 8663 8664// IsEmpty returns true if the ListResult contains no values. 8665func (sc SubscriptionCollection) IsEmpty() bool { 8666 return sc.Value == nil || len(*sc.Value) == 0 8667} 8668 8669// subscriptionCollectionPreparer prepares a request to retrieve the next set of results. 8670// It returns nil if no more results exist. 8671func (sc SubscriptionCollection) subscriptionCollectionPreparer() (*http.Request, error) { 8672 if sc.NextLink == nil || len(to.String(sc.NextLink)) < 1 { 8673 return nil, nil 8674 } 8675 return autorest.Prepare(&http.Request{}, 8676 autorest.AsJSON(), 8677 autorest.AsGet(), 8678 autorest.WithBaseURL(to.String(sc.NextLink))) 8679} 8680 8681// SubscriptionCollectionPage contains a page of SubscriptionContract values. 8682type SubscriptionCollectionPage struct { 8683 fn func(SubscriptionCollection) (SubscriptionCollection, error) 8684 sc SubscriptionCollection 8685} 8686 8687// Next advances to the next page of values. If there was an error making 8688// the request the page does not advance and the error is returned. 8689func (page *SubscriptionCollectionPage) Next() error { 8690 next, err := page.fn(page.sc) 8691 if err != nil { 8692 return err 8693 } 8694 page.sc = next 8695 return nil 8696} 8697 8698// NotDone returns true if the page enumeration should be started or is not yet complete. 8699func (page SubscriptionCollectionPage) NotDone() bool { 8700 return !page.sc.IsEmpty() 8701} 8702 8703// Response returns the raw server response from the last page request. 8704func (page SubscriptionCollectionPage) Response() SubscriptionCollection { 8705 return page.sc 8706} 8707 8708// Values returns the slice of values for the current page or nil if there are no values. 8709func (page SubscriptionCollectionPage) Values() []SubscriptionContract { 8710 if page.sc.IsEmpty() { 8711 return nil 8712 } 8713 return *page.sc.Value 8714} 8715 8716// SubscriptionContract subscription details. 8717type SubscriptionContract struct { 8718 autorest.Response `json:"-"` 8719 // SubscriptionContractProperties - Subscription contract properties. 8720 *SubscriptionContractProperties `json:"properties,omitempty"` 8721 // ID - Resource ID. 8722 ID *string `json:"id,omitempty"` 8723 // Name - Resource name. 8724 Name *string `json:"name,omitempty"` 8725 // Type - Resource type for API Management resource. 8726 Type *string `json:"type,omitempty"` 8727} 8728 8729// MarshalJSON is the custom marshaler for SubscriptionContract. 8730func (sc SubscriptionContract) MarshalJSON() ([]byte, error) { 8731 objectMap := make(map[string]interface{}) 8732 if sc.SubscriptionContractProperties != nil { 8733 objectMap["properties"] = sc.SubscriptionContractProperties 8734 } 8735 if sc.ID != nil { 8736 objectMap["id"] = sc.ID 8737 } 8738 if sc.Name != nil { 8739 objectMap["name"] = sc.Name 8740 } 8741 if sc.Type != nil { 8742 objectMap["type"] = sc.Type 8743 } 8744 return json.Marshal(objectMap) 8745} 8746 8747// UnmarshalJSON is the custom unmarshaler for SubscriptionContract struct. 8748func (sc *SubscriptionContract) UnmarshalJSON(body []byte) error { 8749 var m map[string]*json.RawMessage 8750 err := json.Unmarshal(body, &m) 8751 if err != nil { 8752 return err 8753 } 8754 for k, v := range m { 8755 switch k { 8756 case "properties": 8757 if v != nil { 8758 var subscriptionContractProperties SubscriptionContractProperties 8759 err = json.Unmarshal(*v, &subscriptionContractProperties) 8760 if err != nil { 8761 return err 8762 } 8763 sc.SubscriptionContractProperties = &subscriptionContractProperties 8764 } 8765 case "id": 8766 if v != nil { 8767 var ID string 8768 err = json.Unmarshal(*v, &ID) 8769 if err != nil { 8770 return err 8771 } 8772 sc.ID = &ID 8773 } 8774 case "name": 8775 if v != nil { 8776 var name string 8777 err = json.Unmarshal(*v, &name) 8778 if err != nil { 8779 return err 8780 } 8781 sc.Name = &name 8782 } 8783 case "type": 8784 if v != nil { 8785 var typeVar string 8786 err = json.Unmarshal(*v, &typeVar) 8787 if err != nil { 8788 return err 8789 } 8790 sc.Type = &typeVar 8791 } 8792 } 8793 } 8794 8795 return nil 8796} 8797 8798// SubscriptionContractProperties subscription details. 8799type SubscriptionContractProperties struct { 8800 // UserID - The user resource identifier of the subscription owner. The value is a valid relative URL in the format of /users/{uid} where {uid} is a user identifier. 8801 UserID *string `json:"userId,omitempty"` 8802 // ProductID - The product resource identifier of the subscribed product. The value is a valid relative URL in the format of /products/{productId} where {productId} is a product identifier. 8803 ProductID *string `json:"productId,omitempty"` 8804 // DisplayName - The name of the subscription, or null if the subscription has no name. 8805 DisplayName *string `json:"displayName,omitempty"` 8806 // 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' 8807 State SubscriptionState `json:"state,omitempty"` 8808 // CreatedDate - Subscription creation date. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. 8809 CreatedDate *date.Time `json:"createdDate,omitempty"` 8810 // 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. 8811 StartDate *date.Time `json:"startDate,omitempty"` 8812 // 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. 8813 ExpirationDate *date.Time `json:"expirationDate,omitempty"` 8814 // 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. 8815 EndDate *date.Time `json:"endDate,omitempty"` 8816 // 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. 8817 NotificationDate *date.Time `json:"notificationDate,omitempty"` 8818 // PrimaryKey - Subscription primary key. 8819 PrimaryKey *string `json:"primaryKey,omitempty"` 8820 // SecondaryKey - Subscription secondary key. 8821 SecondaryKey *string `json:"secondaryKey,omitempty"` 8822 // StateComment - Optional subscription comment added by an administrator. 8823 StateComment *string `json:"stateComment,omitempty"` 8824} 8825 8826// SubscriptionCreateParameterProperties parameters supplied to the Create subscription operation. 8827type SubscriptionCreateParameterProperties struct { 8828 // UserID - User (user id path) for whom subscription is being created in form /users/{uid} 8829 UserID *string `json:"userId,omitempty"` 8830 // ProductID - Product (product id path) for which subscription is being created in form /products/{productid} 8831 ProductID *string `json:"productId,omitempty"` 8832 // DisplayName - Subscription name. 8833 DisplayName *string `json:"displayName,omitempty"` 8834 // PrimaryKey - Primary subscription key. If not specified during request key will be generated automatically. 8835 PrimaryKey *string `json:"primaryKey,omitempty"` 8836 // SecondaryKey - Secondary subscription key. If not specified during request key will be generated automatically. 8837 SecondaryKey *string `json:"secondaryKey,omitempty"` 8838 // 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' 8839 State SubscriptionState `json:"state,omitempty"` 8840} 8841 8842// SubscriptionCreateParameters subscription create details. 8843type SubscriptionCreateParameters struct { 8844 // SubscriptionCreateParameterProperties - Subscription contract properties. 8845 *SubscriptionCreateParameterProperties `json:"properties,omitempty"` 8846} 8847 8848// MarshalJSON is the custom marshaler for SubscriptionCreateParameters. 8849func (scp SubscriptionCreateParameters) MarshalJSON() ([]byte, error) { 8850 objectMap := make(map[string]interface{}) 8851 if scp.SubscriptionCreateParameterProperties != nil { 8852 objectMap["properties"] = scp.SubscriptionCreateParameterProperties 8853 } 8854 return json.Marshal(objectMap) 8855} 8856 8857// UnmarshalJSON is the custom unmarshaler for SubscriptionCreateParameters struct. 8858func (scp *SubscriptionCreateParameters) UnmarshalJSON(body []byte) error { 8859 var m map[string]*json.RawMessage 8860 err := json.Unmarshal(body, &m) 8861 if err != nil { 8862 return err 8863 } 8864 for k, v := range m { 8865 switch k { 8866 case "properties": 8867 if v != nil { 8868 var subscriptionCreateParameterProperties SubscriptionCreateParameterProperties 8869 err = json.Unmarshal(*v, &subscriptionCreateParameterProperties) 8870 if err != nil { 8871 return err 8872 } 8873 scp.SubscriptionCreateParameterProperties = &subscriptionCreateParameterProperties 8874 } 8875 } 8876 } 8877 8878 return nil 8879} 8880 8881// SubscriptionKeyParameterNamesContract subscription key parameter names details. 8882type SubscriptionKeyParameterNamesContract struct { 8883 // Header - Subscription key header name. 8884 Header *string `json:"header,omitempty"` 8885 // Query - Subscription key query string parameter name. 8886 Query *string `json:"query,omitempty"` 8887} 8888 8889// SubscriptionsDelegationSettingsProperties subscriptions delegation settings properties. 8890type SubscriptionsDelegationSettingsProperties struct { 8891 // Enabled - Enable or disable delegation for subscriptions. 8892 Enabled *bool `json:"enabled,omitempty"` 8893} 8894 8895// SubscriptionUpdateParameterProperties parameters supplied to the Update subscription operation. 8896type SubscriptionUpdateParameterProperties struct { 8897 // UserID - User identifier path: /users/{uid} 8898 UserID *string `json:"userId,omitempty"` 8899 // ProductID - Product identifier path: /products/{productId} 8900 ProductID *string `json:"productId,omitempty"` 8901 // 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. 8902 ExpirationDate *date.Time `json:"expirationDate,omitempty"` 8903 // DisplayName - Subscription name. 8904 DisplayName *string `json:"displayName,omitempty"` 8905 // PrimaryKey - Primary subscription key. 8906 PrimaryKey *string `json:"primaryKey,omitempty"` 8907 // SecondaryKey - Secondary subscription key. 8908 SecondaryKey *string `json:"secondaryKey,omitempty"` 8909 // 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' 8910 State SubscriptionState `json:"state,omitempty"` 8911 // StateComment - Comments describing subscription state change by the administrator. 8912 StateComment *string `json:"stateComment,omitempty"` 8913} 8914 8915// SubscriptionUpdateParameters subscription update details. 8916type SubscriptionUpdateParameters struct { 8917 // SubscriptionUpdateParameterProperties - Subscription Update contract properties. 8918 *SubscriptionUpdateParameterProperties `json:"properties,omitempty"` 8919} 8920 8921// MarshalJSON is the custom marshaler for SubscriptionUpdateParameters. 8922func (sup SubscriptionUpdateParameters) MarshalJSON() ([]byte, error) { 8923 objectMap := make(map[string]interface{}) 8924 if sup.SubscriptionUpdateParameterProperties != nil { 8925 objectMap["properties"] = sup.SubscriptionUpdateParameterProperties 8926 } 8927 return json.Marshal(objectMap) 8928} 8929 8930// UnmarshalJSON is the custom unmarshaler for SubscriptionUpdateParameters struct. 8931func (sup *SubscriptionUpdateParameters) UnmarshalJSON(body []byte) error { 8932 var m map[string]*json.RawMessage 8933 err := json.Unmarshal(body, &m) 8934 if err != nil { 8935 return err 8936 } 8937 for k, v := range m { 8938 switch k { 8939 case "properties": 8940 if v != nil { 8941 var subscriptionUpdateParameterProperties SubscriptionUpdateParameterProperties 8942 err = json.Unmarshal(*v, &subscriptionUpdateParameterProperties) 8943 if err != nil { 8944 return err 8945 } 8946 sup.SubscriptionUpdateParameterProperties = &subscriptionUpdateParameterProperties 8947 } 8948 } 8949 } 8950 8951 return nil 8952} 8953 8954// TagCollection paged Tag list representation. 8955type TagCollection struct { 8956 autorest.Response `json:"-"` 8957 // Value - Page values. 8958 Value *[]TagContract `json:"value,omitempty"` 8959 // NextLink - Next page link if any. 8960 NextLink *string `json:"nextLink,omitempty"` 8961} 8962 8963// TagCollectionIterator provides access to a complete listing of TagContract values. 8964type TagCollectionIterator struct { 8965 i int 8966 page TagCollectionPage 8967} 8968 8969// Next advances to the next value. If there was an error making 8970// the request the iterator does not advance and the error is returned. 8971func (iter *TagCollectionIterator) Next() error { 8972 iter.i++ 8973 if iter.i < len(iter.page.Values()) { 8974 return nil 8975 } 8976 err := iter.page.Next() 8977 if err != nil { 8978 iter.i-- 8979 return err 8980 } 8981 iter.i = 0 8982 return nil 8983} 8984 8985// NotDone returns true if the enumeration should be started or is not yet complete. 8986func (iter TagCollectionIterator) NotDone() bool { 8987 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 8988} 8989 8990// Response returns the raw server response from the last page request. 8991func (iter TagCollectionIterator) Response() TagCollection { 8992 return iter.page.Response() 8993} 8994 8995// Value returns the current value or a zero-initialized value if the 8996// iterator has advanced beyond the end of the collection. 8997func (iter TagCollectionIterator) Value() TagContract { 8998 if !iter.page.NotDone() { 8999 return TagContract{} 9000 } 9001 return iter.page.Values()[iter.i] 9002} 9003 9004// IsEmpty returns true if the ListResult contains no values. 9005func (tc TagCollection) IsEmpty() bool { 9006 return tc.Value == nil || len(*tc.Value) == 0 9007} 9008 9009// tagCollectionPreparer prepares a request to retrieve the next set of results. 9010// It returns nil if no more results exist. 9011func (tc TagCollection) tagCollectionPreparer() (*http.Request, error) { 9012 if tc.NextLink == nil || len(to.String(tc.NextLink)) < 1 { 9013 return nil, nil 9014 } 9015 return autorest.Prepare(&http.Request{}, 9016 autorest.AsJSON(), 9017 autorest.AsGet(), 9018 autorest.WithBaseURL(to.String(tc.NextLink))) 9019} 9020 9021// TagCollectionPage contains a page of TagContract values. 9022type TagCollectionPage struct { 9023 fn func(TagCollection) (TagCollection, error) 9024 tc TagCollection 9025} 9026 9027// Next advances to the next page of values. If there was an error making 9028// the request the page does not advance and the error is returned. 9029func (page *TagCollectionPage) Next() error { 9030 next, err := page.fn(page.tc) 9031 if err != nil { 9032 return err 9033 } 9034 page.tc = next 9035 return nil 9036} 9037 9038// NotDone returns true if the page enumeration should be started or is not yet complete. 9039func (page TagCollectionPage) NotDone() bool { 9040 return !page.tc.IsEmpty() 9041} 9042 9043// Response returns the raw server response from the last page request. 9044func (page TagCollectionPage) Response() TagCollection { 9045 return page.tc 9046} 9047 9048// Values returns the slice of values for the current page or nil if there are no values. 9049func (page TagCollectionPage) Values() []TagContract { 9050 if page.tc.IsEmpty() { 9051 return nil 9052 } 9053 return *page.tc.Value 9054} 9055 9056// TagContract tag Contract details. 9057type TagContract struct { 9058 autorest.Response `json:"-"` 9059 // TagContractProperties - Tag entity contract properties. 9060 *TagContractProperties `json:"properties,omitempty"` 9061 // ID - Resource ID. 9062 ID *string `json:"id,omitempty"` 9063 // Name - Resource name. 9064 Name *string `json:"name,omitempty"` 9065 // Type - Resource type for API Management resource. 9066 Type *string `json:"type,omitempty"` 9067} 9068 9069// MarshalJSON is the custom marshaler for TagContract. 9070func (tc TagContract) MarshalJSON() ([]byte, error) { 9071 objectMap := make(map[string]interface{}) 9072 if tc.TagContractProperties != nil { 9073 objectMap["properties"] = tc.TagContractProperties 9074 } 9075 if tc.ID != nil { 9076 objectMap["id"] = tc.ID 9077 } 9078 if tc.Name != nil { 9079 objectMap["name"] = tc.Name 9080 } 9081 if tc.Type != nil { 9082 objectMap["type"] = tc.Type 9083 } 9084 return json.Marshal(objectMap) 9085} 9086 9087// UnmarshalJSON is the custom unmarshaler for TagContract struct. 9088func (tc *TagContract) UnmarshalJSON(body []byte) error { 9089 var m map[string]*json.RawMessage 9090 err := json.Unmarshal(body, &m) 9091 if err != nil { 9092 return err 9093 } 9094 for k, v := range m { 9095 switch k { 9096 case "properties": 9097 if v != nil { 9098 var tagContractProperties TagContractProperties 9099 err = json.Unmarshal(*v, &tagContractProperties) 9100 if err != nil { 9101 return err 9102 } 9103 tc.TagContractProperties = &tagContractProperties 9104 } 9105 case "id": 9106 if v != nil { 9107 var ID string 9108 err = json.Unmarshal(*v, &ID) 9109 if err != nil { 9110 return err 9111 } 9112 tc.ID = &ID 9113 } 9114 case "name": 9115 if v != nil { 9116 var name string 9117 err = json.Unmarshal(*v, &name) 9118 if err != nil { 9119 return err 9120 } 9121 tc.Name = &name 9122 } 9123 case "type": 9124 if v != nil { 9125 var typeVar string 9126 err = json.Unmarshal(*v, &typeVar) 9127 if err != nil { 9128 return err 9129 } 9130 tc.Type = &typeVar 9131 } 9132 } 9133 } 9134 9135 return nil 9136} 9137 9138// TagContractProperties tag contract Properties. 9139type TagContractProperties struct { 9140 // DisplayName - Tag name. 9141 DisplayName *string `json:"displayName,omitempty"` 9142} 9143 9144// TagCreateUpdateParameters parameters supplied to Create/Update Tag operations. 9145type TagCreateUpdateParameters struct { 9146 // TagContractProperties - Properties supplied to Create Tag operation. 9147 *TagContractProperties `json:"properties,omitempty"` 9148} 9149 9150// MarshalJSON is the custom marshaler for TagCreateUpdateParameters. 9151func (tcup TagCreateUpdateParameters) MarshalJSON() ([]byte, error) { 9152 objectMap := make(map[string]interface{}) 9153 if tcup.TagContractProperties != nil { 9154 objectMap["properties"] = tcup.TagContractProperties 9155 } 9156 return json.Marshal(objectMap) 9157} 9158 9159// UnmarshalJSON is the custom unmarshaler for TagCreateUpdateParameters struct. 9160func (tcup *TagCreateUpdateParameters) UnmarshalJSON(body []byte) error { 9161 var m map[string]*json.RawMessage 9162 err := json.Unmarshal(body, &m) 9163 if err != nil { 9164 return err 9165 } 9166 for k, v := range m { 9167 switch k { 9168 case "properties": 9169 if v != nil { 9170 var tagContractProperties TagContractProperties 9171 err = json.Unmarshal(*v, &tagContractProperties) 9172 if err != nil { 9173 return err 9174 } 9175 tcup.TagContractProperties = &tagContractProperties 9176 } 9177 } 9178 } 9179 9180 return nil 9181} 9182 9183// TagDescriptionBaseProperties parameters supplied to the Create TagDescription operation. 9184type TagDescriptionBaseProperties struct { 9185 // Description - Description of the Tag. 9186 Description *string `json:"description,omitempty"` 9187 // ExternalDocsURL - Absolute URL of external resources describing the tag. 9188 ExternalDocsURL *string `json:"externalDocsUrl,omitempty"` 9189 // ExternalDocsDescription - Description of the external resources describing the tag. 9190 ExternalDocsDescription *string `json:"externalDocsDescription,omitempty"` 9191} 9192 9193// TagDescriptionCollection paged TagDescription list representation. 9194type TagDescriptionCollection struct { 9195 autorest.Response `json:"-"` 9196 // Value - Page values. 9197 Value *[]TagDescriptionContract `json:"value,omitempty"` 9198 // NextLink - Next page link if any. 9199 NextLink *string `json:"nextLink,omitempty"` 9200} 9201 9202// TagDescriptionCollectionIterator provides access to a complete listing of TagDescriptionContract values. 9203type TagDescriptionCollectionIterator struct { 9204 i int 9205 page TagDescriptionCollectionPage 9206} 9207 9208// Next advances to the next value. If there was an error making 9209// the request the iterator does not advance and the error is returned. 9210func (iter *TagDescriptionCollectionIterator) Next() error { 9211 iter.i++ 9212 if iter.i < len(iter.page.Values()) { 9213 return nil 9214 } 9215 err := iter.page.Next() 9216 if err != nil { 9217 iter.i-- 9218 return err 9219 } 9220 iter.i = 0 9221 return nil 9222} 9223 9224// NotDone returns true if the enumeration should be started or is not yet complete. 9225func (iter TagDescriptionCollectionIterator) NotDone() bool { 9226 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 9227} 9228 9229// Response returns the raw server response from the last page request. 9230func (iter TagDescriptionCollectionIterator) Response() TagDescriptionCollection { 9231 return iter.page.Response() 9232} 9233 9234// Value returns the current value or a zero-initialized value if the 9235// iterator has advanced beyond the end of the collection. 9236func (iter TagDescriptionCollectionIterator) Value() TagDescriptionContract { 9237 if !iter.page.NotDone() { 9238 return TagDescriptionContract{} 9239 } 9240 return iter.page.Values()[iter.i] 9241} 9242 9243// IsEmpty returns true if the ListResult contains no values. 9244func (tdc TagDescriptionCollection) IsEmpty() bool { 9245 return tdc.Value == nil || len(*tdc.Value) == 0 9246} 9247 9248// tagDescriptionCollectionPreparer prepares a request to retrieve the next set of results. 9249// It returns nil if no more results exist. 9250func (tdc TagDescriptionCollection) tagDescriptionCollectionPreparer() (*http.Request, error) { 9251 if tdc.NextLink == nil || len(to.String(tdc.NextLink)) < 1 { 9252 return nil, nil 9253 } 9254 return autorest.Prepare(&http.Request{}, 9255 autorest.AsJSON(), 9256 autorest.AsGet(), 9257 autorest.WithBaseURL(to.String(tdc.NextLink))) 9258} 9259 9260// TagDescriptionCollectionPage contains a page of TagDescriptionContract values. 9261type TagDescriptionCollectionPage struct { 9262 fn func(TagDescriptionCollection) (TagDescriptionCollection, error) 9263 tdc TagDescriptionCollection 9264} 9265 9266// Next advances to the next page of values. If there was an error making 9267// the request the page does not advance and the error is returned. 9268func (page *TagDescriptionCollectionPage) Next() error { 9269 next, err := page.fn(page.tdc) 9270 if err != nil { 9271 return err 9272 } 9273 page.tdc = next 9274 return nil 9275} 9276 9277// NotDone returns true if the page enumeration should be started or is not yet complete. 9278func (page TagDescriptionCollectionPage) NotDone() bool { 9279 return !page.tdc.IsEmpty() 9280} 9281 9282// Response returns the raw server response from the last page request. 9283func (page TagDescriptionCollectionPage) Response() TagDescriptionCollection { 9284 return page.tdc 9285} 9286 9287// Values returns the slice of values for the current page or nil if there are no values. 9288func (page TagDescriptionCollectionPage) Values() []TagDescriptionContract { 9289 if page.tdc.IsEmpty() { 9290 return nil 9291 } 9292 return *page.tdc.Value 9293} 9294 9295// TagDescriptionContract contract details. 9296type TagDescriptionContract struct { 9297 autorest.Response `json:"-"` 9298 // TagDescriptionContractProperties - TagDescription entity contract properties. 9299 *TagDescriptionContractProperties `json:"properties,omitempty"` 9300 // ID - Resource ID. 9301 ID *string `json:"id,omitempty"` 9302 // Name - Resource name. 9303 Name *string `json:"name,omitempty"` 9304 // Type - Resource type for API Management resource. 9305 Type *string `json:"type,omitempty"` 9306} 9307 9308// MarshalJSON is the custom marshaler for TagDescriptionContract. 9309func (tdc TagDescriptionContract) MarshalJSON() ([]byte, error) { 9310 objectMap := make(map[string]interface{}) 9311 if tdc.TagDescriptionContractProperties != nil { 9312 objectMap["properties"] = tdc.TagDescriptionContractProperties 9313 } 9314 if tdc.ID != nil { 9315 objectMap["id"] = tdc.ID 9316 } 9317 if tdc.Name != nil { 9318 objectMap["name"] = tdc.Name 9319 } 9320 if tdc.Type != nil { 9321 objectMap["type"] = tdc.Type 9322 } 9323 return json.Marshal(objectMap) 9324} 9325 9326// UnmarshalJSON is the custom unmarshaler for TagDescriptionContract struct. 9327func (tdc *TagDescriptionContract) UnmarshalJSON(body []byte) error { 9328 var m map[string]*json.RawMessage 9329 err := json.Unmarshal(body, &m) 9330 if err != nil { 9331 return err 9332 } 9333 for k, v := range m { 9334 switch k { 9335 case "properties": 9336 if v != nil { 9337 var tagDescriptionContractProperties TagDescriptionContractProperties 9338 err = json.Unmarshal(*v, &tagDescriptionContractProperties) 9339 if err != nil { 9340 return err 9341 } 9342 tdc.TagDescriptionContractProperties = &tagDescriptionContractProperties 9343 } 9344 case "id": 9345 if v != nil { 9346 var ID string 9347 err = json.Unmarshal(*v, &ID) 9348 if err != nil { 9349 return err 9350 } 9351 tdc.ID = &ID 9352 } 9353 case "name": 9354 if v != nil { 9355 var name string 9356 err = json.Unmarshal(*v, &name) 9357 if err != nil { 9358 return err 9359 } 9360 tdc.Name = &name 9361 } 9362 case "type": 9363 if v != nil { 9364 var typeVar string 9365 err = json.Unmarshal(*v, &typeVar) 9366 if err != nil { 9367 return err 9368 } 9369 tdc.Type = &typeVar 9370 } 9371 } 9372 } 9373 9374 return nil 9375} 9376 9377// TagDescriptionContractProperties tagDescription contract Properties. 9378type TagDescriptionContractProperties struct { 9379 // DisplayName - Tag name. 9380 DisplayName *string `json:"displayName,omitempty"` 9381 // Description - Description of the Tag. 9382 Description *string `json:"description,omitempty"` 9383 // ExternalDocsURL - Absolute URL of external resources describing the tag. 9384 ExternalDocsURL *string `json:"externalDocsUrl,omitempty"` 9385 // ExternalDocsDescription - Description of the external resources describing the tag. 9386 ExternalDocsDescription *string `json:"externalDocsDescription,omitempty"` 9387} 9388 9389// TagDescriptionCreateParameters parameters supplied to the Create TagDescription operation. 9390type TagDescriptionCreateParameters struct { 9391 // TagDescriptionBaseProperties - Properties supplied to Create TagDescription operation. 9392 *TagDescriptionBaseProperties `json:"properties,omitempty"` 9393} 9394 9395// MarshalJSON is the custom marshaler for TagDescriptionCreateParameters. 9396func (tdcp TagDescriptionCreateParameters) MarshalJSON() ([]byte, error) { 9397 objectMap := make(map[string]interface{}) 9398 if tdcp.TagDescriptionBaseProperties != nil { 9399 objectMap["properties"] = tdcp.TagDescriptionBaseProperties 9400 } 9401 return json.Marshal(objectMap) 9402} 9403 9404// UnmarshalJSON is the custom unmarshaler for TagDescriptionCreateParameters struct. 9405func (tdcp *TagDescriptionCreateParameters) UnmarshalJSON(body []byte) error { 9406 var m map[string]*json.RawMessage 9407 err := json.Unmarshal(body, &m) 9408 if err != nil { 9409 return err 9410 } 9411 for k, v := range m { 9412 switch k { 9413 case "properties": 9414 if v != nil { 9415 var tagDescriptionBaseProperties TagDescriptionBaseProperties 9416 err = json.Unmarshal(*v, &tagDescriptionBaseProperties) 9417 if err != nil { 9418 return err 9419 } 9420 tdcp.TagDescriptionBaseProperties = &tagDescriptionBaseProperties 9421 } 9422 } 9423 } 9424 9425 return nil 9426} 9427 9428// TagResourceCollection paged Tag list representation. 9429type TagResourceCollection struct { 9430 autorest.Response `json:"-"` 9431 // Value - Page values. 9432 Value *[]TagResourceContract `json:"value,omitempty"` 9433 // Count - Total record count number across all pages. 9434 Count *int64 `json:"count,omitempty"` 9435 // NextLink - Next page link if any. 9436 NextLink *string `json:"nextLink,omitempty"` 9437} 9438 9439// TagResourceCollectionIterator provides access to a complete listing of TagResourceContract values. 9440type TagResourceCollectionIterator struct { 9441 i int 9442 page TagResourceCollectionPage 9443} 9444 9445// Next advances to the next value. If there was an error making 9446// the request the iterator does not advance and the error is returned. 9447func (iter *TagResourceCollectionIterator) Next() error { 9448 iter.i++ 9449 if iter.i < len(iter.page.Values()) { 9450 return nil 9451 } 9452 err := iter.page.Next() 9453 if err != nil { 9454 iter.i-- 9455 return err 9456 } 9457 iter.i = 0 9458 return nil 9459} 9460 9461// NotDone returns true if the enumeration should be started or is not yet complete. 9462func (iter TagResourceCollectionIterator) NotDone() bool { 9463 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 9464} 9465 9466// Response returns the raw server response from the last page request. 9467func (iter TagResourceCollectionIterator) Response() TagResourceCollection { 9468 return iter.page.Response() 9469} 9470 9471// Value returns the current value or a zero-initialized value if the 9472// iterator has advanced beyond the end of the collection. 9473func (iter TagResourceCollectionIterator) Value() TagResourceContract { 9474 if !iter.page.NotDone() { 9475 return TagResourceContract{} 9476 } 9477 return iter.page.Values()[iter.i] 9478} 9479 9480// IsEmpty returns true if the ListResult contains no values. 9481func (trc TagResourceCollection) IsEmpty() bool { 9482 return trc.Value == nil || len(*trc.Value) == 0 9483} 9484 9485// tagResourceCollectionPreparer prepares a request to retrieve the next set of results. 9486// It returns nil if no more results exist. 9487func (trc TagResourceCollection) tagResourceCollectionPreparer() (*http.Request, error) { 9488 if trc.NextLink == nil || len(to.String(trc.NextLink)) < 1 { 9489 return nil, nil 9490 } 9491 return autorest.Prepare(&http.Request{}, 9492 autorest.AsJSON(), 9493 autorest.AsGet(), 9494 autorest.WithBaseURL(to.String(trc.NextLink))) 9495} 9496 9497// TagResourceCollectionPage contains a page of TagResourceContract values. 9498type TagResourceCollectionPage struct { 9499 fn func(TagResourceCollection) (TagResourceCollection, error) 9500 trc TagResourceCollection 9501} 9502 9503// Next advances to the next page of values. If there was an error making 9504// the request the page does not advance and the error is returned. 9505func (page *TagResourceCollectionPage) Next() error { 9506 next, err := page.fn(page.trc) 9507 if err != nil { 9508 return err 9509 } 9510 page.trc = next 9511 return nil 9512} 9513 9514// NotDone returns true if the page enumeration should be started or is not yet complete. 9515func (page TagResourceCollectionPage) NotDone() bool { 9516 return !page.trc.IsEmpty() 9517} 9518 9519// Response returns the raw server response from the last page request. 9520func (page TagResourceCollectionPage) Response() TagResourceCollection { 9521 return page.trc 9522} 9523 9524// Values returns the slice of values for the current page or nil if there are no values. 9525func (page TagResourceCollectionPage) Values() []TagResourceContract { 9526 if page.trc.IsEmpty() { 9527 return nil 9528 } 9529 return *page.trc.Value 9530} 9531 9532// TagResourceContract tagResource contract properties. 9533type TagResourceContract struct { 9534 // Tag - Tag associated with the resource. 9535 Tag *TagTagResourceContractProperties `json:"tag,omitempty"` 9536 // API - Api associated with the tag. 9537 API *APITagResourceContractProperties `json:"api,omitempty"` 9538 // Operation - Operation associated with the tag. 9539 Operation *OperationTagResourceContractProperties `json:"operation,omitempty"` 9540 // Product - Product associated with the tag. 9541 Product *ProductTagResourceContractProperties `json:"product,omitempty"` 9542} 9543 9544// TagTagResourceContractProperties contract defining the Tag property in the Tag Resource Contract 9545type TagTagResourceContractProperties struct { 9546 // ID - Tag identifier 9547 ID *string `json:"id,omitempty"` 9548 // Name - Tag Name 9549 Name *string `json:"name,omitempty"` 9550} 9551 9552// TenantConfigurationDeployFuture an abstraction for monitoring and retrieving the results of a long-running 9553// operation. 9554type TenantConfigurationDeployFuture struct { 9555 azure.Future 9556} 9557 9558// Result returns the result of the asynchronous operation. 9559// If the operation has not completed it will return an error. 9560func (future *TenantConfigurationDeployFuture) Result(client TenantConfigurationClient) (orc OperationResultContract, err error) { 9561 var done bool 9562 done, err = future.Done(client) 9563 if err != nil { 9564 err = autorest.NewErrorWithError(err, "apimanagement.TenantConfigurationDeployFuture", "Result", future.Response(), "Polling failure") 9565 return 9566 } 9567 if !done { 9568 err = azure.NewAsyncOpIncompleteError("apimanagement.TenantConfigurationDeployFuture") 9569 return 9570 } 9571 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 9572 if orc.Response.Response, err = future.GetResult(sender); err == nil && orc.Response.Response.StatusCode != http.StatusNoContent { 9573 orc, err = client.DeployResponder(orc.Response.Response) 9574 if err != nil { 9575 err = autorest.NewErrorWithError(err, "apimanagement.TenantConfigurationDeployFuture", "Result", orc.Response.Response, "Failure responding to request") 9576 } 9577 } 9578 return 9579} 9580 9581// TenantConfigurationSaveFuture an abstraction for monitoring and retrieving the results of a long-running 9582// operation. 9583type TenantConfigurationSaveFuture struct { 9584 azure.Future 9585} 9586 9587// Result returns the result of the asynchronous operation. 9588// If the operation has not completed it will return an error. 9589func (future *TenantConfigurationSaveFuture) Result(client TenantConfigurationClient) (orc OperationResultContract, err error) { 9590 var done bool 9591 done, err = future.Done(client) 9592 if err != nil { 9593 err = autorest.NewErrorWithError(err, "apimanagement.TenantConfigurationSaveFuture", "Result", future.Response(), "Polling failure") 9594 return 9595 } 9596 if !done { 9597 err = azure.NewAsyncOpIncompleteError("apimanagement.TenantConfigurationSaveFuture") 9598 return 9599 } 9600 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 9601 if orc.Response.Response, err = future.GetResult(sender); err == nil && orc.Response.Response.StatusCode != http.StatusNoContent { 9602 orc, err = client.SaveResponder(orc.Response.Response) 9603 if err != nil { 9604 err = autorest.NewErrorWithError(err, "apimanagement.TenantConfigurationSaveFuture", "Result", orc.Response.Response, "Failure responding to request") 9605 } 9606 } 9607 return 9608} 9609 9610// TenantConfigurationSyncStateContract tenant Configuration Synchronization State. 9611type TenantConfigurationSyncStateContract struct { 9612 autorest.Response `json:"-"` 9613 // Branch - The name of Git branch. 9614 Branch *string `json:"branch,omitempty"` 9615 // CommitID - The latest commit Id. 9616 CommitID *string `json:"commitId,omitempty"` 9617 // IsExport - value indicating if last sync was save (true) or deploy (false) operation. 9618 IsExport *bool `json:"isExport,omitempty"` 9619 // IsSynced - value indicating if last synchronization was later than the configuration change. 9620 IsSynced *bool `json:"isSynced,omitempty"` 9621 // IsGitEnabled - value indicating whether Git configuration access is enabled. 9622 IsGitEnabled *bool `json:"isGitEnabled,omitempty"` 9623 // 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. 9624 SyncDate *date.Time `json:"syncDate,omitempty"` 9625 // 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. 9626 ConfigurationChangeDate *date.Time `json:"configurationChangeDate,omitempty"` 9627} 9628 9629// TenantConfigurationValidateFuture an abstraction for monitoring and retrieving the results of a long-running 9630// operation. 9631type TenantConfigurationValidateFuture struct { 9632 azure.Future 9633} 9634 9635// Result returns the result of the asynchronous operation. 9636// If the operation has not completed it will return an error. 9637func (future *TenantConfigurationValidateFuture) Result(client TenantConfigurationClient) (orc OperationResultContract, err error) { 9638 var done bool 9639 done, err = future.Done(client) 9640 if err != nil { 9641 err = autorest.NewErrorWithError(err, "apimanagement.TenantConfigurationValidateFuture", "Result", future.Response(), "Polling failure") 9642 return 9643 } 9644 if !done { 9645 err = azure.NewAsyncOpIncompleteError("apimanagement.TenantConfigurationValidateFuture") 9646 return 9647 } 9648 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 9649 if orc.Response.Response, err = future.GetResult(sender); err == nil && orc.Response.Response.StatusCode != http.StatusNoContent { 9650 orc, err = client.ValidateResponder(orc.Response.Response) 9651 if err != nil { 9652 err = autorest.NewErrorWithError(err, "apimanagement.TenantConfigurationValidateFuture", "Result", orc.Response.Response, "Failure responding to request") 9653 } 9654 } 9655 return 9656} 9657 9658// TermsOfServiceProperties terms of service contract properties. 9659type TermsOfServiceProperties struct { 9660 // Text - A terms of service text. 9661 Text *string `json:"text,omitempty"` 9662 // Enabled - Display terms of service during a sign-up process. 9663 Enabled *bool `json:"enabled,omitempty"` 9664 // ConsentRequired - Ask user for consent to the terms of service. 9665 ConsentRequired *bool `json:"consentRequired,omitempty"` 9666} 9667 9668// TokenBodyParameterContract oAuth acquire token request body parameter (www-url-form-encoded). 9669type TokenBodyParameterContract struct { 9670 // Name - body parameter name. 9671 Name *string `json:"name,omitempty"` 9672 // Value - body parameter value. 9673 Value *string `json:"value,omitempty"` 9674} 9675 9676// UserCollection paged Users list representation. 9677type UserCollection struct { 9678 autorest.Response `json:"-"` 9679 // Value - Page values. 9680 Value *[]UserContract `json:"value,omitempty"` 9681 // NextLink - Next page link if any. 9682 NextLink *string `json:"nextLink,omitempty"` 9683} 9684 9685// UserCollectionIterator provides access to a complete listing of UserContract values. 9686type UserCollectionIterator struct { 9687 i int 9688 page UserCollectionPage 9689} 9690 9691// Next advances to the next value. If there was an error making 9692// the request the iterator does not advance and the error is returned. 9693func (iter *UserCollectionIterator) Next() error { 9694 iter.i++ 9695 if iter.i < len(iter.page.Values()) { 9696 return nil 9697 } 9698 err := iter.page.Next() 9699 if err != nil { 9700 iter.i-- 9701 return err 9702 } 9703 iter.i = 0 9704 return nil 9705} 9706 9707// NotDone returns true if the enumeration should be started or is not yet complete. 9708func (iter UserCollectionIterator) NotDone() bool { 9709 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 9710} 9711 9712// Response returns the raw server response from the last page request. 9713func (iter UserCollectionIterator) Response() UserCollection { 9714 return iter.page.Response() 9715} 9716 9717// Value returns the current value or a zero-initialized value if the 9718// iterator has advanced beyond the end of the collection. 9719func (iter UserCollectionIterator) Value() UserContract { 9720 if !iter.page.NotDone() { 9721 return UserContract{} 9722 } 9723 return iter.page.Values()[iter.i] 9724} 9725 9726// IsEmpty returns true if the ListResult contains no values. 9727func (uc UserCollection) IsEmpty() bool { 9728 return uc.Value == nil || len(*uc.Value) == 0 9729} 9730 9731// userCollectionPreparer prepares a request to retrieve the next set of results. 9732// It returns nil if no more results exist. 9733func (uc UserCollection) userCollectionPreparer() (*http.Request, error) { 9734 if uc.NextLink == nil || len(to.String(uc.NextLink)) < 1 { 9735 return nil, nil 9736 } 9737 return autorest.Prepare(&http.Request{}, 9738 autorest.AsJSON(), 9739 autorest.AsGet(), 9740 autorest.WithBaseURL(to.String(uc.NextLink))) 9741} 9742 9743// UserCollectionPage contains a page of UserContract values. 9744type UserCollectionPage struct { 9745 fn func(UserCollection) (UserCollection, error) 9746 uc UserCollection 9747} 9748 9749// Next advances to the next page of values. If there was an error making 9750// the request the page does not advance and the error is returned. 9751func (page *UserCollectionPage) Next() error { 9752 next, err := page.fn(page.uc) 9753 if err != nil { 9754 return err 9755 } 9756 page.uc = next 9757 return nil 9758} 9759 9760// NotDone returns true if the page enumeration should be started or is not yet complete. 9761func (page UserCollectionPage) NotDone() bool { 9762 return !page.uc.IsEmpty() 9763} 9764 9765// Response returns the raw server response from the last page request. 9766func (page UserCollectionPage) Response() UserCollection { 9767 return page.uc 9768} 9769 9770// Values returns the slice of values for the current page or nil if there are no values. 9771func (page UserCollectionPage) Values() []UserContract { 9772 if page.uc.IsEmpty() { 9773 return nil 9774 } 9775 return *page.uc.Value 9776} 9777 9778// UserContract user details. 9779type UserContract struct { 9780 autorest.Response `json:"-"` 9781 // UserContractProperties - User entity contract properties. 9782 *UserContractProperties `json:"properties,omitempty"` 9783 // ID - Resource ID. 9784 ID *string `json:"id,omitempty"` 9785 // Name - Resource name. 9786 Name *string `json:"name,omitempty"` 9787 // Type - Resource type for API Management resource. 9788 Type *string `json:"type,omitempty"` 9789} 9790 9791// MarshalJSON is the custom marshaler for UserContract. 9792func (uc UserContract) MarshalJSON() ([]byte, error) { 9793 objectMap := make(map[string]interface{}) 9794 if uc.UserContractProperties != nil { 9795 objectMap["properties"] = uc.UserContractProperties 9796 } 9797 if uc.ID != nil { 9798 objectMap["id"] = uc.ID 9799 } 9800 if uc.Name != nil { 9801 objectMap["name"] = uc.Name 9802 } 9803 if uc.Type != nil { 9804 objectMap["type"] = uc.Type 9805 } 9806 return json.Marshal(objectMap) 9807} 9808 9809// UnmarshalJSON is the custom unmarshaler for UserContract struct. 9810func (uc *UserContract) UnmarshalJSON(body []byte) error { 9811 var m map[string]*json.RawMessage 9812 err := json.Unmarshal(body, &m) 9813 if err != nil { 9814 return err 9815 } 9816 for k, v := range m { 9817 switch k { 9818 case "properties": 9819 if v != nil { 9820 var userContractProperties UserContractProperties 9821 err = json.Unmarshal(*v, &userContractProperties) 9822 if err != nil { 9823 return err 9824 } 9825 uc.UserContractProperties = &userContractProperties 9826 } 9827 case "id": 9828 if v != nil { 9829 var ID string 9830 err = json.Unmarshal(*v, &ID) 9831 if err != nil { 9832 return err 9833 } 9834 uc.ID = &ID 9835 } 9836 case "name": 9837 if v != nil { 9838 var name string 9839 err = json.Unmarshal(*v, &name) 9840 if err != nil { 9841 return err 9842 } 9843 uc.Name = &name 9844 } 9845 case "type": 9846 if v != nil { 9847 var typeVar string 9848 err = json.Unmarshal(*v, &typeVar) 9849 if err != nil { 9850 return err 9851 } 9852 uc.Type = &typeVar 9853 } 9854 } 9855 } 9856 9857 return nil 9858} 9859 9860// UserContractProperties user profile. 9861type UserContractProperties struct { 9862 // FirstName - First name. 9863 FirstName *string `json:"firstName,omitempty"` 9864 // LastName - Last name. 9865 LastName *string `json:"lastName,omitempty"` 9866 // Email - Email address. 9867 Email *string `json:"email,omitempty"` 9868 // RegistrationDate - Date of user registration. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. 9869 RegistrationDate *date.Time `json:"registrationDate,omitempty"` 9870 // Groups - Collection of groups user is part of. 9871 Groups *[]GroupContractProperties `json:"groups,omitempty"` 9872 // 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' 9873 State UserState `json:"state,omitempty"` 9874 // Note - Optional note about a user set by the administrator. 9875 Note *string `json:"note,omitempty"` 9876 // Identities - Collection of user identities. 9877 Identities *[]UserIdentityContract `json:"identities,omitempty"` 9878} 9879 9880// UserCreateParameterProperties parameters supplied to the Create User operation. 9881type UserCreateParameterProperties struct { 9882 // Email - Email address. Must not be empty and must be unique within the service instance. 9883 Email *string `json:"email,omitempty"` 9884 // FirstName - First name. 9885 FirstName *string `json:"firstName,omitempty"` 9886 // LastName - Last name. 9887 LastName *string `json:"lastName,omitempty"` 9888 // Password - User Password. If no value is provided, a default password is generated. 9889 Password *string `json:"password,omitempty"` 9890 // Confirmation - Determines the type of confirmation e-mail that will be sent to the newly created user. Possible values include: 'Signup', 'Invite' 9891 Confirmation Confirmation `json:"confirmation,omitempty"` 9892 // 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' 9893 State UserState `json:"state,omitempty"` 9894 // Note - Optional note about a user set by the administrator. 9895 Note *string `json:"note,omitempty"` 9896 // Identities - Collection of user identities. 9897 Identities *[]UserIdentityContract `json:"identities,omitempty"` 9898} 9899 9900// UserCreateParameters user create details. 9901type UserCreateParameters struct { 9902 // UserCreateParameterProperties - User entity create contract properties. 9903 *UserCreateParameterProperties `json:"properties,omitempty"` 9904} 9905 9906// MarshalJSON is the custom marshaler for UserCreateParameters. 9907func (ucp UserCreateParameters) MarshalJSON() ([]byte, error) { 9908 objectMap := make(map[string]interface{}) 9909 if ucp.UserCreateParameterProperties != nil { 9910 objectMap["properties"] = ucp.UserCreateParameterProperties 9911 } 9912 return json.Marshal(objectMap) 9913} 9914 9915// UnmarshalJSON is the custom unmarshaler for UserCreateParameters struct. 9916func (ucp *UserCreateParameters) UnmarshalJSON(body []byte) error { 9917 var m map[string]*json.RawMessage 9918 err := json.Unmarshal(body, &m) 9919 if err != nil { 9920 return err 9921 } 9922 for k, v := range m { 9923 switch k { 9924 case "properties": 9925 if v != nil { 9926 var userCreateParameterProperties UserCreateParameterProperties 9927 err = json.Unmarshal(*v, &userCreateParameterProperties) 9928 if err != nil { 9929 return err 9930 } 9931 ucp.UserCreateParameterProperties = &userCreateParameterProperties 9932 } 9933 } 9934 } 9935 9936 return nil 9937} 9938 9939// UserEntityBaseParameters user Entity Base Parameters set. 9940type UserEntityBaseParameters struct { 9941 // 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' 9942 State UserState `json:"state,omitempty"` 9943 // Note - Optional note about a user set by the administrator. 9944 Note *string `json:"note,omitempty"` 9945 // Identities - Collection of user identities. 9946 Identities *[]UserIdentityContract `json:"identities,omitempty"` 9947} 9948 9949// UserIdentityCollection list of Users Identity list representation. 9950type UserIdentityCollection struct { 9951 autorest.Response `json:"-"` 9952 // Value - User Identity values. 9953 Value *[]UserIdentityContract `json:"value,omitempty"` 9954 // Count - Total record count number across all pages. 9955 Count *int64 `json:"count,omitempty"` 9956 // NextLink - Next page link if any. 9957 NextLink *string `json:"nextLink,omitempty"` 9958} 9959 9960// UserIdentityCollectionIterator provides access to a complete listing of UserIdentityContract values. 9961type UserIdentityCollectionIterator struct { 9962 i int 9963 page UserIdentityCollectionPage 9964} 9965 9966// Next advances to the next value. If there was an error making 9967// the request the iterator does not advance and the error is returned. 9968func (iter *UserIdentityCollectionIterator) Next() error { 9969 iter.i++ 9970 if iter.i < len(iter.page.Values()) { 9971 return nil 9972 } 9973 err := iter.page.Next() 9974 if err != nil { 9975 iter.i-- 9976 return err 9977 } 9978 iter.i = 0 9979 return nil 9980} 9981 9982// NotDone returns true if the enumeration should be started or is not yet complete. 9983func (iter UserIdentityCollectionIterator) NotDone() bool { 9984 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 9985} 9986 9987// Response returns the raw server response from the last page request. 9988func (iter UserIdentityCollectionIterator) Response() UserIdentityCollection { 9989 return iter.page.Response() 9990} 9991 9992// Value returns the current value or a zero-initialized value if the 9993// iterator has advanced beyond the end of the collection. 9994func (iter UserIdentityCollectionIterator) Value() UserIdentityContract { 9995 if !iter.page.NotDone() { 9996 return UserIdentityContract{} 9997 } 9998 return iter.page.Values()[iter.i] 9999} 10000 10001// IsEmpty returns true if the ListResult contains no values. 10002func (uic UserIdentityCollection) IsEmpty() bool { 10003 return uic.Value == nil || len(*uic.Value) == 0 10004} 10005 10006// userIdentityCollectionPreparer prepares a request to retrieve the next set of results. 10007// It returns nil if no more results exist. 10008func (uic UserIdentityCollection) userIdentityCollectionPreparer() (*http.Request, error) { 10009 if uic.NextLink == nil || len(to.String(uic.NextLink)) < 1 { 10010 return nil, nil 10011 } 10012 return autorest.Prepare(&http.Request{}, 10013 autorest.AsJSON(), 10014 autorest.AsGet(), 10015 autorest.WithBaseURL(to.String(uic.NextLink))) 10016} 10017 10018// UserIdentityCollectionPage contains a page of UserIdentityContract values. 10019type UserIdentityCollectionPage struct { 10020 fn func(UserIdentityCollection) (UserIdentityCollection, error) 10021 uic UserIdentityCollection 10022} 10023 10024// Next advances to the next page of values. If there was an error making 10025// the request the page does not advance and the error is returned. 10026func (page *UserIdentityCollectionPage) Next() error { 10027 next, err := page.fn(page.uic) 10028 if err != nil { 10029 return err 10030 } 10031 page.uic = next 10032 return nil 10033} 10034 10035// NotDone returns true if the page enumeration should be started or is not yet complete. 10036func (page UserIdentityCollectionPage) NotDone() bool { 10037 return !page.uic.IsEmpty() 10038} 10039 10040// Response returns the raw server response from the last page request. 10041func (page UserIdentityCollectionPage) Response() UserIdentityCollection { 10042 return page.uic 10043} 10044 10045// Values returns the slice of values for the current page or nil if there are no values. 10046func (page UserIdentityCollectionPage) Values() []UserIdentityContract { 10047 if page.uic.IsEmpty() { 10048 return nil 10049 } 10050 return *page.uic.Value 10051} 10052 10053// UserIdentityContract user identity details. 10054type UserIdentityContract struct { 10055 // Provider - Identity provider name. 10056 Provider *string `json:"provider,omitempty"` 10057 // ID - Identifier value within provider. 10058 ID *string `json:"id,omitempty"` 10059} 10060 10061// UserTokenParameters parameters supplied to the Get User Token operation. 10062type UserTokenParameters struct { 10063 // KeyType - The Key to be used to generate token for user. Possible values include: 'Primary', 'Secondary' 10064 KeyType KeyType `json:"keyType,omitempty"` 10065 // 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. 10066 Expiry *date.Time `json:"expiry,omitempty"` 10067} 10068 10069// UserTokenResult get User Token response details. 10070type UserTokenResult struct { 10071 autorest.Response `json:"-"` 10072 // Value - Shared Access Authorization token for the User. 10073 Value *string `json:"value,omitempty"` 10074} 10075 10076// UserUpdateParameters user update parameters. 10077type UserUpdateParameters struct { 10078 // UserUpdateParametersProperties - User entity update contract properties. 10079 *UserUpdateParametersProperties `json:"properties,omitempty"` 10080} 10081 10082// MarshalJSON is the custom marshaler for UserUpdateParameters. 10083func (uup UserUpdateParameters) MarshalJSON() ([]byte, error) { 10084 objectMap := make(map[string]interface{}) 10085 if uup.UserUpdateParametersProperties != nil { 10086 objectMap["properties"] = uup.UserUpdateParametersProperties 10087 } 10088 return json.Marshal(objectMap) 10089} 10090 10091// UnmarshalJSON is the custom unmarshaler for UserUpdateParameters struct. 10092func (uup *UserUpdateParameters) UnmarshalJSON(body []byte) error { 10093 var m map[string]*json.RawMessage 10094 err := json.Unmarshal(body, &m) 10095 if err != nil { 10096 return err 10097 } 10098 for k, v := range m { 10099 switch k { 10100 case "properties": 10101 if v != nil { 10102 var userUpdateParametersProperties UserUpdateParametersProperties 10103 err = json.Unmarshal(*v, &userUpdateParametersProperties) 10104 if err != nil { 10105 return err 10106 } 10107 uup.UserUpdateParametersProperties = &userUpdateParametersProperties 10108 } 10109 } 10110 } 10111 10112 return nil 10113} 10114 10115// UserUpdateParametersProperties parameters supplied to the Update User operation. 10116type UserUpdateParametersProperties struct { 10117 // Email - Email address. Must not be empty and must be unique within the service instance. 10118 Email *string `json:"email,omitempty"` 10119 // Password - User Password. 10120 Password *string `json:"password,omitempty"` 10121 // FirstName - First name. 10122 FirstName *string `json:"firstName,omitempty"` 10123 // LastName - Last name. 10124 LastName *string `json:"lastName,omitempty"` 10125 // 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' 10126 State UserState `json:"state,omitempty"` 10127 // Note - Optional note about a user set by the administrator. 10128 Note *string `json:"note,omitempty"` 10129 // Identities - Collection of user identities. 10130 Identities *[]UserIdentityContract `json:"identities,omitempty"` 10131} 10132 10133// VirtualNetworkConfiguration configuration of a virtual network to which API Management service is deployed. 10134type VirtualNetworkConfiguration struct { 10135 // Vnetid - The virtual network ID. This is typically a GUID. Expect a null GUID by default. 10136 Vnetid *string `json:"vnetid,omitempty"` 10137 // Subnetname - The name of the subnet. 10138 Subnetname *string `json:"subnetname,omitempty"` 10139 // SubnetResourceID - The full resource ID of a subnet in a virtual network to deploy the API Management service in. 10140 SubnetResourceID *string `json:"subnetResourceId,omitempty"` 10141} 10142 10143// X509CertificateName properties of server X509Names. 10144type X509CertificateName struct { 10145 // Name - Common Name of the Certificate. 10146 Name *string `json:"name,omitempty"` 10147 // IssuerCertificateThumbprint - Thumbprint for the Issuer of the Certificate. 10148 IssuerCertificateThumbprint *string `json:"issuerCertificateThumbprint,omitempty"` 10149} 10150