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