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/preview/apimanagement/mgmt/2018-06-01-preview/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 // SubscriptionRequired - Specifies whether an API or Product subscription is required for accessing the API. 347 SubscriptionRequired *bool `json:"subscriptionRequired,omitempty"` 348} 349 350// MarshalJSON is the custom marshaler for APIContractProperties. 351func (acp APIContractProperties) MarshalJSON() ([]byte, error) { 352 objectMap := make(map[string]interface{}) 353 if acp.DisplayName != nil { 354 objectMap["displayName"] = acp.DisplayName 355 } 356 if acp.ServiceURL != nil { 357 objectMap["serviceUrl"] = acp.ServiceURL 358 } 359 if acp.Path != nil { 360 objectMap["path"] = acp.Path 361 } 362 if acp.Protocols != nil { 363 objectMap["protocols"] = acp.Protocols 364 } 365 if acp.APIVersionSet != nil { 366 objectMap["apiVersionSet"] = acp.APIVersionSet 367 } 368 if acp.Description != nil { 369 objectMap["description"] = acp.Description 370 } 371 if acp.AuthenticationSettings != nil { 372 objectMap["authenticationSettings"] = acp.AuthenticationSettings 373 } 374 if acp.SubscriptionKeyParameterNames != nil { 375 objectMap["subscriptionKeyParameterNames"] = acp.SubscriptionKeyParameterNames 376 } 377 if acp.APIType != "" { 378 objectMap["type"] = acp.APIType 379 } 380 if acp.APIRevision != nil { 381 objectMap["apiRevision"] = acp.APIRevision 382 } 383 if acp.APIVersion != nil { 384 objectMap["apiVersion"] = acp.APIVersion 385 } 386 if acp.APIRevisionDescription != nil { 387 objectMap["apiRevisionDescription"] = acp.APIRevisionDescription 388 } 389 if acp.APIVersionDescription != nil { 390 objectMap["apiVersionDescription"] = acp.APIVersionDescription 391 } 392 if acp.APIVersionSetID != nil { 393 objectMap["apiVersionSetId"] = acp.APIVersionSetID 394 } 395 if acp.SubscriptionRequired != nil { 396 objectMap["subscriptionRequired"] = acp.SubscriptionRequired 397 } 398 return json.Marshal(objectMap) 399} 400 401// APIContractUpdateProperties API update contract properties. 402type APIContractUpdateProperties struct { 403 // DisplayName - API name. 404 DisplayName *string `json:"displayName,omitempty"` 405 // ServiceURL - Absolute URL of the backend service implementing this API. 406 ServiceURL *string `json:"serviceUrl,omitempty"` 407 // 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. 408 Path *string `json:"path,omitempty"` 409 // Protocols - Describes on which protocols the operations in this API can be invoked. 410 Protocols *[]Protocol `json:"protocols,omitempty"` 411 // Description - Description of the API. May include HTML formatting tags. 412 Description *string `json:"description,omitempty"` 413 // AuthenticationSettings - Collection of authentication settings included into this API. 414 AuthenticationSettings *AuthenticationSettingsContract `json:"authenticationSettings,omitempty"` 415 // SubscriptionKeyParameterNames - Protocols over which API is made available. 416 SubscriptionKeyParameterNames *SubscriptionKeyParameterNamesContract `json:"subscriptionKeyParameterNames,omitempty"` 417 // APIType - Type of API. Possible values include: 'HTTP', 'Soap' 418 APIType APIType `json:"type,omitempty"` 419 // APIRevision - Describes the Revision of the Api. If no value is provided, default revision 1 is created 420 APIRevision *string `json:"apiRevision,omitempty"` 421 // APIVersion - Indicates the Version identifier of the API if the API is versioned 422 APIVersion *string `json:"apiVersion,omitempty"` 423 // IsCurrent - READ-ONLY; Indicates if API revision is current api revision. 424 IsCurrent *bool `json:"isCurrent,omitempty"` 425 // IsOnline - READ-ONLY; Indicates if API revision is accessible via the gateway. 426 IsOnline *bool `json:"isOnline,omitempty"` 427 // APIRevisionDescription - Description of the Api Revision. 428 APIRevisionDescription *string `json:"apiRevisionDescription,omitempty"` 429 // APIVersionDescription - Description of the Api Version. 430 APIVersionDescription *string `json:"apiVersionDescription,omitempty"` 431 // APIVersionSetID - A resource identifier for the related ApiVersionSet. 432 APIVersionSetID *string `json:"apiVersionSetId,omitempty"` 433 // SubscriptionRequired - Specifies whether an API or Product subscription is required for accessing the API. 434 SubscriptionRequired *bool `json:"subscriptionRequired,omitempty"` 435} 436 437// MarshalJSON is the custom marshaler for APIContractUpdateProperties. 438func (acup APIContractUpdateProperties) MarshalJSON() ([]byte, error) { 439 objectMap := make(map[string]interface{}) 440 if acup.DisplayName != nil { 441 objectMap["displayName"] = acup.DisplayName 442 } 443 if acup.ServiceURL != nil { 444 objectMap["serviceUrl"] = acup.ServiceURL 445 } 446 if acup.Path != nil { 447 objectMap["path"] = acup.Path 448 } 449 if acup.Protocols != nil { 450 objectMap["protocols"] = acup.Protocols 451 } 452 if acup.Description != nil { 453 objectMap["description"] = acup.Description 454 } 455 if acup.AuthenticationSettings != nil { 456 objectMap["authenticationSettings"] = acup.AuthenticationSettings 457 } 458 if acup.SubscriptionKeyParameterNames != nil { 459 objectMap["subscriptionKeyParameterNames"] = acup.SubscriptionKeyParameterNames 460 } 461 if acup.APIType != "" { 462 objectMap["type"] = acup.APIType 463 } 464 if acup.APIRevision != nil { 465 objectMap["apiRevision"] = acup.APIRevision 466 } 467 if acup.APIVersion != nil { 468 objectMap["apiVersion"] = acup.APIVersion 469 } 470 if acup.APIRevisionDescription != nil { 471 objectMap["apiRevisionDescription"] = acup.APIRevisionDescription 472 } 473 if acup.APIVersionDescription != nil { 474 objectMap["apiVersionDescription"] = acup.APIVersionDescription 475 } 476 if acup.APIVersionSetID != nil { 477 objectMap["apiVersionSetId"] = acup.APIVersionSetID 478 } 479 if acup.SubscriptionRequired != nil { 480 objectMap["subscriptionRequired"] = acup.SubscriptionRequired 481 } 482 return json.Marshal(objectMap) 483} 484 485// APICreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 486// operation. 487type APICreateOrUpdateFuture struct { 488 azure.FutureAPI 489 // Result returns the result of the asynchronous operation. 490 // If the operation has not completed it will return an error. 491 Result func(APIClient) (APIContract, error) 492} 493 494// UnmarshalJSON is the custom unmarshaller for CreateFuture. 495func (future *APICreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 496 var azFuture azure.Future 497 if err := json.Unmarshal(body, &azFuture); err != nil { 498 return err 499 } 500 future.FutureAPI = &azFuture 501 future.Result = future.result 502 return nil 503} 504 505// result is the default implementation for APICreateOrUpdateFuture.Result. 506func (future *APICreateOrUpdateFuture) result(client APIClient) (ac APIContract, err error) { 507 var done bool 508 done, err = future.DoneWithContext(context.Background(), client) 509 if err != nil { 510 err = autorest.NewErrorWithError(err, "apimanagement.APICreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 511 return 512 } 513 if !done { 514 ac.Response.Response = future.Response() 515 err = azure.NewAsyncOpIncompleteError("apimanagement.APICreateOrUpdateFuture") 516 return 517 } 518 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 519 if ac.Response.Response, err = future.GetResult(sender); err == nil && ac.Response.Response.StatusCode != http.StatusNoContent { 520 ac, err = client.CreateOrUpdateResponder(ac.Response.Response) 521 if err != nil { 522 err = autorest.NewErrorWithError(err, "apimanagement.APICreateOrUpdateFuture", "Result", ac.Response.Response, "Failure responding to request") 523 } 524 } 525 return 526} 527 528// APICreateOrUpdateParameter API Create or Update Parameters. 529type APICreateOrUpdateParameter struct { 530 // APICreateOrUpdateProperties - Api entity create of update properties. 531 *APICreateOrUpdateProperties `json:"properties,omitempty"` 532} 533 534// MarshalJSON is the custom marshaler for APICreateOrUpdateParameter. 535func (acoup APICreateOrUpdateParameter) MarshalJSON() ([]byte, error) { 536 objectMap := make(map[string]interface{}) 537 if acoup.APICreateOrUpdateProperties != nil { 538 objectMap["properties"] = acoup.APICreateOrUpdateProperties 539 } 540 return json.Marshal(objectMap) 541} 542 543// UnmarshalJSON is the custom unmarshaler for APICreateOrUpdateParameter struct. 544func (acoup *APICreateOrUpdateParameter) UnmarshalJSON(body []byte) error { 545 var m map[string]*json.RawMessage 546 err := json.Unmarshal(body, &m) 547 if err != nil { 548 return err 549 } 550 for k, v := range m { 551 switch k { 552 case "properties": 553 if v != nil { 554 var APICreateOrUpdateProperties APICreateOrUpdateProperties 555 err = json.Unmarshal(*v, &APICreateOrUpdateProperties) 556 if err != nil { 557 return err 558 } 559 acoup.APICreateOrUpdateProperties = &APICreateOrUpdateProperties 560 } 561 } 562 } 563 564 return nil 565} 566 567// APICreateOrUpdateProperties api Create or Update Properties. 568type APICreateOrUpdateProperties struct { 569 // ContentValue - Content value when Importing an API. 570 ContentValue *string `json:"contentValue,omitempty"` 571 // ContentFormat - Format of the Content in which the API is getting imported. Possible values include: 'WadlXML', 'WadlLinkJSON', 'SwaggerJSON', 'SwaggerLinkJSON', 'Wsdl', 'WsdlLink', 'Openapi', 'Openapijson', 'OpenapiLink' 572 ContentFormat ContentFormat `json:"contentFormat,omitempty"` 573 // WsdlSelector - Criteria to limit import of WSDL to a subset of the document. 574 WsdlSelector *APICreateOrUpdatePropertiesWsdlSelector `json:"wsdlSelector,omitempty"` 575 // SoapAPIType - Type of Api to create. 576 // * `http` creates a SOAP to REST API 577 // * `soap` creates a SOAP pass-through API. Possible values include: 'SoapToRest', 'SoapPassThrough' 578 SoapAPIType SoapAPIType `json:"apiType,omitempty"` 579 // DisplayName - API name. 580 DisplayName *string `json:"displayName,omitempty"` 581 // ServiceURL - Absolute URL of the backend service implementing this API. 582 ServiceURL *string `json:"serviceUrl,omitempty"` 583 // 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. 584 Path *string `json:"path,omitempty"` 585 // Protocols - Describes on which protocols the operations in this API can be invoked. 586 Protocols *[]Protocol `json:"protocols,omitempty"` 587 APIVersionSet *APIVersionSetContractDetails `json:"apiVersionSet,omitempty"` 588 // Description - Description of the API. May include HTML formatting tags. 589 Description *string `json:"description,omitempty"` 590 // AuthenticationSettings - Collection of authentication settings included into this API. 591 AuthenticationSettings *AuthenticationSettingsContract `json:"authenticationSettings,omitempty"` 592 // SubscriptionKeyParameterNames - Protocols over which API is made available. 593 SubscriptionKeyParameterNames *SubscriptionKeyParameterNamesContract `json:"subscriptionKeyParameterNames,omitempty"` 594 // APIType - Type of API. Possible values include: 'HTTP', 'Soap' 595 APIType APIType `json:"type,omitempty"` 596 // APIRevision - Describes the Revision of the Api. If no value is provided, default revision 1 is created 597 APIRevision *string `json:"apiRevision,omitempty"` 598 // APIVersion - Indicates the Version identifier of the API if the API is versioned 599 APIVersion *string `json:"apiVersion,omitempty"` 600 // IsCurrent - READ-ONLY; Indicates if API revision is current api revision. 601 IsCurrent *bool `json:"isCurrent,omitempty"` 602 // IsOnline - READ-ONLY; Indicates if API revision is accessible via the gateway. 603 IsOnline *bool `json:"isOnline,omitempty"` 604 // APIRevisionDescription - Description of the Api Revision. 605 APIRevisionDescription *string `json:"apiRevisionDescription,omitempty"` 606 // APIVersionDescription - Description of the Api Version. 607 APIVersionDescription *string `json:"apiVersionDescription,omitempty"` 608 // APIVersionSetID - A resource identifier for the related ApiVersionSet. 609 APIVersionSetID *string `json:"apiVersionSetId,omitempty"` 610 // SubscriptionRequired - Specifies whether an API or Product subscription is required for accessing the API. 611 SubscriptionRequired *bool `json:"subscriptionRequired,omitempty"` 612} 613 614// MarshalJSON is the custom marshaler for APICreateOrUpdateProperties. 615func (acoup APICreateOrUpdateProperties) MarshalJSON() ([]byte, error) { 616 objectMap := make(map[string]interface{}) 617 if acoup.ContentValue != nil { 618 objectMap["contentValue"] = acoup.ContentValue 619 } 620 if acoup.ContentFormat != "" { 621 objectMap["contentFormat"] = acoup.ContentFormat 622 } 623 if acoup.WsdlSelector != nil { 624 objectMap["wsdlSelector"] = acoup.WsdlSelector 625 } 626 if acoup.SoapAPIType != "" { 627 objectMap["apiType"] = acoup.SoapAPIType 628 } 629 if acoup.DisplayName != nil { 630 objectMap["displayName"] = acoup.DisplayName 631 } 632 if acoup.ServiceURL != nil { 633 objectMap["serviceUrl"] = acoup.ServiceURL 634 } 635 if acoup.Path != nil { 636 objectMap["path"] = acoup.Path 637 } 638 if acoup.Protocols != nil { 639 objectMap["protocols"] = acoup.Protocols 640 } 641 if acoup.APIVersionSet != nil { 642 objectMap["apiVersionSet"] = acoup.APIVersionSet 643 } 644 if acoup.Description != nil { 645 objectMap["description"] = acoup.Description 646 } 647 if acoup.AuthenticationSettings != nil { 648 objectMap["authenticationSettings"] = acoup.AuthenticationSettings 649 } 650 if acoup.SubscriptionKeyParameterNames != nil { 651 objectMap["subscriptionKeyParameterNames"] = acoup.SubscriptionKeyParameterNames 652 } 653 if acoup.APIType != "" { 654 objectMap["type"] = acoup.APIType 655 } 656 if acoup.APIRevision != nil { 657 objectMap["apiRevision"] = acoup.APIRevision 658 } 659 if acoup.APIVersion != nil { 660 objectMap["apiVersion"] = acoup.APIVersion 661 } 662 if acoup.APIRevisionDescription != nil { 663 objectMap["apiRevisionDescription"] = acoup.APIRevisionDescription 664 } 665 if acoup.APIVersionDescription != nil { 666 objectMap["apiVersionDescription"] = acoup.APIVersionDescription 667 } 668 if acoup.APIVersionSetID != nil { 669 objectMap["apiVersionSetId"] = acoup.APIVersionSetID 670 } 671 if acoup.SubscriptionRequired != nil { 672 objectMap["subscriptionRequired"] = acoup.SubscriptionRequired 673 } 674 return json.Marshal(objectMap) 675} 676 677// APICreateOrUpdatePropertiesWsdlSelector criteria to limit import of WSDL to a subset of the document. 678type APICreateOrUpdatePropertiesWsdlSelector struct { 679 // WsdlServiceName - Name of service to import from WSDL 680 WsdlServiceName *string `json:"wsdlServiceName,omitempty"` 681 // WsdlEndpointName - Name of endpoint(port) to import from WSDL 682 WsdlEndpointName *string `json:"wsdlEndpointName,omitempty"` 683} 684 685// APIEntityBaseContract API base contract details. 686type APIEntityBaseContract struct { 687 // Description - Description of the API. May include HTML formatting tags. 688 Description *string `json:"description,omitempty"` 689 // AuthenticationSettings - Collection of authentication settings included into this API. 690 AuthenticationSettings *AuthenticationSettingsContract `json:"authenticationSettings,omitempty"` 691 // SubscriptionKeyParameterNames - Protocols over which API is made available. 692 SubscriptionKeyParameterNames *SubscriptionKeyParameterNamesContract `json:"subscriptionKeyParameterNames,omitempty"` 693 // APIType - Type of API. Possible values include: 'HTTP', 'Soap' 694 APIType APIType `json:"type,omitempty"` 695 // APIRevision - Describes the Revision of the Api. If no value is provided, default revision 1 is created 696 APIRevision *string `json:"apiRevision,omitempty"` 697 // APIVersion - Indicates the Version identifier of the API if the API is versioned 698 APIVersion *string `json:"apiVersion,omitempty"` 699 // IsCurrent - READ-ONLY; Indicates if API revision is current api revision. 700 IsCurrent *bool `json:"isCurrent,omitempty"` 701 // IsOnline - READ-ONLY; Indicates if API revision is accessible via the gateway. 702 IsOnline *bool `json:"isOnline,omitempty"` 703 // APIRevisionDescription - Description of the Api Revision. 704 APIRevisionDescription *string `json:"apiRevisionDescription,omitempty"` 705 // APIVersionDescription - Description of the Api Version. 706 APIVersionDescription *string `json:"apiVersionDescription,omitempty"` 707 // APIVersionSetID - A resource identifier for the related ApiVersionSet. 708 APIVersionSetID *string `json:"apiVersionSetId,omitempty"` 709 // SubscriptionRequired - Specifies whether an API or Product subscription is required for accessing the API. 710 SubscriptionRequired *bool `json:"subscriptionRequired,omitempty"` 711} 712 713// MarshalJSON is the custom marshaler for APIEntityBaseContract. 714func (aebc APIEntityBaseContract) MarshalJSON() ([]byte, error) { 715 objectMap := make(map[string]interface{}) 716 if aebc.Description != nil { 717 objectMap["description"] = aebc.Description 718 } 719 if aebc.AuthenticationSettings != nil { 720 objectMap["authenticationSettings"] = aebc.AuthenticationSettings 721 } 722 if aebc.SubscriptionKeyParameterNames != nil { 723 objectMap["subscriptionKeyParameterNames"] = aebc.SubscriptionKeyParameterNames 724 } 725 if aebc.APIType != "" { 726 objectMap["type"] = aebc.APIType 727 } 728 if aebc.APIRevision != nil { 729 objectMap["apiRevision"] = aebc.APIRevision 730 } 731 if aebc.APIVersion != nil { 732 objectMap["apiVersion"] = aebc.APIVersion 733 } 734 if aebc.APIRevisionDescription != nil { 735 objectMap["apiRevisionDescription"] = aebc.APIRevisionDescription 736 } 737 if aebc.APIVersionDescription != nil { 738 objectMap["apiVersionDescription"] = aebc.APIVersionDescription 739 } 740 if aebc.APIVersionSetID != nil { 741 objectMap["apiVersionSetId"] = aebc.APIVersionSetID 742 } 743 if aebc.SubscriptionRequired != nil { 744 objectMap["subscriptionRequired"] = aebc.SubscriptionRequired 745 } 746 return json.Marshal(objectMap) 747} 748 749// APIExportResult API Export result Blob Uri. 750type APIExportResult struct { 751 autorest.Response `json:"-"` 752 // Link - Link to the Storage Blob containing the result of the export operation. The Blob Uri is only valid for 5 minutes. 753 Link *string `json:"link,omitempty"` 754} 755 756// ApimResource the Resource definition. 757type ApimResource struct { 758 // ID - READ-ONLY; Resource ID. 759 ID *string `json:"id,omitempty"` 760 // Name - READ-ONLY; Resource name. 761 Name *string `json:"name,omitempty"` 762 // Type - READ-ONLY; Resource type for API Management resource is set to Microsoft.ApiManagement. 763 Type *string `json:"type,omitempty"` 764 // Tags - Resource tags. 765 Tags map[string]*string `json:"tags"` 766} 767 768// MarshalJSON is the custom marshaler for ApimResource. 769func (ar ApimResource) MarshalJSON() ([]byte, error) { 770 objectMap := make(map[string]interface{}) 771 if ar.Tags != nil { 772 objectMap["tags"] = ar.Tags 773 } 774 return json.Marshal(objectMap) 775} 776 777// APIReleaseCollection paged Api Revision list representation. 778type APIReleaseCollection struct { 779 autorest.Response `json:"-"` 780 // Value - READ-ONLY; Page values. 781 Value *[]APIReleaseContract `json:"value,omitempty"` 782 // NextLink - READ-ONLY; Next page link if any. 783 NextLink *string `json:"nextLink,omitempty"` 784} 785 786// MarshalJSON is the custom marshaler for APIReleaseCollection. 787func (arc APIReleaseCollection) MarshalJSON() ([]byte, error) { 788 objectMap := make(map[string]interface{}) 789 return json.Marshal(objectMap) 790} 791 792// APIReleaseCollectionIterator provides access to a complete listing of APIReleaseContract values. 793type APIReleaseCollectionIterator struct { 794 i int 795 page APIReleaseCollectionPage 796} 797 798// NextWithContext advances to the next value. If there was an error making 799// the request the iterator does not advance and the error is returned. 800func (iter *APIReleaseCollectionIterator) NextWithContext(ctx context.Context) (err error) { 801 if tracing.IsEnabled() { 802 ctx = tracing.StartSpan(ctx, fqdn+"/APIReleaseCollectionIterator.NextWithContext") 803 defer func() { 804 sc := -1 805 if iter.Response().Response.Response != nil { 806 sc = iter.Response().Response.Response.StatusCode 807 } 808 tracing.EndSpan(ctx, sc, err) 809 }() 810 } 811 iter.i++ 812 if iter.i < len(iter.page.Values()) { 813 return nil 814 } 815 err = iter.page.NextWithContext(ctx) 816 if err != nil { 817 iter.i-- 818 return err 819 } 820 iter.i = 0 821 return nil 822} 823 824// Next advances to the next value. If there was an error making 825// the request the iterator does not advance and the error is returned. 826// Deprecated: Use NextWithContext() instead. 827func (iter *APIReleaseCollectionIterator) Next() error { 828 return iter.NextWithContext(context.Background()) 829} 830 831// NotDone returns true if the enumeration should be started or is not yet complete. 832func (iter APIReleaseCollectionIterator) NotDone() bool { 833 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 834} 835 836// Response returns the raw server response from the last page request. 837func (iter APIReleaseCollectionIterator) Response() APIReleaseCollection { 838 return iter.page.Response() 839} 840 841// Value returns the current value or a zero-initialized value if the 842// iterator has advanced beyond the end of the collection. 843func (iter APIReleaseCollectionIterator) Value() APIReleaseContract { 844 if !iter.page.NotDone() { 845 return APIReleaseContract{} 846 } 847 return iter.page.Values()[iter.i] 848} 849 850// Creates a new instance of the APIReleaseCollectionIterator type. 851func NewAPIReleaseCollectionIterator(page APIReleaseCollectionPage) APIReleaseCollectionIterator { 852 return APIReleaseCollectionIterator{page: page} 853} 854 855// IsEmpty returns true if the ListResult contains no values. 856func (arc APIReleaseCollection) IsEmpty() bool { 857 return arc.Value == nil || len(*arc.Value) == 0 858} 859 860// hasNextLink returns true if the NextLink is not empty. 861func (arc APIReleaseCollection) hasNextLink() bool { 862 return arc.NextLink != nil && len(*arc.NextLink) != 0 863} 864 865// aPIReleaseCollectionPreparer prepares a request to retrieve the next set of results. 866// It returns nil if no more results exist. 867func (arc APIReleaseCollection) aPIReleaseCollectionPreparer(ctx context.Context) (*http.Request, error) { 868 if !arc.hasNextLink() { 869 return nil, nil 870 } 871 return autorest.Prepare((&http.Request{}).WithContext(ctx), 872 autorest.AsJSON(), 873 autorest.AsGet(), 874 autorest.WithBaseURL(to.String(arc.NextLink))) 875} 876 877// APIReleaseCollectionPage contains a page of APIReleaseContract values. 878type APIReleaseCollectionPage struct { 879 fn func(context.Context, APIReleaseCollection) (APIReleaseCollection, error) 880 arc APIReleaseCollection 881} 882 883// NextWithContext advances to the next page of values. If there was an error making 884// the request the page does not advance and the error is returned. 885func (page *APIReleaseCollectionPage) NextWithContext(ctx context.Context) (err error) { 886 if tracing.IsEnabled() { 887 ctx = tracing.StartSpan(ctx, fqdn+"/APIReleaseCollectionPage.NextWithContext") 888 defer func() { 889 sc := -1 890 if page.Response().Response.Response != nil { 891 sc = page.Response().Response.Response.StatusCode 892 } 893 tracing.EndSpan(ctx, sc, err) 894 }() 895 } 896 for { 897 next, err := page.fn(ctx, page.arc) 898 if err != nil { 899 return err 900 } 901 page.arc = next 902 if !next.hasNextLink() || !next.IsEmpty() { 903 break 904 } 905 } 906 return nil 907} 908 909// Next advances to the next page of values. If there was an error making 910// the request the page does not advance and the error is returned. 911// Deprecated: Use NextWithContext() instead. 912func (page *APIReleaseCollectionPage) Next() error { 913 return page.NextWithContext(context.Background()) 914} 915 916// NotDone returns true if the page enumeration should be started or is not yet complete. 917func (page APIReleaseCollectionPage) NotDone() bool { 918 return !page.arc.IsEmpty() 919} 920 921// Response returns the raw server response from the last page request. 922func (page APIReleaseCollectionPage) Response() APIReleaseCollection { 923 return page.arc 924} 925 926// Values returns the slice of values for the current page or nil if there are no values. 927func (page APIReleaseCollectionPage) Values() []APIReleaseContract { 928 if page.arc.IsEmpty() { 929 return nil 930 } 931 return *page.arc.Value 932} 933 934// Creates a new instance of the APIReleaseCollectionPage type. 935func NewAPIReleaseCollectionPage(cur APIReleaseCollection, getNextPage func(context.Context, APIReleaseCollection) (APIReleaseCollection, error)) APIReleaseCollectionPage { 936 return APIReleaseCollectionPage{ 937 fn: getNextPage, 938 arc: cur, 939 } 940} 941 942// APIReleaseContract api Release details. 943type APIReleaseContract struct { 944 autorest.Response `json:"-"` 945 // APIReleaseContractProperties - Properties of the Api Release Contract. 946 *APIReleaseContractProperties `json:"properties,omitempty"` 947 // ID - READ-ONLY; Resource ID. 948 ID *string `json:"id,omitempty"` 949 // Name - READ-ONLY; Resource name. 950 Name *string `json:"name,omitempty"` 951 // Type - READ-ONLY; Resource type for API Management resource. 952 Type *string `json:"type,omitempty"` 953} 954 955// MarshalJSON is the custom marshaler for APIReleaseContract. 956func (arc APIReleaseContract) MarshalJSON() ([]byte, error) { 957 objectMap := make(map[string]interface{}) 958 if arc.APIReleaseContractProperties != nil { 959 objectMap["properties"] = arc.APIReleaseContractProperties 960 } 961 return json.Marshal(objectMap) 962} 963 964// UnmarshalJSON is the custom unmarshaler for APIReleaseContract struct. 965func (arc *APIReleaseContract) UnmarshalJSON(body []byte) error { 966 var m map[string]*json.RawMessage 967 err := json.Unmarshal(body, &m) 968 if err != nil { 969 return err 970 } 971 for k, v := range m { 972 switch k { 973 case "properties": 974 if v != nil { 975 var APIReleaseContractProperties APIReleaseContractProperties 976 err = json.Unmarshal(*v, &APIReleaseContractProperties) 977 if err != nil { 978 return err 979 } 980 arc.APIReleaseContractProperties = &APIReleaseContractProperties 981 } 982 case "id": 983 if v != nil { 984 var ID string 985 err = json.Unmarshal(*v, &ID) 986 if err != nil { 987 return err 988 } 989 arc.ID = &ID 990 } 991 case "name": 992 if v != nil { 993 var name string 994 err = json.Unmarshal(*v, &name) 995 if err != nil { 996 return err 997 } 998 arc.Name = &name 999 } 1000 case "type": 1001 if v != nil { 1002 var typeVar string 1003 err = json.Unmarshal(*v, &typeVar) 1004 if err != nil { 1005 return err 1006 } 1007 arc.Type = &typeVar 1008 } 1009 } 1010 } 1011 1012 return nil 1013} 1014 1015// APIReleaseContractProperties API Release details 1016type APIReleaseContractProperties struct { 1017 // APIID - Identifier of the API the release belongs to. 1018 APIID *string `json:"apiId,omitempty"` 1019 // 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. 1020 CreatedDateTime *date.Time `json:"createdDateTime,omitempty"` 1021 // UpdatedDateTime - READ-ONLY; The time the API release was updated. 1022 UpdatedDateTime *date.Time `json:"updatedDateTime,omitempty"` 1023 // Notes - Release Notes 1024 Notes *string `json:"notes,omitempty"` 1025} 1026 1027// MarshalJSON is the custom marshaler for APIReleaseContractProperties. 1028func (arcp APIReleaseContractProperties) MarshalJSON() ([]byte, error) { 1029 objectMap := make(map[string]interface{}) 1030 if arcp.APIID != nil { 1031 objectMap["apiId"] = arcp.APIID 1032 } 1033 if arcp.Notes != nil { 1034 objectMap["notes"] = arcp.Notes 1035 } 1036 return json.Marshal(objectMap) 1037} 1038 1039// APIRevisionCollection paged Api Revision list representation. 1040type APIRevisionCollection struct { 1041 autorest.Response `json:"-"` 1042 // Value - READ-ONLY; Page values. 1043 Value *[]APIRevisionContract `json:"value,omitempty"` 1044 // NextLink - READ-ONLY; Next page link if any. 1045 NextLink *string `json:"nextLink,omitempty"` 1046} 1047 1048// MarshalJSON is the custom marshaler for APIRevisionCollection. 1049func (arc APIRevisionCollection) MarshalJSON() ([]byte, error) { 1050 objectMap := make(map[string]interface{}) 1051 return json.Marshal(objectMap) 1052} 1053 1054// APIRevisionCollectionIterator provides access to a complete listing of APIRevisionContract values. 1055type APIRevisionCollectionIterator struct { 1056 i int 1057 page APIRevisionCollectionPage 1058} 1059 1060// NextWithContext advances to the next value. If there was an error making 1061// the request the iterator does not advance and the error is returned. 1062func (iter *APIRevisionCollectionIterator) NextWithContext(ctx context.Context) (err error) { 1063 if tracing.IsEnabled() { 1064 ctx = tracing.StartSpan(ctx, fqdn+"/APIRevisionCollectionIterator.NextWithContext") 1065 defer func() { 1066 sc := -1 1067 if iter.Response().Response.Response != nil { 1068 sc = iter.Response().Response.Response.StatusCode 1069 } 1070 tracing.EndSpan(ctx, sc, err) 1071 }() 1072 } 1073 iter.i++ 1074 if iter.i < len(iter.page.Values()) { 1075 return nil 1076 } 1077 err = iter.page.NextWithContext(ctx) 1078 if err != nil { 1079 iter.i-- 1080 return err 1081 } 1082 iter.i = 0 1083 return nil 1084} 1085 1086// Next advances to the next value. If there was an error making 1087// the request the iterator does not advance and the error is returned. 1088// Deprecated: Use NextWithContext() instead. 1089func (iter *APIRevisionCollectionIterator) Next() error { 1090 return iter.NextWithContext(context.Background()) 1091} 1092 1093// NotDone returns true if the enumeration should be started or is not yet complete. 1094func (iter APIRevisionCollectionIterator) NotDone() bool { 1095 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 1096} 1097 1098// Response returns the raw server response from the last page request. 1099func (iter APIRevisionCollectionIterator) Response() APIRevisionCollection { 1100 return iter.page.Response() 1101} 1102 1103// Value returns the current value or a zero-initialized value if the 1104// iterator has advanced beyond the end of the collection. 1105func (iter APIRevisionCollectionIterator) Value() APIRevisionContract { 1106 if !iter.page.NotDone() { 1107 return APIRevisionContract{} 1108 } 1109 return iter.page.Values()[iter.i] 1110} 1111 1112// Creates a new instance of the APIRevisionCollectionIterator type. 1113func NewAPIRevisionCollectionIterator(page APIRevisionCollectionPage) APIRevisionCollectionIterator { 1114 return APIRevisionCollectionIterator{page: page} 1115} 1116 1117// IsEmpty returns true if the ListResult contains no values. 1118func (arc APIRevisionCollection) IsEmpty() bool { 1119 return arc.Value == nil || len(*arc.Value) == 0 1120} 1121 1122// hasNextLink returns true if the NextLink is not empty. 1123func (arc APIRevisionCollection) hasNextLink() bool { 1124 return arc.NextLink != nil && len(*arc.NextLink) != 0 1125} 1126 1127// aPIRevisionCollectionPreparer prepares a request to retrieve the next set of results. 1128// It returns nil if no more results exist. 1129func (arc APIRevisionCollection) aPIRevisionCollectionPreparer(ctx context.Context) (*http.Request, error) { 1130 if !arc.hasNextLink() { 1131 return nil, nil 1132 } 1133 return autorest.Prepare((&http.Request{}).WithContext(ctx), 1134 autorest.AsJSON(), 1135 autorest.AsGet(), 1136 autorest.WithBaseURL(to.String(arc.NextLink))) 1137} 1138 1139// APIRevisionCollectionPage contains a page of APIRevisionContract values. 1140type APIRevisionCollectionPage struct { 1141 fn func(context.Context, APIRevisionCollection) (APIRevisionCollection, error) 1142 arc APIRevisionCollection 1143} 1144 1145// NextWithContext advances to the next page of values. If there was an error making 1146// the request the page does not advance and the error is returned. 1147func (page *APIRevisionCollectionPage) NextWithContext(ctx context.Context) (err error) { 1148 if tracing.IsEnabled() { 1149 ctx = tracing.StartSpan(ctx, fqdn+"/APIRevisionCollectionPage.NextWithContext") 1150 defer func() { 1151 sc := -1 1152 if page.Response().Response.Response != nil { 1153 sc = page.Response().Response.Response.StatusCode 1154 } 1155 tracing.EndSpan(ctx, sc, err) 1156 }() 1157 } 1158 for { 1159 next, err := page.fn(ctx, page.arc) 1160 if err != nil { 1161 return err 1162 } 1163 page.arc = next 1164 if !next.hasNextLink() || !next.IsEmpty() { 1165 break 1166 } 1167 } 1168 return nil 1169} 1170 1171// Next advances to the next page of values. If there was an error making 1172// the request the page does not advance and the error is returned. 1173// Deprecated: Use NextWithContext() instead. 1174func (page *APIRevisionCollectionPage) Next() error { 1175 return page.NextWithContext(context.Background()) 1176} 1177 1178// NotDone returns true if the page enumeration should be started or is not yet complete. 1179func (page APIRevisionCollectionPage) NotDone() bool { 1180 return !page.arc.IsEmpty() 1181} 1182 1183// Response returns the raw server response from the last page request. 1184func (page APIRevisionCollectionPage) Response() APIRevisionCollection { 1185 return page.arc 1186} 1187 1188// Values returns the slice of values for the current page or nil if there are no values. 1189func (page APIRevisionCollectionPage) Values() []APIRevisionContract { 1190 if page.arc.IsEmpty() { 1191 return nil 1192 } 1193 return *page.arc.Value 1194} 1195 1196// Creates a new instance of the APIRevisionCollectionPage type. 1197func NewAPIRevisionCollectionPage(cur APIRevisionCollection, getNextPage func(context.Context, APIRevisionCollection) (APIRevisionCollection, error)) APIRevisionCollectionPage { 1198 return APIRevisionCollectionPage{ 1199 fn: getNextPage, 1200 arc: cur, 1201 } 1202} 1203 1204// APIRevisionContract summary of revision metadata. 1205type APIRevisionContract struct { 1206 // APIID - READ-ONLY; Identifier of the API Revision. 1207 APIID *string `json:"apiId,omitempty"` 1208 // APIRevision - READ-ONLY; Revision number of API. 1209 APIRevision *string `json:"apiRevision,omitempty"` 1210 // 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. 1211 CreatedDateTime *date.Time `json:"createdDateTime,omitempty"` 1212 // 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. 1213 UpdatedDateTime *date.Time `json:"updatedDateTime,omitempty"` 1214 // Description - READ-ONLY; Description of the API Revision. 1215 Description *string `json:"description,omitempty"` 1216 // PrivateURL - READ-ONLY; Gateway URL for accessing the non-current API Revision. 1217 PrivateURL *string `json:"privateUrl,omitempty"` 1218 // IsOnline - READ-ONLY; Indicates if API revision is the current api revision. 1219 IsOnline *bool `json:"isOnline,omitempty"` 1220 // IsCurrent - READ-ONLY; Indicates if API revision is accessible via the gateway. 1221 IsCurrent *bool `json:"isCurrent,omitempty"` 1222} 1223 1224// MarshalJSON is the custom marshaler for APIRevisionContract. 1225func (arc APIRevisionContract) MarshalJSON() ([]byte, error) { 1226 objectMap := make(map[string]interface{}) 1227 return json.Marshal(objectMap) 1228} 1229 1230// APIRevisionInfoContract object used to create an API Revision or Version based on an existing API 1231// Revision 1232type APIRevisionInfoContract struct { 1233 // SourceAPIID - Resource identifier of API to be used to create the revision from. 1234 SourceAPIID *string `json:"sourceApiId,omitempty"` 1235 // APIVersionName - Version identifier for the new API Version. 1236 APIVersionName *string `json:"apiVersionName,omitempty"` 1237 // APIRevisionDescription - Description of new API Revision. 1238 APIRevisionDescription *string `json:"apiRevisionDescription,omitempty"` 1239 // APIVersionSet - Version set details 1240 APIVersionSet *APIVersionSetContractDetails `json:"apiVersionSet,omitempty"` 1241} 1242 1243// APITagResourceContractProperties API contract properties for the Tag Resources. 1244type APITagResourceContractProperties struct { 1245 // ID - API identifier in the form /apis/{apiId}. 1246 ID *string `json:"id,omitempty"` 1247 // Name - API name. 1248 Name *string `json:"name,omitempty"` 1249 // ServiceURL - Absolute URL of the backend service implementing this API. 1250 ServiceURL *string `json:"serviceUrl,omitempty"` 1251 // 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. 1252 Path *string `json:"path,omitempty"` 1253 // Protocols - Describes on which protocols the operations in this API can be invoked. 1254 Protocols *[]Protocol `json:"protocols,omitempty"` 1255 // Description - Description of the API. May include HTML formatting tags. 1256 Description *string `json:"description,omitempty"` 1257 // AuthenticationSettings - Collection of authentication settings included into this API. 1258 AuthenticationSettings *AuthenticationSettingsContract `json:"authenticationSettings,omitempty"` 1259 // SubscriptionKeyParameterNames - Protocols over which API is made available. 1260 SubscriptionKeyParameterNames *SubscriptionKeyParameterNamesContract `json:"subscriptionKeyParameterNames,omitempty"` 1261 // APIType - Type of API. Possible values include: 'HTTP', 'Soap' 1262 APIType APIType `json:"type,omitempty"` 1263 // APIRevision - Describes the Revision of the Api. If no value is provided, default revision 1 is created 1264 APIRevision *string `json:"apiRevision,omitempty"` 1265 // APIVersion - Indicates the Version identifier of the API if the API is versioned 1266 APIVersion *string `json:"apiVersion,omitempty"` 1267 // IsCurrent - READ-ONLY; Indicates if API revision is current api revision. 1268 IsCurrent *bool `json:"isCurrent,omitempty"` 1269 // IsOnline - READ-ONLY; Indicates if API revision is accessible via the gateway. 1270 IsOnline *bool `json:"isOnline,omitempty"` 1271 // APIRevisionDescription - Description of the Api Revision. 1272 APIRevisionDescription *string `json:"apiRevisionDescription,omitempty"` 1273 // APIVersionDescription - Description of the Api Version. 1274 APIVersionDescription *string `json:"apiVersionDescription,omitempty"` 1275 // APIVersionSetID - A resource identifier for the related ApiVersionSet. 1276 APIVersionSetID *string `json:"apiVersionSetId,omitempty"` 1277 // SubscriptionRequired - Specifies whether an API or Product subscription is required for accessing the API. 1278 SubscriptionRequired *bool `json:"subscriptionRequired,omitempty"` 1279} 1280 1281// MarshalJSON is the custom marshaler for APITagResourceContractProperties. 1282func (atrcp APITagResourceContractProperties) MarshalJSON() ([]byte, error) { 1283 objectMap := make(map[string]interface{}) 1284 if atrcp.ID != nil { 1285 objectMap["id"] = atrcp.ID 1286 } 1287 if atrcp.Name != nil { 1288 objectMap["name"] = atrcp.Name 1289 } 1290 if atrcp.ServiceURL != nil { 1291 objectMap["serviceUrl"] = atrcp.ServiceURL 1292 } 1293 if atrcp.Path != nil { 1294 objectMap["path"] = atrcp.Path 1295 } 1296 if atrcp.Protocols != nil { 1297 objectMap["protocols"] = atrcp.Protocols 1298 } 1299 if atrcp.Description != nil { 1300 objectMap["description"] = atrcp.Description 1301 } 1302 if atrcp.AuthenticationSettings != nil { 1303 objectMap["authenticationSettings"] = atrcp.AuthenticationSettings 1304 } 1305 if atrcp.SubscriptionKeyParameterNames != nil { 1306 objectMap["subscriptionKeyParameterNames"] = atrcp.SubscriptionKeyParameterNames 1307 } 1308 if atrcp.APIType != "" { 1309 objectMap["type"] = atrcp.APIType 1310 } 1311 if atrcp.APIRevision != nil { 1312 objectMap["apiRevision"] = atrcp.APIRevision 1313 } 1314 if atrcp.APIVersion != nil { 1315 objectMap["apiVersion"] = atrcp.APIVersion 1316 } 1317 if atrcp.APIRevisionDescription != nil { 1318 objectMap["apiRevisionDescription"] = atrcp.APIRevisionDescription 1319 } 1320 if atrcp.APIVersionDescription != nil { 1321 objectMap["apiVersionDescription"] = atrcp.APIVersionDescription 1322 } 1323 if atrcp.APIVersionSetID != nil { 1324 objectMap["apiVersionSetId"] = atrcp.APIVersionSetID 1325 } 1326 if atrcp.SubscriptionRequired != nil { 1327 objectMap["subscriptionRequired"] = atrcp.SubscriptionRequired 1328 } 1329 return json.Marshal(objectMap) 1330} 1331 1332// APIUpdateContract API update contract details. 1333type APIUpdateContract struct { 1334 // APIContractUpdateProperties - Properties of the API entity that can be updated. 1335 *APIContractUpdateProperties `json:"properties,omitempty"` 1336} 1337 1338// MarshalJSON is the custom marshaler for APIUpdateContract. 1339func (auc APIUpdateContract) MarshalJSON() ([]byte, error) { 1340 objectMap := make(map[string]interface{}) 1341 if auc.APIContractUpdateProperties != nil { 1342 objectMap["properties"] = auc.APIContractUpdateProperties 1343 } 1344 return json.Marshal(objectMap) 1345} 1346 1347// UnmarshalJSON is the custom unmarshaler for APIUpdateContract struct. 1348func (auc *APIUpdateContract) UnmarshalJSON(body []byte) error { 1349 var m map[string]*json.RawMessage 1350 err := json.Unmarshal(body, &m) 1351 if err != nil { 1352 return err 1353 } 1354 for k, v := range m { 1355 switch k { 1356 case "properties": 1357 if v != nil { 1358 var APIContractUpdateProperties APIContractUpdateProperties 1359 err = json.Unmarshal(*v, &APIContractUpdateProperties) 1360 if err != nil { 1361 return err 1362 } 1363 auc.APIContractUpdateProperties = &APIContractUpdateProperties 1364 } 1365 } 1366 } 1367 1368 return nil 1369} 1370 1371// APIVersionSetCollection paged Api Version Set list representation. 1372type APIVersionSetCollection struct { 1373 autorest.Response `json:"-"` 1374 // Value - Page values. 1375 Value *[]APIVersionSetContract `json:"value,omitempty"` 1376 // NextLink - Next page link if any. 1377 NextLink *string `json:"nextLink,omitempty"` 1378} 1379 1380// APIVersionSetCollectionIterator provides access to a complete listing of APIVersionSetContract values. 1381type APIVersionSetCollectionIterator struct { 1382 i int 1383 page APIVersionSetCollectionPage 1384} 1385 1386// NextWithContext advances to the next value. If there was an error making 1387// the request the iterator does not advance and the error is returned. 1388func (iter *APIVersionSetCollectionIterator) NextWithContext(ctx context.Context) (err error) { 1389 if tracing.IsEnabled() { 1390 ctx = tracing.StartSpan(ctx, fqdn+"/APIVersionSetCollectionIterator.NextWithContext") 1391 defer func() { 1392 sc := -1 1393 if iter.Response().Response.Response != nil { 1394 sc = iter.Response().Response.Response.StatusCode 1395 } 1396 tracing.EndSpan(ctx, sc, err) 1397 }() 1398 } 1399 iter.i++ 1400 if iter.i < len(iter.page.Values()) { 1401 return nil 1402 } 1403 err = iter.page.NextWithContext(ctx) 1404 if err != nil { 1405 iter.i-- 1406 return err 1407 } 1408 iter.i = 0 1409 return nil 1410} 1411 1412// Next advances to the next value. If there was an error making 1413// the request the iterator does not advance and the error is returned. 1414// Deprecated: Use NextWithContext() instead. 1415func (iter *APIVersionSetCollectionIterator) Next() error { 1416 return iter.NextWithContext(context.Background()) 1417} 1418 1419// NotDone returns true if the enumeration should be started or is not yet complete. 1420func (iter APIVersionSetCollectionIterator) NotDone() bool { 1421 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 1422} 1423 1424// Response returns the raw server response from the last page request. 1425func (iter APIVersionSetCollectionIterator) Response() APIVersionSetCollection { 1426 return iter.page.Response() 1427} 1428 1429// Value returns the current value or a zero-initialized value if the 1430// iterator has advanced beyond the end of the collection. 1431func (iter APIVersionSetCollectionIterator) Value() APIVersionSetContract { 1432 if !iter.page.NotDone() { 1433 return APIVersionSetContract{} 1434 } 1435 return iter.page.Values()[iter.i] 1436} 1437 1438// Creates a new instance of the APIVersionSetCollectionIterator type. 1439func NewAPIVersionSetCollectionIterator(page APIVersionSetCollectionPage) APIVersionSetCollectionIterator { 1440 return APIVersionSetCollectionIterator{page: page} 1441} 1442 1443// IsEmpty returns true if the ListResult contains no values. 1444func (avsc APIVersionSetCollection) IsEmpty() bool { 1445 return avsc.Value == nil || len(*avsc.Value) == 0 1446} 1447 1448// hasNextLink returns true if the NextLink is not empty. 1449func (avsc APIVersionSetCollection) hasNextLink() bool { 1450 return avsc.NextLink != nil && len(*avsc.NextLink) != 0 1451} 1452 1453// aPIVersionSetCollectionPreparer prepares a request to retrieve the next set of results. 1454// It returns nil if no more results exist. 1455func (avsc APIVersionSetCollection) aPIVersionSetCollectionPreparer(ctx context.Context) (*http.Request, error) { 1456 if !avsc.hasNextLink() { 1457 return nil, nil 1458 } 1459 return autorest.Prepare((&http.Request{}).WithContext(ctx), 1460 autorest.AsJSON(), 1461 autorest.AsGet(), 1462 autorest.WithBaseURL(to.String(avsc.NextLink))) 1463} 1464 1465// APIVersionSetCollectionPage contains a page of APIVersionSetContract values. 1466type APIVersionSetCollectionPage struct { 1467 fn func(context.Context, APIVersionSetCollection) (APIVersionSetCollection, error) 1468 avsc APIVersionSetCollection 1469} 1470 1471// NextWithContext advances to the next page of values. If there was an error making 1472// the request the page does not advance and the error is returned. 1473func (page *APIVersionSetCollectionPage) NextWithContext(ctx context.Context) (err error) { 1474 if tracing.IsEnabled() { 1475 ctx = tracing.StartSpan(ctx, fqdn+"/APIVersionSetCollectionPage.NextWithContext") 1476 defer func() { 1477 sc := -1 1478 if page.Response().Response.Response != nil { 1479 sc = page.Response().Response.Response.StatusCode 1480 } 1481 tracing.EndSpan(ctx, sc, err) 1482 }() 1483 } 1484 for { 1485 next, err := page.fn(ctx, page.avsc) 1486 if err != nil { 1487 return err 1488 } 1489 page.avsc = next 1490 if !next.hasNextLink() || !next.IsEmpty() { 1491 break 1492 } 1493 } 1494 return nil 1495} 1496 1497// Next advances to the next page of values. If there was an error making 1498// the request the page does not advance and the error is returned. 1499// Deprecated: Use NextWithContext() instead. 1500func (page *APIVersionSetCollectionPage) Next() error { 1501 return page.NextWithContext(context.Background()) 1502} 1503 1504// NotDone returns true if the page enumeration should be started or is not yet complete. 1505func (page APIVersionSetCollectionPage) NotDone() bool { 1506 return !page.avsc.IsEmpty() 1507} 1508 1509// Response returns the raw server response from the last page request. 1510func (page APIVersionSetCollectionPage) Response() APIVersionSetCollection { 1511 return page.avsc 1512} 1513 1514// Values returns the slice of values for the current page or nil if there are no values. 1515func (page APIVersionSetCollectionPage) Values() []APIVersionSetContract { 1516 if page.avsc.IsEmpty() { 1517 return nil 1518 } 1519 return *page.avsc.Value 1520} 1521 1522// Creates a new instance of the APIVersionSetCollectionPage type. 1523func NewAPIVersionSetCollectionPage(cur APIVersionSetCollection, getNextPage func(context.Context, APIVersionSetCollection) (APIVersionSetCollection, error)) APIVersionSetCollectionPage { 1524 return APIVersionSetCollectionPage{ 1525 fn: getNextPage, 1526 avsc: cur, 1527 } 1528} 1529 1530// APIVersionSetContract api Version Set Contract details. 1531type APIVersionSetContract struct { 1532 autorest.Response `json:"-"` 1533 // APIVersionSetContractProperties - Api VersionSet contract properties. 1534 *APIVersionSetContractProperties `json:"properties,omitempty"` 1535 // ID - READ-ONLY; Resource ID. 1536 ID *string `json:"id,omitempty"` 1537 // Name - READ-ONLY; Resource name. 1538 Name *string `json:"name,omitempty"` 1539 // Type - READ-ONLY; Resource type for API Management resource. 1540 Type *string `json:"type,omitempty"` 1541} 1542 1543// MarshalJSON is the custom marshaler for APIVersionSetContract. 1544func (avsc APIVersionSetContract) MarshalJSON() ([]byte, error) { 1545 objectMap := make(map[string]interface{}) 1546 if avsc.APIVersionSetContractProperties != nil { 1547 objectMap["properties"] = avsc.APIVersionSetContractProperties 1548 } 1549 return json.Marshal(objectMap) 1550} 1551 1552// UnmarshalJSON is the custom unmarshaler for APIVersionSetContract struct. 1553func (avsc *APIVersionSetContract) UnmarshalJSON(body []byte) error { 1554 var m map[string]*json.RawMessage 1555 err := json.Unmarshal(body, &m) 1556 if err != nil { 1557 return err 1558 } 1559 for k, v := range m { 1560 switch k { 1561 case "properties": 1562 if v != nil { 1563 var APIVersionSetContractProperties APIVersionSetContractProperties 1564 err = json.Unmarshal(*v, &APIVersionSetContractProperties) 1565 if err != nil { 1566 return err 1567 } 1568 avsc.APIVersionSetContractProperties = &APIVersionSetContractProperties 1569 } 1570 case "id": 1571 if v != nil { 1572 var ID string 1573 err = json.Unmarshal(*v, &ID) 1574 if err != nil { 1575 return err 1576 } 1577 avsc.ID = &ID 1578 } 1579 case "name": 1580 if v != nil { 1581 var name string 1582 err = json.Unmarshal(*v, &name) 1583 if err != nil { 1584 return err 1585 } 1586 avsc.Name = &name 1587 } 1588 case "type": 1589 if v != nil { 1590 var typeVar string 1591 err = json.Unmarshal(*v, &typeVar) 1592 if err != nil { 1593 return err 1594 } 1595 avsc.Type = &typeVar 1596 } 1597 } 1598 } 1599 1600 return nil 1601} 1602 1603// APIVersionSetContractDetails an API Version Set contains the common configuration for a set of API 1604// Versions relating 1605type APIVersionSetContractDetails struct { 1606 // ID - Identifier for existing API Version Set. Omit this value to create a new Version Set. 1607 ID *string `json:"id,omitempty"` 1608 // Description - Description of API Version Set. 1609 Description *string `json:"description,omitempty"` 1610 // VersioningScheme - An value that determines where the API Version identifer will be located in a HTTP request. Possible values include: 'VersioningScheme1Segment', 'VersioningScheme1Query', 'VersioningScheme1Header' 1611 VersioningScheme VersioningScheme1 `json:"versioningScheme,omitempty"` 1612 // VersionQueryName - Name of query parameter that indicates the API Version if versioningScheme is set to `query`. 1613 VersionQueryName *string `json:"versionQueryName,omitempty"` 1614 // VersionHeaderName - Name of HTTP header parameter that indicates the API Version if versioningScheme is set to `header`. 1615 VersionHeaderName *string `json:"versionHeaderName,omitempty"` 1616} 1617 1618// APIVersionSetContractProperties properties of an API Version Set. 1619type APIVersionSetContractProperties struct { 1620 // DisplayName - Name of API Version Set 1621 DisplayName *string `json:"displayName,omitempty"` 1622 // VersioningScheme - An value that determines where the API Version identifer will be located in a HTTP request. Possible values include: 'VersioningSchemeSegment', 'VersioningSchemeQuery', 'VersioningSchemeHeader' 1623 VersioningScheme VersioningScheme `json:"versioningScheme,omitempty"` 1624 // Description - Description of API Version Set. 1625 Description *string `json:"description,omitempty"` 1626 // VersionQueryName - Name of query parameter that indicates the API Version if versioningScheme is set to `query`. 1627 VersionQueryName *string `json:"versionQueryName,omitempty"` 1628 // VersionHeaderName - Name of HTTP header parameter that indicates the API Version if versioningScheme is set to `header`. 1629 VersionHeaderName *string `json:"versionHeaderName,omitempty"` 1630} 1631 1632// APIVersionSetEntityBase api Version set base parameters 1633type APIVersionSetEntityBase struct { 1634 // Description - Description of API Version Set. 1635 Description *string `json:"description,omitempty"` 1636 // VersionQueryName - Name of query parameter that indicates the API Version if versioningScheme is set to `query`. 1637 VersionQueryName *string `json:"versionQueryName,omitempty"` 1638 // VersionHeaderName - Name of HTTP header parameter that indicates the API Version if versioningScheme is set to `header`. 1639 VersionHeaderName *string `json:"versionHeaderName,omitempty"` 1640} 1641 1642// APIVersionSetUpdateParameters parameters to update or create an Api Version Set Contract. 1643type APIVersionSetUpdateParameters struct { 1644 // APIVersionSetUpdateParametersProperties - Parameters to update or create an Api Version Set Contract. 1645 *APIVersionSetUpdateParametersProperties `json:"properties,omitempty"` 1646} 1647 1648// MarshalJSON is the custom marshaler for APIVersionSetUpdateParameters. 1649func (avsup APIVersionSetUpdateParameters) MarshalJSON() ([]byte, error) { 1650 objectMap := make(map[string]interface{}) 1651 if avsup.APIVersionSetUpdateParametersProperties != nil { 1652 objectMap["properties"] = avsup.APIVersionSetUpdateParametersProperties 1653 } 1654 return json.Marshal(objectMap) 1655} 1656 1657// UnmarshalJSON is the custom unmarshaler for APIVersionSetUpdateParameters struct. 1658func (avsup *APIVersionSetUpdateParameters) UnmarshalJSON(body []byte) error { 1659 var m map[string]*json.RawMessage 1660 err := json.Unmarshal(body, &m) 1661 if err != nil { 1662 return err 1663 } 1664 for k, v := range m { 1665 switch k { 1666 case "properties": 1667 if v != nil { 1668 var APIVersionSetUpdateParametersProperties APIVersionSetUpdateParametersProperties 1669 err = json.Unmarshal(*v, &APIVersionSetUpdateParametersProperties) 1670 if err != nil { 1671 return err 1672 } 1673 avsup.APIVersionSetUpdateParametersProperties = &APIVersionSetUpdateParametersProperties 1674 } 1675 } 1676 } 1677 1678 return nil 1679} 1680 1681// APIVersionSetUpdateParametersProperties properties used to create or update an API Version Set. 1682type APIVersionSetUpdateParametersProperties struct { 1683 // DisplayName - Name of API Version Set 1684 DisplayName *string `json:"displayName,omitempty"` 1685 // VersioningScheme - An value that determines where the API Version identifer will be located in a HTTP request. Possible values include: 'VersioningSchemeSegment', 'VersioningSchemeQuery', 'VersioningSchemeHeader' 1686 VersioningScheme VersioningScheme `json:"versioningScheme,omitempty"` 1687 // Description - Description of API Version Set. 1688 Description *string `json:"description,omitempty"` 1689 // VersionQueryName - Name of query parameter that indicates the API Version if versioningScheme is set to `query`. 1690 VersionQueryName *string `json:"versionQueryName,omitempty"` 1691 // VersionHeaderName - Name of HTTP header parameter that indicates the API Version if versioningScheme is set to `header`. 1692 VersionHeaderName *string `json:"versionHeaderName,omitempty"` 1693} 1694 1695// AuthenticationSettingsContract API Authentication Settings. 1696type AuthenticationSettingsContract struct { 1697 // OAuth2 - OAuth2 Authentication settings 1698 OAuth2 *OAuth2AuthenticationSettingsContract `json:"oAuth2,omitempty"` 1699 // Openid - OpenID Connect Authentication Settings 1700 Openid *OpenIDAuthenticationSettingsContract `json:"openid,omitempty"` 1701 // 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. 1702 SubscriptionKeyRequired *bool `json:"subscriptionKeyRequired,omitempty"` 1703} 1704 1705// AuthorizationServerCollection paged OAuth2 Authorization Servers list representation. 1706type AuthorizationServerCollection struct { 1707 autorest.Response `json:"-"` 1708 // Value - Page values. 1709 Value *[]AuthorizationServerContract `json:"value,omitempty"` 1710 // Count - Total record count number across all pages. 1711 Count *int64 `json:"count,omitempty"` 1712 // NextLink - Next page link if any. 1713 NextLink *string `json:"nextLink,omitempty"` 1714} 1715 1716// AuthorizationServerCollectionIterator provides access to a complete listing of 1717// AuthorizationServerContract values. 1718type AuthorizationServerCollectionIterator struct { 1719 i int 1720 page AuthorizationServerCollectionPage 1721} 1722 1723// NextWithContext advances to the next value. If there was an error making 1724// the request the iterator does not advance and the error is returned. 1725func (iter *AuthorizationServerCollectionIterator) NextWithContext(ctx context.Context) (err error) { 1726 if tracing.IsEnabled() { 1727 ctx = tracing.StartSpan(ctx, fqdn+"/AuthorizationServerCollectionIterator.NextWithContext") 1728 defer func() { 1729 sc := -1 1730 if iter.Response().Response.Response != nil { 1731 sc = iter.Response().Response.Response.StatusCode 1732 } 1733 tracing.EndSpan(ctx, sc, err) 1734 }() 1735 } 1736 iter.i++ 1737 if iter.i < len(iter.page.Values()) { 1738 return nil 1739 } 1740 err = iter.page.NextWithContext(ctx) 1741 if err != nil { 1742 iter.i-- 1743 return err 1744 } 1745 iter.i = 0 1746 return nil 1747} 1748 1749// Next advances to the next value. If there was an error making 1750// the request the iterator does not advance and the error is returned. 1751// Deprecated: Use NextWithContext() instead. 1752func (iter *AuthorizationServerCollectionIterator) Next() error { 1753 return iter.NextWithContext(context.Background()) 1754} 1755 1756// NotDone returns true if the enumeration should be started or is not yet complete. 1757func (iter AuthorizationServerCollectionIterator) NotDone() bool { 1758 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 1759} 1760 1761// Response returns the raw server response from the last page request. 1762func (iter AuthorizationServerCollectionIterator) Response() AuthorizationServerCollection { 1763 return iter.page.Response() 1764} 1765 1766// Value returns the current value or a zero-initialized value if the 1767// iterator has advanced beyond the end of the collection. 1768func (iter AuthorizationServerCollectionIterator) Value() AuthorizationServerContract { 1769 if !iter.page.NotDone() { 1770 return AuthorizationServerContract{} 1771 } 1772 return iter.page.Values()[iter.i] 1773} 1774 1775// Creates a new instance of the AuthorizationServerCollectionIterator type. 1776func NewAuthorizationServerCollectionIterator(page AuthorizationServerCollectionPage) AuthorizationServerCollectionIterator { 1777 return AuthorizationServerCollectionIterator{page: page} 1778} 1779 1780// IsEmpty returns true if the ListResult contains no values. 1781func (asc AuthorizationServerCollection) IsEmpty() bool { 1782 return asc.Value == nil || len(*asc.Value) == 0 1783} 1784 1785// hasNextLink returns true if the NextLink is not empty. 1786func (asc AuthorizationServerCollection) hasNextLink() bool { 1787 return asc.NextLink != nil && len(*asc.NextLink) != 0 1788} 1789 1790// authorizationServerCollectionPreparer prepares a request to retrieve the next set of results. 1791// It returns nil if no more results exist. 1792func (asc AuthorizationServerCollection) authorizationServerCollectionPreparer(ctx context.Context) (*http.Request, error) { 1793 if !asc.hasNextLink() { 1794 return nil, nil 1795 } 1796 return autorest.Prepare((&http.Request{}).WithContext(ctx), 1797 autorest.AsJSON(), 1798 autorest.AsGet(), 1799 autorest.WithBaseURL(to.String(asc.NextLink))) 1800} 1801 1802// AuthorizationServerCollectionPage contains a page of AuthorizationServerContract values. 1803type AuthorizationServerCollectionPage struct { 1804 fn func(context.Context, AuthorizationServerCollection) (AuthorizationServerCollection, error) 1805 asc AuthorizationServerCollection 1806} 1807 1808// NextWithContext advances to the next page of values. If there was an error making 1809// the request the page does not advance and the error is returned. 1810func (page *AuthorizationServerCollectionPage) NextWithContext(ctx context.Context) (err error) { 1811 if tracing.IsEnabled() { 1812 ctx = tracing.StartSpan(ctx, fqdn+"/AuthorizationServerCollectionPage.NextWithContext") 1813 defer func() { 1814 sc := -1 1815 if page.Response().Response.Response != nil { 1816 sc = page.Response().Response.Response.StatusCode 1817 } 1818 tracing.EndSpan(ctx, sc, err) 1819 }() 1820 } 1821 for { 1822 next, err := page.fn(ctx, page.asc) 1823 if err != nil { 1824 return err 1825 } 1826 page.asc = next 1827 if !next.hasNextLink() || !next.IsEmpty() { 1828 break 1829 } 1830 } 1831 return nil 1832} 1833 1834// Next advances to the next page of values. If there was an error making 1835// the request the page does not advance and the error is returned. 1836// Deprecated: Use NextWithContext() instead. 1837func (page *AuthorizationServerCollectionPage) Next() error { 1838 return page.NextWithContext(context.Background()) 1839} 1840 1841// NotDone returns true if the page enumeration should be started or is not yet complete. 1842func (page AuthorizationServerCollectionPage) NotDone() bool { 1843 return !page.asc.IsEmpty() 1844} 1845 1846// Response returns the raw server response from the last page request. 1847func (page AuthorizationServerCollectionPage) Response() AuthorizationServerCollection { 1848 return page.asc 1849} 1850 1851// Values returns the slice of values for the current page or nil if there are no values. 1852func (page AuthorizationServerCollectionPage) Values() []AuthorizationServerContract { 1853 if page.asc.IsEmpty() { 1854 return nil 1855 } 1856 return *page.asc.Value 1857} 1858 1859// Creates a new instance of the AuthorizationServerCollectionPage type. 1860func NewAuthorizationServerCollectionPage(cur AuthorizationServerCollection, getNextPage func(context.Context, AuthorizationServerCollection) (AuthorizationServerCollection, error)) AuthorizationServerCollectionPage { 1861 return AuthorizationServerCollectionPage{ 1862 fn: getNextPage, 1863 asc: cur, 1864 } 1865} 1866 1867// AuthorizationServerContract external OAuth authorization server settings. 1868type AuthorizationServerContract struct { 1869 autorest.Response `json:"-"` 1870 // AuthorizationServerContractProperties - Properties of the External OAuth authorization server Contract. 1871 *AuthorizationServerContractProperties `json:"properties,omitempty"` 1872 // ID - READ-ONLY; Resource ID. 1873 ID *string `json:"id,omitempty"` 1874 // Name - READ-ONLY; Resource name. 1875 Name *string `json:"name,omitempty"` 1876 // Type - READ-ONLY; Resource type for API Management resource. 1877 Type *string `json:"type,omitempty"` 1878} 1879 1880// MarshalJSON is the custom marshaler for AuthorizationServerContract. 1881func (asc AuthorizationServerContract) MarshalJSON() ([]byte, error) { 1882 objectMap := make(map[string]interface{}) 1883 if asc.AuthorizationServerContractProperties != nil { 1884 objectMap["properties"] = asc.AuthorizationServerContractProperties 1885 } 1886 return json.Marshal(objectMap) 1887} 1888 1889// UnmarshalJSON is the custom unmarshaler for AuthorizationServerContract struct. 1890func (asc *AuthorizationServerContract) UnmarshalJSON(body []byte) error { 1891 var m map[string]*json.RawMessage 1892 err := json.Unmarshal(body, &m) 1893 if err != nil { 1894 return err 1895 } 1896 for k, v := range m { 1897 switch k { 1898 case "properties": 1899 if v != nil { 1900 var authorizationServerContractProperties AuthorizationServerContractProperties 1901 err = json.Unmarshal(*v, &authorizationServerContractProperties) 1902 if err != nil { 1903 return err 1904 } 1905 asc.AuthorizationServerContractProperties = &authorizationServerContractProperties 1906 } 1907 case "id": 1908 if v != nil { 1909 var ID string 1910 err = json.Unmarshal(*v, &ID) 1911 if err != nil { 1912 return err 1913 } 1914 asc.ID = &ID 1915 } 1916 case "name": 1917 if v != nil { 1918 var name string 1919 err = json.Unmarshal(*v, &name) 1920 if err != nil { 1921 return err 1922 } 1923 asc.Name = &name 1924 } 1925 case "type": 1926 if v != nil { 1927 var typeVar string 1928 err = json.Unmarshal(*v, &typeVar) 1929 if err != nil { 1930 return err 1931 } 1932 asc.Type = &typeVar 1933 } 1934 } 1935 } 1936 1937 return nil 1938} 1939 1940// AuthorizationServerContractBaseProperties external OAuth authorization server Update settings contract. 1941type AuthorizationServerContractBaseProperties struct { 1942 // Description - Description of the authorization server. Can contain HTML formatting tags. 1943 Description *string `json:"description,omitempty"` 1944 // AuthorizationMethods - HTTP verbs supported by the authorization endpoint. GET must be always present. POST is optional. 1945 AuthorizationMethods *[]AuthorizationMethod `json:"authorizationMethods,omitempty"` 1946 // 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. 1947 ClientAuthenticationMethod *[]ClientAuthenticationMethod `json:"clientAuthenticationMethod,omitempty"` 1948 // 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"}. 1949 TokenBodyParameters *[]TokenBodyParameterContract `json:"tokenBodyParameters,omitempty"` 1950 // TokenEndpoint - OAuth token endpoint. Contains absolute URI to entity being referenced. 1951 TokenEndpoint *string `json:"tokenEndpoint,omitempty"` 1952 // 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. 1953 SupportState *bool `json:"supportState,omitempty"` 1954 // 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. 1955 DefaultScope *string `json:"defaultScope,omitempty"` 1956 // BearerTokenSendingMethods - Specifies the mechanism by which access token is passed to the API. 1957 BearerTokenSendingMethods *[]BearerTokenSendingMethod `json:"bearerTokenSendingMethods,omitempty"` 1958 // ClientSecret - Client or app secret registered with this authorization server. 1959 ClientSecret *string `json:"clientSecret,omitempty"` 1960 // ResourceOwnerUsername - Can be optionally specified when resource owner password grant type is supported by this authorization server. Default resource owner username. 1961 ResourceOwnerUsername *string `json:"resourceOwnerUsername,omitempty"` 1962 // ResourceOwnerPassword - Can be optionally specified when resource owner password grant type is supported by this authorization server. Default resource owner password. 1963 ResourceOwnerPassword *string `json:"resourceOwnerPassword,omitempty"` 1964} 1965 1966// AuthorizationServerContractProperties external OAuth authorization server settings Properties. 1967type AuthorizationServerContractProperties struct { 1968 // DisplayName - User-friendly authorization server name. 1969 DisplayName *string `json:"displayName,omitempty"` 1970 // ClientRegistrationEndpoint - Optional reference to a page where client or app registration for this authorization server is performed. Contains absolute URL to entity being referenced. 1971 ClientRegistrationEndpoint *string `json:"clientRegistrationEndpoint,omitempty"` 1972 // AuthorizationEndpoint - OAuth authorization endpoint. See http://tools.ietf.org/html/rfc6749#section-3.2. 1973 AuthorizationEndpoint *string `json:"authorizationEndpoint,omitempty"` 1974 // GrantTypes - Form of an authorization grant, which the client uses to request the access token. 1975 GrantTypes *[]GrantType `json:"grantTypes,omitempty"` 1976 // ClientID - Client or app id registered with this authorization server. 1977 ClientID *string `json:"clientId,omitempty"` 1978 // Description - Description of the authorization server. Can contain HTML formatting tags. 1979 Description *string `json:"description,omitempty"` 1980 // AuthorizationMethods - HTTP verbs supported by the authorization endpoint. GET must be always present. POST is optional. 1981 AuthorizationMethods *[]AuthorizationMethod `json:"authorizationMethods,omitempty"` 1982 // 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. 1983 ClientAuthenticationMethod *[]ClientAuthenticationMethod `json:"clientAuthenticationMethod,omitempty"` 1984 // 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"}. 1985 TokenBodyParameters *[]TokenBodyParameterContract `json:"tokenBodyParameters,omitempty"` 1986 // TokenEndpoint - OAuth token endpoint. Contains absolute URI to entity being referenced. 1987 TokenEndpoint *string `json:"tokenEndpoint,omitempty"` 1988 // 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. 1989 SupportState *bool `json:"supportState,omitempty"` 1990 // 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. 1991 DefaultScope *string `json:"defaultScope,omitempty"` 1992 // BearerTokenSendingMethods - Specifies the mechanism by which access token is passed to the API. 1993 BearerTokenSendingMethods *[]BearerTokenSendingMethod `json:"bearerTokenSendingMethods,omitempty"` 1994 // ClientSecret - Client or app secret registered with this authorization server. 1995 ClientSecret *string `json:"clientSecret,omitempty"` 1996 // ResourceOwnerUsername - Can be optionally specified when resource owner password grant type is supported by this authorization server. Default resource owner username. 1997 ResourceOwnerUsername *string `json:"resourceOwnerUsername,omitempty"` 1998 // ResourceOwnerPassword - Can be optionally specified when resource owner password grant type is supported by this authorization server. Default resource owner password. 1999 ResourceOwnerPassword *string `json:"resourceOwnerPassword,omitempty"` 2000} 2001 2002// AuthorizationServerUpdateContract external OAuth authorization server settings. 2003type AuthorizationServerUpdateContract struct { 2004 // AuthorizationServerUpdateContractProperties - Properties of the External OAuth authorization server update Contract. 2005 *AuthorizationServerUpdateContractProperties `json:"properties,omitempty"` 2006 // ID - READ-ONLY; Resource ID. 2007 ID *string `json:"id,omitempty"` 2008 // Name - READ-ONLY; Resource name. 2009 Name *string `json:"name,omitempty"` 2010 // Type - READ-ONLY; Resource type for API Management resource. 2011 Type *string `json:"type,omitempty"` 2012} 2013 2014// MarshalJSON is the custom marshaler for AuthorizationServerUpdateContract. 2015func (asuc AuthorizationServerUpdateContract) MarshalJSON() ([]byte, error) { 2016 objectMap := make(map[string]interface{}) 2017 if asuc.AuthorizationServerUpdateContractProperties != nil { 2018 objectMap["properties"] = asuc.AuthorizationServerUpdateContractProperties 2019 } 2020 return json.Marshal(objectMap) 2021} 2022 2023// UnmarshalJSON is the custom unmarshaler for AuthorizationServerUpdateContract struct. 2024func (asuc *AuthorizationServerUpdateContract) UnmarshalJSON(body []byte) error { 2025 var m map[string]*json.RawMessage 2026 err := json.Unmarshal(body, &m) 2027 if err != nil { 2028 return err 2029 } 2030 for k, v := range m { 2031 switch k { 2032 case "properties": 2033 if v != nil { 2034 var authorizationServerUpdateContractProperties AuthorizationServerUpdateContractProperties 2035 err = json.Unmarshal(*v, &authorizationServerUpdateContractProperties) 2036 if err != nil { 2037 return err 2038 } 2039 asuc.AuthorizationServerUpdateContractProperties = &authorizationServerUpdateContractProperties 2040 } 2041 case "id": 2042 if v != nil { 2043 var ID string 2044 err = json.Unmarshal(*v, &ID) 2045 if err != nil { 2046 return err 2047 } 2048 asuc.ID = &ID 2049 } 2050 case "name": 2051 if v != nil { 2052 var name string 2053 err = json.Unmarshal(*v, &name) 2054 if err != nil { 2055 return err 2056 } 2057 asuc.Name = &name 2058 } 2059 case "type": 2060 if v != nil { 2061 var typeVar string 2062 err = json.Unmarshal(*v, &typeVar) 2063 if err != nil { 2064 return err 2065 } 2066 asuc.Type = &typeVar 2067 } 2068 } 2069 } 2070 2071 return nil 2072} 2073 2074// AuthorizationServerUpdateContractProperties external OAuth authorization server Update settings 2075// contract. 2076type AuthorizationServerUpdateContractProperties struct { 2077 // DisplayName - User-friendly authorization server name. 2078 DisplayName *string `json:"displayName,omitempty"` 2079 // ClientRegistrationEndpoint - Optional reference to a page where client or app registration for this authorization server is performed. Contains absolute URL to entity being referenced. 2080 ClientRegistrationEndpoint *string `json:"clientRegistrationEndpoint,omitempty"` 2081 // AuthorizationEndpoint - OAuth authorization endpoint. See http://tools.ietf.org/html/rfc6749#section-3.2. 2082 AuthorizationEndpoint *string `json:"authorizationEndpoint,omitempty"` 2083 // GrantTypes - Form of an authorization grant, which the client uses to request the access token. 2084 GrantTypes *[]GrantType `json:"grantTypes,omitempty"` 2085 // ClientID - Client or app id registered with this authorization server. 2086 ClientID *string `json:"clientId,omitempty"` 2087 // Description - Description of the authorization server. Can contain HTML formatting tags. 2088 Description *string `json:"description,omitempty"` 2089 // AuthorizationMethods - HTTP verbs supported by the authorization endpoint. GET must be always present. POST is optional. 2090 AuthorizationMethods *[]AuthorizationMethod `json:"authorizationMethods,omitempty"` 2091 // 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. 2092 ClientAuthenticationMethod *[]ClientAuthenticationMethod `json:"clientAuthenticationMethod,omitempty"` 2093 // 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"}. 2094 TokenBodyParameters *[]TokenBodyParameterContract `json:"tokenBodyParameters,omitempty"` 2095 // TokenEndpoint - OAuth token endpoint. Contains absolute URI to entity being referenced. 2096 TokenEndpoint *string `json:"tokenEndpoint,omitempty"` 2097 // 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. 2098 SupportState *bool `json:"supportState,omitempty"` 2099 // 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. 2100 DefaultScope *string `json:"defaultScope,omitempty"` 2101 // BearerTokenSendingMethods - Specifies the mechanism by which access token is passed to the API. 2102 BearerTokenSendingMethods *[]BearerTokenSendingMethod `json:"bearerTokenSendingMethods,omitempty"` 2103 // ClientSecret - Client or app secret registered with this authorization server. 2104 ClientSecret *string `json:"clientSecret,omitempty"` 2105 // ResourceOwnerUsername - Can be optionally specified when resource owner password grant type is supported by this authorization server. Default resource owner username. 2106 ResourceOwnerUsername *string `json:"resourceOwnerUsername,omitempty"` 2107 // ResourceOwnerPassword - Can be optionally specified when resource owner password grant type is supported by this authorization server. Default resource owner password. 2108 ResourceOwnerPassword *string `json:"resourceOwnerPassword,omitempty"` 2109} 2110 2111// BackendAuthorizationHeaderCredentials authorization header information. 2112type BackendAuthorizationHeaderCredentials struct { 2113 // Scheme - Authentication Scheme name. 2114 Scheme *string `json:"scheme,omitempty"` 2115 // Parameter - Authentication Parameter value. 2116 Parameter *string `json:"parameter,omitempty"` 2117} 2118 2119// BackendBaseParameters backend entity base Parameter set. 2120type BackendBaseParameters struct { 2121 // Title - Backend Title. 2122 Title *string `json:"title,omitempty"` 2123 // Description - Backend Description. 2124 Description *string `json:"description,omitempty"` 2125 // 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. 2126 ResourceID *string `json:"resourceId,omitempty"` 2127 // Properties - Backend Properties contract 2128 Properties *BackendProperties `json:"properties,omitempty"` 2129 // Credentials - Backend Credentials Contract Properties 2130 Credentials *BackendCredentialsContract `json:"credentials,omitempty"` 2131 // Proxy - Backend Proxy Contract Properties 2132 Proxy *BackendProxyContract `json:"proxy,omitempty"` 2133 // TLS - Backend TLS Properties 2134 TLS *BackendTLSProperties `json:"tls,omitempty"` 2135} 2136 2137// BackendCollection paged Backend list representation. 2138type BackendCollection struct { 2139 autorest.Response `json:"-"` 2140 // Value - Backend values. 2141 Value *[]BackendContract `json:"value,omitempty"` 2142 // NextLink - Next page link if any. 2143 NextLink *string `json:"nextLink,omitempty"` 2144} 2145 2146// BackendCollectionIterator provides access to a complete listing of BackendContract values. 2147type BackendCollectionIterator struct { 2148 i int 2149 page BackendCollectionPage 2150} 2151 2152// NextWithContext advances to the next value. If there was an error making 2153// the request the iterator does not advance and the error is returned. 2154func (iter *BackendCollectionIterator) NextWithContext(ctx context.Context) (err error) { 2155 if tracing.IsEnabled() { 2156 ctx = tracing.StartSpan(ctx, fqdn+"/BackendCollectionIterator.NextWithContext") 2157 defer func() { 2158 sc := -1 2159 if iter.Response().Response.Response != nil { 2160 sc = iter.Response().Response.Response.StatusCode 2161 } 2162 tracing.EndSpan(ctx, sc, err) 2163 }() 2164 } 2165 iter.i++ 2166 if iter.i < len(iter.page.Values()) { 2167 return nil 2168 } 2169 err = iter.page.NextWithContext(ctx) 2170 if err != nil { 2171 iter.i-- 2172 return err 2173 } 2174 iter.i = 0 2175 return nil 2176} 2177 2178// Next advances to the next value. If there was an error making 2179// the request the iterator does not advance and the error is returned. 2180// Deprecated: Use NextWithContext() instead. 2181func (iter *BackendCollectionIterator) Next() error { 2182 return iter.NextWithContext(context.Background()) 2183} 2184 2185// NotDone returns true if the enumeration should be started or is not yet complete. 2186func (iter BackendCollectionIterator) NotDone() bool { 2187 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 2188} 2189 2190// Response returns the raw server response from the last page request. 2191func (iter BackendCollectionIterator) Response() BackendCollection { 2192 return iter.page.Response() 2193} 2194 2195// Value returns the current value or a zero-initialized value if the 2196// iterator has advanced beyond the end of the collection. 2197func (iter BackendCollectionIterator) Value() BackendContract { 2198 if !iter.page.NotDone() { 2199 return BackendContract{} 2200 } 2201 return iter.page.Values()[iter.i] 2202} 2203 2204// Creates a new instance of the BackendCollectionIterator type. 2205func NewBackendCollectionIterator(page BackendCollectionPage) BackendCollectionIterator { 2206 return BackendCollectionIterator{page: page} 2207} 2208 2209// IsEmpty returns true if the ListResult contains no values. 2210func (bc BackendCollection) IsEmpty() bool { 2211 return bc.Value == nil || len(*bc.Value) == 0 2212} 2213 2214// hasNextLink returns true if the NextLink is not empty. 2215func (bc BackendCollection) hasNextLink() bool { 2216 return bc.NextLink != nil && len(*bc.NextLink) != 0 2217} 2218 2219// backendCollectionPreparer prepares a request to retrieve the next set of results. 2220// It returns nil if no more results exist. 2221func (bc BackendCollection) backendCollectionPreparer(ctx context.Context) (*http.Request, error) { 2222 if !bc.hasNextLink() { 2223 return nil, nil 2224 } 2225 return autorest.Prepare((&http.Request{}).WithContext(ctx), 2226 autorest.AsJSON(), 2227 autorest.AsGet(), 2228 autorest.WithBaseURL(to.String(bc.NextLink))) 2229} 2230 2231// BackendCollectionPage contains a page of BackendContract values. 2232type BackendCollectionPage struct { 2233 fn func(context.Context, BackendCollection) (BackendCollection, error) 2234 bc BackendCollection 2235} 2236 2237// NextWithContext advances to the next page of values. If there was an error making 2238// the request the page does not advance and the error is returned. 2239func (page *BackendCollectionPage) NextWithContext(ctx context.Context) (err error) { 2240 if tracing.IsEnabled() { 2241 ctx = tracing.StartSpan(ctx, fqdn+"/BackendCollectionPage.NextWithContext") 2242 defer func() { 2243 sc := -1 2244 if page.Response().Response.Response != nil { 2245 sc = page.Response().Response.Response.StatusCode 2246 } 2247 tracing.EndSpan(ctx, sc, err) 2248 }() 2249 } 2250 for { 2251 next, err := page.fn(ctx, page.bc) 2252 if err != nil { 2253 return err 2254 } 2255 page.bc = next 2256 if !next.hasNextLink() || !next.IsEmpty() { 2257 break 2258 } 2259 } 2260 return nil 2261} 2262 2263// Next advances to the next page of values. If there was an error making 2264// the request the page does not advance and the error is returned. 2265// Deprecated: Use NextWithContext() instead. 2266func (page *BackendCollectionPage) Next() error { 2267 return page.NextWithContext(context.Background()) 2268} 2269 2270// NotDone returns true if the page enumeration should be started or is not yet complete. 2271func (page BackendCollectionPage) NotDone() bool { 2272 return !page.bc.IsEmpty() 2273} 2274 2275// Response returns the raw server response from the last page request. 2276func (page BackendCollectionPage) Response() BackendCollection { 2277 return page.bc 2278} 2279 2280// Values returns the slice of values for the current page or nil if there are no values. 2281func (page BackendCollectionPage) Values() []BackendContract { 2282 if page.bc.IsEmpty() { 2283 return nil 2284 } 2285 return *page.bc.Value 2286} 2287 2288// Creates a new instance of the BackendCollectionPage type. 2289func NewBackendCollectionPage(cur BackendCollection, getNextPage func(context.Context, BackendCollection) (BackendCollection, error)) BackendCollectionPage { 2290 return BackendCollectionPage{ 2291 fn: getNextPage, 2292 bc: cur, 2293 } 2294} 2295 2296// BackendContract backend details. 2297type BackendContract struct { 2298 autorest.Response `json:"-"` 2299 // BackendContractProperties - Backend entity contract properties. 2300 *BackendContractProperties `json:"properties,omitempty"` 2301 // ID - READ-ONLY; Resource ID. 2302 ID *string `json:"id,omitempty"` 2303 // Name - READ-ONLY; Resource name. 2304 Name *string `json:"name,omitempty"` 2305 // Type - READ-ONLY; Resource type for API Management resource. 2306 Type *string `json:"type,omitempty"` 2307} 2308 2309// MarshalJSON is the custom marshaler for BackendContract. 2310func (bc BackendContract) MarshalJSON() ([]byte, error) { 2311 objectMap := make(map[string]interface{}) 2312 if bc.BackendContractProperties != nil { 2313 objectMap["properties"] = bc.BackendContractProperties 2314 } 2315 return json.Marshal(objectMap) 2316} 2317 2318// UnmarshalJSON is the custom unmarshaler for BackendContract struct. 2319func (bc *BackendContract) UnmarshalJSON(body []byte) error { 2320 var m map[string]*json.RawMessage 2321 err := json.Unmarshal(body, &m) 2322 if err != nil { 2323 return err 2324 } 2325 for k, v := range m { 2326 switch k { 2327 case "properties": 2328 if v != nil { 2329 var backendContractProperties BackendContractProperties 2330 err = json.Unmarshal(*v, &backendContractProperties) 2331 if err != nil { 2332 return err 2333 } 2334 bc.BackendContractProperties = &backendContractProperties 2335 } 2336 case "id": 2337 if v != nil { 2338 var ID string 2339 err = json.Unmarshal(*v, &ID) 2340 if err != nil { 2341 return err 2342 } 2343 bc.ID = &ID 2344 } 2345 case "name": 2346 if v != nil { 2347 var name string 2348 err = json.Unmarshal(*v, &name) 2349 if err != nil { 2350 return err 2351 } 2352 bc.Name = &name 2353 } 2354 case "type": 2355 if v != nil { 2356 var typeVar string 2357 err = json.Unmarshal(*v, &typeVar) 2358 if err != nil { 2359 return err 2360 } 2361 bc.Type = &typeVar 2362 } 2363 } 2364 } 2365 2366 return nil 2367} 2368 2369// BackendContractProperties parameters supplied to the Create Backend operation. 2370type BackendContractProperties struct { 2371 // URL - Runtime Url of the Backend. 2372 URL *string `json:"url,omitempty"` 2373 // Protocol - Backend communication protocol. Possible values include: 'BackendProtocolHTTP', 'BackendProtocolSoap' 2374 Protocol BackendProtocol `json:"protocol,omitempty"` 2375 // Title - Backend Title. 2376 Title *string `json:"title,omitempty"` 2377 // Description - Backend Description. 2378 Description *string `json:"description,omitempty"` 2379 // 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. 2380 ResourceID *string `json:"resourceId,omitempty"` 2381 // Properties - Backend Properties contract 2382 Properties *BackendProperties `json:"properties,omitempty"` 2383 // Credentials - Backend Credentials Contract Properties 2384 Credentials *BackendCredentialsContract `json:"credentials,omitempty"` 2385 // Proxy - Backend Proxy Contract Properties 2386 Proxy *BackendProxyContract `json:"proxy,omitempty"` 2387 // TLS - Backend TLS Properties 2388 TLS *BackendTLSProperties `json:"tls,omitempty"` 2389} 2390 2391// BackendCredentialsContract details of the Credentials used to connect to Backend. 2392type BackendCredentialsContract struct { 2393 // Certificate - List of Client Certificate Thumbprint. 2394 Certificate *[]string `json:"certificate,omitempty"` 2395 // Query - Query Parameter description. 2396 Query map[string][]string `json:"query"` 2397 // Header - Header Parameter description. 2398 Header map[string][]string `json:"header"` 2399 // Authorization - Authorization header authentication 2400 Authorization *BackendAuthorizationHeaderCredentials `json:"authorization,omitempty"` 2401} 2402 2403// MarshalJSON is the custom marshaler for BackendCredentialsContract. 2404func (bcc BackendCredentialsContract) MarshalJSON() ([]byte, error) { 2405 objectMap := make(map[string]interface{}) 2406 if bcc.Certificate != nil { 2407 objectMap["certificate"] = bcc.Certificate 2408 } 2409 if bcc.Query != nil { 2410 objectMap["query"] = bcc.Query 2411 } 2412 if bcc.Header != nil { 2413 objectMap["header"] = bcc.Header 2414 } 2415 if bcc.Authorization != nil { 2416 objectMap["authorization"] = bcc.Authorization 2417 } 2418 return json.Marshal(objectMap) 2419} 2420 2421// BackendProperties properties specific to the Backend Type. 2422type BackendProperties struct { 2423 // ServiceFabricCluster - Backend Service Fabric Cluster Properties 2424 ServiceFabricCluster *BackendServiceFabricClusterProperties `json:"serviceFabricCluster,omitempty"` 2425} 2426 2427// BackendProxyContract details of the Backend WebProxy Server to use in the Request to Backend. 2428type BackendProxyContract struct { 2429 // URL - WebProxy Server AbsoluteUri property which includes the entire URI stored in the Uri instance, including all fragments and query strings. 2430 URL *string `json:"url,omitempty"` 2431 // Username - Username to connect to the WebProxy server 2432 Username *string `json:"username,omitempty"` 2433 // Password - Password to connect to the WebProxy Server 2434 Password *string `json:"password,omitempty"` 2435} 2436 2437// BackendReconnectContract reconnect request parameters. 2438type BackendReconnectContract struct { 2439 // BackendReconnectProperties - Reconnect request properties. 2440 *BackendReconnectProperties `json:"properties,omitempty"` 2441 // ID - READ-ONLY; Resource ID. 2442 ID *string `json:"id,omitempty"` 2443 // Name - READ-ONLY; Resource name. 2444 Name *string `json:"name,omitempty"` 2445 // Type - READ-ONLY; Resource type for API Management resource. 2446 Type *string `json:"type,omitempty"` 2447} 2448 2449// MarshalJSON is the custom marshaler for BackendReconnectContract. 2450func (brc BackendReconnectContract) MarshalJSON() ([]byte, error) { 2451 objectMap := make(map[string]interface{}) 2452 if brc.BackendReconnectProperties != nil { 2453 objectMap["properties"] = brc.BackendReconnectProperties 2454 } 2455 return json.Marshal(objectMap) 2456} 2457 2458// UnmarshalJSON is the custom unmarshaler for BackendReconnectContract struct. 2459func (brc *BackendReconnectContract) UnmarshalJSON(body []byte) error { 2460 var m map[string]*json.RawMessage 2461 err := json.Unmarshal(body, &m) 2462 if err != nil { 2463 return err 2464 } 2465 for k, v := range m { 2466 switch k { 2467 case "properties": 2468 if v != nil { 2469 var backendReconnectProperties BackendReconnectProperties 2470 err = json.Unmarshal(*v, &backendReconnectProperties) 2471 if err != nil { 2472 return err 2473 } 2474 brc.BackendReconnectProperties = &backendReconnectProperties 2475 } 2476 case "id": 2477 if v != nil { 2478 var ID string 2479 err = json.Unmarshal(*v, &ID) 2480 if err != nil { 2481 return err 2482 } 2483 brc.ID = &ID 2484 } 2485 case "name": 2486 if v != nil { 2487 var name string 2488 err = json.Unmarshal(*v, &name) 2489 if err != nil { 2490 return err 2491 } 2492 brc.Name = &name 2493 } 2494 case "type": 2495 if v != nil { 2496 var typeVar string 2497 err = json.Unmarshal(*v, &typeVar) 2498 if err != nil { 2499 return err 2500 } 2501 brc.Type = &typeVar 2502 } 2503 } 2504 } 2505 2506 return nil 2507} 2508 2509// BackendReconnectProperties properties to control reconnect requests. 2510type BackendReconnectProperties struct { 2511 // After - Duration in ISO8601 format after which reconnect will be initiated. Minimum duration of the Reconnect is PT2M. 2512 After *string `json:"after,omitempty"` 2513} 2514 2515// BackendServiceFabricClusterProperties properties of the Service Fabric Type Backend. 2516type BackendServiceFabricClusterProperties struct { 2517 // ClientCertificatethumbprint - The client certificate thumbprint for the management endpoint. 2518 ClientCertificatethumbprint *string `json:"clientCertificatethumbprint,omitempty"` 2519 // MaxPartitionResolutionRetries - Maximum number of retries while attempting resolve the partition. 2520 MaxPartitionResolutionRetries *int32 `json:"maxPartitionResolutionRetries,omitempty"` 2521 // ManagementEndpoints - The cluster management endpoint. 2522 ManagementEndpoints *[]string `json:"managementEndpoints,omitempty"` 2523 // ServerCertificateThumbprints - Thumbprints of certificates cluster management service uses for tls communication 2524 ServerCertificateThumbprints *[]string `json:"serverCertificateThumbprints,omitempty"` 2525 // ServerX509Names - Server X509 Certificate Names Collection 2526 ServerX509Names *[]X509CertificateName `json:"serverX509Names,omitempty"` 2527} 2528 2529// BackendTLSProperties properties controlling TLS Certificate Validation. 2530type BackendTLSProperties struct { 2531 // ValidateCertificateChain - Flag indicating whether SSL certificate chain validation should be done when using self-signed certificates for this backend host. 2532 ValidateCertificateChain *bool `json:"validateCertificateChain,omitempty"` 2533 // ValidateCertificateName - Flag indicating whether SSL certificate name validation should be done when using self-signed certificates for this backend host. 2534 ValidateCertificateName *bool `json:"validateCertificateName,omitempty"` 2535} 2536 2537// BackendUpdateParameterProperties parameters supplied to the Update Backend operation. 2538type BackendUpdateParameterProperties struct { 2539 // URL - Runtime Url of the Backend. 2540 URL *string `json:"url,omitempty"` 2541 // Protocol - Backend communication protocol. Possible values include: 'BackendProtocolHTTP', 'BackendProtocolSoap' 2542 Protocol BackendProtocol `json:"protocol,omitempty"` 2543 // Title - Backend Title. 2544 Title *string `json:"title,omitempty"` 2545 // Description - Backend Description. 2546 Description *string `json:"description,omitempty"` 2547 // 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. 2548 ResourceID *string `json:"resourceId,omitempty"` 2549 // Properties - Backend Properties contract 2550 Properties *BackendProperties `json:"properties,omitempty"` 2551 // Credentials - Backend Credentials Contract Properties 2552 Credentials *BackendCredentialsContract `json:"credentials,omitempty"` 2553 // Proxy - Backend Proxy Contract Properties 2554 Proxy *BackendProxyContract `json:"proxy,omitempty"` 2555 // TLS - Backend TLS Properties 2556 TLS *BackendTLSProperties `json:"tls,omitempty"` 2557} 2558 2559// BackendUpdateParameters backend update parameters. 2560type BackendUpdateParameters struct { 2561 // BackendUpdateParameterProperties - Backend entity update contract properties. 2562 *BackendUpdateParameterProperties `json:"properties,omitempty"` 2563} 2564 2565// MarshalJSON is the custom marshaler for BackendUpdateParameters. 2566func (bup BackendUpdateParameters) MarshalJSON() ([]byte, error) { 2567 objectMap := make(map[string]interface{}) 2568 if bup.BackendUpdateParameterProperties != nil { 2569 objectMap["properties"] = bup.BackendUpdateParameterProperties 2570 } 2571 return json.Marshal(objectMap) 2572} 2573 2574// UnmarshalJSON is the custom unmarshaler for BackendUpdateParameters struct. 2575func (bup *BackendUpdateParameters) UnmarshalJSON(body []byte) error { 2576 var m map[string]*json.RawMessage 2577 err := json.Unmarshal(body, &m) 2578 if err != nil { 2579 return err 2580 } 2581 for k, v := range m { 2582 switch k { 2583 case "properties": 2584 if v != nil { 2585 var backendUpdateParameterProperties BackendUpdateParameterProperties 2586 err = json.Unmarshal(*v, &backendUpdateParameterProperties) 2587 if err != nil { 2588 return err 2589 } 2590 bup.BackendUpdateParameterProperties = &backendUpdateParameterProperties 2591 } 2592 } 2593 } 2594 2595 return nil 2596} 2597 2598// BodyDiagnosticSettings body logging settings. 2599type BodyDiagnosticSettings struct { 2600 // Bytes - Number of request body bytes to log. 2601 Bytes *int32 `json:"bytes,omitempty"` 2602} 2603 2604// CacheCollection paged Caches list representation. 2605type CacheCollection struct { 2606 autorest.Response `json:"-"` 2607 // Value - Page values. 2608 Value *[]CacheContract `json:"value,omitempty"` 2609 // NextLink - Next page link if any. 2610 NextLink *string `json:"nextLink,omitempty"` 2611} 2612 2613// CacheCollectionIterator provides access to a complete listing of CacheContract values. 2614type CacheCollectionIterator struct { 2615 i int 2616 page CacheCollectionPage 2617} 2618 2619// NextWithContext advances to the next value. If there was an error making 2620// the request the iterator does not advance and the error is returned. 2621func (iter *CacheCollectionIterator) NextWithContext(ctx context.Context) (err error) { 2622 if tracing.IsEnabled() { 2623 ctx = tracing.StartSpan(ctx, fqdn+"/CacheCollectionIterator.NextWithContext") 2624 defer func() { 2625 sc := -1 2626 if iter.Response().Response.Response != nil { 2627 sc = iter.Response().Response.Response.StatusCode 2628 } 2629 tracing.EndSpan(ctx, sc, err) 2630 }() 2631 } 2632 iter.i++ 2633 if iter.i < len(iter.page.Values()) { 2634 return nil 2635 } 2636 err = iter.page.NextWithContext(ctx) 2637 if err != nil { 2638 iter.i-- 2639 return err 2640 } 2641 iter.i = 0 2642 return nil 2643} 2644 2645// Next advances to the next value. If there was an error making 2646// the request the iterator does not advance and the error is returned. 2647// Deprecated: Use NextWithContext() instead. 2648func (iter *CacheCollectionIterator) Next() error { 2649 return iter.NextWithContext(context.Background()) 2650} 2651 2652// NotDone returns true if the enumeration should be started or is not yet complete. 2653func (iter CacheCollectionIterator) NotDone() bool { 2654 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 2655} 2656 2657// Response returns the raw server response from the last page request. 2658func (iter CacheCollectionIterator) Response() CacheCollection { 2659 return iter.page.Response() 2660} 2661 2662// Value returns the current value or a zero-initialized value if the 2663// iterator has advanced beyond the end of the collection. 2664func (iter CacheCollectionIterator) Value() CacheContract { 2665 if !iter.page.NotDone() { 2666 return CacheContract{} 2667 } 2668 return iter.page.Values()[iter.i] 2669} 2670 2671// Creates a new instance of the CacheCollectionIterator type. 2672func NewCacheCollectionIterator(page CacheCollectionPage) CacheCollectionIterator { 2673 return CacheCollectionIterator{page: page} 2674} 2675 2676// IsEmpty returns true if the ListResult contains no values. 2677func (cc CacheCollection) IsEmpty() bool { 2678 return cc.Value == nil || len(*cc.Value) == 0 2679} 2680 2681// hasNextLink returns true if the NextLink is not empty. 2682func (cc CacheCollection) hasNextLink() bool { 2683 return cc.NextLink != nil && len(*cc.NextLink) != 0 2684} 2685 2686// cacheCollectionPreparer prepares a request to retrieve the next set of results. 2687// It returns nil if no more results exist. 2688func (cc CacheCollection) cacheCollectionPreparer(ctx context.Context) (*http.Request, error) { 2689 if !cc.hasNextLink() { 2690 return nil, nil 2691 } 2692 return autorest.Prepare((&http.Request{}).WithContext(ctx), 2693 autorest.AsJSON(), 2694 autorest.AsGet(), 2695 autorest.WithBaseURL(to.String(cc.NextLink))) 2696} 2697 2698// CacheCollectionPage contains a page of CacheContract values. 2699type CacheCollectionPage struct { 2700 fn func(context.Context, CacheCollection) (CacheCollection, error) 2701 cc CacheCollection 2702} 2703 2704// NextWithContext advances to the next page of values. If there was an error making 2705// the request the page does not advance and the error is returned. 2706func (page *CacheCollectionPage) NextWithContext(ctx context.Context) (err error) { 2707 if tracing.IsEnabled() { 2708 ctx = tracing.StartSpan(ctx, fqdn+"/CacheCollectionPage.NextWithContext") 2709 defer func() { 2710 sc := -1 2711 if page.Response().Response.Response != nil { 2712 sc = page.Response().Response.Response.StatusCode 2713 } 2714 tracing.EndSpan(ctx, sc, err) 2715 }() 2716 } 2717 for { 2718 next, err := page.fn(ctx, page.cc) 2719 if err != nil { 2720 return err 2721 } 2722 page.cc = next 2723 if !next.hasNextLink() || !next.IsEmpty() { 2724 break 2725 } 2726 } 2727 return nil 2728} 2729 2730// Next advances to the next page of values. If there was an error making 2731// the request the page does not advance and the error is returned. 2732// Deprecated: Use NextWithContext() instead. 2733func (page *CacheCollectionPage) Next() error { 2734 return page.NextWithContext(context.Background()) 2735} 2736 2737// NotDone returns true if the page enumeration should be started or is not yet complete. 2738func (page CacheCollectionPage) NotDone() bool { 2739 return !page.cc.IsEmpty() 2740} 2741 2742// Response returns the raw server response from the last page request. 2743func (page CacheCollectionPage) Response() CacheCollection { 2744 return page.cc 2745} 2746 2747// Values returns the slice of values for the current page or nil if there are no values. 2748func (page CacheCollectionPage) Values() []CacheContract { 2749 if page.cc.IsEmpty() { 2750 return nil 2751 } 2752 return *page.cc.Value 2753} 2754 2755// Creates a new instance of the CacheCollectionPage type. 2756func NewCacheCollectionPage(cur CacheCollection, getNextPage func(context.Context, CacheCollection) (CacheCollection, error)) CacheCollectionPage { 2757 return CacheCollectionPage{ 2758 fn: getNextPage, 2759 cc: cur, 2760 } 2761} 2762 2763// CacheContract cache details. 2764type CacheContract struct { 2765 autorest.Response `json:"-"` 2766 // CacheContractProperties - Cache properties details. 2767 *CacheContractProperties `json:"properties,omitempty"` 2768 // ID - READ-ONLY; Resource ID. 2769 ID *string `json:"id,omitempty"` 2770 // Name - READ-ONLY; Resource name. 2771 Name *string `json:"name,omitempty"` 2772 // Type - READ-ONLY; Resource type for API Management resource. 2773 Type *string `json:"type,omitempty"` 2774} 2775 2776// MarshalJSON is the custom marshaler for CacheContract. 2777func (cc CacheContract) MarshalJSON() ([]byte, error) { 2778 objectMap := make(map[string]interface{}) 2779 if cc.CacheContractProperties != nil { 2780 objectMap["properties"] = cc.CacheContractProperties 2781 } 2782 return json.Marshal(objectMap) 2783} 2784 2785// UnmarshalJSON is the custom unmarshaler for CacheContract struct. 2786func (cc *CacheContract) UnmarshalJSON(body []byte) error { 2787 var m map[string]*json.RawMessage 2788 err := json.Unmarshal(body, &m) 2789 if err != nil { 2790 return err 2791 } 2792 for k, v := range m { 2793 switch k { 2794 case "properties": 2795 if v != nil { 2796 var cacheContractProperties CacheContractProperties 2797 err = json.Unmarshal(*v, &cacheContractProperties) 2798 if err != nil { 2799 return err 2800 } 2801 cc.CacheContractProperties = &cacheContractProperties 2802 } 2803 case "id": 2804 if v != nil { 2805 var ID string 2806 err = json.Unmarshal(*v, &ID) 2807 if err != nil { 2808 return err 2809 } 2810 cc.ID = &ID 2811 } 2812 case "name": 2813 if v != nil { 2814 var name string 2815 err = json.Unmarshal(*v, &name) 2816 if err != nil { 2817 return err 2818 } 2819 cc.Name = &name 2820 } 2821 case "type": 2822 if v != nil { 2823 var typeVar string 2824 err = json.Unmarshal(*v, &typeVar) 2825 if err != nil { 2826 return err 2827 } 2828 cc.Type = &typeVar 2829 } 2830 } 2831 } 2832 2833 return nil 2834} 2835 2836// CacheContractProperties properties of the Cache contract. 2837type CacheContractProperties struct { 2838 // Description - Cache description 2839 Description *string `json:"description,omitempty"` 2840 // ConnectionString - Runtime connection string to cache 2841 ConnectionString *string `json:"connectionString,omitempty"` 2842 // ResourceID - Original uri of entity in external system cache points to 2843 ResourceID *string `json:"resourceId,omitempty"` 2844} 2845 2846// CacheUpdateParameters cache update details. 2847type CacheUpdateParameters struct { 2848 // CacheUpdateProperties - Cache update properties details. 2849 *CacheUpdateProperties `json:"properties,omitempty"` 2850} 2851 2852// MarshalJSON is the custom marshaler for CacheUpdateParameters. 2853func (cup CacheUpdateParameters) MarshalJSON() ([]byte, error) { 2854 objectMap := make(map[string]interface{}) 2855 if cup.CacheUpdateProperties != nil { 2856 objectMap["properties"] = cup.CacheUpdateProperties 2857 } 2858 return json.Marshal(objectMap) 2859} 2860 2861// UnmarshalJSON is the custom unmarshaler for CacheUpdateParameters struct. 2862func (cup *CacheUpdateParameters) UnmarshalJSON(body []byte) error { 2863 var m map[string]*json.RawMessage 2864 err := json.Unmarshal(body, &m) 2865 if err != nil { 2866 return err 2867 } 2868 for k, v := range m { 2869 switch k { 2870 case "properties": 2871 if v != nil { 2872 var cacheUpdateProperties CacheUpdateProperties 2873 err = json.Unmarshal(*v, &cacheUpdateProperties) 2874 if err != nil { 2875 return err 2876 } 2877 cup.CacheUpdateProperties = &cacheUpdateProperties 2878 } 2879 } 2880 } 2881 2882 return nil 2883} 2884 2885// CacheUpdateProperties parameters supplied to the Update Cache operation. 2886type CacheUpdateProperties struct { 2887 // Description - Cache description 2888 Description *string `json:"description,omitempty"` 2889 // ConnectionString - Runtime connection string to cache 2890 ConnectionString *string `json:"connectionString,omitempty"` 2891 // ResourceID - Original uri of entity in external system cache points to 2892 ResourceID *string `json:"resourceId,omitempty"` 2893} 2894 2895// CertificateCollection paged Certificates list representation. 2896type CertificateCollection struct { 2897 autorest.Response `json:"-"` 2898 // Value - Page values. 2899 Value *[]CertificateContract `json:"value,omitempty"` 2900 // NextLink - Next page link if any. 2901 NextLink *string `json:"nextLink,omitempty"` 2902} 2903 2904// CertificateCollectionIterator provides access to a complete listing of CertificateContract values. 2905type CertificateCollectionIterator struct { 2906 i int 2907 page CertificateCollectionPage 2908} 2909 2910// NextWithContext advances to the next value. If there was an error making 2911// the request the iterator does not advance and the error is returned. 2912func (iter *CertificateCollectionIterator) NextWithContext(ctx context.Context) (err error) { 2913 if tracing.IsEnabled() { 2914 ctx = tracing.StartSpan(ctx, fqdn+"/CertificateCollectionIterator.NextWithContext") 2915 defer func() { 2916 sc := -1 2917 if iter.Response().Response.Response != nil { 2918 sc = iter.Response().Response.Response.StatusCode 2919 } 2920 tracing.EndSpan(ctx, sc, err) 2921 }() 2922 } 2923 iter.i++ 2924 if iter.i < len(iter.page.Values()) { 2925 return nil 2926 } 2927 err = iter.page.NextWithContext(ctx) 2928 if err != nil { 2929 iter.i-- 2930 return err 2931 } 2932 iter.i = 0 2933 return nil 2934} 2935 2936// Next advances to the next value. If there was an error making 2937// the request the iterator does not advance and the error is returned. 2938// Deprecated: Use NextWithContext() instead. 2939func (iter *CertificateCollectionIterator) Next() error { 2940 return iter.NextWithContext(context.Background()) 2941} 2942 2943// NotDone returns true if the enumeration should be started or is not yet complete. 2944func (iter CertificateCollectionIterator) NotDone() bool { 2945 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 2946} 2947 2948// Response returns the raw server response from the last page request. 2949func (iter CertificateCollectionIterator) Response() CertificateCollection { 2950 return iter.page.Response() 2951} 2952 2953// Value returns the current value or a zero-initialized value if the 2954// iterator has advanced beyond the end of the collection. 2955func (iter CertificateCollectionIterator) Value() CertificateContract { 2956 if !iter.page.NotDone() { 2957 return CertificateContract{} 2958 } 2959 return iter.page.Values()[iter.i] 2960} 2961 2962// Creates a new instance of the CertificateCollectionIterator type. 2963func NewCertificateCollectionIterator(page CertificateCollectionPage) CertificateCollectionIterator { 2964 return CertificateCollectionIterator{page: page} 2965} 2966 2967// IsEmpty returns true if the ListResult contains no values. 2968func (cc CertificateCollection) IsEmpty() bool { 2969 return cc.Value == nil || len(*cc.Value) == 0 2970} 2971 2972// hasNextLink returns true if the NextLink is not empty. 2973func (cc CertificateCollection) hasNextLink() bool { 2974 return cc.NextLink != nil && len(*cc.NextLink) != 0 2975} 2976 2977// certificateCollectionPreparer prepares a request to retrieve the next set of results. 2978// It returns nil if no more results exist. 2979func (cc CertificateCollection) certificateCollectionPreparer(ctx context.Context) (*http.Request, error) { 2980 if !cc.hasNextLink() { 2981 return nil, nil 2982 } 2983 return autorest.Prepare((&http.Request{}).WithContext(ctx), 2984 autorest.AsJSON(), 2985 autorest.AsGet(), 2986 autorest.WithBaseURL(to.String(cc.NextLink))) 2987} 2988 2989// CertificateCollectionPage contains a page of CertificateContract values. 2990type CertificateCollectionPage struct { 2991 fn func(context.Context, CertificateCollection) (CertificateCollection, error) 2992 cc CertificateCollection 2993} 2994 2995// NextWithContext advances to the next page of values. If there was an error making 2996// the request the page does not advance and the error is returned. 2997func (page *CertificateCollectionPage) NextWithContext(ctx context.Context) (err error) { 2998 if tracing.IsEnabled() { 2999 ctx = tracing.StartSpan(ctx, fqdn+"/CertificateCollectionPage.NextWithContext") 3000 defer func() { 3001 sc := -1 3002 if page.Response().Response.Response != nil { 3003 sc = page.Response().Response.Response.StatusCode 3004 } 3005 tracing.EndSpan(ctx, sc, err) 3006 }() 3007 } 3008 for { 3009 next, err := page.fn(ctx, page.cc) 3010 if err != nil { 3011 return err 3012 } 3013 page.cc = next 3014 if !next.hasNextLink() || !next.IsEmpty() { 3015 break 3016 } 3017 } 3018 return nil 3019} 3020 3021// Next advances to the next page of values. If there was an error making 3022// the request the page does not advance and the error is returned. 3023// Deprecated: Use NextWithContext() instead. 3024func (page *CertificateCollectionPage) Next() error { 3025 return page.NextWithContext(context.Background()) 3026} 3027 3028// NotDone returns true if the page enumeration should be started or is not yet complete. 3029func (page CertificateCollectionPage) NotDone() bool { 3030 return !page.cc.IsEmpty() 3031} 3032 3033// Response returns the raw server response from the last page request. 3034func (page CertificateCollectionPage) Response() CertificateCollection { 3035 return page.cc 3036} 3037 3038// Values returns the slice of values for the current page or nil if there are no values. 3039func (page CertificateCollectionPage) Values() []CertificateContract { 3040 if page.cc.IsEmpty() { 3041 return nil 3042 } 3043 return *page.cc.Value 3044} 3045 3046// Creates a new instance of the CertificateCollectionPage type. 3047func NewCertificateCollectionPage(cur CertificateCollection, getNextPage func(context.Context, CertificateCollection) (CertificateCollection, error)) CertificateCollectionPage { 3048 return CertificateCollectionPage{ 3049 fn: getNextPage, 3050 cc: cur, 3051 } 3052} 3053 3054// CertificateConfiguration certificate configuration which consist of non-trusted intermediates and root 3055// certificates. 3056type CertificateConfiguration struct { 3057 // EncodedCertificate - Base64 Encoded certificate. 3058 EncodedCertificate *string `json:"encodedCertificate,omitempty"` 3059 // CertificatePassword - Certificate Password. 3060 CertificatePassword *string `json:"certificatePassword,omitempty"` 3061 // StoreName - The System.Security.Cryptography.x509certificates.StoreName certificate store location. Only Root and CertificateAuthority are valid locations. Possible values include: 'CertificateAuthority', 'Root' 3062 StoreName StoreName `json:"storeName,omitempty"` 3063 // Certificate - Certificate information. 3064 Certificate *CertificateInformation `json:"certificate,omitempty"` 3065} 3066 3067// CertificateContract certificate details. 3068type CertificateContract struct { 3069 autorest.Response `json:"-"` 3070 // CertificateContractProperties - Certificate properties details. 3071 *CertificateContractProperties `json:"properties,omitempty"` 3072 // ID - READ-ONLY; Resource ID. 3073 ID *string `json:"id,omitempty"` 3074 // Name - READ-ONLY; Resource name. 3075 Name *string `json:"name,omitempty"` 3076 // Type - READ-ONLY; Resource type for API Management resource. 3077 Type *string `json:"type,omitempty"` 3078} 3079 3080// MarshalJSON is the custom marshaler for CertificateContract. 3081func (cc CertificateContract) MarshalJSON() ([]byte, error) { 3082 objectMap := make(map[string]interface{}) 3083 if cc.CertificateContractProperties != nil { 3084 objectMap["properties"] = cc.CertificateContractProperties 3085 } 3086 return json.Marshal(objectMap) 3087} 3088 3089// UnmarshalJSON is the custom unmarshaler for CertificateContract struct. 3090func (cc *CertificateContract) UnmarshalJSON(body []byte) error { 3091 var m map[string]*json.RawMessage 3092 err := json.Unmarshal(body, &m) 3093 if err != nil { 3094 return err 3095 } 3096 for k, v := range m { 3097 switch k { 3098 case "properties": 3099 if v != nil { 3100 var certificateContractProperties CertificateContractProperties 3101 err = json.Unmarshal(*v, &certificateContractProperties) 3102 if err != nil { 3103 return err 3104 } 3105 cc.CertificateContractProperties = &certificateContractProperties 3106 } 3107 case "id": 3108 if v != nil { 3109 var ID string 3110 err = json.Unmarshal(*v, &ID) 3111 if err != nil { 3112 return err 3113 } 3114 cc.ID = &ID 3115 } 3116 case "name": 3117 if v != nil { 3118 var name string 3119 err = json.Unmarshal(*v, &name) 3120 if err != nil { 3121 return err 3122 } 3123 cc.Name = &name 3124 } 3125 case "type": 3126 if v != nil { 3127 var typeVar string 3128 err = json.Unmarshal(*v, &typeVar) 3129 if err != nil { 3130 return err 3131 } 3132 cc.Type = &typeVar 3133 } 3134 } 3135 } 3136 3137 return nil 3138} 3139 3140// CertificateContractProperties properties of the Certificate contract. 3141type CertificateContractProperties struct { 3142 // Subject - Subject attribute of the certificate. 3143 Subject *string `json:"subject,omitempty"` 3144 // Thumbprint - Thumbprint of the certificate. 3145 Thumbprint *string `json:"thumbprint,omitempty"` 3146 // 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. 3147 ExpirationDate *date.Time `json:"expirationDate,omitempty"` 3148} 3149 3150// CertificateCreateOrUpdateParameters certificate create or update details. 3151type CertificateCreateOrUpdateParameters struct { 3152 // CertificateCreateOrUpdateProperties - Certificate create or update properties details. 3153 *CertificateCreateOrUpdateProperties `json:"properties,omitempty"` 3154} 3155 3156// MarshalJSON is the custom marshaler for CertificateCreateOrUpdateParameters. 3157func (ccoup CertificateCreateOrUpdateParameters) MarshalJSON() ([]byte, error) { 3158 objectMap := make(map[string]interface{}) 3159 if ccoup.CertificateCreateOrUpdateProperties != nil { 3160 objectMap["properties"] = ccoup.CertificateCreateOrUpdateProperties 3161 } 3162 return json.Marshal(objectMap) 3163} 3164 3165// UnmarshalJSON is the custom unmarshaler for CertificateCreateOrUpdateParameters struct. 3166func (ccoup *CertificateCreateOrUpdateParameters) UnmarshalJSON(body []byte) error { 3167 var m map[string]*json.RawMessage 3168 err := json.Unmarshal(body, &m) 3169 if err != nil { 3170 return err 3171 } 3172 for k, v := range m { 3173 switch k { 3174 case "properties": 3175 if v != nil { 3176 var certificateCreateOrUpdateProperties CertificateCreateOrUpdateProperties 3177 err = json.Unmarshal(*v, &certificateCreateOrUpdateProperties) 3178 if err != nil { 3179 return err 3180 } 3181 ccoup.CertificateCreateOrUpdateProperties = &certificateCreateOrUpdateProperties 3182 } 3183 } 3184 } 3185 3186 return nil 3187} 3188 3189// CertificateCreateOrUpdateProperties parameters supplied to the CreateOrUpdate certificate operation. 3190type CertificateCreateOrUpdateProperties struct { 3191 // Data - Base 64 encoded certificate using the application/x-pkcs12 representation. 3192 Data *string `json:"data,omitempty"` 3193 // Password - Password for the Certificate 3194 Password *string `json:"password,omitempty"` 3195} 3196 3197// CertificateInformation SSL certificate information. 3198type CertificateInformation struct { 3199 autorest.Response `json:"-"` 3200 // 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. 3201 Expiry *date.Time `json:"expiry,omitempty"` 3202 // Thumbprint - Thumbprint of the certificate. 3203 Thumbprint *string `json:"thumbprint,omitempty"` 3204 // Subject - Subject of the certificate. 3205 Subject *string `json:"subject,omitempty"` 3206} 3207 3208// ConnectivityStatusContract details about connectivity to a resource. 3209type ConnectivityStatusContract struct { 3210 // 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. 3211 Name *string `json:"name,omitempty"` 3212 // Status - Resource Connectivity Status Type identifier. Possible values include: 'Initializing', 'Success', 'Failure' 3213 Status ConnectivityStatusType `json:"status,omitempty"` 3214 // Error - Error details of the connectivity to the resource. 3215 Error *string `json:"error,omitempty"` 3216 // 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. 3217 LastUpdated *date.Time `json:"lastUpdated,omitempty"` 3218 // 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. 3219 LastStatusChange *date.Time `json:"lastStatusChange,omitempty"` 3220} 3221 3222// CurrentUserIdentity ... 3223type CurrentUserIdentity struct { 3224 // ID - API Management service user id. 3225 ID *string `json:"id,omitempty"` 3226} 3227 3228// DeployConfigurationParameters parameters supplied to the Deploy Configuration operation. 3229type DeployConfigurationParameters struct { 3230 // Branch - The name of the Git branch from which the configuration is to be deployed to the configuration database. 3231 Branch *string `json:"branch,omitempty"` 3232 // Force - The value enforcing deleting subscriptions to products that are deleted in this update. 3233 Force *bool `json:"force,omitempty"` 3234} 3235 3236// DiagnosticCollection paged Diagnostic list representation. 3237type DiagnosticCollection struct { 3238 autorest.Response `json:"-"` 3239 // Value - Page values. 3240 Value *[]DiagnosticContract `json:"value,omitempty"` 3241 // NextLink - Next page link if any. 3242 NextLink *string `json:"nextLink,omitempty"` 3243} 3244 3245// DiagnosticCollectionIterator provides access to a complete listing of DiagnosticContract values. 3246type DiagnosticCollectionIterator struct { 3247 i int 3248 page DiagnosticCollectionPage 3249} 3250 3251// NextWithContext advances to the next value. If there was an error making 3252// the request the iterator does not advance and the error is returned. 3253func (iter *DiagnosticCollectionIterator) NextWithContext(ctx context.Context) (err error) { 3254 if tracing.IsEnabled() { 3255 ctx = tracing.StartSpan(ctx, fqdn+"/DiagnosticCollectionIterator.NextWithContext") 3256 defer func() { 3257 sc := -1 3258 if iter.Response().Response.Response != nil { 3259 sc = iter.Response().Response.Response.StatusCode 3260 } 3261 tracing.EndSpan(ctx, sc, err) 3262 }() 3263 } 3264 iter.i++ 3265 if iter.i < len(iter.page.Values()) { 3266 return nil 3267 } 3268 err = iter.page.NextWithContext(ctx) 3269 if err != nil { 3270 iter.i-- 3271 return err 3272 } 3273 iter.i = 0 3274 return nil 3275} 3276 3277// Next advances to the next value. If there was an error making 3278// the request the iterator does not advance and the error is returned. 3279// Deprecated: Use NextWithContext() instead. 3280func (iter *DiagnosticCollectionIterator) Next() error { 3281 return iter.NextWithContext(context.Background()) 3282} 3283 3284// NotDone returns true if the enumeration should be started or is not yet complete. 3285func (iter DiagnosticCollectionIterator) NotDone() bool { 3286 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 3287} 3288 3289// Response returns the raw server response from the last page request. 3290func (iter DiagnosticCollectionIterator) Response() DiagnosticCollection { 3291 return iter.page.Response() 3292} 3293 3294// Value returns the current value or a zero-initialized value if the 3295// iterator has advanced beyond the end of the collection. 3296func (iter DiagnosticCollectionIterator) Value() DiagnosticContract { 3297 if !iter.page.NotDone() { 3298 return DiagnosticContract{} 3299 } 3300 return iter.page.Values()[iter.i] 3301} 3302 3303// Creates a new instance of the DiagnosticCollectionIterator type. 3304func NewDiagnosticCollectionIterator(page DiagnosticCollectionPage) DiagnosticCollectionIterator { 3305 return DiagnosticCollectionIterator{page: page} 3306} 3307 3308// IsEmpty returns true if the ListResult contains no values. 3309func (dc DiagnosticCollection) IsEmpty() bool { 3310 return dc.Value == nil || len(*dc.Value) == 0 3311} 3312 3313// hasNextLink returns true if the NextLink is not empty. 3314func (dc DiagnosticCollection) hasNextLink() bool { 3315 return dc.NextLink != nil && len(*dc.NextLink) != 0 3316} 3317 3318// diagnosticCollectionPreparer prepares a request to retrieve the next set of results. 3319// It returns nil if no more results exist. 3320func (dc DiagnosticCollection) diagnosticCollectionPreparer(ctx context.Context) (*http.Request, error) { 3321 if !dc.hasNextLink() { 3322 return nil, nil 3323 } 3324 return autorest.Prepare((&http.Request{}).WithContext(ctx), 3325 autorest.AsJSON(), 3326 autorest.AsGet(), 3327 autorest.WithBaseURL(to.String(dc.NextLink))) 3328} 3329 3330// DiagnosticCollectionPage contains a page of DiagnosticContract values. 3331type DiagnosticCollectionPage struct { 3332 fn func(context.Context, DiagnosticCollection) (DiagnosticCollection, error) 3333 dc DiagnosticCollection 3334} 3335 3336// NextWithContext advances to the next page of values. If there was an error making 3337// the request the page does not advance and the error is returned. 3338func (page *DiagnosticCollectionPage) NextWithContext(ctx context.Context) (err error) { 3339 if tracing.IsEnabled() { 3340 ctx = tracing.StartSpan(ctx, fqdn+"/DiagnosticCollectionPage.NextWithContext") 3341 defer func() { 3342 sc := -1 3343 if page.Response().Response.Response != nil { 3344 sc = page.Response().Response.Response.StatusCode 3345 } 3346 tracing.EndSpan(ctx, sc, err) 3347 }() 3348 } 3349 for { 3350 next, err := page.fn(ctx, page.dc) 3351 if err != nil { 3352 return err 3353 } 3354 page.dc = next 3355 if !next.hasNextLink() || !next.IsEmpty() { 3356 break 3357 } 3358 } 3359 return nil 3360} 3361 3362// Next advances to the next page of values. If there was an error making 3363// the request the page does not advance and the error is returned. 3364// Deprecated: Use NextWithContext() instead. 3365func (page *DiagnosticCollectionPage) Next() error { 3366 return page.NextWithContext(context.Background()) 3367} 3368 3369// NotDone returns true if the page enumeration should be started or is not yet complete. 3370func (page DiagnosticCollectionPage) NotDone() bool { 3371 return !page.dc.IsEmpty() 3372} 3373 3374// Response returns the raw server response from the last page request. 3375func (page DiagnosticCollectionPage) Response() DiagnosticCollection { 3376 return page.dc 3377} 3378 3379// Values returns the slice of values for the current page or nil if there are no values. 3380func (page DiagnosticCollectionPage) Values() []DiagnosticContract { 3381 if page.dc.IsEmpty() { 3382 return nil 3383 } 3384 return *page.dc.Value 3385} 3386 3387// Creates a new instance of the DiagnosticCollectionPage type. 3388func NewDiagnosticCollectionPage(cur DiagnosticCollection, getNextPage func(context.Context, DiagnosticCollection) (DiagnosticCollection, error)) DiagnosticCollectionPage { 3389 return DiagnosticCollectionPage{ 3390 fn: getNextPage, 3391 dc: cur, 3392 } 3393} 3394 3395// DiagnosticContract diagnostic details. 3396type DiagnosticContract struct { 3397 autorest.Response `json:"-"` 3398 // DiagnosticContractProperties - Diagnostic entity contract properties. 3399 *DiagnosticContractProperties `json:"properties,omitempty"` 3400 // ID - READ-ONLY; Resource ID. 3401 ID *string `json:"id,omitempty"` 3402 // Name - READ-ONLY; Resource name. 3403 Name *string `json:"name,omitempty"` 3404 // Type - READ-ONLY; Resource type for API Management resource. 3405 Type *string `json:"type,omitempty"` 3406} 3407 3408// MarshalJSON is the custom marshaler for DiagnosticContract. 3409func (dc DiagnosticContract) MarshalJSON() ([]byte, error) { 3410 objectMap := make(map[string]interface{}) 3411 if dc.DiagnosticContractProperties != nil { 3412 objectMap["properties"] = dc.DiagnosticContractProperties 3413 } 3414 return json.Marshal(objectMap) 3415} 3416 3417// UnmarshalJSON is the custom unmarshaler for DiagnosticContract struct. 3418func (dc *DiagnosticContract) UnmarshalJSON(body []byte) error { 3419 var m map[string]*json.RawMessage 3420 err := json.Unmarshal(body, &m) 3421 if err != nil { 3422 return err 3423 } 3424 for k, v := range m { 3425 switch k { 3426 case "properties": 3427 if v != nil { 3428 var diagnosticContractProperties DiagnosticContractProperties 3429 err = json.Unmarshal(*v, &diagnosticContractProperties) 3430 if err != nil { 3431 return err 3432 } 3433 dc.DiagnosticContractProperties = &diagnosticContractProperties 3434 } 3435 case "id": 3436 if v != nil { 3437 var ID string 3438 err = json.Unmarshal(*v, &ID) 3439 if err != nil { 3440 return err 3441 } 3442 dc.ID = &ID 3443 } 3444 case "name": 3445 if v != nil { 3446 var name string 3447 err = json.Unmarshal(*v, &name) 3448 if err != nil { 3449 return err 3450 } 3451 dc.Name = &name 3452 } 3453 case "type": 3454 if v != nil { 3455 var typeVar string 3456 err = json.Unmarshal(*v, &typeVar) 3457 if err != nil { 3458 return err 3459 } 3460 dc.Type = &typeVar 3461 } 3462 } 3463 } 3464 3465 return nil 3466} 3467 3468// DiagnosticContractProperties diagnostic Entity Properties 3469type DiagnosticContractProperties struct { 3470 // AlwaysLog - Specifies for what type of messages sampling settings should not apply. Possible values include: 'AllErrors' 3471 AlwaysLog AlwaysLog `json:"alwaysLog,omitempty"` 3472 // LoggerID - Resource Id of a target logger. 3473 LoggerID *string `json:"loggerId,omitempty"` 3474 // Sampling - Sampling settings for Diagnostic. 3475 Sampling *SamplingSettings `json:"sampling,omitempty"` 3476 // Frontend - Diagnostic settings for incoming/outgoing HTTP messages to the Gateway. 3477 Frontend *PipelineDiagnosticSettings `json:"frontend,omitempty"` 3478 // Backend - Diagnostic settings for incoming/outgoing HTTP messages to the Backend 3479 Backend *PipelineDiagnosticSettings `json:"backend,omitempty"` 3480 // EnableHTTPCorrelationHeaders - Whether to process Correlation Headers coming to Api Management Service. Only applicable to Application Insights diagnostics. Default is true. 3481 EnableHTTPCorrelationHeaders *bool `json:"enableHttpCorrelationHeaders,omitempty"` 3482} 3483 3484// EmailTemplateCollection paged email template list representation. 3485type EmailTemplateCollection struct { 3486 autorest.Response `json:"-"` 3487 // Value - Page values. 3488 Value *[]EmailTemplateContract `json:"value,omitempty"` 3489 // NextLink - Next page link if any. 3490 NextLink *string `json:"nextLink,omitempty"` 3491} 3492 3493// EmailTemplateCollectionIterator provides access to a complete listing of EmailTemplateContract values. 3494type EmailTemplateCollectionIterator struct { 3495 i int 3496 page EmailTemplateCollectionPage 3497} 3498 3499// NextWithContext advances to the next value. If there was an error making 3500// the request the iterator does not advance and the error is returned. 3501func (iter *EmailTemplateCollectionIterator) NextWithContext(ctx context.Context) (err error) { 3502 if tracing.IsEnabled() { 3503 ctx = tracing.StartSpan(ctx, fqdn+"/EmailTemplateCollectionIterator.NextWithContext") 3504 defer func() { 3505 sc := -1 3506 if iter.Response().Response.Response != nil { 3507 sc = iter.Response().Response.Response.StatusCode 3508 } 3509 tracing.EndSpan(ctx, sc, err) 3510 }() 3511 } 3512 iter.i++ 3513 if iter.i < len(iter.page.Values()) { 3514 return nil 3515 } 3516 err = iter.page.NextWithContext(ctx) 3517 if err != nil { 3518 iter.i-- 3519 return err 3520 } 3521 iter.i = 0 3522 return nil 3523} 3524 3525// Next advances to the next value. If there was an error making 3526// the request the iterator does not advance and the error is returned. 3527// Deprecated: Use NextWithContext() instead. 3528func (iter *EmailTemplateCollectionIterator) Next() error { 3529 return iter.NextWithContext(context.Background()) 3530} 3531 3532// NotDone returns true if the enumeration should be started or is not yet complete. 3533func (iter EmailTemplateCollectionIterator) NotDone() bool { 3534 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 3535} 3536 3537// Response returns the raw server response from the last page request. 3538func (iter EmailTemplateCollectionIterator) Response() EmailTemplateCollection { 3539 return iter.page.Response() 3540} 3541 3542// Value returns the current value or a zero-initialized value if the 3543// iterator has advanced beyond the end of the collection. 3544func (iter EmailTemplateCollectionIterator) Value() EmailTemplateContract { 3545 if !iter.page.NotDone() { 3546 return EmailTemplateContract{} 3547 } 3548 return iter.page.Values()[iter.i] 3549} 3550 3551// Creates a new instance of the EmailTemplateCollectionIterator type. 3552func NewEmailTemplateCollectionIterator(page EmailTemplateCollectionPage) EmailTemplateCollectionIterator { 3553 return EmailTemplateCollectionIterator{page: page} 3554} 3555 3556// IsEmpty returns true if the ListResult contains no values. 3557func (etc EmailTemplateCollection) IsEmpty() bool { 3558 return etc.Value == nil || len(*etc.Value) == 0 3559} 3560 3561// hasNextLink returns true if the NextLink is not empty. 3562func (etc EmailTemplateCollection) hasNextLink() bool { 3563 return etc.NextLink != nil && len(*etc.NextLink) != 0 3564} 3565 3566// emailTemplateCollectionPreparer prepares a request to retrieve the next set of results. 3567// It returns nil if no more results exist. 3568func (etc EmailTemplateCollection) emailTemplateCollectionPreparer(ctx context.Context) (*http.Request, error) { 3569 if !etc.hasNextLink() { 3570 return nil, nil 3571 } 3572 return autorest.Prepare((&http.Request{}).WithContext(ctx), 3573 autorest.AsJSON(), 3574 autorest.AsGet(), 3575 autorest.WithBaseURL(to.String(etc.NextLink))) 3576} 3577 3578// EmailTemplateCollectionPage contains a page of EmailTemplateContract values. 3579type EmailTemplateCollectionPage struct { 3580 fn func(context.Context, EmailTemplateCollection) (EmailTemplateCollection, error) 3581 etc EmailTemplateCollection 3582} 3583 3584// NextWithContext advances to the next page of values. If there was an error making 3585// the request the page does not advance and the error is returned. 3586func (page *EmailTemplateCollectionPage) NextWithContext(ctx context.Context) (err error) { 3587 if tracing.IsEnabled() { 3588 ctx = tracing.StartSpan(ctx, fqdn+"/EmailTemplateCollectionPage.NextWithContext") 3589 defer func() { 3590 sc := -1 3591 if page.Response().Response.Response != nil { 3592 sc = page.Response().Response.Response.StatusCode 3593 } 3594 tracing.EndSpan(ctx, sc, err) 3595 }() 3596 } 3597 for { 3598 next, err := page.fn(ctx, page.etc) 3599 if err != nil { 3600 return err 3601 } 3602 page.etc = next 3603 if !next.hasNextLink() || !next.IsEmpty() { 3604 break 3605 } 3606 } 3607 return nil 3608} 3609 3610// Next advances to the next page of values. If there was an error making 3611// the request the page does not advance and the error is returned. 3612// Deprecated: Use NextWithContext() instead. 3613func (page *EmailTemplateCollectionPage) Next() error { 3614 return page.NextWithContext(context.Background()) 3615} 3616 3617// NotDone returns true if the page enumeration should be started or is not yet complete. 3618func (page EmailTemplateCollectionPage) NotDone() bool { 3619 return !page.etc.IsEmpty() 3620} 3621 3622// Response returns the raw server response from the last page request. 3623func (page EmailTemplateCollectionPage) Response() EmailTemplateCollection { 3624 return page.etc 3625} 3626 3627// Values returns the slice of values for the current page or nil if there are no values. 3628func (page EmailTemplateCollectionPage) Values() []EmailTemplateContract { 3629 if page.etc.IsEmpty() { 3630 return nil 3631 } 3632 return *page.etc.Value 3633} 3634 3635// Creates a new instance of the EmailTemplateCollectionPage type. 3636func NewEmailTemplateCollectionPage(cur EmailTemplateCollection, getNextPage func(context.Context, EmailTemplateCollection) (EmailTemplateCollection, error)) EmailTemplateCollectionPage { 3637 return EmailTemplateCollectionPage{ 3638 fn: getNextPage, 3639 etc: cur, 3640 } 3641} 3642 3643// EmailTemplateContract email Template details. 3644type EmailTemplateContract struct { 3645 autorest.Response `json:"-"` 3646 // EmailTemplateContractProperties - Email Template entity contract properties. 3647 *EmailTemplateContractProperties `json:"properties,omitempty"` 3648 // ID - READ-ONLY; Resource ID. 3649 ID *string `json:"id,omitempty"` 3650 // Name - READ-ONLY; Resource name. 3651 Name *string `json:"name,omitempty"` 3652 // Type - READ-ONLY; Resource type for API Management resource. 3653 Type *string `json:"type,omitempty"` 3654} 3655 3656// MarshalJSON is the custom marshaler for EmailTemplateContract. 3657func (etc EmailTemplateContract) MarshalJSON() ([]byte, error) { 3658 objectMap := make(map[string]interface{}) 3659 if etc.EmailTemplateContractProperties != nil { 3660 objectMap["properties"] = etc.EmailTemplateContractProperties 3661 } 3662 return json.Marshal(objectMap) 3663} 3664 3665// UnmarshalJSON is the custom unmarshaler for EmailTemplateContract struct. 3666func (etc *EmailTemplateContract) UnmarshalJSON(body []byte) error { 3667 var m map[string]*json.RawMessage 3668 err := json.Unmarshal(body, &m) 3669 if err != nil { 3670 return err 3671 } 3672 for k, v := range m { 3673 switch k { 3674 case "properties": 3675 if v != nil { 3676 var emailTemplateContractProperties EmailTemplateContractProperties 3677 err = json.Unmarshal(*v, &emailTemplateContractProperties) 3678 if err != nil { 3679 return err 3680 } 3681 etc.EmailTemplateContractProperties = &emailTemplateContractProperties 3682 } 3683 case "id": 3684 if v != nil { 3685 var ID string 3686 err = json.Unmarshal(*v, &ID) 3687 if err != nil { 3688 return err 3689 } 3690 etc.ID = &ID 3691 } 3692 case "name": 3693 if v != nil { 3694 var name string 3695 err = json.Unmarshal(*v, &name) 3696 if err != nil { 3697 return err 3698 } 3699 etc.Name = &name 3700 } 3701 case "type": 3702 if v != nil { 3703 var typeVar string 3704 err = json.Unmarshal(*v, &typeVar) 3705 if err != nil { 3706 return err 3707 } 3708 etc.Type = &typeVar 3709 } 3710 } 3711 } 3712 3713 return nil 3714} 3715 3716// EmailTemplateContractProperties email Template Contract properties. 3717type EmailTemplateContractProperties struct { 3718 // Subject - Subject of the Template. 3719 Subject *string `json:"subject,omitempty"` 3720 // Body - Email Template Body. This should be a valid XDocument 3721 Body *string `json:"body,omitempty"` 3722 // Title - Title of the Template. 3723 Title *string `json:"title,omitempty"` 3724 // Description - Description of the Email Template. 3725 Description *string `json:"description,omitempty"` 3726 // IsDefault - READ-ONLY; Whether the template is the default template provided by Api Management or has been edited. 3727 IsDefault *bool `json:"isDefault,omitempty"` 3728 // Parameters - Email Template Parameter values. 3729 Parameters *[]EmailTemplateParametersContractProperties `json:"parameters,omitempty"` 3730} 3731 3732// MarshalJSON is the custom marshaler for EmailTemplateContractProperties. 3733func (etcp EmailTemplateContractProperties) MarshalJSON() ([]byte, error) { 3734 objectMap := make(map[string]interface{}) 3735 if etcp.Subject != nil { 3736 objectMap["subject"] = etcp.Subject 3737 } 3738 if etcp.Body != nil { 3739 objectMap["body"] = etcp.Body 3740 } 3741 if etcp.Title != nil { 3742 objectMap["title"] = etcp.Title 3743 } 3744 if etcp.Description != nil { 3745 objectMap["description"] = etcp.Description 3746 } 3747 if etcp.Parameters != nil { 3748 objectMap["parameters"] = etcp.Parameters 3749 } 3750 return json.Marshal(objectMap) 3751} 3752 3753// EmailTemplateParametersContractProperties email Template Parameter contract. 3754type EmailTemplateParametersContractProperties struct { 3755 // Name - Template parameter name. 3756 Name *string `json:"name,omitempty"` 3757 // Title - Template parameter title. 3758 Title *string `json:"title,omitempty"` 3759 // Description - Template parameter description. 3760 Description *string `json:"description,omitempty"` 3761} 3762 3763// EmailTemplateUpdateParameterProperties email Template Update Contract properties. 3764type EmailTemplateUpdateParameterProperties struct { 3765 // Subject - Subject of the Template. 3766 Subject *string `json:"subject,omitempty"` 3767 // Title - Title of the Template. 3768 Title *string `json:"title,omitempty"` 3769 // Description - Description of the Email Template. 3770 Description *string `json:"description,omitempty"` 3771 // Body - Email Template Body. This should be a valid XDocument 3772 Body *string `json:"body,omitempty"` 3773 // Parameters - Email Template Parameter values. 3774 Parameters *[]EmailTemplateParametersContractProperties `json:"parameters,omitempty"` 3775} 3776 3777// EmailTemplateUpdateParameters email Template update Parameters. 3778type EmailTemplateUpdateParameters struct { 3779 // EmailTemplateUpdateParameterProperties - Email Template Update contract properties. 3780 *EmailTemplateUpdateParameterProperties `json:"properties,omitempty"` 3781} 3782 3783// MarshalJSON is the custom marshaler for EmailTemplateUpdateParameters. 3784func (etup EmailTemplateUpdateParameters) MarshalJSON() ([]byte, error) { 3785 objectMap := make(map[string]interface{}) 3786 if etup.EmailTemplateUpdateParameterProperties != nil { 3787 objectMap["properties"] = etup.EmailTemplateUpdateParameterProperties 3788 } 3789 return json.Marshal(objectMap) 3790} 3791 3792// UnmarshalJSON is the custom unmarshaler for EmailTemplateUpdateParameters struct. 3793func (etup *EmailTemplateUpdateParameters) UnmarshalJSON(body []byte) error { 3794 var m map[string]*json.RawMessage 3795 err := json.Unmarshal(body, &m) 3796 if err != nil { 3797 return err 3798 } 3799 for k, v := range m { 3800 switch k { 3801 case "properties": 3802 if v != nil { 3803 var emailTemplateUpdateParameterProperties EmailTemplateUpdateParameterProperties 3804 err = json.Unmarshal(*v, &emailTemplateUpdateParameterProperties) 3805 if err != nil { 3806 return err 3807 } 3808 etup.EmailTemplateUpdateParameterProperties = &emailTemplateUpdateParameterProperties 3809 } 3810 } 3811 } 3812 3813 return nil 3814} 3815 3816// ErrorFieldContract error Field contract. 3817type ErrorFieldContract struct { 3818 // Code - Property level error code. 3819 Code *string `json:"code,omitempty"` 3820 // Message - Human-readable representation of property-level error. 3821 Message *string `json:"message,omitempty"` 3822 // Target - Property name. 3823 Target *string `json:"target,omitempty"` 3824} 3825 3826// ErrorResponse error Response. 3827type ErrorResponse struct { 3828 // ErrorResponseBody - Properties of the Error Response. 3829 *ErrorResponseBody `json:"error,omitempty"` 3830} 3831 3832// MarshalJSON is the custom marshaler for ErrorResponse. 3833func (er ErrorResponse) MarshalJSON() ([]byte, error) { 3834 objectMap := make(map[string]interface{}) 3835 if er.ErrorResponseBody != nil { 3836 objectMap["error"] = er.ErrorResponseBody 3837 } 3838 return json.Marshal(objectMap) 3839} 3840 3841// UnmarshalJSON is the custom unmarshaler for ErrorResponse struct. 3842func (er *ErrorResponse) UnmarshalJSON(body []byte) error { 3843 var m map[string]*json.RawMessage 3844 err := json.Unmarshal(body, &m) 3845 if err != nil { 3846 return err 3847 } 3848 for k, v := range m { 3849 switch k { 3850 case "error": 3851 if v != nil { 3852 var errorResponseBody ErrorResponseBody 3853 err = json.Unmarshal(*v, &errorResponseBody) 3854 if err != nil { 3855 return err 3856 } 3857 er.ErrorResponseBody = &errorResponseBody 3858 } 3859 } 3860 } 3861 3862 return nil 3863} 3864 3865// ErrorResponseBody error Body contract. 3866type ErrorResponseBody struct { 3867 // Code - Service-defined error code. This code serves as a sub-status for the HTTP error code specified in the response. 3868 Code *string `json:"code,omitempty"` 3869 // Message - Human-readable representation of the error. 3870 Message *string `json:"message,omitempty"` 3871 // Details - The list of invalid fields send in request, in case of validation error. 3872 Details *[]ErrorFieldContract `json:"details,omitempty"` 3873} 3874 3875// GenerateSsoURLResult generate SSO Url operations response details. 3876type GenerateSsoURLResult struct { 3877 autorest.Response `json:"-"` 3878 // Value - Redirect Url containing the SSO URL value. 3879 Value *string `json:"value,omitempty"` 3880} 3881 3882// GroupCollection paged Group list representation. 3883type GroupCollection struct { 3884 autorest.Response `json:"-"` 3885 // Value - Page values. 3886 Value *[]GroupContract `json:"value,omitempty"` 3887 // NextLink - Next page link if any. 3888 NextLink *string `json:"nextLink,omitempty"` 3889} 3890 3891// GroupCollectionIterator provides access to a complete listing of GroupContract values. 3892type GroupCollectionIterator struct { 3893 i int 3894 page GroupCollectionPage 3895} 3896 3897// NextWithContext advances to the next value. If there was an error making 3898// the request the iterator does not advance and the error is returned. 3899func (iter *GroupCollectionIterator) NextWithContext(ctx context.Context) (err error) { 3900 if tracing.IsEnabled() { 3901 ctx = tracing.StartSpan(ctx, fqdn+"/GroupCollectionIterator.NextWithContext") 3902 defer func() { 3903 sc := -1 3904 if iter.Response().Response.Response != nil { 3905 sc = iter.Response().Response.Response.StatusCode 3906 } 3907 tracing.EndSpan(ctx, sc, err) 3908 }() 3909 } 3910 iter.i++ 3911 if iter.i < len(iter.page.Values()) { 3912 return nil 3913 } 3914 err = iter.page.NextWithContext(ctx) 3915 if err != nil { 3916 iter.i-- 3917 return err 3918 } 3919 iter.i = 0 3920 return nil 3921} 3922 3923// Next advances to the next value. If there was an error making 3924// the request the iterator does not advance and the error is returned. 3925// Deprecated: Use NextWithContext() instead. 3926func (iter *GroupCollectionIterator) Next() error { 3927 return iter.NextWithContext(context.Background()) 3928} 3929 3930// NotDone returns true if the enumeration should be started or is not yet complete. 3931func (iter GroupCollectionIterator) NotDone() bool { 3932 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 3933} 3934 3935// Response returns the raw server response from the last page request. 3936func (iter GroupCollectionIterator) Response() GroupCollection { 3937 return iter.page.Response() 3938} 3939 3940// Value returns the current value or a zero-initialized value if the 3941// iterator has advanced beyond the end of the collection. 3942func (iter GroupCollectionIterator) Value() GroupContract { 3943 if !iter.page.NotDone() { 3944 return GroupContract{} 3945 } 3946 return iter.page.Values()[iter.i] 3947} 3948 3949// Creates a new instance of the GroupCollectionIterator type. 3950func NewGroupCollectionIterator(page GroupCollectionPage) GroupCollectionIterator { 3951 return GroupCollectionIterator{page: page} 3952} 3953 3954// IsEmpty returns true if the ListResult contains no values. 3955func (gc GroupCollection) IsEmpty() bool { 3956 return gc.Value == nil || len(*gc.Value) == 0 3957} 3958 3959// hasNextLink returns true if the NextLink is not empty. 3960func (gc GroupCollection) hasNextLink() bool { 3961 return gc.NextLink != nil && len(*gc.NextLink) != 0 3962} 3963 3964// groupCollectionPreparer prepares a request to retrieve the next set of results. 3965// It returns nil if no more results exist. 3966func (gc GroupCollection) groupCollectionPreparer(ctx context.Context) (*http.Request, error) { 3967 if !gc.hasNextLink() { 3968 return nil, nil 3969 } 3970 return autorest.Prepare((&http.Request{}).WithContext(ctx), 3971 autorest.AsJSON(), 3972 autorest.AsGet(), 3973 autorest.WithBaseURL(to.String(gc.NextLink))) 3974} 3975 3976// GroupCollectionPage contains a page of GroupContract values. 3977type GroupCollectionPage struct { 3978 fn func(context.Context, GroupCollection) (GroupCollection, error) 3979 gc GroupCollection 3980} 3981 3982// NextWithContext advances to the next page of values. If there was an error making 3983// the request the page does not advance and the error is returned. 3984func (page *GroupCollectionPage) NextWithContext(ctx context.Context) (err error) { 3985 if tracing.IsEnabled() { 3986 ctx = tracing.StartSpan(ctx, fqdn+"/GroupCollectionPage.NextWithContext") 3987 defer func() { 3988 sc := -1 3989 if page.Response().Response.Response != nil { 3990 sc = page.Response().Response.Response.StatusCode 3991 } 3992 tracing.EndSpan(ctx, sc, err) 3993 }() 3994 } 3995 for { 3996 next, err := page.fn(ctx, page.gc) 3997 if err != nil { 3998 return err 3999 } 4000 page.gc = next 4001 if !next.hasNextLink() || !next.IsEmpty() { 4002 break 4003 } 4004 } 4005 return nil 4006} 4007 4008// Next advances to the next page of values. If there was an error making 4009// the request the page does not advance and the error is returned. 4010// Deprecated: Use NextWithContext() instead. 4011func (page *GroupCollectionPage) Next() error { 4012 return page.NextWithContext(context.Background()) 4013} 4014 4015// NotDone returns true if the page enumeration should be started or is not yet complete. 4016func (page GroupCollectionPage) NotDone() bool { 4017 return !page.gc.IsEmpty() 4018} 4019 4020// Response returns the raw server response from the last page request. 4021func (page GroupCollectionPage) Response() GroupCollection { 4022 return page.gc 4023} 4024 4025// Values returns the slice of values for the current page or nil if there are no values. 4026func (page GroupCollectionPage) Values() []GroupContract { 4027 if page.gc.IsEmpty() { 4028 return nil 4029 } 4030 return *page.gc.Value 4031} 4032 4033// Creates a new instance of the GroupCollectionPage type. 4034func NewGroupCollectionPage(cur GroupCollection, getNextPage func(context.Context, GroupCollection) (GroupCollection, error)) GroupCollectionPage { 4035 return GroupCollectionPage{ 4036 fn: getNextPage, 4037 gc: cur, 4038 } 4039} 4040 4041// GroupContract contract details. 4042type GroupContract struct { 4043 autorest.Response `json:"-"` 4044 // GroupContractProperties - Group entity contract properties. 4045 *GroupContractProperties `json:"properties,omitempty"` 4046 // ID - READ-ONLY; Resource ID. 4047 ID *string `json:"id,omitempty"` 4048 // Name - READ-ONLY; Resource name. 4049 Name *string `json:"name,omitempty"` 4050 // Type - READ-ONLY; Resource type for API Management resource. 4051 Type *string `json:"type,omitempty"` 4052} 4053 4054// MarshalJSON is the custom marshaler for GroupContract. 4055func (gc GroupContract) MarshalJSON() ([]byte, error) { 4056 objectMap := make(map[string]interface{}) 4057 if gc.GroupContractProperties != nil { 4058 objectMap["properties"] = gc.GroupContractProperties 4059 } 4060 return json.Marshal(objectMap) 4061} 4062 4063// UnmarshalJSON is the custom unmarshaler for GroupContract struct. 4064func (gc *GroupContract) UnmarshalJSON(body []byte) error { 4065 var m map[string]*json.RawMessage 4066 err := json.Unmarshal(body, &m) 4067 if err != nil { 4068 return err 4069 } 4070 for k, v := range m { 4071 switch k { 4072 case "properties": 4073 if v != nil { 4074 var groupContractProperties GroupContractProperties 4075 err = json.Unmarshal(*v, &groupContractProperties) 4076 if err != nil { 4077 return err 4078 } 4079 gc.GroupContractProperties = &groupContractProperties 4080 } 4081 case "id": 4082 if v != nil { 4083 var ID string 4084 err = json.Unmarshal(*v, &ID) 4085 if err != nil { 4086 return err 4087 } 4088 gc.ID = &ID 4089 } 4090 case "name": 4091 if v != nil { 4092 var name string 4093 err = json.Unmarshal(*v, &name) 4094 if err != nil { 4095 return err 4096 } 4097 gc.Name = &name 4098 } 4099 case "type": 4100 if v != nil { 4101 var typeVar string 4102 err = json.Unmarshal(*v, &typeVar) 4103 if err != nil { 4104 return err 4105 } 4106 gc.Type = &typeVar 4107 } 4108 } 4109 } 4110 4111 return nil 4112} 4113 4114// GroupContractProperties group contract Properties. 4115type GroupContractProperties struct { 4116 // DisplayName - Group name. 4117 DisplayName *string `json:"displayName,omitempty"` 4118 // Description - Group description. Can contain HTML formatting tags. 4119 Description *string `json:"description,omitempty"` 4120 // BuiltIn - READ-ONLY; true if the group is one of the three system groups (Administrators, Developers, or Guests); otherwise false. 4121 BuiltIn *bool `json:"builtIn,omitempty"` 4122 // Type - Group type. Possible values include: 'Custom', 'System', 'External' 4123 Type GroupType `json:"type,omitempty"` 4124 // 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. 4125 ExternalID *string `json:"externalId,omitempty"` 4126} 4127 4128// MarshalJSON is the custom marshaler for GroupContractProperties. 4129func (gcp GroupContractProperties) MarshalJSON() ([]byte, error) { 4130 objectMap := make(map[string]interface{}) 4131 if gcp.DisplayName != nil { 4132 objectMap["displayName"] = gcp.DisplayName 4133 } 4134 if gcp.Description != nil { 4135 objectMap["description"] = gcp.Description 4136 } 4137 if gcp.Type != "" { 4138 objectMap["type"] = gcp.Type 4139 } 4140 if gcp.ExternalID != nil { 4141 objectMap["externalId"] = gcp.ExternalID 4142 } 4143 return json.Marshal(objectMap) 4144} 4145 4146// GroupCreateParameters parameters supplied to the Create Group operation. 4147type GroupCreateParameters struct { 4148 // GroupCreateParametersProperties - Properties supplied to Create Group operation. 4149 *GroupCreateParametersProperties `json:"properties,omitempty"` 4150} 4151 4152// MarshalJSON is the custom marshaler for GroupCreateParameters. 4153func (gcp GroupCreateParameters) MarshalJSON() ([]byte, error) { 4154 objectMap := make(map[string]interface{}) 4155 if gcp.GroupCreateParametersProperties != nil { 4156 objectMap["properties"] = gcp.GroupCreateParametersProperties 4157 } 4158 return json.Marshal(objectMap) 4159} 4160 4161// UnmarshalJSON is the custom unmarshaler for GroupCreateParameters struct. 4162func (gcp *GroupCreateParameters) UnmarshalJSON(body []byte) error { 4163 var m map[string]*json.RawMessage 4164 err := json.Unmarshal(body, &m) 4165 if err != nil { 4166 return err 4167 } 4168 for k, v := range m { 4169 switch k { 4170 case "properties": 4171 if v != nil { 4172 var groupCreateParametersProperties GroupCreateParametersProperties 4173 err = json.Unmarshal(*v, &groupCreateParametersProperties) 4174 if err != nil { 4175 return err 4176 } 4177 gcp.GroupCreateParametersProperties = &groupCreateParametersProperties 4178 } 4179 } 4180 } 4181 4182 return nil 4183} 4184 4185// GroupCreateParametersProperties parameters supplied to the Create Group operation. 4186type GroupCreateParametersProperties struct { 4187 // DisplayName - Group name. 4188 DisplayName *string `json:"displayName,omitempty"` 4189 // Description - Group description. 4190 Description *string `json:"description,omitempty"` 4191 // Type - Group type. Possible values include: 'Custom', 'System', 'External' 4192 Type GroupType `json:"type,omitempty"` 4193 // 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. 4194 ExternalID *string `json:"externalId,omitempty"` 4195} 4196 4197// GroupUpdateParameters parameters supplied to the Update Group operation. 4198type GroupUpdateParameters struct { 4199 // GroupUpdateParametersProperties - Group entity update contract properties. 4200 *GroupUpdateParametersProperties `json:"properties,omitempty"` 4201} 4202 4203// MarshalJSON is the custom marshaler for GroupUpdateParameters. 4204func (gup GroupUpdateParameters) MarshalJSON() ([]byte, error) { 4205 objectMap := make(map[string]interface{}) 4206 if gup.GroupUpdateParametersProperties != nil { 4207 objectMap["properties"] = gup.GroupUpdateParametersProperties 4208 } 4209 return json.Marshal(objectMap) 4210} 4211 4212// UnmarshalJSON is the custom unmarshaler for GroupUpdateParameters struct. 4213func (gup *GroupUpdateParameters) UnmarshalJSON(body []byte) error { 4214 var m map[string]*json.RawMessage 4215 err := json.Unmarshal(body, &m) 4216 if err != nil { 4217 return err 4218 } 4219 for k, v := range m { 4220 switch k { 4221 case "properties": 4222 if v != nil { 4223 var groupUpdateParametersProperties GroupUpdateParametersProperties 4224 err = json.Unmarshal(*v, &groupUpdateParametersProperties) 4225 if err != nil { 4226 return err 4227 } 4228 gup.GroupUpdateParametersProperties = &groupUpdateParametersProperties 4229 } 4230 } 4231 } 4232 4233 return nil 4234} 4235 4236// GroupUpdateParametersProperties parameters supplied to the Update Group operation. 4237type GroupUpdateParametersProperties struct { 4238 // DisplayName - Group name. 4239 DisplayName *string `json:"displayName,omitempty"` 4240 // Description - Group description. 4241 Description *string `json:"description,omitempty"` 4242 // Type - Group type. Possible values include: 'Custom', 'System', 'External' 4243 Type GroupType `json:"type,omitempty"` 4244 // 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. 4245 ExternalID *string `json:"externalId,omitempty"` 4246} 4247 4248// HostnameConfiguration custom hostname configuration. 4249type HostnameConfiguration struct { 4250 // Type - Hostname type. Possible values include: 'Proxy', 'Portal', 'Management', 'Scm' 4251 Type HostnameType `json:"type,omitempty"` 4252 // HostName - Hostname to configure on the Api Management service. 4253 HostName *string `json:"hostName,omitempty"` 4254 // 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* 4255 KeyVaultID *string `json:"keyVaultId,omitempty"` 4256 // EncodedCertificate - Base64 Encoded certificate. 4257 EncodedCertificate *string `json:"encodedCertificate,omitempty"` 4258 // CertificatePassword - Certificate Password. 4259 CertificatePassword *string `json:"certificatePassword,omitempty"` 4260 // 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. 4261 DefaultSslBinding *bool `json:"defaultSslBinding,omitempty"` 4262 // NegotiateClientCertificate - Specify true to always negotiate client certificate on the hostname. Default Value is false. 4263 NegotiateClientCertificate *bool `json:"negotiateClientCertificate,omitempty"` 4264 // Certificate - Certificate information. 4265 Certificate *CertificateInformation `json:"certificate,omitempty"` 4266} 4267 4268// HostnameConfigurationOld custom hostname configuration. 4269type HostnameConfigurationOld struct { 4270 // Type - Hostname type. Possible values include: 'Proxy', 'Portal', 'Management', 'Scm' 4271 Type HostnameType `json:"type,omitempty"` 4272 // Hostname - Hostname to configure. 4273 Hostname *string `json:"hostname,omitempty"` 4274 // Certificate - Certificate information. 4275 Certificate *CertificateInformation `json:"certificate,omitempty"` 4276} 4277 4278// HTTPMessageDiagnostic http message diagnostic settings. 4279type HTTPMessageDiagnostic struct { 4280 // Headers - Array of HTTP Headers to log. 4281 Headers *[]string `json:"headers,omitempty"` 4282 // Body - Body logging settings. 4283 Body *BodyDiagnosticSettings `json:"body,omitempty"` 4284} 4285 4286// IdentityProviderBaseParameters identity Provider Base Parameter Properties. 4287type IdentityProviderBaseParameters struct { 4288 // Type - Identity Provider Type identifier. Possible values include: 'Facebook', 'Google', 'Microsoft', 'Twitter', 'Aad', 'AadB2C' 4289 Type IdentityProviderType `json:"type,omitempty"` 4290 // AllowedTenants - List of Allowed Tenants when configuring Azure Active Directory login. 4291 AllowedTenants *[]string `json:"allowedTenants,omitempty"` 4292 // Authority - OpenID Connect discovery endpoint hostname for AAD or AAD B2C. 4293 Authority *string `json:"authority,omitempty"` 4294 // SignupPolicyName - Signup Policy Name. Only applies to AAD B2C Identity Provider. 4295 SignupPolicyName *string `json:"signupPolicyName,omitempty"` 4296 // SigninPolicyName - Signin Policy Name. Only applies to AAD B2C Identity Provider. 4297 SigninPolicyName *string `json:"signinPolicyName,omitempty"` 4298 // ProfileEditingPolicyName - Profile Editing Policy Name. Only applies to AAD B2C Identity Provider. 4299 ProfileEditingPolicyName *string `json:"profileEditingPolicyName,omitempty"` 4300 // PasswordResetPolicyName - Password Reset Policy Name. Only applies to AAD B2C Identity Provider. 4301 PasswordResetPolicyName *string `json:"passwordResetPolicyName,omitempty"` 4302} 4303 4304// IdentityProviderContract identity Provider details. 4305type IdentityProviderContract struct { 4306 autorest.Response `json:"-"` 4307 // IdentityProviderContractProperties - Identity Provider contract properties. 4308 *IdentityProviderContractProperties `json:"properties,omitempty"` 4309 // ID - READ-ONLY; Resource ID. 4310 ID *string `json:"id,omitempty"` 4311 // Name - READ-ONLY; Resource name. 4312 Name *string `json:"name,omitempty"` 4313 // Type - READ-ONLY; Resource type for API Management resource. 4314 Type *string `json:"type,omitempty"` 4315} 4316 4317// MarshalJSON is the custom marshaler for IdentityProviderContract. 4318func (ipc IdentityProviderContract) MarshalJSON() ([]byte, error) { 4319 objectMap := make(map[string]interface{}) 4320 if ipc.IdentityProviderContractProperties != nil { 4321 objectMap["properties"] = ipc.IdentityProviderContractProperties 4322 } 4323 return json.Marshal(objectMap) 4324} 4325 4326// UnmarshalJSON is the custom unmarshaler for IdentityProviderContract struct. 4327func (ipc *IdentityProviderContract) UnmarshalJSON(body []byte) error { 4328 var m map[string]*json.RawMessage 4329 err := json.Unmarshal(body, &m) 4330 if err != nil { 4331 return err 4332 } 4333 for k, v := range m { 4334 switch k { 4335 case "properties": 4336 if v != nil { 4337 var identityProviderContractProperties IdentityProviderContractProperties 4338 err = json.Unmarshal(*v, &identityProviderContractProperties) 4339 if err != nil { 4340 return err 4341 } 4342 ipc.IdentityProviderContractProperties = &identityProviderContractProperties 4343 } 4344 case "id": 4345 if v != nil { 4346 var ID string 4347 err = json.Unmarshal(*v, &ID) 4348 if err != nil { 4349 return err 4350 } 4351 ipc.ID = &ID 4352 } 4353 case "name": 4354 if v != nil { 4355 var name string 4356 err = json.Unmarshal(*v, &name) 4357 if err != nil { 4358 return err 4359 } 4360 ipc.Name = &name 4361 } 4362 case "type": 4363 if v != nil { 4364 var typeVar string 4365 err = json.Unmarshal(*v, &typeVar) 4366 if err != nil { 4367 return err 4368 } 4369 ipc.Type = &typeVar 4370 } 4371 } 4372 } 4373 4374 return nil 4375} 4376 4377// IdentityProviderContractProperties the external Identity Providers like Facebook, Google, Microsoft, 4378// Twitter or Azure Active Directory which can be used to enable access to the API Management service 4379// developer portal for all users. 4380type IdentityProviderContractProperties struct { 4381 // 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. 4382 ClientID *string `json:"clientId,omitempty"` 4383 // 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. 4384 ClientSecret *string `json:"clientSecret,omitempty"` 4385 // Type - Identity Provider Type identifier. Possible values include: 'Facebook', 'Google', 'Microsoft', 'Twitter', 'Aad', 'AadB2C' 4386 Type IdentityProviderType `json:"type,omitempty"` 4387 // AllowedTenants - List of Allowed Tenants when configuring Azure Active Directory login. 4388 AllowedTenants *[]string `json:"allowedTenants,omitempty"` 4389 // Authority - OpenID Connect discovery endpoint hostname for AAD or AAD B2C. 4390 Authority *string `json:"authority,omitempty"` 4391 // SignupPolicyName - Signup Policy Name. Only applies to AAD B2C Identity Provider. 4392 SignupPolicyName *string `json:"signupPolicyName,omitempty"` 4393 // SigninPolicyName - Signin Policy Name. Only applies to AAD B2C Identity Provider. 4394 SigninPolicyName *string `json:"signinPolicyName,omitempty"` 4395 // ProfileEditingPolicyName - Profile Editing Policy Name. Only applies to AAD B2C Identity Provider. 4396 ProfileEditingPolicyName *string `json:"profileEditingPolicyName,omitempty"` 4397 // PasswordResetPolicyName - Password Reset Policy Name. Only applies to AAD B2C Identity Provider. 4398 PasswordResetPolicyName *string `json:"passwordResetPolicyName,omitempty"` 4399} 4400 4401// IdentityProviderList list of all the Identity Providers configured on the service instance. 4402type IdentityProviderList struct { 4403 autorest.Response `json:"-"` 4404 // Value - Identity Provider configuration values. 4405 Value *[]IdentityProviderContract `json:"value,omitempty"` 4406 // NextLink - Next page link if any. 4407 NextLink *string `json:"nextLink,omitempty"` 4408} 4409 4410// IdentityProviderListIterator provides access to a complete listing of IdentityProviderContract values. 4411type IdentityProviderListIterator struct { 4412 i int 4413 page IdentityProviderListPage 4414} 4415 4416// NextWithContext advances to the next value. If there was an error making 4417// the request the iterator does not advance and the error is returned. 4418func (iter *IdentityProviderListIterator) NextWithContext(ctx context.Context) (err error) { 4419 if tracing.IsEnabled() { 4420 ctx = tracing.StartSpan(ctx, fqdn+"/IdentityProviderListIterator.NextWithContext") 4421 defer func() { 4422 sc := -1 4423 if iter.Response().Response.Response != nil { 4424 sc = iter.Response().Response.Response.StatusCode 4425 } 4426 tracing.EndSpan(ctx, sc, err) 4427 }() 4428 } 4429 iter.i++ 4430 if iter.i < len(iter.page.Values()) { 4431 return nil 4432 } 4433 err = iter.page.NextWithContext(ctx) 4434 if err != nil { 4435 iter.i-- 4436 return err 4437 } 4438 iter.i = 0 4439 return nil 4440} 4441 4442// Next advances to the next value. If there was an error making 4443// the request the iterator does not advance and the error is returned. 4444// Deprecated: Use NextWithContext() instead. 4445func (iter *IdentityProviderListIterator) Next() error { 4446 return iter.NextWithContext(context.Background()) 4447} 4448 4449// NotDone returns true if the enumeration should be started or is not yet complete. 4450func (iter IdentityProviderListIterator) NotDone() bool { 4451 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 4452} 4453 4454// Response returns the raw server response from the last page request. 4455func (iter IdentityProviderListIterator) Response() IdentityProviderList { 4456 return iter.page.Response() 4457} 4458 4459// Value returns the current value or a zero-initialized value if the 4460// iterator has advanced beyond the end of the collection. 4461func (iter IdentityProviderListIterator) Value() IdentityProviderContract { 4462 if !iter.page.NotDone() { 4463 return IdentityProviderContract{} 4464 } 4465 return iter.page.Values()[iter.i] 4466} 4467 4468// Creates a new instance of the IdentityProviderListIterator type. 4469func NewIdentityProviderListIterator(page IdentityProviderListPage) IdentityProviderListIterator { 4470 return IdentityProviderListIterator{page: page} 4471} 4472 4473// IsEmpty returns true if the ListResult contains no values. 4474func (ipl IdentityProviderList) IsEmpty() bool { 4475 return ipl.Value == nil || len(*ipl.Value) == 0 4476} 4477 4478// hasNextLink returns true if the NextLink is not empty. 4479func (ipl IdentityProviderList) hasNextLink() bool { 4480 return ipl.NextLink != nil && len(*ipl.NextLink) != 0 4481} 4482 4483// identityProviderListPreparer prepares a request to retrieve the next set of results. 4484// It returns nil if no more results exist. 4485func (ipl IdentityProviderList) identityProviderListPreparer(ctx context.Context) (*http.Request, error) { 4486 if !ipl.hasNextLink() { 4487 return nil, nil 4488 } 4489 return autorest.Prepare((&http.Request{}).WithContext(ctx), 4490 autorest.AsJSON(), 4491 autorest.AsGet(), 4492 autorest.WithBaseURL(to.String(ipl.NextLink))) 4493} 4494 4495// IdentityProviderListPage contains a page of IdentityProviderContract values. 4496type IdentityProviderListPage struct { 4497 fn func(context.Context, IdentityProviderList) (IdentityProviderList, error) 4498 ipl IdentityProviderList 4499} 4500 4501// NextWithContext advances to the next page of values. If there was an error making 4502// the request the page does not advance and the error is returned. 4503func (page *IdentityProviderListPage) NextWithContext(ctx context.Context) (err error) { 4504 if tracing.IsEnabled() { 4505 ctx = tracing.StartSpan(ctx, fqdn+"/IdentityProviderListPage.NextWithContext") 4506 defer func() { 4507 sc := -1 4508 if page.Response().Response.Response != nil { 4509 sc = page.Response().Response.Response.StatusCode 4510 } 4511 tracing.EndSpan(ctx, sc, err) 4512 }() 4513 } 4514 for { 4515 next, err := page.fn(ctx, page.ipl) 4516 if err != nil { 4517 return err 4518 } 4519 page.ipl = next 4520 if !next.hasNextLink() || !next.IsEmpty() { 4521 break 4522 } 4523 } 4524 return nil 4525} 4526 4527// Next advances to the next page of values. If there was an error making 4528// the request the page does not advance and the error is returned. 4529// Deprecated: Use NextWithContext() instead. 4530func (page *IdentityProviderListPage) Next() error { 4531 return page.NextWithContext(context.Background()) 4532} 4533 4534// NotDone returns true if the page enumeration should be started or is not yet complete. 4535func (page IdentityProviderListPage) NotDone() bool { 4536 return !page.ipl.IsEmpty() 4537} 4538 4539// Response returns the raw server response from the last page request. 4540func (page IdentityProviderListPage) Response() IdentityProviderList { 4541 return page.ipl 4542} 4543 4544// Values returns the slice of values for the current page or nil if there are no values. 4545func (page IdentityProviderListPage) Values() []IdentityProviderContract { 4546 if page.ipl.IsEmpty() { 4547 return nil 4548 } 4549 return *page.ipl.Value 4550} 4551 4552// Creates a new instance of the IdentityProviderListPage type. 4553func NewIdentityProviderListPage(cur IdentityProviderList, getNextPage func(context.Context, IdentityProviderList) (IdentityProviderList, error)) IdentityProviderListPage { 4554 return IdentityProviderListPage{ 4555 fn: getNextPage, 4556 ipl: cur, 4557 } 4558} 4559 4560// IdentityProviderUpdateParameters parameters supplied to update Identity Provider 4561type IdentityProviderUpdateParameters struct { 4562 // IdentityProviderUpdateProperties - Identity Provider update properties. 4563 *IdentityProviderUpdateProperties `json:"properties,omitempty"` 4564} 4565 4566// MarshalJSON is the custom marshaler for IdentityProviderUpdateParameters. 4567func (ipup IdentityProviderUpdateParameters) MarshalJSON() ([]byte, error) { 4568 objectMap := make(map[string]interface{}) 4569 if ipup.IdentityProviderUpdateProperties != nil { 4570 objectMap["properties"] = ipup.IdentityProviderUpdateProperties 4571 } 4572 return json.Marshal(objectMap) 4573} 4574 4575// UnmarshalJSON is the custom unmarshaler for IdentityProviderUpdateParameters struct. 4576func (ipup *IdentityProviderUpdateParameters) UnmarshalJSON(body []byte) error { 4577 var m map[string]*json.RawMessage 4578 err := json.Unmarshal(body, &m) 4579 if err != nil { 4580 return err 4581 } 4582 for k, v := range m { 4583 switch k { 4584 case "properties": 4585 if v != nil { 4586 var identityProviderUpdateProperties IdentityProviderUpdateProperties 4587 err = json.Unmarshal(*v, &identityProviderUpdateProperties) 4588 if err != nil { 4589 return err 4590 } 4591 ipup.IdentityProviderUpdateProperties = &identityProviderUpdateProperties 4592 } 4593 } 4594 } 4595 4596 return nil 4597} 4598 4599// IdentityProviderUpdateProperties parameters supplied to the Update Identity Provider operation. 4600type IdentityProviderUpdateProperties struct { 4601 // 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. 4602 ClientID *string `json:"clientId,omitempty"` 4603 // 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. 4604 ClientSecret *string `json:"clientSecret,omitempty"` 4605 // Type - Identity Provider Type identifier. Possible values include: 'Facebook', 'Google', 'Microsoft', 'Twitter', 'Aad', 'AadB2C' 4606 Type IdentityProviderType `json:"type,omitempty"` 4607 // AllowedTenants - List of Allowed Tenants when configuring Azure Active Directory login. 4608 AllowedTenants *[]string `json:"allowedTenants,omitempty"` 4609 // Authority - OpenID Connect discovery endpoint hostname for AAD or AAD B2C. 4610 Authority *string `json:"authority,omitempty"` 4611 // SignupPolicyName - Signup Policy Name. Only applies to AAD B2C Identity Provider. 4612 SignupPolicyName *string `json:"signupPolicyName,omitempty"` 4613 // SigninPolicyName - Signin Policy Name. Only applies to AAD B2C Identity Provider. 4614 SigninPolicyName *string `json:"signinPolicyName,omitempty"` 4615 // ProfileEditingPolicyName - Profile Editing Policy Name. Only applies to AAD B2C Identity Provider. 4616 ProfileEditingPolicyName *string `json:"profileEditingPolicyName,omitempty"` 4617 // PasswordResetPolicyName - Password Reset Policy Name. Only applies to AAD B2C Identity Provider. 4618 PasswordResetPolicyName *string `json:"passwordResetPolicyName,omitempty"` 4619} 4620 4621// IssueAttachmentCollection paged Issue Attachment list representation. 4622type IssueAttachmentCollection struct { 4623 autorest.Response `json:"-"` 4624 // Value - READ-ONLY; Issue Attachment values. 4625 Value *[]IssueAttachmentContract `json:"value,omitempty"` 4626 // NextLink - READ-ONLY; Next page link if any. 4627 NextLink *string `json:"nextLink,omitempty"` 4628} 4629 4630// MarshalJSON is the custom marshaler for IssueAttachmentCollection. 4631func (iac IssueAttachmentCollection) MarshalJSON() ([]byte, error) { 4632 objectMap := make(map[string]interface{}) 4633 return json.Marshal(objectMap) 4634} 4635 4636// IssueAttachmentCollectionIterator provides access to a complete listing of IssueAttachmentContract 4637// values. 4638type IssueAttachmentCollectionIterator struct { 4639 i int 4640 page IssueAttachmentCollectionPage 4641} 4642 4643// NextWithContext advances to the next value. If there was an error making 4644// the request the iterator does not advance and the error is returned. 4645func (iter *IssueAttachmentCollectionIterator) NextWithContext(ctx context.Context) (err error) { 4646 if tracing.IsEnabled() { 4647 ctx = tracing.StartSpan(ctx, fqdn+"/IssueAttachmentCollectionIterator.NextWithContext") 4648 defer func() { 4649 sc := -1 4650 if iter.Response().Response.Response != nil { 4651 sc = iter.Response().Response.Response.StatusCode 4652 } 4653 tracing.EndSpan(ctx, sc, err) 4654 }() 4655 } 4656 iter.i++ 4657 if iter.i < len(iter.page.Values()) { 4658 return nil 4659 } 4660 err = iter.page.NextWithContext(ctx) 4661 if err != nil { 4662 iter.i-- 4663 return err 4664 } 4665 iter.i = 0 4666 return nil 4667} 4668 4669// Next advances to the next value. If there was an error making 4670// the request the iterator does not advance and the error is returned. 4671// Deprecated: Use NextWithContext() instead. 4672func (iter *IssueAttachmentCollectionIterator) Next() error { 4673 return iter.NextWithContext(context.Background()) 4674} 4675 4676// NotDone returns true if the enumeration should be started or is not yet complete. 4677func (iter IssueAttachmentCollectionIterator) NotDone() bool { 4678 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 4679} 4680 4681// Response returns the raw server response from the last page request. 4682func (iter IssueAttachmentCollectionIterator) Response() IssueAttachmentCollection { 4683 return iter.page.Response() 4684} 4685 4686// Value returns the current value or a zero-initialized value if the 4687// iterator has advanced beyond the end of the collection. 4688func (iter IssueAttachmentCollectionIterator) Value() IssueAttachmentContract { 4689 if !iter.page.NotDone() { 4690 return IssueAttachmentContract{} 4691 } 4692 return iter.page.Values()[iter.i] 4693} 4694 4695// Creates a new instance of the IssueAttachmentCollectionIterator type. 4696func NewIssueAttachmentCollectionIterator(page IssueAttachmentCollectionPage) IssueAttachmentCollectionIterator { 4697 return IssueAttachmentCollectionIterator{page: page} 4698} 4699 4700// IsEmpty returns true if the ListResult contains no values. 4701func (iac IssueAttachmentCollection) IsEmpty() bool { 4702 return iac.Value == nil || len(*iac.Value) == 0 4703} 4704 4705// hasNextLink returns true if the NextLink is not empty. 4706func (iac IssueAttachmentCollection) hasNextLink() bool { 4707 return iac.NextLink != nil && len(*iac.NextLink) != 0 4708} 4709 4710// issueAttachmentCollectionPreparer prepares a request to retrieve the next set of results. 4711// It returns nil if no more results exist. 4712func (iac IssueAttachmentCollection) issueAttachmentCollectionPreparer(ctx context.Context) (*http.Request, error) { 4713 if !iac.hasNextLink() { 4714 return nil, nil 4715 } 4716 return autorest.Prepare((&http.Request{}).WithContext(ctx), 4717 autorest.AsJSON(), 4718 autorest.AsGet(), 4719 autorest.WithBaseURL(to.String(iac.NextLink))) 4720} 4721 4722// IssueAttachmentCollectionPage contains a page of IssueAttachmentContract values. 4723type IssueAttachmentCollectionPage struct { 4724 fn func(context.Context, IssueAttachmentCollection) (IssueAttachmentCollection, error) 4725 iac IssueAttachmentCollection 4726} 4727 4728// NextWithContext advances to the next page of values. If there was an error making 4729// the request the page does not advance and the error is returned. 4730func (page *IssueAttachmentCollectionPage) NextWithContext(ctx context.Context) (err error) { 4731 if tracing.IsEnabled() { 4732 ctx = tracing.StartSpan(ctx, fqdn+"/IssueAttachmentCollectionPage.NextWithContext") 4733 defer func() { 4734 sc := -1 4735 if page.Response().Response.Response != nil { 4736 sc = page.Response().Response.Response.StatusCode 4737 } 4738 tracing.EndSpan(ctx, sc, err) 4739 }() 4740 } 4741 for { 4742 next, err := page.fn(ctx, page.iac) 4743 if err != nil { 4744 return err 4745 } 4746 page.iac = next 4747 if !next.hasNextLink() || !next.IsEmpty() { 4748 break 4749 } 4750 } 4751 return nil 4752} 4753 4754// Next advances to the next page of values. If there was an error making 4755// the request the page does not advance and the error is returned. 4756// Deprecated: Use NextWithContext() instead. 4757func (page *IssueAttachmentCollectionPage) Next() error { 4758 return page.NextWithContext(context.Background()) 4759} 4760 4761// NotDone returns true if the page enumeration should be started or is not yet complete. 4762func (page IssueAttachmentCollectionPage) NotDone() bool { 4763 return !page.iac.IsEmpty() 4764} 4765 4766// Response returns the raw server response from the last page request. 4767func (page IssueAttachmentCollectionPage) Response() IssueAttachmentCollection { 4768 return page.iac 4769} 4770 4771// Values returns the slice of values for the current page or nil if there are no values. 4772func (page IssueAttachmentCollectionPage) Values() []IssueAttachmentContract { 4773 if page.iac.IsEmpty() { 4774 return nil 4775 } 4776 return *page.iac.Value 4777} 4778 4779// Creates a new instance of the IssueAttachmentCollectionPage type. 4780func NewIssueAttachmentCollectionPage(cur IssueAttachmentCollection, getNextPage func(context.Context, IssueAttachmentCollection) (IssueAttachmentCollection, error)) IssueAttachmentCollectionPage { 4781 return IssueAttachmentCollectionPage{ 4782 fn: getNextPage, 4783 iac: cur, 4784 } 4785} 4786 4787// IssueAttachmentContract issue Attachment Contract details. 4788type IssueAttachmentContract struct { 4789 autorest.Response `json:"-"` 4790 // IssueAttachmentContractProperties - Properties of the Issue Attachment. 4791 *IssueAttachmentContractProperties `json:"properties,omitempty"` 4792 // ID - READ-ONLY; Resource ID. 4793 ID *string `json:"id,omitempty"` 4794 // Name - READ-ONLY; Resource name. 4795 Name *string `json:"name,omitempty"` 4796 // Type - READ-ONLY; Resource type for API Management resource. 4797 Type *string `json:"type,omitempty"` 4798} 4799 4800// MarshalJSON is the custom marshaler for IssueAttachmentContract. 4801func (iac IssueAttachmentContract) MarshalJSON() ([]byte, error) { 4802 objectMap := make(map[string]interface{}) 4803 if iac.IssueAttachmentContractProperties != nil { 4804 objectMap["properties"] = iac.IssueAttachmentContractProperties 4805 } 4806 return json.Marshal(objectMap) 4807} 4808 4809// UnmarshalJSON is the custom unmarshaler for IssueAttachmentContract struct. 4810func (iac *IssueAttachmentContract) UnmarshalJSON(body []byte) error { 4811 var m map[string]*json.RawMessage 4812 err := json.Unmarshal(body, &m) 4813 if err != nil { 4814 return err 4815 } 4816 for k, v := range m { 4817 switch k { 4818 case "properties": 4819 if v != nil { 4820 var issueAttachmentContractProperties IssueAttachmentContractProperties 4821 err = json.Unmarshal(*v, &issueAttachmentContractProperties) 4822 if err != nil { 4823 return err 4824 } 4825 iac.IssueAttachmentContractProperties = &issueAttachmentContractProperties 4826 } 4827 case "id": 4828 if v != nil { 4829 var ID string 4830 err = json.Unmarshal(*v, &ID) 4831 if err != nil { 4832 return err 4833 } 4834 iac.ID = &ID 4835 } 4836 case "name": 4837 if v != nil { 4838 var name string 4839 err = json.Unmarshal(*v, &name) 4840 if err != nil { 4841 return err 4842 } 4843 iac.Name = &name 4844 } 4845 case "type": 4846 if v != nil { 4847 var typeVar string 4848 err = json.Unmarshal(*v, &typeVar) 4849 if err != nil { 4850 return err 4851 } 4852 iac.Type = &typeVar 4853 } 4854 } 4855 } 4856 4857 return nil 4858} 4859 4860// IssueAttachmentContractProperties issue Attachment contract Properties. 4861type IssueAttachmentContractProperties struct { 4862 // Title - Filename by which the binary data will be saved. 4863 Title *string `json:"title,omitempty"` 4864 // 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. 4865 ContentFormat *string `json:"contentFormat,omitempty"` 4866 // Content - An HTTP link or Base64-encoded binary data. 4867 Content *string `json:"content,omitempty"` 4868} 4869 4870// IssueCollection paged Issue list representation. 4871type IssueCollection struct { 4872 autorest.Response `json:"-"` 4873 // Value - READ-ONLY; Issue values. 4874 Value *[]IssueContract `json:"value,omitempty"` 4875 // NextLink - READ-ONLY; Next page link if any. 4876 NextLink *string `json:"nextLink,omitempty"` 4877} 4878 4879// MarshalJSON is the custom marshaler for IssueCollection. 4880func (ic IssueCollection) MarshalJSON() ([]byte, error) { 4881 objectMap := make(map[string]interface{}) 4882 return json.Marshal(objectMap) 4883} 4884 4885// IssueCollectionIterator provides access to a complete listing of IssueContract values. 4886type IssueCollectionIterator struct { 4887 i int 4888 page IssueCollectionPage 4889} 4890 4891// NextWithContext advances to the next value. If there was an error making 4892// the request the iterator does not advance and the error is returned. 4893func (iter *IssueCollectionIterator) NextWithContext(ctx context.Context) (err error) { 4894 if tracing.IsEnabled() { 4895 ctx = tracing.StartSpan(ctx, fqdn+"/IssueCollectionIterator.NextWithContext") 4896 defer func() { 4897 sc := -1 4898 if iter.Response().Response.Response != nil { 4899 sc = iter.Response().Response.Response.StatusCode 4900 } 4901 tracing.EndSpan(ctx, sc, err) 4902 }() 4903 } 4904 iter.i++ 4905 if iter.i < len(iter.page.Values()) { 4906 return nil 4907 } 4908 err = iter.page.NextWithContext(ctx) 4909 if err != nil { 4910 iter.i-- 4911 return err 4912 } 4913 iter.i = 0 4914 return nil 4915} 4916 4917// Next advances to the next value. If there was an error making 4918// the request the iterator does not advance and the error is returned. 4919// Deprecated: Use NextWithContext() instead. 4920func (iter *IssueCollectionIterator) Next() error { 4921 return iter.NextWithContext(context.Background()) 4922} 4923 4924// NotDone returns true if the enumeration should be started or is not yet complete. 4925func (iter IssueCollectionIterator) NotDone() bool { 4926 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 4927} 4928 4929// Response returns the raw server response from the last page request. 4930func (iter IssueCollectionIterator) Response() IssueCollection { 4931 return iter.page.Response() 4932} 4933 4934// Value returns the current value or a zero-initialized value if the 4935// iterator has advanced beyond the end of the collection. 4936func (iter IssueCollectionIterator) Value() IssueContract { 4937 if !iter.page.NotDone() { 4938 return IssueContract{} 4939 } 4940 return iter.page.Values()[iter.i] 4941} 4942 4943// Creates a new instance of the IssueCollectionIterator type. 4944func NewIssueCollectionIterator(page IssueCollectionPage) IssueCollectionIterator { 4945 return IssueCollectionIterator{page: page} 4946} 4947 4948// IsEmpty returns true if the ListResult contains no values. 4949func (ic IssueCollection) IsEmpty() bool { 4950 return ic.Value == nil || len(*ic.Value) == 0 4951} 4952 4953// hasNextLink returns true if the NextLink is not empty. 4954func (ic IssueCollection) hasNextLink() bool { 4955 return ic.NextLink != nil && len(*ic.NextLink) != 0 4956} 4957 4958// issueCollectionPreparer prepares a request to retrieve the next set of results. 4959// It returns nil if no more results exist. 4960func (ic IssueCollection) issueCollectionPreparer(ctx context.Context) (*http.Request, error) { 4961 if !ic.hasNextLink() { 4962 return nil, nil 4963 } 4964 return autorest.Prepare((&http.Request{}).WithContext(ctx), 4965 autorest.AsJSON(), 4966 autorest.AsGet(), 4967 autorest.WithBaseURL(to.String(ic.NextLink))) 4968} 4969 4970// IssueCollectionPage contains a page of IssueContract values. 4971type IssueCollectionPage struct { 4972 fn func(context.Context, IssueCollection) (IssueCollection, error) 4973 ic IssueCollection 4974} 4975 4976// NextWithContext advances to the next page of values. If there was an error making 4977// the request the page does not advance and the error is returned. 4978func (page *IssueCollectionPage) NextWithContext(ctx context.Context) (err error) { 4979 if tracing.IsEnabled() { 4980 ctx = tracing.StartSpan(ctx, fqdn+"/IssueCollectionPage.NextWithContext") 4981 defer func() { 4982 sc := -1 4983 if page.Response().Response.Response != nil { 4984 sc = page.Response().Response.Response.StatusCode 4985 } 4986 tracing.EndSpan(ctx, sc, err) 4987 }() 4988 } 4989 for { 4990 next, err := page.fn(ctx, page.ic) 4991 if err != nil { 4992 return err 4993 } 4994 page.ic = next 4995 if !next.hasNextLink() || !next.IsEmpty() { 4996 break 4997 } 4998 } 4999 return nil 5000} 5001 5002// Next advances to the next page of values. If there was an error making 5003// the request the page does not advance and the error is returned. 5004// Deprecated: Use NextWithContext() instead. 5005func (page *IssueCollectionPage) Next() error { 5006 return page.NextWithContext(context.Background()) 5007} 5008 5009// NotDone returns true if the page enumeration should be started or is not yet complete. 5010func (page IssueCollectionPage) NotDone() bool { 5011 return !page.ic.IsEmpty() 5012} 5013 5014// Response returns the raw server response from the last page request. 5015func (page IssueCollectionPage) Response() IssueCollection { 5016 return page.ic 5017} 5018 5019// Values returns the slice of values for the current page or nil if there are no values. 5020func (page IssueCollectionPage) Values() []IssueContract { 5021 if page.ic.IsEmpty() { 5022 return nil 5023 } 5024 return *page.ic.Value 5025} 5026 5027// Creates a new instance of the IssueCollectionPage type. 5028func NewIssueCollectionPage(cur IssueCollection, getNextPage func(context.Context, IssueCollection) (IssueCollection, error)) IssueCollectionPage { 5029 return IssueCollectionPage{ 5030 fn: getNextPage, 5031 ic: cur, 5032 } 5033} 5034 5035// IssueCommentCollection paged Issue Comment list representation. 5036type IssueCommentCollection struct { 5037 autorest.Response `json:"-"` 5038 // Value - READ-ONLY; Issue Comment values. 5039 Value *[]IssueCommentContract `json:"value,omitempty"` 5040 // NextLink - READ-ONLY; Next page link if any. 5041 NextLink *string `json:"nextLink,omitempty"` 5042} 5043 5044// MarshalJSON is the custom marshaler for IssueCommentCollection. 5045func (icc IssueCommentCollection) MarshalJSON() ([]byte, error) { 5046 objectMap := make(map[string]interface{}) 5047 return json.Marshal(objectMap) 5048} 5049 5050// IssueCommentCollectionIterator provides access to a complete listing of IssueCommentContract values. 5051type IssueCommentCollectionIterator struct { 5052 i int 5053 page IssueCommentCollectionPage 5054} 5055 5056// NextWithContext advances to the next value. If there was an error making 5057// the request the iterator does not advance and the error is returned. 5058func (iter *IssueCommentCollectionIterator) NextWithContext(ctx context.Context) (err error) { 5059 if tracing.IsEnabled() { 5060 ctx = tracing.StartSpan(ctx, fqdn+"/IssueCommentCollectionIterator.NextWithContext") 5061 defer func() { 5062 sc := -1 5063 if iter.Response().Response.Response != nil { 5064 sc = iter.Response().Response.Response.StatusCode 5065 } 5066 tracing.EndSpan(ctx, sc, err) 5067 }() 5068 } 5069 iter.i++ 5070 if iter.i < len(iter.page.Values()) { 5071 return nil 5072 } 5073 err = iter.page.NextWithContext(ctx) 5074 if err != nil { 5075 iter.i-- 5076 return err 5077 } 5078 iter.i = 0 5079 return nil 5080} 5081 5082// Next advances to the next value. If there was an error making 5083// the request the iterator does not advance and the error is returned. 5084// Deprecated: Use NextWithContext() instead. 5085func (iter *IssueCommentCollectionIterator) Next() error { 5086 return iter.NextWithContext(context.Background()) 5087} 5088 5089// NotDone returns true if the enumeration should be started or is not yet complete. 5090func (iter IssueCommentCollectionIterator) NotDone() bool { 5091 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 5092} 5093 5094// Response returns the raw server response from the last page request. 5095func (iter IssueCommentCollectionIterator) Response() IssueCommentCollection { 5096 return iter.page.Response() 5097} 5098 5099// Value returns the current value or a zero-initialized value if the 5100// iterator has advanced beyond the end of the collection. 5101func (iter IssueCommentCollectionIterator) Value() IssueCommentContract { 5102 if !iter.page.NotDone() { 5103 return IssueCommentContract{} 5104 } 5105 return iter.page.Values()[iter.i] 5106} 5107 5108// Creates a new instance of the IssueCommentCollectionIterator type. 5109func NewIssueCommentCollectionIterator(page IssueCommentCollectionPage) IssueCommentCollectionIterator { 5110 return IssueCommentCollectionIterator{page: page} 5111} 5112 5113// IsEmpty returns true if the ListResult contains no values. 5114func (icc IssueCommentCollection) IsEmpty() bool { 5115 return icc.Value == nil || len(*icc.Value) == 0 5116} 5117 5118// hasNextLink returns true if the NextLink is not empty. 5119func (icc IssueCommentCollection) hasNextLink() bool { 5120 return icc.NextLink != nil && len(*icc.NextLink) != 0 5121} 5122 5123// issueCommentCollectionPreparer prepares a request to retrieve the next set of results. 5124// It returns nil if no more results exist. 5125func (icc IssueCommentCollection) issueCommentCollectionPreparer(ctx context.Context) (*http.Request, error) { 5126 if !icc.hasNextLink() { 5127 return nil, nil 5128 } 5129 return autorest.Prepare((&http.Request{}).WithContext(ctx), 5130 autorest.AsJSON(), 5131 autorest.AsGet(), 5132 autorest.WithBaseURL(to.String(icc.NextLink))) 5133} 5134 5135// IssueCommentCollectionPage contains a page of IssueCommentContract values. 5136type IssueCommentCollectionPage struct { 5137 fn func(context.Context, IssueCommentCollection) (IssueCommentCollection, error) 5138 icc IssueCommentCollection 5139} 5140 5141// NextWithContext advances to the next page of values. If there was an error making 5142// the request the page does not advance and the error is returned. 5143func (page *IssueCommentCollectionPage) NextWithContext(ctx context.Context) (err error) { 5144 if tracing.IsEnabled() { 5145 ctx = tracing.StartSpan(ctx, fqdn+"/IssueCommentCollectionPage.NextWithContext") 5146 defer func() { 5147 sc := -1 5148 if page.Response().Response.Response != nil { 5149 sc = page.Response().Response.Response.StatusCode 5150 } 5151 tracing.EndSpan(ctx, sc, err) 5152 }() 5153 } 5154 for { 5155 next, err := page.fn(ctx, page.icc) 5156 if err != nil { 5157 return err 5158 } 5159 page.icc = next 5160 if !next.hasNextLink() || !next.IsEmpty() { 5161 break 5162 } 5163 } 5164 return nil 5165} 5166 5167// Next advances to the next page of values. If there was an error making 5168// the request the page does not advance and the error is returned. 5169// Deprecated: Use NextWithContext() instead. 5170func (page *IssueCommentCollectionPage) Next() error { 5171 return page.NextWithContext(context.Background()) 5172} 5173 5174// NotDone returns true if the page enumeration should be started or is not yet complete. 5175func (page IssueCommentCollectionPage) NotDone() bool { 5176 return !page.icc.IsEmpty() 5177} 5178 5179// Response returns the raw server response from the last page request. 5180func (page IssueCommentCollectionPage) Response() IssueCommentCollection { 5181 return page.icc 5182} 5183 5184// Values returns the slice of values for the current page or nil if there are no values. 5185func (page IssueCommentCollectionPage) Values() []IssueCommentContract { 5186 if page.icc.IsEmpty() { 5187 return nil 5188 } 5189 return *page.icc.Value 5190} 5191 5192// Creates a new instance of the IssueCommentCollectionPage type. 5193func NewIssueCommentCollectionPage(cur IssueCommentCollection, getNextPage func(context.Context, IssueCommentCollection) (IssueCommentCollection, error)) IssueCommentCollectionPage { 5194 return IssueCommentCollectionPage{ 5195 fn: getNextPage, 5196 icc: cur, 5197 } 5198} 5199 5200// IssueCommentContract issue Comment Contract details. 5201type IssueCommentContract struct { 5202 autorest.Response `json:"-"` 5203 // IssueCommentContractProperties - Properties of the Issue Comment. 5204 *IssueCommentContractProperties `json:"properties,omitempty"` 5205 // ID - READ-ONLY; Resource ID. 5206 ID *string `json:"id,omitempty"` 5207 // Name - READ-ONLY; Resource name. 5208 Name *string `json:"name,omitempty"` 5209 // Type - READ-ONLY; Resource type for API Management resource. 5210 Type *string `json:"type,omitempty"` 5211} 5212 5213// MarshalJSON is the custom marshaler for IssueCommentContract. 5214func (icc IssueCommentContract) MarshalJSON() ([]byte, error) { 5215 objectMap := make(map[string]interface{}) 5216 if icc.IssueCommentContractProperties != nil { 5217 objectMap["properties"] = icc.IssueCommentContractProperties 5218 } 5219 return json.Marshal(objectMap) 5220} 5221 5222// UnmarshalJSON is the custom unmarshaler for IssueCommentContract struct. 5223func (icc *IssueCommentContract) UnmarshalJSON(body []byte) error { 5224 var m map[string]*json.RawMessage 5225 err := json.Unmarshal(body, &m) 5226 if err != nil { 5227 return err 5228 } 5229 for k, v := range m { 5230 switch k { 5231 case "properties": 5232 if v != nil { 5233 var issueCommentContractProperties IssueCommentContractProperties 5234 err = json.Unmarshal(*v, &issueCommentContractProperties) 5235 if err != nil { 5236 return err 5237 } 5238 icc.IssueCommentContractProperties = &issueCommentContractProperties 5239 } 5240 case "id": 5241 if v != nil { 5242 var ID string 5243 err = json.Unmarshal(*v, &ID) 5244 if err != nil { 5245 return err 5246 } 5247 icc.ID = &ID 5248 } 5249 case "name": 5250 if v != nil { 5251 var name string 5252 err = json.Unmarshal(*v, &name) 5253 if err != nil { 5254 return err 5255 } 5256 icc.Name = &name 5257 } 5258 case "type": 5259 if v != nil { 5260 var typeVar string 5261 err = json.Unmarshal(*v, &typeVar) 5262 if err != nil { 5263 return err 5264 } 5265 icc.Type = &typeVar 5266 } 5267 } 5268 } 5269 5270 return nil 5271} 5272 5273// IssueCommentContractProperties issue Comment contract Properties. 5274type IssueCommentContractProperties struct { 5275 // Text - Comment text. 5276 Text *string `json:"text,omitempty"` 5277 // CreatedDate - Date and time when the comment was created. 5278 CreatedDate *date.Time `json:"createdDate,omitempty"` 5279 // UserID - A resource identifier for the user who left the comment. 5280 UserID *string `json:"userId,omitempty"` 5281} 5282 5283// IssueContract issue Contract details. 5284type IssueContract struct { 5285 autorest.Response `json:"-"` 5286 // IssueContractProperties - Properties of the Issue. 5287 *IssueContractProperties `json:"properties,omitempty"` 5288 // ID - READ-ONLY; Resource ID. 5289 ID *string `json:"id,omitempty"` 5290 // Name - READ-ONLY; Resource name. 5291 Name *string `json:"name,omitempty"` 5292 // Type - READ-ONLY; Resource type for API Management resource. 5293 Type *string `json:"type,omitempty"` 5294} 5295 5296// MarshalJSON is the custom marshaler for IssueContract. 5297func (ic IssueContract) MarshalJSON() ([]byte, error) { 5298 objectMap := make(map[string]interface{}) 5299 if ic.IssueContractProperties != nil { 5300 objectMap["properties"] = ic.IssueContractProperties 5301 } 5302 return json.Marshal(objectMap) 5303} 5304 5305// UnmarshalJSON is the custom unmarshaler for IssueContract struct. 5306func (ic *IssueContract) UnmarshalJSON(body []byte) error { 5307 var m map[string]*json.RawMessage 5308 err := json.Unmarshal(body, &m) 5309 if err != nil { 5310 return err 5311 } 5312 for k, v := range m { 5313 switch k { 5314 case "properties": 5315 if v != nil { 5316 var issueContractProperties IssueContractProperties 5317 err = json.Unmarshal(*v, &issueContractProperties) 5318 if err != nil { 5319 return err 5320 } 5321 ic.IssueContractProperties = &issueContractProperties 5322 } 5323 case "id": 5324 if v != nil { 5325 var ID string 5326 err = json.Unmarshal(*v, &ID) 5327 if err != nil { 5328 return err 5329 } 5330 ic.ID = &ID 5331 } 5332 case "name": 5333 if v != nil { 5334 var name string 5335 err = json.Unmarshal(*v, &name) 5336 if err != nil { 5337 return err 5338 } 5339 ic.Name = &name 5340 } 5341 case "type": 5342 if v != nil { 5343 var typeVar string 5344 err = json.Unmarshal(*v, &typeVar) 5345 if err != nil { 5346 return err 5347 } 5348 ic.Type = &typeVar 5349 } 5350 } 5351 } 5352 5353 return nil 5354} 5355 5356// IssueContractBaseProperties issue contract Base Properties. 5357type IssueContractBaseProperties struct { 5358 // CreatedDate - Date and time when the issue was created. 5359 CreatedDate *date.Time `json:"createdDate,omitempty"` 5360 // State - Status of the issue. Possible values include: 'Proposed', 'Open', 'Removed', 'Resolved', 'Closed' 5361 State State `json:"state,omitempty"` 5362 // APIID - A resource identifier for the API the issue was created for. 5363 APIID *string `json:"apiId,omitempty"` 5364} 5365 5366// IssueContractProperties issue contract Properties. 5367type IssueContractProperties struct { 5368 // Title - The issue title. 5369 Title *string `json:"title,omitempty"` 5370 // Description - Text describing the issue. 5371 Description *string `json:"description,omitempty"` 5372 // UserID - A resource identifier for the user created the issue. 5373 UserID *string `json:"userId,omitempty"` 5374 // CreatedDate - Date and time when the issue was created. 5375 CreatedDate *date.Time `json:"createdDate,omitempty"` 5376 // State - Status of the issue. Possible values include: 'Proposed', 'Open', 'Removed', 'Resolved', 'Closed' 5377 State State `json:"state,omitempty"` 5378 // APIID - A resource identifier for the API the issue was created for. 5379 APIID *string `json:"apiId,omitempty"` 5380} 5381 5382// IssueUpdateContract issue update Parameters. 5383type IssueUpdateContract struct { 5384 // IssueUpdateContractProperties - Issue entity Update contract properties. 5385 *IssueUpdateContractProperties `json:"properties,omitempty"` 5386} 5387 5388// MarshalJSON is the custom marshaler for IssueUpdateContract. 5389func (iuc IssueUpdateContract) MarshalJSON() ([]byte, error) { 5390 objectMap := make(map[string]interface{}) 5391 if iuc.IssueUpdateContractProperties != nil { 5392 objectMap["properties"] = iuc.IssueUpdateContractProperties 5393 } 5394 return json.Marshal(objectMap) 5395} 5396 5397// UnmarshalJSON is the custom unmarshaler for IssueUpdateContract struct. 5398func (iuc *IssueUpdateContract) UnmarshalJSON(body []byte) error { 5399 var m map[string]*json.RawMessage 5400 err := json.Unmarshal(body, &m) 5401 if err != nil { 5402 return err 5403 } 5404 for k, v := range m { 5405 switch k { 5406 case "properties": 5407 if v != nil { 5408 var issueUpdateContractProperties IssueUpdateContractProperties 5409 err = json.Unmarshal(*v, &issueUpdateContractProperties) 5410 if err != nil { 5411 return err 5412 } 5413 iuc.IssueUpdateContractProperties = &issueUpdateContractProperties 5414 } 5415 } 5416 } 5417 5418 return nil 5419} 5420 5421// IssueUpdateContractProperties issue contract Update Properties. 5422type IssueUpdateContractProperties struct { 5423 // Title - The issue title. 5424 Title *string `json:"title,omitempty"` 5425 // Description - Text describing the issue. 5426 Description *string `json:"description,omitempty"` 5427 // UserID - A resource identifier for the user created the issue. 5428 UserID *string `json:"userId,omitempty"` 5429 // CreatedDate - Date and time when the issue was created. 5430 CreatedDate *date.Time `json:"createdDate,omitempty"` 5431 // State - Status of the issue. Possible values include: 'Proposed', 'Open', 'Removed', 'Resolved', 'Closed' 5432 State State `json:"state,omitempty"` 5433 // APIID - A resource identifier for the API the issue was created for. 5434 APIID *string `json:"apiId,omitempty"` 5435} 5436 5437// ListNetworkStatusContractByLocation ... 5438type ListNetworkStatusContractByLocation struct { 5439 autorest.Response `json:"-"` 5440 Value *[]NetworkStatusContractByLocation `json:"value,omitempty"` 5441} 5442 5443// LoggerCollection paged Logger list representation. 5444type LoggerCollection struct { 5445 autorest.Response `json:"-"` 5446 // Value - Logger values. 5447 Value *[]LoggerContract `json:"value,omitempty"` 5448 // Count - Total record count number across all pages. 5449 Count *int64 `json:"count,omitempty"` 5450 // NextLink - Next page link if any. 5451 NextLink *string `json:"nextLink,omitempty"` 5452} 5453 5454// LoggerCollectionIterator provides access to a complete listing of LoggerContract values. 5455type LoggerCollectionIterator struct { 5456 i int 5457 page LoggerCollectionPage 5458} 5459 5460// NextWithContext advances to the next value. If there was an error making 5461// the request the iterator does not advance and the error is returned. 5462func (iter *LoggerCollectionIterator) NextWithContext(ctx context.Context) (err error) { 5463 if tracing.IsEnabled() { 5464 ctx = tracing.StartSpan(ctx, fqdn+"/LoggerCollectionIterator.NextWithContext") 5465 defer func() { 5466 sc := -1 5467 if iter.Response().Response.Response != nil { 5468 sc = iter.Response().Response.Response.StatusCode 5469 } 5470 tracing.EndSpan(ctx, sc, err) 5471 }() 5472 } 5473 iter.i++ 5474 if iter.i < len(iter.page.Values()) { 5475 return nil 5476 } 5477 err = iter.page.NextWithContext(ctx) 5478 if err != nil { 5479 iter.i-- 5480 return err 5481 } 5482 iter.i = 0 5483 return nil 5484} 5485 5486// Next advances to the next value. If there was an error making 5487// the request the iterator does not advance and the error is returned. 5488// Deprecated: Use NextWithContext() instead. 5489func (iter *LoggerCollectionIterator) Next() error { 5490 return iter.NextWithContext(context.Background()) 5491} 5492 5493// NotDone returns true if the enumeration should be started or is not yet complete. 5494func (iter LoggerCollectionIterator) NotDone() bool { 5495 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 5496} 5497 5498// Response returns the raw server response from the last page request. 5499func (iter LoggerCollectionIterator) Response() LoggerCollection { 5500 return iter.page.Response() 5501} 5502 5503// Value returns the current value or a zero-initialized value if the 5504// iterator has advanced beyond the end of the collection. 5505func (iter LoggerCollectionIterator) Value() LoggerContract { 5506 if !iter.page.NotDone() { 5507 return LoggerContract{} 5508 } 5509 return iter.page.Values()[iter.i] 5510} 5511 5512// Creates a new instance of the LoggerCollectionIterator type. 5513func NewLoggerCollectionIterator(page LoggerCollectionPage) LoggerCollectionIterator { 5514 return LoggerCollectionIterator{page: page} 5515} 5516 5517// IsEmpty returns true if the ListResult contains no values. 5518func (lc LoggerCollection) IsEmpty() bool { 5519 return lc.Value == nil || len(*lc.Value) == 0 5520} 5521 5522// hasNextLink returns true if the NextLink is not empty. 5523func (lc LoggerCollection) hasNextLink() bool { 5524 return lc.NextLink != nil && len(*lc.NextLink) != 0 5525} 5526 5527// loggerCollectionPreparer prepares a request to retrieve the next set of results. 5528// It returns nil if no more results exist. 5529func (lc LoggerCollection) loggerCollectionPreparer(ctx context.Context) (*http.Request, error) { 5530 if !lc.hasNextLink() { 5531 return nil, nil 5532 } 5533 return autorest.Prepare((&http.Request{}).WithContext(ctx), 5534 autorest.AsJSON(), 5535 autorest.AsGet(), 5536 autorest.WithBaseURL(to.String(lc.NextLink))) 5537} 5538 5539// LoggerCollectionPage contains a page of LoggerContract values. 5540type LoggerCollectionPage struct { 5541 fn func(context.Context, LoggerCollection) (LoggerCollection, error) 5542 lc LoggerCollection 5543} 5544 5545// NextWithContext advances to the next page of values. If there was an error making 5546// the request the page does not advance and the error is returned. 5547func (page *LoggerCollectionPage) NextWithContext(ctx context.Context) (err error) { 5548 if tracing.IsEnabled() { 5549 ctx = tracing.StartSpan(ctx, fqdn+"/LoggerCollectionPage.NextWithContext") 5550 defer func() { 5551 sc := -1 5552 if page.Response().Response.Response != nil { 5553 sc = page.Response().Response.Response.StatusCode 5554 } 5555 tracing.EndSpan(ctx, sc, err) 5556 }() 5557 } 5558 for { 5559 next, err := page.fn(ctx, page.lc) 5560 if err != nil { 5561 return err 5562 } 5563 page.lc = next 5564 if !next.hasNextLink() || !next.IsEmpty() { 5565 break 5566 } 5567 } 5568 return nil 5569} 5570 5571// Next advances to the next page of values. If there was an error making 5572// the request the page does not advance and the error is returned. 5573// Deprecated: Use NextWithContext() instead. 5574func (page *LoggerCollectionPage) Next() error { 5575 return page.NextWithContext(context.Background()) 5576} 5577 5578// NotDone returns true if the page enumeration should be started or is not yet complete. 5579func (page LoggerCollectionPage) NotDone() bool { 5580 return !page.lc.IsEmpty() 5581} 5582 5583// Response returns the raw server response from the last page request. 5584func (page LoggerCollectionPage) Response() LoggerCollection { 5585 return page.lc 5586} 5587 5588// Values returns the slice of values for the current page or nil if there are no values. 5589func (page LoggerCollectionPage) Values() []LoggerContract { 5590 if page.lc.IsEmpty() { 5591 return nil 5592 } 5593 return *page.lc.Value 5594} 5595 5596// Creates a new instance of the LoggerCollectionPage type. 5597func NewLoggerCollectionPage(cur LoggerCollection, getNextPage func(context.Context, LoggerCollection) (LoggerCollection, error)) LoggerCollectionPage { 5598 return LoggerCollectionPage{ 5599 fn: getNextPage, 5600 lc: cur, 5601 } 5602} 5603 5604// LoggerContract logger details. 5605type LoggerContract struct { 5606 autorest.Response `json:"-"` 5607 // LoggerContractProperties - Logger entity contract properties. 5608 *LoggerContractProperties `json:"properties,omitempty"` 5609 // ID - READ-ONLY; Resource ID. 5610 ID *string `json:"id,omitempty"` 5611 // Name - READ-ONLY; Resource name. 5612 Name *string `json:"name,omitempty"` 5613 // Type - READ-ONLY; Resource type for API Management resource. 5614 Type *string `json:"type,omitempty"` 5615} 5616 5617// MarshalJSON is the custom marshaler for LoggerContract. 5618func (lc LoggerContract) MarshalJSON() ([]byte, error) { 5619 objectMap := make(map[string]interface{}) 5620 if lc.LoggerContractProperties != nil { 5621 objectMap["properties"] = lc.LoggerContractProperties 5622 } 5623 return json.Marshal(objectMap) 5624} 5625 5626// UnmarshalJSON is the custom unmarshaler for LoggerContract struct. 5627func (lc *LoggerContract) UnmarshalJSON(body []byte) error { 5628 var m map[string]*json.RawMessage 5629 err := json.Unmarshal(body, &m) 5630 if err != nil { 5631 return err 5632 } 5633 for k, v := range m { 5634 switch k { 5635 case "properties": 5636 if v != nil { 5637 var loggerContractProperties LoggerContractProperties 5638 err = json.Unmarshal(*v, &loggerContractProperties) 5639 if err != nil { 5640 return err 5641 } 5642 lc.LoggerContractProperties = &loggerContractProperties 5643 } 5644 case "id": 5645 if v != nil { 5646 var ID string 5647 err = json.Unmarshal(*v, &ID) 5648 if err != nil { 5649 return err 5650 } 5651 lc.ID = &ID 5652 } 5653 case "name": 5654 if v != nil { 5655 var name string 5656 err = json.Unmarshal(*v, &name) 5657 if err != nil { 5658 return err 5659 } 5660 lc.Name = &name 5661 } 5662 case "type": 5663 if v != nil { 5664 var typeVar string 5665 err = json.Unmarshal(*v, &typeVar) 5666 if err != nil { 5667 return err 5668 } 5669 lc.Type = &typeVar 5670 } 5671 } 5672 } 5673 5674 return nil 5675} 5676 5677// LoggerContractProperties the Logger entity in API Management represents an event sink that you can use 5678// to log API Management events. Currently the Logger entity supports logging API Management events to 5679// Azure Event Hubs. 5680type LoggerContractProperties struct { 5681 // LoggerType - Logger type. Possible values include: 'AzureEventHub', 'ApplicationInsights' 5682 LoggerType LoggerType `json:"loggerType,omitempty"` 5683 // Description - Logger description. 5684 Description *string `json:"description,omitempty"` 5685 // Credentials - The name and SendRule connection string of the event hub for azureEventHub logger. 5686 // Instrumentation key for applicationInsights logger. 5687 Credentials map[string]*string `json:"credentials"` 5688 // IsBuffered - Whether records are buffered in the logger before publishing. Default is assumed to be true. 5689 IsBuffered *bool `json:"isBuffered,omitempty"` 5690 // ResourceID - Azure Resource Id of a log target (either Azure Event Hub resource or Azure Application Insights resource). 5691 ResourceID *string `json:"resourceId,omitempty"` 5692} 5693 5694// MarshalJSON is the custom marshaler for LoggerContractProperties. 5695func (lcp LoggerContractProperties) MarshalJSON() ([]byte, error) { 5696 objectMap := make(map[string]interface{}) 5697 if lcp.LoggerType != "" { 5698 objectMap["loggerType"] = lcp.LoggerType 5699 } 5700 if lcp.Description != nil { 5701 objectMap["description"] = lcp.Description 5702 } 5703 if lcp.Credentials != nil { 5704 objectMap["credentials"] = lcp.Credentials 5705 } 5706 if lcp.IsBuffered != nil { 5707 objectMap["isBuffered"] = lcp.IsBuffered 5708 } 5709 if lcp.ResourceID != nil { 5710 objectMap["resourceId"] = lcp.ResourceID 5711 } 5712 return json.Marshal(objectMap) 5713} 5714 5715// LoggerUpdateContract logger update contract. 5716type LoggerUpdateContract struct { 5717 // LoggerUpdateParameters - Logger entity update contract properties. 5718 *LoggerUpdateParameters `json:"properties,omitempty"` 5719} 5720 5721// MarshalJSON is the custom marshaler for LoggerUpdateContract. 5722func (luc LoggerUpdateContract) MarshalJSON() ([]byte, error) { 5723 objectMap := make(map[string]interface{}) 5724 if luc.LoggerUpdateParameters != nil { 5725 objectMap["properties"] = luc.LoggerUpdateParameters 5726 } 5727 return json.Marshal(objectMap) 5728} 5729 5730// UnmarshalJSON is the custom unmarshaler for LoggerUpdateContract struct. 5731func (luc *LoggerUpdateContract) UnmarshalJSON(body []byte) error { 5732 var m map[string]*json.RawMessage 5733 err := json.Unmarshal(body, &m) 5734 if err != nil { 5735 return err 5736 } 5737 for k, v := range m { 5738 switch k { 5739 case "properties": 5740 if v != nil { 5741 var loggerUpdateParameters LoggerUpdateParameters 5742 err = json.Unmarshal(*v, &loggerUpdateParameters) 5743 if err != nil { 5744 return err 5745 } 5746 luc.LoggerUpdateParameters = &loggerUpdateParameters 5747 } 5748 } 5749 } 5750 5751 return nil 5752} 5753 5754// LoggerUpdateParameters parameters supplied to the Update Logger operation. 5755type LoggerUpdateParameters struct { 5756 // LoggerType - Logger type. Possible values include: 'AzureEventHub', 'ApplicationInsights' 5757 LoggerType LoggerType `json:"loggerType,omitempty"` 5758 // Description - Logger description. 5759 Description *string `json:"description,omitempty"` 5760 // Credentials - Logger credentials. 5761 Credentials map[string]*string `json:"credentials"` 5762 // IsBuffered - Whether records are buffered in the logger before publishing. Default is assumed to be true. 5763 IsBuffered *bool `json:"isBuffered,omitempty"` 5764} 5765 5766// MarshalJSON is the custom marshaler for LoggerUpdateParameters. 5767func (lup LoggerUpdateParameters) MarshalJSON() ([]byte, error) { 5768 objectMap := make(map[string]interface{}) 5769 if lup.LoggerType != "" { 5770 objectMap["loggerType"] = lup.LoggerType 5771 } 5772 if lup.Description != nil { 5773 objectMap["description"] = lup.Description 5774 } 5775 if lup.Credentials != nil { 5776 objectMap["credentials"] = lup.Credentials 5777 } 5778 if lup.IsBuffered != nil { 5779 objectMap["isBuffered"] = lup.IsBuffered 5780 } 5781 return json.Marshal(objectMap) 5782} 5783 5784// NetworkStatusContract network Status details. 5785type NetworkStatusContract struct { 5786 autorest.Response `json:"-"` 5787 // DNSServers - Gets the list of DNS servers IPV4 addresses. 5788 DNSServers *[]string `json:"dnsServers,omitempty"` 5789 // ConnectivityStatus - Gets the list of Connectivity Status to the Resources on which the service depends upon. 5790 ConnectivityStatus *[]ConnectivityStatusContract `json:"connectivityStatus,omitempty"` 5791} 5792 5793// NetworkStatusContractByLocation network Status in the Location 5794type NetworkStatusContractByLocation struct { 5795 // Location - Location of service 5796 Location *string `json:"location,omitempty"` 5797 // NetworkStatus - Network status in Location 5798 NetworkStatus *NetworkStatusContract `json:"networkStatus,omitempty"` 5799} 5800 5801// NotificationCollection paged Notification list representation. 5802type NotificationCollection struct { 5803 autorest.Response `json:"-"` 5804 // Value - Page values. 5805 Value *[]NotificationContract `json:"value,omitempty"` 5806 // NextLink - Next page link if any. 5807 NextLink *string `json:"nextLink,omitempty"` 5808} 5809 5810// NotificationCollectionIterator provides access to a complete listing of NotificationContract values. 5811type NotificationCollectionIterator struct { 5812 i int 5813 page NotificationCollectionPage 5814} 5815 5816// NextWithContext advances to the next value. If there was an error making 5817// the request the iterator does not advance and the error is returned. 5818func (iter *NotificationCollectionIterator) NextWithContext(ctx context.Context) (err error) { 5819 if tracing.IsEnabled() { 5820 ctx = tracing.StartSpan(ctx, fqdn+"/NotificationCollectionIterator.NextWithContext") 5821 defer func() { 5822 sc := -1 5823 if iter.Response().Response.Response != nil { 5824 sc = iter.Response().Response.Response.StatusCode 5825 } 5826 tracing.EndSpan(ctx, sc, err) 5827 }() 5828 } 5829 iter.i++ 5830 if iter.i < len(iter.page.Values()) { 5831 return nil 5832 } 5833 err = iter.page.NextWithContext(ctx) 5834 if err != nil { 5835 iter.i-- 5836 return err 5837 } 5838 iter.i = 0 5839 return nil 5840} 5841 5842// Next advances to the next value. If there was an error making 5843// the request the iterator does not advance and the error is returned. 5844// Deprecated: Use NextWithContext() instead. 5845func (iter *NotificationCollectionIterator) Next() error { 5846 return iter.NextWithContext(context.Background()) 5847} 5848 5849// NotDone returns true if the enumeration should be started or is not yet complete. 5850func (iter NotificationCollectionIterator) NotDone() bool { 5851 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 5852} 5853 5854// Response returns the raw server response from the last page request. 5855func (iter NotificationCollectionIterator) Response() NotificationCollection { 5856 return iter.page.Response() 5857} 5858 5859// Value returns the current value or a zero-initialized value if the 5860// iterator has advanced beyond the end of the collection. 5861func (iter NotificationCollectionIterator) Value() NotificationContract { 5862 if !iter.page.NotDone() { 5863 return NotificationContract{} 5864 } 5865 return iter.page.Values()[iter.i] 5866} 5867 5868// Creates a new instance of the NotificationCollectionIterator type. 5869func NewNotificationCollectionIterator(page NotificationCollectionPage) NotificationCollectionIterator { 5870 return NotificationCollectionIterator{page: page} 5871} 5872 5873// IsEmpty returns true if the ListResult contains no values. 5874func (nc NotificationCollection) IsEmpty() bool { 5875 return nc.Value == nil || len(*nc.Value) == 0 5876} 5877 5878// hasNextLink returns true if the NextLink is not empty. 5879func (nc NotificationCollection) hasNextLink() bool { 5880 return nc.NextLink != nil && len(*nc.NextLink) != 0 5881} 5882 5883// notificationCollectionPreparer prepares a request to retrieve the next set of results. 5884// It returns nil if no more results exist. 5885func (nc NotificationCollection) notificationCollectionPreparer(ctx context.Context) (*http.Request, error) { 5886 if !nc.hasNextLink() { 5887 return nil, nil 5888 } 5889 return autorest.Prepare((&http.Request{}).WithContext(ctx), 5890 autorest.AsJSON(), 5891 autorest.AsGet(), 5892 autorest.WithBaseURL(to.String(nc.NextLink))) 5893} 5894 5895// NotificationCollectionPage contains a page of NotificationContract values. 5896type NotificationCollectionPage struct { 5897 fn func(context.Context, NotificationCollection) (NotificationCollection, error) 5898 nc NotificationCollection 5899} 5900 5901// NextWithContext advances to the next page of values. If there was an error making 5902// the request the page does not advance and the error is returned. 5903func (page *NotificationCollectionPage) NextWithContext(ctx context.Context) (err error) { 5904 if tracing.IsEnabled() { 5905 ctx = tracing.StartSpan(ctx, fqdn+"/NotificationCollectionPage.NextWithContext") 5906 defer func() { 5907 sc := -1 5908 if page.Response().Response.Response != nil { 5909 sc = page.Response().Response.Response.StatusCode 5910 } 5911 tracing.EndSpan(ctx, sc, err) 5912 }() 5913 } 5914 for { 5915 next, err := page.fn(ctx, page.nc) 5916 if err != nil { 5917 return err 5918 } 5919 page.nc = next 5920 if !next.hasNextLink() || !next.IsEmpty() { 5921 break 5922 } 5923 } 5924 return nil 5925} 5926 5927// Next advances to the next page of values. If there was an error making 5928// the request the page does not advance and the error is returned. 5929// Deprecated: Use NextWithContext() instead. 5930func (page *NotificationCollectionPage) Next() error { 5931 return page.NextWithContext(context.Background()) 5932} 5933 5934// NotDone returns true if the page enumeration should be started or is not yet complete. 5935func (page NotificationCollectionPage) NotDone() bool { 5936 return !page.nc.IsEmpty() 5937} 5938 5939// Response returns the raw server response from the last page request. 5940func (page NotificationCollectionPage) Response() NotificationCollection { 5941 return page.nc 5942} 5943 5944// Values returns the slice of values for the current page or nil if there are no values. 5945func (page NotificationCollectionPage) Values() []NotificationContract { 5946 if page.nc.IsEmpty() { 5947 return nil 5948 } 5949 return *page.nc.Value 5950} 5951 5952// Creates a new instance of the NotificationCollectionPage type. 5953func NewNotificationCollectionPage(cur NotificationCollection, getNextPage func(context.Context, NotificationCollection) (NotificationCollection, error)) NotificationCollectionPage { 5954 return NotificationCollectionPage{ 5955 fn: getNextPage, 5956 nc: cur, 5957 } 5958} 5959 5960// NotificationContract notification details. 5961type NotificationContract struct { 5962 autorest.Response `json:"-"` 5963 // NotificationContractProperties - Notification entity contract properties. 5964 *NotificationContractProperties `json:"properties,omitempty"` 5965 // ID - READ-ONLY; Resource ID. 5966 ID *string `json:"id,omitempty"` 5967 // Name - READ-ONLY; Resource name. 5968 Name *string `json:"name,omitempty"` 5969 // Type - READ-ONLY; Resource type for API Management resource. 5970 Type *string `json:"type,omitempty"` 5971} 5972 5973// MarshalJSON is the custom marshaler for NotificationContract. 5974func (nc NotificationContract) MarshalJSON() ([]byte, error) { 5975 objectMap := make(map[string]interface{}) 5976 if nc.NotificationContractProperties != nil { 5977 objectMap["properties"] = nc.NotificationContractProperties 5978 } 5979 return json.Marshal(objectMap) 5980} 5981 5982// UnmarshalJSON is the custom unmarshaler for NotificationContract struct. 5983func (nc *NotificationContract) UnmarshalJSON(body []byte) error { 5984 var m map[string]*json.RawMessage 5985 err := json.Unmarshal(body, &m) 5986 if err != nil { 5987 return err 5988 } 5989 for k, v := range m { 5990 switch k { 5991 case "properties": 5992 if v != nil { 5993 var notificationContractProperties NotificationContractProperties 5994 err = json.Unmarshal(*v, ¬ificationContractProperties) 5995 if err != nil { 5996 return err 5997 } 5998 nc.NotificationContractProperties = ¬ificationContractProperties 5999 } 6000 case "id": 6001 if v != nil { 6002 var ID string 6003 err = json.Unmarshal(*v, &ID) 6004 if err != nil { 6005 return err 6006 } 6007 nc.ID = &ID 6008 } 6009 case "name": 6010 if v != nil { 6011 var name string 6012 err = json.Unmarshal(*v, &name) 6013 if err != nil { 6014 return err 6015 } 6016 nc.Name = &name 6017 } 6018 case "type": 6019 if v != nil { 6020 var typeVar string 6021 err = json.Unmarshal(*v, &typeVar) 6022 if err != nil { 6023 return err 6024 } 6025 nc.Type = &typeVar 6026 } 6027 } 6028 } 6029 6030 return nil 6031} 6032 6033// NotificationContractProperties notification Contract properties. 6034type NotificationContractProperties struct { 6035 // Title - Title of the Notification. 6036 Title *string `json:"title,omitempty"` 6037 // Description - Description of the Notification. 6038 Description *string `json:"description,omitempty"` 6039 // Recipients - Recipient Parameter values. 6040 Recipients *RecipientsContractProperties `json:"recipients,omitempty"` 6041} 6042 6043// OAuth2AuthenticationSettingsContract API OAuth2 Authentication settings details. 6044type OAuth2AuthenticationSettingsContract struct { 6045 // AuthorizationServerID - OAuth authorization server identifier. 6046 AuthorizationServerID *string `json:"authorizationServerId,omitempty"` 6047 // Scope - operations scope. 6048 Scope *string `json:"scope,omitempty"` 6049} 6050 6051// OpenIDAuthenticationSettingsContract API OAuth2 Authentication settings details. 6052type OpenIDAuthenticationSettingsContract struct { 6053 // OpenidProviderID - OAuth authorization server identifier. 6054 OpenidProviderID *string `json:"openidProviderId,omitempty"` 6055 // BearerTokenSendingMethods - How to send token to the server. 6056 BearerTokenSendingMethods *[]BearerTokenSendingMethods `json:"bearerTokenSendingMethods,omitempty"` 6057} 6058 6059// OpenIDConnectProviderCollection paged OpenIdProviders list representation. 6060type OpenIDConnectProviderCollection struct { 6061 autorest.Response `json:"-"` 6062 // Value - Page values. 6063 Value *[]OpenidConnectProviderContract `json:"value,omitempty"` 6064 // NextLink - Next page link if any. 6065 NextLink *string `json:"nextLink,omitempty"` 6066} 6067 6068// OpenIDConnectProviderCollectionIterator provides access to a complete listing of 6069// OpenidConnectProviderContract values. 6070type OpenIDConnectProviderCollectionIterator struct { 6071 i int 6072 page OpenIDConnectProviderCollectionPage 6073} 6074 6075// NextWithContext advances to the next value. If there was an error making 6076// the request the iterator does not advance and the error is returned. 6077func (iter *OpenIDConnectProviderCollectionIterator) NextWithContext(ctx context.Context) (err error) { 6078 if tracing.IsEnabled() { 6079 ctx = tracing.StartSpan(ctx, fqdn+"/OpenIDConnectProviderCollectionIterator.NextWithContext") 6080 defer func() { 6081 sc := -1 6082 if iter.Response().Response.Response != nil { 6083 sc = iter.Response().Response.Response.StatusCode 6084 } 6085 tracing.EndSpan(ctx, sc, err) 6086 }() 6087 } 6088 iter.i++ 6089 if iter.i < len(iter.page.Values()) { 6090 return nil 6091 } 6092 err = iter.page.NextWithContext(ctx) 6093 if err != nil { 6094 iter.i-- 6095 return err 6096 } 6097 iter.i = 0 6098 return nil 6099} 6100 6101// Next advances to the next value. If there was an error making 6102// the request the iterator does not advance and the error is returned. 6103// Deprecated: Use NextWithContext() instead. 6104func (iter *OpenIDConnectProviderCollectionIterator) Next() error { 6105 return iter.NextWithContext(context.Background()) 6106} 6107 6108// NotDone returns true if the enumeration should be started or is not yet complete. 6109func (iter OpenIDConnectProviderCollectionIterator) NotDone() bool { 6110 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 6111} 6112 6113// Response returns the raw server response from the last page request. 6114func (iter OpenIDConnectProviderCollectionIterator) Response() OpenIDConnectProviderCollection { 6115 return iter.page.Response() 6116} 6117 6118// Value returns the current value or a zero-initialized value if the 6119// iterator has advanced beyond the end of the collection. 6120func (iter OpenIDConnectProviderCollectionIterator) Value() OpenidConnectProviderContract { 6121 if !iter.page.NotDone() { 6122 return OpenidConnectProviderContract{} 6123 } 6124 return iter.page.Values()[iter.i] 6125} 6126 6127// Creates a new instance of the OpenIDConnectProviderCollectionIterator type. 6128func NewOpenIDConnectProviderCollectionIterator(page OpenIDConnectProviderCollectionPage) OpenIDConnectProviderCollectionIterator { 6129 return OpenIDConnectProviderCollectionIterator{page: page} 6130} 6131 6132// IsEmpty returns true if the ListResult contains no values. 6133func (oicpc OpenIDConnectProviderCollection) IsEmpty() bool { 6134 return oicpc.Value == nil || len(*oicpc.Value) == 0 6135} 6136 6137// hasNextLink returns true if the NextLink is not empty. 6138func (oicpc OpenIDConnectProviderCollection) hasNextLink() bool { 6139 return oicpc.NextLink != nil && len(*oicpc.NextLink) != 0 6140} 6141 6142// openIDConnectProviderCollectionPreparer prepares a request to retrieve the next set of results. 6143// It returns nil if no more results exist. 6144func (oicpc OpenIDConnectProviderCollection) openIDConnectProviderCollectionPreparer(ctx context.Context) (*http.Request, error) { 6145 if !oicpc.hasNextLink() { 6146 return nil, nil 6147 } 6148 return autorest.Prepare((&http.Request{}).WithContext(ctx), 6149 autorest.AsJSON(), 6150 autorest.AsGet(), 6151 autorest.WithBaseURL(to.String(oicpc.NextLink))) 6152} 6153 6154// OpenIDConnectProviderCollectionPage contains a page of OpenidConnectProviderContract values. 6155type OpenIDConnectProviderCollectionPage struct { 6156 fn func(context.Context, OpenIDConnectProviderCollection) (OpenIDConnectProviderCollection, error) 6157 oicpc OpenIDConnectProviderCollection 6158} 6159 6160// NextWithContext advances to the next page of values. If there was an error making 6161// the request the page does not advance and the error is returned. 6162func (page *OpenIDConnectProviderCollectionPage) NextWithContext(ctx context.Context) (err error) { 6163 if tracing.IsEnabled() { 6164 ctx = tracing.StartSpan(ctx, fqdn+"/OpenIDConnectProviderCollectionPage.NextWithContext") 6165 defer func() { 6166 sc := -1 6167 if page.Response().Response.Response != nil { 6168 sc = page.Response().Response.Response.StatusCode 6169 } 6170 tracing.EndSpan(ctx, sc, err) 6171 }() 6172 } 6173 for { 6174 next, err := page.fn(ctx, page.oicpc) 6175 if err != nil { 6176 return err 6177 } 6178 page.oicpc = next 6179 if !next.hasNextLink() || !next.IsEmpty() { 6180 break 6181 } 6182 } 6183 return nil 6184} 6185 6186// Next advances to the next page of values. If there was an error making 6187// the request the page does not advance and the error is returned. 6188// Deprecated: Use NextWithContext() instead. 6189func (page *OpenIDConnectProviderCollectionPage) Next() error { 6190 return page.NextWithContext(context.Background()) 6191} 6192 6193// NotDone returns true if the page enumeration should be started or is not yet complete. 6194func (page OpenIDConnectProviderCollectionPage) NotDone() bool { 6195 return !page.oicpc.IsEmpty() 6196} 6197 6198// Response returns the raw server response from the last page request. 6199func (page OpenIDConnectProviderCollectionPage) Response() OpenIDConnectProviderCollection { 6200 return page.oicpc 6201} 6202 6203// Values returns the slice of values for the current page or nil if there are no values. 6204func (page OpenIDConnectProviderCollectionPage) Values() []OpenidConnectProviderContract { 6205 if page.oicpc.IsEmpty() { 6206 return nil 6207 } 6208 return *page.oicpc.Value 6209} 6210 6211// Creates a new instance of the OpenIDConnectProviderCollectionPage type. 6212func NewOpenIDConnectProviderCollectionPage(cur OpenIDConnectProviderCollection, getNextPage func(context.Context, OpenIDConnectProviderCollection) (OpenIDConnectProviderCollection, error)) OpenIDConnectProviderCollectionPage { 6213 return OpenIDConnectProviderCollectionPage{ 6214 fn: getNextPage, 6215 oicpc: cur, 6216 } 6217} 6218 6219// OpenidConnectProviderContract openId Connect Provider details. 6220type OpenidConnectProviderContract struct { 6221 autorest.Response `json:"-"` 6222 // OpenidConnectProviderContractProperties - OpenId Connect Provider contract properties. 6223 *OpenidConnectProviderContractProperties `json:"properties,omitempty"` 6224 // ID - READ-ONLY; Resource ID. 6225 ID *string `json:"id,omitempty"` 6226 // Name - READ-ONLY; Resource name. 6227 Name *string `json:"name,omitempty"` 6228 // Type - READ-ONLY; Resource type for API Management resource. 6229 Type *string `json:"type,omitempty"` 6230} 6231 6232// MarshalJSON is the custom marshaler for OpenidConnectProviderContract. 6233func (ocpc OpenidConnectProviderContract) MarshalJSON() ([]byte, error) { 6234 objectMap := make(map[string]interface{}) 6235 if ocpc.OpenidConnectProviderContractProperties != nil { 6236 objectMap["properties"] = ocpc.OpenidConnectProviderContractProperties 6237 } 6238 return json.Marshal(objectMap) 6239} 6240 6241// UnmarshalJSON is the custom unmarshaler for OpenidConnectProviderContract struct. 6242func (ocpc *OpenidConnectProviderContract) UnmarshalJSON(body []byte) error { 6243 var m map[string]*json.RawMessage 6244 err := json.Unmarshal(body, &m) 6245 if err != nil { 6246 return err 6247 } 6248 for k, v := range m { 6249 switch k { 6250 case "properties": 6251 if v != nil { 6252 var openidConnectProviderContractProperties OpenidConnectProviderContractProperties 6253 err = json.Unmarshal(*v, &openidConnectProviderContractProperties) 6254 if err != nil { 6255 return err 6256 } 6257 ocpc.OpenidConnectProviderContractProperties = &openidConnectProviderContractProperties 6258 } 6259 case "id": 6260 if v != nil { 6261 var ID string 6262 err = json.Unmarshal(*v, &ID) 6263 if err != nil { 6264 return err 6265 } 6266 ocpc.ID = &ID 6267 } 6268 case "name": 6269 if v != nil { 6270 var name string 6271 err = json.Unmarshal(*v, &name) 6272 if err != nil { 6273 return err 6274 } 6275 ocpc.Name = &name 6276 } 6277 case "type": 6278 if v != nil { 6279 var typeVar string 6280 err = json.Unmarshal(*v, &typeVar) 6281 if err != nil { 6282 return err 6283 } 6284 ocpc.Type = &typeVar 6285 } 6286 } 6287 } 6288 6289 return nil 6290} 6291 6292// OpenidConnectProviderContractProperties openID Connect Providers Contract. 6293type OpenidConnectProviderContractProperties struct { 6294 // DisplayName - User-friendly OpenID Connect Provider name. 6295 DisplayName *string `json:"displayName,omitempty"` 6296 // Description - User-friendly description of OpenID Connect Provider. 6297 Description *string `json:"description,omitempty"` 6298 // MetadataEndpoint - Metadata endpoint URI. 6299 MetadataEndpoint *string `json:"metadataEndpoint,omitempty"` 6300 // ClientID - Client ID of developer console which is the client application. 6301 ClientID *string `json:"clientId,omitempty"` 6302 // ClientSecret - Client Secret of developer console which is the client application. 6303 ClientSecret *string `json:"clientSecret,omitempty"` 6304} 6305 6306// OpenidConnectProviderUpdateContract parameters supplied to the Update OpenID Connect Provider operation. 6307type OpenidConnectProviderUpdateContract struct { 6308 // OpenidConnectProviderUpdateContractProperties - OpenId Connect Provider Update contract properties. 6309 *OpenidConnectProviderUpdateContractProperties `json:"properties,omitempty"` 6310} 6311 6312// MarshalJSON is the custom marshaler for OpenidConnectProviderUpdateContract. 6313func (ocpuc OpenidConnectProviderUpdateContract) MarshalJSON() ([]byte, error) { 6314 objectMap := make(map[string]interface{}) 6315 if ocpuc.OpenidConnectProviderUpdateContractProperties != nil { 6316 objectMap["properties"] = ocpuc.OpenidConnectProviderUpdateContractProperties 6317 } 6318 return json.Marshal(objectMap) 6319} 6320 6321// UnmarshalJSON is the custom unmarshaler for OpenidConnectProviderUpdateContract struct. 6322func (ocpuc *OpenidConnectProviderUpdateContract) UnmarshalJSON(body []byte) error { 6323 var m map[string]*json.RawMessage 6324 err := json.Unmarshal(body, &m) 6325 if err != nil { 6326 return err 6327 } 6328 for k, v := range m { 6329 switch k { 6330 case "properties": 6331 if v != nil { 6332 var openidConnectProviderUpdateContractProperties OpenidConnectProviderUpdateContractProperties 6333 err = json.Unmarshal(*v, &openidConnectProviderUpdateContractProperties) 6334 if err != nil { 6335 return err 6336 } 6337 ocpuc.OpenidConnectProviderUpdateContractProperties = &openidConnectProviderUpdateContractProperties 6338 } 6339 } 6340 } 6341 6342 return nil 6343} 6344 6345// OpenidConnectProviderUpdateContractProperties parameters supplied to the Update OpenID Connect Provider 6346// operation. 6347type OpenidConnectProviderUpdateContractProperties struct { 6348 // DisplayName - User-friendly OpenID Connect Provider name. 6349 DisplayName *string `json:"displayName,omitempty"` 6350 // Description - User-friendly description of OpenID Connect Provider. 6351 Description *string `json:"description,omitempty"` 6352 // MetadataEndpoint - Metadata endpoint URI. 6353 MetadataEndpoint *string `json:"metadataEndpoint,omitempty"` 6354 // ClientID - Client ID of developer console which is the client application. 6355 ClientID *string `json:"clientId,omitempty"` 6356 // ClientSecret - Client Secret of developer console which is the client application. 6357 ClientSecret *string `json:"clientSecret,omitempty"` 6358} 6359 6360// Operation REST API operation 6361type Operation struct { 6362 // Name - Operation name: {provider}/{resource}/{operation} 6363 Name *string `json:"name,omitempty"` 6364 // Display - The object that describes the operation. 6365 Display *OperationDisplay `json:"display,omitempty"` 6366 // Origin - The operation origin. 6367 Origin *string `json:"origin,omitempty"` 6368 // Properties - The operation properties. 6369 Properties interface{} `json:"properties,omitempty"` 6370} 6371 6372// OperationCollection paged Operation list representation. 6373type OperationCollection struct { 6374 autorest.Response `json:"-"` 6375 // Value - READ-ONLY; Page values. 6376 Value *[]OperationContract `json:"value,omitempty"` 6377 // NextLink - READ-ONLY; Next page link if any. 6378 NextLink *string `json:"nextLink,omitempty"` 6379} 6380 6381// MarshalJSON is the custom marshaler for OperationCollection. 6382func (oc OperationCollection) MarshalJSON() ([]byte, error) { 6383 objectMap := make(map[string]interface{}) 6384 return json.Marshal(objectMap) 6385} 6386 6387// OperationCollectionIterator provides access to a complete listing of OperationContract values. 6388type OperationCollectionIterator struct { 6389 i int 6390 page OperationCollectionPage 6391} 6392 6393// NextWithContext advances to the next value. If there was an error making 6394// the request the iterator does not advance and the error is returned. 6395func (iter *OperationCollectionIterator) NextWithContext(ctx context.Context) (err error) { 6396 if tracing.IsEnabled() { 6397 ctx = tracing.StartSpan(ctx, fqdn+"/OperationCollectionIterator.NextWithContext") 6398 defer func() { 6399 sc := -1 6400 if iter.Response().Response.Response != nil { 6401 sc = iter.Response().Response.Response.StatusCode 6402 } 6403 tracing.EndSpan(ctx, sc, err) 6404 }() 6405 } 6406 iter.i++ 6407 if iter.i < len(iter.page.Values()) { 6408 return nil 6409 } 6410 err = iter.page.NextWithContext(ctx) 6411 if err != nil { 6412 iter.i-- 6413 return err 6414 } 6415 iter.i = 0 6416 return nil 6417} 6418 6419// Next advances to the next value. If there was an error making 6420// the request the iterator does not advance and the error is returned. 6421// Deprecated: Use NextWithContext() instead. 6422func (iter *OperationCollectionIterator) Next() error { 6423 return iter.NextWithContext(context.Background()) 6424} 6425 6426// NotDone returns true if the enumeration should be started or is not yet complete. 6427func (iter OperationCollectionIterator) NotDone() bool { 6428 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 6429} 6430 6431// Response returns the raw server response from the last page request. 6432func (iter OperationCollectionIterator) Response() OperationCollection { 6433 return iter.page.Response() 6434} 6435 6436// Value returns the current value or a zero-initialized value if the 6437// iterator has advanced beyond the end of the collection. 6438func (iter OperationCollectionIterator) Value() OperationContract { 6439 if !iter.page.NotDone() { 6440 return OperationContract{} 6441 } 6442 return iter.page.Values()[iter.i] 6443} 6444 6445// Creates a new instance of the OperationCollectionIterator type. 6446func NewOperationCollectionIterator(page OperationCollectionPage) OperationCollectionIterator { 6447 return OperationCollectionIterator{page: page} 6448} 6449 6450// IsEmpty returns true if the ListResult contains no values. 6451func (oc OperationCollection) IsEmpty() bool { 6452 return oc.Value == nil || len(*oc.Value) == 0 6453} 6454 6455// hasNextLink returns true if the NextLink is not empty. 6456func (oc OperationCollection) hasNextLink() bool { 6457 return oc.NextLink != nil && len(*oc.NextLink) != 0 6458} 6459 6460// operationCollectionPreparer prepares a request to retrieve the next set of results. 6461// It returns nil if no more results exist. 6462func (oc OperationCollection) operationCollectionPreparer(ctx context.Context) (*http.Request, error) { 6463 if !oc.hasNextLink() { 6464 return nil, nil 6465 } 6466 return autorest.Prepare((&http.Request{}).WithContext(ctx), 6467 autorest.AsJSON(), 6468 autorest.AsGet(), 6469 autorest.WithBaseURL(to.String(oc.NextLink))) 6470} 6471 6472// OperationCollectionPage contains a page of OperationContract values. 6473type OperationCollectionPage struct { 6474 fn func(context.Context, OperationCollection) (OperationCollection, error) 6475 oc OperationCollection 6476} 6477 6478// NextWithContext advances to the next page of values. If there was an error making 6479// the request the page does not advance and the error is returned. 6480func (page *OperationCollectionPage) NextWithContext(ctx context.Context) (err error) { 6481 if tracing.IsEnabled() { 6482 ctx = tracing.StartSpan(ctx, fqdn+"/OperationCollectionPage.NextWithContext") 6483 defer func() { 6484 sc := -1 6485 if page.Response().Response.Response != nil { 6486 sc = page.Response().Response.Response.StatusCode 6487 } 6488 tracing.EndSpan(ctx, sc, err) 6489 }() 6490 } 6491 for { 6492 next, err := page.fn(ctx, page.oc) 6493 if err != nil { 6494 return err 6495 } 6496 page.oc = next 6497 if !next.hasNextLink() || !next.IsEmpty() { 6498 break 6499 } 6500 } 6501 return nil 6502} 6503 6504// Next advances to the next page of values. If there was an error making 6505// the request the page does not advance and the error is returned. 6506// Deprecated: Use NextWithContext() instead. 6507func (page *OperationCollectionPage) Next() error { 6508 return page.NextWithContext(context.Background()) 6509} 6510 6511// NotDone returns true if the page enumeration should be started or is not yet complete. 6512func (page OperationCollectionPage) NotDone() bool { 6513 return !page.oc.IsEmpty() 6514} 6515 6516// Response returns the raw server response from the last page request. 6517func (page OperationCollectionPage) Response() OperationCollection { 6518 return page.oc 6519} 6520 6521// Values returns the slice of values for the current page or nil if there are no values. 6522func (page OperationCollectionPage) Values() []OperationContract { 6523 if page.oc.IsEmpty() { 6524 return nil 6525 } 6526 return *page.oc.Value 6527} 6528 6529// Creates a new instance of the OperationCollectionPage type. 6530func NewOperationCollectionPage(cur OperationCollection, getNextPage func(context.Context, OperationCollection) (OperationCollection, error)) OperationCollectionPage { 6531 return OperationCollectionPage{ 6532 fn: getNextPage, 6533 oc: cur, 6534 } 6535} 6536 6537// OperationContract api Operation details. 6538type OperationContract struct { 6539 autorest.Response `json:"-"` 6540 // OperationContractProperties - Properties of the Operation Contract. 6541 *OperationContractProperties `json:"properties,omitempty"` 6542 // ID - READ-ONLY; Resource ID. 6543 ID *string `json:"id,omitempty"` 6544 // Name - READ-ONLY; Resource name. 6545 Name *string `json:"name,omitempty"` 6546 // Type - READ-ONLY; Resource type for API Management resource. 6547 Type *string `json:"type,omitempty"` 6548} 6549 6550// MarshalJSON is the custom marshaler for OperationContract. 6551func (oc OperationContract) MarshalJSON() ([]byte, error) { 6552 objectMap := make(map[string]interface{}) 6553 if oc.OperationContractProperties != nil { 6554 objectMap["properties"] = oc.OperationContractProperties 6555 } 6556 return json.Marshal(objectMap) 6557} 6558 6559// UnmarshalJSON is the custom unmarshaler for OperationContract struct. 6560func (oc *OperationContract) UnmarshalJSON(body []byte) error { 6561 var m map[string]*json.RawMessage 6562 err := json.Unmarshal(body, &m) 6563 if err != nil { 6564 return err 6565 } 6566 for k, v := range m { 6567 switch k { 6568 case "properties": 6569 if v != nil { 6570 var operationContractProperties OperationContractProperties 6571 err = json.Unmarshal(*v, &operationContractProperties) 6572 if err != nil { 6573 return err 6574 } 6575 oc.OperationContractProperties = &operationContractProperties 6576 } 6577 case "id": 6578 if v != nil { 6579 var ID string 6580 err = json.Unmarshal(*v, &ID) 6581 if err != nil { 6582 return err 6583 } 6584 oc.ID = &ID 6585 } 6586 case "name": 6587 if v != nil { 6588 var name string 6589 err = json.Unmarshal(*v, &name) 6590 if err != nil { 6591 return err 6592 } 6593 oc.Name = &name 6594 } 6595 case "type": 6596 if v != nil { 6597 var typeVar string 6598 err = json.Unmarshal(*v, &typeVar) 6599 if err != nil { 6600 return err 6601 } 6602 oc.Type = &typeVar 6603 } 6604 } 6605 } 6606 6607 return nil 6608} 6609 6610// OperationContractProperties operation Contract Properties 6611type OperationContractProperties struct { 6612 // DisplayName - Operation Name. 6613 DisplayName *string `json:"displayName,omitempty"` 6614 // Method - A Valid HTTP Operation Method. Typical Http Methods like GET, PUT, POST but not limited by only them. 6615 Method *string `json:"method,omitempty"` 6616 // URLTemplate - Relative URL template identifying the target resource for this operation. May include parameters. Example: /customers/{cid}/orders/{oid}/?date={date} 6617 URLTemplate *string `json:"urlTemplate,omitempty"` 6618 // TemplateParameters - Collection of URL template parameters. 6619 TemplateParameters *[]ParameterContract `json:"templateParameters,omitempty"` 6620 // Description - Description of the operation. May include HTML formatting tags. 6621 Description *string `json:"description,omitempty"` 6622 // Request - An entity containing request details. 6623 Request *RequestContract `json:"request,omitempty"` 6624 // Responses - Array of Operation responses. 6625 Responses *[]ResponseContract `json:"responses,omitempty"` 6626 // Policies - Operation Policies 6627 Policies *string `json:"policies,omitempty"` 6628} 6629 6630// OperationDisplay the object that describes the operation. 6631type OperationDisplay struct { 6632 // Provider - Friendly name of the resource provider 6633 Provider *string `json:"provider,omitempty"` 6634 // Operation - Operation type: read, write, delete, listKeys/action, etc. 6635 Operation *string `json:"operation,omitempty"` 6636 // Resource - Resource type on which the operation is performed. 6637 Resource *string `json:"resource,omitempty"` 6638 // Description - Friendly name of the operation 6639 Description *string `json:"description,omitempty"` 6640} 6641 6642// OperationEntityBaseContract api Operation Entity Base Contract details. 6643type OperationEntityBaseContract struct { 6644 // TemplateParameters - Collection of URL template parameters. 6645 TemplateParameters *[]ParameterContract `json:"templateParameters,omitempty"` 6646 // Description - Description of the operation. May include HTML formatting tags. 6647 Description *string `json:"description,omitempty"` 6648 // Request - An entity containing request details. 6649 Request *RequestContract `json:"request,omitempty"` 6650 // Responses - Array of Operation responses. 6651 Responses *[]ResponseContract `json:"responses,omitempty"` 6652 // Policies - Operation Policies 6653 Policies *string `json:"policies,omitempty"` 6654} 6655 6656// OperationListResult result of the request to list REST API operations. It contains a list of operations 6657// and a URL nextLink to get the next set of results. 6658type OperationListResult struct { 6659 autorest.Response `json:"-"` 6660 // Value - List of operations supported by the resource provider. 6661 Value *[]Operation `json:"value,omitempty"` 6662 // NextLink - URL to get the next set of operation list results if there are any. 6663 NextLink *string `json:"nextLink,omitempty"` 6664} 6665 6666// OperationListResultIterator provides access to a complete listing of Operation values. 6667type OperationListResultIterator struct { 6668 i int 6669 page OperationListResultPage 6670} 6671 6672// NextWithContext advances to the next value. If there was an error making 6673// the request the iterator does not advance and the error is returned. 6674func (iter *OperationListResultIterator) NextWithContext(ctx context.Context) (err error) { 6675 if tracing.IsEnabled() { 6676 ctx = tracing.StartSpan(ctx, fqdn+"/OperationListResultIterator.NextWithContext") 6677 defer func() { 6678 sc := -1 6679 if iter.Response().Response.Response != nil { 6680 sc = iter.Response().Response.Response.StatusCode 6681 } 6682 tracing.EndSpan(ctx, sc, err) 6683 }() 6684 } 6685 iter.i++ 6686 if iter.i < len(iter.page.Values()) { 6687 return nil 6688 } 6689 err = iter.page.NextWithContext(ctx) 6690 if err != nil { 6691 iter.i-- 6692 return err 6693 } 6694 iter.i = 0 6695 return nil 6696} 6697 6698// Next advances to the next value. If there was an error making 6699// the request the iterator does not advance and the error is returned. 6700// Deprecated: Use NextWithContext() instead. 6701func (iter *OperationListResultIterator) Next() error { 6702 return iter.NextWithContext(context.Background()) 6703} 6704 6705// NotDone returns true if the enumeration should be started or is not yet complete. 6706func (iter OperationListResultIterator) NotDone() bool { 6707 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 6708} 6709 6710// Response returns the raw server response from the last page request. 6711func (iter OperationListResultIterator) Response() OperationListResult { 6712 return iter.page.Response() 6713} 6714 6715// Value returns the current value or a zero-initialized value if the 6716// iterator has advanced beyond the end of the collection. 6717func (iter OperationListResultIterator) Value() Operation { 6718 if !iter.page.NotDone() { 6719 return Operation{} 6720 } 6721 return iter.page.Values()[iter.i] 6722} 6723 6724// Creates a new instance of the OperationListResultIterator type. 6725func NewOperationListResultIterator(page OperationListResultPage) OperationListResultIterator { 6726 return OperationListResultIterator{page: page} 6727} 6728 6729// IsEmpty returns true if the ListResult contains no values. 6730func (olr OperationListResult) IsEmpty() bool { 6731 return olr.Value == nil || len(*olr.Value) == 0 6732} 6733 6734// hasNextLink returns true if the NextLink is not empty. 6735func (olr OperationListResult) hasNextLink() bool { 6736 return olr.NextLink != nil && len(*olr.NextLink) != 0 6737} 6738 6739// operationListResultPreparer prepares a request to retrieve the next set of results. 6740// It returns nil if no more results exist. 6741func (olr OperationListResult) operationListResultPreparer(ctx context.Context) (*http.Request, error) { 6742 if !olr.hasNextLink() { 6743 return nil, nil 6744 } 6745 return autorest.Prepare((&http.Request{}).WithContext(ctx), 6746 autorest.AsJSON(), 6747 autorest.AsGet(), 6748 autorest.WithBaseURL(to.String(olr.NextLink))) 6749} 6750 6751// OperationListResultPage contains a page of Operation values. 6752type OperationListResultPage struct { 6753 fn func(context.Context, OperationListResult) (OperationListResult, error) 6754 olr OperationListResult 6755} 6756 6757// NextWithContext advances to the next page of values. If there was an error making 6758// the request the page does not advance and the error is returned. 6759func (page *OperationListResultPage) NextWithContext(ctx context.Context) (err error) { 6760 if tracing.IsEnabled() { 6761 ctx = tracing.StartSpan(ctx, fqdn+"/OperationListResultPage.NextWithContext") 6762 defer func() { 6763 sc := -1 6764 if page.Response().Response.Response != nil { 6765 sc = page.Response().Response.Response.StatusCode 6766 } 6767 tracing.EndSpan(ctx, sc, err) 6768 }() 6769 } 6770 for { 6771 next, err := page.fn(ctx, page.olr) 6772 if err != nil { 6773 return err 6774 } 6775 page.olr = next 6776 if !next.hasNextLink() || !next.IsEmpty() { 6777 break 6778 } 6779 } 6780 return nil 6781} 6782 6783// Next advances to the next page of values. If there was an error making 6784// the request the page does not advance and the error is returned. 6785// Deprecated: Use NextWithContext() instead. 6786func (page *OperationListResultPage) Next() error { 6787 return page.NextWithContext(context.Background()) 6788} 6789 6790// NotDone returns true if the page enumeration should be started or is not yet complete. 6791func (page OperationListResultPage) NotDone() bool { 6792 return !page.olr.IsEmpty() 6793} 6794 6795// Response returns the raw server response from the last page request. 6796func (page OperationListResultPage) Response() OperationListResult { 6797 return page.olr 6798} 6799 6800// Values returns the slice of values for the current page or nil if there are no values. 6801func (page OperationListResultPage) Values() []Operation { 6802 if page.olr.IsEmpty() { 6803 return nil 6804 } 6805 return *page.olr.Value 6806} 6807 6808// Creates a new instance of the OperationListResultPage type. 6809func NewOperationListResultPage(cur OperationListResult, getNextPage func(context.Context, OperationListResult) (OperationListResult, error)) OperationListResultPage { 6810 return OperationListResultPage{ 6811 fn: getNextPage, 6812 olr: cur, 6813 } 6814} 6815 6816// OperationResultContract operation Result. 6817type OperationResultContract struct { 6818 autorest.Response `json:"-"` 6819 // ID - Operation result identifier. 6820 ID *string `json:"id,omitempty"` 6821 // Status - Status of an async operation. Possible values include: 'Started', 'InProgress', 'Succeeded', 'Failed' 6822 Status AsyncOperationStatus `json:"status,omitempty"` 6823 // 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. 6824 Started *date.Time `json:"started,omitempty"` 6825 // 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. 6826 Updated *date.Time `json:"updated,omitempty"` 6827 // ResultInfo - Optional result info. 6828 ResultInfo *string `json:"resultInfo,omitempty"` 6829 // Error - Error Body Contract 6830 Error *ErrorResponseBody `json:"error,omitempty"` 6831 // 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. 6832 ActionLog *[]OperationResultLogItemContract `json:"actionLog,omitempty"` 6833} 6834 6835// MarshalJSON is the custom marshaler for OperationResultContract. 6836func (orc OperationResultContract) MarshalJSON() ([]byte, error) { 6837 objectMap := make(map[string]interface{}) 6838 if orc.ID != nil { 6839 objectMap["id"] = orc.ID 6840 } 6841 if orc.Status != "" { 6842 objectMap["status"] = orc.Status 6843 } 6844 if orc.Started != nil { 6845 objectMap["started"] = orc.Started 6846 } 6847 if orc.Updated != nil { 6848 objectMap["updated"] = orc.Updated 6849 } 6850 if orc.ResultInfo != nil { 6851 objectMap["resultInfo"] = orc.ResultInfo 6852 } 6853 if orc.Error != nil { 6854 objectMap["error"] = orc.Error 6855 } 6856 return json.Marshal(objectMap) 6857} 6858 6859// OperationResultLogItemContract log of the entity being created, updated or deleted. 6860type OperationResultLogItemContract struct { 6861 // ObjectType - The type of entity contract. 6862 ObjectType *string `json:"objectType,omitempty"` 6863 // Action - Action like create/update/delete. 6864 Action *string `json:"action,omitempty"` 6865 // ObjectKey - Identifier of the entity being created/updated/deleted. 6866 ObjectKey *string `json:"objectKey,omitempty"` 6867} 6868 6869// OperationTagResourceContractProperties operation Entity contract Properties. 6870type OperationTagResourceContractProperties struct { 6871 // ID - Identifier of the operation in form /operations/{operationId}. 6872 ID *string `json:"id,omitempty"` 6873 // Name - READ-ONLY; Operation name. 6874 Name *string `json:"name,omitempty"` 6875 // APIName - READ-ONLY; Api Name. 6876 APIName *string `json:"apiName,omitempty"` 6877 // APIRevision - READ-ONLY; Api Revision. 6878 APIRevision *string `json:"apiRevision,omitempty"` 6879 // APIVersion - READ-ONLY; Api Version. 6880 APIVersion *string `json:"apiVersion,omitempty"` 6881 // Description - READ-ONLY; Operation Description. 6882 Description *string `json:"description,omitempty"` 6883 // Method - READ-ONLY; A Valid HTTP Operation Method. Typical Http Methods like GET, PUT, POST but not limited by only them. 6884 Method *string `json:"method,omitempty"` 6885 // URLTemplate - READ-ONLY; Relative URL template identifying the target resource for this operation. May include parameters. Example: /customers/{cid}/orders/{oid}/?date={date} 6886 URLTemplate *string `json:"urlTemplate,omitempty"` 6887} 6888 6889// MarshalJSON is the custom marshaler for OperationTagResourceContractProperties. 6890func (otrcp OperationTagResourceContractProperties) MarshalJSON() ([]byte, error) { 6891 objectMap := make(map[string]interface{}) 6892 if otrcp.ID != nil { 6893 objectMap["id"] = otrcp.ID 6894 } 6895 return json.Marshal(objectMap) 6896} 6897 6898// OperationUpdateContract api Operation Update Contract details. 6899type OperationUpdateContract struct { 6900 // OperationUpdateContractProperties - Properties of the API Operation entity that can be updated. 6901 *OperationUpdateContractProperties `json:"properties,omitempty"` 6902} 6903 6904// MarshalJSON is the custom marshaler for OperationUpdateContract. 6905func (ouc OperationUpdateContract) MarshalJSON() ([]byte, error) { 6906 objectMap := make(map[string]interface{}) 6907 if ouc.OperationUpdateContractProperties != nil { 6908 objectMap["properties"] = ouc.OperationUpdateContractProperties 6909 } 6910 return json.Marshal(objectMap) 6911} 6912 6913// UnmarshalJSON is the custom unmarshaler for OperationUpdateContract struct. 6914func (ouc *OperationUpdateContract) UnmarshalJSON(body []byte) error { 6915 var m map[string]*json.RawMessage 6916 err := json.Unmarshal(body, &m) 6917 if err != nil { 6918 return err 6919 } 6920 for k, v := range m { 6921 switch k { 6922 case "properties": 6923 if v != nil { 6924 var operationUpdateContractProperties OperationUpdateContractProperties 6925 err = json.Unmarshal(*v, &operationUpdateContractProperties) 6926 if err != nil { 6927 return err 6928 } 6929 ouc.OperationUpdateContractProperties = &operationUpdateContractProperties 6930 } 6931 } 6932 } 6933 6934 return nil 6935} 6936 6937// OperationUpdateContractProperties operation Update Contract Properties. 6938type OperationUpdateContractProperties struct { 6939 // DisplayName - Operation Name. 6940 DisplayName *string `json:"displayName,omitempty"` 6941 // Method - A Valid HTTP Operation Method. Typical Http Methods like GET, PUT, POST but not limited by only them. 6942 Method *string `json:"method,omitempty"` 6943 // URLTemplate - Relative URL template identifying the target resource for this operation. May include parameters. Example: /customers/{cid}/orders/{oid}/?date={date} 6944 URLTemplate *string `json:"urlTemplate,omitempty"` 6945 // TemplateParameters - Collection of URL template parameters. 6946 TemplateParameters *[]ParameterContract `json:"templateParameters,omitempty"` 6947 // Description - Description of the operation. May include HTML formatting tags. 6948 Description *string `json:"description,omitempty"` 6949 // Request - An entity containing request details. 6950 Request *RequestContract `json:"request,omitempty"` 6951 // Responses - Array of Operation responses. 6952 Responses *[]ResponseContract `json:"responses,omitempty"` 6953 // Policies - Operation Policies 6954 Policies *string `json:"policies,omitempty"` 6955} 6956 6957// ParameterContract operation parameters details. 6958type ParameterContract struct { 6959 // Name - Parameter name. 6960 Name *string `json:"name,omitempty"` 6961 // Description - Parameter description. 6962 Description *string `json:"description,omitempty"` 6963 // Type - Parameter type. 6964 Type *string `json:"type,omitempty"` 6965 // DefaultValue - Default parameter value. 6966 DefaultValue *string `json:"defaultValue,omitempty"` 6967 // Required - whether parameter is required or not. 6968 Required *bool `json:"required,omitempty"` 6969 // Values - Parameter values. 6970 Values *[]string `json:"values,omitempty"` 6971} 6972 6973// PipelineDiagnosticSettings diagnostic settings for incoming/outgoing HTTP messages to the Gateway. 6974type PipelineDiagnosticSettings struct { 6975 // Request - Diagnostic settings for request. 6976 Request *HTTPMessageDiagnostic `json:"request,omitempty"` 6977 // Response - Diagnostic settings for response. 6978 Response *HTTPMessageDiagnostic `json:"response,omitempty"` 6979} 6980 6981// PolicyCollection the response of the list policy operation. 6982type PolicyCollection struct { 6983 autorest.Response `json:"-"` 6984 // Value - Policy Contract value. 6985 Value *[]PolicyContract `json:"value,omitempty"` 6986 // NextLink - Next page link if any. 6987 NextLink *string `json:"nextLink,omitempty"` 6988} 6989 6990// PolicyContract policy Contract details. 6991type PolicyContract struct { 6992 autorest.Response `json:"-"` 6993 // PolicyContractProperties - Properties of the Policy. 6994 *PolicyContractProperties `json:"properties,omitempty"` 6995 // ID - READ-ONLY; Resource ID. 6996 ID *string `json:"id,omitempty"` 6997 // Name - READ-ONLY; Resource name. 6998 Name *string `json:"name,omitempty"` 6999 // Type - READ-ONLY; Resource type for API Management resource. 7000 Type *string `json:"type,omitempty"` 7001} 7002 7003// MarshalJSON is the custom marshaler for PolicyContract. 7004func (pc PolicyContract) MarshalJSON() ([]byte, error) { 7005 objectMap := make(map[string]interface{}) 7006 if pc.PolicyContractProperties != nil { 7007 objectMap["properties"] = pc.PolicyContractProperties 7008 } 7009 return json.Marshal(objectMap) 7010} 7011 7012// UnmarshalJSON is the custom unmarshaler for PolicyContract struct. 7013func (pc *PolicyContract) UnmarshalJSON(body []byte) error { 7014 var m map[string]*json.RawMessage 7015 err := json.Unmarshal(body, &m) 7016 if err != nil { 7017 return err 7018 } 7019 for k, v := range m { 7020 switch k { 7021 case "properties": 7022 if v != nil { 7023 var policyContractProperties PolicyContractProperties 7024 err = json.Unmarshal(*v, &policyContractProperties) 7025 if err != nil { 7026 return err 7027 } 7028 pc.PolicyContractProperties = &policyContractProperties 7029 } 7030 case "id": 7031 if v != nil { 7032 var ID string 7033 err = json.Unmarshal(*v, &ID) 7034 if err != nil { 7035 return err 7036 } 7037 pc.ID = &ID 7038 } 7039 case "name": 7040 if v != nil { 7041 var name string 7042 err = json.Unmarshal(*v, &name) 7043 if err != nil { 7044 return err 7045 } 7046 pc.Name = &name 7047 } 7048 case "type": 7049 if v != nil { 7050 var typeVar string 7051 err = json.Unmarshal(*v, &typeVar) 7052 if err != nil { 7053 return err 7054 } 7055 pc.Type = &typeVar 7056 } 7057 } 7058 } 7059 7060 return nil 7061} 7062 7063// PolicyContractProperties policy contract Properties. 7064type PolicyContractProperties struct { 7065 // PolicyContent - Json escaped Xml Encoded contents of the Policy. 7066 PolicyContent *string `json:"policyContent,omitempty"` 7067 // ContentFormat - Format of the policyContent. Possible values include: 'XML', 'XMLLink', 'Rawxml', 'RawxmlLink' 7068 ContentFormat PolicyContentFormat `json:"contentFormat,omitempty"` 7069} 7070 7071// PolicySnippetContract policy snippet. 7072type PolicySnippetContract struct { 7073 // Name - READ-ONLY; Snippet name. 7074 Name *string `json:"name,omitempty"` 7075 // Content - READ-ONLY; Snippet content. 7076 Content *string `json:"content,omitempty"` 7077 // ToolTip - READ-ONLY; Snippet toolTip. 7078 ToolTip *string `json:"toolTip,omitempty"` 7079 // Scope - READ-ONLY; Binary OR value of the Snippet scope. 7080 Scope *int32 `json:"scope,omitempty"` 7081} 7082 7083// MarshalJSON is the custom marshaler for PolicySnippetContract. 7084func (psc PolicySnippetContract) MarshalJSON() ([]byte, error) { 7085 objectMap := make(map[string]interface{}) 7086 return json.Marshal(objectMap) 7087} 7088 7089// PolicySnippetsCollection the response of the list policy snippets operation. 7090type PolicySnippetsCollection struct { 7091 autorest.Response `json:"-"` 7092 // Value - Policy snippet value. 7093 Value *[]PolicySnippetContract `json:"value,omitempty"` 7094} 7095 7096// PortalDelegationSettings delegation settings for a developer portal. 7097type PortalDelegationSettings struct { 7098 autorest.Response `json:"-"` 7099 // PortalDelegationSettingsProperties - Delegation settings contract properties. 7100 *PortalDelegationSettingsProperties `json:"properties,omitempty"` 7101 // ID - READ-ONLY; Resource ID. 7102 ID *string `json:"id,omitempty"` 7103 // Name - READ-ONLY; Resource name. 7104 Name *string `json:"name,omitempty"` 7105 // Type - READ-ONLY; Resource type for API Management resource. 7106 Type *string `json:"type,omitempty"` 7107} 7108 7109// MarshalJSON is the custom marshaler for PortalDelegationSettings. 7110func (pds PortalDelegationSettings) MarshalJSON() ([]byte, error) { 7111 objectMap := make(map[string]interface{}) 7112 if pds.PortalDelegationSettingsProperties != nil { 7113 objectMap["properties"] = pds.PortalDelegationSettingsProperties 7114 } 7115 return json.Marshal(objectMap) 7116} 7117 7118// UnmarshalJSON is the custom unmarshaler for PortalDelegationSettings struct. 7119func (pds *PortalDelegationSettings) UnmarshalJSON(body []byte) error { 7120 var m map[string]*json.RawMessage 7121 err := json.Unmarshal(body, &m) 7122 if err != nil { 7123 return err 7124 } 7125 for k, v := range m { 7126 switch k { 7127 case "properties": 7128 if v != nil { 7129 var portalDelegationSettingsProperties PortalDelegationSettingsProperties 7130 err = json.Unmarshal(*v, &portalDelegationSettingsProperties) 7131 if err != nil { 7132 return err 7133 } 7134 pds.PortalDelegationSettingsProperties = &portalDelegationSettingsProperties 7135 } 7136 case "id": 7137 if v != nil { 7138 var ID string 7139 err = json.Unmarshal(*v, &ID) 7140 if err != nil { 7141 return err 7142 } 7143 pds.ID = &ID 7144 } 7145 case "name": 7146 if v != nil { 7147 var name string 7148 err = json.Unmarshal(*v, &name) 7149 if err != nil { 7150 return err 7151 } 7152 pds.Name = &name 7153 } 7154 case "type": 7155 if v != nil { 7156 var typeVar string 7157 err = json.Unmarshal(*v, &typeVar) 7158 if err != nil { 7159 return err 7160 } 7161 pds.Type = &typeVar 7162 } 7163 } 7164 } 7165 7166 return nil 7167} 7168 7169// PortalDelegationSettingsProperties delegation settings contract properties. 7170type PortalDelegationSettingsProperties struct { 7171 // URL - A delegation Url. 7172 URL *string `json:"url,omitempty"` 7173 // ValidationKey - A base64-encoded validation key to validate, that a request is coming from Azure API Management. 7174 ValidationKey *string `json:"validationKey,omitempty"` 7175 // Subscriptions - Subscriptions delegation settings. 7176 Subscriptions *SubscriptionsDelegationSettingsProperties `json:"subscriptions,omitempty"` 7177 // UserRegistration - User registration delegation settings. 7178 UserRegistration *RegistrationDelegationSettingsProperties `json:"userRegistration,omitempty"` 7179} 7180 7181// PortalSigninSettingProperties sign-in settings contract properties. 7182type PortalSigninSettingProperties struct { 7183 // Enabled - Redirect Anonymous users to the Sign-In page. 7184 Enabled *bool `json:"enabled,omitempty"` 7185} 7186 7187// PortalSigninSettings sign-In settings for the Developer Portal. 7188type PortalSigninSettings struct { 7189 autorest.Response `json:"-"` 7190 // PortalSigninSettingProperties - Sign-in settings contract properties. 7191 *PortalSigninSettingProperties `json:"properties,omitempty"` 7192 // ID - READ-ONLY; Resource ID. 7193 ID *string `json:"id,omitempty"` 7194 // Name - READ-ONLY; Resource name. 7195 Name *string `json:"name,omitempty"` 7196 // Type - READ-ONLY; Resource type for API Management resource. 7197 Type *string `json:"type,omitempty"` 7198} 7199 7200// MarshalJSON is the custom marshaler for PortalSigninSettings. 7201func (pss PortalSigninSettings) MarshalJSON() ([]byte, error) { 7202 objectMap := make(map[string]interface{}) 7203 if pss.PortalSigninSettingProperties != nil { 7204 objectMap["properties"] = pss.PortalSigninSettingProperties 7205 } 7206 return json.Marshal(objectMap) 7207} 7208 7209// UnmarshalJSON is the custom unmarshaler for PortalSigninSettings struct. 7210func (pss *PortalSigninSettings) UnmarshalJSON(body []byte) error { 7211 var m map[string]*json.RawMessage 7212 err := json.Unmarshal(body, &m) 7213 if err != nil { 7214 return err 7215 } 7216 for k, v := range m { 7217 switch k { 7218 case "properties": 7219 if v != nil { 7220 var portalSigninSettingProperties PortalSigninSettingProperties 7221 err = json.Unmarshal(*v, &portalSigninSettingProperties) 7222 if err != nil { 7223 return err 7224 } 7225 pss.PortalSigninSettingProperties = &portalSigninSettingProperties 7226 } 7227 case "id": 7228 if v != nil { 7229 var ID string 7230 err = json.Unmarshal(*v, &ID) 7231 if err != nil { 7232 return err 7233 } 7234 pss.ID = &ID 7235 } 7236 case "name": 7237 if v != nil { 7238 var name string 7239 err = json.Unmarshal(*v, &name) 7240 if err != nil { 7241 return err 7242 } 7243 pss.Name = &name 7244 } 7245 case "type": 7246 if v != nil { 7247 var typeVar string 7248 err = json.Unmarshal(*v, &typeVar) 7249 if err != nil { 7250 return err 7251 } 7252 pss.Type = &typeVar 7253 } 7254 } 7255 } 7256 7257 return nil 7258} 7259 7260// PortalSignupSettings sign-Up settings for a developer portal. 7261type PortalSignupSettings struct { 7262 autorest.Response `json:"-"` 7263 // PortalSignupSettingsProperties - Sign-up settings contract properties. 7264 *PortalSignupSettingsProperties `json:"properties,omitempty"` 7265 // ID - READ-ONLY; Resource ID. 7266 ID *string `json:"id,omitempty"` 7267 // Name - READ-ONLY; Resource name. 7268 Name *string `json:"name,omitempty"` 7269 // Type - READ-ONLY; Resource type for API Management resource. 7270 Type *string `json:"type,omitempty"` 7271} 7272 7273// MarshalJSON is the custom marshaler for PortalSignupSettings. 7274func (pss PortalSignupSettings) MarshalJSON() ([]byte, error) { 7275 objectMap := make(map[string]interface{}) 7276 if pss.PortalSignupSettingsProperties != nil { 7277 objectMap["properties"] = pss.PortalSignupSettingsProperties 7278 } 7279 return json.Marshal(objectMap) 7280} 7281 7282// UnmarshalJSON is the custom unmarshaler for PortalSignupSettings struct. 7283func (pss *PortalSignupSettings) UnmarshalJSON(body []byte) error { 7284 var m map[string]*json.RawMessage 7285 err := json.Unmarshal(body, &m) 7286 if err != nil { 7287 return err 7288 } 7289 for k, v := range m { 7290 switch k { 7291 case "properties": 7292 if v != nil { 7293 var portalSignupSettingsProperties PortalSignupSettingsProperties 7294 err = json.Unmarshal(*v, &portalSignupSettingsProperties) 7295 if err != nil { 7296 return err 7297 } 7298 pss.PortalSignupSettingsProperties = &portalSignupSettingsProperties 7299 } 7300 case "id": 7301 if v != nil { 7302 var ID string 7303 err = json.Unmarshal(*v, &ID) 7304 if err != nil { 7305 return err 7306 } 7307 pss.ID = &ID 7308 } 7309 case "name": 7310 if v != nil { 7311 var name string 7312 err = json.Unmarshal(*v, &name) 7313 if err != nil { 7314 return err 7315 } 7316 pss.Name = &name 7317 } 7318 case "type": 7319 if v != nil { 7320 var typeVar string 7321 err = json.Unmarshal(*v, &typeVar) 7322 if err != nil { 7323 return err 7324 } 7325 pss.Type = &typeVar 7326 } 7327 } 7328 } 7329 7330 return nil 7331} 7332 7333// PortalSignupSettingsProperties sign-up settings contract properties. 7334type PortalSignupSettingsProperties struct { 7335 // Enabled - Allow users to sign up on a developer portal. 7336 Enabled *bool `json:"enabled,omitempty"` 7337 // TermsOfService - Terms of service contract properties. 7338 TermsOfService *TermsOfServiceProperties `json:"termsOfService,omitempty"` 7339} 7340 7341// ProductCollection paged Products list representation. 7342type ProductCollection struct { 7343 autorest.Response `json:"-"` 7344 // Value - Page values. 7345 Value *[]ProductContract `json:"value,omitempty"` 7346 // NextLink - Next page link if any. 7347 NextLink *string `json:"nextLink,omitempty"` 7348} 7349 7350// ProductCollectionIterator provides access to a complete listing of ProductContract values. 7351type ProductCollectionIterator struct { 7352 i int 7353 page ProductCollectionPage 7354} 7355 7356// NextWithContext advances to the next value. If there was an error making 7357// the request the iterator does not advance and the error is returned. 7358func (iter *ProductCollectionIterator) NextWithContext(ctx context.Context) (err error) { 7359 if tracing.IsEnabled() { 7360 ctx = tracing.StartSpan(ctx, fqdn+"/ProductCollectionIterator.NextWithContext") 7361 defer func() { 7362 sc := -1 7363 if iter.Response().Response.Response != nil { 7364 sc = iter.Response().Response.Response.StatusCode 7365 } 7366 tracing.EndSpan(ctx, sc, err) 7367 }() 7368 } 7369 iter.i++ 7370 if iter.i < len(iter.page.Values()) { 7371 return nil 7372 } 7373 err = iter.page.NextWithContext(ctx) 7374 if err != nil { 7375 iter.i-- 7376 return err 7377 } 7378 iter.i = 0 7379 return nil 7380} 7381 7382// Next advances to the next value. If there was an error making 7383// the request the iterator does not advance and the error is returned. 7384// Deprecated: Use NextWithContext() instead. 7385func (iter *ProductCollectionIterator) Next() error { 7386 return iter.NextWithContext(context.Background()) 7387} 7388 7389// NotDone returns true if the enumeration should be started or is not yet complete. 7390func (iter ProductCollectionIterator) NotDone() bool { 7391 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 7392} 7393 7394// Response returns the raw server response from the last page request. 7395func (iter ProductCollectionIterator) Response() ProductCollection { 7396 return iter.page.Response() 7397} 7398 7399// Value returns the current value or a zero-initialized value if the 7400// iterator has advanced beyond the end of the collection. 7401func (iter ProductCollectionIterator) Value() ProductContract { 7402 if !iter.page.NotDone() { 7403 return ProductContract{} 7404 } 7405 return iter.page.Values()[iter.i] 7406} 7407 7408// Creates a new instance of the ProductCollectionIterator type. 7409func NewProductCollectionIterator(page ProductCollectionPage) ProductCollectionIterator { 7410 return ProductCollectionIterator{page: page} 7411} 7412 7413// IsEmpty returns true if the ListResult contains no values. 7414func (pc ProductCollection) IsEmpty() bool { 7415 return pc.Value == nil || len(*pc.Value) == 0 7416} 7417 7418// hasNextLink returns true if the NextLink is not empty. 7419func (pc ProductCollection) hasNextLink() bool { 7420 return pc.NextLink != nil && len(*pc.NextLink) != 0 7421} 7422 7423// productCollectionPreparer prepares a request to retrieve the next set of results. 7424// It returns nil if no more results exist. 7425func (pc ProductCollection) productCollectionPreparer(ctx context.Context) (*http.Request, error) { 7426 if !pc.hasNextLink() { 7427 return nil, nil 7428 } 7429 return autorest.Prepare((&http.Request{}).WithContext(ctx), 7430 autorest.AsJSON(), 7431 autorest.AsGet(), 7432 autorest.WithBaseURL(to.String(pc.NextLink))) 7433} 7434 7435// ProductCollectionPage contains a page of ProductContract values. 7436type ProductCollectionPage struct { 7437 fn func(context.Context, ProductCollection) (ProductCollection, error) 7438 pc ProductCollection 7439} 7440 7441// NextWithContext advances to the next page of values. If there was an error making 7442// the request the page does not advance and the error is returned. 7443func (page *ProductCollectionPage) NextWithContext(ctx context.Context) (err error) { 7444 if tracing.IsEnabled() { 7445 ctx = tracing.StartSpan(ctx, fqdn+"/ProductCollectionPage.NextWithContext") 7446 defer func() { 7447 sc := -1 7448 if page.Response().Response.Response != nil { 7449 sc = page.Response().Response.Response.StatusCode 7450 } 7451 tracing.EndSpan(ctx, sc, err) 7452 }() 7453 } 7454 for { 7455 next, err := page.fn(ctx, page.pc) 7456 if err != nil { 7457 return err 7458 } 7459 page.pc = next 7460 if !next.hasNextLink() || !next.IsEmpty() { 7461 break 7462 } 7463 } 7464 return nil 7465} 7466 7467// Next advances to the next page of values. If there was an error making 7468// the request the page does not advance and the error is returned. 7469// Deprecated: Use NextWithContext() instead. 7470func (page *ProductCollectionPage) Next() error { 7471 return page.NextWithContext(context.Background()) 7472} 7473 7474// NotDone returns true if the page enumeration should be started or is not yet complete. 7475func (page ProductCollectionPage) NotDone() bool { 7476 return !page.pc.IsEmpty() 7477} 7478 7479// Response returns the raw server response from the last page request. 7480func (page ProductCollectionPage) Response() ProductCollection { 7481 return page.pc 7482} 7483 7484// Values returns the slice of values for the current page or nil if there are no values. 7485func (page ProductCollectionPage) Values() []ProductContract { 7486 if page.pc.IsEmpty() { 7487 return nil 7488 } 7489 return *page.pc.Value 7490} 7491 7492// Creates a new instance of the ProductCollectionPage type. 7493func NewProductCollectionPage(cur ProductCollection, getNextPage func(context.Context, ProductCollection) (ProductCollection, error)) ProductCollectionPage { 7494 return ProductCollectionPage{ 7495 fn: getNextPage, 7496 pc: cur, 7497 } 7498} 7499 7500// ProductContract product details. 7501type ProductContract struct { 7502 autorest.Response `json:"-"` 7503 // ProductContractProperties - Product entity contract properties. 7504 *ProductContractProperties `json:"properties,omitempty"` 7505 // ID - READ-ONLY; Resource ID. 7506 ID *string `json:"id,omitempty"` 7507 // Name - READ-ONLY; Resource name. 7508 Name *string `json:"name,omitempty"` 7509 // Type - READ-ONLY; Resource type for API Management resource. 7510 Type *string `json:"type,omitempty"` 7511} 7512 7513// MarshalJSON is the custom marshaler for ProductContract. 7514func (pc ProductContract) MarshalJSON() ([]byte, error) { 7515 objectMap := make(map[string]interface{}) 7516 if pc.ProductContractProperties != nil { 7517 objectMap["properties"] = pc.ProductContractProperties 7518 } 7519 return json.Marshal(objectMap) 7520} 7521 7522// UnmarshalJSON is the custom unmarshaler for ProductContract struct. 7523func (pc *ProductContract) UnmarshalJSON(body []byte) error { 7524 var m map[string]*json.RawMessage 7525 err := json.Unmarshal(body, &m) 7526 if err != nil { 7527 return err 7528 } 7529 for k, v := range m { 7530 switch k { 7531 case "properties": 7532 if v != nil { 7533 var productContractProperties ProductContractProperties 7534 err = json.Unmarshal(*v, &productContractProperties) 7535 if err != nil { 7536 return err 7537 } 7538 pc.ProductContractProperties = &productContractProperties 7539 } 7540 case "id": 7541 if v != nil { 7542 var ID string 7543 err = json.Unmarshal(*v, &ID) 7544 if err != nil { 7545 return err 7546 } 7547 pc.ID = &ID 7548 } 7549 case "name": 7550 if v != nil { 7551 var name string 7552 err = json.Unmarshal(*v, &name) 7553 if err != nil { 7554 return err 7555 } 7556 pc.Name = &name 7557 } 7558 case "type": 7559 if v != nil { 7560 var typeVar string 7561 err = json.Unmarshal(*v, &typeVar) 7562 if err != nil { 7563 return err 7564 } 7565 pc.Type = &typeVar 7566 } 7567 } 7568 } 7569 7570 return nil 7571} 7572 7573// ProductContractProperties product profile. 7574type ProductContractProperties struct { 7575 // DisplayName - Product name. 7576 DisplayName *string `json:"displayName,omitempty"` 7577 // Description - Product description. May include HTML formatting tags. 7578 Description *string `json:"description,omitempty"` 7579 // 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. 7580 Terms *string `json:"terms,omitempty"` 7581 // 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. 7582 SubscriptionRequired *bool `json:"subscriptionRequired,omitempty"` 7583 // 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. 7584 ApprovalRequired *bool `json:"approvalRequired,omitempty"` 7585 // 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. 7586 SubscriptionsLimit *int32 `json:"subscriptionsLimit,omitempty"` 7587 // 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' 7588 State ProductState `json:"state,omitempty"` 7589} 7590 7591// ProductEntityBaseParameters product Entity Base Parameters 7592type ProductEntityBaseParameters struct { 7593 // Description - Product description. May include HTML formatting tags. 7594 Description *string `json:"description,omitempty"` 7595 // 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. 7596 Terms *string `json:"terms,omitempty"` 7597 // 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. 7598 SubscriptionRequired *bool `json:"subscriptionRequired,omitempty"` 7599 // 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. 7600 ApprovalRequired *bool `json:"approvalRequired,omitempty"` 7601 // 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. 7602 SubscriptionsLimit *int32 `json:"subscriptionsLimit,omitempty"` 7603 // 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' 7604 State ProductState `json:"state,omitempty"` 7605} 7606 7607// ProductTagResourceContractProperties product profile. 7608type ProductTagResourceContractProperties struct { 7609 // ID - Identifier of the product in the form of /products/{productId} 7610 ID *string `json:"id,omitempty"` 7611 // Name - Product name. 7612 Name *string `json:"name,omitempty"` 7613 // Description - Product description. May include HTML formatting tags. 7614 Description *string `json:"description,omitempty"` 7615 // 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. 7616 Terms *string `json:"terms,omitempty"` 7617 // 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. 7618 SubscriptionRequired *bool `json:"subscriptionRequired,omitempty"` 7619 // 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. 7620 ApprovalRequired *bool `json:"approvalRequired,omitempty"` 7621 // 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. 7622 SubscriptionsLimit *int32 `json:"subscriptionsLimit,omitempty"` 7623 // 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' 7624 State ProductState `json:"state,omitempty"` 7625} 7626 7627// ProductUpdateParameters product Update parameters. 7628type ProductUpdateParameters struct { 7629 // ProductUpdateProperties - Product entity Update contract properties. 7630 *ProductUpdateProperties `json:"properties,omitempty"` 7631} 7632 7633// MarshalJSON is the custom marshaler for ProductUpdateParameters. 7634func (pup ProductUpdateParameters) MarshalJSON() ([]byte, error) { 7635 objectMap := make(map[string]interface{}) 7636 if pup.ProductUpdateProperties != nil { 7637 objectMap["properties"] = pup.ProductUpdateProperties 7638 } 7639 return json.Marshal(objectMap) 7640} 7641 7642// UnmarshalJSON is the custom unmarshaler for ProductUpdateParameters struct. 7643func (pup *ProductUpdateParameters) UnmarshalJSON(body []byte) error { 7644 var m map[string]*json.RawMessage 7645 err := json.Unmarshal(body, &m) 7646 if err != nil { 7647 return err 7648 } 7649 for k, v := range m { 7650 switch k { 7651 case "properties": 7652 if v != nil { 7653 var productUpdateProperties ProductUpdateProperties 7654 err = json.Unmarshal(*v, &productUpdateProperties) 7655 if err != nil { 7656 return err 7657 } 7658 pup.ProductUpdateProperties = &productUpdateProperties 7659 } 7660 } 7661 } 7662 7663 return nil 7664} 7665 7666// ProductUpdateProperties parameters supplied to the Update Product operation. 7667type ProductUpdateProperties struct { 7668 // DisplayName - Product name. 7669 DisplayName *string `json:"displayName,omitempty"` 7670 // Description - Product description. May include HTML formatting tags. 7671 Description *string `json:"description,omitempty"` 7672 // 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. 7673 Terms *string `json:"terms,omitempty"` 7674 // 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. 7675 SubscriptionRequired *bool `json:"subscriptionRequired,omitempty"` 7676 // 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. 7677 ApprovalRequired *bool `json:"approvalRequired,omitempty"` 7678 // 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. 7679 SubscriptionsLimit *int32 `json:"subscriptionsLimit,omitempty"` 7680 // 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' 7681 State ProductState `json:"state,omitempty"` 7682} 7683 7684// PropertyCollection paged Property list representation. 7685type PropertyCollection struct { 7686 autorest.Response `json:"-"` 7687 // Value - Page values. 7688 Value *[]PropertyContract `json:"value,omitempty"` 7689 // NextLink - Next page link if any. 7690 NextLink *string `json:"nextLink,omitempty"` 7691} 7692 7693// PropertyCollectionIterator provides access to a complete listing of PropertyContract values. 7694type PropertyCollectionIterator struct { 7695 i int 7696 page PropertyCollectionPage 7697} 7698 7699// NextWithContext advances to the next value. If there was an error making 7700// the request the iterator does not advance and the error is returned. 7701func (iter *PropertyCollectionIterator) NextWithContext(ctx context.Context) (err error) { 7702 if tracing.IsEnabled() { 7703 ctx = tracing.StartSpan(ctx, fqdn+"/PropertyCollectionIterator.NextWithContext") 7704 defer func() { 7705 sc := -1 7706 if iter.Response().Response.Response != nil { 7707 sc = iter.Response().Response.Response.StatusCode 7708 } 7709 tracing.EndSpan(ctx, sc, err) 7710 }() 7711 } 7712 iter.i++ 7713 if iter.i < len(iter.page.Values()) { 7714 return nil 7715 } 7716 err = iter.page.NextWithContext(ctx) 7717 if err != nil { 7718 iter.i-- 7719 return err 7720 } 7721 iter.i = 0 7722 return nil 7723} 7724 7725// Next advances to the next value. If there was an error making 7726// the request the iterator does not advance and the error is returned. 7727// Deprecated: Use NextWithContext() instead. 7728func (iter *PropertyCollectionIterator) Next() error { 7729 return iter.NextWithContext(context.Background()) 7730} 7731 7732// NotDone returns true if the enumeration should be started or is not yet complete. 7733func (iter PropertyCollectionIterator) NotDone() bool { 7734 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 7735} 7736 7737// Response returns the raw server response from the last page request. 7738func (iter PropertyCollectionIterator) Response() PropertyCollection { 7739 return iter.page.Response() 7740} 7741 7742// Value returns the current value or a zero-initialized value if the 7743// iterator has advanced beyond the end of the collection. 7744func (iter PropertyCollectionIterator) Value() PropertyContract { 7745 if !iter.page.NotDone() { 7746 return PropertyContract{} 7747 } 7748 return iter.page.Values()[iter.i] 7749} 7750 7751// Creates a new instance of the PropertyCollectionIterator type. 7752func NewPropertyCollectionIterator(page PropertyCollectionPage) PropertyCollectionIterator { 7753 return PropertyCollectionIterator{page: page} 7754} 7755 7756// IsEmpty returns true if the ListResult contains no values. 7757func (pc PropertyCollection) IsEmpty() bool { 7758 return pc.Value == nil || len(*pc.Value) == 0 7759} 7760 7761// hasNextLink returns true if the NextLink is not empty. 7762func (pc PropertyCollection) hasNextLink() bool { 7763 return pc.NextLink != nil && len(*pc.NextLink) != 0 7764} 7765 7766// propertyCollectionPreparer prepares a request to retrieve the next set of results. 7767// It returns nil if no more results exist. 7768func (pc PropertyCollection) propertyCollectionPreparer(ctx context.Context) (*http.Request, error) { 7769 if !pc.hasNextLink() { 7770 return nil, nil 7771 } 7772 return autorest.Prepare((&http.Request{}).WithContext(ctx), 7773 autorest.AsJSON(), 7774 autorest.AsGet(), 7775 autorest.WithBaseURL(to.String(pc.NextLink))) 7776} 7777 7778// PropertyCollectionPage contains a page of PropertyContract values. 7779type PropertyCollectionPage struct { 7780 fn func(context.Context, PropertyCollection) (PropertyCollection, error) 7781 pc PropertyCollection 7782} 7783 7784// NextWithContext advances to the next page of values. If there was an error making 7785// the request the page does not advance and the error is returned. 7786func (page *PropertyCollectionPage) NextWithContext(ctx context.Context) (err error) { 7787 if tracing.IsEnabled() { 7788 ctx = tracing.StartSpan(ctx, fqdn+"/PropertyCollectionPage.NextWithContext") 7789 defer func() { 7790 sc := -1 7791 if page.Response().Response.Response != nil { 7792 sc = page.Response().Response.Response.StatusCode 7793 } 7794 tracing.EndSpan(ctx, sc, err) 7795 }() 7796 } 7797 for { 7798 next, err := page.fn(ctx, page.pc) 7799 if err != nil { 7800 return err 7801 } 7802 page.pc = next 7803 if !next.hasNextLink() || !next.IsEmpty() { 7804 break 7805 } 7806 } 7807 return nil 7808} 7809 7810// Next advances to the next page of values. If there was an error making 7811// the request the page does not advance and the error is returned. 7812// Deprecated: Use NextWithContext() instead. 7813func (page *PropertyCollectionPage) Next() error { 7814 return page.NextWithContext(context.Background()) 7815} 7816 7817// NotDone returns true if the page enumeration should be started or is not yet complete. 7818func (page PropertyCollectionPage) NotDone() bool { 7819 return !page.pc.IsEmpty() 7820} 7821 7822// Response returns the raw server response from the last page request. 7823func (page PropertyCollectionPage) Response() PropertyCollection { 7824 return page.pc 7825} 7826 7827// Values returns the slice of values for the current page or nil if there are no values. 7828func (page PropertyCollectionPage) Values() []PropertyContract { 7829 if page.pc.IsEmpty() { 7830 return nil 7831 } 7832 return *page.pc.Value 7833} 7834 7835// Creates a new instance of the PropertyCollectionPage type. 7836func NewPropertyCollectionPage(cur PropertyCollection, getNextPage func(context.Context, PropertyCollection) (PropertyCollection, error)) PropertyCollectionPage { 7837 return PropertyCollectionPage{ 7838 fn: getNextPage, 7839 pc: cur, 7840 } 7841} 7842 7843// PropertyContract property details. 7844type PropertyContract struct { 7845 autorest.Response `json:"-"` 7846 // PropertyContractProperties - Property entity contract properties. 7847 *PropertyContractProperties `json:"properties,omitempty"` 7848 // ID - READ-ONLY; Resource ID. 7849 ID *string `json:"id,omitempty"` 7850 // Name - READ-ONLY; Resource name. 7851 Name *string `json:"name,omitempty"` 7852 // Type - READ-ONLY; Resource type for API Management resource. 7853 Type *string `json:"type,omitempty"` 7854} 7855 7856// MarshalJSON is the custom marshaler for PropertyContract. 7857func (pc PropertyContract) MarshalJSON() ([]byte, error) { 7858 objectMap := make(map[string]interface{}) 7859 if pc.PropertyContractProperties != nil { 7860 objectMap["properties"] = pc.PropertyContractProperties 7861 } 7862 return json.Marshal(objectMap) 7863} 7864 7865// UnmarshalJSON is the custom unmarshaler for PropertyContract struct. 7866func (pc *PropertyContract) UnmarshalJSON(body []byte) error { 7867 var m map[string]*json.RawMessage 7868 err := json.Unmarshal(body, &m) 7869 if err != nil { 7870 return err 7871 } 7872 for k, v := range m { 7873 switch k { 7874 case "properties": 7875 if v != nil { 7876 var propertyContractProperties PropertyContractProperties 7877 err = json.Unmarshal(*v, &propertyContractProperties) 7878 if err != nil { 7879 return err 7880 } 7881 pc.PropertyContractProperties = &propertyContractProperties 7882 } 7883 case "id": 7884 if v != nil { 7885 var ID string 7886 err = json.Unmarshal(*v, &ID) 7887 if err != nil { 7888 return err 7889 } 7890 pc.ID = &ID 7891 } 7892 case "name": 7893 if v != nil { 7894 var name string 7895 err = json.Unmarshal(*v, &name) 7896 if err != nil { 7897 return err 7898 } 7899 pc.Name = &name 7900 } 7901 case "type": 7902 if v != nil { 7903 var typeVar string 7904 err = json.Unmarshal(*v, &typeVar) 7905 if err != nil { 7906 return err 7907 } 7908 pc.Type = &typeVar 7909 } 7910 } 7911 } 7912 7913 return nil 7914} 7915 7916// PropertyContractProperties property Contract properties. 7917type PropertyContractProperties struct { 7918 // DisplayName - Unique name of Property. It may contain only letters, digits, period, dash, and underscore characters. 7919 DisplayName *string `json:"displayName,omitempty"` 7920 // Value - Value of the property. Can contain policy expressions. It may not be empty or consist only of whitespace. 7921 Value *string `json:"value,omitempty"` 7922 // Tags - Optional tags that when provided can be used to filter the property list. 7923 Tags *[]string `json:"tags,omitempty"` 7924 // Secret - Determines whether the value is a secret and should be encrypted or not. Default value is false. 7925 Secret *bool `json:"secret,omitempty"` 7926} 7927 7928// PropertyEntityBaseParameters property Entity Base Parameters set. 7929type PropertyEntityBaseParameters struct { 7930 // Tags - Optional tags that when provided can be used to filter the property list. 7931 Tags *[]string `json:"tags,omitempty"` 7932 // Secret - Determines whether the value is a secret and should be encrypted or not. Default value is false. 7933 Secret *bool `json:"secret,omitempty"` 7934} 7935 7936// PropertyUpdateParameterProperties property Contract properties. 7937type PropertyUpdateParameterProperties struct { 7938 // DisplayName - Unique name of Property. It may contain only letters, digits, period, dash, and underscore characters. 7939 DisplayName *string `json:"displayName,omitempty"` 7940 // Value - Value of the property. Can contain policy expressions. It may not be empty or consist only of whitespace. 7941 Value *string `json:"value,omitempty"` 7942 // Tags - Optional tags that when provided can be used to filter the property list. 7943 Tags *[]string `json:"tags,omitempty"` 7944 // Secret - Determines whether the value is a secret and should be encrypted or not. Default value is false. 7945 Secret *bool `json:"secret,omitempty"` 7946} 7947 7948// PropertyUpdateParameters property update Parameters. 7949type PropertyUpdateParameters struct { 7950 // PropertyUpdateParameterProperties - Property entity Update contract properties. 7951 *PropertyUpdateParameterProperties `json:"properties,omitempty"` 7952} 7953 7954// MarshalJSON is the custom marshaler for PropertyUpdateParameters. 7955func (pup PropertyUpdateParameters) MarshalJSON() ([]byte, error) { 7956 objectMap := make(map[string]interface{}) 7957 if pup.PropertyUpdateParameterProperties != nil { 7958 objectMap["properties"] = pup.PropertyUpdateParameterProperties 7959 } 7960 return json.Marshal(objectMap) 7961} 7962 7963// UnmarshalJSON is the custom unmarshaler for PropertyUpdateParameters struct. 7964func (pup *PropertyUpdateParameters) UnmarshalJSON(body []byte) error { 7965 var m map[string]*json.RawMessage 7966 err := json.Unmarshal(body, &m) 7967 if err != nil { 7968 return err 7969 } 7970 for k, v := range m { 7971 switch k { 7972 case "properties": 7973 if v != nil { 7974 var propertyUpdateParameterProperties PropertyUpdateParameterProperties 7975 err = json.Unmarshal(*v, &propertyUpdateParameterProperties) 7976 if err != nil { 7977 return err 7978 } 7979 pup.PropertyUpdateParameterProperties = &propertyUpdateParameterProperties 7980 } 7981 } 7982 } 7983 7984 return nil 7985} 7986 7987// QuotaCounterCollection paged Quota Counter list representation. 7988type QuotaCounterCollection struct { 7989 autorest.Response `json:"-"` 7990 // Value - Quota counter values. 7991 Value *[]QuotaCounterContract `json:"value,omitempty"` 7992 // Count - Total record count number across all pages. 7993 Count *int64 `json:"count,omitempty"` 7994 // NextLink - Next page link if any. 7995 NextLink *string `json:"nextLink,omitempty"` 7996} 7997 7998// QuotaCounterContract quota counter details. 7999type QuotaCounterContract struct { 8000 autorest.Response `json:"-"` 8001 // CounterKey - The Key value of the Counter. Must not be empty. 8002 CounterKey *string `json:"counterKey,omitempty"` 8003 // PeriodKey - Identifier of the Period for which the counter was collected. Must not be empty. 8004 PeriodKey *string `json:"periodKey,omitempty"` 8005 // 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. 8006 PeriodStartTime *date.Time `json:"periodStartTime,omitempty"` 8007 // 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. 8008 PeriodEndTime *date.Time `json:"periodEndTime,omitempty"` 8009 // Value - Quota Value Properties 8010 Value *QuotaCounterValueContractProperties `json:"value,omitempty"` 8011} 8012 8013// QuotaCounterValueContract quota counter value details. 8014type QuotaCounterValueContract struct { 8015 // QuotaCounterValueContractProperties - Quota counter Value Properties. 8016 *QuotaCounterValueContractProperties `json:"value,omitempty"` 8017} 8018 8019// MarshalJSON is the custom marshaler for QuotaCounterValueContract. 8020func (qcvc QuotaCounterValueContract) MarshalJSON() ([]byte, error) { 8021 objectMap := make(map[string]interface{}) 8022 if qcvc.QuotaCounterValueContractProperties != nil { 8023 objectMap["value"] = qcvc.QuotaCounterValueContractProperties 8024 } 8025 return json.Marshal(objectMap) 8026} 8027 8028// UnmarshalJSON is the custom unmarshaler for QuotaCounterValueContract struct. 8029func (qcvc *QuotaCounterValueContract) UnmarshalJSON(body []byte) error { 8030 var m map[string]*json.RawMessage 8031 err := json.Unmarshal(body, &m) 8032 if err != nil { 8033 return err 8034 } 8035 for k, v := range m { 8036 switch k { 8037 case "value": 8038 if v != nil { 8039 var quotaCounterValueContractProperties QuotaCounterValueContractProperties 8040 err = json.Unmarshal(*v, "aCounterValueContractProperties) 8041 if err != nil { 8042 return err 8043 } 8044 qcvc.QuotaCounterValueContractProperties = "aCounterValueContractProperties 8045 } 8046 } 8047 } 8048 8049 return nil 8050} 8051 8052// QuotaCounterValueContractProperties quota counter value details. 8053type QuotaCounterValueContractProperties struct { 8054 // CallsCount - Number of times Counter was called. 8055 CallsCount *int32 `json:"callsCount,omitempty"` 8056 // KbTransferred - Data Transferred in KiloBytes. 8057 KbTransferred *float64 `json:"kbTransferred,omitempty"` 8058} 8059 8060// RecipientEmailCollection paged Recipient User list representation. 8061type RecipientEmailCollection struct { 8062 autorest.Response `json:"-"` 8063 // Value - Page values. 8064 Value *[]RecipientEmailContract `json:"value,omitempty"` 8065 // NextLink - Next page link if any. 8066 NextLink *string `json:"nextLink,omitempty"` 8067} 8068 8069// RecipientEmailContract recipient Email details. 8070type RecipientEmailContract struct { 8071 autorest.Response `json:"-"` 8072 // RecipientEmailContractProperties - Recipient Email contract properties. 8073 *RecipientEmailContractProperties `json:"properties,omitempty"` 8074 // ID - READ-ONLY; Resource ID. 8075 ID *string `json:"id,omitempty"` 8076 // Name - READ-ONLY; Resource name. 8077 Name *string `json:"name,omitempty"` 8078 // Type - READ-ONLY; Resource type for API Management resource. 8079 Type *string `json:"type,omitempty"` 8080} 8081 8082// MarshalJSON is the custom marshaler for RecipientEmailContract. 8083func (rec RecipientEmailContract) MarshalJSON() ([]byte, error) { 8084 objectMap := make(map[string]interface{}) 8085 if rec.RecipientEmailContractProperties != nil { 8086 objectMap["properties"] = rec.RecipientEmailContractProperties 8087 } 8088 return json.Marshal(objectMap) 8089} 8090 8091// UnmarshalJSON is the custom unmarshaler for RecipientEmailContract struct. 8092func (rec *RecipientEmailContract) UnmarshalJSON(body []byte) error { 8093 var m map[string]*json.RawMessage 8094 err := json.Unmarshal(body, &m) 8095 if err != nil { 8096 return err 8097 } 8098 for k, v := range m { 8099 switch k { 8100 case "properties": 8101 if v != nil { 8102 var recipientEmailContractProperties RecipientEmailContractProperties 8103 err = json.Unmarshal(*v, &recipientEmailContractProperties) 8104 if err != nil { 8105 return err 8106 } 8107 rec.RecipientEmailContractProperties = &recipientEmailContractProperties 8108 } 8109 case "id": 8110 if v != nil { 8111 var ID string 8112 err = json.Unmarshal(*v, &ID) 8113 if err != nil { 8114 return err 8115 } 8116 rec.ID = &ID 8117 } 8118 case "name": 8119 if v != nil { 8120 var name string 8121 err = json.Unmarshal(*v, &name) 8122 if err != nil { 8123 return err 8124 } 8125 rec.Name = &name 8126 } 8127 case "type": 8128 if v != nil { 8129 var typeVar string 8130 err = json.Unmarshal(*v, &typeVar) 8131 if err != nil { 8132 return err 8133 } 8134 rec.Type = &typeVar 8135 } 8136 } 8137 } 8138 8139 return nil 8140} 8141 8142// RecipientEmailContractProperties recipient Email Contract Properties. 8143type RecipientEmailContractProperties struct { 8144 // Email - User Email subscribed to notification. 8145 Email *string `json:"email,omitempty"` 8146} 8147 8148// RecipientsContractProperties notification Parameter contract. 8149type RecipientsContractProperties struct { 8150 // Emails - List of Emails subscribed for the notification. 8151 Emails *[]string `json:"emails,omitempty"` 8152 // Users - List of Users subscribed for the notification. 8153 Users *[]string `json:"users,omitempty"` 8154} 8155 8156// RecipientUserCollection paged Recipient User list representation. 8157type RecipientUserCollection struct { 8158 autorest.Response `json:"-"` 8159 // Value - Page values. 8160 Value *[]RecipientUserContract `json:"value,omitempty"` 8161 // NextLink - Next page link if any. 8162 NextLink *string `json:"nextLink,omitempty"` 8163} 8164 8165// RecipientUserContract recipient User details. 8166type RecipientUserContract struct { 8167 autorest.Response `json:"-"` 8168 // RecipientUsersContractProperties - Recipient User entity contract properties. 8169 *RecipientUsersContractProperties `json:"properties,omitempty"` 8170 // ID - READ-ONLY; Resource ID. 8171 ID *string `json:"id,omitempty"` 8172 // Name - READ-ONLY; Resource name. 8173 Name *string `json:"name,omitempty"` 8174 // Type - READ-ONLY; Resource type for API Management resource. 8175 Type *string `json:"type,omitempty"` 8176} 8177 8178// MarshalJSON is the custom marshaler for RecipientUserContract. 8179func (ruc RecipientUserContract) MarshalJSON() ([]byte, error) { 8180 objectMap := make(map[string]interface{}) 8181 if ruc.RecipientUsersContractProperties != nil { 8182 objectMap["properties"] = ruc.RecipientUsersContractProperties 8183 } 8184 return json.Marshal(objectMap) 8185} 8186 8187// UnmarshalJSON is the custom unmarshaler for RecipientUserContract struct. 8188func (ruc *RecipientUserContract) UnmarshalJSON(body []byte) error { 8189 var m map[string]*json.RawMessage 8190 err := json.Unmarshal(body, &m) 8191 if err != nil { 8192 return err 8193 } 8194 for k, v := range m { 8195 switch k { 8196 case "properties": 8197 if v != nil { 8198 var recipientUsersContractProperties RecipientUsersContractProperties 8199 err = json.Unmarshal(*v, &recipientUsersContractProperties) 8200 if err != nil { 8201 return err 8202 } 8203 ruc.RecipientUsersContractProperties = &recipientUsersContractProperties 8204 } 8205 case "id": 8206 if v != nil { 8207 var ID string 8208 err = json.Unmarshal(*v, &ID) 8209 if err != nil { 8210 return err 8211 } 8212 ruc.ID = &ID 8213 } 8214 case "name": 8215 if v != nil { 8216 var name string 8217 err = json.Unmarshal(*v, &name) 8218 if err != nil { 8219 return err 8220 } 8221 ruc.Name = &name 8222 } 8223 case "type": 8224 if v != nil { 8225 var typeVar string 8226 err = json.Unmarshal(*v, &typeVar) 8227 if err != nil { 8228 return err 8229 } 8230 ruc.Type = &typeVar 8231 } 8232 } 8233 } 8234 8235 return nil 8236} 8237 8238// RecipientUsersContractProperties recipient User Contract Properties. 8239type RecipientUsersContractProperties struct { 8240 // UserID - API Management UserId subscribed to notification. 8241 UserID *string `json:"userId,omitempty"` 8242} 8243 8244// RegionContract region profile. 8245type RegionContract struct { 8246 // Name - READ-ONLY; Region name. 8247 Name *string `json:"name,omitempty"` 8248 // IsMasterRegion - whether Region is the master region. 8249 IsMasterRegion *bool `json:"isMasterRegion,omitempty"` 8250 // IsDeleted - whether Region is deleted. 8251 IsDeleted *bool `json:"isDeleted,omitempty"` 8252} 8253 8254// MarshalJSON is the custom marshaler for RegionContract. 8255func (rc RegionContract) MarshalJSON() ([]byte, error) { 8256 objectMap := make(map[string]interface{}) 8257 if rc.IsMasterRegion != nil { 8258 objectMap["isMasterRegion"] = rc.IsMasterRegion 8259 } 8260 if rc.IsDeleted != nil { 8261 objectMap["isDeleted"] = rc.IsDeleted 8262 } 8263 return json.Marshal(objectMap) 8264} 8265 8266// RegionListResult lists Regions operation response details. 8267type RegionListResult struct { 8268 autorest.Response `json:"-"` 8269 // Value - Lists of Regions. 8270 Value *[]RegionContract `json:"value,omitempty"` 8271 // Count - Total record count number across all pages. 8272 Count *int64 `json:"count,omitempty"` 8273 // NextLink - Next page link if any. 8274 NextLink *string `json:"nextLink,omitempty"` 8275} 8276 8277// RegionListResultIterator provides access to a complete listing of RegionContract values. 8278type RegionListResultIterator struct { 8279 i int 8280 page RegionListResultPage 8281} 8282 8283// NextWithContext advances to the next value. If there was an error making 8284// the request the iterator does not advance and the error is returned. 8285func (iter *RegionListResultIterator) NextWithContext(ctx context.Context) (err error) { 8286 if tracing.IsEnabled() { 8287 ctx = tracing.StartSpan(ctx, fqdn+"/RegionListResultIterator.NextWithContext") 8288 defer func() { 8289 sc := -1 8290 if iter.Response().Response.Response != nil { 8291 sc = iter.Response().Response.Response.StatusCode 8292 } 8293 tracing.EndSpan(ctx, sc, err) 8294 }() 8295 } 8296 iter.i++ 8297 if iter.i < len(iter.page.Values()) { 8298 return nil 8299 } 8300 err = iter.page.NextWithContext(ctx) 8301 if err != nil { 8302 iter.i-- 8303 return err 8304 } 8305 iter.i = 0 8306 return nil 8307} 8308 8309// Next advances to the next value. If there was an error making 8310// the request the iterator does not advance and the error is returned. 8311// Deprecated: Use NextWithContext() instead. 8312func (iter *RegionListResultIterator) Next() error { 8313 return iter.NextWithContext(context.Background()) 8314} 8315 8316// NotDone returns true if the enumeration should be started or is not yet complete. 8317func (iter RegionListResultIterator) NotDone() bool { 8318 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 8319} 8320 8321// Response returns the raw server response from the last page request. 8322func (iter RegionListResultIterator) Response() RegionListResult { 8323 return iter.page.Response() 8324} 8325 8326// Value returns the current value or a zero-initialized value if the 8327// iterator has advanced beyond the end of the collection. 8328func (iter RegionListResultIterator) Value() RegionContract { 8329 if !iter.page.NotDone() { 8330 return RegionContract{} 8331 } 8332 return iter.page.Values()[iter.i] 8333} 8334 8335// Creates a new instance of the RegionListResultIterator type. 8336func NewRegionListResultIterator(page RegionListResultPage) RegionListResultIterator { 8337 return RegionListResultIterator{page: page} 8338} 8339 8340// IsEmpty returns true if the ListResult contains no values. 8341func (rlr RegionListResult) IsEmpty() bool { 8342 return rlr.Value == nil || len(*rlr.Value) == 0 8343} 8344 8345// hasNextLink returns true if the NextLink is not empty. 8346func (rlr RegionListResult) hasNextLink() bool { 8347 return rlr.NextLink != nil && len(*rlr.NextLink) != 0 8348} 8349 8350// regionListResultPreparer prepares a request to retrieve the next set of results. 8351// It returns nil if no more results exist. 8352func (rlr RegionListResult) regionListResultPreparer(ctx context.Context) (*http.Request, error) { 8353 if !rlr.hasNextLink() { 8354 return nil, nil 8355 } 8356 return autorest.Prepare((&http.Request{}).WithContext(ctx), 8357 autorest.AsJSON(), 8358 autorest.AsGet(), 8359 autorest.WithBaseURL(to.String(rlr.NextLink))) 8360} 8361 8362// RegionListResultPage contains a page of RegionContract values. 8363type RegionListResultPage struct { 8364 fn func(context.Context, RegionListResult) (RegionListResult, error) 8365 rlr RegionListResult 8366} 8367 8368// NextWithContext advances to the next page of values. If there was an error making 8369// the request the page does not advance and the error is returned. 8370func (page *RegionListResultPage) NextWithContext(ctx context.Context) (err error) { 8371 if tracing.IsEnabled() { 8372 ctx = tracing.StartSpan(ctx, fqdn+"/RegionListResultPage.NextWithContext") 8373 defer func() { 8374 sc := -1 8375 if page.Response().Response.Response != nil { 8376 sc = page.Response().Response.Response.StatusCode 8377 } 8378 tracing.EndSpan(ctx, sc, err) 8379 }() 8380 } 8381 for { 8382 next, err := page.fn(ctx, page.rlr) 8383 if err != nil { 8384 return err 8385 } 8386 page.rlr = next 8387 if !next.hasNextLink() || !next.IsEmpty() { 8388 break 8389 } 8390 } 8391 return nil 8392} 8393 8394// Next advances to the next page of values. If there was an error making 8395// the request the page does not advance and the error is returned. 8396// Deprecated: Use NextWithContext() instead. 8397func (page *RegionListResultPage) Next() error { 8398 return page.NextWithContext(context.Background()) 8399} 8400 8401// NotDone returns true if the page enumeration should be started or is not yet complete. 8402func (page RegionListResultPage) NotDone() bool { 8403 return !page.rlr.IsEmpty() 8404} 8405 8406// Response returns the raw server response from the last page request. 8407func (page RegionListResultPage) Response() RegionListResult { 8408 return page.rlr 8409} 8410 8411// Values returns the slice of values for the current page or nil if there are no values. 8412func (page RegionListResultPage) Values() []RegionContract { 8413 if page.rlr.IsEmpty() { 8414 return nil 8415 } 8416 return *page.rlr.Value 8417} 8418 8419// Creates a new instance of the RegionListResultPage type. 8420func NewRegionListResultPage(cur RegionListResult, getNextPage func(context.Context, RegionListResult) (RegionListResult, error)) RegionListResultPage { 8421 return RegionListResultPage{ 8422 fn: getNextPage, 8423 rlr: cur, 8424 } 8425} 8426 8427// RegistrationDelegationSettingsProperties user registration delegation settings properties. 8428type RegistrationDelegationSettingsProperties struct { 8429 // Enabled - Enable or disable delegation for user registration. 8430 Enabled *bool `json:"enabled,omitempty"` 8431} 8432 8433// ReportCollection paged Report records list representation. 8434type ReportCollection struct { 8435 autorest.Response `json:"-"` 8436 // Value - Page values. 8437 Value *[]ReportRecordContract `json:"value,omitempty"` 8438 // Count - Total record count number across all pages. 8439 Count *int64 `json:"count,omitempty"` 8440 // NextLink - Next page link if any. 8441 NextLink *string `json:"nextLink,omitempty"` 8442} 8443 8444// ReportCollectionIterator provides access to a complete listing of ReportRecordContract values. 8445type ReportCollectionIterator struct { 8446 i int 8447 page ReportCollectionPage 8448} 8449 8450// NextWithContext advances to the next value. If there was an error making 8451// the request the iterator does not advance and the error is returned. 8452func (iter *ReportCollectionIterator) NextWithContext(ctx context.Context) (err error) { 8453 if tracing.IsEnabled() { 8454 ctx = tracing.StartSpan(ctx, fqdn+"/ReportCollectionIterator.NextWithContext") 8455 defer func() { 8456 sc := -1 8457 if iter.Response().Response.Response != nil { 8458 sc = iter.Response().Response.Response.StatusCode 8459 } 8460 tracing.EndSpan(ctx, sc, err) 8461 }() 8462 } 8463 iter.i++ 8464 if iter.i < len(iter.page.Values()) { 8465 return nil 8466 } 8467 err = iter.page.NextWithContext(ctx) 8468 if err != nil { 8469 iter.i-- 8470 return err 8471 } 8472 iter.i = 0 8473 return nil 8474} 8475 8476// Next advances to the next value. If there was an error making 8477// the request the iterator does not advance and the error is returned. 8478// Deprecated: Use NextWithContext() instead. 8479func (iter *ReportCollectionIterator) Next() error { 8480 return iter.NextWithContext(context.Background()) 8481} 8482 8483// NotDone returns true if the enumeration should be started or is not yet complete. 8484func (iter ReportCollectionIterator) NotDone() bool { 8485 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 8486} 8487 8488// Response returns the raw server response from the last page request. 8489func (iter ReportCollectionIterator) Response() ReportCollection { 8490 return iter.page.Response() 8491} 8492 8493// Value returns the current value or a zero-initialized value if the 8494// iterator has advanced beyond the end of the collection. 8495func (iter ReportCollectionIterator) Value() ReportRecordContract { 8496 if !iter.page.NotDone() { 8497 return ReportRecordContract{} 8498 } 8499 return iter.page.Values()[iter.i] 8500} 8501 8502// Creates a new instance of the ReportCollectionIterator type. 8503func NewReportCollectionIterator(page ReportCollectionPage) ReportCollectionIterator { 8504 return ReportCollectionIterator{page: page} 8505} 8506 8507// IsEmpty returns true if the ListResult contains no values. 8508func (rc ReportCollection) IsEmpty() bool { 8509 return rc.Value == nil || len(*rc.Value) == 0 8510} 8511 8512// hasNextLink returns true if the NextLink is not empty. 8513func (rc ReportCollection) hasNextLink() bool { 8514 return rc.NextLink != nil && len(*rc.NextLink) != 0 8515} 8516 8517// reportCollectionPreparer prepares a request to retrieve the next set of results. 8518// It returns nil if no more results exist. 8519func (rc ReportCollection) reportCollectionPreparer(ctx context.Context) (*http.Request, error) { 8520 if !rc.hasNextLink() { 8521 return nil, nil 8522 } 8523 return autorest.Prepare((&http.Request{}).WithContext(ctx), 8524 autorest.AsJSON(), 8525 autorest.AsGet(), 8526 autorest.WithBaseURL(to.String(rc.NextLink))) 8527} 8528 8529// ReportCollectionPage contains a page of ReportRecordContract values. 8530type ReportCollectionPage struct { 8531 fn func(context.Context, ReportCollection) (ReportCollection, error) 8532 rc ReportCollection 8533} 8534 8535// NextWithContext advances to the next page of values. If there was an error making 8536// the request the page does not advance and the error is returned. 8537func (page *ReportCollectionPage) NextWithContext(ctx context.Context) (err error) { 8538 if tracing.IsEnabled() { 8539 ctx = tracing.StartSpan(ctx, fqdn+"/ReportCollectionPage.NextWithContext") 8540 defer func() { 8541 sc := -1 8542 if page.Response().Response.Response != nil { 8543 sc = page.Response().Response.Response.StatusCode 8544 } 8545 tracing.EndSpan(ctx, sc, err) 8546 }() 8547 } 8548 for { 8549 next, err := page.fn(ctx, page.rc) 8550 if err != nil { 8551 return err 8552 } 8553 page.rc = next 8554 if !next.hasNextLink() || !next.IsEmpty() { 8555 break 8556 } 8557 } 8558 return nil 8559} 8560 8561// Next advances to the next page of values. If there was an error making 8562// the request the page does not advance and the error is returned. 8563// Deprecated: Use NextWithContext() instead. 8564func (page *ReportCollectionPage) Next() error { 8565 return page.NextWithContext(context.Background()) 8566} 8567 8568// NotDone returns true if the page enumeration should be started or is not yet complete. 8569func (page ReportCollectionPage) NotDone() bool { 8570 return !page.rc.IsEmpty() 8571} 8572 8573// Response returns the raw server response from the last page request. 8574func (page ReportCollectionPage) Response() ReportCollection { 8575 return page.rc 8576} 8577 8578// Values returns the slice of values for the current page or nil if there are no values. 8579func (page ReportCollectionPage) Values() []ReportRecordContract { 8580 if page.rc.IsEmpty() { 8581 return nil 8582 } 8583 return *page.rc.Value 8584} 8585 8586// Creates a new instance of the ReportCollectionPage type. 8587func NewReportCollectionPage(cur ReportCollection, getNextPage func(context.Context, ReportCollection) (ReportCollection, error)) ReportCollectionPage { 8588 return ReportCollectionPage{ 8589 fn: getNextPage, 8590 rc: cur, 8591 } 8592} 8593 8594// ReportRecordContract report data. 8595type ReportRecordContract struct { 8596 // Name - Name depending on report endpoint specifies product, API, operation or developer name. 8597 Name *string `json:"name,omitempty"` 8598 // Timestamp - Start of aggregation period. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. 8599 Timestamp *date.Time `json:"timestamp,omitempty"` 8600 // 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). 8601 Interval *string `json:"interval,omitempty"` 8602 // Country - Country to which this record data is related. 8603 Country *string `json:"country,omitempty"` 8604 // Region - Country region to which this record data is related. 8605 Region *string `json:"region,omitempty"` 8606 // Zip - Zip code to which this record data is related. 8607 Zip *string `json:"zip,omitempty"` 8608 // UserID - READ-ONLY; User identifier path. /users/{userId} 8609 UserID *string `json:"userId,omitempty"` 8610 // ProductID - READ-ONLY; Product identifier path. /products/{productId} 8611 ProductID *string `json:"productId,omitempty"` 8612 // APIID - API identifier path. /apis/{apiId} 8613 APIID *string `json:"apiId,omitempty"` 8614 // OperationID - Operation identifier path. /apis/{apiId}/operations/{operationId} 8615 OperationID *string `json:"operationId,omitempty"` 8616 // APIRegion - API region identifier. 8617 APIRegion *string `json:"apiRegion,omitempty"` 8618 // SubscriptionID - Subscription identifier path. /subscriptions/{subscriptionId} 8619 SubscriptionID *string `json:"subscriptionId,omitempty"` 8620 // CallCountSuccess - Number of successful calls. This includes calls returning HttpStatusCode <= 301 and HttpStatusCode.NotModified and HttpStatusCode.TemporaryRedirect 8621 CallCountSuccess *int32 `json:"callCountSuccess,omitempty"` 8622 // CallCountBlocked - Number of calls blocked due to invalid credentials. This includes calls returning HttpStatusCode.Unauthorized and HttpStatusCode.Forbidden and HttpStatusCode.TooManyRequests 8623 CallCountBlocked *int32 `json:"callCountBlocked,omitempty"` 8624 // 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 8625 CallCountFailed *int32 `json:"callCountFailed,omitempty"` 8626 // CallCountOther - Number of other calls. 8627 CallCountOther *int32 `json:"callCountOther,omitempty"` 8628 // CallCountTotal - Total number of calls. 8629 CallCountTotal *int32 `json:"callCountTotal,omitempty"` 8630 // Bandwidth - Bandwidth consumed. 8631 Bandwidth *int64 `json:"bandwidth,omitempty"` 8632 // CacheHitCount - Number of times when content was served from cache policy. 8633 CacheHitCount *int32 `json:"cacheHitCount,omitempty"` 8634 // CacheMissCount - Number of times content was fetched from backend. 8635 CacheMissCount *int32 `json:"cacheMissCount,omitempty"` 8636 // APITimeAvg - Average time it took to process request. 8637 APITimeAvg *float64 `json:"apiTimeAvg,omitempty"` 8638 // APITimeMin - Minimum time it took to process request. 8639 APITimeMin *float64 `json:"apiTimeMin,omitempty"` 8640 // APITimeMax - Maximum time it took to process request. 8641 APITimeMax *float64 `json:"apiTimeMax,omitempty"` 8642 // ServiceTimeAvg - Average time it took to process request on backend. 8643 ServiceTimeAvg *float64 `json:"serviceTimeAvg,omitempty"` 8644 // ServiceTimeMin - Minimum time it took to process request on backend. 8645 ServiceTimeMin *float64 `json:"serviceTimeMin,omitempty"` 8646 // ServiceTimeMax - Maximum time it took to process request on backend. 8647 ServiceTimeMax *float64 `json:"serviceTimeMax,omitempty"` 8648} 8649 8650// MarshalJSON is the custom marshaler for ReportRecordContract. 8651func (rrc ReportRecordContract) MarshalJSON() ([]byte, error) { 8652 objectMap := make(map[string]interface{}) 8653 if rrc.Name != nil { 8654 objectMap["name"] = rrc.Name 8655 } 8656 if rrc.Timestamp != nil { 8657 objectMap["timestamp"] = rrc.Timestamp 8658 } 8659 if rrc.Interval != nil { 8660 objectMap["interval"] = rrc.Interval 8661 } 8662 if rrc.Country != nil { 8663 objectMap["country"] = rrc.Country 8664 } 8665 if rrc.Region != nil { 8666 objectMap["region"] = rrc.Region 8667 } 8668 if rrc.Zip != nil { 8669 objectMap["zip"] = rrc.Zip 8670 } 8671 if rrc.APIID != nil { 8672 objectMap["apiId"] = rrc.APIID 8673 } 8674 if rrc.OperationID != nil { 8675 objectMap["operationId"] = rrc.OperationID 8676 } 8677 if rrc.APIRegion != nil { 8678 objectMap["apiRegion"] = rrc.APIRegion 8679 } 8680 if rrc.SubscriptionID != nil { 8681 objectMap["subscriptionId"] = rrc.SubscriptionID 8682 } 8683 if rrc.CallCountSuccess != nil { 8684 objectMap["callCountSuccess"] = rrc.CallCountSuccess 8685 } 8686 if rrc.CallCountBlocked != nil { 8687 objectMap["callCountBlocked"] = rrc.CallCountBlocked 8688 } 8689 if rrc.CallCountFailed != nil { 8690 objectMap["callCountFailed"] = rrc.CallCountFailed 8691 } 8692 if rrc.CallCountOther != nil { 8693 objectMap["callCountOther"] = rrc.CallCountOther 8694 } 8695 if rrc.CallCountTotal != nil { 8696 objectMap["callCountTotal"] = rrc.CallCountTotal 8697 } 8698 if rrc.Bandwidth != nil { 8699 objectMap["bandwidth"] = rrc.Bandwidth 8700 } 8701 if rrc.CacheHitCount != nil { 8702 objectMap["cacheHitCount"] = rrc.CacheHitCount 8703 } 8704 if rrc.CacheMissCount != nil { 8705 objectMap["cacheMissCount"] = rrc.CacheMissCount 8706 } 8707 if rrc.APITimeAvg != nil { 8708 objectMap["apiTimeAvg"] = rrc.APITimeAvg 8709 } 8710 if rrc.APITimeMin != nil { 8711 objectMap["apiTimeMin"] = rrc.APITimeMin 8712 } 8713 if rrc.APITimeMax != nil { 8714 objectMap["apiTimeMax"] = rrc.APITimeMax 8715 } 8716 if rrc.ServiceTimeAvg != nil { 8717 objectMap["serviceTimeAvg"] = rrc.ServiceTimeAvg 8718 } 8719 if rrc.ServiceTimeMin != nil { 8720 objectMap["serviceTimeMin"] = rrc.ServiceTimeMin 8721 } 8722 if rrc.ServiceTimeMax != nil { 8723 objectMap["serviceTimeMax"] = rrc.ServiceTimeMax 8724 } 8725 return json.Marshal(objectMap) 8726} 8727 8728// RepresentationContract operation request/response representation details. 8729type RepresentationContract struct { 8730 // ContentType - Specifies a registered or custom content type for this representation, e.g. application/xml. 8731 ContentType *string `json:"contentType,omitempty"` 8732 // Sample - An example of the representation. 8733 Sample *string `json:"sample,omitempty"` 8734 // SchemaID - Schema identifier. Applicable only if 'contentType' value is neither 'application/x-www-form-urlencoded' nor 'multipart/form-data'. 8735 SchemaID *string `json:"schemaId,omitempty"` 8736 // TypeName - Type name defined by the schema. Applicable only if 'contentType' value is neither 'application/x-www-form-urlencoded' nor 'multipart/form-data'. 8737 TypeName *string `json:"typeName,omitempty"` 8738 // FormParameters - Collection of form parameters. Required if 'contentType' value is either 'application/x-www-form-urlencoded' or 'multipart/form-data'.. 8739 FormParameters *[]ParameterContract `json:"formParameters,omitempty"` 8740} 8741 8742// RequestContract operation request details. 8743type RequestContract struct { 8744 // Description - Operation request description. 8745 Description *string `json:"description,omitempty"` 8746 // QueryParameters - Collection of operation request query parameters. 8747 QueryParameters *[]ParameterContract `json:"queryParameters,omitempty"` 8748 // Headers - Collection of operation request headers. 8749 Headers *[]ParameterContract `json:"headers,omitempty"` 8750 // Representations - Collection of operation request representations. 8751 Representations *[]RepresentationContract `json:"representations,omitempty"` 8752} 8753 8754// RequestReportCollection paged Report records list representation. 8755type RequestReportCollection struct { 8756 autorest.Response `json:"-"` 8757 // Value - Page values. 8758 Value *[]RequestReportRecordContract `json:"value,omitempty"` 8759 // Count - Total record count number across all pages. 8760 Count *int64 `json:"count,omitempty"` 8761} 8762 8763// RequestReportRecordContract request Report data. 8764type RequestReportRecordContract struct { 8765 // APIID - API identifier path. /apis/{apiId} 8766 APIID *string `json:"apiId,omitempty"` 8767 // OperationID - Operation identifier path. /apis/{apiId}/operations/{operationId} 8768 OperationID *string `json:"operationId,omitempty"` 8769 // ProductID - READ-ONLY; Product identifier path. /products/{productId} 8770 ProductID *string `json:"productId,omitempty"` 8771 // UserID - READ-ONLY; User identifier path. /users/{userId} 8772 UserID *string `json:"userId,omitempty"` 8773 // Method - The HTTP method associated with this request.. 8774 Method *string `json:"method,omitempty"` 8775 // URL - The full URL associated with this request. 8776 URL *string `json:"url,omitempty"` 8777 // IPAddress - The client IP address associated with this request. 8778 IPAddress *string `json:"ipAddress,omitempty"` 8779 // BackendResponseCode - The HTTP status code received by the gateway as a result of forwarding this request to the backend. 8780 BackendResponseCode *string `json:"backendResponseCode,omitempty"` 8781 // ResponseCode - The HTTP status code returned by the gateway. 8782 ResponseCode *int32 `json:"responseCode,omitempty"` 8783 // ResponseSize - The size of the response returned by the gateway. 8784 ResponseSize *int32 `json:"responseSize,omitempty"` 8785 // Timestamp - The date and time when this request was received by the gateway in ISO 8601 format. 8786 Timestamp *date.Time `json:"timestamp,omitempty"` 8787 // 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. 8788 Cache *string `json:"cache,omitempty"` 8789 // APITime - The total time it took to process this request. 8790 APITime *float64 `json:"apiTime,omitempty"` 8791 // ServiceTime - he time it took to forward this request to the backend and get the response back. 8792 ServiceTime *float64 `json:"serviceTime,omitempty"` 8793 // APIRegion - Azure region where the gateway that processed this request is located. 8794 APIRegion *string `json:"apiRegion,omitempty"` 8795 // SubscriptionID - Subscription identifier path. /subscriptions/{subscriptionId} 8796 SubscriptionID *string `json:"subscriptionId,omitempty"` 8797 // RequestID - Request Identifier. 8798 RequestID *string `json:"requestId,omitempty"` 8799 // RequestSize - The size of this request.. 8800 RequestSize *int32 `json:"requestSize,omitempty"` 8801} 8802 8803// MarshalJSON is the custom marshaler for RequestReportRecordContract. 8804func (rrrc RequestReportRecordContract) MarshalJSON() ([]byte, error) { 8805 objectMap := make(map[string]interface{}) 8806 if rrrc.APIID != nil { 8807 objectMap["apiId"] = rrrc.APIID 8808 } 8809 if rrrc.OperationID != nil { 8810 objectMap["operationId"] = rrrc.OperationID 8811 } 8812 if rrrc.Method != nil { 8813 objectMap["method"] = rrrc.Method 8814 } 8815 if rrrc.URL != nil { 8816 objectMap["url"] = rrrc.URL 8817 } 8818 if rrrc.IPAddress != nil { 8819 objectMap["ipAddress"] = rrrc.IPAddress 8820 } 8821 if rrrc.BackendResponseCode != nil { 8822 objectMap["backendResponseCode"] = rrrc.BackendResponseCode 8823 } 8824 if rrrc.ResponseCode != nil { 8825 objectMap["responseCode"] = rrrc.ResponseCode 8826 } 8827 if rrrc.ResponseSize != nil { 8828 objectMap["responseSize"] = rrrc.ResponseSize 8829 } 8830 if rrrc.Timestamp != nil { 8831 objectMap["timestamp"] = rrrc.Timestamp 8832 } 8833 if rrrc.Cache != nil { 8834 objectMap["cache"] = rrrc.Cache 8835 } 8836 if rrrc.APITime != nil { 8837 objectMap["apiTime"] = rrrc.APITime 8838 } 8839 if rrrc.ServiceTime != nil { 8840 objectMap["serviceTime"] = rrrc.ServiceTime 8841 } 8842 if rrrc.APIRegion != nil { 8843 objectMap["apiRegion"] = rrrc.APIRegion 8844 } 8845 if rrrc.SubscriptionID != nil { 8846 objectMap["subscriptionId"] = rrrc.SubscriptionID 8847 } 8848 if rrrc.RequestID != nil { 8849 objectMap["requestId"] = rrrc.RequestID 8850 } 8851 if rrrc.RequestSize != nil { 8852 objectMap["requestSize"] = rrrc.RequestSize 8853 } 8854 return json.Marshal(objectMap) 8855} 8856 8857// Resource the Resource definition. 8858type Resource struct { 8859 // ID - READ-ONLY; Resource ID. 8860 ID *string `json:"id,omitempty"` 8861 // Name - READ-ONLY; Resource name. 8862 Name *string `json:"name,omitempty"` 8863 // Type - READ-ONLY; Resource type for API Management resource. 8864 Type *string `json:"type,omitempty"` 8865} 8866 8867// MarshalJSON is the custom marshaler for Resource. 8868func (r Resource) MarshalJSON() ([]byte, error) { 8869 objectMap := make(map[string]interface{}) 8870 return json.Marshal(objectMap) 8871} 8872 8873// ResourceSku describes an available API Management SKU. 8874type ResourceSku struct { 8875 // Name - Name of the Sku. Possible values include: 'SkuTypeDeveloper', 'SkuTypeStandard', 'SkuTypePremium', 'SkuTypeBasic', 'SkuTypeConsumption' 8876 Name SkuType `json:"name,omitempty"` 8877} 8878 8879// ResourceSkuCapacity describes scaling information of a SKU. 8880type ResourceSkuCapacity struct { 8881 // Minimum - READ-ONLY; The minimum capacity. 8882 Minimum *int32 `json:"minimum,omitempty"` 8883 // Maximum - READ-ONLY; The maximum capacity that can be set. 8884 Maximum *int32 `json:"maximum,omitempty"` 8885 // Default - READ-ONLY; The default capacity. 8886 Default *int32 `json:"default,omitempty"` 8887 // ScaleType - READ-ONLY; The scale type applicable to the sku. Possible values include: 'Automatic', 'Manual', 'None' 8888 ScaleType ResourceSkuCapacityScaleType `json:"scaleType,omitempty"` 8889} 8890 8891// MarshalJSON is the custom marshaler for ResourceSkuCapacity. 8892func (rsc ResourceSkuCapacity) MarshalJSON() ([]byte, error) { 8893 objectMap := make(map[string]interface{}) 8894 return json.Marshal(objectMap) 8895} 8896 8897// ResourceSkuResult describes an available API Management service SKU. 8898type ResourceSkuResult struct { 8899 // ResourceType - READ-ONLY; The type of resource the SKU applies to. 8900 ResourceType *string `json:"resourceType,omitempty"` 8901 // Sku - READ-ONLY; Specifies API Management SKU. 8902 Sku *ResourceSku `json:"sku,omitempty"` 8903 // Capacity - READ-ONLY; Specifies the number of API Management units. 8904 Capacity *ResourceSkuCapacity `json:"capacity,omitempty"` 8905} 8906 8907// MarshalJSON is the custom marshaler for ResourceSkuResult. 8908func (rsr ResourceSkuResult) MarshalJSON() ([]byte, error) { 8909 objectMap := make(map[string]interface{}) 8910 return json.Marshal(objectMap) 8911} 8912 8913// ResourceSkuResults the API Management service SKUs operation response. 8914type ResourceSkuResults struct { 8915 autorest.Response `json:"-"` 8916 // Value - The list of skus available for the service. 8917 Value *[]ResourceSkuResult `json:"value,omitempty"` 8918 // NextLink - The uri to fetch the next page of API Management service Skus. 8919 NextLink *string `json:"nextLink,omitempty"` 8920} 8921 8922// ResourceSkuResultsIterator provides access to a complete listing of ResourceSkuResult values. 8923type ResourceSkuResultsIterator struct { 8924 i int 8925 page ResourceSkuResultsPage 8926} 8927 8928// NextWithContext advances to the next value. If there was an error making 8929// the request the iterator does not advance and the error is returned. 8930func (iter *ResourceSkuResultsIterator) NextWithContext(ctx context.Context) (err error) { 8931 if tracing.IsEnabled() { 8932 ctx = tracing.StartSpan(ctx, fqdn+"/ResourceSkuResultsIterator.NextWithContext") 8933 defer func() { 8934 sc := -1 8935 if iter.Response().Response.Response != nil { 8936 sc = iter.Response().Response.Response.StatusCode 8937 } 8938 tracing.EndSpan(ctx, sc, err) 8939 }() 8940 } 8941 iter.i++ 8942 if iter.i < len(iter.page.Values()) { 8943 return nil 8944 } 8945 err = iter.page.NextWithContext(ctx) 8946 if err != nil { 8947 iter.i-- 8948 return err 8949 } 8950 iter.i = 0 8951 return nil 8952} 8953 8954// Next advances to the next value. If there was an error making 8955// the request the iterator does not advance and the error is returned. 8956// Deprecated: Use NextWithContext() instead. 8957func (iter *ResourceSkuResultsIterator) Next() error { 8958 return iter.NextWithContext(context.Background()) 8959} 8960 8961// NotDone returns true if the enumeration should be started or is not yet complete. 8962func (iter ResourceSkuResultsIterator) NotDone() bool { 8963 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 8964} 8965 8966// Response returns the raw server response from the last page request. 8967func (iter ResourceSkuResultsIterator) Response() ResourceSkuResults { 8968 return iter.page.Response() 8969} 8970 8971// Value returns the current value or a zero-initialized value if the 8972// iterator has advanced beyond the end of the collection. 8973func (iter ResourceSkuResultsIterator) Value() ResourceSkuResult { 8974 if !iter.page.NotDone() { 8975 return ResourceSkuResult{} 8976 } 8977 return iter.page.Values()[iter.i] 8978} 8979 8980// Creates a new instance of the ResourceSkuResultsIterator type. 8981func NewResourceSkuResultsIterator(page ResourceSkuResultsPage) ResourceSkuResultsIterator { 8982 return ResourceSkuResultsIterator{page: page} 8983} 8984 8985// IsEmpty returns true if the ListResult contains no values. 8986func (rsr ResourceSkuResults) IsEmpty() bool { 8987 return rsr.Value == nil || len(*rsr.Value) == 0 8988} 8989 8990// hasNextLink returns true if the NextLink is not empty. 8991func (rsr ResourceSkuResults) hasNextLink() bool { 8992 return rsr.NextLink != nil && len(*rsr.NextLink) != 0 8993} 8994 8995// resourceSkuResultsPreparer prepares a request to retrieve the next set of results. 8996// It returns nil if no more results exist. 8997func (rsr ResourceSkuResults) resourceSkuResultsPreparer(ctx context.Context) (*http.Request, error) { 8998 if !rsr.hasNextLink() { 8999 return nil, nil 9000 } 9001 return autorest.Prepare((&http.Request{}).WithContext(ctx), 9002 autorest.AsJSON(), 9003 autorest.AsGet(), 9004 autorest.WithBaseURL(to.String(rsr.NextLink))) 9005} 9006 9007// ResourceSkuResultsPage contains a page of ResourceSkuResult values. 9008type ResourceSkuResultsPage struct { 9009 fn func(context.Context, ResourceSkuResults) (ResourceSkuResults, error) 9010 rsr ResourceSkuResults 9011} 9012 9013// NextWithContext advances to the next page of values. If there was an error making 9014// the request the page does not advance and the error is returned. 9015func (page *ResourceSkuResultsPage) NextWithContext(ctx context.Context) (err error) { 9016 if tracing.IsEnabled() { 9017 ctx = tracing.StartSpan(ctx, fqdn+"/ResourceSkuResultsPage.NextWithContext") 9018 defer func() { 9019 sc := -1 9020 if page.Response().Response.Response != nil { 9021 sc = page.Response().Response.Response.StatusCode 9022 } 9023 tracing.EndSpan(ctx, sc, err) 9024 }() 9025 } 9026 for { 9027 next, err := page.fn(ctx, page.rsr) 9028 if err != nil { 9029 return err 9030 } 9031 page.rsr = next 9032 if !next.hasNextLink() || !next.IsEmpty() { 9033 break 9034 } 9035 } 9036 return nil 9037} 9038 9039// Next advances to the next page of values. If there was an error making 9040// the request the page does not advance and the error is returned. 9041// Deprecated: Use NextWithContext() instead. 9042func (page *ResourceSkuResultsPage) Next() error { 9043 return page.NextWithContext(context.Background()) 9044} 9045 9046// NotDone returns true if the page enumeration should be started or is not yet complete. 9047func (page ResourceSkuResultsPage) NotDone() bool { 9048 return !page.rsr.IsEmpty() 9049} 9050 9051// Response returns the raw server response from the last page request. 9052func (page ResourceSkuResultsPage) Response() ResourceSkuResults { 9053 return page.rsr 9054} 9055 9056// Values returns the slice of values for the current page or nil if there are no values. 9057func (page ResourceSkuResultsPage) Values() []ResourceSkuResult { 9058 if page.rsr.IsEmpty() { 9059 return nil 9060 } 9061 return *page.rsr.Value 9062} 9063 9064// Creates a new instance of the ResourceSkuResultsPage type. 9065func NewResourceSkuResultsPage(cur ResourceSkuResults, getNextPage func(context.Context, ResourceSkuResults) (ResourceSkuResults, error)) ResourceSkuResultsPage { 9066 return ResourceSkuResultsPage{ 9067 fn: getNextPage, 9068 rsr: cur, 9069 } 9070} 9071 9072// ResponseContract operation response details. 9073type ResponseContract struct { 9074 // StatusCode - Operation response HTTP status code. 9075 StatusCode *int32 `json:"statusCode,omitempty"` 9076 // Description - Operation response description. 9077 Description *string `json:"description,omitempty"` 9078 // Representations - Collection of operation response representations. 9079 Representations *[]RepresentationContract `json:"representations,omitempty"` 9080 // Headers - Collection of operation response headers. 9081 Headers *[]ParameterContract `json:"headers,omitempty"` 9082} 9083 9084// SamplingSettings sampling settings for Diagnostic. 9085type SamplingSettings struct { 9086 // SamplingType - Sampling type. Possible values include: 'Fixed' 9087 SamplingType SamplingType `json:"samplingType,omitempty"` 9088 // Percentage - Rate of sampling for fixed-rate sampling. 9089 Percentage *float64 `json:"percentage,omitempty"` 9090} 9091 9092// SaveConfigurationParameter parameters supplied to the Save Tenant Configuration operation. 9093type SaveConfigurationParameter struct { 9094 // Branch - The name of the Git branch in which to commit the current configuration snapshot. 9095 Branch *string `json:"branch,omitempty"` 9096 // 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. 9097 Force *bool `json:"force,omitempty"` 9098} 9099 9100// SchemaCollection the response of the list schema operation. 9101type SchemaCollection struct { 9102 autorest.Response `json:"-"` 9103 // Value - READ-ONLY; Api Schema Contract value. 9104 Value *[]SchemaContract `json:"value,omitempty"` 9105 // NextLink - READ-ONLY; Next page link if any. 9106 NextLink *string `json:"nextLink,omitempty"` 9107} 9108 9109// MarshalJSON is the custom marshaler for SchemaCollection. 9110func (sc SchemaCollection) MarshalJSON() ([]byte, error) { 9111 objectMap := make(map[string]interface{}) 9112 return json.Marshal(objectMap) 9113} 9114 9115// SchemaCollectionIterator provides access to a complete listing of SchemaContract values. 9116type SchemaCollectionIterator struct { 9117 i int 9118 page SchemaCollectionPage 9119} 9120 9121// NextWithContext advances to the next value. If there was an error making 9122// the request the iterator does not advance and the error is returned. 9123func (iter *SchemaCollectionIterator) NextWithContext(ctx context.Context) (err error) { 9124 if tracing.IsEnabled() { 9125 ctx = tracing.StartSpan(ctx, fqdn+"/SchemaCollectionIterator.NextWithContext") 9126 defer func() { 9127 sc := -1 9128 if iter.Response().Response.Response != nil { 9129 sc = iter.Response().Response.Response.StatusCode 9130 } 9131 tracing.EndSpan(ctx, sc, err) 9132 }() 9133 } 9134 iter.i++ 9135 if iter.i < len(iter.page.Values()) { 9136 return nil 9137 } 9138 err = iter.page.NextWithContext(ctx) 9139 if err != nil { 9140 iter.i-- 9141 return err 9142 } 9143 iter.i = 0 9144 return nil 9145} 9146 9147// Next advances to the next value. If there was an error making 9148// the request the iterator does not advance and the error is returned. 9149// Deprecated: Use NextWithContext() instead. 9150func (iter *SchemaCollectionIterator) Next() error { 9151 return iter.NextWithContext(context.Background()) 9152} 9153 9154// NotDone returns true if the enumeration should be started or is not yet complete. 9155func (iter SchemaCollectionIterator) NotDone() bool { 9156 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 9157} 9158 9159// Response returns the raw server response from the last page request. 9160func (iter SchemaCollectionIterator) Response() SchemaCollection { 9161 return iter.page.Response() 9162} 9163 9164// Value returns the current value or a zero-initialized value if the 9165// iterator has advanced beyond the end of the collection. 9166func (iter SchemaCollectionIterator) Value() SchemaContract { 9167 if !iter.page.NotDone() { 9168 return SchemaContract{} 9169 } 9170 return iter.page.Values()[iter.i] 9171} 9172 9173// Creates a new instance of the SchemaCollectionIterator type. 9174func NewSchemaCollectionIterator(page SchemaCollectionPage) SchemaCollectionIterator { 9175 return SchemaCollectionIterator{page: page} 9176} 9177 9178// IsEmpty returns true if the ListResult contains no values. 9179func (sc SchemaCollection) IsEmpty() bool { 9180 return sc.Value == nil || len(*sc.Value) == 0 9181} 9182 9183// hasNextLink returns true if the NextLink is not empty. 9184func (sc SchemaCollection) hasNextLink() bool { 9185 return sc.NextLink != nil && len(*sc.NextLink) != 0 9186} 9187 9188// schemaCollectionPreparer prepares a request to retrieve the next set of results. 9189// It returns nil if no more results exist. 9190func (sc SchemaCollection) schemaCollectionPreparer(ctx context.Context) (*http.Request, error) { 9191 if !sc.hasNextLink() { 9192 return nil, nil 9193 } 9194 return autorest.Prepare((&http.Request{}).WithContext(ctx), 9195 autorest.AsJSON(), 9196 autorest.AsGet(), 9197 autorest.WithBaseURL(to.String(sc.NextLink))) 9198} 9199 9200// SchemaCollectionPage contains a page of SchemaContract values. 9201type SchemaCollectionPage struct { 9202 fn func(context.Context, SchemaCollection) (SchemaCollection, error) 9203 sc SchemaCollection 9204} 9205 9206// NextWithContext advances to the next page of values. If there was an error making 9207// the request the page does not advance and the error is returned. 9208func (page *SchemaCollectionPage) NextWithContext(ctx context.Context) (err error) { 9209 if tracing.IsEnabled() { 9210 ctx = tracing.StartSpan(ctx, fqdn+"/SchemaCollectionPage.NextWithContext") 9211 defer func() { 9212 sc := -1 9213 if page.Response().Response.Response != nil { 9214 sc = page.Response().Response.Response.StatusCode 9215 } 9216 tracing.EndSpan(ctx, sc, err) 9217 }() 9218 } 9219 for { 9220 next, err := page.fn(ctx, page.sc) 9221 if err != nil { 9222 return err 9223 } 9224 page.sc = next 9225 if !next.hasNextLink() || !next.IsEmpty() { 9226 break 9227 } 9228 } 9229 return nil 9230} 9231 9232// Next advances to the next page of values. If there was an error making 9233// the request the page does not advance and the error is returned. 9234// Deprecated: Use NextWithContext() instead. 9235func (page *SchemaCollectionPage) Next() error { 9236 return page.NextWithContext(context.Background()) 9237} 9238 9239// NotDone returns true if the page enumeration should be started or is not yet complete. 9240func (page SchemaCollectionPage) NotDone() bool { 9241 return !page.sc.IsEmpty() 9242} 9243 9244// Response returns the raw server response from the last page request. 9245func (page SchemaCollectionPage) Response() SchemaCollection { 9246 return page.sc 9247} 9248 9249// Values returns the slice of values for the current page or nil if there are no values. 9250func (page SchemaCollectionPage) Values() []SchemaContract { 9251 if page.sc.IsEmpty() { 9252 return nil 9253 } 9254 return *page.sc.Value 9255} 9256 9257// Creates a new instance of the SchemaCollectionPage type. 9258func NewSchemaCollectionPage(cur SchemaCollection, getNextPage func(context.Context, SchemaCollection) (SchemaCollection, error)) SchemaCollectionPage { 9259 return SchemaCollectionPage{ 9260 fn: getNextPage, 9261 sc: cur, 9262 } 9263} 9264 9265// SchemaContract schema Contract details. 9266type SchemaContract struct { 9267 autorest.Response `json:"-"` 9268 // SchemaContractProperties - Properties of the Schema. 9269 *SchemaContractProperties `json:"properties,omitempty"` 9270 // ID - READ-ONLY; Resource ID. 9271 ID *string `json:"id,omitempty"` 9272 // Name - READ-ONLY; Resource name. 9273 Name *string `json:"name,omitempty"` 9274 // Type - READ-ONLY; Resource type for API Management resource. 9275 Type *string `json:"type,omitempty"` 9276} 9277 9278// MarshalJSON is the custom marshaler for SchemaContract. 9279func (sc SchemaContract) MarshalJSON() ([]byte, error) { 9280 objectMap := make(map[string]interface{}) 9281 if sc.SchemaContractProperties != nil { 9282 objectMap["properties"] = sc.SchemaContractProperties 9283 } 9284 return json.Marshal(objectMap) 9285} 9286 9287// UnmarshalJSON is the custom unmarshaler for SchemaContract struct. 9288func (sc *SchemaContract) UnmarshalJSON(body []byte) error { 9289 var m map[string]*json.RawMessage 9290 err := json.Unmarshal(body, &m) 9291 if err != nil { 9292 return err 9293 } 9294 for k, v := range m { 9295 switch k { 9296 case "properties": 9297 if v != nil { 9298 var schemaContractProperties SchemaContractProperties 9299 err = json.Unmarshal(*v, &schemaContractProperties) 9300 if err != nil { 9301 return err 9302 } 9303 sc.SchemaContractProperties = &schemaContractProperties 9304 } 9305 case "id": 9306 if v != nil { 9307 var ID string 9308 err = json.Unmarshal(*v, &ID) 9309 if err != nil { 9310 return err 9311 } 9312 sc.ID = &ID 9313 } 9314 case "name": 9315 if v != nil { 9316 var name string 9317 err = json.Unmarshal(*v, &name) 9318 if err != nil { 9319 return err 9320 } 9321 sc.Name = &name 9322 } 9323 case "type": 9324 if v != nil { 9325 var typeVar string 9326 err = json.Unmarshal(*v, &typeVar) 9327 if err != nil { 9328 return err 9329 } 9330 sc.Type = &typeVar 9331 } 9332 } 9333 } 9334 9335 return nil 9336} 9337 9338// SchemaContractProperties schema contract Properties. 9339type SchemaContractProperties struct { 9340 // 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). 9341 ContentType *string `json:"contentType,omitempty"` 9342 // SchemaDocumentProperties - Properties of the Schema Document. 9343 *SchemaDocumentProperties `json:"document,omitempty"` 9344} 9345 9346// MarshalJSON is the custom marshaler for SchemaContractProperties. 9347func (scp SchemaContractProperties) MarshalJSON() ([]byte, error) { 9348 objectMap := make(map[string]interface{}) 9349 if scp.ContentType != nil { 9350 objectMap["contentType"] = scp.ContentType 9351 } 9352 if scp.SchemaDocumentProperties != nil { 9353 objectMap["document"] = scp.SchemaDocumentProperties 9354 } 9355 return json.Marshal(objectMap) 9356} 9357 9358// UnmarshalJSON is the custom unmarshaler for SchemaContractProperties struct. 9359func (scp *SchemaContractProperties) UnmarshalJSON(body []byte) error { 9360 var m map[string]*json.RawMessage 9361 err := json.Unmarshal(body, &m) 9362 if err != nil { 9363 return err 9364 } 9365 for k, v := range m { 9366 switch k { 9367 case "contentType": 9368 if v != nil { 9369 var contentType string 9370 err = json.Unmarshal(*v, &contentType) 9371 if err != nil { 9372 return err 9373 } 9374 scp.ContentType = &contentType 9375 } 9376 case "document": 9377 if v != nil { 9378 var schemaDocumentProperties SchemaDocumentProperties 9379 err = json.Unmarshal(*v, &schemaDocumentProperties) 9380 if err != nil { 9381 return err 9382 } 9383 scp.SchemaDocumentProperties = &schemaDocumentProperties 9384 } 9385 } 9386 } 9387 9388 return nil 9389} 9390 9391// SchemaDocumentProperties schema Document Properties. 9392type SchemaDocumentProperties struct { 9393 // Value - Json escaped string defining the document representing the Schema. 9394 Value *string `json:"value,omitempty"` 9395} 9396 9397// ServiceApplyNetworkConfigurationParameters parameter supplied to the Apply Network configuration 9398// operation. 9399type ServiceApplyNetworkConfigurationParameters struct { 9400 // 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. 9401 Location *string `json:"location,omitempty"` 9402} 9403 9404// ServiceApplyNetworkConfigurationUpdatesFuture an abstraction for monitoring and retrieving the results 9405// of a long-running operation. 9406type ServiceApplyNetworkConfigurationUpdatesFuture struct { 9407 azure.FutureAPI 9408 // Result returns the result of the asynchronous operation. 9409 // If the operation has not completed it will return an error. 9410 Result func(ServiceClient) (ServiceResource, error) 9411} 9412 9413// UnmarshalJSON is the custom unmarshaller for CreateFuture. 9414func (future *ServiceApplyNetworkConfigurationUpdatesFuture) UnmarshalJSON(body []byte) error { 9415 var azFuture azure.Future 9416 if err := json.Unmarshal(body, &azFuture); err != nil { 9417 return err 9418 } 9419 future.FutureAPI = &azFuture 9420 future.Result = future.result 9421 return nil 9422} 9423 9424// result is the default implementation for ServiceApplyNetworkConfigurationUpdatesFuture.Result. 9425func (future *ServiceApplyNetworkConfigurationUpdatesFuture) result(client ServiceClient) (sr ServiceResource, err error) { 9426 var done bool 9427 done, err = future.DoneWithContext(context.Background(), client) 9428 if err != nil { 9429 err = autorest.NewErrorWithError(err, "apimanagement.ServiceApplyNetworkConfigurationUpdatesFuture", "Result", future.Response(), "Polling failure") 9430 return 9431 } 9432 if !done { 9433 sr.Response.Response = future.Response() 9434 err = azure.NewAsyncOpIncompleteError("apimanagement.ServiceApplyNetworkConfigurationUpdatesFuture") 9435 return 9436 } 9437 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 9438 if sr.Response.Response, err = future.GetResult(sender); err == nil && sr.Response.Response.StatusCode != http.StatusNoContent { 9439 sr, err = client.ApplyNetworkConfigurationUpdatesResponder(sr.Response.Response) 9440 if err != nil { 9441 err = autorest.NewErrorWithError(err, "apimanagement.ServiceApplyNetworkConfigurationUpdatesFuture", "Result", sr.Response.Response, "Failure responding to request") 9442 } 9443 } 9444 return 9445} 9446 9447// ServiceBackupFuture an abstraction for monitoring and retrieving the results of a long-running 9448// operation. 9449type ServiceBackupFuture struct { 9450 azure.FutureAPI 9451 // Result returns the result of the asynchronous operation. 9452 // If the operation has not completed it will return an error. 9453 Result func(ServiceClient) (ServiceResource, error) 9454} 9455 9456// UnmarshalJSON is the custom unmarshaller for CreateFuture. 9457func (future *ServiceBackupFuture) UnmarshalJSON(body []byte) error { 9458 var azFuture azure.Future 9459 if err := json.Unmarshal(body, &azFuture); err != nil { 9460 return err 9461 } 9462 future.FutureAPI = &azFuture 9463 future.Result = future.result 9464 return nil 9465} 9466 9467// result is the default implementation for ServiceBackupFuture.Result. 9468func (future *ServiceBackupFuture) result(client ServiceClient) (sr ServiceResource, err error) { 9469 var done bool 9470 done, err = future.DoneWithContext(context.Background(), client) 9471 if err != nil { 9472 err = autorest.NewErrorWithError(err, "apimanagement.ServiceBackupFuture", "Result", future.Response(), "Polling failure") 9473 return 9474 } 9475 if !done { 9476 sr.Response.Response = future.Response() 9477 err = azure.NewAsyncOpIncompleteError("apimanagement.ServiceBackupFuture") 9478 return 9479 } 9480 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 9481 if sr.Response.Response, err = future.GetResult(sender); err == nil && sr.Response.Response.StatusCode != http.StatusNoContent { 9482 sr, err = client.BackupResponder(sr.Response.Response) 9483 if err != nil { 9484 err = autorest.NewErrorWithError(err, "apimanagement.ServiceBackupFuture", "Result", sr.Response.Response, "Failure responding to request") 9485 } 9486 } 9487 return 9488} 9489 9490// ServiceBackupRestoreParameters parameters supplied to the Backup/Restore of an API Management service 9491// operation. 9492type ServiceBackupRestoreParameters struct { 9493 // StorageAccount - Azure Cloud Storage account (used to place/retrieve the backup) name. 9494 StorageAccount *string `json:"storageAccount,omitempty"` 9495 // AccessKey - Azure Cloud Storage account (used to place/retrieve the backup) access key. 9496 AccessKey *string `json:"accessKey,omitempty"` 9497 // ContainerName - Azure Cloud Storage blob container name used to place/retrieve the backup. 9498 ContainerName *string `json:"containerName,omitempty"` 9499 // BackupName - The name of the backup file to create. 9500 BackupName *string `json:"backupName,omitempty"` 9501} 9502 9503// ServiceBaseProperties base Properties of an API Management service resource description. 9504type ServiceBaseProperties struct { 9505 // NotificationSenderEmail - Email address from which the notification will be sent. 9506 NotificationSenderEmail *string `json:"notificationSenderEmail,omitempty"` 9507 // 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. 9508 ProvisioningState *string `json:"provisioningState,omitempty"` 9509 // TargetProvisioningState - READ-ONLY; The provisioning state of the API Management service, which is targeted by the long running operation started on the service. 9510 TargetProvisioningState *string `json:"targetProvisioningState,omitempty"` 9511 // 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. 9512 CreatedAtUtc *date.Time `json:"createdAtUtc,omitempty"` 9513 // GatewayURL - READ-ONLY; Gateway URL of the API Management service. 9514 GatewayURL *string `json:"gatewayUrl,omitempty"` 9515 // GatewayRegionalURL - READ-ONLY; Gateway URL of the API Management service in the Default Region. 9516 GatewayRegionalURL *string `json:"gatewayRegionalUrl,omitempty"` 9517 // PortalURL - READ-ONLY; Publisher portal endpoint Url of the API Management service. 9518 PortalURL *string `json:"portalUrl,omitempty"` 9519 // ManagementAPIURL - READ-ONLY; Management API endpoint URL of the API Management service. 9520 ManagementAPIURL *string `json:"managementApiUrl,omitempty"` 9521 // ScmURL - READ-ONLY; SCM endpoint URL of the API Management service. 9522 ScmURL *string `json:"scmUrl,omitempty"` 9523 // HostnameConfigurations - Custom hostname configuration of the API Management service. 9524 HostnameConfigurations *[]HostnameConfiguration `json:"hostnameConfigurations,omitempty"` 9525 // 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. 9526 PublicIPAddresses *[]string `json:"publicIPAddresses,omitempty"` 9527 // 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. 9528 PrivateIPAddresses *[]string `json:"privateIPAddresses,omitempty"` 9529 // VirtualNetworkConfiguration - Virtual network configuration of the API Management service. 9530 VirtualNetworkConfiguration *VirtualNetworkConfiguration `json:"virtualNetworkConfiguration,omitempty"` 9531 // AdditionalLocations - Additional datacenter locations of the API Management service. 9532 AdditionalLocations *[]AdditionalLocation `json:"additionalLocations,omitempty"` 9533 // 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. 9534 CustomProperties map[string]*string `json:"customProperties"` 9535 // Certificates - List of Certificates that need to be installed in the API Management service. Max supported certificates that can be installed is 10. 9536 Certificates *[]CertificateConfiguration `json:"certificates,omitempty"` 9537 // 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' 9538 VirtualNetworkType VirtualNetworkType `json:"virtualNetworkType,omitempty"` 9539} 9540 9541// MarshalJSON is the custom marshaler for ServiceBaseProperties. 9542func (sbp ServiceBaseProperties) MarshalJSON() ([]byte, error) { 9543 objectMap := make(map[string]interface{}) 9544 if sbp.NotificationSenderEmail != nil { 9545 objectMap["notificationSenderEmail"] = sbp.NotificationSenderEmail 9546 } 9547 if sbp.HostnameConfigurations != nil { 9548 objectMap["hostnameConfigurations"] = sbp.HostnameConfigurations 9549 } 9550 if sbp.VirtualNetworkConfiguration != nil { 9551 objectMap["virtualNetworkConfiguration"] = sbp.VirtualNetworkConfiguration 9552 } 9553 if sbp.AdditionalLocations != nil { 9554 objectMap["additionalLocations"] = sbp.AdditionalLocations 9555 } 9556 if sbp.CustomProperties != nil { 9557 objectMap["customProperties"] = sbp.CustomProperties 9558 } 9559 if sbp.Certificates != nil { 9560 objectMap["certificates"] = sbp.Certificates 9561 } 9562 if sbp.VirtualNetworkType != "" { 9563 objectMap["virtualNetworkType"] = sbp.VirtualNetworkType 9564 } 9565 return json.Marshal(objectMap) 9566} 9567 9568// ServiceCheckNameAvailabilityParameters parameters supplied to the CheckNameAvailability operation. 9569type ServiceCheckNameAvailabilityParameters struct { 9570 // Name - The name to check for availability. 9571 Name *string `json:"name,omitempty"` 9572} 9573 9574// ServiceCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 9575// operation. 9576type ServiceCreateOrUpdateFuture struct { 9577 azure.FutureAPI 9578 // Result returns the result of the asynchronous operation. 9579 // If the operation has not completed it will return an error. 9580 Result func(ServiceClient) (ServiceResource, error) 9581} 9582 9583// UnmarshalJSON is the custom unmarshaller for CreateFuture. 9584func (future *ServiceCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 9585 var azFuture azure.Future 9586 if err := json.Unmarshal(body, &azFuture); err != nil { 9587 return err 9588 } 9589 future.FutureAPI = &azFuture 9590 future.Result = future.result 9591 return nil 9592} 9593 9594// result is the default implementation for ServiceCreateOrUpdateFuture.Result. 9595func (future *ServiceCreateOrUpdateFuture) result(client ServiceClient) (sr ServiceResource, err error) { 9596 var done bool 9597 done, err = future.DoneWithContext(context.Background(), client) 9598 if err != nil { 9599 err = autorest.NewErrorWithError(err, "apimanagement.ServiceCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 9600 return 9601 } 9602 if !done { 9603 sr.Response.Response = future.Response() 9604 err = azure.NewAsyncOpIncompleteError("apimanagement.ServiceCreateOrUpdateFuture") 9605 return 9606 } 9607 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 9608 if sr.Response.Response, err = future.GetResult(sender); err == nil && sr.Response.Response.StatusCode != http.StatusNoContent { 9609 sr, err = client.CreateOrUpdateResponder(sr.Response.Response) 9610 if err != nil { 9611 err = autorest.NewErrorWithError(err, "apimanagement.ServiceCreateOrUpdateFuture", "Result", sr.Response.Response, "Failure responding to request") 9612 } 9613 } 9614 return 9615} 9616 9617// ServiceDeleteFuture an abstraction for monitoring and retrieving the results of a long-running 9618// operation. 9619type ServiceDeleteFuture struct { 9620 azure.FutureAPI 9621 // Result returns the result of the asynchronous operation. 9622 // If the operation has not completed it will return an error. 9623 Result func(ServiceClient) (ServiceResource, error) 9624} 9625 9626// UnmarshalJSON is the custom unmarshaller for CreateFuture. 9627func (future *ServiceDeleteFuture) UnmarshalJSON(body []byte) error { 9628 var azFuture azure.Future 9629 if err := json.Unmarshal(body, &azFuture); err != nil { 9630 return err 9631 } 9632 future.FutureAPI = &azFuture 9633 future.Result = future.result 9634 return nil 9635} 9636 9637// result is the default implementation for ServiceDeleteFuture.Result. 9638func (future *ServiceDeleteFuture) result(client ServiceClient) (sr ServiceResource, err error) { 9639 var done bool 9640 done, err = future.DoneWithContext(context.Background(), client) 9641 if err != nil { 9642 err = autorest.NewErrorWithError(err, "apimanagement.ServiceDeleteFuture", "Result", future.Response(), "Polling failure") 9643 return 9644 } 9645 if !done { 9646 sr.Response.Response = future.Response() 9647 err = azure.NewAsyncOpIncompleteError("apimanagement.ServiceDeleteFuture") 9648 return 9649 } 9650 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 9651 if sr.Response.Response, err = future.GetResult(sender); err == nil && sr.Response.Response.StatusCode != http.StatusNoContent { 9652 sr, err = client.DeleteResponder(sr.Response.Response) 9653 if err != nil { 9654 err = autorest.NewErrorWithError(err, "apimanagement.ServiceDeleteFuture", "Result", sr.Response.Response, "Failure responding to request") 9655 } 9656 } 9657 return 9658} 9659 9660// ServiceGetSsoTokenResult the response of the GetSsoToken operation. 9661type ServiceGetSsoTokenResult struct { 9662 autorest.Response `json:"-"` 9663 // RedirectURI - Redirect URL to the Publisher Portal containing the SSO token. 9664 RedirectURI *string `json:"redirectUri,omitempty"` 9665} 9666 9667// ServiceIdentity identity properties of the Api Management service resource. 9668type ServiceIdentity struct { 9669 // Type - The identity type. Currently the only supported type is 'SystemAssigned'. 9670 Type *string `json:"type,omitempty"` 9671 // PrincipalID - READ-ONLY; The principal id of the identity. 9672 PrincipalID *uuid.UUID `json:"principalId,omitempty"` 9673 // TenantID - READ-ONLY; The client tenant id of the identity. 9674 TenantID *uuid.UUID `json:"tenantId,omitempty"` 9675} 9676 9677// MarshalJSON is the custom marshaler for ServiceIdentity. 9678func (si ServiceIdentity) MarshalJSON() ([]byte, error) { 9679 objectMap := make(map[string]interface{}) 9680 if si.Type != nil { 9681 objectMap["type"] = si.Type 9682 } 9683 return json.Marshal(objectMap) 9684} 9685 9686// ServiceListResult the response of the List API Management services operation. 9687type ServiceListResult struct { 9688 autorest.Response `json:"-"` 9689 // Value - Result of the List API Management services operation. 9690 Value *[]ServiceResource `json:"value,omitempty"` 9691 // NextLink - Link to the next set of results. Not empty if Value contains incomplete list of API Management services. 9692 NextLink *string `json:"nextLink,omitempty"` 9693} 9694 9695// ServiceListResultIterator provides access to a complete listing of ServiceResource values. 9696type ServiceListResultIterator struct { 9697 i int 9698 page ServiceListResultPage 9699} 9700 9701// NextWithContext advances to the next value. If there was an error making 9702// the request the iterator does not advance and the error is returned. 9703func (iter *ServiceListResultIterator) NextWithContext(ctx context.Context) (err error) { 9704 if tracing.IsEnabled() { 9705 ctx = tracing.StartSpan(ctx, fqdn+"/ServiceListResultIterator.NextWithContext") 9706 defer func() { 9707 sc := -1 9708 if iter.Response().Response.Response != nil { 9709 sc = iter.Response().Response.Response.StatusCode 9710 } 9711 tracing.EndSpan(ctx, sc, err) 9712 }() 9713 } 9714 iter.i++ 9715 if iter.i < len(iter.page.Values()) { 9716 return nil 9717 } 9718 err = iter.page.NextWithContext(ctx) 9719 if err != nil { 9720 iter.i-- 9721 return err 9722 } 9723 iter.i = 0 9724 return nil 9725} 9726 9727// Next advances to the next value. If there was an error making 9728// the request the iterator does not advance and the error is returned. 9729// Deprecated: Use NextWithContext() instead. 9730func (iter *ServiceListResultIterator) Next() error { 9731 return iter.NextWithContext(context.Background()) 9732} 9733 9734// NotDone returns true if the enumeration should be started or is not yet complete. 9735func (iter ServiceListResultIterator) NotDone() bool { 9736 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 9737} 9738 9739// Response returns the raw server response from the last page request. 9740func (iter ServiceListResultIterator) Response() ServiceListResult { 9741 return iter.page.Response() 9742} 9743 9744// Value returns the current value or a zero-initialized value if the 9745// iterator has advanced beyond the end of the collection. 9746func (iter ServiceListResultIterator) Value() ServiceResource { 9747 if !iter.page.NotDone() { 9748 return ServiceResource{} 9749 } 9750 return iter.page.Values()[iter.i] 9751} 9752 9753// Creates a new instance of the ServiceListResultIterator type. 9754func NewServiceListResultIterator(page ServiceListResultPage) ServiceListResultIterator { 9755 return ServiceListResultIterator{page: page} 9756} 9757 9758// IsEmpty returns true if the ListResult contains no values. 9759func (slr ServiceListResult) IsEmpty() bool { 9760 return slr.Value == nil || len(*slr.Value) == 0 9761} 9762 9763// hasNextLink returns true if the NextLink is not empty. 9764func (slr ServiceListResult) hasNextLink() bool { 9765 return slr.NextLink != nil && len(*slr.NextLink) != 0 9766} 9767 9768// serviceListResultPreparer prepares a request to retrieve the next set of results. 9769// It returns nil if no more results exist. 9770func (slr ServiceListResult) serviceListResultPreparer(ctx context.Context) (*http.Request, error) { 9771 if !slr.hasNextLink() { 9772 return nil, nil 9773 } 9774 return autorest.Prepare((&http.Request{}).WithContext(ctx), 9775 autorest.AsJSON(), 9776 autorest.AsGet(), 9777 autorest.WithBaseURL(to.String(slr.NextLink))) 9778} 9779 9780// ServiceListResultPage contains a page of ServiceResource values. 9781type ServiceListResultPage struct { 9782 fn func(context.Context, ServiceListResult) (ServiceListResult, error) 9783 slr ServiceListResult 9784} 9785 9786// NextWithContext advances to the next page of values. If there was an error making 9787// the request the page does not advance and the error is returned. 9788func (page *ServiceListResultPage) NextWithContext(ctx context.Context) (err error) { 9789 if tracing.IsEnabled() { 9790 ctx = tracing.StartSpan(ctx, fqdn+"/ServiceListResultPage.NextWithContext") 9791 defer func() { 9792 sc := -1 9793 if page.Response().Response.Response != nil { 9794 sc = page.Response().Response.Response.StatusCode 9795 } 9796 tracing.EndSpan(ctx, sc, err) 9797 }() 9798 } 9799 for { 9800 next, err := page.fn(ctx, page.slr) 9801 if err != nil { 9802 return err 9803 } 9804 page.slr = next 9805 if !next.hasNextLink() || !next.IsEmpty() { 9806 break 9807 } 9808 } 9809 return nil 9810} 9811 9812// Next advances to the next page of values. If there was an error making 9813// the request the page does not advance and the error is returned. 9814// Deprecated: Use NextWithContext() instead. 9815func (page *ServiceListResultPage) Next() error { 9816 return page.NextWithContext(context.Background()) 9817} 9818 9819// NotDone returns true if the page enumeration should be started or is not yet complete. 9820func (page ServiceListResultPage) NotDone() bool { 9821 return !page.slr.IsEmpty() 9822} 9823 9824// Response returns the raw server response from the last page request. 9825func (page ServiceListResultPage) Response() ServiceListResult { 9826 return page.slr 9827} 9828 9829// Values returns the slice of values for the current page or nil if there are no values. 9830func (page ServiceListResultPage) Values() []ServiceResource { 9831 if page.slr.IsEmpty() { 9832 return nil 9833 } 9834 return *page.slr.Value 9835} 9836 9837// Creates a new instance of the ServiceListResultPage type. 9838func NewServiceListResultPage(cur ServiceListResult, getNextPage func(context.Context, ServiceListResult) (ServiceListResult, error)) ServiceListResultPage { 9839 return ServiceListResultPage{ 9840 fn: getNextPage, 9841 slr: cur, 9842 } 9843} 9844 9845// ServiceNameAvailabilityResult response of the CheckNameAvailability operation. 9846type ServiceNameAvailabilityResult struct { 9847 autorest.Response `json:"-"` 9848 // NameAvailable - READ-ONLY; True if the name is available and can be used to create a new API Management service; otherwise false. 9849 NameAvailable *bool `json:"nameAvailable,omitempty"` 9850 // 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. 9851 Message *string `json:"message,omitempty"` 9852 // 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' 9853 Reason NameAvailabilityReason `json:"reason,omitempty"` 9854} 9855 9856// MarshalJSON is the custom marshaler for ServiceNameAvailabilityResult. 9857func (snar ServiceNameAvailabilityResult) MarshalJSON() ([]byte, error) { 9858 objectMap := make(map[string]interface{}) 9859 if snar.Reason != "" { 9860 objectMap["reason"] = snar.Reason 9861 } 9862 return json.Marshal(objectMap) 9863} 9864 9865// ServiceProperties properties of an API Management service resource description. 9866type ServiceProperties struct { 9867 // PublisherEmail - Publisher email. 9868 PublisherEmail *string `json:"publisherEmail,omitempty"` 9869 // PublisherName - Publisher name. 9870 PublisherName *string `json:"publisherName,omitempty"` 9871 // NotificationSenderEmail - Email address from which the notification will be sent. 9872 NotificationSenderEmail *string `json:"notificationSenderEmail,omitempty"` 9873 // 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. 9874 ProvisioningState *string `json:"provisioningState,omitempty"` 9875 // TargetProvisioningState - READ-ONLY; The provisioning state of the API Management service, which is targeted by the long running operation started on the service. 9876 TargetProvisioningState *string `json:"targetProvisioningState,omitempty"` 9877 // 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. 9878 CreatedAtUtc *date.Time `json:"createdAtUtc,omitempty"` 9879 // GatewayURL - READ-ONLY; Gateway URL of the API Management service. 9880 GatewayURL *string `json:"gatewayUrl,omitempty"` 9881 // GatewayRegionalURL - READ-ONLY; Gateway URL of the API Management service in the Default Region. 9882 GatewayRegionalURL *string `json:"gatewayRegionalUrl,omitempty"` 9883 // PortalURL - READ-ONLY; Publisher portal endpoint Url of the API Management service. 9884 PortalURL *string `json:"portalUrl,omitempty"` 9885 // ManagementAPIURL - READ-ONLY; Management API endpoint URL of the API Management service. 9886 ManagementAPIURL *string `json:"managementApiUrl,omitempty"` 9887 // ScmURL - READ-ONLY; SCM endpoint URL of the API Management service. 9888 ScmURL *string `json:"scmUrl,omitempty"` 9889 // HostnameConfigurations - Custom hostname configuration of the API Management service. 9890 HostnameConfigurations *[]HostnameConfiguration `json:"hostnameConfigurations,omitempty"` 9891 // 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. 9892 PublicIPAddresses *[]string `json:"publicIPAddresses,omitempty"` 9893 // 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. 9894 PrivateIPAddresses *[]string `json:"privateIPAddresses,omitempty"` 9895 // VirtualNetworkConfiguration - Virtual network configuration of the API Management service. 9896 VirtualNetworkConfiguration *VirtualNetworkConfiguration `json:"virtualNetworkConfiguration,omitempty"` 9897 // AdditionalLocations - Additional datacenter locations of the API Management service. 9898 AdditionalLocations *[]AdditionalLocation `json:"additionalLocations,omitempty"` 9899 // 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. 9900 CustomProperties map[string]*string `json:"customProperties"` 9901 // Certificates - List of Certificates that need to be installed in the API Management service. Max supported certificates that can be installed is 10. 9902 Certificates *[]CertificateConfiguration `json:"certificates,omitempty"` 9903 // 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' 9904 VirtualNetworkType VirtualNetworkType `json:"virtualNetworkType,omitempty"` 9905} 9906 9907// MarshalJSON is the custom marshaler for ServiceProperties. 9908func (sp ServiceProperties) MarshalJSON() ([]byte, error) { 9909 objectMap := make(map[string]interface{}) 9910 if sp.PublisherEmail != nil { 9911 objectMap["publisherEmail"] = sp.PublisherEmail 9912 } 9913 if sp.PublisherName != nil { 9914 objectMap["publisherName"] = sp.PublisherName 9915 } 9916 if sp.NotificationSenderEmail != nil { 9917 objectMap["notificationSenderEmail"] = sp.NotificationSenderEmail 9918 } 9919 if sp.HostnameConfigurations != nil { 9920 objectMap["hostnameConfigurations"] = sp.HostnameConfigurations 9921 } 9922 if sp.VirtualNetworkConfiguration != nil { 9923 objectMap["virtualNetworkConfiguration"] = sp.VirtualNetworkConfiguration 9924 } 9925 if sp.AdditionalLocations != nil { 9926 objectMap["additionalLocations"] = sp.AdditionalLocations 9927 } 9928 if sp.CustomProperties != nil { 9929 objectMap["customProperties"] = sp.CustomProperties 9930 } 9931 if sp.Certificates != nil { 9932 objectMap["certificates"] = sp.Certificates 9933 } 9934 if sp.VirtualNetworkType != "" { 9935 objectMap["virtualNetworkType"] = sp.VirtualNetworkType 9936 } 9937 return json.Marshal(objectMap) 9938} 9939 9940// ServiceResource a single API Management service resource in List or Get response. 9941type ServiceResource struct { 9942 autorest.Response `json:"-"` 9943 // ServiceProperties - Properties of the API Management service. 9944 *ServiceProperties `json:"properties,omitempty"` 9945 // Sku - SKU properties of the API Management service. 9946 Sku *ServiceSkuProperties `json:"sku,omitempty"` 9947 // Identity - Managed service identity of the Api Management service. 9948 Identity *ServiceIdentity `json:"identity,omitempty"` 9949 // Location - Resource location. 9950 Location *string `json:"location,omitempty"` 9951 // Etag - READ-ONLY; ETag of the resource. 9952 Etag *string `json:"etag,omitempty"` 9953 // ID - READ-ONLY; Resource ID. 9954 ID *string `json:"id,omitempty"` 9955 // Name - READ-ONLY; Resource name. 9956 Name *string `json:"name,omitempty"` 9957 // Type - READ-ONLY; Resource type for API Management resource is set to Microsoft.ApiManagement. 9958 Type *string `json:"type,omitempty"` 9959 // Tags - Resource tags. 9960 Tags map[string]*string `json:"tags"` 9961} 9962 9963// MarshalJSON is the custom marshaler for ServiceResource. 9964func (sr ServiceResource) MarshalJSON() ([]byte, error) { 9965 objectMap := make(map[string]interface{}) 9966 if sr.ServiceProperties != nil { 9967 objectMap["properties"] = sr.ServiceProperties 9968 } 9969 if sr.Sku != nil { 9970 objectMap["sku"] = sr.Sku 9971 } 9972 if sr.Identity != nil { 9973 objectMap["identity"] = sr.Identity 9974 } 9975 if sr.Location != nil { 9976 objectMap["location"] = sr.Location 9977 } 9978 if sr.Tags != nil { 9979 objectMap["tags"] = sr.Tags 9980 } 9981 return json.Marshal(objectMap) 9982} 9983 9984// UnmarshalJSON is the custom unmarshaler for ServiceResource struct. 9985func (sr *ServiceResource) UnmarshalJSON(body []byte) error { 9986 var m map[string]*json.RawMessage 9987 err := json.Unmarshal(body, &m) 9988 if err != nil { 9989 return err 9990 } 9991 for k, v := range m { 9992 switch k { 9993 case "properties": 9994 if v != nil { 9995 var serviceProperties ServiceProperties 9996 err = json.Unmarshal(*v, &serviceProperties) 9997 if err != nil { 9998 return err 9999 } 10000 sr.ServiceProperties = &serviceProperties 10001 } 10002 case "sku": 10003 if v != nil { 10004 var sku ServiceSkuProperties 10005 err = json.Unmarshal(*v, &sku) 10006 if err != nil { 10007 return err 10008 } 10009 sr.Sku = &sku 10010 } 10011 case "identity": 10012 if v != nil { 10013 var identity ServiceIdentity 10014 err = json.Unmarshal(*v, &identity) 10015 if err != nil { 10016 return err 10017 } 10018 sr.Identity = &identity 10019 } 10020 case "location": 10021 if v != nil { 10022 var location string 10023 err = json.Unmarshal(*v, &location) 10024 if err != nil { 10025 return err 10026 } 10027 sr.Location = &location 10028 } 10029 case "etag": 10030 if v != nil { 10031 var etag string 10032 err = json.Unmarshal(*v, &etag) 10033 if err != nil { 10034 return err 10035 } 10036 sr.Etag = &etag 10037 } 10038 case "id": 10039 if v != nil { 10040 var ID string 10041 err = json.Unmarshal(*v, &ID) 10042 if err != nil { 10043 return err 10044 } 10045 sr.ID = &ID 10046 } 10047 case "name": 10048 if v != nil { 10049 var name string 10050 err = json.Unmarshal(*v, &name) 10051 if err != nil { 10052 return err 10053 } 10054 sr.Name = &name 10055 } 10056 case "type": 10057 if v != nil { 10058 var typeVar string 10059 err = json.Unmarshal(*v, &typeVar) 10060 if err != nil { 10061 return err 10062 } 10063 sr.Type = &typeVar 10064 } 10065 case "tags": 10066 if v != nil { 10067 var tags map[string]*string 10068 err = json.Unmarshal(*v, &tags) 10069 if err != nil { 10070 return err 10071 } 10072 sr.Tags = tags 10073 } 10074 } 10075 } 10076 10077 return nil 10078} 10079 10080// ServiceRestoreFuture an abstraction for monitoring and retrieving the results of a long-running 10081// operation. 10082type ServiceRestoreFuture struct { 10083 azure.FutureAPI 10084 // Result returns the result of the asynchronous operation. 10085 // If the operation has not completed it will return an error. 10086 Result func(ServiceClient) (ServiceResource, error) 10087} 10088 10089// UnmarshalJSON is the custom unmarshaller for CreateFuture. 10090func (future *ServiceRestoreFuture) UnmarshalJSON(body []byte) error { 10091 var azFuture azure.Future 10092 if err := json.Unmarshal(body, &azFuture); err != nil { 10093 return err 10094 } 10095 future.FutureAPI = &azFuture 10096 future.Result = future.result 10097 return nil 10098} 10099 10100// result is the default implementation for ServiceRestoreFuture.Result. 10101func (future *ServiceRestoreFuture) result(client ServiceClient) (sr ServiceResource, err error) { 10102 var done bool 10103 done, err = future.DoneWithContext(context.Background(), client) 10104 if err != nil { 10105 err = autorest.NewErrorWithError(err, "apimanagement.ServiceRestoreFuture", "Result", future.Response(), "Polling failure") 10106 return 10107 } 10108 if !done { 10109 sr.Response.Response = future.Response() 10110 err = azure.NewAsyncOpIncompleteError("apimanagement.ServiceRestoreFuture") 10111 return 10112 } 10113 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 10114 if sr.Response.Response, err = future.GetResult(sender); err == nil && sr.Response.Response.StatusCode != http.StatusNoContent { 10115 sr, err = client.RestoreResponder(sr.Response.Response) 10116 if err != nil { 10117 err = autorest.NewErrorWithError(err, "apimanagement.ServiceRestoreFuture", "Result", sr.Response.Response, "Failure responding to request") 10118 } 10119 } 10120 return 10121} 10122 10123// ServiceSkuProperties API Management service resource SKU properties. 10124type ServiceSkuProperties struct { 10125 // Name - Name of the Sku. Possible values include: 'SkuTypeDeveloper', 'SkuTypeStandard', 'SkuTypePremium', 'SkuTypeBasic', 'SkuTypeConsumption' 10126 Name SkuType `json:"name,omitempty"` 10127 // Capacity - Capacity of the SKU (number of deployed units of the SKU). The default value is 1. 10128 Capacity *int32 `json:"capacity,omitempty"` 10129} 10130 10131// ServiceUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 10132// operation. 10133type ServiceUpdateFuture struct { 10134 azure.FutureAPI 10135 // Result returns the result of the asynchronous operation. 10136 // If the operation has not completed it will return an error. 10137 Result func(ServiceClient) (ServiceResource, error) 10138} 10139 10140// UnmarshalJSON is the custom unmarshaller for CreateFuture. 10141func (future *ServiceUpdateFuture) UnmarshalJSON(body []byte) error { 10142 var azFuture azure.Future 10143 if err := json.Unmarshal(body, &azFuture); err != nil { 10144 return err 10145 } 10146 future.FutureAPI = &azFuture 10147 future.Result = future.result 10148 return nil 10149} 10150 10151// result is the default implementation for ServiceUpdateFuture.Result. 10152func (future *ServiceUpdateFuture) result(client ServiceClient) (sr ServiceResource, err error) { 10153 var done bool 10154 done, err = future.DoneWithContext(context.Background(), client) 10155 if err != nil { 10156 err = autorest.NewErrorWithError(err, "apimanagement.ServiceUpdateFuture", "Result", future.Response(), "Polling failure") 10157 return 10158 } 10159 if !done { 10160 sr.Response.Response = future.Response() 10161 err = azure.NewAsyncOpIncompleteError("apimanagement.ServiceUpdateFuture") 10162 return 10163 } 10164 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 10165 if sr.Response.Response, err = future.GetResult(sender); err == nil && sr.Response.Response.StatusCode != http.StatusNoContent { 10166 sr, err = client.UpdateResponder(sr.Response.Response) 10167 if err != nil { 10168 err = autorest.NewErrorWithError(err, "apimanagement.ServiceUpdateFuture", "Result", sr.Response.Response, "Failure responding to request") 10169 } 10170 } 10171 return 10172} 10173 10174// ServiceUpdateHostnameFuture an abstraction for monitoring and retrieving the results of a long-running 10175// operation. 10176type ServiceUpdateHostnameFuture struct { 10177 azure.FutureAPI 10178 // Result returns the result of the asynchronous operation. 10179 // If the operation has not completed it will return an error. 10180 Result func(ServiceClient) (ServiceResource, error) 10181} 10182 10183// UnmarshalJSON is the custom unmarshaller for CreateFuture. 10184func (future *ServiceUpdateHostnameFuture) UnmarshalJSON(body []byte) error { 10185 var azFuture azure.Future 10186 if err := json.Unmarshal(body, &azFuture); err != nil { 10187 return err 10188 } 10189 future.FutureAPI = &azFuture 10190 future.Result = future.result 10191 return nil 10192} 10193 10194// result is the default implementation for ServiceUpdateHostnameFuture.Result. 10195func (future *ServiceUpdateHostnameFuture) result(client ServiceClient) (sr ServiceResource, err error) { 10196 var done bool 10197 done, err = future.DoneWithContext(context.Background(), client) 10198 if err != nil { 10199 err = autorest.NewErrorWithError(err, "apimanagement.ServiceUpdateHostnameFuture", "Result", future.Response(), "Polling failure") 10200 return 10201 } 10202 if !done { 10203 sr.Response.Response = future.Response() 10204 err = azure.NewAsyncOpIncompleteError("apimanagement.ServiceUpdateHostnameFuture") 10205 return 10206 } 10207 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 10208 if sr.Response.Response, err = future.GetResult(sender); err == nil && sr.Response.Response.StatusCode != http.StatusNoContent { 10209 sr, err = client.UpdateHostnameResponder(sr.Response.Response) 10210 if err != nil { 10211 err = autorest.NewErrorWithError(err, "apimanagement.ServiceUpdateHostnameFuture", "Result", sr.Response.Response, "Failure responding to request") 10212 } 10213 } 10214 return 10215} 10216 10217// ServiceUpdateHostnameParameters parameters supplied to the UpdateHostname operation. 10218type ServiceUpdateHostnameParameters struct { 10219 // Update - Hostnames to create or update. 10220 Update *[]HostnameConfigurationOld `json:"update,omitempty"` 10221 // Delete - Hostnames types to delete. 10222 Delete *[]HostnameType `json:"delete,omitempty"` 10223} 10224 10225// ServiceUpdateParameters parameter supplied to Update Api Management Service. 10226type ServiceUpdateParameters struct { 10227 // ServiceUpdateProperties - Properties of the API Management service. 10228 *ServiceUpdateProperties `json:"properties,omitempty"` 10229 // Sku - SKU properties of the API Management service. 10230 Sku *ServiceSkuProperties `json:"sku,omitempty"` 10231 // Identity - Managed service identity of the Api Management service. 10232 Identity *ServiceIdentity `json:"identity,omitempty"` 10233 // Etag - READ-ONLY; ETag of the resource. 10234 Etag *string `json:"etag,omitempty"` 10235 // ID - READ-ONLY; Resource ID. 10236 ID *string `json:"id,omitempty"` 10237 // Name - READ-ONLY; Resource name. 10238 Name *string `json:"name,omitempty"` 10239 // Type - READ-ONLY; Resource type for API Management resource is set to Microsoft.ApiManagement. 10240 Type *string `json:"type,omitempty"` 10241 // Tags - Resource tags. 10242 Tags map[string]*string `json:"tags"` 10243} 10244 10245// MarshalJSON is the custom marshaler for ServiceUpdateParameters. 10246func (sup ServiceUpdateParameters) MarshalJSON() ([]byte, error) { 10247 objectMap := make(map[string]interface{}) 10248 if sup.ServiceUpdateProperties != nil { 10249 objectMap["properties"] = sup.ServiceUpdateProperties 10250 } 10251 if sup.Sku != nil { 10252 objectMap["sku"] = sup.Sku 10253 } 10254 if sup.Identity != nil { 10255 objectMap["identity"] = sup.Identity 10256 } 10257 if sup.Tags != nil { 10258 objectMap["tags"] = sup.Tags 10259 } 10260 return json.Marshal(objectMap) 10261} 10262 10263// UnmarshalJSON is the custom unmarshaler for ServiceUpdateParameters struct. 10264func (sup *ServiceUpdateParameters) UnmarshalJSON(body []byte) error { 10265 var m map[string]*json.RawMessage 10266 err := json.Unmarshal(body, &m) 10267 if err != nil { 10268 return err 10269 } 10270 for k, v := range m { 10271 switch k { 10272 case "properties": 10273 if v != nil { 10274 var serviceUpdateProperties ServiceUpdateProperties 10275 err = json.Unmarshal(*v, &serviceUpdateProperties) 10276 if err != nil { 10277 return err 10278 } 10279 sup.ServiceUpdateProperties = &serviceUpdateProperties 10280 } 10281 case "sku": 10282 if v != nil { 10283 var sku ServiceSkuProperties 10284 err = json.Unmarshal(*v, &sku) 10285 if err != nil { 10286 return err 10287 } 10288 sup.Sku = &sku 10289 } 10290 case "identity": 10291 if v != nil { 10292 var identity ServiceIdentity 10293 err = json.Unmarshal(*v, &identity) 10294 if err != nil { 10295 return err 10296 } 10297 sup.Identity = &identity 10298 } 10299 case "etag": 10300 if v != nil { 10301 var etag string 10302 err = json.Unmarshal(*v, &etag) 10303 if err != nil { 10304 return err 10305 } 10306 sup.Etag = &etag 10307 } 10308 case "id": 10309 if v != nil { 10310 var ID string 10311 err = json.Unmarshal(*v, &ID) 10312 if err != nil { 10313 return err 10314 } 10315 sup.ID = &ID 10316 } 10317 case "name": 10318 if v != nil { 10319 var name string 10320 err = json.Unmarshal(*v, &name) 10321 if err != nil { 10322 return err 10323 } 10324 sup.Name = &name 10325 } 10326 case "type": 10327 if v != nil { 10328 var typeVar string 10329 err = json.Unmarshal(*v, &typeVar) 10330 if err != nil { 10331 return err 10332 } 10333 sup.Type = &typeVar 10334 } 10335 case "tags": 10336 if v != nil { 10337 var tags map[string]*string 10338 err = json.Unmarshal(*v, &tags) 10339 if err != nil { 10340 return err 10341 } 10342 sup.Tags = tags 10343 } 10344 } 10345 } 10346 10347 return nil 10348} 10349 10350// ServiceUpdateProperties properties of an API Management service resource description. 10351type ServiceUpdateProperties struct { 10352 // PublisherEmail - Publisher email. 10353 PublisherEmail *string `json:"publisherEmail,omitempty"` 10354 // PublisherName - Publisher name. 10355 PublisherName *string `json:"publisherName,omitempty"` 10356 // NotificationSenderEmail - Email address from which the notification will be sent. 10357 NotificationSenderEmail *string `json:"notificationSenderEmail,omitempty"` 10358 // 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. 10359 ProvisioningState *string `json:"provisioningState,omitempty"` 10360 // TargetProvisioningState - READ-ONLY; The provisioning state of the API Management service, which is targeted by the long running operation started on the service. 10361 TargetProvisioningState *string `json:"targetProvisioningState,omitempty"` 10362 // 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. 10363 CreatedAtUtc *date.Time `json:"createdAtUtc,omitempty"` 10364 // GatewayURL - READ-ONLY; Gateway URL of the API Management service. 10365 GatewayURL *string `json:"gatewayUrl,omitempty"` 10366 // GatewayRegionalURL - READ-ONLY; Gateway URL of the API Management service in the Default Region. 10367 GatewayRegionalURL *string `json:"gatewayRegionalUrl,omitempty"` 10368 // PortalURL - READ-ONLY; Publisher portal endpoint Url of the API Management service. 10369 PortalURL *string `json:"portalUrl,omitempty"` 10370 // ManagementAPIURL - READ-ONLY; Management API endpoint URL of the API Management service. 10371 ManagementAPIURL *string `json:"managementApiUrl,omitempty"` 10372 // ScmURL - READ-ONLY; SCM endpoint URL of the API Management service. 10373 ScmURL *string `json:"scmUrl,omitempty"` 10374 // HostnameConfigurations - Custom hostname configuration of the API Management service. 10375 HostnameConfigurations *[]HostnameConfiguration `json:"hostnameConfigurations,omitempty"` 10376 // 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. 10377 PublicIPAddresses *[]string `json:"publicIPAddresses,omitempty"` 10378 // 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. 10379 PrivateIPAddresses *[]string `json:"privateIPAddresses,omitempty"` 10380 // VirtualNetworkConfiguration - Virtual network configuration of the API Management service. 10381 VirtualNetworkConfiguration *VirtualNetworkConfiguration `json:"virtualNetworkConfiguration,omitempty"` 10382 // AdditionalLocations - Additional datacenter locations of the API Management service. 10383 AdditionalLocations *[]AdditionalLocation `json:"additionalLocations,omitempty"` 10384 // 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. 10385 CustomProperties map[string]*string `json:"customProperties"` 10386 // Certificates - List of Certificates that need to be installed in the API Management service. Max supported certificates that can be installed is 10. 10387 Certificates *[]CertificateConfiguration `json:"certificates,omitempty"` 10388 // 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' 10389 VirtualNetworkType VirtualNetworkType `json:"virtualNetworkType,omitempty"` 10390} 10391 10392// MarshalJSON is the custom marshaler for ServiceUpdateProperties. 10393func (sup ServiceUpdateProperties) MarshalJSON() ([]byte, error) { 10394 objectMap := make(map[string]interface{}) 10395 if sup.PublisherEmail != nil { 10396 objectMap["publisherEmail"] = sup.PublisherEmail 10397 } 10398 if sup.PublisherName != nil { 10399 objectMap["publisherName"] = sup.PublisherName 10400 } 10401 if sup.NotificationSenderEmail != nil { 10402 objectMap["notificationSenderEmail"] = sup.NotificationSenderEmail 10403 } 10404 if sup.HostnameConfigurations != nil { 10405 objectMap["hostnameConfigurations"] = sup.HostnameConfigurations 10406 } 10407 if sup.VirtualNetworkConfiguration != nil { 10408 objectMap["virtualNetworkConfiguration"] = sup.VirtualNetworkConfiguration 10409 } 10410 if sup.AdditionalLocations != nil { 10411 objectMap["additionalLocations"] = sup.AdditionalLocations 10412 } 10413 if sup.CustomProperties != nil { 10414 objectMap["customProperties"] = sup.CustomProperties 10415 } 10416 if sup.Certificates != nil { 10417 objectMap["certificates"] = sup.Certificates 10418 } 10419 if sup.VirtualNetworkType != "" { 10420 objectMap["virtualNetworkType"] = sup.VirtualNetworkType 10421 } 10422 return json.Marshal(objectMap) 10423} 10424 10425// ServiceUploadCertificateParameters parameters supplied to the Upload SSL certificate for an API 10426// Management service operation. 10427type ServiceUploadCertificateParameters struct { 10428 // Type - Hostname type. Possible values include: 'Proxy', 'Portal', 'Management', 'Scm' 10429 Type HostnameType `json:"type,omitempty"` 10430 // Certificate - Base64 Encoded certificate. 10431 Certificate *string `json:"certificate,omitempty"` 10432 // CertificatePassword - Certificate password. 10433 CertificatePassword *string `json:"certificate_password,omitempty"` 10434} 10435 10436// SubscriptionCollection paged Subscriptions list representation. 10437type SubscriptionCollection struct { 10438 autorest.Response `json:"-"` 10439 // Value - Page values. 10440 Value *[]SubscriptionContract `json:"value,omitempty"` 10441 // NextLink - Next page link if any. 10442 NextLink *string `json:"nextLink,omitempty"` 10443} 10444 10445// SubscriptionCollectionIterator provides access to a complete listing of SubscriptionContract values. 10446type SubscriptionCollectionIterator struct { 10447 i int 10448 page SubscriptionCollectionPage 10449} 10450 10451// NextWithContext advances to the next value. If there was an error making 10452// the request the iterator does not advance and the error is returned. 10453func (iter *SubscriptionCollectionIterator) NextWithContext(ctx context.Context) (err error) { 10454 if tracing.IsEnabled() { 10455 ctx = tracing.StartSpan(ctx, fqdn+"/SubscriptionCollectionIterator.NextWithContext") 10456 defer func() { 10457 sc := -1 10458 if iter.Response().Response.Response != nil { 10459 sc = iter.Response().Response.Response.StatusCode 10460 } 10461 tracing.EndSpan(ctx, sc, err) 10462 }() 10463 } 10464 iter.i++ 10465 if iter.i < len(iter.page.Values()) { 10466 return nil 10467 } 10468 err = iter.page.NextWithContext(ctx) 10469 if err != nil { 10470 iter.i-- 10471 return err 10472 } 10473 iter.i = 0 10474 return nil 10475} 10476 10477// Next advances to the next value. If there was an error making 10478// the request the iterator does not advance and the error is returned. 10479// Deprecated: Use NextWithContext() instead. 10480func (iter *SubscriptionCollectionIterator) Next() error { 10481 return iter.NextWithContext(context.Background()) 10482} 10483 10484// NotDone returns true if the enumeration should be started or is not yet complete. 10485func (iter SubscriptionCollectionIterator) NotDone() bool { 10486 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 10487} 10488 10489// Response returns the raw server response from the last page request. 10490func (iter SubscriptionCollectionIterator) Response() SubscriptionCollection { 10491 return iter.page.Response() 10492} 10493 10494// Value returns the current value or a zero-initialized value if the 10495// iterator has advanced beyond the end of the collection. 10496func (iter SubscriptionCollectionIterator) Value() SubscriptionContract { 10497 if !iter.page.NotDone() { 10498 return SubscriptionContract{} 10499 } 10500 return iter.page.Values()[iter.i] 10501} 10502 10503// Creates a new instance of the SubscriptionCollectionIterator type. 10504func NewSubscriptionCollectionIterator(page SubscriptionCollectionPage) SubscriptionCollectionIterator { 10505 return SubscriptionCollectionIterator{page: page} 10506} 10507 10508// IsEmpty returns true if the ListResult contains no values. 10509func (sc SubscriptionCollection) IsEmpty() bool { 10510 return sc.Value == nil || len(*sc.Value) == 0 10511} 10512 10513// hasNextLink returns true if the NextLink is not empty. 10514func (sc SubscriptionCollection) hasNextLink() bool { 10515 return sc.NextLink != nil && len(*sc.NextLink) != 0 10516} 10517 10518// subscriptionCollectionPreparer prepares a request to retrieve the next set of results. 10519// It returns nil if no more results exist. 10520func (sc SubscriptionCollection) subscriptionCollectionPreparer(ctx context.Context) (*http.Request, error) { 10521 if !sc.hasNextLink() { 10522 return nil, nil 10523 } 10524 return autorest.Prepare((&http.Request{}).WithContext(ctx), 10525 autorest.AsJSON(), 10526 autorest.AsGet(), 10527 autorest.WithBaseURL(to.String(sc.NextLink))) 10528} 10529 10530// SubscriptionCollectionPage contains a page of SubscriptionContract values. 10531type SubscriptionCollectionPage struct { 10532 fn func(context.Context, SubscriptionCollection) (SubscriptionCollection, error) 10533 sc SubscriptionCollection 10534} 10535 10536// NextWithContext advances to the next page of values. If there was an error making 10537// the request the page does not advance and the error is returned. 10538func (page *SubscriptionCollectionPage) NextWithContext(ctx context.Context) (err error) { 10539 if tracing.IsEnabled() { 10540 ctx = tracing.StartSpan(ctx, fqdn+"/SubscriptionCollectionPage.NextWithContext") 10541 defer func() { 10542 sc := -1 10543 if page.Response().Response.Response != nil { 10544 sc = page.Response().Response.Response.StatusCode 10545 } 10546 tracing.EndSpan(ctx, sc, err) 10547 }() 10548 } 10549 for { 10550 next, err := page.fn(ctx, page.sc) 10551 if err != nil { 10552 return err 10553 } 10554 page.sc = next 10555 if !next.hasNextLink() || !next.IsEmpty() { 10556 break 10557 } 10558 } 10559 return nil 10560} 10561 10562// Next advances to the next page of values. If there was an error making 10563// the request the page does not advance and the error is returned. 10564// Deprecated: Use NextWithContext() instead. 10565func (page *SubscriptionCollectionPage) Next() error { 10566 return page.NextWithContext(context.Background()) 10567} 10568 10569// NotDone returns true if the page enumeration should be started or is not yet complete. 10570func (page SubscriptionCollectionPage) NotDone() bool { 10571 return !page.sc.IsEmpty() 10572} 10573 10574// Response returns the raw server response from the last page request. 10575func (page SubscriptionCollectionPage) Response() SubscriptionCollection { 10576 return page.sc 10577} 10578 10579// Values returns the slice of values for the current page or nil if there are no values. 10580func (page SubscriptionCollectionPage) Values() []SubscriptionContract { 10581 if page.sc.IsEmpty() { 10582 return nil 10583 } 10584 return *page.sc.Value 10585} 10586 10587// Creates a new instance of the SubscriptionCollectionPage type. 10588func NewSubscriptionCollectionPage(cur SubscriptionCollection, getNextPage func(context.Context, SubscriptionCollection) (SubscriptionCollection, error)) SubscriptionCollectionPage { 10589 return SubscriptionCollectionPage{ 10590 fn: getNextPage, 10591 sc: cur, 10592 } 10593} 10594 10595// SubscriptionContract subscription details. 10596type SubscriptionContract struct { 10597 autorest.Response `json:"-"` 10598 // SubscriptionContractProperties - Subscription contract properties. 10599 *SubscriptionContractProperties `json:"properties,omitempty"` 10600 // ID - READ-ONLY; Resource ID. 10601 ID *string `json:"id,omitempty"` 10602 // Name - READ-ONLY; Resource name. 10603 Name *string `json:"name,omitempty"` 10604 // Type - READ-ONLY; Resource type for API Management resource. 10605 Type *string `json:"type,omitempty"` 10606} 10607 10608// MarshalJSON is the custom marshaler for SubscriptionContract. 10609func (sc SubscriptionContract) MarshalJSON() ([]byte, error) { 10610 objectMap := make(map[string]interface{}) 10611 if sc.SubscriptionContractProperties != nil { 10612 objectMap["properties"] = sc.SubscriptionContractProperties 10613 } 10614 return json.Marshal(objectMap) 10615} 10616 10617// UnmarshalJSON is the custom unmarshaler for SubscriptionContract struct. 10618func (sc *SubscriptionContract) UnmarshalJSON(body []byte) error { 10619 var m map[string]*json.RawMessage 10620 err := json.Unmarshal(body, &m) 10621 if err != nil { 10622 return err 10623 } 10624 for k, v := range m { 10625 switch k { 10626 case "properties": 10627 if v != nil { 10628 var subscriptionContractProperties SubscriptionContractProperties 10629 err = json.Unmarshal(*v, &subscriptionContractProperties) 10630 if err != nil { 10631 return err 10632 } 10633 sc.SubscriptionContractProperties = &subscriptionContractProperties 10634 } 10635 case "id": 10636 if v != nil { 10637 var ID string 10638 err = json.Unmarshal(*v, &ID) 10639 if err != nil { 10640 return err 10641 } 10642 sc.ID = &ID 10643 } 10644 case "name": 10645 if v != nil { 10646 var name string 10647 err = json.Unmarshal(*v, &name) 10648 if err != nil { 10649 return err 10650 } 10651 sc.Name = &name 10652 } 10653 case "type": 10654 if v != nil { 10655 var typeVar string 10656 err = json.Unmarshal(*v, &typeVar) 10657 if err != nil { 10658 return err 10659 } 10660 sc.Type = &typeVar 10661 } 10662 } 10663 } 10664 10665 return nil 10666} 10667 10668// SubscriptionContractProperties subscription details. 10669type SubscriptionContractProperties struct { 10670 // OwnerID - The user resource identifier of the subscription owner. The value is a valid relative URL in the format of /users/{userId} where {userId} is a user identifier. 10671 OwnerID *string `json:"ownerId,omitempty"` 10672 // Scope - Scope like /products/{productId} or /apis or /apis/{apiId}. 10673 Scope *string `json:"scope,omitempty"` 10674 // DisplayName - The name of the subscription, or null if the subscription has no name. 10675 DisplayName *string `json:"displayName,omitempty"` 10676 // 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' 10677 State SubscriptionState `json:"state,omitempty"` 10678 // 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. 10679 CreatedDate *date.Time `json:"createdDate,omitempty"` 10680 // 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. 10681 StartDate *date.Time `json:"startDate,omitempty"` 10682 // 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. 10683 ExpirationDate *date.Time `json:"expirationDate,omitempty"` 10684 // 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. 10685 EndDate *date.Time `json:"endDate,omitempty"` 10686 // 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. 10687 NotificationDate *date.Time `json:"notificationDate,omitempty"` 10688 // PrimaryKey - Subscription primary key. 10689 PrimaryKey *string `json:"primaryKey,omitempty"` 10690 // SecondaryKey - Subscription secondary key. 10691 SecondaryKey *string `json:"secondaryKey,omitempty"` 10692 // StateComment - Optional subscription comment added by an administrator. 10693 StateComment *string `json:"stateComment,omitempty"` 10694 // AllowTracing - Determines whether tracing is enabled 10695 AllowTracing *bool `json:"allowTracing,omitempty"` 10696} 10697 10698// MarshalJSON is the custom marshaler for SubscriptionContractProperties. 10699func (scp SubscriptionContractProperties) MarshalJSON() ([]byte, error) { 10700 objectMap := make(map[string]interface{}) 10701 if scp.OwnerID != nil { 10702 objectMap["ownerId"] = scp.OwnerID 10703 } 10704 if scp.Scope != nil { 10705 objectMap["scope"] = scp.Scope 10706 } 10707 if scp.DisplayName != nil { 10708 objectMap["displayName"] = scp.DisplayName 10709 } 10710 if scp.State != "" { 10711 objectMap["state"] = scp.State 10712 } 10713 if scp.StartDate != nil { 10714 objectMap["startDate"] = scp.StartDate 10715 } 10716 if scp.ExpirationDate != nil { 10717 objectMap["expirationDate"] = scp.ExpirationDate 10718 } 10719 if scp.EndDate != nil { 10720 objectMap["endDate"] = scp.EndDate 10721 } 10722 if scp.NotificationDate != nil { 10723 objectMap["notificationDate"] = scp.NotificationDate 10724 } 10725 if scp.PrimaryKey != nil { 10726 objectMap["primaryKey"] = scp.PrimaryKey 10727 } 10728 if scp.SecondaryKey != nil { 10729 objectMap["secondaryKey"] = scp.SecondaryKey 10730 } 10731 if scp.StateComment != nil { 10732 objectMap["stateComment"] = scp.StateComment 10733 } 10734 if scp.AllowTracing != nil { 10735 objectMap["allowTracing"] = scp.AllowTracing 10736 } 10737 return json.Marshal(objectMap) 10738} 10739 10740// SubscriptionCreateParameterProperties parameters supplied to the Create subscription operation. 10741type SubscriptionCreateParameterProperties struct { 10742 // OwnerID - User (user id path) for whom subscription is being created in form /users/{userId} 10743 OwnerID *string `json:"ownerId,omitempty"` 10744 // Scope - Scope like /products/{productId} or /apis or /apis/{apiId}. 10745 Scope *string `json:"scope,omitempty"` 10746 // DisplayName - Subscription name. 10747 DisplayName *string `json:"displayName,omitempty"` 10748 // PrimaryKey - Primary subscription key. If not specified during request key will be generated automatically. 10749 PrimaryKey *string `json:"primaryKey,omitempty"` 10750 // SecondaryKey - Secondary subscription key. If not specified during request key will be generated automatically. 10751 SecondaryKey *string `json:"secondaryKey,omitempty"` 10752 // 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' 10753 State SubscriptionState `json:"state,omitempty"` 10754 // AllowTracing - Determines whether tracing can be enabled 10755 AllowTracing *bool `json:"allowTracing,omitempty"` 10756} 10757 10758// SubscriptionCreateParameters subscription create details. 10759type SubscriptionCreateParameters struct { 10760 // SubscriptionCreateParameterProperties - Subscription contract properties. 10761 *SubscriptionCreateParameterProperties `json:"properties,omitempty"` 10762} 10763 10764// MarshalJSON is the custom marshaler for SubscriptionCreateParameters. 10765func (scp SubscriptionCreateParameters) MarshalJSON() ([]byte, error) { 10766 objectMap := make(map[string]interface{}) 10767 if scp.SubscriptionCreateParameterProperties != nil { 10768 objectMap["properties"] = scp.SubscriptionCreateParameterProperties 10769 } 10770 return json.Marshal(objectMap) 10771} 10772 10773// UnmarshalJSON is the custom unmarshaler for SubscriptionCreateParameters struct. 10774func (scp *SubscriptionCreateParameters) UnmarshalJSON(body []byte) error { 10775 var m map[string]*json.RawMessage 10776 err := json.Unmarshal(body, &m) 10777 if err != nil { 10778 return err 10779 } 10780 for k, v := range m { 10781 switch k { 10782 case "properties": 10783 if v != nil { 10784 var subscriptionCreateParameterProperties SubscriptionCreateParameterProperties 10785 err = json.Unmarshal(*v, &subscriptionCreateParameterProperties) 10786 if err != nil { 10787 return err 10788 } 10789 scp.SubscriptionCreateParameterProperties = &subscriptionCreateParameterProperties 10790 } 10791 } 10792 } 10793 10794 return nil 10795} 10796 10797// SubscriptionKeyParameterNamesContract subscription key parameter names details. 10798type SubscriptionKeyParameterNamesContract struct { 10799 // Header - Subscription key header name. 10800 Header *string `json:"header,omitempty"` 10801 // Query - Subscription key query string parameter name. 10802 Query *string `json:"query,omitempty"` 10803} 10804 10805// SubscriptionsDelegationSettingsProperties subscriptions delegation settings properties. 10806type SubscriptionsDelegationSettingsProperties struct { 10807 // Enabled - Enable or disable delegation for subscriptions. 10808 Enabled *bool `json:"enabled,omitempty"` 10809} 10810 10811// SubscriptionUpdateParameterProperties parameters supplied to the Update subscription operation. 10812type SubscriptionUpdateParameterProperties struct { 10813 // OwnerID - User identifier path: /users/{userId} 10814 OwnerID *string `json:"ownerId,omitempty"` 10815 // Scope - Scope like /products/{productId} or /apis or /apis/{apiId} 10816 Scope *string `json:"scope,omitempty"` 10817 // 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. 10818 ExpirationDate *date.Time `json:"expirationDate,omitempty"` 10819 // DisplayName - Subscription name. 10820 DisplayName *string `json:"displayName,omitempty"` 10821 // PrimaryKey - Primary subscription key. 10822 PrimaryKey *string `json:"primaryKey,omitempty"` 10823 // SecondaryKey - Secondary subscription key. 10824 SecondaryKey *string `json:"secondaryKey,omitempty"` 10825 // 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' 10826 State SubscriptionState `json:"state,omitempty"` 10827 // StateComment - Comments describing subscription state change by the administrator. 10828 StateComment *string `json:"stateComment,omitempty"` 10829 // AllowTracing - Determines whether tracing can be enabled 10830 AllowTracing *bool `json:"allowTracing,omitempty"` 10831} 10832 10833// SubscriptionUpdateParameters subscription update details. 10834type SubscriptionUpdateParameters struct { 10835 // SubscriptionUpdateParameterProperties - Subscription Update contract properties. 10836 *SubscriptionUpdateParameterProperties `json:"properties,omitempty"` 10837} 10838 10839// MarshalJSON is the custom marshaler for SubscriptionUpdateParameters. 10840func (sup SubscriptionUpdateParameters) MarshalJSON() ([]byte, error) { 10841 objectMap := make(map[string]interface{}) 10842 if sup.SubscriptionUpdateParameterProperties != nil { 10843 objectMap["properties"] = sup.SubscriptionUpdateParameterProperties 10844 } 10845 return json.Marshal(objectMap) 10846} 10847 10848// UnmarshalJSON is the custom unmarshaler for SubscriptionUpdateParameters struct. 10849func (sup *SubscriptionUpdateParameters) UnmarshalJSON(body []byte) error { 10850 var m map[string]*json.RawMessage 10851 err := json.Unmarshal(body, &m) 10852 if err != nil { 10853 return err 10854 } 10855 for k, v := range m { 10856 switch k { 10857 case "properties": 10858 if v != nil { 10859 var subscriptionUpdateParameterProperties SubscriptionUpdateParameterProperties 10860 err = json.Unmarshal(*v, &subscriptionUpdateParameterProperties) 10861 if err != nil { 10862 return err 10863 } 10864 sup.SubscriptionUpdateParameterProperties = &subscriptionUpdateParameterProperties 10865 } 10866 } 10867 } 10868 10869 return nil 10870} 10871 10872// TagCollection paged Tag list representation. 10873type TagCollection struct { 10874 autorest.Response `json:"-"` 10875 // Value - Page values. 10876 Value *[]TagContract `json:"value,omitempty"` 10877 // NextLink - Next page link if any. 10878 NextLink *string `json:"nextLink,omitempty"` 10879} 10880 10881// TagCollectionIterator provides access to a complete listing of TagContract values. 10882type TagCollectionIterator struct { 10883 i int 10884 page TagCollectionPage 10885} 10886 10887// NextWithContext advances to the next value. If there was an error making 10888// the request the iterator does not advance and the error is returned. 10889func (iter *TagCollectionIterator) NextWithContext(ctx context.Context) (err error) { 10890 if tracing.IsEnabled() { 10891 ctx = tracing.StartSpan(ctx, fqdn+"/TagCollectionIterator.NextWithContext") 10892 defer func() { 10893 sc := -1 10894 if iter.Response().Response.Response != nil { 10895 sc = iter.Response().Response.Response.StatusCode 10896 } 10897 tracing.EndSpan(ctx, sc, err) 10898 }() 10899 } 10900 iter.i++ 10901 if iter.i < len(iter.page.Values()) { 10902 return nil 10903 } 10904 err = iter.page.NextWithContext(ctx) 10905 if err != nil { 10906 iter.i-- 10907 return err 10908 } 10909 iter.i = 0 10910 return nil 10911} 10912 10913// Next advances to the next value. If there was an error making 10914// the request the iterator does not advance and the error is returned. 10915// Deprecated: Use NextWithContext() instead. 10916func (iter *TagCollectionIterator) Next() error { 10917 return iter.NextWithContext(context.Background()) 10918} 10919 10920// NotDone returns true if the enumeration should be started or is not yet complete. 10921func (iter TagCollectionIterator) NotDone() bool { 10922 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 10923} 10924 10925// Response returns the raw server response from the last page request. 10926func (iter TagCollectionIterator) Response() TagCollection { 10927 return iter.page.Response() 10928} 10929 10930// Value returns the current value or a zero-initialized value if the 10931// iterator has advanced beyond the end of the collection. 10932func (iter TagCollectionIterator) Value() TagContract { 10933 if !iter.page.NotDone() { 10934 return TagContract{} 10935 } 10936 return iter.page.Values()[iter.i] 10937} 10938 10939// Creates a new instance of the TagCollectionIterator type. 10940func NewTagCollectionIterator(page TagCollectionPage) TagCollectionIterator { 10941 return TagCollectionIterator{page: page} 10942} 10943 10944// IsEmpty returns true if the ListResult contains no values. 10945func (tc TagCollection) IsEmpty() bool { 10946 return tc.Value == nil || len(*tc.Value) == 0 10947} 10948 10949// hasNextLink returns true if the NextLink is not empty. 10950func (tc TagCollection) hasNextLink() bool { 10951 return tc.NextLink != nil && len(*tc.NextLink) != 0 10952} 10953 10954// tagCollectionPreparer prepares a request to retrieve the next set of results. 10955// It returns nil if no more results exist. 10956func (tc TagCollection) tagCollectionPreparer(ctx context.Context) (*http.Request, error) { 10957 if !tc.hasNextLink() { 10958 return nil, nil 10959 } 10960 return autorest.Prepare((&http.Request{}).WithContext(ctx), 10961 autorest.AsJSON(), 10962 autorest.AsGet(), 10963 autorest.WithBaseURL(to.String(tc.NextLink))) 10964} 10965 10966// TagCollectionPage contains a page of TagContract values. 10967type TagCollectionPage struct { 10968 fn func(context.Context, TagCollection) (TagCollection, error) 10969 tc TagCollection 10970} 10971 10972// NextWithContext advances to the next page of values. If there was an error making 10973// the request the page does not advance and the error is returned. 10974func (page *TagCollectionPage) NextWithContext(ctx context.Context) (err error) { 10975 if tracing.IsEnabled() { 10976 ctx = tracing.StartSpan(ctx, fqdn+"/TagCollectionPage.NextWithContext") 10977 defer func() { 10978 sc := -1 10979 if page.Response().Response.Response != nil { 10980 sc = page.Response().Response.Response.StatusCode 10981 } 10982 tracing.EndSpan(ctx, sc, err) 10983 }() 10984 } 10985 for { 10986 next, err := page.fn(ctx, page.tc) 10987 if err != nil { 10988 return err 10989 } 10990 page.tc = next 10991 if !next.hasNextLink() || !next.IsEmpty() { 10992 break 10993 } 10994 } 10995 return nil 10996} 10997 10998// Next advances to the next page of values. If there was an error making 10999// the request the page does not advance and the error is returned. 11000// Deprecated: Use NextWithContext() instead. 11001func (page *TagCollectionPage) Next() error { 11002 return page.NextWithContext(context.Background()) 11003} 11004 11005// NotDone returns true if the page enumeration should be started or is not yet complete. 11006func (page TagCollectionPage) NotDone() bool { 11007 return !page.tc.IsEmpty() 11008} 11009 11010// Response returns the raw server response from the last page request. 11011func (page TagCollectionPage) Response() TagCollection { 11012 return page.tc 11013} 11014 11015// Values returns the slice of values for the current page or nil if there are no values. 11016func (page TagCollectionPage) Values() []TagContract { 11017 if page.tc.IsEmpty() { 11018 return nil 11019 } 11020 return *page.tc.Value 11021} 11022 11023// Creates a new instance of the TagCollectionPage type. 11024func NewTagCollectionPage(cur TagCollection, getNextPage func(context.Context, TagCollection) (TagCollection, error)) TagCollectionPage { 11025 return TagCollectionPage{ 11026 fn: getNextPage, 11027 tc: cur, 11028 } 11029} 11030 11031// TagContract tag Contract details. 11032type TagContract struct { 11033 autorest.Response `json:"-"` 11034 // TagContractProperties - Tag entity contract properties. 11035 *TagContractProperties `json:"properties,omitempty"` 11036 // ID - READ-ONLY; Resource ID. 11037 ID *string `json:"id,omitempty"` 11038 // Name - READ-ONLY; Resource name. 11039 Name *string `json:"name,omitempty"` 11040 // Type - READ-ONLY; Resource type for API Management resource. 11041 Type *string `json:"type,omitempty"` 11042} 11043 11044// MarshalJSON is the custom marshaler for TagContract. 11045func (tc TagContract) MarshalJSON() ([]byte, error) { 11046 objectMap := make(map[string]interface{}) 11047 if tc.TagContractProperties != nil { 11048 objectMap["properties"] = tc.TagContractProperties 11049 } 11050 return json.Marshal(objectMap) 11051} 11052 11053// UnmarshalJSON is the custom unmarshaler for TagContract struct. 11054func (tc *TagContract) UnmarshalJSON(body []byte) error { 11055 var m map[string]*json.RawMessage 11056 err := json.Unmarshal(body, &m) 11057 if err != nil { 11058 return err 11059 } 11060 for k, v := range m { 11061 switch k { 11062 case "properties": 11063 if v != nil { 11064 var tagContractProperties TagContractProperties 11065 err = json.Unmarshal(*v, &tagContractProperties) 11066 if err != nil { 11067 return err 11068 } 11069 tc.TagContractProperties = &tagContractProperties 11070 } 11071 case "id": 11072 if v != nil { 11073 var ID string 11074 err = json.Unmarshal(*v, &ID) 11075 if err != nil { 11076 return err 11077 } 11078 tc.ID = &ID 11079 } 11080 case "name": 11081 if v != nil { 11082 var name string 11083 err = json.Unmarshal(*v, &name) 11084 if err != nil { 11085 return err 11086 } 11087 tc.Name = &name 11088 } 11089 case "type": 11090 if v != nil { 11091 var typeVar string 11092 err = json.Unmarshal(*v, &typeVar) 11093 if err != nil { 11094 return err 11095 } 11096 tc.Type = &typeVar 11097 } 11098 } 11099 } 11100 11101 return nil 11102} 11103 11104// TagContractProperties tag contract Properties. 11105type TagContractProperties struct { 11106 // DisplayName - Tag name. 11107 DisplayName *string `json:"displayName,omitempty"` 11108} 11109 11110// TagCreateUpdateParameters parameters supplied to Create/Update Tag operations. 11111type TagCreateUpdateParameters struct { 11112 // TagContractProperties - Properties supplied to Create Tag operation. 11113 *TagContractProperties `json:"properties,omitempty"` 11114} 11115 11116// MarshalJSON is the custom marshaler for TagCreateUpdateParameters. 11117func (tcup TagCreateUpdateParameters) MarshalJSON() ([]byte, error) { 11118 objectMap := make(map[string]interface{}) 11119 if tcup.TagContractProperties != nil { 11120 objectMap["properties"] = tcup.TagContractProperties 11121 } 11122 return json.Marshal(objectMap) 11123} 11124 11125// UnmarshalJSON is the custom unmarshaler for TagCreateUpdateParameters struct. 11126func (tcup *TagCreateUpdateParameters) UnmarshalJSON(body []byte) error { 11127 var m map[string]*json.RawMessage 11128 err := json.Unmarshal(body, &m) 11129 if err != nil { 11130 return err 11131 } 11132 for k, v := range m { 11133 switch k { 11134 case "properties": 11135 if v != nil { 11136 var tagContractProperties TagContractProperties 11137 err = json.Unmarshal(*v, &tagContractProperties) 11138 if err != nil { 11139 return err 11140 } 11141 tcup.TagContractProperties = &tagContractProperties 11142 } 11143 } 11144 } 11145 11146 return nil 11147} 11148 11149// TagDescriptionBaseProperties parameters supplied to the Create TagDescription operation. 11150type TagDescriptionBaseProperties struct { 11151 // Description - Description of the Tag. 11152 Description *string `json:"description,omitempty"` 11153 // ExternalDocsURL - Absolute URL of external resources describing the tag. 11154 ExternalDocsURL *string `json:"externalDocsUrl,omitempty"` 11155 // ExternalDocsDescription - Description of the external resources describing the tag. 11156 ExternalDocsDescription *string `json:"externalDocsDescription,omitempty"` 11157} 11158 11159// TagDescriptionCollection paged TagDescription list representation. 11160type TagDescriptionCollection struct { 11161 autorest.Response `json:"-"` 11162 // Value - Page values. 11163 Value *[]TagDescriptionContract `json:"value,omitempty"` 11164 // NextLink - Next page link if any. 11165 NextLink *string `json:"nextLink,omitempty"` 11166} 11167 11168// TagDescriptionCollectionIterator provides access to a complete listing of TagDescriptionContract values. 11169type TagDescriptionCollectionIterator struct { 11170 i int 11171 page TagDescriptionCollectionPage 11172} 11173 11174// NextWithContext advances to the next value. If there was an error making 11175// the request the iterator does not advance and the error is returned. 11176func (iter *TagDescriptionCollectionIterator) NextWithContext(ctx context.Context) (err error) { 11177 if tracing.IsEnabled() { 11178 ctx = tracing.StartSpan(ctx, fqdn+"/TagDescriptionCollectionIterator.NextWithContext") 11179 defer func() { 11180 sc := -1 11181 if iter.Response().Response.Response != nil { 11182 sc = iter.Response().Response.Response.StatusCode 11183 } 11184 tracing.EndSpan(ctx, sc, err) 11185 }() 11186 } 11187 iter.i++ 11188 if iter.i < len(iter.page.Values()) { 11189 return nil 11190 } 11191 err = iter.page.NextWithContext(ctx) 11192 if err != nil { 11193 iter.i-- 11194 return err 11195 } 11196 iter.i = 0 11197 return nil 11198} 11199 11200// Next advances to the next value. If there was an error making 11201// the request the iterator does not advance and the error is returned. 11202// Deprecated: Use NextWithContext() instead. 11203func (iter *TagDescriptionCollectionIterator) Next() error { 11204 return iter.NextWithContext(context.Background()) 11205} 11206 11207// NotDone returns true if the enumeration should be started or is not yet complete. 11208func (iter TagDescriptionCollectionIterator) NotDone() bool { 11209 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 11210} 11211 11212// Response returns the raw server response from the last page request. 11213func (iter TagDescriptionCollectionIterator) Response() TagDescriptionCollection { 11214 return iter.page.Response() 11215} 11216 11217// Value returns the current value or a zero-initialized value if the 11218// iterator has advanced beyond the end of the collection. 11219func (iter TagDescriptionCollectionIterator) Value() TagDescriptionContract { 11220 if !iter.page.NotDone() { 11221 return TagDescriptionContract{} 11222 } 11223 return iter.page.Values()[iter.i] 11224} 11225 11226// Creates a new instance of the TagDescriptionCollectionIterator type. 11227func NewTagDescriptionCollectionIterator(page TagDescriptionCollectionPage) TagDescriptionCollectionIterator { 11228 return TagDescriptionCollectionIterator{page: page} 11229} 11230 11231// IsEmpty returns true if the ListResult contains no values. 11232func (tdc TagDescriptionCollection) IsEmpty() bool { 11233 return tdc.Value == nil || len(*tdc.Value) == 0 11234} 11235 11236// hasNextLink returns true if the NextLink is not empty. 11237func (tdc TagDescriptionCollection) hasNextLink() bool { 11238 return tdc.NextLink != nil && len(*tdc.NextLink) != 0 11239} 11240 11241// tagDescriptionCollectionPreparer prepares a request to retrieve the next set of results. 11242// It returns nil if no more results exist. 11243func (tdc TagDescriptionCollection) tagDescriptionCollectionPreparer(ctx context.Context) (*http.Request, error) { 11244 if !tdc.hasNextLink() { 11245 return nil, nil 11246 } 11247 return autorest.Prepare((&http.Request{}).WithContext(ctx), 11248 autorest.AsJSON(), 11249 autorest.AsGet(), 11250 autorest.WithBaseURL(to.String(tdc.NextLink))) 11251} 11252 11253// TagDescriptionCollectionPage contains a page of TagDescriptionContract values. 11254type TagDescriptionCollectionPage struct { 11255 fn func(context.Context, TagDescriptionCollection) (TagDescriptionCollection, error) 11256 tdc TagDescriptionCollection 11257} 11258 11259// NextWithContext advances to the next page of values. If there was an error making 11260// the request the page does not advance and the error is returned. 11261func (page *TagDescriptionCollectionPage) NextWithContext(ctx context.Context) (err error) { 11262 if tracing.IsEnabled() { 11263 ctx = tracing.StartSpan(ctx, fqdn+"/TagDescriptionCollectionPage.NextWithContext") 11264 defer func() { 11265 sc := -1 11266 if page.Response().Response.Response != nil { 11267 sc = page.Response().Response.Response.StatusCode 11268 } 11269 tracing.EndSpan(ctx, sc, err) 11270 }() 11271 } 11272 for { 11273 next, err := page.fn(ctx, page.tdc) 11274 if err != nil { 11275 return err 11276 } 11277 page.tdc = next 11278 if !next.hasNextLink() || !next.IsEmpty() { 11279 break 11280 } 11281 } 11282 return nil 11283} 11284 11285// Next advances to the next page of values. If there was an error making 11286// the request the page does not advance and the error is returned. 11287// Deprecated: Use NextWithContext() instead. 11288func (page *TagDescriptionCollectionPage) Next() error { 11289 return page.NextWithContext(context.Background()) 11290} 11291 11292// NotDone returns true if the page enumeration should be started or is not yet complete. 11293func (page TagDescriptionCollectionPage) NotDone() bool { 11294 return !page.tdc.IsEmpty() 11295} 11296 11297// Response returns the raw server response from the last page request. 11298func (page TagDescriptionCollectionPage) Response() TagDescriptionCollection { 11299 return page.tdc 11300} 11301 11302// Values returns the slice of values for the current page or nil if there are no values. 11303func (page TagDescriptionCollectionPage) Values() []TagDescriptionContract { 11304 if page.tdc.IsEmpty() { 11305 return nil 11306 } 11307 return *page.tdc.Value 11308} 11309 11310// Creates a new instance of the TagDescriptionCollectionPage type. 11311func NewTagDescriptionCollectionPage(cur TagDescriptionCollection, getNextPage func(context.Context, TagDescriptionCollection) (TagDescriptionCollection, error)) TagDescriptionCollectionPage { 11312 return TagDescriptionCollectionPage{ 11313 fn: getNextPage, 11314 tdc: cur, 11315 } 11316} 11317 11318// TagDescriptionContract contract details. 11319type TagDescriptionContract struct { 11320 autorest.Response `json:"-"` 11321 // TagDescriptionContractProperties - TagDescription entity contract properties. 11322 *TagDescriptionContractProperties `json:"properties,omitempty"` 11323 // ID - READ-ONLY; Resource ID. 11324 ID *string `json:"id,omitempty"` 11325 // Name - READ-ONLY; Resource name. 11326 Name *string `json:"name,omitempty"` 11327 // Type - READ-ONLY; Resource type for API Management resource. 11328 Type *string `json:"type,omitempty"` 11329} 11330 11331// MarshalJSON is the custom marshaler for TagDescriptionContract. 11332func (tdc TagDescriptionContract) MarshalJSON() ([]byte, error) { 11333 objectMap := make(map[string]interface{}) 11334 if tdc.TagDescriptionContractProperties != nil { 11335 objectMap["properties"] = tdc.TagDescriptionContractProperties 11336 } 11337 return json.Marshal(objectMap) 11338} 11339 11340// UnmarshalJSON is the custom unmarshaler for TagDescriptionContract struct. 11341func (tdc *TagDescriptionContract) UnmarshalJSON(body []byte) error { 11342 var m map[string]*json.RawMessage 11343 err := json.Unmarshal(body, &m) 11344 if err != nil { 11345 return err 11346 } 11347 for k, v := range m { 11348 switch k { 11349 case "properties": 11350 if v != nil { 11351 var tagDescriptionContractProperties TagDescriptionContractProperties 11352 err = json.Unmarshal(*v, &tagDescriptionContractProperties) 11353 if err != nil { 11354 return err 11355 } 11356 tdc.TagDescriptionContractProperties = &tagDescriptionContractProperties 11357 } 11358 case "id": 11359 if v != nil { 11360 var ID string 11361 err = json.Unmarshal(*v, &ID) 11362 if err != nil { 11363 return err 11364 } 11365 tdc.ID = &ID 11366 } 11367 case "name": 11368 if v != nil { 11369 var name string 11370 err = json.Unmarshal(*v, &name) 11371 if err != nil { 11372 return err 11373 } 11374 tdc.Name = &name 11375 } 11376 case "type": 11377 if v != nil { 11378 var typeVar string 11379 err = json.Unmarshal(*v, &typeVar) 11380 if err != nil { 11381 return err 11382 } 11383 tdc.Type = &typeVar 11384 } 11385 } 11386 } 11387 11388 return nil 11389} 11390 11391// TagDescriptionContractProperties tagDescription contract Properties. 11392type TagDescriptionContractProperties struct { 11393 // DisplayName - Tag name. 11394 DisplayName *string `json:"displayName,omitempty"` 11395 // Description - Description of the Tag. 11396 Description *string `json:"description,omitempty"` 11397 // ExternalDocsURL - Absolute URL of external resources describing the tag. 11398 ExternalDocsURL *string `json:"externalDocsUrl,omitempty"` 11399 // ExternalDocsDescription - Description of the external resources describing the tag. 11400 ExternalDocsDescription *string `json:"externalDocsDescription,omitempty"` 11401} 11402 11403// TagDescriptionCreateParameters parameters supplied to the Create TagDescription operation. 11404type TagDescriptionCreateParameters struct { 11405 // TagDescriptionBaseProperties - Properties supplied to Create TagDescription operation. 11406 *TagDescriptionBaseProperties `json:"properties,omitempty"` 11407} 11408 11409// MarshalJSON is the custom marshaler for TagDescriptionCreateParameters. 11410func (tdcp TagDescriptionCreateParameters) MarshalJSON() ([]byte, error) { 11411 objectMap := make(map[string]interface{}) 11412 if tdcp.TagDescriptionBaseProperties != nil { 11413 objectMap["properties"] = tdcp.TagDescriptionBaseProperties 11414 } 11415 return json.Marshal(objectMap) 11416} 11417 11418// UnmarshalJSON is the custom unmarshaler for TagDescriptionCreateParameters struct. 11419func (tdcp *TagDescriptionCreateParameters) UnmarshalJSON(body []byte) error { 11420 var m map[string]*json.RawMessage 11421 err := json.Unmarshal(body, &m) 11422 if err != nil { 11423 return err 11424 } 11425 for k, v := range m { 11426 switch k { 11427 case "properties": 11428 if v != nil { 11429 var tagDescriptionBaseProperties TagDescriptionBaseProperties 11430 err = json.Unmarshal(*v, &tagDescriptionBaseProperties) 11431 if err != nil { 11432 return err 11433 } 11434 tdcp.TagDescriptionBaseProperties = &tagDescriptionBaseProperties 11435 } 11436 } 11437 } 11438 11439 return nil 11440} 11441 11442// TagResourceCollection paged Tag list representation. 11443type TagResourceCollection struct { 11444 autorest.Response `json:"-"` 11445 // Value - Page values. 11446 Value *[]TagResourceContract `json:"value,omitempty"` 11447 // NextLink - Next page link if any. 11448 NextLink *string `json:"nextLink,omitempty"` 11449} 11450 11451// TagResourceCollectionIterator provides access to a complete listing of TagResourceContract values. 11452type TagResourceCollectionIterator struct { 11453 i int 11454 page TagResourceCollectionPage 11455} 11456 11457// NextWithContext advances to the next value. If there was an error making 11458// the request the iterator does not advance and the error is returned. 11459func (iter *TagResourceCollectionIterator) NextWithContext(ctx context.Context) (err error) { 11460 if tracing.IsEnabled() { 11461 ctx = tracing.StartSpan(ctx, fqdn+"/TagResourceCollectionIterator.NextWithContext") 11462 defer func() { 11463 sc := -1 11464 if iter.Response().Response.Response != nil { 11465 sc = iter.Response().Response.Response.StatusCode 11466 } 11467 tracing.EndSpan(ctx, sc, err) 11468 }() 11469 } 11470 iter.i++ 11471 if iter.i < len(iter.page.Values()) { 11472 return nil 11473 } 11474 err = iter.page.NextWithContext(ctx) 11475 if err != nil { 11476 iter.i-- 11477 return err 11478 } 11479 iter.i = 0 11480 return nil 11481} 11482 11483// Next advances to the next value. If there was an error making 11484// the request the iterator does not advance and the error is returned. 11485// Deprecated: Use NextWithContext() instead. 11486func (iter *TagResourceCollectionIterator) Next() error { 11487 return iter.NextWithContext(context.Background()) 11488} 11489 11490// NotDone returns true if the enumeration should be started or is not yet complete. 11491func (iter TagResourceCollectionIterator) NotDone() bool { 11492 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 11493} 11494 11495// Response returns the raw server response from the last page request. 11496func (iter TagResourceCollectionIterator) Response() TagResourceCollection { 11497 return iter.page.Response() 11498} 11499 11500// Value returns the current value or a zero-initialized value if the 11501// iterator has advanced beyond the end of the collection. 11502func (iter TagResourceCollectionIterator) Value() TagResourceContract { 11503 if !iter.page.NotDone() { 11504 return TagResourceContract{} 11505 } 11506 return iter.page.Values()[iter.i] 11507} 11508 11509// Creates a new instance of the TagResourceCollectionIterator type. 11510func NewTagResourceCollectionIterator(page TagResourceCollectionPage) TagResourceCollectionIterator { 11511 return TagResourceCollectionIterator{page: page} 11512} 11513 11514// IsEmpty returns true if the ListResult contains no values. 11515func (trc TagResourceCollection) IsEmpty() bool { 11516 return trc.Value == nil || len(*trc.Value) == 0 11517} 11518 11519// hasNextLink returns true if the NextLink is not empty. 11520func (trc TagResourceCollection) hasNextLink() bool { 11521 return trc.NextLink != nil && len(*trc.NextLink) != 0 11522} 11523 11524// tagResourceCollectionPreparer prepares a request to retrieve the next set of results. 11525// It returns nil if no more results exist. 11526func (trc TagResourceCollection) tagResourceCollectionPreparer(ctx context.Context) (*http.Request, error) { 11527 if !trc.hasNextLink() { 11528 return nil, nil 11529 } 11530 return autorest.Prepare((&http.Request{}).WithContext(ctx), 11531 autorest.AsJSON(), 11532 autorest.AsGet(), 11533 autorest.WithBaseURL(to.String(trc.NextLink))) 11534} 11535 11536// TagResourceCollectionPage contains a page of TagResourceContract values. 11537type TagResourceCollectionPage struct { 11538 fn func(context.Context, TagResourceCollection) (TagResourceCollection, error) 11539 trc TagResourceCollection 11540} 11541 11542// NextWithContext advances to the next page of values. If there was an error making 11543// the request the page does not advance and the error is returned. 11544func (page *TagResourceCollectionPage) NextWithContext(ctx context.Context) (err error) { 11545 if tracing.IsEnabled() { 11546 ctx = tracing.StartSpan(ctx, fqdn+"/TagResourceCollectionPage.NextWithContext") 11547 defer func() { 11548 sc := -1 11549 if page.Response().Response.Response != nil { 11550 sc = page.Response().Response.Response.StatusCode 11551 } 11552 tracing.EndSpan(ctx, sc, err) 11553 }() 11554 } 11555 for { 11556 next, err := page.fn(ctx, page.trc) 11557 if err != nil { 11558 return err 11559 } 11560 page.trc = next 11561 if !next.hasNextLink() || !next.IsEmpty() { 11562 break 11563 } 11564 } 11565 return nil 11566} 11567 11568// Next advances to the next page of values. If there was an error making 11569// the request the page does not advance and the error is returned. 11570// Deprecated: Use NextWithContext() instead. 11571func (page *TagResourceCollectionPage) Next() error { 11572 return page.NextWithContext(context.Background()) 11573} 11574 11575// NotDone returns true if the page enumeration should be started or is not yet complete. 11576func (page TagResourceCollectionPage) NotDone() bool { 11577 return !page.trc.IsEmpty() 11578} 11579 11580// Response returns the raw server response from the last page request. 11581func (page TagResourceCollectionPage) Response() TagResourceCollection { 11582 return page.trc 11583} 11584 11585// Values returns the slice of values for the current page or nil if there are no values. 11586func (page TagResourceCollectionPage) Values() []TagResourceContract { 11587 if page.trc.IsEmpty() { 11588 return nil 11589 } 11590 return *page.trc.Value 11591} 11592 11593// Creates a new instance of the TagResourceCollectionPage type. 11594func NewTagResourceCollectionPage(cur TagResourceCollection, getNextPage func(context.Context, TagResourceCollection) (TagResourceCollection, error)) TagResourceCollectionPage { 11595 return TagResourceCollectionPage{ 11596 fn: getNextPage, 11597 trc: cur, 11598 } 11599} 11600 11601// TagResourceContract tagResource contract properties. 11602type TagResourceContract struct { 11603 // Tag - Tag associated with the resource. 11604 Tag *TagTagResourceContractProperties `json:"tag,omitempty"` 11605 // API - Api associated with the tag. 11606 API *APITagResourceContractProperties `json:"api,omitempty"` 11607 // Operation - Operation associated with the tag. 11608 Operation *OperationTagResourceContractProperties `json:"operation,omitempty"` 11609 // Product - Product associated with the tag. 11610 Product *ProductTagResourceContractProperties `json:"product,omitempty"` 11611} 11612 11613// TagTagResourceContractProperties contract defining the Tag property in the Tag Resource Contract 11614type TagTagResourceContractProperties struct { 11615 // ID - Tag identifier 11616 ID *string `json:"id,omitempty"` 11617 // Name - Tag Name 11618 Name *string `json:"name,omitempty"` 11619} 11620 11621// TenantConfigurationDeployFuture an abstraction for monitoring and retrieving the results of a 11622// long-running operation. 11623type TenantConfigurationDeployFuture struct { 11624 azure.FutureAPI 11625 // Result returns the result of the asynchronous operation. 11626 // If the operation has not completed it will return an error. 11627 Result func(TenantConfigurationClient) (OperationResultContract, error) 11628} 11629 11630// UnmarshalJSON is the custom unmarshaller for CreateFuture. 11631func (future *TenantConfigurationDeployFuture) UnmarshalJSON(body []byte) error { 11632 var azFuture azure.Future 11633 if err := json.Unmarshal(body, &azFuture); err != nil { 11634 return err 11635 } 11636 future.FutureAPI = &azFuture 11637 future.Result = future.result 11638 return nil 11639} 11640 11641// result is the default implementation for TenantConfigurationDeployFuture.Result. 11642func (future *TenantConfigurationDeployFuture) result(client TenantConfigurationClient) (orc OperationResultContract, err error) { 11643 var done bool 11644 done, err = future.DoneWithContext(context.Background(), client) 11645 if err != nil { 11646 err = autorest.NewErrorWithError(err, "apimanagement.TenantConfigurationDeployFuture", "Result", future.Response(), "Polling failure") 11647 return 11648 } 11649 if !done { 11650 orc.Response.Response = future.Response() 11651 err = azure.NewAsyncOpIncompleteError("apimanagement.TenantConfigurationDeployFuture") 11652 return 11653 } 11654 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 11655 if orc.Response.Response, err = future.GetResult(sender); err == nil && orc.Response.Response.StatusCode != http.StatusNoContent { 11656 orc, err = client.DeployResponder(orc.Response.Response) 11657 if err != nil { 11658 err = autorest.NewErrorWithError(err, "apimanagement.TenantConfigurationDeployFuture", "Result", orc.Response.Response, "Failure responding to request") 11659 } 11660 } 11661 return 11662} 11663 11664// TenantConfigurationSaveFuture an abstraction for monitoring and retrieving the results of a long-running 11665// operation. 11666type TenantConfigurationSaveFuture struct { 11667 azure.FutureAPI 11668 // Result returns the result of the asynchronous operation. 11669 // If the operation has not completed it will return an error. 11670 Result func(TenantConfigurationClient) (OperationResultContract, error) 11671} 11672 11673// UnmarshalJSON is the custom unmarshaller for CreateFuture. 11674func (future *TenantConfigurationSaveFuture) UnmarshalJSON(body []byte) error { 11675 var azFuture azure.Future 11676 if err := json.Unmarshal(body, &azFuture); err != nil { 11677 return err 11678 } 11679 future.FutureAPI = &azFuture 11680 future.Result = future.result 11681 return nil 11682} 11683 11684// result is the default implementation for TenantConfigurationSaveFuture.Result. 11685func (future *TenantConfigurationSaveFuture) result(client TenantConfigurationClient) (orc OperationResultContract, err error) { 11686 var done bool 11687 done, err = future.DoneWithContext(context.Background(), client) 11688 if err != nil { 11689 err = autorest.NewErrorWithError(err, "apimanagement.TenantConfigurationSaveFuture", "Result", future.Response(), "Polling failure") 11690 return 11691 } 11692 if !done { 11693 orc.Response.Response = future.Response() 11694 err = azure.NewAsyncOpIncompleteError("apimanagement.TenantConfigurationSaveFuture") 11695 return 11696 } 11697 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 11698 if orc.Response.Response, err = future.GetResult(sender); err == nil && orc.Response.Response.StatusCode != http.StatusNoContent { 11699 orc, err = client.SaveResponder(orc.Response.Response) 11700 if err != nil { 11701 err = autorest.NewErrorWithError(err, "apimanagement.TenantConfigurationSaveFuture", "Result", orc.Response.Response, "Failure responding to request") 11702 } 11703 } 11704 return 11705} 11706 11707// TenantConfigurationSyncStateContract tenant Configuration Synchronization State. 11708type TenantConfigurationSyncStateContract struct { 11709 autorest.Response `json:"-"` 11710 // Branch - The name of Git branch. 11711 Branch *string `json:"branch,omitempty"` 11712 // CommitID - The latest commit Id. 11713 CommitID *string `json:"commitId,omitempty"` 11714 // IsExport - value indicating if last sync was save (true) or deploy (false) operation. 11715 IsExport *bool `json:"isExport,omitempty"` 11716 // IsSynced - value indicating if last synchronization was later than the configuration change. 11717 IsSynced *bool `json:"isSynced,omitempty"` 11718 // IsGitEnabled - value indicating whether Git configuration access is enabled. 11719 IsGitEnabled *bool `json:"isGitEnabled,omitempty"` 11720 // 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. 11721 SyncDate *date.Time `json:"syncDate,omitempty"` 11722 // 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. 11723 ConfigurationChangeDate *date.Time `json:"configurationChangeDate,omitempty"` 11724} 11725 11726// TenantConfigurationValidateFuture an abstraction for monitoring and retrieving the results of a 11727// long-running operation. 11728type TenantConfigurationValidateFuture struct { 11729 azure.FutureAPI 11730 // Result returns the result of the asynchronous operation. 11731 // If the operation has not completed it will return an error. 11732 Result func(TenantConfigurationClient) (OperationResultContract, error) 11733} 11734 11735// UnmarshalJSON is the custom unmarshaller for CreateFuture. 11736func (future *TenantConfigurationValidateFuture) UnmarshalJSON(body []byte) error { 11737 var azFuture azure.Future 11738 if err := json.Unmarshal(body, &azFuture); err != nil { 11739 return err 11740 } 11741 future.FutureAPI = &azFuture 11742 future.Result = future.result 11743 return nil 11744} 11745 11746// result is the default implementation for TenantConfigurationValidateFuture.Result. 11747func (future *TenantConfigurationValidateFuture) result(client TenantConfigurationClient) (orc OperationResultContract, err error) { 11748 var done bool 11749 done, err = future.DoneWithContext(context.Background(), client) 11750 if err != nil { 11751 err = autorest.NewErrorWithError(err, "apimanagement.TenantConfigurationValidateFuture", "Result", future.Response(), "Polling failure") 11752 return 11753 } 11754 if !done { 11755 orc.Response.Response = future.Response() 11756 err = azure.NewAsyncOpIncompleteError("apimanagement.TenantConfigurationValidateFuture") 11757 return 11758 } 11759 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 11760 if orc.Response.Response, err = future.GetResult(sender); err == nil && orc.Response.Response.StatusCode != http.StatusNoContent { 11761 orc, err = client.ValidateResponder(orc.Response.Response) 11762 if err != nil { 11763 err = autorest.NewErrorWithError(err, "apimanagement.TenantConfigurationValidateFuture", "Result", orc.Response.Response, "Failure responding to request") 11764 } 11765 } 11766 return 11767} 11768 11769// TermsOfServiceProperties terms of service contract properties. 11770type TermsOfServiceProperties struct { 11771 // Text - A terms of service text. 11772 Text *string `json:"text,omitempty"` 11773 // Enabled - Display terms of service during a sign-up process. 11774 Enabled *bool `json:"enabled,omitempty"` 11775 // ConsentRequired - Ask user for consent to the terms of service. 11776 ConsentRequired *bool `json:"consentRequired,omitempty"` 11777} 11778 11779// TokenBodyParameterContract oAuth acquire token request body parameter (www-url-form-encoded). 11780type TokenBodyParameterContract struct { 11781 // Name - body parameter name. 11782 Name *string `json:"name,omitempty"` 11783 // Value - body parameter value. 11784 Value *string `json:"value,omitempty"` 11785} 11786 11787// UserCollection paged Users list representation. 11788type UserCollection struct { 11789 autorest.Response `json:"-"` 11790 // Value - Page values. 11791 Value *[]UserContract `json:"value,omitempty"` 11792 // NextLink - Next page link if any. 11793 NextLink *string `json:"nextLink,omitempty"` 11794} 11795 11796// UserCollectionIterator provides access to a complete listing of UserContract values. 11797type UserCollectionIterator struct { 11798 i int 11799 page UserCollectionPage 11800} 11801 11802// NextWithContext advances to the next value. If there was an error making 11803// the request the iterator does not advance and the error is returned. 11804func (iter *UserCollectionIterator) NextWithContext(ctx context.Context) (err error) { 11805 if tracing.IsEnabled() { 11806 ctx = tracing.StartSpan(ctx, fqdn+"/UserCollectionIterator.NextWithContext") 11807 defer func() { 11808 sc := -1 11809 if iter.Response().Response.Response != nil { 11810 sc = iter.Response().Response.Response.StatusCode 11811 } 11812 tracing.EndSpan(ctx, sc, err) 11813 }() 11814 } 11815 iter.i++ 11816 if iter.i < len(iter.page.Values()) { 11817 return nil 11818 } 11819 err = iter.page.NextWithContext(ctx) 11820 if err != nil { 11821 iter.i-- 11822 return err 11823 } 11824 iter.i = 0 11825 return nil 11826} 11827 11828// Next advances to the next value. If there was an error making 11829// the request the iterator does not advance and the error is returned. 11830// Deprecated: Use NextWithContext() instead. 11831func (iter *UserCollectionIterator) Next() error { 11832 return iter.NextWithContext(context.Background()) 11833} 11834 11835// NotDone returns true if the enumeration should be started or is not yet complete. 11836func (iter UserCollectionIterator) NotDone() bool { 11837 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 11838} 11839 11840// Response returns the raw server response from the last page request. 11841func (iter UserCollectionIterator) Response() UserCollection { 11842 return iter.page.Response() 11843} 11844 11845// Value returns the current value or a zero-initialized value if the 11846// iterator has advanced beyond the end of the collection. 11847func (iter UserCollectionIterator) Value() UserContract { 11848 if !iter.page.NotDone() { 11849 return UserContract{} 11850 } 11851 return iter.page.Values()[iter.i] 11852} 11853 11854// Creates a new instance of the UserCollectionIterator type. 11855func NewUserCollectionIterator(page UserCollectionPage) UserCollectionIterator { 11856 return UserCollectionIterator{page: page} 11857} 11858 11859// IsEmpty returns true if the ListResult contains no values. 11860func (uc UserCollection) IsEmpty() bool { 11861 return uc.Value == nil || len(*uc.Value) == 0 11862} 11863 11864// hasNextLink returns true if the NextLink is not empty. 11865func (uc UserCollection) hasNextLink() bool { 11866 return uc.NextLink != nil && len(*uc.NextLink) != 0 11867} 11868 11869// userCollectionPreparer prepares a request to retrieve the next set of results. 11870// It returns nil if no more results exist. 11871func (uc UserCollection) userCollectionPreparer(ctx context.Context) (*http.Request, error) { 11872 if !uc.hasNextLink() { 11873 return nil, nil 11874 } 11875 return autorest.Prepare((&http.Request{}).WithContext(ctx), 11876 autorest.AsJSON(), 11877 autorest.AsGet(), 11878 autorest.WithBaseURL(to.String(uc.NextLink))) 11879} 11880 11881// UserCollectionPage contains a page of UserContract values. 11882type UserCollectionPage struct { 11883 fn func(context.Context, UserCollection) (UserCollection, error) 11884 uc UserCollection 11885} 11886 11887// NextWithContext advances to the next page of values. If there was an error making 11888// the request the page does not advance and the error is returned. 11889func (page *UserCollectionPage) NextWithContext(ctx context.Context) (err error) { 11890 if tracing.IsEnabled() { 11891 ctx = tracing.StartSpan(ctx, fqdn+"/UserCollectionPage.NextWithContext") 11892 defer func() { 11893 sc := -1 11894 if page.Response().Response.Response != nil { 11895 sc = page.Response().Response.Response.StatusCode 11896 } 11897 tracing.EndSpan(ctx, sc, err) 11898 }() 11899 } 11900 for { 11901 next, err := page.fn(ctx, page.uc) 11902 if err != nil { 11903 return err 11904 } 11905 page.uc = next 11906 if !next.hasNextLink() || !next.IsEmpty() { 11907 break 11908 } 11909 } 11910 return nil 11911} 11912 11913// Next advances to the next page of values. If there was an error making 11914// the request the page does not advance and the error is returned. 11915// Deprecated: Use NextWithContext() instead. 11916func (page *UserCollectionPage) Next() error { 11917 return page.NextWithContext(context.Background()) 11918} 11919 11920// NotDone returns true if the page enumeration should be started or is not yet complete. 11921func (page UserCollectionPage) NotDone() bool { 11922 return !page.uc.IsEmpty() 11923} 11924 11925// Response returns the raw server response from the last page request. 11926func (page UserCollectionPage) Response() UserCollection { 11927 return page.uc 11928} 11929 11930// Values returns the slice of values for the current page or nil if there are no values. 11931func (page UserCollectionPage) Values() []UserContract { 11932 if page.uc.IsEmpty() { 11933 return nil 11934 } 11935 return *page.uc.Value 11936} 11937 11938// Creates a new instance of the UserCollectionPage type. 11939func NewUserCollectionPage(cur UserCollection, getNextPage func(context.Context, UserCollection) (UserCollection, error)) UserCollectionPage { 11940 return UserCollectionPage{ 11941 fn: getNextPage, 11942 uc: cur, 11943 } 11944} 11945 11946// UserContract user details. 11947type UserContract struct { 11948 autorest.Response `json:"-"` 11949 // UserContractProperties - User entity contract properties. 11950 *UserContractProperties `json:"properties,omitempty"` 11951 // ID - READ-ONLY; Resource ID. 11952 ID *string `json:"id,omitempty"` 11953 // Name - READ-ONLY; Resource name. 11954 Name *string `json:"name,omitempty"` 11955 // Type - READ-ONLY; Resource type for API Management resource. 11956 Type *string `json:"type,omitempty"` 11957} 11958 11959// MarshalJSON is the custom marshaler for UserContract. 11960func (uc UserContract) MarshalJSON() ([]byte, error) { 11961 objectMap := make(map[string]interface{}) 11962 if uc.UserContractProperties != nil { 11963 objectMap["properties"] = uc.UserContractProperties 11964 } 11965 return json.Marshal(objectMap) 11966} 11967 11968// UnmarshalJSON is the custom unmarshaler for UserContract struct. 11969func (uc *UserContract) UnmarshalJSON(body []byte) error { 11970 var m map[string]*json.RawMessage 11971 err := json.Unmarshal(body, &m) 11972 if err != nil { 11973 return err 11974 } 11975 for k, v := range m { 11976 switch k { 11977 case "properties": 11978 if v != nil { 11979 var userContractProperties UserContractProperties 11980 err = json.Unmarshal(*v, &userContractProperties) 11981 if err != nil { 11982 return err 11983 } 11984 uc.UserContractProperties = &userContractProperties 11985 } 11986 case "id": 11987 if v != nil { 11988 var ID string 11989 err = json.Unmarshal(*v, &ID) 11990 if err != nil { 11991 return err 11992 } 11993 uc.ID = &ID 11994 } 11995 case "name": 11996 if v != nil { 11997 var name string 11998 err = json.Unmarshal(*v, &name) 11999 if err != nil { 12000 return err 12001 } 12002 uc.Name = &name 12003 } 12004 case "type": 12005 if v != nil { 12006 var typeVar string 12007 err = json.Unmarshal(*v, &typeVar) 12008 if err != nil { 12009 return err 12010 } 12011 uc.Type = &typeVar 12012 } 12013 } 12014 } 12015 12016 return nil 12017} 12018 12019// UserContractProperties user profile. 12020type UserContractProperties struct { 12021 // FirstName - First name. 12022 FirstName *string `json:"firstName,omitempty"` 12023 // LastName - Last name. 12024 LastName *string `json:"lastName,omitempty"` 12025 // Email - Email address. 12026 Email *string `json:"email,omitempty"` 12027 // RegistrationDate - Date of user registration. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. 12028 RegistrationDate *date.Time `json:"registrationDate,omitempty"` 12029 // Groups - READ-ONLY; Collection of groups user is part of. 12030 Groups *[]GroupContractProperties `json:"groups,omitempty"` 12031 // 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' 12032 State UserState `json:"state,omitempty"` 12033 // Note - Optional note about a user set by the administrator. 12034 Note *string `json:"note,omitempty"` 12035 // Identities - Collection of user identities. 12036 Identities *[]UserIdentityContract `json:"identities,omitempty"` 12037} 12038 12039// MarshalJSON is the custom marshaler for UserContractProperties. 12040func (ucp UserContractProperties) MarshalJSON() ([]byte, error) { 12041 objectMap := make(map[string]interface{}) 12042 if ucp.FirstName != nil { 12043 objectMap["firstName"] = ucp.FirstName 12044 } 12045 if ucp.LastName != nil { 12046 objectMap["lastName"] = ucp.LastName 12047 } 12048 if ucp.Email != nil { 12049 objectMap["email"] = ucp.Email 12050 } 12051 if ucp.RegistrationDate != nil { 12052 objectMap["registrationDate"] = ucp.RegistrationDate 12053 } 12054 if ucp.State != "" { 12055 objectMap["state"] = ucp.State 12056 } 12057 if ucp.Note != nil { 12058 objectMap["note"] = ucp.Note 12059 } 12060 if ucp.Identities != nil { 12061 objectMap["identities"] = ucp.Identities 12062 } 12063 return json.Marshal(objectMap) 12064} 12065 12066// UserCreateParameterProperties parameters supplied to the Create User operation. 12067type UserCreateParameterProperties struct { 12068 // Email - Email address. Must not be empty and must be unique within the service instance. 12069 Email *string `json:"email,omitempty"` 12070 // FirstName - First name. 12071 FirstName *string `json:"firstName,omitempty"` 12072 // LastName - Last name. 12073 LastName *string `json:"lastName,omitempty"` 12074 // Password - User Password. If no value is provided, a default password is generated. 12075 Password *string `json:"password,omitempty"` 12076 // Confirmation - Determines the type of confirmation e-mail that will be sent to the newly created user. Possible values include: 'Signup', 'Invite' 12077 Confirmation Confirmation `json:"confirmation,omitempty"` 12078 // 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' 12079 State UserState `json:"state,omitempty"` 12080 // Note - Optional note about a user set by the administrator. 12081 Note *string `json:"note,omitempty"` 12082 // Identities - Collection of user identities. 12083 Identities *[]UserIdentityContract `json:"identities,omitempty"` 12084} 12085 12086// UserCreateParameters user create details. 12087type UserCreateParameters struct { 12088 // UserCreateParameterProperties - User entity create contract properties. 12089 *UserCreateParameterProperties `json:"properties,omitempty"` 12090} 12091 12092// MarshalJSON is the custom marshaler for UserCreateParameters. 12093func (ucp UserCreateParameters) MarshalJSON() ([]byte, error) { 12094 objectMap := make(map[string]interface{}) 12095 if ucp.UserCreateParameterProperties != nil { 12096 objectMap["properties"] = ucp.UserCreateParameterProperties 12097 } 12098 return json.Marshal(objectMap) 12099} 12100 12101// UnmarshalJSON is the custom unmarshaler for UserCreateParameters struct. 12102func (ucp *UserCreateParameters) UnmarshalJSON(body []byte) error { 12103 var m map[string]*json.RawMessage 12104 err := json.Unmarshal(body, &m) 12105 if err != nil { 12106 return err 12107 } 12108 for k, v := range m { 12109 switch k { 12110 case "properties": 12111 if v != nil { 12112 var userCreateParameterProperties UserCreateParameterProperties 12113 err = json.Unmarshal(*v, &userCreateParameterProperties) 12114 if err != nil { 12115 return err 12116 } 12117 ucp.UserCreateParameterProperties = &userCreateParameterProperties 12118 } 12119 } 12120 } 12121 12122 return nil 12123} 12124 12125// UserEntityBaseParameters user Entity Base Parameters set. 12126type UserEntityBaseParameters struct { 12127 // 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' 12128 State UserState `json:"state,omitempty"` 12129 // Note - Optional note about a user set by the administrator. 12130 Note *string `json:"note,omitempty"` 12131 // Identities - Collection of user identities. 12132 Identities *[]UserIdentityContract `json:"identities,omitempty"` 12133} 12134 12135// UserIdentityCollection list of Users Identity list representation. 12136type UserIdentityCollection struct { 12137 autorest.Response `json:"-"` 12138 // Value - User Identity values. 12139 Value *[]UserIdentityContract `json:"value,omitempty"` 12140 // Count - Total record count number across all pages. 12141 Count *int64 `json:"count,omitempty"` 12142 // NextLink - Next page link if any. 12143 NextLink *string `json:"nextLink,omitempty"` 12144} 12145 12146// UserIdentityCollectionIterator provides access to a complete listing of UserIdentityContract values. 12147type UserIdentityCollectionIterator struct { 12148 i int 12149 page UserIdentityCollectionPage 12150} 12151 12152// NextWithContext advances to the next value. If there was an error making 12153// the request the iterator does not advance and the error is returned. 12154func (iter *UserIdentityCollectionIterator) NextWithContext(ctx context.Context) (err error) { 12155 if tracing.IsEnabled() { 12156 ctx = tracing.StartSpan(ctx, fqdn+"/UserIdentityCollectionIterator.NextWithContext") 12157 defer func() { 12158 sc := -1 12159 if iter.Response().Response.Response != nil { 12160 sc = iter.Response().Response.Response.StatusCode 12161 } 12162 tracing.EndSpan(ctx, sc, err) 12163 }() 12164 } 12165 iter.i++ 12166 if iter.i < len(iter.page.Values()) { 12167 return nil 12168 } 12169 err = iter.page.NextWithContext(ctx) 12170 if err != nil { 12171 iter.i-- 12172 return err 12173 } 12174 iter.i = 0 12175 return nil 12176} 12177 12178// Next advances to the next value. If there was an error making 12179// the request the iterator does not advance and the error is returned. 12180// Deprecated: Use NextWithContext() instead. 12181func (iter *UserIdentityCollectionIterator) Next() error { 12182 return iter.NextWithContext(context.Background()) 12183} 12184 12185// NotDone returns true if the enumeration should be started or is not yet complete. 12186func (iter UserIdentityCollectionIterator) NotDone() bool { 12187 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 12188} 12189 12190// Response returns the raw server response from the last page request. 12191func (iter UserIdentityCollectionIterator) Response() UserIdentityCollection { 12192 return iter.page.Response() 12193} 12194 12195// Value returns the current value or a zero-initialized value if the 12196// iterator has advanced beyond the end of the collection. 12197func (iter UserIdentityCollectionIterator) Value() UserIdentityContract { 12198 if !iter.page.NotDone() { 12199 return UserIdentityContract{} 12200 } 12201 return iter.page.Values()[iter.i] 12202} 12203 12204// Creates a new instance of the UserIdentityCollectionIterator type. 12205func NewUserIdentityCollectionIterator(page UserIdentityCollectionPage) UserIdentityCollectionIterator { 12206 return UserIdentityCollectionIterator{page: page} 12207} 12208 12209// IsEmpty returns true if the ListResult contains no values. 12210func (uic UserIdentityCollection) IsEmpty() bool { 12211 return uic.Value == nil || len(*uic.Value) == 0 12212} 12213 12214// hasNextLink returns true if the NextLink is not empty. 12215func (uic UserIdentityCollection) hasNextLink() bool { 12216 return uic.NextLink != nil && len(*uic.NextLink) != 0 12217} 12218 12219// userIdentityCollectionPreparer prepares a request to retrieve the next set of results. 12220// It returns nil if no more results exist. 12221func (uic UserIdentityCollection) userIdentityCollectionPreparer(ctx context.Context) (*http.Request, error) { 12222 if !uic.hasNextLink() { 12223 return nil, nil 12224 } 12225 return autorest.Prepare((&http.Request{}).WithContext(ctx), 12226 autorest.AsJSON(), 12227 autorest.AsGet(), 12228 autorest.WithBaseURL(to.String(uic.NextLink))) 12229} 12230 12231// UserIdentityCollectionPage contains a page of UserIdentityContract values. 12232type UserIdentityCollectionPage struct { 12233 fn func(context.Context, UserIdentityCollection) (UserIdentityCollection, error) 12234 uic UserIdentityCollection 12235} 12236 12237// NextWithContext advances to the next page of values. If there was an error making 12238// the request the page does not advance and the error is returned. 12239func (page *UserIdentityCollectionPage) NextWithContext(ctx context.Context) (err error) { 12240 if tracing.IsEnabled() { 12241 ctx = tracing.StartSpan(ctx, fqdn+"/UserIdentityCollectionPage.NextWithContext") 12242 defer func() { 12243 sc := -1 12244 if page.Response().Response.Response != nil { 12245 sc = page.Response().Response.Response.StatusCode 12246 } 12247 tracing.EndSpan(ctx, sc, err) 12248 }() 12249 } 12250 for { 12251 next, err := page.fn(ctx, page.uic) 12252 if err != nil { 12253 return err 12254 } 12255 page.uic = next 12256 if !next.hasNextLink() || !next.IsEmpty() { 12257 break 12258 } 12259 } 12260 return nil 12261} 12262 12263// Next advances to the next page of values. If there was an error making 12264// the request the page does not advance and the error is returned. 12265// Deprecated: Use NextWithContext() instead. 12266func (page *UserIdentityCollectionPage) Next() error { 12267 return page.NextWithContext(context.Background()) 12268} 12269 12270// NotDone returns true if the page enumeration should be started or is not yet complete. 12271func (page UserIdentityCollectionPage) NotDone() bool { 12272 return !page.uic.IsEmpty() 12273} 12274 12275// Response returns the raw server response from the last page request. 12276func (page UserIdentityCollectionPage) Response() UserIdentityCollection { 12277 return page.uic 12278} 12279 12280// Values returns the slice of values for the current page or nil if there are no values. 12281func (page UserIdentityCollectionPage) Values() []UserIdentityContract { 12282 if page.uic.IsEmpty() { 12283 return nil 12284 } 12285 return *page.uic.Value 12286} 12287 12288// Creates a new instance of the UserIdentityCollectionPage type. 12289func NewUserIdentityCollectionPage(cur UserIdentityCollection, getNextPage func(context.Context, UserIdentityCollection) (UserIdentityCollection, error)) UserIdentityCollectionPage { 12290 return UserIdentityCollectionPage{ 12291 fn: getNextPage, 12292 uic: cur, 12293 } 12294} 12295 12296// UserIdentityContract user identity details. 12297type UserIdentityContract struct { 12298 // Provider - Identity provider name. 12299 Provider *string `json:"provider,omitempty"` 12300 // ID - Identifier value within provider. 12301 ID *string `json:"id,omitempty"` 12302} 12303 12304// UserTokenParameters parameters supplied to the Get User Token operation. 12305type UserTokenParameters struct { 12306 // KeyType - The Key to be used to generate token for user. Possible values include: 'Primary', 'Secondary' 12307 KeyType KeyType `json:"keyType,omitempty"` 12308 // 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. 12309 Expiry *date.Time `json:"expiry,omitempty"` 12310} 12311 12312// UserTokenResult get User Token response details. 12313type UserTokenResult struct { 12314 autorest.Response `json:"-"` 12315 // Value - Shared Access Authorization token for the User. 12316 Value *string `json:"value,omitempty"` 12317} 12318 12319// UserUpdateParameters user update parameters. 12320type UserUpdateParameters struct { 12321 // UserUpdateParametersProperties - User entity update contract properties. 12322 *UserUpdateParametersProperties `json:"properties,omitempty"` 12323} 12324 12325// MarshalJSON is the custom marshaler for UserUpdateParameters. 12326func (uup UserUpdateParameters) MarshalJSON() ([]byte, error) { 12327 objectMap := make(map[string]interface{}) 12328 if uup.UserUpdateParametersProperties != nil { 12329 objectMap["properties"] = uup.UserUpdateParametersProperties 12330 } 12331 return json.Marshal(objectMap) 12332} 12333 12334// UnmarshalJSON is the custom unmarshaler for UserUpdateParameters struct. 12335func (uup *UserUpdateParameters) UnmarshalJSON(body []byte) error { 12336 var m map[string]*json.RawMessage 12337 err := json.Unmarshal(body, &m) 12338 if err != nil { 12339 return err 12340 } 12341 for k, v := range m { 12342 switch k { 12343 case "properties": 12344 if v != nil { 12345 var userUpdateParametersProperties UserUpdateParametersProperties 12346 err = json.Unmarshal(*v, &userUpdateParametersProperties) 12347 if err != nil { 12348 return err 12349 } 12350 uup.UserUpdateParametersProperties = &userUpdateParametersProperties 12351 } 12352 } 12353 } 12354 12355 return nil 12356} 12357 12358// UserUpdateParametersProperties parameters supplied to the Update User operation. 12359type UserUpdateParametersProperties struct { 12360 // Email - Email address. Must not be empty and must be unique within the service instance. 12361 Email *string `json:"email,omitempty"` 12362 // Password - User Password. 12363 Password *string `json:"password,omitempty"` 12364 // FirstName - First name. 12365 FirstName *string `json:"firstName,omitempty"` 12366 // LastName - Last name. 12367 LastName *string `json:"lastName,omitempty"` 12368 // 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' 12369 State UserState `json:"state,omitempty"` 12370 // Note - Optional note about a user set by the administrator. 12371 Note *string `json:"note,omitempty"` 12372 // Identities - Collection of user identities. 12373 Identities *[]UserIdentityContract `json:"identities,omitempty"` 12374} 12375 12376// VirtualNetworkConfiguration configuration of a virtual network to which API Management service is 12377// deployed. 12378type VirtualNetworkConfiguration struct { 12379 // Vnetid - READ-ONLY; The virtual network ID. This is typically a GUID. Expect a null GUID by default. 12380 Vnetid *string `json:"vnetid,omitempty"` 12381 // Subnetname - READ-ONLY; The name of the subnet. 12382 Subnetname *string `json:"subnetname,omitempty"` 12383 // SubnetResourceID - The full resource ID of a subnet in a virtual network to deploy the API Management service in. 12384 SubnetResourceID *string `json:"subnetResourceId,omitempty"` 12385} 12386 12387// MarshalJSON is the custom marshaler for VirtualNetworkConfiguration. 12388func (vnc VirtualNetworkConfiguration) MarshalJSON() ([]byte, error) { 12389 objectMap := make(map[string]interface{}) 12390 if vnc.SubnetResourceID != nil { 12391 objectMap["subnetResourceId"] = vnc.SubnetResourceID 12392 } 12393 return json.Marshal(objectMap) 12394} 12395 12396// X509CertificateName properties of server X509Names. 12397type X509CertificateName struct { 12398 // Name - Common Name of the Certificate. 12399 Name *string `json:"name,omitempty"` 12400 // IssuerCertificateThumbprint - Thumbprint for the Issuer of the Certificate. 12401 IssuerCertificateThumbprint *string `json:"issuerCertificateThumbprint,omitempty"` 12402} 12403