1package apimanagement 2 3// Copyright (c) Microsoft Corporation. All rights reserved. 4// Licensed under the MIT License. See License.txt in the project root for license information. 5// 6// Code generated by Microsoft (R) AutoRest Code Generator. 7// Changes may cause incorrect behavior and will be lost if the code is regenerated. 8 9import ( 10 "context" 11 "encoding/json" 12 "github.com/Azure/go-autorest/autorest" 13 "github.com/Azure/go-autorest/autorest/azure" 14 "github.com/Azure/go-autorest/autorest/date" 15 "github.com/Azure/go-autorest/autorest/to" 16 "github.com/Azure/go-autorest/tracing" 17 "github.com/gofrs/uuid" 18 "net/http" 19) 20 21// The package's fully qualified name. 22const fqdn = "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-01-01/apimanagement" 23 24// AccessInformationContract tenant access information contract of the API Management service. 25type AccessInformationContract struct { 26 autorest.Response `json:"-"` 27 // ID - Identifier. 28 ID *string `json:"id,omitempty"` 29 // PrimaryKey - Primary access key. 30 PrimaryKey *string `json:"primaryKey,omitempty"` 31 // SecondaryKey - Secondary access key. 32 SecondaryKey *string `json:"secondaryKey,omitempty"` 33 // Enabled - Determines whether direct access is enabled. 34 Enabled *bool `json:"enabled,omitempty"` 35} 36 37// AccessInformationUpdateParameterProperties tenant access information update parameters of the API 38// Management service 39type AccessInformationUpdateParameterProperties struct { 40 // Enabled - Determines whether direct access is enabled. 41 Enabled *bool `json:"enabled,omitempty"` 42} 43 44// AccessInformationUpdateParameters tenant access information update parameters. 45type AccessInformationUpdateParameters struct { 46 // AccessInformationUpdateParameterProperties - Tenant access information update parameter properties. 47 *AccessInformationUpdateParameterProperties `json:"properties,omitempty"` 48} 49 50// MarshalJSON is the custom marshaler for AccessInformationUpdateParameters. 51func (aiup AccessInformationUpdateParameters) MarshalJSON() ([]byte, error) { 52 objectMap := make(map[string]interface{}) 53 if aiup.AccessInformationUpdateParameterProperties != nil { 54 objectMap["properties"] = aiup.AccessInformationUpdateParameterProperties 55 } 56 return json.Marshal(objectMap) 57} 58 59// UnmarshalJSON is the custom unmarshaler for AccessInformationUpdateParameters struct. 60func (aiup *AccessInformationUpdateParameters) UnmarshalJSON(body []byte) error { 61 var m map[string]*json.RawMessage 62 err := json.Unmarshal(body, &m) 63 if err != nil { 64 return err 65 } 66 for k, v := range m { 67 switch k { 68 case "properties": 69 if v != nil { 70 var accessInformationUpdateParameterProperties AccessInformationUpdateParameterProperties 71 err = json.Unmarshal(*v, &accessInformationUpdateParameterProperties) 72 if err != nil { 73 return err 74 } 75 aiup.AccessInformationUpdateParameterProperties = &accessInformationUpdateParameterProperties 76 } 77 } 78 } 79 80 return nil 81} 82 83// AdditionalLocation description of an additional API Management resource location. 84type AdditionalLocation struct { 85 // Location - The location name of the additional region among Azure Data center regions. 86 Location *string `json:"location,omitempty"` 87 // Sku - SKU properties of the API Management service. 88 Sku *ServiceSkuProperties `json:"sku,omitempty"` 89 // PublicIPAddresses - READ-ONLY; Public Static Load Balanced IP addresses of the API Management service in the additional location. Available only for Basic, Standard and Premium SKU. 90 PublicIPAddresses *[]string `json:"publicIPAddresses,omitempty"` 91 // PrivateIPAddresses - READ-ONLY; Private Static Load Balanced IP addresses of the API Management service which is deployed in an Internal Virtual Network in a particular additional location. Available only for Basic, Standard and Premium SKU. 92 PrivateIPAddresses *[]string `json:"privateIPAddresses,omitempty"` 93 // VirtualNetworkConfiguration - Virtual network configuration for the location. 94 VirtualNetworkConfiguration *VirtualNetworkConfiguration `json:"virtualNetworkConfiguration,omitempty"` 95 // GatewayRegionalURL - READ-ONLY; Gateway URL of the API Management service in the Region. 96 GatewayRegionalURL *string `json:"gatewayRegionalUrl,omitempty"` 97} 98 99// MarshalJSON is the custom marshaler for AdditionalLocation. 100func (al AdditionalLocation) MarshalJSON() ([]byte, error) { 101 objectMap := make(map[string]interface{}) 102 if al.Location != nil { 103 objectMap["location"] = al.Location 104 } 105 if al.Sku != nil { 106 objectMap["sku"] = al.Sku 107 } 108 if al.VirtualNetworkConfiguration != nil { 109 objectMap["virtualNetworkConfiguration"] = al.VirtualNetworkConfiguration 110 } 111 return json.Marshal(objectMap) 112} 113 114// APICollection paged Api list representation. 115type APICollection struct { 116 autorest.Response `json:"-"` 117 // Value - READ-ONLY; Page values. 118 Value *[]APIContract `json:"value,omitempty"` 119 // NextLink - READ-ONLY; Next page link if any. 120 NextLink *string `json:"nextLink,omitempty"` 121} 122 123// MarshalJSON is the custom marshaler for APICollection. 124func (ac APICollection) MarshalJSON() ([]byte, error) { 125 objectMap := make(map[string]interface{}) 126 return json.Marshal(objectMap) 127} 128 129// APICollectionIterator provides access to a complete listing of APIContract values. 130type APICollectionIterator struct { 131 i int 132 page APICollectionPage 133} 134 135// NextWithContext advances to the next value. If there was an error making 136// the request the iterator does not advance and the error is returned. 137func (iter *APICollectionIterator) NextWithContext(ctx context.Context) (err error) { 138 if tracing.IsEnabled() { 139 ctx = tracing.StartSpan(ctx, fqdn+"/APICollectionIterator.NextWithContext") 140 defer func() { 141 sc := -1 142 if iter.Response().Response.Response != nil { 143 sc = iter.Response().Response.Response.StatusCode 144 } 145 tracing.EndSpan(ctx, sc, err) 146 }() 147 } 148 iter.i++ 149 if iter.i < len(iter.page.Values()) { 150 return nil 151 } 152 err = iter.page.NextWithContext(ctx) 153 if err != nil { 154 iter.i-- 155 return err 156 } 157 iter.i = 0 158 return nil 159} 160 161// Next advances to the next value. If there was an error making 162// the request the iterator does not advance and the error is returned. 163// Deprecated: Use NextWithContext() instead. 164func (iter *APICollectionIterator) Next() error { 165 return iter.NextWithContext(context.Background()) 166} 167 168// NotDone returns true if the enumeration should be started or is not yet complete. 169func (iter APICollectionIterator) NotDone() bool { 170 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 171} 172 173// Response returns the raw server response from the last page request. 174func (iter APICollectionIterator) Response() APICollection { 175 return iter.page.Response() 176} 177 178// Value returns the current value or a zero-initialized value if the 179// iterator has advanced beyond the end of the collection. 180func (iter APICollectionIterator) Value() APIContract { 181 if !iter.page.NotDone() { 182 return APIContract{} 183 } 184 return iter.page.Values()[iter.i] 185} 186 187// Creates a new instance of the APICollectionIterator type. 188func NewAPICollectionIterator(page APICollectionPage) APICollectionIterator { 189 return APICollectionIterator{page: page} 190} 191 192// IsEmpty returns true if the ListResult contains no values. 193func (ac APICollection) IsEmpty() bool { 194 return ac.Value == nil || len(*ac.Value) == 0 195} 196 197// hasNextLink returns true if the NextLink is not empty. 198func (ac APICollection) hasNextLink() bool { 199 return ac.NextLink != nil && len(*ac.NextLink) != 0 200} 201 202// aPICollectionPreparer prepares a request to retrieve the next set of results. 203// It returns nil if no more results exist. 204func (ac APICollection) aPICollectionPreparer(ctx context.Context) (*http.Request, error) { 205 if !ac.hasNextLink() { 206 return nil, nil 207 } 208 return autorest.Prepare((&http.Request{}).WithContext(ctx), 209 autorest.AsJSON(), 210 autorest.AsGet(), 211 autorest.WithBaseURL(to.String(ac.NextLink))) 212} 213 214// APICollectionPage contains a page of APIContract values. 215type APICollectionPage struct { 216 fn func(context.Context, APICollection) (APICollection, error) 217 ac APICollection 218} 219 220// NextWithContext advances to the next page of values. If there was an error making 221// the request the page does not advance and the error is returned. 222func (page *APICollectionPage) NextWithContext(ctx context.Context) (err error) { 223 if tracing.IsEnabled() { 224 ctx = tracing.StartSpan(ctx, fqdn+"/APICollectionPage.NextWithContext") 225 defer func() { 226 sc := -1 227 if page.Response().Response.Response != nil { 228 sc = page.Response().Response.Response.StatusCode 229 } 230 tracing.EndSpan(ctx, sc, err) 231 }() 232 } 233 for { 234 next, err := page.fn(ctx, page.ac) 235 if err != nil { 236 return err 237 } 238 page.ac = next 239 if !next.hasNextLink() || !next.IsEmpty() { 240 break 241 } 242 } 243 return nil 244} 245 246// Next advances to the next page of values. If there was an error making 247// the request the page does not advance and the error is returned. 248// Deprecated: Use NextWithContext() instead. 249func (page *APICollectionPage) Next() error { 250 return page.NextWithContext(context.Background()) 251} 252 253// NotDone returns true if the page enumeration should be started or is not yet complete. 254func (page APICollectionPage) NotDone() bool { 255 return !page.ac.IsEmpty() 256} 257 258// Response returns the raw server response from the last page request. 259func (page APICollectionPage) Response() APICollection { 260 return page.ac 261} 262 263// Values returns the slice of values for the current page or nil if there are no values. 264func (page APICollectionPage) Values() []APIContract { 265 if page.ac.IsEmpty() { 266 return nil 267 } 268 return *page.ac.Value 269} 270 271// Creates a new instance of the APICollectionPage type. 272func NewAPICollectionPage(cur APICollection, getNextPage func(context.Context, APICollection) (APICollection, error)) APICollectionPage { 273 return APICollectionPage{ 274 fn: getNextPage, 275 ac: cur, 276 } 277} 278 279// APIContract api details. 280type APIContract struct { 281 autorest.Response `json:"-"` 282 // APIContractProperties - Api entity contract properties. 283 *APIContractProperties `json:"properties,omitempty"` 284 // ID - READ-ONLY; Resource ID. 285 ID *string `json:"id,omitempty"` 286 // Name - READ-ONLY; Resource name. 287 Name *string `json:"name,omitempty"` 288 // Type - READ-ONLY; Resource type for API Management resource. 289 Type *string `json:"type,omitempty"` 290} 291 292// MarshalJSON is the custom marshaler for APIContract. 293func (ac APIContract) MarshalJSON() ([]byte, error) { 294 objectMap := make(map[string]interface{}) 295 if ac.APIContractProperties != nil { 296 objectMap["properties"] = ac.APIContractProperties 297 } 298 return json.Marshal(objectMap) 299} 300 301// UnmarshalJSON is the custom unmarshaler for APIContract struct. 302func (ac *APIContract) UnmarshalJSON(body []byte) error { 303 var m map[string]*json.RawMessage 304 err := json.Unmarshal(body, &m) 305 if err != nil { 306 return err 307 } 308 for k, v := range m { 309 switch k { 310 case "properties": 311 if v != nil { 312 var APIContractProperties APIContractProperties 313 err = json.Unmarshal(*v, &APIContractProperties) 314 if err != nil { 315 return err 316 } 317 ac.APIContractProperties = &APIContractProperties 318 } 319 case "id": 320 if v != nil { 321 var ID string 322 err = json.Unmarshal(*v, &ID) 323 if err != nil { 324 return err 325 } 326 ac.ID = &ID 327 } 328 case "name": 329 if v != nil { 330 var name string 331 err = json.Unmarshal(*v, &name) 332 if err != nil { 333 return err 334 } 335 ac.Name = &name 336 } 337 case "type": 338 if v != nil { 339 var typeVar string 340 err = json.Unmarshal(*v, &typeVar) 341 if err != nil { 342 return err 343 } 344 ac.Type = &typeVar 345 } 346 } 347 } 348 349 return nil 350} 351 352// APIContractProperties api Entity Properties 353type APIContractProperties struct { 354 // SourceAPIID - API identifier of the source API. 355 SourceAPIID *string `json:"sourceApiId,omitempty"` 356 // DisplayName - API name. Must be 1 to 300 characters long. 357 DisplayName *string `json:"displayName,omitempty"` 358 // ServiceURL - Absolute URL of the backend service implementing this API. Cannot be more than 2000 characters long. 359 ServiceURL *string `json:"serviceUrl,omitempty"` 360 // 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. 361 Path *string `json:"path,omitempty"` 362 // Protocols - Describes on which protocols the operations in this API can be invoked. 363 Protocols *[]Protocol `json:"protocols,omitempty"` 364 // APIVersionSet - Version set details 365 APIVersionSet *APIVersionSetContractDetails `json:"apiVersionSet,omitempty"` 366 // Description - Description of the API. May include HTML formatting tags. 367 Description *string `json:"description,omitempty"` 368 // AuthenticationSettings - Collection of authentication settings included into this API. 369 AuthenticationSettings *AuthenticationSettingsContract `json:"authenticationSettings,omitempty"` 370 // SubscriptionKeyParameterNames - Protocols over which API is made available. 371 SubscriptionKeyParameterNames *SubscriptionKeyParameterNamesContract `json:"subscriptionKeyParameterNames,omitempty"` 372 // APIType - Type of API. Possible values include: 'HTTP', 'Soap' 373 APIType APIType `json:"type,omitempty"` 374 // APIRevision - Describes the Revision of the Api. If no value is provided, default revision 1 is created 375 APIRevision *string `json:"apiRevision,omitempty"` 376 // APIVersion - Indicates the Version identifier of the API if the API is versioned 377 APIVersion *string `json:"apiVersion,omitempty"` 378 // IsCurrent - Indicates if API revision is current api revision. 379 IsCurrent *bool `json:"isCurrent,omitempty"` 380 // IsOnline - READ-ONLY; Indicates if API revision is accessible via the gateway. 381 IsOnline *bool `json:"isOnline,omitempty"` 382 // APIRevisionDescription - Description of the Api Revision. 383 APIRevisionDescription *string `json:"apiRevisionDescription,omitempty"` 384 // APIVersionDescription - Description of the Api Version. 385 APIVersionDescription *string `json:"apiVersionDescription,omitempty"` 386 // APIVersionSetID - A resource identifier for the related ApiVersionSet. 387 APIVersionSetID *string `json:"apiVersionSetId,omitempty"` 388 // SubscriptionRequired - Specifies whether an API or Product subscription is required for accessing the API. 389 SubscriptionRequired *bool `json:"subscriptionRequired,omitempty"` 390} 391 392// MarshalJSON is the custom marshaler for APIContractProperties. 393func (acp APIContractProperties) MarshalJSON() ([]byte, error) { 394 objectMap := make(map[string]interface{}) 395 if acp.SourceAPIID != nil { 396 objectMap["sourceApiId"] = acp.SourceAPIID 397 } 398 if acp.DisplayName != nil { 399 objectMap["displayName"] = acp.DisplayName 400 } 401 if acp.ServiceURL != nil { 402 objectMap["serviceUrl"] = acp.ServiceURL 403 } 404 if acp.Path != nil { 405 objectMap["path"] = acp.Path 406 } 407 if acp.Protocols != nil { 408 objectMap["protocols"] = acp.Protocols 409 } 410 if acp.APIVersionSet != nil { 411 objectMap["apiVersionSet"] = acp.APIVersionSet 412 } 413 if acp.Description != nil { 414 objectMap["description"] = acp.Description 415 } 416 if acp.AuthenticationSettings != nil { 417 objectMap["authenticationSettings"] = acp.AuthenticationSettings 418 } 419 if acp.SubscriptionKeyParameterNames != nil { 420 objectMap["subscriptionKeyParameterNames"] = acp.SubscriptionKeyParameterNames 421 } 422 if acp.APIType != "" { 423 objectMap["type"] = acp.APIType 424 } 425 if acp.APIRevision != nil { 426 objectMap["apiRevision"] = acp.APIRevision 427 } 428 if acp.APIVersion != nil { 429 objectMap["apiVersion"] = acp.APIVersion 430 } 431 if acp.IsCurrent != nil { 432 objectMap["isCurrent"] = acp.IsCurrent 433 } 434 if acp.APIRevisionDescription != nil { 435 objectMap["apiRevisionDescription"] = acp.APIRevisionDescription 436 } 437 if acp.APIVersionDescription != nil { 438 objectMap["apiVersionDescription"] = acp.APIVersionDescription 439 } 440 if acp.APIVersionSetID != nil { 441 objectMap["apiVersionSetId"] = acp.APIVersionSetID 442 } 443 if acp.SubscriptionRequired != nil { 444 objectMap["subscriptionRequired"] = acp.SubscriptionRequired 445 } 446 return json.Marshal(objectMap) 447} 448 449// APIContractUpdateProperties API update contract properties. 450type APIContractUpdateProperties struct { 451 // DisplayName - API name. 452 DisplayName *string `json:"displayName,omitempty"` 453 // ServiceURL - Absolute URL of the backend service implementing this API. 454 ServiceURL *string `json:"serviceUrl,omitempty"` 455 // 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. 456 Path *string `json:"path,omitempty"` 457 // Protocols - Describes on which protocols the operations in this API can be invoked. 458 Protocols *[]Protocol `json:"protocols,omitempty"` 459 // Description - Description of the API. May include HTML formatting tags. 460 Description *string `json:"description,omitempty"` 461 // AuthenticationSettings - Collection of authentication settings included into this API. 462 AuthenticationSettings *AuthenticationSettingsContract `json:"authenticationSettings,omitempty"` 463 // SubscriptionKeyParameterNames - Protocols over which API is made available. 464 SubscriptionKeyParameterNames *SubscriptionKeyParameterNamesContract `json:"subscriptionKeyParameterNames,omitempty"` 465 // APIType - Type of API. Possible values include: 'HTTP', 'Soap' 466 APIType APIType `json:"type,omitempty"` 467 // APIRevision - Describes the Revision of the Api. If no value is provided, default revision 1 is created 468 APIRevision *string `json:"apiRevision,omitempty"` 469 // APIVersion - Indicates the Version identifier of the API if the API is versioned 470 APIVersion *string `json:"apiVersion,omitempty"` 471 // IsCurrent - Indicates if API revision is current api revision. 472 IsCurrent *bool `json:"isCurrent,omitempty"` 473 // IsOnline - READ-ONLY; Indicates if API revision is accessible via the gateway. 474 IsOnline *bool `json:"isOnline,omitempty"` 475 // APIRevisionDescription - Description of the Api Revision. 476 APIRevisionDescription *string `json:"apiRevisionDescription,omitempty"` 477 // APIVersionDescription - Description of the Api Version. 478 APIVersionDescription *string `json:"apiVersionDescription,omitempty"` 479 // APIVersionSetID - A resource identifier for the related ApiVersionSet. 480 APIVersionSetID *string `json:"apiVersionSetId,omitempty"` 481 // SubscriptionRequired - Specifies whether an API or Product subscription is required for accessing the API. 482 SubscriptionRequired *bool `json:"subscriptionRequired,omitempty"` 483} 484 485// MarshalJSON is the custom marshaler for APIContractUpdateProperties. 486func (acup APIContractUpdateProperties) MarshalJSON() ([]byte, error) { 487 objectMap := make(map[string]interface{}) 488 if acup.DisplayName != nil { 489 objectMap["displayName"] = acup.DisplayName 490 } 491 if acup.ServiceURL != nil { 492 objectMap["serviceUrl"] = acup.ServiceURL 493 } 494 if acup.Path != nil { 495 objectMap["path"] = acup.Path 496 } 497 if acup.Protocols != nil { 498 objectMap["protocols"] = acup.Protocols 499 } 500 if acup.Description != nil { 501 objectMap["description"] = acup.Description 502 } 503 if acup.AuthenticationSettings != nil { 504 objectMap["authenticationSettings"] = acup.AuthenticationSettings 505 } 506 if acup.SubscriptionKeyParameterNames != nil { 507 objectMap["subscriptionKeyParameterNames"] = acup.SubscriptionKeyParameterNames 508 } 509 if acup.APIType != "" { 510 objectMap["type"] = acup.APIType 511 } 512 if acup.APIRevision != nil { 513 objectMap["apiRevision"] = acup.APIRevision 514 } 515 if acup.APIVersion != nil { 516 objectMap["apiVersion"] = acup.APIVersion 517 } 518 if acup.IsCurrent != nil { 519 objectMap["isCurrent"] = acup.IsCurrent 520 } 521 if acup.APIRevisionDescription != nil { 522 objectMap["apiRevisionDescription"] = acup.APIRevisionDescription 523 } 524 if acup.APIVersionDescription != nil { 525 objectMap["apiVersionDescription"] = acup.APIVersionDescription 526 } 527 if acup.APIVersionSetID != nil { 528 objectMap["apiVersionSetId"] = acup.APIVersionSetID 529 } 530 if acup.SubscriptionRequired != nil { 531 objectMap["subscriptionRequired"] = acup.SubscriptionRequired 532 } 533 return json.Marshal(objectMap) 534} 535 536// APICreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 537// operation. 538type APICreateOrUpdateFuture struct { 539 azure.FutureAPI 540 // Result returns the result of the asynchronous operation. 541 // If the operation has not completed it will return an error. 542 Result func(APIClient) (APIContract, error) 543} 544 545// UnmarshalJSON is the custom unmarshaller for CreateFuture. 546func (future *APICreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 547 var azFuture azure.Future 548 if err := json.Unmarshal(body, &azFuture); err != nil { 549 return err 550 } 551 future.FutureAPI = &azFuture 552 future.Result = future.result 553 return nil 554} 555 556// result is the default implementation for APICreateOrUpdateFuture.Result. 557func (future *APICreateOrUpdateFuture) result(client APIClient) (ac APIContract, err error) { 558 var done bool 559 done, err = future.DoneWithContext(context.Background(), client) 560 if err != nil { 561 err = autorest.NewErrorWithError(err, "apimanagement.APICreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 562 return 563 } 564 if !done { 565 ac.Response.Response = future.Response() 566 err = azure.NewAsyncOpIncompleteError("apimanagement.APICreateOrUpdateFuture") 567 return 568 } 569 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 570 if ac.Response.Response, err = future.GetResult(sender); err == nil && ac.Response.Response.StatusCode != http.StatusNoContent { 571 ac, err = client.CreateOrUpdateResponder(ac.Response.Response) 572 if err != nil { 573 err = autorest.NewErrorWithError(err, "apimanagement.APICreateOrUpdateFuture", "Result", ac.Response.Response, "Failure responding to request") 574 } 575 } 576 return 577} 578 579// APICreateOrUpdateParameter API Create or Update Parameters. 580type APICreateOrUpdateParameter struct { 581 // APICreateOrUpdateProperties - Api entity create of update properties. 582 *APICreateOrUpdateProperties `json:"properties,omitempty"` 583} 584 585// MarshalJSON is the custom marshaler for APICreateOrUpdateParameter. 586func (acoup APICreateOrUpdateParameter) MarshalJSON() ([]byte, error) { 587 objectMap := make(map[string]interface{}) 588 if acoup.APICreateOrUpdateProperties != nil { 589 objectMap["properties"] = acoup.APICreateOrUpdateProperties 590 } 591 return json.Marshal(objectMap) 592} 593 594// UnmarshalJSON is the custom unmarshaler for APICreateOrUpdateParameter struct. 595func (acoup *APICreateOrUpdateParameter) UnmarshalJSON(body []byte) error { 596 var m map[string]*json.RawMessage 597 err := json.Unmarshal(body, &m) 598 if err != nil { 599 return err 600 } 601 for k, v := range m { 602 switch k { 603 case "properties": 604 if v != nil { 605 var APICreateOrUpdateProperties APICreateOrUpdateProperties 606 err = json.Unmarshal(*v, &APICreateOrUpdateProperties) 607 if err != nil { 608 return err 609 } 610 acoup.APICreateOrUpdateProperties = &APICreateOrUpdateProperties 611 } 612 } 613 } 614 615 return nil 616} 617 618// APICreateOrUpdateProperties api Create or Update Properties. 619type APICreateOrUpdateProperties struct { 620 // Value - Content value when Importing an API. 621 Value *string `json:"value,omitempty"` 622 // Format - Format of the Content in which the API is getting imported. Possible values include: 'WadlXML', 'WadlLinkJSON', 'SwaggerJSON', 'SwaggerLinkJSON', 'Wsdl', 'WsdlLink', 'Openapi', 'Openapijson', 'OpenapiLink', 'OpenapijsonLink' 623 Format ContentFormat `json:"format,omitempty"` 624 // WsdlSelector - Criteria to limit import of WSDL to a subset of the document. 625 WsdlSelector *APICreateOrUpdatePropertiesWsdlSelector `json:"wsdlSelector,omitempty"` 626 // SoapAPIType - Type of Api to create. 627 // * `http` creates a SOAP to REST API 628 // * `soap` creates a SOAP pass-through API. Possible values include: 'SoapToRest', 'SoapPassThrough' 629 SoapAPIType SoapAPIType `json:"apiType,omitempty"` 630 // SourceAPIID - API identifier of the source API. 631 SourceAPIID *string `json:"sourceApiId,omitempty"` 632 // DisplayName - API name. Must be 1 to 300 characters long. 633 DisplayName *string `json:"displayName,omitempty"` 634 // ServiceURL - Absolute URL of the backend service implementing this API. Cannot be more than 2000 characters long. 635 ServiceURL *string `json:"serviceUrl,omitempty"` 636 // 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. 637 Path *string `json:"path,omitempty"` 638 // Protocols - Describes on which protocols the operations in this API can be invoked. 639 Protocols *[]Protocol `json:"protocols,omitempty"` 640 // APIVersionSet - Version set details 641 APIVersionSet *APIVersionSetContractDetails `json:"apiVersionSet,omitempty"` 642 // Description - Description of the API. May include HTML formatting tags. 643 Description *string `json:"description,omitempty"` 644 // AuthenticationSettings - Collection of authentication settings included into this API. 645 AuthenticationSettings *AuthenticationSettingsContract `json:"authenticationSettings,omitempty"` 646 // SubscriptionKeyParameterNames - Protocols over which API is made available. 647 SubscriptionKeyParameterNames *SubscriptionKeyParameterNamesContract `json:"subscriptionKeyParameterNames,omitempty"` 648 // APIType - Type of API. Possible values include: 'HTTP', 'Soap' 649 APIType APIType `json:"type,omitempty"` 650 // APIRevision - Describes the Revision of the Api. If no value is provided, default revision 1 is created 651 APIRevision *string `json:"apiRevision,omitempty"` 652 // APIVersion - Indicates the Version identifier of the API if the API is versioned 653 APIVersion *string `json:"apiVersion,omitempty"` 654 // IsCurrent - Indicates if API revision is current api revision. 655 IsCurrent *bool `json:"isCurrent,omitempty"` 656 // IsOnline - READ-ONLY; Indicates if API revision is accessible via the gateway. 657 IsOnline *bool `json:"isOnline,omitempty"` 658 // APIRevisionDescription - Description of the Api Revision. 659 APIRevisionDescription *string `json:"apiRevisionDescription,omitempty"` 660 // APIVersionDescription - Description of the Api Version. 661 APIVersionDescription *string `json:"apiVersionDescription,omitempty"` 662 // APIVersionSetID - A resource identifier for the related ApiVersionSet. 663 APIVersionSetID *string `json:"apiVersionSetId,omitempty"` 664 // SubscriptionRequired - Specifies whether an API or Product subscription is required for accessing the API. 665 SubscriptionRequired *bool `json:"subscriptionRequired,omitempty"` 666} 667 668// MarshalJSON is the custom marshaler for APICreateOrUpdateProperties. 669func (acoup APICreateOrUpdateProperties) MarshalJSON() ([]byte, error) { 670 objectMap := make(map[string]interface{}) 671 if acoup.Value != nil { 672 objectMap["value"] = acoup.Value 673 } 674 if acoup.Format != "" { 675 objectMap["format"] = acoup.Format 676 } 677 if acoup.WsdlSelector != nil { 678 objectMap["wsdlSelector"] = acoup.WsdlSelector 679 } 680 if acoup.SoapAPIType != "" { 681 objectMap["apiType"] = acoup.SoapAPIType 682 } 683 if acoup.SourceAPIID != nil { 684 objectMap["sourceApiId"] = acoup.SourceAPIID 685 } 686 if acoup.DisplayName != nil { 687 objectMap["displayName"] = acoup.DisplayName 688 } 689 if acoup.ServiceURL != nil { 690 objectMap["serviceUrl"] = acoup.ServiceURL 691 } 692 if acoup.Path != nil { 693 objectMap["path"] = acoup.Path 694 } 695 if acoup.Protocols != nil { 696 objectMap["protocols"] = acoup.Protocols 697 } 698 if acoup.APIVersionSet != nil { 699 objectMap["apiVersionSet"] = acoup.APIVersionSet 700 } 701 if acoup.Description != nil { 702 objectMap["description"] = acoup.Description 703 } 704 if acoup.AuthenticationSettings != nil { 705 objectMap["authenticationSettings"] = acoup.AuthenticationSettings 706 } 707 if acoup.SubscriptionKeyParameterNames != nil { 708 objectMap["subscriptionKeyParameterNames"] = acoup.SubscriptionKeyParameterNames 709 } 710 if acoup.APIType != "" { 711 objectMap["type"] = acoup.APIType 712 } 713 if acoup.APIRevision != nil { 714 objectMap["apiRevision"] = acoup.APIRevision 715 } 716 if acoup.APIVersion != nil { 717 objectMap["apiVersion"] = acoup.APIVersion 718 } 719 if acoup.IsCurrent != nil { 720 objectMap["isCurrent"] = acoup.IsCurrent 721 } 722 if acoup.APIRevisionDescription != nil { 723 objectMap["apiRevisionDescription"] = acoup.APIRevisionDescription 724 } 725 if acoup.APIVersionDescription != nil { 726 objectMap["apiVersionDescription"] = acoup.APIVersionDescription 727 } 728 if acoup.APIVersionSetID != nil { 729 objectMap["apiVersionSetId"] = acoup.APIVersionSetID 730 } 731 if acoup.SubscriptionRequired != nil { 732 objectMap["subscriptionRequired"] = acoup.SubscriptionRequired 733 } 734 return json.Marshal(objectMap) 735} 736 737// APICreateOrUpdatePropertiesWsdlSelector criteria to limit import of WSDL to a subset of the document. 738type APICreateOrUpdatePropertiesWsdlSelector struct { 739 // WsdlServiceName - Name of service to import from WSDL 740 WsdlServiceName *string `json:"wsdlServiceName,omitempty"` 741 // WsdlEndpointName - Name of endpoint(port) to import from WSDL 742 WsdlEndpointName *string `json:"wsdlEndpointName,omitempty"` 743} 744 745// APIEntityBaseContract API base contract details. 746type APIEntityBaseContract struct { 747 // Description - Description of the API. May include HTML formatting tags. 748 Description *string `json:"description,omitempty"` 749 // AuthenticationSettings - Collection of authentication settings included into this API. 750 AuthenticationSettings *AuthenticationSettingsContract `json:"authenticationSettings,omitempty"` 751 // SubscriptionKeyParameterNames - Protocols over which API is made available. 752 SubscriptionKeyParameterNames *SubscriptionKeyParameterNamesContract `json:"subscriptionKeyParameterNames,omitempty"` 753 // APIType - Type of API. Possible values include: 'HTTP', 'Soap' 754 APIType APIType `json:"type,omitempty"` 755 // APIRevision - Describes the Revision of the Api. If no value is provided, default revision 1 is created 756 APIRevision *string `json:"apiRevision,omitempty"` 757 // APIVersion - Indicates the Version identifier of the API if the API is versioned 758 APIVersion *string `json:"apiVersion,omitempty"` 759 // IsCurrent - Indicates if API revision is current api revision. 760 IsCurrent *bool `json:"isCurrent,omitempty"` 761 // IsOnline - READ-ONLY; Indicates if API revision is accessible via the gateway. 762 IsOnline *bool `json:"isOnline,omitempty"` 763 // APIRevisionDescription - Description of the Api Revision. 764 APIRevisionDescription *string `json:"apiRevisionDescription,omitempty"` 765 // APIVersionDescription - Description of the Api Version. 766 APIVersionDescription *string `json:"apiVersionDescription,omitempty"` 767 // APIVersionSetID - A resource identifier for the related ApiVersionSet. 768 APIVersionSetID *string `json:"apiVersionSetId,omitempty"` 769 // SubscriptionRequired - Specifies whether an API or Product subscription is required for accessing the API. 770 SubscriptionRequired *bool `json:"subscriptionRequired,omitempty"` 771} 772 773// MarshalJSON is the custom marshaler for APIEntityBaseContract. 774func (aebc APIEntityBaseContract) MarshalJSON() ([]byte, error) { 775 objectMap := make(map[string]interface{}) 776 if aebc.Description != nil { 777 objectMap["description"] = aebc.Description 778 } 779 if aebc.AuthenticationSettings != nil { 780 objectMap["authenticationSettings"] = aebc.AuthenticationSettings 781 } 782 if aebc.SubscriptionKeyParameterNames != nil { 783 objectMap["subscriptionKeyParameterNames"] = aebc.SubscriptionKeyParameterNames 784 } 785 if aebc.APIType != "" { 786 objectMap["type"] = aebc.APIType 787 } 788 if aebc.APIRevision != nil { 789 objectMap["apiRevision"] = aebc.APIRevision 790 } 791 if aebc.APIVersion != nil { 792 objectMap["apiVersion"] = aebc.APIVersion 793 } 794 if aebc.IsCurrent != nil { 795 objectMap["isCurrent"] = aebc.IsCurrent 796 } 797 if aebc.APIRevisionDescription != nil { 798 objectMap["apiRevisionDescription"] = aebc.APIRevisionDescription 799 } 800 if aebc.APIVersionDescription != nil { 801 objectMap["apiVersionDescription"] = aebc.APIVersionDescription 802 } 803 if aebc.APIVersionSetID != nil { 804 objectMap["apiVersionSetId"] = aebc.APIVersionSetID 805 } 806 if aebc.SubscriptionRequired != nil { 807 objectMap["subscriptionRequired"] = aebc.SubscriptionRequired 808 } 809 return json.Marshal(objectMap) 810} 811 812// APIExportResult API Export result. 813type APIExportResult struct { 814 autorest.Response `json:"-"` 815 // ID - ResourceId of the API which was exported. 816 ID *string `json:"id,omitempty"` 817 // ExportResultFormat - Format in which the Api Details are exported to the Storage Blob with Sas Key valid for 5 minutes. Possible values include: 'ExportResultFormatSwagger', 'ExportResultFormatWsdl', 'ExportResultFormatWadl', 'ExportResultFormatOpenAPI' 818 ExportResultFormat ExportResultFormat `json:"format,omitempty"` 819 // Value - The object defining the schema of the exported Api Detail 820 Value *APIExportResultValue `json:"value,omitempty"` 821} 822 823// APIExportResultValue the object defining the schema of the exported Api Detail 824type APIExportResultValue struct { 825 // Link - Link to the Storage Blob containing the result of the export operation. The Blob Uri is only valid for 5 minutes. 826 Link *string `json:"link,omitempty"` 827} 828 829// ApimResource the Resource definition. 830type ApimResource struct { 831 // ID - READ-ONLY; Resource ID. 832 ID *string `json:"id,omitempty"` 833 // Name - READ-ONLY; Resource name. 834 Name *string `json:"name,omitempty"` 835 // Type - READ-ONLY; Resource type for API Management resource is set to Microsoft.ApiManagement. 836 Type *string `json:"type,omitempty"` 837 // Tags - Resource tags. 838 Tags map[string]*string `json:"tags"` 839} 840 841// MarshalJSON is the custom marshaler for ApimResource. 842func (ar ApimResource) MarshalJSON() ([]byte, error) { 843 objectMap := make(map[string]interface{}) 844 if ar.Tags != nil { 845 objectMap["tags"] = ar.Tags 846 } 847 return json.Marshal(objectMap) 848} 849 850// APIReleaseCollection paged ApiRelease list representation. 851type APIReleaseCollection struct { 852 autorest.Response `json:"-"` 853 // Value - READ-ONLY; Page values. 854 Value *[]APIReleaseContract `json:"value,omitempty"` 855 // NextLink - READ-ONLY; Next page link if any. 856 NextLink *string `json:"nextLink,omitempty"` 857} 858 859// MarshalJSON is the custom marshaler for APIReleaseCollection. 860func (arc APIReleaseCollection) MarshalJSON() ([]byte, error) { 861 objectMap := make(map[string]interface{}) 862 return json.Marshal(objectMap) 863} 864 865// APIReleaseCollectionIterator provides access to a complete listing of APIReleaseContract values. 866type APIReleaseCollectionIterator struct { 867 i int 868 page APIReleaseCollectionPage 869} 870 871// NextWithContext advances to the next value. If there was an error making 872// the request the iterator does not advance and the error is returned. 873func (iter *APIReleaseCollectionIterator) NextWithContext(ctx context.Context) (err error) { 874 if tracing.IsEnabled() { 875 ctx = tracing.StartSpan(ctx, fqdn+"/APIReleaseCollectionIterator.NextWithContext") 876 defer func() { 877 sc := -1 878 if iter.Response().Response.Response != nil { 879 sc = iter.Response().Response.Response.StatusCode 880 } 881 tracing.EndSpan(ctx, sc, err) 882 }() 883 } 884 iter.i++ 885 if iter.i < len(iter.page.Values()) { 886 return nil 887 } 888 err = iter.page.NextWithContext(ctx) 889 if err != nil { 890 iter.i-- 891 return err 892 } 893 iter.i = 0 894 return nil 895} 896 897// Next advances to the next value. If there was an error making 898// the request the iterator does not advance and the error is returned. 899// Deprecated: Use NextWithContext() instead. 900func (iter *APIReleaseCollectionIterator) Next() error { 901 return iter.NextWithContext(context.Background()) 902} 903 904// NotDone returns true if the enumeration should be started or is not yet complete. 905func (iter APIReleaseCollectionIterator) NotDone() bool { 906 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 907} 908 909// Response returns the raw server response from the last page request. 910func (iter APIReleaseCollectionIterator) Response() APIReleaseCollection { 911 return iter.page.Response() 912} 913 914// Value returns the current value or a zero-initialized value if the 915// iterator has advanced beyond the end of the collection. 916func (iter APIReleaseCollectionIterator) Value() APIReleaseContract { 917 if !iter.page.NotDone() { 918 return APIReleaseContract{} 919 } 920 return iter.page.Values()[iter.i] 921} 922 923// Creates a new instance of the APIReleaseCollectionIterator type. 924func NewAPIReleaseCollectionIterator(page APIReleaseCollectionPage) APIReleaseCollectionIterator { 925 return APIReleaseCollectionIterator{page: page} 926} 927 928// IsEmpty returns true if the ListResult contains no values. 929func (arc APIReleaseCollection) IsEmpty() bool { 930 return arc.Value == nil || len(*arc.Value) == 0 931} 932 933// hasNextLink returns true if the NextLink is not empty. 934func (arc APIReleaseCollection) hasNextLink() bool { 935 return arc.NextLink != nil && len(*arc.NextLink) != 0 936} 937 938// aPIReleaseCollectionPreparer prepares a request to retrieve the next set of results. 939// It returns nil if no more results exist. 940func (arc APIReleaseCollection) aPIReleaseCollectionPreparer(ctx context.Context) (*http.Request, error) { 941 if !arc.hasNextLink() { 942 return nil, nil 943 } 944 return autorest.Prepare((&http.Request{}).WithContext(ctx), 945 autorest.AsJSON(), 946 autorest.AsGet(), 947 autorest.WithBaseURL(to.String(arc.NextLink))) 948} 949 950// APIReleaseCollectionPage contains a page of APIReleaseContract values. 951type APIReleaseCollectionPage struct { 952 fn func(context.Context, APIReleaseCollection) (APIReleaseCollection, error) 953 arc APIReleaseCollection 954} 955 956// NextWithContext advances to the next page of values. If there was an error making 957// the request the page does not advance and the error is returned. 958func (page *APIReleaseCollectionPage) NextWithContext(ctx context.Context) (err error) { 959 if tracing.IsEnabled() { 960 ctx = tracing.StartSpan(ctx, fqdn+"/APIReleaseCollectionPage.NextWithContext") 961 defer func() { 962 sc := -1 963 if page.Response().Response.Response != nil { 964 sc = page.Response().Response.Response.StatusCode 965 } 966 tracing.EndSpan(ctx, sc, err) 967 }() 968 } 969 for { 970 next, err := page.fn(ctx, page.arc) 971 if err != nil { 972 return err 973 } 974 page.arc = next 975 if !next.hasNextLink() || !next.IsEmpty() { 976 break 977 } 978 } 979 return nil 980} 981 982// Next advances to the next page of values. If there was an error making 983// the request the page does not advance and the error is returned. 984// Deprecated: Use NextWithContext() instead. 985func (page *APIReleaseCollectionPage) Next() error { 986 return page.NextWithContext(context.Background()) 987} 988 989// NotDone returns true if the page enumeration should be started or is not yet complete. 990func (page APIReleaseCollectionPage) NotDone() bool { 991 return !page.arc.IsEmpty() 992} 993 994// Response returns the raw server response from the last page request. 995func (page APIReleaseCollectionPage) Response() APIReleaseCollection { 996 return page.arc 997} 998 999// Values returns the slice of values for the current page or nil if there are no values. 1000func (page APIReleaseCollectionPage) Values() []APIReleaseContract { 1001 if page.arc.IsEmpty() { 1002 return nil 1003 } 1004 return *page.arc.Value 1005} 1006 1007// Creates a new instance of the APIReleaseCollectionPage type. 1008func NewAPIReleaseCollectionPage(cur APIReleaseCollection, getNextPage func(context.Context, APIReleaseCollection) (APIReleaseCollection, error)) APIReleaseCollectionPage { 1009 return APIReleaseCollectionPage{ 1010 fn: getNextPage, 1011 arc: cur, 1012 } 1013} 1014 1015// APIReleaseContract apiRelease details. 1016type APIReleaseContract struct { 1017 autorest.Response `json:"-"` 1018 // APIReleaseContractProperties - ApiRelease entity contract properties. 1019 *APIReleaseContractProperties `json:"properties,omitempty"` 1020 // ID - READ-ONLY; Resource ID. 1021 ID *string `json:"id,omitempty"` 1022 // Name - READ-ONLY; Resource name. 1023 Name *string `json:"name,omitempty"` 1024 // Type - READ-ONLY; Resource type for API Management resource. 1025 Type *string `json:"type,omitempty"` 1026} 1027 1028// MarshalJSON is the custom marshaler for APIReleaseContract. 1029func (arc APIReleaseContract) MarshalJSON() ([]byte, error) { 1030 objectMap := make(map[string]interface{}) 1031 if arc.APIReleaseContractProperties != nil { 1032 objectMap["properties"] = arc.APIReleaseContractProperties 1033 } 1034 return json.Marshal(objectMap) 1035} 1036 1037// UnmarshalJSON is the custom unmarshaler for APIReleaseContract struct. 1038func (arc *APIReleaseContract) UnmarshalJSON(body []byte) error { 1039 var m map[string]*json.RawMessage 1040 err := json.Unmarshal(body, &m) 1041 if err != nil { 1042 return err 1043 } 1044 for k, v := range m { 1045 switch k { 1046 case "properties": 1047 if v != nil { 1048 var APIReleaseContractProperties APIReleaseContractProperties 1049 err = json.Unmarshal(*v, &APIReleaseContractProperties) 1050 if err != nil { 1051 return err 1052 } 1053 arc.APIReleaseContractProperties = &APIReleaseContractProperties 1054 } 1055 case "id": 1056 if v != nil { 1057 var ID string 1058 err = json.Unmarshal(*v, &ID) 1059 if err != nil { 1060 return err 1061 } 1062 arc.ID = &ID 1063 } 1064 case "name": 1065 if v != nil { 1066 var name string 1067 err = json.Unmarshal(*v, &name) 1068 if err != nil { 1069 return err 1070 } 1071 arc.Name = &name 1072 } 1073 case "type": 1074 if v != nil { 1075 var typeVar string 1076 err = json.Unmarshal(*v, &typeVar) 1077 if err != nil { 1078 return err 1079 } 1080 arc.Type = &typeVar 1081 } 1082 } 1083 } 1084 1085 return nil 1086} 1087 1088// APIReleaseContractProperties API Release details 1089type APIReleaseContractProperties struct { 1090 // APIID - Identifier of the API the release belongs to. 1091 APIID *string `json:"apiId,omitempty"` 1092 // CreatedDateTime - READ-ONLY; The time the API was released. The date conforms to the following format: yyyy-MM-ddTHH:mm:ssZ as specified by the ISO 8601 standard. 1093 CreatedDateTime *date.Time `json:"createdDateTime,omitempty"` 1094 // UpdatedDateTime - READ-ONLY; The time the API release was updated. 1095 UpdatedDateTime *date.Time `json:"updatedDateTime,omitempty"` 1096 // Notes - Release Notes 1097 Notes *string `json:"notes,omitempty"` 1098} 1099 1100// MarshalJSON is the custom marshaler for APIReleaseContractProperties. 1101func (arcp APIReleaseContractProperties) MarshalJSON() ([]byte, error) { 1102 objectMap := make(map[string]interface{}) 1103 if arcp.APIID != nil { 1104 objectMap["apiId"] = arcp.APIID 1105 } 1106 if arcp.Notes != nil { 1107 objectMap["notes"] = arcp.Notes 1108 } 1109 return json.Marshal(objectMap) 1110} 1111 1112// APIRevisionCollection paged Api Revision list representation. 1113type APIRevisionCollection struct { 1114 autorest.Response `json:"-"` 1115 // Value - READ-ONLY; Page values. 1116 Value *[]APIRevisionContract `json:"value,omitempty"` 1117 // NextLink - READ-ONLY; Next page link if any. 1118 NextLink *string `json:"nextLink,omitempty"` 1119} 1120 1121// MarshalJSON is the custom marshaler for APIRevisionCollection. 1122func (arc APIRevisionCollection) MarshalJSON() ([]byte, error) { 1123 objectMap := make(map[string]interface{}) 1124 return json.Marshal(objectMap) 1125} 1126 1127// APIRevisionCollectionIterator provides access to a complete listing of APIRevisionContract values. 1128type APIRevisionCollectionIterator struct { 1129 i int 1130 page APIRevisionCollectionPage 1131} 1132 1133// NextWithContext advances to the next value. If there was an error making 1134// the request the iterator does not advance and the error is returned. 1135func (iter *APIRevisionCollectionIterator) NextWithContext(ctx context.Context) (err error) { 1136 if tracing.IsEnabled() { 1137 ctx = tracing.StartSpan(ctx, fqdn+"/APIRevisionCollectionIterator.NextWithContext") 1138 defer func() { 1139 sc := -1 1140 if iter.Response().Response.Response != nil { 1141 sc = iter.Response().Response.Response.StatusCode 1142 } 1143 tracing.EndSpan(ctx, sc, err) 1144 }() 1145 } 1146 iter.i++ 1147 if iter.i < len(iter.page.Values()) { 1148 return nil 1149 } 1150 err = iter.page.NextWithContext(ctx) 1151 if err != nil { 1152 iter.i-- 1153 return err 1154 } 1155 iter.i = 0 1156 return nil 1157} 1158 1159// Next advances to the next value. If there was an error making 1160// the request the iterator does not advance and the error is returned. 1161// Deprecated: Use NextWithContext() instead. 1162func (iter *APIRevisionCollectionIterator) Next() error { 1163 return iter.NextWithContext(context.Background()) 1164} 1165 1166// NotDone returns true if the enumeration should be started or is not yet complete. 1167func (iter APIRevisionCollectionIterator) NotDone() bool { 1168 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 1169} 1170 1171// Response returns the raw server response from the last page request. 1172func (iter APIRevisionCollectionIterator) Response() APIRevisionCollection { 1173 return iter.page.Response() 1174} 1175 1176// Value returns the current value or a zero-initialized value if the 1177// iterator has advanced beyond the end of the collection. 1178func (iter APIRevisionCollectionIterator) Value() APIRevisionContract { 1179 if !iter.page.NotDone() { 1180 return APIRevisionContract{} 1181 } 1182 return iter.page.Values()[iter.i] 1183} 1184 1185// Creates a new instance of the APIRevisionCollectionIterator type. 1186func NewAPIRevisionCollectionIterator(page APIRevisionCollectionPage) APIRevisionCollectionIterator { 1187 return APIRevisionCollectionIterator{page: page} 1188} 1189 1190// IsEmpty returns true if the ListResult contains no values. 1191func (arc APIRevisionCollection) IsEmpty() bool { 1192 return arc.Value == nil || len(*arc.Value) == 0 1193} 1194 1195// hasNextLink returns true if the NextLink is not empty. 1196func (arc APIRevisionCollection) hasNextLink() bool { 1197 return arc.NextLink != nil && len(*arc.NextLink) != 0 1198} 1199 1200// aPIRevisionCollectionPreparer prepares a request to retrieve the next set of results. 1201// It returns nil if no more results exist. 1202func (arc APIRevisionCollection) aPIRevisionCollectionPreparer(ctx context.Context) (*http.Request, error) { 1203 if !arc.hasNextLink() { 1204 return nil, nil 1205 } 1206 return autorest.Prepare((&http.Request{}).WithContext(ctx), 1207 autorest.AsJSON(), 1208 autorest.AsGet(), 1209 autorest.WithBaseURL(to.String(arc.NextLink))) 1210} 1211 1212// APIRevisionCollectionPage contains a page of APIRevisionContract values. 1213type APIRevisionCollectionPage struct { 1214 fn func(context.Context, APIRevisionCollection) (APIRevisionCollection, error) 1215 arc APIRevisionCollection 1216} 1217 1218// NextWithContext advances to the next page of values. If there was an error making 1219// the request the page does not advance and the error is returned. 1220func (page *APIRevisionCollectionPage) NextWithContext(ctx context.Context) (err error) { 1221 if tracing.IsEnabled() { 1222 ctx = tracing.StartSpan(ctx, fqdn+"/APIRevisionCollectionPage.NextWithContext") 1223 defer func() { 1224 sc := -1 1225 if page.Response().Response.Response != nil { 1226 sc = page.Response().Response.Response.StatusCode 1227 } 1228 tracing.EndSpan(ctx, sc, err) 1229 }() 1230 } 1231 for { 1232 next, err := page.fn(ctx, page.arc) 1233 if err != nil { 1234 return err 1235 } 1236 page.arc = next 1237 if !next.hasNextLink() || !next.IsEmpty() { 1238 break 1239 } 1240 } 1241 return nil 1242} 1243 1244// Next advances to the next page of values. If there was an error making 1245// the request the page does not advance and the error is returned. 1246// Deprecated: Use NextWithContext() instead. 1247func (page *APIRevisionCollectionPage) Next() error { 1248 return page.NextWithContext(context.Background()) 1249} 1250 1251// NotDone returns true if the page enumeration should be started or is not yet complete. 1252func (page APIRevisionCollectionPage) NotDone() bool { 1253 return !page.arc.IsEmpty() 1254} 1255 1256// Response returns the raw server response from the last page request. 1257func (page APIRevisionCollectionPage) Response() APIRevisionCollection { 1258 return page.arc 1259} 1260 1261// Values returns the slice of values for the current page or nil if there are no values. 1262func (page APIRevisionCollectionPage) Values() []APIRevisionContract { 1263 if page.arc.IsEmpty() { 1264 return nil 1265 } 1266 return *page.arc.Value 1267} 1268 1269// Creates a new instance of the APIRevisionCollectionPage type. 1270func NewAPIRevisionCollectionPage(cur APIRevisionCollection, getNextPage func(context.Context, APIRevisionCollection) (APIRevisionCollection, error)) APIRevisionCollectionPage { 1271 return APIRevisionCollectionPage{ 1272 fn: getNextPage, 1273 arc: cur, 1274 } 1275} 1276 1277// APIRevisionContract summary of revision metadata. 1278type APIRevisionContract struct { 1279 // APIID - READ-ONLY; Identifier of the API Revision. 1280 APIID *string `json:"apiId,omitempty"` 1281 // APIRevision - READ-ONLY; Revision number of API. 1282 APIRevision *string `json:"apiRevision,omitempty"` 1283 // CreatedDateTime - READ-ONLY; The time the API Revision was created. The date conforms to the following format: yyyy-MM-ddTHH:mm:ssZ as specified by the ISO 8601 standard. 1284 CreatedDateTime *date.Time `json:"createdDateTime,omitempty"` 1285 // UpdatedDateTime - READ-ONLY; The time the API Revision were updated. The date conforms to the following format: yyyy-MM-ddTHH:mm:ssZ as specified by the ISO 8601 standard. 1286 UpdatedDateTime *date.Time `json:"updatedDateTime,omitempty"` 1287 // Description - READ-ONLY; Description of the API Revision. 1288 Description *string `json:"description,omitempty"` 1289 // PrivateURL - READ-ONLY; Gateway URL for accessing the non-current API Revision. 1290 PrivateURL *string `json:"privateUrl,omitempty"` 1291 // IsOnline - READ-ONLY; Indicates if API revision is the current api revision. 1292 IsOnline *bool `json:"isOnline,omitempty"` 1293 // IsCurrent - READ-ONLY; Indicates if API revision is accessible via the gateway. 1294 IsCurrent *bool `json:"isCurrent,omitempty"` 1295} 1296 1297// MarshalJSON is the custom marshaler for APIRevisionContract. 1298func (arc APIRevisionContract) MarshalJSON() ([]byte, error) { 1299 objectMap := make(map[string]interface{}) 1300 return json.Marshal(objectMap) 1301} 1302 1303// APIRevisionInfoContract object used to create an API Revision or Version based on an existing API 1304// Revision 1305type APIRevisionInfoContract struct { 1306 // SourceAPIID - Resource identifier of API to be used to create the revision from. 1307 SourceAPIID *string `json:"sourceApiId,omitempty"` 1308 // APIVersionName - Version identifier for the new API Version. 1309 APIVersionName *string `json:"apiVersionName,omitempty"` 1310 // APIRevisionDescription - Description of new API Revision. 1311 APIRevisionDescription *string `json:"apiRevisionDescription,omitempty"` 1312 // APIVersionSet - Version set details 1313 APIVersionSet *APIVersionSetContractDetails `json:"apiVersionSet,omitempty"` 1314} 1315 1316// APITagResourceContractProperties API contract properties for the Tag Resources. 1317type APITagResourceContractProperties struct { 1318 // ID - API identifier in the form /apis/{apiId}. 1319 ID *string `json:"id,omitempty"` 1320 // Name - API name. 1321 Name *string `json:"name,omitempty"` 1322 // ServiceURL - Absolute URL of the backend service implementing this API. 1323 ServiceURL *string `json:"serviceUrl,omitempty"` 1324 // 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. 1325 Path *string `json:"path,omitempty"` 1326 // Protocols - Describes on which protocols the operations in this API can be invoked. 1327 Protocols *[]Protocol `json:"protocols,omitempty"` 1328 // Description - Description of the API. May include HTML formatting tags. 1329 Description *string `json:"description,omitempty"` 1330 // AuthenticationSettings - Collection of authentication settings included into this API. 1331 AuthenticationSettings *AuthenticationSettingsContract `json:"authenticationSettings,omitempty"` 1332 // SubscriptionKeyParameterNames - Protocols over which API is made available. 1333 SubscriptionKeyParameterNames *SubscriptionKeyParameterNamesContract `json:"subscriptionKeyParameterNames,omitempty"` 1334 // APIType - Type of API. Possible values include: 'HTTP', 'Soap' 1335 APIType APIType `json:"type,omitempty"` 1336 // APIRevision - Describes the Revision of the Api. If no value is provided, default revision 1 is created 1337 APIRevision *string `json:"apiRevision,omitempty"` 1338 // APIVersion - Indicates the Version identifier of the API if the API is versioned 1339 APIVersion *string `json:"apiVersion,omitempty"` 1340 // IsCurrent - Indicates if API revision is current api revision. 1341 IsCurrent *bool `json:"isCurrent,omitempty"` 1342 // IsOnline - READ-ONLY; Indicates if API revision is accessible via the gateway. 1343 IsOnline *bool `json:"isOnline,omitempty"` 1344 // APIRevisionDescription - Description of the Api Revision. 1345 APIRevisionDescription *string `json:"apiRevisionDescription,omitempty"` 1346 // APIVersionDescription - Description of the Api Version. 1347 APIVersionDescription *string `json:"apiVersionDescription,omitempty"` 1348 // APIVersionSetID - A resource identifier for the related ApiVersionSet. 1349 APIVersionSetID *string `json:"apiVersionSetId,omitempty"` 1350 // SubscriptionRequired - Specifies whether an API or Product subscription is required for accessing the API. 1351 SubscriptionRequired *bool `json:"subscriptionRequired,omitempty"` 1352} 1353 1354// MarshalJSON is the custom marshaler for APITagResourceContractProperties. 1355func (atrcp APITagResourceContractProperties) MarshalJSON() ([]byte, error) { 1356 objectMap := make(map[string]interface{}) 1357 if atrcp.ID != nil { 1358 objectMap["id"] = atrcp.ID 1359 } 1360 if atrcp.Name != nil { 1361 objectMap["name"] = atrcp.Name 1362 } 1363 if atrcp.ServiceURL != nil { 1364 objectMap["serviceUrl"] = atrcp.ServiceURL 1365 } 1366 if atrcp.Path != nil { 1367 objectMap["path"] = atrcp.Path 1368 } 1369 if atrcp.Protocols != nil { 1370 objectMap["protocols"] = atrcp.Protocols 1371 } 1372 if atrcp.Description != nil { 1373 objectMap["description"] = atrcp.Description 1374 } 1375 if atrcp.AuthenticationSettings != nil { 1376 objectMap["authenticationSettings"] = atrcp.AuthenticationSettings 1377 } 1378 if atrcp.SubscriptionKeyParameterNames != nil { 1379 objectMap["subscriptionKeyParameterNames"] = atrcp.SubscriptionKeyParameterNames 1380 } 1381 if atrcp.APIType != "" { 1382 objectMap["type"] = atrcp.APIType 1383 } 1384 if atrcp.APIRevision != nil { 1385 objectMap["apiRevision"] = atrcp.APIRevision 1386 } 1387 if atrcp.APIVersion != nil { 1388 objectMap["apiVersion"] = atrcp.APIVersion 1389 } 1390 if atrcp.IsCurrent != nil { 1391 objectMap["isCurrent"] = atrcp.IsCurrent 1392 } 1393 if atrcp.APIRevisionDescription != nil { 1394 objectMap["apiRevisionDescription"] = atrcp.APIRevisionDescription 1395 } 1396 if atrcp.APIVersionDescription != nil { 1397 objectMap["apiVersionDescription"] = atrcp.APIVersionDescription 1398 } 1399 if atrcp.APIVersionSetID != nil { 1400 objectMap["apiVersionSetId"] = atrcp.APIVersionSetID 1401 } 1402 if atrcp.SubscriptionRequired != nil { 1403 objectMap["subscriptionRequired"] = atrcp.SubscriptionRequired 1404 } 1405 return json.Marshal(objectMap) 1406} 1407 1408// APIUpdateContract API update contract details. 1409type APIUpdateContract struct { 1410 // APIContractUpdateProperties - Properties of the API entity that can be updated. 1411 *APIContractUpdateProperties `json:"properties,omitempty"` 1412} 1413 1414// MarshalJSON is the custom marshaler for APIUpdateContract. 1415func (auc APIUpdateContract) MarshalJSON() ([]byte, error) { 1416 objectMap := make(map[string]interface{}) 1417 if auc.APIContractUpdateProperties != nil { 1418 objectMap["properties"] = auc.APIContractUpdateProperties 1419 } 1420 return json.Marshal(objectMap) 1421} 1422 1423// UnmarshalJSON is the custom unmarshaler for APIUpdateContract struct. 1424func (auc *APIUpdateContract) UnmarshalJSON(body []byte) error { 1425 var m map[string]*json.RawMessage 1426 err := json.Unmarshal(body, &m) 1427 if err != nil { 1428 return err 1429 } 1430 for k, v := range m { 1431 switch k { 1432 case "properties": 1433 if v != nil { 1434 var APIContractUpdateProperties APIContractUpdateProperties 1435 err = json.Unmarshal(*v, &APIContractUpdateProperties) 1436 if err != nil { 1437 return err 1438 } 1439 auc.APIContractUpdateProperties = &APIContractUpdateProperties 1440 } 1441 } 1442 } 1443 1444 return nil 1445} 1446 1447// APIVersionSetCollection paged Api Version Set list representation. 1448type APIVersionSetCollection struct { 1449 autorest.Response `json:"-"` 1450 // Value - Page values. 1451 Value *[]APIVersionSetContract `json:"value,omitempty"` 1452 // NextLink - Next page link if any. 1453 NextLink *string `json:"nextLink,omitempty"` 1454} 1455 1456// APIVersionSetCollectionIterator provides access to a complete listing of APIVersionSetContract values. 1457type APIVersionSetCollectionIterator struct { 1458 i int 1459 page APIVersionSetCollectionPage 1460} 1461 1462// NextWithContext advances to the next value. If there was an error making 1463// the request the iterator does not advance and the error is returned. 1464func (iter *APIVersionSetCollectionIterator) NextWithContext(ctx context.Context) (err error) { 1465 if tracing.IsEnabled() { 1466 ctx = tracing.StartSpan(ctx, fqdn+"/APIVersionSetCollectionIterator.NextWithContext") 1467 defer func() { 1468 sc := -1 1469 if iter.Response().Response.Response != nil { 1470 sc = iter.Response().Response.Response.StatusCode 1471 } 1472 tracing.EndSpan(ctx, sc, err) 1473 }() 1474 } 1475 iter.i++ 1476 if iter.i < len(iter.page.Values()) { 1477 return nil 1478 } 1479 err = iter.page.NextWithContext(ctx) 1480 if err != nil { 1481 iter.i-- 1482 return err 1483 } 1484 iter.i = 0 1485 return nil 1486} 1487 1488// Next advances to the next value. If there was an error making 1489// the request the iterator does not advance and the error is returned. 1490// Deprecated: Use NextWithContext() instead. 1491func (iter *APIVersionSetCollectionIterator) Next() error { 1492 return iter.NextWithContext(context.Background()) 1493} 1494 1495// NotDone returns true if the enumeration should be started or is not yet complete. 1496func (iter APIVersionSetCollectionIterator) NotDone() bool { 1497 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 1498} 1499 1500// Response returns the raw server response from the last page request. 1501func (iter APIVersionSetCollectionIterator) Response() APIVersionSetCollection { 1502 return iter.page.Response() 1503} 1504 1505// Value returns the current value or a zero-initialized value if the 1506// iterator has advanced beyond the end of the collection. 1507func (iter APIVersionSetCollectionIterator) Value() APIVersionSetContract { 1508 if !iter.page.NotDone() { 1509 return APIVersionSetContract{} 1510 } 1511 return iter.page.Values()[iter.i] 1512} 1513 1514// Creates a new instance of the APIVersionSetCollectionIterator type. 1515func NewAPIVersionSetCollectionIterator(page APIVersionSetCollectionPage) APIVersionSetCollectionIterator { 1516 return APIVersionSetCollectionIterator{page: page} 1517} 1518 1519// IsEmpty returns true if the ListResult contains no values. 1520func (avsc APIVersionSetCollection) IsEmpty() bool { 1521 return avsc.Value == nil || len(*avsc.Value) == 0 1522} 1523 1524// hasNextLink returns true if the NextLink is not empty. 1525func (avsc APIVersionSetCollection) hasNextLink() bool { 1526 return avsc.NextLink != nil && len(*avsc.NextLink) != 0 1527} 1528 1529// aPIVersionSetCollectionPreparer prepares a request to retrieve the next set of results. 1530// It returns nil if no more results exist. 1531func (avsc APIVersionSetCollection) aPIVersionSetCollectionPreparer(ctx context.Context) (*http.Request, error) { 1532 if !avsc.hasNextLink() { 1533 return nil, nil 1534 } 1535 return autorest.Prepare((&http.Request{}).WithContext(ctx), 1536 autorest.AsJSON(), 1537 autorest.AsGet(), 1538 autorest.WithBaseURL(to.String(avsc.NextLink))) 1539} 1540 1541// APIVersionSetCollectionPage contains a page of APIVersionSetContract values. 1542type APIVersionSetCollectionPage struct { 1543 fn func(context.Context, APIVersionSetCollection) (APIVersionSetCollection, error) 1544 avsc APIVersionSetCollection 1545} 1546 1547// NextWithContext advances to the next page of values. If there was an error making 1548// the request the page does not advance and the error is returned. 1549func (page *APIVersionSetCollectionPage) NextWithContext(ctx context.Context) (err error) { 1550 if tracing.IsEnabled() { 1551 ctx = tracing.StartSpan(ctx, fqdn+"/APIVersionSetCollectionPage.NextWithContext") 1552 defer func() { 1553 sc := -1 1554 if page.Response().Response.Response != nil { 1555 sc = page.Response().Response.Response.StatusCode 1556 } 1557 tracing.EndSpan(ctx, sc, err) 1558 }() 1559 } 1560 for { 1561 next, err := page.fn(ctx, page.avsc) 1562 if err != nil { 1563 return err 1564 } 1565 page.avsc = next 1566 if !next.hasNextLink() || !next.IsEmpty() { 1567 break 1568 } 1569 } 1570 return nil 1571} 1572 1573// Next advances to the next page of values. If there was an error making 1574// the request the page does not advance and the error is returned. 1575// Deprecated: Use NextWithContext() instead. 1576func (page *APIVersionSetCollectionPage) Next() error { 1577 return page.NextWithContext(context.Background()) 1578} 1579 1580// NotDone returns true if the page enumeration should be started or is not yet complete. 1581func (page APIVersionSetCollectionPage) NotDone() bool { 1582 return !page.avsc.IsEmpty() 1583} 1584 1585// Response returns the raw server response from the last page request. 1586func (page APIVersionSetCollectionPage) Response() APIVersionSetCollection { 1587 return page.avsc 1588} 1589 1590// Values returns the slice of values for the current page or nil if there are no values. 1591func (page APIVersionSetCollectionPage) Values() []APIVersionSetContract { 1592 if page.avsc.IsEmpty() { 1593 return nil 1594 } 1595 return *page.avsc.Value 1596} 1597 1598// Creates a new instance of the APIVersionSetCollectionPage type. 1599func NewAPIVersionSetCollectionPage(cur APIVersionSetCollection, getNextPage func(context.Context, APIVersionSetCollection) (APIVersionSetCollection, error)) APIVersionSetCollectionPage { 1600 return APIVersionSetCollectionPage{ 1601 fn: getNextPage, 1602 avsc: cur, 1603 } 1604} 1605 1606// APIVersionSetContract api Version Set Contract details. 1607type APIVersionSetContract struct { 1608 autorest.Response `json:"-"` 1609 // APIVersionSetContractProperties - Api VersionSet contract properties. 1610 *APIVersionSetContractProperties `json:"properties,omitempty"` 1611 // ID - READ-ONLY; Resource ID. 1612 ID *string `json:"id,omitempty"` 1613 // Name - READ-ONLY; Resource name. 1614 Name *string `json:"name,omitempty"` 1615 // Type - READ-ONLY; Resource type for API Management resource. 1616 Type *string `json:"type,omitempty"` 1617} 1618 1619// MarshalJSON is the custom marshaler for APIVersionSetContract. 1620func (avsc APIVersionSetContract) MarshalJSON() ([]byte, error) { 1621 objectMap := make(map[string]interface{}) 1622 if avsc.APIVersionSetContractProperties != nil { 1623 objectMap["properties"] = avsc.APIVersionSetContractProperties 1624 } 1625 return json.Marshal(objectMap) 1626} 1627 1628// UnmarshalJSON is the custom unmarshaler for APIVersionSetContract struct. 1629func (avsc *APIVersionSetContract) UnmarshalJSON(body []byte) error { 1630 var m map[string]*json.RawMessage 1631 err := json.Unmarshal(body, &m) 1632 if err != nil { 1633 return err 1634 } 1635 for k, v := range m { 1636 switch k { 1637 case "properties": 1638 if v != nil { 1639 var APIVersionSetContractProperties APIVersionSetContractProperties 1640 err = json.Unmarshal(*v, &APIVersionSetContractProperties) 1641 if err != nil { 1642 return err 1643 } 1644 avsc.APIVersionSetContractProperties = &APIVersionSetContractProperties 1645 } 1646 case "id": 1647 if v != nil { 1648 var ID string 1649 err = json.Unmarshal(*v, &ID) 1650 if err != nil { 1651 return err 1652 } 1653 avsc.ID = &ID 1654 } 1655 case "name": 1656 if v != nil { 1657 var name string 1658 err = json.Unmarshal(*v, &name) 1659 if err != nil { 1660 return err 1661 } 1662 avsc.Name = &name 1663 } 1664 case "type": 1665 if v != nil { 1666 var typeVar string 1667 err = json.Unmarshal(*v, &typeVar) 1668 if err != nil { 1669 return err 1670 } 1671 avsc.Type = &typeVar 1672 } 1673 } 1674 } 1675 1676 return nil 1677} 1678 1679// APIVersionSetContractDetails an API Version Set contains the common configuration for a set of API 1680// Versions relating 1681type APIVersionSetContractDetails struct { 1682 // ID - Identifier for existing API Version Set. Omit this value to create a new Version Set. 1683 ID *string `json:"id,omitempty"` 1684 // Name - The display Name of the API Version Set. 1685 Name *string `json:"name,omitempty"` 1686 // Description - Description of API Version Set. 1687 Description *string `json:"description,omitempty"` 1688 // VersioningScheme - An value that determines where the API Version identifer will be located in a HTTP request. Possible values include: 'VersioningScheme1Segment', 'VersioningScheme1Query', 'VersioningScheme1Header' 1689 VersioningScheme VersioningScheme1 `json:"versioningScheme,omitempty"` 1690 // VersionQueryName - Name of query parameter that indicates the API Version if versioningScheme is set to `query`. 1691 VersionQueryName *string `json:"versionQueryName,omitempty"` 1692 // VersionHeaderName - Name of HTTP header parameter that indicates the API Version if versioningScheme is set to `header`. 1693 VersionHeaderName *string `json:"versionHeaderName,omitempty"` 1694} 1695 1696// APIVersionSetContractProperties properties of an API Version Set. 1697type APIVersionSetContractProperties struct { 1698 // DisplayName - Name of API Version Set 1699 DisplayName *string `json:"displayName,omitempty"` 1700 // VersioningScheme - An value that determines where the API Version identifer will be located in a HTTP request. Possible values include: 'VersioningSchemeSegment', 'VersioningSchemeQuery', 'VersioningSchemeHeader' 1701 VersioningScheme VersioningScheme `json:"versioningScheme,omitempty"` 1702 // Description - Description of API Version Set. 1703 Description *string `json:"description,omitempty"` 1704 // VersionQueryName - Name of query parameter that indicates the API Version if versioningScheme is set to `query`. 1705 VersionQueryName *string `json:"versionQueryName,omitempty"` 1706 // VersionHeaderName - Name of HTTP header parameter that indicates the API Version if versioningScheme is set to `header`. 1707 VersionHeaderName *string `json:"versionHeaderName,omitempty"` 1708} 1709 1710// APIVersionSetEntityBase api Version set base parameters 1711type APIVersionSetEntityBase struct { 1712 // Description - Description of API Version Set. 1713 Description *string `json:"description,omitempty"` 1714 // VersionQueryName - Name of query parameter that indicates the API Version if versioningScheme is set to `query`. 1715 VersionQueryName *string `json:"versionQueryName,omitempty"` 1716 // VersionHeaderName - Name of HTTP header parameter that indicates the API Version if versioningScheme is set to `header`. 1717 VersionHeaderName *string `json:"versionHeaderName,omitempty"` 1718} 1719 1720// APIVersionSetUpdateParameters parameters to update or create an Api Version Set Contract. 1721type APIVersionSetUpdateParameters struct { 1722 // APIVersionSetUpdateParametersProperties - Parameters to update or create an Api Version Set Contract. 1723 *APIVersionSetUpdateParametersProperties `json:"properties,omitempty"` 1724} 1725 1726// MarshalJSON is the custom marshaler for APIVersionSetUpdateParameters. 1727func (avsup APIVersionSetUpdateParameters) MarshalJSON() ([]byte, error) { 1728 objectMap := make(map[string]interface{}) 1729 if avsup.APIVersionSetUpdateParametersProperties != nil { 1730 objectMap["properties"] = avsup.APIVersionSetUpdateParametersProperties 1731 } 1732 return json.Marshal(objectMap) 1733} 1734 1735// UnmarshalJSON is the custom unmarshaler for APIVersionSetUpdateParameters struct. 1736func (avsup *APIVersionSetUpdateParameters) UnmarshalJSON(body []byte) error { 1737 var m map[string]*json.RawMessage 1738 err := json.Unmarshal(body, &m) 1739 if err != nil { 1740 return err 1741 } 1742 for k, v := range m { 1743 switch k { 1744 case "properties": 1745 if v != nil { 1746 var APIVersionSetUpdateParametersProperties APIVersionSetUpdateParametersProperties 1747 err = json.Unmarshal(*v, &APIVersionSetUpdateParametersProperties) 1748 if err != nil { 1749 return err 1750 } 1751 avsup.APIVersionSetUpdateParametersProperties = &APIVersionSetUpdateParametersProperties 1752 } 1753 } 1754 } 1755 1756 return nil 1757} 1758 1759// APIVersionSetUpdateParametersProperties properties used to create or update an API Version Set. 1760type APIVersionSetUpdateParametersProperties struct { 1761 // DisplayName - Name of API Version Set 1762 DisplayName *string `json:"displayName,omitempty"` 1763 // VersioningScheme - An value that determines where the API Version identifer will be located in a HTTP request. Possible values include: 'VersioningSchemeSegment', 'VersioningSchemeQuery', 'VersioningSchemeHeader' 1764 VersioningScheme VersioningScheme `json:"versioningScheme,omitempty"` 1765 // Description - Description of API Version Set. 1766 Description *string `json:"description,omitempty"` 1767 // VersionQueryName - Name of query parameter that indicates the API Version if versioningScheme is set to `query`. 1768 VersionQueryName *string `json:"versionQueryName,omitempty"` 1769 // VersionHeaderName - Name of HTTP header parameter that indicates the API Version if versioningScheme is set to `header`. 1770 VersionHeaderName *string `json:"versionHeaderName,omitempty"` 1771} 1772 1773// AuthenticationSettingsContract API Authentication Settings. 1774type AuthenticationSettingsContract struct { 1775 // OAuth2 - OAuth2 Authentication settings 1776 OAuth2 *OAuth2AuthenticationSettingsContract `json:"oAuth2,omitempty"` 1777 // Openid - OpenID Connect Authentication Settings 1778 Openid *OpenIDAuthenticationSettingsContract `json:"openid,omitempty"` 1779} 1780 1781// AuthorizationServerCollection paged OAuth2 Authorization Servers list representation. 1782type AuthorizationServerCollection struct { 1783 autorest.Response `json:"-"` 1784 // Value - Page values. 1785 Value *[]AuthorizationServerContract `json:"value,omitempty"` 1786 // Count - Total record count number across all pages. 1787 Count *int64 `json:"count,omitempty"` 1788 // NextLink - Next page link if any. 1789 NextLink *string `json:"nextLink,omitempty"` 1790} 1791 1792// AuthorizationServerCollectionIterator provides access to a complete listing of 1793// AuthorizationServerContract values. 1794type AuthorizationServerCollectionIterator struct { 1795 i int 1796 page AuthorizationServerCollectionPage 1797} 1798 1799// NextWithContext advances to the next value. If there was an error making 1800// the request the iterator does not advance and the error is returned. 1801func (iter *AuthorizationServerCollectionIterator) NextWithContext(ctx context.Context) (err error) { 1802 if tracing.IsEnabled() { 1803 ctx = tracing.StartSpan(ctx, fqdn+"/AuthorizationServerCollectionIterator.NextWithContext") 1804 defer func() { 1805 sc := -1 1806 if iter.Response().Response.Response != nil { 1807 sc = iter.Response().Response.Response.StatusCode 1808 } 1809 tracing.EndSpan(ctx, sc, err) 1810 }() 1811 } 1812 iter.i++ 1813 if iter.i < len(iter.page.Values()) { 1814 return nil 1815 } 1816 err = iter.page.NextWithContext(ctx) 1817 if err != nil { 1818 iter.i-- 1819 return err 1820 } 1821 iter.i = 0 1822 return nil 1823} 1824 1825// Next advances to the next value. If there was an error making 1826// the request the iterator does not advance and the error is returned. 1827// Deprecated: Use NextWithContext() instead. 1828func (iter *AuthorizationServerCollectionIterator) Next() error { 1829 return iter.NextWithContext(context.Background()) 1830} 1831 1832// NotDone returns true if the enumeration should be started or is not yet complete. 1833func (iter AuthorizationServerCollectionIterator) NotDone() bool { 1834 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 1835} 1836 1837// Response returns the raw server response from the last page request. 1838func (iter AuthorizationServerCollectionIterator) Response() AuthorizationServerCollection { 1839 return iter.page.Response() 1840} 1841 1842// Value returns the current value or a zero-initialized value if the 1843// iterator has advanced beyond the end of the collection. 1844func (iter AuthorizationServerCollectionIterator) Value() AuthorizationServerContract { 1845 if !iter.page.NotDone() { 1846 return AuthorizationServerContract{} 1847 } 1848 return iter.page.Values()[iter.i] 1849} 1850 1851// Creates a new instance of the AuthorizationServerCollectionIterator type. 1852func NewAuthorizationServerCollectionIterator(page AuthorizationServerCollectionPage) AuthorizationServerCollectionIterator { 1853 return AuthorizationServerCollectionIterator{page: page} 1854} 1855 1856// IsEmpty returns true if the ListResult contains no values. 1857func (asc AuthorizationServerCollection) IsEmpty() bool { 1858 return asc.Value == nil || len(*asc.Value) == 0 1859} 1860 1861// hasNextLink returns true if the NextLink is not empty. 1862func (asc AuthorizationServerCollection) hasNextLink() bool { 1863 return asc.NextLink != nil && len(*asc.NextLink) != 0 1864} 1865 1866// authorizationServerCollectionPreparer prepares a request to retrieve the next set of results. 1867// It returns nil if no more results exist. 1868func (asc AuthorizationServerCollection) authorizationServerCollectionPreparer(ctx context.Context) (*http.Request, error) { 1869 if !asc.hasNextLink() { 1870 return nil, nil 1871 } 1872 return autorest.Prepare((&http.Request{}).WithContext(ctx), 1873 autorest.AsJSON(), 1874 autorest.AsGet(), 1875 autorest.WithBaseURL(to.String(asc.NextLink))) 1876} 1877 1878// AuthorizationServerCollectionPage contains a page of AuthorizationServerContract values. 1879type AuthorizationServerCollectionPage struct { 1880 fn func(context.Context, AuthorizationServerCollection) (AuthorizationServerCollection, error) 1881 asc AuthorizationServerCollection 1882} 1883 1884// NextWithContext advances to the next page of values. If there was an error making 1885// the request the page does not advance and the error is returned. 1886func (page *AuthorizationServerCollectionPage) NextWithContext(ctx context.Context) (err error) { 1887 if tracing.IsEnabled() { 1888 ctx = tracing.StartSpan(ctx, fqdn+"/AuthorizationServerCollectionPage.NextWithContext") 1889 defer func() { 1890 sc := -1 1891 if page.Response().Response.Response != nil { 1892 sc = page.Response().Response.Response.StatusCode 1893 } 1894 tracing.EndSpan(ctx, sc, err) 1895 }() 1896 } 1897 for { 1898 next, err := page.fn(ctx, page.asc) 1899 if err != nil { 1900 return err 1901 } 1902 page.asc = next 1903 if !next.hasNextLink() || !next.IsEmpty() { 1904 break 1905 } 1906 } 1907 return nil 1908} 1909 1910// Next advances to the next page of values. If there was an error making 1911// the request the page does not advance and the error is returned. 1912// Deprecated: Use NextWithContext() instead. 1913func (page *AuthorizationServerCollectionPage) Next() error { 1914 return page.NextWithContext(context.Background()) 1915} 1916 1917// NotDone returns true if the page enumeration should be started or is not yet complete. 1918func (page AuthorizationServerCollectionPage) NotDone() bool { 1919 return !page.asc.IsEmpty() 1920} 1921 1922// Response returns the raw server response from the last page request. 1923func (page AuthorizationServerCollectionPage) Response() AuthorizationServerCollection { 1924 return page.asc 1925} 1926 1927// Values returns the slice of values for the current page or nil if there are no values. 1928func (page AuthorizationServerCollectionPage) Values() []AuthorizationServerContract { 1929 if page.asc.IsEmpty() { 1930 return nil 1931 } 1932 return *page.asc.Value 1933} 1934 1935// Creates a new instance of the AuthorizationServerCollectionPage type. 1936func NewAuthorizationServerCollectionPage(cur AuthorizationServerCollection, getNextPage func(context.Context, AuthorizationServerCollection) (AuthorizationServerCollection, error)) AuthorizationServerCollectionPage { 1937 return AuthorizationServerCollectionPage{ 1938 fn: getNextPage, 1939 asc: cur, 1940 } 1941} 1942 1943// AuthorizationServerContract external OAuth authorization server settings. 1944type AuthorizationServerContract struct { 1945 autorest.Response `json:"-"` 1946 // AuthorizationServerContractProperties - Properties of the External OAuth authorization server Contract. 1947 *AuthorizationServerContractProperties `json:"properties,omitempty"` 1948 // ID - READ-ONLY; Resource ID. 1949 ID *string `json:"id,omitempty"` 1950 // Name - READ-ONLY; Resource name. 1951 Name *string `json:"name,omitempty"` 1952 // Type - READ-ONLY; Resource type for API Management resource. 1953 Type *string `json:"type,omitempty"` 1954} 1955 1956// MarshalJSON is the custom marshaler for AuthorizationServerContract. 1957func (asc AuthorizationServerContract) MarshalJSON() ([]byte, error) { 1958 objectMap := make(map[string]interface{}) 1959 if asc.AuthorizationServerContractProperties != nil { 1960 objectMap["properties"] = asc.AuthorizationServerContractProperties 1961 } 1962 return json.Marshal(objectMap) 1963} 1964 1965// UnmarshalJSON is the custom unmarshaler for AuthorizationServerContract struct. 1966func (asc *AuthorizationServerContract) UnmarshalJSON(body []byte) error { 1967 var m map[string]*json.RawMessage 1968 err := json.Unmarshal(body, &m) 1969 if err != nil { 1970 return err 1971 } 1972 for k, v := range m { 1973 switch k { 1974 case "properties": 1975 if v != nil { 1976 var authorizationServerContractProperties AuthorizationServerContractProperties 1977 err = json.Unmarshal(*v, &authorizationServerContractProperties) 1978 if err != nil { 1979 return err 1980 } 1981 asc.AuthorizationServerContractProperties = &authorizationServerContractProperties 1982 } 1983 case "id": 1984 if v != nil { 1985 var ID string 1986 err = json.Unmarshal(*v, &ID) 1987 if err != nil { 1988 return err 1989 } 1990 asc.ID = &ID 1991 } 1992 case "name": 1993 if v != nil { 1994 var name string 1995 err = json.Unmarshal(*v, &name) 1996 if err != nil { 1997 return err 1998 } 1999 asc.Name = &name 2000 } 2001 case "type": 2002 if v != nil { 2003 var typeVar string 2004 err = json.Unmarshal(*v, &typeVar) 2005 if err != nil { 2006 return err 2007 } 2008 asc.Type = &typeVar 2009 } 2010 } 2011 } 2012 2013 return nil 2014} 2015 2016// AuthorizationServerContractBaseProperties external OAuth authorization server Update settings contract. 2017type AuthorizationServerContractBaseProperties struct { 2018 // Description - Description of the authorization server. Can contain HTML formatting tags. 2019 Description *string `json:"description,omitempty"` 2020 // AuthorizationMethods - HTTP verbs supported by the authorization endpoint. GET must be always present. POST is optional. 2021 AuthorizationMethods *[]AuthorizationMethod `json:"authorizationMethods,omitempty"` 2022 // 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. 2023 ClientAuthenticationMethod *[]ClientAuthenticationMethod `json:"clientAuthenticationMethod,omitempty"` 2024 // 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"}. 2025 TokenBodyParameters *[]TokenBodyParameterContract `json:"tokenBodyParameters,omitempty"` 2026 // TokenEndpoint - OAuth token endpoint. Contains absolute URI to entity being referenced. 2027 TokenEndpoint *string `json:"tokenEndpoint,omitempty"` 2028 // 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. 2029 SupportState *bool `json:"supportState,omitempty"` 2030 // 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. 2031 DefaultScope *string `json:"defaultScope,omitempty"` 2032 // BearerTokenSendingMethods - Specifies the mechanism by which access token is passed to the API. 2033 BearerTokenSendingMethods *[]BearerTokenSendingMethod `json:"bearerTokenSendingMethods,omitempty"` 2034 // ClientSecret - Client or app secret registered with this authorization server. 2035 ClientSecret *string `json:"clientSecret,omitempty"` 2036 // ResourceOwnerUsername - Can be optionally specified when resource owner password grant type is supported by this authorization server. Default resource owner username. 2037 ResourceOwnerUsername *string `json:"resourceOwnerUsername,omitempty"` 2038 // ResourceOwnerPassword - Can be optionally specified when resource owner password grant type is supported by this authorization server. Default resource owner password. 2039 ResourceOwnerPassword *string `json:"resourceOwnerPassword,omitempty"` 2040} 2041 2042// AuthorizationServerContractProperties external OAuth authorization server settings Properties. 2043type AuthorizationServerContractProperties struct { 2044 // DisplayName - User-friendly authorization server name. 2045 DisplayName *string `json:"displayName,omitempty"` 2046 // ClientRegistrationEndpoint - Optional reference to a page where client or app registration for this authorization server is performed. Contains absolute URL to entity being referenced. 2047 ClientRegistrationEndpoint *string `json:"clientRegistrationEndpoint,omitempty"` 2048 // AuthorizationEndpoint - OAuth authorization endpoint. See http://tools.ietf.org/html/rfc6749#section-3.2. 2049 AuthorizationEndpoint *string `json:"authorizationEndpoint,omitempty"` 2050 // GrantTypes - Form of an authorization grant, which the client uses to request the access token. 2051 GrantTypes *[]GrantType `json:"grantTypes,omitempty"` 2052 // ClientID - Client or app id registered with this authorization server. 2053 ClientID *string `json:"clientId,omitempty"` 2054 // Description - Description of the authorization server. Can contain HTML formatting tags. 2055 Description *string `json:"description,omitempty"` 2056 // AuthorizationMethods - HTTP verbs supported by the authorization endpoint. GET must be always present. POST is optional. 2057 AuthorizationMethods *[]AuthorizationMethod `json:"authorizationMethods,omitempty"` 2058 // 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. 2059 ClientAuthenticationMethod *[]ClientAuthenticationMethod `json:"clientAuthenticationMethod,omitempty"` 2060 // 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"}. 2061 TokenBodyParameters *[]TokenBodyParameterContract `json:"tokenBodyParameters,omitempty"` 2062 // TokenEndpoint - OAuth token endpoint. Contains absolute URI to entity being referenced. 2063 TokenEndpoint *string `json:"tokenEndpoint,omitempty"` 2064 // 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. 2065 SupportState *bool `json:"supportState,omitempty"` 2066 // 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. 2067 DefaultScope *string `json:"defaultScope,omitempty"` 2068 // BearerTokenSendingMethods - Specifies the mechanism by which access token is passed to the API. 2069 BearerTokenSendingMethods *[]BearerTokenSendingMethod `json:"bearerTokenSendingMethods,omitempty"` 2070 // ClientSecret - Client or app secret registered with this authorization server. 2071 ClientSecret *string `json:"clientSecret,omitempty"` 2072 // ResourceOwnerUsername - Can be optionally specified when resource owner password grant type is supported by this authorization server. Default resource owner username. 2073 ResourceOwnerUsername *string `json:"resourceOwnerUsername,omitempty"` 2074 // ResourceOwnerPassword - Can be optionally specified when resource owner password grant type is supported by this authorization server. Default resource owner password. 2075 ResourceOwnerPassword *string `json:"resourceOwnerPassword,omitempty"` 2076} 2077 2078// AuthorizationServerUpdateContract external OAuth authorization server settings. 2079type AuthorizationServerUpdateContract struct { 2080 // AuthorizationServerUpdateContractProperties - Properties of the External OAuth authorization server update Contract. 2081 *AuthorizationServerUpdateContractProperties `json:"properties,omitempty"` 2082 // ID - READ-ONLY; Resource ID. 2083 ID *string `json:"id,omitempty"` 2084 // Name - READ-ONLY; Resource name. 2085 Name *string `json:"name,omitempty"` 2086 // Type - READ-ONLY; Resource type for API Management resource. 2087 Type *string `json:"type,omitempty"` 2088} 2089 2090// MarshalJSON is the custom marshaler for AuthorizationServerUpdateContract. 2091func (asuc AuthorizationServerUpdateContract) MarshalJSON() ([]byte, error) { 2092 objectMap := make(map[string]interface{}) 2093 if asuc.AuthorizationServerUpdateContractProperties != nil { 2094 objectMap["properties"] = asuc.AuthorizationServerUpdateContractProperties 2095 } 2096 return json.Marshal(objectMap) 2097} 2098 2099// UnmarshalJSON is the custom unmarshaler for AuthorizationServerUpdateContract struct. 2100func (asuc *AuthorizationServerUpdateContract) UnmarshalJSON(body []byte) error { 2101 var m map[string]*json.RawMessage 2102 err := json.Unmarshal(body, &m) 2103 if err != nil { 2104 return err 2105 } 2106 for k, v := range m { 2107 switch k { 2108 case "properties": 2109 if v != nil { 2110 var authorizationServerUpdateContractProperties AuthorizationServerUpdateContractProperties 2111 err = json.Unmarshal(*v, &authorizationServerUpdateContractProperties) 2112 if err != nil { 2113 return err 2114 } 2115 asuc.AuthorizationServerUpdateContractProperties = &authorizationServerUpdateContractProperties 2116 } 2117 case "id": 2118 if v != nil { 2119 var ID string 2120 err = json.Unmarshal(*v, &ID) 2121 if err != nil { 2122 return err 2123 } 2124 asuc.ID = &ID 2125 } 2126 case "name": 2127 if v != nil { 2128 var name string 2129 err = json.Unmarshal(*v, &name) 2130 if err != nil { 2131 return err 2132 } 2133 asuc.Name = &name 2134 } 2135 case "type": 2136 if v != nil { 2137 var typeVar string 2138 err = json.Unmarshal(*v, &typeVar) 2139 if err != nil { 2140 return err 2141 } 2142 asuc.Type = &typeVar 2143 } 2144 } 2145 } 2146 2147 return nil 2148} 2149 2150// AuthorizationServerUpdateContractProperties external OAuth authorization server Update settings 2151// contract. 2152type AuthorizationServerUpdateContractProperties struct { 2153 // DisplayName - User-friendly authorization server name. 2154 DisplayName *string `json:"displayName,omitempty"` 2155 // ClientRegistrationEndpoint - Optional reference to a page where client or app registration for this authorization server is performed. Contains absolute URL to entity being referenced. 2156 ClientRegistrationEndpoint *string `json:"clientRegistrationEndpoint,omitempty"` 2157 // AuthorizationEndpoint - OAuth authorization endpoint. See http://tools.ietf.org/html/rfc6749#section-3.2. 2158 AuthorizationEndpoint *string `json:"authorizationEndpoint,omitempty"` 2159 // GrantTypes - Form of an authorization grant, which the client uses to request the access token. 2160 GrantTypes *[]GrantType `json:"grantTypes,omitempty"` 2161 // ClientID - Client or app id registered with this authorization server. 2162 ClientID *string `json:"clientId,omitempty"` 2163 // Description - Description of the authorization server. Can contain HTML formatting tags. 2164 Description *string `json:"description,omitempty"` 2165 // AuthorizationMethods - HTTP verbs supported by the authorization endpoint. GET must be always present. POST is optional. 2166 AuthorizationMethods *[]AuthorizationMethod `json:"authorizationMethods,omitempty"` 2167 // 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. 2168 ClientAuthenticationMethod *[]ClientAuthenticationMethod `json:"clientAuthenticationMethod,omitempty"` 2169 // 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"}. 2170 TokenBodyParameters *[]TokenBodyParameterContract `json:"tokenBodyParameters,omitempty"` 2171 // TokenEndpoint - OAuth token endpoint. Contains absolute URI to entity being referenced. 2172 TokenEndpoint *string `json:"tokenEndpoint,omitempty"` 2173 // 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. 2174 SupportState *bool `json:"supportState,omitempty"` 2175 // 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. 2176 DefaultScope *string `json:"defaultScope,omitempty"` 2177 // BearerTokenSendingMethods - Specifies the mechanism by which access token is passed to the API. 2178 BearerTokenSendingMethods *[]BearerTokenSendingMethod `json:"bearerTokenSendingMethods,omitempty"` 2179 // ClientSecret - Client or app secret registered with this authorization server. 2180 ClientSecret *string `json:"clientSecret,omitempty"` 2181 // ResourceOwnerUsername - Can be optionally specified when resource owner password grant type is supported by this authorization server. Default resource owner username. 2182 ResourceOwnerUsername *string `json:"resourceOwnerUsername,omitempty"` 2183 // ResourceOwnerPassword - Can be optionally specified when resource owner password grant type is supported by this authorization server. Default resource owner password. 2184 ResourceOwnerPassword *string `json:"resourceOwnerPassword,omitempty"` 2185} 2186 2187// BackendAuthorizationHeaderCredentials authorization header information. 2188type BackendAuthorizationHeaderCredentials struct { 2189 // Scheme - Authentication Scheme name. 2190 Scheme *string `json:"scheme,omitempty"` 2191 // Parameter - Authentication Parameter value. 2192 Parameter *string `json:"parameter,omitempty"` 2193} 2194 2195// BackendBaseParameters backend entity base Parameter set. 2196type BackendBaseParameters struct { 2197 // Title - Backend Title. 2198 Title *string `json:"title,omitempty"` 2199 // Description - Backend Description. 2200 Description *string `json:"description,omitempty"` 2201 // 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. 2202 ResourceID *string `json:"resourceId,omitempty"` 2203 // Properties - Backend Properties contract 2204 Properties *BackendProperties `json:"properties,omitempty"` 2205 // Credentials - Backend Credentials Contract Properties 2206 Credentials *BackendCredentialsContract `json:"credentials,omitempty"` 2207 // Proxy - Backend Proxy Contract Properties 2208 Proxy *BackendProxyContract `json:"proxy,omitempty"` 2209 // TLS - Backend TLS Properties 2210 TLS *BackendTLSProperties `json:"tls,omitempty"` 2211} 2212 2213// BackendCollection paged Backend list representation. 2214type BackendCollection struct { 2215 autorest.Response `json:"-"` 2216 // Value - Backend values. 2217 Value *[]BackendContract `json:"value,omitempty"` 2218 // NextLink - Next page link if any. 2219 NextLink *string `json:"nextLink,omitempty"` 2220} 2221 2222// BackendCollectionIterator provides access to a complete listing of BackendContract values. 2223type BackendCollectionIterator struct { 2224 i int 2225 page BackendCollectionPage 2226} 2227 2228// NextWithContext advances to the next value. If there was an error making 2229// the request the iterator does not advance and the error is returned. 2230func (iter *BackendCollectionIterator) NextWithContext(ctx context.Context) (err error) { 2231 if tracing.IsEnabled() { 2232 ctx = tracing.StartSpan(ctx, fqdn+"/BackendCollectionIterator.NextWithContext") 2233 defer func() { 2234 sc := -1 2235 if iter.Response().Response.Response != nil { 2236 sc = iter.Response().Response.Response.StatusCode 2237 } 2238 tracing.EndSpan(ctx, sc, err) 2239 }() 2240 } 2241 iter.i++ 2242 if iter.i < len(iter.page.Values()) { 2243 return nil 2244 } 2245 err = iter.page.NextWithContext(ctx) 2246 if err != nil { 2247 iter.i-- 2248 return err 2249 } 2250 iter.i = 0 2251 return nil 2252} 2253 2254// Next advances to the next value. If there was an error making 2255// the request the iterator does not advance and the error is returned. 2256// Deprecated: Use NextWithContext() instead. 2257func (iter *BackendCollectionIterator) Next() error { 2258 return iter.NextWithContext(context.Background()) 2259} 2260 2261// NotDone returns true if the enumeration should be started or is not yet complete. 2262func (iter BackendCollectionIterator) NotDone() bool { 2263 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 2264} 2265 2266// Response returns the raw server response from the last page request. 2267func (iter BackendCollectionIterator) Response() BackendCollection { 2268 return iter.page.Response() 2269} 2270 2271// Value returns the current value or a zero-initialized value if the 2272// iterator has advanced beyond the end of the collection. 2273func (iter BackendCollectionIterator) Value() BackendContract { 2274 if !iter.page.NotDone() { 2275 return BackendContract{} 2276 } 2277 return iter.page.Values()[iter.i] 2278} 2279 2280// Creates a new instance of the BackendCollectionIterator type. 2281func NewBackendCollectionIterator(page BackendCollectionPage) BackendCollectionIterator { 2282 return BackendCollectionIterator{page: page} 2283} 2284 2285// IsEmpty returns true if the ListResult contains no values. 2286func (bc BackendCollection) IsEmpty() bool { 2287 return bc.Value == nil || len(*bc.Value) == 0 2288} 2289 2290// hasNextLink returns true if the NextLink is not empty. 2291func (bc BackendCollection) hasNextLink() bool { 2292 return bc.NextLink != nil && len(*bc.NextLink) != 0 2293} 2294 2295// backendCollectionPreparer prepares a request to retrieve the next set of results. 2296// It returns nil if no more results exist. 2297func (bc BackendCollection) backendCollectionPreparer(ctx context.Context) (*http.Request, error) { 2298 if !bc.hasNextLink() { 2299 return nil, nil 2300 } 2301 return autorest.Prepare((&http.Request{}).WithContext(ctx), 2302 autorest.AsJSON(), 2303 autorest.AsGet(), 2304 autorest.WithBaseURL(to.String(bc.NextLink))) 2305} 2306 2307// BackendCollectionPage contains a page of BackendContract values. 2308type BackendCollectionPage struct { 2309 fn func(context.Context, BackendCollection) (BackendCollection, error) 2310 bc BackendCollection 2311} 2312 2313// NextWithContext advances to the next page of values. If there was an error making 2314// the request the page does not advance and the error is returned. 2315func (page *BackendCollectionPage) NextWithContext(ctx context.Context) (err error) { 2316 if tracing.IsEnabled() { 2317 ctx = tracing.StartSpan(ctx, fqdn+"/BackendCollectionPage.NextWithContext") 2318 defer func() { 2319 sc := -1 2320 if page.Response().Response.Response != nil { 2321 sc = page.Response().Response.Response.StatusCode 2322 } 2323 tracing.EndSpan(ctx, sc, err) 2324 }() 2325 } 2326 for { 2327 next, err := page.fn(ctx, page.bc) 2328 if err != nil { 2329 return err 2330 } 2331 page.bc = next 2332 if !next.hasNextLink() || !next.IsEmpty() { 2333 break 2334 } 2335 } 2336 return nil 2337} 2338 2339// Next advances to the next page of values. If there was an error making 2340// the request the page does not advance and the error is returned. 2341// Deprecated: Use NextWithContext() instead. 2342func (page *BackendCollectionPage) Next() error { 2343 return page.NextWithContext(context.Background()) 2344} 2345 2346// NotDone returns true if the page enumeration should be started or is not yet complete. 2347func (page BackendCollectionPage) NotDone() bool { 2348 return !page.bc.IsEmpty() 2349} 2350 2351// Response returns the raw server response from the last page request. 2352func (page BackendCollectionPage) Response() BackendCollection { 2353 return page.bc 2354} 2355 2356// Values returns the slice of values for the current page or nil if there are no values. 2357func (page BackendCollectionPage) Values() []BackendContract { 2358 if page.bc.IsEmpty() { 2359 return nil 2360 } 2361 return *page.bc.Value 2362} 2363 2364// Creates a new instance of the BackendCollectionPage type. 2365func NewBackendCollectionPage(cur BackendCollection, getNextPage func(context.Context, BackendCollection) (BackendCollection, error)) BackendCollectionPage { 2366 return BackendCollectionPage{ 2367 fn: getNextPage, 2368 bc: cur, 2369 } 2370} 2371 2372// BackendContract backend details. 2373type BackendContract struct { 2374 autorest.Response `json:"-"` 2375 // BackendContractProperties - Backend entity contract properties. 2376 *BackendContractProperties `json:"properties,omitempty"` 2377 // ID - READ-ONLY; Resource ID. 2378 ID *string `json:"id,omitempty"` 2379 // Name - READ-ONLY; Resource name. 2380 Name *string `json:"name,omitempty"` 2381 // Type - READ-ONLY; Resource type for API Management resource. 2382 Type *string `json:"type,omitempty"` 2383} 2384 2385// MarshalJSON is the custom marshaler for BackendContract. 2386func (bc BackendContract) MarshalJSON() ([]byte, error) { 2387 objectMap := make(map[string]interface{}) 2388 if bc.BackendContractProperties != nil { 2389 objectMap["properties"] = bc.BackendContractProperties 2390 } 2391 return json.Marshal(objectMap) 2392} 2393 2394// UnmarshalJSON is the custom unmarshaler for BackendContract struct. 2395func (bc *BackendContract) UnmarshalJSON(body []byte) error { 2396 var m map[string]*json.RawMessage 2397 err := json.Unmarshal(body, &m) 2398 if err != nil { 2399 return err 2400 } 2401 for k, v := range m { 2402 switch k { 2403 case "properties": 2404 if v != nil { 2405 var backendContractProperties BackendContractProperties 2406 err = json.Unmarshal(*v, &backendContractProperties) 2407 if err != nil { 2408 return err 2409 } 2410 bc.BackendContractProperties = &backendContractProperties 2411 } 2412 case "id": 2413 if v != nil { 2414 var ID string 2415 err = json.Unmarshal(*v, &ID) 2416 if err != nil { 2417 return err 2418 } 2419 bc.ID = &ID 2420 } 2421 case "name": 2422 if v != nil { 2423 var name string 2424 err = json.Unmarshal(*v, &name) 2425 if err != nil { 2426 return err 2427 } 2428 bc.Name = &name 2429 } 2430 case "type": 2431 if v != nil { 2432 var typeVar string 2433 err = json.Unmarshal(*v, &typeVar) 2434 if err != nil { 2435 return err 2436 } 2437 bc.Type = &typeVar 2438 } 2439 } 2440 } 2441 2442 return nil 2443} 2444 2445// BackendContractProperties parameters supplied to the Create Backend operation. 2446type BackendContractProperties struct { 2447 // URL - Runtime Url of the Backend. 2448 URL *string `json:"url,omitempty"` 2449 // Protocol - Backend communication protocol. Possible values include: 'BackendProtocolHTTP', 'BackendProtocolSoap' 2450 Protocol BackendProtocol `json:"protocol,omitempty"` 2451 // Title - Backend Title. 2452 Title *string `json:"title,omitempty"` 2453 // Description - Backend Description. 2454 Description *string `json:"description,omitempty"` 2455 // 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. 2456 ResourceID *string `json:"resourceId,omitempty"` 2457 // Properties - Backend Properties contract 2458 Properties *BackendProperties `json:"properties,omitempty"` 2459 // Credentials - Backend Credentials Contract Properties 2460 Credentials *BackendCredentialsContract `json:"credentials,omitempty"` 2461 // Proxy - Backend Proxy Contract Properties 2462 Proxy *BackendProxyContract `json:"proxy,omitempty"` 2463 // TLS - Backend TLS Properties 2464 TLS *BackendTLSProperties `json:"tls,omitempty"` 2465} 2466 2467// BackendCredentialsContract details of the Credentials used to connect to Backend. 2468type BackendCredentialsContract struct { 2469 // Certificate - List of Client Certificate Thumbprint. 2470 Certificate *[]string `json:"certificate,omitempty"` 2471 // Query - Query Parameter description. 2472 Query map[string][]string `json:"query"` 2473 // Header - Header Parameter description. 2474 Header map[string][]string `json:"header"` 2475 // Authorization - Authorization header authentication 2476 Authorization *BackendAuthorizationHeaderCredentials `json:"authorization,omitempty"` 2477} 2478 2479// MarshalJSON is the custom marshaler for BackendCredentialsContract. 2480func (bcc BackendCredentialsContract) MarshalJSON() ([]byte, error) { 2481 objectMap := make(map[string]interface{}) 2482 if bcc.Certificate != nil { 2483 objectMap["certificate"] = bcc.Certificate 2484 } 2485 if bcc.Query != nil { 2486 objectMap["query"] = bcc.Query 2487 } 2488 if bcc.Header != nil { 2489 objectMap["header"] = bcc.Header 2490 } 2491 if bcc.Authorization != nil { 2492 objectMap["authorization"] = bcc.Authorization 2493 } 2494 return json.Marshal(objectMap) 2495} 2496 2497// BackendProperties properties specific to the Backend Type. 2498type BackendProperties struct { 2499 // ServiceFabricCluster - Backend Service Fabric Cluster Properties 2500 ServiceFabricCluster *BackendServiceFabricClusterProperties `json:"serviceFabricCluster,omitempty"` 2501} 2502 2503// BackendProxyContract details of the Backend WebProxy Server to use in the Request to Backend. 2504type BackendProxyContract struct { 2505 // URL - WebProxy Server AbsoluteUri property which includes the entire URI stored in the Uri instance, including all fragments and query strings. 2506 URL *string `json:"url,omitempty"` 2507 // Username - Username to connect to the WebProxy server 2508 Username *string `json:"username,omitempty"` 2509 // Password - Password to connect to the WebProxy Server 2510 Password *string `json:"password,omitempty"` 2511} 2512 2513// BackendReconnectContract reconnect request parameters. 2514type BackendReconnectContract struct { 2515 // BackendReconnectProperties - Reconnect request properties. 2516 *BackendReconnectProperties `json:"properties,omitempty"` 2517 // ID - READ-ONLY; Resource ID. 2518 ID *string `json:"id,omitempty"` 2519 // Name - READ-ONLY; Resource name. 2520 Name *string `json:"name,omitempty"` 2521 // Type - READ-ONLY; Resource type for API Management resource. 2522 Type *string `json:"type,omitempty"` 2523} 2524 2525// MarshalJSON is the custom marshaler for BackendReconnectContract. 2526func (brc BackendReconnectContract) MarshalJSON() ([]byte, error) { 2527 objectMap := make(map[string]interface{}) 2528 if brc.BackendReconnectProperties != nil { 2529 objectMap["properties"] = brc.BackendReconnectProperties 2530 } 2531 return json.Marshal(objectMap) 2532} 2533 2534// UnmarshalJSON is the custom unmarshaler for BackendReconnectContract struct. 2535func (brc *BackendReconnectContract) UnmarshalJSON(body []byte) error { 2536 var m map[string]*json.RawMessage 2537 err := json.Unmarshal(body, &m) 2538 if err != nil { 2539 return err 2540 } 2541 for k, v := range m { 2542 switch k { 2543 case "properties": 2544 if v != nil { 2545 var backendReconnectProperties BackendReconnectProperties 2546 err = json.Unmarshal(*v, &backendReconnectProperties) 2547 if err != nil { 2548 return err 2549 } 2550 brc.BackendReconnectProperties = &backendReconnectProperties 2551 } 2552 case "id": 2553 if v != nil { 2554 var ID string 2555 err = json.Unmarshal(*v, &ID) 2556 if err != nil { 2557 return err 2558 } 2559 brc.ID = &ID 2560 } 2561 case "name": 2562 if v != nil { 2563 var name string 2564 err = json.Unmarshal(*v, &name) 2565 if err != nil { 2566 return err 2567 } 2568 brc.Name = &name 2569 } 2570 case "type": 2571 if v != nil { 2572 var typeVar string 2573 err = json.Unmarshal(*v, &typeVar) 2574 if err != nil { 2575 return err 2576 } 2577 brc.Type = &typeVar 2578 } 2579 } 2580 } 2581 2582 return nil 2583} 2584 2585// BackendReconnectProperties properties to control reconnect requests. 2586type BackendReconnectProperties struct { 2587 // After - Duration in ISO8601 format after which reconnect will be initiated. Minimum duration of the Reconnect is PT2M. 2588 After *string `json:"after,omitempty"` 2589} 2590 2591// BackendServiceFabricClusterProperties properties of the Service Fabric Type Backend. 2592type BackendServiceFabricClusterProperties struct { 2593 // ClientCertificatethumbprint - The client certificate thumbprint for the management endpoint. 2594 ClientCertificatethumbprint *string `json:"clientCertificatethumbprint,omitempty"` 2595 // MaxPartitionResolutionRetries - Maximum number of retries while attempting resolve the partition. 2596 MaxPartitionResolutionRetries *int32 `json:"maxPartitionResolutionRetries,omitempty"` 2597 // ManagementEndpoints - The cluster management endpoint. 2598 ManagementEndpoints *[]string `json:"managementEndpoints,omitempty"` 2599 // ServerCertificateThumbprints - Thumbprints of certificates cluster management service uses for tls communication 2600 ServerCertificateThumbprints *[]string `json:"serverCertificateThumbprints,omitempty"` 2601 // ServerX509Names - Server X509 Certificate Names Collection 2602 ServerX509Names *[]X509CertificateName `json:"serverX509Names,omitempty"` 2603} 2604 2605// BackendTLSProperties properties controlling TLS Certificate Validation. 2606type BackendTLSProperties struct { 2607 // ValidateCertificateChain - Flag indicating whether SSL certificate chain validation should be done when using self-signed certificates for this backend host. 2608 ValidateCertificateChain *bool `json:"validateCertificateChain,omitempty"` 2609 // ValidateCertificateName - Flag indicating whether SSL certificate name validation should be done when using self-signed certificates for this backend host. 2610 ValidateCertificateName *bool `json:"validateCertificateName,omitempty"` 2611} 2612 2613// BackendUpdateParameterProperties parameters supplied to the Update Backend operation. 2614type BackendUpdateParameterProperties struct { 2615 // URL - Runtime Url of the Backend. 2616 URL *string `json:"url,omitempty"` 2617 // Protocol - Backend communication protocol. Possible values include: 'BackendProtocolHTTP', 'BackendProtocolSoap' 2618 Protocol BackendProtocol `json:"protocol,omitempty"` 2619 // Title - Backend Title. 2620 Title *string `json:"title,omitempty"` 2621 // Description - Backend Description. 2622 Description *string `json:"description,omitempty"` 2623 // 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. 2624 ResourceID *string `json:"resourceId,omitempty"` 2625 // Properties - Backend Properties contract 2626 Properties *BackendProperties `json:"properties,omitempty"` 2627 // Credentials - Backend Credentials Contract Properties 2628 Credentials *BackendCredentialsContract `json:"credentials,omitempty"` 2629 // Proxy - Backend Proxy Contract Properties 2630 Proxy *BackendProxyContract `json:"proxy,omitempty"` 2631 // TLS - Backend TLS Properties 2632 TLS *BackendTLSProperties `json:"tls,omitempty"` 2633} 2634 2635// BackendUpdateParameters backend update parameters. 2636type BackendUpdateParameters struct { 2637 // BackendUpdateParameterProperties - Backend entity update contract properties. 2638 *BackendUpdateParameterProperties `json:"properties,omitempty"` 2639} 2640 2641// MarshalJSON is the custom marshaler for BackendUpdateParameters. 2642func (bup BackendUpdateParameters) MarshalJSON() ([]byte, error) { 2643 objectMap := make(map[string]interface{}) 2644 if bup.BackendUpdateParameterProperties != nil { 2645 objectMap["properties"] = bup.BackendUpdateParameterProperties 2646 } 2647 return json.Marshal(objectMap) 2648} 2649 2650// UnmarshalJSON is the custom unmarshaler for BackendUpdateParameters struct. 2651func (bup *BackendUpdateParameters) UnmarshalJSON(body []byte) error { 2652 var m map[string]*json.RawMessage 2653 err := json.Unmarshal(body, &m) 2654 if err != nil { 2655 return err 2656 } 2657 for k, v := range m { 2658 switch k { 2659 case "properties": 2660 if v != nil { 2661 var backendUpdateParameterProperties BackendUpdateParameterProperties 2662 err = json.Unmarshal(*v, &backendUpdateParameterProperties) 2663 if err != nil { 2664 return err 2665 } 2666 bup.BackendUpdateParameterProperties = &backendUpdateParameterProperties 2667 } 2668 } 2669 } 2670 2671 return nil 2672} 2673 2674// BodyDiagnosticSettings body logging settings. 2675type BodyDiagnosticSettings struct { 2676 // Bytes - Number of request body bytes to log. 2677 Bytes *int32 `json:"bytes,omitempty"` 2678} 2679 2680// CacheCollection paged Caches list representation. 2681type CacheCollection struct { 2682 autorest.Response `json:"-"` 2683 // Value - Page values. 2684 Value *[]CacheContract `json:"value,omitempty"` 2685 // NextLink - Next page link if any. 2686 NextLink *string `json:"nextLink,omitempty"` 2687} 2688 2689// CacheCollectionIterator provides access to a complete listing of CacheContract values. 2690type CacheCollectionIterator struct { 2691 i int 2692 page CacheCollectionPage 2693} 2694 2695// NextWithContext advances to the next value. If there was an error making 2696// the request the iterator does not advance and the error is returned. 2697func (iter *CacheCollectionIterator) NextWithContext(ctx context.Context) (err error) { 2698 if tracing.IsEnabled() { 2699 ctx = tracing.StartSpan(ctx, fqdn+"/CacheCollectionIterator.NextWithContext") 2700 defer func() { 2701 sc := -1 2702 if iter.Response().Response.Response != nil { 2703 sc = iter.Response().Response.Response.StatusCode 2704 } 2705 tracing.EndSpan(ctx, sc, err) 2706 }() 2707 } 2708 iter.i++ 2709 if iter.i < len(iter.page.Values()) { 2710 return nil 2711 } 2712 err = iter.page.NextWithContext(ctx) 2713 if err != nil { 2714 iter.i-- 2715 return err 2716 } 2717 iter.i = 0 2718 return nil 2719} 2720 2721// Next advances to the next value. If there was an error making 2722// the request the iterator does not advance and the error is returned. 2723// Deprecated: Use NextWithContext() instead. 2724func (iter *CacheCollectionIterator) Next() error { 2725 return iter.NextWithContext(context.Background()) 2726} 2727 2728// NotDone returns true if the enumeration should be started or is not yet complete. 2729func (iter CacheCollectionIterator) NotDone() bool { 2730 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 2731} 2732 2733// Response returns the raw server response from the last page request. 2734func (iter CacheCollectionIterator) Response() CacheCollection { 2735 return iter.page.Response() 2736} 2737 2738// Value returns the current value or a zero-initialized value if the 2739// iterator has advanced beyond the end of the collection. 2740func (iter CacheCollectionIterator) Value() CacheContract { 2741 if !iter.page.NotDone() { 2742 return CacheContract{} 2743 } 2744 return iter.page.Values()[iter.i] 2745} 2746 2747// Creates a new instance of the CacheCollectionIterator type. 2748func NewCacheCollectionIterator(page CacheCollectionPage) CacheCollectionIterator { 2749 return CacheCollectionIterator{page: page} 2750} 2751 2752// IsEmpty returns true if the ListResult contains no values. 2753func (cc CacheCollection) IsEmpty() bool { 2754 return cc.Value == nil || len(*cc.Value) == 0 2755} 2756 2757// hasNextLink returns true if the NextLink is not empty. 2758func (cc CacheCollection) hasNextLink() bool { 2759 return cc.NextLink != nil && len(*cc.NextLink) != 0 2760} 2761 2762// cacheCollectionPreparer prepares a request to retrieve the next set of results. 2763// It returns nil if no more results exist. 2764func (cc CacheCollection) cacheCollectionPreparer(ctx context.Context) (*http.Request, error) { 2765 if !cc.hasNextLink() { 2766 return nil, nil 2767 } 2768 return autorest.Prepare((&http.Request{}).WithContext(ctx), 2769 autorest.AsJSON(), 2770 autorest.AsGet(), 2771 autorest.WithBaseURL(to.String(cc.NextLink))) 2772} 2773 2774// CacheCollectionPage contains a page of CacheContract values. 2775type CacheCollectionPage struct { 2776 fn func(context.Context, CacheCollection) (CacheCollection, error) 2777 cc CacheCollection 2778} 2779 2780// NextWithContext advances to the next page of values. If there was an error making 2781// the request the page does not advance and the error is returned. 2782func (page *CacheCollectionPage) NextWithContext(ctx context.Context) (err error) { 2783 if tracing.IsEnabled() { 2784 ctx = tracing.StartSpan(ctx, fqdn+"/CacheCollectionPage.NextWithContext") 2785 defer func() { 2786 sc := -1 2787 if page.Response().Response.Response != nil { 2788 sc = page.Response().Response.Response.StatusCode 2789 } 2790 tracing.EndSpan(ctx, sc, err) 2791 }() 2792 } 2793 for { 2794 next, err := page.fn(ctx, page.cc) 2795 if err != nil { 2796 return err 2797 } 2798 page.cc = next 2799 if !next.hasNextLink() || !next.IsEmpty() { 2800 break 2801 } 2802 } 2803 return nil 2804} 2805 2806// Next advances to the next page of values. If there was an error making 2807// the request the page does not advance and the error is returned. 2808// Deprecated: Use NextWithContext() instead. 2809func (page *CacheCollectionPage) Next() error { 2810 return page.NextWithContext(context.Background()) 2811} 2812 2813// NotDone returns true if the page enumeration should be started or is not yet complete. 2814func (page CacheCollectionPage) NotDone() bool { 2815 return !page.cc.IsEmpty() 2816} 2817 2818// Response returns the raw server response from the last page request. 2819func (page CacheCollectionPage) Response() CacheCollection { 2820 return page.cc 2821} 2822 2823// Values returns the slice of values for the current page or nil if there are no values. 2824func (page CacheCollectionPage) Values() []CacheContract { 2825 if page.cc.IsEmpty() { 2826 return nil 2827 } 2828 return *page.cc.Value 2829} 2830 2831// Creates a new instance of the CacheCollectionPage type. 2832func NewCacheCollectionPage(cur CacheCollection, getNextPage func(context.Context, CacheCollection) (CacheCollection, error)) CacheCollectionPage { 2833 return CacheCollectionPage{ 2834 fn: getNextPage, 2835 cc: cur, 2836 } 2837} 2838 2839// CacheContract cache details. 2840type CacheContract struct { 2841 autorest.Response `json:"-"` 2842 // CacheContractProperties - Cache properties details. 2843 *CacheContractProperties `json:"properties,omitempty"` 2844 // ID - READ-ONLY; Resource ID. 2845 ID *string `json:"id,omitempty"` 2846 // Name - READ-ONLY; Resource name. 2847 Name *string `json:"name,omitempty"` 2848 // Type - READ-ONLY; Resource type for API Management resource. 2849 Type *string `json:"type,omitempty"` 2850} 2851 2852// MarshalJSON is the custom marshaler for CacheContract. 2853func (cc CacheContract) MarshalJSON() ([]byte, error) { 2854 objectMap := make(map[string]interface{}) 2855 if cc.CacheContractProperties != nil { 2856 objectMap["properties"] = cc.CacheContractProperties 2857 } 2858 return json.Marshal(objectMap) 2859} 2860 2861// UnmarshalJSON is the custom unmarshaler for CacheContract struct. 2862func (cc *CacheContract) UnmarshalJSON(body []byte) error { 2863 var m map[string]*json.RawMessage 2864 err := json.Unmarshal(body, &m) 2865 if err != nil { 2866 return err 2867 } 2868 for k, v := range m { 2869 switch k { 2870 case "properties": 2871 if v != nil { 2872 var cacheContractProperties CacheContractProperties 2873 err = json.Unmarshal(*v, &cacheContractProperties) 2874 if err != nil { 2875 return err 2876 } 2877 cc.CacheContractProperties = &cacheContractProperties 2878 } 2879 case "id": 2880 if v != nil { 2881 var ID string 2882 err = json.Unmarshal(*v, &ID) 2883 if err != nil { 2884 return err 2885 } 2886 cc.ID = &ID 2887 } 2888 case "name": 2889 if v != nil { 2890 var name string 2891 err = json.Unmarshal(*v, &name) 2892 if err != nil { 2893 return err 2894 } 2895 cc.Name = &name 2896 } 2897 case "type": 2898 if v != nil { 2899 var typeVar string 2900 err = json.Unmarshal(*v, &typeVar) 2901 if err != nil { 2902 return err 2903 } 2904 cc.Type = &typeVar 2905 } 2906 } 2907 } 2908 2909 return nil 2910} 2911 2912// CacheContractProperties properties of the Cache contract. 2913type CacheContractProperties struct { 2914 // Description - Cache description 2915 Description *string `json:"description,omitempty"` 2916 // ConnectionString - Runtime connection string to cache 2917 ConnectionString *string `json:"connectionString,omitempty"` 2918 // ResourceID - Original uri of entity in external system cache points to 2919 ResourceID *string `json:"resourceId,omitempty"` 2920} 2921 2922// CacheUpdateParameters cache update details. 2923type CacheUpdateParameters struct { 2924 // CacheUpdateProperties - Cache update properties details. 2925 *CacheUpdateProperties `json:"properties,omitempty"` 2926} 2927 2928// MarshalJSON is the custom marshaler for CacheUpdateParameters. 2929func (cup CacheUpdateParameters) MarshalJSON() ([]byte, error) { 2930 objectMap := make(map[string]interface{}) 2931 if cup.CacheUpdateProperties != nil { 2932 objectMap["properties"] = cup.CacheUpdateProperties 2933 } 2934 return json.Marshal(objectMap) 2935} 2936 2937// UnmarshalJSON is the custom unmarshaler for CacheUpdateParameters struct. 2938func (cup *CacheUpdateParameters) UnmarshalJSON(body []byte) error { 2939 var m map[string]*json.RawMessage 2940 err := json.Unmarshal(body, &m) 2941 if err != nil { 2942 return err 2943 } 2944 for k, v := range m { 2945 switch k { 2946 case "properties": 2947 if v != nil { 2948 var cacheUpdateProperties CacheUpdateProperties 2949 err = json.Unmarshal(*v, &cacheUpdateProperties) 2950 if err != nil { 2951 return err 2952 } 2953 cup.CacheUpdateProperties = &cacheUpdateProperties 2954 } 2955 } 2956 } 2957 2958 return nil 2959} 2960 2961// CacheUpdateProperties parameters supplied to the Update Cache operation. 2962type CacheUpdateProperties struct { 2963 // Description - Cache description 2964 Description *string `json:"description,omitempty"` 2965 // ConnectionString - Runtime connection string to cache 2966 ConnectionString *string `json:"connectionString,omitempty"` 2967 // ResourceID - Original uri of entity in external system cache points to 2968 ResourceID *string `json:"resourceId,omitempty"` 2969} 2970 2971// CertificateCollection paged Certificates list representation. 2972type CertificateCollection struct { 2973 autorest.Response `json:"-"` 2974 // Value - Page values. 2975 Value *[]CertificateContract `json:"value,omitempty"` 2976 // NextLink - Next page link if any. 2977 NextLink *string `json:"nextLink,omitempty"` 2978} 2979 2980// CertificateCollectionIterator provides access to a complete listing of CertificateContract values. 2981type CertificateCollectionIterator struct { 2982 i int 2983 page CertificateCollectionPage 2984} 2985 2986// NextWithContext advances to the next value. If there was an error making 2987// the request the iterator does not advance and the error is returned. 2988func (iter *CertificateCollectionIterator) NextWithContext(ctx context.Context) (err error) { 2989 if tracing.IsEnabled() { 2990 ctx = tracing.StartSpan(ctx, fqdn+"/CertificateCollectionIterator.NextWithContext") 2991 defer func() { 2992 sc := -1 2993 if iter.Response().Response.Response != nil { 2994 sc = iter.Response().Response.Response.StatusCode 2995 } 2996 tracing.EndSpan(ctx, sc, err) 2997 }() 2998 } 2999 iter.i++ 3000 if iter.i < len(iter.page.Values()) { 3001 return nil 3002 } 3003 err = iter.page.NextWithContext(ctx) 3004 if err != nil { 3005 iter.i-- 3006 return err 3007 } 3008 iter.i = 0 3009 return nil 3010} 3011 3012// Next advances to the next value. If there was an error making 3013// the request the iterator does not advance and the error is returned. 3014// Deprecated: Use NextWithContext() instead. 3015func (iter *CertificateCollectionIterator) Next() error { 3016 return iter.NextWithContext(context.Background()) 3017} 3018 3019// NotDone returns true if the enumeration should be started or is not yet complete. 3020func (iter CertificateCollectionIterator) NotDone() bool { 3021 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 3022} 3023 3024// Response returns the raw server response from the last page request. 3025func (iter CertificateCollectionIterator) Response() CertificateCollection { 3026 return iter.page.Response() 3027} 3028 3029// Value returns the current value or a zero-initialized value if the 3030// iterator has advanced beyond the end of the collection. 3031func (iter CertificateCollectionIterator) Value() CertificateContract { 3032 if !iter.page.NotDone() { 3033 return CertificateContract{} 3034 } 3035 return iter.page.Values()[iter.i] 3036} 3037 3038// Creates a new instance of the CertificateCollectionIterator type. 3039func NewCertificateCollectionIterator(page CertificateCollectionPage) CertificateCollectionIterator { 3040 return CertificateCollectionIterator{page: page} 3041} 3042 3043// IsEmpty returns true if the ListResult contains no values. 3044func (cc CertificateCollection) IsEmpty() bool { 3045 return cc.Value == nil || len(*cc.Value) == 0 3046} 3047 3048// hasNextLink returns true if the NextLink is not empty. 3049func (cc CertificateCollection) hasNextLink() bool { 3050 return cc.NextLink != nil && len(*cc.NextLink) != 0 3051} 3052 3053// certificateCollectionPreparer prepares a request to retrieve the next set of results. 3054// It returns nil if no more results exist. 3055func (cc CertificateCollection) certificateCollectionPreparer(ctx context.Context) (*http.Request, error) { 3056 if !cc.hasNextLink() { 3057 return nil, nil 3058 } 3059 return autorest.Prepare((&http.Request{}).WithContext(ctx), 3060 autorest.AsJSON(), 3061 autorest.AsGet(), 3062 autorest.WithBaseURL(to.String(cc.NextLink))) 3063} 3064 3065// CertificateCollectionPage contains a page of CertificateContract values. 3066type CertificateCollectionPage struct { 3067 fn func(context.Context, CertificateCollection) (CertificateCollection, error) 3068 cc CertificateCollection 3069} 3070 3071// NextWithContext advances to the next page of values. If there was an error making 3072// the request the page does not advance and the error is returned. 3073func (page *CertificateCollectionPage) NextWithContext(ctx context.Context) (err error) { 3074 if tracing.IsEnabled() { 3075 ctx = tracing.StartSpan(ctx, fqdn+"/CertificateCollectionPage.NextWithContext") 3076 defer func() { 3077 sc := -1 3078 if page.Response().Response.Response != nil { 3079 sc = page.Response().Response.Response.StatusCode 3080 } 3081 tracing.EndSpan(ctx, sc, err) 3082 }() 3083 } 3084 for { 3085 next, err := page.fn(ctx, page.cc) 3086 if err != nil { 3087 return err 3088 } 3089 page.cc = next 3090 if !next.hasNextLink() || !next.IsEmpty() { 3091 break 3092 } 3093 } 3094 return nil 3095} 3096 3097// Next advances to the next page of values. If there was an error making 3098// the request the page does not advance and the error is returned. 3099// Deprecated: Use NextWithContext() instead. 3100func (page *CertificateCollectionPage) Next() error { 3101 return page.NextWithContext(context.Background()) 3102} 3103 3104// NotDone returns true if the page enumeration should be started or is not yet complete. 3105func (page CertificateCollectionPage) NotDone() bool { 3106 return !page.cc.IsEmpty() 3107} 3108 3109// Response returns the raw server response from the last page request. 3110func (page CertificateCollectionPage) Response() CertificateCollection { 3111 return page.cc 3112} 3113 3114// Values returns the slice of values for the current page or nil if there are no values. 3115func (page CertificateCollectionPage) Values() []CertificateContract { 3116 if page.cc.IsEmpty() { 3117 return nil 3118 } 3119 return *page.cc.Value 3120} 3121 3122// Creates a new instance of the CertificateCollectionPage type. 3123func NewCertificateCollectionPage(cur CertificateCollection, getNextPage func(context.Context, CertificateCollection) (CertificateCollection, error)) CertificateCollectionPage { 3124 return CertificateCollectionPage{ 3125 fn: getNextPage, 3126 cc: cur, 3127 } 3128} 3129 3130// CertificateConfiguration certificate configuration which consist of non-trusted intermediates and root 3131// certificates. 3132type CertificateConfiguration struct { 3133 // EncodedCertificate - Base64 Encoded certificate. 3134 EncodedCertificate *string `json:"encodedCertificate,omitempty"` 3135 // CertificatePassword - Certificate Password. 3136 CertificatePassword *string `json:"certificatePassword,omitempty"` 3137 // StoreName - The System.Security.Cryptography.x509certificates.StoreName certificate store location. Only Root and CertificateAuthority are valid locations. Possible values include: 'CertificateAuthority', 'Root' 3138 StoreName StoreName `json:"storeName,omitempty"` 3139 // Certificate - Certificate information. 3140 Certificate *CertificateInformation `json:"certificate,omitempty"` 3141} 3142 3143// CertificateContract certificate details. 3144type CertificateContract struct { 3145 autorest.Response `json:"-"` 3146 // CertificateContractProperties - Certificate properties details. 3147 *CertificateContractProperties `json:"properties,omitempty"` 3148 // ID - READ-ONLY; Resource ID. 3149 ID *string `json:"id,omitempty"` 3150 // Name - READ-ONLY; Resource name. 3151 Name *string `json:"name,omitempty"` 3152 // Type - READ-ONLY; Resource type for API Management resource. 3153 Type *string `json:"type,omitempty"` 3154} 3155 3156// MarshalJSON is the custom marshaler for CertificateContract. 3157func (cc CertificateContract) MarshalJSON() ([]byte, error) { 3158 objectMap := make(map[string]interface{}) 3159 if cc.CertificateContractProperties != nil { 3160 objectMap["properties"] = cc.CertificateContractProperties 3161 } 3162 return json.Marshal(objectMap) 3163} 3164 3165// UnmarshalJSON is the custom unmarshaler for CertificateContract struct. 3166func (cc *CertificateContract) UnmarshalJSON(body []byte) error { 3167 var m map[string]*json.RawMessage 3168 err := json.Unmarshal(body, &m) 3169 if err != nil { 3170 return err 3171 } 3172 for k, v := range m { 3173 switch k { 3174 case "properties": 3175 if v != nil { 3176 var certificateContractProperties CertificateContractProperties 3177 err = json.Unmarshal(*v, &certificateContractProperties) 3178 if err != nil { 3179 return err 3180 } 3181 cc.CertificateContractProperties = &certificateContractProperties 3182 } 3183 case "id": 3184 if v != nil { 3185 var ID string 3186 err = json.Unmarshal(*v, &ID) 3187 if err != nil { 3188 return err 3189 } 3190 cc.ID = &ID 3191 } 3192 case "name": 3193 if v != nil { 3194 var name string 3195 err = json.Unmarshal(*v, &name) 3196 if err != nil { 3197 return err 3198 } 3199 cc.Name = &name 3200 } 3201 case "type": 3202 if v != nil { 3203 var typeVar string 3204 err = json.Unmarshal(*v, &typeVar) 3205 if err != nil { 3206 return err 3207 } 3208 cc.Type = &typeVar 3209 } 3210 } 3211 } 3212 3213 return nil 3214} 3215 3216// CertificateContractProperties properties of the Certificate contract. 3217type CertificateContractProperties struct { 3218 // Subject - Subject attribute of the certificate. 3219 Subject *string `json:"subject,omitempty"` 3220 // Thumbprint - Thumbprint of the certificate. 3221 Thumbprint *string `json:"thumbprint,omitempty"` 3222 // 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. 3223 ExpirationDate *date.Time `json:"expirationDate,omitempty"` 3224} 3225 3226// CertificateCreateOrUpdateParameters certificate create or update details. 3227type CertificateCreateOrUpdateParameters struct { 3228 // CertificateCreateOrUpdateProperties - Certificate create or update properties details. 3229 *CertificateCreateOrUpdateProperties `json:"properties,omitempty"` 3230} 3231 3232// MarshalJSON is the custom marshaler for CertificateCreateOrUpdateParameters. 3233func (ccoup CertificateCreateOrUpdateParameters) MarshalJSON() ([]byte, error) { 3234 objectMap := make(map[string]interface{}) 3235 if ccoup.CertificateCreateOrUpdateProperties != nil { 3236 objectMap["properties"] = ccoup.CertificateCreateOrUpdateProperties 3237 } 3238 return json.Marshal(objectMap) 3239} 3240 3241// UnmarshalJSON is the custom unmarshaler for CertificateCreateOrUpdateParameters struct. 3242func (ccoup *CertificateCreateOrUpdateParameters) UnmarshalJSON(body []byte) error { 3243 var m map[string]*json.RawMessage 3244 err := json.Unmarshal(body, &m) 3245 if err != nil { 3246 return err 3247 } 3248 for k, v := range m { 3249 switch k { 3250 case "properties": 3251 if v != nil { 3252 var certificateCreateOrUpdateProperties CertificateCreateOrUpdateProperties 3253 err = json.Unmarshal(*v, &certificateCreateOrUpdateProperties) 3254 if err != nil { 3255 return err 3256 } 3257 ccoup.CertificateCreateOrUpdateProperties = &certificateCreateOrUpdateProperties 3258 } 3259 } 3260 } 3261 3262 return nil 3263} 3264 3265// CertificateCreateOrUpdateProperties parameters supplied to the CreateOrUpdate certificate operation. 3266type CertificateCreateOrUpdateProperties struct { 3267 // Data - Base 64 encoded certificate using the application/x-pkcs12 representation. 3268 Data *string `json:"data,omitempty"` 3269 // Password - Password for the Certificate 3270 Password *string `json:"password,omitempty"` 3271} 3272 3273// CertificateInformation SSL certificate information. 3274type CertificateInformation struct { 3275 // 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. 3276 Expiry *date.Time `json:"expiry,omitempty"` 3277 // Thumbprint - Thumbprint of the certificate. 3278 Thumbprint *string `json:"thumbprint,omitempty"` 3279 // Subject - Subject of the certificate. 3280 Subject *string `json:"subject,omitempty"` 3281} 3282 3283// ConnectivityStatusContract details about connectivity to a resource. 3284type ConnectivityStatusContract struct { 3285 // 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. 3286 Name *string `json:"name,omitempty"` 3287 // Status - Resource Connectivity Status Type identifier. Possible values include: 'Initializing', 'Success', 'Failure' 3288 Status ConnectivityStatusType `json:"status,omitempty"` 3289 // Error - Error details of the connectivity to the resource. 3290 Error *string `json:"error,omitempty"` 3291 // 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. 3292 LastUpdated *date.Time `json:"lastUpdated,omitempty"` 3293 // 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. 3294 LastStatusChange *date.Time `json:"lastStatusChange,omitempty"` 3295} 3296 3297// DeployConfigurationParameterProperties parameters supplied to the Deploy Configuration operation. 3298type DeployConfigurationParameterProperties struct { 3299 // Branch - The name of the Git branch from which the configuration is to be deployed to the configuration database. 3300 Branch *string `json:"branch,omitempty"` 3301 // Force - The value enforcing deleting subscriptions to products that are deleted in this update. 3302 Force *bool `json:"force,omitempty"` 3303} 3304 3305// DeployConfigurationParameters deploy Tenant Configuration Contract. 3306type DeployConfigurationParameters struct { 3307 // DeployConfigurationParameterProperties - Deploy Configuration Parameter contract properties. 3308 *DeployConfigurationParameterProperties `json:"properties,omitempty"` 3309} 3310 3311// MarshalJSON is the custom marshaler for DeployConfigurationParameters. 3312func (dcp DeployConfigurationParameters) MarshalJSON() ([]byte, error) { 3313 objectMap := make(map[string]interface{}) 3314 if dcp.DeployConfigurationParameterProperties != nil { 3315 objectMap["properties"] = dcp.DeployConfigurationParameterProperties 3316 } 3317 return json.Marshal(objectMap) 3318} 3319 3320// UnmarshalJSON is the custom unmarshaler for DeployConfigurationParameters struct. 3321func (dcp *DeployConfigurationParameters) UnmarshalJSON(body []byte) error { 3322 var m map[string]*json.RawMessage 3323 err := json.Unmarshal(body, &m) 3324 if err != nil { 3325 return err 3326 } 3327 for k, v := range m { 3328 switch k { 3329 case "properties": 3330 if v != nil { 3331 var deployConfigurationParameterProperties DeployConfigurationParameterProperties 3332 err = json.Unmarshal(*v, &deployConfigurationParameterProperties) 3333 if err != nil { 3334 return err 3335 } 3336 dcp.DeployConfigurationParameterProperties = &deployConfigurationParameterProperties 3337 } 3338 } 3339 } 3340 3341 return nil 3342} 3343 3344// DiagnosticCollection paged Diagnostic list representation. 3345type DiagnosticCollection struct { 3346 autorest.Response `json:"-"` 3347 // Value - Page values. 3348 Value *[]DiagnosticContract `json:"value,omitempty"` 3349 // NextLink - Next page link if any. 3350 NextLink *string `json:"nextLink,omitempty"` 3351} 3352 3353// DiagnosticCollectionIterator provides access to a complete listing of DiagnosticContract values. 3354type DiagnosticCollectionIterator struct { 3355 i int 3356 page DiagnosticCollectionPage 3357} 3358 3359// NextWithContext advances to the next value. If there was an error making 3360// the request the iterator does not advance and the error is returned. 3361func (iter *DiagnosticCollectionIterator) NextWithContext(ctx context.Context) (err error) { 3362 if tracing.IsEnabled() { 3363 ctx = tracing.StartSpan(ctx, fqdn+"/DiagnosticCollectionIterator.NextWithContext") 3364 defer func() { 3365 sc := -1 3366 if iter.Response().Response.Response != nil { 3367 sc = iter.Response().Response.Response.StatusCode 3368 } 3369 tracing.EndSpan(ctx, sc, err) 3370 }() 3371 } 3372 iter.i++ 3373 if iter.i < len(iter.page.Values()) { 3374 return nil 3375 } 3376 err = iter.page.NextWithContext(ctx) 3377 if err != nil { 3378 iter.i-- 3379 return err 3380 } 3381 iter.i = 0 3382 return nil 3383} 3384 3385// Next advances to the next value. If there was an error making 3386// the request the iterator does not advance and the error is returned. 3387// Deprecated: Use NextWithContext() instead. 3388func (iter *DiagnosticCollectionIterator) Next() error { 3389 return iter.NextWithContext(context.Background()) 3390} 3391 3392// NotDone returns true if the enumeration should be started or is not yet complete. 3393func (iter DiagnosticCollectionIterator) NotDone() bool { 3394 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 3395} 3396 3397// Response returns the raw server response from the last page request. 3398func (iter DiagnosticCollectionIterator) Response() DiagnosticCollection { 3399 return iter.page.Response() 3400} 3401 3402// Value returns the current value or a zero-initialized value if the 3403// iterator has advanced beyond the end of the collection. 3404func (iter DiagnosticCollectionIterator) Value() DiagnosticContract { 3405 if !iter.page.NotDone() { 3406 return DiagnosticContract{} 3407 } 3408 return iter.page.Values()[iter.i] 3409} 3410 3411// Creates a new instance of the DiagnosticCollectionIterator type. 3412func NewDiagnosticCollectionIterator(page DiagnosticCollectionPage) DiagnosticCollectionIterator { 3413 return DiagnosticCollectionIterator{page: page} 3414} 3415 3416// IsEmpty returns true if the ListResult contains no values. 3417func (dc DiagnosticCollection) IsEmpty() bool { 3418 return dc.Value == nil || len(*dc.Value) == 0 3419} 3420 3421// hasNextLink returns true if the NextLink is not empty. 3422func (dc DiagnosticCollection) hasNextLink() bool { 3423 return dc.NextLink != nil && len(*dc.NextLink) != 0 3424} 3425 3426// diagnosticCollectionPreparer prepares a request to retrieve the next set of results. 3427// It returns nil if no more results exist. 3428func (dc DiagnosticCollection) diagnosticCollectionPreparer(ctx context.Context) (*http.Request, error) { 3429 if !dc.hasNextLink() { 3430 return nil, nil 3431 } 3432 return autorest.Prepare((&http.Request{}).WithContext(ctx), 3433 autorest.AsJSON(), 3434 autorest.AsGet(), 3435 autorest.WithBaseURL(to.String(dc.NextLink))) 3436} 3437 3438// DiagnosticCollectionPage contains a page of DiagnosticContract values. 3439type DiagnosticCollectionPage struct { 3440 fn func(context.Context, DiagnosticCollection) (DiagnosticCollection, error) 3441 dc DiagnosticCollection 3442} 3443 3444// NextWithContext advances to the next page of values. If there was an error making 3445// the request the page does not advance and the error is returned. 3446func (page *DiagnosticCollectionPage) NextWithContext(ctx context.Context) (err error) { 3447 if tracing.IsEnabled() { 3448 ctx = tracing.StartSpan(ctx, fqdn+"/DiagnosticCollectionPage.NextWithContext") 3449 defer func() { 3450 sc := -1 3451 if page.Response().Response.Response != nil { 3452 sc = page.Response().Response.Response.StatusCode 3453 } 3454 tracing.EndSpan(ctx, sc, err) 3455 }() 3456 } 3457 for { 3458 next, err := page.fn(ctx, page.dc) 3459 if err != nil { 3460 return err 3461 } 3462 page.dc = next 3463 if !next.hasNextLink() || !next.IsEmpty() { 3464 break 3465 } 3466 } 3467 return nil 3468} 3469 3470// Next advances to the next page of values. If there was an error making 3471// the request the page does not advance and the error is returned. 3472// Deprecated: Use NextWithContext() instead. 3473func (page *DiagnosticCollectionPage) Next() error { 3474 return page.NextWithContext(context.Background()) 3475} 3476 3477// NotDone returns true if the page enumeration should be started or is not yet complete. 3478func (page DiagnosticCollectionPage) NotDone() bool { 3479 return !page.dc.IsEmpty() 3480} 3481 3482// Response returns the raw server response from the last page request. 3483func (page DiagnosticCollectionPage) Response() DiagnosticCollection { 3484 return page.dc 3485} 3486 3487// Values returns the slice of values for the current page or nil if there are no values. 3488func (page DiagnosticCollectionPage) Values() []DiagnosticContract { 3489 if page.dc.IsEmpty() { 3490 return nil 3491 } 3492 return *page.dc.Value 3493} 3494 3495// Creates a new instance of the DiagnosticCollectionPage type. 3496func NewDiagnosticCollectionPage(cur DiagnosticCollection, getNextPage func(context.Context, DiagnosticCollection) (DiagnosticCollection, error)) DiagnosticCollectionPage { 3497 return DiagnosticCollectionPage{ 3498 fn: getNextPage, 3499 dc: cur, 3500 } 3501} 3502 3503// DiagnosticContract diagnostic details. 3504type DiagnosticContract struct { 3505 autorest.Response `json:"-"` 3506 // DiagnosticContractProperties - Diagnostic entity contract properties. 3507 *DiagnosticContractProperties `json:"properties,omitempty"` 3508 // ID - READ-ONLY; Resource ID. 3509 ID *string `json:"id,omitempty"` 3510 // Name - READ-ONLY; Resource name. 3511 Name *string `json:"name,omitempty"` 3512 // Type - READ-ONLY; Resource type for API Management resource. 3513 Type *string `json:"type,omitempty"` 3514} 3515 3516// MarshalJSON is the custom marshaler for DiagnosticContract. 3517func (dc DiagnosticContract) MarshalJSON() ([]byte, error) { 3518 objectMap := make(map[string]interface{}) 3519 if dc.DiagnosticContractProperties != nil { 3520 objectMap["properties"] = dc.DiagnosticContractProperties 3521 } 3522 return json.Marshal(objectMap) 3523} 3524 3525// UnmarshalJSON is the custom unmarshaler for DiagnosticContract struct. 3526func (dc *DiagnosticContract) 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 diagnosticContractProperties DiagnosticContractProperties 3537 err = json.Unmarshal(*v, &diagnosticContractProperties) 3538 if err != nil { 3539 return err 3540 } 3541 dc.DiagnosticContractProperties = &diagnosticContractProperties 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 dc.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 dc.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 dc.Type = &typeVar 3569 } 3570 } 3571 } 3572 3573 return nil 3574} 3575 3576// DiagnosticContractProperties diagnostic Entity Properties 3577type DiagnosticContractProperties struct { 3578 // AlwaysLog - Specifies for what type of messages sampling settings should not apply. Possible values include: 'AllErrors' 3579 AlwaysLog AlwaysLog `json:"alwaysLog,omitempty"` 3580 // LoggerID - Resource Id of a target logger. 3581 LoggerID *string `json:"loggerId,omitempty"` 3582 // Sampling - Sampling settings for Diagnostic. 3583 Sampling *SamplingSettings `json:"sampling,omitempty"` 3584 // Frontend - Diagnostic settings for incoming/outgoing HTTP messages to the Gateway. 3585 Frontend *PipelineDiagnosticSettings `json:"frontend,omitempty"` 3586 // Backend - Diagnostic settings for incoming/outgoing HTTP messages to the Backend 3587 Backend *PipelineDiagnosticSettings `json:"backend,omitempty"` 3588 // EnableHTTPCorrelationHeaders - Whether to process Correlation Headers coming to Api Management Service. Only applicable to Application Insights diagnostics. Default is true. 3589 EnableHTTPCorrelationHeaders *bool `json:"enableHttpCorrelationHeaders,omitempty"` 3590 // HTTPCorrelationProtocol - Sets correlation protocol to use for Application Insights diagnostics. Possible values include: 'None', 'Legacy', 'W3C' 3591 HTTPCorrelationProtocol HTTPCorrelationProtocol `json:"httpCorrelationProtocol,omitempty"` 3592 // Verbosity - The verbosity level applied to traces emitted by trace policies. Possible values include: 'Verbose', 'Information', 'Error' 3593 Verbosity Verbosity `json:"verbosity,omitempty"` 3594} 3595 3596// EmailTemplateCollection paged email template list representation. 3597type EmailTemplateCollection struct { 3598 autorest.Response `json:"-"` 3599 // Value - Page values. 3600 Value *[]EmailTemplateContract `json:"value,omitempty"` 3601 // NextLink - Next page link if any. 3602 NextLink *string `json:"nextLink,omitempty"` 3603} 3604 3605// EmailTemplateCollectionIterator provides access to a complete listing of EmailTemplateContract values. 3606type EmailTemplateCollectionIterator struct { 3607 i int 3608 page EmailTemplateCollectionPage 3609} 3610 3611// NextWithContext advances to the next value. If there was an error making 3612// the request the iterator does not advance and the error is returned. 3613func (iter *EmailTemplateCollectionIterator) NextWithContext(ctx context.Context) (err error) { 3614 if tracing.IsEnabled() { 3615 ctx = tracing.StartSpan(ctx, fqdn+"/EmailTemplateCollectionIterator.NextWithContext") 3616 defer func() { 3617 sc := -1 3618 if iter.Response().Response.Response != nil { 3619 sc = iter.Response().Response.Response.StatusCode 3620 } 3621 tracing.EndSpan(ctx, sc, err) 3622 }() 3623 } 3624 iter.i++ 3625 if iter.i < len(iter.page.Values()) { 3626 return nil 3627 } 3628 err = iter.page.NextWithContext(ctx) 3629 if err != nil { 3630 iter.i-- 3631 return err 3632 } 3633 iter.i = 0 3634 return nil 3635} 3636 3637// Next advances to the next value. If there was an error making 3638// the request the iterator does not advance and the error is returned. 3639// Deprecated: Use NextWithContext() instead. 3640func (iter *EmailTemplateCollectionIterator) Next() error { 3641 return iter.NextWithContext(context.Background()) 3642} 3643 3644// NotDone returns true if the enumeration should be started or is not yet complete. 3645func (iter EmailTemplateCollectionIterator) NotDone() bool { 3646 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 3647} 3648 3649// Response returns the raw server response from the last page request. 3650func (iter EmailTemplateCollectionIterator) Response() EmailTemplateCollection { 3651 return iter.page.Response() 3652} 3653 3654// Value returns the current value or a zero-initialized value if the 3655// iterator has advanced beyond the end of the collection. 3656func (iter EmailTemplateCollectionIterator) Value() EmailTemplateContract { 3657 if !iter.page.NotDone() { 3658 return EmailTemplateContract{} 3659 } 3660 return iter.page.Values()[iter.i] 3661} 3662 3663// Creates a new instance of the EmailTemplateCollectionIterator type. 3664func NewEmailTemplateCollectionIterator(page EmailTemplateCollectionPage) EmailTemplateCollectionIterator { 3665 return EmailTemplateCollectionIterator{page: page} 3666} 3667 3668// IsEmpty returns true if the ListResult contains no values. 3669func (etc EmailTemplateCollection) IsEmpty() bool { 3670 return etc.Value == nil || len(*etc.Value) == 0 3671} 3672 3673// hasNextLink returns true if the NextLink is not empty. 3674func (etc EmailTemplateCollection) hasNextLink() bool { 3675 return etc.NextLink != nil && len(*etc.NextLink) != 0 3676} 3677 3678// emailTemplateCollectionPreparer prepares a request to retrieve the next set of results. 3679// It returns nil if no more results exist. 3680func (etc EmailTemplateCollection) emailTemplateCollectionPreparer(ctx context.Context) (*http.Request, error) { 3681 if !etc.hasNextLink() { 3682 return nil, nil 3683 } 3684 return autorest.Prepare((&http.Request{}).WithContext(ctx), 3685 autorest.AsJSON(), 3686 autorest.AsGet(), 3687 autorest.WithBaseURL(to.String(etc.NextLink))) 3688} 3689 3690// EmailTemplateCollectionPage contains a page of EmailTemplateContract values. 3691type EmailTemplateCollectionPage struct { 3692 fn func(context.Context, EmailTemplateCollection) (EmailTemplateCollection, error) 3693 etc EmailTemplateCollection 3694} 3695 3696// NextWithContext advances to the next page of values. If there was an error making 3697// the request the page does not advance and the error is returned. 3698func (page *EmailTemplateCollectionPage) NextWithContext(ctx context.Context) (err error) { 3699 if tracing.IsEnabled() { 3700 ctx = tracing.StartSpan(ctx, fqdn+"/EmailTemplateCollectionPage.NextWithContext") 3701 defer func() { 3702 sc := -1 3703 if page.Response().Response.Response != nil { 3704 sc = page.Response().Response.Response.StatusCode 3705 } 3706 tracing.EndSpan(ctx, sc, err) 3707 }() 3708 } 3709 for { 3710 next, err := page.fn(ctx, page.etc) 3711 if err != nil { 3712 return err 3713 } 3714 page.etc = next 3715 if !next.hasNextLink() || !next.IsEmpty() { 3716 break 3717 } 3718 } 3719 return nil 3720} 3721 3722// Next advances to the next page of values. If there was an error making 3723// the request the page does not advance and the error is returned. 3724// Deprecated: Use NextWithContext() instead. 3725func (page *EmailTemplateCollectionPage) Next() error { 3726 return page.NextWithContext(context.Background()) 3727} 3728 3729// NotDone returns true if the page enumeration should be started or is not yet complete. 3730func (page EmailTemplateCollectionPage) NotDone() bool { 3731 return !page.etc.IsEmpty() 3732} 3733 3734// Response returns the raw server response from the last page request. 3735func (page EmailTemplateCollectionPage) Response() EmailTemplateCollection { 3736 return page.etc 3737} 3738 3739// Values returns the slice of values for the current page or nil if there are no values. 3740func (page EmailTemplateCollectionPage) Values() []EmailTemplateContract { 3741 if page.etc.IsEmpty() { 3742 return nil 3743 } 3744 return *page.etc.Value 3745} 3746 3747// Creates a new instance of the EmailTemplateCollectionPage type. 3748func NewEmailTemplateCollectionPage(cur EmailTemplateCollection, getNextPage func(context.Context, EmailTemplateCollection) (EmailTemplateCollection, error)) EmailTemplateCollectionPage { 3749 return EmailTemplateCollectionPage{ 3750 fn: getNextPage, 3751 etc: cur, 3752 } 3753} 3754 3755// EmailTemplateContract email Template details. 3756type EmailTemplateContract struct { 3757 autorest.Response `json:"-"` 3758 // EmailTemplateContractProperties - Email Template entity contract properties. 3759 *EmailTemplateContractProperties `json:"properties,omitempty"` 3760 // ID - READ-ONLY; Resource ID. 3761 ID *string `json:"id,omitempty"` 3762 // Name - READ-ONLY; Resource name. 3763 Name *string `json:"name,omitempty"` 3764 // Type - READ-ONLY; Resource type for API Management resource. 3765 Type *string `json:"type,omitempty"` 3766} 3767 3768// MarshalJSON is the custom marshaler for EmailTemplateContract. 3769func (etc EmailTemplateContract) MarshalJSON() ([]byte, error) { 3770 objectMap := make(map[string]interface{}) 3771 if etc.EmailTemplateContractProperties != nil { 3772 objectMap["properties"] = etc.EmailTemplateContractProperties 3773 } 3774 return json.Marshal(objectMap) 3775} 3776 3777// UnmarshalJSON is the custom unmarshaler for EmailTemplateContract struct. 3778func (etc *EmailTemplateContract) UnmarshalJSON(body []byte) error { 3779 var m map[string]*json.RawMessage 3780 err := json.Unmarshal(body, &m) 3781 if err != nil { 3782 return err 3783 } 3784 for k, v := range m { 3785 switch k { 3786 case "properties": 3787 if v != nil { 3788 var emailTemplateContractProperties EmailTemplateContractProperties 3789 err = json.Unmarshal(*v, &emailTemplateContractProperties) 3790 if err != nil { 3791 return err 3792 } 3793 etc.EmailTemplateContractProperties = &emailTemplateContractProperties 3794 } 3795 case "id": 3796 if v != nil { 3797 var ID string 3798 err = json.Unmarshal(*v, &ID) 3799 if err != nil { 3800 return err 3801 } 3802 etc.ID = &ID 3803 } 3804 case "name": 3805 if v != nil { 3806 var name string 3807 err = json.Unmarshal(*v, &name) 3808 if err != nil { 3809 return err 3810 } 3811 etc.Name = &name 3812 } 3813 case "type": 3814 if v != nil { 3815 var typeVar string 3816 err = json.Unmarshal(*v, &typeVar) 3817 if err != nil { 3818 return err 3819 } 3820 etc.Type = &typeVar 3821 } 3822 } 3823 } 3824 3825 return nil 3826} 3827 3828// EmailTemplateContractProperties email Template Contract properties. 3829type EmailTemplateContractProperties struct { 3830 // Subject - Subject of the Template. 3831 Subject *string `json:"subject,omitempty"` 3832 // Body - Email Template Body. This should be a valid XDocument 3833 Body *string `json:"body,omitempty"` 3834 // Title - Title of the Template. 3835 Title *string `json:"title,omitempty"` 3836 // Description - Description of the Email Template. 3837 Description *string `json:"description,omitempty"` 3838 // IsDefault - READ-ONLY; Whether the template is the default template provided by Api Management or has been edited. 3839 IsDefault *bool `json:"isDefault,omitempty"` 3840 // Parameters - Email Template Parameter values. 3841 Parameters *[]EmailTemplateParametersContractProperties `json:"parameters,omitempty"` 3842} 3843 3844// MarshalJSON is the custom marshaler for EmailTemplateContractProperties. 3845func (etcp EmailTemplateContractProperties) MarshalJSON() ([]byte, error) { 3846 objectMap := make(map[string]interface{}) 3847 if etcp.Subject != nil { 3848 objectMap["subject"] = etcp.Subject 3849 } 3850 if etcp.Body != nil { 3851 objectMap["body"] = etcp.Body 3852 } 3853 if etcp.Title != nil { 3854 objectMap["title"] = etcp.Title 3855 } 3856 if etcp.Description != nil { 3857 objectMap["description"] = etcp.Description 3858 } 3859 if etcp.Parameters != nil { 3860 objectMap["parameters"] = etcp.Parameters 3861 } 3862 return json.Marshal(objectMap) 3863} 3864 3865// EmailTemplateParametersContractProperties email Template Parameter contract. 3866type EmailTemplateParametersContractProperties struct { 3867 // Name - Template parameter name. 3868 Name *string `json:"name,omitempty"` 3869 // Title - Template parameter title. 3870 Title *string `json:"title,omitempty"` 3871 // Description - Template parameter description. 3872 Description *string `json:"description,omitempty"` 3873} 3874 3875// EmailTemplateUpdateParameterProperties email Template Update Contract properties. 3876type EmailTemplateUpdateParameterProperties struct { 3877 // Subject - Subject of the Template. 3878 Subject *string `json:"subject,omitempty"` 3879 // Title - Title of the Template. 3880 Title *string `json:"title,omitempty"` 3881 // Description - Description of the Email Template. 3882 Description *string `json:"description,omitempty"` 3883 // Body - Email Template Body. This should be a valid XDocument 3884 Body *string `json:"body,omitempty"` 3885 // Parameters - Email Template Parameter values. 3886 Parameters *[]EmailTemplateParametersContractProperties `json:"parameters,omitempty"` 3887} 3888 3889// EmailTemplateUpdateParameters email Template update Parameters. 3890type EmailTemplateUpdateParameters struct { 3891 // EmailTemplateUpdateParameterProperties - Email Template Update contract properties. 3892 *EmailTemplateUpdateParameterProperties `json:"properties,omitempty"` 3893} 3894 3895// MarshalJSON is the custom marshaler for EmailTemplateUpdateParameters. 3896func (etup EmailTemplateUpdateParameters) MarshalJSON() ([]byte, error) { 3897 objectMap := make(map[string]interface{}) 3898 if etup.EmailTemplateUpdateParameterProperties != nil { 3899 objectMap["properties"] = etup.EmailTemplateUpdateParameterProperties 3900 } 3901 return json.Marshal(objectMap) 3902} 3903 3904// UnmarshalJSON is the custom unmarshaler for EmailTemplateUpdateParameters struct. 3905func (etup *EmailTemplateUpdateParameters) UnmarshalJSON(body []byte) error { 3906 var m map[string]*json.RawMessage 3907 err := json.Unmarshal(body, &m) 3908 if err != nil { 3909 return err 3910 } 3911 for k, v := range m { 3912 switch k { 3913 case "properties": 3914 if v != nil { 3915 var emailTemplateUpdateParameterProperties EmailTemplateUpdateParameterProperties 3916 err = json.Unmarshal(*v, &emailTemplateUpdateParameterProperties) 3917 if err != nil { 3918 return err 3919 } 3920 etup.EmailTemplateUpdateParameterProperties = &emailTemplateUpdateParameterProperties 3921 } 3922 } 3923 } 3924 3925 return nil 3926} 3927 3928// ErrorFieldContract error Field contract. 3929type ErrorFieldContract struct { 3930 // Code - Property level error code. 3931 Code *string `json:"code,omitempty"` 3932 // Message - Human-readable representation of property-level error. 3933 Message *string `json:"message,omitempty"` 3934 // Target - Property name. 3935 Target *string `json:"target,omitempty"` 3936} 3937 3938// ErrorResponse error Response. 3939type ErrorResponse struct { 3940 // ErrorResponseBody - Properties of the Error Response. 3941 *ErrorResponseBody `json:"error,omitempty"` 3942} 3943 3944// MarshalJSON is the custom marshaler for ErrorResponse. 3945func (er ErrorResponse) MarshalJSON() ([]byte, error) { 3946 objectMap := make(map[string]interface{}) 3947 if er.ErrorResponseBody != nil { 3948 objectMap["error"] = er.ErrorResponseBody 3949 } 3950 return json.Marshal(objectMap) 3951} 3952 3953// UnmarshalJSON is the custom unmarshaler for ErrorResponse struct. 3954func (er *ErrorResponse) UnmarshalJSON(body []byte) error { 3955 var m map[string]*json.RawMessage 3956 err := json.Unmarshal(body, &m) 3957 if err != nil { 3958 return err 3959 } 3960 for k, v := range m { 3961 switch k { 3962 case "error": 3963 if v != nil { 3964 var errorResponseBody ErrorResponseBody 3965 err = json.Unmarshal(*v, &errorResponseBody) 3966 if err != nil { 3967 return err 3968 } 3969 er.ErrorResponseBody = &errorResponseBody 3970 } 3971 } 3972 } 3973 3974 return nil 3975} 3976 3977// ErrorResponseBody error Body contract. 3978type ErrorResponseBody struct { 3979 // Code - Service-defined error code. This code serves as a sub-status for the HTTP error code specified in the response. 3980 Code *string `json:"code,omitempty"` 3981 // Message - Human-readable representation of the error. 3982 Message *string `json:"message,omitempty"` 3983 // Details - The list of invalid fields send in request, in case of validation error. 3984 Details *[]ErrorFieldContract `json:"details,omitempty"` 3985} 3986 3987// GenerateSsoURLResult generate SSO Url operations response details. 3988type GenerateSsoURLResult struct { 3989 autorest.Response `json:"-"` 3990 // Value - Redirect Url containing the SSO URL value. 3991 Value *string `json:"value,omitempty"` 3992} 3993 3994// GroupCollection paged Group list representation. 3995type GroupCollection struct { 3996 autorest.Response `json:"-"` 3997 // Value - Page values. 3998 Value *[]GroupContract `json:"value,omitempty"` 3999 // NextLink - Next page link if any. 4000 NextLink *string `json:"nextLink,omitempty"` 4001} 4002 4003// GroupCollectionIterator provides access to a complete listing of GroupContract values. 4004type GroupCollectionIterator struct { 4005 i int 4006 page GroupCollectionPage 4007} 4008 4009// NextWithContext advances to the next value. If there was an error making 4010// the request the iterator does not advance and the error is returned. 4011func (iter *GroupCollectionIterator) NextWithContext(ctx context.Context) (err error) { 4012 if tracing.IsEnabled() { 4013 ctx = tracing.StartSpan(ctx, fqdn+"/GroupCollectionIterator.NextWithContext") 4014 defer func() { 4015 sc := -1 4016 if iter.Response().Response.Response != nil { 4017 sc = iter.Response().Response.Response.StatusCode 4018 } 4019 tracing.EndSpan(ctx, sc, err) 4020 }() 4021 } 4022 iter.i++ 4023 if iter.i < len(iter.page.Values()) { 4024 return nil 4025 } 4026 err = iter.page.NextWithContext(ctx) 4027 if err != nil { 4028 iter.i-- 4029 return err 4030 } 4031 iter.i = 0 4032 return nil 4033} 4034 4035// Next advances to the next value. If there was an error making 4036// the request the iterator does not advance and the error is returned. 4037// Deprecated: Use NextWithContext() instead. 4038func (iter *GroupCollectionIterator) Next() error { 4039 return iter.NextWithContext(context.Background()) 4040} 4041 4042// NotDone returns true if the enumeration should be started or is not yet complete. 4043func (iter GroupCollectionIterator) NotDone() bool { 4044 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 4045} 4046 4047// Response returns the raw server response from the last page request. 4048func (iter GroupCollectionIterator) Response() GroupCollection { 4049 return iter.page.Response() 4050} 4051 4052// Value returns the current value or a zero-initialized value if the 4053// iterator has advanced beyond the end of the collection. 4054func (iter GroupCollectionIterator) Value() GroupContract { 4055 if !iter.page.NotDone() { 4056 return GroupContract{} 4057 } 4058 return iter.page.Values()[iter.i] 4059} 4060 4061// Creates a new instance of the GroupCollectionIterator type. 4062func NewGroupCollectionIterator(page GroupCollectionPage) GroupCollectionIterator { 4063 return GroupCollectionIterator{page: page} 4064} 4065 4066// IsEmpty returns true if the ListResult contains no values. 4067func (gc GroupCollection) IsEmpty() bool { 4068 return gc.Value == nil || len(*gc.Value) == 0 4069} 4070 4071// hasNextLink returns true if the NextLink is not empty. 4072func (gc GroupCollection) hasNextLink() bool { 4073 return gc.NextLink != nil && len(*gc.NextLink) != 0 4074} 4075 4076// groupCollectionPreparer prepares a request to retrieve the next set of results. 4077// It returns nil if no more results exist. 4078func (gc GroupCollection) groupCollectionPreparer(ctx context.Context) (*http.Request, error) { 4079 if !gc.hasNextLink() { 4080 return nil, nil 4081 } 4082 return autorest.Prepare((&http.Request{}).WithContext(ctx), 4083 autorest.AsJSON(), 4084 autorest.AsGet(), 4085 autorest.WithBaseURL(to.String(gc.NextLink))) 4086} 4087 4088// GroupCollectionPage contains a page of GroupContract values. 4089type GroupCollectionPage struct { 4090 fn func(context.Context, GroupCollection) (GroupCollection, error) 4091 gc GroupCollection 4092} 4093 4094// NextWithContext advances to the next page of values. If there was an error making 4095// the request the page does not advance and the error is returned. 4096func (page *GroupCollectionPage) NextWithContext(ctx context.Context) (err error) { 4097 if tracing.IsEnabled() { 4098 ctx = tracing.StartSpan(ctx, fqdn+"/GroupCollectionPage.NextWithContext") 4099 defer func() { 4100 sc := -1 4101 if page.Response().Response.Response != nil { 4102 sc = page.Response().Response.Response.StatusCode 4103 } 4104 tracing.EndSpan(ctx, sc, err) 4105 }() 4106 } 4107 for { 4108 next, err := page.fn(ctx, page.gc) 4109 if err != nil { 4110 return err 4111 } 4112 page.gc = next 4113 if !next.hasNextLink() || !next.IsEmpty() { 4114 break 4115 } 4116 } 4117 return nil 4118} 4119 4120// Next advances to the next page of values. If there was an error making 4121// the request the page does not advance and the error is returned. 4122// Deprecated: Use NextWithContext() instead. 4123func (page *GroupCollectionPage) Next() error { 4124 return page.NextWithContext(context.Background()) 4125} 4126 4127// NotDone returns true if the page enumeration should be started or is not yet complete. 4128func (page GroupCollectionPage) NotDone() bool { 4129 return !page.gc.IsEmpty() 4130} 4131 4132// Response returns the raw server response from the last page request. 4133func (page GroupCollectionPage) Response() GroupCollection { 4134 return page.gc 4135} 4136 4137// Values returns the slice of values for the current page or nil if there are no values. 4138func (page GroupCollectionPage) Values() []GroupContract { 4139 if page.gc.IsEmpty() { 4140 return nil 4141 } 4142 return *page.gc.Value 4143} 4144 4145// Creates a new instance of the GroupCollectionPage type. 4146func NewGroupCollectionPage(cur GroupCollection, getNextPage func(context.Context, GroupCollection) (GroupCollection, error)) GroupCollectionPage { 4147 return GroupCollectionPage{ 4148 fn: getNextPage, 4149 gc: cur, 4150 } 4151} 4152 4153// GroupContract contract details. 4154type GroupContract struct { 4155 autorest.Response `json:"-"` 4156 // GroupContractProperties - Group entity contract properties. 4157 *GroupContractProperties `json:"properties,omitempty"` 4158 // ID - READ-ONLY; Resource ID. 4159 ID *string `json:"id,omitempty"` 4160 // Name - READ-ONLY; Resource name. 4161 Name *string `json:"name,omitempty"` 4162 // Type - READ-ONLY; Resource type for API Management resource. 4163 Type *string `json:"type,omitempty"` 4164} 4165 4166// MarshalJSON is the custom marshaler for GroupContract. 4167func (gc GroupContract) MarshalJSON() ([]byte, error) { 4168 objectMap := make(map[string]interface{}) 4169 if gc.GroupContractProperties != nil { 4170 objectMap["properties"] = gc.GroupContractProperties 4171 } 4172 return json.Marshal(objectMap) 4173} 4174 4175// UnmarshalJSON is the custom unmarshaler for GroupContract struct. 4176func (gc *GroupContract) UnmarshalJSON(body []byte) error { 4177 var m map[string]*json.RawMessage 4178 err := json.Unmarshal(body, &m) 4179 if err != nil { 4180 return err 4181 } 4182 for k, v := range m { 4183 switch k { 4184 case "properties": 4185 if v != nil { 4186 var groupContractProperties GroupContractProperties 4187 err = json.Unmarshal(*v, &groupContractProperties) 4188 if err != nil { 4189 return err 4190 } 4191 gc.GroupContractProperties = &groupContractProperties 4192 } 4193 case "id": 4194 if v != nil { 4195 var ID string 4196 err = json.Unmarshal(*v, &ID) 4197 if err != nil { 4198 return err 4199 } 4200 gc.ID = &ID 4201 } 4202 case "name": 4203 if v != nil { 4204 var name string 4205 err = json.Unmarshal(*v, &name) 4206 if err != nil { 4207 return err 4208 } 4209 gc.Name = &name 4210 } 4211 case "type": 4212 if v != nil { 4213 var typeVar string 4214 err = json.Unmarshal(*v, &typeVar) 4215 if err != nil { 4216 return err 4217 } 4218 gc.Type = &typeVar 4219 } 4220 } 4221 } 4222 4223 return nil 4224} 4225 4226// GroupContractProperties group contract Properties. 4227type GroupContractProperties struct { 4228 // DisplayName - Group name. 4229 DisplayName *string `json:"displayName,omitempty"` 4230 // Description - Group description. Can contain HTML formatting tags. 4231 Description *string `json:"description,omitempty"` 4232 // BuiltIn - READ-ONLY; true if the group is one of the three system groups (Administrators, Developers, or Guests); otherwise false. 4233 BuiltIn *bool `json:"builtIn,omitempty"` 4234 // Type - Group type. Possible values include: 'Custom', 'System', 'External' 4235 Type GroupType `json:"type,omitempty"` 4236 // 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. 4237 ExternalID *string `json:"externalId,omitempty"` 4238} 4239 4240// MarshalJSON is the custom marshaler for GroupContractProperties. 4241func (gcp GroupContractProperties) MarshalJSON() ([]byte, error) { 4242 objectMap := make(map[string]interface{}) 4243 if gcp.DisplayName != nil { 4244 objectMap["displayName"] = gcp.DisplayName 4245 } 4246 if gcp.Description != nil { 4247 objectMap["description"] = gcp.Description 4248 } 4249 if gcp.Type != "" { 4250 objectMap["type"] = gcp.Type 4251 } 4252 if gcp.ExternalID != nil { 4253 objectMap["externalId"] = gcp.ExternalID 4254 } 4255 return json.Marshal(objectMap) 4256} 4257 4258// GroupCreateParameters parameters supplied to the Create Group operation. 4259type GroupCreateParameters struct { 4260 // GroupCreateParametersProperties - Properties supplied to Create Group operation. 4261 *GroupCreateParametersProperties `json:"properties,omitempty"` 4262} 4263 4264// MarshalJSON is the custom marshaler for GroupCreateParameters. 4265func (gcp GroupCreateParameters) MarshalJSON() ([]byte, error) { 4266 objectMap := make(map[string]interface{}) 4267 if gcp.GroupCreateParametersProperties != nil { 4268 objectMap["properties"] = gcp.GroupCreateParametersProperties 4269 } 4270 return json.Marshal(objectMap) 4271} 4272 4273// UnmarshalJSON is the custom unmarshaler for GroupCreateParameters struct. 4274func (gcp *GroupCreateParameters) UnmarshalJSON(body []byte) error { 4275 var m map[string]*json.RawMessage 4276 err := json.Unmarshal(body, &m) 4277 if err != nil { 4278 return err 4279 } 4280 for k, v := range m { 4281 switch k { 4282 case "properties": 4283 if v != nil { 4284 var groupCreateParametersProperties GroupCreateParametersProperties 4285 err = json.Unmarshal(*v, &groupCreateParametersProperties) 4286 if err != nil { 4287 return err 4288 } 4289 gcp.GroupCreateParametersProperties = &groupCreateParametersProperties 4290 } 4291 } 4292 } 4293 4294 return nil 4295} 4296 4297// GroupCreateParametersProperties parameters supplied to the Create Group operation. 4298type GroupCreateParametersProperties struct { 4299 // DisplayName - Group name. 4300 DisplayName *string `json:"displayName,omitempty"` 4301 // Description - Group description. 4302 Description *string `json:"description,omitempty"` 4303 // Type - Group type. Possible values include: 'Custom', 'System', 'External' 4304 Type GroupType `json:"type,omitempty"` 4305 // 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. 4306 ExternalID *string `json:"externalId,omitempty"` 4307} 4308 4309// GroupUpdateParameters parameters supplied to the Update Group operation. 4310type GroupUpdateParameters struct { 4311 // GroupUpdateParametersProperties - Group entity update contract properties. 4312 *GroupUpdateParametersProperties `json:"properties,omitempty"` 4313} 4314 4315// MarshalJSON is the custom marshaler for GroupUpdateParameters. 4316func (gup GroupUpdateParameters) MarshalJSON() ([]byte, error) { 4317 objectMap := make(map[string]interface{}) 4318 if gup.GroupUpdateParametersProperties != nil { 4319 objectMap["properties"] = gup.GroupUpdateParametersProperties 4320 } 4321 return json.Marshal(objectMap) 4322} 4323 4324// UnmarshalJSON is the custom unmarshaler for GroupUpdateParameters struct. 4325func (gup *GroupUpdateParameters) UnmarshalJSON(body []byte) error { 4326 var m map[string]*json.RawMessage 4327 err := json.Unmarshal(body, &m) 4328 if err != nil { 4329 return err 4330 } 4331 for k, v := range m { 4332 switch k { 4333 case "properties": 4334 if v != nil { 4335 var groupUpdateParametersProperties GroupUpdateParametersProperties 4336 err = json.Unmarshal(*v, &groupUpdateParametersProperties) 4337 if err != nil { 4338 return err 4339 } 4340 gup.GroupUpdateParametersProperties = &groupUpdateParametersProperties 4341 } 4342 } 4343 } 4344 4345 return nil 4346} 4347 4348// GroupUpdateParametersProperties parameters supplied to the Update Group operation. 4349type GroupUpdateParametersProperties struct { 4350 // DisplayName - Group name. 4351 DisplayName *string `json:"displayName,omitempty"` 4352 // Description - Group description. 4353 Description *string `json:"description,omitempty"` 4354 // Type - Group type. Possible values include: 'Custom', 'System', 'External' 4355 Type GroupType `json:"type,omitempty"` 4356 // 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. 4357 ExternalID *string `json:"externalId,omitempty"` 4358} 4359 4360// HostnameConfiguration custom hostname configuration. 4361type HostnameConfiguration struct { 4362 // Type - Hostname type. Possible values include: 'HostnameTypeProxy', 'HostnameTypePortal', 'HostnameTypeManagement', 'HostnameTypeScm', 'HostnameTypeDeveloperPortal' 4363 Type HostnameType `json:"type,omitempty"` 4364 // HostName - Hostname to configure on the Api Management service. 4365 HostName *string `json:"hostName,omitempty"` 4366 // 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* 4367 KeyVaultID *string `json:"keyVaultId,omitempty"` 4368 // EncodedCertificate - Base64 Encoded certificate. 4369 EncodedCertificate *string `json:"encodedCertificate,omitempty"` 4370 // CertificatePassword - Certificate Password. 4371 CertificatePassword *string `json:"certificatePassword,omitempty"` 4372 // 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. 4373 DefaultSslBinding *bool `json:"defaultSslBinding,omitempty"` 4374 // NegotiateClientCertificate - Specify true to always negotiate client certificate on the hostname. Default Value is false. 4375 NegotiateClientCertificate *bool `json:"negotiateClientCertificate,omitempty"` 4376 // Certificate - Certificate information. 4377 Certificate *CertificateInformation `json:"certificate,omitempty"` 4378} 4379 4380// HTTPMessageDiagnostic http message diagnostic settings. 4381type HTTPMessageDiagnostic struct { 4382 // Headers - Array of HTTP Headers to log. 4383 Headers *[]string `json:"headers,omitempty"` 4384 // Body - Body logging settings. 4385 Body *BodyDiagnosticSettings `json:"body,omitempty"` 4386} 4387 4388// IdentityProviderBaseParameters identity Provider Base Parameter Properties. 4389type IdentityProviderBaseParameters struct { 4390 // Type - Identity Provider Type identifier. Possible values include: 'Facebook', 'Google', 'Microsoft', 'Twitter', 'Aad', 'AadB2C' 4391 Type IdentityProviderType `json:"type,omitempty"` 4392 // SigninTenant - The TenantId to use instead of Common when logging into Active Directory 4393 SigninTenant *string `json:"signinTenant,omitempty"` 4394 // AllowedTenants - List of Allowed Tenants when configuring Azure Active Directory login. 4395 AllowedTenants *[]string `json:"allowedTenants,omitempty"` 4396 // Authority - OpenID Connect discovery endpoint hostname for AAD or AAD B2C. 4397 Authority *string `json:"authority,omitempty"` 4398 // SignupPolicyName - Signup Policy Name. Only applies to AAD B2C Identity Provider. 4399 SignupPolicyName *string `json:"signupPolicyName,omitempty"` 4400 // SigninPolicyName - Signin Policy Name. Only applies to AAD B2C Identity Provider. 4401 SigninPolicyName *string `json:"signinPolicyName,omitempty"` 4402 // ProfileEditingPolicyName - Profile Editing Policy Name. Only applies to AAD B2C Identity Provider. 4403 ProfileEditingPolicyName *string `json:"profileEditingPolicyName,omitempty"` 4404 // PasswordResetPolicyName - Password Reset Policy Name. Only applies to AAD B2C Identity Provider. 4405 PasswordResetPolicyName *string `json:"passwordResetPolicyName,omitempty"` 4406} 4407 4408// IdentityProviderContract identity Provider details. 4409type IdentityProviderContract struct { 4410 autorest.Response `json:"-"` 4411 // IdentityProviderContractProperties - Identity Provider contract properties. 4412 *IdentityProviderContractProperties `json:"properties,omitempty"` 4413 // ID - READ-ONLY; Resource ID. 4414 ID *string `json:"id,omitempty"` 4415 // Name - READ-ONLY; Resource name. 4416 Name *string `json:"name,omitempty"` 4417 // Type - READ-ONLY; Resource type for API Management resource. 4418 Type *string `json:"type,omitempty"` 4419} 4420 4421// MarshalJSON is the custom marshaler for IdentityProviderContract. 4422func (ipc IdentityProviderContract) MarshalJSON() ([]byte, error) { 4423 objectMap := make(map[string]interface{}) 4424 if ipc.IdentityProviderContractProperties != nil { 4425 objectMap["properties"] = ipc.IdentityProviderContractProperties 4426 } 4427 return json.Marshal(objectMap) 4428} 4429 4430// UnmarshalJSON is the custom unmarshaler for IdentityProviderContract struct. 4431func (ipc *IdentityProviderContract) UnmarshalJSON(body []byte) error { 4432 var m map[string]*json.RawMessage 4433 err := json.Unmarshal(body, &m) 4434 if err != nil { 4435 return err 4436 } 4437 for k, v := range m { 4438 switch k { 4439 case "properties": 4440 if v != nil { 4441 var identityProviderContractProperties IdentityProviderContractProperties 4442 err = json.Unmarshal(*v, &identityProviderContractProperties) 4443 if err != nil { 4444 return err 4445 } 4446 ipc.IdentityProviderContractProperties = &identityProviderContractProperties 4447 } 4448 case "id": 4449 if v != nil { 4450 var ID string 4451 err = json.Unmarshal(*v, &ID) 4452 if err != nil { 4453 return err 4454 } 4455 ipc.ID = &ID 4456 } 4457 case "name": 4458 if v != nil { 4459 var name string 4460 err = json.Unmarshal(*v, &name) 4461 if err != nil { 4462 return err 4463 } 4464 ipc.Name = &name 4465 } 4466 case "type": 4467 if v != nil { 4468 var typeVar string 4469 err = json.Unmarshal(*v, &typeVar) 4470 if err != nil { 4471 return err 4472 } 4473 ipc.Type = &typeVar 4474 } 4475 } 4476 } 4477 4478 return nil 4479} 4480 4481// IdentityProviderContractProperties the external Identity Providers like Facebook, Google, Microsoft, 4482// Twitter or Azure Active Directory which can be used to enable access to the API Management service 4483// developer portal for all users. 4484type IdentityProviderContractProperties struct { 4485 // 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. 4486 ClientID *string `json:"clientId,omitempty"` 4487 // 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. 4488 ClientSecret *string `json:"clientSecret,omitempty"` 4489 // Type - Identity Provider Type identifier. Possible values include: 'Facebook', 'Google', 'Microsoft', 'Twitter', 'Aad', 'AadB2C' 4490 Type IdentityProviderType `json:"type,omitempty"` 4491 // SigninTenant - The TenantId to use instead of Common when logging into Active Directory 4492 SigninTenant *string `json:"signinTenant,omitempty"` 4493 // AllowedTenants - List of Allowed Tenants when configuring Azure Active Directory login. 4494 AllowedTenants *[]string `json:"allowedTenants,omitempty"` 4495 // Authority - OpenID Connect discovery endpoint hostname for AAD or AAD B2C. 4496 Authority *string `json:"authority,omitempty"` 4497 // SignupPolicyName - Signup Policy Name. Only applies to AAD B2C Identity Provider. 4498 SignupPolicyName *string `json:"signupPolicyName,omitempty"` 4499 // SigninPolicyName - Signin Policy Name. Only applies to AAD B2C Identity Provider. 4500 SigninPolicyName *string `json:"signinPolicyName,omitempty"` 4501 // ProfileEditingPolicyName - Profile Editing Policy Name. Only applies to AAD B2C Identity Provider. 4502 ProfileEditingPolicyName *string `json:"profileEditingPolicyName,omitempty"` 4503 // PasswordResetPolicyName - Password Reset Policy Name. Only applies to AAD B2C Identity Provider. 4504 PasswordResetPolicyName *string `json:"passwordResetPolicyName,omitempty"` 4505} 4506 4507// IdentityProviderList list of all the Identity Providers configured on the service instance. 4508type IdentityProviderList struct { 4509 autorest.Response `json:"-"` 4510 // Value - Identity Provider configuration values. 4511 Value *[]IdentityProviderContract `json:"value,omitempty"` 4512 // NextLink - Next page link if any. 4513 NextLink *string `json:"nextLink,omitempty"` 4514} 4515 4516// IdentityProviderListIterator provides access to a complete listing of IdentityProviderContract values. 4517type IdentityProviderListIterator struct { 4518 i int 4519 page IdentityProviderListPage 4520} 4521 4522// NextWithContext advances to the next value. If there was an error making 4523// the request the iterator does not advance and the error is returned. 4524func (iter *IdentityProviderListIterator) NextWithContext(ctx context.Context) (err error) { 4525 if tracing.IsEnabled() { 4526 ctx = tracing.StartSpan(ctx, fqdn+"/IdentityProviderListIterator.NextWithContext") 4527 defer func() { 4528 sc := -1 4529 if iter.Response().Response.Response != nil { 4530 sc = iter.Response().Response.Response.StatusCode 4531 } 4532 tracing.EndSpan(ctx, sc, err) 4533 }() 4534 } 4535 iter.i++ 4536 if iter.i < len(iter.page.Values()) { 4537 return nil 4538 } 4539 err = iter.page.NextWithContext(ctx) 4540 if err != nil { 4541 iter.i-- 4542 return err 4543 } 4544 iter.i = 0 4545 return nil 4546} 4547 4548// Next advances to the next value. If there was an error making 4549// the request the iterator does not advance and the error is returned. 4550// Deprecated: Use NextWithContext() instead. 4551func (iter *IdentityProviderListIterator) Next() error { 4552 return iter.NextWithContext(context.Background()) 4553} 4554 4555// NotDone returns true if the enumeration should be started or is not yet complete. 4556func (iter IdentityProviderListIterator) NotDone() bool { 4557 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 4558} 4559 4560// Response returns the raw server response from the last page request. 4561func (iter IdentityProviderListIterator) Response() IdentityProviderList { 4562 return iter.page.Response() 4563} 4564 4565// Value returns the current value or a zero-initialized value if the 4566// iterator has advanced beyond the end of the collection. 4567func (iter IdentityProviderListIterator) Value() IdentityProviderContract { 4568 if !iter.page.NotDone() { 4569 return IdentityProviderContract{} 4570 } 4571 return iter.page.Values()[iter.i] 4572} 4573 4574// Creates a new instance of the IdentityProviderListIterator type. 4575func NewIdentityProviderListIterator(page IdentityProviderListPage) IdentityProviderListIterator { 4576 return IdentityProviderListIterator{page: page} 4577} 4578 4579// IsEmpty returns true if the ListResult contains no values. 4580func (ipl IdentityProviderList) IsEmpty() bool { 4581 return ipl.Value == nil || len(*ipl.Value) == 0 4582} 4583 4584// hasNextLink returns true if the NextLink is not empty. 4585func (ipl IdentityProviderList) hasNextLink() bool { 4586 return ipl.NextLink != nil && len(*ipl.NextLink) != 0 4587} 4588 4589// identityProviderListPreparer prepares a request to retrieve the next set of results. 4590// It returns nil if no more results exist. 4591func (ipl IdentityProviderList) identityProviderListPreparer(ctx context.Context) (*http.Request, error) { 4592 if !ipl.hasNextLink() { 4593 return nil, nil 4594 } 4595 return autorest.Prepare((&http.Request{}).WithContext(ctx), 4596 autorest.AsJSON(), 4597 autorest.AsGet(), 4598 autorest.WithBaseURL(to.String(ipl.NextLink))) 4599} 4600 4601// IdentityProviderListPage contains a page of IdentityProviderContract values. 4602type IdentityProviderListPage struct { 4603 fn func(context.Context, IdentityProviderList) (IdentityProviderList, error) 4604 ipl IdentityProviderList 4605} 4606 4607// NextWithContext advances to the next page of values. If there was an error making 4608// the request the page does not advance and the error is returned. 4609func (page *IdentityProviderListPage) NextWithContext(ctx context.Context) (err error) { 4610 if tracing.IsEnabled() { 4611 ctx = tracing.StartSpan(ctx, fqdn+"/IdentityProviderListPage.NextWithContext") 4612 defer func() { 4613 sc := -1 4614 if page.Response().Response.Response != nil { 4615 sc = page.Response().Response.Response.StatusCode 4616 } 4617 tracing.EndSpan(ctx, sc, err) 4618 }() 4619 } 4620 for { 4621 next, err := page.fn(ctx, page.ipl) 4622 if err != nil { 4623 return err 4624 } 4625 page.ipl = next 4626 if !next.hasNextLink() || !next.IsEmpty() { 4627 break 4628 } 4629 } 4630 return nil 4631} 4632 4633// Next advances to the next page of values. If there was an error making 4634// the request the page does not advance and the error is returned. 4635// Deprecated: Use NextWithContext() instead. 4636func (page *IdentityProviderListPage) Next() error { 4637 return page.NextWithContext(context.Background()) 4638} 4639 4640// NotDone returns true if the page enumeration should be started or is not yet complete. 4641func (page IdentityProviderListPage) NotDone() bool { 4642 return !page.ipl.IsEmpty() 4643} 4644 4645// Response returns the raw server response from the last page request. 4646func (page IdentityProviderListPage) Response() IdentityProviderList { 4647 return page.ipl 4648} 4649 4650// Values returns the slice of values for the current page or nil if there are no values. 4651func (page IdentityProviderListPage) Values() []IdentityProviderContract { 4652 if page.ipl.IsEmpty() { 4653 return nil 4654 } 4655 return *page.ipl.Value 4656} 4657 4658// Creates a new instance of the IdentityProviderListPage type. 4659func NewIdentityProviderListPage(cur IdentityProviderList, getNextPage func(context.Context, IdentityProviderList) (IdentityProviderList, error)) IdentityProviderListPage { 4660 return IdentityProviderListPage{ 4661 fn: getNextPage, 4662 ipl: cur, 4663 } 4664} 4665 4666// IdentityProviderUpdateParameters parameters supplied to update Identity Provider 4667type IdentityProviderUpdateParameters struct { 4668 // IdentityProviderUpdateProperties - Identity Provider update properties. 4669 *IdentityProviderUpdateProperties `json:"properties,omitempty"` 4670} 4671 4672// MarshalJSON is the custom marshaler for IdentityProviderUpdateParameters. 4673func (ipup IdentityProviderUpdateParameters) MarshalJSON() ([]byte, error) { 4674 objectMap := make(map[string]interface{}) 4675 if ipup.IdentityProviderUpdateProperties != nil { 4676 objectMap["properties"] = ipup.IdentityProviderUpdateProperties 4677 } 4678 return json.Marshal(objectMap) 4679} 4680 4681// UnmarshalJSON is the custom unmarshaler for IdentityProviderUpdateParameters struct. 4682func (ipup *IdentityProviderUpdateParameters) UnmarshalJSON(body []byte) error { 4683 var m map[string]*json.RawMessage 4684 err := json.Unmarshal(body, &m) 4685 if err != nil { 4686 return err 4687 } 4688 for k, v := range m { 4689 switch k { 4690 case "properties": 4691 if v != nil { 4692 var identityProviderUpdateProperties IdentityProviderUpdateProperties 4693 err = json.Unmarshal(*v, &identityProviderUpdateProperties) 4694 if err != nil { 4695 return err 4696 } 4697 ipup.IdentityProviderUpdateProperties = &identityProviderUpdateProperties 4698 } 4699 } 4700 } 4701 4702 return nil 4703} 4704 4705// IdentityProviderUpdateProperties parameters supplied to the Update Identity Provider operation. 4706type IdentityProviderUpdateProperties struct { 4707 // 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. 4708 ClientID *string `json:"clientId,omitempty"` 4709 // 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. 4710 ClientSecret *string `json:"clientSecret,omitempty"` 4711 // Type - Identity Provider Type identifier. Possible values include: 'Facebook', 'Google', 'Microsoft', 'Twitter', 'Aad', 'AadB2C' 4712 Type IdentityProviderType `json:"type,omitempty"` 4713 // SigninTenant - The TenantId to use instead of Common when logging into Active Directory 4714 SigninTenant *string `json:"signinTenant,omitempty"` 4715 // AllowedTenants - List of Allowed Tenants when configuring Azure Active Directory login. 4716 AllowedTenants *[]string `json:"allowedTenants,omitempty"` 4717 // Authority - OpenID Connect discovery endpoint hostname for AAD or AAD B2C. 4718 Authority *string `json:"authority,omitempty"` 4719 // SignupPolicyName - Signup Policy Name. Only applies to AAD B2C Identity Provider. 4720 SignupPolicyName *string `json:"signupPolicyName,omitempty"` 4721 // SigninPolicyName - Signin Policy Name. Only applies to AAD B2C Identity Provider. 4722 SigninPolicyName *string `json:"signinPolicyName,omitempty"` 4723 // ProfileEditingPolicyName - Profile Editing Policy Name. Only applies to AAD B2C Identity Provider. 4724 ProfileEditingPolicyName *string `json:"profileEditingPolicyName,omitempty"` 4725 // PasswordResetPolicyName - Password Reset Policy Name. Only applies to AAD B2C Identity Provider. 4726 PasswordResetPolicyName *string `json:"passwordResetPolicyName,omitempty"` 4727} 4728 4729// IssueAttachmentCollection paged Issue Attachment list representation. 4730type IssueAttachmentCollection struct { 4731 autorest.Response `json:"-"` 4732 // Value - READ-ONLY; Issue Attachment values. 4733 Value *[]IssueAttachmentContract `json:"value,omitempty"` 4734 // NextLink - READ-ONLY; Next page link if any. 4735 NextLink *string `json:"nextLink,omitempty"` 4736} 4737 4738// MarshalJSON is the custom marshaler for IssueAttachmentCollection. 4739func (iac IssueAttachmentCollection) MarshalJSON() ([]byte, error) { 4740 objectMap := make(map[string]interface{}) 4741 return json.Marshal(objectMap) 4742} 4743 4744// IssueAttachmentCollectionIterator provides access to a complete listing of IssueAttachmentContract 4745// values. 4746type IssueAttachmentCollectionIterator struct { 4747 i int 4748 page IssueAttachmentCollectionPage 4749} 4750 4751// NextWithContext advances to the next value. If there was an error making 4752// the request the iterator does not advance and the error is returned. 4753func (iter *IssueAttachmentCollectionIterator) NextWithContext(ctx context.Context) (err error) { 4754 if tracing.IsEnabled() { 4755 ctx = tracing.StartSpan(ctx, fqdn+"/IssueAttachmentCollectionIterator.NextWithContext") 4756 defer func() { 4757 sc := -1 4758 if iter.Response().Response.Response != nil { 4759 sc = iter.Response().Response.Response.StatusCode 4760 } 4761 tracing.EndSpan(ctx, sc, err) 4762 }() 4763 } 4764 iter.i++ 4765 if iter.i < len(iter.page.Values()) { 4766 return nil 4767 } 4768 err = iter.page.NextWithContext(ctx) 4769 if err != nil { 4770 iter.i-- 4771 return err 4772 } 4773 iter.i = 0 4774 return nil 4775} 4776 4777// Next advances to the next value. If there was an error making 4778// the request the iterator does not advance and the error is returned. 4779// Deprecated: Use NextWithContext() instead. 4780func (iter *IssueAttachmentCollectionIterator) Next() error { 4781 return iter.NextWithContext(context.Background()) 4782} 4783 4784// NotDone returns true if the enumeration should be started or is not yet complete. 4785func (iter IssueAttachmentCollectionIterator) NotDone() bool { 4786 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 4787} 4788 4789// Response returns the raw server response from the last page request. 4790func (iter IssueAttachmentCollectionIterator) Response() IssueAttachmentCollection { 4791 return iter.page.Response() 4792} 4793 4794// Value returns the current value or a zero-initialized value if the 4795// iterator has advanced beyond the end of the collection. 4796func (iter IssueAttachmentCollectionIterator) Value() IssueAttachmentContract { 4797 if !iter.page.NotDone() { 4798 return IssueAttachmentContract{} 4799 } 4800 return iter.page.Values()[iter.i] 4801} 4802 4803// Creates a new instance of the IssueAttachmentCollectionIterator type. 4804func NewIssueAttachmentCollectionIterator(page IssueAttachmentCollectionPage) IssueAttachmentCollectionIterator { 4805 return IssueAttachmentCollectionIterator{page: page} 4806} 4807 4808// IsEmpty returns true if the ListResult contains no values. 4809func (iac IssueAttachmentCollection) IsEmpty() bool { 4810 return iac.Value == nil || len(*iac.Value) == 0 4811} 4812 4813// hasNextLink returns true if the NextLink is not empty. 4814func (iac IssueAttachmentCollection) hasNextLink() bool { 4815 return iac.NextLink != nil && len(*iac.NextLink) != 0 4816} 4817 4818// issueAttachmentCollectionPreparer prepares a request to retrieve the next set of results. 4819// It returns nil if no more results exist. 4820func (iac IssueAttachmentCollection) issueAttachmentCollectionPreparer(ctx context.Context) (*http.Request, error) { 4821 if !iac.hasNextLink() { 4822 return nil, nil 4823 } 4824 return autorest.Prepare((&http.Request{}).WithContext(ctx), 4825 autorest.AsJSON(), 4826 autorest.AsGet(), 4827 autorest.WithBaseURL(to.String(iac.NextLink))) 4828} 4829 4830// IssueAttachmentCollectionPage contains a page of IssueAttachmentContract values. 4831type IssueAttachmentCollectionPage struct { 4832 fn func(context.Context, IssueAttachmentCollection) (IssueAttachmentCollection, error) 4833 iac IssueAttachmentCollection 4834} 4835 4836// NextWithContext advances to the next page of values. If there was an error making 4837// the request the page does not advance and the error is returned. 4838func (page *IssueAttachmentCollectionPage) NextWithContext(ctx context.Context) (err error) { 4839 if tracing.IsEnabled() { 4840 ctx = tracing.StartSpan(ctx, fqdn+"/IssueAttachmentCollectionPage.NextWithContext") 4841 defer func() { 4842 sc := -1 4843 if page.Response().Response.Response != nil { 4844 sc = page.Response().Response.Response.StatusCode 4845 } 4846 tracing.EndSpan(ctx, sc, err) 4847 }() 4848 } 4849 for { 4850 next, err := page.fn(ctx, page.iac) 4851 if err != nil { 4852 return err 4853 } 4854 page.iac = next 4855 if !next.hasNextLink() || !next.IsEmpty() { 4856 break 4857 } 4858 } 4859 return nil 4860} 4861 4862// Next advances to the next page of values. If there was an error making 4863// the request the page does not advance and the error is returned. 4864// Deprecated: Use NextWithContext() instead. 4865func (page *IssueAttachmentCollectionPage) Next() error { 4866 return page.NextWithContext(context.Background()) 4867} 4868 4869// NotDone returns true if the page enumeration should be started or is not yet complete. 4870func (page IssueAttachmentCollectionPage) NotDone() bool { 4871 return !page.iac.IsEmpty() 4872} 4873 4874// Response returns the raw server response from the last page request. 4875func (page IssueAttachmentCollectionPage) Response() IssueAttachmentCollection { 4876 return page.iac 4877} 4878 4879// Values returns the slice of values for the current page or nil if there are no values. 4880func (page IssueAttachmentCollectionPage) Values() []IssueAttachmentContract { 4881 if page.iac.IsEmpty() { 4882 return nil 4883 } 4884 return *page.iac.Value 4885} 4886 4887// Creates a new instance of the IssueAttachmentCollectionPage type. 4888func NewIssueAttachmentCollectionPage(cur IssueAttachmentCollection, getNextPage func(context.Context, IssueAttachmentCollection) (IssueAttachmentCollection, error)) IssueAttachmentCollectionPage { 4889 return IssueAttachmentCollectionPage{ 4890 fn: getNextPage, 4891 iac: cur, 4892 } 4893} 4894 4895// IssueAttachmentContract issue Attachment Contract details. 4896type IssueAttachmentContract struct { 4897 autorest.Response `json:"-"` 4898 // IssueAttachmentContractProperties - Properties of the Issue Attachment. 4899 *IssueAttachmentContractProperties `json:"properties,omitempty"` 4900 // ID - READ-ONLY; Resource ID. 4901 ID *string `json:"id,omitempty"` 4902 // Name - READ-ONLY; Resource name. 4903 Name *string `json:"name,omitempty"` 4904 // Type - READ-ONLY; Resource type for API Management resource. 4905 Type *string `json:"type,omitempty"` 4906} 4907 4908// MarshalJSON is the custom marshaler for IssueAttachmentContract. 4909func (iac IssueAttachmentContract) MarshalJSON() ([]byte, error) { 4910 objectMap := make(map[string]interface{}) 4911 if iac.IssueAttachmentContractProperties != nil { 4912 objectMap["properties"] = iac.IssueAttachmentContractProperties 4913 } 4914 return json.Marshal(objectMap) 4915} 4916 4917// UnmarshalJSON is the custom unmarshaler for IssueAttachmentContract struct. 4918func (iac *IssueAttachmentContract) UnmarshalJSON(body []byte) error { 4919 var m map[string]*json.RawMessage 4920 err := json.Unmarshal(body, &m) 4921 if err != nil { 4922 return err 4923 } 4924 for k, v := range m { 4925 switch k { 4926 case "properties": 4927 if v != nil { 4928 var issueAttachmentContractProperties IssueAttachmentContractProperties 4929 err = json.Unmarshal(*v, &issueAttachmentContractProperties) 4930 if err != nil { 4931 return err 4932 } 4933 iac.IssueAttachmentContractProperties = &issueAttachmentContractProperties 4934 } 4935 case "id": 4936 if v != nil { 4937 var ID string 4938 err = json.Unmarshal(*v, &ID) 4939 if err != nil { 4940 return err 4941 } 4942 iac.ID = &ID 4943 } 4944 case "name": 4945 if v != nil { 4946 var name string 4947 err = json.Unmarshal(*v, &name) 4948 if err != nil { 4949 return err 4950 } 4951 iac.Name = &name 4952 } 4953 case "type": 4954 if v != nil { 4955 var typeVar string 4956 err = json.Unmarshal(*v, &typeVar) 4957 if err != nil { 4958 return err 4959 } 4960 iac.Type = &typeVar 4961 } 4962 } 4963 } 4964 4965 return nil 4966} 4967 4968// IssueAttachmentContractProperties issue Attachment contract Properties. 4969type IssueAttachmentContractProperties struct { 4970 // Title - Filename by which the binary data will be saved. 4971 Title *string `json:"title,omitempty"` 4972 // 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. 4973 ContentFormat *string `json:"contentFormat,omitempty"` 4974 // Content - An HTTP link or Base64-encoded binary data. 4975 Content *string `json:"content,omitempty"` 4976} 4977 4978// IssueCollection paged Issue list representation. 4979type IssueCollection struct { 4980 autorest.Response `json:"-"` 4981 // Value - READ-ONLY; Issue values. 4982 Value *[]IssueContract `json:"value,omitempty"` 4983 // NextLink - READ-ONLY; Next page link if any. 4984 NextLink *string `json:"nextLink,omitempty"` 4985} 4986 4987// MarshalJSON is the custom marshaler for IssueCollection. 4988func (ic IssueCollection) MarshalJSON() ([]byte, error) { 4989 objectMap := make(map[string]interface{}) 4990 return json.Marshal(objectMap) 4991} 4992 4993// IssueCollectionIterator provides access to a complete listing of IssueContract values. 4994type IssueCollectionIterator struct { 4995 i int 4996 page IssueCollectionPage 4997} 4998 4999// NextWithContext advances to the next value. If there was an error making 5000// the request the iterator does not advance and the error is returned. 5001func (iter *IssueCollectionIterator) NextWithContext(ctx context.Context) (err error) { 5002 if tracing.IsEnabled() { 5003 ctx = tracing.StartSpan(ctx, fqdn+"/IssueCollectionIterator.NextWithContext") 5004 defer func() { 5005 sc := -1 5006 if iter.Response().Response.Response != nil { 5007 sc = iter.Response().Response.Response.StatusCode 5008 } 5009 tracing.EndSpan(ctx, sc, err) 5010 }() 5011 } 5012 iter.i++ 5013 if iter.i < len(iter.page.Values()) { 5014 return nil 5015 } 5016 err = iter.page.NextWithContext(ctx) 5017 if err != nil { 5018 iter.i-- 5019 return err 5020 } 5021 iter.i = 0 5022 return nil 5023} 5024 5025// Next advances to the next value. If there was an error making 5026// the request the iterator does not advance and the error is returned. 5027// Deprecated: Use NextWithContext() instead. 5028func (iter *IssueCollectionIterator) Next() error { 5029 return iter.NextWithContext(context.Background()) 5030} 5031 5032// NotDone returns true if the enumeration should be started or is not yet complete. 5033func (iter IssueCollectionIterator) NotDone() bool { 5034 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 5035} 5036 5037// Response returns the raw server response from the last page request. 5038func (iter IssueCollectionIterator) Response() IssueCollection { 5039 return iter.page.Response() 5040} 5041 5042// Value returns the current value or a zero-initialized value if the 5043// iterator has advanced beyond the end of the collection. 5044func (iter IssueCollectionIterator) Value() IssueContract { 5045 if !iter.page.NotDone() { 5046 return IssueContract{} 5047 } 5048 return iter.page.Values()[iter.i] 5049} 5050 5051// Creates a new instance of the IssueCollectionIterator type. 5052func NewIssueCollectionIterator(page IssueCollectionPage) IssueCollectionIterator { 5053 return IssueCollectionIterator{page: page} 5054} 5055 5056// IsEmpty returns true if the ListResult contains no values. 5057func (ic IssueCollection) IsEmpty() bool { 5058 return ic.Value == nil || len(*ic.Value) == 0 5059} 5060 5061// hasNextLink returns true if the NextLink is not empty. 5062func (ic IssueCollection) hasNextLink() bool { 5063 return ic.NextLink != nil && len(*ic.NextLink) != 0 5064} 5065 5066// issueCollectionPreparer prepares a request to retrieve the next set of results. 5067// It returns nil if no more results exist. 5068func (ic IssueCollection) issueCollectionPreparer(ctx context.Context) (*http.Request, error) { 5069 if !ic.hasNextLink() { 5070 return nil, nil 5071 } 5072 return autorest.Prepare((&http.Request{}).WithContext(ctx), 5073 autorest.AsJSON(), 5074 autorest.AsGet(), 5075 autorest.WithBaseURL(to.String(ic.NextLink))) 5076} 5077 5078// IssueCollectionPage contains a page of IssueContract values. 5079type IssueCollectionPage struct { 5080 fn func(context.Context, IssueCollection) (IssueCollection, error) 5081 ic IssueCollection 5082} 5083 5084// NextWithContext advances to the next page of values. If there was an error making 5085// the request the page does not advance and the error is returned. 5086func (page *IssueCollectionPage) NextWithContext(ctx context.Context) (err error) { 5087 if tracing.IsEnabled() { 5088 ctx = tracing.StartSpan(ctx, fqdn+"/IssueCollectionPage.NextWithContext") 5089 defer func() { 5090 sc := -1 5091 if page.Response().Response.Response != nil { 5092 sc = page.Response().Response.Response.StatusCode 5093 } 5094 tracing.EndSpan(ctx, sc, err) 5095 }() 5096 } 5097 for { 5098 next, err := page.fn(ctx, page.ic) 5099 if err != nil { 5100 return err 5101 } 5102 page.ic = next 5103 if !next.hasNextLink() || !next.IsEmpty() { 5104 break 5105 } 5106 } 5107 return nil 5108} 5109 5110// Next advances to the next page of values. If there was an error making 5111// the request the page does not advance and the error is returned. 5112// Deprecated: Use NextWithContext() instead. 5113func (page *IssueCollectionPage) Next() error { 5114 return page.NextWithContext(context.Background()) 5115} 5116 5117// NotDone returns true if the page enumeration should be started or is not yet complete. 5118func (page IssueCollectionPage) NotDone() bool { 5119 return !page.ic.IsEmpty() 5120} 5121 5122// Response returns the raw server response from the last page request. 5123func (page IssueCollectionPage) Response() IssueCollection { 5124 return page.ic 5125} 5126 5127// Values returns the slice of values for the current page or nil if there are no values. 5128func (page IssueCollectionPage) Values() []IssueContract { 5129 if page.ic.IsEmpty() { 5130 return nil 5131 } 5132 return *page.ic.Value 5133} 5134 5135// Creates a new instance of the IssueCollectionPage type. 5136func NewIssueCollectionPage(cur IssueCollection, getNextPage func(context.Context, IssueCollection) (IssueCollection, error)) IssueCollectionPage { 5137 return IssueCollectionPage{ 5138 fn: getNextPage, 5139 ic: cur, 5140 } 5141} 5142 5143// IssueCommentCollection paged Issue Comment list representation. 5144type IssueCommentCollection struct { 5145 autorest.Response `json:"-"` 5146 // Value - READ-ONLY; Issue Comment values. 5147 Value *[]IssueCommentContract `json:"value,omitempty"` 5148 // NextLink - READ-ONLY; Next page link if any. 5149 NextLink *string `json:"nextLink,omitempty"` 5150} 5151 5152// MarshalJSON is the custom marshaler for IssueCommentCollection. 5153func (icc IssueCommentCollection) MarshalJSON() ([]byte, error) { 5154 objectMap := make(map[string]interface{}) 5155 return json.Marshal(objectMap) 5156} 5157 5158// IssueCommentCollectionIterator provides access to a complete listing of IssueCommentContract values. 5159type IssueCommentCollectionIterator struct { 5160 i int 5161 page IssueCommentCollectionPage 5162} 5163 5164// NextWithContext advances to the next value. If there was an error making 5165// the request the iterator does not advance and the error is returned. 5166func (iter *IssueCommentCollectionIterator) NextWithContext(ctx context.Context) (err error) { 5167 if tracing.IsEnabled() { 5168 ctx = tracing.StartSpan(ctx, fqdn+"/IssueCommentCollectionIterator.NextWithContext") 5169 defer func() { 5170 sc := -1 5171 if iter.Response().Response.Response != nil { 5172 sc = iter.Response().Response.Response.StatusCode 5173 } 5174 tracing.EndSpan(ctx, sc, err) 5175 }() 5176 } 5177 iter.i++ 5178 if iter.i < len(iter.page.Values()) { 5179 return nil 5180 } 5181 err = iter.page.NextWithContext(ctx) 5182 if err != nil { 5183 iter.i-- 5184 return err 5185 } 5186 iter.i = 0 5187 return nil 5188} 5189 5190// Next advances to the next value. If there was an error making 5191// the request the iterator does not advance and the error is returned. 5192// Deprecated: Use NextWithContext() instead. 5193func (iter *IssueCommentCollectionIterator) Next() error { 5194 return iter.NextWithContext(context.Background()) 5195} 5196 5197// NotDone returns true if the enumeration should be started or is not yet complete. 5198func (iter IssueCommentCollectionIterator) NotDone() bool { 5199 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 5200} 5201 5202// Response returns the raw server response from the last page request. 5203func (iter IssueCommentCollectionIterator) Response() IssueCommentCollection { 5204 return iter.page.Response() 5205} 5206 5207// Value returns the current value or a zero-initialized value if the 5208// iterator has advanced beyond the end of the collection. 5209func (iter IssueCommentCollectionIterator) Value() IssueCommentContract { 5210 if !iter.page.NotDone() { 5211 return IssueCommentContract{} 5212 } 5213 return iter.page.Values()[iter.i] 5214} 5215 5216// Creates a new instance of the IssueCommentCollectionIterator type. 5217func NewIssueCommentCollectionIterator(page IssueCommentCollectionPage) IssueCommentCollectionIterator { 5218 return IssueCommentCollectionIterator{page: page} 5219} 5220 5221// IsEmpty returns true if the ListResult contains no values. 5222func (icc IssueCommentCollection) IsEmpty() bool { 5223 return icc.Value == nil || len(*icc.Value) == 0 5224} 5225 5226// hasNextLink returns true if the NextLink is not empty. 5227func (icc IssueCommentCollection) hasNextLink() bool { 5228 return icc.NextLink != nil && len(*icc.NextLink) != 0 5229} 5230 5231// issueCommentCollectionPreparer prepares a request to retrieve the next set of results. 5232// It returns nil if no more results exist. 5233func (icc IssueCommentCollection) issueCommentCollectionPreparer(ctx context.Context) (*http.Request, error) { 5234 if !icc.hasNextLink() { 5235 return nil, nil 5236 } 5237 return autorest.Prepare((&http.Request{}).WithContext(ctx), 5238 autorest.AsJSON(), 5239 autorest.AsGet(), 5240 autorest.WithBaseURL(to.String(icc.NextLink))) 5241} 5242 5243// IssueCommentCollectionPage contains a page of IssueCommentContract values. 5244type IssueCommentCollectionPage struct { 5245 fn func(context.Context, IssueCommentCollection) (IssueCommentCollection, error) 5246 icc IssueCommentCollection 5247} 5248 5249// NextWithContext advances to the next page of values. If there was an error making 5250// the request the page does not advance and the error is returned. 5251func (page *IssueCommentCollectionPage) NextWithContext(ctx context.Context) (err error) { 5252 if tracing.IsEnabled() { 5253 ctx = tracing.StartSpan(ctx, fqdn+"/IssueCommentCollectionPage.NextWithContext") 5254 defer func() { 5255 sc := -1 5256 if page.Response().Response.Response != nil { 5257 sc = page.Response().Response.Response.StatusCode 5258 } 5259 tracing.EndSpan(ctx, sc, err) 5260 }() 5261 } 5262 for { 5263 next, err := page.fn(ctx, page.icc) 5264 if err != nil { 5265 return err 5266 } 5267 page.icc = next 5268 if !next.hasNextLink() || !next.IsEmpty() { 5269 break 5270 } 5271 } 5272 return nil 5273} 5274 5275// Next advances to the next page of values. If there was an error making 5276// the request the page does not advance and the error is returned. 5277// Deprecated: Use NextWithContext() instead. 5278func (page *IssueCommentCollectionPage) Next() error { 5279 return page.NextWithContext(context.Background()) 5280} 5281 5282// NotDone returns true if the page enumeration should be started or is not yet complete. 5283func (page IssueCommentCollectionPage) NotDone() bool { 5284 return !page.icc.IsEmpty() 5285} 5286 5287// Response returns the raw server response from the last page request. 5288func (page IssueCommentCollectionPage) Response() IssueCommentCollection { 5289 return page.icc 5290} 5291 5292// Values returns the slice of values for the current page or nil if there are no values. 5293func (page IssueCommentCollectionPage) Values() []IssueCommentContract { 5294 if page.icc.IsEmpty() { 5295 return nil 5296 } 5297 return *page.icc.Value 5298} 5299 5300// Creates a new instance of the IssueCommentCollectionPage type. 5301func NewIssueCommentCollectionPage(cur IssueCommentCollection, getNextPage func(context.Context, IssueCommentCollection) (IssueCommentCollection, error)) IssueCommentCollectionPage { 5302 return IssueCommentCollectionPage{ 5303 fn: getNextPage, 5304 icc: cur, 5305 } 5306} 5307 5308// IssueCommentContract issue Comment Contract details. 5309type IssueCommentContract struct { 5310 autorest.Response `json:"-"` 5311 // IssueCommentContractProperties - Properties of the Issue Comment. 5312 *IssueCommentContractProperties `json:"properties,omitempty"` 5313 // ID - READ-ONLY; Resource ID. 5314 ID *string `json:"id,omitempty"` 5315 // Name - READ-ONLY; Resource name. 5316 Name *string `json:"name,omitempty"` 5317 // Type - READ-ONLY; Resource type for API Management resource. 5318 Type *string `json:"type,omitempty"` 5319} 5320 5321// MarshalJSON is the custom marshaler for IssueCommentContract. 5322func (icc IssueCommentContract) MarshalJSON() ([]byte, error) { 5323 objectMap := make(map[string]interface{}) 5324 if icc.IssueCommentContractProperties != nil { 5325 objectMap["properties"] = icc.IssueCommentContractProperties 5326 } 5327 return json.Marshal(objectMap) 5328} 5329 5330// UnmarshalJSON is the custom unmarshaler for IssueCommentContract struct. 5331func (icc *IssueCommentContract) UnmarshalJSON(body []byte) error { 5332 var m map[string]*json.RawMessage 5333 err := json.Unmarshal(body, &m) 5334 if err != nil { 5335 return err 5336 } 5337 for k, v := range m { 5338 switch k { 5339 case "properties": 5340 if v != nil { 5341 var issueCommentContractProperties IssueCommentContractProperties 5342 err = json.Unmarshal(*v, &issueCommentContractProperties) 5343 if err != nil { 5344 return err 5345 } 5346 icc.IssueCommentContractProperties = &issueCommentContractProperties 5347 } 5348 case "id": 5349 if v != nil { 5350 var ID string 5351 err = json.Unmarshal(*v, &ID) 5352 if err != nil { 5353 return err 5354 } 5355 icc.ID = &ID 5356 } 5357 case "name": 5358 if v != nil { 5359 var name string 5360 err = json.Unmarshal(*v, &name) 5361 if err != nil { 5362 return err 5363 } 5364 icc.Name = &name 5365 } 5366 case "type": 5367 if v != nil { 5368 var typeVar string 5369 err = json.Unmarshal(*v, &typeVar) 5370 if err != nil { 5371 return err 5372 } 5373 icc.Type = &typeVar 5374 } 5375 } 5376 } 5377 5378 return nil 5379} 5380 5381// IssueCommentContractProperties issue Comment contract Properties. 5382type IssueCommentContractProperties struct { 5383 // Text - Comment text. 5384 Text *string `json:"text,omitempty"` 5385 // CreatedDate - Date and time when the comment was created. 5386 CreatedDate *date.Time `json:"createdDate,omitempty"` 5387 // UserID - A resource identifier for the user who left the comment. 5388 UserID *string `json:"userId,omitempty"` 5389} 5390 5391// IssueContract issue Contract details. 5392type IssueContract struct { 5393 autorest.Response `json:"-"` 5394 // IssueContractProperties - Properties of the Issue. 5395 *IssueContractProperties `json:"properties,omitempty"` 5396 // ID - READ-ONLY; Resource ID. 5397 ID *string `json:"id,omitempty"` 5398 // Name - READ-ONLY; Resource name. 5399 Name *string `json:"name,omitempty"` 5400 // Type - READ-ONLY; Resource type for API Management resource. 5401 Type *string `json:"type,omitempty"` 5402} 5403 5404// MarshalJSON is the custom marshaler for IssueContract. 5405func (ic IssueContract) MarshalJSON() ([]byte, error) { 5406 objectMap := make(map[string]interface{}) 5407 if ic.IssueContractProperties != nil { 5408 objectMap["properties"] = ic.IssueContractProperties 5409 } 5410 return json.Marshal(objectMap) 5411} 5412 5413// UnmarshalJSON is the custom unmarshaler for IssueContract struct. 5414func (ic *IssueContract) UnmarshalJSON(body []byte) error { 5415 var m map[string]*json.RawMessage 5416 err := json.Unmarshal(body, &m) 5417 if err != nil { 5418 return err 5419 } 5420 for k, v := range m { 5421 switch k { 5422 case "properties": 5423 if v != nil { 5424 var issueContractProperties IssueContractProperties 5425 err = json.Unmarshal(*v, &issueContractProperties) 5426 if err != nil { 5427 return err 5428 } 5429 ic.IssueContractProperties = &issueContractProperties 5430 } 5431 case "id": 5432 if v != nil { 5433 var ID string 5434 err = json.Unmarshal(*v, &ID) 5435 if err != nil { 5436 return err 5437 } 5438 ic.ID = &ID 5439 } 5440 case "name": 5441 if v != nil { 5442 var name string 5443 err = json.Unmarshal(*v, &name) 5444 if err != nil { 5445 return err 5446 } 5447 ic.Name = &name 5448 } 5449 case "type": 5450 if v != nil { 5451 var typeVar string 5452 err = json.Unmarshal(*v, &typeVar) 5453 if err != nil { 5454 return err 5455 } 5456 ic.Type = &typeVar 5457 } 5458 } 5459 } 5460 5461 return nil 5462} 5463 5464// IssueContractBaseProperties issue contract Base Properties. 5465type IssueContractBaseProperties struct { 5466 // CreatedDate - Date and time when the issue was created. 5467 CreatedDate *date.Time `json:"createdDate,omitempty"` 5468 // State - Status of the issue. Possible values include: 'Proposed', 'Open', 'Removed', 'Resolved', 'Closed' 5469 State State `json:"state,omitempty"` 5470 // APIID - A resource identifier for the API the issue was created for. 5471 APIID *string `json:"apiId,omitempty"` 5472} 5473 5474// IssueContractProperties issue contract Properties. 5475type IssueContractProperties struct { 5476 // Title - The issue title. 5477 Title *string `json:"title,omitempty"` 5478 // Description - Text describing the issue. 5479 Description *string `json:"description,omitempty"` 5480 // UserID - A resource identifier for the user created the issue. 5481 UserID *string `json:"userId,omitempty"` 5482 // CreatedDate - Date and time when the issue was created. 5483 CreatedDate *date.Time `json:"createdDate,omitempty"` 5484 // State - Status of the issue. Possible values include: 'Proposed', 'Open', 'Removed', 'Resolved', 'Closed' 5485 State State `json:"state,omitempty"` 5486 // APIID - A resource identifier for the API the issue was created for. 5487 APIID *string `json:"apiId,omitempty"` 5488} 5489 5490// IssueUpdateContract issue update Parameters. 5491type IssueUpdateContract struct { 5492 // IssueUpdateContractProperties - Issue entity Update contract properties. 5493 *IssueUpdateContractProperties `json:"properties,omitempty"` 5494} 5495 5496// MarshalJSON is the custom marshaler for IssueUpdateContract. 5497func (iuc IssueUpdateContract) MarshalJSON() ([]byte, error) { 5498 objectMap := make(map[string]interface{}) 5499 if iuc.IssueUpdateContractProperties != nil { 5500 objectMap["properties"] = iuc.IssueUpdateContractProperties 5501 } 5502 return json.Marshal(objectMap) 5503} 5504 5505// UnmarshalJSON is the custom unmarshaler for IssueUpdateContract struct. 5506func (iuc *IssueUpdateContract) UnmarshalJSON(body []byte) error { 5507 var m map[string]*json.RawMessage 5508 err := json.Unmarshal(body, &m) 5509 if err != nil { 5510 return err 5511 } 5512 for k, v := range m { 5513 switch k { 5514 case "properties": 5515 if v != nil { 5516 var issueUpdateContractProperties IssueUpdateContractProperties 5517 err = json.Unmarshal(*v, &issueUpdateContractProperties) 5518 if err != nil { 5519 return err 5520 } 5521 iuc.IssueUpdateContractProperties = &issueUpdateContractProperties 5522 } 5523 } 5524 } 5525 5526 return nil 5527} 5528 5529// IssueUpdateContractProperties issue contract Update Properties. 5530type IssueUpdateContractProperties struct { 5531 // Title - The issue title. 5532 Title *string `json:"title,omitempty"` 5533 // Description - Text describing the issue. 5534 Description *string `json:"description,omitempty"` 5535 // UserID - A resource identifier for the user created the issue. 5536 UserID *string `json:"userId,omitempty"` 5537 // CreatedDate - Date and time when the issue was created. 5538 CreatedDate *date.Time `json:"createdDate,omitempty"` 5539 // State - Status of the issue. Possible values include: 'Proposed', 'Open', 'Removed', 'Resolved', 'Closed' 5540 State State `json:"state,omitempty"` 5541 // APIID - A resource identifier for the API the issue was created for. 5542 APIID *string `json:"apiId,omitempty"` 5543} 5544 5545// ListNetworkStatusContractByLocation ... 5546type ListNetworkStatusContractByLocation struct { 5547 autorest.Response `json:"-"` 5548 Value *[]NetworkStatusContractByLocation `json:"value,omitempty"` 5549} 5550 5551// LoggerCollection paged Logger list representation. 5552type LoggerCollection struct { 5553 autorest.Response `json:"-"` 5554 // Value - Logger values. 5555 Value *[]LoggerContract `json:"value,omitempty"` 5556 // Count - Total record count number across all pages. 5557 Count *int64 `json:"count,omitempty"` 5558 // NextLink - Next page link if any. 5559 NextLink *string `json:"nextLink,omitempty"` 5560} 5561 5562// LoggerCollectionIterator provides access to a complete listing of LoggerContract values. 5563type LoggerCollectionIterator struct { 5564 i int 5565 page LoggerCollectionPage 5566} 5567 5568// NextWithContext advances to the next value. If there was an error making 5569// the request the iterator does not advance and the error is returned. 5570func (iter *LoggerCollectionIterator) NextWithContext(ctx context.Context) (err error) { 5571 if tracing.IsEnabled() { 5572 ctx = tracing.StartSpan(ctx, fqdn+"/LoggerCollectionIterator.NextWithContext") 5573 defer func() { 5574 sc := -1 5575 if iter.Response().Response.Response != nil { 5576 sc = iter.Response().Response.Response.StatusCode 5577 } 5578 tracing.EndSpan(ctx, sc, err) 5579 }() 5580 } 5581 iter.i++ 5582 if iter.i < len(iter.page.Values()) { 5583 return nil 5584 } 5585 err = iter.page.NextWithContext(ctx) 5586 if err != nil { 5587 iter.i-- 5588 return err 5589 } 5590 iter.i = 0 5591 return nil 5592} 5593 5594// Next advances to the next value. If there was an error making 5595// the request the iterator does not advance and the error is returned. 5596// Deprecated: Use NextWithContext() instead. 5597func (iter *LoggerCollectionIterator) Next() error { 5598 return iter.NextWithContext(context.Background()) 5599} 5600 5601// NotDone returns true if the enumeration should be started or is not yet complete. 5602func (iter LoggerCollectionIterator) NotDone() bool { 5603 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 5604} 5605 5606// Response returns the raw server response from the last page request. 5607func (iter LoggerCollectionIterator) Response() LoggerCollection { 5608 return iter.page.Response() 5609} 5610 5611// Value returns the current value or a zero-initialized value if the 5612// iterator has advanced beyond the end of the collection. 5613func (iter LoggerCollectionIterator) Value() LoggerContract { 5614 if !iter.page.NotDone() { 5615 return LoggerContract{} 5616 } 5617 return iter.page.Values()[iter.i] 5618} 5619 5620// Creates a new instance of the LoggerCollectionIterator type. 5621func NewLoggerCollectionIterator(page LoggerCollectionPage) LoggerCollectionIterator { 5622 return LoggerCollectionIterator{page: page} 5623} 5624 5625// IsEmpty returns true if the ListResult contains no values. 5626func (lc LoggerCollection) IsEmpty() bool { 5627 return lc.Value == nil || len(*lc.Value) == 0 5628} 5629 5630// hasNextLink returns true if the NextLink is not empty. 5631func (lc LoggerCollection) hasNextLink() bool { 5632 return lc.NextLink != nil && len(*lc.NextLink) != 0 5633} 5634 5635// loggerCollectionPreparer prepares a request to retrieve the next set of results. 5636// It returns nil if no more results exist. 5637func (lc LoggerCollection) loggerCollectionPreparer(ctx context.Context) (*http.Request, error) { 5638 if !lc.hasNextLink() { 5639 return nil, nil 5640 } 5641 return autorest.Prepare((&http.Request{}).WithContext(ctx), 5642 autorest.AsJSON(), 5643 autorest.AsGet(), 5644 autorest.WithBaseURL(to.String(lc.NextLink))) 5645} 5646 5647// LoggerCollectionPage contains a page of LoggerContract values. 5648type LoggerCollectionPage struct { 5649 fn func(context.Context, LoggerCollection) (LoggerCollection, error) 5650 lc LoggerCollection 5651} 5652 5653// NextWithContext advances to the next page of values. If there was an error making 5654// the request the page does not advance and the error is returned. 5655func (page *LoggerCollectionPage) NextWithContext(ctx context.Context) (err error) { 5656 if tracing.IsEnabled() { 5657 ctx = tracing.StartSpan(ctx, fqdn+"/LoggerCollectionPage.NextWithContext") 5658 defer func() { 5659 sc := -1 5660 if page.Response().Response.Response != nil { 5661 sc = page.Response().Response.Response.StatusCode 5662 } 5663 tracing.EndSpan(ctx, sc, err) 5664 }() 5665 } 5666 for { 5667 next, err := page.fn(ctx, page.lc) 5668 if err != nil { 5669 return err 5670 } 5671 page.lc = next 5672 if !next.hasNextLink() || !next.IsEmpty() { 5673 break 5674 } 5675 } 5676 return nil 5677} 5678 5679// Next advances to the next page of values. If there was an error making 5680// the request the page does not advance and the error is returned. 5681// Deprecated: Use NextWithContext() instead. 5682func (page *LoggerCollectionPage) Next() error { 5683 return page.NextWithContext(context.Background()) 5684} 5685 5686// NotDone returns true if the page enumeration should be started or is not yet complete. 5687func (page LoggerCollectionPage) NotDone() bool { 5688 return !page.lc.IsEmpty() 5689} 5690 5691// Response returns the raw server response from the last page request. 5692func (page LoggerCollectionPage) Response() LoggerCollection { 5693 return page.lc 5694} 5695 5696// Values returns the slice of values for the current page or nil if there are no values. 5697func (page LoggerCollectionPage) Values() []LoggerContract { 5698 if page.lc.IsEmpty() { 5699 return nil 5700 } 5701 return *page.lc.Value 5702} 5703 5704// Creates a new instance of the LoggerCollectionPage type. 5705func NewLoggerCollectionPage(cur LoggerCollection, getNextPage func(context.Context, LoggerCollection) (LoggerCollection, error)) LoggerCollectionPage { 5706 return LoggerCollectionPage{ 5707 fn: getNextPage, 5708 lc: cur, 5709 } 5710} 5711 5712// LoggerContract logger details. 5713type LoggerContract struct { 5714 autorest.Response `json:"-"` 5715 // LoggerContractProperties - Logger entity contract properties. 5716 *LoggerContractProperties `json:"properties,omitempty"` 5717 // ID - READ-ONLY; Resource ID. 5718 ID *string `json:"id,omitempty"` 5719 // Name - READ-ONLY; Resource name. 5720 Name *string `json:"name,omitempty"` 5721 // Type - READ-ONLY; Resource type for API Management resource. 5722 Type *string `json:"type,omitempty"` 5723} 5724 5725// MarshalJSON is the custom marshaler for LoggerContract. 5726func (lc LoggerContract) MarshalJSON() ([]byte, error) { 5727 objectMap := make(map[string]interface{}) 5728 if lc.LoggerContractProperties != nil { 5729 objectMap["properties"] = lc.LoggerContractProperties 5730 } 5731 return json.Marshal(objectMap) 5732} 5733 5734// UnmarshalJSON is the custom unmarshaler for LoggerContract struct. 5735func (lc *LoggerContract) UnmarshalJSON(body []byte) error { 5736 var m map[string]*json.RawMessage 5737 err := json.Unmarshal(body, &m) 5738 if err != nil { 5739 return err 5740 } 5741 for k, v := range m { 5742 switch k { 5743 case "properties": 5744 if v != nil { 5745 var loggerContractProperties LoggerContractProperties 5746 err = json.Unmarshal(*v, &loggerContractProperties) 5747 if err != nil { 5748 return err 5749 } 5750 lc.LoggerContractProperties = &loggerContractProperties 5751 } 5752 case "id": 5753 if v != nil { 5754 var ID string 5755 err = json.Unmarshal(*v, &ID) 5756 if err != nil { 5757 return err 5758 } 5759 lc.ID = &ID 5760 } 5761 case "name": 5762 if v != nil { 5763 var name string 5764 err = json.Unmarshal(*v, &name) 5765 if err != nil { 5766 return err 5767 } 5768 lc.Name = &name 5769 } 5770 case "type": 5771 if v != nil { 5772 var typeVar string 5773 err = json.Unmarshal(*v, &typeVar) 5774 if err != nil { 5775 return err 5776 } 5777 lc.Type = &typeVar 5778 } 5779 } 5780 } 5781 5782 return nil 5783} 5784 5785// LoggerContractProperties the Logger entity in API Management represents an event sink that you can use 5786// to log API Management events. Currently the Logger entity supports logging API Management events to 5787// Azure Event Hubs. 5788type LoggerContractProperties struct { 5789 // LoggerType - Logger type. Possible values include: 'AzureEventHub', 'ApplicationInsights' 5790 LoggerType LoggerType `json:"loggerType,omitempty"` 5791 // Description - Logger description. 5792 Description *string `json:"description,omitempty"` 5793 // Credentials - The name and SendRule connection string of the event hub for azureEventHub logger. 5794 // Instrumentation key for applicationInsights logger. 5795 Credentials map[string]*string `json:"credentials"` 5796 // IsBuffered - Whether records are buffered in the logger before publishing. Default is assumed to be true. 5797 IsBuffered *bool `json:"isBuffered,omitempty"` 5798 // ResourceID - Azure Resource Id of a log target (either Azure Event Hub resource or Azure Application Insights resource). 5799 ResourceID *string `json:"resourceId,omitempty"` 5800} 5801 5802// MarshalJSON is the custom marshaler for LoggerContractProperties. 5803func (lcp LoggerContractProperties) MarshalJSON() ([]byte, error) { 5804 objectMap := make(map[string]interface{}) 5805 if lcp.LoggerType != "" { 5806 objectMap["loggerType"] = lcp.LoggerType 5807 } 5808 if lcp.Description != nil { 5809 objectMap["description"] = lcp.Description 5810 } 5811 if lcp.Credentials != nil { 5812 objectMap["credentials"] = lcp.Credentials 5813 } 5814 if lcp.IsBuffered != nil { 5815 objectMap["isBuffered"] = lcp.IsBuffered 5816 } 5817 if lcp.ResourceID != nil { 5818 objectMap["resourceId"] = lcp.ResourceID 5819 } 5820 return json.Marshal(objectMap) 5821} 5822 5823// LoggerUpdateContract logger update contract. 5824type LoggerUpdateContract struct { 5825 // LoggerUpdateParameters - Logger entity update contract properties. 5826 *LoggerUpdateParameters `json:"properties,omitempty"` 5827} 5828 5829// MarshalJSON is the custom marshaler for LoggerUpdateContract. 5830func (luc LoggerUpdateContract) MarshalJSON() ([]byte, error) { 5831 objectMap := make(map[string]interface{}) 5832 if luc.LoggerUpdateParameters != nil { 5833 objectMap["properties"] = luc.LoggerUpdateParameters 5834 } 5835 return json.Marshal(objectMap) 5836} 5837 5838// UnmarshalJSON is the custom unmarshaler for LoggerUpdateContract struct. 5839func (luc *LoggerUpdateContract) UnmarshalJSON(body []byte) error { 5840 var m map[string]*json.RawMessage 5841 err := json.Unmarshal(body, &m) 5842 if err != nil { 5843 return err 5844 } 5845 for k, v := range m { 5846 switch k { 5847 case "properties": 5848 if v != nil { 5849 var loggerUpdateParameters LoggerUpdateParameters 5850 err = json.Unmarshal(*v, &loggerUpdateParameters) 5851 if err != nil { 5852 return err 5853 } 5854 luc.LoggerUpdateParameters = &loggerUpdateParameters 5855 } 5856 } 5857 } 5858 5859 return nil 5860} 5861 5862// LoggerUpdateParameters parameters supplied to the Update Logger operation. 5863type LoggerUpdateParameters struct { 5864 // LoggerType - Logger type. Possible values include: 'AzureEventHub', 'ApplicationInsights' 5865 LoggerType LoggerType `json:"loggerType,omitempty"` 5866 // Description - Logger description. 5867 Description *string `json:"description,omitempty"` 5868 // Credentials - Logger credentials. 5869 Credentials map[string]*string `json:"credentials"` 5870 // IsBuffered - Whether records are buffered in the logger before publishing. Default is assumed to be true. 5871 IsBuffered *bool `json:"isBuffered,omitempty"` 5872} 5873 5874// MarshalJSON is the custom marshaler for LoggerUpdateParameters. 5875func (lup LoggerUpdateParameters) MarshalJSON() ([]byte, error) { 5876 objectMap := make(map[string]interface{}) 5877 if lup.LoggerType != "" { 5878 objectMap["loggerType"] = lup.LoggerType 5879 } 5880 if lup.Description != nil { 5881 objectMap["description"] = lup.Description 5882 } 5883 if lup.Credentials != nil { 5884 objectMap["credentials"] = lup.Credentials 5885 } 5886 if lup.IsBuffered != nil { 5887 objectMap["isBuffered"] = lup.IsBuffered 5888 } 5889 return json.Marshal(objectMap) 5890} 5891 5892// NetworkStatusContract network Status details. 5893type NetworkStatusContract struct { 5894 autorest.Response `json:"-"` 5895 // DNSServers - Gets the list of DNS servers IPV4 addresses. 5896 DNSServers *[]string `json:"dnsServers,omitempty"` 5897 // ConnectivityStatus - Gets the list of Connectivity Status to the Resources on which the service depends upon. 5898 ConnectivityStatus *[]ConnectivityStatusContract `json:"connectivityStatus,omitempty"` 5899} 5900 5901// NetworkStatusContractByLocation network Status in the Location 5902type NetworkStatusContractByLocation struct { 5903 // Location - Location of service 5904 Location *string `json:"location,omitempty"` 5905 // NetworkStatus - Network status in Location 5906 NetworkStatus *NetworkStatusContract `json:"networkStatus,omitempty"` 5907} 5908 5909// NotificationCollection paged Notification list representation. 5910type NotificationCollection struct { 5911 autorest.Response `json:"-"` 5912 // Value - Page values. 5913 Value *[]NotificationContract `json:"value,omitempty"` 5914 // NextLink - Next page link if any. 5915 NextLink *string `json:"nextLink,omitempty"` 5916} 5917 5918// NotificationCollectionIterator provides access to a complete listing of NotificationContract values. 5919type NotificationCollectionIterator struct { 5920 i int 5921 page NotificationCollectionPage 5922} 5923 5924// NextWithContext advances to the next value. If there was an error making 5925// the request the iterator does not advance and the error is returned. 5926func (iter *NotificationCollectionIterator) NextWithContext(ctx context.Context) (err error) { 5927 if tracing.IsEnabled() { 5928 ctx = tracing.StartSpan(ctx, fqdn+"/NotificationCollectionIterator.NextWithContext") 5929 defer func() { 5930 sc := -1 5931 if iter.Response().Response.Response != nil { 5932 sc = iter.Response().Response.Response.StatusCode 5933 } 5934 tracing.EndSpan(ctx, sc, err) 5935 }() 5936 } 5937 iter.i++ 5938 if iter.i < len(iter.page.Values()) { 5939 return nil 5940 } 5941 err = iter.page.NextWithContext(ctx) 5942 if err != nil { 5943 iter.i-- 5944 return err 5945 } 5946 iter.i = 0 5947 return nil 5948} 5949 5950// Next advances to the next value. If there was an error making 5951// the request the iterator does not advance and the error is returned. 5952// Deprecated: Use NextWithContext() instead. 5953func (iter *NotificationCollectionIterator) Next() error { 5954 return iter.NextWithContext(context.Background()) 5955} 5956 5957// NotDone returns true if the enumeration should be started or is not yet complete. 5958func (iter NotificationCollectionIterator) NotDone() bool { 5959 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 5960} 5961 5962// Response returns the raw server response from the last page request. 5963func (iter NotificationCollectionIterator) Response() NotificationCollection { 5964 return iter.page.Response() 5965} 5966 5967// Value returns the current value or a zero-initialized value if the 5968// iterator has advanced beyond the end of the collection. 5969func (iter NotificationCollectionIterator) Value() NotificationContract { 5970 if !iter.page.NotDone() { 5971 return NotificationContract{} 5972 } 5973 return iter.page.Values()[iter.i] 5974} 5975 5976// Creates a new instance of the NotificationCollectionIterator type. 5977func NewNotificationCollectionIterator(page NotificationCollectionPage) NotificationCollectionIterator { 5978 return NotificationCollectionIterator{page: page} 5979} 5980 5981// IsEmpty returns true if the ListResult contains no values. 5982func (nc NotificationCollection) IsEmpty() bool { 5983 return nc.Value == nil || len(*nc.Value) == 0 5984} 5985 5986// hasNextLink returns true if the NextLink is not empty. 5987func (nc NotificationCollection) hasNextLink() bool { 5988 return nc.NextLink != nil && len(*nc.NextLink) != 0 5989} 5990 5991// notificationCollectionPreparer prepares a request to retrieve the next set of results. 5992// It returns nil if no more results exist. 5993func (nc NotificationCollection) notificationCollectionPreparer(ctx context.Context) (*http.Request, error) { 5994 if !nc.hasNextLink() { 5995 return nil, nil 5996 } 5997 return autorest.Prepare((&http.Request{}).WithContext(ctx), 5998 autorest.AsJSON(), 5999 autorest.AsGet(), 6000 autorest.WithBaseURL(to.String(nc.NextLink))) 6001} 6002 6003// NotificationCollectionPage contains a page of NotificationContract values. 6004type NotificationCollectionPage struct { 6005 fn func(context.Context, NotificationCollection) (NotificationCollection, error) 6006 nc NotificationCollection 6007} 6008 6009// NextWithContext advances to the next page of values. If there was an error making 6010// the request the page does not advance and the error is returned. 6011func (page *NotificationCollectionPage) NextWithContext(ctx context.Context) (err error) { 6012 if tracing.IsEnabled() { 6013 ctx = tracing.StartSpan(ctx, fqdn+"/NotificationCollectionPage.NextWithContext") 6014 defer func() { 6015 sc := -1 6016 if page.Response().Response.Response != nil { 6017 sc = page.Response().Response.Response.StatusCode 6018 } 6019 tracing.EndSpan(ctx, sc, err) 6020 }() 6021 } 6022 for { 6023 next, err := page.fn(ctx, page.nc) 6024 if err != nil { 6025 return err 6026 } 6027 page.nc = next 6028 if !next.hasNextLink() || !next.IsEmpty() { 6029 break 6030 } 6031 } 6032 return nil 6033} 6034 6035// Next advances to the next page of values. If there was an error making 6036// the request the page does not advance and the error is returned. 6037// Deprecated: Use NextWithContext() instead. 6038func (page *NotificationCollectionPage) Next() error { 6039 return page.NextWithContext(context.Background()) 6040} 6041 6042// NotDone returns true if the page enumeration should be started or is not yet complete. 6043func (page NotificationCollectionPage) NotDone() bool { 6044 return !page.nc.IsEmpty() 6045} 6046 6047// Response returns the raw server response from the last page request. 6048func (page NotificationCollectionPage) Response() NotificationCollection { 6049 return page.nc 6050} 6051 6052// Values returns the slice of values for the current page or nil if there are no values. 6053func (page NotificationCollectionPage) Values() []NotificationContract { 6054 if page.nc.IsEmpty() { 6055 return nil 6056 } 6057 return *page.nc.Value 6058} 6059 6060// Creates a new instance of the NotificationCollectionPage type. 6061func NewNotificationCollectionPage(cur NotificationCollection, getNextPage func(context.Context, NotificationCollection) (NotificationCollection, error)) NotificationCollectionPage { 6062 return NotificationCollectionPage{ 6063 fn: getNextPage, 6064 nc: cur, 6065 } 6066} 6067 6068// NotificationContract notification details. 6069type NotificationContract struct { 6070 autorest.Response `json:"-"` 6071 // NotificationContractProperties - Notification entity contract properties. 6072 *NotificationContractProperties `json:"properties,omitempty"` 6073 // ID - READ-ONLY; Resource ID. 6074 ID *string `json:"id,omitempty"` 6075 // Name - READ-ONLY; Resource name. 6076 Name *string `json:"name,omitempty"` 6077 // Type - READ-ONLY; Resource type for API Management resource. 6078 Type *string `json:"type,omitempty"` 6079} 6080 6081// MarshalJSON is the custom marshaler for NotificationContract. 6082func (nc NotificationContract) MarshalJSON() ([]byte, error) { 6083 objectMap := make(map[string]interface{}) 6084 if nc.NotificationContractProperties != nil { 6085 objectMap["properties"] = nc.NotificationContractProperties 6086 } 6087 return json.Marshal(objectMap) 6088} 6089 6090// UnmarshalJSON is the custom unmarshaler for NotificationContract struct. 6091func (nc *NotificationContract) UnmarshalJSON(body []byte) error { 6092 var m map[string]*json.RawMessage 6093 err := json.Unmarshal(body, &m) 6094 if err != nil { 6095 return err 6096 } 6097 for k, v := range m { 6098 switch k { 6099 case "properties": 6100 if v != nil { 6101 var notificationContractProperties NotificationContractProperties 6102 err = json.Unmarshal(*v, ¬ificationContractProperties) 6103 if err != nil { 6104 return err 6105 } 6106 nc.NotificationContractProperties = ¬ificationContractProperties 6107 } 6108 case "id": 6109 if v != nil { 6110 var ID string 6111 err = json.Unmarshal(*v, &ID) 6112 if err != nil { 6113 return err 6114 } 6115 nc.ID = &ID 6116 } 6117 case "name": 6118 if v != nil { 6119 var name string 6120 err = json.Unmarshal(*v, &name) 6121 if err != nil { 6122 return err 6123 } 6124 nc.Name = &name 6125 } 6126 case "type": 6127 if v != nil { 6128 var typeVar string 6129 err = json.Unmarshal(*v, &typeVar) 6130 if err != nil { 6131 return err 6132 } 6133 nc.Type = &typeVar 6134 } 6135 } 6136 } 6137 6138 return nil 6139} 6140 6141// NotificationContractProperties notification Contract properties. 6142type NotificationContractProperties struct { 6143 // Title - Title of the Notification. 6144 Title *string `json:"title,omitempty"` 6145 // Description - Description of the Notification. 6146 Description *string `json:"description,omitempty"` 6147 // Recipients - Recipient Parameter values. 6148 Recipients *RecipientsContractProperties `json:"recipients,omitempty"` 6149} 6150 6151// OAuth2AuthenticationSettingsContract API OAuth2 Authentication settings details. 6152type OAuth2AuthenticationSettingsContract struct { 6153 // AuthorizationServerID - OAuth authorization server identifier. 6154 AuthorizationServerID *string `json:"authorizationServerId,omitempty"` 6155 // Scope - operations scope. 6156 Scope *string `json:"scope,omitempty"` 6157} 6158 6159// OpenIDAuthenticationSettingsContract API OAuth2 Authentication settings details. 6160type OpenIDAuthenticationSettingsContract struct { 6161 // OpenidProviderID - OAuth authorization server identifier. 6162 OpenidProviderID *string `json:"openidProviderId,omitempty"` 6163 // BearerTokenSendingMethods - How to send token to the server. 6164 BearerTokenSendingMethods *[]BearerTokenSendingMethods `json:"bearerTokenSendingMethods,omitempty"` 6165} 6166 6167// OpenIDConnectProviderCollection paged OpenIdProviders list representation. 6168type OpenIDConnectProviderCollection struct { 6169 autorest.Response `json:"-"` 6170 // Value - Page values. 6171 Value *[]OpenidConnectProviderContract `json:"value,omitempty"` 6172 // NextLink - Next page link if any. 6173 NextLink *string `json:"nextLink,omitempty"` 6174} 6175 6176// OpenIDConnectProviderCollectionIterator provides access to a complete listing of 6177// OpenidConnectProviderContract values. 6178type OpenIDConnectProviderCollectionIterator struct { 6179 i int 6180 page OpenIDConnectProviderCollectionPage 6181} 6182 6183// NextWithContext advances to the next value. If there was an error making 6184// the request the iterator does not advance and the error is returned. 6185func (iter *OpenIDConnectProviderCollectionIterator) NextWithContext(ctx context.Context) (err error) { 6186 if tracing.IsEnabled() { 6187 ctx = tracing.StartSpan(ctx, fqdn+"/OpenIDConnectProviderCollectionIterator.NextWithContext") 6188 defer func() { 6189 sc := -1 6190 if iter.Response().Response.Response != nil { 6191 sc = iter.Response().Response.Response.StatusCode 6192 } 6193 tracing.EndSpan(ctx, sc, err) 6194 }() 6195 } 6196 iter.i++ 6197 if iter.i < len(iter.page.Values()) { 6198 return nil 6199 } 6200 err = iter.page.NextWithContext(ctx) 6201 if err != nil { 6202 iter.i-- 6203 return err 6204 } 6205 iter.i = 0 6206 return nil 6207} 6208 6209// Next advances to the next value. If there was an error making 6210// the request the iterator does not advance and the error is returned. 6211// Deprecated: Use NextWithContext() instead. 6212func (iter *OpenIDConnectProviderCollectionIterator) Next() error { 6213 return iter.NextWithContext(context.Background()) 6214} 6215 6216// NotDone returns true if the enumeration should be started or is not yet complete. 6217func (iter OpenIDConnectProviderCollectionIterator) NotDone() bool { 6218 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 6219} 6220 6221// Response returns the raw server response from the last page request. 6222func (iter OpenIDConnectProviderCollectionIterator) Response() OpenIDConnectProviderCollection { 6223 return iter.page.Response() 6224} 6225 6226// Value returns the current value or a zero-initialized value if the 6227// iterator has advanced beyond the end of the collection. 6228func (iter OpenIDConnectProviderCollectionIterator) Value() OpenidConnectProviderContract { 6229 if !iter.page.NotDone() { 6230 return OpenidConnectProviderContract{} 6231 } 6232 return iter.page.Values()[iter.i] 6233} 6234 6235// Creates a new instance of the OpenIDConnectProviderCollectionIterator type. 6236func NewOpenIDConnectProviderCollectionIterator(page OpenIDConnectProviderCollectionPage) OpenIDConnectProviderCollectionIterator { 6237 return OpenIDConnectProviderCollectionIterator{page: page} 6238} 6239 6240// IsEmpty returns true if the ListResult contains no values. 6241func (oicpc OpenIDConnectProviderCollection) IsEmpty() bool { 6242 return oicpc.Value == nil || len(*oicpc.Value) == 0 6243} 6244 6245// hasNextLink returns true if the NextLink is not empty. 6246func (oicpc OpenIDConnectProviderCollection) hasNextLink() bool { 6247 return oicpc.NextLink != nil && len(*oicpc.NextLink) != 0 6248} 6249 6250// openIDConnectProviderCollectionPreparer prepares a request to retrieve the next set of results. 6251// It returns nil if no more results exist. 6252func (oicpc OpenIDConnectProviderCollection) openIDConnectProviderCollectionPreparer(ctx context.Context) (*http.Request, error) { 6253 if !oicpc.hasNextLink() { 6254 return nil, nil 6255 } 6256 return autorest.Prepare((&http.Request{}).WithContext(ctx), 6257 autorest.AsJSON(), 6258 autorest.AsGet(), 6259 autorest.WithBaseURL(to.String(oicpc.NextLink))) 6260} 6261 6262// OpenIDConnectProviderCollectionPage contains a page of OpenidConnectProviderContract values. 6263type OpenIDConnectProviderCollectionPage struct { 6264 fn func(context.Context, OpenIDConnectProviderCollection) (OpenIDConnectProviderCollection, error) 6265 oicpc OpenIDConnectProviderCollection 6266} 6267 6268// NextWithContext advances to the next page of values. If there was an error making 6269// the request the page does not advance and the error is returned. 6270func (page *OpenIDConnectProviderCollectionPage) NextWithContext(ctx context.Context) (err error) { 6271 if tracing.IsEnabled() { 6272 ctx = tracing.StartSpan(ctx, fqdn+"/OpenIDConnectProviderCollectionPage.NextWithContext") 6273 defer func() { 6274 sc := -1 6275 if page.Response().Response.Response != nil { 6276 sc = page.Response().Response.Response.StatusCode 6277 } 6278 tracing.EndSpan(ctx, sc, err) 6279 }() 6280 } 6281 for { 6282 next, err := page.fn(ctx, page.oicpc) 6283 if err != nil { 6284 return err 6285 } 6286 page.oicpc = next 6287 if !next.hasNextLink() || !next.IsEmpty() { 6288 break 6289 } 6290 } 6291 return nil 6292} 6293 6294// Next advances to the next page of values. If there was an error making 6295// the request the page does not advance and the error is returned. 6296// Deprecated: Use NextWithContext() instead. 6297func (page *OpenIDConnectProviderCollectionPage) Next() error { 6298 return page.NextWithContext(context.Background()) 6299} 6300 6301// NotDone returns true if the page enumeration should be started or is not yet complete. 6302func (page OpenIDConnectProviderCollectionPage) NotDone() bool { 6303 return !page.oicpc.IsEmpty() 6304} 6305 6306// Response returns the raw server response from the last page request. 6307func (page OpenIDConnectProviderCollectionPage) Response() OpenIDConnectProviderCollection { 6308 return page.oicpc 6309} 6310 6311// Values returns the slice of values for the current page or nil if there are no values. 6312func (page OpenIDConnectProviderCollectionPage) Values() []OpenidConnectProviderContract { 6313 if page.oicpc.IsEmpty() { 6314 return nil 6315 } 6316 return *page.oicpc.Value 6317} 6318 6319// Creates a new instance of the OpenIDConnectProviderCollectionPage type. 6320func NewOpenIDConnectProviderCollectionPage(cur OpenIDConnectProviderCollection, getNextPage func(context.Context, OpenIDConnectProviderCollection) (OpenIDConnectProviderCollection, error)) OpenIDConnectProviderCollectionPage { 6321 return OpenIDConnectProviderCollectionPage{ 6322 fn: getNextPage, 6323 oicpc: cur, 6324 } 6325} 6326 6327// OpenidConnectProviderContract openId Connect Provider details. 6328type OpenidConnectProviderContract struct { 6329 autorest.Response `json:"-"` 6330 // OpenidConnectProviderContractProperties - OpenId Connect Provider contract properties. 6331 *OpenidConnectProviderContractProperties `json:"properties,omitempty"` 6332 // ID - READ-ONLY; Resource ID. 6333 ID *string `json:"id,omitempty"` 6334 // Name - READ-ONLY; Resource name. 6335 Name *string `json:"name,omitempty"` 6336 // Type - READ-ONLY; Resource type for API Management resource. 6337 Type *string `json:"type,omitempty"` 6338} 6339 6340// MarshalJSON is the custom marshaler for OpenidConnectProviderContract. 6341func (ocpc OpenidConnectProviderContract) MarshalJSON() ([]byte, error) { 6342 objectMap := make(map[string]interface{}) 6343 if ocpc.OpenidConnectProviderContractProperties != nil { 6344 objectMap["properties"] = ocpc.OpenidConnectProviderContractProperties 6345 } 6346 return json.Marshal(objectMap) 6347} 6348 6349// UnmarshalJSON is the custom unmarshaler for OpenidConnectProviderContract struct. 6350func (ocpc *OpenidConnectProviderContract) UnmarshalJSON(body []byte) error { 6351 var m map[string]*json.RawMessage 6352 err := json.Unmarshal(body, &m) 6353 if err != nil { 6354 return err 6355 } 6356 for k, v := range m { 6357 switch k { 6358 case "properties": 6359 if v != nil { 6360 var openidConnectProviderContractProperties OpenidConnectProviderContractProperties 6361 err = json.Unmarshal(*v, &openidConnectProviderContractProperties) 6362 if err != nil { 6363 return err 6364 } 6365 ocpc.OpenidConnectProviderContractProperties = &openidConnectProviderContractProperties 6366 } 6367 case "id": 6368 if v != nil { 6369 var ID string 6370 err = json.Unmarshal(*v, &ID) 6371 if err != nil { 6372 return err 6373 } 6374 ocpc.ID = &ID 6375 } 6376 case "name": 6377 if v != nil { 6378 var name string 6379 err = json.Unmarshal(*v, &name) 6380 if err != nil { 6381 return err 6382 } 6383 ocpc.Name = &name 6384 } 6385 case "type": 6386 if v != nil { 6387 var typeVar string 6388 err = json.Unmarshal(*v, &typeVar) 6389 if err != nil { 6390 return err 6391 } 6392 ocpc.Type = &typeVar 6393 } 6394 } 6395 } 6396 6397 return nil 6398} 6399 6400// OpenidConnectProviderContractProperties openID Connect Providers Contract. 6401type OpenidConnectProviderContractProperties struct { 6402 // DisplayName - User-friendly OpenID Connect Provider name. 6403 DisplayName *string `json:"displayName,omitempty"` 6404 // Description - User-friendly description of OpenID Connect Provider. 6405 Description *string `json:"description,omitempty"` 6406 // MetadataEndpoint - Metadata endpoint URI. 6407 MetadataEndpoint *string `json:"metadataEndpoint,omitempty"` 6408 // ClientID - Client ID of developer console which is the client application. 6409 ClientID *string `json:"clientId,omitempty"` 6410 // ClientSecret - Client Secret of developer console which is the client application. 6411 ClientSecret *string `json:"clientSecret,omitempty"` 6412} 6413 6414// OpenidConnectProviderUpdateContract parameters supplied to the Update OpenID Connect Provider operation. 6415type OpenidConnectProviderUpdateContract struct { 6416 // OpenidConnectProviderUpdateContractProperties - OpenId Connect Provider Update contract properties. 6417 *OpenidConnectProviderUpdateContractProperties `json:"properties,omitempty"` 6418} 6419 6420// MarshalJSON is the custom marshaler for OpenidConnectProviderUpdateContract. 6421func (ocpuc OpenidConnectProviderUpdateContract) MarshalJSON() ([]byte, error) { 6422 objectMap := make(map[string]interface{}) 6423 if ocpuc.OpenidConnectProviderUpdateContractProperties != nil { 6424 objectMap["properties"] = ocpuc.OpenidConnectProviderUpdateContractProperties 6425 } 6426 return json.Marshal(objectMap) 6427} 6428 6429// UnmarshalJSON is the custom unmarshaler for OpenidConnectProviderUpdateContract struct. 6430func (ocpuc *OpenidConnectProviderUpdateContract) UnmarshalJSON(body []byte) error { 6431 var m map[string]*json.RawMessage 6432 err := json.Unmarshal(body, &m) 6433 if err != nil { 6434 return err 6435 } 6436 for k, v := range m { 6437 switch k { 6438 case "properties": 6439 if v != nil { 6440 var openidConnectProviderUpdateContractProperties OpenidConnectProviderUpdateContractProperties 6441 err = json.Unmarshal(*v, &openidConnectProviderUpdateContractProperties) 6442 if err != nil { 6443 return err 6444 } 6445 ocpuc.OpenidConnectProviderUpdateContractProperties = &openidConnectProviderUpdateContractProperties 6446 } 6447 } 6448 } 6449 6450 return nil 6451} 6452 6453// OpenidConnectProviderUpdateContractProperties parameters supplied to the Update OpenID Connect Provider 6454// operation. 6455type OpenidConnectProviderUpdateContractProperties struct { 6456 // DisplayName - User-friendly OpenID Connect Provider name. 6457 DisplayName *string `json:"displayName,omitempty"` 6458 // Description - User-friendly description of OpenID Connect Provider. 6459 Description *string `json:"description,omitempty"` 6460 // MetadataEndpoint - Metadata endpoint URI. 6461 MetadataEndpoint *string `json:"metadataEndpoint,omitempty"` 6462 // ClientID - Client ID of developer console which is the client application. 6463 ClientID *string `json:"clientId,omitempty"` 6464 // ClientSecret - Client Secret of developer console which is the client application. 6465 ClientSecret *string `json:"clientSecret,omitempty"` 6466} 6467 6468// Operation REST API operation 6469type Operation struct { 6470 // Name - Operation name: {provider}/{resource}/{operation} 6471 Name *string `json:"name,omitempty"` 6472 // Display - The object that describes the operation. 6473 Display *OperationDisplay `json:"display,omitempty"` 6474 // Origin - The operation origin. 6475 Origin *string `json:"origin,omitempty"` 6476 // Properties - The operation properties. 6477 Properties interface{} `json:"properties,omitempty"` 6478} 6479 6480// OperationCollection paged Operation list representation. 6481type OperationCollection struct { 6482 autorest.Response `json:"-"` 6483 // Value - READ-ONLY; Page values. 6484 Value *[]OperationContract `json:"value,omitempty"` 6485 // NextLink - READ-ONLY; Next page link if any. 6486 NextLink *string `json:"nextLink,omitempty"` 6487} 6488 6489// MarshalJSON is the custom marshaler for OperationCollection. 6490func (oc OperationCollection) MarshalJSON() ([]byte, error) { 6491 objectMap := make(map[string]interface{}) 6492 return json.Marshal(objectMap) 6493} 6494 6495// OperationCollectionIterator provides access to a complete listing of OperationContract values. 6496type OperationCollectionIterator struct { 6497 i int 6498 page OperationCollectionPage 6499} 6500 6501// NextWithContext advances to the next value. If there was an error making 6502// the request the iterator does not advance and the error is returned. 6503func (iter *OperationCollectionIterator) NextWithContext(ctx context.Context) (err error) { 6504 if tracing.IsEnabled() { 6505 ctx = tracing.StartSpan(ctx, fqdn+"/OperationCollectionIterator.NextWithContext") 6506 defer func() { 6507 sc := -1 6508 if iter.Response().Response.Response != nil { 6509 sc = iter.Response().Response.Response.StatusCode 6510 } 6511 tracing.EndSpan(ctx, sc, err) 6512 }() 6513 } 6514 iter.i++ 6515 if iter.i < len(iter.page.Values()) { 6516 return nil 6517 } 6518 err = iter.page.NextWithContext(ctx) 6519 if err != nil { 6520 iter.i-- 6521 return err 6522 } 6523 iter.i = 0 6524 return nil 6525} 6526 6527// Next advances to the next value. If there was an error making 6528// the request the iterator does not advance and the error is returned. 6529// Deprecated: Use NextWithContext() instead. 6530func (iter *OperationCollectionIterator) Next() error { 6531 return iter.NextWithContext(context.Background()) 6532} 6533 6534// NotDone returns true if the enumeration should be started or is not yet complete. 6535func (iter OperationCollectionIterator) NotDone() bool { 6536 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 6537} 6538 6539// Response returns the raw server response from the last page request. 6540func (iter OperationCollectionIterator) Response() OperationCollection { 6541 return iter.page.Response() 6542} 6543 6544// Value returns the current value or a zero-initialized value if the 6545// iterator has advanced beyond the end of the collection. 6546func (iter OperationCollectionIterator) Value() OperationContract { 6547 if !iter.page.NotDone() { 6548 return OperationContract{} 6549 } 6550 return iter.page.Values()[iter.i] 6551} 6552 6553// Creates a new instance of the OperationCollectionIterator type. 6554func NewOperationCollectionIterator(page OperationCollectionPage) OperationCollectionIterator { 6555 return OperationCollectionIterator{page: page} 6556} 6557 6558// IsEmpty returns true if the ListResult contains no values. 6559func (oc OperationCollection) IsEmpty() bool { 6560 return oc.Value == nil || len(*oc.Value) == 0 6561} 6562 6563// hasNextLink returns true if the NextLink is not empty. 6564func (oc OperationCollection) hasNextLink() bool { 6565 return oc.NextLink != nil && len(*oc.NextLink) != 0 6566} 6567 6568// operationCollectionPreparer prepares a request to retrieve the next set of results. 6569// It returns nil if no more results exist. 6570func (oc OperationCollection) operationCollectionPreparer(ctx context.Context) (*http.Request, error) { 6571 if !oc.hasNextLink() { 6572 return nil, nil 6573 } 6574 return autorest.Prepare((&http.Request{}).WithContext(ctx), 6575 autorest.AsJSON(), 6576 autorest.AsGet(), 6577 autorest.WithBaseURL(to.String(oc.NextLink))) 6578} 6579 6580// OperationCollectionPage contains a page of OperationContract values. 6581type OperationCollectionPage struct { 6582 fn func(context.Context, OperationCollection) (OperationCollection, error) 6583 oc OperationCollection 6584} 6585 6586// NextWithContext advances to the next page of values. If there was an error making 6587// the request the page does not advance and the error is returned. 6588func (page *OperationCollectionPage) NextWithContext(ctx context.Context) (err error) { 6589 if tracing.IsEnabled() { 6590 ctx = tracing.StartSpan(ctx, fqdn+"/OperationCollectionPage.NextWithContext") 6591 defer func() { 6592 sc := -1 6593 if page.Response().Response.Response != nil { 6594 sc = page.Response().Response.Response.StatusCode 6595 } 6596 tracing.EndSpan(ctx, sc, err) 6597 }() 6598 } 6599 for { 6600 next, err := page.fn(ctx, page.oc) 6601 if err != nil { 6602 return err 6603 } 6604 page.oc = next 6605 if !next.hasNextLink() || !next.IsEmpty() { 6606 break 6607 } 6608 } 6609 return nil 6610} 6611 6612// Next advances to the next page of values. If there was an error making 6613// the request the page does not advance and the error is returned. 6614// Deprecated: Use NextWithContext() instead. 6615func (page *OperationCollectionPage) Next() error { 6616 return page.NextWithContext(context.Background()) 6617} 6618 6619// NotDone returns true if the page enumeration should be started or is not yet complete. 6620func (page OperationCollectionPage) NotDone() bool { 6621 return !page.oc.IsEmpty() 6622} 6623 6624// Response returns the raw server response from the last page request. 6625func (page OperationCollectionPage) Response() OperationCollection { 6626 return page.oc 6627} 6628 6629// Values returns the slice of values for the current page or nil if there are no values. 6630func (page OperationCollectionPage) Values() []OperationContract { 6631 if page.oc.IsEmpty() { 6632 return nil 6633 } 6634 return *page.oc.Value 6635} 6636 6637// Creates a new instance of the OperationCollectionPage type. 6638func NewOperationCollectionPage(cur OperationCollection, getNextPage func(context.Context, OperationCollection) (OperationCollection, error)) OperationCollectionPage { 6639 return OperationCollectionPage{ 6640 fn: getNextPage, 6641 oc: cur, 6642 } 6643} 6644 6645// OperationContract api Operation details. 6646type OperationContract struct { 6647 autorest.Response `json:"-"` 6648 // OperationContractProperties - Properties of the Operation Contract. 6649 *OperationContractProperties `json:"properties,omitempty"` 6650 // ID - READ-ONLY; Resource ID. 6651 ID *string `json:"id,omitempty"` 6652 // Name - READ-ONLY; Resource name. 6653 Name *string `json:"name,omitempty"` 6654 // Type - READ-ONLY; Resource type for API Management resource. 6655 Type *string `json:"type,omitempty"` 6656} 6657 6658// MarshalJSON is the custom marshaler for OperationContract. 6659func (oc OperationContract) MarshalJSON() ([]byte, error) { 6660 objectMap := make(map[string]interface{}) 6661 if oc.OperationContractProperties != nil { 6662 objectMap["properties"] = oc.OperationContractProperties 6663 } 6664 return json.Marshal(objectMap) 6665} 6666 6667// UnmarshalJSON is the custom unmarshaler for OperationContract struct. 6668func (oc *OperationContract) UnmarshalJSON(body []byte) error { 6669 var m map[string]*json.RawMessage 6670 err := json.Unmarshal(body, &m) 6671 if err != nil { 6672 return err 6673 } 6674 for k, v := range m { 6675 switch k { 6676 case "properties": 6677 if v != nil { 6678 var operationContractProperties OperationContractProperties 6679 err = json.Unmarshal(*v, &operationContractProperties) 6680 if err != nil { 6681 return err 6682 } 6683 oc.OperationContractProperties = &operationContractProperties 6684 } 6685 case "id": 6686 if v != nil { 6687 var ID string 6688 err = json.Unmarshal(*v, &ID) 6689 if err != nil { 6690 return err 6691 } 6692 oc.ID = &ID 6693 } 6694 case "name": 6695 if v != nil { 6696 var name string 6697 err = json.Unmarshal(*v, &name) 6698 if err != nil { 6699 return err 6700 } 6701 oc.Name = &name 6702 } 6703 case "type": 6704 if v != nil { 6705 var typeVar string 6706 err = json.Unmarshal(*v, &typeVar) 6707 if err != nil { 6708 return err 6709 } 6710 oc.Type = &typeVar 6711 } 6712 } 6713 } 6714 6715 return nil 6716} 6717 6718// OperationContractProperties operation Contract Properties 6719type OperationContractProperties struct { 6720 // DisplayName - Operation Name. 6721 DisplayName *string `json:"displayName,omitempty"` 6722 // Method - A Valid HTTP Operation Method. Typical Http Methods like GET, PUT, POST but not limited by only them. 6723 Method *string `json:"method,omitempty"` 6724 // URLTemplate - Relative URL template identifying the target resource for this operation. May include parameters. Example: /customers/{cid}/orders/{oid}/?date={date} 6725 URLTemplate *string `json:"urlTemplate,omitempty"` 6726 // TemplateParameters - Collection of URL template parameters. 6727 TemplateParameters *[]ParameterContract `json:"templateParameters,omitempty"` 6728 // Description - Description of the operation. May include HTML formatting tags. 6729 Description *string `json:"description,omitempty"` 6730 // Request - An entity containing request details. 6731 Request *RequestContract `json:"request,omitempty"` 6732 // Responses - Array of Operation responses. 6733 Responses *[]ResponseContract `json:"responses,omitempty"` 6734 // Policies - Operation Policies 6735 Policies *string `json:"policies,omitempty"` 6736} 6737 6738// OperationDisplay the object that describes the operation. 6739type OperationDisplay struct { 6740 // Provider - Friendly name of the resource provider 6741 Provider *string `json:"provider,omitempty"` 6742 // Operation - Operation type: read, write, delete, listKeys/action, etc. 6743 Operation *string `json:"operation,omitempty"` 6744 // Resource - Resource type on which the operation is performed. 6745 Resource *string `json:"resource,omitempty"` 6746 // Description - Friendly name of the operation 6747 Description *string `json:"description,omitempty"` 6748} 6749 6750// OperationEntityBaseContract api Operation Entity Base Contract details. 6751type OperationEntityBaseContract struct { 6752 // TemplateParameters - Collection of URL template parameters. 6753 TemplateParameters *[]ParameterContract `json:"templateParameters,omitempty"` 6754 // Description - Description of the operation. May include HTML formatting tags. 6755 Description *string `json:"description,omitempty"` 6756 // Request - An entity containing request details. 6757 Request *RequestContract `json:"request,omitempty"` 6758 // Responses - Array of Operation responses. 6759 Responses *[]ResponseContract `json:"responses,omitempty"` 6760 // Policies - Operation Policies 6761 Policies *string `json:"policies,omitempty"` 6762} 6763 6764// OperationListResult result of the request to list REST API operations. It contains a list of operations 6765// and a URL nextLink to get the next set of results. 6766type OperationListResult struct { 6767 autorest.Response `json:"-"` 6768 // Value - List of operations supported by the resource provider. 6769 Value *[]Operation `json:"value,omitempty"` 6770 // NextLink - URL to get the next set of operation list results if there are any. 6771 NextLink *string `json:"nextLink,omitempty"` 6772} 6773 6774// OperationListResultIterator provides access to a complete listing of Operation values. 6775type OperationListResultIterator struct { 6776 i int 6777 page OperationListResultPage 6778} 6779 6780// NextWithContext advances to the next value. If there was an error making 6781// the request the iterator does not advance and the error is returned. 6782func (iter *OperationListResultIterator) NextWithContext(ctx context.Context) (err error) { 6783 if tracing.IsEnabled() { 6784 ctx = tracing.StartSpan(ctx, fqdn+"/OperationListResultIterator.NextWithContext") 6785 defer func() { 6786 sc := -1 6787 if iter.Response().Response.Response != nil { 6788 sc = iter.Response().Response.Response.StatusCode 6789 } 6790 tracing.EndSpan(ctx, sc, err) 6791 }() 6792 } 6793 iter.i++ 6794 if iter.i < len(iter.page.Values()) { 6795 return nil 6796 } 6797 err = iter.page.NextWithContext(ctx) 6798 if err != nil { 6799 iter.i-- 6800 return err 6801 } 6802 iter.i = 0 6803 return nil 6804} 6805 6806// Next advances to the next value. If there was an error making 6807// the request the iterator does not advance and the error is returned. 6808// Deprecated: Use NextWithContext() instead. 6809func (iter *OperationListResultIterator) Next() error { 6810 return iter.NextWithContext(context.Background()) 6811} 6812 6813// NotDone returns true if the enumeration should be started or is not yet complete. 6814func (iter OperationListResultIterator) NotDone() bool { 6815 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 6816} 6817 6818// Response returns the raw server response from the last page request. 6819func (iter OperationListResultIterator) Response() OperationListResult { 6820 return iter.page.Response() 6821} 6822 6823// Value returns the current value or a zero-initialized value if the 6824// iterator has advanced beyond the end of the collection. 6825func (iter OperationListResultIterator) Value() Operation { 6826 if !iter.page.NotDone() { 6827 return Operation{} 6828 } 6829 return iter.page.Values()[iter.i] 6830} 6831 6832// Creates a new instance of the OperationListResultIterator type. 6833func NewOperationListResultIterator(page OperationListResultPage) OperationListResultIterator { 6834 return OperationListResultIterator{page: page} 6835} 6836 6837// IsEmpty returns true if the ListResult contains no values. 6838func (olr OperationListResult) IsEmpty() bool { 6839 return olr.Value == nil || len(*olr.Value) == 0 6840} 6841 6842// hasNextLink returns true if the NextLink is not empty. 6843func (olr OperationListResult) hasNextLink() bool { 6844 return olr.NextLink != nil && len(*olr.NextLink) != 0 6845} 6846 6847// operationListResultPreparer prepares a request to retrieve the next set of results. 6848// It returns nil if no more results exist. 6849func (olr OperationListResult) operationListResultPreparer(ctx context.Context) (*http.Request, error) { 6850 if !olr.hasNextLink() { 6851 return nil, nil 6852 } 6853 return autorest.Prepare((&http.Request{}).WithContext(ctx), 6854 autorest.AsJSON(), 6855 autorest.AsGet(), 6856 autorest.WithBaseURL(to.String(olr.NextLink))) 6857} 6858 6859// OperationListResultPage contains a page of Operation values. 6860type OperationListResultPage struct { 6861 fn func(context.Context, OperationListResult) (OperationListResult, error) 6862 olr OperationListResult 6863} 6864 6865// NextWithContext advances to the next page of values. If there was an error making 6866// the request the page does not advance and the error is returned. 6867func (page *OperationListResultPage) NextWithContext(ctx context.Context) (err error) { 6868 if tracing.IsEnabled() { 6869 ctx = tracing.StartSpan(ctx, fqdn+"/OperationListResultPage.NextWithContext") 6870 defer func() { 6871 sc := -1 6872 if page.Response().Response.Response != nil { 6873 sc = page.Response().Response.Response.StatusCode 6874 } 6875 tracing.EndSpan(ctx, sc, err) 6876 }() 6877 } 6878 for { 6879 next, err := page.fn(ctx, page.olr) 6880 if err != nil { 6881 return err 6882 } 6883 page.olr = next 6884 if !next.hasNextLink() || !next.IsEmpty() { 6885 break 6886 } 6887 } 6888 return nil 6889} 6890 6891// Next advances to the next page of values. If there was an error making 6892// the request the page does not advance and the error is returned. 6893// Deprecated: Use NextWithContext() instead. 6894func (page *OperationListResultPage) Next() error { 6895 return page.NextWithContext(context.Background()) 6896} 6897 6898// NotDone returns true if the page enumeration should be started or is not yet complete. 6899func (page OperationListResultPage) NotDone() bool { 6900 return !page.olr.IsEmpty() 6901} 6902 6903// Response returns the raw server response from the last page request. 6904func (page OperationListResultPage) Response() OperationListResult { 6905 return page.olr 6906} 6907 6908// Values returns the slice of values for the current page or nil if there are no values. 6909func (page OperationListResultPage) Values() []Operation { 6910 if page.olr.IsEmpty() { 6911 return nil 6912 } 6913 return *page.olr.Value 6914} 6915 6916// Creates a new instance of the OperationListResultPage type. 6917func NewOperationListResultPage(cur OperationListResult, getNextPage func(context.Context, OperationListResult) (OperationListResult, error)) OperationListResultPage { 6918 return OperationListResultPage{ 6919 fn: getNextPage, 6920 olr: cur, 6921 } 6922} 6923 6924// OperationResultContract operation Result. 6925type OperationResultContract struct { 6926 autorest.Response `json:"-"` 6927 // ID - Operation result identifier. 6928 ID *string `json:"id,omitempty"` 6929 // Status - Status of an async operation. Possible values include: 'Started', 'InProgress', 'Succeeded', 'Failed' 6930 Status AsyncOperationStatus `json:"status,omitempty"` 6931 // 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. 6932 Started *date.Time `json:"started,omitempty"` 6933 // 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. 6934 Updated *date.Time `json:"updated,omitempty"` 6935 // ResultInfo - Optional result info. 6936 ResultInfo *string `json:"resultInfo,omitempty"` 6937 // Error - Error Body Contract 6938 Error *ErrorResponseBody `json:"error,omitempty"` 6939 // ActionLog - READ-ONLY; This property if only provided as part of the TenantConfiguration_Validate operation. It contains the log the entities which will be updated/created/deleted as part of the TenantConfiguration_Deploy operation. 6940 ActionLog *[]OperationResultLogItemContract `json:"actionLog,omitempty"` 6941} 6942 6943// MarshalJSON is the custom marshaler for OperationResultContract. 6944func (orc OperationResultContract) MarshalJSON() ([]byte, error) { 6945 objectMap := make(map[string]interface{}) 6946 if orc.ID != nil { 6947 objectMap["id"] = orc.ID 6948 } 6949 if orc.Status != "" { 6950 objectMap["status"] = orc.Status 6951 } 6952 if orc.Started != nil { 6953 objectMap["started"] = orc.Started 6954 } 6955 if orc.Updated != nil { 6956 objectMap["updated"] = orc.Updated 6957 } 6958 if orc.ResultInfo != nil { 6959 objectMap["resultInfo"] = orc.ResultInfo 6960 } 6961 if orc.Error != nil { 6962 objectMap["error"] = orc.Error 6963 } 6964 return json.Marshal(objectMap) 6965} 6966 6967// OperationResultLogItemContract log of the entity being created, updated or deleted. 6968type OperationResultLogItemContract struct { 6969 // ObjectType - The type of entity contract. 6970 ObjectType *string `json:"objectType,omitempty"` 6971 // Action - Action like create/update/delete. 6972 Action *string `json:"action,omitempty"` 6973 // ObjectKey - Identifier of the entity being created/updated/deleted. 6974 ObjectKey *string `json:"objectKey,omitempty"` 6975} 6976 6977// OperationTagResourceContractProperties operation Entity contract Properties. 6978type OperationTagResourceContractProperties struct { 6979 // ID - Identifier of the operation in form /operations/{operationId}. 6980 ID *string `json:"id,omitempty"` 6981 // Name - READ-ONLY; Operation name. 6982 Name *string `json:"name,omitempty"` 6983 // APIName - READ-ONLY; Api Name. 6984 APIName *string `json:"apiName,omitempty"` 6985 // APIRevision - READ-ONLY; Api Revision. 6986 APIRevision *string `json:"apiRevision,omitempty"` 6987 // APIVersion - READ-ONLY; Api Version. 6988 APIVersion *string `json:"apiVersion,omitempty"` 6989 // Description - READ-ONLY; Operation Description. 6990 Description *string `json:"description,omitempty"` 6991 // Method - READ-ONLY; A Valid HTTP Operation Method. Typical Http Methods like GET, PUT, POST but not limited by only them. 6992 Method *string `json:"method,omitempty"` 6993 // URLTemplate - READ-ONLY; Relative URL template identifying the target resource for this operation. May include parameters. Example: /customers/{cid}/orders/{oid}/?date={date} 6994 URLTemplate *string `json:"urlTemplate,omitempty"` 6995} 6996 6997// MarshalJSON is the custom marshaler for OperationTagResourceContractProperties. 6998func (otrcp OperationTagResourceContractProperties) MarshalJSON() ([]byte, error) { 6999 objectMap := make(map[string]interface{}) 7000 if otrcp.ID != nil { 7001 objectMap["id"] = otrcp.ID 7002 } 7003 return json.Marshal(objectMap) 7004} 7005 7006// OperationUpdateContract api Operation Update Contract details. 7007type OperationUpdateContract struct { 7008 // OperationUpdateContractProperties - Properties of the API Operation entity that can be updated. 7009 *OperationUpdateContractProperties `json:"properties,omitempty"` 7010} 7011 7012// MarshalJSON is the custom marshaler for OperationUpdateContract. 7013func (ouc OperationUpdateContract) MarshalJSON() ([]byte, error) { 7014 objectMap := make(map[string]interface{}) 7015 if ouc.OperationUpdateContractProperties != nil { 7016 objectMap["properties"] = ouc.OperationUpdateContractProperties 7017 } 7018 return json.Marshal(objectMap) 7019} 7020 7021// UnmarshalJSON is the custom unmarshaler for OperationUpdateContract struct. 7022func (ouc *OperationUpdateContract) UnmarshalJSON(body []byte) error { 7023 var m map[string]*json.RawMessage 7024 err := json.Unmarshal(body, &m) 7025 if err != nil { 7026 return err 7027 } 7028 for k, v := range m { 7029 switch k { 7030 case "properties": 7031 if v != nil { 7032 var operationUpdateContractProperties OperationUpdateContractProperties 7033 err = json.Unmarshal(*v, &operationUpdateContractProperties) 7034 if err != nil { 7035 return err 7036 } 7037 ouc.OperationUpdateContractProperties = &operationUpdateContractProperties 7038 } 7039 } 7040 } 7041 7042 return nil 7043} 7044 7045// OperationUpdateContractProperties operation Update Contract Properties. 7046type OperationUpdateContractProperties struct { 7047 // DisplayName - Operation Name. 7048 DisplayName *string `json:"displayName,omitempty"` 7049 // Method - A Valid HTTP Operation Method. Typical Http Methods like GET, PUT, POST but not limited by only them. 7050 Method *string `json:"method,omitempty"` 7051 // URLTemplate - Relative URL template identifying the target resource for this operation. May include parameters. Example: /customers/{cid}/orders/{oid}/?date={date} 7052 URLTemplate *string `json:"urlTemplate,omitempty"` 7053 // TemplateParameters - Collection of URL template parameters. 7054 TemplateParameters *[]ParameterContract `json:"templateParameters,omitempty"` 7055 // Description - Description of the operation. May include HTML formatting tags. 7056 Description *string `json:"description,omitempty"` 7057 // Request - An entity containing request details. 7058 Request *RequestContract `json:"request,omitempty"` 7059 // Responses - Array of Operation responses. 7060 Responses *[]ResponseContract `json:"responses,omitempty"` 7061 // Policies - Operation Policies 7062 Policies *string `json:"policies,omitempty"` 7063} 7064 7065// ParameterContract operation parameters details. 7066type ParameterContract struct { 7067 // Name - Parameter name. 7068 Name *string `json:"name,omitempty"` 7069 // Description - Parameter description. 7070 Description *string `json:"description,omitempty"` 7071 // Type - Parameter type. 7072 Type *string `json:"type,omitempty"` 7073 // DefaultValue - Default parameter value. 7074 DefaultValue *string `json:"defaultValue,omitempty"` 7075 // Required - Specifies whether parameter is required or not. 7076 Required *bool `json:"required,omitempty"` 7077 // Values - Parameter values. 7078 Values *[]string `json:"values,omitempty"` 7079} 7080 7081// PipelineDiagnosticSettings diagnostic settings for incoming/outgoing HTTP messages to the Gateway. 7082type PipelineDiagnosticSettings struct { 7083 // Request - Diagnostic settings for request. 7084 Request *HTTPMessageDiagnostic `json:"request,omitempty"` 7085 // Response - Diagnostic settings for response. 7086 Response *HTTPMessageDiagnostic `json:"response,omitempty"` 7087} 7088 7089// PolicyCollection the response of the list policy operation. 7090type PolicyCollection struct { 7091 autorest.Response `json:"-"` 7092 // Value - Policy Contract value. 7093 Value *[]PolicyContract `json:"value,omitempty"` 7094 // NextLink - Next page link if any. 7095 NextLink *string `json:"nextLink,omitempty"` 7096} 7097 7098// PolicyContract policy Contract details. 7099type PolicyContract struct { 7100 autorest.Response `json:"-"` 7101 // PolicyContractProperties - Properties of the Policy. 7102 *PolicyContractProperties `json:"properties,omitempty"` 7103 // ID - READ-ONLY; Resource ID. 7104 ID *string `json:"id,omitempty"` 7105 // Name - READ-ONLY; Resource name. 7106 Name *string `json:"name,omitempty"` 7107 // Type - READ-ONLY; Resource type for API Management resource. 7108 Type *string `json:"type,omitempty"` 7109} 7110 7111// MarshalJSON is the custom marshaler for PolicyContract. 7112func (pc PolicyContract) MarshalJSON() ([]byte, error) { 7113 objectMap := make(map[string]interface{}) 7114 if pc.PolicyContractProperties != nil { 7115 objectMap["properties"] = pc.PolicyContractProperties 7116 } 7117 return json.Marshal(objectMap) 7118} 7119 7120// UnmarshalJSON is the custom unmarshaler for PolicyContract struct. 7121func (pc *PolicyContract) UnmarshalJSON(body []byte) error { 7122 var m map[string]*json.RawMessage 7123 err := json.Unmarshal(body, &m) 7124 if err != nil { 7125 return err 7126 } 7127 for k, v := range m { 7128 switch k { 7129 case "properties": 7130 if v != nil { 7131 var policyContractProperties PolicyContractProperties 7132 err = json.Unmarshal(*v, &policyContractProperties) 7133 if err != nil { 7134 return err 7135 } 7136 pc.PolicyContractProperties = &policyContractProperties 7137 } 7138 case "id": 7139 if v != nil { 7140 var ID string 7141 err = json.Unmarshal(*v, &ID) 7142 if err != nil { 7143 return err 7144 } 7145 pc.ID = &ID 7146 } 7147 case "name": 7148 if v != nil { 7149 var name string 7150 err = json.Unmarshal(*v, &name) 7151 if err != nil { 7152 return err 7153 } 7154 pc.Name = &name 7155 } 7156 case "type": 7157 if v != nil { 7158 var typeVar string 7159 err = json.Unmarshal(*v, &typeVar) 7160 if err != nil { 7161 return err 7162 } 7163 pc.Type = &typeVar 7164 } 7165 } 7166 } 7167 7168 return nil 7169} 7170 7171// PolicyContractProperties policy contract Properties. 7172type PolicyContractProperties struct { 7173 // Value - Contents of the Policy as defined by the format. 7174 Value *string `json:"value,omitempty"` 7175 // Format - Format of the policyContent. Possible values include: 'XML', 'XMLLink', 'Rawxml', 'RawxmlLink' 7176 Format PolicyContentFormat `json:"format,omitempty"` 7177} 7178 7179// PolicySnippetContract policy snippet. 7180type PolicySnippetContract struct { 7181 // Name - READ-ONLY; Snippet name. 7182 Name *string `json:"name,omitempty"` 7183 // Content - READ-ONLY; Snippet content. 7184 Content *string `json:"content,omitempty"` 7185 // ToolTip - READ-ONLY; Snippet toolTip. 7186 ToolTip *string `json:"toolTip,omitempty"` 7187 // Scope - READ-ONLY; Binary OR value of the Snippet scope. 7188 Scope *int32 `json:"scope,omitempty"` 7189} 7190 7191// MarshalJSON is the custom marshaler for PolicySnippetContract. 7192func (psc PolicySnippetContract) MarshalJSON() ([]byte, error) { 7193 objectMap := make(map[string]interface{}) 7194 return json.Marshal(objectMap) 7195} 7196 7197// PolicySnippetsCollection the response of the list policy snippets operation. 7198type PolicySnippetsCollection struct { 7199 autorest.Response `json:"-"` 7200 // Value - Policy snippet value. 7201 Value *[]PolicySnippetContract `json:"value,omitempty"` 7202} 7203 7204// PortalDelegationSettings delegation settings for a developer portal. 7205type PortalDelegationSettings struct { 7206 autorest.Response `json:"-"` 7207 // PortalDelegationSettingsProperties - Delegation settings contract properties. 7208 *PortalDelegationSettingsProperties `json:"properties,omitempty"` 7209 // ID - READ-ONLY; Resource ID. 7210 ID *string `json:"id,omitempty"` 7211 // Name - READ-ONLY; Resource name. 7212 Name *string `json:"name,omitempty"` 7213 // Type - READ-ONLY; Resource type for API Management resource. 7214 Type *string `json:"type,omitempty"` 7215} 7216 7217// MarshalJSON is the custom marshaler for PortalDelegationSettings. 7218func (pds PortalDelegationSettings) MarshalJSON() ([]byte, error) { 7219 objectMap := make(map[string]interface{}) 7220 if pds.PortalDelegationSettingsProperties != nil { 7221 objectMap["properties"] = pds.PortalDelegationSettingsProperties 7222 } 7223 return json.Marshal(objectMap) 7224} 7225 7226// UnmarshalJSON is the custom unmarshaler for PortalDelegationSettings struct. 7227func (pds *PortalDelegationSettings) UnmarshalJSON(body []byte) error { 7228 var m map[string]*json.RawMessage 7229 err := json.Unmarshal(body, &m) 7230 if err != nil { 7231 return err 7232 } 7233 for k, v := range m { 7234 switch k { 7235 case "properties": 7236 if v != nil { 7237 var portalDelegationSettingsProperties PortalDelegationSettingsProperties 7238 err = json.Unmarshal(*v, &portalDelegationSettingsProperties) 7239 if err != nil { 7240 return err 7241 } 7242 pds.PortalDelegationSettingsProperties = &portalDelegationSettingsProperties 7243 } 7244 case "id": 7245 if v != nil { 7246 var ID string 7247 err = json.Unmarshal(*v, &ID) 7248 if err != nil { 7249 return err 7250 } 7251 pds.ID = &ID 7252 } 7253 case "name": 7254 if v != nil { 7255 var name string 7256 err = json.Unmarshal(*v, &name) 7257 if err != nil { 7258 return err 7259 } 7260 pds.Name = &name 7261 } 7262 case "type": 7263 if v != nil { 7264 var typeVar string 7265 err = json.Unmarshal(*v, &typeVar) 7266 if err != nil { 7267 return err 7268 } 7269 pds.Type = &typeVar 7270 } 7271 } 7272 } 7273 7274 return nil 7275} 7276 7277// PortalDelegationSettingsProperties delegation settings contract properties. 7278type PortalDelegationSettingsProperties struct { 7279 // URL - A delegation Url. 7280 URL *string `json:"url,omitempty"` 7281 // ValidationKey - A base64-encoded validation key to validate, that a request is coming from Azure API Management. 7282 ValidationKey *string `json:"validationKey,omitempty"` 7283 // Subscriptions - Subscriptions delegation settings. 7284 Subscriptions *SubscriptionsDelegationSettingsProperties `json:"subscriptions,omitempty"` 7285 // UserRegistration - User registration delegation settings. 7286 UserRegistration *RegistrationDelegationSettingsProperties `json:"userRegistration,omitempty"` 7287} 7288 7289// PortalSigninSettingProperties sign-in settings contract properties. 7290type PortalSigninSettingProperties struct { 7291 // Enabled - Redirect Anonymous users to the Sign-In page. 7292 Enabled *bool `json:"enabled,omitempty"` 7293} 7294 7295// PortalSigninSettings sign-In settings for the Developer Portal. 7296type PortalSigninSettings struct { 7297 autorest.Response `json:"-"` 7298 // PortalSigninSettingProperties - Sign-in settings contract properties. 7299 *PortalSigninSettingProperties `json:"properties,omitempty"` 7300 // ID - READ-ONLY; Resource ID. 7301 ID *string `json:"id,omitempty"` 7302 // Name - READ-ONLY; Resource name. 7303 Name *string `json:"name,omitempty"` 7304 // Type - READ-ONLY; Resource type for API Management resource. 7305 Type *string `json:"type,omitempty"` 7306} 7307 7308// MarshalJSON is the custom marshaler for PortalSigninSettings. 7309func (pss PortalSigninSettings) MarshalJSON() ([]byte, error) { 7310 objectMap := make(map[string]interface{}) 7311 if pss.PortalSigninSettingProperties != nil { 7312 objectMap["properties"] = pss.PortalSigninSettingProperties 7313 } 7314 return json.Marshal(objectMap) 7315} 7316 7317// UnmarshalJSON is the custom unmarshaler for PortalSigninSettings struct. 7318func (pss *PortalSigninSettings) UnmarshalJSON(body []byte) error { 7319 var m map[string]*json.RawMessage 7320 err := json.Unmarshal(body, &m) 7321 if err != nil { 7322 return err 7323 } 7324 for k, v := range m { 7325 switch k { 7326 case "properties": 7327 if v != nil { 7328 var portalSigninSettingProperties PortalSigninSettingProperties 7329 err = json.Unmarshal(*v, &portalSigninSettingProperties) 7330 if err != nil { 7331 return err 7332 } 7333 pss.PortalSigninSettingProperties = &portalSigninSettingProperties 7334 } 7335 case "id": 7336 if v != nil { 7337 var ID string 7338 err = json.Unmarshal(*v, &ID) 7339 if err != nil { 7340 return err 7341 } 7342 pss.ID = &ID 7343 } 7344 case "name": 7345 if v != nil { 7346 var name string 7347 err = json.Unmarshal(*v, &name) 7348 if err != nil { 7349 return err 7350 } 7351 pss.Name = &name 7352 } 7353 case "type": 7354 if v != nil { 7355 var typeVar string 7356 err = json.Unmarshal(*v, &typeVar) 7357 if err != nil { 7358 return err 7359 } 7360 pss.Type = &typeVar 7361 } 7362 } 7363 } 7364 7365 return nil 7366} 7367 7368// PortalSignupSettings sign-Up settings for a developer portal. 7369type PortalSignupSettings struct { 7370 autorest.Response `json:"-"` 7371 // PortalSignupSettingsProperties - Sign-up settings contract properties. 7372 *PortalSignupSettingsProperties `json:"properties,omitempty"` 7373 // ID - READ-ONLY; Resource ID. 7374 ID *string `json:"id,omitempty"` 7375 // Name - READ-ONLY; Resource name. 7376 Name *string `json:"name,omitempty"` 7377 // Type - READ-ONLY; Resource type for API Management resource. 7378 Type *string `json:"type,omitempty"` 7379} 7380 7381// MarshalJSON is the custom marshaler for PortalSignupSettings. 7382func (pss PortalSignupSettings) MarshalJSON() ([]byte, error) { 7383 objectMap := make(map[string]interface{}) 7384 if pss.PortalSignupSettingsProperties != nil { 7385 objectMap["properties"] = pss.PortalSignupSettingsProperties 7386 } 7387 return json.Marshal(objectMap) 7388} 7389 7390// UnmarshalJSON is the custom unmarshaler for PortalSignupSettings struct. 7391func (pss *PortalSignupSettings) UnmarshalJSON(body []byte) error { 7392 var m map[string]*json.RawMessage 7393 err := json.Unmarshal(body, &m) 7394 if err != nil { 7395 return err 7396 } 7397 for k, v := range m { 7398 switch k { 7399 case "properties": 7400 if v != nil { 7401 var portalSignupSettingsProperties PortalSignupSettingsProperties 7402 err = json.Unmarshal(*v, &portalSignupSettingsProperties) 7403 if err != nil { 7404 return err 7405 } 7406 pss.PortalSignupSettingsProperties = &portalSignupSettingsProperties 7407 } 7408 case "id": 7409 if v != nil { 7410 var ID string 7411 err = json.Unmarshal(*v, &ID) 7412 if err != nil { 7413 return err 7414 } 7415 pss.ID = &ID 7416 } 7417 case "name": 7418 if v != nil { 7419 var name string 7420 err = json.Unmarshal(*v, &name) 7421 if err != nil { 7422 return err 7423 } 7424 pss.Name = &name 7425 } 7426 case "type": 7427 if v != nil { 7428 var typeVar string 7429 err = json.Unmarshal(*v, &typeVar) 7430 if err != nil { 7431 return err 7432 } 7433 pss.Type = &typeVar 7434 } 7435 } 7436 } 7437 7438 return nil 7439} 7440 7441// PortalSignupSettingsProperties sign-up settings contract properties. 7442type PortalSignupSettingsProperties struct { 7443 // Enabled - Allow users to sign up on a developer portal. 7444 Enabled *bool `json:"enabled,omitempty"` 7445 // TermsOfService - Terms of service contract properties. 7446 TermsOfService *TermsOfServiceProperties `json:"termsOfService,omitempty"` 7447} 7448 7449// ProductCollection paged Products list representation. 7450type ProductCollection struct { 7451 autorest.Response `json:"-"` 7452 // Value - Page values. 7453 Value *[]ProductContract `json:"value,omitempty"` 7454 // NextLink - Next page link if any. 7455 NextLink *string `json:"nextLink,omitempty"` 7456} 7457 7458// ProductCollectionIterator provides access to a complete listing of ProductContract values. 7459type ProductCollectionIterator struct { 7460 i int 7461 page ProductCollectionPage 7462} 7463 7464// NextWithContext advances to the next value. If there was an error making 7465// the request the iterator does not advance and the error is returned. 7466func (iter *ProductCollectionIterator) NextWithContext(ctx context.Context) (err error) { 7467 if tracing.IsEnabled() { 7468 ctx = tracing.StartSpan(ctx, fqdn+"/ProductCollectionIterator.NextWithContext") 7469 defer func() { 7470 sc := -1 7471 if iter.Response().Response.Response != nil { 7472 sc = iter.Response().Response.Response.StatusCode 7473 } 7474 tracing.EndSpan(ctx, sc, err) 7475 }() 7476 } 7477 iter.i++ 7478 if iter.i < len(iter.page.Values()) { 7479 return nil 7480 } 7481 err = iter.page.NextWithContext(ctx) 7482 if err != nil { 7483 iter.i-- 7484 return err 7485 } 7486 iter.i = 0 7487 return nil 7488} 7489 7490// Next advances to the next value. If there was an error making 7491// the request the iterator does not advance and the error is returned. 7492// Deprecated: Use NextWithContext() instead. 7493func (iter *ProductCollectionIterator) Next() error { 7494 return iter.NextWithContext(context.Background()) 7495} 7496 7497// NotDone returns true if the enumeration should be started or is not yet complete. 7498func (iter ProductCollectionIterator) NotDone() bool { 7499 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 7500} 7501 7502// Response returns the raw server response from the last page request. 7503func (iter ProductCollectionIterator) Response() ProductCollection { 7504 return iter.page.Response() 7505} 7506 7507// Value returns the current value or a zero-initialized value if the 7508// iterator has advanced beyond the end of the collection. 7509func (iter ProductCollectionIterator) Value() ProductContract { 7510 if !iter.page.NotDone() { 7511 return ProductContract{} 7512 } 7513 return iter.page.Values()[iter.i] 7514} 7515 7516// Creates a new instance of the ProductCollectionIterator type. 7517func NewProductCollectionIterator(page ProductCollectionPage) ProductCollectionIterator { 7518 return ProductCollectionIterator{page: page} 7519} 7520 7521// IsEmpty returns true if the ListResult contains no values. 7522func (pc ProductCollection) IsEmpty() bool { 7523 return pc.Value == nil || len(*pc.Value) == 0 7524} 7525 7526// hasNextLink returns true if the NextLink is not empty. 7527func (pc ProductCollection) hasNextLink() bool { 7528 return pc.NextLink != nil && len(*pc.NextLink) != 0 7529} 7530 7531// productCollectionPreparer prepares a request to retrieve the next set of results. 7532// It returns nil if no more results exist. 7533func (pc ProductCollection) productCollectionPreparer(ctx context.Context) (*http.Request, error) { 7534 if !pc.hasNextLink() { 7535 return nil, nil 7536 } 7537 return autorest.Prepare((&http.Request{}).WithContext(ctx), 7538 autorest.AsJSON(), 7539 autorest.AsGet(), 7540 autorest.WithBaseURL(to.String(pc.NextLink))) 7541} 7542 7543// ProductCollectionPage contains a page of ProductContract values. 7544type ProductCollectionPage struct { 7545 fn func(context.Context, ProductCollection) (ProductCollection, error) 7546 pc ProductCollection 7547} 7548 7549// NextWithContext advances to the next page of values. If there was an error making 7550// the request the page does not advance and the error is returned. 7551func (page *ProductCollectionPage) NextWithContext(ctx context.Context) (err error) { 7552 if tracing.IsEnabled() { 7553 ctx = tracing.StartSpan(ctx, fqdn+"/ProductCollectionPage.NextWithContext") 7554 defer func() { 7555 sc := -1 7556 if page.Response().Response.Response != nil { 7557 sc = page.Response().Response.Response.StatusCode 7558 } 7559 tracing.EndSpan(ctx, sc, err) 7560 }() 7561 } 7562 for { 7563 next, err := page.fn(ctx, page.pc) 7564 if err != nil { 7565 return err 7566 } 7567 page.pc = next 7568 if !next.hasNextLink() || !next.IsEmpty() { 7569 break 7570 } 7571 } 7572 return nil 7573} 7574 7575// Next advances to the next page of values. If there was an error making 7576// the request the page does not advance and the error is returned. 7577// Deprecated: Use NextWithContext() instead. 7578func (page *ProductCollectionPage) Next() error { 7579 return page.NextWithContext(context.Background()) 7580} 7581 7582// NotDone returns true if the page enumeration should be started or is not yet complete. 7583func (page ProductCollectionPage) NotDone() bool { 7584 return !page.pc.IsEmpty() 7585} 7586 7587// Response returns the raw server response from the last page request. 7588func (page ProductCollectionPage) Response() ProductCollection { 7589 return page.pc 7590} 7591 7592// Values returns the slice of values for the current page or nil if there are no values. 7593func (page ProductCollectionPage) Values() []ProductContract { 7594 if page.pc.IsEmpty() { 7595 return nil 7596 } 7597 return *page.pc.Value 7598} 7599 7600// Creates a new instance of the ProductCollectionPage type. 7601func NewProductCollectionPage(cur ProductCollection, getNextPage func(context.Context, ProductCollection) (ProductCollection, error)) ProductCollectionPage { 7602 return ProductCollectionPage{ 7603 fn: getNextPage, 7604 pc: cur, 7605 } 7606} 7607 7608// ProductContract product details. 7609type ProductContract struct { 7610 autorest.Response `json:"-"` 7611 // ProductContractProperties - Product entity contract properties. 7612 *ProductContractProperties `json:"properties,omitempty"` 7613 // ID - READ-ONLY; Resource ID. 7614 ID *string `json:"id,omitempty"` 7615 // Name - READ-ONLY; Resource name. 7616 Name *string `json:"name,omitempty"` 7617 // Type - READ-ONLY; Resource type for API Management resource. 7618 Type *string `json:"type,omitempty"` 7619} 7620 7621// MarshalJSON is the custom marshaler for ProductContract. 7622func (pc ProductContract) MarshalJSON() ([]byte, error) { 7623 objectMap := make(map[string]interface{}) 7624 if pc.ProductContractProperties != nil { 7625 objectMap["properties"] = pc.ProductContractProperties 7626 } 7627 return json.Marshal(objectMap) 7628} 7629 7630// UnmarshalJSON is the custom unmarshaler for ProductContract struct. 7631func (pc *ProductContract) UnmarshalJSON(body []byte) error { 7632 var m map[string]*json.RawMessage 7633 err := json.Unmarshal(body, &m) 7634 if err != nil { 7635 return err 7636 } 7637 for k, v := range m { 7638 switch k { 7639 case "properties": 7640 if v != nil { 7641 var productContractProperties ProductContractProperties 7642 err = json.Unmarshal(*v, &productContractProperties) 7643 if err != nil { 7644 return err 7645 } 7646 pc.ProductContractProperties = &productContractProperties 7647 } 7648 case "id": 7649 if v != nil { 7650 var ID string 7651 err = json.Unmarshal(*v, &ID) 7652 if err != nil { 7653 return err 7654 } 7655 pc.ID = &ID 7656 } 7657 case "name": 7658 if v != nil { 7659 var name string 7660 err = json.Unmarshal(*v, &name) 7661 if err != nil { 7662 return err 7663 } 7664 pc.Name = &name 7665 } 7666 case "type": 7667 if v != nil { 7668 var typeVar string 7669 err = json.Unmarshal(*v, &typeVar) 7670 if err != nil { 7671 return err 7672 } 7673 pc.Type = &typeVar 7674 } 7675 } 7676 } 7677 7678 return nil 7679} 7680 7681// ProductContractProperties product profile. 7682type ProductContractProperties struct { 7683 // DisplayName - Product name. 7684 DisplayName *string `json:"displayName,omitempty"` 7685 // Description - Product description. May include HTML formatting tags. 7686 Description *string `json:"description,omitempty"` 7687 // 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. 7688 Terms *string `json:"terms,omitempty"` 7689 // 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. 7690 SubscriptionRequired *bool `json:"subscriptionRequired,omitempty"` 7691 // 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 true. 7692 ApprovalRequired *bool `json:"approvalRequired,omitempty"` 7693 // 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 true. 7694 SubscriptionsLimit *int32 `json:"subscriptionsLimit,omitempty"` 7695 // 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' 7696 State ProductState `json:"state,omitempty"` 7697} 7698 7699// ProductEntityBaseParameters product Entity Base Parameters 7700type ProductEntityBaseParameters struct { 7701 // Description - Product description. May include HTML formatting tags. 7702 Description *string `json:"description,omitempty"` 7703 // Terms - Product terms of use. Developers trying to subscribe to the product will be presented and required to accept these terms before they can complete the subscription process. 7704 Terms *string `json:"terms,omitempty"` 7705 // SubscriptionRequired - Whether a product subscription is required for accessing APIs included in this product. If true, the product is referred to as "protected" and a valid subscription key is required for a request to an API included in the product to succeed. If false, the product is referred to as "open" and requests to an API included in the product can be made without a subscription key. If property is omitted when creating a new product it's value is assumed to be true. 7706 SubscriptionRequired *bool `json:"subscriptionRequired,omitempty"` 7707 // ApprovalRequired - whether subscription approval is required. If false, new subscriptions will be approved automatically enabling developers to call the product’s APIs immediately after subscribing. If true, administrators must manually approve the subscription before the developer can any of the product’s APIs. Can be present only if subscriptionRequired property is present and has a value of true. 7708 ApprovalRequired *bool `json:"approvalRequired,omitempty"` 7709 // SubscriptionsLimit - Whether the number of subscriptions a user can have to this product at the same time. Set to null or omit to allow unlimited per user subscriptions. Can be present only if subscriptionRequired property is present and has a value of true. 7710 SubscriptionsLimit *int32 `json:"subscriptionsLimit,omitempty"` 7711 // State - whether product is published or not. Published products are discoverable by users of developer portal. Non published products are visible only to administrators. Default state of Product is notPublished. Possible values include: 'NotPublished', 'Published' 7712 State ProductState `json:"state,omitempty"` 7713} 7714 7715// ProductTagResourceContractProperties product profile. 7716type ProductTagResourceContractProperties struct { 7717 // ID - Identifier of the product in the form of /products/{productId} 7718 ID *string `json:"id,omitempty"` 7719 // Name - Product name. 7720 Name *string `json:"name,omitempty"` 7721 // Description - Product description. May include HTML formatting tags. 7722 Description *string `json:"description,omitempty"` 7723 // 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. 7724 Terms *string `json:"terms,omitempty"` 7725 // 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. 7726 SubscriptionRequired *bool `json:"subscriptionRequired,omitempty"` 7727 // 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 true. 7728 ApprovalRequired *bool `json:"approvalRequired,omitempty"` 7729 // 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 true. 7730 SubscriptionsLimit *int32 `json:"subscriptionsLimit,omitempty"` 7731 // 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' 7732 State ProductState `json:"state,omitempty"` 7733} 7734 7735// ProductUpdateParameters product Update parameters. 7736type ProductUpdateParameters struct { 7737 // ProductUpdateProperties - Product entity Update contract properties. 7738 *ProductUpdateProperties `json:"properties,omitempty"` 7739} 7740 7741// MarshalJSON is the custom marshaler for ProductUpdateParameters. 7742func (pup ProductUpdateParameters) MarshalJSON() ([]byte, error) { 7743 objectMap := make(map[string]interface{}) 7744 if pup.ProductUpdateProperties != nil { 7745 objectMap["properties"] = pup.ProductUpdateProperties 7746 } 7747 return json.Marshal(objectMap) 7748} 7749 7750// UnmarshalJSON is the custom unmarshaler for ProductUpdateParameters struct. 7751func (pup *ProductUpdateParameters) UnmarshalJSON(body []byte) error { 7752 var m map[string]*json.RawMessage 7753 err := json.Unmarshal(body, &m) 7754 if err != nil { 7755 return err 7756 } 7757 for k, v := range m { 7758 switch k { 7759 case "properties": 7760 if v != nil { 7761 var productUpdateProperties ProductUpdateProperties 7762 err = json.Unmarshal(*v, &productUpdateProperties) 7763 if err != nil { 7764 return err 7765 } 7766 pup.ProductUpdateProperties = &productUpdateProperties 7767 } 7768 } 7769 } 7770 7771 return nil 7772} 7773 7774// ProductUpdateProperties parameters supplied to the Update Product operation. 7775type ProductUpdateProperties struct { 7776 // DisplayName - Product name. 7777 DisplayName *string `json:"displayName,omitempty"` 7778 // Description - Product description. May include HTML formatting tags. 7779 Description *string `json:"description,omitempty"` 7780 // 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. 7781 Terms *string `json:"terms,omitempty"` 7782 // 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. 7783 SubscriptionRequired *bool `json:"subscriptionRequired,omitempty"` 7784 // 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 true. 7785 ApprovalRequired *bool `json:"approvalRequired,omitempty"` 7786 // 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 true. 7787 SubscriptionsLimit *int32 `json:"subscriptionsLimit,omitempty"` 7788 // 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' 7789 State ProductState `json:"state,omitempty"` 7790} 7791 7792// PropertyCollection paged Property list representation. 7793type PropertyCollection struct { 7794 autorest.Response `json:"-"` 7795 // Value - Page values. 7796 Value *[]PropertyContract `json:"value,omitempty"` 7797 // NextLink - Next page link if any. 7798 NextLink *string `json:"nextLink,omitempty"` 7799} 7800 7801// PropertyCollectionIterator provides access to a complete listing of PropertyContract values. 7802type PropertyCollectionIterator struct { 7803 i int 7804 page PropertyCollectionPage 7805} 7806 7807// NextWithContext advances to the next value. If there was an error making 7808// the request the iterator does not advance and the error is returned. 7809func (iter *PropertyCollectionIterator) NextWithContext(ctx context.Context) (err error) { 7810 if tracing.IsEnabled() { 7811 ctx = tracing.StartSpan(ctx, fqdn+"/PropertyCollectionIterator.NextWithContext") 7812 defer func() { 7813 sc := -1 7814 if iter.Response().Response.Response != nil { 7815 sc = iter.Response().Response.Response.StatusCode 7816 } 7817 tracing.EndSpan(ctx, sc, err) 7818 }() 7819 } 7820 iter.i++ 7821 if iter.i < len(iter.page.Values()) { 7822 return nil 7823 } 7824 err = iter.page.NextWithContext(ctx) 7825 if err != nil { 7826 iter.i-- 7827 return err 7828 } 7829 iter.i = 0 7830 return nil 7831} 7832 7833// Next advances to the next value. If there was an error making 7834// the request the iterator does not advance and the error is returned. 7835// Deprecated: Use NextWithContext() instead. 7836func (iter *PropertyCollectionIterator) Next() error { 7837 return iter.NextWithContext(context.Background()) 7838} 7839 7840// NotDone returns true if the enumeration should be started or is not yet complete. 7841func (iter PropertyCollectionIterator) NotDone() bool { 7842 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 7843} 7844 7845// Response returns the raw server response from the last page request. 7846func (iter PropertyCollectionIterator) Response() PropertyCollection { 7847 return iter.page.Response() 7848} 7849 7850// Value returns the current value or a zero-initialized value if the 7851// iterator has advanced beyond the end of the collection. 7852func (iter PropertyCollectionIterator) Value() PropertyContract { 7853 if !iter.page.NotDone() { 7854 return PropertyContract{} 7855 } 7856 return iter.page.Values()[iter.i] 7857} 7858 7859// Creates a new instance of the PropertyCollectionIterator type. 7860func NewPropertyCollectionIterator(page PropertyCollectionPage) PropertyCollectionIterator { 7861 return PropertyCollectionIterator{page: page} 7862} 7863 7864// IsEmpty returns true if the ListResult contains no values. 7865func (pc PropertyCollection) IsEmpty() bool { 7866 return pc.Value == nil || len(*pc.Value) == 0 7867} 7868 7869// hasNextLink returns true if the NextLink is not empty. 7870func (pc PropertyCollection) hasNextLink() bool { 7871 return pc.NextLink != nil && len(*pc.NextLink) != 0 7872} 7873 7874// propertyCollectionPreparer prepares a request to retrieve the next set of results. 7875// It returns nil if no more results exist. 7876func (pc PropertyCollection) propertyCollectionPreparer(ctx context.Context) (*http.Request, error) { 7877 if !pc.hasNextLink() { 7878 return nil, nil 7879 } 7880 return autorest.Prepare((&http.Request{}).WithContext(ctx), 7881 autorest.AsJSON(), 7882 autorest.AsGet(), 7883 autorest.WithBaseURL(to.String(pc.NextLink))) 7884} 7885 7886// PropertyCollectionPage contains a page of PropertyContract values. 7887type PropertyCollectionPage struct { 7888 fn func(context.Context, PropertyCollection) (PropertyCollection, error) 7889 pc PropertyCollection 7890} 7891 7892// NextWithContext advances to the next page of values. If there was an error making 7893// the request the page does not advance and the error is returned. 7894func (page *PropertyCollectionPage) NextWithContext(ctx context.Context) (err error) { 7895 if tracing.IsEnabled() { 7896 ctx = tracing.StartSpan(ctx, fqdn+"/PropertyCollectionPage.NextWithContext") 7897 defer func() { 7898 sc := -1 7899 if page.Response().Response.Response != nil { 7900 sc = page.Response().Response.Response.StatusCode 7901 } 7902 tracing.EndSpan(ctx, sc, err) 7903 }() 7904 } 7905 for { 7906 next, err := page.fn(ctx, page.pc) 7907 if err != nil { 7908 return err 7909 } 7910 page.pc = next 7911 if !next.hasNextLink() || !next.IsEmpty() { 7912 break 7913 } 7914 } 7915 return nil 7916} 7917 7918// Next advances to the next page of values. If there was an error making 7919// the request the page does not advance and the error is returned. 7920// Deprecated: Use NextWithContext() instead. 7921func (page *PropertyCollectionPage) Next() error { 7922 return page.NextWithContext(context.Background()) 7923} 7924 7925// NotDone returns true if the page enumeration should be started or is not yet complete. 7926func (page PropertyCollectionPage) NotDone() bool { 7927 return !page.pc.IsEmpty() 7928} 7929 7930// Response returns the raw server response from the last page request. 7931func (page PropertyCollectionPage) Response() PropertyCollection { 7932 return page.pc 7933} 7934 7935// Values returns the slice of values for the current page or nil if there are no values. 7936func (page PropertyCollectionPage) Values() []PropertyContract { 7937 if page.pc.IsEmpty() { 7938 return nil 7939 } 7940 return *page.pc.Value 7941} 7942 7943// Creates a new instance of the PropertyCollectionPage type. 7944func NewPropertyCollectionPage(cur PropertyCollection, getNextPage func(context.Context, PropertyCollection) (PropertyCollection, error)) PropertyCollectionPage { 7945 return PropertyCollectionPage{ 7946 fn: getNextPage, 7947 pc: cur, 7948 } 7949} 7950 7951// PropertyContract property details. 7952type PropertyContract struct { 7953 autorest.Response `json:"-"` 7954 // PropertyContractProperties - Property entity contract properties. 7955 *PropertyContractProperties `json:"properties,omitempty"` 7956 // ID - READ-ONLY; Resource ID. 7957 ID *string `json:"id,omitempty"` 7958 // Name - READ-ONLY; Resource name. 7959 Name *string `json:"name,omitempty"` 7960 // Type - READ-ONLY; Resource type for API Management resource. 7961 Type *string `json:"type,omitempty"` 7962} 7963 7964// MarshalJSON is the custom marshaler for PropertyContract. 7965func (pc PropertyContract) MarshalJSON() ([]byte, error) { 7966 objectMap := make(map[string]interface{}) 7967 if pc.PropertyContractProperties != nil { 7968 objectMap["properties"] = pc.PropertyContractProperties 7969 } 7970 return json.Marshal(objectMap) 7971} 7972 7973// UnmarshalJSON is the custom unmarshaler for PropertyContract struct. 7974func (pc *PropertyContract) UnmarshalJSON(body []byte) error { 7975 var m map[string]*json.RawMessage 7976 err := json.Unmarshal(body, &m) 7977 if err != nil { 7978 return err 7979 } 7980 for k, v := range m { 7981 switch k { 7982 case "properties": 7983 if v != nil { 7984 var propertyContractProperties PropertyContractProperties 7985 err = json.Unmarshal(*v, &propertyContractProperties) 7986 if err != nil { 7987 return err 7988 } 7989 pc.PropertyContractProperties = &propertyContractProperties 7990 } 7991 case "id": 7992 if v != nil { 7993 var ID string 7994 err = json.Unmarshal(*v, &ID) 7995 if err != nil { 7996 return err 7997 } 7998 pc.ID = &ID 7999 } 8000 case "name": 8001 if v != nil { 8002 var name string 8003 err = json.Unmarshal(*v, &name) 8004 if err != nil { 8005 return err 8006 } 8007 pc.Name = &name 8008 } 8009 case "type": 8010 if v != nil { 8011 var typeVar string 8012 err = json.Unmarshal(*v, &typeVar) 8013 if err != nil { 8014 return err 8015 } 8016 pc.Type = &typeVar 8017 } 8018 } 8019 } 8020 8021 return nil 8022} 8023 8024// PropertyContractProperties property Contract properties. 8025type PropertyContractProperties struct { 8026 // DisplayName - Unique name of Property. It may contain only letters, digits, period, dash, and underscore characters. 8027 DisplayName *string `json:"displayName,omitempty"` 8028 // Value - Value of the property. Can contain policy expressions. It may not be empty or consist only of whitespace. 8029 Value *string `json:"value,omitempty"` 8030 // Tags - Optional tags that when provided can be used to filter the property list. 8031 Tags *[]string `json:"tags,omitempty"` 8032 // Secret - Determines whether the value is a secret and should be encrypted or not. Default value is false. 8033 Secret *bool `json:"secret,omitempty"` 8034} 8035 8036// PropertyEntityBaseParameters property Entity Base Parameters set. 8037type PropertyEntityBaseParameters struct { 8038 // Tags - Optional tags that when provided can be used to filter the property list. 8039 Tags *[]string `json:"tags,omitempty"` 8040 // Secret - Determines whether the value is a secret and should be encrypted or not. Default value is false. 8041 Secret *bool `json:"secret,omitempty"` 8042} 8043 8044// PropertyUpdateParameterProperties property Contract properties. 8045type PropertyUpdateParameterProperties struct { 8046 // DisplayName - Unique name of Property. It may contain only letters, digits, period, dash, and underscore characters. 8047 DisplayName *string `json:"displayName,omitempty"` 8048 // Value - Value of the property. Can contain policy expressions. It may not be empty or consist only of whitespace. 8049 Value *string `json:"value,omitempty"` 8050 // Tags - Optional tags that when provided can be used to filter the property list. 8051 Tags *[]string `json:"tags,omitempty"` 8052 // Secret - Determines whether the value is a secret and should be encrypted or not. Default value is false. 8053 Secret *bool `json:"secret,omitempty"` 8054} 8055 8056// PropertyUpdateParameters property update Parameters. 8057type PropertyUpdateParameters struct { 8058 // PropertyUpdateParameterProperties - Property entity Update contract properties. 8059 *PropertyUpdateParameterProperties `json:"properties,omitempty"` 8060} 8061 8062// MarshalJSON is the custom marshaler for PropertyUpdateParameters. 8063func (pup PropertyUpdateParameters) MarshalJSON() ([]byte, error) { 8064 objectMap := make(map[string]interface{}) 8065 if pup.PropertyUpdateParameterProperties != nil { 8066 objectMap["properties"] = pup.PropertyUpdateParameterProperties 8067 } 8068 return json.Marshal(objectMap) 8069} 8070 8071// UnmarshalJSON is the custom unmarshaler for PropertyUpdateParameters struct. 8072func (pup *PropertyUpdateParameters) UnmarshalJSON(body []byte) error { 8073 var m map[string]*json.RawMessage 8074 err := json.Unmarshal(body, &m) 8075 if err != nil { 8076 return err 8077 } 8078 for k, v := range m { 8079 switch k { 8080 case "properties": 8081 if v != nil { 8082 var propertyUpdateParameterProperties PropertyUpdateParameterProperties 8083 err = json.Unmarshal(*v, &propertyUpdateParameterProperties) 8084 if err != nil { 8085 return err 8086 } 8087 pup.PropertyUpdateParameterProperties = &propertyUpdateParameterProperties 8088 } 8089 } 8090 } 8091 8092 return nil 8093} 8094 8095// QuotaCounterCollection paged Quota Counter list representation. 8096type QuotaCounterCollection struct { 8097 autorest.Response `json:"-"` 8098 // Value - Quota counter values. 8099 Value *[]QuotaCounterContract `json:"value,omitempty"` 8100 // Count - Total record count number across all pages. 8101 Count *int64 `json:"count,omitempty"` 8102 // NextLink - Next page link if any. 8103 NextLink *string `json:"nextLink,omitempty"` 8104} 8105 8106// QuotaCounterContract quota counter details. 8107type QuotaCounterContract struct { 8108 autorest.Response `json:"-"` 8109 // CounterKey - The Key value of the Counter. Must not be empty. 8110 CounterKey *string `json:"counterKey,omitempty"` 8111 // PeriodKey - Identifier of the Period for which the counter was collected. Must not be empty. 8112 PeriodKey *string `json:"periodKey,omitempty"` 8113 // 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. 8114 PeriodStartTime *date.Time `json:"periodStartTime,omitempty"` 8115 // 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. 8116 PeriodEndTime *date.Time `json:"periodEndTime,omitempty"` 8117 // Value - Quota Value Properties 8118 Value *QuotaCounterValueContractProperties `json:"value,omitempty"` 8119} 8120 8121// QuotaCounterValueContract quota counter value details. 8122type QuotaCounterValueContract struct { 8123 // QuotaCounterValueContractProperties - Quota counter Value Properties. 8124 *QuotaCounterValueContractProperties `json:"value,omitempty"` 8125} 8126 8127// MarshalJSON is the custom marshaler for QuotaCounterValueContract. 8128func (qcvc QuotaCounterValueContract) MarshalJSON() ([]byte, error) { 8129 objectMap := make(map[string]interface{}) 8130 if qcvc.QuotaCounterValueContractProperties != nil { 8131 objectMap["value"] = qcvc.QuotaCounterValueContractProperties 8132 } 8133 return json.Marshal(objectMap) 8134} 8135 8136// UnmarshalJSON is the custom unmarshaler for QuotaCounterValueContract struct. 8137func (qcvc *QuotaCounterValueContract) UnmarshalJSON(body []byte) error { 8138 var m map[string]*json.RawMessage 8139 err := json.Unmarshal(body, &m) 8140 if err != nil { 8141 return err 8142 } 8143 for k, v := range m { 8144 switch k { 8145 case "value": 8146 if v != nil { 8147 var quotaCounterValueContractProperties QuotaCounterValueContractProperties 8148 err = json.Unmarshal(*v, "aCounterValueContractProperties) 8149 if err != nil { 8150 return err 8151 } 8152 qcvc.QuotaCounterValueContractProperties = "aCounterValueContractProperties 8153 } 8154 } 8155 } 8156 8157 return nil 8158} 8159 8160// QuotaCounterValueContractProperties quota counter value details. 8161type QuotaCounterValueContractProperties struct { 8162 // CallsCount - Number of times Counter was called. 8163 CallsCount *int32 `json:"callsCount,omitempty"` 8164 // KbTransferred - Data Transferred in KiloBytes. 8165 KbTransferred *float64 `json:"kbTransferred,omitempty"` 8166} 8167 8168// RecipientEmailCollection paged Recipient User list representation. 8169type RecipientEmailCollection struct { 8170 autorest.Response `json:"-"` 8171 // Value - Page values. 8172 Value *[]RecipientEmailContract `json:"value,omitempty"` 8173 // NextLink - Next page link if any. 8174 NextLink *string `json:"nextLink,omitempty"` 8175} 8176 8177// RecipientEmailContract recipient Email details. 8178type RecipientEmailContract struct { 8179 autorest.Response `json:"-"` 8180 // RecipientEmailContractProperties - Recipient Email contract properties. 8181 *RecipientEmailContractProperties `json:"properties,omitempty"` 8182 // ID - READ-ONLY; Resource ID. 8183 ID *string `json:"id,omitempty"` 8184 // Name - READ-ONLY; Resource name. 8185 Name *string `json:"name,omitempty"` 8186 // Type - READ-ONLY; Resource type for API Management resource. 8187 Type *string `json:"type,omitempty"` 8188} 8189 8190// MarshalJSON is the custom marshaler for RecipientEmailContract. 8191func (rec RecipientEmailContract) MarshalJSON() ([]byte, error) { 8192 objectMap := make(map[string]interface{}) 8193 if rec.RecipientEmailContractProperties != nil { 8194 objectMap["properties"] = rec.RecipientEmailContractProperties 8195 } 8196 return json.Marshal(objectMap) 8197} 8198 8199// UnmarshalJSON is the custom unmarshaler for RecipientEmailContract struct. 8200func (rec *RecipientEmailContract) UnmarshalJSON(body []byte) error { 8201 var m map[string]*json.RawMessage 8202 err := json.Unmarshal(body, &m) 8203 if err != nil { 8204 return err 8205 } 8206 for k, v := range m { 8207 switch k { 8208 case "properties": 8209 if v != nil { 8210 var recipientEmailContractProperties RecipientEmailContractProperties 8211 err = json.Unmarshal(*v, &recipientEmailContractProperties) 8212 if err != nil { 8213 return err 8214 } 8215 rec.RecipientEmailContractProperties = &recipientEmailContractProperties 8216 } 8217 case "id": 8218 if v != nil { 8219 var ID string 8220 err = json.Unmarshal(*v, &ID) 8221 if err != nil { 8222 return err 8223 } 8224 rec.ID = &ID 8225 } 8226 case "name": 8227 if v != nil { 8228 var name string 8229 err = json.Unmarshal(*v, &name) 8230 if err != nil { 8231 return err 8232 } 8233 rec.Name = &name 8234 } 8235 case "type": 8236 if v != nil { 8237 var typeVar string 8238 err = json.Unmarshal(*v, &typeVar) 8239 if err != nil { 8240 return err 8241 } 8242 rec.Type = &typeVar 8243 } 8244 } 8245 } 8246 8247 return nil 8248} 8249 8250// RecipientEmailContractProperties recipient Email Contract Properties. 8251type RecipientEmailContractProperties struct { 8252 // Email - User Email subscribed to notification. 8253 Email *string `json:"email,omitempty"` 8254} 8255 8256// RecipientsContractProperties notification Parameter contract. 8257type RecipientsContractProperties struct { 8258 // Emails - List of Emails subscribed for the notification. 8259 Emails *[]string `json:"emails,omitempty"` 8260 // Users - List of Users subscribed for the notification. 8261 Users *[]string `json:"users,omitempty"` 8262} 8263 8264// RecipientUserCollection paged Recipient User list representation. 8265type RecipientUserCollection struct { 8266 autorest.Response `json:"-"` 8267 // Value - Page values. 8268 Value *[]RecipientUserContract `json:"value,omitempty"` 8269 // NextLink - Next page link if any. 8270 NextLink *string `json:"nextLink,omitempty"` 8271} 8272 8273// RecipientUserContract recipient User details. 8274type RecipientUserContract struct { 8275 autorest.Response `json:"-"` 8276 // RecipientUsersContractProperties - Recipient User entity contract properties. 8277 *RecipientUsersContractProperties `json:"properties,omitempty"` 8278 // ID - READ-ONLY; Resource ID. 8279 ID *string `json:"id,omitempty"` 8280 // Name - READ-ONLY; Resource name. 8281 Name *string `json:"name,omitempty"` 8282 // Type - READ-ONLY; Resource type for API Management resource. 8283 Type *string `json:"type,omitempty"` 8284} 8285 8286// MarshalJSON is the custom marshaler for RecipientUserContract. 8287func (ruc RecipientUserContract) MarshalJSON() ([]byte, error) { 8288 objectMap := make(map[string]interface{}) 8289 if ruc.RecipientUsersContractProperties != nil { 8290 objectMap["properties"] = ruc.RecipientUsersContractProperties 8291 } 8292 return json.Marshal(objectMap) 8293} 8294 8295// UnmarshalJSON is the custom unmarshaler for RecipientUserContract struct. 8296func (ruc *RecipientUserContract) UnmarshalJSON(body []byte) error { 8297 var m map[string]*json.RawMessage 8298 err := json.Unmarshal(body, &m) 8299 if err != nil { 8300 return err 8301 } 8302 for k, v := range m { 8303 switch k { 8304 case "properties": 8305 if v != nil { 8306 var recipientUsersContractProperties RecipientUsersContractProperties 8307 err = json.Unmarshal(*v, &recipientUsersContractProperties) 8308 if err != nil { 8309 return err 8310 } 8311 ruc.RecipientUsersContractProperties = &recipientUsersContractProperties 8312 } 8313 case "id": 8314 if v != nil { 8315 var ID string 8316 err = json.Unmarshal(*v, &ID) 8317 if err != nil { 8318 return err 8319 } 8320 ruc.ID = &ID 8321 } 8322 case "name": 8323 if v != nil { 8324 var name string 8325 err = json.Unmarshal(*v, &name) 8326 if err != nil { 8327 return err 8328 } 8329 ruc.Name = &name 8330 } 8331 case "type": 8332 if v != nil { 8333 var typeVar string 8334 err = json.Unmarshal(*v, &typeVar) 8335 if err != nil { 8336 return err 8337 } 8338 ruc.Type = &typeVar 8339 } 8340 } 8341 } 8342 8343 return nil 8344} 8345 8346// RecipientUsersContractProperties recipient User Contract Properties. 8347type RecipientUsersContractProperties struct { 8348 // UserID - API Management UserId subscribed to notification. 8349 UserID *string `json:"userId,omitempty"` 8350} 8351 8352// RegionContract region profile. 8353type RegionContract struct { 8354 // Name - READ-ONLY; Region name. 8355 Name *string `json:"name,omitempty"` 8356 // IsMasterRegion - whether Region is the master region. 8357 IsMasterRegion *bool `json:"isMasterRegion,omitempty"` 8358 // IsDeleted - whether Region is deleted. 8359 IsDeleted *bool `json:"isDeleted,omitempty"` 8360} 8361 8362// MarshalJSON is the custom marshaler for RegionContract. 8363func (rc RegionContract) MarshalJSON() ([]byte, error) { 8364 objectMap := make(map[string]interface{}) 8365 if rc.IsMasterRegion != nil { 8366 objectMap["isMasterRegion"] = rc.IsMasterRegion 8367 } 8368 if rc.IsDeleted != nil { 8369 objectMap["isDeleted"] = rc.IsDeleted 8370 } 8371 return json.Marshal(objectMap) 8372} 8373 8374// RegionListResult lists Regions operation response details. 8375type RegionListResult struct { 8376 autorest.Response `json:"-"` 8377 // Value - Lists of Regions. 8378 Value *[]RegionContract `json:"value,omitempty"` 8379 // Count - Total record count number across all pages. 8380 Count *int64 `json:"count,omitempty"` 8381 // NextLink - Next page link if any. 8382 NextLink *string `json:"nextLink,omitempty"` 8383} 8384 8385// RegionListResultIterator provides access to a complete listing of RegionContract values. 8386type RegionListResultIterator struct { 8387 i int 8388 page RegionListResultPage 8389} 8390 8391// NextWithContext advances to the next value. If there was an error making 8392// the request the iterator does not advance and the error is returned. 8393func (iter *RegionListResultIterator) NextWithContext(ctx context.Context) (err error) { 8394 if tracing.IsEnabled() { 8395 ctx = tracing.StartSpan(ctx, fqdn+"/RegionListResultIterator.NextWithContext") 8396 defer func() { 8397 sc := -1 8398 if iter.Response().Response.Response != nil { 8399 sc = iter.Response().Response.Response.StatusCode 8400 } 8401 tracing.EndSpan(ctx, sc, err) 8402 }() 8403 } 8404 iter.i++ 8405 if iter.i < len(iter.page.Values()) { 8406 return nil 8407 } 8408 err = iter.page.NextWithContext(ctx) 8409 if err != nil { 8410 iter.i-- 8411 return err 8412 } 8413 iter.i = 0 8414 return nil 8415} 8416 8417// Next advances to the next value. If there was an error making 8418// the request the iterator does not advance and the error is returned. 8419// Deprecated: Use NextWithContext() instead. 8420func (iter *RegionListResultIterator) Next() error { 8421 return iter.NextWithContext(context.Background()) 8422} 8423 8424// NotDone returns true if the enumeration should be started or is not yet complete. 8425func (iter RegionListResultIterator) NotDone() bool { 8426 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 8427} 8428 8429// Response returns the raw server response from the last page request. 8430func (iter RegionListResultIterator) Response() RegionListResult { 8431 return iter.page.Response() 8432} 8433 8434// Value returns the current value or a zero-initialized value if the 8435// iterator has advanced beyond the end of the collection. 8436func (iter RegionListResultIterator) Value() RegionContract { 8437 if !iter.page.NotDone() { 8438 return RegionContract{} 8439 } 8440 return iter.page.Values()[iter.i] 8441} 8442 8443// Creates a new instance of the RegionListResultIterator type. 8444func NewRegionListResultIterator(page RegionListResultPage) RegionListResultIterator { 8445 return RegionListResultIterator{page: page} 8446} 8447 8448// IsEmpty returns true if the ListResult contains no values. 8449func (rlr RegionListResult) IsEmpty() bool { 8450 return rlr.Value == nil || len(*rlr.Value) == 0 8451} 8452 8453// hasNextLink returns true if the NextLink is not empty. 8454func (rlr RegionListResult) hasNextLink() bool { 8455 return rlr.NextLink != nil && len(*rlr.NextLink) != 0 8456} 8457 8458// regionListResultPreparer prepares a request to retrieve the next set of results. 8459// It returns nil if no more results exist. 8460func (rlr RegionListResult) regionListResultPreparer(ctx context.Context) (*http.Request, error) { 8461 if !rlr.hasNextLink() { 8462 return nil, nil 8463 } 8464 return autorest.Prepare((&http.Request{}).WithContext(ctx), 8465 autorest.AsJSON(), 8466 autorest.AsGet(), 8467 autorest.WithBaseURL(to.String(rlr.NextLink))) 8468} 8469 8470// RegionListResultPage contains a page of RegionContract values. 8471type RegionListResultPage struct { 8472 fn func(context.Context, RegionListResult) (RegionListResult, error) 8473 rlr RegionListResult 8474} 8475 8476// NextWithContext advances to the next page of values. If there was an error making 8477// the request the page does not advance and the error is returned. 8478func (page *RegionListResultPage) NextWithContext(ctx context.Context) (err error) { 8479 if tracing.IsEnabled() { 8480 ctx = tracing.StartSpan(ctx, fqdn+"/RegionListResultPage.NextWithContext") 8481 defer func() { 8482 sc := -1 8483 if page.Response().Response.Response != nil { 8484 sc = page.Response().Response.Response.StatusCode 8485 } 8486 tracing.EndSpan(ctx, sc, err) 8487 }() 8488 } 8489 for { 8490 next, err := page.fn(ctx, page.rlr) 8491 if err != nil { 8492 return err 8493 } 8494 page.rlr = next 8495 if !next.hasNextLink() || !next.IsEmpty() { 8496 break 8497 } 8498 } 8499 return nil 8500} 8501 8502// Next advances to the next page of values. If there was an error making 8503// the request the page does not advance and the error is returned. 8504// Deprecated: Use NextWithContext() instead. 8505func (page *RegionListResultPage) Next() error { 8506 return page.NextWithContext(context.Background()) 8507} 8508 8509// NotDone returns true if the page enumeration should be started or is not yet complete. 8510func (page RegionListResultPage) NotDone() bool { 8511 return !page.rlr.IsEmpty() 8512} 8513 8514// Response returns the raw server response from the last page request. 8515func (page RegionListResultPage) Response() RegionListResult { 8516 return page.rlr 8517} 8518 8519// Values returns the slice of values for the current page or nil if there are no values. 8520func (page RegionListResultPage) Values() []RegionContract { 8521 if page.rlr.IsEmpty() { 8522 return nil 8523 } 8524 return *page.rlr.Value 8525} 8526 8527// Creates a new instance of the RegionListResultPage type. 8528func NewRegionListResultPage(cur RegionListResult, getNextPage func(context.Context, RegionListResult) (RegionListResult, error)) RegionListResultPage { 8529 return RegionListResultPage{ 8530 fn: getNextPage, 8531 rlr: cur, 8532 } 8533} 8534 8535// RegistrationDelegationSettingsProperties user registration delegation settings properties. 8536type RegistrationDelegationSettingsProperties struct { 8537 // Enabled - Enable or disable delegation for user registration. 8538 Enabled *bool `json:"enabled,omitempty"` 8539} 8540 8541// ReportCollection paged Report records list representation. 8542type ReportCollection struct { 8543 autorest.Response `json:"-"` 8544 // Value - Page values. 8545 Value *[]ReportRecordContract `json:"value,omitempty"` 8546 // Count - Total record count number across all pages. 8547 Count *int64 `json:"count,omitempty"` 8548 // NextLink - Next page link if any. 8549 NextLink *string `json:"nextLink,omitempty"` 8550} 8551 8552// ReportCollectionIterator provides access to a complete listing of ReportRecordContract values. 8553type ReportCollectionIterator struct { 8554 i int 8555 page ReportCollectionPage 8556} 8557 8558// NextWithContext advances to the next value. If there was an error making 8559// the request the iterator does not advance and the error is returned. 8560func (iter *ReportCollectionIterator) NextWithContext(ctx context.Context) (err error) { 8561 if tracing.IsEnabled() { 8562 ctx = tracing.StartSpan(ctx, fqdn+"/ReportCollectionIterator.NextWithContext") 8563 defer func() { 8564 sc := -1 8565 if iter.Response().Response.Response != nil { 8566 sc = iter.Response().Response.Response.StatusCode 8567 } 8568 tracing.EndSpan(ctx, sc, err) 8569 }() 8570 } 8571 iter.i++ 8572 if iter.i < len(iter.page.Values()) { 8573 return nil 8574 } 8575 err = iter.page.NextWithContext(ctx) 8576 if err != nil { 8577 iter.i-- 8578 return err 8579 } 8580 iter.i = 0 8581 return nil 8582} 8583 8584// Next advances to the next value. If there was an error making 8585// the request the iterator does not advance and the error is returned. 8586// Deprecated: Use NextWithContext() instead. 8587func (iter *ReportCollectionIterator) Next() error { 8588 return iter.NextWithContext(context.Background()) 8589} 8590 8591// NotDone returns true if the enumeration should be started or is not yet complete. 8592func (iter ReportCollectionIterator) NotDone() bool { 8593 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 8594} 8595 8596// Response returns the raw server response from the last page request. 8597func (iter ReportCollectionIterator) Response() ReportCollection { 8598 return iter.page.Response() 8599} 8600 8601// Value returns the current value or a zero-initialized value if the 8602// iterator has advanced beyond the end of the collection. 8603func (iter ReportCollectionIterator) Value() ReportRecordContract { 8604 if !iter.page.NotDone() { 8605 return ReportRecordContract{} 8606 } 8607 return iter.page.Values()[iter.i] 8608} 8609 8610// Creates a new instance of the ReportCollectionIterator type. 8611func NewReportCollectionIterator(page ReportCollectionPage) ReportCollectionIterator { 8612 return ReportCollectionIterator{page: page} 8613} 8614 8615// IsEmpty returns true if the ListResult contains no values. 8616func (rc ReportCollection) IsEmpty() bool { 8617 return rc.Value == nil || len(*rc.Value) == 0 8618} 8619 8620// hasNextLink returns true if the NextLink is not empty. 8621func (rc ReportCollection) hasNextLink() bool { 8622 return rc.NextLink != nil && len(*rc.NextLink) != 0 8623} 8624 8625// reportCollectionPreparer prepares a request to retrieve the next set of results. 8626// It returns nil if no more results exist. 8627func (rc ReportCollection) reportCollectionPreparer(ctx context.Context) (*http.Request, error) { 8628 if !rc.hasNextLink() { 8629 return nil, nil 8630 } 8631 return autorest.Prepare((&http.Request{}).WithContext(ctx), 8632 autorest.AsJSON(), 8633 autorest.AsGet(), 8634 autorest.WithBaseURL(to.String(rc.NextLink))) 8635} 8636 8637// ReportCollectionPage contains a page of ReportRecordContract values. 8638type ReportCollectionPage struct { 8639 fn func(context.Context, ReportCollection) (ReportCollection, error) 8640 rc ReportCollection 8641} 8642 8643// NextWithContext advances to the next page of values. If there was an error making 8644// the request the page does not advance and the error is returned. 8645func (page *ReportCollectionPage) NextWithContext(ctx context.Context) (err error) { 8646 if tracing.IsEnabled() { 8647 ctx = tracing.StartSpan(ctx, fqdn+"/ReportCollectionPage.NextWithContext") 8648 defer func() { 8649 sc := -1 8650 if page.Response().Response.Response != nil { 8651 sc = page.Response().Response.Response.StatusCode 8652 } 8653 tracing.EndSpan(ctx, sc, err) 8654 }() 8655 } 8656 for { 8657 next, err := page.fn(ctx, page.rc) 8658 if err != nil { 8659 return err 8660 } 8661 page.rc = next 8662 if !next.hasNextLink() || !next.IsEmpty() { 8663 break 8664 } 8665 } 8666 return nil 8667} 8668 8669// Next advances to the next page of values. If there was an error making 8670// the request the page does not advance and the error is returned. 8671// Deprecated: Use NextWithContext() instead. 8672func (page *ReportCollectionPage) Next() error { 8673 return page.NextWithContext(context.Background()) 8674} 8675 8676// NotDone returns true if the page enumeration should be started or is not yet complete. 8677func (page ReportCollectionPage) NotDone() bool { 8678 return !page.rc.IsEmpty() 8679} 8680 8681// Response returns the raw server response from the last page request. 8682func (page ReportCollectionPage) Response() ReportCollection { 8683 return page.rc 8684} 8685 8686// Values returns the slice of values for the current page or nil if there are no values. 8687func (page ReportCollectionPage) Values() []ReportRecordContract { 8688 if page.rc.IsEmpty() { 8689 return nil 8690 } 8691 return *page.rc.Value 8692} 8693 8694// Creates a new instance of the ReportCollectionPage type. 8695func NewReportCollectionPage(cur ReportCollection, getNextPage func(context.Context, ReportCollection) (ReportCollection, error)) ReportCollectionPage { 8696 return ReportCollectionPage{ 8697 fn: getNextPage, 8698 rc: cur, 8699 } 8700} 8701 8702// ReportRecordContract report data. 8703type ReportRecordContract struct { 8704 // Name - Name depending on report endpoint specifies product, API, operation or developer name. 8705 Name *string `json:"name,omitempty"` 8706 // Timestamp - Start of aggregation period. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. 8707 Timestamp *date.Time `json:"timestamp,omitempty"` 8708 // Interval - Length of aggregation period. Interval must be multiple of 15 minutes and may not be zero. The value should be in ISO 8601 format (http://en.wikipedia.org/wiki/ISO_8601#Durations). 8709 Interval *string `json:"interval,omitempty"` 8710 // Country - Country to which this record data is related. 8711 Country *string `json:"country,omitempty"` 8712 // Region - Country region to which this record data is related. 8713 Region *string `json:"region,omitempty"` 8714 // Zip - Zip code to which this record data is related. 8715 Zip *string `json:"zip,omitempty"` 8716 // UserID - READ-ONLY; User identifier path. /users/{userId} 8717 UserID *string `json:"userId,omitempty"` 8718 // ProductID - READ-ONLY; Product identifier path. /products/{productId} 8719 ProductID *string `json:"productId,omitempty"` 8720 // APIID - API identifier path. /apis/{apiId} 8721 APIID *string `json:"apiId,omitempty"` 8722 // OperationID - Operation identifier path. /apis/{apiId}/operations/{operationId} 8723 OperationID *string `json:"operationId,omitempty"` 8724 // APIRegion - API region identifier. 8725 APIRegion *string `json:"apiRegion,omitempty"` 8726 // SubscriptionID - Subscription identifier path. /subscriptions/{subscriptionId} 8727 SubscriptionID *string `json:"subscriptionId,omitempty"` 8728 // CallCountSuccess - Number of successful calls. This includes calls returning HttpStatusCode <= 301 and HttpStatusCode.NotModified and HttpStatusCode.TemporaryRedirect 8729 CallCountSuccess *int32 `json:"callCountSuccess,omitempty"` 8730 // CallCountBlocked - Number of calls blocked due to invalid credentials. This includes calls returning HttpStatusCode.Unauthorized and HttpStatusCode.Forbidden and HttpStatusCode.TooManyRequests 8731 CallCountBlocked *int32 `json:"callCountBlocked,omitempty"` 8732 // 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 8733 CallCountFailed *int32 `json:"callCountFailed,omitempty"` 8734 // CallCountOther - Number of other calls. 8735 CallCountOther *int32 `json:"callCountOther,omitempty"` 8736 // CallCountTotal - Total number of calls. 8737 CallCountTotal *int32 `json:"callCountTotal,omitempty"` 8738 // Bandwidth - Bandwidth consumed. 8739 Bandwidth *int64 `json:"bandwidth,omitempty"` 8740 // CacheHitCount - Number of times when content was served from cache policy. 8741 CacheHitCount *int32 `json:"cacheHitCount,omitempty"` 8742 // CacheMissCount - Number of times content was fetched from backend. 8743 CacheMissCount *int32 `json:"cacheMissCount,omitempty"` 8744 // APITimeAvg - Average time it took to process request. 8745 APITimeAvg *float64 `json:"apiTimeAvg,omitempty"` 8746 // APITimeMin - Minimum time it took to process request. 8747 APITimeMin *float64 `json:"apiTimeMin,omitempty"` 8748 // APITimeMax - Maximum time it took to process request. 8749 APITimeMax *float64 `json:"apiTimeMax,omitempty"` 8750 // ServiceTimeAvg - Average time it took to process request on backend. 8751 ServiceTimeAvg *float64 `json:"serviceTimeAvg,omitempty"` 8752 // ServiceTimeMin - Minimum time it took to process request on backend. 8753 ServiceTimeMin *float64 `json:"serviceTimeMin,omitempty"` 8754 // ServiceTimeMax - Maximum time it took to process request on backend. 8755 ServiceTimeMax *float64 `json:"serviceTimeMax,omitempty"` 8756} 8757 8758// MarshalJSON is the custom marshaler for ReportRecordContract. 8759func (rrc ReportRecordContract) MarshalJSON() ([]byte, error) { 8760 objectMap := make(map[string]interface{}) 8761 if rrc.Name != nil { 8762 objectMap["name"] = rrc.Name 8763 } 8764 if rrc.Timestamp != nil { 8765 objectMap["timestamp"] = rrc.Timestamp 8766 } 8767 if rrc.Interval != nil { 8768 objectMap["interval"] = rrc.Interval 8769 } 8770 if rrc.Country != nil { 8771 objectMap["country"] = rrc.Country 8772 } 8773 if rrc.Region != nil { 8774 objectMap["region"] = rrc.Region 8775 } 8776 if rrc.Zip != nil { 8777 objectMap["zip"] = rrc.Zip 8778 } 8779 if rrc.APIID != nil { 8780 objectMap["apiId"] = rrc.APIID 8781 } 8782 if rrc.OperationID != nil { 8783 objectMap["operationId"] = rrc.OperationID 8784 } 8785 if rrc.APIRegion != nil { 8786 objectMap["apiRegion"] = rrc.APIRegion 8787 } 8788 if rrc.SubscriptionID != nil { 8789 objectMap["subscriptionId"] = rrc.SubscriptionID 8790 } 8791 if rrc.CallCountSuccess != nil { 8792 objectMap["callCountSuccess"] = rrc.CallCountSuccess 8793 } 8794 if rrc.CallCountBlocked != nil { 8795 objectMap["callCountBlocked"] = rrc.CallCountBlocked 8796 } 8797 if rrc.CallCountFailed != nil { 8798 objectMap["callCountFailed"] = rrc.CallCountFailed 8799 } 8800 if rrc.CallCountOther != nil { 8801 objectMap["callCountOther"] = rrc.CallCountOther 8802 } 8803 if rrc.CallCountTotal != nil { 8804 objectMap["callCountTotal"] = rrc.CallCountTotal 8805 } 8806 if rrc.Bandwidth != nil { 8807 objectMap["bandwidth"] = rrc.Bandwidth 8808 } 8809 if rrc.CacheHitCount != nil { 8810 objectMap["cacheHitCount"] = rrc.CacheHitCount 8811 } 8812 if rrc.CacheMissCount != nil { 8813 objectMap["cacheMissCount"] = rrc.CacheMissCount 8814 } 8815 if rrc.APITimeAvg != nil { 8816 objectMap["apiTimeAvg"] = rrc.APITimeAvg 8817 } 8818 if rrc.APITimeMin != nil { 8819 objectMap["apiTimeMin"] = rrc.APITimeMin 8820 } 8821 if rrc.APITimeMax != nil { 8822 objectMap["apiTimeMax"] = rrc.APITimeMax 8823 } 8824 if rrc.ServiceTimeAvg != nil { 8825 objectMap["serviceTimeAvg"] = rrc.ServiceTimeAvg 8826 } 8827 if rrc.ServiceTimeMin != nil { 8828 objectMap["serviceTimeMin"] = rrc.ServiceTimeMin 8829 } 8830 if rrc.ServiceTimeMax != nil { 8831 objectMap["serviceTimeMax"] = rrc.ServiceTimeMax 8832 } 8833 return json.Marshal(objectMap) 8834} 8835 8836// RepresentationContract operation request/response representation details. 8837type RepresentationContract struct { 8838 // ContentType - Specifies a registered or custom content type for this representation, e.g. application/xml. 8839 ContentType *string `json:"contentType,omitempty"` 8840 // Sample - An example of the representation. 8841 Sample *string `json:"sample,omitempty"` 8842 // SchemaID - Schema identifier. Applicable only if 'contentType' value is neither 'application/x-www-form-urlencoded' nor 'multipart/form-data'. 8843 SchemaID *string `json:"schemaId,omitempty"` 8844 // TypeName - Type name defined by the schema. Applicable only if 'contentType' value is neither 'application/x-www-form-urlencoded' nor 'multipart/form-data'. 8845 TypeName *string `json:"typeName,omitempty"` 8846 // FormParameters - Collection of form parameters. Required if 'contentType' value is either 'application/x-www-form-urlencoded' or 'multipart/form-data'.. 8847 FormParameters *[]ParameterContract `json:"formParameters,omitempty"` 8848} 8849 8850// RequestContract operation request details. 8851type RequestContract struct { 8852 // Description - Operation request description. 8853 Description *string `json:"description,omitempty"` 8854 // QueryParameters - Collection of operation request query parameters. 8855 QueryParameters *[]ParameterContract `json:"queryParameters,omitempty"` 8856 // Headers - Collection of operation request headers. 8857 Headers *[]ParameterContract `json:"headers,omitempty"` 8858 // Representations - Collection of operation request representations. 8859 Representations *[]RepresentationContract `json:"representations,omitempty"` 8860} 8861 8862// RequestReportCollection paged Report records list representation. 8863type RequestReportCollection struct { 8864 autorest.Response `json:"-"` 8865 // Value - Page values. 8866 Value *[]RequestReportRecordContract `json:"value,omitempty"` 8867 // Count - Total record count number across all pages. 8868 Count *int64 `json:"count,omitempty"` 8869} 8870 8871// RequestReportRecordContract request Report data. 8872type RequestReportRecordContract struct { 8873 // APIID - API identifier path. /apis/{apiId} 8874 APIID *string `json:"apiId,omitempty"` 8875 // OperationID - Operation identifier path. /apis/{apiId}/operations/{operationId} 8876 OperationID *string `json:"operationId,omitempty"` 8877 // ProductID - READ-ONLY; Product identifier path. /products/{productId} 8878 ProductID *string `json:"productId,omitempty"` 8879 // UserID - READ-ONLY; User identifier path. /users/{userId} 8880 UserID *string `json:"userId,omitempty"` 8881 // Method - The HTTP method associated with this request.. 8882 Method *string `json:"method,omitempty"` 8883 // URL - The full URL associated with this request. 8884 URL *string `json:"url,omitempty"` 8885 // IPAddress - The client IP address associated with this request. 8886 IPAddress *string `json:"ipAddress,omitempty"` 8887 // BackendResponseCode - The HTTP status code received by the gateway as a result of forwarding this request to the backend. 8888 BackendResponseCode *string `json:"backendResponseCode,omitempty"` 8889 // ResponseCode - The HTTP status code returned by the gateway. 8890 ResponseCode *int32 `json:"responseCode,omitempty"` 8891 // ResponseSize - The size of the response returned by the gateway. 8892 ResponseSize *int32 `json:"responseSize,omitempty"` 8893 // Timestamp - The date and time when this request was received by the gateway in ISO 8601 format. 8894 Timestamp *date.Time `json:"timestamp,omitempty"` 8895 // Cache - Specifies if response cache was involved in generating the response. If the value is none, the cache was not used. If the value is hit, cached response was returned. If the value is miss, the cache was used but lookup resulted in a miss and request was fulfilled by the backend. 8896 Cache *string `json:"cache,omitempty"` 8897 // APITime - The total time it took to process this request. 8898 APITime *float64 `json:"apiTime,omitempty"` 8899 // ServiceTime - he time it took to forward this request to the backend and get the response back. 8900 ServiceTime *float64 `json:"serviceTime,omitempty"` 8901 // APIRegion - Azure region where the gateway that processed this request is located. 8902 APIRegion *string `json:"apiRegion,omitempty"` 8903 // SubscriptionID - Subscription identifier path. /subscriptions/{subscriptionId} 8904 SubscriptionID *string `json:"subscriptionId,omitempty"` 8905 // RequestID - Request Identifier. 8906 RequestID *string `json:"requestId,omitempty"` 8907 // RequestSize - The size of this request.. 8908 RequestSize *int32 `json:"requestSize,omitempty"` 8909} 8910 8911// MarshalJSON is the custom marshaler for RequestReportRecordContract. 8912func (rrrc RequestReportRecordContract) MarshalJSON() ([]byte, error) { 8913 objectMap := make(map[string]interface{}) 8914 if rrrc.APIID != nil { 8915 objectMap["apiId"] = rrrc.APIID 8916 } 8917 if rrrc.OperationID != nil { 8918 objectMap["operationId"] = rrrc.OperationID 8919 } 8920 if rrrc.Method != nil { 8921 objectMap["method"] = rrrc.Method 8922 } 8923 if rrrc.URL != nil { 8924 objectMap["url"] = rrrc.URL 8925 } 8926 if rrrc.IPAddress != nil { 8927 objectMap["ipAddress"] = rrrc.IPAddress 8928 } 8929 if rrrc.BackendResponseCode != nil { 8930 objectMap["backendResponseCode"] = rrrc.BackendResponseCode 8931 } 8932 if rrrc.ResponseCode != nil { 8933 objectMap["responseCode"] = rrrc.ResponseCode 8934 } 8935 if rrrc.ResponseSize != nil { 8936 objectMap["responseSize"] = rrrc.ResponseSize 8937 } 8938 if rrrc.Timestamp != nil { 8939 objectMap["timestamp"] = rrrc.Timestamp 8940 } 8941 if rrrc.Cache != nil { 8942 objectMap["cache"] = rrrc.Cache 8943 } 8944 if rrrc.APITime != nil { 8945 objectMap["apiTime"] = rrrc.APITime 8946 } 8947 if rrrc.ServiceTime != nil { 8948 objectMap["serviceTime"] = rrrc.ServiceTime 8949 } 8950 if rrrc.APIRegion != nil { 8951 objectMap["apiRegion"] = rrrc.APIRegion 8952 } 8953 if rrrc.SubscriptionID != nil { 8954 objectMap["subscriptionId"] = rrrc.SubscriptionID 8955 } 8956 if rrrc.RequestID != nil { 8957 objectMap["requestId"] = rrrc.RequestID 8958 } 8959 if rrrc.RequestSize != nil { 8960 objectMap["requestSize"] = rrrc.RequestSize 8961 } 8962 return json.Marshal(objectMap) 8963} 8964 8965// Resource the Resource definition. 8966type Resource struct { 8967 // ID - READ-ONLY; Resource ID. 8968 ID *string `json:"id,omitempty"` 8969 // Name - READ-ONLY; Resource name. 8970 Name *string `json:"name,omitempty"` 8971 // Type - READ-ONLY; Resource type for API Management resource. 8972 Type *string `json:"type,omitempty"` 8973} 8974 8975// MarshalJSON is the custom marshaler for Resource. 8976func (r Resource) MarshalJSON() ([]byte, error) { 8977 objectMap := make(map[string]interface{}) 8978 return json.Marshal(objectMap) 8979} 8980 8981// ResourceSku describes an available API Management SKU. 8982type ResourceSku struct { 8983 // Name - Name of the Sku. Possible values include: 'SkuTypeDeveloper', 'SkuTypeStandard', 'SkuTypePremium', 'SkuTypeBasic', 'SkuTypeConsumption' 8984 Name SkuType `json:"name,omitempty"` 8985} 8986 8987// ResourceSkuCapacity describes scaling information of a SKU. 8988type ResourceSkuCapacity struct { 8989 // Minimum - READ-ONLY; The minimum capacity. 8990 Minimum *int32 `json:"minimum,omitempty"` 8991 // Maximum - READ-ONLY; The maximum capacity that can be set. 8992 Maximum *int32 `json:"maximum,omitempty"` 8993 // Default - READ-ONLY; The default capacity. 8994 Default *int32 `json:"default,omitempty"` 8995 // ScaleType - READ-ONLY; The scale type applicable to the sku. Possible values include: 'ResourceSkuCapacityScaleTypeAutomatic', 'ResourceSkuCapacityScaleTypeManual', 'ResourceSkuCapacityScaleTypeNone' 8996 ScaleType ResourceSkuCapacityScaleType `json:"scaleType,omitempty"` 8997} 8998 8999// MarshalJSON is the custom marshaler for ResourceSkuCapacity. 9000func (rsc ResourceSkuCapacity) MarshalJSON() ([]byte, error) { 9001 objectMap := make(map[string]interface{}) 9002 return json.Marshal(objectMap) 9003} 9004 9005// ResourceSkuResult describes an available API Management service SKU. 9006type ResourceSkuResult struct { 9007 // ResourceType - READ-ONLY; The type of resource the SKU applies to. 9008 ResourceType *string `json:"resourceType,omitempty"` 9009 // Sku - READ-ONLY; Specifies API Management SKU. 9010 Sku *ResourceSku `json:"sku,omitempty"` 9011 // Capacity - READ-ONLY; Specifies the number of API Management units. 9012 Capacity *ResourceSkuCapacity `json:"capacity,omitempty"` 9013} 9014 9015// MarshalJSON is the custom marshaler for ResourceSkuResult. 9016func (rsr ResourceSkuResult) MarshalJSON() ([]byte, error) { 9017 objectMap := make(map[string]interface{}) 9018 return json.Marshal(objectMap) 9019} 9020 9021// ResourceSkuResults the API Management service SKUs operation response. 9022type ResourceSkuResults struct { 9023 autorest.Response `json:"-"` 9024 // Value - The list of skus available for the service. 9025 Value *[]ResourceSkuResult `json:"value,omitempty"` 9026 // NextLink - The uri to fetch the next page of API Management service Skus. 9027 NextLink *string `json:"nextLink,omitempty"` 9028} 9029 9030// ResourceSkuResultsIterator provides access to a complete listing of ResourceSkuResult values. 9031type ResourceSkuResultsIterator struct { 9032 i int 9033 page ResourceSkuResultsPage 9034} 9035 9036// NextWithContext advances to the next value. If there was an error making 9037// the request the iterator does not advance and the error is returned. 9038func (iter *ResourceSkuResultsIterator) NextWithContext(ctx context.Context) (err error) { 9039 if tracing.IsEnabled() { 9040 ctx = tracing.StartSpan(ctx, fqdn+"/ResourceSkuResultsIterator.NextWithContext") 9041 defer func() { 9042 sc := -1 9043 if iter.Response().Response.Response != nil { 9044 sc = iter.Response().Response.Response.StatusCode 9045 } 9046 tracing.EndSpan(ctx, sc, err) 9047 }() 9048 } 9049 iter.i++ 9050 if iter.i < len(iter.page.Values()) { 9051 return nil 9052 } 9053 err = iter.page.NextWithContext(ctx) 9054 if err != nil { 9055 iter.i-- 9056 return err 9057 } 9058 iter.i = 0 9059 return nil 9060} 9061 9062// Next advances to the next value. If there was an error making 9063// the request the iterator does not advance and the error is returned. 9064// Deprecated: Use NextWithContext() instead. 9065func (iter *ResourceSkuResultsIterator) Next() error { 9066 return iter.NextWithContext(context.Background()) 9067} 9068 9069// NotDone returns true if the enumeration should be started or is not yet complete. 9070func (iter ResourceSkuResultsIterator) NotDone() bool { 9071 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 9072} 9073 9074// Response returns the raw server response from the last page request. 9075func (iter ResourceSkuResultsIterator) Response() ResourceSkuResults { 9076 return iter.page.Response() 9077} 9078 9079// Value returns the current value or a zero-initialized value if the 9080// iterator has advanced beyond the end of the collection. 9081func (iter ResourceSkuResultsIterator) Value() ResourceSkuResult { 9082 if !iter.page.NotDone() { 9083 return ResourceSkuResult{} 9084 } 9085 return iter.page.Values()[iter.i] 9086} 9087 9088// Creates a new instance of the ResourceSkuResultsIterator type. 9089func NewResourceSkuResultsIterator(page ResourceSkuResultsPage) ResourceSkuResultsIterator { 9090 return ResourceSkuResultsIterator{page: page} 9091} 9092 9093// IsEmpty returns true if the ListResult contains no values. 9094func (rsr ResourceSkuResults) IsEmpty() bool { 9095 return rsr.Value == nil || len(*rsr.Value) == 0 9096} 9097 9098// hasNextLink returns true if the NextLink is not empty. 9099func (rsr ResourceSkuResults) hasNextLink() bool { 9100 return rsr.NextLink != nil && len(*rsr.NextLink) != 0 9101} 9102 9103// resourceSkuResultsPreparer prepares a request to retrieve the next set of results. 9104// It returns nil if no more results exist. 9105func (rsr ResourceSkuResults) resourceSkuResultsPreparer(ctx context.Context) (*http.Request, error) { 9106 if !rsr.hasNextLink() { 9107 return nil, nil 9108 } 9109 return autorest.Prepare((&http.Request{}).WithContext(ctx), 9110 autorest.AsJSON(), 9111 autorest.AsGet(), 9112 autorest.WithBaseURL(to.String(rsr.NextLink))) 9113} 9114 9115// ResourceSkuResultsPage contains a page of ResourceSkuResult values. 9116type ResourceSkuResultsPage struct { 9117 fn func(context.Context, ResourceSkuResults) (ResourceSkuResults, error) 9118 rsr ResourceSkuResults 9119} 9120 9121// NextWithContext advances to the next page of values. If there was an error making 9122// the request the page does not advance and the error is returned. 9123func (page *ResourceSkuResultsPage) NextWithContext(ctx context.Context) (err error) { 9124 if tracing.IsEnabled() { 9125 ctx = tracing.StartSpan(ctx, fqdn+"/ResourceSkuResultsPage.NextWithContext") 9126 defer func() { 9127 sc := -1 9128 if page.Response().Response.Response != nil { 9129 sc = page.Response().Response.Response.StatusCode 9130 } 9131 tracing.EndSpan(ctx, sc, err) 9132 }() 9133 } 9134 for { 9135 next, err := page.fn(ctx, page.rsr) 9136 if err != nil { 9137 return err 9138 } 9139 page.rsr = next 9140 if !next.hasNextLink() || !next.IsEmpty() { 9141 break 9142 } 9143 } 9144 return nil 9145} 9146 9147// Next advances to the next page of values. If there was an error making 9148// the request the page does not advance and the error is returned. 9149// Deprecated: Use NextWithContext() instead. 9150func (page *ResourceSkuResultsPage) Next() error { 9151 return page.NextWithContext(context.Background()) 9152} 9153 9154// NotDone returns true if the page enumeration should be started or is not yet complete. 9155func (page ResourceSkuResultsPage) NotDone() bool { 9156 return !page.rsr.IsEmpty() 9157} 9158 9159// Response returns the raw server response from the last page request. 9160func (page ResourceSkuResultsPage) Response() ResourceSkuResults { 9161 return page.rsr 9162} 9163 9164// Values returns the slice of values for the current page or nil if there are no values. 9165func (page ResourceSkuResultsPage) Values() []ResourceSkuResult { 9166 if page.rsr.IsEmpty() { 9167 return nil 9168 } 9169 return *page.rsr.Value 9170} 9171 9172// Creates a new instance of the ResourceSkuResultsPage type. 9173func NewResourceSkuResultsPage(cur ResourceSkuResults, getNextPage func(context.Context, ResourceSkuResults) (ResourceSkuResults, error)) ResourceSkuResultsPage { 9174 return ResourceSkuResultsPage{ 9175 fn: getNextPage, 9176 rsr: cur, 9177 } 9178} 9179 9180// ResponseContract operation response details. 9181type ResponseContract struct { 9182 // StatusCode - Operation response HTTP status code. 9183 StatusCode *int32 `json:"statusCode,omitempty"` 9184 // Description - Operation response description. 9185 Description *string `json:"description,omitempty"` 9186 // Representations - Collection of operation response representations. 9187 Representations *[]RepresentationContract `json:"representations,omitempty"` 9188 // Headers - Collection of operation response headers. 9189 Headers *[]ParameterContract `json:"headers,omitempty"` 9190} 9191 9192// SamplingSettings sampling settings for Diagnostic. 9193type SamplingSettings struct { 9194 // SamplingType - Sampling type. Possible values include: 'Fixed' 9195 SamplingType SamplingType `json:"samplingType,omitempty"` 9196 // Percentage - Rate of sampling for fixed-rate sampling. 9197 Percentage *float64 `json:"percentage,omitempty"` 9198} 9199 9200// SaveConfigurationParameter save Tenant Configuration Contract details. 9201type SaveConfigurationParameter struct { 9202 // SaveConfigurationParameterProperties - Properties of the Save Configuration Parameters. 9203 *SaveConfigurationParameterProperties `json:"properties,omitempty"` 9204} 9205 9206// MarshalJSON is the custom marshaler for SaveConfigurationParameter. 9207func (scp SaveConfigurationParameter) MarshalJSON() ([]byte, error) { 9208 objectMap := make(map[string]interface{}) 9209 if scp.SaveConfigurationParameterProperties != nil { 9210 objectMap["properties"] = scp.SaveConfigurationParameterProperties 9211 } 9212 return json.Marshal(objectMap) 9213} 9214 9215// UnmarshalJSON is the custom unmarshaler for SaveConfigurationParameter struct. 9216func (scp *SaveConfigurationParameter) UnmarshalJSON(body []byte) error { 9217 var m map[string]*json.RawMessage 9218 err := json.Unmarshal(body, &m) 9219 if err != nil { 9220 return err 9221 } 9222 for k, v := range m { 9223 switch k { 9224 case "properties": 9225 if v != nil { 9226 var saveConfigurationParameterProperties SaveConfigurationParameterProperties 9227 err = json.Unmarshal(*v, &saveConfigurationParameterProperties) 9228 if err != nil { 9229 return err 9230 } 9231 scp.SaveConfigurationParameterProperties = &saveConfigurationParameterProperties 9232 } 9233 } 9234 } 9235 9236 return nil 9237} 9238 9239// SaveConfigurationParameterProperties parameters supplied to the Save Tenant Configuration operation. 9240type SaveConfigurationParameterProperties struct { 9241 // Branch - The name of the Git branch in which to commit the current configuration snapshot. 9242 Branch *string `json:"branch,omitempty"` 9243 // 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. 9244 Force *bool `json:"force,omitempty"` 9245} 9246 9247// SchemaCollection the response of the list schema operation. 9248type SchemaCollection struct { 9249 autorest.Response `json:"-"` 9250 // Value - READ-ONLY; Api Schema Contract value. 9251 Value *[]SchemaContract `json:"value,omitempty"` 9252 // NextLink - READ-ONLY; Next page link if any. 9253 NextLink *string `json:"nextLink,omitempty"` 9254} 9255 9256// MarshalJSON is the custom marshaler for SchemaCollection. 9257func (sc SchemaCollection) MarshalJSON() ([]byte, error) { 9258 objectMap := make(map[string]interface{}) 9259 return json.Marshal(objectMap) 9260} 9261 9262// SchemaCollectionIterator provides access to a complete listing of SchemaContract values. 9263type SchemaCollectionIterator struct { 9264 i int 9265 page SchemaCollectionPage 9266} 9267 9268// NextWithContext advances to the next value. If there was an error making 9269// the request the iterator does not advance and the error is returned. 9270func (iter *SchemaCollectionIterator) NextWithContext(ctx context.Context) (err error) { 9271 if tracing.IsEnabled() { 9272 ctx = tracing.StartSpan(ctx, fqdn+"/SchemaCollectionIterator.NextWithContext") 9273 defer func() { 9274 sc := -1 9275 if iter.Response().Response.Response != nil { 9276 sc = iter.Response().Response.Response.StatusCode 9277 } 9278 tracing.EndSpan(ctx, sc, err) 9279 }() 9280 } 9281 iter.i++ 9282 if iter.i < len(iter.page.Values()) { 9283 return nil 9284 } 9285 err = iter.page.NextWithContext(ctx) 9286 if err != nil { 9287 iter.i-- 9288 return err 9289 } 9290 iter.i = 0 9291 return nil 9292} 9293 9294// Next advances to the next value. If there was an error making 9295// the request the iterator does not advance and the error is returned. 9296// Deprecated: Use NextWithContext() instead. 9297func (iter *SchemaCollectionIterator) Next() error { 9298 return iter.NextWithContext(context.Background()) 9299} 9300 9301// NotDone returns true if the enumeration should be started or is not yet complete. 9302func (iter SchemaCollectionIterator) NotDone() bool { 9303 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 9304} 9305 9306// Response returns the raw server response from the last page request. 9307func (iter SchemaCollectionIterator) Response() SchemaCollection { 9308 return iter.page.Response() 9309} 9310 9311// Value returns the current value or a zero-initialized value if the 9312// iterator has advanced beyond the end of the collection. 9313func (iter SchemaCollectionIterator) Value() SchemaContract { 9314 if !iter.page.NotDone() { 9315 return SchemaContract{} 9316 } 9317 return iter.page.Values()[iter.i] 9318} 9319 9320// Creates a new instance of the SchemaCollectionIterator type. 9321func NewSchemaCollectionIterator(page SchemaCollectionPage) SchemaCollectionIterator { 9322 return SchemaCollectionIterator{page: page} 9323} 9324 9325// IsEmpty returns true if the ListResult contains no values. 9326func (sc SchemaCollection) IsEmpty() bool { 9327 return sc.Value == nil || len(*sc.Value) == 0 9328} 9329 9330// hasNextLink returns true if the NextLink is not empty. 9331func (sc SchemaCollection) hasNextLink() bool { 9332 return sc.NextLink != nil && len(*sc.NextLink) != 0 9333} 9334 9335// schemaCollectionPreparer prepares a request to retrieve the next set of results. 9336// It returns nil if no more results exist. 9337func (sc SchemaCollection) schemaCollectionPreparer(ctx context.Context) (*http.Request, error) { 9338 if !sc.hasNextLink() { 9339 return nil, nil 9340 } 9341 return autorest.Prepare((&http.Request{}).WithContext(ctx), 9342 autorest.AsJSON(), 9343 autorest.AsGet(), 9344 autorest.WithBaseURL(to.String(sc.NextLink))) 9345} 9346 9347// SchemaCollectionPage contains a page of SchemaContract values. 9348type SchemaCollectionPage struct { 9349 fn func(context.Context, SchemaCollection) (SchemaCollection, error) 9350 sc SchemaCollection 9351} 9352 9353// NextWithContext advances to the next page of values. If there was an error making 9354// the request the page does not advance and the error is returned. 9355func (page *SchemaCollectionPage) NextWithContext(ctx context.Context) (err error) { 9356 if tracing.IsEnabled() { 9357 ctx = tracing.StartSpan(ctx, fqdn+"/SchemaCollectionPage.NextWithContext") 9358 defer func() { 9359 sc := -1 9360 if page.Response().Response.Response != nil { 9361 sc = page.Response().Response.Response.StatusCode 9362 } 9363 tracing.EndSpan(ctx, sc, err) 9364 }() 9365 } 9366 for { 9367 next, err := page.fn(ctx, page.sc) 9368 if err != nil { 9369 return err 9370 } 9371 page.sc = next 9372 if !next.hasNextLink() || !next.IsEmpty() { 9373 break 9374 } 9375 } 9376 return nil 9377} 9378 9379// Next advances to the next page of values. If there was an error making 9380// the request the page does not advance and the error is returned. 9381// Deprecated: Use NextWithContext() instead. 9382func (page *SchemaCollectionPage) Next() error { 9383 return page.NextWithContext(context.Background()) 9384} 9385 9386// NotDone returns true if the page enumeration should be started or is not yet complete. 9387func (page SchemaCollectionPage) NotDone() bool { 9388 return !page.sc.IsEmpty() 9389} 9390 9391// Response returns the raw server response from the last page request. 9392func (page SchemaCollectionPage) Response() SchemaCollection { 9393 return page.sc 9394} 9395 9396// Values returns the slice of values for the current page or nil if there are no values. 9397func (page SchemaCollectionPage) Values() []SchemaContract { 9398 if page.sc.IsEmpty() { 9399 return nil 9400 } 9401 return *page.sc.Value 9402} 9403 9404// Creates a new instance of the SchemaCollectionPage type. 9405func NewSchemaCollectionPage(cur SchemaCollection, getNextPage func(context.Context, SchemaCollection) (SchemaCollection, error)) SchemaCollectionPage { 9406 return SchemaCollectionPage{ 9407 fn: getNextPage, 9408 sc: cur, 9409 } 9410} 9411 9412// SchemaContract schema Contract details. 9413type SchemaContract struct { 9414 autorest.Response `json:"-"` 9415 // SchemaContractProperties - Properties of the Schema. 9416 *SchemaContractProperties `json:"properties,omitempty"` 9417 // ID - READ-ONLY; Resource ID. 9418 ID *string `json:"id,omitempty"` 9419 // Name - READ-ONLY; Resource name. 9420 Name *string `json:"name,omitempty"` 9421 // Type - READ-ONLY; Resource type for API Management resource. 9422 Type *string `json:"type,omitempty"` 9423} 9424 9425// MarshalJSON is the custom marshaler for SchemaContract. 9426func (sc SchemaContract) MarshalJSON() ([]byte, error) { 9427 objectMap := make(map[string]interface{}) 9428 if sc.SchemaContractProperties != nil { 9429 objectMap["properties"] = sc.SchemaContractProperties 9430 } 9431 return json.Marshal(objectMap) 9432} 9433 9434// UnmarshalJSON is the custom unmarshaler for SchemaContract struct. 9435func (sc *SchemaContract) UnmarshalJSON(body []byte) error { 9436 var m map[string]*json.RawMessage 9437 err := json.Unmarshal(body, &m) 9438 if err != nil { 9439 return err 9440 } 9441 for k, v := range m { 9442 switch k { 9443 case "properties": 9444 if v != nil { 9445 var schemaContractProperties SchemaContractProperties 9446 err = json.Unmarshal(*v, &schemaContractProperties) 9447 if err != nil { 9448 return err 9449 } 9450 sc.SchemaContractProperties = &schemaContractProperties 9451 } 9452 case "id": 9453 if v != nil { 9454 var ID string 9455 err = json.Unmarshal(*v, &ID) 9456 if err != nil { 9457 return err 9458 } 9459 sc.ID = &ID 9460 } 9461 case "name": 9462 if v != nil { 9463 var name string 9464 err = json.Unmarshal(*v, &name) 9465 if err != nil { 9466 return err 9467 } 9468 sc.Name = &name 9469 } 9470 case "type": 9471 if v != nil { 9472 var typeVar string 9473 err = json.Unmarshal(*v, &typeVar) 9474 if err != nil { 9475 return err 9476 } 9477 sc.Type = &typeVar 9478 } 9479 } 9480 } 9481 9482 return nil 9483} 9484 9485// SchemaContractProperties schema contract Properties. 9486type SchemaContractProperties struct { 9487 // ContentType - Must be a valid a media type used in a Content-Type header as defined in the RFC 2616. Media type of the schema document (e.g. application/json, application/xml). </br> - `Swagger` Schema use `application/vnd.ms-azure-apim.swagger.definitions+json` </br> - `WSDL` Schema use `application/vnd.ms-azure-apim.xsd+xml` </br> - `OpenApi` Schema use `application/vnd.oai.openapi.components+json` </br> - `WADL Schema` use `application/vnd.ms-azure-apim.wadl.grammars+xml`. 9488 ContentType *string `json:"contentType,omitempty"` 9489 // Document - Properties of the Schema Document. 9490 Document interface{} `json:"document,omitempty"` 9491} 9492 9493// SchemaCreateOrUpdateContract schema Contract details. 9494type SchemaCreateOrUpdateContract struct { 9495 // SchemaCreateOrUpdateProperties - Properties of the Schema. 9496 *SchemaCreateOrUpdateProperties `json:"properties,omitempty"` 9497 // ID - READ-ONLY; Resource ID. 9498 ID *string `json:"id,omitempty"` 9499 // Name - READ-ONLY; Resource name. 9500 Name *string `json:"name,omitempty"` 9501 // Type - READ-ONLY; Resource type for API Management resource. 9502 Type *string `json:"type,omitempty"` 9503} 9504 9505// MarshalJSON is the custom marshaler for SchemaCreateOrUpdateContract. 9506func (scouc SchemaCreateOrUpdateContract) MarshalJSON() ([]byte, error) { 9507 objectMap := make(map[string]interface{}) 9508 if scouc.SchemaCreateOrUpdateProperties != nil { 9509 objectMap["properties"] = scouc.SchemaCreateOrUpdateProperties 9510 } 9511 return json.Marshal(objectMap) 9512} 9513 9514// UnmarshalJSON is the custom unmarshaler for SchemaCreateOrUpdateContract struct. 9515func (scouc *SchemaCreateOrUpdateContract) UnmarshalJSON(body []byte) error { 9516 var m map[string]*json.RawMessage 9517 err := json.Unmarshal(body, &m) 9518 if err != nil { 9519 return err 9520 } 9521 for k, v := range m { 9522 switch k { 9523 case "properties": 9524 if v != nil { 9525 var schemaCreateOrUpdateProperties SchemaCreateOrUpdateProperties 9526 err = json.Unmarshal(*v, &schemaCreateOrUpdateProperties) 9527 if err != nil { 9528 return err 9529 } 9530 scouc.SchemaCreateOrUpdateProperties = &schemaCreateOrUpdateProperties 9531 } 9532 case "id": 9533 if v != nil { 9534 var ID string 9535 err = json.Unmarshal(*v, &ID) 9536 if err != nil { 9537 return err 9538 } 9539 scouc.ID = &ID 9540 } 9541 case "name": 9542 if v != nil { 9543 var name string 9544 err = json.Unmarshal(*v, &name) 9545 if err != nil { 9546 return err 9547 } 9548 scouc.Name = &name 9549 } 9550 case "type": 9551 if v != nil { 9552 var typeVar string 9553 err = json.Unmarshal(*v, &typeVar) 9554 if err != nil { 9555 return err 9556 } 9557 scouc.Type = &typeVar 9558 } 9559 } 9560 } 9561 9562 return nil 9563} 9564 9565// SchemaCreateOrUpdateProperties API Schema create or update contract Properties. 9566type SchemaCreateOrUpdateProperties struct { 9567 // ContentType - Must be a valid a media type used in a Content-Type header as defined in the RFC 2616. Media type of the schema document (e.g. application/json, application/xml). </br> - `Swagger` Schema use `application/vnd.ms-azure-apim.swagger.definitions+json` </br> - `WSDL` Schema use `application/vnd.ms-azure-apim.xsd+xml` </br> - `OpenApi` Schema use `application/vnd.oai.openapi.components+json` </br> - `WADL Schema` use `application/vnd.ms-azure-apim.wadl.grammars+xml`. 9568 ContentType *string `json:"contentType,omitempty"` 9569 // SchemaDocumentProperties - Create or update Properties of the Schema Document. 9570 *SchemaDocumentProperties `json:"document,omitempty"` 9571} 9572 9573// MarshalJSON is the custom marshaler for SchemaCreateOrUpdateProperties. 9574func (scoup SchemaCreateOrUpdateProperties) MarshalJSON() ([]byte, error) { 9575 objectMap := make(map[string]interface{}) 9576 if scoup.ContentType != nil { 9577 objectMap["contentType"] = scoup.ContentType 9578 } 9579 if scoup.SchemaDocumentProperties != nil { 9580 objectMap["document"] = scoup.SchemaDocumentProperties 9581 } 9582 return json.Marshal(objectMap) 9583} 9584 9585// UnmarshalJSON is the custom unmarshaler for SchemaCreateOrUpdateProperties struct. 9586func (scoup *SchemaCreateOrUpdateProperties) UnmarshalJSON(body []byte) error { 9587 var m map[string]*json.RawMessage 9588 err := json.Unmarshal(body, &m) 9589 if err != nil { 9590 return err 9591 } 9592 for k, v := range m { 9593 switch k { 9594 case "contentType": 9595 if v != nil { 9596 var contentType string 9597 err = json.Unmarshal(*v, &contentType) 9598 if err != nil { 9599 return err 9600 } 9601 scoup.ContentType = &contentType 9602 } 9603 case "document": 9604 if v != nil { 9605 var schemaDocumentProperties SchemaDocumentProperties 9606 err = json.Unmarshal(*v, &schemaDocumentProperties) 9607 if err != nil { 9608 return err 9609 } 9610 scoup.SchemaDocumentProperties = &schemaDocumentProperties 9611 } 9612 } 9613 } 9614 9615 return nil 9616} 9617 9618// SchemaDocumentProperties schema Document Properties. 9619type SchemaDocumentProperties struct { 9620 // Value - Json escaped string defining the document representing the Schema. 9621 Value *string `json:"value,omitempty"` 9622} 9623 9624// ServiceApplyNetworkConfigurationParameters parameter supplied to the Apply Network configuration 9625// operation. 9626type ServiceApplyNetworkConfigurationParameters struct { 9627 // 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. 9628 Location *string `json:"location,omitempty"` 9629} 9630 9631// ServiceApplyNetworkConfigurationUpdatesFuture an abstraction for monitoring and retrieving the results 9632// of a long-running operation. 9633type ServiceApplyNetworkConfigurationUpdatesFuture struct { 9634 azure.FutureAPI 9635 // Result returns the result of the asynchronous operation. 9636 // If the operation has not completed it will return an error. 9637 Result func(ServiceClient) (ServiceResource, error) 9638} 9639 9640// UnmarshalJSON is the custom unmarshaller for CreateFuture. 9641func (future *ServiceApplyNetworkConfigurationUpdatesFuture) UnmarshalJSON(body []byte) error { 9642 var azFuture azure.Future 9643 if err := json.Unmarshal(body, &azFuture); err != nil { 9644 return err 9645 } 9646 future.FutureAPI = &azFuture 9647 future.Result = future.result 9648 return nil 9649} 9650 9651// result is the default implementation for ServiceApplyNetworkConfigurationUpdatesFuture.Result. 9652func (future *ServiceApplyNetworkConfigurationUpdatesFuture) result(client ServiceClient) (sr ServiceResource, err error) { 9653 var done bool 9654 done, err = future.DoneWithContext(context.Background(), client) 9655 if err != nil { 9656 err = autorest.NewErrorWithError(err, "apimanagement.ServiceApplyNetworkConfigurationUpdatesFuture", "Result", future.Response(), "Polling failure") 9657 return 9658 } 9659 if !done { 9660 sr.Response.Response = future.Response() 9661 err = azure.NewAsyncOpIncompleteError("apimanagement.ServiceApplyNetworkConfigurationUpdatesFuture") 9662 return 9663 } 9664 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 9665 if sr.Response.Response, err = future.GetResult(sender); err == nil && sr.Response.Response.StatusCode != http.StatusNoContent { 9666 sr, err = client.ApplyNetworkConfigurationUpdatesResponder(sr.Response.Response) 9667 if err != nil { 9668 err = autorest.NewErrorWithError(err, "apimanagement.ServiceApplyNetworkConfigurationUpdatesFuture", "Result", sr.Response.Response, "Failure responding to request") 9669 } 9670 } 9671 return 9672} 9673 9674// ServiceBackupFuture an abstraction for monitoring and retrieving the results of a long-running 9675// operation. 9676type ServiceBackupFuture struct { 9677 azure.FutureAPI 9678 // Result returns the result of the asynchronous operation. 9679 // If the operation has not completed it will return an error. 9680 Result func(ServiceClient) (ServiceResource, error) 9681} 9682 9683// UnmarshalJSON is the custom unmarshaller for CreateFuture. 9684func (future *ServiceBackupFuture) UnmarshalJSON(body []byte) error { 9685 var azFuture azure.Future 9686 if err := json.Unmarshal(body, &azFuture); err != nil { 9687 return err 9688 } 9689 future.FutureAPI = &azFuture 9690 future.Result = future.result 9691 return nil 9692} 9693 9694// result is the default implementation for ServiceBackupFuture.Result. 9695func (future *ServiceBackupFuture) result(client ServiceClient) (sr ServiceResource, err error) { 9696 var done bool 9697 done, err = future.DoneWithContext(context.Background(), client) 9698 if err != nil { 9699 err = autorest.NewErrorWithError(err, "apimanagement.ServiceBackupFuture", "Result", future.Response(), "Polling failure") 9700 return 9701 } 9702 if !done { 9703 sr.Response.Response = future.Response() 9704 err = azure.NewAsyncOpIncompleteError("apimanagement.ServiceBackupFuture") 9705 return 9706 } 9707 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 9708 if sr.Response.Response, err = future.GetResult(sender); err == nil && sr.Response.Response.StatusCode != http.StatusNoContent { 9709 sr, err = client.BackupResponder(sr.Response.Response) 9710 if err != nil { 9711 err = autorest.NewErrorWithError(err, "apimanagement.ServiceBackupFuture", "Result", sr.Response.Response, "Failure responding to request") 9712 } 9713 } 9714 return 9715} 9716 9717// ServiceBackupRestoreParameters parameters supplied to the Backup/Restore of an API Management service 9718// operation. 9719type ServiceBackupRestoreParameters struct { 9720 // StorageAccount - Azure Cloud Storage account (used to place/retrieve the backup) name. 9721 StorageAccount *string `json:"storageAccount,omitempty"` 9722 // AccessKey - Azure Cloud Storage account (used to place/retrieve the backup) access key. 9723 AccessKey *string `json:"accessKey,omitempty"` 9724 // ContainerName - Azure Cloud Storage blob container name used to place/retrieve the backup. 9725 ContainerName *string `json:"containerName,omitempty"` 9726 // BackupName - The name of the backup file to create. 9727 BackupName *string `json:"backupName,omitempty"` 9728} 9729 9730// ServiceBaseProperties base Properties of an API Management service resource description. 9731type ServiceBaseProperties struct { 9732 // NotificationSenderEmail - Email address from which the notification will be sent. 9733 NotificationSenderEmail *string `json:"notificationSenderEmail,omitempty"` 9734 // ProvisioningState - READ-ONLY; The current provisioning state of the API Management service which can be one of the following: Created/Activating/Succeeded/Updating/Failed/Stopped/Terminating/TerminationFailed/Deleted. 9735 ProvisioningState *string `json:"provisioningState,omitempty"` 9736 // TargetProvisioningState - READ-ONLY; The provisioning state of the API Management service, which is targeted by the long running operation started on the service. 9737 TargetProvisioningState *string `json:"targetProvisioningState,omitempty"` 9738 // CreatedAtUtc - READ-ONLY; Creation UTC date of the API Management service.The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. 9739 CreatedAtUtc *date.Time `json:"createdAtUtc,omitempty"` 9740 // GatewayURL - READ-ONLY; Gateway URL of the API Management service. 9741 GatewayURL *string `json:"gatewayUrl,omitempty"` 9742 // GatewayRegionalURL - READ-ONLY; Gateway URL of the API Management service in the Default Region. 9743 GatewayRegionalURL *string `json:"gatewayRegionalUrl,omitempty"` 9744 // PortalURL - READ-ONLY; Publisher portal endpoint Url of the API Management service. 9745 PortalURL *string `json:"portalUrl,omitempty"` 9746 // ManagementAPIURL - READ-ONLY; Management API endpoint URL of the API Management service. 9747 ManagementAPIURL *string `json:"managementApiUrl,omitempty"` 9748 // DeveloperPortalURL - READ-ONLY; Developer Portal endpoint URL of the API Management service. 9749 DeveloperPortalURL *string `json:"developerPortalUrl,omitempty"` 9750 // ScmURL - READ-ONLY; SCM endpoint URL of the API Management service. 9751 ScmURL *string `json:"scmUrl,omitempty"` 9752 // HostnameConfigurations - Custom hostname configuration of the API Management service. 9753 HostnameConfigurations *[]HostnameConfiguration `json:"hostnameConfigurations,omitempty"` 9754 // PublicIPAddresses - READ-ONLY; Public Static Load Balanced IP addresses of the API Management service in Primary region. Available only for Basic, Standard and Premium SKU. 9755 PublicIPAddresses *[]string `json:"publicIPAddresses,omitempty"` 9756 // PrivateIPAddresses - READ-ONLY; Private Static Load Balanced IP addresses of the API Management service in Primary region which is deployed in an Internal Virtual Network. Available only for Basic, Standard and Premium SKU. 9757 PrivateIPAddresses *[]string `json:"privateIPAddresses,omitempty"` 9758 // VirtualNetworkConfiguration - Virtual network configuration of the API Management service. 9759 VirtualNetworkConfiguration *VirtualNetworkConfiguration `json:"virtualNetworkConfiguration,omitempty"` 9760 // AdditionalLocations - Additional datacenter locations of the API Management service. 9761 AdditionalLocations *[]AdditionalLocation `json:"additionalLocations,omitempty"` 9762 // CustomProperties - Custom properties of the API Management service.</br>Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TripleDes168` will disable the cipher TLS_RSA_WITH_3DES_EDE_CBC_SHA for all TLS(1.0, 1.1 and 1.2).</br>Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls11` can be used to disable just TLS 1.1.</br>Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls10` can be used to disable TLS 1.0 on an API Management service.</br>Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls11` can be used to disable just TLS 1.1 for communications with backends.</br>Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls10` can be used to disable TLS 1.0 for communications with backends.</br>Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Protocols.Server.Http2` can be used to enable HTTP2 protocol on an API Management service.</br>Not specifying any of these properties on PATCH operation will reset omitted properties' values to their defaults. For all the settings except Http2 the default value is `True` if the service was created on or before April 1st 2018 and `False` otherwise. Http2 setting's default value is `False`.</br></br>You can disable any of next ciphers by using settings `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.[cipher_name]`:</br>TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA</br>TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA</br>TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA</br>TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA</br>TLS_RSA_WITH_AES_128_GCM_SHA256</br>TLS_RSA_WITH_AES_256_CBC_SHA256</br>TLS_RSA_WITH_AES_128_CBC_SHA256</br>TLS_RSA_WITH_AES_256_CBC_SHA</br>TLS_RSA_WITH_AES_128_CBC_SHA.</br>For example: `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TLS_RSA_WITH_AES_128_CBC_SHA256`:`false`. The default value is `true` for all of them. 9763 CustomProperties map[string]*string `json:"customProperties"` 9764 // Certificates - List of Certificates that need to be installed in the API Management service. Max supported certificates that can be installed is 10. 9765 Certificates *[]CertificateConfiguration `json:"certificates,omitempty"` 9766 // EnableClientCertificate - Property only meant to be used for Consumption SKU Service. This enforces a client certificate to be presented on each request to the gateway. This also enables the ability to authenticate the certificate in the policy on the gateway. 9767 EnableClientCertificate *bool `json:"enableClientCertificate,omitempty"` 9768 // VirtualNetworkType - The type of VPN in which API Management service needs to be configured in. None (Default Value) means the API Management service is not part of any Virtual Network, External means the API Management deployment is set up inside a Virtual Network having an Internet Facing Endpoint, and Internal means that API Management deployment is setup inside a Virtual Network having an Intranet Facing Endpoint only. Possible values include: 'VirtualNetworkTypeNone', 'VirtualNetworkTypeExternal', 'VirtualNetworkTypeInternal' 9769 VirtualNetworkType VirtualNetworkType `json:"virtualNetworkType,omitempty"` 9770} 9771 9772// MarshalJSON is the custom marshaler for ServiceBaseProperties. 9773func (sbp ServiceBaseProperties) MarshalJSON() ([]byte, error) { 9774 objectMap := make(map[string]interface{}) 9775 if sbp.NotificationSenderEmail != nil { 9776 objectMap["notificationSenderEmail"] = sbp.NotificationSenderEmail 9777 } 9778 if sbp.HostnameConfigurations != nil { 9779 objectMap["hostnameConfigurations"] = sbp.HostnameConfigurations 9780 } 9781 if sbp.VirtualNetworkConfiguration != nil { 9782 objectMap["virtualNetworkConfiguration"] = sbp.VirtualNetworkConfiguration 9783 } 9784 if sbp.AdditionalLocations != nil { 9785 objectMap["additionalLocations"] = sbp.AdditionalLocations 9786 } 9787 if sbp.CustomProperties != nil { 9788 objectMap["customProperties"] = sbp.CustomProperties 9789 } 9790 if sbp.Certificates != nil { 9791 objectMap["certificates"] = sbp.Certificates 9792 } 9793 if sbp.EnableClientCertificate != nil { 9794 objectMap["enableClientCertificate"] = sbp.EnableClientCertificate 9795 } 9796 if sbp.VirtualNetworkType != "" { 9797 objectMap["virtualNetworkType"] = sbp.VirtualNetworkType 9798 } 9799 return json.Marshal(objectMap) 9800} 9801 9802// ServiceCheckNameAvailabilityParameters parameters supplied to the CheckNameAvailability operation. 9803type ServiceCheckNameAvailabilityParameters struct { 9804 // Name - The name to check for availability. 9805 Name *string `json:"name,omitempty"` 9806} 9807 9808// ServiceCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 9809// operation. 9810type ServiceCreateOrUpdateFuture struct { 9811 azure.FutureAPI 9812 // Result returns the result of the asynchronous operation. 9813 // If the operation has not completed it will return an error. 9814 Result func(ServiceClient) (ServiceResource, error) 9815} 9816 9817// UnmarshalJSON is the custom unmarshaller for CreateFuture. 9818func (future *ServiceCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 9819 var azFuture azure.Future 9820 if err := json.Unmarshal(body, &azFuture); err != nil { 9821 return err 9822 } 9823 future.FutureAPI = &azFuture 9824 future.Result = future.result 9825 return nil 9826} 9827 9828// result is the default implementation for ServiceCreateOrUpdateFuture.Result. 9829func (future *ServiceCreateOrUpdateFuture) result(client ServiceClient) (sr ServiceResource, err error) { 9830 var done bool 9831 done, err = future.DoneWithContext(context.Background(), client) 9832 if err != nil { 9833 err = autorest.NewErrorWithError(err, "apimanagement.ServiceCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 9834 return 9835 } 9836 if !done { 9837 sr.Response.Response = future.Response() 9838 err = azure.NewAsyncOpIncompleteError("apimanagement.ServiceCreateOrUpdateFuture") 9839 return 9840 } 9841 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 9842 if sr.Response.Response, err = future.GetResult(sender); err == nil && sr.Response.Response.StatusCode != http.StatusNoContent { 9843 sr, err = client.CreateOrUpdateResponder(sr.Response.Response) 9844 if err != nil { 9845 err = autorest.NewErrorWithError(err, "apimanagement.ServiceCreateOrUpdateFuture", "Result", sr.Response.Response, "Failure responding to request") 9846 } 9847 } 9848 return 9849} 9850 9851// ServiceDeleteFuture an abstraction for monitoring and retrieving the results of a long-running 9852// operation. 9853type ServiceDeleteFuture struct { 9854 azure.FutureAPI 9855 // Result returns the result of the asynchronous operation. 9856 // If the operation has not completed it will return an error. 9857 Result func(ServiceClient) (ServiceResource, error) 9858} 9859 9860// UnmarshalJSON is the custom unmarshaller for CreateFuture. 9861func (future *ServiceDeleteFuture) UnmarshalJSON(body []byte) error { 9862 var azFuture azure.Future 9863 if err := json.Unmarshal(body, &azFuture); err != nil { 9864 return err 9865 } 9866 future.FutureAPI = &azFuture 9867 future.Result = future.result 9868 return nil 9869} 9870 9871// result is the default implementation for ServiceDeleteFuture.Result. 9872func (future *ServiceDeleteFuture) result(client ServiceClient) (sr ServiceResource, err error) { 9873 var done bool 9874 done, err = future.DoneWithContext(context.Background(), client) 9875 if err != nil { 9876 err = autorest.NewErrorWithError(err, "apimanagement.ServiceDeleteFuture", "Result", future.Response(), "Polling failure") 9877 return 9878 } 9879 if !done { 9880 sr.Response.Response = future.Response() 9881 err = azure.NewAsyncOpIncompleteError("apimanagement.ServiceDeleteFuture") 9882 return 9883 } 9884 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 9885 if sr.Response.Response, err = future.GetResult(sender); err == nil && sr.Response.Response.StatusCode != http.StatusNoContent { 9886 sr, err = client.DeleteResponder(sr.Response.Response) 9887 if err != nil { 9888 err = autorest.NewErrorWithError(err, "apimanagement.ServiceDeleteFuture", "Result", sr.Response.Response, "Failure responding to request") 9889 } 9890 } 9891 return 9892} 9893 9894// ServiceGetSsoTokenResult the response of the GetSsoToken operation. 9895type ServiceGetSsoTokenResult struct { 9896 autorest.Response `json:"-"` 9897 // RedirectURI - Redirect URL to the Publisher Portal containing the SSO token. 9898 RedirectURI *string `json:"redirectUri,omitempty"` 9899} 9900 9901// ServiceIdentity identity properties of the Api Management service resource. 9902type ServiceIdentity struct { 9903 // Type - The identity type. Currently the only supported type is 'SystemAssigned'. 9904 Type *string `json:"type,omitempty"` 9905 // PrincipalID - READ-ONLY; The principal id of the identity. 9906 PrincipalID *uuid.UUID `json:"principalId,omitempty"` 9907 // TenantID - READ-ONLY; The client tenant id of the identity. 9908 TenantID *uuid.UUID `json:"tenantId,omitempty"` 9909} 9910 9911// MarshalJSON is the custom marshaler for ServiceIdentity. 9912func (si ServiceIdentity) MarshalJSON() ([]byte, error) { 9913 objectMap := make(map[string]interface{}) 9914 if si.Type != nil { 9915 objectMap["type"] = si.Type 9916 } 9917 return json.Marshal(objectMap) 9918} 9919 9920// ServiceListResult the response of the List API Management services operation. 9921type ServiceListResult struct { 9922 autorest.Response `json:"-"` 9923 // Value - Result of the List API Management services operation. 9924 Value *[]ServiceResource `json:"value,omitempty"` 9925 // NextLink - Link to the next set of results. Not empty if Value contains incomplete list of API Management services. 9926 NextLink *string `json:"nextLink,omitempty"` 9927} 9928 9929// ServiceListResultIterator provides access to a complete listing of ServiceResource values. 9930type ServiceListResultIterator struct { 9931 i int 9932 page ServiceListResultPage 9933} 9934 9935// NextWithContext advances to the next value. If there was an error making 9936// the request the iterator does not advance and the error is returned. 9937func (iter *ServiceListResultIterator) NextWithContext(ctx context.Context) (err error) { 9938 if tracing.IsEnabled() { 9939 ctx = tracing.StartSpan(ctx, fqdn+"/ServiceListResultIterator.NextWithContext") 9940 defer func() { 9941 sc := -1 9942 if iter.Response().Response.Response != nil { 9943 sc = iter.Response().Response.Response.StatusCode 9944 } 9945 tracing.EndSpan(ctx, sc, err) 9946 }() 9947 } 9948 iter.i++ 9949 if iter.i < len(iter.page.Values()) { 9950 return nil 9951 } 9952 err = iter.page.NextWithContext(ctx) 9953 if err != nil { 9954 iter.i-- 9955 return err 9956 } 9957 iter.i = 0 9958 return nil 9959} 9960 9961// Next advances to the next value. If there was an error making 9962// the request the iterator does not advance and the error is returned. 9963// Deprecated: Use NextWithContext() instead. 9964func (iter *ServiceListResultIterator) Next() error { 9965 return iter.NextWithContext(context.Background()) 9966} 9967 9968// NotDone returns true if the enumeration should be started or is not yet complete. 9969func (iter ServiceListResultIterator) NotDone() bool { 9970 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 9971} 9972 9973// Response returns the raw server response from the last page request. 9974func (iter ServiceListResultIterator) Response() ServiceListResult { 9975 return iter.page.Response() 9976} 9977 9978// Value returns the current value or a zero-initialized value if the 9979// iterator has advanced beyond the end of the collection. 9980func (iter ServiceListResultIterator) Value() ServiceResource { 9981 if !iter.page.NotDone() { 9982 return ServiceResource{} 9983 } 9984 return iter.page.Values()[iter.i] 9985} 9986 9987// Creates a new instance of the ServiceListResultIterator type. 9988func NewServiceListResultIterator(page ServiceListResultPage) ServiceListResultIterator { 9989 return ServiceListResultIterator{page: page} 9990} 9991 9992// IsEmpty returns true if the ListResult contains no values. 9993func (slr ServiceListResult) IsEmpty() bool { 9994 return slr.Value == nil || len(*slr.Value) == 0 9995} 9996 9997// hasNextLink returns true if the NextLink is not empty. 9998func (slr ServiceListResult) hasNextLink() bool { 9999 return slr.NextLink != nil && len(*slr.NextLink) != 0 10000} 10001 10002// serviceListResultPreparer prepares a request to retrieve the next set of results. 10003// It returns nil if no more results exist. 10004func (slr ServiceListResult) serviceListResultPreparer(ctx context.Context) (*http.Request, error) { 10005 if !slr.hasNextLink() { 10006 return nil, nil 10007 } 10008 return autorest.Prepare((&http.Request{}).WithContext(ctx), 10009 autorest.AsJSON(), 10010 autorest.AsGet(), 10011 autorest.WithBaseURL(to.String(slr.NextLink))) 10012} 10013 10014// ServiceListResultPage contains a page of ServiceResource values. 10015type ServiceListResultPage struct { 10016 fn func(context.Context, ServiceListResult) (ServiceListResult, error) 10017 slr ServiceListResult 10018} 10019 10020// NextWithContext advances to the next page of values. If there was an error making 10021// the request the page does not advance and the error is returned. 10022func (page *ServiceListResultPage) NextWithContext(ctx context.Context) (err error) { 10023 if tracing.IsEnabled() { 10024 ctx = tracing.StartSpan(ctx, fqdn+"/ServiceListResultPage.NextWithContext") 10025 defer func() { 10026 sc := -1 10027 if page.Response().Response.Response != nil { 10028 sc = page.Response().Response.Response.StatusCode 10029 } 10030 tracing.EndSpan(ctx, sc, err) 10031 }() 10032 } 10033 for { 10034 next, err := page.fn(ctx, page.slr) 10035 if err != nil { 10036 return err 10037 } 10038 page.slr = next 10039 if !next.hasNextLink() || !next.IsEmpty() { 10040 break 10041 } 10042 } 10043 return nil 10044} 10045 10046// Next advances to the next page of values. If there was an error making 10047// the request the page does not advance and the error is returned. 10048// Deprecated: Use NextWithContext() instead. 10049func (page *ServiceListResultPage) Next() error { 10050 return page.NextWithContext(context.Background()) 10051} 10052 10053// NotDone returns true if the page enumeration should be started or is not yet complete. 10054func (page ServiceListResultPage) NotDone() bool { 10055 return !page.slr.IsEmpty() 10056} 10057 10058// Response returns the raw server response from the last page request. 10059func (page ServiceListResultPage) Response() ServiceListResult { 10060 return page.slr 10061} 10062 10063// Values returns the slice of values for the current page or nil if there are no values. 10064func (page ServiceListResultPage) Values() []ServiceResource { 10065 if page.slr.IsEmpty() { 10066 return nil 10067 } 10068 return *page.slr.Value 10069} 10070 10071// Creates a new instance of the ServiceListResultPage type. 10072func NewServiceListResultPage(cur ServiceListResult, getNextPage func(context.Context, ServiceListResult) (ServiceListResult, error)) ServiceListResultPage { 10073 return ServiceListResultPage{ 10074 fn: getNextPage, 10075 slr: cur, 10076 } 10077} 10078 10079// ServiceNameAvailabilityResult response of the CheckNameAvailability operation. 10080type ServiceNameAvailabilityResult struct { 10081 autorest.Response `json:"-"` 10082 // NameAvailable - READ-ONLY; True if the name is available and can be used to create a new API Management service; otherwise false. 10083 NameAvailable *bool `json:"nameAvailable,omitempty"` 10084 // Message - READ-ONLY; If reason == invalid, provide the user with the reason why the given name is invalid, and provide the resource naming requirements so that the user can select a valid name. If reason == AlreadyExists, explain that <resourceName> is already in use, and direct them to select a different name. 10085 Message *string `json:"message,omitempty"` 10086 // 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' 10087 Reason NameAvailabilityReason `json:"reason,omitempty"` 10088} 10089 10090// MarshalJSON is the custom marshaler for ServiceNameAvailabilityResult. 10091func (snar ServiceNameAvailabilityResult) MarshalJSON() ([]byte, error) { 10092 objectMap := make(map[string]interface{}) 10093 if snar.Reason != "" { 10094 objectMap["reason"] = snar.Reason 10095 } 10096 return json.Marshal(objectMap) 10097} 10098 10099// ServiceProperties properties of an API Management service resource description. 10100type ServiceProperties struct { 10101 // PublisherEmail - Publisher email. 10102 PublisherEmail *string `json:"publisherEmail,omitempty"` 10103 // PublisherName - Publisher name. 10104 PublisherName *string `json:"publisherName,omitempty"` 10105 // NotificationSenderEmail - Email address from which the notification will be sent. 10106 NotificationSenderEmail *string `json:"notificationSenderEmail,omitempty"` 10107 // ProvisioningState - READ-ONLY; The current provisioning state of the API Management service which can be one of the following: Created/Activating/Succeeded/Updating/Failed/Stopped/Terminating/TerminationFailed/Deleted. 10108 ProvisioningState *string `json:"provisioningState,omitempty"` 10109 // TargetProvisioningState - READ-ONLY; The provisioning state of the API Management service, which is targeted by the long running operation started on the service. 10110 TargetProvisioningState *string `json:"targetProvisioningState,omitempty"` 10111 // CreatedAtUtc - READ-ONLY; Creation UTC date of the API Management service.The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. 10112 CreatedAtUtc *date.Time `json:"createdAtUtc,omitempty"` 10113 // GatewayURL - READ-ONLY; Gateway URL of the API Management service. 10114 GatewayURL *string `json:"gatewayUrl,omitempty"` 10115 // GatewayRegionalURL - READ-ONLY; Gateway URL of the API Management service in the Default Region. 10116 GatewayRegionalURL *string `json:"gatewayRegionalUrl,omitempty"` 10117 // PortalURL - READ-ONLY; Publisher portal endpoint Url of the API Management service. 10118 PortalURL *string `json:"portalUrl,omitempty"` 10119 // ManagementAPIURL - READ-ONLY; Management API endpoint URL of the API Management service. 10120 ManagementAPIURL *string `json:"managementApiUrl,omitempty"` 10121 // DeveloperPortalURL - READ-ONLY; Developer Portal endpoint URL of the API Management service. 10122 DeveloperPortalURL *string `json:"developerPortalUrl,omitempty"` 10123 // ScmURL - READ-ONLY; SCM endpoint URL of the API Management service. 10124 ScmURL *string `json:"scmUrl,omitempty"` 10125 // HostnameConfigurations - Custom hostname configuration of the API Management service. 10126 HostnameConfigurations *[]HostnameConfiguration `json:"hostnameConfigurations,omitempty"` 10127 // PublicIPAddresses - READ-ONLY; Public Static Load Balanced IP addresses of the API Management service in Primary region. Available only for Basic, Standard and Premium SKU. 10128 PublicIPAddresses *[]string `json:"publicIPAddresses,omitempty"` 10129 // PrivateIPAddresses - READ-ONLY; Private Static Load Balanced IP addresses of the API Management service in Primary region which is deployed in an Internal Virtual Network. Available only for Basic, Standard and Premium SKU. 10130 PrivateIPAddresses *[]string `json:"privateIPAddresses,omitempty"` 10131 // VirtualNetworkConfiguration - Virtual network configuration of the API Management service. 10132 VirtualNetworkConfiguration *VirtualNetworkConfiguration `json:"virtualNetworkConfiguration,omitempty"` 10133 // AdditionalLocations - Additional datacenter locations of the API Management service. 10134 AdditionalLocations *[]AdditionalLocation `json:"additionalLocations,omitempty"` 10135 // CustomProperties - Custom properties of the API Management service.</br>Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TripleDes168` will disable the cipher TLS_RSA_WITH_3DES_EDE_CBC_SHA for all TLS(1.0, 1.1 and 1.2).</br>Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls11` can be used to disable just TLS 1.1.</br>Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls10` can be used to disable TLS 1.0 on an API Management service.</br>Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls11` can be used to disable just TLS 1.1 for communications with backends.</br>Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls10` can be used to disable TLS 1.0 for communications with backends.</br>Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Protocols.Server.Http2` can be used to enable HTTP2 protocol on an API Management service.</br>Not specifying any of these properties on PATCH operation will reset omitted properties' values to their defaults. For all the settings except Http2 the default value is `True` if the service was created on or before April 1st 2018 and `False` otherwise. Http2 setting's default value is `False`.</br></br>You can disable any of next ciphers by using settings `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.[cipher_name]`:</br>TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA</br>TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA</br>TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA</br>TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA</br>TLS_RSA_WITH_AES_128_GCM_SHA256</br>TLS_RSA_WITH_AES_256_CBC_SHA256</br>TLS_RSA_WITH_AES_128_CBC_SHA256</br>TLS_RSA_WITH_AES_256_CBC_SHA</br>TLS_RSA_WITH_AES_128_CBC_SHA.</br>For example: `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TLS_RSA_WITH_AES_128_CBC_SHA256`:`false`. The default value is `true` for all of them. 10136 CustomProperties map[string]*string `json:"customProperties"` 10137 // Certificates - List of Certificates that need to be installed in the API Management service. Max supported certificates that can be installed is 10. 10138 Certificates *[]CertificateConfiguration `json:"certificates,omitempty"` 10139 // EnableClientCertificate - Property only meant to be used for Consumption SKU Service. This enforces a client certificate to be presented on each request to the gateway. This also enables the ability to authenticate the certificate in the policy on the gateway. 10140 EnableClientCertificate *bool `json:"enableClientCertificate,omitempty"` 10141 // VirtualNetworkType - The type of VPN in which API Management service needs to be configured in. None (Default Value) means the API Management service is not part of any Virtual Network, External means the API Management deployment is set up inside a Virtual Network having an Internet Facing Endpoint, and Internal means that API Management deployment is setup inside a Virtual Network having an Intranet Facing Endpoint only. Possible values include: 'VirtualNetworkTypeNone', 'VirtualNetworkTypeExternal', 'VirtualNetworkTypeInternal' 10142 VirtualNetworkType VirtualNetworkType `json:"virtualNetworkType,omitempty"` 10143} 10144 10145// MarshalJSON is the custom marshaler for ServiceProperties. 10146func (sp ServiceProperties) MarshalJSON() ([]byte, error) { 10147 objectMap := make(map[string]interface{}) 10148 if sp.PublisherEmail != nil { 10149 objectMap["publisherEmail"] = sp.PublisherEmail 10150 } 10151 if sp.PublisherName != nil { 10152 objectMap["publisherName"] = sp.PublisherName 10153 } 10154 if sp.NotificationSenderEmail != nil { 10155 objectMap["notificationSenderEmail"] = sp.NotificationSenderEmail 10156 } 10157 if sp.HostnameConfigurations != nil { 10158 objectMap["hostnameConfigurations"] = sp.HostnameConfigurations 10159 } 10160 if sp.VirtualNetworkConfiguration != nil { 10161 objectMap["virtualNetworkConfiguration"] = sp.VirtualNetworkConfiguration 10162 } 10163 if sp.AdditionalLocations != nil { 10164 objectMap["additionalLocations"] = sp.AdditionalLocations 10165 } 10166 if sp.CustomProperties != nil { 10167 objectMap["customProperties"] = sp.CustomProperties 10168 } 10169 if sp.Certificates != nil { 10170 objectMap["certificates"] = sp.Certificates 10171 } 10172 if sp.EnableClientCertificate != nil { 10173 objectMap["enableClientCertificate"] = sp.EnableClientCertificate 10174 } 10175 if sp.VirtualNetworkType != "" { 10176 objectMap["virtualNetworkType"] = sp.VirtualNetworkType 10177 } 10178 return json.Marshal(objectMap) 10179} 10180 10181// ServiceResource a single API Management service resource in List or Get response. 10182type ServiceResource struct { 10183 autorest.Response `json:"-"` 10184 // ServiceProperties - Properties of the API Management service. 10185 *ServiceProperties `json:"properties,omitempty"` 10186 // Sku - SKU properties of the API Management service. 10187 Sku *ServiceSkuProperties `json:"sku,omitempty"` 10188 // Identity - Managed service identity of the Api Management service. 10189 Identity *ServiceIdentity `json:"identity,omitempty"` 10190 // Location - Resource location. 10191 Location *string `json:"location,omitempty"` 10192 // Etag - READ-ONLY; ETag of the resource. 10193 Etag *string `json:"etag,omitempty"` 10194 // ID - READ-ONLY; Resource ID. 10195 ID *string `json:"id,omitempty"` 10196 // Name - READ-ONLY; Resource name. 10197 Name *string `json:"name,omitempty"` 10198 // Type - READ-ONLY; Resource type for API Management resource is set to Microsoft.ApiManagement. 10199 Type *string `json:"type,omitempty"` 10200 // Tags - Resource tags. 10201 Tags map[string]*string `json:"tags"` 10202} 10203 10204// MarshalJSON is the custom marshaler for ServiceResource. 10205func (sr ServiceResource) MarshalJSON() ([]byte, error) { 10206 objectMap := make(map[string]interface{}) 10207 if sr.ServiceProperties != nil { 10208 objectMap["properties"] = sr.ServiceProperties 10209 } 10210 if sr.Sku != nil { 10211 objectMap["sku"] = sr.Sku 10212 } 10213 if sr.Identity != nil { 10214 objectMap["identity"] = sr.Identity 10215 } 10216 if sr.Location != nil { 10217 objectMap["location"] = sr.Location 10218 } 10219 if sr.Tags != nil { 10220 objectMap["tags"] = sr.Tags 10221 } 10222 return json.Marshal(objectMap) 10223} 10224 10225// UnmarshalJSON is the custom unmarshaler for ServiceResource struct. 10226func (sr *ServiceResource) UnmarshalJSON(body []byte) error { 10227 var m map[string]*json.RawMessage 10228 err := json.Unmarshal(body, &m) 10229 if err != nil { 10230 return err 10231 } 10232 for k, v := range m { 10233 switch k { 10234 case "properties": 10235 if v != nil { 10236 var serviceProperties ServiceProperties 10237 err = json.Unmarshal(*v, &serviceProperties) 10238 if err != nil { 10239 return err 10240 } 10241 sr.ServiceProperties = &serviceProperties 10242 } 10243 case "sku": 10244 if v != nil { 10245 var sku ServiceSkuProperties 10246 err = json.Unmarshal(*v, &sku) 10247 if err != nil { 10248 return err 10249 } 10250 sr.Sku = &sku 10251 } 10252 case "identity": 10253 if v != nil { 10254 var identity ServiceIdentity 10255 err = json.Unmarshal(*v, &identity) 10256 if err != nil { 10257 return err 10258 } 10259 sr.Identity = &identity 10260 } 10261 case "location": 10262 if v != nil { 10263 var location string 10264 err = json.Unmarshal(*v, &location) 10265 if err != nil { 10266 return err 10267 } 10268 sr.Location = &location 10269 } 10270 case "etag": 10271 if v != nil { 10272 var etag string 10273 err = json.Unmarshal(*v, &etag) 10274 if err != nil { 10275 return err 10276 } 10277 sr.Etag = &etag 10278 } 10279 case "id": 10280 if v != nil { 10281 var ID string 10282 err = json.Unmarshal(*v, &ID) 10283 if err != nil { 10284 return err 10285 } 10286 sr.ID = &ID 10287 } 10288 case "name": 10289 if v != nil { 10290 var name string 10291 err = json.Unmarshal(*v, &name) 10292 if err != nil { 10293 return err 10294 } 10295 sr.Name = &name 10296 } 10297 case "type": 10298 if v != nil { 10299 var typeVar string 10300 err = json.Unmarshal(*v, &typeVar) 10301 if err != nil { 10302 return err 10303 } 10304 sr.Type = &typeVar 10305 } 10306 case "tags": 10307 if v != nil { 10308 var tags map[string]*string 10309 err = json.Unmarshal(*v, &tags) 10310 if err != nil { 10311 return err 10312 } 10313 sr.Tags = tags 10314 } 10315 } 10316 } 10317 10318 return nil 10319} 10320 10321// ServiceRestoreFuture an abstraction for monitoring and retrieving the results of a long-running 10322// operation. 10323type ServiceRestoreFuture struct { 10324 azure.FutureAPI 10325 // Result returns the result of the asynchronous operation. 10326 // If the operation has not completed it will return an error. 10327 Result func(ServiceClient) (ServiceResource, error) 10328} 10329 10330// UnmarshalJSON is the custom unmarshaller for CreateFuture. 10331func (future *ServiceRestoreFuture) UnmarshalJSON(body []byte) error { 10332 var azFuture azure.Future 10333 if err := json.Unmarshal(body, &azFuture); err != nil { 10334 return err 10335 } 10336 future.FutureAPI = &azFuture 10337 future.Result = future.result 10338 return nil 10339} 10340 10341// result is the default implementation for ServiceRestoreFuture.Result. 10342func (future *ServiceRestoreFuture) result(client ServiceClient) (sr ServiceResource, err error) { 10343 var done bool 10344 done, err = future.DoneWithContext(context.Background(), client) 10345 if err != nil { 10346 err = autorest.NewErrorWithError(err, "apimanagement.ServiceRestoreFuture", "Result", future.Response(), "Polling failure") 10347 return 10348 } 10349 if !done { 10350 sr.Response.Response = future.Response() 10351 err = azure.NewAsyncOpIncompleteError("apimanagement.ServiceRestoreFuture") 10352 return 10353 } 10354 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 10355 if sr.Response.Response, err = future.GetResult(sender); err == nil && sr.Response.Response.StatusCode != http.StatusNoContent { 10356 sr, err = client.RestoreResponder(sr.Response.Response) 10357 if err != nil { 10358 err = autorest.NewErrorWithError(err, "apimanagement.ServiceRestoreFuture", "Result", sr.Response.Response, "Failure responding to request") 10359 } 10360 } 10361 return 10362} 10363 10364// ServiceSkuProperties API Management service resource SKU properties. 10365type ServiceSkuProperties struct { 10366 // Name - Name of the Sku. Possible values include: 'SkuTypeDeveloper', 'SkuTypeStandard', 'SkuTypePremium', 'SkuTypeBasic', 'SkuTypeConsumption' 10367 Name SkuType `json:"name,omitempty"` 10368 // Capacity - Capacity of the SKU (number of deployed units of the SKU). 10369 Capacity *int32 `json:"capacity,omitempty"` 10370} 10371 10372// ServiceUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 10373// operation. 10374type ServiceUpdateFuture struct { 10375 azure.FutureAPI 10376 // Result returns the result of the asynchronous operation. 10377 // If the operation has not completed it will return an error. 10378 Result func(ServiceClient) (ServiceResource, error) 10379} 10380 10381// UnmarshalJSON is the custom unmarshaller for CreateFuture. 10382func (future *ServiceUpdateFuture) UnmarshalJSON(body []byte) error { 10383 var azFuture azure.Future 10384 if err := json.Unmarshal(body, &azFuture); err != nil { 10385 return err 10386 } 10387 future.FutureAPI = &azFuture 10388 future.Result = future.result 10389 return nil 10390} 10391 10392// result is the default implementation for ServiceUpdateFuture.Result. 10393func (future *ServiceUpdateFuture) result(client ServiceClient) (sr ServiceResource, err error) { 10394 var done bool 10395 done, err = future.DoneWithContext(context.Background(), client) 10396 if err != nil { 10397 err = autorest.NewErrorWithError(err, "apimanagement.ServiceUpdateFuture", "Result", future.Response(), "Polling failure") 10398 return 10399 } 10400 if !done { 10401 sr.Response.Response = future.Response() 10402 err = azure.NewAsyncOpIncompleteError("apimanagement.ServiceUpdateFuture") 10403 return 10404 } 10405 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 10406 if sr.Response.Response, err = future.GetResult(sender); err == nil && sr.Response.Response.StatusCode != http.StatusNoContent { 10407 sr, err = client.UpdateResponder(sr.Response.Response) 10408 if err != nil { 10409 err = autorest.NewErrorWithError(err, "apimanagement.ServiceUpdateFuture", "Result", sr.Response.Response, "Failure responding to request") 10410 } 10411 } 10412 return 10413} 10414 10415// ServiceUpdateParameters parameter supplied to Update Api Management Service. 10416type ServiceUpdateParameters struct { 10417 // ServiceUpdateProperties - Properties of the API Management service. 10418 *ServiceUpdateProperties `json:"properties,omitempty"` 10419 // Sku - SKU properties of the API Management service. 10420 Sku *ServiceSkuProperties `json:"sku,omitempty"` 10421 // Identity - Managed service identity of the Api Management service. 10422 Identity *ServiceIdentity `json:"identity,omitempty"` 10423 // Etag - READ-ONLY; ETag of the resource. 10424 Etag *string `json:"etag,omitempty"` 10425 // ID - READ-ONLY; Resource ID. 10426 ID *string `json:"id,omitempty"` 10427 // Name - READ-ONLY; Resource name. 10428 Name *string `json:"name,omitempty"` 10429 // Type - READ-ONLY; Resource type for API Management resource is set to Microsoft.ApiManagement. 10430 Type *string `json:"type,omitempty"` 10431 // Tags - Resource tags. 10432 Tags map[string]*string `json:"tags"` 10433} 10434 10435// MarshalJSON is the custom marshaler for ServiceUpdateParameters. 10436func (sup ServiceUpdateParameters) MarshalJSON() ([]byte, error) { 10437 objectMap := make(map[string]interface{}) 10438 if sup.ServiceUpdateProperties != nil { 10439 objectMap["properties"] = sup.ServiceUpdateProperties 10440 } 10441 if sup.Sku != nil { 10442 objectMap["sku"] = sup.Sku 10443 } 10444 if sup.Identity != nil { 10445 objectMap["identity"] = sup.Identity 10446 } 10447 if sup.Tags != nil { 10448 objectMap["tags"] = sup.Tags 10449 } 10450 return json.Marshal(objectMap) 10451} 10452 10453// UnmarshalJSON is the custom unmarshaler for ServiceUpdateParameters struct. 10454func (sup *ServiceUpdateParameters) UnmarshalJSON(body []byte) error { 10455 var m map[string]*json.RawMessage 10456 err := json.Unmarshal(body, &m) 10457 if err != nil { 10458 return err 10459 } 10460 for k, v := range m { 10461 switch k { 10462 case "properties": 10463 if v != nil { 10464 var serviceUpdateProperties ServiceUpdateProperties 10465 err = json.Unmarshal(*v, &serviceUpdateProperties) 10466 if err != nil { 10467 return err 10468 } 10469 sup.ServiceUpdateProperties = &serviceUpdateProperties 10470 } 10471 case "sku": 10472 if v != nil { 10473 var sku ServiceSkuProperties 10474 err = json.Unmarshal(*v, &sku) 10475 if err != nil { 10476 return err 10477 } 10478 sup.Sku = &sku 10479 } 10480 case "identity": 10481 if v != nil { 10482 var identity ServiceIdentity 10483 err = json.Unmarshal(*v, &identity) 10484 if err != nil { 10485 return err 10486 } 10487 sup.Identity = &identity 10488 } 10489 case "etag": 10490 if v != nil { 10491 var etag string 10492 err = json.Unmarshal(*v, &etag) 10493 if err != nil { 10494 return err 10495 } 10496 sup.Etag = &etag 10497 } 10498 case "id": 10499 if v != nil { 10500 var ID string 10501 err = json.Unmarshal(*v, &ID) 10502 if err != nil { 10503 return err 10504 } 10505 sup.ID = &ID 10506 } 10507 case "name": 10508 if v != nil { 10509 var name string 10510 err = json.Unmarshal(*v, &name) 10511 if err != nil { 10512 return err 10513 } 10514 sup.Name = &name 10515 } 10516 case "type": 10517 if v != nil { 10518 var typeVar string 10519 err = json.Unmarshal(*v, &typeVar) 10520 if err != nil { 10521 return err 10522 } 10523 sup.Type = &typeVar 10524 } 10525 case "tags": 10526 if v != nil { 10527 var tags map[string]*string 10528 err = json.Unmarshal(*v, &tags) 10529 if err != nil { 10530 return err 10531 } 10532 sup.Tags = tags 10533 } 10534 } 10535 } 10536 10537 return nil 10538} 10539 10540// ServiceUpdateProperties properties of an API Management service resource description. 10541type ServiceUpdateProperties struct { 10542 // PublisherEmail - Publisher email. 10543 PublisherEmail *string `json:"publisherEmail,omitempty"` 10544 // PublisherName - Publisher name. 10545 PublisherName *string `json:"publisherName,omitempty"` 10546 // NotificationSenderEmail - Email address from which the notification will be sent. 10547 NotificationSenderEmail *string `json:"notificationSenderEmail,omitempty"` 10548 // ProvisioningState - READ-ONLY; The current provisioning state of the API Management service which can be one of the following: Created/Activating/Succeeded/Updating/Failed/Stopped/Terminating/TerminationFailed/Deleted. 10549 ProvisioningState *string `json:"provisioningState,omitempty"` 10550 // TargetProvisioningState - READ-ONLY; The provisioning state of the API Management service, which is targeted by the long running operation started on the service. 10551 TargetProvisioningState *string `json:"targetProvisioningState,omitempty"` 10552 // CreatedAtUtc - READ-ONLY; Creation UTC date of the API Management service.The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. 10553 CreatedAtUtc *date.Time `json:"createdAtUtc,omitempty"` 10554 // GatewayURL - READ-ONLY; Gateway URL of the API Management service. 10555 GatewayURL *string `json:"gatewayUrl,omitempty"` 10556 // GatewayRegionalURL - READ-ONLY; Gateway URL of the API Management service in the Default Region. 10557 GatewayRegionalURL *string `json:"gatewayRegionalUrl,omitempty"` 10558 // PortalURL - READ-ONLY; Publisher portal endpoint Url of the API Management service. 10559 PortalURL *string `json:"portalUrl,omitempty"` 10560 // ManagementAPIURL - READ-ONLY; Management API endpoint URL of the API Management service. 10561 ManagementAPIURL *string `json:"managementApiUrl,omitempty"` 10562 // DeveloperPortalURL - READ-ONLY; Developer Portal endpoint URL of the API Management service. 10563 DeveloperPortalURL *string `json:"developerPortalUrl,omitempty"` 10564 // ScmURL - READ-ONLY; SCM endpoint URL of the API Management service. 10565 ScmURL *string `json:"scmUrl,omitempty"` 10566 // HostnameConfigurations - Custom hostname configuration of the API Management service. 10567 HostnameConfigurations *[]HostnameConfiguration `json:"hostnameConfigurations,omitempty"` 10568 // PublicIPAddresses - READ-ONLY; Public Static Load Balanced IP addresses of the API Management service in Primary region. Available only for Basic, Standard and Premium SKU. 10569 PublicIPAddresses *[]string `json:"publicIPAddresses,omitempty"` 10570 // PrivateIPAddresses - READ-ONLY; Private Static Load Balanced IP addresses of the API Management service in Primary region which is deployed in an Internal Virtual Network. Available only for Basic, Standard and Premium SKU. 10571 PrivateIPAddresses *[]string `json:"privateIPAddresses,omitempty"` 10572 // VirtualNetworkConfiguration - Virtual network configuration of the API Management service. 10573 VirtualNetworkConfiguration *VirtualNetworkConfiguration `json:"virtualNetworkConfiguration,omitempty"` 10574 // AdditionalLocations - Additional datacenter locations of the API Management service. 10575 AdditionalLocations *[]AdditionalLocation `json:"additionalLocations,omitempty"` 10576 // CustomProperties - Custom properties of the API Management service.</br>Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TripleDes168` will disable the cipher TLS_RSA_WITH_3DES_EDE_CBC_SHA for all TLS(1.0, 1.1 and 1.2).</br>Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls11` can be used to disable just TLS 1.1.</br>Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls10` can be used to disable TLS 1.0 on an API Management service.</br>Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls11` can be used to disable just TLS 1.1 for communications with backends.</br>Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls10` can be used to disable TLS 1.0 for communications with backends.</br>Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Protocols.Server.Http2` can be used to enable HTTP2 protocol on an API Management service.</br>Not specifying any of these properties on PATCH operation will reset omitted properties' values to their defaults. For all the settings except Http2 the default value is `True` if the service was created on or before April 1st 2018 and `False` otherwise. Http2 setting's default value is `False`.</br></br>You can disable any of next ciphers by using settings `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.[cipher_name]`:</br>TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA</br>TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA</br>TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA</br>TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA</br>TLS_RSA_WITH_AES_128_GCM_SHA256</br>TLS_RSA_WITH_AES_256_CBC_SHA256</br>TLS_RSA_WITH_AES_128_CBC_SHA256</br>TLS_RSA_WITH_AES_256_CBC_SHA</br>TLS_RSA_WITH_AES_128_CBC_SHA.</br>For example: `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TLS_RSA_WITH_AES_128_CBC_SHA256`:`false`. The default value is `true` for all of them. 10577 CustomProperties map[string]*string `json:"customProperties"` 10578 // Certificates - List of Certificates that need to be installed in the API Management service. Max supported certificates that can be installed is 10. 10579 Certificates *[]CertificateConfiguration `json:"certificates,omitempty"` 10580 // EnableClientCertificate - Property only meant to be used for Consumption SKU Service. This enforces a client certificate to be presented on each request to the gateway. This also enables the ability to authenticate the certificate in the policy on the gateway. 10581 EnableClientCertificate *bool `json:"enableClientCertificate,omitempty"` 10582 // VirtualNetworkType - The type of VPN in which API Management service needs to be configured in. None (Default Value) means the API Management service is not part of any Virtual Network, External means the API Management deployment is set up inside a Virtual Network having an Internet Facing Endpoint, and Internal means that API Management deployment is setup inside a Virtual Network having an Intranet Facing Endpoint only. Possible values include: 'VirtualNetworkTypeNone', 'VirtualNetworkTypeExternal', 'VirtualNetworkTypeInternal' 10583 VirtualNetworkType VirtualNetworkType `json:"virtualNetworkType,omitempty"` 10584} 10585 10586// MarshalJSON is the custom marshaler for ServiceUpdateProperties. 10587func (sup ServiceUpdateProperties) MarshalJSON() ([]byte, error) { 10588 objectMap := make(map[string]interface{}) 10589 if sup.PublisherEmail != nil { 10590 objectMap["publisherEmail"] = sup.PublisherEmail 10591 } 10592 if sup.PublisherName != nil { 10593 objectMap["publisherName"] = sup.PublisherName 10594 } 10595 if sup.NotificationSenderEmail != nil { 10596 objectMap["notificationSenderEmail"] = sup.NotificationSenderEmail 10597 } 10598 if sup.HostnameConfigurations != nil { 10599 objectMap["hostnameConfigurations"] = sup.HostnameConfigurations 10600 } 10601 if sup.VirtualNetworkConfiguration != nil { 10602 objectMap["virtualNetworkConfiguration"] = sup.VirtualNetworkConfiguration 10603 } 10604 if sup.AdditionalLocations != nil { 10605 objectMap["additionalLocations"] = sup.AdditionalLocations 10606 } 10607 if sup.CustomProperties != nil { 10608 objectMap["customProperties"] = sup.CustomProperties 10609 } 10610 if sup.Certificates != nil { 10611 objectMap["certificates"] = sup.Certificates 10612 } 10613 if sup.EnableClientCertificate != nil { 10614 objectMap["enableClientCertificate"] = sup.EnableClientCertificate 10615 } 10616 if sup.VirtualNetworkType != "" { 10617 objectMap["virtualNetworkType"] = sup.VirtualNetworkType 10618 } 10619 return json.Marshal(objectMap) 10620} 10621 10622// SubscriptionCollection paged Subscriptions list representation. 10623type SubscriptionCollection struct { 10624 autorest.Response `json:"-"` 10625 // Value - Page values. 10626 Value *[]SubscriptionContract `json:"value,omitempty"` 10627 // NextLink - Next page link if any. 10628 NextLink *string `json:"nextLink,omitempty"` 10629} 10630 10631// SubscriptionCollectionIterator provides access to a complete listing of SubscriptionContract values. 10632type SubscriptionCollectionIterator struct { 10633 i int 10634 page SubscriptionCollectionPage 10635} 10636 10637// NextWithContext advances to the next value. If there was an error making 10638// the request the iterator does not advance and the error is returned. 10639func (iter *SubscriptionCollectionIterator) NextWithContext(ctx context.Context) (err error) { 10640 if tracing.IsEnabled() { 10641 ctx = tracing.StartSpan(ctx, fqdn+"/SubscriptionCollectionIterator.NextWithContext") 10642 defer func() { 10643 sc := -1 10644 if iter.Response().Response.Response != nil { 10645 sc = iter.Response().Response.Response.StatusCode 10646 } 10647 tracing.EndSpan(ctx, sc, err) 10648 }() 10649 } 10650 iter.i++ 10651 if iter.i < len(iter.page.Values()) { 10652 return nil 10653 } 10654 err = iter.page.NextWithContext(ctx) 10655 if err != nil { 10656 iter.i-- 10657 return err 10658 } 10659 iter.i = 0 10660 return nil 10661} 10662 10663// Next advances to the next value. If there was an error making 10664// the request the iterator does not advance and the error is returned. 10665// Deprecated: Use NextWithContext() instead. 10666func (iter *SubscriptionCollectionIterator) Next() error { 10667 return iter.NextWithContext(context.Background()) 10668} 10669 10670// NotDone returns true if the enumeration should be started or is not yet complete. 10671func (iter SubscriptionCollectionIterator) NotDone() bool { 10672 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 10673} 10674 10675// Response returns the raw server response from the last page request. 10676func (iter SubscriptionCollectionIterator) Response() SubscriptionCollection { 10677 return iter.page.Response() 10678} 10679 10680// Value returns the current value or a zero-initialized value if the 10681// iterator has advanced beyond the end of the collection. 10682func (iter SubscriptionCollectionIterator) Value() SubscriptionContract { 10683 if !iter.page.NotDone() { 10684 return SubscriptionContract{} 10685 } 10686 return iter.page.Values()[iter.i] 10687} 10688 10689// Creates a new instance of the SubscriptionCollectionIterator type. 10690func NewSubscriptionCollectionIterator(page SubscriptionCollectionPage) SubscriptionCollectionIterator { 10691 return SubscriptionCollectionIterator{page: page} 10692} 10693 10694// IsEmpty returns true if the ListResult contains no values. 10695func (sc SubscriptionCollection) IsEmpty() bool { 10696 return sc.Value == nil || len(*sc.Value) == 0 10697} 10698 10699// hasNextLink returns true if the NextLink is not empty. 10700func (sc SubscriptionCollection) hasNextLink() bool { 10701 return sc.NextLink != nil && len(*sc.NextLink) != 0 10702} 10703 10704// subscriptionCollectionPreparer prepares a request to retrieve the next set of results. 10705// It returns nil if no more results exist. 10706func (sc SubscriptionCollection) subscriptionCollectionPreparer(ctx context.Context) (*http.Request, error) { 10707 if !sc.hasNextLink() { 10708 return nil, nil 10709 } 10710 return autorest.Prepare((&http.Request{}).WithContext(ctx), 10711 autorest.AsJSON(), 10712 autorest.AsGet(), 10713 autorest.WithBaseURL(to.String(sc.NextLink))) 10714} 10715 10716// SubscriptionCollectionPage contains a page of SubscriptionContract values. 10717type SubscriptionCollectionPage struct { 10718 fn func(context.Context, SubscriptionCollection) (SubscriptionCollection, error) 10719 sc SubscriptionCollection 10720} 10721 10722// NextWithContext advances to the next page of values. If there was an error making 10723// the request the page does not advance and the error is returned. 10724func (page *SubscriptionCollectionPage) NextWithContext(ctx context.Context) (err error) { 10725 if tracing.IsEnabled() { 10726 ctx = tracing.StartSpan(ctx, fqdn+"/SubscriptionCollectionPage.NextWithContext") 10727 defer func() { 10728 sc := -1 10729 if page.Response().Response.Response != nil { 10730 sc = page.Response().Response.Response.StatusCode 10731 } 10732 tracing.EndSpan(ctx, sc, err) 10733 }() 10734 } 10735 for { 10736 next, err := page.fn(ctx, page.sc) 10737 if err != nil { 10738 return err 10739 } 10740 page.sc = next 10741 if !next.hasNextLink() || !next.IsEmpty() { 10742 break 10743 } 10744 } 10745 return nil 10746} 10747 10748// Next advances to the next page of values. If there was an error making 10749// the request the page does not advance and the error is returned. 10750// Deprecated: Use NextWithContext() instead. 10751func (page *SubscriptionCollectionPage) Next() error { 10752 return page.NextWithContext(context.Background()) 10753} 10754 10755// NotDone returns true if the page enumeration should be started or is not yet complete. 10756func (page SubscriptionCollectionPage) NotDone() bool { 10757 return !page.sc.IsEmpty() 10758} 10759 10760// Response returns the raw server response from the last page request. 10761func (page SubscriptionCollectionPage) Response() SubscriptionCollection { 10762 return page.sc 10763} 10764 10765// Values returns the slice of values for the current page or nil if there are no values. 10766func (page SubscriptionCollectionPage) Values() []SubscriptionContract { 10767 if page.sc.IsEmpty() { 10768 return nil 10769 } 10770 return *page.sc.Value 10771} 10772 10773// Creates a new instance of the SubscriptionCollectionPage type. 10774func NewSubscriptionCollectionPage(cur SubscriptionCollection, getNextPage func(context.Context, SubscriptionCollection) (SubscriptionCollection, error)) SubscriptionCollectionPage { 10775 return SubscriptionCollectionPage{ 10776 fn: getNextPage, 10777 sc: cur, 10778 } 10779} 10780 10781// SubscriptionContract subscription details. 10782type SubscriptionContract struct { 10783 autorest.Response `json:"-"` 10784 // SubscriptionContractProperties - Subscription contract properties. 10785 *SubscriptionContractProperties `json:"properties,omitempty"` 10786 // ID - READ-ONLY; Resource ID. 10787 ID *string `json:"id,omitempty"` 10788 // Name - READ-ONLY; Resource name. 10789 Name *string `json:"name,omitempty"` 10790 // Type - READ-ONLY; Resource type for API Management resource. 10791 Type *string `json:"type,omitempty"` 10792} 10793 10794// MarshalJSON is the custom marshaler for SubscriptionContract. 10795func (sc SubscriptionContract) MarshalJSON() ([]byte, error) { 10796 objectMap := make(map[string]interface{}) 10797 if sc.SubscriptionContractProperties != nil { 10798 objectMap["properties"] = sc.SubscriptionContractProperties 10799 } 10800 return json.Marshal(objectMap) 10801} 10802 10803// UnmarshalJSON is the custom unmarshaler for SubscriptionContract struct. 10804func (sc *SubscriptionContract) UnmarshalJSON(body []byte) error { 10805 var m map[string]*json.RawMessage 10806 err := json.Unmarshal(body, &m) 10807 if err != nil { 10808 return err 10809 } 10810 for k, v := range m { 10811 switch k { 10812 case "properties": 10813 if v != nil { 10814 var subscriptionContractProperties SubscriptionContractProperties 10815 err = json.Unmarshal(*v, &subscriptionContractProperties) 10816 if err != nil { 10817 return err 10818 } 10819 sc.SubscriptionContractProperties = &subscriptionContractProperties 10820 } 10821 case "id": 10822 if v != nil { 10823 var ID string 10824 err = json.Unmarshal(*v, &ID) 10825 if err != nil { 10826 return err 10827 } 10828 sc.ID = &ID 10829 } 10830 case "name": 10831 if v != nil { 10832 var name string 10833 err = json.Unmarshal(*v, &name) 10834 if err != nil { 10835 return err 10836 } 10837 sc.Name = &name 10838 } 10839 case "type": 10840 if v != nil { 10841 var typeVar string 10842 err = json.Unmarshal(*v, &typeVar) 10843 if err != nil { 10844 return err 10845 } 10846 sc.Type = &typeVar 10847 } 10848 } 10849 } 10850 10851 return nil 10852} 10853 10854// SubscriptionContractProperties subscription details. 10855type SubscriptionContractProperties struct { 10856 // OwnerID - The user resource identifier of the subscription owner. The value is a valid relative URL in the format of /users/{userId} where {userId} is a user identifier. 10857 OwnerID *string `json:"ownerId,omitempty"` 10858 // Scope - Scope like /products/{productId} or /apis or /apis/{apiId}. 10859 Scope *string `json:"scope,omitempty"` 10860 // DisplayName - The name of the subscription, or null if the subscription has no name. 10861 DisplayName *string `json:"displayName,omitempty"` 10862 // 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' 10863 State SubscriptionState `json:"state,omitempty"` 10864 // CreatedDate - READ-ONLY; Subscription creation date. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. 10865 CreatedDate *date.Time `json:"createdDate,omitempty"` 10866 // 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. 10867 StartDate *date.Time `json:"startDate,omitempty"` 10868 // 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. 10869 ExpirationDate *date.Time `json:"expirationDate,omitempty"` 10870 // 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. 10871 EndDate *date.Time `json:"endDate,omitempty"` 10872 // 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. 10873 NotificationDate *date.Time `json:"notificationDate,omitempty"` 10874 // PrimaryKey - Subscription primary key. 10875 PrimaryKey *string `json:"primaryKey,omitempty"` 10876 // SecondaryKey - Subscription secondary key. 10877 SecondaryKey *string `json:"secondaryKey,omitempty"` 10878 // StateComment - Optional subscription comment added by an administrator. 10879 StateComment *string `json:"stateComment,omitempty"` 10880 // AllowTracing - Determines whether tracing is enabled 10881 AllowTracing *bool `json:"allowTracing,omitempty"` 10882} 10883 10884// MarshalJSON is the custom marshaler for SubscriptionContractProperties. 10885func (scp SubscriptionContractProperties) MarshalJSON() ([]byte, error) { 10886 objectMap := make(map[string]interface{}) 10887 if scp.OwnerID != nil { 10888 objectMap["ownerId"] = scp.OwnerID 10889 } 10890 if scp.Scope != nil { 10891 objectMap["scope"] = scp.Scope 10892 } 10893 if scp.DisplayName != nil { 10894 objectMap["displayName"] = scp.DisplayName 10895 } 10896 if scp.State != "" { 10897 objectMap["state"] = scp.State 10898 } 10899 if scp.StartDate != nil { 10900 objectMap["startDate"] = scp.StartDate 10901 } 10902 if scp.ExpirationDate != nil { 10903 objectMap["expirationDate"] = scp.ExpirationDate 10904 } 10905 if scp.EndDate != nil { 10906 objectMap["endDate"] = scp.EndDate 10907 } 10908 if scp.NotificationDate != nil { 10909 objectMap["notificationDate"] = scp.NotificationDate 10910 } 10911 if scp.PrimaryKey != nil { 10912 objectMap["primaryKey"] = scp.PrimaryKey 10913 } 10914 if scp.SecondaryKey != nil { 10915 objectMap["secondaryKey"] = scp.SecondaryKey 10916 } 10917 if scp.StateComment != nil { 10918 objectMap["stateComment"] = scp.StateComment 10919 } 10920 if scp.AllowTracing != nil { 10921 objectMap["allowTracing"] = scp.AllowTracing 10922 } 10923 return json.Marshal(objectMap) 10924} 10925 10926// SubscriptionCreateParameterProperties parameters supplied to the Create subscription operation. 10927type SubscriptionCreateParameterProperties struct { 10928 // OwnerID - User (user id path) for whom subscription is being created in form /users/{userId} 10929 OwnerID *string `json:"ownerId,omitempty"` 10930 // Scope - Scope like /products/{productId} or /apis or /apis/{apiId}. 10931 Scope *string `json:"scope,omitempty"` 10932 // DisplayName - Subscription name. 10933 DisplayName *string `json:"displayName,omitempty"` 10934 // PrimaryKey - Primary subscription key. If not specified during request key will be generated automatically. 10935 PrimaryKey *string `json:"primaryKey,omitempty"` 10936 // SecondaryKey - Secondary subscription key. If not specified during request key will be generated automatically. 10937 SecondaryKey *string `json:"secondaryKey,omitempty"` 10938 // 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' 10939 State SubscriptionState `json:"state,omitempty"` 10940 // AllowTracing - Determines whether tracing can be enabled 10941 AllowTracing *bool `json:"allowTracing,omitempty"` 10942} 10943 10944// SubscriptionCreateParameters subscription create details. 10945type SubscriptionCreateParameters struct { 10946 // SubscriptionCreateParameterProperties - Subscription contract properties. 10947 *SubscriptionCreateParameterProperties `json:"properties,omitempty"` 10948} 10949 10950// MarshalJSON is the custom marshaler for SubscriptionCreateParameters. 10951func (scp SubscriptionCreateParameters) MarshalJSON() ([]byte, error) { 10952 objectMap := make(map[string]interface{}) 10953 if scp.SubscriptionCreateParameterProperties != nil { 10954 objectMap["properties"] = scp.SubscriptionCreateParameterProperties 10955 } 10956 return json.Marshal(objectMap) 10957} 10958 10959// UnmarshalJSON is the custom unmarshaler for SubscriptionCreateParameters struct. 10960func (scp *SubscriptionCreateParameters) UnmarshalJSON(body []byte) error { 10961 var m map[string]*json.RawMessage 10962 err := json.Unmarshal(body, &m) 10963 if err != nil { 10964 return err 10965 } 10966 for k, v := range m { 10967 switch k { 10968 case "properties": 10969 if v != nil { 10970 var subscriptionCreateParameterProperties SubscriptionCreateParameterProperties 10971 err = json.Unmarshal(*v, &subscriptionCreateParameterProperties) 10972 if err != nil { 10973 return err 10974 } 10975 scp.SubscriptionCreateParameterProperties = &subscriptionCreateParameterProperties 10976 } 10977 } 10978 } 10979 10980 return nil 10981} 10982 10983// SubscriptionKeyParameterNamesContract subscription key parameter names details. 10984type SubscriptionKeyParameterNamesContract struct { 10985 // Header - Subscription key header name. 10986 Header *string `json:"header,omitempty"` 10987 // Query - Subscription key query string parameter name. 10988 Query *string `json:"query,omitempty"` 10989} 10990 10991// SubscriptionsDelegationSettingsProperties subscriptions delegation settings properties. 10992type SubscriptionsDelegationSettingsProperties struct { 10993 // Enabled - Enable or disable delegation for subscriptions. 10994 Enabled *bool `json:"enabled,omitempty"` 10995} 10996 10997// SubscriptionUpdateParameterProperties parameters supplied to the Update subscription operation. 10998type SubscriptionUpdateParameterProperties struct { 10999 // OwnerID - User identifier path: /users/{userId} 11000 OwnerID *string `json:"ownerId,omitempty"` 11001 // Scope - Scope like /products/{productId} or /apis or /apis/{apiId} 11002 Scope *string `json:"scope,omitempty"` 11003 // 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. 11004 ExpirationDate *date.Time `json:"expirationDate,omitempty"` 11005 // DisplayName - Subscription name. 11006 DisplayName *string `json:"displayName,omitempty"` 11007 // PrimaryKey - Primary subscription key. 11008 PrimaryKey *string `json:"primaryKey,omitempty"` 11009 // SecondaryKey - Secondary subscription key. 11010 SecondaryKey *string `json:"secondaryKey,omitempty"` 11011 // 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' 11012 State SubscriptionState `json:"state,omitempty"` 11013 // StateComment - Comments describing subscription state change by the administrator. 11014 StateComment *string `json:"stateComment,omitempty"` 11015 // AllowTracing - Determines whether tracing can be enabled 11016 AllowTracing *bool `json:"allowTracing,omitempty"` 11017} 11018 11019// SubscriptionUpdateParameters subscription update details. 11020type SubscriptionUpdateParameters struct { 11021 // SubscriptionUpdateParameterProperties - Subscription Update contract properties. 11022 *SubscriptionUpdateParameterProperties `json:"properties,omitempty"` 11023} 11024 11025// MarshalJSON is the custom marshaler for SubscriptionUpdateParameters. 11026func (sup SubscriptionUpdateParameters) MarshalJSON() ([]byte, error) { 11027 objectMap := make(map[string]interface{}) 11028 if sup.SubscriptionUpdateParameterProperties != nil { 11029 objectMap["properties"] = sup.SubscriptionUpdateParameterProperties 11030 } 11031 return json.Marshal(objectMap) 11032} 11033 11034// UnmarshalJSON is the custom unmarshaler for SubscriptionUpdateParameters struct. 11035func (sup *SubscriptionUpdateParameters) UnmarshalJSON(body []byte) error { 11036 var m map[string]*json.RawMessage 11037 err := json.Unmarshal(body, &m) 11038 if err != nil { 11039 return err 11040 } 11041 for k, v := range m { 11042 switch k { 11043 case "properties": 11044 if v != nil { 11045 var subscriptionUpdateParameterProperties SubscriptionUpdateParameterProperties 11046 err = json.Unmarshal(*v, &subscriptionUpdateParameterProperties) 11047 if err != nil { 11048 return err 11049 } 11050 sup.SubscriptionUpdateParameterProperties = &subscriptionUpdateParameterProperties 11051 } 11052 } 11053 } 11054 11055 return nil 11056} 11057 11058// TagCollection paged Tag list representation. 11059type TagCollection struct { 11060 autorest.Response `json:"-"` 11061 // Value - Page values. 11062 Value *[]TagContract `json:"value,omitempty"` 11063 // NextLink - Next page link if any. 11064 NextLink *string `json:"nextLink,omitempty"` 11065} 11066 11067// TagCollectionIterator provides access to a complete listing of TagContract values. 11068type TagCollectionIterator struct { 11069 i int 11070 page TagCollectionPage 11071} 11072 11073// NextWithContext advances to the next value. If there was an error making 11074// the request the iterator does not advance and the error is returned. 11075func (iter *TagCollectionIterator) NextWithContext(ctx context.Context) (err error) { 11076 if tracing.IsEnabled() { 11077 ctx = tracing.StartSpan(ctx, fqdn+"/TagCollectionIterator.NextWithContext") 11078 defer func() { 11079 sc := -1 11080 if iter.Response().Response.Response != nil { 11081 sc = iter.Response().Response.Response.StatusCode 11082 } 11083 tracing.EndSpan(ctx, sc, err) 11084 }() 11085 } 11086 iter.i++ 11087 if iter.i < len(iter.page.Values()) { 11088 return nil 11089 } 11090 err = iter.page.NextWithContext(ctx) 11091 if err != nil { 11092 iter.i-- 11093 return err 11094 } 11095 iter.i = 0 11096 return nil 11097} 11098 11099// Next advances to the next value. If there was an error making 11100// the request the iterator does not advance and the error is returned. 11101// Deprecated: Use NextWithContext() instead. 11102func (iter *TagCollectionIterator) Next() error { 11103 return iter.NextWithContext(context.Background()) 11104} 11105 11106// NotDone returns true if the enumeration should be started or is not yet complete. 11107func (iter TagCollectionIterator) NotDone() bool { 11108 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 11109} 11110 11111// Response returns the raw server response from the last page request. 11112func (iter TagCollectionIterator) Response() TagCollection { 11113 return iter.page.Response() 11114} 11115 11116// Value returns the current value or a zero-initialized value if the 11117// iterator has advanced beyond the end of the collection. 11118func (iter TagCollectionIterator) Value() TagContract { 11119 if !iter.page.NotDone() { 11120 return TagContract{} 11121 } 11122 return iter.page.Values()[iter.i] 11123} 11124 11125// Creates a new instance of the TagCollectionIterator type. 11126func NewTagCollectionIterator(page TagCollectionPage) TagCollectionIterator { 11127 return TagCollectionIterator{page: page} 11128} 11129 11130// IsEmpty returns true if the ListResult contains no values. 11131func (tc TagCollection) IsEmpty() bool { 11132 return tc.Value == nil || len(*tc.Value) == 0 11133} 11134 11135// hasNextLink returns true if the NextLink is not empty. 11136func (tc TagCollection) hasNextLink() bool { 11137 return tc.NextLink != nil && len(*tc.NextLink) != 0 11138} 11139 11140// tagCollectionPreparer prepares a request to retrieve the next set of results. 11141// It returns nil if no more results exist. 11142func (tc TagCollection) tagCollectionPreparer(ctx context.Context) (*http.Request, error) { 11143 if !tc.hasNextLink() { 11144 return nil, nil 11145 } 11146 return autorest.Prepare((&http.Request{}).WithContext(ctx), 11147 autorest.AsJSON(), 11148 autorest.AsGet(), 11149 autorest.WithBaseURL(to.String(tc.NextLink))) 11150} 11151 11152// TagCollectionPage contains a page of TagContract values. 11153type TagCollectionPage struct { 11154 fn func(context.Context, TagCollection) (TagCollection, error) 11155 tc TagCollection 11156} 11157 11158// NextWithContext advances to the next page of values. If there was an error making 11159// the request the page does not advance and the error is returned. 11160func (page *TagCollectionPage) NextWithContext(ctx context.Context) (err error) { 11161 if tracing.IsEnabled() { 11162 ctx = tracing.StartSpan(ctx, fqdn+"/TagCollectionPage.NextWithContext") 11163 defer func() { 11164 sc := -1 11165 if page.Response().Response.Response != nil { 11166 sc = page.Response().Response.Response.StatusCode 11167 } 11168 tracing.EndSpan(ctx, sc, err) 11169 }() 11170 } 11171 for { 11172 next, err := page.fn(ctx, page.tc) 11173 if err != nil { 11174 return err 11175 } 11176 page.tc = next 11177 if !next.hasNextLink() || !next.IsEmpty() { 11178 break 11179 } 11180 } 11181 return nil 11182} 11183 11184// Next advances to the next page of values. If there was an error making 11185// the request the page does not advance and the error is returned. 11186// Deprecated: Use NextWithContext() instead. 11187func (page *TagCollectionPage) Next() error { 11188 return page.NextWithContext(context.Background()) 11189} 11190 11191// NotDone returns true if the page enumeration should be started or is not yet complete. 11192func (page TagCollectionPage) NotDone() bool { 11193 return !page.tc.IsEmpty() 11194} 11195 11196// Response returns the raw server response from the last page request. 11197func (page TagCollectionPage) Response() TagCollection { 11198 return page.tc 11199} 11200 11201// Values returns the slice of values for the current page or nil if there are no values. 11202func (page TagCollectionPage) Values() []TagContract { 11203 if page.tc.IsEmpty() { 11204 return nil 11205 } 11206 return *page.tc.Value 11207} 11208 11209// Creates a new instance of the TagCollectionPage type. 11210func NewTagCollectionPage(cur TagCollection, getNextPage func(context.Context, TagCollection) (TagCollection, error)) TagCollectionPage { 11211 return TagCollectionPage{ 11212 fn: getNextPage, 11213 tc: cur, 11214 } 11215} 11216 11217// TagContract tag Contract details. 11218type TagContract struct { 11219 autorest.Response `json:"-"` 11220 // TagContractProperties - Tag entity contract properties. 11221 *TagContractProperties `json:"properties,omitempty"` 11222 // ID - READ-ONLY; Resource ID. 11223 ID *string `json:"id,omitempty"` 11224 // Name - READ-ONLY; Resource name. 11225 Name *string `json:"name,omitempty"` 11226 // Type - READ-ONLY; Resource type for API Management resource. 11227 Type *string `json:"type,omitempty"` 11228} 11229 11230// MarshalJSON is the custom marshaler for TagContract. 11231func (tc TagContract) MarshalJSON() ([]byte, error) { 11232 objectMap := make(map[string]interface{}) 11233 if tc.TagContractProperties != nil { 11234 objectMap["properties"] = tc.TagContractProperties 11235 } 11236 return json.Marshal(objectMap) 11237} 11238 11239// UnmarshalJSON is the custom unmarshaler for TagContract struct. 11240func (tc *TagContract) UnmarshalJSON(body []byte) error { 11241 var m map[string]*json.RawMessage 11242 err := json.Unmarshal(body, &m) 11243 if err != nil { 11244 return err 11245 } 11246 for k, v := range m { 11247 switch k { 11248 case "properties": 11249 if v != nil { 11250 var tagContractProperties TagContractProperties 11251 err = json.Unmarshal(*v, &tagContractProperties) 11252 if err != nil { 11253 return err 11254 } 11255 tc.TagContractProperties = &tagContractProperties 11256 } 11257 case "id": 11258 if v != nil { 11259 var ID string 11260 err = json.Unmarshal(*v, &ID) 11261 if err != nil { 11262 return err 11263 } 11264 tc.ID = &ID 11265 } 11266 case "name": 11267 if v != nil { 11268 var name string 11269 err = json.Unmarshal(*v, &name) 11270 if err != nil { 11271 return err 11272 } 11273 tc.Name = &name 11274 } 11275 case "type": 11276 if v != nil { 11277 var typeVar string 11278 err = json.Unmarshal(*v, &typeVar) 11279 if err != nil { 11280 return err 11281 } 11282 tc.Type = &typeVar 11283 } 11284 } 11285 } 11286 11287 return nil 11288} 11289 11290// TagContractProperties tag contract Properties. 11291type TagContractProperties struct { 11292 // DisplayName - Tag name. 11293 DisplayName *string `json:"displayName,omitempty"` 11294} 11295 11296// TagCreateUpdateParameters parameters supplied to Create/Update Tag operations. 11297type TagCreateUpdateParameters struct { 11298 // TagContractProperties - Properties supplied to Create Tag operation. 11299 *TagContractProperties `json:"properties,omitempty"` 11300} 11301 11302// MarshalJSON is the custom marshaler for TagCreateUpdateParameters. 11303func (tcup TagCreateUpdateParameters) MarshalJSON() ([]byte, error) { 11304 objectMap := make(map[string]interface{}) 11305 if tcup.TagContractProperties != nil { 11306 objectMap["properties"] = tcup.TagContractProperties 11307 } 11308 return json.Marshal(objectMap) 11309} 11310 11311// UnmarshalJSON is the custom unmarshaler for TagCreateUpdateParameters struct. 11312func (tcup *TagCreateUpdateParameters) UnmarshalJSON(body []byte) error { 11313 var m map[string]*json.RawMessage 11314 err := json.Unmarshal(body, &m) 11315 if err != nil { 11316 return err 11317 } 11318 for k, v := range m { 11319 switch k { 11320 case "properties": 11321 if v != nil { 11322 var tagContractProperties TagContractProperties 11323 err = json.Unmarshal(*v, &tagContractProperties) 11324 if err != nil { 11325 return err 11326 } 11327 tcup.TagContractProperties = &tagContractProperties 11328 } 11329 } 11330 } 11331 11332 return nil 11333} 11334 11335// TagDescriptionBaseProperties parameters supplied to the Create TagDescription operation. 11336type TagDescriptionBaseProperties struct { 11337 // Description - Description of the Tag. 11338 Description *string `json:"description,omitempty"` 11339 // ExternalDocsURL - Absolute URL of external resources describing the tag. 11340 ExternalDocsURL *string `json:"externalDocsUrl,omitempty"` 11341 // ExternalDocsDescription - Description of the external resources describing the tag. 11342 ExternalDocsDescription *string `json:"externalDocsDescription,omitempty"` 11343} 11344 11345// TagDescriptionCollection paged TagDescription list representation. 11346type TagDescriptionCollection struct { 11347 autorest.Response `json:"-"` 11348 // Value - Page values. 11349 Value *[]TagDescriptionContract `json:"value,omitempty"` 11350 // NextLink - Next page link if any. 11351 NextLink *string `json:"nextLink,omitempty"` 11352} 11353 11354// TagDescriptionCollectionIterator provides access to a complete listing of TagDescriptionContract values. 11355type TagDescriptionCollectionIterator struct { 11356 i int 11357 page TagDescriptionCollectionPage 11358} 11359 11360// NextWithContext advances to the next value. If there was an error making 11361// the request the iterator does not advance and the error is returned. 11362func (iter *TagDescriptionCollectionIterator) NextWithContext(ctx context.Context) (err error) { 11363 if tracing.IsEnabled() { 11364 ctx = tracing.StartSpan(ctx, fqdn+"/TagDescriptionCollectionIterator.NextWithContext") 11365 defer func() { 11366 sc := -1 11367 if iter.Response().Response.Response != nil { 11368 sc = iter.Response().Response.Response.StatusCode 11369 } 11370 tracing.EndSpan(ctx, sc, err) 11371 }() 11372 } 11373 iter.i++ 11374 if iter.i < len(iter.page.Values()) { 11375 return nil 11376 } 11377 err = iter.page.NextWithContext(ctx) 11378 if err != nil { 11379 iter.i-- 11380 return err 11381 } 11382 iter.i = 0 11383 return nil 11384} 11385 11386// Next advances to the next value. If there was an error making 11387// the request the iterator does not advance and the error is returned. 11388// Deprecated: Use NextWithContext() instead. 11389func (iter *TagDescriptionCollectionIterator) Next() error { 11390 return iter.NextWithContext(context.Background()) 11391} 11392 11393// NotDone returns true if the enumeration should be started or is not yet complete. 11394func (iter TagDescriptionCollectionIterator) NotDone() bool { 11395 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 11396} 11397 11398// Response returns the raw server response from the last page request. 11399func (iter TagDescriptionCollectionIterator) Response() TagDescriptionCollection { 11400 return iter.page.Response() 11401} 11402 11403// Value returns the current value or a zero-initialized value if the 11404// iterator has advanced beyond the end of the collection. 11405func (iter TagDescriptionCollectionIterator) Value() TagDescriptionContract { 11406 if !iter.page.NotDone() { 11407 return TagDescriptionContract{} 11408 } 11409 return iter.page.Values()[iter.i] 11410} 11411 11412// Creates a new instance of the TagDescriptionCollectionIterator type. 11413func NewTagDescriptionCollectionIterator(page TagDescriptionCollectionPage) TagDescriptionCollectionIterator { 11414 return TagDescriptionCollectionIterator{page: page} 11415} 11416 11417// IsEmpty returns true if the ListResult contains no values. 11418func (tdc TagDescriptionCollection) IsEmpty() bool { 11419 return tdc.Value == nil || len(*tdc.Value) == 0 11420} 11421 11422// hasNextLink returns true if the NextLink is not empty. 11423func (tdc TagDescriptionCollection) hasNextLink() bool { 11424 return tdc.NextLink != nil && len(*tdc.NextLink) != 0 11425} 11426 11427// tagDescriptionCollectionPreparer prepares a request to retrieve the next set of results. 11428// It returns nil if no more results exist. 11429func (tdc TagDescriptionCollection) tagDescriptionCollectionPreparer(ctx context.Context) (*http.Request, error) { 11430 if !tdc.hasNextLink() { 11431 return nil, nil 11432 } 11433 return autorest.Prepare((&http.Request{}).WithContext(ctx), 11434 autorest.AsJSON(), 11435 autorest.AsGet(), 11436 autorest.WithBaseURL(to.String(tdc.NextLink))) 11437} 11438 11439// TagDescriptionCollectionPage contains a page of TagDescriptionContract values. 11440type TagDescriptionCollectionPage struct { 11441 fn func(context.Context, TagDescriptionCollection) (TagDescriptionCollection, error) 11442 tdc TagDescriptionCollection 11443} 11444 11445// NextWithContext advances to the next page of values. If there was an error making 11446// the request the page does not advance and the error is returned. 11447func (page *TagDescriptionCollectionPage) NextWithContext(ctx context.Context) (err error) { 11448 if tracing.IsEnabled() { 11449 ctx = tracing.StartSpan(ctx, fqdn+"/TagDescriptionCollectionPage.NextWithContext") 11450 defer func() { 11451 sc := -1 11452 if page.Response().Response.Response != nil { 11453 sc = page.Response().Response.Response.StatusCode 11454 } 11455 tracing.EndSpan(ctx, sc, err) 11456 }() 11457 } 11458 for { 11459 next, err := page.fn(ctx, page.tdc) 11460 if err != nil { 11461 return err 11462 } 11463 page.tdc = next 11464 if !next.hasNextLink() || !next.IsEmpty() { 11465 break 11466 } 11467 } 11468 return nil 11469} 11470 11471// Next advances to the next page of values. If there was an error making 11472// the request the page does not advance and the error is returned. 11473// Deprecated: Use NextWithContext() instead. 11474func (page *TagDescriptionCollectionPage) Next() error { 11475 return page.NextWithContext(context.Background()) 11476} 11477 11478// NotDone returns true if the page enumeration should be started or is not yet complete. 11479func (page TagDescriptionCollectionPage) NotDone() bool { 11480 return !page.tdc.IsEmpty() 11481} 11482 11483// Response returns the raw server response from the last page request. 11484func (page TagDescriptionCollectionPage) Response() TagDescriptionCollection { 11485 return page.tdc 11486} 11487 11488// Values returns the slice of values for the current page or nil if there are no values. 11489func (page TagDescriptionCollectionPage) Values() []TagDescriptionContract { 11490 if page.tdc.IsEmpty() { 11491 return nil 11492 } 11493 return *page.tdc.Value 11494} 11495 11496// Creates a new instance of the TagDescriptionCollectionPage type. 11497func NewTagDescriptionCollectionPage(cur TagDescriptionCollection, getNextPage func(context.Context, TagDescriptionCollection) (TagDescriptionCollection, error)) TagDescriptionCollectionPage { 11498 return TagDescriptionCollectionPage{ 11499 fn: getNextPage, 11500 tdc: cur, 11501 } 11502} 11503 11504// TagDescriptionContract contract details. 11505type TagDescriptionContract struct { 11506 autorest.Response `json:"-"` 11507 // TagDescriptionContractProperties - TagDescription entity contract properties. 11508 *TagDescriptionContractProperties `json:"properties,omitempty"` 11509 // ID - READ-ONLY; Resource ID. 11510 ID *string `json:"id,omitempty"` 11511 // Name - READ-ONLY; Resource name. 11512 Name *string `json:"name,omitempty"` 11513 // Type - READ-ONLY; Resource type for API Management resource. 11514 Type *string `json:"type,omitempty"` 11515} 11516 11517// MarshalJSON is the custom marshaler for TagDescriptionContract. 11518func (tdc TagDescriptionContract) MarshalJSON() ([]byte, error) { 11519 objectMap := make(map[string]interface{}) 11520 if tdc.TagDescriptionContractProperties != nil { 11521 objectMap["properties"] = tdc.TagDescriptionContractProperties 11522 } 11523 return json.Marshal(objectMap) 11524} 11525 11526// UnmarshalJSON is the custom unmarshaler for TagDescriptionContract struct. 11527func (tdc *TagDescriptionContract) UnmarshalJSON(body []byte) error { 11528 var m map[string]*json.RawMessage 11529 err := json.Unmarshal(body, &m) 11530 if err != nil { 11531 return err 11532 } 11533 for k, v := range m { 11534 switch k { 11535 case "properties": 11536 if v != nil { 11537 var tagDescriptionContractProperties TagDescriptionContractProperties 11538 err = json.Unmarshal(*v, &tagDescriptionContractProperties) 11539 if err != nil { 11540 return err 11541 } 11542 tdc.TagDescriptionContractProperties = &tagDescriptionContractProperties 11543 } 11544 case "id": 11545 if v != nil { 11546 var ID string 11547 err = json.Unmarshal(*v, &ID) 11548 if err != nil { 11549 return err 11550 } 11551 tdc.ID = &ID 11552 } 11553 case "name": 11554 if v != nil { 11555 var name string 11556 err = json.Unmarshal(*v, &name) 11557 if err != nil { 11558 return err 11559 } 11560 tdc.Name = &name 11561 } 11562 case "type": 11563 if v != nil { 11564 var typeVar string 11565 err = json.Unmarshal(*v, &typeVar) 11566 if err != nil { 11567 return err 11568 } 11569 tdc.Type = &typeVar 11570 } 11571 } 11572 } 11573 11574 return nil 11575} 11576 11577// TagDescriptionContractProperties tagDescription contract Properties. 11578type TagDescriptionContractProperties struct { 11579 // DisplayName - Tag name. 11580 DisplayName *string `json:"displayName,omitempty"` 11581 // Description - Description of the Tag. 11582 Description *string `json:"description,omitempty"` 11583 // ExternalDocsURL - Absolute URL of external resources describing the tag. 11584 ExternalDocsURL *string `json:"externalDocsUrl,omitempty"` 11585 // ExternalDocsDescription - Description of the external resources describing the tag. 11586 ExternalDocsDescription *string `json:"externalDocsDescription,omitempty"` 11587} 11588 11589// TagDescriptionCreateParameters parameters supplied to the Create TagDescription operation. 11590type TagDescriptionCreateParameters struct { 11591 // TagDescriptionBaseProperties - Properties supplied to Create TagDescription operation. 11592 *TagDescriptionBaseProperties `json:"properties,omitempty"` 11593} 11594 11595// MarshalJSON is the custom marshaler for TagDescriptionCreateParameters. 11596func (tdcp TagDescriptionCreateParameters) MarshalJSON() ([]byte, error) { 11597 objectMap := make(map[string]interface{}) 11598 if tdcp.TagDescriptionBaseProperties != nil { 11599 objectMap["properties"] = tdcp.TagDescriptionBaseProperties 11600 } 11601 return json.Marshal(objectMap) 11602} 11603 11604// UnmarshalJSON is the custom unmarshaler for TagDescriptionCreateParameters struct. 11605func (tdcp *TagDescriptionCreateParameters) UnmarshalJSON(body []byte) error { 11606 var m map[string]*json.RawMessage 11607 err := json.Unmarshal(body, &m) 11608 if err != nil { 11609 return err 11610 } 11611 for k, v := range m { 11612 switch k { 11613 case "properties": 11614 if v != nil { 11615 var tagDescriptionBaseProperties TagDescriptionBaseProperties 11616 err = json.Unmarshal(*v, &tagDescriptionBaseProperties) 11617 if err != nil { 11618 return err 11619 } 11620 tdcp.TagDescriptionBaseProperties = &tagDescriptionBaseProperties 11621 } 11622 } 11623 } 11624 11625 return nil 11626} 11627 11628// TagResourceCollection paged Tag list representation. 11629type TagResourceCollection struct { 11630 autorest.Response `json:"-"` 11631 // Value - Page values. 11632 Value *[]TagResourceContract `json:"value,omitempty"` 11633 // NextLink - Next page link if any. 11634 NextLink *string `json:"nextLink,omitempty"` 11635} 11636 11637// TagResourceCollectionIterator provides access to a complete listing of TagResourceContract values. 11638type TagResourceCollectionIterator struct { 11639 i int 11640 page TagResourceCollectionPage 11641} 11642 11643// NextWithContext advances to the next value. If there was an error making 11644// the request the iterator does not advance and the error is returned. 11645func (iter *TagResourceCollectionIterator) NextWithContext(ctx context.Context) (err error) { 11646 if tracing.IsEnabled() { 11647 ctx = tracing.StartSpan(ctx, fqdn+"/TagResourceCollectionIterator.NextWithContext") 11648 defer func() { 11649 sc := -1 11650 if iter.Response().Response.Response != nil { 11651 sc = iter.Response().Response.Response.StatusCode 11652 } 11653 tracing.EndSpan(ctx, sc, err) 11654 }() 11655 } 11656 iter.i++ 11657 if iter.i < len(iter.page.Values()) { 11658 return nil 11659 } 11660 err = iter.page.NextWithContext(ctx) 11661 if err != nil { 11662 iter.i-- 11663 return err 11664 } 11665 iter.i = 0 11666 return nil 11667} 11668 11669// Next advances to the next value. If there was an error making 11670// the request the iterator does not advance and the error is returned. 11671// Deprecated: Use NextWithContext() instead. 11672func (iter *TagResourceCollectionIterator) Next() error { 11673 return iter.NextWithContext(context.Background()) 11674} 11675 11676// NotDone returns true if the enumeration should be started or is not yet complete. 11677func (iter TagResourceCollectionIterator) NotDone() bool { 11678 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 11679} 11680 11681// Response returns the raw server response from the last page request. 11682func (iter TagResourceCollectionIterator) Response() TagResourceCollection { 11683 return iter.page.Response() 11684} 11685 11686// Value returns the current value or a zero-initialized value if the 11687// iterator has advanced beyond the end of the collection. 11688func (iter TagResourceCollectionIterator) Value() TagResourceContract { 11689 if !iter.page.NotDone() { 11690 return TagResourceContract{} 11691 } 11692 return iter.page.Values()[iter.i] 11693} 11694 11695// Creates a new instance of the TagResourceCollectionIterator type. 11696func NewTagResourceCollectionIterator(page TagResourceCollectionPage) TagResourceCollectionIterator { 11697 return TagResourceCollectionIterator{page: page} 11698} 11699 11700// IsEmpty returns true if the ListResult contains no values. 11701func (trc TagResourceCollection) IsEmpty() bool { 11702 return trc.Value == nil || len(*trc.Value) == 0 11703} 11704 11705// hasNextLink returns true if the NextLink is not empty. 11706func (trc TagResourceCollection) hasNextLink() bool { 11707 return trc.NextLink != nil && len(*trc.NextLink) != 0 11708} 11709 11710// tagResourceCollectionPreparer prepares a request to retrieve the next set of results. 11711// It returns nil if no more results exist. 11712func (trc TagResourceCollection) tagResourceCollectionPreparer(ctx context.Context) (*http.Request, error) { 11713 if !trc.hasNextLink() { 11714 return nil, nil 11715 } 11716 return autorest.Prepare((&http.Request{}).WithContext(ctx), 11717 autorest.AsJSON(), 11718 autorest.AsGet(), 11719 autorest.WithBaseURL(to.String(trc.NextLink))) 11720} 11721 11722// TagResourceCollectionPage contains a page of TagResourceContract values. 11723type TagResourceCollectionPage struct { 11724 fn func(context.Context, TagResourceCollection) (TagResourceCollection, error) 11725 trc TagResourceCollection 11726} 11727 11728// NextWithContext advances to the next page of values. If there was an error making 11729// the request the page does not advance and the error is returned. 11730func (page *TagResourceCollectionPage) NextWithContext(ctx context.Context) (err error) { 11731 if tracing.IsEnabled() { 11732 ctx = tracing.StartSpan(ctx, fqdn+"/TagResourceCollectionPage.NextWithContext") 11733 defer func() { 11734 sc := -1 11735 if page.Response().Response.Response != nil { 11736 sc = page.Response().Response.Response.StatusCode 11737 } 11738 tracing.EndSpan(ctx, sc, err) 11739 }() 11740 } 11741 for { 11742 next, err := page.fn(ctx, page.trc) 11743 if err != nil { 11744 return err 11745 } 11746 page.trc = next 11747 if !next.hasNextLink() || !next.IsEmpty() { 11748 break 11749 } 11750 } 11751 return nil 11752} 11753 11754// Next advances to the next page of values. If there was an error making 11755// the request the page does not advance and the error is returned. 11756// Deprecated: Use NextWithContext() instead. 11757func (page *TagResourceCollectionPage) Next() error { 11758 return page.NextWithContext(context.Background()) 11759} 11760 11761// NotDone returns true if the page enumeration should be started or is not yet complete. 11762func (page TagResourceCollectionPage) NotDone() bool { 11763 return !page.trc.IsEmpty() 11764} 11765 11766// Response returns the raw server response from the last page request. 11767func (page TagResourceCollectionPage) Response() TagResourceCollection { 11768 return page.trc 11769} 11770 11771// Values returns the slice of values for the current page or nil if there are no values. 11772func (page TagResourceCollectionPage) Values() []TagResourceContract { 11773 if page.trc.IsEmpty() { 11774 return nil 11775 } 11776 return *page.trc.Value 11777} 11778 11779// Creates a new instance of the TagResourceCollectionPage type. 11780func NewTagResourceCollectionPage(cur TagResourceCollection, getNextPage func(context.Context, TagResourceCollection) (TagResourceCollection, error)) TagResourceCollectionPage { 11781 return TagResourceCollectionPage{ 11782 fn: getNextPage, 11783 trc: cur, 11784 } 11785} 11786 11787// TagResourceContract tagResource contract properties. 11788type TagResourceContract struct { 11789 // Tag - Tag associated with the resource. 11790 Tag *TagTagResourceContractProperties `json:"tag,omitempty"` 11791 // API - Api associated with the tag. 11792 API *APITagResourceContractProperties `json:"api,omitempty"` 11793 // Operation - Operation associated with the tag. 11794 Operation *OperationTagResourceContractProperties `json:"operation,omitempty"` 11795 // Product - Product associated with the tag. 11796 Product *ProductTagResourceContractProperties `json:"product,omitempty"` 11797} 11798 11799// TagTagResourceContractProperties contract defining the Tag property in the Tag Resource Contract 11800type TagTagResourceContractProperties struct { 11801 // ID - Tag identifier 11802 ID *string `json:"id,omitempty"` 11803 // Name - Tag Name 11804 Name *string `json:"name,omitempty"` 11805} 11806 11807// TenantConfigurationDeployFuture an abstraction for monitoring and retrieving the results of a 11808// long-running operation. 11809type TenantConfigurationDeployFuture struct { 11810 azure.FutureAPI 11811 // Result returns the result of the asynchronous operation. 11812 // If the operation has not completed it will return an error. 11813 Result func(TenantConfigurationClient) (OperationResultContract, error) 11814} 11815 11816// UnmarshalJSON is the custom unmarshaller for CreateFuture. 11817func (future *TenantConfigurationDeployFuture) UnmarshalJSON(body []byte) error { 11818 var azFuture azure.Future 11819 if err := json.Unmarshal(body, &azFuture); err != nil { 11820 return err 11821 } 11822 future.FutureAPI = &azFuture 11823 future.Result = future.result 11824 return nil 11825} 11826 11827// result is the default implementation for TenantConfigurationDeployFuture.Result. 11828func (future *TenantConfigurationDeployFuture) result(client TenantConfigurationClient) (orc OperationResultContract, err error) { 11829 var done bool 11830 done, err = future.DoneWithContext(context.Background(), client) 11831 if err != nil { 11832 err = autorest.NewErrorWithError(err, "apimanagement.TenantConfigurationDeployFuture", "Result", future.Response(), "Polling failure") 11833 return 11834 } 11835 if !done { 11836 orc.Response.Response = future.Response() 11837 err = azure.NewAsyncOpIncompleteError("apimanagement.TenantConfigurationDeployFuture") 11838 return 11839 } 11840 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 11841 if orc.Response.Response, err = future.GetResult(sender); err == nil && orc.Response.Response.StatusCode != http.StatusNoContent { 11842 orc, err = client.DeployResponder(orc.Response.Response) 11843 if err != nil { 11844 err = autorest.NewErrorWithError(err, "apimanagement.TenantConfigurationDeployFuture", "Result", orc.Response.Response, "Failure responding to request") 11845 } 11846 } 11847 return 11848} 11849 11850// TenantConfigurationSaveFuture an abstraction for monitoring and retrieving the results of a long-running 11851// operation. 11852type TenantConfigurationSaveFuture struct { 11853 azure.FutureAPI 11854 // Result returns the result of the asynchronous operation. 11855 // If the operation has not completed it will return an error. 11856 Result func(TenantConfigurationClient) (OperationResultContract, error) 11857} 11858 11859// UnmarshalJSON is the custom unmarshaller for CreateFuture. 11860func (future *TenantConfigurationSaveFuture) UnmarshalJSON(body []byte) error { 11861 var azFuture azure.Future 11862 if err := json.Unmarshal(body, &azFuture); err != nil { 11863 return err 11864 } 11865 future.FutureAPI = &azFuture 11866 future.Result = future.result 11867 return nil 11868} 11869 11870// result is the default implementation for TenantConfigurationSaveFuture.Result. 11871func (future *TenantConfigurationSaveFuture) result(client TenantConfigurationClient) (orc OperationResultContract, err error) { 11872 var done bool 11873 done, err = future.DoneWithContext(context.Background(), client) 11874 if err != nil { 11875 err = autorest.NewErrorWithError(err, "apimanagement.TenantConfigurationSaveFuture", "Result", future.Response(), "Polling failure") 11876 return 11877 } 11878 if !done { 11879 orc.Response.Response = future.Response() 11880 err = azure.NewAsyncOpIncompleteError("apimanagement.TenantConfigurationSaveFuture") 11881 return 11882 } 11883 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 11884 if orc.Response.Response, err = future.GetResult(sender); err == nil && orc.Response.Response.StatusCode != http.StatusNoContent { 11885 orc, err = client.SaveResponder(orc.Response.Response) 11886 if err != nil { 11887 err = autorest.NewErrorWithError(err, "apimanagement.TenantConfigurationSaveFuture", "Result", orc.Response.Response, "Failure responding to request") 11888 } 11889 } 11890 return 11891} 11892 11893// TenantConfigurationSyncStateContract tenant Configuration Synchronization State. 11894type TenantConfigurationSyncStateContract struct { 11895 autorest.Response `json:"-"` 11896 // Branch - The name of Git branch. 11897 Branch *string `json:"branch,omitempty"` 11898 // CommitID - The latest commit Id. 11899 CommitID *string `json:"commitId,omitempty"` 11900 // IsExport - value indicating if last sync was save (true) or deploy (false) operation. 11901 IsExport *bool `json:"isExport,omitempty"` 11902 // IsSynced - value indicating if last synchronization was later than the configuration change. 11903 IsSynced *bool `json:"isSynced,omitempty"` 11904 // IsGitEnabled - value indicating whether Git configuration access is enabled. 11905 IsGitEnabled *bool `json:"isGitEnabled,omitempty"` 11906 // 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. 11907 SyncDate *date.Time `json:"syncDate,omitempty"` 11908 // 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. 11909 ConfigurationChangeDate *date.Time `json:"configurationChangeDate,omitempty"` 11910} 11911 11912// TenantConfigurationValidateFuture an abstraction for monitoring and retrieving the results of a 11913// long-running operation. 11914type TenantConfigurationValidateFuture struct { 11915 azure.FutureAPI 11916 // Result returns the result of the asynchronous operation. 11917 // If the operation has not completed it will return an error. 11918 Result func(TenantConfigurationClient) (OperationResultContract, error) 11919} 11920 11921// UnmarshalJSON is the custom unmarshaller for CreateFuture. 11922func (future *TenantConfigurationValidateFuture) UnmarshalJSON(body []byte) error { 11923 var azFuture azure.Future 11924 if err := json.Unmarshal(body, &azFuture); err != nil { 11925 return err 11926 } 11927 future.FutureAPI = &azFuture 11928 future.Result = future.result 11929 return nil 11930} 11931 11932// result is the default implementation for TenantConfigurationValidateFuture.Result. 11933func (future *TenantConfigurationValidateFuture) result(client TenantConfigurationClient) (orc OperationResultContract, err error) { 11934 var done bool 11935 done, err = future.DoneWithContext(context.Background(), client) 11936 if err != nil { 11937 err = autorest.NewErrorWithError(err, "apimanagement.TenantConfigurationValidateFuture", "Result", future.Response(), "Polling failure") 11938 return 11939 } 11940 if !done { 11941 orc.Response.Response = future.Response() 11942 err = azure.NewAsyncOpIncompleteError("apimanagement.TenantConfigurationValidateFuture") 11943 return 11944 } 11945 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 11946 if orc.Response.Response, err = future.GetResult(sender); err == nil && orc.Response.Response.StatusCode != http.StatusNoContent { 11947 orc, err = client.ValidateResponder(orc.Response.Response) 11948 if err != nil { 11949 err = autorest.NewErrorWithError(err, "apimanagement.TenantConfigurationValidateFuture", "Result", orc.Response.Response, "Failure responding to request") 11950 } 11951 } 11952 return 11953} 11954 11955// TermsOfServiceProperties terms of service contract properties. 11956type TermsOfServiceProperties struct { 11957 // Text - A terms of service text. 11958 Text *string `json:"text,omitempty"` 11959 // Enabled - Display terms of service during a sign-up process. 11960 Enabled *bool `json:"enabled,omitempty"` 11961 // ConsentRequired - Ask user for consent to the terms of service. 11962 ConsentRequired *bool `json:"consentRequired,omitempty"` 11963} 11964 11965// TokenBodyParameterContract oAuth acquire token request body parameter (www-url-form-encoded). 11966type TokenBodyParameterContract struct { 11967 // Name - body parameter name. 11968 Name *string `json:"name,omitempty"` 11969 // Value - body parameter value. 11970 Value *string `json:"value,omitempty"` 11971} 11972 11973// UserCollection paged Users list representation. 11974type UserCollection struct { 11975 autorest.Response `json:"-"` 11976 // Value - Page values. 11977 Value *[]UserContract `json:"value,omitempty"` 11978 // NextLink - Next page link if any. 11979 NextLink *string `json:"nextLink,omitempty"` 11980} 11981 11982// UserCollectionIterator provides access to a complete listing of UserContract values. 11983type UserCollectionIterator struct { 11984 i int 11985 page UserCollectionPage 11986} 11987 11988// NextWithContext advances to the next value. If there was an error making 11989// the request the iterator does not advance and the error is returned. 11990func (iter *UserCollectionIterator) NextWithContext(ctx context.Context) (err error) { 11991 if tracing.IsEnabled() { 11992 ctx = tracing.StartSpan(ctx, fqdn+"/UserCollectionIterator.NextWithContext") 11993 defer func() { 11994 sc := -1 11995 if iter.Response().Response.Response != nil { 11996 sc = iter.Response().Response.Response.StatusCode 11997 } 11998 tracing.EndSpan(ctx, sc, err) 11999 }() 12000 } 12001 iter.i++ 12002 if iter.i < len(iter.page.Values()) { 12003 return nil 12004 } 12005 err = iter.page.NextWithContext(ctx) 12006 if err != nil { 12007 iter.i-- 12008 return err 12009 } 12010 iter.i = 0 12011 return nil 12012} 12013 12014// Next advances to the next value. If there was an error making 12015// the request the iterator does not advance and the error is returned. 12016// Deprecated: Use NextWithContext() instead. 12017func (iter *UserCollectionIterator) Next() error { 12018 return iter.NextWithContext(context.Background()) 12019} 12020 12021// NotDone returns true if the enumeration should be started or is not yet complete. 12022func (iter UserCollectionIterator) NotDone() bool { 12023 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 12024} 12025 12026// Response returns the raw server response from the last page request. 12027func (iter UserCollectionIterator) Response() UserCollection { 12028 return iter.page.Response() 12029} 12030 12031// Value returns the current value or a zero-initialized value if the 12032// iterator has advanced beyond the end of the collection. 12033func (iter UserCollectionIterator) Value() UserContract { 12034 if !iter.page.NotDone() { 12035 return UserContract{} 12036 } 12037 return iter.page.Values()[iter.i] 12038} 12039 12040// Creates a new instance of the UserCollectionIterator type. 12041func NewUserCollectionIterator(page UserCollectionPage) UserCollectionIterator { 12042 return UserCollectionIterator{page: page} 12043} 12044 12045// IsEmpty returns true if the ListResult contains no values. 12046func (uc UserCollection) IsEmpty() bool { 12047 return uc.Value == nil || len(*uc.Value) == 0 12048} 12049 12050// hasNextLink returns true if the NextLink is not empty. 12051func (uc UserCollection) hasNextLink() bool { 12052 return uc.NextLink != nil && len(*uc.NextLink) != 0 12053} 12054 12055// userCollectionPreparer prepares a request to retrieve the next set of results. 12056// It returns nil if no more results exist. 12057func (uc UserCollection) userCollectionPreparer(ctx context.Context) (*http.Request, error) { 12058 if !uc.hasNextLink() { 12059 return nil, nil 12060 } 12061 return autorest.Prepare((&http.Request{}).WithContext(ctx), 12062 autorest.AsJSON(), 12063 autorest.AsGet(), 12064 autorest.WithBaseURL(to.String(uc.NextLink))) 12065} 12066 12067// UserCollectionPage contains a page of UserContract values. 12068type UserCollectionPage struct { 12069 fn func(context.Context, UserCollection) (UserCollection, error) 12070 uc UserCollection 12071} 12072 12073// NextWithContext advances to the next page of values. If there was an error making 12074// the request the page does not advance and the error is returned. 12075func (page *UserCollectionPage) NextWithContext(ctx context.Context) (err error) { 12076 if tracing.IsEnabled() { 12077 ctx = tracing.StartSpan(ctx, fqdn+"/UserCollectionPage.NextWithContext") 12078 defer func() { 12079 sc := -1 12080 if page.Response().Response.Response != nil { 12081 sc = page.Response().Response.Response.StatusCode 12082 } 12083 tracing.EndSpan(ctx, sc, err) 12084 }() 12085 } 12086 for { 12087 next, err := page.fn(ctx, page.uc) 12088 if err != nil { 12089 return err 12090 } 12091 page.uc = next 12092 if !next.hasNextLink() || !next.IsEmpty() { 12093 break 12094 } 12095 } 12096 return nil 12097} 12098 12099// Next advances to the next page of values. If there was an error making 12100// the request the page does not advance and the error is returned. 12101// Deprecated: Use NextWithContext() instead. 12102func (page *UserCollectionPage) Next() error { 12103 return page.NextWithContext(context.Background()) 12104} 12105 12106// NotDone returns true if the page enumeration should be started or is not yet complete. 12107func (page UserCollectionPage) NotDone() bool { 12108 return !page.uc.IsEmpty() 12109} 12110 12111// Response returns the raw server response from the last page request. 12112func (page UserCollectionPage) Response() UserCollection { 12113 return page.uc 12114} 12115 12116// Values returns the slice of values for the current page or nil if there are no values. 12117func (page UserCollectionPage) Values() []UserContract { 12118 if page.uc.IsEmpty() { 12119 return nil 12120 } 12121 return *page.uc.Value 12122} 12123 12124// Creates a new instance of the UserCollectionPage type. 12125func NewUserCollectionPage(cur UserCollection, getNextPage func(context.Context, UserCollection) (UserCollection, error)) UserCollectionPage { 12126 return UserCollectionPage{ 12127 fn: getNextPage, 12128 uc: cur, 12129 } 12130} 12131 12132// UserContract user details. 12133type UserContract struct { 12134 autorest.Response `json:"-"` 12135 // UserContractProperties - User entity contract properties. 12136 *UserContractProperties `json:"properties,omitempty"` 12137 // ID - READ-ONLY; Resource ID. 12138 ID *string `json:"id,omitempty"` 12139 // Name - READ-ONLY; Resource name. 12140 Name *string `json:"name,omitempty"` 12141 // Type - READ-ONLY; Resource type for API Management resource. 12142 Type *string `json:"type,omitempty"` 12143} 12144 12145// MarshalJSON is the custom marshaler for UserContract. 12146func (uc UserContract) MarshalJSON() ([]byte, error) { 12147 objectMap := make(map[string]interface{}) 12148 if uc.UserContractProperties != nil { 12149 objectMap["properties"] = uc.UserContractProperties 12150 } 12151 return json.Marshal(objectMap) 12152} 12153 12154// UnmarshalJSON is the custom unmarshaler for UserContract struct. 12155func (uc *UserContract) UnmarshalJSON(body []byte) error { 12156 var m map[string]*json.RawMessage 12157 err := json.Unmarshal(body, &m) 12158 if err != nil { 12159 return err 12160 } 12161 for k, v := range m { 12162 switch k { 12163 case "properties": 12164 if v != nil { 12165 var userContractProperties UserContractProperties 12166 err = json.Unmarshal(*v, &userContractProperties) 12167 if err != nil { 12168 return err 12169 } 12170 uc.UserContractProperties = &userContractProperties 12171 } 12172 case "id": 12173 if v != nil { 12174 var ID string 12175 err = json.Unmarshal(*v, &ID) 12176 if err != nil { 12177 return err 12178 } 12179 uc.ID = &ID 12180 } 12181 case "name": 12182 if v != nil { 12183 var name string 12184 err = json.Unmarshal(*v, &name) 12185 if err != nil { 12186 return err 12187 } 12188 uc.Name = &name 12189 } 12190 case "type": 12191 if v != nil { 12192 var typeVar string 12193 err = json.Unmarshal(*v, &typeVar) 12194 if err != nil { 12195 return err 12196 } 12197 uc.Type = &typeVar 12198 } 12199 } 12200 } 12201 12202 return nil 12203} 12204 12205// UserContractProperties user profile. 12206type UserContractProperties struct { 12207 // FirstName - First name. 12208 FirstName *string `json:"firstName,omitempty"` 12209 // LastName - Last name. 12210 LastName *string `json:"lastName,omitempty"` 12211 // Email - Email address. 12212 Email *string `json:"email,omitempty"` 12213 // RegistrationDate - Date of user registration. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. 12214 RegistrationDate *date.Time `json:"registrationDate,omitempty"` 12215 // Groups - READ-ONLY; Collection of groups user is part of. 12216 Groups *[]GroupContractProperties `json:"groups,omitempty"` 12217 // 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' 12218 State UserState `json:"state,omitempty"` 12219 // Note - Optional note about a user set by the administrator. 12220 Note *string `json:"note,omitempty"` 12221 // Identities - Collection of user identities. 12222 Identities *[]UserIdentityContract `json:"identities,omitempty"` 12223} 12224 12225// MarshalJSON is the custom marshaler for UserContractProperties. 12226func (ucp UserContractProperties) MarshalJSON() ([]byte, error) { 12227 objectMap := make(map[string]interface{}) 12228 if ucp.FirstName != nil { 12229 objectMap["firstName"] = ucp.FirstName 12230 } 12231 if ucp.LastName != nil { 12232 objectMap["lastName"] = ucp.LastName 12233 } 12234 if ucp.Email != nil { 12235 objectMap["email"] = ucp.Email 12236 } 12237 if ucp.RegistrationDate != nil { 12238 objectMap["registrationDate"] = ucp.RegistrationDate 12239 } 12240 if ucp.State != "" { 12241 objectMap["state"] = ucp.State 12242 } 12243 if ucp.Note != nil { 12244 objectMap["note"] = ucp.Note 12245 } 12246 if ucp.Identities != nil { 12247 objectMap["identities"] = ucp.Identities 12248 } 12249 return json.Marshal(objectMap) 12250} 12251 12252// UserCreateParameterProperties parameters supplied to the Create User operation. 12253type UserCreateParameterProperties struct { 12254 // Email - Email address. Must not be empty and must be unique within the service instance. 12255 Email *string `json:"email,omitempty"` 12256 // FirstName - First name. 12257 FirstName *string `json:"firstName,omitempty"` 12258 // LastName - Last name. 12259 LastName *string `json:"lastName,omitempty"` 12260 // Password - User Password. If no value is provided, a default password is generated. 12261 Password *string `json:"password,omitempty"` 12262 // AppType - Determines the type of application which send the create user request. Default is legacy portal. Possible values include: 'Portal', 'DeveloperPortal' 12263 AppType AppType `json:"appType,omitempty"` 12264 // Confirmation - Determines the type of confirmation e-mail that will be sent to the newly created user. Possible values include: 'Signup', 'Invite' 12265 Confirmation Confirmation `json:"confirmation,omitempty"` 12266 // 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' 12267 State UserState `json:"state,omitempty"` 12268 // Note - Optional note about a user set by the administrator. 12269 Note *string `json:"note,omitempty"` 12270 // Identities - Collection of user identities. 12271 Identities *[]UserIdentityContract `json:"identities,omitempty"` 12272} 12273 12274// UserCreateParameters user create details. 12275type UserCreateParameters struct { 12276 // UserCreateParameterProperties - User entity create contract properties. 12277 *UserCreateParameterProperties `json:"properties,omitempty"` 12278} 12279 12280// MarshalJSON is the custom marshaler for UserCreateParameters. 12281func (ucp UserCreateParameters) MarshalJSON() ([]byte, error) { 12282 objectMap := make(map[string]interface{}) 12283 if ucp.UserCreateParameterProperties != nil { 12284 objectMap["properties"] = ucp.UserCreateParameterProperties 12285 } 12286 return json.Marshal(objectMap) 12287} 12288 12289// UnmarshalJSON is the custom unmarshaler for UserCreateParameters struct. 12290func (ucp *UserCreateParameters) UnmarshalJSON(body []byte) error { 12291 var m map[string]*json.RawMessage 12292 err := json.Unmarshal(body, &m) 12293 if err != nil { 12294 return err 12295 } 12296 for k, v := range m { 12297 switch k { 12298 case "properties": 12299 if v != nil { 12300 var userCreateParameterProperties UserCreateParameterProperties 12301 err = json.Unmarshal(*v, &userCreateParameterProperties) 12302 if err != nil { 12303 return err 12304 } 12305 ucp.UserCreateParameterProperties = &userCreateParameterProperties 12306 } 12307 } 12308 } 12309 12310 return nil 12311} 12312 12313// UserEntityBaseParameters user Entity Base Parameters set. 12314type UserEntityBaseParameters struct { 12315 // 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' 12316 State UserState `json:"state,omitempty"` 12317 // Note - Optional note about a user set by the administrator. 12318 Note *string `json:"note,omitempty"` 12319 // Identities - Collection of user identities. 12320 Identities *[]UserIdentityContract `json:"identities,omitempty"` 12321} 12322 12323// UserIdentityCollection list of Users Identity list representation. 12324type UserIdentityCollection struct { 12325 autorest.Response `json:"-"` 12326 // Value - User Identity values. 12327 Value *[]UserIdentityContract `json:"value,omitempty"` 12328 // Count - Total record count number across all pages. 12329 Count *int64 `json:"count,omitempty"` 12330 // NextLink - Next page link if any. 12331 NextLink *string `json:"nextLink,omitempty"` 12332} 12333 12334// UserIdentityCollectionIterator provides access to a complete listing of UserIdentityContract values. 12335type UserIdentityCollectionIterator struct { 12336 i int 12337 page UserIdentityCollectionPage 12338} 12339 12340// NextWithContext advances to the next value. If there was an error making 12341// the request the iterator does not advance and the error is returned. 12342func (iter *UserIdentityCollectionIterator) NextWithContext(ctx context.Context) (err error) { 12343 if tracing.IsEnabled() { 12344 ctx = tracing.StartSpan(ctx, fqdn+"/UserIdentityCollectionIterator.NextWithContext") 12345 defer func() { 12346 sc := -1 12347 if iter.Response().Response.Response != nil { 12348 sc = iter.Response().Response.Response.StatusCode 12349 } 12350 tracing.EndSpan(ctx, sc, err) 12351 }() 12352 } 12353 iter.i++ 12354 if iter.i < len(iter.page.Values()) { 12355 return nil 12356 } 12357 err = iter.page.NextWithContext(ctx) 12358 if err != nil { 12359 iter.i-- 12360 return err 12361 } 12362 iter.i = 0 12363 return nil 12364} 12365 12366// Next advances to the next value. If there was an error making 12367// the request the iterator does not advance and the error is returned. 12368// Deprecated: Use NextWithContext() instead. 12369func (iter *UserIdentityCollectionIterator) Next() error { 12370 return iter.NextWithContext(context.Background()) 12371} 12372 12373// NotDone returns true if the enumeration should be started or is not yet complete. 12374func (iter UserIdentityCollectionIterator) NotDone() bool { 12375 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 12376} 12377 12378// Response returns the raw server response from the last page request. 12379func (iter UserIdentityCollectionIterator) Response() UserIdentityCollection { 12380 return iter.page.Response() 12381} 12382 12383// Value returns the current value or a zero-initialized value if the 12384// iterator has advanced beyond the end of the collection. 12385func (iter UserIdentityCollectionIterator) Value() UserIdentityContract { 12386 if !iter.page.NotDone() { 12387 return UserIdentityContract{} 12388 } 12389 return iter.page.Values()[iter.i] 12390} 12391 12392// Creates a new instance of the UserIdentityCollectionIterator type. 12393func NewUserIdentityCollectionIterator(page UserIdentityCollectionPage) UserIdentityCollectionIterator { 12394 return UserIdentityCollectionIterator{page: page} 12395} 12396 12397// IsEmpty returns true if the ListResult contains no values. 12398func (uic UserIdentityCollection) IsEmpty() bool { 12399 return uic.Value == nil || len(*uic.Value) == 0 12400} 12401 12402// hasNextLink returns true if the NextLink is not empty. 12403func (uic UserIdentityCollection) hasNextLink() bool { 12404 return uic.NextLink != nil && len(*uic.NextLink) != 0 12405} 12406 12407// userIdentityCollectionPreparer prepares a request to retrieve the next set of results. 12408// It returns nil if no more results exist. 12409func (uic UserIdentityCollection) userIdentityCollectionPreparer(ctx context.Context) (*http.Request, error) { 12410 if !uic.hasNextLink() { 12411 return nil, nil 12412 } 12413 return autorest.Prepare((&http.Request{}).WithContext(ctx), 12414 autorest.AsJSON(), 12415 autorest.AsGet(), 12416 autorest.WithBaseURL(to.String(uic.NextLink))) 12417} 12418 12419// UserIdentityCollectionPage contains a page of UserIdentityContract values. 12420type UserIdentityCollectionPage struct { 12421 fn func(context.Context, UserIdentityCollection) (UserIdentityCollection, error) 12422 uic UserIdentityCollection 12423} 12424 12425// NextWithContext advances to the next page of values. If there was an error making 12426// the request the page does not advance and the error is returned. 12427func (page *UserIdentityCollectionPage) NextWithContext(ctx context.Context) (err error) { 12428 if tracing.IsEnabled() { 12429 ctx = tracing.StartSpan(ctx, fqdn+"/UserIdentityCollectionPage.NextWithContext") 12430 defer func() { 12431 sc := -1 12432 if page.Response().Response.Response != nil { 12433 sc = page.Response().Response.Response.StatusCode 12434 } 12435 tracing.EndSpan(ctx, sc, err) 12436 }() 12437 } 12438 for { 12439 next, err := page.fn(ctx, page.uic) 12440 if err != nil { 12441 return err 12442 } 12443 page.uic = next 12444 if !next.hasNextLink() || !next.IsEmpty() { 12445 break 12446 } 12447 } 12448 return nil 12449} 12450 12451// Next advances to the next page of values. If there was an error making 12452// the request the page does not advance and the error is returned. 12453// Deprecated: Use NextWithContext() instead. 12454func (page *UserIdentityCollectionPage) Next() error { 12455 return page.NextWithContext(context.Background()) 12456} 12457 12458// NotDone returns true if the page enumeration should be started or is not yet complete. 12459func (page UserIdentityCollectionPage) NotDone() bool { 12460 return !page.uic.IsEmpty() 12461} 12462 12463// Response returns the raw server response from the last page request. 12464func (page UserIdentityCollectionPage) Response() UserIdentityCollection { 12465 return page.uic 12466} 12467 12468// Values returns the slice of values for the current page or nil if there are no values. 12469func (page UserIdentityCollectionPage) Values() []UserIdentityContract { 12470 if page.uic.IsEmpty() { 12471 return nil 12472 } 12473 return *page.uic.Value 12474} 12475 12476// Creates a new instance of the UserIdentityCollectionPage type. 12477func NewUserIdentityCollectionPage(cur UserIdentityCollection, getNextPage func(context.Context, UserIdentityCollection) (UserIdentityCollection, error)) UserIdentityCollectionPage { 12478 return UserIdentityCollectionPage{ 12479 fn: getNextPage, 12480 uic: cur, 12481 } 12482} 12483 12484// UserIdentityContract user identity details. 12485type UserIdentityContract struct { 12486 // Provider - Identity provider name. 12487 Provider *string `json:"provider,omitempty"` 12488 // ID - Identifier value within provider. 12489 ID *string `json:"id,omitempty"` 12490} 12491 12492// UserTokenParameterProperties parameters supplied to the Get User Token operation. 12493type UserTokenParameterProperties struct { 12494 // KeyType - The Key to be used to generate token for user. Possible values include: 'Primary', 'Secondary' 12495 KeyType KeyType `json:"keyType,omitempty"` 12496 // 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. 12497 Expiry *date.Time `json:"expiry,omitempty"` 12498} 12499 12500// UserTokenParameters get User Token parameters. 12501type UserTokenParameters struct { 12502 // UserTokenParameterProperties - User Token Parameter contract properties. 12503 *UserTokenParameterProperties `json:"properties,omitempty"` 12504} 12505 12506// MarshalJSON is the custom marshaler for UserTokenParameters. 12507func (utp UserTokenParameters) MarshalJSON() ([]byte, error) { 12508 objectMap := make(map[string]interface{}) 12509 if utp.UserTokenParameterProperties != nil { 12510 objectMap["properties"] = utp.UserTokenParameterProperties 12511 } 12512 return json.Marshal(objectMap) 12513} 12514 12515// UnmarshalJSON is the custom unmarshaler for UserTokenParameters struct. 12516func (utp *UserTokenParameters) UnmarshalJSON(body []byte) error { 12517 var m map[string]*json.RawMessage 12518 err := json.Unmarshal(body, &m) 12519 if err != nil { 12520 return err 12521 } 12522 for k, v := range m { 12523 switch k { 12524 case "properties": 12525 if v != nil { 12526 var userTokenParameterProperties UserTokenParameterProperties 12527 err = json.Unmarshal(*v, &userTokenParameterProperties) 12528 if err != nil { 12529 return err 12530 } 12531 utp.UserTokenParameterProperties = &userTokenParameterProperties 12532 } 12533 } 12534 } 12535 12536 return nil 12537} 12538 12539// UserTokenResult get User Token response details. 12540type UserTokenResult struct { 12541 autorest.Response `json:"-"` 12542 // Value - Shared Access Authorization token for the User. 12543 Value *string `json:"value,omitempty"` 12544} 12545 12546// UserUpdateParameters user update parameters. 12547type UserUpdateParameters struct { 12548 // UserUpdateParametersProperties - User entity update contract properties. 12549 *UserUpdateParametersProperties `json:"properties,omitempty"` 12550} 12551 12552// MarshalJSON is the custom marshaler for UserUpdateParameters. 12553func (uup UserUpdateParameters) MarshalJSON() ([]byte, error) { 12554 objectMap := make(map[string]interface{}) 12555 if uup.UserUpdateParametersProperties != nil { 12556 objectMap["properties"] = uup.UserUpdateParametersProperties 12557 } 12558 return json.Marshal(objectMap) 12559} 12560 12561// UnmarshalJSON is the custom unmarshaler for UserUpdateParameters struct. 12562func (uup *UserUpdateParameters) UnmarshalJSON(body []byte) error { 12563 var m map[string]*json.RawMessage 12564 err := json.Unmarshal(body, &m) 12565 if err != nil { 12566 return err 12567 } 12568 for k, v := range m { 12569 switch k { 12570 case "properties": 12571 if v != nil { 12572 var userUpdateParametersProperties UserUpdateParametersProperties 12573 err = json.Unmarshal(*v, &userUpdateParametersProperties) 12574 if err != nil { 12575 return err 12576 } 12577 uup.UserUpdateParametersProperties = &userUpdateParametersProperties 12578 } 12579 } 12580 } 12581 12582 return nil 12583} 12584 12585// UserUpdateParametersProperties parameters supplied to the Update User operation. 12586type UserUpdateParametersProperties struct { 12587 // Email - Email address. Must not be empty and must be unique within the service instance. 12588 Email *string `json:"email,omitempty"` 12589 // Password - User Password. 12590 Password *string `json:"password,omitempty"` 12591 // FirstName - First name. 12592 FirstName *string `json:"firstName,omitempty"` 12593 // LastName - Last name. 12594 LastName *string `json:"lastName,omitempty"` 12595 // 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' 12596 State UserState `json:"state,omitempty"` 12597 // Note - Optional note about a user set by the administrator. 12598 Note *string `json:"note,omitempty"` 12599 // Identities - Collection of user identities. 12600 Identities *[]UserIdentityContract `json:"identities,omitempty"` 12601} 12602 12603// VirtualNetworkConfiguration configuration of a virtual network to which API Management service is 12604// deployed. 12605type VirtualNetworkConfiguration struct { 12606 // Vnetid - READ-ONLY; The virtual network ID. This is typically a GUID. Expect a null GUID by default. 12607 Vnetid *string `json:"vnetid,omitempty"` 12608 // Subnetname - READ-ONLY; The name of the subnet. 12609 Subnetname *string `json:"subnetname,omitempty"` 12610 // SubnetResourceID - The full resource ID of a subnet in a virtual network to deploy the API Management service in. 12611 SubnetResourceID *string `json:"subnetResourceId,omitempty"` 12612} 12613 12614// MarshalJSON is the custom marshaler for VirtualNetworkConfiguration. 12615func (vnc VirtualNetworkConfiguration) MarshalJSON() ([]byte, error) { 12616 objectMap := make(map[string]interface{}) 12617 if vnc.SubnetResourceID != nil { 12618 objectMap["subnetResourceId"] = vnc.SubnetResourceID 12619 } 12620 return json.Marshal(objectMap) 12621} 12622 12623// X509CertificateName properties of server X509Names. 12624type X509CertificateName struct { 12625 // Name - Common Name of the Certificate. 12626 Name *string `json:"name,omitempty"` 12627 // IssuerCertificateThumbprint - Thumbprint for the Issuer of the Certificate. 12628 IssuerCertificateThumbprint *string `json:"issuerCertificateThumbprint,omitempty"` 12629} 12630