1package apimanagement 2 3// Copyright (c) Microsoft Corporation. All rights reserved. 4// Licensed under the MIT License. See License.txt in the project root for license information. 5// 6// Code generated by Microsoft (R) AutoRest Code Generator. 7// Changes may cause incorrect behavior and will be lost if the code is regenerated. 8 9import ( 10 "context" 11 "encoding/json" 12 "github.com/Azure/go-autorest/autorest" 13 "github.com/Azure/go-autorest/autorest/azure" 14 "github.com/Azure/go-autorest/autorest/date" 15 "github.com/Azure/go-autorest/autorest/to" 16 "github.com/Azure/go-autorest/tracing" 17 "github.com/gofrs/uuid" 18 "net/http" 19) 20 21// The package's fully qualified name. 22const fqdn = "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement" 23 24// AccessInformationContract tenant access information contract of the API Management service. 25type AccessInformationContract struct { 26 autorest.Response `json:"-"` 27 // ID - Identifier. 28 ID *string `json:"id,omitempty"` 29 // PrimaryKey - Primary access key. This property will not be filled on 'GET' operations! Use '/listSecrets' POST request to get the value. 30 PrimaryKey *string `json:"primaryKey,omitempty"` 31 // SecondaryKey - Secondary access key. This property will not be filled on 'GET' operations! Use '/listSecrets' POST request to get the value. 32 SecondaryKey *string `json:"secondaryKey,omitempty"` 33 // Enabled - Determines whether direct access is enabled. 34 Enabled *bool `json:"enabled,omitempty"` 35} 36 37// AccessInformationUpdateParameterProperties tenant access information update parameters of the API 38// Management service 39type AccessInformationUpdateParameterProperties struct { 40 // Enabled - Determines whether direct access is enabled. 41 Enabled *bool `json:"enabled,omitempty"` 42} 43 44// AccessInformationUpdateParameters tenant access information update parameters. 45type AccessInformationUpdateParameters struct { 46 // AccessInformationUpdateParameterProperties - Tenant access information update parameter properties. 47 *AccessInformationUpdateParameterProperties `json:"properties,omitempty"` 48} 49 50// MarshalJSON is the custom marshaler for AccessInformationUpdateParameters. 51func (aiup AccessInformationUpdateParameters) MarshalJSON() ([]byte, error) { 52 objectMap := make(map[string]interface{}) 53 if aiup.AccessInformationUpdateParameterProperties != nil { 54 objectMap["properties"] = aiup.AccessInformationUpdateParameterProperties 55 } 56 return json.Marshal(objectMap) 57} 58 59// UnmarshalJSON is the custom unmarshaler for AccessInformationUpdateParameters struct. 60func (aiup *AccessInformationUpdateParameters) UnmarshalJSON(body []byte) error { 61 var m map[string]*json.RawMessage 62 err := json.Unmarshal(body, &m) 63 if err != nil { 64 return err 65 } 66 for k, v := range m { 67 switch k { 68 case "properties": 69 if v != nil { 70 var accessInformationUpdateParameterProperties AccessInformationUpdateParameterProperties 71 err = json.Unmarshal(*v, &accessInformationUpdateParameterProperties) 72 if err != nil { 73 return err 74 } 75 aiup.AccessInformationUpdateParameterProperties = &accessInformationUpdateParameterProperties 76 } 77 } 78 } 79 80 return nil 81} 82 83// AdditionalLocation description of an additional API Management resource location. 84type AdditionalLocation struct { 85 // Location - The location name of the additional region among Azure Data center regions. 86 Location *string `json:"location,omitempty"` 87 // Sku - SKU properties of the API Management service. 88 Sku *ServiceSkuProperties `json:"sku,omitempty"` 89 // PublicIPAddresses - READ-ONLY; Public Static Load Balanced IP addresses of the API Management service in the additional location. Available only for Basic, Standard and Premium SKU. 90 PublicIPAddresses *[]string `json:"publicIPAddresses,omitempty"` 91 // PrivateIPAddresses - READ-ONLY; Private Static Load Balanced IP addresses of the API Management service which is deployed in an Internal Virtual Network in a particular additional location. Available only for Basic, Standard and Premium SKU. 92 PrivateIPAddresses *[]string `json:"privateIPAddresses,omitempty"` 93 // VirtualNetworkConfiguration - Virtual network configuration for the location. 94 VirtualNetworkConfiguration *VirtualNetworkConfiguration `json:"virtualNetworkConfiguration,omitempty"` 95 // GatewayRegionalURL - READ-ONLY; Gateway URL of the API Management service in the Region. 96 GatewayRegionalURL *string `json:"gatewayRegionalUrl,omitempty"` 97 // DisableGateway - Property only valid for an Api Management service deployed in multiple locations. This can be used to disable the gateway in this additional location. 98 DisableGateway *bool `json:"disableGateway,omitempty"` 99} 100 101// MarshalJSON is the custom marshaler for AdditionalLocation. 102func (al AdditionalLocation) MarshalJSON() ([]byte, error) { 103 objectMap := make(map[string]interface{}) 104 if al.Location != nil { 105 objectMap["location"] = al.Location 106 } 107 if al.Sku != nil { 108 objectMap["sku"] = al.Sku 109 } 110 if al.VirtualNetworkConfiguration != nil { 111 objectMap["virtualNetworkConfiguration"] = al.VirtualNetworkConfiguration 112 } 113 if al.DisableGateway != nil { 114 objectMap["disableGateway"] = al.DisableGateway 115 } 116 return json.Marshal(objectMap) 117} 118 119// APICollection paged Api list representation. 120type APICollection struct { 121 autorest.Response `json:"-"` 122 // Value - READ-ONLY; Page values. 123 Value *[]APIContract `json:"value,omitempty"` 124 // NextLink - READ-ONLY; Next page link if any. 125 NextLink *string `json:"nextLink,omitempty"` 126} 127 128// MarshalJSON is the custom marshaler for APICollection. 129func (ac APICollection) MarshalJSON() ([]byte, error) { 130 objectMap := make(map[string]interface{}) 131 return json.Marshal(objectMap) 132} 133 134// APICollectionIterator provides access to a complete listing of APIContract values. 135type APICollectionIterator struct { 136 i int 137 page APICollectionPage 138} 139 140// NextWithContext advances to the next value. If there was an error making 141// the request the iterator does not advance and the error is returned. 142func (iter *APICollectionIterator) NextWithContext(ctx context.Context) (err error) { 143 if tracing.IsEnabled() { 144 ctx = tracing.StartSpan(ctx, fqdn+"/APICollectionIterator.NextWithContext") 145 defer func() { 146 sc := -1 147 if iter.Response().Response.Response != nil { 148 sc = iter.Response().Response.Response.StatusCode 149 } 150 tracing.EndSpan(ctx, sc, err) 151 }() 152 } 153 iter.i++ 154 if iter.i < len(iter.page.Values()) { 155 return nil 156 } 157 err = iter.page.NextWithContext(ctx) 158 if err != nil { 159 iter.i-- 160 return err 161 } 162 iter.i = 0 163 return nil 164} 165 166// Next advances to the next value. If there was an error making 167// the request the iterator does not advance and the error is returned. 168// Deprecated: Use NextWithContext() instead. 169func (iter *APICollectionIterator) Next() error { 170 return iter.NextWithContext(context.Background()) 171} 172 173// NotDone returns true if the enumeration should be started or is not yet complete. 174func (iter APICollectionIterator) NotDone() bool { 175 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 176} 177 178// Response returns the raw server response from the last page request. 179func (iter APICollectionIterator) Response() APICollection { 180 return iter.page.Response() 181} 182 183// Value returns the current value or a zero-initialized value if the 184// iterator has advanced beyond the end of the collection. 185func (iter APICollectionIterator) Value() APIContract { 186 if !iter.page.NotDone() { 187 return APIContract{} 188 } 189 return iter.page.Values()[iter.i] 190} 191 192// Creates a new instance of the APICollectionIterator type. 193func NewAPICollectionIterator(page APICollectionPage) APICollectionIterator { 194 return APICollectionIterator{page: page} 195} 196 197// IsEmpty returns true if the ListResult contains no values. 198func (ac APICollection) IsEmpty() bool { 199 return ac.Value == nil || len(*ac.Value) == 0 200} 201 202// hasNextLink returns true if the NextLink is not empty. 203func (ac APICollection) hasNextLink() bool { 204 return ac.NextLink != nil && len(*ac.NextLink) != 0 205} 206 207// aPICollectionPreparer prepares a request to retrieve the next set of results. 208// It returns nil if no more results exist. 209func (ac APICollection) aPICollectionPreparer(ctx context.Context) (*http.Request, error) { 210 if !ac.hasNextLink() { 211 return nil, nil 212 } 213 return autorest.Prepare((&http.Request{}).WithContext(ctx), 214 autorest.AsJSON(), 215 autorest.AsGet(), 216 autorest.WithBaseURL(to.String(ac.NextLink))) 217} 218 219// APICollectionPage contains a page of APIContract values. 220type APICollectionPage struct { 221 fn func(context.Context, APICollection) (APICollection, error) 222 ac APICollection 223} 224 225// NextWithContext advances to the next page of values. If there was an error making 226// the request the page does not advance and the error is returned. 227func (page *APICollectionPage) NextWithContext(ctx context.Context) (err error) { 228 if tracing.IsEnabled() { 229 ctx = tracing.StartSpan(ctx, fqdn+"/APICollectionPage.NextWithContext") 230 defer func() { 231 sc := -1 232 if page.Response().Response.Response != nil { 233 sc = page.Response().Response.Response.StatusCode 234 } 235 tracing.EndSpan(ctx, sc, err) 236 }() 237 } 238 for { 239 next, err := page.fn(ctx, page.ac) 240 if err != nil { 241 return err 242 } 243 page.ac = next 244 if !next.hasNextLink() || !next.IsEmpty() { 245 break 246 } 247 } 248 return nil 249} 250 251// Next advances to the next page of values. If there was an error making 252// the request the page does not advance and the error is returned. 253// Deprecated: Use NextWithContext() instead. 254func (page *APICollectionPage) Next() error { 255 return page.NextWithContext(context.Background()) 256} 257 258// NotDone returns true if the page enumeration should be started or is not yet complete. 259func (page APICollectionPage) NotDone() bool { 260 return !page.ac.IsEmpty() 261} 262 263// Response returns the raw server response from the last page request. 264func (page APICollectionPage) Response() APICollection { 265 return page.ac 266} 267 268// Values returns the slice of values for the current page or nil if there are no values. 269func (page APICollectionPage) Values() []APIContract { 270 if page.ac.IsEmpty() { 271 return nil 272 } 273 return *page.ac.Value 274} 275 276// Creates a new instance of the APICollectionPage type. 277func NewAPICollectionPage(cur APICollection, getNextPage func(context.Context, APICollection) (APICollection, error)) APICollectionPage { 278 return APICollectionPage{ 279 fn: getNextPage, 280 ac: cur, 281 } 282} 283 284// APIContract api details. 285type APIContract struct { 286 autorest.Response `json:"-"` 287 // APIContractProperties - Api entity contract properties. 288 *APIContractProperties `json:"properties,omitempty"` 289 // ID - READ-ONLY; Resource ID. 290 ID *string `json:"id,omitempty"` 291 // Name - READ-ONLY; Resource name. 292 Name *string `json:"name,omitempty"` 293 // Type - READ-ONLY; Resource type for API Management resource. 294 Type *string `json:"type,omitempty"` 295} 296 297// MarshalJSON is the custom marshaler for APIContract. 298func (ac APIContract) MarshalJSON() ([]byte, error) { 299 objectMap := make(map[string]interface{}) 300 if ac.APIContractProperties != nil { 301 objectMap["properties"] = ac.APIContractProperties 302 } 303 return json.Marshal(objectMap) 304} 305 306// UnmarshalJSON is the custom unmarshaler for APIContract struct. 307func (ac *APIContract) UnmarshalJSON(body []byte) error { 308 var m map[string]*json.RawMessage 309 err := json.Unmarshal(body, &m) 310 if err != nil { 311 return err 312 } 313 for k, v := range m { 314 switch k { 315 case "properties": 316 if v != nil { 317 var APIContractProperties APIContractProperties 318 err = json.Unmarshal(*v, &APIContractProperties) 319 if err != nil { 320 return err 321 } 322 ac.APIContractProperties = &APIContractProperties 323 } 324 case "id": 325 if v != nil { 326 var ID string 327 err = json.Unmarshal(*v, &ID) 328 if err != nil { 329 return err 330 } 331 ac.ID = &ID 332 } 333 case "name": 334 if v != nil { 335 var name string 336 err = json.Unmarshal(*v, &name) 337 if err != nil { 338 return err 339 } 340 ac.Name = &name 341 } 342 case "type": 343 if v != nil { 344 var typeVar string 345 err = json.Unmarshal(*v, &typeVar) 346 if err != nil { 347 return err 348 } 349 ac.Type = &typeVar 350 } 351 } 352 } 353 354 return nil 355} 356 357// APIContractProperties api Entity Properties 358type APIContractProperties struct { 359 // SourceAPIID - API identifier of the source API. 360 SourceAPIID *string `json:"sourceApiId,omitempty"` 361 // DisplayName - API name. Must be 1 to 300 characters long. 362 DisplayName *string `json:"displayName,omitempty"` 363 // ServiceURL - Absolute URL of the backend service implementing this API. Cannot be more than 2000 characters long. 364 ServiceURL *string `json:"serviceUrl,omitempty"` 365 // 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. 366 Path *string `json:"path,omitempty"` 367 // Protocols - Describes on which protocols the operations in this API can be invoked. 368 Protocols *[]Protocol `json:"protocols,omitempty"` 369 // APIVersionSet - Version set details 370 APIVersionSet *APIVersionSetContractDetails `json:"apiVersionSet,omitempty"` 371 // Description - Description of the API. May include HTML formatting tags. 372 Description *string `json:"description,omitempty"` 373 // AuthenticationSettings - Collection of authentication settings included into this API. 374 AuthenticationSettings *AuthenticationSettingsContract `json:"authenticationSettings,omitempty"` 375 // SubscriptionKeyParameterNames - Protocols over which API is made available. 376 SubscriptionKeyParameterNames *SubscriptionKeyParameterNamesContract `json:"subscriptionKeyParameterNames,omitempty"` 377 // APIType - Type of API. Possible values include: 'HTTP', 'Soap' 378 APIType APIType `json:"type,omitempty"` 379 // APIRevision - Describes the Revision of the Api. If no value is provided, default revision 1 is created 380 APIRevision *string `json:"apiRevision,omitempty"` 381 // APIVersion - Indicates the Version identifier of the API if the API is versioned 382 APIVersion *string `json:"apiVersion,omitempty"` 383 // IsCurrent - Indicates if API revision is current api revision. 384 IsCurrent *bool `json:"isCurrent,omitempty"` 385 // IsOnline - READ-ONLY; Indicates if API revision is accessible via the gateway. 386 IsOnline *bool `json:"isOnline,omitempty"` 387 // APIRevisionDescription - Description of the Api Revision. 388 APIRevisionDescription *string `json:"apiRevisionDescription,omitempty"` 389 // APIVersionDescription - Description of the Api Version. 390 APIVersionDescription *string `json:"apiVersionDescription,omitempty"` 391 // APIVersionSetID - A resource identifier for the related ApiVersionSet. 392 APIVersionSetID *string `json:"apiVersionSetId,omitempty"` 393 // SubscriptionRequired - Specifies whether an API or Product subscription is required for accessing the API. 394 SubscriptionRequired *bool `json:"subscriptionRequired,omitempty"` 395} 396 397// MarshalJSON is the custom marshaler for APIContractProperties. 398func (acp APIContractProperties) MarshalJSON() ([]byte, error) { 399 objectMap := make(map[string]interface{}) 400 if acp.SourceAPIID != nil { 401 objectMap["sourceApiId"] = acp.SourceAPIID 402 } 403 if acp.DisplayName != nil { 404 objectMap["displayName"] = acp.DisplayName 405 } 406 if acp.ServiceURL != nil { 407 objectMap["serviceUrl"] = acp.ServiceURL 408 } 409 if acp.Path != nil { 410 objectMap["path"] = acp.Path 411 } 412 if acp.Protocols != nil { 413 objectMap["protocols"] = acp.Protocols 414 } 415 if acp.APIVersionSet != nil { 416 objectMap["apiVersionSet"] = acp.APIVersionSet 417 } 418 if acp.Description != nil { 419 objectMap["description"] = acp.Description 420 } 421 if acp.AuthenticationSettings != nil { 422 objectMap["authenticationSettings"] = acp.AuthenticationSettings 423 } 424 if acp.SubscriptionKeyParameterNames != nil { 425 objectMap["subscriptionKeyParameterNames"] = acp.SubscriptionKeyParameterNames 426 } 427 if acp.APIType != "" { 428 objectMap["type"] = acp.APIType 429 } 430 if acp.APIRevision != nil { 431 objectMap["apiRevision"] = acp.APIRevision 432 } 433 if acp.APIVersion != nil { 434 objectMap["apiVersion"] = acp.APIVersion 435 } 436 if acp.IsCurrent != nil { 437 objectMap["isCurrent"] = acp.IsCurrent 438 } 439 if acp.APIRevisionDescription != nil { 440 objectMap["apiRevisionDescription"] = acp.APIRevisionDescription 441 } 442 if acp.APIVersionDescription != nil { 443 objectMap["apiVersionDescription"] = acp.APIVersionDescription 444 } 445 if acp.APIVersionSetID != nil { 446 objectMap["apiVersionSetId"] = acp.APIVersionSetID 447 } 448 if acp.SubscriptionRequired != nil { 449 objectMap["subscriptionRequired"] = acp.SubscriptionRequired 450 } 451 return json.Marshal(objectMap) 452} 453 454// APIContractUpdateProperties API update contract properties. 455type APIContractUpdateProperties struct { 456 // DisplayName - API name. 457 DisplayName *string `json:"displayName,omitempty"` 458 // ServiceURL - Absolute URL of the backend service implementing this API. 459 ServiceURL *string `json:"serviceUrl,omitempty"` 460 // 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. 461 Path *string `json:"path,omitempty"` 462 // Protocols - Describes on which protocols the operations in this API can be invoked. 463 Protocols *[]Protocol `json:"protocols,omitempty"` 464 // Description - Description of the API. May include HTML formatting tags. 465 Description *string `json:"description,omitempty"` 466 // AuthenticationSettings - Collection of authentication settings included into this API. 467 AuthenticationSettings *AuthenticationSettingsContract `json:"authenticationSettings,omitempty"` 468 // SubscriptionKeyParameterNames - Protocols over which API is made available. 469 SubscriptionKeyParameterNames *SubscriptionKeyParameterNamesContract `json:"subscriptionKeyParameterNames,omitempty"` 470 // APIType - Type of API. Possible values include: 'HTTP', 'Soap' 471 APIType APIType `json:"type,omitempty"` 472 // APIRevision - Describes the Revision of the Api. If no value is provided, default revision 1 is created 473 APIRevision *string `json:"apiRevision,omitempty"` 474 // APIVersion - Indicates the Version identifier of the API if the API is versioned 475 APIVersion *string `json:"apiVersion,omitempty"` 476 // IsCurrent - Indicates if API revision is current api revision. 477 IsCurrent *bool `json:"isCurrent,omitempty"` 478 // IsOnline - READ-ONLY; Indicates if API revision is accessible via the gateway. 479 IsOnline *bool `json:"isOnline,omitempty"` 480 // APIRevisionDescription - Description of the Api Revision. 481 APIRevisionDescription *string `json:"apiRevisionDescription,omitempty"` 482 // APIVersionDescription - Description of the Api Version. 483 APIVersionDescription *string `json:"apiVersionDescription,omitempty"` 484 // APIVersionSetID - A resource identifier for the related ApiVersionSet. 485 APIVersionSetID *string `json:"apiVersionSetId,omitempty"` 486 // SubscriptionRequired - Specifies whether an API or Product subscription is required for accessing the API. 487 SubscriptionRequired *bool `json:"subscriptionRequired,omitempty"` 488} 489 490// MarshalJSON is the custom marshaler for APIContractUpdateProperties. 491func (acup APIContractUpdateProperties) MarshalJSON() ([]byte, error) { 492 objectMap := make(map[string]interface{}) 493 if acup.DisplayName != nil { 494 objectMap["displayName"] = acup.DisplayName 495 } 496 if acup.ServiceURL != nil { 497 objectMap["serviceUrl"] = acup.ServiceURL 498 } 499 if acup.Path != nil { 500 objectMap["path"] = acup.Path 501 } 502 if acup.Protocols != nil { 503 objectMap["protocols"] = acup.Protocols 504 } 505 if acup.Description != nil { 506 objectMap["description"] = acup.Description 507 } 508 if acup.AuthenticationSettings != nil { 509 objectMap["authenticationSettings"] = acup.AuthenticationSettings 510 } 511 if acup.SubscriptionKeyParameterNames != nil { 512 objectMap["subscriptionKeyParameterNames"] = acup.SubscriptionKeyParameterNames 513 } 514 if acup.APIType != "" { 515 objectMap["type"] = acup.APIType 516 } 517 if acup.APIRevision != nil { 518 objectMap["apiRevision"] = acup.APIRevision 519 } 520 if acup.APIVersion != nil { 521 objectMap["apiVersion"] = acup.APIVersion 522 } 523 if acup.IsCurrent != nil { 524 objectMap["isCurrent"] = acup.IsCurrent 525 } 526 if acup.APIRevisionDescription != nil { 527 objectMap["apiRevisionDescription"] = acup.APIRevisionDescription 528 } 529 if acup.APIVersionDescription != nil { 530 objectMap["apiVersionDescription"] = acup.APIVersionDescription 531 } 532 if acup.APIVersionSetID != nil { 533 objectMap["apiVersionSetId"] = acup.APIVersionSetID 534 } 535 if acup.SubscriptionRequired != nil { 536 objectMap["subscriptionRequired"] = acup.SubscriptionRequired 537 } 538 return json.Marshal(objectMap) 539} 540 541// APICreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 542// operation. 543type APICreateOrUpdateFuture struct { 544 azure.FutureAPI 545 // Result returns the result of the asynchronous operation. 546 // If the operation has not completed it will return an error. 547 Result func(APIClient) (APIContract, error) 548} 549 550// UnmarshalJSON is the custom unmarshaller for CreateFuture. 551func (future *APICreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 552 var azFuture azure.Future 553 if err := json.Unmarshal(body, &azFuture); err != nil { 554 return err 555 } 556 future.FutureAPI = &azFuture 557 future.Result = future.result 558 return nil 559} 560 561// result is the default implementation for APICreateOrUpdateFuture.Result. 562func (future *APICreateOrUpdateFuture) result(client APIClient) (ac APIContract, err error) { 563 var done bool 564 done, err = future.DoneWithContext(context.Background(), client) 565 if err != nil { 566 err = autorest.NewErrorWithError(err, "apimanagement.APICreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 567 return 568 } 569 if !done { 570 ac.Response.Response = future.Response() 571 err = azure.NewAsyncOpIncompleteError("apimanagement.APICreateOrUpdateFuture") 572 return 573 } 574 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 575 if ac.Response.Response, err = future.GetResult(sender); err == nil && ac.Response.Response.StatusCode != http.StatusNoContent { 576 ac, err = client.CreateOrUpdateResponder(ac.Response.Response) 577 if err != nil { 578 err = autorest.NewErrorWithError(err, "apimanagement.APICreateOrUpdateFuture", "Result", ac.Response.Response, "Failure responding to request") 579 } 580 } 581 return 582} 583 584// APICreateOrUpdateParameter API Create or Update Parameters. 585type APICreateOrUpdateParameter struct { 586 // APICreateOrUpdateProperties - Api entity create of update properties. 587 *APICreateOrUpdateProperties `json:"properties,omitempty"` 588} 589 590// MarshalJSON is the custom marshaler for APICreateOrUpdateParameter. 591func (acoup APICreateOrUpdateParameter) MarshalJSON() ([]byte, error) { 592 objectMap := make(map[string]interface{}) 593 if acoup.APICreateOrUpdateProperties != nil { 594 objectMap["properties"] = acoup.APICreateOrUpdateProperties 595 } 596 return json.Marshal(objectMap) 597} 598 599// UnmarshalJSON is the custom unmarshaler for APICreateOrUpdateParameter struct. 600func (acoup *APICreateOrUpdateParameter) UnmarshalJSON(body []byte) error { 601 var m map[string]*json.RawMessage 602 err := json.Unmarshal(body, &m) 603 if err != nil { 604 return err 605 } 606 for k, v := range m { 607 switch k { 608 case "properties": 609 if v != nil { 610 var APICreateOrUpdateProperties APICreateOrUpdateProperties 611 err = json.Unmarshal(*v, &APICreateOrUpdateProperties) 612 if err != nil { 613 return err 614 } 615 acoup.APICreateOrUpdateProperties = &APICreateOrUpdateProperties 616 } 617 } 618 } 619 620 return nil 621} 622 623// APICreateOrUpdateProperties api Create or Update Properties. 624type APICreateOrUpdateProperties struct { 625 // Value - Content value when Importing an API. 626 Value *string `json:"value,omitempty"` 627 // Format - Format of the Content in which the API is getting imported. Possible values include: 'WadlXML', 'WadlLinkJSON', 'SwaggerJSON', 'SwaggerLinkJSON', 'Wsdl', 'WsdlLink', 'Openapi', 'Openapijson', 'OpenapiLink', 'OpenapijsonLink' 628 Format ContentFormat `json:"format,omitempty"` 629 // WsdlSelector - Criteria to limit import of WSDL to a subset of the document. 630 WsdlSelector *APICreateOrUpdatePropertiesWsdlSelector `json:"wsdlSelector,omitempty"` 631 // SoapAPIType - Type of Api to create. 632 // * `http` creates a SOAP to REST API 633 // * `soap` creates a SOAP pass-through API. Possible values include: 'SoapToRest', 'SoapPassThrough' 634 SoapAPIType SoapAPIType `json:"apiType,omitempty"` 635 // SourceAPIID - API identifier of the source API. 636 SourceAPIID *string `json:"sourceApiId,omitempty"` 637 // DisplayName - API name. Must be 1 to 300 characters long. 638 DisplayName *string `json:"displayName,omitempty"` 639 // ServiceURL - Absolute URL of the backend service implementing this API. Cannot be more than 2000 characters long. 640 ServiceURL *string `json:"serviceUrl,omitempty"` 641 // 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. 642 Path *string `json:"path,omitempty"` 643 // Protocols - Describes on which protocols the operations in this API can be invoked. 644 Protocols *[]Protocol `json:"protocols,omitempty"` 645 // APIVersionSet - Version set details 646 APIVersionSet *APIVersionSetContractDetails `json:"apiVersionSet,omitempty"` 647 // Description - Description of the API. May include HTML formatting tags. 648 Description *string `json:"description,omitempty"` 649 // AuthenticationSettings - Collection of authentication settings included into this API. 650 AuthenticationSettings *AuthenticationSettingsContract `json:"authenticationSettings,omitempty"` 651 // SubscriptionKeyParameterNames - Protocols over which API is made available. 652 SubscriptionKeyParameterNames *SubscriptionKeyParameterNamesContract `json:"subscriptionKeyParameterNames,omitempty"` 653 // APIType - Type of API. Possible values include: 'HTTP', 'Soap' 654 APIType APIType `json:"type,omitempty"` 655 // APIRevision - Describes the Revision of the Api. If no value is provided, default revision 1 is created 656 APIRevision *string `json:"apiRevision,omitempty"` 657 // APIVersion - Indicates the Version identifier of the API if the API is versioned 658 APIVersion *string `json:"apiVersion,omitempty"` 659 // IsCurrent - Indicates if API revision is current api revision. 660 IsCurrent *bool `json:"isCurrent,omitempty"` 661 // IsOnline - READ-ONLY; Indicates if API revision is accessible via the gateway. 662 IsOnline *bool `json:"isOnline,omitempty"` 663 // APIRevisionDescription - Description of the Api Revision. 664 APIRevisionDescription *string `json:"apiRevisionDescription,omitempty"` 665 // APIVersionDescription - Description of the Api Version. 666 APIVersionDescription *string `json:"apiVersionDescription,omitempty"` 667 // APIVersionSetID - A resource identifier for the related ApiVersionSet. 668 APIVersionSetID *string `json:"apiVersionSetId,omitempty"` 669 // SubscriptionRequired - Specifies whether an API or Product subscription is required for accessing the API. 670 SubscriptionRequired *bool `json:"subscriptionRequired,omitempty"` 671} 672 673// MarshalJSON is the custom marshaler for APICreateOrUpdateProperties. 674func (acoup APICreateOrUpdateProperties) MarshalJSON() ([]byte, error) { 675 objectMap := make(map[string]interface{}) 676 if acoup.Value != nil { 677 objectMap["value"] = acoup.Value 678 } 679 if acoup.Format != "" { 680 objectMap["format"] = acoup.Format 681 } 682 if acoup.WsdlSelector != nil { 683 objectMap["wsdlSelector"] = acoup.WsdlSelector 684 } 685 if acoup.SoapAPIType != "" { 686 objectMap["apiType"] = acoup.SoapAPIType 687 } 688 if acoup.SourceAPIID != nil { 689 objectMap["sourceApiId"] = acoup.SourceAPIID 690 } 691 if acoup.DisplayName != nil { 692 objectMap["displayName"] = acoup.DisplayName 693 } 694 if acoup.ServiceURL != nil { 695 objectMap["serviceUrl"] = acoup.ServiceURL 696 } 697 if acoup.Path != nil { 698 objectMap["path"] = acoup.Path 699 } 700 if acoup.Protocols != nil { 701 objectMap["protocols"] = acoup.Protocols 702 } 703 if acoup.APIVersionSet != nil { 704 objectMap["apiVersionSet"] = acoup.APIVersionSet 705 } 706 if acoup.Description != nil { 707 objectMap["description"] = acoup.Description 708 } 709 if acoup.AuthenticationSettings != nil { 710 objectMap["authenticationSettings"] = acoup.AuthenticationSettings 711 } 712 if acoup.SubscriptionKeyParameterNames != nil { 713 objectMap["subscriptionKeyParameterNames"] = acoup.SubscriptionKeyParameterNames 714 } 715 if acoup.APIType != "" { 716 objectMap["type"] = acoup.APIType 717 } 718 if acoup.APIRevision != nil { 719 objectMap["apiRevision"] = acoup.APIRevision 720 } 721 if acoup.APIVersion != nil { 722 objectMap["apiVersion"] = acoup.APIVersion 723 } 724 if acoup.IsCurrent != nil { 725 objectMap["isCurrent"] = acoup.IsCurrent 726 } 727 if acoup.APIRevisionDescription != nil { 728 objectMap["apiRevisionDescription"] = acoup.APIRevisionDescription 729 } 730 if acoup.APIVersionDescription != nil { 731 objectMap["apiVersionDescription"] = acoup.APIVersionDescription 732 } 733 if acoup.APIVersionSetID != nil { 734 objectMap["apiVersionSetId"] = acoup.APIVersionSetID 735 } 736 if acoup.SubscriptionRequired != nil { 737 objectMap["subscriptionRequired"] = acoup.SubscriptionRequired 738 } 739 return json.Marshal(objectMap) 740} 741 742// APICreateOrUpdatePropertiesWsdlSelector criteria to limit import of WSDL to a subset of the document. 743type APICreateOrUpdatePropertiesWsdlSelector struct { 744 // WsdlServiceName - Name of service to import from WSDL 745 WsdlServiceName *string `json:"wsdlServiceName,omitempty"` 746 // WsdlEndpointName - Name of endpoint(port) to import from WSDL 747 WsdlEndpointName *string `json:"wsdlEndpointName,omitempty"` 748} 749 750// APIEntityBaseContract API base contract details. 751type APIEntityBaseContract struct { 752 // Description - Description of the API. May include HTML formatting tags. 753 Description *string `json:"description,omitempty"` 754 // AuthenticationSettings - Collection of authentication settings included into this API. 755 AuthenticationSettings *AuthenticationSettingsContract `json:"authenticationSettings,omitempty"` 756 // SubscriptionKeyParameterNames - Protocols over which API is made available. 757 SubscriptionKeyParameterNames *SubscriptionKeyParameterNamesContract `json:"subscriptionKeyParameterNames,omitempty"` 758 // APIType - Type of API. Possible values include: 'HTTP', 'Soap' 759 APIType APIType `json:"type,omitempty"` 760 // APIRevision - Describes the Revision of the Api. If no value is provided, default revision 1 is created 761 APIRevision *string `json:"apiRevision,omitempty"` 762 // APIVersion - Indicates the Version identifier of the API if the API is versioned 763 APIVersion *string `json:"apiVersion,omitempty"` 764 // IsCurrent - Indicates if API revision is current api revision. 765 IsCurrent *bool `json:"isCurrent,omitempty"` 766 // IsOnline - READ-ONLY; Indicates if API revision is accessible via the gateway. 767 IsOnline *bool `json:"isOnline,omitempty"` 768 // APIRevisionDescription - Description of the Api Revision. 769 APIRevisionDescription *string `json:"apiRevisionDescription,omitempty"` 770 // APIVersionDescription - Description of the Api Version. 771 APIVersionDescription *string `json:"apiVersionDescription,omitempty"` 772 // APIVersionSetID - A resource identifier for the related ApiVersionSet. 773 APIVersionSetID *string `json:"apiVersionSetId,omitempty"` 774 // SubscriptionRequired - Specifies whether an API or Product subscription is required for accessing the API. 775 SubscriptionRequired *bool `json:"subscriptionRequired,omitempty"` 776} 777 778// MarshalJSON is the custom marshaler for APIEntityBaseContract. 779func (aebc APIEntityBaseContract) MarshalJSON() ([]byte, error) { 780 objectMap := make(map[string]interface{}) 781 if aebc.Description != nil { 782 objectMap["description"] = aebc.Description 783 } 784 if aebc.AuthenticationSettings != nil { 785 objectMap["authenticationSettings"] = aebc.AuthenticationSettings 786 } 787 if aebc.SubscriptionKeyParameterNames != nil { 788 objectMap["subscriptionKeyParameterNames"] = aebc.SubscriptionKeyParameterNames 789 } 790 if aebc.APIType != "" { 791 objectMap["type"] = aebc.APIType 792 } 793 if aebc.APIRevision != nil { 794 objectMap["apiRevision"] = aebc.APIRevision 795 } 796 if aebc.APIVersion != nil { 797 objectMap["apiVersion"] = aebc.APIVersion 798 } 799 if aebc.IsCurrent != nil { 800 objectMap["isCurrent"] = aebc.IsCurrent 801 } 802 if aebc.APIRevisionDescription != nil { 803 objectMap["apiRevisionDescription"] = aebc.APIRevisionDescription 804 } 805 if aebc.APIVersionDescription != nil { 806 objectMap["apiVersionDescription"] = aebc.APIVersionDescription 807 } 808 if aebc.APIVersionSetID != nil { 809 objectMap["apiVersionSetId"] = aebc.APIVersionSetID 810 } 811 if aebc.SubscriptionRequired != nil { 812 objectMap["subscriptionRequired"] = aebc.SubscriptionRequired 813 } 814 return json.Marshal(objectMap) 815} 816 817// APIExportResult API Export result. 818type APIExportResult struct { 819 autorest.Response `json:"-"` 820 // ID - ResourceId of the API which was exported. 821 ID *string `json:"id,omitempty"` 822 // ExportResultFormat - Format in which the Api Details are exported to the Storage Blob with Sas Key valid for 5 minutes. Possible values include: 'ExportResultFormatSwagger', 'ExportResultFormatWsdl', 'ExportResultFormatWadl', 'ExportResultFormatOpenAPI' 823 ExportResultFormat ExportResultFormat `json:"format,omitempty"` 824 // Value - The object defining the schema of the exported Api Detail 825 Value *APIExportResultValue `json:"value,omitempty"` 826} 827 828// APIExportResultValue the object defining the schema of the exported Api Detail 829type APIExportResultValue struct { 830 // Link - Link to the Storage Blob containing the result of the export operation. The Blob Uri is only valid for 5 minutes. 831 Link *string `json:"link,omitempty"` 832} 833 834// ApimResource the Resource definition. 835type ApimResource struct { 836 // ID - READ-ONLY; Resource ID. 837 ID *string `json:"id,omitempty"` 838 // Name - READ-ONLY; Resource name. 839 Name *string `json:"name,omitempty"` 840 // Type - READ-ONLY; Resource type for API Management resource is set to Microsoft.ApiManagement. 841 Type *string `json:"type,omitempty"` 842 // Tags - Resource tags. 843 Tags map[string]*string `json:"tags"` 844} 845 846// MarshalJSON is the custom marshaler for ApimResource. 847func (ar ApimResource) MarshalJSON() ([]byte, error) { 848 objectMap := make(map[string]interface{}) 849 if ar.Tags != nil { 850 objectMap["tags"] = ar.Tags 851 } 852 return json.Marshal(objectMap) 853} 854 855// APIReleaseCollection paged ApiRelease list representation. 856type APIReleaseCollection struct { 857 autorest.Response `json:"-"` 858 // Value - READ-ONLY; Page values. 859 Value *[]APIReleaseContract `json:"value,omitempty"` 860 // NextLink - READ-ONLY; Next page link if any. 861 NextLink *string `json:"nextLink,omitempty"` 862} 863 864// MarshalJSON is the custom marshaler for APIReleaseCollection. 865func (arc APIReleaseCollection) MarshalJSON() ([]byte, error) { 866 objectMap := make(map[string]interface{}) 867 return json.Marshal(objectMap) 868} 869 870// APIReleaseCollectionIterator provides access to a complete listing of APIReleaseContract values. 871type APIReleaseCollectionIterator struct { 872 i int 873 page APIReleaseCollectionPage 874} 875 876// NextWithContext advances to the next value. If there was an error making 877// the request the iterator does not advance and the error is returned. 878func (iter *APIReleaseCollectionIterator) NextWithContext(ctx context.Context) (err error) { 879 if tracing.IsEnabled() { 880 ctx = tracing.StartSpan(ctx, fqdn+"/APIReleaseCollectionIterator.NextWithContext") 881 defer func() { 882 sc := -1 883 if iter.Response().Response.Response != nil { 884 sc = iter.Response().Response.Response.StatusCode 885 } 886 tracing.EndSpan(ctx, sc, err) 887 }() 888 } 889 iter.i++ 890 if iter.i < len(iter.page.Values()) { 891 return nil 892 } 893 err = iter.page.NextWithContext(ctx) 894 if err != nil { 895 iter.i-- 896 return err 897 } 898 iter.i = 0 899 return nil 900} 901 902// Next advances to the next value. If there was an error making 903// the request the iterator does not advance and the error is returned. 904// Deprecated: Use NextWithContext() instead. 905func (iter *APIReleaseCollectionIterator) Next() error { 906 return iter.NextWithContext(context.Background()) 907} 908 909// NotDone returns true if the enumeration should be started or is not yet complete. 910func (iter APIReleaseCollectionIterator) NotDone() bool { 911 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 912} 913 914// Response returns the raw server response from the last page request. 915func (iter APIReleaseCollectionIterator) Response() APIReleaseCollection { 916 return iter.page.Response() 917} 918 919// Value returns the current value or a zero-initialized value if the 920// iterator has advanced beyond the end of the collection. 921func (iter APIReleaseCollectionIterator) Value() APIReleaseContract { 922 if !iter.page.NotDone() { 923 return APIReleaseContract{} 924 } 925 return iter.page.Values()[iter.i] 926} 927 928// Creates a new instance of the APIReleaseCollectionIterator type. 929func NewAPIReleaseCollectionIterator(page APIReleaseCollectionPage) APIReleaseCollectionIterator { 930 return APIReleaseCollectionIterator{page: page} 931} 932 933// IsEmpty returns true if the ListResult contains no values. 934func (arc APIReleaseCollection) IsEmpty() bool { 935 return arc.Value == nil || len(*arc.Value) == 0 936} 937 938// hasNextLink returns true if the NextLink is not empty. 939func (arc APIReleaseCollection) hasNextLink() bool { 940 return arc.NextLink != nil && len(*arc.NextLink) != 0 941} 942 943// aPIReleaseCollectionPreparer prepares a request to retrieve the next set of results. 944// It returns nil if no more results exist. 945func (arc APIReleaseCollection) aPIReleaseCollectionPreparer(ctx context.Context) (*http.Request, error) { 946 if !arc.hasNextLink() { 947 return nil, nil 948 } 949 return autorest.Prepare((&http.Request{}).WithContext(ctx), 950 autorest.AsJSON(), 951 autorest.AsGet(), 952 autorest.WithBaseURL(to.String(arc.NextLink))) 953} 954 955// APIReleaseCollectionPage contains a page of APIReleaseContract values. 956type APIReleaseCollectionPage struct { 957 fn func(context.Context, APIReleaseCollection) (APIReleaseCollection, error) 958 arc APIReleaseCollection 959} 960 961// NextWithContext advances to the next page of values. If there was an error making 962// the request the page does not advance and the error is returned. 963func (page *APIReleaseCollectionPage) NextWithContext(ctx context.Context) (err error) { 964 if tracing.IsEnabled() { 965 ctx = tracing.StartSpan(ctx, fqdn+"/APIReleaseCollectionPage.NextWithContext") 966 defer func() { 967 sc := -1 968 if page.Response().Response.Response != nil { 969 sc = page.Response().Response.Response.StatusCode 970 } 971 tracing.EndSpan(ctx, sc, err) 972 }() 973 } 974 for { 975 next, err := page.fn(ctx, page.arc) 976 if err != nil { 977 return err 978 } 979 page.arc = next 980 if !next.hasNextLink() || !next.IsEmpty() { 981 break 982 } 983 } 984 return nil 985} 986 987// Next advances to the next page of values. If there was an error making 988// the request the page does not advance and the error is returned. 989// Deprecated: Use NextWithContext() instead. 990func (page *APIReleaseCollectionPage) Next() error { 991 return page.NextWithContext(context.Background()) 992} 993 994// NotDone returns true if the page enumeration should be started or is not yet complete. 995func (page APIReleaseCollectionPage) NotDone() bool { 996 return !page.arc.IsEmpty() 997} 998 999// Response returns the raw server response from the last page request. 1000func (page APIReleaseCollectionPage) Response() APIReleaseCollection { 1001 return page.arc 1002} 1003 1004// Values returns the slice of values for the current page or nil if there are no values. 1005func (page APIReleaseCollectionPage) Values() []APIReleaseContract { 1006 if page.arc.IsEmpty() { 1007 return nil 1008 } 1009 return *page.arc.Value 1010} 1011 1012// Creates a new instance of the APIReleaseCollectionPage type. 1013func NewAPIReleaseCollectionPage(cur APIReleaseCollection, getNextPage func(context.Context, APIReleaseCollection) (APIReleaseCollection, error)) APIReleaseCollectionPage { 1014 return APIReleaseCollectionPage{ 1015 fn: getNextPage, 1016 arc: cur, 1017 } 1018} 1019 1020// APIReleaseContract apiRelease details. 1021type APIReleaseContract struct { 1022 autorest.Response `json:"-"` 1023 // APIReleaseContractProperties - ApiRelease entity contract properties. 1024 *APIReleaseContractProperties `json:"properties,omitempty"` 1025 // ID - READ-ONLY; Resource ID. 1026 ID *string `json:"id,omitempty"` 1027 // Name - READ-ONLY; Resource name. 1028 Name *string `json:"name,omitempty"` 1029 // Type - READ-ONLY; Resource type for API Management resource. 1030 Type *string `json:"type,omitempty"` 1031} 1032 1033// MarshalJSON is the custom marshaler for APIReleaseContract. 1034func (arc APIReleaseContract) MarshalJSON() ([]byte, error) { 1035 objectMap := make(map[string]interface{}) 1036 if arc.APIReleaseContractProperties != nil { 1037 objectMap["properties"] = arc.APIReleaseContractProperties 1038 } 1039 return json.Marshal(objectMap) 1040} 1041 1042// UnmarshalJSON is the custom unmarshaler for APIReleaseContract struct. 1043func (arc *APIReleaseContract) UnmarshalJSON(body []byte) error { 1044 var m map[string]*json.RawMessage 1045 err := json.Unmarshal(body, &m) 1046 if err != nil { 1047 return err 1048 } 1049 for k, v := range m { 1050 switch k { 1051 case "properties": 1052 if v != nil { 1053 var APIReleaseContractProperties APIReleaseContractProperties 1054 err = json.Unmarshal(*v, &APIReleaseContractProperties) 1055 if err != nil { 1056 return err 1057 } 1058 arc.APIReleaseContractProperties = &APIReleaseContractProperties 1059 } 1060 case "id": 1061 if v != nil { 1062 var ID string 1063 err = json.Unmarshal(*v, &ID) 1064 if err != nil { 1065 return err 1066 } 1067 arc.ID = &ID 1068 } 1069 case "name": 1070 if v != nil { 1071 var name string 1072 err = json.Unmarshal(*v, &name) 1073 if err != nil { 1074 return err 1075 } 1076 arc.Name = &name 1077 } 1078 case "type": 1079 if v != nil { 1080 var typeVar string 1081 err = json.Unmarshal(*v, &typeVar) 1082 if err != nil { 1083 return err 1084 } 1085 arc.Type = &typeVar 1086 } 1087 } 1088 } 1089 1090 return nil 1091} 1092 1093// APIReleaseContractProperties API Release details 1094type APIReleaseContractProperties struct { 1095 // APIID - Identifier of the API the release belongs to. 1096 APIID *string `json:"apiId,omitempty"` 1097 // 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. 1098 CreatedDateTime *date.Time `json:"createdDateTime,omitempty"` 1099 // UpdatedDateTime - READ-ONLY; The time the API release was updated. 1100 UpdatedDateTime *date.Time `json:"updatedDateTime,omitempty"` 1101 // Notes - Release Notes 1102 Notes *string `json:"notes,omitempty"` 1103} 1104 1105// MarshalJSON is the custom marshaler for APIReleaseContractProperties. 1106func (arcp APIReleaseContractProperties) MarshalJSON() ([]byte, error) { 1107 objectMap := make(map[string]interface{}) 1108 if arcp.APIID != nil { 1109 objectMap["apiId"] = arcp.APIID 1110 } 1111 if arcp.Notes != nil { 1112 objectMap["notes"] = arcp.Notes 1113 } 1114 return json.Marshal(objectMap) 1115} 1116 1117// APIRevisionCollection paged Api Revision list representation. 1118type APIRevisionCollection struct { 1119 autorest.Response `json:"-"` 1120 // Value - READ-ONLY; Page values. 1121 Value *[]APIRevisionContract `json:"value,omitempty"` 1122 // NextLink - READ-ONLY; Next page link if any. 1123 NextLink *string `json:"nextLink,omitempty"` 1124} 1125 1126// MarshalJSON is the custom marshaler for APIRevisionCollection. 1127func (arc APIRevisionCollection) MarshalJSON() ([]byte, error) { 1128 objectMap := make(map[string]interface{}) 1129 return json.Marshal(objectMap) 1130} 1131 1132// APIRevisionCollectionIterator provides access to a complete listing of APIRevisionContract values. 1133type APIRevisionCollectionIterator struct { 1134 i int 1135 page APIRevisionCollectionPage 1136} 1137 1138// NextWithContext advances to the next value. If there was an error making 1139// the request the iterator does not advance and the error is returned. 1140func (iter *APIRevisionCollectionIterator) NextWithContext(ctx context.Context) (err error) { 1141 if tracing.IsEnabled() { 1142 ctx = tracing.StartSpan(ctx, fqdn+"/APIRevisionCollectionIterator.NextWithContext") 1143 defer func() { 1144 sc := -1 1145 if iter.Response().Response.Response != nil { 1146 sc = iter.Response().Response.Response.StatusCode 1147 } 1148 tracing.EndSpan(ctx, sc, err) 1149 }() 1150 } 1151 iter.i++ 1152 if iter.i < len(iter.page.Values()) { 1153 return nil 1154 } 1155 err = iter.page.NextWithContext(ctx) 1156 if err != nil { 1157 iter.i-- 1158 return err 1159 } 1160 iter.i = 0 1161 return nil 1162} 1163 1164// Next advances to the next value. If there was an error making 1165// the request the iterator does not advance and the error is returned. 1166// Deprecated: Use NextWithContext() instead. 1167func (iter *APIRevisionCollectionIterator) Next() error { 1168 return iter.NextWithContext(context.Background()) 1169} 1170 1171// NotDone returns true if the enumeration should be started or is not yet complete. 1172func (iter APIRevisionCollectionIterator) NotDone() bool { 1173 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 1174} 1175 1176// Response returns the raw server response from the last page request. 1177func (iter APIRevisionCollectionIterator) Response() APIRevisionCollection { 1178 return iter.page.Response() 1179} 1180 1181// Value returns the current value or a zero-initialized value if the 1182// iterator has advanced beyond the end of the collection. 1183func (iter APIRevisionCollectionIterator) Value() APIRevisionContract { 1184 if !iter.page.NotDone() { 1185 return APIRevisionContract{} 1186 } 1187 return iter.page.Values()[iter.i] 1188} 1189 1190// Creates a new instance of the APIRevisionCollectionIterator type. 1191func NewAPIRevisionCollectionIterator(page APIRevisionCollectionPage) APIRevisionCollectionIterator { 1192 return APIRevisionCollectionIterator{page: page} 1193} 1194 1195// IsEmpty returns true if the ListResult contains no values. 1196func (arc APIRevisionCollection) IsEmpty() bool { 1197 return arc.Value == nil || len(*arc.Value) == 0 1198} 1199 1200// hasNextLink returns true if the NextLink is not empty. 1201func (arc APIRevisionCollection) hasNextLink() bool { 1202 return arc.NextLink != nil && len(*arc.NextLink) != 0 1203} 1204 1205// aPIRevisionCollectionPreparer prepares a request to retrieve the next set of results. 1206// It returns nil if no more results exist. 1207func (arc APIRevisionCollection) aPIRevisionCollectionPreparer(ctx context.Context) (*http.Request, error) { 1208 if !arc.hasNextLink() { 1209 return nil, nil 1210 } 1211 return autorest.Prepare((&http.Request{}).WithContext(ctx), 1212 autorest.AsJSON(), 1213 autorest.AsGet(), 1214 autorest.WithBaseURL(to.String(arc.NextLink))) 1215} 1216 1217// APIRevisionCollectionPage contains a page of APIRevisionContract values. 1218type APIRevisionCollectionPage struct { 1219 fn func(context.Context, APIRevisionCollection) (APIRevisionCollection, error) 1220 arc APIRevisionCollection 1221} 1222 1223// NextWithContext advances to the next page of values. If there was an error making 1224// the request the page does not advance and the error is returned. 1225func (page *APIRevisionCollectionPage) NextWithContext(ctx context.Context) (err error) { 1226 if tracing.IsEnabled() { 1227 ctx = tracing.StartSpan(ctx, fqdn+"/APIRevisionCollectionPage.NextWithContext") 1228 defer func() { 1229 sc := -1 1230 if page.Response().Response.Response != nil { 1231 sc = page.Response().Response.Response.StatusCode 1232 } 1233 tracing.EndSpan(ctx, sc, err) 1234 }() 1235 } 1236 for { 1237 next, err := page.fn(ctx, page.arc) 1238 if err != nil { 1239 return err 1240 } 1241 page.arc = next 1242 if !next.hasNextLink() || !next.IsEmpty() { 1243 break 1244 } 1245 } 1246 return nil 1247} 1248 1249// Next advances to the next page of values. If there was an error making 1250// the request the page does not advance and the error is returned. 1251// Deprecated: Use NextWithContext() instead. 1252func (page *APIRevisionCollectionPage) Next() error { 1253 return page.NextWithContext(context.Background()) 1254} 1255 1256// NotDone returns true if the page enumeration should be started or is not yet complete. 1257func (page APIRevisionCollectionPage) NotDone() bool { 1258 return !page.arc.IsEmpty() 1259} 1260 1261// Response returns the raw server response from the last page request. 1262func (page APIRevisionCollectionPage) Response() APIRevisionCollection { 1263 return page.arc 1264} 1265 1266// Values returns the slice of values for the current page or nil if there are no values. 1267func (page APIRevisionCollectionPage) Values() []APIRevisionContract { 1268 if page.arc.IsEmpty() { 1269 return nil 1270 } 1271 return *page.arc.Value 1272} 1273 1274// Creates a new instance of the APIRevisionCollectionPage type. 1275func NewAPIRevisionCollectionPage(cur APIRevisionCollection, getNextPage func(context.Context, APIRevisionCollection) (APIRevisionCollection, error)) APIRevisionCollectionPage { 1276 return APIRevisionCollectionPage{ 1277 fn: getNextPage, 1278 arc: cur, 1279 } 1280} 1281 1282// APIRevisionContract summary of revision metadata. 1283type APIRevisionContract struct { 1284 // APIID - READ-ONLY; Identifier of the API Revision. 1285 APIID *string `json:"apiId,omitempty"` 1286 // APIRevision - READ-ONLY; Revision number of API. 1287 APIRevision *string `json:"apiRevision,omitempty"` 1288 // 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. 1289 CreatedDateTime *date.Time `json:"createdDateTime,omitempty"` 1290 // 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. 1291 UpdatedDateTime *date.Time `json:"updatedDateTime,omitempty"` 1292 // Description - READ-ONLY; Description of the API Revision. 1293 Description *string `json:"description,omitempty"` 1294 // PrivateURL - READ-ONLY; Gateway URL for accessing the non-current API Revision. 1295 PrivateURL *string `json:"privateUrl,omitempty"` 1296 // IsOnline - READ-ONLY; Indicates if API revision is the current api revision. 1297 IsOnline *bool `json:"isOnline,omitempty"` 1298 // IsCurrent - READ-ONLY; Indicates if API revision is accessible via the gateway. 1299 IsCurrent *bool `json:"isCurrent,omitempty"` 1300} 1301 1302// MarshalJSON is the custom marshaler for APIRevisionContract. 1303func (arc APIRevisionContract) MarshalJSON() ([]byte, error) { 1304 objectMap := make(map[string]interface{}) 1305 return json.Marshal(objectMap) 1306} 1307 1308// APIRevisionInfoContract object used to create an API Revision or Version based on an existing API 1309// Revision 1310type APIRevisionInfoContract struct { 1311 // SourceAPIID - Resource identifier of API to be used to create the revision from. 1312 SourceAPIID *string `json:"sourceApiId,omitempty"` 1313 // APIVersionName - Version identifier for the new API Version. 1314 APIVersionName *string `json:"apiVersionName,omitempty"` 1315 // APIRevisionDescription - Description of new API Revision. 1316 APIRevisionDescription *string `json:"apiRevisionDescription,omitempty"` 1317 // APIVersionSet - Version set details 1318 APIVersionSet *APIVersionSetContractDetails `json:"apiVersionSet,omitempty"` 1319} 1320 1321// APISchemaCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 1322// operation. 1323type APISchemaCreateOrUpdateFuture struct { 1324 azure.FutureAPI 1325 // Result returns the result of the asynchronous operation. 1326 // If the operation has not completed it will return an error. 1327 Result func(APISchemaClient) (SchemaContract, error) 1328} 1329 1330// UnmarshalJSON is the custom unmarshaller for CreateFuture. 1331func (future *APISchemaCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 1332 var azFuture azure.Future 1333 if err := json.Unmarshal(body, &azFuture); err != nil { 1334 return err 1335 } 1336 future.FutureAPI = &azFuture 1337 future.Result = future.result 1338 return nil 1339} 1340 1341// result is the default implementation for APISchemaCreateOrUpdateFuture.Result. 1342func (future *APISchemaCreateOrUpdateFuture) result(client APISchemaClient) (sc SchemaContract, err error) { 1343 var done bool 1344 done, err = future.DoneWithContext(context.Background(), client) 1345 if err != nil { 1346 err = autorest.NewErrorWithError(err, "apimanagement.APISchemaCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 1347 return 1348 } 1349 if !done { 1350 sc.Response.Response = future.Response() 1351 err = azure.NewAsyncOpIncompleteError("apimanagement.APISchemaCreateOrUpdateFuture") 1352 return 1353 } 1354 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 1355 if sc.Response.Response, err = future.GetResult(sender); err == nil && sc.Response.Response.StatusCode != http.StatusNoContent { 1356 sc, err = client.CreateOrUpdateResponder(sc.Response.Response) 1357 if err != nil { 1358 err = autorest.NewErrorWithError(err, "apimanagement.APISchemaCreateOrUpdateFuture", "Result", sc.Response.Response, "Failure responding to request") 1359 } 1360 } 1361 return 1362} 1363 1364// APITagResourceContractProperties API contract properties for the Tag Resources. 1365type APITagResourceContractProperties struct { 1366 // ID - API identifier in the form /apis/{apiId}. 1367 ID *string `json:"id,omitempty"` 1368 // Name - API name. 1369 Name *string `json:"name,omitempty"` 1370 // ServiceURL - Absolute URL of the backend service implementing this API. 1371 ServiceURL *string `json:"serviceUrl,omitempty"` 1372 // 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. 1373 Path *string `json:"path,omitempty"` 1374 // Protocols - Describes on which protocols the operations in this API can be invoked. 1375 Protocols *[]Protocol `json:"protocols,omitempty"` 1376 // Description - Description of the API. May include HTML formatting tags. 1377 Description *string `json:"description,omitempty"` 1378 // AuthenticationSettings - Collection of authentication settings included into this API. 1379 AuthenticationSettings *AuthenticationSettingsContract `json:"authenticationSettings,omitempty"` 1380 // SubscriptionKeyParameterNames - Protocols over which API is made available. 1381 SubscriptionKeyParameterNames *SubscriptionKeyParameterNamesContract `json:"subscriptionKeyParameterNames,omitempty"` 1382 // APIType - Type of API. Possible values include: 'HTTP', 'Soap' 1383 APIType APIType `json:"type,omitempty"` 1384 // APIRevision - Describes the Revision of the Api. If no value is provided, default revision 1 is created 1385 APIRevision *string `json:"apiRevision,omitempty"` 1386 // APIVersion - Indicates the Version identifier of the API if the API is versioned 1387 APIVersion *string `json:"apiVersion,omitempty"` 1388 // IsCurrent - Indicates if API revision is current api revision. 1389 IsCurrent *bool `json:"isCurrent,omitempty"` 1390 // IsOnline - READ-ONLY; Indicates if API revision is accessible via the gateway. 1391 IsOnline *bool `json:"isOnline,omitempty"` 1392 // APIRevisionDescription - Description of the Api Revision. 1393 APIRevisionDescription *string `json:"apiRevisionDescription,omitempty"` 1394 // APIVersionDescription - Description of the Api Version. 1395 APIVersionDescription *string `json:"apiVersionDescription,omitempty"` 1396 // APIVersionSetID - A resource identifier for the related ApiVersionSet. 1397 APIVersionSetID *string `json:"apiVersionSetId,omitempty"` 1398 // SubscriptionRequired - Specifies whether an API or Product subscription is required for accessing the API. 1399 SubscriptionRequired *bool `json:"subscriptionRequired,omitempty"` 1400} 1401 1402// MarshalJSON is the custom marshaler for APITagResourceContractProperties. 1403func (atrcp APITagResourceContractProperties) MarshalJSON() ([]byte, error) { 1404 objectMap := make(map[string]interface{}) 1405 if atrcp.ID != nil { 1406 objectMap["id"] = atrcp.ID 1407 } 1408 if atrcp.Name != nil { 1409 objectMap["name"] = atrcp.Name 1410 } 1411 if atrcp.ServiceURL != nil { 1412 objectMap["serviceUrl"] = atrcp.ServiceURL 1413 } 1414 if atrcp.Path != nil { 1415 objectMap["path"] = atrcp.Path 1416 } 1417 if atrcp.Protocols != nil { 1418 objectMap["protocols"] = atrcp.Protocols 1419 } 1420 if atrcp.Description != nil { 1421 objectMap["description"] = atrcp.Description 1422 } 1423 if atrcp.AuthenticationSettings != nil { 1424 objectMap["authenticationSettings"] = atrcp.AuthenticationSettings 1425 } 1426 if atrcp.SubscriptionKeyParameterNames != nil { 1427 objectMap["subscriptionKeyParameterNames"] = atrcp.SubscriptionKeyParameterNames 1428 } 1429 if atrcp.APIType != "" { 1430 objectMap["type"] = atrcp.APIType 1431 } 1432 if atrcp.APIRevision != nil { 1433 objectMap["apiRevision"] = atrcp.APIRevision 1434 } 1435 if atrcp.APIVersion != nil { 1436 objectMap["apiVersion"] = atrcp.APIVersion 1437 } 1438 if atrcp.IsCurrent != nil { 1439 objectMap["isCurrent"] = atrcp.IsCurrent 1440 } 1441 if atrcp.APIRevisionDescription != nil { 1442 objectMap["apiRevisionDescription"] = atrcp.APIRevisionDescription 1443 } 1444 if atrcp.APIVersionDescription != nil { 1445 objectMap["apiVersionDescription"] = atrcp.APIVersionDescription 1446 } 1447 if atrcp.APIVersionSetID != nil { 1448 objectMap["apiVersionSetId"] = atrcp.APIVersionSetID 1449 } 1450 if atrcp.SubscriptionRequired != nil { 1451 objectMap["subscriptionRequired"] = atrcp.SubscriptionRequired 1452 } 1453 return json.Marshal(objectMap) 1454} 1455 1456// APIUpdateContract API update contract details. 1457type APIUpdateContract struct { 1458 // APIContractUpdateProperties - Properties of the API entity that can be updated. 1459 *APIContractUpdateProperties `json:"properties,omitempty"` 1460} 1461 1462// MarshalJSON is the custom marshaler for APIUpdateContract. 1463func (auc APIUpdateContract) MarshalJSON() ([]byte, error) { 1464 objectMap := make(map[string]interface{}) 1465 if auc.APIContractUpdateProperties != nil { 1466 objectMap["properties"] = auc.APIContractUpdateProperties 1467 } 1468 return json.Marshal(objectMap) 1469} 1470 1471// UnmarshalJSON is the custom unmarshaler for APIUpdateContract struct. 1472func (auc *APIUpdateContract) UnmarshalJSON(body []byte) error { 1473 var m map[string]*json.RawMessage 1474 err := json.Unmarshal(body, &m) 1475 if err != nil { 1476 return err 1477 } 1478 for k, v := range m { 1479 switch k { 1480 case "properties": 1481 if v != nil { 1482 var APIContractUpdateProperties APIContractUpdateProperties 1483 err = json.Unmarshal(*v, &APIContractUpdateProperties) 1484 if err != nil { 1485 return err 1486 } 1487 auc.APIContractUpdateProperties = &APIContractUpdateProperties 1488 } 1489 } 1490 } 1491 1492 return nil 1493} 1494 1495// APIVersionConstraint control Plane Apis version constraint for the API Management service. 1496type APIVersionConstraint struct { 1497 // MinAPIVersion - Limit control plane API calls to API Management service with version equal to or newer than this value. 1498 MinAPIVersion *string `json:"minApiVersion,omitempty"` 1499} 1500 1501// APIVersionSetCollection paged Api Version Set list representation. 1502type APIVersionSetCollection struct { 1503 autorest.Response `json:"-"` 1504 // Value - Page values. 1505 Value *[]APIVersionSetContract `json:"value,omitempty"` 1506 // NextLink - Next page link if any. 1507 NextLink *string `json:"nextLink,omitempty"` 1508} 1509 1510// APIVersionSetCollectionIterator provides access to a complete listing of APIVersionSetContract values. 1511type APIVersionSetCollectionIterator struct { 1512 i int 1513 page APIVersionSetCollectionPage 1514} 1515 1516// NextWithContext advances to the next value. If there was an error making 1517// the request the iterator does not advance and the error is returned. 1518func (iter *APIVersionSetCollectionIterator) NextWithContext(ctx context.Context) (err error) { 1519 if tracing.IsEnabled() { 1520 ctx = tracing.StartSpan(ctx, fqdn+"/APIVersionSetCollectionIterator.NextWithContext") 1521 defer func() { 1522 sc := -1 1523 if iter.Response().Response.Response != nil { 1524 sc = iter.Response().Response.Response.StatusCode 1525 } 1526 tracing.EndSpan(ctx, sc, err) 1527 }() 1528 } 1529 iter.i++ 1530 if iter.i < len(iter.page.Values()) { 1531 return nil 1532 } 1533 err = iter.page.NextWithContext(ctx) 1534 if err != nil { 1535 iter.i-- 1536 return err 1537 } 1538 iter.i = 0 1539 return nil 1540} 1541 1542// Next advances to the next value. If there was an error making 1543// the request the iterator does not advance and the error is returned. 1544// Deprecated: Use NextWithContext() instead. 1545func (iter *APIVersionSetCollectionIterator) Next() error { 1546 return iter.NextWithContext(context.Background()) 1547} 1548 1549// NotDone returns true if the enumeration should be started or is not yet complete. 1550func (iter APIVersionSetCollectionIterator) NotDone() bool { 1551 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 1552} 1553 1554// Response returns the raw server response from the last page request. 1555func (iter APIVersionSetCollectionIterator) Response() APIVersionSetCollection { 1556 return iter.page.Response() 1557} 1558 1559// Value returns the current value or a zero-initialized value if the 1560// iterator has advanced beyond the end of the collection. 1561func (iter APIVersionSetCollectionIterator) Value() APIVersionSetContract { 1562 if !iter.page.NotDone() { 1563 return APIVersionSetContract{} 1564 } 1565 return iter.page.Values()[iter.i] 1566} 1567 1568// Creates a new instance of the APIVersionSetCollectionIterator type. 1569func NewAPIVersionSetCollectionIterator(page APIVersionSetCollectionPage) APIVersionSetCollectionIterator { 1570 return APIVersionSetCollectionIterator{page: page} 1571} 1572 1573// IsEmpty returns true if the ListResult contains no values. 1574func (avsc APIVersionSetCollection) IsEmpty() bool { 1575 return avsc.Value == nil || len(*avsc.Value) == 0 1576} 1577 1578// hasNextLink returns true if the NextLink is not empty. 1579func (avsc APIVersionSetCollection) hasNextLink() bool { 1580 return avsc.NextLink != nil && len(*avsc.NextLink) != 0 1581} 1582 1583// aPIVersionSetCollectionPreparer prepares a request to retrieve the next set of results. 1584// It returns nil if no more results exist. 1585func (avsc APIVersionSetCollection) aPIVersionSetCollectionPreparer(ctx context.Context) (*http.Request, error) { 1586 if !avsc.hasNextLink() { 1587 return nil, nil 1588 } 1589 return autorest.Prepare((&http.Request{}).WithContext(ctx), 1590 autorest.AsJSON(), 1591 autorest.AsGet(), 1592 autorest.WithBaseURL(to.String(avsc.NextLink))) 1593} 1594 1595// APIVersionSetCollectionPage contains a page of APIVersionSetContract values. 1596type APIVersionSetCollectionPage struct { 1597 fn func(context.Context, APIVersionSetCollection) (APIVersionSetCollection, error) 1598 avsc APIVersionSetCollection 1599} 1600 1601// NextWithContext advances to the next page of values. If there was an error making 1602// the request the page does not advance and the error is returned. 1603func (page *APIVersionSetCollectionPage) NextWithContext(ctx context.Context) (err error) { 1604 if tracing.IsEnabled() { 1605 ctx = tracing.StartSpan(ctx, fqdn+"/APIVersionSetCollectionPage.NextWithContext") 1606 defer func() { 1607 sc := -1 1608 if page.Response().Response.Response != nil { 1609 sc = page.Response().Response.Response.StatusCode 1610 } 1611 tracing.EndSpan(ctx, sc, err) 1612 }() 1613 } 1614 for { 1615 next, err := page.fn(ctx, page.avsc) 1616 if err != nil { 1617 return err 1618 } 1619 page.avsc = next 1620 if !next.hasNextLink() || !next.IsEmpty() { 1621 break 1622 } 1623 } 1624 return nil 1625} 1626 1627// Next advances to the next page of values. If there was an error making 1628// the request the page does not advance and the error is returned. 1629// Deprecated: Use NextWithContext() instead. 1630func (page *APIVersionSetCollectionPage) Next() error { 1631 return page.NextWithContext(context.Background()) 1632} 1633 1634// NotDone returns true if the page enumeration should be started or is not yet complete. 1635func (page APIVersionSetCollectionPage) NotDone() bool { 1636 return !page.avsc.IsEmpty() 1637} 1638 1639// Response returns the raw server response from the last page request. 1640func (page APIVersionSetCollectionPage) Response() APIVersionSetCollection { 1641 return page.avsc 1642} 1643 1644// Values returns the slice of values for the current page or nil if there are no values. 1645func (page APIVersionSetCollectionPage) Values() []APIVersionSetContract { 1646 if page.avsc.IsEmpty() { 1647 return nil 1648 } 1649 return *page.avsc.Value 1650} 1651 1652// Creates a new instance of the APIVersionSetCollectionPage type. 1653func NewAPIVersionSetCollectionPage(cur APIVersionSetCollection, getNextPage func(context.Context, APIVersionSetCollection) (APIVersionSetCollection, error)) APIVersionSetCollectionPage { 1654 return APIVersionSetCollectionPage{ 1655 fn: getNextPage, 1656 avsc: cur, 1657 } 1658} 1659 1660// APIVersionSetContract api Version Set Contract details. 1661type APIVersionSetContract struct { 1662 autorest.Response `json:"-"` 1663 // APIVersionSetContractProperties - Api VersionSet contract properties. 1664 *APIVersionSetContractProperties `json:"properties,omitempty"` 1665 // ID - READ-ONLY; Resource ID. 1666 ID *string `json:"id,omitempty"` 1667 // Name - READ-ONLY; Resource name. 1668 Name *string `json:"name,omitempty"` 1669 // Type - READ-ONLY; Resource type for API Management resource. 1670 Type *string `json:"type,omitempty"` 1671} 1672 1673// MarshalJSON is the custom marshaler for APIVersionSetContract. 1674func (avsc APIVersionSetContract) MarshalJSON() ([]byte, error) { 1675 objectMap := make(map[string]interface{}) 1676 if avsc.APIVersionSetContractProperties != nil { 1677 objectMap["properties"] = avsc.APIVersionSetContractProperties 1678 } 1679 return json.Marshal(objectMap) 1680} 1681 1682// UnmarshalJSON is the custom unmarshaler for APIVersionSetContract struct. 1683func (avsc *APIVersionSetContract) UnmarshalJSON(body []byte) error { 1684 var m map[string]*json.RawMessage 1685 err := json.Unmarshal(body, &m) 1686 if err != nil { 1687 return err 1688 } 1689 for k, v := range m { 1690 switch k { 1691 case "properties": 1692 if v != nil { 1693 var APIVersionSetContractProperties APIVersionSetContractProperties 1694 err = json.Unmarshal(*v, &APIVersionSetContractProperties) 1695 if err != nil { 1696 return err 1697 } 1698 avsc.APIVersionSetContractProperties = &APIVersionSetContractProperties 1699 } 1700 case "id": 1701 if v != nil { 1702 var ID string 1703 err = json.Unmarshal(*v, &ID) 1704 if err != nil { 1705 return err 1706 } 1707 avsc.ID = &ID 1708 } 1709 case "name": 1710 if v != nil { 1711 var name string 1712 err = json.Unmarshal(*v, &name) 1713 if err != nil { 1714 return err 1715 } 1716 avsc.Name = &name 1717 } 1718 case "type": 1719 if v != nil { 1720 var typeVar string 1721 err = json.Unmarshal(*v, &typeVar) 1722 if err != nil { 1723 return err 1724 } 1725 avsc.Type = &typeVar 1726 } 1727 } 1728 } 1729 1730 return nil 1731} 1732 1733// APIVersionSetContractDetails an API Version Set contains the common configuration for a set of API 1734// Versions relating 1735type APIVersionSetContractDetails struct { 1736 // ID - Identifier for existing API Version Set. Omit this value to create a new Version Set. 1737 ID *string `json:"id,omitempty"` 1738 // Name - The display Name of the API Version Set. 1739 Name *string `json:"name,omitempty"` 1740 // Description - Description of API Version Set. 1741 Description *string `json:"description,omitempty"` 1742 // VersioningScheme - An value that determines where the API Version identifer will be located in a HTTP request. Possible values include: 'VersioningScheme1Segment', 'VersioningScheme1Query', 'VersioningScheme1Header' 1743 VersioningScheme VersioningScheme1 `json:"versioningScheme,omitempty"` 1744 // VersionQueryName - Name of query parameter that indicates the API Version if versioningScheme is set to `query`. 1745 VersionQueryName *string `json:"versionQueryName,omitempty"` 1746 // VersionHeaderName - Name of HTTP header parameter that indicates the API Version if versioningScheme is set to `header`. 1747 VersionHeaderName *string `json:"versionHeaderName,omitempty"` 1748} 1749 1750// APIVersionSetContractProperties properties of an API Version Set. 1751type APIVersionSetContractProperties struct { 1752 // DisplayName - Name of API Version Set 1753 DisplayName *string `json:"displayName,omitempty"` 1754 // VersioningScheme - An value that determines where the API Version identifer will be located in a HTTP request. Possible values include: 'VersioningSchemeSegment', 'VersioningSchemeQuery', 'VersioningSchemeHeader' 1755 VersioningScheme VersioningScheme `json:"versioningScheme,omitempty"` 1756 // Description - Description of API Version Set. 1757 Description *string `json:"description,omitempty"` 1758 // VersionQueryName - Name of query parameter that indicates the API Version if versioningScheme is set to `query`. 1759 VersionQueryName *string `json:"versionQueryName,omitempty"` 1760 // VersionHeaderName - Name of HTTP header parameter that indicates the API Version if versioningScheme is set to `header`. 1761 VersionHeaderName *string `json:"versionHeaderName,omitempty"` 1762} 1763 1764// APIVersionSetEntityBase api Version set base parameters 1765type APIVersionSetEntityBase struct { 1766 // Description - Description of API Version Set. 1767 Description *string `json:"description,omitempty"` 1768 // VersionQueryName - Name of query parameter that indicates the API Version if versioningScheme is set to `query`. 1769 VersionQueryName *string `json:"versionQueryName,omitempty"` 1770 // VersionHeaderName - Name of HTTP header parameter that indicates the API Version if versioningScheme is set to `header`. 1771 VersionHeaderName *string `json:"versionHeaderName,omitempty"` 1772} 1773 1774// APIVersionSetUpdateParameters parameters to update or create an Api Version Set Contract. 1775type APIVersionSetUpdateParameters struct { 1776 // APIVersionSetUpdateParametersProperties - Parameters to update or create an Api Version Set Contract. 1777 *APIVersionSetUpdateParametersProperties `json:"properties,omitempty"` 1778} 1779 1780// MarshalJSON is the custom marshaler for APIVersionSetUpdateParameters. 1781func (avsup APIVersionSetUpdateParameters) MarshalJSON() ([]byte, error) { 1782 objectMap := make(map[string]interface{}) 1783 if avsup.APIVersionSetUpdateParametersProperties != nil { 1784 objectMap["properties"] = avsup.APIVersionSetUpdateParametersProperties 1785 } 1786 return json.Marshal(objectMap) 1787} 1788 1789// UnmarshalJSON is the custom unmarshaler for APIVersionSetUpdateParameters struct. 1790func (avsup *APIVersionSetUpdateParameters) UnmarshalJSON(body []byte) error { 1791 var m map[string]*json.RawMessage 1792 err := json.Unmarshal(body, &m) 1793 if err != nil { 1794 return err 1795 } 1796 for k, v := range m { 1797 switch k { 1798 case "properties": 1799 if v != nil { 1800 var APIVersionSetUpdateParametersProperties APIVersionSetUpdateParametersProperties 1801 err = json.Unmarshal(*v, &APIVersionSetUpdateParametersProperties) 1802 if err != nil { 1803 return err 1804 } 1805 avsup.APIVersionSetUpdateParametersProperties = &APIVersionSetUpdateParametersProperties 1806 } 1807 } 1808 } 1809 1810 return nil 1811} 1812 1813// APIVersionSetUpdateParametersProperties properties used to create or update an API Version Set. 1814type APIVersionSetUpdateParametersProperties struct { 1815 // DisplayName - Name of API Version Set 1816 DisplayName *string `json:"displayName,omitempty"` 1817 // VersioningScheme - An value that determines where the API Version identifer will be located in a HTTP request. Possible values include: 'VersioningSchemeSegment', 'VersioningSchemeQuery', 'VersioningSchemeHeader' 1818 VersioningScheme VersioningScheme `json:"versioningScheme,omitempty"` 1819 // Description - Description of API Version Set. 1820 Description *string `json:"description,omitempty"` 1821 // VersionQueryName - Name of query parameter that indicates the API Version if versioningScheme is set to `query`. 1822 VersionQueryName *string `json:"versionQueryName,omitempty"` 1823 // VersionHeaderName - Name of HTTP header parameter that indicates the API Version if versioningScheme is set to `header`. 1824 VersionHeaderName *string `json:"versionHeaderName,omitempty"` 1825} 1826 1827// AssociationContract association entity details. 1828type AssociationContract struct { 1829 // AssociationContractProperties - Association entity contract properties. 1830 *AssociationContractProperties `json:"properties,omitempty"` 1831 // ID - READ-ONLY; Resource ID. 1832 ID *string `json:"id,omitempty"` 1833 // Name - READ-ONLY; Resource name. 1834 Name *string `json:"name,omitempty"` 1835 // Type - READ-ONLY; Resource type for API Management resource. 1836 Type *string `json:"type,omitempty"` 1837} 1838 1839// MarshalJSON is the custom marshaler for AssociationContract. 1840func (ac AssociationContract) MarshalJSON() ([]byte, error) { 1841 objectMap := make(map[string]interface{}) 1842 if ac.AssociationContractProperties != nil { 1843 objectMap["properties"] = ac.AssociationContractProperties 1844 } 1845 return json.Marshal(objectMap) 1846} 1847 1848// UnmarshalJSON is the custom unmarshaler for AssociationContract struct. 1849func (ac *AssociationContract) UnmarshalJSON(body []byte) error { 1850 var m map[string]*json.RawMessage 1851 err := json.Unmarshal(body, &m) 1852 if err != nil { 1853 return err 1854 } 1855 for k, v := range m { 1856 switch k { 1857 case "properties": 1858 if v != nil { 1859 var associationContractProperties AssociationContractProperties 1860 err = json.Unmarshal(*v, &associationContractProperties) 1861 if err != nil { 1862 return err 1863 } 1864 ac.AssociationContractProperties = &associationContractProperties 1865 } 1866 case "id": 1867 if v != nil { 1868 var ID string 1869 err = json.Unmarshal(*v, &ID) 1870 if err != nil { 1871 return err 1872 } 1873 ac.ID = &ID 1874 } 1875 case "name": 1876 if v != nil { 1877 var name string 1878 err = json.Unmarshal(*v, &name) 1879 if err != nil { 1880 return err 1881 } 1882 ac.Name = &name 1883 } 1884 case "type": 1885 if v != nil { 1886 var typeVar string 1887 err = json.Unmarshal(*v, &typeVar) 1888 if err != nil { 1889 return err 1890 } 1891 ac.Type = &typeVar 1892 } 1893 } 1894 } 1895 1896 return nil 1897} 1898 1899// AssociationContractProperties association entity contract properties. 1900type AssociationContractProperties struct { 1901 // ProvisioningState - Provisioning state. Possible values include: 'Created' 1902 ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` 1903} 1904 1905// AuthenticationSettingsContract API Authentication Settings. 1906type AuthenticationSettingsContract struct { 1907 // OAuth2 - OAuth2 Authentication settings 1908 OAuth2 *OAuth2AuthenticationSettingsContract `json:"oAuth2,omitempty"` 1909 // Openid - OpenID Connect Authentication Settings 1910 Openid *OpenIDAuthenticationSettingsContract `json:"openid,omitempty"` 1911} 1912 1913// AuthorizationServerCollection paged OAuth2 Authorization Servers list representation. 1914type AuthorizationServerCollection struct { 1915 autorest.Response `json:"-"` 1916 // Value - Page values. 1917 Value *[]AuthorizationServerContract `json:"value,omitempty"` 1918 // Count - Total record count number across all pages. 1919 Count *int64 `json:"count,omitempty"` 1920 // NextLink - Next page link if any. 1921 NextLink *string `json:"nextLink,omitempty"` 1922} 1923 1924// AuthorizationServerCollectionIterator provides access to a complete listing of 1925// AuthorizationServerContract values. 1926type AuthorizationServerCollectionIterator struct { 1927 i int 1928 page AuthorizationServerCollectionPage 1929} 1930 1931// NextWithContext advances to the next value. If there was an error making 1932// the request the iterator does not advance and the error is returned. 1933func (iter *AuthorizationServerCollectionIterator) NextWithContext(ctx context.Context) (err error) { 1934 if tracing.IsEnabled() { 1935 ctx = tracing.StartSpan(ctx, fqdn+"/AuthorizationServerCollectionIterator.NextWithContext") 1936 defer func() { 1937 sc := -1 1938 if iter.Response().Response.Response != nil { 1939 sc = iter.Response().Response.Response.StatusCode 1940 } 1941 tracing.EndSpan(ctx, sc, err) 1942 }() 1943 } 1944 iter.i++ 1945 if iter.i < len(iter.page.Values()) { 1946 return nil 1947 } 1948 err = iter.page.NextWithContext(ctx) 1949 if err != nil { 1950 iter.i-- 1951 return err 1952 } 1953 iter.i = 0 1954 return nil 1955} 1956 1957// Next advances to the next value. If there was an error making 1958// the request the iterator does not advance and the error is returned. 1959// Deprecated: Use NextWithContext() instead. 1960func (iter *AuthorizationServerCollectionIterator) Next() error { 1961 return iter.NextWithContext(context.Background()) 1962} 1963 1964// NotDone returns true if the enumeration should be started or is not yet complete. 1965func (iter AuthorizationServerCollectionIterator) NotDone() bool { 1966 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 1967} 1968 1969// Response returns the raw server response from the last page request. 1970func (iter AuthorizationServerCollectionIterator) Response() AuthorizationServerCollection { 1971 return iter.page.Response() 1972} 1973 1974// Value returns the current value or a zero-initialized value if the 1975// iterator has advanced beyond the end of the collection. 1976func (iter AuthorizationServerCollectionIterator) Value() AuthorizationServerContract { 1977 if !iter.page.NotDone() { 1978 return AuthorizationServerContract{} 1979 } 1980 return iter.page.Values()[iter.i] 1981} 1982 1983// Creates a new instance of the AuthorizationServerCollectionIterator type. 1984func NewAuthorizationServerCollectionIterator(page AuthorizationServerCollectionPage) AuthorizationServerCollectionIterator { 1985 return AuthorizationServerCollectionIterator{page: page} 1986} 1987 1988// IsEmpty returns true if the ListResult contains no values. 1989func (asc AuthorizationServerCollection) IsEmpty() bool { 1990 return asc.Value == nil || len(*asc.Value) == 0 1991} 1992 1993// hasNextLink returns true if the NextLink is not empty. 1994func (asc AuthorizationServerCollection) hasNextLink() bool { 1995 return asc.NextLink != nil && len(*asc.NextLink) != 0 1996} 1997 1998// authorizationServerCollectionPreparer prepares a request to retrieve the next set of results. 1999// It returns nil if no more results exist. 2000func (asc AuthorizationServerCollection) authorizationServerCollectionPreparer(ctx context.Context) (*http.Request, error) { 2001 if !asc.hasNextLink() { 2002 return nil, nil 2003 } 2004 return autorest.Prepare((&http.Request{}).WithContext(ctx), 2005 autorest.AsJSON(), 2006 autorest.AsGet(), 2007 autorest.WithBaseURL(to.String(asc.NextLink))) 2008} 2009 2010// AuthorizationServerCollectionPage contains a page of AuthorizationServerContract values. 2011type AuthorizationServerCollectionPage struct { 2012 fn func(context.Context, AuthorizationServerCollection) (AuthorizationServerCollection, error) 2013 asc AuthorizationServerCollection 2014} 2015 2016// NextWithContext advances to the next page of values. If there was an error making 2017// the request the page does not advance and the error is returned. 2018func (page *AuthorizationServerCollectionPage) NextWithContext(ctx context.Context) (err error) { 2019 if tracing.IsEnabled() { 2020 ctx = tracing.StartSpan(ctx, fqdn+"/AuthorizationServerCollectionPage.NextWithContext") 2021 defer func() { 2022 sc := -1 2023 if page.Response().Response.Response != nil { 2024 sc = page.Response().Response.Response.StatusCode 2025 } 2026 tracing.EndSpan(ctx, sc, err) 2027 }() 2028 } 2029 for { 2030 next, err := page.fn(ctx, page.asc) 2031 if err != nil { 2032 return err 2033 } 2034 page.asc = next 2035 if !next.hasNextLink() || !next.IsEmpty() { 2036 break 2037 } 2038 } 2039 return nil 2040} 2041 2042// Next advances to the next page of values. If there was an error making 2043// the request the page does not advance and the error is returned. 2044// Deprecated: Use NextWithContext() instead. 2045func (page *AuthorizationServerCollectionPage) Next() error { 2046 return page.NextWithContext(context.Background()) 2047} 2048 2049// NotDone returns true if the page enumeration should be started or is not yet complete. 2050func (page AuthorizationServerCollectionPage) NotDone() bool { 2051 return !page.asc.IsEmpty() 2052} 2053 2054// Response returns the raw server response from the last page request. 2055func (page AuthorizationServerCollectionPage) Response() AuthorizationServerCollection { 2056 return page.asc 2057} 2058 2059// Values returns the slice of values for the current page or nil if there are no values. 2060func (page AuthorizationServerCollectionPage) Values() []AuthorizationServerContract { 2061 if page.asc.IsEmpty() { 2062 return nil 2063 } 2064 return *page.asc.Value 2065} 2066 2067// Creates a new instance of the AuthorizationServerCollectionPage type. 2068func NewAuthorizationServerCollectionPage(cur AuthorizationServerCollection, getNextPage func(context.Context, AuthorizationServerCollection) (AuthorizationServerCollection, error)) AuthorizationServerCollectionPage { 2069 return AuthorizationServerCollectionPage{ 2070 fn: getNextPage, 2071 asc: cur, 2072 } 2073} 2074 2075// AuthorizationServerContract external OAuth authorization server settings. 2076type AuthorizationServerContract struct { 2077 autorest.Response `json:"-"` 2078 // AuthorizationServerContractProperties - Properties of the External OAuth authorization server Contract. 2079 *AuthorizationServerContractProperties `json:"properties,omitempty"` 2080 // ID - READ-ONLY; Resource ID. 2081 ID *string `json:"id,omitempty"` 2082 // Name - READ-ONLY; Resource name. 2083 Name *string `json:"name,omitempty"` 2084 // Type - READ-ONLY; Resource type for API Management resource. 2085 Type *string `json:"type,omitempty"` 2086} 2087 2088// MarshalJSON is the custom marshaler for AuthorizationServerContract. 2089func (asc AuthorizationServerContract) MarshalJSON() ([]byte, error) { 2090 objectMap := make(map[string]interface{}) 2091 if asc.AuthorizationServerContractProperties != nil { 2092 objectMap["properties"] = asc.AuthorizationServerContractProperties 2093 } 2094 return json.Marshal(objectMap) 2095} 2096 2097// UnmarshalJSON is the custom unmarshaler for AuthorizationServerContract struct. 2098func (asc *AuthorizationServerContract) UnmarshalJSON(body []byte) error { 2099 var m map[string]*json.RawMessage 2100 err := json.Unmarshal(body, &m) 2101 if err != nil { 2102 return err 2103 } 2104 for k, v := range m { 2105 switch k { 2106 case "properties": 2107 if v != nil { 2108 var authorizationServerContractProperties AuthorizationServerContractProperties 2109 err = json.Unmarshal(*v, &authorizationServerContractProperties) 2110 if err != nil { 2111 return err 2112 } 2113 asc.AuthorizationServerContractProperties = &authorizationServerContractProperties 2114 } 2115 case "id": 2116 if v != nil { 2117 var ID string 2118 err = json.Unmarshal(*v, &ID) 2119 if err != nil { 2120 return err 2121 } 2122 asc.ID = &ID 2123 } 2124 case "name": 2125 if v != nil { 2126 var name string 2127 err = json.Unmarshal(*v, &name) 2128 if err != nil { 2129 return err 2130 } 2131 asc.Name = &name 2132 } 2133 case "type": 2134 if v != nil { 2135 var typeVar string 2136 err = json.Unmarshal(*v, &typeVar) 2137 if err != nil { 2138 return err 2139 } 2140 asc.Type = &typeVar 2141 } 2142 } 2143 } 2144 2145 return nil 2146} 2147 2148// AuthorizationServerContractBaseProperties external OAuth authorization server Update settings contract. 2149type AuthorizationServerContractBaseProperties struct { 2150 // Description - Description of the authorization server. Can contain HTML formatting tags. 2151 Description *string `json:"description,omitempty"` 2152 // AuthorizationMethods - HTTP verbs supported by the authorization endpoint. GET must be always present. POST is optional. 2153 AuthorizationMethods *[]AuthorizationMethod `json:"authorizationMethods,omitempty"` 2154 // 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. 2155 ClientAuthenticationMethod *[]ClientAuthenticationMethod `json:"clientAuthenticationMethod,omitempty"` 2156 // 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"}. 2157 TokenBodyParameters *[]TokenBodyParameterContract `json:"tokenBodyParameters,omitempty"` 2158 // TokenEndpoint - OAuth token endpoint. Contains absolute URI to entity being referenced. 2159 TokenEndpoint *string `json:"tokenEndpoint,omitempty"` 2160 // 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. 2161 SupportState *bool `json:"supportState,omitempty"` 2162 // 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. 2163 DefaultScope *string `json:"defaultScope,omitempty"` 2164 // BearerTokenSendingMethods - Specifies the mechanism by which access token is passed to the API. 2165 BearerTokenSendingMethods *[]BearerTokenSendingMethod `json:"bearerTokenSendingMethods,omitempty"` 2166 // ResourceOwnerUsername - Can be optionally specified when resource owner password grant type is supported by this authorization server. Default resource owner username. 2167 ResourceOwnerUsername *string `json:"resourceOwnerUsername,omitempty"` 2168 // ResourceOwnerPassword - Can be optionally specified when resource owner password grant type is supported by this authorization server. Default resource owner password. 2169 ResourceOwnerPassword *string `json:"resourceOwnerPassword,omitempty"` 2170} 2171 2172// AuthorizationServerContractProperties external OAuth authorization server settings Properties. 2173type AuthorizationServerContractProperties struct { 2174 // DisplayName - User-friendly authorization server name. 2175 DisplayName *string `json:"displayName,omitempty"` 2176 // ClientRegistrationEndpoint - Optional reference to a page where client or app registration for this authorization server is performed. Contains absolute URL to entity being referenced. 2177 ClientRegistrationEndpoint *string `json:"clientRegistrationEndpoint,omitempty"` 2178 // AuthorizationEndpoint - OAuth authorization endpoint. See http://tools.ietf.org/html/rfc6749#section-3.2. 2179 AuthorizationEndpoint *string `json:"authorizationEndpoint,omitempty"` 2180 // GrantTypes - Form of an authorization grant, which the client uses to request the access token. 2181 GrantTypes *[]GrantType `json:"grantTypes,omitempty"` 2182 // ClientID - Client or app id registered with this authorization server. 2183 ClientID *string `json:"clientId,omitempty"` 2184 // ClientSecret - Client or app secret registered with this authorization server. This property will not be filled on 'GET' operations! Use '/listSecrets' POST request to get the value. 2185 ClientSecret *string `json:"clientSecret,omitempty"` 2186 // Description - Description of the authorization server. Can contain HTML formatting tags. 2187 Description *string `json:"description,omitempty"` 2188 // AuthorizationMethods - HTTP verbs supported by the authorization endpoint. GET must be always present. POST is optional. 2189 AuthorizationMethods *[]AuthorizationMethod `json:"authorizationMethods,omitempty"` 2190 // 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. 2191 ClientAuthenticationMethod *[]ClientAuthenticationMethod `json:"clientAuthenticationMethod,omitempty"` 2192 // 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"}. 2193 TokenBodyParameters *[]TokenBodyParameterContract `json:"tokenBodyParameters,omitempty"` 2194 // TokenEndpoint - OAuth token endpoint. Contains absolute URI to entity being referenced. 2195 TokenEndpoint *string `json:"tokenEndpoint,omitempty"` 2196 // 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. 2197 SupportState *bool `json:"supportState,omitempty"` 2198 // 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. 2199 DefaultScope *string `json:"defaultScope,omitempty"` 2200 // BearerTokenSendingMethods - Specifies the mechanism by which access token is passed to the API. 2201 BearerTokenSendingMethods *[]BearerTokenSendingMethod `json:"bearerTokenSendingMethods,omitempty"` 2202 // ResourceOwnerUsername - Can be optionally specified when resource owner password grant type is supported by this authorization server. Default resource owner username. 2203 ResourceOwnerUsername *string `json:"resourceOwnerUsername,omitempty"` 2204 // ResourceOwnerPassword - Can be optionally specified when resource owner password grant type is supported by this authorization server. Default resource owner password. 2205 ResourceOwnerPassword *string `json:"resourceOwnerPassword,omitempty"` 2206} 2207 2208// AuthorizationServerUpdateContract external OAuth authorization server settings. 2209type AuthorizationServerUpdateContract struct { 2210 // AuthorizationServerUpdateContractProperties - Properties of the External OAuth authorization server update Contract. 2211 *AuthorizationServerUpdateContractProperties `json:"properties,omitempty"` 2212 // ID - READ-ONLY; Resource ID. 2213 ID *string `json:"id,omitempty"` 2214 // Name - READ-ONLY; Resource name. 2215 Name *string `json:"name,omitempty"` 2216 // Type - READ-ONLY; Resource type for API Management resource. 2217 Type *string `json:"type,omitempty"` 2218} 2219 2220// MarshalJSON is the custom marshaler for AuthorizationServerUpdateContract. 2221func (asuc AuthorizationServerUpdateContract) MarshalJSON() ([]byte, error) { 2222 objectMap := make(map[string]interface{}) 2223 if asuc.AuthorizationServerUpdateContractProperties != nil { 2224 objectMap["properties"] = asuc.AuthorizationServerUpdateContractProperties 2225 } 2226 return json.Marshal(objectMap) 2227} 2228 2229// UnmarshalJSON is the custom unmarshaler for AuthorizationServerUpdateContract struct. 2230func (asuc *AuthorizationServerUpdateContract) UnmarshalJSON(body []byte) error { 2231 var m map[string]*json.RawMessage 2232 err := json.Unmarshal(body, &m) 2233 if err != nil { 2234 return err 2235 } 2236 for k, v := range m { 2237 switch k { 2238 case "properties": 2239 if v != nil { 2240 var authorizationServerUpdateContractProperties AuthorizationServerUpdateContractProperties 2241 err = json.Unmarshal(*v, &authorizationServerUpdateContractProperties) 2242 if err != nil { 2243 return err 2244 } 2245 asuc.AuthorizationServerUpdateContractProperties = &authorizationServerUpdateContractProperties 2246 } 2247 case "id": 2248 if v != nil { 2249 var ID string 2250 err = json.Unmarshal(*v, &ID) 2251 if err != nil { 2252 return err 2253 } 2254 asuc.ID = &ID 2255 } 2256 case "name": 2257 if v != nil { 2258 var name string 2259 err = json.Unmarshal(*v, &name) 2260 if err != nil { 2261 return err 2262 } 2263 asuc.Name = &name 2264 } 2265 case "type": 2266 if v != nil { 2267 var typeVar string 2268 err = json.Unmarshal(*v, &typeVar) 2269 if err != nil { 2270 return err 2271 } 2272 asuc.Type = &typeVar 2273 } 2274 } 2275 } 2276 2277 return nil 2278} 2279 2280// AuthorizationServerUpdateContractProperties external OAuth authorization server Update settings 2281// contract. 2282type AuthorizationServerUpdateContractProperties struct { 2283 // DisplayName - User-friendly authorization server name. 2284 DisplayName *string `json:"displayName,omitempty"` 2285 // ClientRegistrationEndpoint - Optional reference to a page where client or app registration for this authorization server is performed. Contains absolute URL to entity being referenced. 2286 ClientRegistrationEndpoint *string `json:"clientRegistrationEndpoint,omitempty"` 2287 // AuthorizationEndpoint - OAuth authorization endpoint. See http://tools.ietf.org/html/rfc6749#section-3.2. 2288 AuthorizationEndpoint *string `json:"authorizationEndpoint,omitempty"` 2289 // GrantTypes - Form of an authorization grant, which the client uses to request the access token. 2290 GrantTypes *[]GrantType `json:"grantTypes,omitempty"` 2291 // ClientID - Client or app id registered with this authorization server. 2292 ClientID *string `json:"clientId,omitempty"` 2293 // ClientSecret - Client or app secret registered with this authorization server. This property will not be filled on 'GET' operations! Use '/listSecrets' POST request to get the value. 2294 ClientSecret *string `json:"clientSecret,omitempty"` 2295 // Description - Description of the authorization server. Can contain HTML formatting tags. 2296 Description *string `json:"description,omitempty"` 2297 // AuthorizationMethods - HTTP verbs supported by the authorization endpoint. GET must be always present. POST is optional. 2298 AuthorizationMethods *[]AuthorizationMethod `json:"authorizationMethods,omitempty"` 2299 // 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. 2300 ClientAuthenticationMethod *[]ClientAuthenticationMethod `json:"clientAuthenticationMethod,omitempty"` 2301 // 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"}. 2302 TokenBodyParameters *[]TokenBodyParameterContract `json:"tokenBodyParameters,omitempty"` 2303 // TokenEndpoint - OAuth token endpoint. Contains absolute URI to entity being referenced. 2304 TokenEndpoint *string `json:"tokenEndpoint,omitempty"` 2305 // 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. 2306 SupportState *bool `json:"supportState,omitempty"` 2307 // 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. 2308 DefaultScope *string `json:"defaultScope,omitempty"` 2309 // BearerTokenSendingMethods - Specifies the mechanism by which access token is passed to the API. 2310 BearerTokenSendingMethods *[]BearerTokenSendingMethod `json:"bearerTokenSendingMethods,omitempty"` 2311 // ResourceOwnerUsername - Can be optionally specified when resource owner password grant type is supported by this authorization server. Default resource owner username. 2312 ResourceOwnerUsername *string `json:"resourceOwnerUsername,omitempty"` 2313 // ResourceOwnerPassword - Can be optionally specified when resource owner password grant type is supported by this authorization server. Default resource owner password. 2314 ResourceOwnerPassword *string `json:"resourceOwnerPassword,omitempty"` 2315} 2316 2317// BackendAuthorizationHeaderCredentials authorization header information. 2318type BackendAuthorizationHeaderCredentials struct { 2319 // Scheme - Authentication Scheme name. 2320 Scheme *string `json:"scheme,omitempty"` 2321 // Parameter - Authentication Parameter value. 2322 Parameter *string `json:"parameter,omitempty"` 2323} 2324 2325// BackendBaseParameters backend entity base Parameter set. 2326type BackendBaseParameters struct { 2327 // Title - Backend Title. 2328 Title *string `json:"title,omitempty"` 2329 // Description - Backend Description. 2330 Description *string `json:"description,omitempty"` 2331 // 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. 2332 ResourceID *string `json:"resourceId,omitempty"` 2333 // Properties - Backend Properties contract 2334 Properties *BackendProperties `json:"properties,omitempty"` 2335 // Credentials - Backend Credentials Contract Properties 2336 Credentials *BackendCredentialsContract `json:"credentials,omitempty"` 2337 // Proxy - Backend Proxy Contract Properties 2338 Proxy *BackendProxyContract `json:"proxy,omitempty"` 2339 // TLS - Backend TLS Properties 2340 TLS *BackendTLSProperties `json:"tls,omitempty"` 2341} 2342 2343// BackendCollection paged Backend list representation. 2344type BackendCollection struct { 2345 autorest.Response `json:"-"` 2346 // Value - Backend values. 2347 Value *[]BackendContract `json:"value,omitempty"` 2348 // NextLink - Next page link if any. 2349 NextLink *string `json:"nextLink,omitempty"` 2350} 2351 2352// BackendCollectionIterator provides access to a complete listing of BackendContract values. 2353type BackendCollectionIterator struct { 2354 i int 2355 page BackendCollectionPage 2356} 2357 2358// NextWithContext advances to the next value. If there was an error making 2359// the request the iterator does not advance and the error is returned. 2360func (iter *BackendCollectionIterator) NextWithContext(ctx context.Context) (err error) { 2361 if tracing.IsEnabled() { 2362 ctx = tracing.StartSpan(ctx, fqdn+"/BackendCollectionIterator.NextWithContext") 2363 defer func() { 2364 sc := -1 2365 if iter.Response().Response.Response != nil { 2366 sc = iter.Response().Response.Response.StatusCode 2367 } 2368 tracing.EndSpan(ctx, sc, err) 2369 }() 2370 } 2371 iter.i++ 2372 if iter.i < len(iter.page.Values()) { 2373 return nil 2374 } 2375 err = iter.page.NextWithContext(ctx) 2376 if err != nil { 2377 iter.i-- 2378 return err 2379 } 2380 iter.i = 0 2381 return nil 2382} 2383 2384// Next advances to the next value. If there was an error making 2385// the request the iterator does not advance and the error is returned. 2386// Deprecated: Use NextWithContext() instead. 2387func (iter *BackendCollectionIterator) Next() error { 2388 return iter.NextWithContext(context.Background()) 2389} 2390 2391// NotDone returns true if the enumeration should be started or is not yet complete. 2392func (iter BackendCollectionIterator) NotDone() bool { 2393 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 2394} 2395 2396// Response returns the raw server response from the last page request. 2397func (iter BackendCollectionIterator) Response() BackendCollection { 2398 return iter.page.Response() 2399} 2400 2401// Value returns the current value or a zero-initialized value if the 2402// iterator has advanced beyond the end of the collection. 2403func (iter BackendCollectionIterator) Value() BackendContract { 2404 if !iter.page.NotDone() { 2405 return BackendContract{} 2406 } 2407 return iter.page.Values()[iter.i] 2408} 2409 2410// Creates a new instance of the BackendCollectionIterator type. 2411func NewBackendCollectionIterator(page BackendCollectionPage) BackendCollectionIterator { 2412 return BackendCollectionIterator{page: page} 2413} 2414 2415// IsEmpty returns true if the ListResult contains no values. 2416func (bc BackendCollection) IsEmpty() bool { 2417 return bc.Value == nil || len(*bc.Value) == 0 2418} 2419 2420// hasNextLink returns true if the NextLink is not empty. 2421func (bc BackendCollection) hasNextLink() bool { 2422 return bc.NextLink != nil && len(*bc.NextLink) != 0 2423} 2424 2425// backendCollectionPreparer prepares a request to retrieve the next set of results. 2426// It returns nil if no more results exist. 2427func (bc BackendCollection) backendCollectionPreparer(ctx context.Context) (*http.Request, error) { 2428 if !bc.hasNextLink() { 2429 return nil, nil 2430 } 2431 return autorest.Prepare((&http.Request{}).WithContext(ctx), 2432 autorest.AsJSON(), 2433 autorest.AsGet(), 2434 autorest.WithBaseURL(to.String(bc.NextLink))) 2435} 2436 2437// BackendCollectionPage contains a page of BackendContract values. 2438type BackendCollectionPage struct { 2439 fn func(context.Context, BackendCollection) (BackendCollection, error) 2440 bc BackendCollection 2441} 2442 2443// NextWithContext advances to the next page of values. If there was an error making 2444// the request the page does not advance and the error is returned. 2445func (page *BackendCollectionPage) NextWithContext(ctx context.Context) (err error) { 2446 if tracing.IsEnabled() { 2447 ctx = tracing.StartSpan(ctx, fqdn+"/BackendCollectionPage.NextWithContext") 2448 defer func() { 2449 sc := -1 2450 if page.Response().Response.Response != nil { 2451 sc = page.Response().Response.Response.StatusCode 2452 } 2453 tracing.EndSpan(ctx, sc, err) 2454 }() 2455 } 2456 for { 2457 next, err := page.fn(ctx, page.bc) 2458 if err != nil { 2459 return err 2460 } 2461 page.bc = next 2462 if !next.hasNextLink() || !next.IsEmpty() { 2463 break 2464 } 2465 } 2466 return nil 2467} 2468 2469// Next advances to the next page of values. If there was an error making 2470// the request the page does not advance and the error is returned. 2471// Deprecated: Use NextWithContext() instead. 2472func (page *BackendCollectionPage) Next() error { 2473 return page.NextWithContext(context.Background()) 2474} 2475 2476// NotDone returns true if the page enumeration should be started or is not yet complete. 2477func (page BackendCollectionPage) NotDone() bool { 2478 return !page.bc.IsEmpty() 2479} 2480 2481// Response returns the raw server response from the last page request. 2482func (page BackendCollectionPage) Response() BackendCollection { 2483 return page.bc 2484} 2485 2486// Values returns the slice of values for the current page or nil if there are no values. 2487func (page BackendCollectionPage) Values() []BackendContract { 2488 if page.bc.IsEmpty() { 2489 return nil 2490 } 2491 return *page.bc.Value 2492} 2493 2494// Creates a new instance of the BackendCollectionPage type. 2495func NewBackendCollectionPage(cur BackendCollection, getNextPage func(context.Context, BackendCollection) (BackendCollection, error)) BackendCollectionPage { 2496 return BackendCollectionPage{ 2497 fn: getNextPage, 2498 bc: cur, 2499 } 2500} 2501 2502// BackendContract backend details. 2503type BackendContract struct { 2504 autorest.Response `json:"-"` 2505 // BackendContractProperties - Backend entity contract properties. 2506 *BackendContractProperties `json:"properties,omitempty"` 2507 // ID - READ-ONLY; Resource ID. 2508 ID *string `json:"id,omitempty"` 2509 // Name - READ-ONLY; Resource name. 2510 Name *string `json:"name,omitempty"` 2511 // Type - READ-ONLY; Resource type for API Management resource. 2512 Type *string `json:"type,omitempty"` 2513} 2514 2515// MarshalJSON is the custom marshaler for BackendContract. 2516func (bc BackendContract) MarshalJSON() ([]byte, error) { 2517 objectMap := make(map[string]interface{}) 2518 if bc.BackendContractProperties != nil { 2519 objectMap["properties"] = bc.BackendContractProperties 2520 } 2521 return json.Marshal(objectMap) 2522} 2523 2524// UnmarshalJSON is the custom unmarshaler for BackendContract struct. 2525func (bc *BackendContract) UnmarshalJSON(body []byte) error { 2526 var m map[string]*json.RawMessage 2527 err := json.Unmarshal(body, &m) 2528 if err != nil { 2529 return err 2530 } 2531 for k, v := range m { 2532 switch k { 2533 case "properties": 2534 if v != nil { 2535 var backendContractProperties BackendContractProperties 2536 err = json.Unmarshal(*v, &backendContractProperties) 2537 if err != nil { 2538 return err 2539 } 2540 bc.BackendContractProperties = &backendContractProperties 2541 } 2542 case "id": 2543 if v != nil { 2544 var ID string 2545 err = json.Unmarshal(*v, &ID) 2546 if err != nil { 2547 return err 2548 } 2549 bc.ID = &ID 2550 } 2551 case "name": 2552 if v != nil { 2553 var name string 2554 err = json.Unmarshal(*v, &name) 2555 if err != nil { 2556 return err 2557 } 2558 bc.Name = &name 2559 } 2560 case "type": 2561 if v != nil { 2562 var typeVar string 2563 err = json.Unmarshal(*v, &typeVar) 2564 if err != nil { 2565 return err 2566 } 2567 bc.Type = &typeVar 2568 } 2569 } 2570 } 2571 2572 return nil 2573} 2574 2575// BackendContractProperties parameters supplied to the Create Backend operation. 2576type BackendContractProperties struct { 2577 // URL - Runtime Url of the Backend. 2578 URL *string `json:"url,omitempty"` 2579 // Protocol - Backend communication protocol. Possible values include: 'BackendProtocolHTTP', 'BackendProtocolSoap' 2580 Protocol BackendProtocol `json:"protocol,omitempty"` 2581 // Title - Backend Title. 2582 Title *string `json:"title,omitempty"` 2583 // Description - Backend Description. 2584 Description *string `json:"description,omitempty"` 2585 // 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. 2586 ResourceID *string `json:"resourceId,omitempty"` 2587 // Properties - Backend Properties contract 2588 Properties *BackendProperties `json:"properties,omitempty"` 2589 // Credentials - Backend Credentials Contract Properties 2590 Credentials *BackendCredentialsContract `json:"credentials,omitempty"` 2591 // Proxy - Backend Proxy Contract Properties 2592 Proxy *BackendProxyContract `json:"proxy,omitempty"` 2593 // TLS - Backend TLS Properties 2594 TLS *BackendTLSProperties `json:"tls,omitempty"` 2595} 2596 2597// BackendCredentialsContract details of the Credentials used to connect to Backend. 2598type BackendCredentialsContract struct { 2599 // Certificate - List of Client Certificate Thumbprint. 2600 Certificate *[]string `json:"certificate,omitempty"` 2601 // Query - Query Parameter description. 2602 Query map[string][]string `json:"query"` 2603 // Header - Header Parameter description. 2604 Header map[string][]string `json:"header"` 2605 // Authorization - Authorization header authentication 2606 Authorization *BackendAuthorizationHeaderCredentials `json:"authorization,omitempty"` 2607} 2608 2609// MarshalJSON is the custom marshaler for BackendCredentialsContract. 2610func (bcc BackendCredentialsContract) MarshalJSON() ([]byte, error) { 2611 objectMap := make(map[string]interface{}) 2612 if bcc.Certificate != nil { 2613 objectMap["certificate"] = bcc.Certificate 2614 } 2615 if bcc.Query != nil { 2616 objectMap["query"] = bcc.Query 2617 } 2618 if bcc.Header != nil { 2619 objectMap["header"] = bcc.Header 2620 } 2621 if bcc.Authorization != nil { 2622 objectMap["authorization"] = bcc.Authorization 2623 } 2624 return json.Marshal(objectMap) 2625} 2626 2627// BackendProperties properties specific to the Backend Type. 2628type BackendProperties struct { 2629 // ServiceFabricCluster - Backend Service Fabric Cluster Properties 2630 ServiceFabricCluster *BackendServiceFabricClusterProperties `json:"serviceFabricCluster,omitempty"` 2631} 2632 2633// BackendProxyContract details of the Backend WebProxy Server to use in the Request to Backend. 2634type BackendProxyContract struct { 2635 // URL - WebProxy Server AbsoluteUri property which includes the entire URI stored in the Uri instance, including all fragments and query strings. 2636 URL *string `json:"url,omitempty"` 2637 // Username - Username to connect to the WebProxy server 2638 Username *string `json:"username,omitempty"` 2639 // Password - Password to connect to the WebProxy Server 2640 Password *string `json:"password,omitempty"` 2641} 2642 2643// BackendReconnectContract reconnect request parameters. 2644type BackendReconnectContract struct { 2645 // BackendReconnectProperties - Reconnect request properties. 2646 *BackendReconnectProperties `json:"properties,omitempty"` 2647 // ID - READ-ONLY; Resource ID. 2648 ID *string `json:"id,omitempty"` 2649 // Name - READ-ONLY; Resource name. 2650 Name *string `json:"name,omitempty"` 2651 // Type - READ-ONLY; Resource type for API Management resource. 2652 Type *string `json:"type,omitempty"` 2653} 2654 2655// MarshalJSON is the custom marshaler for BackendReconnectContract. 2656func (brc BackendReconnectContract) MarshalJSON() ([]byte, error) { 2657 objectMap := make(map[string]interface{}) 2658 if brc.BackendReconnectProperties != nil { 2659 objectMap["properties"] = brc.BackendReconnectProperties 2660 } 2661 return json.Marshal(objectMap) 2662} 2663 2664// UnmarshalJSON is the custom unmarshaler for BackendReconnectContract struct. 2665func (brc *BackendReconnectContract) UnmarshalJSON(body []byte) error { 2666 var m map[string]*json.RawMessage 2667 err := json.Unmarshal(body, &m) 2668 if err != nil { 2669 return err 2670 } 2671 for k, v := range m { 2672 switch k { 2673 case "properties": 2674 if v != nil { 2675 var backendReconnectProperties BackendReconnectProperties 2676 err = json.Unmarshal(*v, &backendReconnectProperties) 2677 if err != nil { 2678 return err 2679 } 2680 brc.BackendReconnectProperties = &backendReconnectProperties 2681 } 2682 case "id": 2683 if v != nil { 2684 var ID string 2685 err = json.Unmarshal(*v, &ID) 2686 if err != nil { 2687 return err 2688 } 2689 brc.ID = &ID 2690 } 2691 case "name": 2692 if v != nil { 2693 var name string 2694 err = json.Unmarshal(*v, &name) 2695 if err != nil { 2696 return err 2697 } 2698 brc.Name = &name 2699 } 2700 case "type": 2701 if v != nil { 2702 var typeVar string 2703 err = json.Unmarshal(*v, &typeVar) 2704 if err != nil { 2705 return err 2706 } 2707 brc.Type = &typeVar 2708 } 2709 } 2710 } 2711 2712 return nil 2713} 2714 2715// BackendReconnectProperties properties to control reconnect requests. 2716type BackendReconnectProperties struct { 2717 // After - Duration in ISO8601 format after which reconnect will be initiated. Minimum duration of the Reconnect is PT2M. 2718 After *string `json:"after,omitempty"` 2719} 2720 2721// BackendServiceFabricClusterProperties properties of the Service Fabric Type Backend. 2722type BackendServiceFabricClusterProperties struct { 2723 // ClientCertificatethumbprint - The client certificate thumbprint for the management endpoint. 2724 ClientCertificatethumbprint *string `json:"clientCertificatethumbprint,omitempty"` 2725 // MaxPartitionResolutionRetries - Maximum number of retries while attempting resolve the partition. 2726 MaxPartitionResolutionRetries *int32 `json:"maxPartitionResolutionRetries,omitempty"` 2727 // ManagementEndpoints - The cluster management endpoint. 2728 ManagementEndpoints *[]string `json:"managementEndpoints,omitempty"` 2729 // ServerCertificateThumbprints - Thumbprints of certificates cluster management service uses for tls communication 2730 ServerCertificateThumbprints *[]string `json:"serverCertificateThumbprints,omitempty"` 2731 // ServerX509Names - Server X509 Certificate Names Collection 2732 ServerX509Names *[]X509CertificateName `json:"serverX509Names,omitempty"` 2733} 2734 2735// BackendTLSProperties properties controlling TLS Certificate Validation. 2736type BackendTLSProperties struct { 2737 // ValidateCertificateChain - Flag indicating whether SSL certificate chain validation should be done when using self-signed certificates for this backend host. 2738 ValidateCertificateChain *bool `json:"validateCertificateChain,omitempty"` 2739 // ValidateCertificateName - Flag indicating whether SSL certificate name validation should be done when using self-signed certificates for this backend host. 2740 ValidateCertificateName *bool `json:"validateCertificateName,omitempty"` 2741} 2742 2743// BackendUpdateParameterProperties parameters supplied to the Update Backend operation. 2744type BackendUpdateParameterProperties struct { 2745 // URL - Runtime Url of the Backend. 2746 URL *string `json:"url,omitempty"` 2747 // Protocol - Backend communication protocol. Possible values include: 'BackendProtocolHTTP', 'BackendProtocolSoap' 2748 Protocol BackendProtocol `json:"protocol,omitempty"` 2749 // Title - Backend Title. 2750 Title *string `json:"title,omitempty"` 2751 // Description - Backend Description. 2752 Description *string `json:"description,omitempty"` 2753 // 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. 2754 ResourceID *string `json:"resourceId,omitempty"` 2755 // Properties - Backend Properties contract 2756 Properties *BackendProperties `json:"properties,omitempty"` 2757 // Credentials - Backend Credentials Contract Properties 2758 Credentials *BackendCredentialsContract `json:"credentials,omitempty"` 2759 // Proxy - Backend Proxy Contract Properties 2760 Proxy *BackendProxyContract `json:"proxy,omitempty"` 2761 // TLS - Backend TLS Properties 2762 TLS *BackendTLSProperties `json:"tls,omitempty"` 2763} 2764 2765// BackendUpdateParameters backend update parameters. 2766type BackendUpdateParameters struct { 2767 // BackendUpdateParameterProperties - Backend entity update contract properties. 2768 *BackendUpdateParameterProperties `json:"properties,omitempty"` 2769} 2770 2771// MarshalJSON is the custom marshaler for BackendUpdateParameters. 2772func (bup BackendUpdateParameters) MarshalJSON() ([]byte, error) { 2773 objectMap := make(map[string]interface{}) 2774 if bup.BackendUpdateParameterProperties != nil { 2775 objectMap["properties"] = bup.BackendUpdateParameterProperties 2776 } 2777 return json.Marshal(objectMap) 2778} 2779 2780// UnmarshalJSON is the custom unmarshaler for BackendUpdateParameters struct. 2781func (bup *BackendUpdateParameters) UnmarshalJSON(body []byte) error { 2782 var m map[string]*json.RawMessage 2783 err := json.Unmarshal(body, &m) 2784 if err != nil { 2785 return err 2786 } 2787 for k, v := range m { 2788 switch k { 2789 case "properties": 2790 if v != nil { 2791 var backendUpdateParameterProperties BackendUpdateParameterProperties 2792 err = json.Unmarshal(*v, &backendUpdateParameterProperties) 2793 if err != nil { 2794 return err 2795 } 2796 bup.BackendUpdateParameterProperties = &backendUpdateParameterProperties 2797 } 2798 } 2799 } 2800 2801 return nil 2802} 2803 2804// BodyDiagnosticSettings body logging settings. 2805type BodyDiagnosticSettings struct { 2806 // Bytes - Number of request body bytes to log. 2807 Bytes *int32 `json:"bytes,omitempty"` 2808} 2809 2810// CacheCollection paged Caches list representation. 2811type CacheCollection struct { 2812 autorest.Response `json:"-"` 2813 // Value - Page values. 2814 Value *[]CacheContract `json:"value,omitempty"` 2815 // NextLink - Next page link if any. 2816 NextLink *string `json:"nextLink,omitempty"` 2817} 2818 2819// CacheCollectionIterator provides access to a complete listing of CacheContract values. 2820type CacheCollectionIterator struct { 2821 i int 2822 page CacheCollectionPage 2823} 2824 2825// NextWithContext advances to the next value. If there was an error making 2826// the request the iterator does not advance and the error is returned. 2827func (iter *CacheCollectionIterator) NextWithContext(ctx context.Context) (err error) { 2828 if tracing.IsEnabled() { 2829 ctx = tracing.StartSpan(ctx, fqdn+"/CacheCollectionIterator.NextWithContext") 2830 defer func() { 2831 sc := -1 2832 if iter.Response().Response.Response != nil { 2833 sc = iter.Response().Response.Response.StatusCode 2834 } 2835 tracing.EndSpan(ctx, sc, err) 2836 }() 2837 } 2838 iter.i++ 2839 if iter.i < len(iter.page.Values()) { 2840 return nil 2841 } 2842 err = iter.page.NextWithContext(ctx) 2843 if err != nil { 2844 iter.i-- 2845 return err 2846 } 2847 iter.i = 0 2848 return nil 2849} 2850 2851// Next advances to the next value. If there was an error making 2852// the request the iterator does not advance and the error is returned. 2853// Deprecated: Use NextWithContext() instead. 2854func (iter *CacheCollectionIterator) Next() error { 2855 return iter.NextWithContext(context.Background()) 2856} 2857 2858// NotDone returns true if the enumeration should be started or is not yet complete. 2859func (iter CacheCollectionIterator) NotDone() bool { 2860 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 2861} 2862 2863// Response returns the raw server response from the last page request. 2864func (iter CacheCollectionIterator) Response() CacheCollection { 2865 return iter.page.Response() 2866} 2867 2868// Value returns the current value or a zero-initialized value if the 2869// iterator has advanced beyond the end of the collection. 2870func (iter CacheCollectionIterator) Value() CacheContract { 2871 if !iter.page.NotDone() { 2872 return CacheContract{} 2873 } 2874 return iter.page.Values()[iter.i] 2875} 2876 2877// Creates a new instance of the CacheCollectionIterator type. 2878func NewCacheCollectionIterator(page CacheCollectionPage) CacheCollectionIterator { 2879 return CacheCollectionIterator{page: page} 2880} 2881 2882// IsEmpty returns true if the ListResult contains no values. 2883func (cc CacheCollection) IsEmpty() bool { 2884 return cc.Value == nil || len(*cc.Value) == 0 2885} 2886 2887// hasNextLink returns true if the NextLink is not empty. 2888func (cc CacheCollection) hasNextLink() bool { 2889 return cc.NextLink != nil && len(*cc.NextLink) != 0 2890} 2891 2892// cacheCollectionPreparer prepares a request to retrieve the next set of results. 2893// It returns nil if no more results exist. 2894func (cc CacheCollection) cacheCollectionPreparer(ctx context.Context) (*http.Request, error) { 2895 if !cc.hasNextLink() { 2896 return nil, nil 2897 } 2898 return autorest.Prepare((&http.Request{}).WithContext(ctx), 2899 autorest.AsJSON(), 2900 autorest.AsGet(), 2901 autorest.WithBaseURL(to.String(cc.NextLink))) 2902} 2903 2904// CacheCollectionPage contains a page of CacheContract values. 2905type CacheCollectionPage struct { 2906 fn func(context.Context, CacheCollection) (CacheCollection, error) 2907 cc CacheCollection 2908} 2909 2910// NextWithContext advances to the next page of values. If there was an error making 2911// the request the page does not advance and the error is returned. 2912func (page *CacheCollectionPage) NextWithContext(ctx context.Context) (err error) { 2913 if tracing.IsEnabled() { 2914 ctx = tracing.StartSpan(ctx, fqdn+"/CacheCollectionPage.NextWithContext") 2915 defer func() { 2916 sc := -1 2917 if page.Response().Response.Response != nil { 2918 sc = page.Response().Response.Response.StatusCode 2919 } 2920 tracing.EndSpan(ctx, sc, err) 2921 }() 2922 } 2923 for { 2924 next, err := page.fn(ctx, page.cc) 2925 if err != nil { 2926 return err 2927 } 2928 page.cc = next 2929 if !next.hasNextLink() || !next.IsEmpty() { 2930 break 2931 } 2932 } 2933 return nil 2934} 2935 2936// Next advances to the next page of values. If there was an error making 2937// the request the page does not advance and the error is returned. 2938// Deprecated: Use NextWithContext() instead. 2939func (page *CacheCollectionPage) Next() error { 2940 return page.NextWithContext(context.Background()) 2941} 2942 2943// NotDone returns true if the page enumeration should be started or is not yet complete. 2944func (page CacheCollectionPage) NotDone() bool { 2945 return !page.cc.IsEmpty() 2946} 2947 2948// Response returns the raw server response from the last page request. 2949func (page CacheCollectionPage) Response() CacheCollection { 2950 return page.cc 2951} 2952 2953// Values returns the slice of values for the current page or nil if there are no values. 2954func (page CacheCollectionPage) Values() []CacheContract { 2955 if page.cc.IsEmpty() { 2956 return nil 2957 } 2958 return *page.cc.Value 2959} 2960 2961// Creates a new instance of the CacheCollectionPage type. 2962func NewCacheCollectionPage(cur CacheCollection, getNextPage func(context.Context, CacheCollection) (CacheCollection, error)) CacheCollectionPage { 2963 return CacheCollectionPage{ 2964 fn: getNextPage, 2965 cc: cur, 2966 } 2967} 2968 2969// CacheContract cache details. 2970type CacheContract struct { 2971 autorest.Response `json:"-"` 2972 // CacheContractProperties - Cache properties details. 2973 *CacheContractProperties `json:"properties,omitempty"` 2974 // ID - READ-ONLY; Resource ID. 2975 ID *string `json:"id,omitempty"` 2976 // Name - READ-ONLY; Resource name. 2977 Name *string `json:"name,omitempty"` 2978 // Type - READ-ONLY; Resource type for API Management resource. 2979 Type *string `json:"type,omitempty"` 2980} 2981 2982// MarshalJSON is the custom marshaler for CacheContract. 2983func (cc CacheContract) MarshalJSON() ([]byte, error) { 2984 objectMap := make(map[string]interface{}) 2985 if cc.CacheContractProperties != nil { 2986 objectMap["properties"] = cc.CacheContractProperties 2987 } 2988 return json.Marshal(objectMap) 2989} 2990 2991// UnmarshalJSON is the custom unmarshaler for CacheContract struct. 2992func (cc *CacheContract) UnmarshalJSON(body []byte) error { 2993 var m map[string]*json.RawMessage 2994 err := json.Unmarshal(body, &m) 2995 if err != nil { 2996 return err 2997 } 2998 for k, v := range m { 2999 switch k { 3000 case "properties": 3001 if v != nil { 3002 var cacheContractProperties CacheContractProperties 3003 err = json.Unmarshal(*v, &cacheContractProperties) 3004 if err != nil { 3005 return err 3006 } 3007 cc.CacheContractProperties = &cacheContractProperties 3008 } 3009 case "id": 3010 if v != nil { 3011 var ID string 3012 err = json.Unmarshal(*v, &ID) 3013 if err != nil { 3014 return err 3015 } 3016 cc.ID = &ID 3017 } 3018 case "name": 3019 if v != nil { 3020 var name string 3021 err = json.Unmarshal(*v, &name) 3022 if err != nil { 3023 return err 3024 } 3025 cc.Name = &name 3026 } 3027 case "type": 3028 if v != nil { 3029 var typeVar string 3030 err = json.Unmarshal(*v, &typeVar) 3031 if err != nil { 3032 return err 3033 } 3034 cc.Type = &typeVar 3035 } 3036 } 3037 } 3038 3039 return nil 3040} 3041 3042// CacheContractProperties properties of the Cache contract. 3043type CacheContractProperties struct { 3044 // Description - Cache description 3045 Description *string `json:"description,omitempty"` 3046 // ConnectionString - Runtime connection string to cache 3047 ConnectionString *string `json:"connectionString,omitempty"` 3048 // ResourceID - Original uri of entity in external system cache points to 3049 ResourceID *string `json:"resourceId,omitempty"` 3050} 3051 3052// CacheUpdateParameters cache update details. 3053type CacheUpdateParameters struct { 3054 // CacheUpdateProperties - Cache update properties details. 3055 *CacheUpdateProperties `json:"properties,omitempty"` 3056} 3057 3058// MarshalJSON is the custom marshaler for CacheUpdateParameters. 3059func (cup CacheUpdateParameters) MarshalJSON() ([]byte, error) { 3060 objectMap := make(map[string]interface{}) 3061 if cup.CacheUpdateProperties != nil { 3062 objectMap["properties"] = cup.CacheUpdateProperties 3063 } 3064 return json.Marshal(objectMap) 3065} 3066 3067// UnmarshalJSON is the custom unmarshaler for CacheUpdateParameters struct. 3068func (cup *CacheUpdateParameters) UnmarshalJSON(body []byte) error { 3069 var m map[string]*json.RawMessage 3070 err := json.Unmarshal(body, &m) 3071 if err != nil { 3072 return err 3073 } 3074 for k, v := range m { 3075 switch k { 3076 case "properties": 3077 if v != nil { 3078 var cacheUpdateProperties CacheUpdateProperties 3079 err = json.Unmarshal(*v, &cacheUpdateProperties) 3080 if err != nil { 3081 return err 3082 } 3083 cup.CacheUpdateProperties = &cacheUpdateProperties 3084 } 3085 } 3086 } 3087 3088 return nil 3089} 3090 3091// CacheUpdateProperties parameters supplied to the Update Cache operation. 3092type CacheUpdateProperties struct { 3093 // Description - Cache description 3094 Description *string `json:"description,omitempty"` 3095 // ConnectionString - Runtime connection string to cache 3096 ConnectionString *string `json:"connectionString,omitempty"` 3097 // ResourceID - Original uri of entity in external system cache points to 3098 ResourceID *string `json:"resourceId,omitempty"` 3099} 3100 3101// CertificateCollection paged Certificates list representation. 3102type CertificateCollection struct { 3103 autorest.Response `json:"-"` 3104 // Value - Page values. 3105 Value *[]CertificateContract `json:"value,omitempty"` 3106 // NextLink - Next page link if any. 3107 NextLink *string `json:"nextLink,omitempty"` 3108} 3109 3110// CertificateCollectionIterator provides access to a complete listing of CertificateContract values. 3111type CertificateCollectionIterator struct { 3112 i int 3113 page CertificateCollectionPage 3114} 3115 3116// NextWithContext advances to the next value. If there was an error making 3117// the request the iterator does not advance and the error is returned. 3118func (iter *CertificateCollectionIterator) NextWithContext(ctx context.Context) (err error) { 3119 if tracing.IsEnabled() { 3120 ctx = tracing.StartSpan(ctx, fqdn+"/CertificateCollectionIterator.NextWithContext") 3121 defer func() { 3122 sc := -1 3123 if iter.Response().Response.Response != nil { 3124 sc = iter.Response().Response.Response.StatusCode 3125 } 3126 tracing.EndSpan(ctx, sc, err) 3127 }() 3128 } 3129 iter.i++ 3130 if iter.i < len(iter.page.Values()) { 3131 return nil 3132 } 3133 err = iter.page.NextWithContext(ctx) 3134 if err != nil { 3135 iter.i-- 3136 return err 3137 } 3138 iter.i = 0 3139 return nil 3140} 3141 3142// Next advances to the next value. If there was an error making 3143// the request the iterator does not advance and the error is returned. 3144// Deprecated: Use NextWithContext() instead. 3145func (iter *CertificateCollectionIterator) Next() error { 3146 return iter.NextWithContext(context.Background()) 3147} 3148 3149// NotDone returns true if the enumeration should be started or is not yet complete. 3150func (iter CertificateCollectionIterator) NotDone() bool { 3151 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 3152} 3153 3154// Response returns the raw server response from the last page request. 3155func (iter CertificateCollectionIterator) Response() CertificateCollection { 3156 return iter.page.Response() 3157} 3158 3159// Value returns the current value or a zero-initialized value if the 3160// iterator has advanced beyond the end of the collection. 3161func (iter CertificateCollectionIterator) Value() CertificateContract { 3162 if !iter.page.NotDone() { 3163 return CertificateContract{} 3164 } 3165 return iter.page.Values()[iter.i] 3166} 3167 3168// Creates a new instance of the CertificateCollectionIterator type. 3169func NewCertificateCollectionIterator(page CertificateCollectionPage) CertificateCollectionIterator { 3170 return CertificateCollectionIterator{page: page} 3171} 3172 3173// IsEmpty returns true if the ListResult contains no values. 3174func (cc CertificateCollection) IsEmpty() bool { 3175 return cc.Value == nil || len(*cc.Value) == 0 3176} 3177 3178// hasNextLink returns true if the NextLink is not empty. 3179func (cc CertificateCollection) hasNextLink() bool { 3180 return cc.NextLink != nil && len(*cc.NextLink) != 0 3181} 3182 3183// certificateCollectionPreparer prepares a request to retrieve the next set of results. 3184// It returns nil if no more results exist. 3185func (cc CertificateCollection) certificateCollectionPreparer(ctx context.Context) (*http.Request, error) { 3186 if !cc.hasNextLink() { 3187 return nil, nil 3188 } 3189 return autorest.Prepare((&http.Request{}).WithContext(ctx), 3190 autorest.AsJSON(), 3191 autorest.AsGet(), 3192 autorest.WithBaseURL(to.String(cc.NextLink))) 3193} 3194 3195// CertificateCollectionPage contains a page of CertificateContract values. 3196type CertificateCollectionPage struct { 3197 fn func(context.Context, CertificateCollection) (CertificateCollection, error) 3198 cc CertificateCollection 3199} 3200 3201// NextWithContext advances to the next page of values. If there was an error making 3202// the request the page does not advance and the error is returned. 3203func (page *CertificateCollectionPage) NextWithContext(ctx context.Context) (err error) { 3204 if tracing.IsEnabled() { 3205 ctx = tracing.StartSpan(ctx, fqdn+"/CertificateCollectionPage.NextWithContext") 3206 defer func() { 3207 sc := -1 3208 if page.Response().Response.Response != nil { 3209 sc = page.Response().Response.Response.StatusCode 3210 } 3211 tracing.EndSpan(ctx, sc, err) 3212 }() 3213 } 3214 for { 3215 next, err := page.fn(ctx, page.cc) 3216 if err != nil { 3217 return err 3218 } 3219 page.cc = next 3220 if !next.hasNextLink() || !next.IsEmpty() { 3221 break 3222 } 3223 } 3224 return nil 3225} 3226 3227// Next advances to the next page of values. If there was an error making 3228// the request the page does not advance and the error is returned. 3229// Deprecated: Use NextWithContext() instead. 3230func (page *CertificateCollectionPage) Next() error { 3231 return page.NextWithContext(context.Background()) 3232} 3233 3234// NotDone returns true if the page enumeration should be started or is not yet complete. 3235func (page CertificateCollectionPage) NotDone() bool { 3236 return !page.cc.IsEmpty() 3237} 3238 3239// Response returns the raw server response from the last page request. 3240func (page CertificateCollectionPage) Response() CertificateCollection { 3241 return page.cc 3242} 3243 3244// Values returns the slice of values for the current page or nil if there are no values. 3245func (page CertificateCollectionPage) Values() []CertificateContract { 3246 if page.cc.IsEmpty() { 3247 return nil 3248 } 3249 return *page.cc.Value 3250} 3251 3252// Creates a new instance of the CertificateCollectionPage type. 3253func NewCertificateCollectionPage(cur CertificateCollection, getNextPage func(context.Context, CertificateCollection) (CertificateCollection, error)) CertificateCollectionPage { 3254 return CertificateCollectionPage{ 3255 fn: getNextPage, 3256 cc: cur, 3257 } 3258} 3259 3260// CertificateConfiguration certificate configuration which consist of non-trusted intermediates and root 3261// certificates. 3262type CertificateConfiguration struct { 3263 // EncodedCertificate - Base64 Encoded certificate. 3264 EncodedCertificate *string `json:"encodedCertificate,omitempty"` 3265 // CertificatePassword - Certificate Password. 3266 CertificatePassword *string `json:"certificatePassword,omitempty"` 3267 // StoreName - The System.Security.Cryptography.x509certificates.StoreName certificate store location. Only Root and CertificateAuthority are valid locations. Possible values include: 'CertificateAuthority', 'Root' 3268 StoreName StoreName `json:"storeName,omitempty"` 3269 // Certificate - Certificate information. 3270 Certificate *CertificateInformation `json:"certificate,omitempty"` 3271} 3272 3273// CertificateContract certificate details. 3274type CertificateContract struct { 3275 autorest.Response `json:"-"` 3276 // CertificateContractProperties - Certificate properties details. 3277 *CertificateContractProperties `json:"properties,omitempty"` 3278 // ID - READ-ONLY; Resource ID. 3279 ID *string `json:"id,omitempty"` 3280 // Name - READ-ONLY; Resource name. 3281 Name *string `json:"name,omitempty"` 3282 // Type - READ-ONLY; Resource type for API Management resource. 3283 Type *string `json:"type,omitempty"` 3284} 3285 3286// MarshalJSON is the custom marshaler for CertificateContract. 3287func (cc CertificateContract) MarshalJSON() ([]byte, error) { 3288 objectMap := make(map[string]interface{}) 3289 if cc.CertificateContractProperties != nil { 3290 objectMap["properties"] = cc.CertificateContractProperties 3291 } 3292 return json.Marshal(objectMap) 3293} 3294 3295// UnmarshalJSON is the custom unmarshaler for CertificateContract struct. 3296func (cc *CertificateContract) UnmarshalJSON(body []byte) error { 3297 var m map[string]*json.RawMessage 3298 err := json.Unmarshal(body, &m) 3299 if err != nil { 3300 return err 3301 } 3302 for k, v := range m { 3303 switch k { 3304 case "properties": 3305 if v != nil { 3306 var certificateContractProperties CertificateContractProperties 3307 err = json.Unmarshal(*v, &certificateContractProperties) 3308 if err != nil { 3309 return err 3310 } 3311 cc.CertificateContractProperties = &certificateContractProperties 3312 } 3313 case "id": 3314 if v != nil { 3315 var ID string 3316 err = json.Unmarshal(*v, &ID) 3317 if err != nil { 3318 return err 3319 } 3320 cc.ID = &ID 3321 } 3322 case "name": 3323 if v != nil { 3324 var name string 3325 err = json.Unmarshal(*v, &name) 3326 if err != nil { 3327 return err 3328 } 3329 cc.Name = &name 3330 } 3331 case "type": 3332 if v != nil { 3333 var typeVar string 3334 err = json.Unmarshal(*v, &typeVar) 3335 if err != nil { 3336 return err 3337 } 3338 cc.Type = &typeVar 3339 } 3340 } 3341 } 3342 3343 return nil 3344} 3345 3346// CertificateContractProperties properties of the Certificate contract. 3347type CertificateContractProperties struct { 3348 // Subject - Subject attribute of the certificate. 3349 Subject *string `json:"subject,omitempty"` 3350 // Thumbprint - Thumbprint of the certificate. 3351 Thumbprint *string `json:"thumbprint,omitempty"` 3352 // 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. 3353 ExpirationDate *date.Time `json:"expirationDate,omitempty"` 3354} 3355 3356// CertificateCreateOrUpdateParameters certificate create or update details. 3357type CertificateCreateOrUpdateParameters struct { 3358 // CertificateCreateOrUpdateProperties - Certificate create or update properties details. 3359 *CertificateCreateOrUpdateProperties `json:"properties,omitempty"` 3360} 3361 3362// MarshalJSON is the custom marshaler for CertificateCreateOrUpdateParameters. 3363func (ccoup CertificateCreateOrUpdateParameters) MarshalJSON() ([]byte, error) { 3364 objectMap := make(map[string]interface{}) 3365 if ccoup.CertificateCreateOrUpdateProperties != nil { 3366 objectMap["properties"] = ccoup.CertificateCreateOrUpdateProperties 3367 } 3368 return json.Marshal(objectMap) 3369} 3370 3371// UnmarshalJSON is the custom unmarshaler for CertificateCreateOrUpdateParameters struct. 3372func (ccoup *CertificateCreateOrUpdateParameters) UnmarshalJSON(body []byte) error { 3373 var m map[string]*json.RawMessage 3374 err := json.Unmarshal(body, &m) 3375 if err != nil { 3376 return err 3377 } 3378 for k, v := range m { 3379 switch k { 3380 case "properties": 3381 if v != nil { 3382 var certificateCreateOrUpdateProperties CertificateCreateOrUpdateProperties 3383 err = json.Unmarshal(*v, &certificateCreateOrUpdateProperties) 3384 if err != nil { 3385 return err 3386 } 3387 ccoup.CertificateCreateOrUpdateProperties = &certificateCreateOrUpdateProperties 3388 } 3389 } 3390 } 3391 3392 return nil 3393} 3394 3395// CertificateCreateOrUpdateProperties parameters supplied to the CreateOrUpdate certificate operation. 3396type CertificateCreateOrUpdateProperties struct { 3397 // Data - Base 64 encoded certificate using the application/x-pkcs12 representation. 3398 Data *string `json:"data,omitempty"` 3399 // Password - Password for the Certificate 3400 Password *string `json:"password,omitempty"` 3401} 3402 3403// CertificateInformation SSL certificate information. 3404type CertificateInformation struct { 3405 // 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. 3406 Expiry *date.Time `json:"expiry,omitempty"` 3407 // Thumbprint - Thumbprint of the certificate. 3408 Thumbprint *string `json:"thumbprint,omitempty"` 3409 // Subject - Subject of the certificate. 3410 Subject *string `json:"subject,omitempty"` 3411} 3412 3413// ClientSecretContract client or app secret used in IdentityProviders, Aad, OpenID or OAuth. 3414type ClientSecretContract struct { 3415 autorest.Response `json:"-"` 3416 // ClientSecret - Client or app secret used in IdentityProviders, Aad, OpenID or OAuth. 3417 ClientSecret *string `json:"clientSecret,omitempty"` 3418} 3419 3420// ConnectivityStatusContract details about connectivity to a resource. 3421type ConnectivityStatusContract struct { 3422 // 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. 3423 Name *string `json:"name,omitempty"` 3424 // Status - Resource Connectivity Status Type identifier. Possible values include: 'Initializing', 'Success', 'Failure' 3425 Status ConnectivityStatusType `json:"status,omitempty"` 3426 // Error - Error details of the connectivity to the resource. 3427 Error *string `json:"error,omitempty"` 3428 // 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. 3429 LastUpdated *date.Time `json:"lastUpdated,omitempty"` 3430 // 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. 3431 LastStatusChange *date.Time `json:"lastStatusChange,omitempty"` 3432} 3433 3434// ContentItemCollection paged list of content items. 3435type ContentItemCollection struct { 3436 autorest.Response `json:"-"` 3437 // Value - READ-ONLY; Collection of content items. 3438 Value *[]ContentItemContract `json:"value,omitempty"` 3439 // NextLink - READ-ONLY; Next page link, if any. 3440 NextLink *string `json:"nextLink,omitempty"` 3441} 3442 3443// MarshalJSON is the custom marshaler for ContentItemCollection. 3444func (cic ContentItemCollection) MarshalJSON() ([]byte, error) { 3445 objectMap := make(map[string]interface{}) 3446 return json.Marshal(objectMap) 3447} 3448 3449// ContentItemCollectionIterator provides access to a complete listing of ContentItemContract values. 3450type ContentItemCollectionIterator struct { 3451 i int 3452 page ContentItemCollectionPage 3453} 3454 3455// NextWithContext advances to the next value. If there was an error making 3456// the request the iterator does not advance and the error is returned. 3457func (iter *ContentItemCollectionIterator) NextWithContext(ctx context.Context) (err error) { 3458 if tracing.IsEnabled() { 3459 ctx = tracing.StartSpan(ctx, fqdn+"/ContentItemCollectionIterator.NextWithContext") 3460 defer func() { 3461 sc := -1 3462 if iter.Response().Response.Response != nil { 3463 sc = iter.Response().Response.Response.StatusCode 3464 } 3465 tracing.EndSpan(ctx, sc, err) 3466 }() 3467 } 3468 iter.i++ 3469 if iter.i < len(iter.page.Values()) { 3470 return nil 3471 } 3472 err = iter.page.NextWithContext(ctx) 3473 if err != nil { 3474 iter.i-- 3475 return err 3476 } 3477 iter.i = 0 3478 return nil 3479} 3480 3481// Next advances to the next value. If there was an error making 3482// the request the iterator does not advance and the error is returned. 3483// Deprecated: Use NextWithContext() instead. 3484func (iter *ContentItemCollectionIterator) Next() error { 3485 return iter.NextWithContext(context.Background()) 3486} 3487 3488// NotDone returns true if the enumeration should be started or is not yet complete. 3489func (iter ContentItemCollectionIterator) NotDone() bool { 3490 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 3491} 3492 3493// Response returns the raw server response from the last page request. 3494func (iter ContentItemCollectionIterator) Response() ContentItemCollection { 3495 return iter.page.Response() 3496} 3497 3498// Value returns the current value or a zero-initialized value if the 3499// iterator has advanced beyond the end of the collection. 3500func (iter ContentItemCollectionIterator) Value() ContentItemContract { 3501 if !iter.page.NotDone() { 3502 return ContentItemContract{} 3503 } 3504 return iter.page.Values()[iter.i] 3505} 3506 3507// Creates a new instance of the ContentItemCollectionIterator type. 3508func NewContentItemCollectionIterator(page ContentItemCollectionPage) ContentItemCollectionIterator { 3509 return ContentItemCollectionIterator{page: page} 3510} 3511 3512// IsEmpty returns true if the ListResult contains no values. 3513func (cic ContentItemCollection) IsEmpty() bool { 3514 return cic.Value == nil || len(*cic.Value) == 0 3515} 3516 3517// hasNextLink returns true if the NextLink is not empty. 3518func (cic ContentItemCollection) hasNextLink() bool { 3519 return cic.NextLink != nil && len(*cic.NextLink) != 0 3520} 3521 3522// contentItemCollectionPreparer prepares a request to retrieve the next set of results. 3523// It returns nil if no more results exist. 3524func (cic ContentItemCollection) contentItemCollectionPreparer(ctx context.Context) (*http.Request, error) { 3525 if !cic.hasNextLink() { 3526 return nil, nil 3527 } 3528 return autorest.Prepare((&http.Request{}).WithContext(ctx), 3529 autorest.AsJSON(), 3530 autorest.AsGet(), 3531 autorest.WithBaseURL(to.String(cic.NextLink))) 3532} 3533 3534// ContentItemCollectionPage contains a page of ContentItemContract values. 3535type ContentItemCollectionPage struct { 3536 fn func(context.Context, ContentItemCollection) (ContentItemCollection, error) 3537 cic ContentItemCollection 3538} 3539 3540// NextWithContext advances to the next page of values. If there was an error making 3541// the request the page does not advance and the error is returned. 3542func (page *ContentItemCollectionPage) NextWithContext(ctx context.Context) (err error) { 3543 if tracing.IsEnabled() { 3544 ctx = tracing.StartSpan(ctx, fqdn+"/ContentItemCollectionPage.NextWithContext") 3545 defer func() { 3546 sc := -1 3547 if page.Response().Response.Response != nil { 3548 sc = page.Response().Response.Response.StatusCode 3549 } 3550 tracing.EndSpan(ctx, sc, err) 3551 }() 3552 } 3553 for { 3554 next, err := page.fn(ctx, page.cic) 3555 if err != nil { 3556 return err 3557 } 3558 page.cic = next 3559 if !next.hasNextLink() || !next.IsEmpty() { 3560 break 3561 } 3562 } 3563 return nil 3564} 3565 3566// Next advances to the next page of values. If there was an error making 3567// the request the page does not advance and the error is returned. 3568// Deprecated: Use NextWithContext() instead. 3569func (page *ContentItemCollectionPage) Next() error { 3570 return page.NextWithContext(context.Background()) 3571} 3572 3573// NotDone returns true if the page enumeration should be started or is not yet complete. 3574func (page ContentItemCollectionPage) NotDone() bool { 3575 return !page.cic.IsEmpty() 3576} 3577 3578// Response returns the raw server response from the last page request. 3579func (page ContentItemCollectionPage) Response() ContentItemCollection { 3580 return page.cic 3581} 3582 3583// Values returns the slice of values for the current page or nil if there are no values. 3584func (page ContentItemCollectionPage) Values() []ContentItemContract { 3585 if page.cic.IsEmpty() { 3586 return nil 3587 } 3588 return *page.cic.Value 3589} 3590 3591// Creates a new instance of the ContentItemCollectionPage type. 3592func NewContentItemCollectionPage(cur ContentItemCollection, getNextPage func(context.Context, ContentItemCollection) (ContentItemCollection, error)) ContentItemCollectionPage { 3593 return ContentItemCollectionPage{ 3594 fn: getNextPage, 3595 cic: cur, 3596 } 3597} 3598 3599// ContentItemContract content type contract details. 3600type ContentItemContract struct { 3601 autorest.Response `json:"-"` 3602 // Properties - Properties of the content item. 3603 Properties map[string]interface{} `json:"properties"` 3604 // ID - READ-ONLY; Resource ID. 3605 ID *string `json:"id,omitempty"` 3606 // Name - READ-ONLY; Resource name. 3607 Name *string `json:"name,omitempty"` 3608 // Type - READ-ONLY; Resource type for API Management resource. 3609 Type *string `json:"type,omitempty"` 3610} 3611 3612// MarshalJSON is the custom marshaler for ContentItemContract. 3613func (cic ContentItemContract) MarshalJSON() ([]byte, error) { 3614 objectMap := make(map[string]interface{}) 3615 if cic.Properties != nil { 3616 objectMap["properties"] = cic.Properties 3617 } 3618 return json.Marshal(objectMap) 3619} 3620 3621// ContentTypeCollection paged list of content types. 3622type ContentTypeCollection struct { 3623 autorest.Response `json:"-"` 3624 // Value - READ-ONLY; Collection of content types. 3625 Value *[]ContentTypeContract `json:"value,omitempty"` 3626 // NextLink - READ-ONLY; Next page link, if any. 3627 NextLink *string `json:"nextLink,omitempty"` 3628} 3629 3630// MarshalJSON is the custom marshaler for ContentTypeCollection. 3631func (ctc ContentTypeCollection) MarshalJSON() ([]byte, error) { 3632 objectMap := make(map[string]interface{}) 3633 return json.Marshal(objectMap) 3634} 3635 3636// ContentTypeCollectionIterator provides access to a complete listing of ContentTypeContract values. 3637type ContentTypeCollectionIterator struct { 3638 i int 3639 page ContentTypeCollectionPage 3640} 3641 3642// NextWithContext advances to the next value. If there was an error making 3643// the request the iterator does not advance and the error is returned. 3644func (iter *ContentTypeCollectionIterator) NextWithContext(ctx context.Context) (err error) { 3645 if tracing.IsEnabled() { 3646 ctx = tracing.StartSpan(ctx, fqdn+"/ContentTypeCollectionIterator.NextWithContext") 3647 defer func() { 3648 sc := -1 3649 if iter.Response().Response.Response != nil { 3650 sc = iter.Response().Response.Response.StatusCode 3651 } 3652 tracing.EndSpan(ctx, sc, err) 3653 }() 3654 } 3655 iter.i++ 3656 if iter.i < len(iter.page.Values()) { 3657 return nil 3658 } 3659 err = iter.page.NextWithContext(ctx) 3660 if err != nil { 3661 iter.i-- 3662 return err 3663 } 3664 iter.i = 0 3665 return nil 3666} 3667 3668// Next advances to the next value. If there was an error making 3669// the request the iterator does not advance and the error is returned. 3670// Deprecated: Use NextWithContext() instead. 3671func (iter *ContentTypeCollectionIterator) Next() error { 3672 return iter.NextWithContext(context.Background()) 3673} 3674 3675// NotDone returns true if the enumeration should be started or is not yet complete. 3676func (iter ContentTypeCollectionIterator) NotDone() bool { 3677 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 3678} 3679 3680// Response returns the raw server response from the last page request. 3681func (iter ContentTypeCollectionIterator) Response() ContentTypeCollection { 3682 return iter.page.Response() 3683} 3684 3685// Value returns the current value or a zero-initialized value if the 3686// iterator has advanced beyond the end of the collection. 3687func (iter ContentTypeCollectionIterator) Value() ContentTypeContract { 3688 if !iter.page.NotDone() { 3689 return ContentTypeContract{} 3690 } 3691 return iter.page.Values()[iter.i] 3692} 3693 3694// Creates a new instance of the ContentTypeCollectionIterator type. 3695func NewContentTypeCollectionIterator(page ContentTypeCollectionPage) ContentTypeCollectionIterator { 3696 return ContentTypeCollectionIterator{page: page} 3697} 3698 3699// IsEmpty returns true if the ListResult contains no values. 3700func (ctc ContentTypeCollection) IsEmpty() bool { 3701 return ctc.Value == nil || len(*ctc.Value) == 0 3702} 3703 3704// hasNextLink returns true if the NextLink is not empty. 3705func (ctc ContentTypeCollection) hasNextLink() bool { 3706 return ctc.NextLink != nil && len(*ctc.NextLink) != 0 3707} 3708 3709// contentTypeCollectionPreparer prepares a request to retrieve the next set of results. 3710// It returns nil if no more results exist. 3711func (ctc ContentTypeCollection) contentTypeCollectionPreparer(ctx context.Context) (*http.Request, error) { 3712 if !ctc.hasNextLink() { 3713 return nil, nil 3714 } 3715 return autorest.Prepare((&http.Request{}).WithContext(ctx), 3716 autorest.AsJSON(), 3717 autorest.AsGet(), 3718 autorest.WithBaseURL(to.String(ctc.NextLink))) 3719} 3720 3721// ContentTypeCollectionPage contains a page of ContentTypeContract values. 3722type ContentTypeCollectionPage struct { 3723 fn func(context.Context, ContentTypeCollection) (ContentTypeCollection, error) 3724 ctc ContentTypeCollection 3725} 3726 3727// NextWithContext advances to the next page of values. If there was an error making 3728// the request the page does not advance and the error is returned. 3729func (page *ContentTypeCollectionPage) NextWithContext(ctx context.Context) (err error) { 3730 if tracing.IsEnabled() { 3731 ctx = tracing.StartSpan(ctx, fqdn+"/ContentTypeCollectionPage.NextWithContext") 3732 defer func() { 3733 sc := -1 3734 if page.Response().Response.Response != nil { 3735 sc = page.Response().Response.Response.StatusCode 3736 } 3737 tracing.EndSpan(ctx, sc, err) 3738 }() 3739 } 3740 for { 3741 next, err := page.fn(ctx, page.ctc) 3742 if err != nil { 3743 return err 3744 } 3745 page.ctc = next 3746 if !next.hasNextLink() || !next.IsEmpty() { 3747 break 3748 } 3749 } 3750 return nil 3751} 3752 3753// Next advances to the next page of values. If there was an error making 3754// the request the page does not advance and the error is returned. 3755// Deprecated: Use NextWithContext() instead. 3756func (page *ContentTypeCollectionPage) Next() error { 3757 return page.NextWithContext(context.Background()) 3758} 3759 3760// NotDone returns true if the page enumeration should be started or is not yet complete. 3761func (page ContentTypeCollectionPage) NotDone() bool { 3762 return !page.ctc.IsEmpty() 3763} 3764 3765// Response returns the raw server response from the last page request. 3766func (page ContentTypeCollectionPage) Response() ContentTypeCollection { 3767 return page.ctc 3768} 3769 3770// Values returns the slice of values for the current page or nil if there are no values. 3771func (page ContentTypeCollectionPage) Values() []ContentTypeContract { 3772 if page.ctc.IsEmpty() { 3773 return nil 3774 } 3775 return *page.ctc.Value 3776} 3777 3778// Creates a new instance of the ContentTypeCollectionPage type. 3779func NewContentTypeCollectionPage(cur ContentTypeCollection, getNextPage func(context.Context, ContentTypeCollection) (ContentTypeCollection, error)) ContentTypeCollectionPage { 3780 return ContentTypeCollectionPage{ 3781 fn: getNextPage, 3782 ctc: cur, 3783 } 3784} 3785 3786// ContentTypeContract content type contract details. 3787type ContentTypeContract struct { 3788 autorest.Response `json:"-"` 3789 // ContentTypeContractProperties - Properties of the content type. 3790 *ContentTypeContractProperties `json:"properties,omitempty"` 3791 // ID - READ-ONLY; Resource ID. 3792 ID *string `json:"id,omitempty"` 3793 // Name - READ-ONLY; Resource name. 3794 Name *string `json:"name,omitempty"` 3795 // Type - READ-ONLY; Resource type for API Management resource. 3796 Type *string `json:"type,omitempty"` 3797} 3798 3799// MarshalJSON is the custom marshaler for ContentTypeContract. 3800func (ctc ContentTypeContract) MarshalJSON() ([]byte, error) { 3801 objectMap := make(map[string]interface{}) 3802 if ctc.ContentTypeContractProperties != nil { 3803 objectMap["properties"] = ctc.ContentTypeContractProperties 3804 } 3805 return json.Marshal(objectMap) 3806} 3807 3808// UnmarshalJSON is the custom unmarshaler for ContentTypeContract struct. 3809func (ctc *ContentTypeContract) UnmarshalJSON(body []byte) error { 3810 var m map[string]*json.RawMessage 3811 err := json.Unmarshal(body, &m) 3812 if err != nil { 3813 return err 3814 } 3815 for k, v := range m { 3816 switch k { 3817 case "properties": 3818 if v != nil { 3819 var contentTypeContractProperties ContentTypeContractProperties 3820 err = json.Unmarshal(*v, &contentTypeContractProperties) 3821 if err != nil { 3822 return err 3823 } 3824 ctc.ContentTypeContractProperties = &contentTypeContractProperties 3825 } 3826 case "id": 3827 if v != nil { 3828 var ID string 3829 err = json.Unmarshal(*v, &ID) 3830 if err != nil { 3831 return err 3832 } 3833 ctc.ID = &ID 3834 } 3835 case "name": 3836 if v != nil { 3837 var name string 3838 err = json.Unmarshal(*v, &name) 3839 if err != nil { 3840 return err 3841 } 3842 ctc.Name = &name 3843 } 3844 case "type": 3845 if v != nil { 3846 var typeVar string 3847 err = json.Unmarshal(*v, &typeVar) 3848 if err != nil { 3849 return err 3850 } 3851 ctc.Type = &typeVar 3852 } 3853 } 3854 } 3855 3856 return nil 3857} 3858 3859// ContentTypeContractProperties ... 3860type ContentTypeContractProperties struct { 3861 // ID - Content type identifier 3862 ID *string `json:"id,omitempty"` 3863 // Name - Content type name. Must be 1 to 250 characters long. 3864 Name *string `json:"name,omitempty"` 3865 // Description - Content type description. 3866 Description *string `json:"description,omitempty"` 3867 // Schema - Content type schema. 3868 Schema interface{} `json:"schema,omitempty"` 3869 // Version - Content type version. 3870 Version *string `json:"version,omitempty"` 3871} 3872 3873// DeployConfigurationParameterProperties parameters supplied to the Deploy Configuration operation. 3874type DeployConfigurationParameterProperties struct { 3875 // Branch - The name of the Git branch from which the configuration is to be deployed to the configuration database. 3876 Branch *string `json:"branch,omitempty"` 3877 // Force - The value enforcing deleting subscriptions to products that are deleted in this update. 3878 Force *bool `json:"force,omitempty"` 3879} 3880 3881// DeployConfigurationParameters deploy Tenant Configuration Contract. 3882type DeployConfigurationParameters struct { 3883 // DeployConfigurationParameterProperties - Deploy Configuration Parameter contract properties. 3884 *DeployConfigurationParameterProperties `json:"properties,omitempty"` 3885} 3886 3887// MarshalJSON is the custom marshaler for DeployConfigurationParameters. 3888func (dcp DeployConfigurationParameters) MarshalJSON() ([]byte, error) { 3889 objectMap := make(map[string]interface{}) 3890 if dcp.DeployConfigurationParameterProperties != nil { 3891 objectMap["properties"] = dcp.DeployConfigurationParameterProperties 3892 } 3893 return json.Marshal(objectMap) 3894} 3895 3896// UnmarshalJSON is the custom unmarshaler for DeployConfigurationParameters struct. 3897func (dcp *DeployConfigurationParameters) UnmarshalJSON(body []byte) error { 3898 var m map[string]*json.RawMessage 3899 err := json.Unmarshal(body, &m) 3900 if err != nil { 3901 return err 3902 } 3903 for k, v := range m { 3904 switch k { 3905 case "properties": 3906 if v != nil { 3907 var deployConfigurationParameterProperties DeployConfigurationParameterProperties 3908 err = json.Unmarshal(*v, &deployConfigurationParameterProperties) 3909 if err != nil { 3910 return err 3911 } 3912 dcp.DeployConfigurationParameterProperties = &deployConfigurationParameterProperties 3913 } 3914 } 3915 } 3916 3917 return nil 3918} 3919 3920// DiagnosticCollection paged Diagnostic list representation. 3921type DiagnosticCollection struct { 3922 autorest.Response `json:"-"` 3923 // Value - Page values. 3924 Value *[]DiagnosticContract `json:"value,omitempty"` 3925 // NextLink - Next page link if any. 3926 NextLink *string `json:"nextLink,omitempty"` 3927} 3928 3929// DiagnosticCollectionIterator provides access to a complete listing of DiagnosticContract values. 3930type DiagnosticCollectionIterator struct { 3931 i int 3932 page DiagnosticCollectionPage 3933} 3934 3935// NextWithContext advances to the next value. If there was an error making 3936// the request the iterator does not advance and the error is returned. 3937func (iter *DiagnosticCollectionIterator) NextWithContext(ctx context.Context) (err error) { 3938 if tracing.IsEnabled() { 3939 ctx = tracing.StartSpan(ctx, fqdn+"/DiagnosticCollectionIterator.NextWithContext") 3940 defer func() { 3941 sc := -1 3942 if iter.Response().Response.Response != nil { 3943 sc = iter.Response().Response.Response.StatusCode 3944 } 3945 tracing.EndSpan(ctx, sc, err) 3946 }() 3947 } 3948 iter.i++ 3949 if iter.i < len(iter.page.Values()) { 3950 return nil 3951 } 3952 err = iter.page.NextWithContext(ctx) 3953 if err != nil { 3954 iter.i-- 3955 return err 3956 } 3957 iter.i = 0 3958 return nil 3959} 3960 3961// Next advances to the next value. If there was an error making 3962// the request the iterator does not advance and the error is returned. 3963// Deprecated: Use NextWithContext() instead. 3964func (iter *DiagnosticCollectionIterator) Next() error { 3965 return iter.NextWithContext(context.Background()) 3966} 3967 3968// NotDone returns true if the enumeration should be started or is not yet complete. 3969func (iter DiagnosticCollectionIterator) NotDone() bool { 3970 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 3971} 3972 3973// Response returns the raw server response from the last page request. 3974func (iter DiagnosticCollectionIterator) Response() DiagnosticCollection { 3975 return iter.page.Response() 3976} 3977 3978// Value returns the current value or a zero-initialized value if the 3979// iterator has advanced beyond the end of the collection. 3980func (iter DiagnosticCollectionIterator) Value() DiagnosticContract { 3981 if !iter.page.NotDone() { 3982 return DiagnosticContract{} 3983 } 3984 return iter.page.Values()[iter.i] 3985} 3986 3987// Creates a new instance of the DiagnosticCollectionIterator type. 3988func NewDiagnosticCollectionIterator(page DiagnosticCollectionPage) DiagnosticCollectionIterator { 3989 return DiagnosticCollectionIterator{page: page} 3990} 3991 3992// IsEmpty returns true if the ListResult contains no values. 3993func (dc DiagnosticCollection) IsEmpty() bool { 3994 return dc.Value == nil || len(*dc.Value) == 0 3995} 3996 3997// hasNextLink returns true if the NextLink is not empty. 3998func (dc DiagnosticCollection) hasNextLink() bool { 3999 return dc.NextLink != nil && len(*dc.NextLink) != 0 4000} 4001 4002// diagnosticCollectionPreparer prepares a request to retrieve the next set of results. 4003// It returns nil if no more results exist. 4004func (dc DiagnosticCollection) diagnosticCollectionPreparer(ctx context.Context) (*http.Request, error) { 4005 if !dc.hasNextLink() { 4006 return nil, nil 4007 } 4008 return autorest.Prepare((&http.Request{}).WithContext(ctx), 4009 autorest.AsJSON(), 4010 autorest.AsGet(), 4011 autorest.WithBaseURL(to.String(dc.NextLink))) 4012} 4013 4014// DiagnosticCollectionPage contains a page of DiagnosticContract values. 4015type DiagnosticCollectionPage struct { 4016 fn func(context.Context, DiagnosticCollection) (DiagnosticCollection, error) 4017 dc DiagnosticCollection 4018} 4019 4020// NextWithContext advances to the next page of values. If there was an error making 4021// the request the page does not advance and the error is returned. 4022func (page *DiagnosticCollectionPage) NextWithContext(ctx context.Context) (err error) { 4023 if tracing.IsEnabled() { 4024 ctx = tracing.StartSpan(ctx, fqdn+"/DiagnosticCollectionPage.NextWithContext") 4025 defer func() { 4026 sc := -1 4027 if page.Response().Response.Response != nil { 4028 sc = page.Response().Response.Response.StatusCode 4029 } 4030 tracing.EndSpan(ctx, sc, err) 4031 }() 4032 } 4033 for { 4034 next, err := page.fn(ctx, page.dc) 4035 if err != nil { 4036 return err 4037 } 4038 page.dc = next 4039 if !next.hasNextLink() || !next.IsEmpty() { 4040 break 4041 } 4042 } 4043 return nil 4044} 4045 4046// Next advances to the next page of values. If there was an error making 4047// the request the page does not advance and the error is returned. 4048// Deprecated: Use NextWithContext() instead. 4049func (page *DiagnosticCollectionPage) Next() error { 4050 return page.NextWithContext(context.Background()) 4051} 4052 4053// NotDone returns true if the page enumeration should be started or is not yet complete. 4054func (page DiagnosticCollectionPage) NotDone() bool { 4055 return !page.dc.IsEmpty() 4056} 4057 4058// Response returns the raw server response from the last page request. 4059func (page DiagnosticCollectionPage) Response() DiagnosticCollection { 4060 return page.dc 4061} 4062 4063// Values returns the slice of values for the current page or nil if there are no values. 4064func (page DiagnosticCollectionPage) Values() []DiagnosticContract { 4065 if page.dc.IsEmpty() { 4066 return nil 4067 } 4068 return *page.dc.Value 4069} 4070 4071// Creates a new instance of the DiagnosticCollectionPage type. 4072func NewDiagnosticCollectionPage(cur DiagnosticCollection, getNextPage func(context.Context, DiagnosticCollection) (DiagnosticCollection, error)) DiagnosticCollectionPage { 4073 return DiagnosticCollectionPage{ 4074 fn: getNextPage, 4075 dc: cur, 4076 } 4077} 4078 4079// DiagnosticContract diagnostic details. 4080type DiagnosticContract struct { 4081 autorest.Response `json:"-"` 4082 // DiagnosticContractProperties - Diagnostic entity contract properties. 4083 *DiagnosticContractProperties `json:"properties,omitempty"` 4084 // ID - READ-ONLY; Resource ID. 4085 ID *string `json:"id,omitempty"` 4086 // Name - READ-ONLY; Resource name. 4087 Name *string `json:"name,omitempty"` 4088 // Type - READ-ONLY; Resource type for API Management resource. 4089 Type *string `json:"type,omitempty"` 4090} 4091 4092// MarshalJSON is the custom marshaler for DiagnosticContract. 4093func (dc DiagnosticContract) MarshalJSON() ([]byte, error) { 4094 objectMap := make(map[string]interface{}) 4095 if dc.DiagnosticContractProperties != nil { 4096 objectMap["properties"] = dc.DiagnosticContractProperties 4097 } 4098 return json.Marshal(objectMap) 4099} 4100 4101// UnmarshalJSON is the custom unmarshaler for DiagnosticContract struct. 4102func (dc *DiagnosticContract) UnmarshalJSON(body []byte) error { 4103 var m map[string]*json.RawMessage 4104 err := json.Unmarshal(body, &m) 4105 if err != nil { 4106 return err 4107 } 4108 for k, v := range m { 4109 switch k { 4110 case "properties": 4111 if v != nil { 4112 var diagnosticContractProperties DiagnosticContractProperties 4113 err = json.Unmarshal(*v, &diagnosticContractProperties) 4114 if err != nil { 4115 return err 4116 } 4117 dc.DiagnosticContractProperties = &diagnosticContractProperties 4118 } 4119 case "id": 4120 if v != nil { 4121 var ID string 4122 err = json.Unmarshal(*v, &ID) 4123 if err != nil { 4124 return err 4125 } 4126 dc.ID = &ID 4127 } 4128 case "name": 4129 if v != nil { 4130 var name string 4131 err = json.Unmarshal(*v, &name) 4132 if err != nil { 4133 return err 4134 } 4135 dc.Name = &name 4136 } 4137 case "type": 4138 if v != nil { 4139 var typeVar string 4140 err = json.Unmarshal(*v, &typeVar) 4141 if err != nil { 4142 return err 4143 } 4144 dc.Type = &typeVar 4145 } 4146 } 4147 } 4148 4149 return nil 4150} 4151 4152// DiagnosticContractProperties diagnostic Entity Properties 4153type DiagnosticContractProperties struct { 4154 // AlwaysLog - Specifies for what type of messages sampling settings should not apply. Possible values include: 'AllErrors' 4155 AlwaysLog AlwaysLog `json:"alwaysLog,omitempty"` 4156 // LoggerID - Resource Id of a target logger. 4157 LoggerID *string `json:"loggerId,omitempty"` 4158 // Sampling - Sampling settings for Diagnostic. 4159 Sampling *SamplingSettings `json:"sampling,omitempty"` 4160 // Frontend - Diagnostic settings for incoming/outgoing HTTP messages to the Gateway. 4161 Frontend *PipelineDiagnosticSettings `json:"frontend,omitempty"` 4162 // Backend - Diagnostic settings for incoming/outgoing HTTP messages to the Backend 4163 Backend *PipelineDiagnosticSettings `json:"backend,omitempty"` 4164 // LogClientIP - Log the ClientIP. Default is false. 4165 LogClientIP *bool `json:"logClientIp,omitempty"` 4166 // HTTPCorrelationProtocol - Sets correlation protocol to use for Application Insights diagnostics. Possible values include: 'HTTPCorrelationProtocolNone', 'HTTPCorrelationProtocolLegacy', 'HTTPCorrelationProtocolW3C' 4167 HTTPCorrelationProtocol HTTPCorrelationProtocol `json:"httpCorrelationProtocol,omitempty"` 4168 // Verbosity - The verbosity level applied to traces emitted by trace policies. Possible values include: 'Verbose', 'Information', 'Error' 4169 Verbosity Verbosity `json:"verbosity,omitempty"` 4170} 4171 4172// EmailTemplateCollection paged email template list representation. 4173type EmailTemplateCollection struct { 4174 autorest.Response `json:"-"` 4175 // Value - Page values. 4176 Value *[]EmailTemplateContract `json:"value,omitempty"` 4177 // NextLink - Next page link if any. 4178 NextLink *string `json:"nextLink,omitempty"` 4179} 4180 4181// EmailTemplateCollectionIterator provides access to a complete listing of EmailTemplateContract values. 4182type EmailTemplateCollectionIterator struct { 4183 i int 4184 page EmailTemplateCollectionPage 4185} 4186 4187// NextWithContext advances to the next value. If there was an error making 4188// the request the iterator does not advance and the error is returned. 4189func (iter *EmailTemplateCollectionIterator) NextWithContext(ctx context.Context) (err error) { 4190 if tracing.IsEnabled() { 4191 ctx = tracing.StartSpan(ctx, fqdn+"/EmailTemplateCollectionIterator.NextWithContext") 4192 defer func() { 4193 sc := -1 4194 if iter.Response().Response.Response != nil { 4195 sc = iter.Response().Response.Response.StatusCode 4196 } 4197 tracing.EndSpan(ctx, sc, err) 4198 }() 4199 } 4200 iter.i++ 4201 if iter.i < len(iter.page.Values()) { 4202 return nil 4203 } 4204 err = iter.page.NextWithContext(ctx) 4205 if err != nil { 4206 iter.i-- 4207 return err 4208 } 4209 iter.i = 0 4210 return nil 4211} 4212 4213// Next advances to the next value. If there was an error making 4214// the request the iterator does not advance and the error is returned. 4215// Deprecated: Use NextWithContext() instead. 4216func (iter *EmailTemplateCollectionIterator) Next() error { 4217 return iter.NextWithContext(context.Background()) 4218} 4219 4220// NotDone returns true if the enumeration should be started or is not yet complete. 4221func (iter EmailTemplateCollectionIterator) NotDone() bool { 4222 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 4223} 4224 4225// Response returns the raw server response from the last page request. 4226func (iter EmailTemplateCollectionIterator) Response() EmailTemplateCollection { 4227 return iter.page.Response() 4228} 4229 4230// Value returns the current value or a zero-initialized value if the 4231// iterator has advanced beyond the end of the collection. 4232func (iter EmailTemplateCollectionIterator) Value() EmailTemplateContract { 4233 if !iter.page.NotDone() { 4234 return EmailTemplateContract{} 4235 } 4236 return iter.page.Values()[iter.i] 4237} 4238 4239// Creates a new instance of the EmailTemplateCollectionIterator type. 4240func NewEmailTemplateCollectionIterator(page EmailTemplateCollectionPage) EmailTemplateCollectionIterator { 4241 return EmailTemplateCollectionIterator{page: page} 4242} 4243 4244// IsEmpty returns true if the ListResult contains no values. 4245func (etc EmailTemplateCollection) IsEmpty() bool { 4246 return etc.Value == nil || len(*etc.Value) == 0 4247} 4248 4249// hasNextLink returns true if the NextLink is not empty. 4250func (etc EmailTemplateCollection) hasNextLink() bool { 4251 return etc.NextLink != nil && len(*etc.NextLink) != 0 4252} 4253 4254// emailTemplateCollectionPreparer prepares a request to retrieve the next set of results. 4255// It returns nil if no more results exist. 4256func (etc EmailTemplateCollection) emailTemplateCollectionPreparer(ctx context.Context) (*http.Request, error) { 4257 if !etc.hasNextLink() { 4258 return nil, nil 4259 } 4260 return autorest.Prepare((&http.Request{}).WithContext(ctx), 4261 autorest.AsJSON(), 4262 autorest.AsGet(), 4263 autorest.WithBaseURL(to.String(etc.NextLink))) 4264} 4265 4266// EmailTemplateCollectionPage contains a page of EmailTemplateContract values. 4267type EmailTemplateCollectionPage struct { 4268 fn func(context.Context, EmailTemplateCollection) (EmailTemplateCollection, error) 4269 etc EmailTemplateCollection 4270} 4271 4272// NextWithContext advances to the next page of values. If there was an error making 4273// the request the page does not advance and the error is returned. 4274func (page *EmailTemplateCollectionPage) NextWithContext(ctx context.Context) (err error) { 4275 if tracing.IsEnabled() { 4276 ctx = tracing.StartSpan(ctx, fqdn+"/EmailTemplateCollectionPage.NextWithContext") 4277 defer func() { 4278 sc := -1 4279 if page.Response().Response.Response != nil { 4280 sc = page.Response().Response.Response.StatusCode 4281 } 4282 tracing.EndSpan(ctx, sc, err) 4283 }() 4284 } 4285 for { 4286 next, err := page.fn(ctx, page.etc) 4287 if err != nil { 4288 return err 4289 } 4290 page.etc = next 4291 if !next.hasNextLink() || !next.IsEmpty() { 4292 break 4293 } 4294 } 4295 return nil 4296} 4297 4298// Next advances to the next page of values. If there was an error making 4299// the request the page does not advance and the error is returned. 4300// Deprecated: Use NextWithContext() instead. 4301func (page *EmailTemplateCollectionPage) Next() error { 4302 return page.NextWithContext(context.Background()) 4303} 4304 4305// NotDone returns true if the page enumeration should be started or is not yet complete. 4306func (page EmailTemplateCollectionPage) NotDone() bool { 4307 return !page.etc.IsEmpty() 4308} 4309 4310// Response returns the raw server response from the last page request. 4311func (page EmailTemplateCollectionPage) Response() EmailTemplateCollection { 4312 return page.etc 4313} 4314 4315// Values returns the slice of values for the current page or nil if there are no values. 4316func (page EmailTemplateCollectionPage) Values() []EmailTemplateContract { 4317 if page.etc.IsEmpty() { 4318 return nil 4319 } 4320 return *page.etc.Value 4321} 4322 4323// Creates a new instance of the EmailTemplateCollectionPage type. 4324func NewEmailTemplateCollectionPage(cur EmailTemplateCollection, getNextPage func(context.Context, EmailTemplateCollection) (EmailTemplateCollection, error)) EmailTemplateCollectionPage { 4325 return EmailTemplateCollectionPage{ 4326 fn: getNextPage, 4327 etc: cur, 4328 } 4329} 4330 4331// EmailTemplateContract email Template details. 4332type EmailTemplateContract struct { 4333 autorest.Response `json:"-"` 4334 // EmailTemplateContractProperties - Email Template entity contract properties. 4335 *EmailTemplateContractProperties `json:"properties,omitempty"` 4336 // ID - READ-ONLY; Resource ID. 4337 ID *string `json:"id,omitempty"` 4338 // Name - READ-ONLY; Resource name. 4339 Name *string `json:"name,omitempty"` 4340 // Type - READ-ONLY; Resource type for API Management resource. 4341 Type *string `json:"type,omitempty"` 4342} 4343 4344// MarshalJSON is the custom marshaler for EmailTemplateContract. 4345func (etc EmailTemplateContract) MarshalJSON() ([]byte, error) { 4346 objectMap := make(map[string]interface{}) 4347 if etc.EmailTemplateContractProperties != nil { 4348 objectMap["properties"] = etc.EmailTemplateContractProperties 4349 } 4350 return json.Marshal(objectMap) 4351} 4352 4353// UnmarshalJSON is the custom unmarshaler for EmailTemplateContract struct. 4354func (etc *EmailTemplateContract) UnmarshalJSON(body []byte) error { 4355 var m map[string]*json.RawMessage 4356 err := json.Unmarshal(body, &m) 4357 if err != nil { 4358 return err 4359 } 4360 for k, v := range m { 4361 switch k { 4362 case "properties": 4363 if v != nil { 4364 var emailTemplateContractProperties EmailTemplateContractProperties 4365 err = json.Unmarshal(*v, &emailTemplateContractProperties) 4366 if err != nil { 4367 return err 4368 } 4369 etc.EmailTemplateContractProperties = &emailTemplateContractProperties 4370 } 4371 case "id": 4372 if v != nil { 4373 var ID string 4374 err = json.Unmarshal(*v, &ID) 4375 if err != nil { 4376 return err 4377 } 4378 etc.ID = &ID 4379 } 4380 case "name": 4381 if v != nil { 4382 var name string 4383 err = json.Unmarshal(*v, &name) 4384 if err != nil { 4385 return err 4386 } 4387 etc.Name = &name 4388 } 4389 case "type": 4390 if v != nil { 4391 var typeVar string 4392 err = json.Unmarshal(*v, &typeVar) 4393 if err != nil { 4394 return err 4395 } 4396 etc.Type = &typeVar 4397 } 4398 } 4399 } 4400 4401 return nil 4402} 4403 4404// EmailTemplateContractProperties email Template Contract properties. 4405type EmailTemplateContractProperties struct { 4406 // Subject - Subject of the Template. 4407 Subject *string `json:"subject,omitempty"` 4408 // Body - Email Template Body. This should be a valid XDocument 4409 Body *string `json:"body,omitempty"` 4410 // Title - Title of the Template. 4411 Title *string `json:"title,omitempty"` 4412 // Description - Description of the Email Template. 4413 Description *string `json:"description,omitempty"` 4414 // IsDefault - READ-ONLY; Whether the template is the default template provided by Api Management or has been edited. 4415 IsDefault *bool `json:"isDefault,omitempty"` 4416 // Parameters - Email Template Parameter values. 4417 Parameters *[]EmailTemplateParametersContractProperties `json:"parameters,omitempty"` 4418} 4419 4420// MarshalJSON is the custom marshaler for EmailTemplateContractProperties. 4421func (etcp EmailTemplateContractProperties) MarshalJSON() ([]byte, error) { 4422 objectMap := make(map[string]interface{}) 4423 if etcp.Subject != nil { 4424 objectMap["subject"] = etcp.Subject 4425 } 4426 if etcp.Body != nil { 4427 objectMap["body"] = etcp.Body 4428 } 4429 if etcp.Title != nil { 4430 objectMap["title"] = etcp.Title 4431 } 4432 if etcp.Description != nil { 4433 objectMap["description"] = etcp.Description 4434 } 4435 if etcp.Parameters != nil { 4436 objectMap["parameters"] = etcp.Parameters 4437 } 4438 return json.Marshal(objectMap) 4439} 4440 4441// EmailTemplateParametersContractProperties email Template Parameter contract. 4442type EmailTemplateParametersContractProperties struct { 4443 // Name - Template parameter name. 4444 Name *string `json:"name,omitempty"` 4445 // Title - Template parameter title. 4446 Title *string `json:"title,omitempty"` 4447 // Description - Template parameter description. 4448 Description *string `json:"description,omitempty"` 4449} 4450 4451// EmailTemplateUpdateParameterProperties email Template Update Contract properties. 4452type EmailTemplateUpdateParameterProperties struct { 4453 // Subject - Subject of the Template. 4454 Subject *string `json:"subject,omitempty"` 4455 // Title - Title of the Template. 4456 Title *string `json:"title,omitempty"` 4457 // Description - Description of the Email Template. 4458 Description *string `json:"description,omitempty"` 4459 // Body - Email Template Body. This should be a valid XDocument 4460 Body *string `json:"body,omitempty"` 4461 // Parameters - Email Template Parameter values. 4462 Parameters *[]EmailTemplateParametersContractProperties `json:"parameters,omitempty"` 4463} 4464 4465// EmailTemplateUpdateParameters email Template update Parameters. 4466type EmailTemplateUpdateParameters struct { 4467 // EmailTemplateUpdateParameterProperties - Email Template Update contract properties. 4468 *EmailTemplateUpdateParameterProperties `json:"properties,omitempty"` 4469} 4470 4471// MarshalJSON is the custom marshaler for EmailTemplateUpdateParameters. 4472func (etup EmailTemplateUpdateParameters) MarshalJSON() ([]byte, error) { 4473 objectMap := make(map[string]interface{}) 4474 if etup.EmailTemplateUpdateParameterProperties != nil { 4475 objectMap["properties"] = etup.EmailTemplateUpdateParameterProperties 4476 } 4477 return json.Marshal(objectMap) 4478} 4479 4480// UnmarshalJSON is the custom unmarshaler for EmailTemplateUpdateParameters struct. 4481func (etup *EmailTemplateUpdateParameters) UnmarshalJSON(body []byte) error { 4482 var m map[string]*json.RawMessage 4483 err := json.Unmarshal(body, &m) 4484 if err != nil { 4485 return err 4486 } 4487 for k, v := range m { 4488 switch k { 4489 case "properties": 4490 if v != nil { 4491 var emailTemplateUpdateParameterProperties EmailTemplateUpdateParameterProperties 4492 err = json.Unmarshal(*v, &emailTemplateUpdateParameterProperties) 4493 if err != nil { 4494 return err 4495 } 4496 etup.EmailTemplateUpdateParameterProperties = &emailTemplateUpdateParameterProperties 4497 } 4498 } 4499 } 4500 4501 return nil 4502} 4503 4504// ErrorFieldContract error Field contract. 4505type ErrorFieldContract struct { 4506 // Code - Property level error code. 4507 Code *string `json:"code,omitempty"` 4508 // Message - Human-readable representation of property-level error. 4509 Message *string `json:"message,omitempty"` 4510 // Target - Property name. 4511 Target *string `json:"target,omitempty"` 4512} 4513 4514// ErrorResponse error Response. 4515type ErrorResponse struct { 4516 // ErrorResponseBody - Properties of the Error Response. 4517 *ErrorResponseBody `json:"error,omitempty"` 4518} 4519 4520// MarshalJSON is the custom marshaler for ErrorResponse. 4521func (er ErrorResponse) MarshalJSON() ([]byte, error) { 4522 objectMap := make(map[string]interface{}) 4523 if er.ErrorResponseBody != nil { 4524 objectMap["error"] = er.ErrorResponseBody 4525 } 4526 return json.Marshal(objectMap) 4527} 4528 4529// UnmarshalJSON is the custom unmarshaler for ErrorResponse struct. 4530func (er *ErrorResponse) UnmarshalJSON(body []byte) error { 4531 var m map[string]*json.RawMessage 4532 err := json.Unmarshal(body, &m) 4533 if err != nil { 4534 return err 4535 } 4536 for k, v := range m { 4537 switch k { 4538 case "error": 4539 if v != nil { 4540 var errorResponseBody ErrorResponseBody 4541 err = json.Unmarshal(*v, &errorResponseBody) 4542 if err != nil { 4543 return err 4544 } 4545 er.ErrorResponseBody = &errorResponseBody 4546 } 4547 } 4548 } 4549 4550 return nil 4551} 4552 4553// ErrorResponseBody error Body contract. 4554type ErrorResponseBody struct { 4555 // Code - Service-defined error code. This code serves as a sub-status for the HTTP error code specified in the response. 4556 Code *string `json:"code,omitempty"` 4557 // Message - Human-readable representation of the error. 4558 Message *string `json:"message,omitempty"` 4559 // Details - The list of invalid fields send in request, in case of validation error. 4560 Details *[]ErrorFieldContract `json:"details,omitempty"` 4561} 4562 4563// GatewayCollection paged Gateway list representation. 4564type GatewayCollection struct { 4565 autorest.Response `json:"-"` 4566 // Value - READ-ONLY; Page values. 4567 Value *[]GatewayContract `json:"value,omitempty"` 4568 // NextLink - READ-ONLY; Next page link if any. 4569 NextLink *string `json:"nextLink,omitempty"` 4570} 4571 4572// MarshalJSON is the custom marshaler for GatewayCollection. 4573func (gc GatewayCollection) MarshalJSON() ([]byte, error) { 4574 objectMap := make(map[string]interface{}) 4575 return json.Marshal(objectMap) 4576} 4577 4578// GatewayCollectionIterator provides access to a complete listing of GatewayContract values. 4579type GatewayCollectionIterator struct { 4580 i int 4581 page GatewayCollectionPage 4582} 4583 4584// NextWithContext advances to the next value. If there was an error making 4585// the request the iterator does not advance and the error is returned. 4586func (iter *GatewayCollectionIterator) NextWithContext(ctx context.Context) (err error) { 4587 if tracing.IsEnabled() { 4588 ctx = tracing.StartSpan(ctx, fqdn+"/GatewayCollectionIterator.NextWithContext") 4589 defer func() { 4590 sc := -1 4591 if iter.Response().Response.Response != nil { 4592 sc = iter.Response().Response.Response.StatusCode 4593 } 4594 tracing.EndSpan(ctx, sc, err) 4595 }() 4596 } 4597 iter.i++ 4598 if iter.i < len(iter.page.Values()) { 4599 return nil 4600 } 4601 err = iter.page.NextWithContext(ctx) 4602 if err != nil { 4603 iter.i-- 4604 return err 4605 } 4606 iter.i = 0 4607 return nil 4608} 4609 4610// Next advances to the next value. If there was an error making 4611// the request the iterator does not advance and the error is returned. 4612// Deprecated: Use NextWithContext() instead. 4613func (iter *GatewayCollectionIterator) Next() error { 4614 return iter.NextWithContext(context.Background()) 4615} 4616 4617// NotDone returns true if the enumeration should be started or is not yet complete. 4618func (iter GatewayCollectionIterator) NotDone() bool { 4619 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 4620} 4621 4622// Response returns the raw server response from the last page request. 4623func (iter GatewayCollectionIterator) Response() GatewayCollection { 4624 return iter.page.Response() 4625} 4626 4627// Value returns the current value or a zero-initialized value if the 4628// iterator has advanced beyond the end of the collection. 4629func (iter GatewayCollectionIterator) Value() GatewayContract { 4630 if !iter.page.NotDone() { 4631 return GatewayContract{} 4632 } 4633 return iter.page.Values()[iter.i] 4634} 4635 4636// Creates a new instance of the GatewayCollectionIterator type. 4637func NewGatewayCollectionIterator(page GatewayCollectionPage) GatewayCollectionIterator { 4638 return GatewayCollectionIterator{page: page} 4639} 4640 4641// IsEmpty returns true if the ListResult contains no values. 4642func (gc GatewayCollection) IsEmpty() bool { 4643 return gc.Value == nil || len(*gc.Value) == 0 4644} 4645 4646// hasNextLink returns true if the NextLink is not empty. 4647func (gc GatewayCollection) hasNextLink() bool { 4648 return gc.NextLink != nil && len(*gc.NextLink) != 0 4649} 4650 4651// gatewayCollectionPreparer prepares a request to retrieve the next set of results. 4652// It returns nil if no more results exist. 4653func (gc GatewayCollection) gatewayCollectionPreparer(ctx context.Context) (*http.Request, error) { 4654 if !gc.hasNextLink() { 4655 return nil, nil 4656 } 4657 return autorest.Prepare((&http.Request{}).WithContext(ctx), 4658 autorest.AsJSON(), 4659 autorest.AsGet(), 4660 autorest.WithBaseURL(to.String(gc.NextLink))) 4661} 4662 4663// GatewayCollectionPage contains a page of GatewayContract values. 4664type GatewayCollectionPage struct { 4665 fn func(context.Context, GatewayCollection) (GatewayCollection, error) 4666 gc GatewayCollection 4667} 4668 4669// NextWithContext advances to the next page of values. If there was an error making 4670// the request the page does not advance and the error is returned. 4671func (page *GatewayCollectionPage) NextWithContext(ctx context.Context) (err error) { 4672 if tracing.IsEnabled() { 4673 ctx = tracing.StartSpan(ctx, fqdn+"/GatewayCollectionPage.NextWithContext") 4674 defer func() { 4675 sc := -1 4676 if page.Response().Response.Response != nil { 4677 sc = page.Response().Response.Response.StatusCode 4678 } 4679 tracing.EndSpan(ctx, sc, err) 4680 }() 4681 } 4682 for { 4683 next, err := page.fn(ctx, page.gc) 4684 if err != nil { 4685 return err 4686 } 4687 page.gc = next 4688 if !next.hasNextLink() || !next.IsEmpty() { 4689 break 4690 } 4691 } 4692 return nil 4693} 4694 4695// Next advances to the next page of values. If there was an error making 4696// the request the page does not advance and the error is returned. 4697// Deprecated: Use NextWithContext() instead. 4698func (page *GatewayCollectionPage) Next() error { 4699 return page.NextWithContext(context.Background()) 4700} 4701 4702// NotDone returns true if the page enumeration should be started or is not yet complete. 4703func (page GatewayCollectionPage) NotDone() bool { 4704 return !page.gc.IsEmpty() 4705} 4706 4707// Response returns the raw server response from the last page request. 4708func (page GatewayCollectionPage) Response() GatewayCollection { 4709 return page.gc 4710} 4711 4712// Values returns the slice of values for the current page or nil if there are no values. 4713func (page GatewayCollectionPage) Values() []GatewayContract { 4714 if page.gc.IsEmpty() { 4715 return nil 4716 } 4717 return *page.gc.Value 4718} 4719 4720// Creates a new instance of the GatewayCollectionPage type. 4721func NewGatewayCollectionPage(cur GatewayCollection, getNextPage func(context.Context, GatewayCollection) (GatewayCollection, error)) GatewayCollectionPage { 4722 return GatewayCollectionPage{ 4723 fn: getNextPage, 4724 gc: cur, 4725 } 4726} 4727 4728// GatewayContract gateway details. 4729type GatewayContract struct { 4730 autorest.Response `json:"-"` 4731 // GatewayContractProperties - Gateway details. 4732 *GatewayContractProperties `json:"properties,omitempty"` 4733 // ID - READ-ONLY; Resource ID. 4734 ID *string `json:"id,omitempty"` 4735 // Name - READ-ONLY; Resource name. 4736 Name *string `json:"name,omitempty"` 4737 // Type - READ-ONLY; Resource type for API Management resource. 4738 Type *string `json:"type,omitempty"` 4739} 4740 4741// MarshalJSON is the custom marshaler for GatewayContract. 4742func (gc GatewayContract) MarshalJSON() ([]byte, error) { 4743 objectMap := make(map[string]interface{}) 4744 if gc.GatewayContractProperties != nil { 4745 objectMap["properties"] = gc.GatewayContractProperties 4746 } 4747 return json.Marshal(objectMap) 4748} 4749 4750// UnmarshalJSON is the custom unmarshaler for GatewayContract struct. 4751func (gc *GatewayContract) UnmarshalJSON(body []byte) error { 4752 var m map[string]*json.RawMessage 4753 err := json.Unmarshal(body, &m) 4754 if err != nil { 4755 return err 4756 } 4757 for k, v := range m { 4758 switch k { 4759 case "properties": 4760 if v != nil { 4761 var gatewayContractProperties GatewayContractProperties 4762 err = json.Unmarshal(*v, &gatewayContractProperties) 4763 if err != nil { 4764 return err 4765 } 4766 gc.GatewayContractProperties = &gatewayContractProperties 4767 } 4768 case "id": 4769 if v != nil { 4770 var ID string 4771 err = json.Unmarshal(*v, &ID) 4772 if err != nil { 4773 return err 4774 } 4775 gc.ID = &ID 4776 } 4777 case "name": 4778 if v != nil { 4779 var name string 4780 err = json.Unmarshal(*v, &name) 4781 if err != nil { 4782 return err 4783 } 4784 gc.Name = &name 4785 } 4786 case "type": 4787 if v != nil { 4788 var typeVar string 4789 err = json.Unmarshal(*v, &typeVar) 4790 if err != nil { 4791 return err 4792 } 4793 gc.Type = &typeVar 4794 } 4795 } 4796 } 4797 4798 return nil 4799} 4800 4801// GatewayContractProperties properties of the Gateway contract. 4802type GatewayContractProperties struct { 4803 // LocationData - Gateway location. 4804 LocationData *ResourceLocationDataContract `json:"locationData,omitempty"` 4805 // Description - Gateway description 4806 Description *string `json:"description,omitempty"` 4807} 4808 4809// GatewayHostnameConfigurationCollection paged Gateway hostname configuration list representation. 4810type GatewayHostnameConfigurationCollection struct { 4811 autorest.Response `json:"-"` 4812 // Value - READ-ONLY; Page values. 4813 Value *[]GatewayHostnameConfigurationContract `json:"value,omitempty"` 4814 // NextLink - READ-ONLY; Next page link if any. 4815 NextLink *string `json:"nextLink,omitempty"` 4816} 4817 4818// MarshalJSON is the custom marshaler for GatewayHostnameConfigurationCollection. 4819func (ghcc GatewayHostnameConfigurationCollection) MarshalJSON() ([]byte, error) { 4820 objectMap := make(map[string]interface{}) 4821 return json.Marshal(objectMap) 4822} 4823 4824// GatewayHostnameConfigurationCollectionIterator provides access to a complete listing of 4825// GatewayHostnameConfigurationContract values. 4826type GatewayHostnameConfigurationCollectionIterator struct { 4827 i int 4828 page GatewayHostnameConfigurationCollectionPage 4829} 4830 4831// NextWithContext advances to the next value. If there was an error making 4832// the request the iterator does not advance and the error is returned. 4833func (iter *GatewayHostnameConfigurationCollectionIterator) NextWithContext(ctx context.Context) (err error) { 4834 if tracing.IsEnabled() { 4835 ctx = tracing.StartSpan(ctx, fqdn+"/GatewayHostnameConfigurationCollectionIterator.NextWithContext") 4836 defer func() { 4837 sc := -1 4838 if iter.Response().Response.Response != nil { 4839 sc = iter.Response().Response.Response.StatusCode 4840 } 4841 tracing.EndSpan(ctx, sc, err) 4842 }() 4843 } 4844 iter.i++ 4845 if iter.i < len(iter.page.Values()) { 4846 return nil 4847 } 4848 err = iter.page.NextWithContext(ctx) 4849 if err != nil { 4850 iter.i-- 4851 return err 4852 } 4853 iter.i = 0 4854 return nil 4855} 4856 4857// Next advances to the next value. If there was an error making 4858// the request the iterator does not advance and the error is returned. 4859// Deprecated: Use NextWithContext() instead. 4860func (iter *GatewayHostnameConfigurationCollectionIterator) Next() error { 4861 return iter.NextWithContext(context.Background()) 4862} 4863 4864// NotDone returns true if the enumeration should be started or is not yet complete. 4865func (iter GatewayHostnameConfigurationCollectionIterator) NotDone() bool { 4866 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 4867} 4868 4869// Response returns the raw server response from the last page request. 4870func (iter GatewayHostnameConfigurationCollectionIterator) Response() GatewayHostnameConfigurationCollection { 4871 return iter.page.Response() 4872} 4873 4874// Value returns the current value or a zero-initialized value if the 4875// iterator has advanced beyond the end of the collection. 4876func (iter GatewayHostnameConfigurationCollectionIterator) Value() GatewayHostnameConfigurationContract { 4877 if !iter.page.NotDone() { 4878 return GatewayHostnameConfigurationContract{} 4879 } 4880 return iter.page.Values()[iter.i] 4881} 4882 4883// Creates a new instance of the GatewayHostnameConfigurationCollectionIterator type. 4884func NewGatewayHostnameConfigurationCollectionIterator(page GatewayHostnameConfigurationCollectionPage) GatewayHostnameConfigurationCollectionIterator { 4885 return GatewayHostnameConfigurationCollectionIterator{page: page} 4886} 4887 4888// IsEmpty returns true if the ListResult contains no values. 4889func (ghcc GatewayHostnameConfigurationCollection) IsEmpty() bool { 4890 return ghcc.Value == nil || len(*ghcc.Value) == 0 4891} 4892 4893// hasNextLink returns true if the NextLink is not empty. 4894func (ghcc GatewayHostnameConfigurationCollection) hasNextLink() bool { 4895 return ghcc.NextLink != nil && len(*ghcc.NextLink) != 0 4896} 4897 4898// gatewayHostnameConfigurationCollectionPreparer prepares a request to retrieve the next set of results. 4899// It returns nil if no more results exist. 4900func (ghcc GatewayHostnameConfigurationCollection) gatewayHostnameConfigurationCollectionPreparer(ctx context.Context) (*http.Request, error) { 4901 if !ghcc.hasNextLink() { 4902 return nil, nil 4903 } 4904 return autorest.Prepare((&http.Request{}).WithContext(ctx), 4905 autorest.AsJSON(), 4906 autorest.AsGet(), 4907 autorest.WithBaseURL(to.String(ghcc.NextLink))) 4908} 4909 4910// GatewayHostnameConfigurationCollectionPage contains a page of GatewayHostnameConfigurationContract 4911// values. 4912type GatewayHostnameConfigurationCollectionPage struct { 4913 fn func(context.Context, GatewayHostnameConfigurationCollection) (GatewayHostnameConfigurationCollection, error) 4914 ghcc GatewayHostnameConfigurationCollection 4915} 4916 4917// NextWithContext advances to the next page of values. If there was an error making 4918// the request the page does not advance and the error is returned. 4919func (page *GatewayHostnameConfigurationCollectionPage) NextWithContext(ctx context.Context) (err error) { 4920 if tracing.IsEnabled() { 4921 ctx = tracing.StartSpan(ctx, fqdn+"/GatewayHostnameConfigurationCollectionPage.NextWithContext") 4922 defer func() { 4923 sc := -1 4924 if page.Response().Response.Response != nil { 4925 sc = page.Response().Response.Response.StatusCode 4926 } 4927 tracing.EndSpan(ctx, sc, err) 4928 }() 4929 } 4930 for { 4931 next, err := page.fn(ctx, page.ghcc) 4932 if err != nil { 4933 return err 4934 } 4935 page.ghcc = next 4936 if !next.hasNextLink() || !next.IsEmpty() { 4937 break 4938 } 4939 } 4940 return nil 4941} 4942 4943// Next advances to the next page of values. If there was an error making 4944// the request the page does not advance and the error is returned. 4945// Deprecated: Use NextWithContext() instead. 4946func (page *GatewayHostnameConfigurationCollectionPage) Next() error { 4947 return page.NextWithContext(context.Background()) 4948} 4949 4950// NotDone returns true if the page enumeration should be started or is not yet complete. 4951func (page GatewayHostnameConfigurationCollectionPage) NotDone() bool { 4952 return !page.ghcc.IsEmpty() 4953} 4954 4955// Response returns the raw server response from the last page request. 4956func (page GatewayHostnameConfigurationCollectionPage) Response() GatewayHostnameConfigurationCollection { 4957 return page.ghcc 4958} 4959 4960// Values returns the slice of values for the current page or nil if there are no values. 4961func (page GatewayHostnameConfigurationCollectionPage) Values() []GatewayHostnameConfigurationContract { 4962 if page.ghcc.IsEmpty() { 4963 return nil 4964 } 4965 return *page.ghcc.Value 4966} 4967 4968// Creates a new instance of the GatewayHostnameConfigurationCollectionPage type. 4969func NewGatewayHostnameConfigurationCollectionPage(cur GatewayHostnameConfigurationCollection, getNextPage func(context.Context, GatewayHostnameConfigurationCollection) (GatewayHostnameConfigurationCollection, error)) GatewayHostnameConfigurationCollectionPage { 4970 return GatewayHostnameConfigurationCollectionPage{ 4971 fn: getNextPage, 4972 ghcc: cur, 4973 } 4974} 4975 4976// GatewayHostnameConfigurationContract gateway hostname configuration details. 4977type GatewayHostnameConfigurationContract struct { 4978 autorest.Response `json:"-"` 4979 // GatewayHostnameConfigurationContractProperties - Gateway hostname configuration details. 4980 *GatewayHostnameConfigurationContractProperties `json:"properties,omitempty"` 4981 // ID - READ-ONLY; Resource ID. 4982 ID *string `json:"id,omitempty"` 4983 // Name - READ-ONLY; Resource name. 4984 Name *string `json:"name,omitempty"` 4985 // Type - READ-ONLY; Resource type for API Management resource. 4986 Type *string `json:"type,omitempty"` 4987} 4988 4989// MarshalJSON is the custom marshaler for GatewayHostnameConfigurationContract. 4990func (ghcc GatewayHostnameConfigurationContract) MarshalJSON() ([]byte, error) { 4991 objectMap := make(map[string]interface{}) 4992 if ghcc.GatewayHostnameConfigurationContractProperties != nil { 4993 objectMap["properties"] = ghcc.GatewayHostnameConfigurationContractProperties 4994 } 4995 return json.Marshal(objectMap) 4996} 4997 4998// UnmarshalJSON is the custom unmarshaler for GatewayHostnameConfigurationContract struct. 4999func (ghcc *GatewayHostnameConfigurationContract) UnmarshalJSON(body []byte) error { 5000 var m map[string]*json.RawMessage 5001 err := json.Unmarshal(body, &m) 5002 if err != nil { 5003 return err 5004 } 5005 for k, v := range m { 5006 switch k { 5007 case "properties": 5008 if v != nil { 5009 var gatewayHostnameConfigurationContractProperties GatewayHostnameConfigurationContractProperties 5010 err = json.Unmarshal(*v, &gatewayHostnameConfigurationContractProperties) 5011 if err != nil { 5012 return err 5013 } 5014 ghcc.GatewayHostnameConfigurationContractProperties = &gatewayHostnameConfigurationContractProperties 5015 } 5016 case "id": 5017 if v != nil { 5018 var ID string 5019 err = json.Unmarshal(*v, &ID) 5020 if err != nil { 5021 return err 5022 } 5023 ghcc.ID = &ID 5024 } 5025 case "name": 5026 if v != nil { 5027 var name string 5028 err = json.Unmarshal(*v, &name) 5029 if err != nil { 5030 return err 5031 } 5032 ghcc.Name = &name 5033 } 5034 case "type": 5035 if v != nil { 5036 var typeVar string 5037 err = json.Unmarshal(*v, &typeVar) 5038 if err != nil { 5039 return err 5040 } 5041 ghcc.Type = &typeVar 5042 } 5043 } 5044 } 5045 5046 return nil 5047} 5048 5049// GatewayHostnameConfigurationContractProperties gateway hostname configuration details. 5050type GatewayHostnameConfigurationContractProperties struct { 5051 // Hostname - Hostname value. Supports valid domain name, partial or full wildcard 5052 Hostname *string `json:"hostname,omitempty"` 5053 // CertificateID - Identifier of Certificate entity that will be used for TLS connection establishment 5054 CertificateID *string `json:"certificateId,omitempty"` 5055 // NegotiateClientCertificate - Determines whether gateway requests client certificate 5056 NegotiateClientCertificate *bool `json:"negotiateClientCertificate,omitempty"` 5057} 5058 5059// GatewayKeyRegenerationRequestContract gateway key regeneration request contract properties. 5060type GatewayKeyRegenerationRequestContract struct { 5061 // KeyType - The Key being regenerated. Possible values include: 'Primary', 'Secondary' 5062 KeyType KeyType `json:"keyType,omitempty"` 5063} 5064 5065// GatewayKeysContract gateway authentication keys. 5066type GatewayKeysContract struct { 5067 autorest.Response `json:"-"` 5068 // Primary - Primary gateway key. 5069 Primary *string `json:"primary,omitempty"` 5070 // Secondary - Secondary gateway key. 5071 Secondary *string `json:"secondary,omitempty"` 5072} 5073 5074// GatewayTokenContract gateway access token. 5075type GatewayTokenContract struct { 5076 autorest.Response `json:"-"` 5077 // Value - Shared Access Authentication token value for the Gateway. 5078 Value *string `json:"value,omitempty"` 5079} 5080 5081// GatewayTokenRequestContract gateway token request contract properties. 5082type GatewayTokenRequestContract struct { 5083 // KeyType - The Key to be used to generate gateway token. Possible values include: 'Primary', 'Secondary' 5084 KeyType KeyType `json:"keyType,omitempty"` 5085 // 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. 5086 Expiry *date.Time `json:"expiry,omitempty"` 5087} 5088 5089// GenerateSsoURLResult generate SSO Url operations response details. 5090type GenerateSsoURLResult struct { 5091 autorest.Response `json:"-"` 5092 // Value - Redirect Url containing the SSO URL value. 5093 Value *string `json:"value,omitempty"` 5094} 5095 5096// GroupCollection paged Group list representation. 5097type GroupCollection struct { 5098 autorest.Response `json:"-"` 5099 // Value - Page values. 5100 Value *[]GroupContract `json:"value,omitempty"` 5101 // NextLink - Next page link if any. 5102 NextLink *string `json:"nextLink,omitempty"` 5103} 5104 5105// GroupCollectionIterator provides access to a complete listing of GroupContract values. 5106type GroupCollectionIterator struct { 5107 i int 5108 page GroupCollectionPage 5109} 5110 5111// NextWithContext advances to the next value. If there was an error making 5112// the request the iterator does not advance and the error is returned. 5113func (iter *GroupCollectionIterator) NextWithContext(ctx context.Context) (err error) { 5114 if tracing.IsEnabled() { 5115 ctx = tracing.StartSpan(ctx, fqdn+"/GroupCollectionIterator.NextWithContext") 5116 defer func() { 5117 sc := -1 5118 if iter.Response().Response.Response != nil { 5119 sc = iter.Response().Response.Response.StatusCode 5120 } 5121 tracing.EndSpan(ctx, sc, err) 5122 }() 5123 } 5124 iter.i++ 5125 if iter.i < len(iter.page.Values()) { 5126 return nil 5127 } 5128 err = iter.page.NextWithContext(ctx) 5129 if err != nil { 5130 iter.i-- 5131 return err 5132 } 5133 iter.i = 0 5134 return nil 5135} 5136 5137// Next advances to the next value. If there was an error making 5138// the request the iterator does not advance and the error is returned. 5139// Deprecated: Use NextWithContext() instead. 5140func (iter *GroupCollectionIterator) Next() error { 5141 return iter.NextWithContext(context.Background()) 5142} 5143 5144// NotDone returns true if the enumeration should be started or is not yet complete. 5145func (iter GroupCollectionIterator) NotDone() bool { 5146 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 5147} 5148 5149// Response returns the raw server response from the last page request. 5150func (iter GroupCollectionIterator) Response() GroupCollection { 5151 return iter.page.Response() 5152} 5153 5154// Value returns the current value or a zero-initialized value if the 5155// iterator has advanced beyond the end of the collection. 5156func (iter GroupCollectionIterator) Value() GroupContract { 5157 if !iter.page.NotDone() { 5158 return GroupContract{} 5159 } 5160 return iter.page.Values()[iter.i] 5161} 5162 5163// Creates a new instance of the GroupCollectionIterator type. 5164func NewGroupCollectionIterator(page GroupCollectionPage) GroupCollectionIterator { 5165 return GroupCollectionIterator{page: page} 5166} 5167 5168// IsEmpty returns true if the ListResult contains no values. 5169func (gc GroupCollection) IsEmpty() bool { 5170 return gc.Value == nil || len(*gc.Value) == 0 5171} 5172 5173// hasNextLink returns true if the NextLink is not empty. 5174func (gc GroupCollection) hasNextLink() bool { 5175 return gc.NextLink != nil && len(*gc.NextLink) != 0 5176} 5177 5178// groupCollectionPreparer prepares a request to retrieve the next set of results. 5179// It returns nil if no more results exist. 5180func (gc GroupCollection) groupCollectionPreparer(ctx context.Context) (*http.Request, error) { 5181 if !gc.hasNextLink() { 5182 return nil, nil 5183 } 5184 return autorest.Prepare((&http.Request{}).WithContext(ctx), 5185 autorest.AsJSON(), 5186 autorest.AsGet(), 5187 autorest.WithBaseURL(to.String(gc.NextLink))) 5188} 5189 5190// GroupCollectionPage contains a page of GroupContract values. 5191type GroupCollectionPage struct { 5192 fn func(context.Context, GroupCollection) (GroupCollection, error) 5193 gc GroupCollection 5194} 5195 5196// NextWithContext advances to the next page of values. If there was an error making 5197// the request the page does not advance and the error is returned. 5198func (page *GroupCollectionPage) NextWithContext(ctx context.Context) (err error) { 5199 if tracing.IsEnabled() { 5200 ctx = tracing.StartSpan(ctx, fqdn+"/GroupCollectionPage.NextWithContext") 5201 defer func() { 5202 sc := -1 5203 if page.Response().Response.Response != nil { 5204 sc = page.Response().Response.Response.StatusCode 5205 } 5206 tracing.EndSpan(ctx, sc, err) 5207 }() 5208 } 5209 for { 5210 next, err := page.fn(ctx, page.gc) 5211 if err != nil { 5212 return err 5213 } 5214 page.gc = next 5215 if !next.hasNextLink() || !next.IsEmpty() { 5216 break 5217 } 5218 } 5219 return nil 5220} 5221 5222// Next advances to the next page of values. If there was an error making 5223// the request the page does not advance and the error is returned. 5224// Deprecated: Use NextWithContext() instead. 5225func (page *GroupCollectionPage) Next() error { 5226 return page.NextWithContext(context.Background()) 5227} 5228 5229// NotDone returns true if the page enumeration should be started or is not yet complete. 5230func (page GroupCollectionPage) NotDone() bool { 5231 return !page.gc.IsEmpty() 5232} 5233 5234// Response returns the raw server response from the last page request. 5235func (page GroupCollectionPage) Response() GroupCollection { 5236 return page.gc 5237} 5238 5239// Values returns the slice of values for the current page or nil if there are no values. 5240func (page GroupCollectionPage) Values() []GroupContract { 5241 if page.gc.IsEmpty() { 5242 return nil 5243 } 5244 return *page.gc.Value 5245} 5246 5247// Creates a new instance of the GroupCollectionPage type. 5248func NewGroupCollectionPage(cur GroupCollection, getNextPage func(context.Context, GroupCollection) (GroupCollection, error)) GroupCollectionPage { 5249 return GroupCollectionPage{ 5250 fn: getNextPage, 5251 gc: cur, 5252 } 5253} 5254 5255// GroupContract contract details. 5256type GroupContract struct { 5257 autorest.Response `json:"-"` 5258 // GroupContractProperties - Group entity contract properties. 5259 *GroupContractProperties `json:"properties,omitempty"` 5260 // ID - READ-ONLY; Resource ID. 5261 ID *string `json:"id,omitempty"` 5262 // Name - READ-ONLY; Resource name. 5263 Name *string `json:"name,omitempty"` 5264 // Type - READ-ONLY; Resource type for API Management resource. 5265 Type *string `json:"type,omitempty"` 5266} 5267 5268// MarshalJSON is the custom marshaler for GroupContract. 5269func (gc GroupContract) MarshalJSON() ([]byte, error) { 5270 objectMap := make(map[string]interface{}) 5271 if gc.GroupContractProperties != nil { 5272 objectMap["properties"] = gc.GroupContractProperties 5273 } 5274 return json.Marshal(objectMap) 5275} 5276 5277// UnmarshalJSON is the custom unmarshaler for GroupContract struct. 5278func (gc *GroupContract) UnmarshalJSON(body []byte) error { 5279 var m map[string]*json.RawMessage 5280 err := json.Unmarshal(body, &m) 5281 if err != nil { 5282 return err 5283 } 5284 for k, v := range m { 5285 switch k { 5286 case "properties": 5287 if v != nil { 5288 var groupContractProperties GroupContractProperties 5289 err = json.Unmarshal(*v, &groupContractProperties) 5290 if err != nil { 5291 return err 5292 } 5293 gc.GroupContractProperties = &groupContractProperties 5294 } 5295 case "id": 5296 if v != nil { 5297 var ID string 5298 err = json.Unmarshal(*v, &ID) 5299 if err != nil { 5300 return err 5301 } 5302 gc.ID = &ID 5303 } 5304 case "name": 5305 if v != nil { 5306 var name string 5307 err = json.Unmarshal(*v, &name) 5308 if err != nil { 5309 return err 5310 } 5311 gc.Name = &name 5312 } 5313 case "type": 5314 if v != nil { 5315 var typeVar string 5316 err = json.Unmarshal(*v, &typeVar) 5317 if err != nil { 5318 return err 5319 } 5320 gc.Type = &typeVar 5321 } 5322 } 5323 } 5324 5325 return nil 5326} 5327 5328// GroupContractProperties group contract Properties. 5329type GroupContractProperties struct { 5330 // DisplayName - Group name. 5331 DisplayName *string `json:"displayName,omitempty"` 5332 // Description - Group description. Can contain HTML formatting tags. 5333 Description *string `json:"description,omitempty"` 5334 // BuiltIn - READ-ONLY; true if the group is one of the three system groups (Administrators, Developers, or Guests); otherwise false. 5335 BuiltIn *bool `json:"builtIn,omitempty"` 5336 // Type - Group type. Possible values include: 'Custom', 'System', 'External' 5337 Type GroupType `json:"type,omitempty"` 5338 // 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. 5339 ExternalID *string `json:"externalId,omitempty"` 5340} 5341 5342// MarshalJSON is the custom marshaler for GroupContractProperties. 5343func (gcp GroupContractProperties) MarshalJSON() ([]byte, error) { 5344 objectMap := make(map[string]interface{}) 5345 if gcp.DisplayName != nil { 5346 objectMap["displayName"] = gcp.DisplayName 5347 } 5348 if gcp.Description != nil { 5349 objectMap["description"] = gcp.Description 5350 } 5351 if gcp.Type != "" { 5352 objectMap["type"] = gcp.Type 5353 } 5354 if gcp.ExternalID != nil { 5355 objectMap["externalId"] = gcp.ExternalID 5356 } 5357 return json.Marshal(objectMap) 5358} 5359 5360// GroupCreateParameters parameters supplied to the Create Group operation. 5361type GroupCreateParameters struct { 5362 // GroupCreateParametersProperties - Properties supplied to Create Group operation. 5363 *GroupCreateParametersProperties `json:"properties,omitempty"` 5364} 5365 5366// MarshalJSON is the custom marshaler for GroupCreateParameters. 5367func (gcp GroupCreateParameters) MarshalJSON() ([]byte, error) { 5368 objectMap := make(map[string]interface{}) 5369 if gcp.GroupCreateParametersProperties != nil { 5370 objectMap["properties"] = gcp.GroupCreateParametersProperties 5371 } 5372 return json.Marshal(objectMap) 5373} 5374 5375// UnmarshalJSON is the custom unmarshaler for GroupCreateParameters struct. 5376func (gcp *GroupCreateParameters) UnmarshalJSON(body []byte) error { 5377 var m map[string]*json.RawMessage 5378 err := json.Unmarshal(body, &m) 5379 if err != nil { 5380 return err 5381 } 5382 for k, v := range m { 5383 switch k { 5384 case "properties": 5385 if v != nil { 5386 var groupCreateParametersProperties GroupCreateParametersProperties 5387 err = json.Unmarshal(*v, &groupCreateParametersProperties) 5388 if err != nil { 5389 return err 5390 } 5391 gcp.GroupCreateParametersProperties = &groupCreateParametersProperties 5392 } 5393 } 5394 } 5395 5396 return nil 5397} 5398 5399// GroupCreateParametersProperties parameters supplied to the Create Group operation. 5400type GroupCreateParametersProperties struct { 5401 // DisplayName - Group name. 5402 DisplayName *string `json:"displayName,omitempty"` 5403 // Description - Group description. 5404 Description *string `json:"description,omitempty"` 5405 // Type - Group type. Possible values include: 'Custom', 'System', 'External' 5406 Type GroupType `json:"type,omitempty"` 5407 // 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. 5408 ExternalID *string `json:"externalId,omitempty"` 5409} 5410 5411// GroupUpdateParameters parameters supplied to the Update Group operation. 5412type GroupUpdateParameters struct { 5413 // GroupUpdateParametersProperties - Group entity update contract properties. 5414 *GroupUpdateParametersProperties `json:"properties,omitempty"` 5415} 5416 5417// MarshalJSON is the custom marshaler for GroupUpdateParameters. 5418func (gup GroupUpdateParameters) MarshalJSON() ([]byte, error) { 5419 objectMap := make(map[string]interface{}) 5420 if gup.GroupUpdateParametersProperties != nil { 5421 objectMap["properties"] = gup.GroupUpdateParametersProperties 5422 } 5423 return json.Marshal(objectMap) 5424} 5425 5426// UnmarshalJSON is the custom unmarshaler for GroupUpdateParameters struct. 5427func (gup *GroupUpdateParameters) UnmarshalJSON(body []byte) error { 5428 var m map[string]*json.RawMessage 5429 err := json.Unmarshal(body, &m) 5430 if err != nil { 5431 return err 5432 } 5433 for k, v := range m { 5434 switch k { 5435 case "properties": 5436 if v != nil { 5437 var groupUpdateParametersProperties GroupUpdateParametersProperties 5438 err = json.Unmarshal(*v, &groupUpdateParametersProperties) 5439 if err != nil { 5440 return err 5441 } 5442 gup.GroupUpdateParametersProperties = &groupUpdateParametersProperties 5443 } 5444 } 5445 } 5446 5447 return nil 5448} 5449 5450// GroupUpdateParametersProperties parameters supplied to the Update Group operation. 5451type GroupUpdateParametersProperties struct { 5452 // DisplayName - Group name. 5453 DisplayName *string `json:"displayName,omitempty"` 5454 // Description - Group description. 5455 Description *string `json:"description,omitempty"` 5456 // Type - Group type. Possible values include: 'Custom', 'System', 'External' 5457 Type GroupType `json:"type,omitempty"` 5458 // 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. 5459 ExternalID *string `json:"externalId,omitempty"` 5460} 5461 5462// HostnameConfiguration custom hostname configuration. 5463type HostnameConfiguration struct { 5464 // Type - Hostname type. Possible values include: 'HostnameTypeProxy', 'HostnameTypePortal', 'HostnameTypeManagement', 'HostnameTypeScm', 'HostnameTypeDeveloperPortal' 5465 Type HostnameType `json:"type,omitempty"` 5466 // HostName - Hostname to configure on the Api Management service. 5467 HostName *string `json:"hostName,omitempty"` 5468 // 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* 5469 KeyVaultID *string `json:"keyVaultId,omitempty"` 5470 // EncodedCertificate - Base64 Encoded certificate. 5471 EncodedCertificate *string `json:"encodedCertificate,omitempty"` 5472 // CertificatePassword - Certificate Password. 5473 CertificatePassword *string `json:"certificatePassword,omitempty"` 5474 // 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. 5475 DefaultSslBinding *bool `json:"defaultSslBinding,omitempty"` 5476 // NegotiateClientCertificate - Specify true to always negotiate client certificate on the hostname. Default Value is false. 5477 NegotiateClientCertificate *bool `json:"negotiateClientCertificate,omitempty"` 5478 // Certificate - Certificate information. 5479 Certificate *CertificateInformation `json:"certificate,omitempty"` 5480} 5481 5482// HTTPMessageDiagnostic http message diagnostic settings. 5483type HTTPMessageDiagnostic struct { 5484 // Headers - Array of HTTP Headers to log. 5485 Headers *[]string `json:"headers,omitempty"` 5486 // Body - Body logging settings. 5487 Body *BodyDiagnosticSettings `json:"body,omitempty"` 5488} 5489 5490// IdentityProviderBaseParameters identity Provider Base Parameter Properties. 5491type IdentityProviderBaseParameters struct { 5492 // Type - Identity Provider Type identifier. Possible values include: 'Facebook', 'Google', 'Microsoft', 'Twitter', 'Aad', 'AadB2C' 5493 Type IdentityProviderType `json:"type,omitempty"` 5494 // SigninTenant - The TenantId to use instead of Common when logging into Active Directory 5495 SigninTenant *string `json:"signinTenant,omitempty"` 5496 // AllowedTenants - List of Allowed Tenants when configuring Azure Active Directory login. 5497 AllowedTenants *[]string `json:"allowedTenants,omitempty"` 5498 // Authority - OpenID Connect discovery endpoint hostname for AAD or AAD B2C. 5499 Authority *string `json:"authority,omitempty"` 5500 // SignupPolicyName - Signup Policy Name. Only applies to AAD B2C Identity Provider. 5501 SignupPolicyName *string `json:"signupPolicyName,omitempty"` 5502 // SigninPolicyName - Signin Policy Name. Only applies to AAD B2C Identity Provider. 5503 SigninPolicyName *string `json:"signinPolicyName,omitempty"` 5504 // ProfileEditingPolicyName - Profile Editing Policy Name. Only applies to AAD B2C Identity Provider. 5505 ProfileEditingPolicyName *string `json:"profileEditingPolicyName,omitempty"` 5506 // PasswordResetPolicyName - Password Reset Policy Name. Only applies to AAD B2C Identity Provider. 5507 PasswordResetPolicyName *string `json:"passwordResetPolicyName,omitempty"` 5508} 5509 5510// IdentityProviderContract identity Provider details. 5511type IdentityProviderContract struct { 5512 autorest.Response `json:"-"` 5513 // IdentityProviderContractProperties - Identity Provider contract properties. 5514 *IdentityProviderContractProperties `json:"properties,omitempty"` 5515 // ID - READ-ONLY; Resource ID. 5516 ID *string `json:"id,omitempty"` 5517 // Name - READ-ONLY; Resource name. 5518 Name *string `json:"name,omitempty"` 5519 // Type - READ-ONLY; Resource type for API Management resource. 5520 Type *string `json:"type,omitempty"` 5521} 5522 5523// MarshalJSON is the custom marshaler for IdentityProviderContract. 5524func (ipc IdentityProviderContract) MarshalJSON() ([]byte, error) { 5525 objectMap := make(map[string]interface{}) 5526 if ipc.IdentityProviderContractProperties != nil { 5527 objectMap["properties"] = ipc.IdentityProviderContractProperties 5528 } 5529 return json.Marshal(objectMap) 5530} 5531 5532// UnmarshalJSON is the custom unmarshaler for IdentityProviderContract struct. 5533func (ipc *IdentityProviderContract) UnmarshalJSON(body []byte) error { 5534 var m map[string]*json.RawMessage 5535 err := json.Unmarshal(body, &m) 5536 if err != nil { 5537 return err 5538 } 5539 for k, v := range m { 5540 switch k { 5541 case "properties": 5542 if v != nil { 5543 var identityProviderContractProperties IdentityProviderContractProperties 5544 err = json.Unmarshal(*v, &identityProviderContractProperties) 5545 if err != nil { 5546 return err 5547 } 5548 ipc.IdentityProviderContractProperties = &identityProviderContractProperties 5549 } 5550 case "id": 5551 if v != nil { 5552 var ID string 5553 err = json.Unmarshal(*v, &ID) 5554 if err != nil { 5555 return err 5556 } 5557 ipc.ID = &ID 5558 } 5559 case "name": 5560 if v != nil { 5561 var name string 5562 err = json.Unmarshal(*v, &name) 5563 if err != nil { 5564 return err 5565 } 5566 ipc.Name = &name 5567 } 5568 case "type": 5569 if v != nil { 5570 var typeVar string 5571 err = json.Unmarshal(*v, &typeVar) 5572 if err != nil { 5573 return err 5574 } 5575 ipc.Type = &typeVar 5576 } 5577 } 5578 } 5579 5580 return nil 5581} 5582 5583// IdentityProviderContractProperties the external Identity Providers like Facebook, Google, Microsoft, 5584// Twitter or Azure Active Directory which can be used to enable access to the API Management service 5585// developer portal for all users. 5586type IdentityProviderContractProperties struct { 5587 // 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. 5588 ClientID *string `json:"clientId,omitempty"` 5589 // 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. This property will not be filled on 'GET' operations! Use '/listSecrets' POST request to get the value. 5590 ClientSecret *string `json:"clientSecret,omitempty"` 5591 // Type - Identity Provider Type identifier. Possible values include: 'Facebook', 'Google', 'Microsoft', 'Twitter', 'Aad', 'AadB2C' 5592 Type IdentityProviderType `json:"type,omitempty"` 5593 // SigninTenant - The TenantId to use instead of Common when logging into Active Directory 5594 SigninTenant *string `json:"signinTenant,omitempty"` 5595 // AllowedTenants - List of Allowed Tenants when configuring Azure Active Directory login. 5596 AllowedTenants *[]string `json:"allowedTenants,omitempty"` 5597 // Authority - OpenID Connect discovery endpoint hostname for AAD or AAD B2C. 5598 Authority *string `json:"authority,omitempty"` 5599 // SignupPolicyName - Signup Policy Name. Only applies to AAD B2C Identity Provider. 5600 SignupPolicyName *string `json:"signupPolicyName,omitempty"` 5601 // SigninPolicyName - Signin Policy Name. Only applies to AAD B2C Identity Provider. 5602 SigninPolicyName *string `json:"signinPolicyName,omitempty"` 5603 // ProfileEditingPolicyName - Profile Editing Policy Name. Only applies to AAD B2C Identity Provider. 5604 ProfileEditingPolicyName *string `json:"profileEditingPolicyName,omitempty"` 5605 // PasswordResetPolicyName - Password Reset Policy Name. Only applies to AAD B2C Identity Provider. 5606 PasswordResetPolicyName *string `json:"passwordResetPolicyName,omitempty"` 5607} 5608 5609// IdentityProviderCreateContract identity Provider details. 5610type IdentityProviderCreateContract struct { 5611 // IdentityProviderCreateContractProperties - Identity Provider contract properties. 5612 *IdentityProviderCreateContractProperties `json:"properties,omitempty"` 5613 // ID - READ-ONLY; Resource ID. 5614 ID *string `json:"id,omitempty"` 5615 // Name - READ-ONLY; Resource name. 5616 Name *string `json:"name,omitempty"` 5617 // Type - READ-ONLY; Resource type for API Management resource. 5618 Type *string `json:"type,omitempty"` 5619} 5620 5621// MarshalJSON is the custom marshaler for IdentityProviderCreateContract. 5622func (ipcc IdentityProviderCreateContract) MarshalJSON() ([]byte, error) { 5623 objectMap := make(map[string]interface{}) 5624 if ipcc.IdentityProviderCreateContractProperties != nil { 5625 objectMap["properties"] = ipcc.IdentityProviderCreateContractProperties 5626 } 5627 return json.Marshal(objectMap) 5628} 5629 5630// UnmarshalJSON is the custom unmarshaler for IdentityProviderCreateContract struct. 5631func (ipcc *IdentityProviderCreateContract) UnmarshalJSON(body []byte) error { 5632 var m map[string]*json.RawMessage 5633 err := json.Unmarshal(body, &m) 5634 if err != nil { 5635 return err 5636 } 5637 for k, v := range m { 5638 switch k { 5639 case "properties": 5640 if v != nil { 5641 var identityProviderCreateContractProperties IdentityProviderCreateContractProperties 5642 err = json.Unmarshal(*v, &identityProviderCreateContractProperties) 5643 if err != nil { 5644 return err 5645 } 5646 ipcc.IdentityProviderCreateContractProperties = &identityProviderCreateContractProperties 5647 } 5648 case "id": 5649 if v != nil { 5650 var ID string 5651 err = json.Unmarshal(*v, &ID) 5652 if err != nil { 5653 return err 5654 } 5655 ipcc.ID = &ID 5656 } 5657 case "name": 5658 if v != nil { 5659 var name string 5660 err = json.Unmarshal(*v, &name) 5661 if err != nil { 5662 return err 5663 } 5664 ipcc.Name = &name 5665 } 5666 case "type": 5667 if v != nil { 5668 var typeVar string 5669 err = json.Unmarshal(*v, &typeVar) 5670 if err != nil { 5671 return err 5672 } 5673 ipcc.Type = &typeVar 5674 } 5675 } 5676 } 5677 5678 return nil 5679} 5680 5681// IdentityProviderCreateContractProperties the external Identity Providers like Facebook, Google, 5682// Microsoft, Twitter or Azure Active Directory which can be used to enable access to the API Management 5683// service developer portal for all users. 5684type IdentityProviderCreateContractProperties struct { 5685 // 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. 5686 ClientID *string `json:"clientId,omitempty"` 5687 // 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. This property will not be filled on 'GET' operations! Use '/listSecrets' POST request to get the value. 5688 ClientSecret *string `json:"clientSecret,omitempty"` 5689 // Type - Identity Provider Type identifier. Possible values include: 'Facebook', 'Google', 'Microsoft', 'Twitter', 'Aad', 'AadB2C' 5690 Type IdentityProviderType `json:"type,omitempty"` 5691 // SigninTenant - The TenantId to use instead of Common when logging into Active Directory 5692 SigninTenant *string `json:"signinTenant,omitempty"` 5693 // AllowedTenants - List of Allowed Tenants when configuring Azure Active Directory login. 5694 AllowedTenants *[]string `json:"allowedTenants,omitempty"` 5695 // Authority - OpenID Connect discovery endpoint hostname for AAD or AAD B2C. 5696 Authority *string `json:"authority,omitempty"` 5697 // SignupPolicyName - Signup Policy Name. Only applies to AAD B2C Identity Provider. 5698 SignupPolicyName *string `json:"signupPolicyName,omitempty"` 5699 // SigninPolicyName - Signin Policy Name. Only applies to AAD B2C Identity Provider. 5700 SigninPolicyName *string `json:"signinPolicyName,omitempty"` 5701 // ProfileEditingPolicyName - Profile Editing Policy Name. Only applies to AAD B2C Identity Provider. 5702 ProfileEditingPolicyName *string `json:"profileEditingPolicyName,omitempty"` 5703 // PasswordResetPolicyName - Password Reset Policy Name. Only applies to AAD B2C Identity Provider. 5704 PasswordResetPolicyName *string `json:"passwordResetPolicyName,omitempty"` 5705} 5706 5707// IdentityProviderList list of all the Identity Providers configured on the service instance. 5708type IdentityProviderList struct { 5709 autorest.Response `json:"-"` 5710 // Value - Identity Provider configuration values. 5711 Value *[]IdentityProviderContract `json:"value,omitempty"` 5712 // NextLink - Next page link if any. 5713 NextLink *string `json:"nextLink,omitempty"` 5714} 5715 5716// IdentityProviderListIterator provides access to a complete listing of IdentityProviderContract values. 5717type IdentityProviderListIterator struct { 5718 i int 5719 page IdentityProviderListPage 5720} 5721 5722// NextWithContext advances to the next value. If there was an error making 5723// the request the iterator does not advance and the error is returned. 5724func (iter *IdentityProviderListIterator) NextWithContext(ctx context.Context) (err error) { 5725 if tracing.IsEnabled() { 5726 ctx = tracing.StartSpan(ctx, fqdn+"/IdentityProviderListIterator.NextWithContext") 5727 defer func() { 5728 sc := -1 5729 if iter.Response().Response.Response != nil { 5730 sc = iter.Response().Response.Response.StatusCode 5731 } 5732 tracing.EndSpan(ctx, sc, err) 5733 }() 5734 } 5735 iter.i++ 5736 if iter.i < len(iter.page.Values()) { 5737 return nil 5738 } 5739 err = iter.page.NextWithContext(ctx) 5740 if err != nil { 5741 iter.i-- 5742 return err 5743 } 5744 iter.i = 0 5745 return nil 5746} 5747 5748// Next advances to the next value. If there was an error making 5749// the request the iterator does not advance and the error is returned. 5750// Deprecated: Use NextWithContext() instead. 5751func (iter *IdentityProviderListIterator) Next() error { 5752 return iter.NextWithContext(context.Background()) 5753} 5754 5755// NotDone returns true if the enumeration should be started or is not yet complete. 5756func (iter IdentityProviderListIterator) NotDone() bool { 5757 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 5758} 5759 5760// Response returns the raw server response from the last page request. 5761func (iter IdentityProviderListIterator) Response() IdentityProviderList { 5762 return iter.page.Response() 5763} 5764 5765// Value returns the current value or a zero-initialized value if the 5766// iterator has advanced beyond the end of the collection. 5767func (iter IdentityProviderListIterator) Value() IdentityProviderContract { 5768 if !iter.page.NotDone() { 5769 return IdentityProviderContract{} 5770 } 5771 return iter.page.Values()[iter.i] 5772} 5773 5774// Creates a new instance of the IdentityProviderListIterator type. 5775func NewIdentityProviderListIterator(page IdentityProviderListPage) IdentityProviderListIterator { 5776 return IdentityProviderListIterator{page: page} 5777} 5778 5779// IsEmpty returns true if the ListResult contains no values. 5780func (ipl IdentityProviderList) IsEmpty() bool { 5781 return ipl.Value == nil || len(*ipl.Value) == 0 5782} 5783 5784// hasNextLink returns true if the NextLink is not empty. 5785func (ipl IdentityProviderList) hasNextLink() bool { 5786 return ipl.NextLink != nil && len(*ipl.NextLink) != 0 5787} 5788 5789// identityProviderListPreparer prepares a request to retrieve the next set of results. 5790// It returns nil if no more results exist. 5791func (ipl IdentityProviderList) identityProviderListPreparer(ctx context.Context) (*http.Request, error) { 5792 if !ipl.hasNextLink() { 5793 return nil, nil 5794 } 5795 return autorest.Prepare((&http.Request{}).WithContext(ctx), 5796 autorest.AsJSON(), 5797 autorest.AsGet(), 5798 autorest.WithBaseURL(to.String(ipl.NextLink))) 5799} 5800 5801// IdentityProviderListPage contains a page of IdentityProviderContract values. 5802type IdentityProviderListPage struct { 5803 fn func(context.Context, IdentityProviderList) (IdentityProviderList, error) 5804 ipl IdentityProviderList 5805} 5806 5807// NextWithContext advances to the next page of values. If there was an error making 5808// the request the page does not advance and the error is returned. 5809func (page *IdentityProviderListPage) NextWithContext(ctx context.Context) (err error) { 5810 if tracing.IsEnabled() { 5811 ctx = tracing.StartSpan(ctx, fqdn+"/IdentityProviderListPage.NextWithContext") 5812 defer func() { 5813 sc := -1 5814 if page.Response().Response.Response != nil { 5815 sc = page.Response().Response.Response.StatusCode 5816 } 5817 tracing.EndSpan(ctx, sc, err) 5818 }() 5819 } 5820 for { 5821 next, err := page.fn(ctx, page.ipl) 5822 if err != nil { 5823 return err 5824 } 5825 page.ipl = next 5826 if !next.hasNextLink() || !next.IsEmpty() { 5827 break 5828 } 5829 } 5830 return nil 5831} 5832 5833// Next advances to the next page of values. If there was an error making 5834// the request the page does not advance and the error is returned. 5835// Deprecated: Use NextWithContext() instead. 5836func (page *IdentityProviderListPage) Next() error { 5837 return page.NextWithContext(context.Background()) 5838} 5839 5840// NotDone returns true if the page enumeration should be started or is not yet complete. 5841func (page IdentityProviderListPage) NotDone() bool { 5842 return !page.ipl.IsEmpty() 5843} 5844 5845// Response returns the raw server response from the last page request. 5846func (page IdentityProviderListPage) Response() IdentityProviderList { 5847 return page.ipl 5848} 5849 5850// Values returns the slice of values for the current page or nil if there are no values. 5851func (page IdentityProviderListPage) Values() []IdentityProviderContract { 5852 if page.ipl.IsEmpty() { 5853 return nil 5854 } 5855 return *page.ipl.Value 5856} 5857 5858// Creates a new instance of the IdentityProviderListPage type. 5859func NewIdentityProviderListPage(cur IdentityProviderList, getNextPage func(context.Context, IdentityProviderList) (IdentityProviderList, error)) IdentityProviderListPage { 5860 return IdentityProviderListPage{ 5861 fn: getNextPage, 5862 ipl: cur, 5863 } 5864} 5865 5866// IdentityProviderUpdateParameters parameters supplied to update Identity Provider 5867type IdentityProviderUpdateParameters struct { 5868 // IdentityProviderUpdateProperties - Identity Provider update properties. 5869 *IdentityProviderUpdateProperties `json:"properties,omitempty"` 5870} 5871 5872// MarshalJSON is the custom marshaler for IdentityProviderUpdateParameters. 5873func (ipup IdentityProviderUpdateParameters) MarshalJSON() ([]byte, error) { 5874 objectMap := make(map[string]interface{}) 5875 if ipup.IdentityProviderUpdateProperties != nil { 5876 objectMap["properties"] = ipup.IdentityProviderUpdateProperties 5877 } 5878 return json.Marshal(objectMap) 5879} 5880 5881// UnmarshalJSON is the custom unmarshaler for IdentityProviderUpdateParameters struct. 5882func (ipup *IdentityProviderUpdateParameters) UnmarshalJSON(body []byte) error { 5883 var m map[string]*json.RawMessage 5884 err := json.Unmarshal(body, &m) 5885 if err != nil { 5886 return err 5887 } 5888 for k, v := range m { 5889 switch k { 5890 case "properties": 5891 if v != nil { 5892 var identityProviderUpdateProperties IdentityProviderUpdateProperties 5893 err = json.Unmarshal(*v, &identityProviderUpdateProperties) 5894 if err != nil { 5895 return err 5896 } 5897 ipup.IdentityProviderUpdateProperties = &identityProviderUpdateProperties 5898 } 5899 } 5900 } 5901 5902 return nil 5903} 5904 5905// IdentityProviderUpdateProperties parameters supplied to the Update Identity Provider operation. 5906type IdentityProviderUpdateProperties struct { 5907 // 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. 5908 ClientID *string `json:"clientId,omitempty"` 5909 // 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. 5910 ClientSecret *string `json:"clientSecret,omitempty"` 5911 // Type - Identity Provider Type identifier. Possible values include: 'Facebook', 'Google', 'Microsoft', 'Twitter', 'Aad', 'AadB2C' 5912 Type IdentityProviderType `json:"type,omitempty"` 5913 // SigninTenant - The TenantId to use instead of Common when logging into Active Directory 5914 SigninTenant *string `json:"signinTenant,omitempty"` 5915 // AllowedTenants - List of Allowed Tenants when configuring Azure Active Directory login. 5916 AllowedTenants *[]string `json:"allowedTenants,omitempty"` 5917 // Authority - OpenID Connect discovery endpoint hostname for AAD or AAD B2C. 5918 Authority *string `json:"authority,omitempty"` 5919 // SignupPolicyName - Signup Policy Name. Only applies to AAD B2C Identity Provider. 5920 SignupPolicyName *string `json:"signupPolicyName,omitempty"` 5921 // SigninPolicyName - Signin Policy Name. Only applies to AAD B2C Identity Provider. 5922 SigninPolicyName *string `json:"signinPolicyName,omitempty"` 5923 // ProfileEditingPolicyName - Profile Editing Policy Name. Only applies to AAD B2C Identity Provider. 5924 ProfileEditingPolicyName *string `json:"profileEditingPolicyName,omitempty"` 5925 // PasswordResetPolicyName - Password Reset Policy Name. Only applies to AAD B2C Identity Provider. 5926 PasswordResetPolicyName *string `json:"passwordResetPolicyName,omitempty"` 5927} 5928 5929// IssueAttachmentCollection paged Issue Attachment list representation. 5930type IssueAttachmentCollection struct { 5931 autorest.Response `json:"-"` 5932 // Value - READ-ONLY; Issue Attachment values. 5933 Value *[]IssueAttachmentContract `json:"value,omitempty"` 5934 // NextLink - READ-ONLY; Next page link if any. 5935 NextLink *string `json:"nextLink,omitempty"` 5936} 5937 5938// MarshalJSON is the custom marshaler for IssueAttachmentCollection. 5939func (iac IssueAttachmentCollection) MarshalJSON() ([]byte, error) { 5940 objectMap := make(map[string]interface{}) 5941 return json.Marshal(objectMap) 5942} 5943 5944// IssueAttachmentCollectionIterator provides access to a complete listing of IssueAttachmentContract 5945// values. 5946type IssueAttachmentCollectionIterator struct { 5947 i int 5948 page IssueAttachmentCollectionPage 5949} 5950 5951// NextWithContext advances to the next value. If there was an error making 5952// the request the iterator does not advance and the error is returned. 5953func (iter *IssueAttachmentCollectionIterator) NextWithContext(ctx context.Context) (err error) { 5954 if tracing.IsEnabled() { 5955 ctx = tracing.StartSpan(ctx, fqdn+"/IssueAttachmentCollectionIterator.NextWithContext") 5956 defer func() { 5957 sc := -1 5958 if iter.Response().Response.Response != nil { 5959 sc = iter.Response().Response.Response.StatusCode 5960 } 5961 tracing.EndSpan(ctx, sc, err) 5962 }() 5963 } 5964 iter.i++ 5965 if iter.i < len(iter.page.Values()) { 5966 return nil 5967 } 5968 err = iter.page.NextWithContext(ctx) 5969 if err != nil { 5970 iter.i-- 5971 return err 5972 } 5973 iter.i = 0 5974 return nil 5975} 5976 5977// Next advances to the next value. If there was an error making 5978// the request the iterator does not advance and the error is returned. 5979// Deprecated: Use NextWithContext() instead. 5980func (iter *IssueAttachmentCollectionIterator) Next() error { 5981 return iter.NextWithContext(context.Background()) 5982} 5983 5984// NotDone returns true if the enumeration should be started or is not yet complete. 5985func (iter IssueAttachmentCollectionIterator) NotDone() bool { 5986 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 5987} 5988 5989// Response returns the raw server response from the last page request. 5990func (iter IssueAttachmentCollectionIterator) Response() IssueAttachmentCollection { 5991 return iter.page.Response() 5992} 5993 5994// Value returns the current value or a zero-initialized value if the 5995// iterator has advanced beyond the end of the collection. 5996func (iter IssueAttachmentCollectionIterator) Value() IssueAttachmentContract { 5997 if !iter.page.NotDone() { 5998 return IssueAttachmentContract{} 5999 } 6000 return iter.page.Values()[iter.i] 6001} 6002 6003// Creates a new instance of the IssueAttachmentCollectionIterator type. 6004func NewIssueAttachmentCollectionIterator(page IssueAttachmentCollectionPage) IssueAttachmentCollectionIterator { 6005 return IssueAttachmentCollectionIterator{page: page} 6006} 6007 6008// IsEmpty returns true if the ListResult contains no values. 6009func (iac IssueAttachmentCollection) IsEmpty() bool { 6010 return iac.Value == nil || len(*iac.Value) == 0 6011} 6012 6013// hasNextLink returns true if the NextLink is not empty. 6014func (iac IssueAttachmentCollection) hasNextLink() bool { 6015 return iac.NextLink != nil && len(*iac.NextLink) != 0 6016} 6017 6018// issueAttachmentCollectionPreparer prepares a request to retrieve the next set of results. 6019// It returns nil if no more results exist. 6020func (iac IssueAttachmentCollection) issueAttachmentCollectionPreparer(ctx context.Context) (*http.Request, error) { 6021 if !iac.hasNextLink() { 6022 return nil, nil 6023 } 6024 return autorest.Prepare((&http.Request{}).WithContext(ctx), 6025 autorest.AsJSON(), 6026 autorest.AsGet(), 6027 autorest.WithBaseURL(to.String(iac.NextLink))) 6028} 6029 6030// IssueAttachmentCollectionPage contains a page of IssueAttachmentContract values. 6031type IssueAttachmentCollectionPage struct { 6032 fn func(context.Context, IssueAttachmentCollection) (IssueAttachmentCollection, error) 6033 iac IssueAttachmentCollection 6034} 6035 6036// NextWithContext advances to the next page of values. If there was an error making 6037// the request the page does not advance and the error is returned. 6038func (page *IssueAttachmentCollectionPage) NextWithContext(ctx context.Context) (err error) { 6039 if tracing.IsEnabled() { 6040 ctx = tracing.StartSpan(ctx, fqdn+"/IssueAttachmentCollectionPage.NextWithContext") 6041 defer func() { 6042 sc := -1 6043 if page.Response().Response.Response != nil { 6044 sc = page.Response().Response.Response.StatusCode 6045 } 6046 tracing.EndSpan(ctx, sc, err) 6047 }() 6048 } 6049 for { 6050 next, err := page.fn(ctx, page.iac) 6051 if err != nil { 6052 return err 6053 } 6054 page.iac = next 6055 if !next.hasNextLink() || !next.IsEmpty() { 6056 break 6057 } 6058 } 6059 return nil 6060} 6061 6062// Next advances to the next page of values. If there was an error making 6063// the request the page does not advance and the error is returned. 6064// Deprecated: Use NextWithContext() instead. 6065func (page *IssueAttachmentCollectionPage) Next() error { 6066 return page.NextWithContext(context.Background()) 6067} 6068 6069// NotDone returns true if the page enumeration should be started or is not yet complete. 6070func (page IssueAttachmentCollectionPage) NotDone() bool { 6071 return !page.iac.IsEmpty() 6072} 6073 6074// Response returns the raw server response from the last page request. 6075func (page IssueAttachmentCollectionPage) Response() IssueAttachmentCollection { 6076 return page.iac 6077} 6078 6079// Values returns the slice of values for the current page or nil if there are no values. 6080func (page IssueAttachmentCollectionPage) Values() []IssueAttachmentContract { 6081 if page.iac.IsEmpty() { 6082 return nil 6083 } 6084 return *page.iac.Value 6085} 6086 6087// Creates a new instance of the IssueAttachmentCollectionPage type. 6088func NewIssueAttachmentCollectionPage(cur IssueAttachmentCollection, getNextPage func(context.Context, IssueAttachmentCollection) (IssueAttachmentCollection, error)) IssueAttachmentCollectionPage { 6089 return IssueAttachmentCollectionPage{ 6090 fn: getNextPage, 6091 iac: cur, 6092 } 6093} 6094 6095// IssueAttachmentContract issue Attachment Contract details. 6096type IssueAttachmentContract struct { 6097 autorest.Response `json:"-"` 6098 // IssueAttachmentContractProperties - Properties of the Issue Attachment. 6099 *IssueAttachmentContractProperties `json:"properties,omitempty"` 6100 // ID - READ-ONLY; Resource ID. 6101 ID *string `json:"id,omitempty"` 6102 // Name - READ-ONLY; Resource name. 6103 Name *string `json:"name,omitempty"` 6104 // Type - READ-ONLY; Resource type for API Management resource. 6105 Type *string `json:"type,omitempty"` 6106} 6107 6108// MarshalJSON is the custom marshaler for IssueAttachmentContract. 6109func (iac IssueAttachmentContract) MarshalJSON() ([]byte, error) { 6110 objectMap := make(map[string]interface{}) 6111 if iac.IssueAttachmentContractProperties != nil { 6112 objectMap["properties"] = iac.IssueAttachmentContractProperties 6113 } 6114 return json.Marshal(objectMap) 6115} 6116 6117// UnmarshalJSON is the custom unmarshaler for IssueAttachmentContract struct. 6118func (iac *IssueAttachmentContract) UnmarshalJSON(body []byte) error { 6119 var m map[string]*json.RawMessage 6120 err := json.Unmarshal(body, &m) 6121 if err != nil { 6122 return err 6123 } 6124 for k, v := range m { 6125 switch k { 6126 case "properties": 6127 if v != nil { 6128 var issueAttachmentContractProperties IssueAttachmentContractProperties 6129 err = json.Unmarshal(*v, &issueAttachmentContractProperties) 6130 if err != nil { 6131 return err 6132 } 6133 iac.IssueAttachmentContractProperties = &issueAttachmentContractProperties 6134 } 6135 case "id": 6136 if v != nil { 6137 var ID string 6138 err = json.Unmarshal(*v, &ID) 6139 if err != nil { 6140 return err 6141 } 6142 iac.ID = &ID 6143 } 6144 case "name": 6145 if v != nil { 6146 var name string 6147 err = json.Unmarshal(*v, &name) 6148 if err != nil { 6149 return err 6150 } 6151 iac.Name = &name 6152 } 6153 case "type": 6154 if v != nil { 6155 var typeVar string 6156 err = json.Unmarshal(*v, &typeVar) 6157 if err != nil { 6158 return err 6159 } 6160 iac.Type = &typeVar 6161 } 6162 } 6163 } 6164 6165 return nil 6166} 6167 6168// IssueAttachmentContractProperties issue Attachment contract Properties. 6169type IssueAttachmentContractProperties struct { 6170 // Title - Filename by which the binary data will be saved. 6171 Title *string `json:"title,omitempty"` 6172 // 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. 6173 ContentFormat *string `json:"contentFormat,omitempty"` 6174 // Content - An HTTP link or Base64-encoded binary data. 6175 Content *string `json:"content,omitempty"` 6176} 6177 6178// IssueCollection paged Issue list representation. 6179type IssueCollection struct { 6180 autorest.Response `json:"-"` 6181 // Value - READ-ONLY; Issue values. 6182 Value *[]IssueContract `json:"value,omitempty"` 6183 // NextLink - READ-ONLY; Next page link if any. 6184 NextLink *string `json:"nextLink,omitempty"` 6185} 6186 6187// MarshalJSON is the custom marshaler for IssueCollection. 6188func (ic IssueCollection) MarshalJSON() ([]byte, error) { 6189 objectMap := make(map[string]interface{}) 6190 return json.Marshal(objectMap) 6191} 6192 6193// IssueCollectionIterator provides access to a complete listing of IssueContract values. 6194type IssueCollectionIterator struct { 6195 i int 6196 page IssueCollectionPage 6197} 6198 6199// NextWithContext advances to the next value. If there was an error making 6200// the request the iterator does not advance and the error is returned. 6201func (iter *IssueCollectionIterator) NextWithContext(ctx context.Context) (err error) { 6202 if tracing.IsEnabled() { 6203 ctx = tracing.StartSpan(ctx, fqdn+"/IssueCollectionIterator.NextWithContext") 6204 defer func() { 6205 sc := -1 6206 if iter.Response().Response.Response != nil { 6207 sc = iter.Response().Response.Response.StatusCode 6208 } 6209 tracing.EndSpan(ctx, sc, err) 6210 }() 6211 } 6212 iter.i++ 6213 if iter.i < len(iter.page.Values()) { 6214 return nil 6215 } 6216 err = iter.page.NextWithContext(ctx) 6217 if err != nil { 6218 iter.i-- 6219 return err 6220 } 6221 iter.i = 0 6222 return nil 6223} 6224 6225// Next advances to the next value. If there was an error making 6226// the request the iterator does not advance and the error is returned. 6227// Deprecated: Use NextWithContext() instead. 6228func (iter *IssueCollectionIterator) Next() error { 6229 return iter.NextWithContext(context.Background()) 6230} 6231 6232// NotDone returns true if the enumeration should be started or is not yet complete. 6233func (iter IssueCollectionIterator) NotDone() bool { 6234 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 6235} 6236 6237// Response returns the raw server response from the last page request. 6238func (iter IssueCollectionIterator) Response() IssueCollection { 6239 return iter.page.Response() 6240} 6241 6242// Value returns the current value or a zero-initialized value if the 6243// iterator has advanced beyond the end of the collection. 6244func (iter IssueCollectionIterator) Value() IssueContract { 6245 if !iter.page.NotDone() { 6246 return IssueContract{} 6247 } 6248 return iter.page.Values()[iter.i] 6249} 6250 6251// Creates a new instance of the IssueCollectionIterator type. 6252func NewIssueCollectionIterator(page IssueCollectionPage) IssueCollectionIterator { 6253 return IssueCollectionIterator{page: page} 6254} 6255 6256// IsEmpty returns true if the ListResult contains no values. 6257func (ic IssueCollection) IsEmpty() bool { 6258 return ic.Value == nil || len(*ic.Value) == 0 6259} 6260 6261// hasNextLink returns true if the NextLink is not empty. 6262func (ic IssueCollection) hasNextLink() bool { 6263 return ic.NextLink != nil && len(*ic.NextLink) != 0 6264} 6265 6266// issueCollectionPreparer prepares a request to retrieve the next set of results. 6267// It returns nil if no more results exist. 6268func (ic IssueCollection) issueCollectionPreparer(ctx context.Context) (*http.Request, error) { 6269 if !ic.hasNextLink() { 6270 return nil, nil 6271 } 6272 return autorest.Prepare((&http.Request{}).WithContext(ctx), 6273 autorest.AsJSON(), 6274 autorest.AsGet(), 6275 autorest.WithBaseURL(to.String(ic.NextLink))) 6276} 6277 6278// IssueCollectionPage contains a page of IssueContract values. 6279type IssueCollectionPage struct { 6280 fn func(context.Context, IssueCollection) (IssueCollection, error) 6281 ic IssueCollection 6282} 6283 6284// NextWithContext advances to the next page of values. If there was an error making 6285// the request the page does not advance and the error is returned. 6286func (page *IssueCollectionPage) NextWithContext(ctx context.Context) (err error) { 6287 if tracing.IsEnabled() { 6288 ctx = tracing.StartSpan(ctx, fqdn+"/IssueCollectionPage.NextWithContext") 6289 defer func() { 6290 sc := -1 6291 if page.Response().Response.Response != nil { 6292 sc = page.Response().Response.Response.StatusCode 6293 } 6294 tracing.EndSpan(ctx, sc, err) 6295 }() 6296 } 6297 for { 6298 next, err := page.fn(ctx, page.ic) 6299 if err != nil { 6300 return err 6301 } 6302 page.ic = next 6303 if !next.hasNextLink() || !next.IsEmpty() { 6304 break 6305 } 6306 } 6307 return nil 6308} 6309 6310// Next advances to the next page of values. If there was an error making 6311// the request the page does not advance and the error is returned. 6312// Deprecated: Use NextWithContext() instead. 6313func (page *IssueCollectionPage) Next() error { 6314 return page.NextWithContext(context.Background()) 6315} 6316 6317// NotDone returns true if the page enumeration should be started or is not yet complete. 6318func (page IssueCollectionPage) NotDone() bool { 6319 return !page.ic.IsEmpty() 6320} 6321 6322// Response returns the raw server response from the last page request. 6323func (page IssueCollectionPage) Response() IssueCollection { 6324 return page.ic 6325} 6326 6327// Values returns the slice of values for the current page or nil if there are no values. 6328func (page IssueCollectionPage) Values() []IssueContract { 6329 if page.ic.IsEmpty() { 6330 return nil 6331 } 6332 return *page.ic.Value 6333} 6334 6335// Creates a new instance of the IssueCollectionPage type. 6336func NewIssueCollectionPage(cur IssueCollection, getNextPage func(context.Context, IssueCollection) (IssueCollection, error)) IssueCollectionPage { 6337 return IssueCollectionPage{ 6338 fn: getNextPage, 6339 ic: cur, 6340 } 6341} 6342 6343// IssueCommentCollection paged Issue Comment list representation. 6344type IssueCommentCollection struct { 6345 autorest.Response `json:"-"` 6346 // Value - READ-ONLY; Issue Comment values. 6347 Value *[]IssueCommentContract `json:"value,omitempty"` 6348 // NextLink - READ-ONLY; Next page link if any. 6349 NextLink *string `json:"nextLink,omitempty"` 6350} 6351 6352// MarshalJSON is the custom marshaler for IssueCommentCollection. 6353func (icc IssueCommentCollection) MarshalJSON() ([]byte, error) { 6354 objectMap := make(map[string]interface{}) 6355 return json.Marshal(objectMap) 6356} 6357 6358// IssueCommentCollectionIterator provides access to a complete listing of IssueCommentContract values. 6359type IssueCommentCollectionIterator struct { 6360 i int 6361 page IssueCommentCollectionPage 6362} 6363 6364// NextWithContext advances to the next value. If there was an error making 6365// the request the iterator does not advance and the error is returned. 6366func (iter *IssueCommentCollectionIterator) NextWithContext(ctx context.Context) (err error) { 6367 if tracing.IsEnabled() { 6368 ctx = tracing.StartSpan(ctx, fqdn+"/IssueCommentCollectionIterator.NextWithContext") 6369 defer func() { 6370 sc := -1 6371 if iter.Response().Response.Response != nil { 6372 sc = iter.Response().Response.Response.StatusCode 6373 } 6374 tracing.EndSpan(ctx, sc, err) 6375 }() 6376 } 6377 iter.i++ 6378 if iter.i < len(iter.page.Values()) { 6379 return nil 6380 } 6381 err = iter.page.NextWithContext(ctx) 6382 if err != nil { 6383 iter.i-- 6384 return err 6385 } 6386 iter.i = 0 6387 return nil 6388} 6389 6390// Next advances to the next value. If there was an error making 6391// the request the iterator does not advance and the error is returned. 6392// Deprecated: Use NextWithContext() instead. 6393func (iter *IssueCommentCollectionIterator) Next() error { 6394 return iter.NextWithContext(context.Background()) 6395} 6396 6397// NotDone returns true if the enumeration should be started or is not yet complete. 6398func (iter IssueCommentCollectionIterator) NotDone() bool { 6399 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 6400} 6401 6402// Response returns the raw server response from the last page request. 6403func (iter IssueCommentCollectionIterator) Response() IssueCommentCollection { 6404 return iter.page.Response() 6405} 6406 6407// Value returns the current value or a zero-initialized value if the 6408// iterator has advanced beyond the end of the collection. 6409func (iter IssueCommentCollectionIterator) Value() IssueCommentContract { 6410 if !iter.page.NotDone() { 6411 return IssueCommentContract{} 6412 } 6413 return iter.page.Values()[iter.i] 6414} 6415 6416// Creates a new instance of the IssueCommentCollectionIterator type. 6417func NewIssueCommentCollectionIterator(page IssueCommentCollectionPage) IssueCommentCollectionIterator { 6418 return IssueCommentCollectionIterator{page: page} 6419} 6420 6421// IsEmpty returns true if the ListResult contains no values. 6422func (icc IssueCommentCollection) IsEmpty() bool { 6423 return icc.Value == nil || len(*icc.Value) == 0 6424} 6425 6426// hasNextLink returns true if the NextLink is not empty. 6427func (icc IssueCommentCollection) hasNextLink() bool { 6428 return icc.NextLink != nil && len(*icc.NextLink) != 0 6429} 6430 6431// issueCommentCollectionPreparer prepares a request to retrieve the next set of results. 6432// It returns nil if no more results exist. 6433func (icc IssueCommentCollection) issueCommentCollectionPreparer(ctx context.Context) (*http.Request, error) { 6434 if !icc.hasNextLink() { 6435 return nil, nil 6436 } 6437 return autorest.Prepare((&http.Request{}).WithContext(ctx), 6438 autorest.AsJSON(), 6439 autorest.AsGet(), 6440 autorest.WithBaseURL(to.String(icc.NextLink))) 6441} 6442 6443// IssueCommentCollectionPage contains a page of IssueCommentContract values. 6444type IssueCommentCollectionPage struct { 6445 fn func(context.Context, IssueCommentCollection) (IssueCommentCollection, error) 6446 icc IssueCommentCollection 6447} 6448 6449// NextWithContext advances to the next page of values. If there was an error making 6450// the request the page does not advance and the error is returned. 6451func (page *IssueCommentCollectionPage) NextWithContext(ctx context.Context) (err error) { 6452 if tracing.IsEnabled() { 6453 ctx = tracing.StartSpan(ctx, fqdn+"/IssueCommentCollectionPage.NextWithContext") 6454 defer func() { 6455 sc := -1 6456 if page.Response().Response.Response != nil { 6457 sc = page.Response().Response.Response.StatusCode 6458 } 6459 tracing.EndSpan(ctx, sc, err) 6460 }() 6461 } 6462 for { 6463 next, err := page.fn(ctx, page.icc) 6464 if err != nil { 6465 return err 6466 } 6467 page.icc = next 6468 if !next.hasNextLink() || !next.IsEmpty() { 6469 break 6470 } 6471 } 6472 return nil 6473} 6474 6475// Next advances to the next page of values. If there was an error making 6476// the request the page does not advance and the error is returned. 6477// Deprecated: Use NextWithContext() instead. 6478func (page *IssueCommentCollectionPage) Next() error { 6479 return page.NextWithContext(context.Background()) 6480} 6481 6482// NotDone returns true if the page enumeration should be started or is not yet complete. 6483func (page IssueCommentCollectionPage) NotDone() bool { 6484 return !page.icc.IsEmpty() 6485} 6486 6487// Response returns the raw server response from the last page request. 6488func (page IssueCommentCollectionPage) Response() IssueCommentCollection { 6489 return page.icc 6490} 6491 6492// Values returns the slice of values for the current page or nil if there are no values. 6493func (page IssueCommentCollectionPage) Values() []IssueCommentContract { 6494 if page.icc.IsEmpty() { 6495 return nil 6496 } 6497 return *page.icc.Value 6498} 6499 6500// Creates a new instance of the IssueCommentCollectionPage type. 6501func NewIssueCommentCollectionPage(cur IssueCommentCollection, getNextPage func(context.Context, IssueCommentCollection) (IssueCommentCollection, error)) IssueCommentCollectionPage { 6502 return IssueCommentCollectionPage{ 6503 fn: getNextPage, 6504 icc: cur, 6505 } 6506} 6507 6508// IssueCommentContract issue Comment Contract details. 6509type IssueCommentContract struct { 6510 autorest.Response `json:"-"` 6511 // IssueCommentContractProperties - Properties of the Issue Comment. 6512 *IssueCommentContractProperties `json:"properties,omitempty"` 6513 // ID - READ-ONLY; Resource ID. 6514 ID *string `json:"id,omitempty"` 6515 // Name - READ-ONLY; Resource name. 6516 Name *string `json:"name,omitempty"` 6517 // Type - READ-ONLY; Resource type for API Management resource. 6518 Type *string `json:"type,omitempty"` 6519} 6520 6521// MarshalJSON is the custom marshaler for IssueCommentContract. 6522func (icc IssueCommentContract) MarshalJSON() ([]byte, error) { 6523 objectMap := make(map[string]interface{}) 6524 if icc.IssueCommentContractProperties != nil { 6525 objectMap["properties"] = icc.IssueCommentContractProperties 6526 } 6527 return json.Marshal(objectMap) 6528} 6529 6530// UnmarshalJSON is the custom unmarshaler for IssueCommentContract struct. 6531func (icc *IssueCommentContract) UnmarshalJSON(body []byte) error { 6532 var m map[string]*json.RawMessage 6533 err := json.Unmarshal(body, &m) 6534 if err != nil { 6535 return err 6536 } 6537 for k, v := range m { 6538 switch k { 6539 case "properties": 6540 if v != nil { 6541 var issueCommentContractProperties IssueCommentContractProperties 6542 err = json.Unmarshal(*v, &issueCommentContractProperties) 6543 if err != nil { 6544 return err 6545 } 6546 icc.IssueCommentContractProperties = &issueCommentContractProperties 6547 } 6548 case "id": 6549 if v != nil { 6550 var ID string 6551 err = json.Unmarshal(*v, &ID) 6552 if err != nil { 6553 return err 6554 } 6555 icc.ID = &ID 6556 } 6557 case "name": 6558 if v != nil { 6559 var name string 6560 err = json.Unmarshal(*v, &name) 6561 if err != nil { 6562 return err 6563 } 6564 icc.Name = &name 6565 } 6566 case "type": 6567 if v != nil { 6568 var typeVar string 6569 err = json.Unmarshal(*v, &typeVar) 6570 if err != nil { 6571 return err 6572 } 6573 icc.Type = &typeVar 6574 } 6575 } 6576 } 6577 6578 return nil 6579} 6580 6581// IssueCommentContractProperties issue Comment contract Properties. 6582type IssueCommentContractProperties struct { 6583 // Text - Comment text. 6584 Text *string `json:"text,omitempty"` 6585 // CreatedDate - Date and time when the comment was created. 6586 CreatedDate *date.Time `json:"createdDate,omitempty"` 6587 // UserID - A resource identifier for the user who left the comment. 6588 UserID *string `json:"userId,omitempty"` 6589} 6590 6591// IssueContract issue Contract details. 6592type IssueContract struct { 6593 autorest.Response `json:"-"` 6594 // IssueContractProperties - Properties of the Issue. 6595 *IssueContractProperties `json:"properties,omitempty"` 6596 // ID - READ-ONLY; Resource ID. 6597 ID *string `json:"id,omitempty"` 6598 // Name - READ-ONLY; Resource name. 6599 Name *string `json:"name,omitempty"` 6600 // Type - READ-ONLY; Resource type for API Management resource. 6601 Type *string `json:"type,omitempty"` 6602} 6603 6604// MarshalJSON is the custom marshaler for IssueContract. 6605func (ic IssueContract) MarshalJSON() ([]byte, error) { 6606 objectMap := make(map[string]interface{}) 6607 if ic.IssueContractProperties != nil { 6608 objectMap["properties"] = ic.IssueContractProperties 6609 } 6610 return json.Marshal(objectMap) 6611} 6612 6613// UnmarshalJSON is the custom unmarshaler for IssueContract struct. 6614func (ic *IssueContract) UnmarshalJSON(body []byte) error { 6615 var m map[string]*json.RawMessage 6616 err := json.Unmarshal(body, &m) 6617 if err != nil { 6618 return err 6619 } 6620 for k, v := range m { 6621 switch k { 6622 case "properties": 6623 if v != nil { 6624 var issueContractProperties IssueContractProperties 6625 err = json.Unmarshal(*v, &issueContractProperties) 6626 if err != nil { 6627 return err 6628 } 6629 ic.IssueContractProperties = &issueContractProperties 6630 } 6631 case "id": 6632 if v != nil { 6633 var ID string 6634 err = json.Unmarshal(*v, &ID) 6635 if err != nil { 6636 return err 6637 } 6638 ic.ID = &ID 6639 } 6640 case "name": 6641 if v != nil { 6642 var name string 6643 err = json.Unmarshal(*v, &name) 6644 if err != nil { 6645 return err 6646 } 6647 ic.Name = &name 6648 } 6649 case "type": 6650 if v != nil { 6651 var typeVar string 6652 err = json.Unmarshal(*v, &typeVar) 6653 if err != nil { 6654 return err 6655 } 6656 ic.Type = &typeVar 6657 } 6658 } 6659 } 6660 6661 return nil 6662} 6663 6664// IssueContractBaseProperties issue contract Base Properties. 6665type IssueContractBaseProperties struct { 6666 // CreatedDate - Date and time when the issue was created. 6667 CreatedDate *date.Time `json:"createdDate,omitempty"` 6668 // State - Status of the issue. Possible values include: 'Proposed', 'Open', 'Removed', 'Resolved', 'Closed' 6669 State State `json:"state,omitempty"` 6670 // APIID - A resource identifier for the API the issue was created for. 6671 APIID *string `json:"apiId,omitempty"` 6672} 6673 6674// IssueContractProperties issue contract Properties. 6675type IssueContractProperties struct { 6676 // Title - The issue title. 6677 Title *string `json:"title,omitempty"` 6678 // Description - Text describing the issue. 6679 Description *string `json:"description,omitempty"` 6680 // UserID - A resource identifier for the user created the issue. 6681 UserID *string `json:"userId,omitempty"` 6682 // CreatedDate - Date and time when the issue was created. 6683 CreatedDate *date.Time `json:"createdDate,omitempty"` 6684 // State - Status of the issue. Possible values include: 'Proposed', 'Open', 'Removed', 'Resolved', 'Closed' 6685 State State `json:"state,omitempty"` 6686 // APIID - A resource identifier for the API the issue was created for. 6687 APIID *string `json:"apiId,omitempty"` 6688} 6689 6690// IssueUpdateContract issue update Parameters. 6691type IssueUpdateContract struct { 6692 // IssueUpdateContractProperties - Issue entity Update contract properties. 6693 *IssueUpdateContractProperties `json:"properties,omitempty"` 6694} 6695 6696// MarshalJSON is the custom marshaler for IssueUpdateContract. 6697func (iuc IssueUpdateContract) MarshalJSON() ([]byte, error) { 6698 objectMap := make(map[string]interface{}) 6699 if iuc.IssueUpdateContractProperties != nil { 6700 objectMap["properties"] = iuc.IssueUpdateContractProperties 6701 } 6702 return json.Marshal(objectMap) 6703} 6704 6705// UnmarshalJSON is the custom unmarshaler for IssueUpdateContract struct. 6706func (iuc *IssueUpdateContract) UnmarshalJSON(body []byte) error { 6707 var m map[string]*json.RawMessage 6708 err := json.Unmarshal(body, &m) 6709 if err != nil { 6710 return err 6711 } 6712 for k, v := range m { 6713 switch k { 6714 case "properties": 6715 if v != nil { 6716 var issueUpdateContractProperties IssueUpdateContractProperties 6717 err = json.Unmarshal(*v, &issueUpdateContractProperties) 6718 if err != nil { 6719 return err 6720 } 6721 iuc.IssueUpdateContractProperties = &issueUpdateContractProperties 6722 } 6723 } 6724 } 6725 6726 return nil 6727} 6728 6729// IssueUpdateContractProperties issue contract Update Properties. 6730type IssueUpdateContractProperties struct { 6731 // Title - The issue title. 6732 Title *string `json:"title,omitempty"` 6733 // Description - Text describing the issue. 6734 Description *string `json:"description,omitempty"` 6735 // UserID - A resource identifier for the user created the issue. 6736 UserID *string `json:"userId,omitempty"` 6737 // CreatedDate - Date and time when the issue was created. 6738 CreatedDate *date.Time `json:"createdDate,omitempty"` 6739 // State - Status of the issue. Possible values include: 'Proposed', 'Open', 'Removed', 'Resolved', 'Closed' 6740 State State `json:"state,omitempty"` 6741 // APIID - A resource identifier for the API the issue was created for. 6742 APIID *string `json:"apiId,omitempty"` 6743} 6744 6745// ListNetworkStatusContractByLocation ... 6746type ListNetworkStatusContractByLocation struct { 6747 autorest.Response `json:"-"` 6748 Value *[]NetworkStatusContractByLocation `json:"value,omitempty"` 6749} 6750 6751// LoggerCollection paged Logger list representation. 6752type LoggerCollection struct { 6753 autorest.Response `json:"-"` 6754 // Value - Logger values. 6755 Value *[]LoggerContract `json:"value,omitempty"` 6756 // Count - Total record count number across all pages. 6757 Count *int64 `json:"count,omitempty"` 6758 // NextLink - Next page link if any. 6759 NextLink *string `json:"nextLink,omitempty"` 6760} 6761 6762// LoggerCollectionIterator provides access to a complete listing of LoggerContract values. 6763type LoggerCollectionIterator struct { 6764 i int 6765 page LoggerCollectionPage 6766} 6767 6768// NextWithContext advances to the next value. If there was an error making 6769// the request the iterator does not advance and the error is returned. 6770func (iter *LoggerCollectionIterator) NextWithContext(ctx context.Context) (err error) { 6771 if tracing.IsEnabled() { 6772 ctx = tracing.StartSpan(ctx, fqdn+"/LoggerCollectionIterator.NextWithContext") 6773 defer func() { 6774 sc := -1 6775 if iter.Response().Response.Response != nil { 6776 sc = iter.Response().Response.Response.StatusCode 6777 } 6778 tracing.EndSpan(ctx, sc, err) 6779 }() 6780 } 6781 iter.i++ 6782 if iter.i < len(iter.page.Values()) { 6783 return nil 6784 } 6785 err = iter.page.NextWithContext(ctx) 6786 if err != nil { 6787 iter.i-- 6788 return err 6789 } 6790 iter.i = 0 6791 return nil 6792} 6793 6794// Next advances to the next value. If there was an error making 6795// the request the iterator does not advance and the error is returned. 6796// Deprecated: Use NextWithContext() instead. 6797func (iter *LoggerCollectionIterator) Next() error { 6798 return iter.NextWithContext(context.Background()) 6799} 6800 6801// NotDone returns true if the enumeration should be started or is not yet complete. 6802func (iter LoggerCollectionIterator) NotDone() bool { 6803 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 6804} 6805 6806// Response returns the raw server response from the last page request. 6807func (iter LoggerCollectionIterator) Response() LoggerCollection { 6808 return iter.page.Response() 6809} 6810 6811// Value returns the current value or a zero-initialized value if the 6812// iterator has advanced beyond the end of the collection. 6813func (iter LoggerCollectionIterator) Value() LoggerContract { 6814 if !iter.page.NotDone() { 6815 return LoggerContract{} 6816 } 6817 return iter.page.Values()[iter.i] 6818} 6819 6820// Creates a new instance of the LoggerCollectionIterator type. 6821func NewLoggerCollectionIterator(page LoggerCollectionPage) LoggerCollectionIterator { 6822 return LoggerCollectionIterator{page: page} 6823} 6824 6825// IsEmpty returns true if the ListResult contains no values. 6826func (lc LoggerCollection) IsEmpty() bool { 6827 return lc.Value == nil || len(*lc.Value) == 0 6828} 6829 6830// hasNextLink returns true if the NextLink is not empty. 6831func (lc LoggerCollection) hasNextLink() bool { 6832 return lc.NextLink != nil && len(*lc.NextLink) != 0 6833} 6834 6835// loggerCollectionPreparer prepares a request to retrieve the next set of results. 6836// It returns nil if no more results exist. 6837func (lc LoggerCollection) loggerCollectionPreparer(ctx context.Context) (*http.Request, error) { 6838 if !lc.hasNextLink() { 6839 return nil, nil 6840 } 6841 return autorest.Prepare((&http.Request{}).WithContext(ctx), 6842 autorest.AsJSON(), 6843 autorest.AsGet(), 6844 autorest.WithBaseURL(to.String(lc.NextLink))) 6845} 6846 6847// LoggerCollectionPage contains a page of LoggerContract values. 6848type LoggerCollectionPage struct { 6849 fn func(context.Context, LoggerCollection) (LoggerCollection, error) 6850 lc LoggerCollection 6851} 6852 6853// NextWithContext advances to the next page of values. If there was an error making 6854// the request the page does not advance and the error is returned. 6855func (page *LoggerCollectionPage) NextWithContext(ctx context.Context) (err error) { 6856 if tracing.IsEnabled() { 6857 ctx = tracing.StartSpan(ctx, fqdn+"/LoggerCollectionPage.NextWithContext") 6858 defer func() { 6859 sc := -1 6860 if page.Response().Response.Response != nil { 6861 sc = page.Response().Response.Response.StatusCode 6862 } 6863 tracing.EndSpan(ctx, sc, err) 6864 }() 6865 } 6866 for { 6867 next, err := page.fn(ctx, page.lc) 6868 if err != nil { 6869 return err 6870 } 6871 page.lc = next 6872 if !next.hasNextLink() || !next.IsEmpty() { 6873 break 6874 } 6875 } 6876 return nil 6877} 6878 6879// Next advances to the next page of values. If there was an error making 6880// the request the page does not advance and the error is returned. 6881// Deprecated: Use NextWithContext() instead. 6882func (page *LoggerCollectionPage) Next() error { 6883 return page.NextWithContext(context.Background()) 6884} 6885 6886// NotDone returns true if the page enumeration should be started or is not yet complete. 6887func (page LoggerCollectionPage) NotDone() bool { 6888 return !page.lc.IsEmpty() 6889} 6890 6891// Response returns the raw server response from the last page request. 6892func (page LoggerCollectionPage) Response() LoggerCollection { 6893 return page.lc 6894} 6895 6896// Values returns the slice of values for the current page or nil if there are no values. 6897func (page LoggerCollectionPage) Values() []LoggerContract { 6898 if page.lc.IsEmpty() { 6899 return nil 6900 } 6901 return *page.lc.Value 6902} 6903 6904// Creates a new instance of the LoggerCollectionPage type. 6905func NewLoggerCollectionPage(cur LoggerCollection, getNextPage func(context.Context, LoggerCollection) (LoggerCollection, error)) LoggerCollectionPage { 6906 return LoggerCollectionPage{ 6907 fn: getNextPage, 6908 lc: cur, 6909 } 6910} 6911 6912// LoggerContract logger details. 6913type LoggerContract struct { 6914 autorest.Response `json:"-"` 6915 // LoggerContractProperties - Logger entity contract properties. 6916 *LoggerContractProperties `json:"properties,omitempty"` 6917 // ID - READ-ONLY; Resource ID. 6918 ID *string `json:"id,omitempty"` 6919 // Name - READ-ONLY; Resource name. 6920 Name *string `json:"name,omitempty"` 6921 // Type - READ-ONLY; Resource type for API Management resource. 6922 Type *string `json:"type,omitempty"` 6923} 6924 6925// MarshalJSON is the custom marshaler for LoggerContract. 6926func (lc LoggerContract) MarshalJSON() ([]byte, error) { 6927 objectMap := make(map[string]interface{}) 6928 if lc.LoggerContractProperties != nil { 6929 objectMap["properties"] = lc.LoggerContractProperties 6930 } 6931 return json.Marshal(objectMap) 6932} 6933 6934// UnmarshalJSON is the custom unmarshaler for LoggerContract struct. 6935func (lc *LoggerContract) UnmarshalJSON(body []byte) error { 6936 var m map[string]*json.RawMessage 6937 err := json.Unmarshal(body, &m) 6938 if err != nil { 6939 return err 6940 } 6941 for k, v := range m { 6942 switch k { 6943 case "properties": 6944 if v != nil { 6945 var loggerContractProperties LoggerContractProperties 6946 err = json.Unmarshal(*v, &loggerContractProperties) 6947 if err != nil { 6948 return err 6949 } 6950 lc.LoggerContractProperties = &loggerContractProperties 6951 } 6952 case "id": 6953 if v != nil { 6954 var ID string 6955 err = json.Unmarshal(*v, &ID) 6956 if err != nil { 6957 return err 6958 } 6959 lc.ID = &ID 6960 } 6961 case "name": 6962 if v != nil { 6963 var name string 6964 err = json.Unmarshal(*v, &name) 6965 if err != nil { 6966 return err 6967 } 6968 lc.Name = &name 6969 } 6970 case "type": 6971 if v != nil { 6972 var typeVar string 6973 err = json.Unmarshal(*v, &typeVar) 6974 if err != nil { 6975 return err 6976 } 6977 lc.Type = &typeVar 6978 } 6979 } 6980 } 6981 6982 return nil 6983} 6984 6985// LoggerContractProperties the Logger entity in API Management represents an event sink that you can use 6986// to log API Management events. Currently the Logger entity supports logging API Management events to 6987// Azure Event Hubs. 6988type LoggerContractProperties struct { 6989 // LoggerType - Logger type. Possible values include: 'AzureEventHub', 'ApplicationInsights' 6990 LoggerType LoggerType `json:"loggerType,omitempty"` 6991 // Description - Logger description. 6992 Description *string `json:"description,omitempty"` 6993 // Credentials - The name and SendRule connection string of the event hub for azureEventHub logger. 6994 // Instrumentation key for applicationInsights logger. 6995 Credentials map[string]*string `json:"credentials"` 6996 // IsBuffered - Whether records are buffered in the logger before publishing. Default is assumed to be true. 6997 IsBuffered *bool `json:"isBuffered,omitempty"` 6998 // ResourceID - Azure Resource Id of a log target (either Azure Event Hub resource or Azure Application Insights resource). 6999 ResourceID *string `json:"resourceId,omitempty"` 7000} 7001 7002// MarshalJSON is the custom marshaler for LoggerContractProperties. 7003func (lcp LoggerContractProperties) MarshalJSON() ([]byte, error) { 7004 objectMap := make(map[string]interface{}) 7005 if lcp.LoggerType != "" { 7006 objectMap["loggerType"] = lcp.LoggerType 7007 } 7008 if lcp.Description != nil { 7009 objectMap["description"] = lcp.Description 7010 } 7011 if lcp.Credentials != nil { 7012 objectMap["credentials"] = lcp.Credentials 7013 } 7014 if lcp.IsBuffered != nil { 7015 objectMap["isBuffered"] = lcp.IsBuffered 7016 } 7017 if lcp.ResourceID != nil { 7018 objectMap["resourceId"] = lcp.ResourceID 7019 } 7020 return json.Marshal(objectMap) 7021} 7022 7023// LoggerUpdateContract logger update contract. 7024type LoggerUpdateContract struct { 7025 // LoggerUpdateParameters - Logger entity update contract properties. 7026 *LoggerUpdateParameters `json:"properties,omitempty"` 7027} 7028 7029// MarshalJSON is the custom marshaler for LoggerUpdateContract. 7030func (luc LoggerUpdateContract) MarshalJSON() ([]byte, error) { 7031 objectMap := make(map[string]interface{}) 7032 if luc.LoggerUpdateParameters != nil { 7033 objectMap["properties"] = luc.LoggerUpdateParameters 7034 } 7035 return json.Marshal(objectMap) 7036} 7037 7038// UnmarshalJSON is the custom unmarshaler for LoggerUpdateContract struct. 7039func (luc *LoggerUpdateContract) UnmarshalJSON(body []byte) error { 7040 var m map[string]*json.RawMessage 7041 err := json.Unmarshal(body, &m) 7042 if err != nil { 7043 return err 7044 } 7045 for k, v := range m { 7046 switch k { 7047 case "properties": 7048 if v != nil { 7049 var loggerUpdateParameters LoggerUpdateParameters 7050 err = json.Unmarshal(*v, &loggerUpdateParameters) 7051 if err != nil { 7052 return err 7053 } 7054 luc.LoggerUpdateParameters = &loggerUpdateParameters 7055 } 7056 } 7057 } 7058 7059 return nil 7060} 7061 7062// LoggerUpdateParameters parameters supplied to the Update Logger operation. 7063type LoggerUpdateParameters struct { 7064 // LoggerType - Logger type. Possible values include: 'AzureEventHub', 'ApplicationInsights' 7065 LoggerType LoggerType `json:"loggerType,omitempty"` 7066 // Description - Logger description. 7067 Description *string `json:"description,omitempty"` 7068 // Credentials - Logger credentials. 7069 Credentials map[string]*string `json:"credentials"` 7070 // IsBuffered - Whether records are buffered in the logger before publishing. Default is assumed to be true. 7071 IsBuffered *bool `json:"isBuffered,omitempty"` 7072} 7073 7074// MarshalJSON is the custom marshaler for LoggerUpdateParameters. 7075func (lup LoggerUpdateParameters) MarshalJSON() ([]byte, error) { 7076 objectMap := make(map[string]interface{}) 7077 if lup.LoggerType != "" { 7078 objectMap["loggerType"] = lup.LoggerType 7079 } 7080 if lup.Description != nil { 7081 objectMap["description"] = lup.Description 7082 } 7083 if lup.Credentials != nil { 7084 objectMap["credentials"] = lup.Credentials 7085 } 7086 if lup.IsBuffered != nil { 7087 objectMap["isBuffered"] = lup.IsBuffered 7088 } 7089 return json.Marshal(objectMap) 7090} 7091 7092// NamedValueCollection paged NamedValue list representation. 7093type NamedValueCollection struct { 7094 autorest.Response `json:"-"` 7095 // Value - Page values. 7096 Value *[]NamedValueContract `json:"value,omitempty"` 7097 // NextLink - Next page link if any. 7098 NextLink *string `json:"nextLink,omitempty"` 7099} 7100 7101// NamedValueCollectionIterator provides access to a complete listing of NamedValueContract values. 7102type NamedValueCollectionIterator struct { 7103 i int 7104 page NamedValueCollectionPage 7105} 7106 7107// NextWithContext advances to the next value. If there was an error making 7108// the request the iterator does not advance and the error is returned. 7109func (iter *NamedValueCollectionIterator) NextWithContext(ctx context.Context) (err error) { 7110 if tracing.IsEnabled() { 7111 ctx = tracing.StartSpan(ctx, fqdn+"/NamedValueCollectionIterator.NextWithContext") 7112 defer func() { 7113 sc := -1 7114 if iter.Response().Response.Response != nil { 7115 sc = iter.Response().Response.Response.StatusCode 7116 } 7117 tracing.EndSpan(ctx, sc, err) 7118 }() 7119 } 7120 iter.i++ 7121 if iter.i < len(iter.page.Values()) { 7122 return nil 7123 } 7124 err = iter.page.NextWithContext(ctx) 7125 if err != nil { 7126 iter.i-- 7127 return err 7128 } 7129 iter.i = 0 7130 return nil 7131} 7132 7133// Next advances to the next value. If there was an error making 7134// the request the iterator does not advance and the error is returned. 7135// Deprecated: Use NextWithContext() instead. 7136func (iter *NamedValueCollectionIterator) Next() error { 7137 return iter.NextWithContext(context.Background()) 7138} 7139 7140// NotDone returns true if the enumeration should be started or is not yet complete. 7141func (iter NamedValueCollectionIterator) NotDone() bool { 7142 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 7143} 7144 7145// Response returns the raw server response from the last page request. 7146func (iter NamedValueCollectionIterator) Response() NamedValueCollection { 7147 return iter.page.Response() 7148} 7149 7150// Value returns the current value or a zero-initialized value if the 7151// iterator has advanced beyond the end of the collection. 7152func (iter NamedValueCollectionIterator) Value() NamedValueContract { 7153 if !iter.page.NotDone() { 7154 return NamedValueContract{} 7155 } 7156 return iter.page.Values()[iter.i] 7157} 7158 7159// Creates a new instance of the NamedValueCollectionIterator type. 7160func NewNamedValueCollectionIterator(page NamedValueCollectionPage) NamedValueCollectionIterator { 7161 return NamedValueCollectionIterator{page: page} 7162} 7163 7164// IsEmpty returns true if the ListResult contains no values. 7165func (nvc NamedValueCollection) IsEmpty() bool { 7166 return nvc.Value == nil || len(*nvc.Value) == 0 7167} 7168 7169// hasNextLink returns true if the NextLink is not empty. 7170func (nvc NamedValueCollection) hasNextLink() bool { 7171 return nvc.NextLink != nil && len(*nvc.NextLink) != 0 7172} 7173 7174// namedValueCollectionPreparer prepares a request to retrieve the next set of results. 7175// It returns nil if no more results exist. 7176func (nvc NamedValueCollection) namedValueCollectionPreparer(ctx context.Context) (*http.Request, error) { 7177 if !nvc.hasNextLink() { 7178 return nil, nil 7179 } 7180 return autorest.Prepare((&http.Request{}).WithContext(ctx), 7181 autorest.AsJSON(), 7182 autorest.AsGet(), 7183 autorest.WithBaseURL(to.String(nvc.NextLink))) 7184} 7185 7186// NamedValueCollectionPage contains a page of NamedValueContract values. 7187type NamedValueCollectionPage struct { 7188 fn func(context.Context, NamedValueCollection) (NamedValueCollection, error) 7189 nvc NamedValueCollection 7190} 7191 7192// NextWithContext advances to the next page of values. If there was an error making 7193// the request the page does not advance and the error is returned. 7194func (page *NamedValueCollectionPage) NextWithContext(ctx context.Context) (err error) { 7195 if tracing.IsEnabled() { 7196 ctx = tracing.StartSpan(ctx, fqdn+"/NamedValueCollectionPage.NextWithContext") 7197 defer func() { 7198 sc := -1 7199 if page.Response().Response.Response != nil { 7200 sc = page.Response().Response.Response.StatusCode 7201 } 7202 tracing.EndSpan(ctx, sc, err) 7203 }() 7204 } 7205 for { 7206 next, err := page.fn(ctx, page.nvc) 7207 if err != nil { 7208 return err 7209 } 7210 page.nvc = next 7211 if !next.hasNextLink() || !next.IsEmpty() { 7212 break 7213 } 7214 } 7215 return nil 7216} 7217 7218// Next advances to the next page of values. If there was an error making 7219// the request the page does not advance and the error is returned. 7220// Deprecated: Use NextWithContext() instead. 7221func (page *NamedValueCollectionPage) Next() error { 7222 return page.NextWithContext(context.Background()) 7223} 7224 7225// NotDone returns true if the page enumeration should be started or is not yet complete. 7226func (page NamedValueCollectionPage) NotDone() bool { 7227 return !page.nvc.IsEmpty() 7228} 7229 7230// Response returns the raw server response from the last page request. 7231func (page NamedValueCollectionPage) Response() NamedValueCollection { 7232 return page.nvc 7233} 7234 7235// Values returns the slice of values for the current page or nil if there are no values. 7236func (page NamedValueCollectionPage) Values() []NamedValueContract { 7237 if page.nvc.IsEmpty() { 7238 return nil 7239 } 7240 return *page.nvc.Value 7241} 7242 7243// Creates a new instance of the NamedValueCollectionPage type. 7244func NewNamedValueCollectionPage(cur NamedValueCollection, getNextPage func(context.Context, NamedValueCollection) (NamedValueCollection, error)) NamedValueCollectionPage { 7245 return NamedValueCollectionPage{ 7246 fn: getNextPage, 7247 nvc: cur, 7248 } 7249} 7250 7251// NamedValueContract namedValue details. 7252type NamedValueContract struct { 7253 autorest.Response `json:"-"` 7254 // NamedValueContractProperties - NamedValue entity contract properties. 7255 *NamedValueContractProperties `json:"properties,omitempty"` 7256 // ID - READ-ONLY; Resource ID. 7257 ID *string `json:"id,omitempty"` 7258 // Name - READ-ONLY; Resource name. 7259 Name *string `json:"name,omitempty"` 7260 // Type - READ-ONLY; Resource type for API Management resource. 7261 Type *string `json:"type,omitempty"` 7262} 7263 7264// MarshalJSON is the custom marshaler for NamedValueContract. 7265func (nvc NamedValueContract) MarshalJSON() ([]byte, error) { 7266 objectMap := make(map[string]interface{}) 7267 if nvc.NamedValueContractProperties != nil { 7268 objectMap["properties"] = nvc.NamedValueContractProperties 7269 } 7270 return json.Marshal(objectMap) 7271} 7272 7273// UnmarshalJSON is the custom unmarshaler for NamedValueContract struct. 7274func (nvc *NamedValueContract) UnmarshalJSON(body []byte) error { 7275 var m map[string]*json.RawMessage 7276 err := json.Unmarshal(body, &m) 7277 if err != nil { 7278 return err 7279 } 7280 for k, v := range m { 7281 switch k { 7282 case "properties": 7283 if v != nil { 7284 var namedValueContractProperties NamedValueContractProperties 7285 err = json.Unmarshal(*v, &namedValueContractProperties) 7286 if err != nil { 7287 return err 7288 } 7289 nvc.NamedValueContractProperties = &namedValueContractProperties 7290 } 7291 case "id": 7292 if v != nil { 7293 var ID string 7294 err = json.Unmarshal(*v, &ID) 7295 if err != nil { 7296 return err 7297 } 7298 nvc.ID = &ID 7299 } 7300 case "name": 7301 if v != nil { 7302 var name string 7303 err = json.Unmarshal(*v, &name) 7304 if err != nil { 7305 return err 7306 } 7307 nvc.Name = &name 7308 } 7309 case "type": 7310 if v != nil { 7311 var typeVar string 7312 err = json.Unmarshal(*v, &typeVar) 7313 if err != nil { 7314 return err 7315 } 7316 nvc.Type = &typeVar 7317 } 7318 } 7319 } 7320 7321 return nil 7322} 7323 7324// NamedValueContractProperties namedValue Contract properties. 7325type NamedValueContractProperties struct { 7326 // DisplayName - Unique name of NamedValue. It may contain only letters, digits, period, dash, and underscore characters. 7327 DisplayName *string `json:"displayName,omitempty"` 7328 // Value - Value of the NamedValue. Can contain policy expressions. It may not be empty or consist only of whitespace. This property will not be filled on 'GET' operations! Use '/listSecrets' POST request to get the value. 7329 Value *string `json:"value,omitempty"` 7330 // Tags - Optional tags that when provided can be used to filter the NamedValue list. 7331 Tags *[]string `json:"tags,omitempty"` 7332 // Secret - Determines whether the value is a secret and should be encrypted or not. Default value is false. 7333 Secret *bool `json:"secret,omitempty"` 7334} 7335 7336// NamedValueCreateContract namedValue details. 7337type NamedValueCreateContract struct { 7338 // NamedValueCreateContractProperties - NamedValue entity contract properties for PUT operation. 7339 *NamedValueCreateContractProperties `json:"properties,omitempty"` 7340 // ID - READ-ONLY; Resource ID. 7341 ID *string `json:"id,omitempty"` 7342 // Name - READ-ONLY; Resource name. 7343 Name *string `json:"name,omitempty"` 7344 // Type - READ-ONLY; Resource type for API Management resource. 7345 Type *string `json:"type,omitempty"` 7346} 7347 7348// MarshalJSON is the custom marshaler for NamedValueCreateContract. 7349func (nvcc NamedValueCreateContract) MarshalJSON() ([]byte, error) { 7350 objectMap := make(map[string]interface{}) 7351 if nvcc.NamedValueCreateContractProperties != nil { 7352 objectMap["properties"] = nvcc.NamedValueCreateContractProperties 7353 } 7354 return json.Marshal(objectMap) 7355} 7356 7357// UnmarshalJSON is the custom unmarshaler for NamedValueCreateContract struct. 7358func (nvcc *NamedValueCreateContract) UnmarshalJSON(body []byte) error { 7359 var m map[string]*json.RawMessage 7360 err := json.Unmarshal(body, &m) 7361 if err != nil { 7362 return err 7363 } 7364 for k, v := range m { 7365 switch k { 7366 case "properties": 7367 if v != nil { 7368 var namedValueCreateContractProperties NamedValueCreateContractProperties 7369 err = json.Unmarshal(*v, &namedValueCreateContractProperties) 7370 if err != nil { 7371 return err 7372 } 7373 nvcc.NamedValueCreateContractProperties = &namedValueCreateContractProperties 7374 } 7375 case "id": 7376 if v != nil { 7377 var ID string 7378 err = json.Unmarshal(*v, &ID) 7379 if err != nil { 7380 return err 7381 } 7382 nvcc.ID = &ID 7383 } 7384 case "name": 7385 if v != nil { 7386 var name string 7387 err = json.Unmarshal(*v, &name) 7388 if err != nil { 7389 return err 7390 } 7391 nvcc.Name = &name 7392 } 7393 case "type": 7394 if v != nil { 7395 var typeVar string 7396 err = json.Unmarshal(*v, &typeVar) 7397 if err != nil { 7398 return err 7399 } 7400 nvcc.Type = &typeVar 7401 } 7402 } 7403 } 7404 7405 return nil 7406} 7407 7408// NamedValueCreateContractProperties namedValue Contract properties. 7409type NamedValueCreateContractProperties struct { 7410 // DisplayName - Unique name of NamedValue. It may contain only letters, digits, period, dash, and underscore characters. 7411 DisplayName *string `json:"displayName,omitempty"` 7412 // Value - Value of the NamedValue. Can contain policy expressions. It may not be empty or consist only of whitespace. This property will not be filled on 'GET' operations! Use '/listSecrets' POST request to get the value. 7413 Value *string `json:"value,omitempty"` 7414 // Tags - Optional tags that when provided can be used to filter the NamedValue list. 7415 Tags *[]string `json:"tags,omitempty"` 7416 // Secret - Determines whether the value is a secret and should be encrypted or not. Default value is false. 7417 Secret *bool `json:"secret,omitempty"` 7418} 7419 7420// NamedValueCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a 7421// long-running operation. 7422type NamedValueCreateOrUpdateFuture struct { 7423 azure.FutureAPI 7424 // Result returns the result of the asynchronous operation. 7425 // If the operation has not completed it will return an error. 7426 Result func(NamedValueClient) (NamedValueContract, error) 7427} 7428 7429// UnmarshalJSON is the custom unmarshaller for CreateFuture. 7430func (future *NamedValueCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 7431 var azFuture azure.Future 7432 if err := json.Unmarshal(body, &azFuture); err != nil { 7433 return err 7434 } 7435 future.FutureAPI = &azFuture 7436 future.Result = future.result 7437 return nil 7438} 7439 7440// result is the default implementation for NamedValueCreateOrUpdateFuture.Result. 7441func (future *NamedValueCreateOrUpdateFuture) result(client NamedValueClient) (nvc NamedValueContract, err error) { 7442 var done bool 7443 done, err = future.DoneWithContext(context.Background(), client) 7444 if err != nil { 7445 err = autorest.NewErrorWithError(err, "apimanagement.NamedValueCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 7446 return 7447 } 7448 if !done { 7449 nvc.Response.Response = future.Response() 7450 err = azure.NewAsyncOpIncompleteError("apimanagement.NamedValueCreateOrUpdateFuture") 7451 return 7452 } 7453 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 7454 if nvc.Response.Response, err = future.GetResult(sender); err == nil && nvc.Response.Response.StatusCode != http.StatusNoContent { 7455 nvc, err = client.CreateOrUpdateResponder(nvc.Response.Response) 7456 if err != nil { 7457 err = autorest.NewErrorWithError(err, "apimanagement.NamedValueCreateOrUpdateFuture", "Result", nvc.Response.Response, "Failure responding to request") 7458 } 7459 } 7460 return 7461} 7462 7463// NamedValueEntityBaseParameters namedValue Entity Base Parameters set. 7464type NamedValueEntityBaseParameters struct { 7465 // Tags - Optional tags that when provided can be used to filter the NamedValue list. 7466 Tags *[]string `json:"tags,omitempty"` 7467 // Secret - Determines whether the value is a secret and should be encrypted or not. Default value is false. 7468 Secret *bool `json:"secret,omitempty"` 7469} 7470 7471// NamedValueUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 7472// operation. 7473type NamedValueUpdateFuture struct { 7474 azure.FutureAPI 7475 // Result returns the result of the asynchronous operation. 7476 // If the operation has not completed it will return an error. 7477 Result func(NamedValueClient) (NamedValueContract, error) 7478} 7479 7480// UnmarshalJSON is the custom unmarshaller for CreateFuture. 7481func (future *NamedValueUpdateFuture) UnmarshalJSON(body []byte) error { 7482 var azFuture azure.Future 7483 if err := json.Unmarshal(body, &azFuture); err != nil { 7484 return err 7485 } 7486 future.FutureAPI = &azFuture 7487 future.Result = future.result 7488 return nil 7489} 7490 7491// result is the default implementation for NamedValueUpdateFuture.Result. 7492func (future *NamedValueUpdateFuture) result(client NamedValueClient) (nvc NamedValueContract, err error) { 7493 var done bool 7494 done, err = future.DoneWithContext(context.Background(), client) 7495 if err != nil { 7496 err = autorest.NewErrorWithError(err, "apimanagement.NamedValueUpdateFuture", "Result", future.Response(), "Polling failure") 7497 return 7498 } 7499 if !done { 7500 nvc.Response.Response = future.Response() 7501 err = azure.NewAsyncOpIncompleteError("apimanagement.NamedValueUpdateFuture") 7502 return 7503 } 7504 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 7505 if nvc.Response.Response, err = future.GetResult(sender); err == nil && nvc.Response.Response.StatusCode != http.StatusNoContent { 7506 nvc, err = client.UpdateResponder(nvc.Response.Response) 7507 if err != nil { 7508 err = autorest.NewErrorWithError(err, "apimanagement.NamedValueUpdateFuture", "Result", nvc.Response.Response, "Failure responding to request") 7509 } 7510 } 7511 return 7512} 7513 7514// NamedValueUpdateParameterProperties namedValue Contract properties. 7515type NamedValueUpdateParameterProperties struct { 7516 // DisplayName - Unique name of NamedValue. It may contain only letters, digits, period, dash, and underscore characters. 7517 DisplayName *string `json:"displayName,omitempty"` 7518 // Value - Value of the NamedValue. Can contain policy expressions. It may not be empty or consist only of whitespace. 7519 Value *string `json:"value,omitempty"` 7520 // Tags - Optional tags that when provided can be used to filter the NamedValue list. 7521 Tags *[]string `json:"tags,omitempty"` 7522 // Secret - Determines whether the value is a secret and should be encrypted or not. Default value is false. 7523 Secret *bool `json:"secret,omitempty"` 7524} 7525 7526// NamedValueUpdateParameters namedValue update Parameters. 7527type NamedValueUpdateParameters struct { 7528 // NamedValueUpdateParameterProperties - NamedValue entity Update contract properties. 7529 *NamedValueUpdateParameterProperties `json:"properties,omitempty"` 7530} 7531 7532// MarshalJSON is the custom marshaler for NamedValueUpdateParameters. 7533func (nvup NamedValueUpdateParameters) MarshalJSON() ([]byte, error) { 7534 objectMap := make(map[string]interface{}) 7535 if nvup.NamedValueUpdateParameterProperties != nil { 7536 objectMap["properties"] = nvup.NamedValueUpdateParameterProperties 7537 } 7538 return json.Marshal(objectMap) 7539} 7540 7541// UnmarshalJSON is the custom unmarshaler for NamedValueUpdateParameters struct. 7542func (nvup *NamedValueUpdateParameters) UnmarshalJSON(body []byte) error { 7543 var m map[string]*json.RawMessage 7544 err := json.Unmarshal(body, &m) 7545 if err != nil { 7546 return err 7547 } 7548 for k, v := range m { 7549 switch k { 7550 case "properties": 7551 if v != nil { 7552 var namedValueUpdateParameterProperties NamedValueUpdateParameterProperties 7553 err = json.Unmarshal(*v, &namedValueUpdateParameterProperties) 7554 if err != nil { 7555 return err 7556 } 7557 nvup.NamedValueUpdateParameterProperties = &namedValueUpdateParameterProperties 7558 } 7559 } 7560 } 7561 7562 return nil 7563} 7564 7565// NetworkStatusContract network Status details. 7566type NetworkStatusContract struct { 7567 autorest.Response `json:"-"` 7568 // DNSServers - Gets the list of DNS servers IPV4 addresses. 7569 DNSServers *[]string `json:"dnsServers,omitempty"` 7570 // ConnectivityStatus - Gets the list of Connectivity Status to the Resources on which the service depends upon. 7571 ConnectivityStatus *[]ConnectivityStatusContract `json:"connectivityStatus,omitempty"` 7572} 7573 7574// NetworkStatusContractByLocation network Status in the Location 7575type NetworkStatusContractByLocation struct { 7576 // Location - Location of service 7577 Location *string `json:"location,omitempty"` 7578 // NetworkStatus - Network status in Location 7579 NetworkStatus *NetworkStatusContract `json:"networkStatus,omitempty"` 7580} 7581 7582// NotificationCollection paged Notification list representation. 7583type NotificationCollection struct { 7584 autorest.Response `json:"-"` 7585 // Value - Page values. 7586 Value *[]NotificationContract `json:"value,omitempty"` 7587 // NextLink - Next page link if any. 7588 NextLink *string `json:"nextLink,omitempty"` 7589} 7590 7591// NotificationCollectionIterator provides access to a complete listing of NotificationContract values. 7592type NotificationCollectionIterator struct { 7593 i int 7594 page NotificationCollectionPage 7595} 7596 7597// NextWithContext advances to the next value. If there was an error making 7598// the request the iterator does not advance and the error is returned. 7599func (iter *NotificationCollectionIterator) NextWithContext(ctx context.Context) (err error) { 7600 if tracing.IsEnabled() { 7601 ctx = tracing.StartSpan(ctx, fqdn+"/NotificationCollectionIterator.NextWithContext") 7602 defer func() { 7603 sc := -1 7604 if iter.Response().Response.Response != nil { 7605 sc = iter.Response().Response.Response.StatusCode 7606 } 7607 tracing.EndSpan(ctx, sc, err) 7608 }() 7609 } 7610 iter.i++ 7611 if iter.i < len(iter.page.Values()) { 7612 return nil 7613 } 7614 err = iter.page.NextWithContext(ctx) 7615 if err != nil { 7616 iter.i-- 7617 return err 7618 } 7619 iter.i = 0 7620 return nil 7621} 7622 7623// Next advances to the next value. If there was an error making 7624// the request the iterator does not advance and the error is returned. 7625// Deprecated: Use NextWithContext() instead. 7626func (iter *NotificationCollectionIterator) Next() error { 7627 return iter.NextWithContext(context.Background()) 7628} 7629 7630// NotDone returns true if the enumeration should be started or is not yet complete. 7631func (iter NotificationCollectionIterator) NotDone() bool { 7632 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 7633} 7634 7635// Response returns the raw server response from the last page request. 7636func (iter NotificationCollectionIterator) Response() NotificationCollection { 7637 return iter.page.Response() 7638} 7639 7640// Value returns the current value or a zero-initialized value if the 7641// iterator has advanced beyond the end of the collection. 7642func (iter NotificationCollectionIterator) Value() NotificationContract { 7643 if !iter.page.NotDone() { 7644 return NotificationContract{} 7645 } 7646 return iter.page.Values()[iter.i] 7647} 7648 7649// Creates a new instance of the NotificationCollectionIterator type. 7650func NewNotificationCollectionIterator(page NotificationCollectionPage) NotificationCollectionIterator { 7651 return NotificationCollectionIterator{page: page} 7652} 7653 7654// IsEmpty returns true if the ListResult contains no values. 7655func (nc NotificationCollection) IsEmpty() bool { 7656 return nc.Value == nil || len(*nc.Value) == 0 7657} 7658 7659// hasNextLink returns true if the NextLink is not empty. 7660func (nc NotificationCollection) hasNextLink() bool { 7661 return nc.NextLink != nil && len(*nc.NextLink) != 0 7662} 7663 7664// notificationCollectionPreparer prepares a request to retrieve the next set of results. 7665// It returns nil if no more results exist. 7666func (nc NotificationCollection) notificationCollectionPreparer(ctx context.Context) (*http.Request, error) { 7667 if !nc.hasNextLink() { 7668 return nil, nil 7669 } 7670 return autorest.Prepare((&http.Request{}).WithContext(ctx), 7671 autorest.AsJSON(), 7672 autorest.AsGet(), 7673 autorest.WithBaseURL(to.String(nc.NextLink))) 7674} 7675 7676// NotificationCollectionPage contains a page of NotificationContract values. 7677type NotificationCollectionPage struct { 7678 fn func(context.Context, NotificationCollection) (NotificationCollection, error) 7679 nc NotificationCollection 7680} 7681 7682// NextWithContext advances to the next page of values. If there was an error making 7683// the request the page does not advance and the error is returned. 7684func (page *NotificationCollectionPage) NextWithContext(ctx context.Context) (err error) { 7685 if tracing.IsEnabled() { 7686 ctx = tracing.StartSpan(ctx, fqdn+"/NotificationCollectionPage.NextWithContext") 7687 defer func() { 7688 sc := -1 7689 if page.Response().Response.Response != nil { 7690 sc = page.Response().Response.Response.StatusCode 7691 } 7692 tracing.EndSpan(ctx, sc, err) 7693 }() 7694 } 7695 for { 7696 next, err := page.fn(ctx, page.nc) 7697 if err != nil { 7698 return err 7699 } 7700 page.nc = next 7701 if !next.hasNextLink() || !next.IsEmpty() { 7702 break 7703 } 7704 } 7705 return nil 7706} 7707 7708// Next advances to the next page of values. If there was an error making 7709// the request the page does not advance and the error is returned. 7710// Deprecated: Use NextWithContext() instead. 7711func (page *NotificationCollectionPage) Next() error { 7712 return page.NextWithContext(context.Background()) 7713} 7714 7715// NotDone returns true if the page enumeration should be started or is not yet complete. 7716func (page NotificationCollectionPage) NotDone() bool { 7717 return !page.nc.IsEmpty() 7718} 7719 7720// Response returns the raw server response from the last page request. 7721func (page NotificationCollectionPage) Response() NotificationCollection { 7722 return page.nc 7723} 7724 7725// Values returns the slice of values for the current page or nil if there are no values. 7726func (page NotificationCollectionPage) Values() []NotificationContract { 7727 if page.nc.IsEmpty() { 7728 return nil 7729 } 7730 return *page.nc.Value 7731} 7732 7733// Creates a new instance of the NotificationCollectionPage type. 7734func NewNotificationCollectionPage(cur NotificationCollection, getNextPage func(context.Context, NotificationCollection) (NotificationCollection, error)) NotificationCollectionPage { 7735 return NotificationCollectionPage{ 7736 fn: getNextPage, 7737 nc: cur, 7738 } 7739} 7740 7741// NotificationContract notification details. 7742type NotificationContract struct { 7743 autorest.Response `json:"-"` 7744 // NotificationContractProperties - Notification entity contract properties. 7745 *NotificationContractProperties `json:"properties,omitempty"` 7746 // ID - READ-ONLY; Resource ID. 7747 ID *string `json:"id,omitempty"` 7748 // Name - READ-ONLY; Resource name. 7749 Name *string `json:"name,omitempty"` 7750 // Type - READ-ONLY; Resource type for API Management resource. 7751 Type *string `json:"type,omitempty"` 7752} 7753 7754// MarshalJSON is the custom marshaler for NotificationContract. 7755func (nc NotificationContract) MarshalJSON() ([]byte, error) { 7756 objectMap := make(map[string]interface{}) 7757 if nc.NotificationContractProperties != nil { 7758 objectMap["properties"] = nc.NotificationContractProperties 7759 } 7760 return json.Marshal(objectMap) 7761} 7762 7763// UnmarshalJSON is the custom unmarshaler for NotificationContract struct. 7764func (nc *NotificationContract) UnmarshalJSON(body []byte) error { 7765 var m map[string]*json.RawMessage 7766 err := json.Unmarshal(body, &m) 7767 if err != nil { 7768 return err 7769 } 7770 for k, v := range m { 7771 switch k { 7772 case "properties": 7773 if v != nil { 7774 var notificationContractProperties NotificationContractProperties 7775 err = json.Unmarshal(*v, ¬ificationContractProperties) 7776 if err != nil { 7777 return err 7778 } 7779 nc.NotificationContractProperties = ¬ificationContractProperties 7780 } 7781 case "id": 7782 if v != nil { 7783 var ID string 7784 err = json.Unmarshal(*v, &ID) 7785 if err != nil { 7786 return err 7787 } 7788 nc.ID = &ID 7789 } 7790 case "name": 7791 if v != nil { 7792 var name string 7793 err = json.Unmarshal(*v, &name) 7794 if err != nil { 7795 return err 7796 } 7797 nc.Name = &name 7798 } 7799 case "type": 7800 if v != nil { 7801 var typeVar string 7802 err = json.Unmarshal(*v, &typeVar) 7803 if err != nil { 7804 return err 7805 } 7806 nc.Type = &typeVar 7807 } 7808 } 7809 } 7810 7811 return nil 7812} 7813 7814// NotificationContractProperties notification Contract properties. 7815type NotificationContractProperties struct { 7816 // Title - Title of the Notification. 7817 Title *string `json:"title,omitempty"` 7818 // Description - Description of the Notification. 7819 Description *string `json:"description,omitempty"` 7820 // Recipients - Recipient Parameter values. 7821 Recipients *RecipientsContractProperties `json:"recipients,omitempty"` 7822} 7823 7824// OAuth2AuthenticationSettingsContract API OAuth2 Authentication settings details. 7825type OAuth2AuthenticationSettingsContract struct { 7826 // AuthorizationServerID - OAuth authorization server identifier. 7827 AuthorizationServerID *string `json:"authorizationServerId,omitempty"` 7828 // Scope - operations scope. 7829 Scope *string `json:"scope,omitempty"` 7830} 7831 7832// OpenIDAuthenticationSettingsContract API OAuth2 Authentication settings details. 7833type OpenIDAuthenticationSettingsContract struct { 7834 // OpenidProviderID - OAuth authorization server identifier. 7835 OpenidProviderID *string `json:"openidProviderId,omitempty"` 7836 // BearerTokenSendingMethods - How to send token to the server. 7837 BearerTokenSendingMethods *[]BearerTokenSendingMethods `json:"bearerTokenSendingMethods,omitempty"` 7838} 7839 7840// OpenIDConnectProviderCollection paged OpenIdProviders list representation. 7841type OpenIDConnectProviderCollection struct { 7842 autorest.Response `json:"-"` 7843 // Value - Page values. 7844 Value *[]OpenidConnectProviderContract `json:"value,omitempty"` 7845 // NextLink - Next page link if any. 7846 NextLink *string `json:"nextLink,omitempty"` 7847} 7848 7849// OpenIDConnectProviderCollectionIterator provides access to a complete listing of 7850// OpenidConnectProviderContract values. 7851type OpenIDConnectProviderCollectionIterator struct { 7852 i int 7853 page OpenIDConnectProviderCollectionPage 7854} 7855 7856// NextWithContext advances to the next value. If there was an error making 7857// the request the iterator does not advance and the error is returned. 7858func (iter *OpenIDConnectProviderCollectionIterator) NextWithContext(ctx context.Context) (err error) { 7859 if tracing.IsEnabled() { 7860 ctx = tracing.StartSpan(ctx, fqdn+"/OpenIDConnectProviderCollectionIterator.NextWithContext") 7861 defer func() { 7862 sc := -1 7863 if iter.Response().Response.Response != nil { 7864 sc = iter.Response().Response.Response.StatusCode 7865 } 7866 tracing.EndSpan(ctx, sc, err) 7867 }() 7868 } 7869 iter.i++ 7870 if iter.i < len(iter.page.Values()) { 7871 return nil 7872 } 7873 err = iter.page.NextWithContext(ctx) 7874 if err != nil { 7875 iter.i-- 7876 return err 7877 } 7878 iter.i = 0 7879 return nil 7880} 7881 7882// Next advances to the next value. If there was an error making 7883// the request the iterator does not advance and the error is returned. 7884// Deprecated: Use NextWithContext() instead. 7885func (iter *OpenIDConnectProviderCollectionIterator) Next() error { 7886 return iter.NextWithContext(context.Background()) 7887} 7888 7889// NotDone returns true if the enumeration should be started or is not yet complete. 7890func (iter OpenIDConnectProviderCollectionIterator) NotDone() bool { 7891 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 7892} 7893 7894// Response returns the raw server response from the last page request. 7895func (iter OpenIDConnectProviderCollectionIterator) Response() OpenIDConnectProviderCollection { 7896 return iter.page.Response() 7897} 7898 7899// Value returns the current value or a zero-initialized value if the 7900// iterator has advanced beyond the end of the collection. 7901func (iter OpenIDConnectProviderCollectionIterator) Value() OpenidConnectProviderContract { 7902 if !iter.page.NotDone() { 7903 return OpenidConnectProviderContract{} 7904 } 7905 return iter.page.Values()[iter.i] 7906} 7907 7908// Creates a new instance of the OpenIDConnectProviderCollectionIterator type. 7909func NewOpenIDConnectProviderCollectionIterator(page OpenIDConnectProviderCollectionPage) OpenIDConnectProviderCollectionIterator { 7910 return OpenIDConnectProviderCollectionIterator{page: page} 7911} 7912 7913// IsEmpty returns true if the ListResult contains no values. 7914func (oicpc OpenIDConnectProviderCollection) IsEmpty() bool { 7915 return oicpc.Value == nil || len(*oicpc.Value) == 0 7916} 7917 7918// hasNextLink returns true if the NextLink is not empty. 7919func (oicpc OpenIDConnectProviderCollection) hasNextLink() bool { 7920 return oicpc.NextLink != nil && len(*oicpc.NextLink) != 0 7921} 7922 7923// openIDConnectProviderCollectionPreparer prepares a request to retrieve the next set of results. 7924// It returns nil if no more results exist. 7925func (oicpc OpenIDConnectProviderCollection) openIDConnectProviderCollectionPreparer(ctx context.Context) (*http.Request, error) { 7926 if !oicpc.hasNextLink() { 7927 return nil, nil 7928 } 7929 return autorest.Prepare((&http.Request{}).WithContext(ctx), 7930 autorest.AsJSON(), 7931 autorest.AsGet(), 7932 autorest.WithBaseURL(to.String(oicpc.NextLink))) 7933} 7934 7935// OpenIDConnectProviderCollectionPage contains a page of OpenidConnectProviderContract values. 7936type OpenIDConnectProviderCollectionPage struct { 7937 fn func(context.Context, OpenIDConnectProviderCollection) (OpenIDConnectProviderCollection, error) 7938 oicpc OpenIDConnectProviderCollection 7939} 7940 7941// NextWithContext advances to the next page of values. If there was an error making 7942// the request the page does not advance and the error is returned. 7943func (page *OpenIDConnectProviderCollectionPage) NextWithContext(ctx context.Context) (err error) { 7944 if tracing.IsEnabled() { 7945 ctx = tracing.StartSpan(ctx, fqdn+"/OpenIDConnectProviderCollectionPage.NextWithContext") 7946 defer func() { 7947 sc := -1 7948 if page.Response().Response.Response != nil { 7949 sc = page.Response().Response.Response.StatusCode 7950 } 7951 tracing.EndSpan(ctx, sc, err) 7952 }() 7953 } 7954 for { 7955 next, err := page.fn(ctx, page.oicpc) 7956 if err != nil { 7957 return err 7958 } 7959 page.oicpc = next 7960 if !next.hasNextLink() || !next.IsEmpty() { 7961 break 7962 } 7963 } 7964 return nil 7965} 7966 7967// Next advances to the next page of values. If there was an error making 7968// the request the page does not advance and the error is returned. 7969// Deprecated: Use NextWithContext() instead. 7970func (page *OpenIDConnectProviderCollectionPage) Next() error { 7971 return page.NextWithContext(context.Background()) 7972} 7973 7974// NotDone returns true if the page enumeration should be started or is not yet complete. 7975func (page OpenIDConnectProviderCollectionPage) NotDone() bool { 7976 return !page.oicpc.IsEmpty() 7977} 7978 7979// Response returns the raw server response from the last page request. 7980func (page OpenIDConnectProviderCollectionPage) Response() OpenIDConnectProviderCollection { 7981 return page.oicpc 7982} 7983 7984// Values returns the slice of values for the current page or nil if there are no values. 7985func (page OpenIDConnectProviderCollectionPage) Values() []OpenidConnectProviderContract { 7986 if page.oicpc.IsEmpty() { 7987 return nil 7988 } 7989 return *page.oicpc.Value 7990} 7991 7992// Creates a new instance of the OpenIDConnectProviderCollectionPage type. 7993func NewOpenIDConnectProviderCollectionPage(cur OpenIDConnectProviderCollection, getNextPage func(context.Context, OpenIDConnectProviderCollection) (OpenIDConnectProviderCollection, error)) OpenIDConnectProviderCollectionPage { 7994 return OpenIDConnectProviderCollectionPage{ 7995 fn: getNextPage, 7996 oicpc: cur, 7997 } 7998} 7999 8000// OpenidConnectProviderContract openId Connect Provider details. 8001type OpenidConnectProviderContract struct { 8002 autorest.Response `json:"-"` 8003 // OpenidConnectProviderContractProperties - OpenId Connect Provider contract properties. 8004 *OpenidConnectProviderContractProperties `json:"properties,omitempty"` 8005 // ID - READ-ONLY; Resource ID. 8006 ID *string `json:"id,omitempty"` 8007 // Name - READ-ONLY; Resource name. 8008 Name *string `json:"name,omitempty"` 8009 // Type - READ-ONLY; Resource type for API Management resource. 8010 Type *string `json:"type,omitempty"` 8011} 8012 8013// MarshalJSON is the custom marshaler for OpenidConnectProviderContract. 8014func (ocpc OpenidConnectProviderContract) MarshalJSON() ([]byte, error) { 8015 objectMap := make(map[string]interface{}) 8016 if ocpc.OpenidConnectProviderContractProperties != nil { 8017 objectMap["properties"] = ocpc.OpenidConnectProviderContractProperties 8018 } 8019 return json.Marshal(objectMap) 8020} 8021 8022// UnmarshalJSON is the custom unmarshaler for OpenidConnectProviderContract struct. 8023func (ocpc *OpenidConnectProviderContract) UnmarshalJSON(body []byte) error { 8024 var m map[string]*json.RawMessage 8025 err := json.Unmarshal(body, &m) 8026 if err != nil { 8027 return err 8028 } 8029 for k, v := range m { 8030 switch k { 8031 case "properties": 8032 if v != nil { 8033 var openidConnectProviderContractProperties OpenidConnectProviderContractProperties 8034 err = json.Unmarshal(*v, &openidConnectProviderContractProperties) 8035 if err != nil { 8036 return err 8037 } 8038 ocpc.OpenidConnectProviderContractProperties = &openidConnectProviderContractProperties 8039 } 8040 case "id": 8041 if v != nil { 8042 var ID string 8043 err = json.Unmarshal(*v, &ID) 8044 if err != nil { 8045 return err 8046 } 8047 ocpc.ID = &ID 8048 } 8049 case "name": 8050 if v != nil { 8051 var name string 8052 err = json.Unmarshal(*v, &name) 8053 if err != nil { 8054 return err 8055 } 8056 ocpc.Name = &name 8057 } 8058 case "type": 8059 if v != nil { 8060 var typeVar string 8061 err = json.Unmarshal(*v, &typeVar) 8062 if err != nil { 8063 return err 8064 } 8065 ocpc.Type = &typeVar 8066 } 8067 } 8068 } 8069 8070 return nil 8071} 8072 8073// OpenidConnectProviderContractProperties openID Connect Providers Contract. 8074type OpenidConnectProviderContractProperties struct { 8075 // DisplayName - User-friendly OpenID Connect Provider name. 8076 DisplayName *string `json:"displayName,omitempty"` 8077 // Description - User-friendly description of OpenID Connect Provider. 8078 Description *string `json:"description,omitempty"` 8079 // MetadataEndpoint - Metadata endpoint URI. 8080 MetadataEndpoint *string `json:"metadataEndpoint,omitempty"` 8081 // ClientID - Client ID of developer console which is the client application. 8082 ClientID *string `json:"clientId,omitempty"` 8083 // ClientSecret - Client Secret of developer console which is the client application. 8084 ClientSecret *string `json:"clientSecret,omitempty"` 8085} 8086 8087// OpenidConnectProviderUpdateContract parameters supplied to the Update OpenID Connect Provider operation. 8088type OpenidConnectProviderUpdateContract struct { 8089 // OpenidConnectProviderUpdateContractProperties - OpenId Connect Provider Update contract properties. 8090 *OpenidConnectProviderUpdateContractProperties `json:"properties,omitempty"` 8091} 8092 8093// MarshalJSON is the custom marshaler for OpenidConnectProviderUpdateContract. 8094func (ocpuc OpenidConnectProviderUpdateContract) MarshalJSON() ([]byte, error) { 8095 objectMap := make(map[string]interface{}) 8096 if ocpuc.OpenidConnectProviderUpdateContractProperties != nil { 8097 objectMap["properties"] = ocpuc.OpenidConnectProviderUpdateContractProperties 8098 } 8099 return json.Marshal(objectMap) 8100} 8101 8102// UnmarshalJSON is the custom unmarshaler for OpenidConnectProviderUpdateContract struct. 8103func (ocpuc *OpenidConnectProviderUpdateContract) UnmarshalJSON(body []byte) error { 8104 var m map[string]*json.RawMessage 8105 err := json.Unmarshal(body, &m) 8106 if err != nil { 8107 return err 8108 } 8109 for k, v := range m { 8110 switch k { 8111 case "properties": 8112 if v != nil { 8113 var openidConnectProviderUpdateContractProperties OpenidConnectProviderUpdateContractProperties 8114 err = json.Unmarshal(*v, &openidConnectProviderUpdateContractProperties) 8115 if err != nil { 8116 return err 8117 } 8118 ocpuc.OpenidConnectProviderUpdateContractProperties = &openidConnectProviderUpdateContractProperties 8119 } 8120 } 8121 } 8122 8123 return nil 8124} 8125 8126// OpenidConnectProviderUpdateContractProperties parameters supplied to the Update OpenID Connect Provider 8127// operation. 8128type OpenidConnectProviderUpdateContractProperties struct { 8129 // DisplayName - User-friendly OpenID Connect Provider name. 8130 DisplayName *string `json:"displayName,omitempty"` 8131 // Description - User-friendly description of OpenID Connect Provider. 8132 Description *string `json:"description,omitempty"` 8133 // MetadataEndpoint - Metadata endpoint URI. 8134 MetadataEndpoint *string `json:"metadataEndpoint,omitempty"` 8135 // ClientID - Client ID of developer console which is the client application. 8136 ClientID *string `json:"clientId,omitempty"` 8137 // ClientSecret - Client Secret of developer console which is the client application. 8138 ClientSecret *string `json:"clientSecret,omitempty"` 8139} 8140 8141// Operation REST API operation 8142type Operation struct { 8143 // Name - Operation name: {provider}/{resource}/{operation} 8144 Name *string `json:"name,omitempty"` 8145 // Display - The object that describes the operation. 8146 Display *OperationDisplay `json:"display,omitempty"` 8147 // Origin - The operation origin. 8148 Origin *string `json:"origin,omitempty"` 8149 // Properties - The operation properties. 8150 Properties interface{} `json:"properties,omitempty"` 8151} 8152 8153// OperationCollection paged Operation list representation. 8154type OperationCollection struct { 8155 autorest.Response `json:"-"` 8156 // Value - READ-ONLY; Page values. 8157 Value *[]OperationContract `json:"value,omitempty"` 8158 // NextLink - READ-ONLY; Next page link if any. 8159 NextLink *string `json:"nextLink,omitempty"` 8160} 8161 8162// MarshalJSON is the custom marshaler for OperationCollection. 8163func (oc OperationCollection) MarshalJSON() ([]byte, error) { 8164 objectMap := make(map[string]interface{}) 8165 return json.Marshal(objectMap) 8166} 8167 8168// OperationCollectionIterator provides access to a complete listing of OperationContract values. 8169type OperationCollectionIterator struct { 8170 i int 8171 page OperationCollectionPage 8172} 8173 8174// NextWithContext advances to the next value. If there was an error making 8175// the request the iterator does not advance and the error is returned. 8176func (iter *OperationCollectionIterator) NextWithContext(ctx context.Context) (err error) { 8177 if tracing.IsEnabled() { 8178 ctx = tracing.StartSpan(ctx, fqdn+"/OperationCollectionIterator.NextWithContext") 8179 defer func() { 8180 sc := -1 8181 if iter.Response().Response.Response != nil { 8182 sc = iter.Response().Response.Response.StatusCode 8183 } 8184 tracing.EndSpan(ctx, sc, err) 8185 }() 8186 } 8187 iter.i++ 8188 if iter.i < len(iter.page.Values()) { 8189 return nil 8190 } 8191 err = iter.page.NextWithContext(ctx) 8192 if err != nil { 8193 iter.i-- 8194 return err 8195 } 8196 iter.i = 0 8197 return nil 8198} 8199 8200// Next advances to the next value. If there was an error making 8201// the request the iterator does not advance and the error is returned. 8202// Deprecated: Use NextWithContext() instead. 8203func (iter *OperationCollectionIterator) Next() error { 8204 return iter.NextWithContext(context.Background()) 8205} 8206 8207// NotDone returns true if the enumeration should be started or is not yet complete. 8208func (iter OperationCollectionIterator) NotDone() bool { 8209 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 8210} 8211 8212// Response returns the raw server response from the last page request. 8213func (iter OperationCollectionIterator) Response() OperationCollection { 8214 return iter.page.Response() 8215} 8216 8217// Value returns the current value or a zero-initialized value if the 8218// iterator has advanced beyond the end of the collection. 8219func (iter OperationCollectionIterator) Value() OperationContract { 8220 if !iter.page.NotDone() { 8221 return OperationContract{} 8222 } 8223 return iter.page.Values()[iter.i] 8224} 8225 8226// Creates a new instance of the OperationCollectionIterator type. 8227func NewOperationCollectionIterator(page OperationCollectionPage) OperationCollectionIterator { 8228 return OperationCollectionIterator{page: page} 8229} 8230 8231// IsEmpty returns true if the ListResult contains no values. 8232func (oc OperationCollection) IsEmpty() bool { 8233 return oc.Value == nil || len(*oc.Value) == 0 8234} 8235 8236// hasNextLink returns true if the NextLink is not empty. 8237func (oc OperationCollection) hasNextLink() bool { 8238 return oc.NextLink != nil && len(*oc.NextLink) != 0 8239} 8240 8241// operationCollectionPreparer prepares a request to retrieve the next set of results. 8242// It returns nil if no more results exist. 8243func (oc OperationCollection) operationCollectionPreparer(ctx context.Context) (*http.Request, error) { 8244 if !oc.hasNextLink() { 8245 return nil, nil 8246 } 8247 return autorest.Prepare((&http.Request{}).WithContext(ctx), 8248 autorest.AsJSON(), 8249 autorest.AsGet(), 8250 autorest.WithBaseURL(to.String(oc.NextLink))) 8251} 8252 8253// OperationCollectionPage contains a page of OperationContract values. 8254type OperationCollectionPage struct { 8255 fn func(context.Context, OperationCollection) (OperationCollection, error) 8256 oc OperationCollection 8257} 8258 8259// NextWithContext advances to the next page of values. If there was an error making 8260// the request the page does not advance and the error is returned. 8261func (page *OperationCollectionPage) NextWithContext(ctx context.Context) (err error) { 8262 if tracing.IsEnabled() { 8263 ctx = tracing.StartSpan(ctx, fqdn+"/OperationCollectionPage.NextWithContext") 8264 defer func() { 8265 sc := -1 8266 if page.Response().Response.Response != nil { 8267 sc = page.Response().Response.Response.StatusCode 8268 } 8269 tracing.EndSpan(ctx, sc, err) 8270 }() 8271 } 8272 for { 8273 next, err := page.fn(ctx, page.oc) 8274 if err != nil { 8275 return err 8276 } 8277 page.oc = next 8278 if !next.hasNextLink() || !next.IsEmpty() { 8279 break 8280 } 8281 } 8282 return nil 8283} 8284 8285// Next advances to the next page of values. If there was an error making 8286// the request the page does not advance and the error is returned. 8287// Deprecated: Use NextWithContext() instead. 8288func (page *OperationCollectionPage) Next() error { 8289 return page.NextWithContext(context.Background()) 8290} 8291 8292// NotDone returns true if the page enumeration should be started or is not yet complete. 8293func (page OperationCollectionPage) NotDone() bool { 8294 return !page.oc.IsEmpty() 8295} 8296 8297// Response returns the raw server response from the last page request. 8298func (page OperationCollectionPage) Response() OperationCollection { 8299 return page.oc 8300} 8301 8302// Values returns the slice of values for the current page or nil if there are no values. 8303func (page OperationCollectionPage) Values() []OperationContract { 8304 if page.oc.IsEmpty() { 8305 return nil 8306 } 8307 return *page.oc.Value 8308} 8309 8310// Creates a new instance of the OperationCollectionPage type. 8311func NewOperationCollectionPage(cur OperationCollection, getNextPage func(context.Context, OperationCollection) (OperationCollection, error)) OperationCollectionPage { 8312 return OperationCollectionPage{ 8313 fn: getNextPage, 8314 oc: cur, 8315 } 8316} 8317 8318// OperationContract api Operation details. 8319type OperationContract struct { 8320 autorest.Response `json:"-"` 8321 // OperationContractProperties - Properties of the Operation Contract. 8322 *OperationContractProperties `json:"properties,omitempty"` 8323 // ID - READ-ONLY; Resource ID. 8324 ID *string `json:"id,omitempty"` 8325 // Name - READ-ONLY; Resource name. 8326 Name *string `json:"name,omitempty"` 8327 // Type - READ-ONLY; Resource type for API Management resource. 8328 Type *string `json:"type,omitempty"` 8329} 8330 8331// MarshalJSON is the custom marshaler for OperationContract. 8332func (oc OperationContract) MarshalJSON() ([]byte, error) { 8333 objectMap := make(map[string]interface{}) 8334 if oc.OperationContractProperties != nil { 8335 objectMap["properties"] = oc.OperationContractProperties 8336 } 8337 return json.Marshal(objectMap) 8338} 8339 8340// UnmarshalJSON is the custom unmarshaler for OperationContract struct. 8341func (oc *OperationContract) UnmarshalJSON(body []byte) error { 8342 var m map[string]*json.RawMessage 8343 err := json.Unmarshal(body, &m) 8344 if err != nil { 8345 return err 8346 } 8347 for k, v := range m { 8348 switch k { 8349 case "properties": 8350 if v != nil { 8351 var operationContractProperties OperationContractProperties 8352 err = json.Unmarshal(*v, &operationContractProperties) 8353 if err != nil { 8354 return err 8355 } 8356 oc.OperationContractProperties = &operationContractProperties 8357 } 8358 case "id": 8359 if v != nil { 8360 var ID string 8361 err = json.Unmarshal(*v, &ID) 8362 if err != nil { 8363 return err 8364 } 8365 oc.ID = &ID 8366 } 8367 case "name": 8368 if v != nil { 8369 var name string 8370 err = json.Unmarshal(*v, &name) 8371 if err != nil { 8372 return err 8373 } 8374 oc.Name = &name 8375 } 8376 case "type": 8377 if v != nil { 8378 var typeVar string 8379 err = json.Unmarshal(*v, &typeVar) 8380 if err != nil { 8381 return err 8382 } 8383 oc.Type = &typeVar 8384 } 8385 } 8386 } 8387 8388 return nil 8389} 8390 8391// OperationContractProperties operation Contract Properties 8392type OperationContractProperties struct { 8393 // DisplayName - Operation Name. 8394 DisplayName *string `json:"displayName,omitempty"` 8395 // Method - A Valid HTTP Operation Method. Typical Http Methods like GET, PUT, POST but not limited by only them. 8396 Method *string `json:"method,omitempty"` 8397 // URLTemplate - Relative URL template identifying the target resource for this operation. May include parameters. Example: /customers/{cid}/orders/{oid}/?date={date} 8398 URLTemplate *string `json:"urlTemplate,omitempty"` 8399 // TemplateParameters - Collection of URL template parameters. 8400 TemplateParameters *[]ParameterContract `json:"templateParameters,omitempty"` 8401 // Description - Description of the operation. May include HTML formatting tags. 8402 Description *string `json:"description,omitempty"` 8403 // Request - An entity containing request details. 8404 Request *RequestContract `json:"request,omitempty"` 8405 // Responses - Array of Operation responses. 8406 Responses *[]ResponseContract `json:"responses,omitempty"` 8407 // Policies - Operation Policies 8408 Policies *string `json:"policies,omitempty"` 8409} 8410 8411// OperationDisplay the object that describes the operation. 8412type OperationDisplay struct { 8413 // Provider - Friendly name of the resource provider 8414 Provider *string `json:"provider,omitempty"` 8415 // Operation - Operation type: read, write, delete, listKeys/action, etc. 8416 Operation *string `json:"operation,omitempty"` 8417 // Resource - Resource type on which the operation is performed. 8418 Resource *string `json:"resource,omitempty"` 8419 // Description - Friendly name of the operation 8420 Description *string `json:"description,omitempty"` 8421} 8422 8423// OperationEntityBaseContract api Operation Entity Base Contract details. 8424type OperationEntityBaseContract struct { 8425 // TemplateParameters - Collection of URL template parameters. 8426 TemplateParameters *[]ParameterContract `json:"templateParameters,omitempty"` 8427 // Description - Description of the operation. May include HTML formatting tags. 8428 Description *string `json:"description,omitempty"` 8429 // Request - An entity containing request details. 8430 Request *RequestContract `json:"request,omitempty"` 8431 // Responses - Array of Operation responses. 8432 Responses *[]ResponseContract `json:"responses,omitempty"` 8433 // Policies - Operation Policies 8434 Policies *string `json:"policies,omitempty"` 8435} 8436 8437// OperationListResult result of the request to list REST API operations. It contains a list of operations 8438// and a URL nextLink to get the next set of results. 8439type OperationListResult struct { 8440 autorest.Response `json:"-"` 8441 // Value - List of operations supported by the resource provider. 8442 Value *[]Operation `json:"value,omitempty"` 8443 // NextLink - URL to get the next set of operation list results if there are any. 8444 NextLink *string `json:"nextLink,omitempty"` 8445} 8446 8447// OperationListResultIterator provides access to a complete listing of Operation values. 8448type OperationListResultIterator struct { 8449 i int 8450 page OperationListResultPage 8451} 8452 8453// NextWithContext advances to the next value. If there was an error making 8454// the request the iterator does not advance and the error is returned. 8455func (iter *OperationListResultIterator) NextWithContext(ctx context.Context) (err error) { 8456 if tracing.IsEnabled() { 8457 ctx = tracing.StartSpan(ctx, fqdn+"/OperationListResultIterator.NextWithContext") 8458 defer func() { 8459 sc := -1 8460 if iter.Response().Response.Response != nil { 8461 sc = iter.Response().Response.Response.StatusCode 8462 } 8463 tracing.EndSpan(ctx, sc, err) 8464 }() 8465 } 8466 iter.i++ 8467 if iter.i < len(iter.page.Values()) { 8468 return nil 8469 } 8470 err = iter.page.NextWithContext(ctx) 8471 if err != nil { 8472 iter.i-- 8473 return err 8474 } 8475 iter.i = 0 8476 return nil 8477} 8478 8479// Next advances to the next value. If there was an error making 8480// the request the iterator does not advance and the error is returned. 8481// Deprecated: Use NextWithContext() instead. 8482func (iter *OperationListResultIterator) Next() error { 8483 return iter.NextWithContext(context.Background()) 8484} 8485 8486// NotDone returns true if the enumeration should be started or is not yet complete. 8487func (iter OperationListResultIterator) NotDone() bool { 8488 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 8489} 8490 8491// Response returns the raw server response from the last page request. 8492func (iter OperationListResultIterator) Response() OperationListResult { 8493 return iter.page.Response() 8494} 8495 8496// Value returns the current value or a zero-initialized value if the 8497// iterator has advanced beyond the end of the collection. 8498func (iter OperationListResultIterator) Value() Operation { 8499 if !iter.page.NotDone() { 8500 return Operation{} 8501 } 8502 return iter.page.Values()[iter.i] 8503} 8504 8505// Creates a new instance of the OperationListResultIterator type. 8506func NewOperationListResultIterator(page OperationListResultPage) OperationListResultIterator { 8507 return OperationListResultIterator{page: page} 8508} 8509 8510// IsEmpty returns true if the ListResult contains no values. 8511func (olr OperationListResult) IsEmpty() bool { 8512 return olr.Value == nil || len(*olr.Value) == 0 8513} 8514 8515// hasNextLink returns true if the NextLink is not empty. 8516func (olr OperationListResult) hasNextLink() bool { 8517 return olr.NextLink != nil && len(*olr.NextLink) != 0 8518} 8519 8520// operationListResultPreparer prepares a request to retrieve the next set of results. 8521// It returns nil if no more results exist. 8522func (olr OperationListResult) operationListResultPreparer(ctx context.Context) (*http.Request, error) { 8523 if !olr.hasNextLink() { 8524 return nil, nil 8525 } 8526 return autorest.Prepare((&http.Request{}).WithContext(ctx), 8527 autorest.AsJSON(), 8528 autorest.AsGet(), 8529 autorest.WithBaseURL(to.String(olr.NextLink))) 8530} 8531 8532// OperationListResultPage contains a page of Operation values. 8533type OperationListResultPage struct { 8534 fn func(context.Context, OperationListResult) (OperationListResult, error) 8535 olr OperationListResult 8536} 8537 8538// NextWithContext advances to the next page of values. If there was an error making 8539// the request the page does not advance and the error is returned. 8540func (page *OperationListResultPage) NextWithContext(ctx context.Context) (err error) { 8541 if tracing.IsEnabled() { 8542 ctx = tracing.StartSpan(ctx, fqdn+"/OperationListResultPage.NextWithContext") 8543 defer func() { 8544 sc := -1 8545 if page.Response().Response.Response != nil { 8546 sc = page.Response().Response.Response.StatusCode 8547 } 8548 tracing.EndSpan(ctx, sc, err) 8549 }() 8550 } 8551 for { 8552 next, err := page.fn(ctx, page.olr) 8553 if err != nil { 8554 return err 8555 } 8556 page.olr = next 8557 if !next.hasNextLink() || !next.IsEmpty() { 8558 break 8559 } 8560 } 8561 return nil 8562} 8563 8564// Next advances to the next page of values. If there was an error making 8565// the request the page does not advance and the error is returned. 8566// Deprecated: Use NextWithContext() instead. 8567func (page *OperationListResultPage) Next() error { 8568 return page.NextWithContext(context.Background()) 8569} 8570 8571// NotDone returns true if the page enumeration should be started or is not yet complete. 8572func (page OperationListResultPage) NotDone() bool { 8573 return !page.olr.IsEmpty() 8574} 8575 8576// Response returns the raw server response from the last page request. 8577func (page OperationListResultPage) Response() OperationListResult { 8578 return page.olr 8579} 8580 8581// Values returns the slice of values for the current page or nil if there are no values. 8582func (page OperationListResultPage) Values() []Operation { 8583 if page.olr.IsEmpty() { 8584 return nil 8585 } 8586 return *page.olr.Value 8587} 8588 8589// Creates a new instance of the OperationListResultPage type. 8590func NewOperationListResultPage(cur OperationListResult, getNextPage func(context.Context, OperationListResult) (OperationListResult, error)) OperationListResultPage { 8591 return OperationListResultPage{ 8592 fn: getNextPage, 8593 olr: cur, 8594 } 8595} 8596 8597// OperationResultContract operation Result. 8598type OperationResultContract struct { 8599 autorest.Response `json:"-"` 8600 // ID - Operation result identifier. 8601 ID *string `json:"id,omitempty"` 8602 // Status - Status of an async operation. Possible values include: 'Started', 'InProgress', 'Succeeded', 'Failed' 8603 Status AsyncOperationStatus `json:"status,omitempty"` 8604 // 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. 8605 Started *date.Time `json:"started,omitempty"` 8606 // 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. 8607 Updated *date.Time `json:"updated,omitempty"` 8608 // ResultInfo - Optional result info. 8609 ResultInfo *string `json:"resultInfo,omitempty"` 8610 // Error - Error Body Contract 8611 Error *ErrorResponseBody `json:"error,omitempty"` 8612 // 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. 8613 ActionLog *[]OperationResultLogItemContract `json:"actionLog,omitempty"` 8614} 8615 8616// MarshalJSON is the custom marshaler for OperationResultContract. 8617func (orc OperationResultContract) MarshalJSON() ([]byte, error) { 8618 objectMap := make(map[string]interface{}) 8619 if orc.ID != nil { 8620 objectMap["id"] = orc.ID 8621 } 8622 if orc.Status != "" { 8623 objectMap["status"] = orc.Status 8624 } 8625 if orc.Started != nil { 8626 objectMap["started"] = orc.Started 8627 } 8628 if orc.Updated != nil { 8629 objectMap["updated"] = orc.Updated 8630 } 8631 if orc.ResultInfo != nil { 8632 objectMap["resultInfo"] = orc.ResultInfo 8633 } 8634 if orc.Error != nil { 8635 objectMap["error"] = orc.Error 8636 } 8637 return json.Marshal(objectMap) 8638} 8639 8640// OperationResultLogItemContract log of the entity being created, updated or deleted. 8641type OperationResultLogItemContract struct { 8642 // ObjectType - The type of entity contract. 8643 ObjectType *string `json:"objectType,omitempty"` 8644 // Action - Action like create/update/delete. 8645 Action *string `json:"action,omitempty"` 8646 // ObjectKey - Identifier of the entity being created/updated/deleted. 8647 ObjectKey *string `json:"objectKey,omitempty"` 8648} 8649 8650// OperationTagResourceContractProperties operation Entity contract Properties. 8651type OperationTagResourceContractProperties struct { 8652 // ID - Identifier of the operation in form /operations/{operationId}. 8653 ID *string `json:"id,omitempty"` 8654 // Name - READ-ONLY; Operation name. 8655 Name *string `json:"name,omitempty"` 8656 // APIName - READ-ONLY; Api Name. 8657 APIName *string `json:"apiName,omitempty"` 8658 // APIRevision - READ-ONLY; Api Revision. 8659 APIRevision *string `json:"apiRevision,omitempty"` 8660 // APIVersion - READ-ONLY; Api Version. 8661 APIVersion *string `json:"apiVersion,omitempty"` 8662 // Description - READ-ONLY; Operation Description. 8663 Description *string `json:"description,omitempty"` 8664 // Method - READ-ONLY; A Valid HTTP Operation Method. Typical Http Methods like GET, PUT, POST but not limited by only them. 8665 Method *string `json:"method,omitempty"` 8666 // URLTemplate - READ-ONLY; Relative URL template identifying the target resource for this operation. May include parameters. Example: /customers/{cid}/orders/{oid}/?date={date} 8667 URLTemplate *string `json:"urlTemplate,omitempty"` 8668} 8669 8670// MarshalJSON is the custom marshaler for OperationTagResourceContractProperties. 8671func (otrcp OperationTagResourceContractProperties) MarshalJSON() ([]byte, error) { 8672 objectMap := make(map[string]interface{}) 8673 if otrcp.ID != nil { 8674 objectMap["id"] = otrcp.ID 8675 } 8676 return json.Marshal(objectMap) 8677} 8678 8679// OperationUpdateContract api Operation Update Contract details. 8680type OperationUpdateContract struct { 8681 // OperationUpdateContractProperties - Properties of the API Operation entity that can be updated. 8682 *OperationUpdateContractProperties `json:"properties,omitempty"` 8683} 8684 8685// MarshalJSON is the custom marshaler for OperationUpdateContract. 8686func (ouc OperationUpdateContract) MarshalJSON() ([]byte, error) { 8687 objectMap := make(map[string]interface{}) 8688 if ouc.OperationUpdateContractProperties != nil { 8689 objectMap["properties"] = ouc.OperationUpdateContractProperties 8690 } 8691 return json.Marshal(objectMap) 8692} 8693 8694// UnmarshalJSON is the custom unmarshaler for OperationUpdateContract struct. 8695func (ouc *OperationUpdateContract) UnmarshalJSON(body []byte) error { 8696 var m map[string]*json.RawMessage 8697 err := json.Unmarshal(body, &m) 8698 if err != nil { 8699 return err 8700 } 8701 for k, v := range m { 8702 switch k { 8703 case "properties": 8704 if v != nil { 8705 var operationUpdateContractProperties OperationUpdateContractProperties 8706 err = json.Unmarshal(*v, &operationUpdateContractProperties) 8707 if err != nil { 8708 return err 8709 } 8710 ouc.OperationUpdateContractProperties = &operationUpdateContractProperties 8711 } 8712 } 8713 } 8714 8715 return nil 8716} 8717 8718// OperationUpdateContractProperties operation Update Contract Properties. 8719type OperationUpdateContractProperties struct { 8720 // DisplayName - Operation Name. 8721 DisplayName *string `json:"displayName,omitempty"` 8722 // Method - A Valid HTTP Operation Method. Typical Http Methods like GET, PUT, POST but not limited by only them. 8723 Method *string `json:"method,omitempty"` 8724 // URLTemplate - Relative URL template identifying the target resource for this operation. May include parameters. Example: /customers/{cid}/orders/{oid}/?date={date} 8725 URLTemplate *string `json:"urlTemplate,omitempty"` 8726 // TemplateParameters - Collection of URL template parameters. 8727 TemplateParameters *[]ParameterContract `json:"templateParameters,omitempty"` 8728 // Description - Description of the operation. May include HTML formatting tags. 8729 Description *string `json:"description,omitempty"` 8730 // Request - An entity containing request details. 8731 Request *RequestContract `json:"request,omitempty"` 8732 // Responses - Array of Operation responses. 8733 Responses *[]ResponseContract `json:"responses,omitempty"` 8734 // Policies - Operation Policies 8735 Policies *string `json:"policies,omitempty"` 8736} 8737 8738// ParameterContract operation parameters details. 8739type ParameterContract struct { 8740 // Name - Parameter name. 8741 Name *string `json:"name,omitempty"` 8742 // Description - Parameter description. 8743 Description *string `json:"description,omitempty"` 8744 // Type - Parameter type. 8745 Type *string `json:"type,omitempty"` 8746 // DefaultValue - Default parameter value. 8747 DefaultValue *string `json:"defaultValue,omitempty"` 8748 // Required - Specifies whether parameter is required or not. 8749 Required *bool `json:"required,omitempty"` 8750 // Values - Parameter values. 8751 Values *[]string `json:"values,omitempty"` 8752} 8753 8754// PipelineDiagnosticSettings diagnostic settings for incoming/outgoing HTTP messages to the Gateway. 8755type PipelineDiagnosticSettings struct { 8756 // Request - Diagnostic settings for request. 8757 Request *HTTPMessageDiagnostic `json:"request,omitempty"` 8758 // Response - Diagnostic settings for response. 8759 Response *HTTPMessageDiagnostic `json:"response,omitempty"` 8760} 8761 8762// PolicyCollection the response of the list policy operation. 8763type PolicyCollection struct { 8764 autorest.Response `json:"-"` 8765 // Value - Policy Contract value. 8766 Value *[]PolicyContract `json:"value,omitempty"` 8767 // NextLink - Next page link if any. 8768 NextLink *string `json:"nextLink,omitempty"` 8769} 8770 8771// PolicyContract policy Contract details. 8772type PolicyContract struct { 8773 autorest.Response `json:"-"` 8774 // PolicyContractProperties - Properties of the Policy. 8775 *PolicyContractProperties `json:"properties,omitempty"` 8776 // ID - READ-ONLY; Resource ID. 8777 ID *string `json:"id,omitempty"` 8778 // Name - READ-ONLY; Resource name. 8779 Name *string `json:"name,omitempty"` 8780 // Type - READ-ONLY; Resource type for API Management resource. 8781 Type *string `json:"type,omitempty"` 8782} 8783 8784// MarshalJSON is the custom marshaler for PolicyContract. 8785func (pc PolicyContract) MarshalJSON() ([]byte, error) { 8786 objectMap := make(map[string]interface{}) 8787 if pc.PolicyContractProperties != nil { 8788 objectMap["properties"] = pc.PolicyContractProperties 8789 } 8790 return json.Marshal(objectMap) 8791} 8792 8793// UnmarshalJSON is the custom unmarshaler for PolicyContract struct. 8794func (pc *PolicyContract) UnmarshalJSON(body []byte) error { 8795 var m map[string]*json.RawMessage 8796 err := json.Unmarshal(body, &m) 8797 if err != nil { 8798 return err 8799 } 8800 for k, v := range m { 8801 switch k { 8802 case "properties": 8803 if v != nil { 8804 var policyContractProperties PolicyContractProperties 8805 err = json.Unmarshal(*v, &policyContractProperties) 8806 if err != nil { 8807 return err 8808 } 8809 pc.PolicyContractProperties = &policyContractProperties 8810 } 8811 case "id": 8812 if v != nil { 8813 var ID string 8814 err = json.Unmarshal(*v, &ID) 8815 if err != nil { 8816 return err 8817 } 8818 pc.ID = &ID 8819 } 8820 case "name": 8821 if v != nil { 8822 var name string 8823 err = json.Unmarshal(*v, &name) 8824 if err != nil { 8825 return err 8826 } 8827 pc.Name = &name 8828 } 8829 case "type": 8830 if v != nil { 8831 var typeVar string 8832 err = json.Unmarshal(*v, &typeVar) 8833 if err != nil { 8834 return err 8835 } 8836 pc.Type = &typeVar 8837 } 8838 } 8839 } 8840 8841 return nil 8842} 8843 8844// PolicyContractProperties policy contract Properties. 8845type PolicyContractProperties struct { 8846 // Value - Contents of the Policy as defined by the format. 8847 Value *string `json:"value,omitempty"` 8848 // Format - Format of the policyContent. Possible values include: 'XML', 'XMLLink', 'Rawxml', 'RawxmlLink' 8849 Format PolicyContentFormat `json:"format,omitempty"` 8850} 8851 8852// PolicyDescriptionCollection descriptions of APIM policies. 8853type PolicyDescriptionCollection struct { 8854 autorest.Response `json:"-"` 8855 // Value - Descriptions of APIM policies. 8856 Value *[]PolicyDescriptionContract `json:"value,omitempty"` 8857 // Count - Total record count number. 8858 Count *int64 `json:"count,omitempty"` 8859} 8860 8861// PolicyDescriptionContract policy description details. 8862type PolicyDescriptionContract struct { 8863 // PolicyDescriptionContractProperties - Policy description contract properties. 8864 *PolicyDescriptionContractProperties `json:"properties,omitempty"` 8865 // ID - READ-ONLY; Resource ID. 8866 ID *string `json:"id,omitempty"` 8867 // Name - READ-ONLY; Resource name. 8868 Name *string `json:"name,omitempty"` 8869 // Type - READ-ONLY; Resource type for API Management resource. 8870 Type *string `json:"type,omitempty"` 8871} 8872 8873// MarshalJSON is the custom marshaler for PolicyDescriptionContract. 8874func (pdc PolicyDescriptionContract) MarshalJSON() ([]byte, error) { 8875 objectMap := make(map[string]interface{}) 8876 if pdc.PolicyDescriptionContractProperties != nil { 8877 objectMap["properties"] = pdc.PolicyDescriptionContractProperties 8878 } 8879 return json.Marshal(objectMap) 8880} 8881 8882// UnmarshalJSON is the custom unmarshaler for PolicyDescriptionContract struct. 8883func (pdc *PolicyDescriptionContract) UnmarshalJSON(body []byte) error { 8884 var m map[string]*json.RawMessage 8885 err := json.Unmarshal(body, &m) 8886 if err != nil { 8887 return err 8888 } 8889 for k, v := range m { 8890 switch k { 8891 case "properties": 8892 if v != nil { 8893 var policyDescriptionContractProperties PolicyDescriptionContractProperties 8894 err = json.Unmarshal(*v, &policyDescriptionContractProperties) 8895 if err != nil { 8896 return err 8897 } 8898 pdc.PolicyDescriptionContractProperties = &policyDescriptionContractProperties 8899 } 8900 case "id": 8901 if v != nil { 8902 var ID string 8903 err = json.Unmarshal(*v, &ID) 8904 if err != nil { 8905 return err 8906 } 8907 pdc.ID = &ID 8908 } 8909 case "name": 8910 if v != nil { 8911 var name string 8912 err = json.Unmarshal(*v, &name) 8913 if err != nil { 8914 return err 8915 } 8916 pdc.Name = &name 8917 } 8918 case "type": 8919 if v != nil { 8920 var typeVar string 8921 err = json.Unmarshal(*v, &typeVar) 8922 if err != nil { 8923 return err 8924 } 8925 pdc.Type = &typeVar 8926 } 8927 } 8928 } 8929 8930 return nil 8931} 8932 8933// PolicyDescriptionContractProperties policy description properties. 8934type PolicyDescriptionContractProperties struct { 8935 // Description - READ-ONLY; Policy description. 8936 Description *string `json:"description,omitempty"` 8937 // Scope - READ-ONLY; Binary OR value of the Snippet scope. 8938 Scope *int32 `json:"scope,omitempty"` 8939} 8940 8941// MarshalJSON is the custom marshaler for PolicyDescriptionContractProperties. 8942func (pdcp PolicyDescriptionContractProperties) MarshalJSON() ([]byte, error) { 8943 objectMap := make(map[string]interface{}) 8944 return json.Marshal(objectMap) 8945} 8946 8947// PortalDelegationSettings delegation settings for a developer portal. 8948type PortalDelegationSettings struct { 8949 autorest.Response `json:"-"` 8950 // PortalDelegationSettingsProperties - Delegation settings contract properties. 8951 *PortalDelegationSettingsProperties `json:"properties,omitempty"` 8952 // ID - READ-ONLY; Resource ID. 8953 ID *string `json:"id,omitempty"` 8954 // Name - READ-ONLY; Resource name. 8955 Name *string `json:"name,omitempty"` 8956 // Type - READ-ONLY; Resource type for API Management resource. 8957 Type *string `json:"type,omitempty"` 8958} 8959 8960// MarshalJSON is the custom marshaler for PortalDelegationSettings. 8961func (pds PortalDelegationSettings) MarshalJSON() ([]byte, error) { 8962 objectMap := make(map[string]interface{}) 8963 if pds.PortalDelegationSettingsProperties != nil { 8964 objectMap["properties"] = pds.PortalDelegationSettingsProperties 8965 } 8966 return json.Marshal(objectMap) 8967} 8968 8969// UnmarshalJSON is the custom unmarshaler for PortalDelegationSettings struct. 8970func (pds *PortalDelegationSettings) UnmarshalJSON(body []byte) error { 8971 var m map[string]*json.RawMessage 8972 err := json.Unmarshal(body, &m) 8973 if err != nil { 8974 return err 8975 } 8976 for k, v := range m { 8977 switch k { 8978 case "properties": 8979 if v != nil { 8980 var portalDelegationSettingsProperties PortalDelegationSettingsProperties 8981 err = json.Unmarshal(*v, &portalDelegationSettingsProperties) 8982 if err != nil { 8983 return err 8984 } 8985 pds.PortalDelegationSettingsProperties = &portalDelegationSettingsProperties 8986 } 8987 case "id": 8988 if v != nil { 8989 var ID string 8990 err = json.Unmarshal(*v, &ID) 8991 if err != nil { 8992 return err 8993 } 8994 pds.ID = &ID 8995 } 8996 case "name": 8997 if v != nil { 8998 var name string 8999 err = json.Unmarshal(*v, &name) 9000 if err != nil { 9001 return err 9002 } 9003 pds.Name = &name 9004 } 9005 case "type": 9006 if v != nil { 9007 var typeVar string 9008 err = json.Unmarshal(*v, &typeVar) 9009 if err != nil { 9010 return err 9011 } 9012 pds.Type = &typeVar 9013 } 9014 } 9015 } 9016 9017 return nil 9018} 9019 9020// PortalDelegationSettingsProperties delegation settings contract properties. 9021type PortalDelegationSettingsProperties struct { 9022 // URL - A delegation Url. 9023 URL *string `json:"url,omitempty"` 9024 // ValidationKey - A base64-encoded validation key to validate, that a request is coming from Azure API Management. 9025 ValidationKey *string `json:"validationKey,omitempty"` 9026 // Subscriptions - Subscriptions delegation settings. 9027 Subscriptions *SubscriptionsDelegationSettingsProperties `json:"subscriptions,omitempty"` 9028 // UserRegistration - User registration delegation settings. 9029 UserRegistration *RegistrationDelegationSettingsProperties `json:"userRegistration,omitempty"` 9030} 9031 9032// PortalSettingValidationKeyContract client or app secret used in IdentityProviders, Aad, OpenID or OAuth. 9033type PortalSettingValidationKeyContract struct { 9034 autorest.Response `json:"-"` 9035 // ValidationKey - This is secret value of the validation key in portal settings. 9036 ValidationKey *string `json:"validationKey,omitempty"` 9037} 9038 9039// PortalSigninSettingProperties sign-in settings contract properties. 9040type PortalSigninSettingProperties struct { 9041 // Enabled - Redirect Anonymous users to the Sign-In page. 9042 Enabled *bool `json:"enabled,omitempty"` 9043} 9044 9045// PortalSigninSettings sign-In settings for the Developer Portal. 9046type PortalSigninSettings struct { 9047 autorest.Response `json:"-"` 9048 // PortalSigninSettingProperties - Sign-in settings contract properties. 9049 *PortalSigninSettingProperties `json:"properties,omitempty"` 9050 // ID - READ-ONLY; Resource ID. 9051 ID *string `json:"id,omitempty"` 9052 // Name - READ-ONLY; Resource name. 9053 Name *string `json:"name,omitempty"` 9054 // Type - READ-ONLY; Resource type for API Management resource. 9055 Type *string `json:"type,omitempty"` 9056} 9057 9058// MarshalJSON is the custom marshaler for PortalSigninSettings. 9059func (pss PortalSigninSettings) MarshalJSON() ([]byte, error) { 9060 objectMap := make(map[string]interface{}) 9061 if pss.PortalSigninSettingProperties != nil { 9062 objectMap["properties"] = pss.PortalSigninSettingProperties 9063 } 9064 return json.Marshal(objectMap) 9065} 9066 9067// UnmarshalJSON is the custom unmarshaler for PortalSigninSettings struct. 9068func (pss *PortalSigninSettings) UnmarshalJSON(body []byte) error { 9069 var m map[string]*json.RawMessage 9070 err := json.Unmarshal(body, &m) 9071 if err != nil { 9072 return err 9073 } 9074 for k, v := range m { 9075 switch k { 9076 case "properties": 9077 if v != nil { 9078 var portalSigninSettingProperties PortalSigninSettingProperties 9079 err = json.Unmarshal(*v, &portalSigninSettingProperties) 9080 if err != nil { 9081 return err 9082 } 9083 pss.PortalSigninSettingProperties = &portalSigninSettingProperties 9084 } 9085 case "id": 9086 if v != nil { 9087 var ID string 9088 err = json.Unmarshal(*v, &ID) 9089 if err != nil { 9090 return err 9091 } 9092 pss.ID = &ID 9093 } 9094 case "name": 9095 if v != nil { 9096 var name string 9097 err = json.Unmarshal(*v, &name) 9098 if err != nil { 9099 return err 9100 } 9101 pss.Name = &name 9102 } 9103 case "type": 9104 if v != nil { 9105 var typeVar string 9106 err = json.Unmarshal(*v, &typeVar) 9107 if err != nil { 9108 return err 9109 } 9110 pss.Type = &typeVar 9111 } 9112 } 9113 } 9114 9115 return nil 9116} 9117 9118// PortalSignupSettings sign-Up settings for a developer portal. 9119type PortalSignupSettings struct { 9120 autorest.Response `json:"-"` 9121 // PortalSignupSettingsProperties - Sign-up settings contract properties. 9122 *PortalSignupSettingsProperties `json:"properties,omitempty"` 9123 // ID - READ-ONLY; Resource ID. 9124 ID *string `json:"id,omitempty"` 9125 // Name - READ-ONLY; Resource name. 9126 Name *string `json:"name,omitempty"` 9127 // Type - READ-ONLY; Resource type for API Management resource. 9128 Type *string `json:"type,omitempty"` 9129} 9130 9131// MarshalJSON is the custom marshaler for PortalSignupSettings. 9132func (pss PortalSignupSettings) MarshalJSON() ([]byte, error) { 9133 objectMap := make(map[string]interface{}) 9134 if pss.PortalSignupSettingsProperties != nil { 9135 objectMap["properties"] = pss.PortalSignupSettingsProperties 9136 } 9137 return json.Marshal(objectMap) 9138} 9139 9140// UnmarshalJSON is the custom unmarshaler for PortalSignupSettings struct. 9141func (pss *PortalSignupSettings) UnmarshalJSON(body []byte) error { 9142 var m map[string]*json.RawMessage 9143 err := json.Unmarshal(body, &m) 9144 if err != nil { 9145 return err 9146 } 9147 for k, v := range m { 9148 switch k { 9149 case "properties": 9150 if v != nil { 9151 var portalSignupSettingsProperties PortalSignupSettingsProperties 9152 err = json.Unmarshal(*v, &portalSignupSettingsProperties) 9153 if err != nil { 9154 return err 9155 } 9156 pss.PortalSignupSettingsProperties = &portalSignupSettingsProperties 9157 } 9158 case "id": 9159 if v != nil { 9160 var ID string 9161 err = json.Unmarshal(*v, &ID) 9162 if err != nil { 9163 return err 9164 } 9165 pss.ID = &ID 9166 } 9167 case "name": 9168 if v != nil { 9169 var name string 9170 err = json.Unmarshal(*v, &name) 9171 if err != nil { 9172 return err 9173 } 9174 pss.Name = &name 9175 } 9176 case "type": 9177 if v != nil { 9178 var typeVar string 9179 err = json.Unmarshal(*v, &typeVar) 9180 if err != nil { 9181 return err 9182 } 9183 pss.Type = &typeVar 9184 } 9185 } 9186 } 9187 9188 return nil 9189} 9190 9191// PortalSignupSettingsProperties sign-up settings contract properties. 9192type PortalSignupSettingsProperties struct { 9193 // Enabled - Allow users to sign up on a developer portal. 9194 Enabled *bool `json:"enabled,omitempty"` 9195 // TermsOfService - Terms of service contract properties. 9196 TermsOfService *TermsOfServiceProperties `json:"termsOfService,omitempty"` 9197} 9198 9199// ProductCollection paged Products list representation. 9200type ProductCollection struct { 9201 autorest.Response `json:"-"` 9202 // Value - Page values. 9203 Value *[]ProductContract `json:"value,omitempty"` 9204 // NextLink - Next page link if any. 9205 NextLink *string `json:"nextLink,omitempty"` 9206} 9207 9208// ProductCollectionIterator provides access to a complete listing of ProductContract values. 9209type ProductCollectionIterator struct { 9210 i int 9211 page ProductCollectionPage 9212} 9213 9214// NextWithContext advances to the next value. If there was an error making 9215// the request the iterator does not advance and the error is returned. 9216func (iter *ProductCollectionIterator) NextWithContext(ctx context.Context) (err error) { 9217 if tracing.IsEnabled() { 9218 ctx = tracing.StartSpan(ctx, fqdn+"/ProductCollectionIterator.NextWithContext") 9219 defer func() { 9220 sc := -1 9221 if iter.Response().Response.Response != nil { 9222 sc = iter.Response().Response.Response.StatusCode 9223 } 9224 tracing.EndSpan(ctx, sc, err) 9225 }() 9226 } 9227 iter.i++ 9228 if iter.i < len(iter.page.Values()) { 9229 return nil 9230 } 9231 err = iter.page.NextWithContext(ctx) 9232 if err != nil { 9233 iter.i-- 9234 return err 9235 } 9236 iter.i = 0 9237 return nil 9238} 9239 9240// Next advances to the next value. If there was an error making 9241// the request the iterator does not advance and the error is returned. 9242// Deprecated: Use NextWithContext() instead. 9243func (iter *ProductCollectionIterator) Next() error { 9244 return iter.NextWithContext(context.Background()) 9245} 9246 9247// NotDone returns true if the enumeration should be started or is not yet complete. 9248func (iter ProductCollectionIterator) NotDone() bool { 9249 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 9250} 9251 9252// Response returns the raw server response from the last page request. 9253func (iter ProductCollectionIterator) Response() ProductCollection { 9254 return iter.page.Response() 9255} 9256 9257// Value returns the current value or a zero-initialized value if the 9258// iterator has advanced beyond the end of the collection. 9259func (iter ProductCollectionIterator) Value() ProductContract { 9260 if !iter.page.NotDone() { 9261 return ProductContract{} 9262 } 9263 return iter.page.Values()[iter.i] 9264} 9265 9266// Creates a new instance of the ProductCollectionIterator type. 9267func NewProductCollectionIterator(page ProductCollectionPage) ProductCollectionIterator { 9268 return ProductCollectionIterator{page: page} 9269} 9270 9271// IsEmpty returns true if the ListResult contains no values. 9272func (pc ProductCollection) IsEmpty() bool { 9273 return pc.Value == nil || len(*pc.Value) == 0 9274} 9275 9276// hasNextLink returns true if the NextLink is not empty. 9277func (pc ProductCollection) hasNextLink() bool { 9278 return pc.NextLink != nil && len(*pc.NextLink) != 0 9279} 9280 9281// productCollectionPreparer prepares a request to retrieve the next set of results. 9282// It returns nil if no more results exist. 9283func (pc ProductCollection) productCollectionPreparer(ctx context.Context) (*http.Request, error) { 9284 if !pc.hasNextLink() { 9285 return nil, nil 9286 } 9287 return autorest.Prepare((&http.Request{}).WithContext(ctx), 9288 autorest.AsJSON(), 9289 autorest.AsGet(), 9290 autorest.WithBaseURL(to.String(pc.NextLink))) 9291} 9292 9293// ProductCollectionPage contains a page of ProductContract values. 9294type ProductCollectionPage struct { 9295 fn func(context.Context, ProductCollection) (ProductCollection, error) 9296 pc ProductCollection 9297} 9298 9299// NextWithContext advances to the next page of values. If there was an error making 9300// the request the page does not advance and the error is returned. 9301func (page *ProductCollectionPage) NextWithContext(ctx context.Context) (err error) { 9302 if tracing.IsEnabled() { 9303 ctx = tracing.StartSpan(ctx, fqdn+"/ProductCollectionPage.NextWithContext") 9304 defer func() { 9305 sc := -1 9306 if page.Response().Response.Response != nil { 9307 sc = page.Response().Response.Response.StatusCode 9308 } 9309 tracing.EndSpan(ctx, sc, err) 9310 }() 9311 } 9312 for { 9313 next, err := page.fn(ctx, page.pc) 9314 if err != nil { 9315 return err 9316 } 9317 page.pc = next 9318 if !next.hasNextLink() || !next.IsEmpty() { 9319 break 9320 } 9321 } 9322 return nil 9323} 9324 9325// Next advances to the next page of values. If there was an error making 9326// the request the page does not advance and the error is returned. 9327// Deprecated: Use NextWithContext() instead. 9328func (page *ProductCollectionPage) Next() error { 9329 return page.NextWithContext(context.Background()) 9330} 9331 9332// NotDone returns true if the page enumeration should be started or is not yet complete. 9333func (page ProductCollectionPage) NotDone() bool { 9334 return !page.pc.IsEmpty() 9335} 9336 9337// Response returns the raw server response from the last page request. 9338func (page ProductCollectionPage) Response() ProductCollection { 9339 return page.pc 9340} 9341 9342// Values returns the slice of values for the current page or nil if there are no values. 9343func (page ProductCollectionPage) Values() []ProductContract { 9344 if page.pc.IsEmpty() { 9345 return nil 9346 } 9347 return *page.pc.Value 9348} 9349 9350// Creates a new instance of the ProductCollectionPage type. 9351func NewProductCollectionPage(cur ProductCollection, getNextPage func(context.Context, ProductCollection) (ProductCollection, error)) ProductCollectionPage { 9352 return ProductCollectionPage{ 9353 fn: getNextPage, 9354 pc: cur, 9355 } 9356} 9357 9358// ProductContract product details. 9359type ProductContract struct { 9360 autorest.Response `json:"-"` 9361 // ProductContractProperties - Product entity contract properties. 9362 *ProductContractProperties `json:"properties,omitempty"` 9363 // ID - READ-ONLY; Resource ID. 9364 ID *string `json:"id,omitempty"` 9365 // Name - READ-ONLY; Resource name. 9366 Name *string `json:"name,omitempty"` 9367 // Type - READ-ONLY; Resource type for API Management resource. 9368 Type *string `json:"type,omitempty"` 9369} 9370 9371// MarshalJSON is the custom marshaler for ProductContract. 9372func (pc ProductContract) MarshalJSON() ([]byte, error) { 9373 objectMap := make(map[string]interface{}) 9374 if pc.ProductContractProperties != nil { 9375 objectMap["properties"] = pc.ProductContractProperties 9376 } 9377 return json.Marshal(objectMap) 9378} 9379 9380// UnmarshalJSON is the custom unmarshaler for ProductContract struct. 9381func (pc *ProductContract) UnmarshalJSON(body []byte) error { 9382 var m map[string]*json.RawMessage 9383 err := json.Unmarshal(body, &m) 9384 if err != nil { 9385 return err 9386 } 9387 for k, v := range m { 9388 switch k { 9389 case "properties": 9390 if v != nil { 9391 var productContractProperties ProductContractProperties 9392 err = json.Unmarshal(*v, &productContractProperties) 9393 if err != nil { 9394 return err 9395 } 9396 pc.ProductContractProperties = &productContractProperties 9397 } 9398 case "id": 9399 if v != nil { 9400 var ID string 9401 err = json.Unmarshal(*v, &ID) 9402 if err != nil { 9403 return err 9404 } 9405 pc.ID = &ID 9406 } 9407 case "name": 9408 if v != nil { 9409 var name string 9410 err = json.Unmarshal(*v, &name) 9411 if err != nil { 9412 return err 9413 } 9414 pc.Name = &name 9415 } 9416 case "type": 9417 if v != nil { 9418 var typeVar string 9419 err = json.Unmarshal(*v, &typeVar) 9420 if err != nil { 9421 return err 9422 } 9423 pc.Type = &typeVar 9424 } 9425 } 9426 } 9427 9428 return nil 9429} 9430 9431// ProductContractProperties product profile. 9432type ProductContractProperties struct { 9433 // DisplayName - Product name. 9434 DisplayName *string `json:"displayName,omitempty"` 9435 // Description - Product description. May include HTML formatting tags. 9436 Description *string `json:"description,omitempty"` 9437 // 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. 9438 Terms *string `json:"terms,omitempty"` 9439 // 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. 9440 SubscriptionRequired *bool `json:"subscriptionRequired,omitempty"` 9441 // 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. 9442 ApprovalRequired *bool `json:"approvalRequired,omitempty"` 9443 // 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. 9444 SubscriptionsLimit *int32 `json:"subscriptionsLimit,omitempty"` 9445 // 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' 9446 State ProductState `json:"state,omitempty"` 9447} 9448 9449// ProductEntityBaseParameters product Entity Base Parameters 9450type ProductEntityBaseParameters struct { 9451 // Description - Product description. May include HTML formatting tags. 9452 Description *string `json:"description,omitempty"` 9453 // 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. 9454 Terms *string `json:"terms,omitempty"` 9455 // 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. 9456 SubscriptionRequired *bool `json:"subscriptionRequired,omitempty"` 9457 // 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. 9458 ApprovalRequired *bool `json:"approvalRequired,omitempty"` 9459 // 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. 9460 SubscriptionsLimit *int32 `json:"subscriptionsLimit,omitempty"` 9461 // 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' 9462 State ProductState `json:"state,omitempty"` 9463} 9464 9465// ProductTagResourceContractProperties product profile. 9466type ProductTagResourceContractProperties struct { 9467 // ID - Identifier of the product in the form of /products/{productId} 9468 ID *string `json:"id,omitempty"` 9469 // Name - Product name. 9470 Name *string `json:"name,omitempty"` 9471 // Description - Product description. May include HTML formatting tags. 9472 Description *string `json:"description,omitempty"` 9473 // 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. 9474 Terms *string `json:"terms,omitempty"` 9475 // 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. 9476 SubscriptionRequired *bool `json:"subscriptionRequired,omitempty"` 9477 // 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. 9478 ApprovalRequired *bool `json:"approvalRequired,omitempty"` 9479 // 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. 9480 SubscriptionsLimit *int32 `json:"subscriptionsLimit,omitempty"` 9481 // 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' 9482 State ProductState `json:"state,omitempty"` 9483} 9484 9485// ProductUpdateParameters product Update parameters. 9486type ProductUpdateParameters struct { 9487 // ProductUpdateProperties - Product entity Update contract properties. 9488 *ProductUpdateProperties `json:"properties,omitempty"` 9489} 9490 9491// MarshalJSON is the custom marshaler for ProductUpdateParameters. 9492func (pup ProductUpdateParameters) MarshalJSON() ([]byte, error) { 9493 objectMap := make(map[string]interface{}) 9494 if pup.ProductUpdateProperties != nil { 9495 objectMap["properties"] = pup.ProductUpdateProperties 9496 } 9497 return json.Marshal(objectMap) 9498} 9499 9500// UnmarshalJSON is the custom unmarshaler for ProductUpdateParameters struct. 9501func (pup *ProductUpdateParameters) UnmarshalJSON(body []byte) error { 9502 var m map[string]*json.RawMessage 9503 err := json.Unmarshal(body, &m) 9504 if err != nil { 9505 return err 9506 } 9507 for k, v := range m { 9508 switch k { 9509 case "properties": 9510 if v != nil { 9511 var productUpdateProperties ProductUpdateProperties 9512 err = json.Unmarshal(*v, &productUpdateProperties) 9513 if err != nil { 9514 return err 9515 } 9516 pup.ProductUpdateProperties = &productUpdateProperties 9517 } 9518 } 9519 } 9520 9521 return nil 9522} 9523 9524// ProductUpdateProperties parameters supplied to the Update Product operation. 9525type ProductUpdateProperties struct { 9526 // DisplayName - Product name. 9527 DisplayName *string `json:"displayName,omitempty"` 9528 // Description - Product description. May include HTML formatting tags. 9529 Description *string `json:"description,omitempty"` 9530 // 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. 9531 Terms *string `json:"terms,omitempty"` 9532 // 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. 9533 SubscriptionRequired *bool `json:"subscriptionRequired,omitempty"` 9534 // 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. 9535 ApprovalRequired *bool `json:"approvalRequired,omitempty"` 9536 // 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. 9537 SubscriptionsLimit *int32 `json:"subscriptionsLimit,omitempty"` 9538 // 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' 9539 State ProductState `json:"state,omitempty"` 9540} 9541 9542// PropertyValueContract client or app secret used in IdentityProviders, Aad, OpenID or OAuth. 9543type PropertyValueContract struct { 9544 autorest.Response `json:"-"` 9545 // Value - This is secret value of the NamedValue entity. 9546 Value *string `json:"value,omitempty"` 9547} 9548 9549// QuotaCounterCollection paged Quota Counter list representation. 9550type QuotaCounterCollection struct { 9551 autorest.Response `json:"-"` 9552 // Value - Quota counter values. 9553 Value *[]QuotaCounterContract `json:"value,omitempty"` 9554 // Count - Total record count number across all pages. 9555 Count *int64 `json:"count,omitempty"` 9556 // NextLink - Next page link if any. 9557 NextLink *string `json:"nextLink,omitempty"` 9558} 9559 9560// QuotaCounterContract quota counter details. 9561type QuotaCounterContract struct { 9562 autorest.Response `json:"-"` 9563 // CounterKey - The Key value of the Counter. Must not be empty. 9564 CounterKey *string `json:"counterKey,omitempty"` 9565 // PeriodKey - Identifier of the Period for which the counter was collected. Must not be empty. 9566 PeriodKey *string `json:"periodKey,omitempty"` 9567 // 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. 9568 PeriodStartTime *date.Time `json:"periodStartTime,omitempty"` 9569 // 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. 9570 PeriodEndTime *date.Time `json:"periodEndTime,omitempty"` 9571 // Value - Quota Value Properties 9572 Value *QuotaCounterValueContractProperties `json:"value,omitempty"` 9573} 9574 9575// QuotaCounterValueContract quota counter value details. 9576type QuotaCounterValueContract struct { 9577 // QuotaCounterValueContractProperties - Quota counter Value Properties. 9578 *QuotaCounterValueContractProperties `json:"value,omitempty"` 9579} 9580 9581// MarshalJSON is the custom marshaler for QuotaCounterValueContract. 9582func (qcvc QuotaCounterValueContract) MarshalJSON() ([]byte, error) { 9583 objectMap := make(map[string]interface{}) 9584 if qcvc.QuotaCounterValueContractProperties != nil { 9585 objectMap["value"] = qcvc.QuotaCounterValueContractProperties 9586 } 9587 return json.Marshal(objectMap) 9588} 9589 9590// UnmarshalJSON is the custom unmarshaler for QuotaCounterValueContract struct. 9591func (qcvc *QuotaCounterValueContract) UnmarshalJSON(body []byte) error { 9592 var m map[string]*json.RawMessage 9593 err := json.Unmarshal(body, &m) 9594 if err != nil { 9595 return err 9596 } 9597 for k, v := range m { 9598 switch k { 9599 case "value": 9600 if v != nil { 9601 var quotaCounterValueContractProperties QuotaCounterValueContractProperties 9602 err = json.Unmarshal(*v, "aCounterValueContractProperties) 9603 if err != nil { 9604 return err 9605 } 9606 qcvc.QuotaCounterValueContractProperties = "aCounterValueContractProperties 9607 } 9608 } 9609 } 9610 9611 return nil 9612} 9613 9614// QuotaCounterValueContractProperties quota counter value details. 9615type QuotaCounterValueContractProperties struct { 9616 // CallsCount - Number of times Counter was called. 9617 CallsCount *int32 `json:"callsCount,omitempty"` 9618 // KbTransferred - Data Transferred in KiloBytes. 9619 KbTransferred *float64 `json:"kbTransferred,omitempty"` 9620} 9621 9622// QuotaCounterValueUpdateContract quota counter value details. 9623type QuotaCounterValueUpdateContract struct { 9624 // QuotaCounterValueContractProperties - Quota counter value details. 9625 *QuotaCounterValueContractProperties `json:"properties,omitempty"` 9626} 9627 9628// MarshalJSON is the custom marshaler for QuotaCounterValueUpdateContract. 9629func (qcvuc QuotaCounterValueUpdateContract) MarshalJSON() ([]byte, error) { 9630 objectMap := make(map[string]interface{}) 9631 if qcvuc.QuotaCounterValueContractProperties != nil { 9632 objectMap["properties"] = qcvuc.QuotaCounterValueContractProperties 9633 } 9634 return json.Marshal(objectMap) 9635} 9636 9637// UnmarshalJSON is the custom unmarshaler for QuotaCounterValueUpdateContract struct. 9638func (qcvuc *QuotaCounterValueUpdateContract) UnmarshalJSON(body []byte) error { 9639 var m map[string]*json.RawMessage 9640 err := json.Unmarshal(body, &m) 9641 if err != nil { 9642 return err 9643 } 9644 for k, v := range m { 9645 switch k { 9646 case "properties": 9647 if v != nil { 9648 var quotaCounterValueContractProperties QuotaCounterValueContractProperties 9649 err = json.Unmarshal(*v, "aCounterValueContractProperties) 9650 if err != nil { 9651 return err 9652 } 9653 qcvuc.QuotaCounterValueContractProperties = "aCounterValueContractProperties 9654 } 9655 } 9656 } 9657 9658 return nil 9659} 9660 9661// RecipientEmailCollection paged Recipient User list representation. 9662type RecipientEmailCollection struct { 9663 autorest.Response `json:"-"` 9664 // Value - Page values. 9665 Value *[]RecipientEmailContract `json:"value,omitempty"` 9666 // NextLink - Next page link if any. 9667 NextLink *string `json:"nextLink,omitempty"` 9668} 9669 9670// RecipientEmailContract recipient Email details. 9671type RecipientEmailContract struct { 9672 autorest.Response `json:"-"` 9673 // RecipientEmailContractProperties - Recipient Email contract properties. 9674 *RecipientEmailContractProperties `json:"properties,omitempty"` 9675 // ID - READ-ONLY; Resource ID. 9676 ID *string `json:"id,omitempty"` 9677 // Name - READ-ONLY; Resource name. 9678 Name *string `json:"name,omitempty"` 9679 // Type - READ-ONLY; Resource type for API Management resource. 9680 Type *string `json:"type,omitempty"` 9681} 9682 9683// MarshalJSON is the custom marshaler for RecipientEmailContract. 9684func (rec RecipientEmailContract) MarshalJSON() ([]byte, error) { 9685 objectMap := make(map[string]interface{}) 9686 if rec.RecipientEmailContractProperties != nil { 9687 objectMap["properties"] = rec.RecipientEmailContractProperties 9688 } 9689 return json.Marshal(objectMap) 9690} 9691 9692// UnmarshalJSON is the custom unmarshaler for RecipientEmailContract struct. 9693func (rec *RecipientEmailContract) UnmarshalJSON(body []byte) error { 9694 var m map[string]*json.RawMessage 9695 err := json.Unmarshal(body, &m) 9696 if err != nil { 9697 return err 9698 } 9699 for k, v := range m { 9700 switch k { 9701 case "properties": 9702 if v != nil { 9703 var recipientEmailContractProperties RecipientEmailContractProperties 9704 err = json.Unmarshal(*v, &recipientEmailContractProperties) 9705 if err != nil { 9706 return err 9707 } 9708 rec.RecipientEmailContractProperties = &recipientEmailContractProperties 9709 } 9710 case "id": 9711 if v != nil { 9712 var ID string 9713 err = json.Unmarshal(*v, &ID) 9714 if err != nil { 9715 return err 9716 } 9717 rec.ID = &ID 9718 } 9719 case "name": 9720 if v != nil { 9721 var name string 9722 err = json.Unmarshal(*v, &name) 9723 if err != nil { 9724 return err 9725 } 9726 rec.Name = &name 9727 } 9728 case "type": 9729 if v != nil { 9730 var typeVar string 9731 err = json.Unmarshal(*v, &typeVar) 9732 if err != nil { 9733 return err 9734 } 9735 rec.Type = &typeVar 9736 } 9737 } 9738 } 9739 9740 return nil 9741} 9742 9743// RecipientEmailContractProperties recipient Email Contract Properties. 9744type RecipientEmailContractProperties struct { 9745 // Email - User Email subscribed to notification. 9746 Email *string `json:"email,omitempty"` 9747} 9748 9749// RecipientsContractProperties notification Parameter contract. 9750type RecipientsContractProperties struct { 9751 // Emails - List of Emails subscribed for the notification. 9752 Emails *[]string `json:"emails,omitempty"` 9753 // Users - List of Users subscribed for the notification. 9754 Users *[]string `json:"users,omitempty"` 9755} 9756 9757// RecipientUserCollection paged Recipient User list representation. 9758type RecipientUserCollection struct { 9759 autorest.Response `json:"-"` 9760 // Value - Page values. 9761 Value *[]RecipientUserContract `json:"value,omitempty"` 9762 // NextLink - Next page link if any. 9763 NextLink *string `json:"nextLink,omitempty"` 9764} 9765 9766// RecipientUserContract recipient User details. 9767type RecipientUserContract struct { 9768 autorest.Response `json:"-"` 9769 // RecipientUsersContractProperties - Recipient User entity contract properties. 9770 *RecipientUsersContractProperties `json:"properties,omitempty"` 9771 // ID - READ-ONLY; Resource ID. 9772 ID *string `json:"id,omitempty"` 9773 // Name - READ-ONLY; Resource name. 9774 Name *string `json:"name,omitempty"` 9775 // Type - READ-ONLY; Resource type for API Management resource. 9776 Type *string `json:"type,omitempty"` 9777} 9778 9779// MarshalJSON is the custom marshaler for RecipientUserContract. 9780func (ruc RecipientUserContract) MarshalJSON() ([]byte, error) { 9781 objectMap := make(map[string]interface{}) 9782 if ruc.RecipientUsersContractProperties != nil { 9783 objectMap["properties"] = ruc.RecipientUsersContractProperties 9784 } 9785 return json.Marshal(objectMap) 9786} 9787 9788// UnmarshalJSON is the custom unmarshaler for RecipientUserContract struct. 9789func (ruc *RecipientUserContract) UnmarshalJSON(body []byte) error { 9790 var m map[string]*json.RawMessage 9791 err := json.Unmarshal(body, &m) 9792 if err != nil { 9793 return err 9794 } 9795 for k, v := range m { 9796 switch k { 9797 case "properties": 9798 if v != nil { 9799 var recipientUsersContractProperties RecipientUsersContractProperties 9800 err = json.Unmarshal(*v, &recipientUsersContractProperties) 9801 if err != nil { 9802 return err 9803 } 9804 ruc.RecipientUsersContractProperties = &recipientUsersContractProperties 9805 } 9806 case "id": 9807 if v != nil { 9808 var ID string 9809 err = json.Unmarshal(*v, &ID) 9810 if err != nil { 9811 return err 9812 } 9813 ruc.ID = &ID 9814 } 9815 case "name": 9816 if v != nil { 9817 var name string 9818 err = json.Unmarshal(*v, &name) 9819 if err != nil { 9820 return err 9821 } 9822 ruc.Name = &name 9823 } 9824 case "type": 9825 if v != nil { 9826 var typeVar string 9827 err = json.Unmarshal(*v, &typeVar) 9828 if err != nil { 9829 return err 9830 } 9831 ruc.Type = &typeVar 9832 } 9833 } 9834 } 9835 9836 return nil 9837} 9838 9839// RecipientUsersContractProperties recipient User Contract Properties. 9840type RecipientUsersContractProperties struct { 9841 // UserID - API Management UserId subscribed to notification. 9842 UserID *string `json:"userId,omitempty"` 9843} 9844 9845// RegionContract region profile. 9846type RegionContract struct { 9847 // Name - READ-ONLY; Region name. 9848 Name *string `json:"name,omitempty"` 9849 // IsMasterRegion - whether Region is the master region. 9850 IsMasterRegion *bool `json:"isMasterRegion,omitempty"` 9851 // IsDeleted - whether Region is deleted. 9852 IsDeleted *bool `json:"isDeleted,omitempty"` 9853} 9854 9855// MarshalJSON is the custom marshaler for RegionContract. 9856func (rc RegionContract) MarshalJSON() ([]byte, error) { 9857 objectMap := make(map[string]interface{}) 9858 if rc.IsMasterRegion != nil { 9859 objectMap["isMasterRegion"] = rc.IsMasterRegion 9860 } 9861 if rc.IsDeleted != nil { 9862 objectMap["isDeleted"] = rc.IsDeleted 9863 } 9864 return json.Marshal(objectMap) 9865} 9866 9867// RegionListResult lists Regions operation response details. 9868type RegionListResult struct { 9869 autorest.Response `json:"-"` 9870 // Value - Lists of Regions. 9871 Value *[]RegionContract `json:"value,omitempty"` 9872 // Count - Total record count number across all pages. 9873 Count *int64 `json:"count,omitempty"` 9874 // NextLink - Next page link if any. 9875 NextLink *string `json:"nextLink,omitempty"` 9876} 9877 9878// RegionListResultIterator provides access to a complete listing of RegionContract values. 9879type RegionListResultIterator struct { 9880 i int 9881 page RegionListResultPage 9882} 9883 9884// NextWithContext advances to the next value. If there was an error making 9885// the request the iterator does not advance and the error is returned. 9886func (iter *RegionListResultIterator) NextWithContext(ctx context.Context) (err error) { 9887 if tracing.IsEnabled() { 9888 ctx = tracing.StartSpan(ctx, fqdn+"/RegionListResultIterator.NextWithContext") 9889 defer func() { 9890 sc := -1 9891 if iter.Response().Response.Response != nil { 9892 sc = iter.Response().Response.Response.StatusCode 9893 } 9894 tracing.EndSpan(ctx, sc, err) 9895 }() 9896 } 9897 iter.i++ 9898 if iter.i < len(iter.page.Values()) { 9899 return nil 9900 } 9901 err = iter.page.NextWithContext(ctx) 9902 if err != nil { 9903 iter.i-- 9904 return err 9905 } 9906 iter.i = 0 9907 return nil 9908} 9909 9910// Next advances to the next value. If there was an error making 9911// the request the iterator does not advance and the error is returned. 9912// Deprecated: Use NextWithContext() instead. 9913func (iter *RegionListResultIterator) Next() error { 9914 return iter.NextWithContext(context.Background()) 9915} 9916 9917// NotDone returns true if the enumeration should be started or is not yet complete. 9918func (iter RegionListResultIterator) NotDone() bool { 9919 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 9920} 9921 9922// Response returns the raw server response from the last page request. 9923func (iter RegionListResultIterator) Response() RegionListResult { 9924 return iter.page.Response() 9925} 9926 9927// Value returns the current value or a zero-initialized value if the 9928// iterator has advanced beyond the end of the collection. 9929func (iter RegionListResultIterator) Value() RegionContract { 9930 if !iter.page.NotDone() { 9931 return RegionContract{} 9932 } 9933 return iter.page.Values()[iter.i] 9934} 9935 9936// Creates a new instance of the RegionListResultIterator type. 9937func NewRegionListResultIterator(page RegionListResultPage) RegionListResultIterator { 9938 return RegionListResultIterator{page: page} 9939} 9940 9941// IsEmpty returns true if the ListResult contains no values. 9942func (rlr RegionListResult) IsEmpty() bool { 9943 return rlr.Value == nil || len(*rlr.Value) == 0 9944} 9945 9946// hasNextLink returns true if the NextLink is not empty. 9947func (rlr RegionListResult) hasNextLink() bool { 9948 return rlr.NextLink != nil && len(*rlr.NextLink) != 0 9949} 9950 9951// regionListResultPreparer prepares a request to retrieve the next set of results. 9952// It returns nil if no more results exist. 9953func (rlr RegionListResult) regionListResultPreparer(ctx context.Context) (*http.Request, error) { 9954 if !rlr.hasNextLink() { 9955 return nil, nil 9956 } 9957 return autorest.Prepare((&http.Request{}).WithContext(ctx), 9958 autorest.AsJSON(), 9959 autorest.AsGet(), 9960 autorest.WithBaseURL(to.String(rlr.NextLink))) 9961} 9962 9963// RegionListResultPage contains a page of RegionContract values. 9964type RegionListResultPage struct { 9965 fn func(context.Context, RegionListResult) (RegionListResult, error) 9966 rlr RegionListResult 9967} 9968 9969// NextWithContext advances to the next page of values. If there was an error making 9970// the request the page does not advance and the error is returned. 9971func (page *RegionListResultPage) NextWithContext(ctx context.Context) (err error) { 9972 if tracing.IsEnabled() { 9973 ctx = tracing.StartSpan(ctx, fqdn+"/RegionListResultPage.NextWithContext") 9974 defer func() { 9975 sc := -1 9976 if page.Response().Response.Response != nil { 9977 sc = page.Response().Response.Response.StatusCode 9978 } 9979 tracing.EndSpan(ctx, sc, err) 9980 }() 9981 } 9982 for { 9983 next, err := page.fn(ctx, page.rlr) 9984 if err != nil { 9985 return err 9986 } 9987 page.rlr = next 9988 if !next.hasNextLink() || !next.IsEmpty() { 9989 break 9990 } 9991 } 9992 return nil 9993} 9994 9995// Next advances to the next page of values. If there was an error making 9996// the request the page does not advance and the error is returned. 9997// Deprecated: Use NextWithContext() instead. 9998func (page *RegionListResultPage) Next() error { 9999 return page.NextWithContext(context.Background()) 10000} 10001 10002// NotDone returns true if the page enumeration should be started or is not yet complete. 10003func (page RegionListResultPage) NotDone() bool { 10004 return !page.rlr.IsEmpty() 10005} 10006 10007// Response returns the raw server response from the last page request. 10008func (page RegionListResultPage) Response() RegionListResult { 10009 return page.rlr 10010} 10011 10012// Values returns the slice of values for the current page or nil if there are no values. 10013func (page RegionListResultPage) Values() []RegionContract { 10014 if page.rlr.IsEmpty() { 10015 return nil 10016 } 10017 return *page.rlr.Value 10018} 10019 10020// Creates a new instance of the RegionListResultPage type. 10021func NewRegionListResultPage(cur RegionListResult, getNextPage func(context.Context, RegionListResult) (RegionListResult, error)) RegionListResultPage { 10022 return RegionListResultPage{ 10023 fn: getNextPage, 10024 rlr: cur, 10025 } 10026} 10027 10028// RegistrationDelegationSettingsProperties user registration delegation settings properties. 10029type RegistrationDelegationSettingsProperties struct { 10030 // Enabled - Enable or disable delegation for user registration. 10031 Enabled *bool `json:"enabled,omitempty"` 10032} 10033 10034// ReportCollection paged Report records list representation. 10035type ReportCollection struct { 10036 autorest.Response `json:"-"` 10037 // Value - Page values. 10038 Value *[]ReportRecordContract `json:"value,omitempty"` 10039 // Count - Total record count number across all pages. 10040 Count *int64 `json:"count,omitempty"` 10041 // NextLink - Next page link if any. 10042 NextLink *string `json:"nextLink,omitempty"` 10043} 10044 10045// ReportCollectionIterator provides access to a complete listing of ReportRecordContract values. 10046type ReportCollectionIterator struct { 10047 i int 10048 page ReportCollectionPage 10049} 10050 10051// NextWithContext advances to the next value. If there was an error making 10052// the request the iterator does not advance and the error is returned. 10053func (iter *ReportCollectionIterator) NextWithContext(ctx context.Context) (err error) { 10054 if tracing.IsEnabled() { 10055 ctx = tracing.StartSpan(ctx, fqdn+"/ReportCollectionIterator.NextWithContext") 10056 defer func() { 10057 sc := -1 10058 if iter.Response().Response.Response != nil { 10059 sc = iter.Response().Response.Response.StatusCode 10060 } 10061 tracing.EndSpan(ctx, sc, err) 10062 }() 10063 } 10064 iter.i++ 10065 if iter.i < len(iter.page.Values()) { 10066 return nil 10067 } 10068 err = iter.page.NextWithContext(ctx) 10069 if err != nil { 10070 iter.i-- 10071 return err 10072 } 10073 iter.i = 0 10074 return nil 10075} 10076 10077// Next advances to the next value. If there was an error making 10078// the request the iterator does not advance and the error is returned. 10079// Deprecated: Use NextWithContext() instead. 10080func (iter *ReportCollectionIterator) Next() error { 10081 return iter.NextWithContext(context.Background()) 10082} 10083 10084// NotDone returns true if the enumeration should be started or is not yet complete. 10085func (iter ReportCollectionIterator) NotDone() bool { 10086 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 10087} 10088 10089// Response returns the raw server response from the last page request. 10090func (iter ReportCollectionIterator) Response() ReportCollection { 10091 return iter.page.Response() 10092} 10093 10094// Value returns the current value or a zero-initialized value if the 10095// iterator has advanced beyond the end of the collection. 10096func (iter ReportCollectionIterator) Value() ReportRecordContract { 10097 if !iter.page.NotDone() { 10098 return ReportRecordContract{} 10099 } 10100 return iter.page.Values()[iter.i] 10101} 10102 10103// Creates a new instance of the ReportCollectionIterator type. 10104func NewReportCollectionIterator(page ReportCollectionPage) ReportCollectionIterator { 10105 return ReportCollectionIterator{page: page} 10106} 10107 10108// IsEmpty returns true if the ListResult contains no values. 10109func (rc ReportCollection) IsEmpty() bool { 10110 return rc.Value == nil || len(*rc.Value) == 0 10111} 10112 10113// hasNextLink returns true if the NextLink is not empty. 10114func (rc ReportCollection) hasNextLink() bool { 10115 return rc.NextLink != nil && len(*rc.NextLink) != 0 10116} 10117 10118// reportCollectionPreparer prepares a request to retrieve the next set of results. 10119// It returns nil if no more results exist. 10120func (rc ReportCollection) reportCollectionPreparer(ctx context.Context) (*http.Request, error) { 10121 if !rc.hasNextLink() { 10122 return nil, nil 10123 } 10124 return autorest.Prepare((&http.Request{}).WithContext(ctx), 10125 autorest.AsJSON(), 10126 autorest.AsGet(), 10127 autorest.WithBaseURL(to.String(rc.NextLink))) 10128} 10129 10130// ReportCollectionPage contains a page of ReportRecordContract values. 10131type ReportCollectionPage struct { 10132 fn func(context.Context, ReportCollection) (ReportCollection, error) 10133 rc ReportCollection 10134} 10135 10136// NextWithContext advances to the next page of values. If there was an error making 10137// the request the page does not advance and the error is returned. 10138func (page *ReportCollectionPage) NextWithContext(ctx context.Context) (err error) { 10139 if tracing.IsEnabled() { 10140 ctx = tracing.StartSpan(ctx, fqdn+"/ReportCollectionPage.NextWithContext") 10141 defer func() { 10142 sc := -1 10143 if page.Response().Response.Response != nil { 10144 sc = page.Response().Response.Response.StatusCode 10145 } 10146 tracing.EndSpan(ctx, sc, err) 10147 }() 10148 } 10149 for { 10150 next, err := page.fn(ctx, page.rc) 10151 if err != nil { 10152 return err 10153 } 10154 page.rc = next 10155 if !next.hasNextLink() || !next.IsEmpty() { 10156 break 10157 } 10158 } 10159 return nil 10160} 10161 10162// Next advances to the next page of values. If there was an error making 10163// the request the page does not advance and the error is returned. 10164// Deprecated: Use NextWithContext() instead. 10165func (page *ReportCollectionPage) Next() error { 10166 return page.NextWithContext(context.Background()) 10167} 10168 10169// NotDone returns true if the page enumeration should be started or is not yet complete. 10170func (page ReportCollectionPage) NotDone() bool { 10171 return !page.rc.IsEmpty() 10172} 10173 10174// Response returns the raw server response from the last page request. 10175func (page ReportCollectionPage) Response() ReportCollection { 10176 return page.rc 10177} 10178 10179// Values returns the slice of values for the current page or nil if there are no values. 10180func (page ReportCollectionPage) Values() []ReportRecordContract { 10181 if page.rc.IsEmpty() { 10182 return nil 10183 } 10184 return *page.rc.Value 10185} 10186 10187// Creates a new instance of the ReportCollectionPage type. 10188func NewReportCollectionPage(cur ReportCollection, getNextPage func(context.Context, ReportCollection) (ReportCollection, error)) ReportCollectionPage { 10189 return ReportCollectionPage{ 10190 fn: getNextPage, 10191 rc: cur, 10192 } 10193} 10194 10195// ReportRecordContract report data. 10196type ReportRecordContract struct { 10197 // Name - Name depending on report endpoint specifies product, API, operation or developer name. 10198 Name *string `json:"name,omitempty"` 10199 // Timestamp - Start of aggregation period. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. 10200 Timestamp *date.Time `json:"timestamp,omitempty"` 10201 // 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). 10202 Interval *string `json:"interval,omitempty"` 10203 // Country - Country to which this record data is related. 10204 Country *string `json:"country,omitempty"` 10205 // Region - Country region to which this record data is related. 10206 Region *string `json:"region,omitempty"` 10207 // Zip - Zip code to which this record data is related. 10208 Zip *string `json:"zip,omitempty"` 10209 // UserID - READ-ONLY; User identifier path. /users/{userId} 10210 UserID *string `json:"userId,omitempty"` 10211 // ProductID - READ-ONLY; Product identifier path. /products/{productId} 10212 ProductID *string `json:"productId,omitempty"` 10213 // APIID - API identifier path. /apis/{apiId} 10214 APIID *string `json:"apiId,omitempty"` 10215 // OperationID - Operation identifier path. /apis/{apiId}/operations/{operationId} 10216 OperationID *string `json:"operationId,omitempty"` 10217 // APIRegion - API region identifier. 10218 APIRegion *string `json:"apiRegion,omitempty"` 10219 // SubscriptionID - Subscription identifier path. /subscriptions/{subscriptionId} 10220 SubscriptionID *string `json:"subscriptionId,omitempty"` 10221 // CallCountSuccess - Number of successful calls. This includes calls returning HttpStatusCode <= 301 and HttpStatusCode.NotModified and HttpStatusCode.TemporaryRedirect 10222 CallCountSuccess *int32 `json:"callCountSuccess,omitempty"` 10223 // CallCountBlocked - Number of calls blocked due to invalid credentials. This includes calls returning HttpStatusCode.Unauthorized and HttpStatusCode.Forbidden and HttpStatusCode.TooManyRequests 10224 CallCountBlocked *int32 `json:"callCountBlocked,omitempty"` 10225 // 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 10226 CallCountFailed *int32 `json:"callCountFailed,omitempty"` 10227 // CallCountOther - Number of other calls. 10228 CallCountOther *int32 `json:"callCountOther,omitempty"` 10229 // CallCountTotal - Total number of calls. 10230 CallCountTotal *int32 `json:"callCountTotal,omitempty"` 10231 // Bandwidth - Bandwidth consumed. 10232 Bandwidth *int64 `json:"bandwidth,omitempty"` 10233 // CacheHitCount - Number of times when content was served from cache policy. 10234 CacheHitCount *int32 `json:"cacheHitCount,omitempty"` 10235 // CacheMissCount - Number of times content was fetched from backend. 10236 CacheMissCount *int32 `json:"cacheMissCount,omitempty"` 10237 // APITimeAvg - Average time it took to process request. 10238 APITimeAvg *float64 `json:"apiTimeAvg,omitempty"` 10239 // APITimeMin - Minimum time it took to process request. 10240 APITimeMin *float64 `json:"apiTimeMin,omitempty"` 10241 // APITimeMax - Maximum time it took to process request. 10242 APITimeMax *float64 `json:"apiTimeMax,omitempty"` 10243 // ServiceTimeAvg - Average time it took to process request on backend. 10244 ServiceTimeAvg *float64 `json:"serviceTimeAvg,omitempty"` 10245 // ServiceTimeMin - Minimum time it took to process request on backend. 10246 ServiceTimeMin *float64 `json:"serviceTimeMin,omitempty"` 10247 // ServiceTimeMax - Maximum time it took to process request on backend. 10248 ServiceTimeMax *float64 `json:"serviceTimeMax,omitempty"` 10249} 10250 10251// MarshalJSON is the custom marshaler for ReportRecordContract. 10252func (rrc ReportRecordContract) MarshalJSON() ([]byte, error) { 10253 objectMap := make(map[string]interface{}) 10254 if rrc.Name != nil { 10255 objectMap["name"] = rrc.Name 10256 } 10257 if rrc.Timestamp != nil { 10258 objectMap["timestamp"] = rrc.Timestamp 10259 } 10260 if rrc.Interval != nil { 10261 objectMap["interval"] = rrc.Interval 10262 } 10263 if rrc.Country != nil { 10264 objectMap["country"] = rrc.Country 10265 } 10266 if rrc.Region != nil { 10267 objectMap["region"] = rrc.Region 10268 } 10269 if rrc.Zip != nil { 10270 objectMap["zip"] = rrc.Zip 10271 } 10272 if rrc.APIID != nil { 10273 objectMap["apiId"] = rrc.APIID 10274 } 10275 if rrc.OperationID != nil { 10276 objectMap["operationId"] = rrc.OperationID 10277 } 10278 if rrc.APIRegion != nil { 10279 objectMap["apiRegion"] = rrc.APIRegion 10280 } 10281 if rrc.SubscriptionID != nil { 10282 objectMap["subscriptionId"] = rrc.SubscriptionID 10283 } 10284 if rrc.CallCountSuccess != nil { 10285 objectMap["callCountSuccess"] = rrc.CallCountSuccess 10286 } 10287 if rrc.CallCountBlocked != nil { 10288 objectMap["callCountBlocked"] = rrc.CallCountBlocked 10289 } 10290 if rrc.CallCountFailed != nil { 10291 objectMap["callCountFailed"] = rrc.CallCountFailed 10292 } 10293 if rrc.CallCountOther != nil { 10294 objectMap["callCountOther"] = rrc.CallCountOther 10295 } 10296 if rrc.CallCountTotal != nil { 10297 objectMap["callCountTotal"] = rrc.CallCountTotal 10298 } 10299 if rrc.Bandwidth != nil { 10300 objectMap["bandwidth"] = rrc.Bandwidth 10301 } 10302 if rrc.CacheHitCount != nil { 10303 objectMap["cacheHitCount"] = rrc.CacheHitCount 10304 } 10305 if rrc.CacheMissCount != nil { 10306 objectMap["cacheMissCount"] = rrc.CacheMissCount 10307 } 10308 if rrc.APITimeAvg != nil { 10309 objectMap["apiTimeAvg"] = rrc.APITimeAvg 10310 } 10311 if rrc.APITimeMin != nil { 10312 objectMap["apiTimeMin"] = rrc.APITimeMin 10313 } 10314 if rrc.APITimeMax != nil { 10315 objectMap["apiTimeMax"] = rrc.APITimeMax 10316 } 10317 if rrc.ServiceTimeAvg != nil { 10318 objectMap["serviceTimeAvg"] = rrc.ServiceTimeAvg 10319 } 10320 if rrc.ServiceTimeMin != nil { 10321 objectMap["serviceTimeMin"] = rrc.ServiceTimeMin 10322 } 10323 if rrc.ServiceTimeMax != nil { 10324 objectMap["serviceTimeMax"] = rrc.ServiceTimeMax 10325 } 10326 return json.Marshal(objectMap) 10327} 10328 10329// RepresentationContract operation request/response representation details. 10330type RepresentationContract struct { 10331 // ContentType - Specifies a registered or custom content type for this representation, e.g. application/xml. 10332 ContentType *string `json:"contentType,omitempty"` 10333 // Sample - An example of the representation. 10334 Sample *string `json:"sample,omitempty"` 10335 // SchemaID - Schema identifier. Applicable only if 'contentType' value is neither 'application/x-www-form-urlencoded' nor 'multipart/form-data'. 10336 SchemaID *string `json:"schemaId,omitempty"` 10337 // TypeName - Type name defined by the schema. Applicable only if 'contentType' value is neither 'application/x-www-form-urlencoded' nor 'multipart/form-data'. 10338 TypeName *string `json:"typeName,omitempty"` 10339 // FormParameters - Collection of form parameters. Required if 'contentType' value is either 'application/x-www-form-urlencoded' or 'multipart/form-data'.. 10340 FormParameters *[]ParameterContract `json:"formParameters,omitempty"` 10341} 10342 10343// RequestContract operation request details. 10344type RequestContract struct { 10345 // Description - Operation request description. 10346 Description *string `json:"description,omitempty"` 10347 // QueryParameters - Collection of operation request query parameters. 10348 QueryParameters *[]ParameterContract `json:"queryParameters,omitempty"` 10349 // Headers - Collection of operation request headers. 10350 Headers *[]ParameterContract `json:"headers,omitempty"` 10351 // Representations - Collection of operation request representations. 10352 Representations *[]RepresentationContract `json:"representations,omitempty"` 10353} 10354 10355// RequestReportCollection paged Report records list representation. 10356type RequestReportCollection struct { 10357 autorest.Response `json:"-"` 10358 // Value - Page values. 10359 Value *[]RequestReportRecordContract `json:"value,omitempty"` 10360 // Count - Total record count number across all pages. 10361 Count *int64 `json:"count,omitempty"` 10362} 10363 10364// RequestReportRecordContract request Report data. 10365type RequestReportRecordContract struct { 10366 // APIID - API identifier path. /apis/{apiId} 10367 APIID *string `json:"apiId,omitempty"` 10368 // OperationID - Operation identifier path. /apis/{apiId}/operations/{operationId} 10369 OperationID *string `json:"operationId,omitempty"` 10370 // ProductID - READ-ONLY; Product identifier path. /products/{productId} 10371 ProductID *string `json:"productId,omitempty"` 10372 // UserID - READ-ONLY; User identifier path. /users/{userId} 10373 UserID *string `json:"userId,omitempty"` 10374 // Method - The HTTP method associated with this request.. 10375 Method *string `json:"method,omitempty"` 10376 // URL - The full URL associated with this request. 10377 URL *string `json:"url,omitempty"` 10378 // IPAddress - The client IP address associated with this request. 10379 IPAddress *string `json:"ipAddress,omitempty"` 10380 // BackendResponseCode - The HTTP status code received by the gateway as a result of forwarding this request to the backend. 10381 BackendResponseCode *string `json:"backendResponseCode,omitempty"` 10382 // ResponseCode - The HTTP status code returned by the gateway. 10383 ResponseCode *int32 `json:"responseCode,omitempty"` 10384 // ResponseSize - The size of the response returned by the gateway. 10385 ResponseSize *int32 `json:"responseSize,omitempty"` 10386 // Timestamp - The date and time when this request was received by the gateway in ISO 8601 format. 10387 Timestamp *date.Time `json:"timestamp,omitempty"` 10388 // 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. 10389 Cache *string `json:"cache,omitempty"` 10390 // APITime - The total time it took to process this request. 10391 APITime *float64 `json:"apiTime,omitempty"` 10392 // ServiceTime - he time it took to forward this request to the backend and get the response back. 10393 ServiceTime *float64 `json:"serviceTime,omitempty"` 10394 // APIRegion - Azure region where the gateway that processed this request is located. 10395 APIRegion *string `json:"apiRegion,omitempty"` 10396 // SubscriptionID - Subscription identifier path. /subscriptions/{subscriptionId} 10397 SubscriptionID *string `json:"subscriptionId,omitempty"` 10398 // RequestID - Request Identifier. 10399 RequestID *string `json:"requestId,omitempty"` 10400 // RequestSize - The size of this request.. 10401 RequestSize *int32 `json:"requestSize,omitempty"` 10402} 10403 10404// MarshalJSON is the custom marshaler for RequestReportRecordContract. 10405func (rrrc RequestReportRecordContract) MarshalJSON() ([]byte, error) { 10406 objectMap := make(map[string]interface{}) 10407 if rrrc.APIID != nil { 10408 objectMap["apiId"] = rrrc.APIID 10409 } 10410 if rrrc.OperationID != nil { 10411 objectMap["operationId"] = rrrc.OperationID 10412 } 10413 if rrrc.Method != nil { 10414 objectMap["method"] = rrrc.Method 10415 } 10416 if rrrc.URL != nil { 10417 objectMap["url"] = rrrc.URL 10418 } 10419 if rrrc.IPAddress != nil { 10420 objectMap["ipAddress"] = rrrc.IPAddress 10421 } 10422 if rrrc.BackendResponseCode != nil { 10423 objectMap["backendResponseCode"] = rrrc.BackendResponseCode 10424 } 10425 if rrrc.ResponseCode != nil { 10426 objectMap["responseCode"] = rrrc.ResponseCode 10427 } 10428 if rrrc.ResponseSize != nil { 10429 objectMap["responseSize"] = rrrc.ResponseSize 10430 } 10431 if rrrc.Timestamp != nil { 10432 objectMap["timestamp"] = rrrc.Timestamp 10433 } 10434 if rrrc.Cache != nil { 10435 objectMap["cache"] = rrrc.Cache 10436 } 10437 if rrrc.APITime != nil { 10438 objectMap["apiTime"] = rrrc.APITime 10439 } 10440 if rrrc.ServiceTime != nil { 10441 objectMap["serviceTime"] = rrrc.ServiceTime 10442 } 10443 if rrrc.APIRegion != nil { 10444 objectMap["apiRegion"] = rrrc.APIRegion 10445 } 10446 if rrrc.SubscriptionID != nil { 10447 objectMap["subscriptionId"] = rrrc.SubscriptionID 10448 } 10449 if rrrc.RequestID != nil { 10450 objectMap["requestId"] = rrrc.RequestID 10451 } 10452 if rrrc.RequestSize != nil { 10453 objectMap["requestSize"] = rrrc.RequestSize 10454 } 10455 return json.Marshal(objectMap) 10456} 10457 10458// Resource the Resource definition. 10459type Resource struct { 10460 // ID - READ-ONLY; Resource ID. 10461 ID *string `json:"id,omitempty"` 10462 // Name - READ-ONLY; Resource name. 10463 Name *string `json:"name,omitempty"` 10464 // Type - READ-ONLY; Resource type for API Management resource. 10465 Type *string `json:"type,omitempty"` 10466} 10467 10468// MarshalJSON is the custom marshaler for Resource. 10469func (r Resource) MarshalJSON() ([]byte, error) { 10470 objectMap := make(map[string]interface{}) 10471 return json.Marshal(objectMap) 10472} 10473 10474// ResourceLocationDataContract resource location data properties. 10475type ResourceLocationDataContract struct { 10476 // Name - A canonical name for the geographic or physical location. 10477 Name *string `json:"name,omitempty"` 10478 // City - The city or locality where the resource is located. 10479 City *string `json:"city,omitempty"` 10480 // District - The district, state, or province where the resource is located. 10481 District *string `json:"district,omitempty"` 10482 // CountryOrRegion - The country or region where the resource is located. 10483 CountryOrRegion *string `json:"countryOrRegion,omitempty"` 10484} 10485 10486// ResourceSku describes an available API Management SKU. 10487type ResourceSku struct { 10488 // Name - Name of the Sku. Possible values include: 'SkuTypeDeveloper', 'SkuTypeStandard', 'SkuTypePremium', 'SkuTypeBasic', 'SkuTypeConsumption' 10489 Name SkuType `json:"name,omitempty"` 10490} 10491 10492// ResourceSkuCapacity describes scaling information of a SKU. 10493type ResourceSkuCapacity struct { 10494 // Minimum - READ-ONLY; The minimum capacity. 10495 Minimum *int32 `json:"minimum,omitempty"` 10496 // Maximum - READ-ONLY; The maximum capacity that can be set. 10497 Maximum *int32 `json:"maximum,omitempty"` 10498 // Default - READ-ONLY; The default capacity. 10499 Default *int32 `json:"default,omitempty"` 10500 // ScaleType - READ-ONLY; The scale type applicable to the sku. Possible values include: 'ResourceSkuCapacityScaleTypeAutomatic', 'ResourceSkuCapacityScaleTypeManual', 'ResourceSkuCapacityScaleTypeNone' 10501 ScaleType ResourceSkuCapacityScaleType `json:"scaleType,omitempty"` 10502} 10503 10504// MarshalJSON is the custom marshaler for ResourceSkuCapacity. 10505func (rsc ResourceSkuCapacity) MarshalJSON() ([]byte, error) { 10506 objectMap := make(map[string]interface{}) 10507 return json.Marshal(objectMap) 10508} 10509 10510// ResourceSkuResult describes an available API Management service SKU. 10511type ResourceSkuResult struct { 10512 // ResourceType - READ-ONLY; The type of resource the SKU applies to. 10513 ResourceType *string `json:"resourceType,omitempty"` 10514 // Sku - READ-ONLY; Specifies API Management SKU. 10515 Sku *ResourceSku `json:"sku,omitempty"` 10516 // Capacity - READ-ONLY; Specifies the number of API Management units. 10517 Capacity *ResourceSkuCapacity `json:"capacity,omitempty"` 10518} 10519 10520// MarshalJSON is the custom marshaler for ResourceSkuResult. 10521func (rsr ResourceSkuResult) MarshalJSON() ([]byte, error) { 10522 objectMap := make(map[string]interface{}) 10523 return json.Marshal(objectMap) 10524} 10525 10526// ResourceSkuResults the API Management service SKUs operation response. 10527type ResourceSkuResults struct { 10528 autorest.Response `json:"-"` 10529 // Value - The list of skus available for the service. 10530 Value *[]ResourceSkuResult `json:"value,omitempty"` 10531 // NextLink - The uri to fetch the next page of API Management service Skus. 10532 NextLink *string `json:"nextLink,omitempty"` 10533} 10534 10535// ResourceSkuResultsIterator provides access to a complete listing of ResourceSkuResult values. 10536type ResourceSkuResultsIterator struct { 10537 i int 10538 page ResourceSkuResultsPage 10539} 10540 10541// NextWithContext advances to the next value. If there was an error making 10542// the request the iterator does not advance and the error is returned. 10543func (iter *ResourceSkuResultsIterator) NextWithContext(ctx context.Context) (err error) { 10544 if tracing.IsEnabled() { 10545 ctx = tracing.StartSpan(ctx, fqdn+"/ResourceSkuResultsIterator.NextWithContext") 10546 defer func() { 10547 sc := -1 10548 if iter.Response().Response.Response != nil { 10549 sc = iter.Response().Response.Response.StatusCode 10550 } 10551 tracing.EndSpan(ctx, sc, err) 10552 }() 10553 } 10554 iter.i++ 10555 if iter.i < len(iter.page.Values()) { 10556 return nil 10557 } 10558 err = iter.page.NextWithContext(ctx) 10559 if err != nil { 10560 iter.i-- 10561 return err 10562 } 10563 iter.i = 0 10564 return nil 10565} 10566 10567// Next advances to the next value. If there was an error making 10568// the request the iterator does not advance and the error is returned. 10569// Deprecated: Use NextWithContext() instead. 10570func (iter *ResourceSkuResultsIterator) Next() error { 10571 return iter.NextWithContext(context.Background()) 10572} 10573 10574// NotDone returns true if the enumeration should be started or is not yet complete. 10575func (iter ResourceSkuResultsIterator) NotDone() bool { 10576 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 10577} 10578 10579// Response returns the raw server response from the last page request. 10580func (iter ResourceSkuResultsIterator) Response() ResourceSkuResults { 10581 return iter.page.Response() 10582} 10583 10584// Value returns the current value or a zero-initialized value if the 10585// iterator has advanced beyond the end of the collection. 10586func (iter ResourceSkuResultsIterator) Value() ResourceSkuResult { 10587 if !iter.page.NotDone() { 10588 return ResourceSkuResult{} 10589 } 10590 return iter.page.Values()[iter.i] 10591} 10592 10593// Creates a new instance of the ResourceSkuResultsIterator type. 10594func NewResourceSkuResultsIterator(page ResourceSkuResultsPage) ResourceSkuResultsIterator { 10595 return ResourceSkuResultsIterator{page: page} 10596} 10597 10598// IsEmpty returns true if the ListResult contains no values. 10599func (rsr ResourceSkuResults) IsEmpty() bool { 10600 return rsr.Value == nil || len(*rsr.Value) == 0 10601} 10602 10603// hasNextLink returns true if the NextLink is not empty. 10604func (rsr ResourceSkuResults) hasNextLink() bool { 10605 return rsr.NextLink != nil && len(*rsr.NextLink) != 0 10606} 10607 10608// resourceSkuResultsPreparer prepares a request to retrieve the next set of results. 10609// It returns nil if no more results exist. 10610func (rsr ResourceSkuResults) resourceSkuResultsPreparer(ctx context.Context) (*http.Request, error) { 10611 if !rsr.hasNextLink() { 10612 return nil, nil 10613 } 10614 return autorest.Prepare((&http.Request{}).WithContext(ctx), 10615 autorest.AsJSON(), 10616 autorest.AsGet(), 10617 autorest.WithBaseURL(to.String(rsr.NextLink))) 10618} 10619 10620// ResourceSkuResultsPage contains a page of ResourceSkuResult values. 10621type ResourceSkuResultsPage struct { 10622 fn func(context.Context, ResourceSkuResults) (ResourceSkuResults, error) 10623 rsr ResourceSkuResults 10624} 10625 10626// NextWithContext advances to the next page of values. If there was an error making 10627// the request the page does not advance and the error is returned. 10628func (page *ResourceSkuResultsPage) NextWithContext(ctx context.Context) (err error) { 10629 if tracing.IsEnabled() { 10630 ctx = tracing.StartSpan(ctx, fqdn+"/ResourceSkuResultsPage.NextWithContext") 10631 defer func() { 10632 sc := -1 10633 if page.Response().Response.Response != nil { 10634 sc = page.Response().Response.Response.StatusCode 10635 } 10636 tracing.EndSpan(ctx, sc, err) 10637 }() 10638 } 10639 for { 10640 next, err := page.fn(ctx, page.rsr) 10641 if err != nil { 10642 return err 10643 } 10644 page.rsr = next 10645 if !next.hasNextLink() || !next.IsEmpty() { 10646 break 10647 } 10648 } 10649 return nil 10650} 10651 10652// Next advances to the next page of values. If there was an error making 10653// the request the page does not advance and the error is returned. 10654// Deprecated: Use NextWithContext() instead. 10655func (page *ResourceSkuResultsPage) Next() error { 10656 return page.NextWithContext(context.Background()) 10657} 10658 10659// NotDone returns true if the page enumeration should be started or is not yet complete. 10660func (page ResourceSkuResultsPage) NotDone() bool { 10661 return !page.rsr.IsEmpty() 10662} 10663 10664// Response returns the raw server response from the last page request. 10665func (page ResourceSkuResultsPage) Response() ResourceSkuResults { 10666 return page.rsr 10667} 10668 10669// Values returns the slice of values for the current page or nil if there are no values. 10670func (page ResourceSkuResultsPage) Values() []ResourceSkuResult { 10671 if page.rsr.IsEmpty() { 10672 return nil 10673 } 10674 return *page.rsr.Value 10675} 10676 10677// Creates a new instance of the ResourceSkuResultsPage type. 10678func NewResourceSkuResultsPage(cur ResourceSkuResults, getNextPage func(context.Context, ResourceSkuResults) (ResourceSkuResults, error)) ResourceSkuResultsPage { 10679 return ResourceSkuResultsPage{ 10680 fn: getNextPage, 10681 rsr: cur, 10682 } 10683} 10684 10685// ResponseContract operation response details. 10686type ResponseContract struct { 10687 // StatusCode - Operation response HTTP status code. 10688 StatusCode *int32 `json:"statusCode,omitempty"` 10689 // Description - Operation response description. 10690 Description *string `json:"description,omitempty"` 10691 // Representations - Collection of operation response representations. 10692 Representations *[]RepresentationContract `json:"representations,omitempty"` 10693 // Headers - Collection of operation response headers. 10694 Headers *[]ParameterContract `json:"headers,omitempty"` 10695} 10696 10697// SamplingSettings sampling settings for Diagnostic. 10698type SamplingSettings struct { 10699 // SamplingType - Sampling type. Possible values include: 'Fixed' 10700 SamplingType SamplingType `json:"samplingType,omitempty"` 10701 // Percentage - Rate of sampling for fixed-rate sampling. 10702 Percentage *float64 `json:"percentage,omitempty"` 10703} 10704 10705// SaveConfigurationParameter save Tenant Configuration Contract details. 10706type SaveConfigurationParameter struct { 10707 // SaveConfigurationParameterProperties - Properties of the Save Configuration Parameters. 10708 *SaveConfigurationParameterProperties `json:"properties,omitempty"` 10709} 10710 10711// MarshalJSON is the custom marshaler for SaveConfigurationParameter. 10712func (scp SaveConfigurationParameter) MarshalJSON() ([]byte, error) { 10713 objectMap := make(map[string]interface{}) 10714 if scp.SaveConfigurationParameterProperties != nil { 10715 objectMap["properties"] = scp.SaveConfigurationParameterProperties 10716 } 10717 return json.Marshal(objectMap) 10718} 10719 10720// UnmarshalJSON is the custom unmarshaler for SaveConfigurationParameter struct. 10721func (scp *SaveConfigurationParameter) UnmarshalJSON(body []byte) error { 10722 var m map[string]*json.RawMessage 10723 err := json.Unmarshal(body, &m) 10724 if err != nil { 10725 return err 10726 } 10727 for k, v := range m { 10728 switch k { 10729 case "properties": 10730 if v != nil { 10731 var saveConfigurationParameterProperties SaveConfigurationParameterProperties 10732 err = json.Unmarshal(*v, &saveConfigurationParameterProperties) 10733 if err != nil { 10734 return err 10735 } 10736 scp.SaveConfigurationParameterProperties = &saveConfigurationParameterProperties 10737 } 10738 } 10739 } 10740 10741 return nil 10742} 10743 10744// SaveConfigurationParameterProperties parameters supplied to the Save Tenant Configuration operation. 10745type SaveConfigurationParameterProperties struct { 10746 // Branch - The name of the Git branch in which to commit the current configuration snapshot. 10747 Branch *string `json:"branch,omitempty"` 10748 // 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. 10749 Force *bool `json:"force,omitempty"` 10750} 10751 10752// SchemaCollection the response of the list schema operation. 10753type SchemaCollection struct { 10754 autorest.Response `json:"-"` 10755 // Value - READ-ONLY; Api Schema Contract value. 10756 Value *[]SchemaContract `json:"value,omitempty"` 10757 // NextLink - READ-ONLY; Next page link if any. 10758 NextLink *string `json:"nextLink,omitempty"` 10759} 10760 10761// MarshalJSON is the custom marshaler for SchemaCollection. 10762func (sc SchemaCollection) MarshalJSON() ([]byte, error) { 10763 objectMap := make(map[string]interface{}) 10764 return json.Marshal(objectMap) 10765} 10766 10767// SchemaCollectionIterator provides access to a complete listing of SchemaContract values. 10768type SchemaCollectionIterator struct { 10769 i int 10770 page SchemaCollectionPage 10771} 10772 10773// NextWithContext advances to the next value. If there was an error making 10774// the request the iterator does not advance and the error is returned. 10775func (iter *SchemaCollectionIterator) NextWithContext(ctx context.Context) (err error) { 10776 if tracing.IsEnabled() { 10777 ctx = tracing.StartSpan(ctx, fqdn+"/SchemaCollectionIterator.NextWithContext") 10778 defer func() { 10779 sc := -1 10780 if iter.Response().Response.Response != nil { 10781 sc = iter.Response().Response.Response.StatusCode 10782 } 10783 tracing.EndSpan(ctx, sc, err) 10784 }() 10785 } 10786 iter.i++ 10787 if iter.i < len(iter.page.Values()) { 10788 return nil 10789 } 10790 err = iter.page.NextWithContext(ctx) 10791 if err != nil { 10792 iter.i-- 10793 return err 10794 } 10795 iter.i = 0 10796 return nil 10797} 10798 10799// Next advances to the next value. If there was an error making 10800// the request the iterator does not advance and the error is returned. 10801// Deprecated: Use NextWithContext() instead. 10802func (iter *SchemaCollectionIterator) Next() error { 10803 return iter.NextWithContext(context.Background()) 10804} 10805 10806// NotDone returns true if the enumeration should be started or is not yet complete. 10807func (iter SchemaCollectionIterator) NotDone() bool { 10808 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 10809} 10810 10811// Response returns the raw server response from the last page request. 10812func (iter SchemaCollectionIterator) Response() SchemaCollection { 10813 return iter.page.Response() 10814} 10815 10816// Value returns the current value or a zero-initialized value if the 10817// iterator has advanced beyond the end of the collection. 10818func (iter SchemaCollectionIterator) Value() SchemaContract { 10819 if !iter.page.NotDone() { 10820 return SchemaContract{} 10821 } 10822 return iter.page.Values()[iter.i] 10823} 10824 10825// Creates a new instance of the SchemaCollectionIterator type. 10826func NewSchemaCollectionIterator(page SchemaCollectionPage) SchemaCollectionIterator { 10827 return SchemaCollectionIterator{page: page} 10828} 10829 10830// IsEmpty returns true if the ListResult contains no values. 10831func (sc SchemaCollection) IsEmpty() bool { 10832 return sc.Value == nil || len(*sc.Value) == 0 10833} 10834 10835// hasNextLink returns true if the NextLink is not empty. 10836func (sc SchemaCollection) hasNextLink() bool { 10837 return sc.NextLink != nil && len(*sc.NextLink) != 0 10838} 10839 10840// schemaCollectionPreparer prepares a request to retrieve the next set of results. 10841// It returns nil if no more results exist. 10842func (sc SchemaCollection) schemaCollectionPreparer(ctx context.Context) (*http.Request, error) { 10843 if !sc.hasNextLink() { 10844 return nil, nil 10845 } 10846 return autorest.Prepare((&http.Request{}).WithContext(ctx), 10847 autorest.AsJSON(), 10848 autorest.AsGet(), 10849 autorest.WithBaseURL(to.String(sc.NextLink))) 10850} 10851 10852// SchemaCollectionPage contains a page of SchemaContract values. 10853type SchemaCollectionPage struct { 10854 fn func(context.Context, SchemaCollection) (SchemaCollection, error) 10855 sc SchemaCollection 10856} 10857 10858// NextWithContext advances to the next page of values. If there was an error making 10859// the request the page does not advance and the error is returned. 10860func (page *SchemaCollectionPage) NextWithContext(ctx context.Context) (err error) { 10861 if tracing.IsEnabled() { 10862 ctx = tracing.StartSpan(ctx, fqdn+"/SchemaCollectionPage.NextWithContext") 10863 defer func() { 10864 sc := -1 10865 if page.Response().Response.Response != nil { 10866 sc = page.Response().Response.Response.StatusCode 10867 } 10868 tracing.EndSpan(ctx, sc, err) 10869 }() 10870 } 10871 for { 10872 next, err := page.fn(ctx, page.sc) 10873 if err != nil { 10874 return err 10875 } 10876 page.sc = next 10877 if !next.hasNextLink() || !next.IsEmpty() { 10878 break 10879 } 10880 } 10881 return nil 10882} 10883 10884// Next advances to the next page of values. If there was an error making 10885// the request the page does not advance and the error is returned. 10886// Deprecated: Use NextWithContext() instead. 10887func (page *SchemaCollectionPage) Next() error { 10888 return page.NextWithContext(context.Background()) 10889} 10890 10891// NotDone returns true if the page enumeration should be started or is not yet complete. 10892func (page SchemaCollectionPage) NotDone() bool { 10893 return !page.sc.IsEmpty() 10894} 10895 10896// Response returns the raw server response from the last page request. 10897func (page SchemaCollectionPage) Response() SchemaCollection { 10898 return page.sc 10899} 10900 10901// Values returns the slice of values for the current page or nil if there are no values. 10902func (page SchemaCollectionPage) Values() []SchemaContract { 10903 if page.sc.IsEmpty() { 10904 return nil 10905 } 10906 return *page.sc.Value 10907} 10908 10909// Creates a new instance of the SchemaCollectionPage type. 10910func NewSchemaCollectionPage(cur SchemaCollection, getNextPage func(context.Context, SchemaCollection) (SchemaCollection, error)) SchemaCollectionPage { 10911 return SchemaCollectionPage{ 10912 fn: getNextPage, 10913 sc: cur, 10914 } 10915} 10916 10917// SchemaContract schema Contract details. 10918type SchemaContract struct { 10919 autorest.Response `json:"-"` 10920 // SchemaContractProperties - Properties of the Schema. 10921 *SchemaContractProperties `json:"properties,omitempty"` 10922 // ID - READ-ONLY; Resource ID. 10923 ID *string `json:"id,omitempty"` 10924 // Name - READ-ONLY; Resource name. 10925 Name *string `json:"name,omitempty"` 10926 // Type - READ-ONLY; Resource type for API Management resource. 10927 Type *string `json:"type,omitempty"` 10928} 10929 10930// MarshalJSON is the custom marshaler for SchemaContract. 10931func (sc SchemaContract) MarshalJSON() ([]byte, error) { 10932 objectMap := make(map[string]interface{}) 10933 if sc.SchemaContractProperties != nil { 10934 objectMap["properties"] = sc.SchemaContractProperties 10935 } 10936 return json.Marshal(objectMap) 10937} 10938 10939// UnmarshalJSON is the custom unmarshaler for SchemaContract struct. 10940func (sc *SchemaContract) UnmarshalJSON(body []byte) error { 10941 var m map[string]*json.RawMessage 10942 err := json.Unmarshal(body, &m) 10943 if err != nil { 10944 return err 10945 } 10946 for k, v := range m { 10947 switch k { 10948 case "properties": 10949 if v != nil { 10950 var schemaContractProperties SchemaContractProperties 10951 err = json.Unmarshal(*v, &schemaContractProperties) 10952 if err != nil { 10953 return err 10954 } 10955 sc.SchemaContractProperties = &schemaContractProperties 10956 } 10957 case "id": 10958 if v != nil { 10959 var ID string 10960 err = json.Unmarshal(*v, &ID) 10961 if err != nil { 10962 return err 10963 } 10964 sc.ID = &ID 10965 } 10966 case "name": 10967 if v != nil { 10968 var name string 10969 err = json.Unmarshal(*v, &name) 10970 if err != nil { 10971 return err 10972 } 10973 sc.Name = &name 10974 } 10975 case "type": 10976 if v != nil { 10977 var typeVar string 10978 err = json.Unmarshal(*v, &typeVar) 10979 if err != nil { 10980 return err 10981 } 10982 sc.Type = &typeVar 10983 } 10984 } 10985 } 10986 10987 return nil 10988} 10989 10990// SchemaContractProperties API Schema create or update contract Properties. 10991type SchemaContractProperties struct { 10992 // ContentType - Must be a valid a media type used in a Content-Type header as defined in the RFC 2616. Media type of the schema document (e.g. application/json, application/xml). </br> - `Swagger` Schema use `application/vnd.ms-azure-apim.swagger.definitions+json` </br> - `WSDL` Schema use `application/vnd.ms-azure-apim.xsd+xml` </br> - `OpenApi` Schema use `application/vnd.oai.openapi.components+json` </br> - `WADL Schema` use `application/vnd.ms-azure-apim.wadl.grammars+xml`. 10993 ContentType *string `json:"contentType,omitempty"` 10994 // SchemaDocumentProperties - Create or update Properties of the Schema Document. 10995 *SchemaDocumentProperties `json:"document,omitempty"` 10996} 10997 10998// MarshalJSON is the custom marshaler for SchemaContractProperties. 10999func (scp SchemaContractProperties) MarshalJSON() ([]byte, error) { 11000 objectMap := make(map[string]interface{}) 11001 if scp.ContentType != nil { 11002 objectMap["contentType"] = scp.ContentType 11003 } 11004 if scp.SchemaDocumentProperties != nil { 11005 objectMap["document"] = scp.SchemaDocumentProperties 11006 } 11007 return json.Marshal(objectMap) 11008} 11009 11010// UnmarshalJSON is the custom unmarshaler for SchemaContractProperties struct. 11011func (scp *SchemaContractProperties) UnmarshalJSON(body []byte) error { 11012 var m map[string]*json.RawMessage 11013 err := json.Unmarshal(body, &m) 11014 if err != nil { 11015 return err 11016 } 11017 for k, v := range m { 11018 switch k { 11019 case "contentType": 11020 if v != nil { 11021 var contentType string 11022 err = json.Unmarshal(*v, &contentType) 11023 if err != nil { 11024 return err 11025 } 11026 scp.ContentType = &contentType 11027 } 11028 case "document": 11029 if v != nil { 11030 var schemaDocumentProperties SchemaDocumentProperties 11031 err = json.Unmarshal(*v, &schemaDocumentProperties) 11032 if err != nil { 11033 return err 11034 } 11035 scp.SchemaDocumentProperties = &schemaDocumentProperties 11036 } 11037 } 11038 } 11039 11040 return nil 11041} 11042 11043// SchemaDocumentProperties schema Document Properties. 11044type SchemaDocumentProperties struct { 11045 // Value - Json escaped string defining the document representing the Schema. Used for schemas other than Swagger/OpenAPI. 11046 Value *string `json:"value,omitempty"` 11047 // Definitions - Types definitions. Used for Swagger/OpenAPI schemas only, null otherwise. 11048 Definitions interface{} `json:"definitions,omitempty"` 11049} 11050 11051// ServiceApplyNetworkConfigurationParameters parameter supplied to the Apply Network configuration 11052// operation. 11053type ServiceApplyNetworkConfigurationParameters struct { 11054 // 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. 11055 Location *string `json:"location,omitempty"` 11056} 11057 11058// ServiceApplyNetworkConfigurationUpdatesFuture an abstraction for monitoring and retrieving the results 11059// of a long-running operation. 11060type ServiceApplyNetworkConfigurationUpdatesFuture struct { 11061 azure.FutureAPI 11062 // Result returns the result of the asynchronous operation. 11063 // If the operation has not completed it will return an error. 11064 Result func(ServiceClient) (ServiceResource, error) 11065} 11066 11067// UnmarshalJSON is the custom unmarshaller for CreateFuture. 11068func (future *ServiceApplyNetworkConfigurationUpdatesFuture) UnmarshalJSON(body []byte) error { 11069 var azFuture azure.Future 11070 if err := json.Unmarshal(body, &azFuture); err != nil { 11071 return err 11072 } 11073 future.FutureAPI = &azFuture 11074 future.Result = future.result 11075 return nil 11076} 11077 11078// result is the default implementation for ServiceApplyNetworkConfigurationUpdatesFuture.Result. 11079func (future *ServiceApplyNetworkConfigurationUpdatesFuture) result(client ServiceClient) (sr ServiceResource, err error) { 11080 var done bool 11081 done, err = future.DoneWithContext(context.Background(), client) 11082 if err != nil { 11083 err = autorest.NewErrorWithError(err, "apimanagement.ServiceApplyNetworkConfigurationUpdatesFuture", "Result", future.Response(), "Polling failure") 11084 return 11085 } 11086 if !done { 11087 sr.Response.Response = future.Response() 11088 err = azure.NewAsyncOpIncompleteError("apimanagement.ServiceApplyNetworkConfigurationUpdatesFuture") 11089 return 11090 } 11091 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 11092 if sr.Response.Response, err = future.GetResult(sender); err == nil && sr.Response.Response.StatusCode != http.StatusNoContent { 11093 sr, err = client.ApplyNetworkConfigurationUpdatesResponder(sr.Response.Response) 11094 if err != nil { 11095 err = autorest.NewErrorWithError(err, "apimanagement.ServiceApplyNetworkConfigurationUpdatesFuture", "Result", sr.Response.Response, "Failure responding to request") 11096 } 11097 } 11098 return 11099} 11100 11101// ServiceBackupFuture an abstraction for monitoring and retrieving the results of a long-running 11102// operation. 11103type ServiceBackupFuture struct { 11104 azure.FutureAPI 11105 // Result returns the result of the asynchronous operation. 11106 // If the operation has not completed it will return an error. 11107 Result func(ServiceClient) (ServiceResource, error) 11108} 11109 11110// UnmarshalJSON is the custom unmarshaller for CreateFuture. 11111func (future *ServiceBackupFuture) UnmarshalJSON(body []byte) error { 11112 var azFuture azure.Future 11113 if err := json.Unmarshal(body, &azFuture); err != nil { 11114 return err 11115 } 11116 future.FutureAPI = &azFuture 11117 future.Result = future.result 11118 return nil 11119} 11120 11121// result is the default implementation for ServiceBackupFuture.Result. 11122func (future *ServiceBackupFuture) result(client ServiceClient) (sr ServiceResource, err error) { 11123 var done bool 11124 done, err = future.DoneWithContext(context.Background(), client) 11125 if err != nil { 11126 err = autorest.NewErrorWithError(err, "apimanagement.ServiceBackupFuture", "Result", future.Response(), "Polling failure") 11127 return 11128 } 11129 if !done { 11130 sr.Response.Response = future.Response() 11131 err = azure.NewAsyncOpIncompleteError("apimanagement.ServiceBackupFuture") 11132 return 11133 } 11134 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 11135 if sr.Response.Response, err = future.GetResult(sender); err == nil && sr.Response.Response.StatusCode != http.StatusNoContent { 11136 sr, err = client.BackupResponder(sr.Response.Response) 11137 if err != nil { 11138 err = autorest.NewErrorWithError(err, "apimanagement.ServiceBackupFuture", "Result", sr.Response.Response, "Failure responding to request") 11139 } 11140 } 11141 return 11142} 11143 11144// ServiceBackupRestoreParameters parameters supplied to the Backup/Restore of an API Management service 11145// operation. 11146type ServiceBackupRestoreParameters struct { 11147 // StorageAccount - Azure Cloud Storage account (used to place/retrieve the backup) name. 11148 StorageAccount *string `json:"storageAccount,omitempty"` 11149 // AccessKey - Azure Cloud Storage account (used to place/retrieve the backup) access key. 11150 AccessKey *string `json:"accessKey,omitempty"` 11151 // ContainerName - Azure Cloud Storage blob container name used to place/retrieve the backup. 11152 ContainerName *string `json:"containerName,omitempty"` 11153 // BackupName - The name of the backup file to create. 11154 BackupName *string `json:"backupName,omitempty"` 11155} 11156 11157// ServiceBaseProperties base Properties of an API Management service resource description. 11158type ServiceBaseProperties struct { 11159 // NotificationSenderEmail - Email address from which the notification will be sent. 11160 NotificationSenderEmail *string `json:"notificationSenderEmail,omitempty"` 11161 // 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. 11162 ProvisioningState *string `json:"provisioningState,omitempty"` 11163 // TargetProvisioningState - READ-ONLY; The provisioning state of the API Management service, which is targeted by the long running operation started on the service. 11164 TargetProvisioningState *string `json:"targetProvisioningState,omitempty"` 11165 // 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. 11166 CreatedAtUtc *date.Time `json:"createdAtUtc,omitempty"` 11167 // GatewayURL - READ-ONLY; Gateway URL of the API Management service. 11168 GatewayURL *string `json:"gatewayUrl,omitempty"` 11169 // GatewayRegionalURL - READ-ONLY; Gateway URL of the API Management service in the Default Region. 11170 GatewayRegionalURL *string `json:"gatewayRegionalUrl,omitempty"` 11171 // PortalURL - READ-ONLY; Publisher portal endpoint Url of the API Management service. 11172 PortalURL *string `json:"portalUrl,omitempty"` 11173 // ManagementAPIURL - READ-ONLY; Management API endpoint URL of the API Management service. 11174 ManagementAPIURL *string `json:"managementApiUrl,omitempty"` 11175 // ScmURL - READ-ONLY; SCM endpoint URL of the API Management service. 11176 ScmURL *string `json:"scmUrl,omitempty"` 11177 // DeveloperPortalURL - READ-ONLY; DEveloper Portal endpoint URL of the API Management service. 11178 DeveloperPortalURL *string `json:"developerPortalUrl,omitempty"` 11179 // HostnameConfigurations - Custom hostname configuration of the API Management service. 11180 HostnameConfigurations *[]HostnameConfiguration `json:"hostnameConfigurations,omitempty"` 11181 // 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. 11182 PublicIPAddresses *[]string `json:"publicIPAddresses,omitempty"` 11183 // 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. 11184 PrivateIPAddresses *[]string `json:"privateIPAddresses,omitempty"` 11185 // VirtualNetworkConfiguration - Virtual network configuration of the API Management service. 11186 VirtualNetworkConfiguration *VirtualNetworkConfiguration `json:"virtualNetworkConfiguration,omitempty"` 11187 // AdditionalLocations - Additional datacenter locations of the API Management service. 11188 AdditionalLocations *[]AdditionalLocation `json:"additionalLocations,omitempty"` 11189 // CustomProperties - Custom properties of the API Management service.</br>Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TripleDes168` will disable the cipher TLS_RSA_WITH_3DES_EDE_CBC_SHA for all TLS(1.0, 1.1 and 1.2).</br>Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls11` can be used to disable just TLS 1.1.</br>Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls10` can be used to disable TLS 1.0 on an API Management service.</br>Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls11` can be used to disable just TLS 1.1 for communications with backends.</br>Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls10` can be used to disable TLS 1.0 for communications with backends.</br>Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Protocols.Server.Http2` can be used to enable HTTP2 protocol on an API Management service.</br></br>Not specifying any of these properties on PATCH operation will reset omitted properties' values to their defaults. For all the settings except Http2 the default value is `True` if the service was created on or before April 1st 2018 and `False` otherwise. Http2 setting's default value is `False`.</br></br>You can disable any of next ciphers by using settings `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.[cipher_name]`:</br>TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA</br>TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA</br>TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA</br>TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA</br>TLS_RSA_WITH_AES_128_GCM_SHA256</br>TLS_RSA_WITH_AES_256_CBC_SHA256<br/>TLS_RSA_WITH_AES_128_CBC_SHA256<br/>TLS_RSA_WITH_AES_256_CBC_SHA<br/>TLS_RSA_WITH_AES_128_CBC_SHA.<br/><br/>For example: `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TLS_RSA_WITH_AES_128_CBC_SHA256`:`false`. The default value is `true` for all of them.<br/><br/>Note: next ciphers can't be disabled since they are required by Azure CloudService internal components:<br/>TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384<br/>TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256<br/>TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384<br/>TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256<br/>TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384<br/>TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256<br/>TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384<br/>TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256<br/>TLS_RSA_WITH_AES_256_GCM_SHA384 11190 CustomProperties map[string]*string `json:"customProperties"` 11191 // Certificates - List of Certificates that need to be installed in the API Management service. Max supported certificates that can be installed is 10. 11192 Certificates *[]CertificateConfiguration `json:"certificates,omitempty"` 11193 // EnableClientCertificate - Property only meant to be used for Consumption SKU Service. This enforces a client certificate to be presented on each request to the gateway. This also enables the ability to authenticate the certificate in the policy on the gateway. 11194 EnableClientCertificate *bool `json:"enableClientCertificate,omitempty"` 11195 // DisableGateway - Property only valid for an Api Management service deployed in multiple locations. This can be used to disable the gateway in master region. 11196 DisableGateway *bool `json:"disableGateway,omitempty"` 11197 // 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' 11198 VirtualNetworkType VirtualNetworkType `json:"virtualNetworkType,omitempty"` 11199 // APIVersionConstraint - Control Plane Apis version constraint for the API Management service. 11200 APIVersionConstraint *APIVersionConstraint `json:"apiVersionConstraint,omitempty"` 11201} 11202 11203// MarshalJSON is the custom marshaler for ServiceBaseProperties. 11204func (sbp ServiceBaseProperties) MarshalJSON() ([]byte, error) { 11205 objectMap := make(map[string]interface{}) 11206 if sbp.NotificationSenderEmail != nil { 11207 objectMap["notificationSenderEmail"] = sbp.NotificationSenderEmail 11208 } 11209 if sbp.HostnameConfigurations != nil { 11210 objectMap["hostnameConfigurations"] = sbp.HostnameConfigurations 11211 } 11212 if sbp.VirtualNetworkConfiguration != nil { 11213 objectMap["virtualNetworkConfiguration"] = sbp.VirtualNetworkConfiguration 11214 } 11215 if sbp.AdditionalLocations != nil { 11216 objectMap["additionalLocations"] = sbp.AdditionalLocations 11217 } 11218 if sbp.CustomProperties != nil { 11219 objectMap["customProperties"] = sbp.CustomProperties 11220 } 11221 if sbp.Certificates != nil { 11222 objectMap["certificates"] = sbp.Certificates 11223 } 11224 if sbp.EnableClientCertificate != nil { 11225 objectMap["enableClientCertificate"] = sbp.EnableClientCertificate 11226 } 11227 if sbp.DisableGateway != nil { 11228 objectMap["disableGateway"] = sbp.DisableGateway 11229 } 11230 if sbp.VirtualNetworkType != "" { 11231 objectMap["virtualNetworkType"] = sbp.VirtualNetworkType 11232 } 11233 if sbp.APIVersionConstraint != nil { 11234 objectMap["apiVersionConstraint"] = sbp.APIVersionConstraint 11235 } 11236 return json.Marshal(objectMap) 11237} 11238 11239// ServiceCheckNameAvailabilityParameters parameters supplied to the CheckNameAvailability operation. 11240type ServiceCheckNameAvailabilityParameters struct { 11241 // Name - The name to check for availability. 11242 Name *string `json:"name,omitempty"` 11243} 11244 11245// ServiceCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 11246// operation. 11247type ServiceCreateOrUpdateFuture struct { 11248 azure.FutureAPI 11249 // Result returns the result of the asynchronous operation. 11250 // If the operation has not completed it will return an error. 11251 Result func(ServiceClient) (ServiceResource, error) 11252} 11253 11254// UnmarshalJSON is the custom unmarshaller for CreateFuture. 11255func (future *ServiceCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 11256 var azFuture azure.Future 11257 if err := json.Unmarshal(body, &azFuture); err != nil { 11258 return err 11259 } 11260 future.FutureAPI = &azFuture 11261 future.Result = future.result 11262 return nil 11263} 11264 11265// result is the default implementation for ServiceCreateOrUpdateFuture.Result. 11266func (future *ServiceCreateOrUpdateFuture) result(client ServiceClient) (sr ServiceResource, err error) { 11267 var done bool 11268 done, err = future.DoneWithContext(context.Background(), client) 11269 if err != nil { 11270 err = autorest.NewErrorWithError(err, "apimanagement.ServiceCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 11271 return 11272 } 11273 if !done { 11274 sr.Response.Response = future.Response() 11275 err = azure.NewAsyncOpIncompleteError("apimanagement.ServiceCreateOrUpdateFuture") 11276 return 11277 } 11278 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 11279 if sr.Response.Response, err = future.GetResult(sender); err == nil && sr.Response.Response.StatusCode != http.StatusNoContent { 11280 sr, err = client.CreateOrUpdateResponder(sr.Response.Response) 11281 if err != nil { 11282 err = autorest.NewErrorWithError(err, "apimanagement.ServiceCreateOrUpdateFuture", "Result", sr.Response.Response, "Failure responding to request") 11283 } 11284 } 11285 return 11286} 11287 11288// ServiceDeleteFuture an abstraction for monitoring and retrieving the results of a long-running 11289// operation. 11290type ServiceDeleteFuture struct { 11291 azure.FutureAPI 11292 // Result returns the result of the asynchronous operation. 11293 // If the operation has not completed it will return an error. 11294 Result func(ServiceClient) (ServiceResource, error) 11295} 11296 11297// UnmarshalJSON is the custom unmarshaller for CreateFuture. 11298func (future *ServiceDeleteFuture) UnmarshalJSON(body []byte) error { 11299 var azFuture azure.Future 11300 if err := json.Unmarshal(body, &azFuture); err != nil { 11301 return err 11302 } 11303 future.FutureAPI = &azFuture 11304 future.Result = future.result 11305 return nil 11306} 11307 11308// result is the default implementation for ServiceDeleteFuture.Result. 11309func (future *ServiceDeleteFuture) result(client ServiceClient) (sr ServiceResource, err error) { 11310 var done bool 11311 done, err = future.DoneWithContext(context.Background(), client) 11312 if err != nil { 11313 err = autorest.NewErrorWithError(err, "apimanagement.ServiceDeleteFuture", "Result", future.Response(), "Polling failure") 11314 return 11315 } 11316 if !done { 11317 sr.Response.Response = future.Response() 11318 err = azure.NewAsyncOpIncompleteError("apimanagement.ServiceDeleteFuture") 11319 return 11320 } 11321 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 11322 if sr.Response.Response, err = future.GetResult(sender); err == nil && sr.Response.Response.StatusCode != http.StatusNoContent { 11323 sr, err = client.DeleteResponder(sr.Response.Response) 11324 if err != nil { 11325 err = autorest.NewErrorWithError(err, "apimanagement.ServiceDeleteFuture", "Result", sr.Response.Response, "Failure responding to request") 11326 } 11327 } 11328 return 11329} 11330 11331// ServiceGetSsoTokenResult the response of the GetSsoToken operation. 11332type ServiceGetSsoTokenResult struct { 11333 autorest.Response `json:"-"` 11334 // RedirectURI - Redirect URL to the Publisher Portal containing the SSO token. 11335 RedirectURI *string `json:"redirectUri,omitempty"` 11336} 11337 11338// ServiceIdentity identity properties of the Api Management service resource. 11339type ServiceIdentity struct { 11340 // Type - The type of identity used for the resource. The type 'SystemAssigned, UserAssigned' includes both an implicitly created identity and a set of user assigned identities. The type 'None' will remove any identities from the service. Possible values include: 'SystemAssigned', 'UserAssigned', 'SystemAssignedUserAssigned', 'None' 11341 Type ApimIdentityType `json:"type,omitempty"` 11342 // PrincipalID - READ-ONLY; The principal id of the identity. 11343 PrincipalID *uuid.UUID `json:"principalId,omitempty"` 11344 // TenantID - READ-ONLY; The client tenant id of the identity. 11345 TenantID *uuid.UUID `json:"tenantId,omitempty"` 11346 // UserAssignedIdentities - The list of user identities associated with the resource. The user identity 11347 // dictionary key references will be ARM resource ids in the form: 11348 // '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/ 11349 // providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. 11350 UserAssignedIdentities map[string]*UserIdentityProperties `json:"userAssignedIdentities"` 11351} 11352 11353// MarshalJSON is the custom marshaler for ServiceIdentity. 11354func (si ServiceIdentity) MarshalJSON() ([]byte, error) { 11355 objectMap := make(map[string]interface{}) 11356 if si.Type != "" { 11357 objectMap["type"] = si.Type 11358 } 11359 if si.UserAssignedIdentities != nil { 11360 objectMap["userAssignedIdentities"] = si.UserAssignedIdentities 11361 } 11362 return json.Marshal(objectMap) 11363} 11364 11365// ServiceListResult the response of the List API Management services operation. 11366type ServiceListResult struct { 11367 autorest.Response `json:"-"` 11368 // Value - Result of the List API Management services operation. 11369 Value *[]ServiceResource `json:"value,omitempty"` 11370 // NextLink - Link to the next set of results. Not empty if Value contains incomplete list of API Management services. 11371 NextLink *string `json:"nextLink,omitempty"` 11372} 11373 11374// ServiceListResultIterator provides access to a complete listing of ServiceResource values. 11375type ServiceListResultIterator struct { 11376 i int 11377 page ServiceListResultPage 11378} 11379 11380// NextWithContext advances to the next value. If there was an error making 11381// the request the iterator does not advance and the error is returned. 11382func (iter *ServiceListResultIterator) NextWithContext(ctx context.Context) (err error) { 11383 if tracing.IsEnabled() { 11384 ctx = tracing.StartSpan(ctx, fqdn+"/ServiceListResultIterator.NextWithContext") 11385 defer func() { 11386 sc := -1 11387 if iter.Response().Response.Response != nil { 11388 sc = iter.Response().Response.Response.StatusCode 11389 } 11390 tracing.EndSpan(ctx, sc, err) 11391 }() 11392 } 11393 iter.i++ 11394 if iter.i < len(iter.page.Values()) { 11395 return nil 11396 } 11397 err = iter.page.NextWithContext(ctx) 11398 if err != nil { 11399 iter.i-- 11400 return err 11401 } 11402 iter.i = 0 11403 return nil 11404} 11405 11406// Next advances to the next value. If there was an error making 11407// the request the iterator does not advance and the error is returned. 11408// Deprecated: Use NextWithContext() instead. 11409func (iter *ServiceListResultIterator) Next() error { 11410 return iter.NextWithContext(context.Background()) 11411} 11412 11413// NotDone returns true if the enumeration should be started or is not yet complete. 11414func (iter ServiceListResultIterator) NotDone() bool { 11415 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 11416} 11417 11418// Response returns the raw server response from the last page request. 11419func (iter ServiceListResultIterator) Response() ServiceListResult { 11420 return iter.page.Response() 11421} 11422 11423// Value returns the current value or a zero-initialized value if the 11424// iterator has advanced beyond the end of the collection. 11425func (iter ServiceListResultIterator) Value() ServiceResource { 11426 if !iter.page.NotDone() { 11427 return ServiceResource{} 11428 } 11429 return iter.page.Values()[iter.i] 11430} 11431 11432// Creates a new instance of the ServiceListResultIterator type. 11433func NewServiceListResultIterator(page ServiceListResultPage) ServiceListResultIterator { 11434 return ServiceListResultIterator{page: page} 11435} 11436 11437// IsEmpty returns true if the ListResult contains no values. 11438func (slr ServiceListResult) IsEmpty() bool { 11439 return slr.Value == nil || len(*slr.Value) == 0 11440} 11441 11442// hasNextLink returns true if the NextLink is not empty. 11443func (slr ServiceListResult) hasNextLink() bool { 11444 return slr.NextLink != nil && len(*slr.NextLink) != 0 11445} 11446 11447// serviceListResultPreparer prepares a request to retrieve the next set of results. 11448// It returns nil if no more results exist. 11449func (slr ServiceListResult) serviceListResultPreparer(ctx context.Context) (*http.Request, error) { 11450 if !slr.hasNextLink() { 11451 return nil, nil 11452 } 11453 return autorest.Prepare((&http.Request{}).WithContext(ctx), 11454 autorest.AsJSON(), 11455 autorest.AsGet(), 11456 autorest.WithBaseURL(to.String(slr.NextLink))) 11457} 11458 11459// ServiceListResultPage contains a page of ServiceResource values. 11460type ServiceListResultPage struct { 11461 fn func(context.Context, ServiceListResult) (ServiceListResult, error) 11462 slr ServiceListResult 11463} 11464 11465// NextWithContext advances to the next page of values. If there was an error making 11466// the request the page does not advance and the error is returned. 11467func (page *ServiceListResultPage) NextWithContext(ctx context.Context) (err error) { 11468 if tracing.IsEnabled() { 11469 ctx = tracing.StartSpan(ctx, fqdn+"/ServiceListResultPage.NextWithContext") 11470 defer func() { 11471 sc := -1 11472 if page.Response().Response.Response != nil { 11473 sc = page.Response().Response.Response.StatusCode 11474 } 11475 tracing.EndSpan(ctx, sc, err) 11476 }() 11477 } 11478 for { 11479 next, err := page.fn(ctx, page.slr) 11480 if err != nil { 11481 return err 11482 } 11483 page.slr = next 11484 if !next.hasNextLink() || !next.IsEmpty() { 11485 break 11486 } 11487 } 11488 return nil 11489} 11490 11491// Next advances to the next page of values. If there was an error making 11492// the request the page does not advance and the error is returned. 11493// Deprecated: Use NextWithContext() instead. 11494func (page *ServiceListResultPage) Next() error { 11495 return page.NextWithContext(context.Background()) 11496} 11497 11498// NotDone returns true if the page enumeration should be started or is not yet complete. 11499func (page ServiceListResultPage) NotDone() bool { 11500 return !page.slr.IsEmpty() 11501} 11502 11503// Response returns the raw server response from the last page request. 11504func (page ServiceListResultPage) Response() ServiceListResult { 11505 return page.slr 11506} 11507 11508// Values returns the slice of values for the current page or nil if there are no values. 11509func (page ServiceListResultPage) Values() []ServiceResource { 11510 if page.slr.IsEmpty() { 11511 return nil 11512 } 11513 return *page.slr.Value 11514} 11515 11516// Creates a new instance of the ServiceListResultPage type. 11517func NewServiceListResultPage(cur ServiceListResult, getNextPage func(context.Context, ServiceListResult) (ServiceListResult, error)) ServiceListResultPage { 11518 return ServiceListResultPage{ 11519 fn: getNextPage, 11520 slr: cur, 11521 } 11522} 11523 11524// ServiceNameAvailabilityResult response of the CheckNameAvailability operation. 11525type ServiceNameAvailabilityResult struct { 11526 autorest.Response `json:"-"` 11527 // NameAvailable - READ-ONLY; True if the name is available and can be used to create a new API Management service; otherwise false. 11528 NameAvailable *bool `json:"nameAvailable,omitempty"` 11529 // 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. 11530 Message *string `json:"message,omitempty"` 11531 // 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' 11532 Reason NameAvailabilityReason `json:"reason,omitempty"` 11533} 11534 11535// MarshalJSON is the custom marshaler for ServiceNameAvailabilityResult. 11536func (snar ServiceNameAvailabilityResult) MarshalJSON() ([]byte, error) { 11537 objectMap := make(map[string]interface{}) 11538 if snar.Reason != "" { 11539 objectMap["reason"] = snar.Reason 11540 } 11541 return json.Marshal(objectMap) 11542} 11543 11544// ServiceProperties properties of an API Management service resource description. 11545type ServiceProperties struct { 11546 // PublisherEmail - Publisher email. 11547 PublisherEmail *string `json:"publisherEmail,omitempty"` 11548 // PublisherName - Publisher name. 11549 PublisherName *string `json:"publisherName,omitempty"` 11550 // NotificationSenderEmail - Email address from which the notification will be sent. 11551 NotificationSenderEmail *string `json:"notificationSenderEmail,omitempty"` 11552 // 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. 11553 ProvisioningState *string `json:"provisioningState,omitempty"` 11554 // TargetProvisioningState - READ-ONLY; The provisioning state of the API Management service, which is targeted by the long running operation started on the service. 11555 TargetProvisioningState *string `json:"targetProvisioningState,omitempty"` 11556 // 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. 11557 CreatedAtUtc *date.Time `json:"createdAtUtc,omitempty"` 11558 // GatewayURL - READ-ONLY; Gateway URL of the API Management service. 11559 GatewayURL *string `json:"gatewayUrl,omitempty"` 11560 // GatewayRegionalURL - READ-ONLY; Gateway URL of the API Management service in the Default Region. 11561 GatewayRegionalURL *string `json:"gatewayRegionalUrl,omitempty"` 11562 // PortalURL - READ-ONLY; Publisher portal endpoint Url of the API Management service. 11563 PortalURL *string `json:"portalUrl,omitempty"` 11564 // ManagementAPIURL - READ-ONLY; Management API endpoint URL of the API Management service. 11565 ManagementAPIURL *string `json:"managementApiUrl,omitempty"` 11566 // ScmURL - READ-ONLY; SCM endpoint URL of the API Management service. 11567 ScmURL *string `json:"scmUrl,omitempty"` 11568 // DeveloperPortalURL - READ-ONLY; DEveloper Portal endpoint URL of the API Management service. 11569 DeveloperPortalURL *string `json:"developerPortalUrl,omitempty"` 11570 // HostnameConfigurations - Custom hostname configuration of the API Management service. 11571 HostnameConfigurations *[]HostnameConfiguration `json:"hostnameConfigurations,omitempty"` 11572 // 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. 11573 PublicIPAddresses *[]string `json:"publicIPAddresses,omitempty"` 11574 // 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. 11575 PrivateIPAddresses *[]string `json:"privateIPAddresses,omitempty"` 11576 // VirtualNetworkConfiguration - Virtual network configuration of the API Management service. 11577 VirtualNetworkConfiguration *VirtualNetworkConfiguration `json:"virtualNetworkConfiguration,omitempty"` 11578 // AdditionalLocations - Additional datacenter locations of the API Management service. 11579 AdditionalLocations *[]AdditionalLocation `json:"additionalLocations,omitempty"` 11580 // CustomProperties - Custom properties of the API Management service.</br>Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TripleDes168` will disable the cipher TLS_RSA_WITH_3DES_EDE_CBC_SHA for all TLS(1.0, 1.1 and 1.2).</br>Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls11` can be used to disable just TLS 1.1.</br>Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls10` can be used to disable TLS 1.0 on an API Management service.</br>Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls11` can be used to disable just TLS 1.1 for communications with backends.</br>Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls10` can be used to disable TLS 1.0 for communications with backends.</br>Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Protocols.Server.Http2` can be used to enable HTTP2 protocol on an API Management service.</br></br>Not specifying any of these properties on PATCH operation will reset omitted properties' values to their defaults. For all the settings except Http2 the default value is `True` if the service was created on or before April 1st 2018 and `False` otherwise. Http2 setting's default value is `False`.</br></br>You can disable any of next ciphers by using settings `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.[cipher_name]`:</br>TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA</br>TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA</br>TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA</br>TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA</br>TLS_RSA_WITH_AES_128_GCM_SHA256</br>TLS_RSA_WITH_AES_256_CBC_SHA256<br/>TLS_RSA_WITH_AES_128_CBC_SHA256<br/>TLS_RSA_WITH_AES_256_CBC_SHA<br/>TLS_RSA_WITH_AES_128_CBC_SHA.<br/><br/>For example: `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TLS_RSA_WITH_AES_128_CBC_SHA256`:`false`. The default value is `true` for all of them.<br/><br/>Note: next ciphers can't be disabled since they are required by Azure CloudService internal components:<br/>TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384<br/>TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256<br/>TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384<br/>TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256<br/>TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384<br/>TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256<br/>TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384<br/>TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256<br/>TLS_RSA_WITH_AES_256_GCM_SHA384 11581 CustomProperties map[string]*string `json:"customProperties"` 11582 // Certificates - List of Certificates that need to be installed in the API Management service. Max supported certificates that can be installed is 10. 11583 Certificates *[]CertificateConfiguration `json:"certificates,omitempty"` 11584 // EnableClientCertificate - Property only meant to be used for Consumption SKU Service. This enforces a client certificate to be presented on each request to the gateway. This also enables the ability to authenticate the certificate in the policy on the gateway. 11585 EnableClientCertificate *bool `json:"enableClientCertificate,omitempty"` 11586 // DisableGateway - Property only valid for an Api Management service deployed in multiple locations. This can be used to disable the gateway in master region. 11587 DisableGateway *bool `json:"disableGateway,omitempty"` 11588 // 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' 11589 VirtualNetworkType VirtualNetworkType `json:"virtualNetworkType,omitempty"` 11590 // APIVersionConstraint - Control Plane Apis version constraint for the API Management service. 11591 APIVersionConstraint *APIVersionConstraint `json:"apiVersionConstraint,omitempty"` 11592} 11593 11594// MarshalJSON is the custom marshaler for ServiceProperties. 11595func (sp ServiceProperties) MarshalJSON() ([]byte, error) { 11596 objectMap := make(map[string]interface{}) 11597 if sp.PublisherEmail != nil { 11598 objectMap["publisherEmail"] = sp.PublisherEmail 11599 } 11600 if sp.PublisherName != nil { 11601 objectMap["publisherName"] = sp.PublisherName 11602 } 11603 if sp.NotificationSenderEmail != nil { 11604 objectMap["notificationSenderEmail"] = sp.NotificationSenderEmail 11605 } 11606 if sp.HostnameConfigurations != nil { 11607 objectMap["hostnameConfigurations"] = sp.HostnameConfigurations 11608 } 11609 if sp.VirtualNetworkConfiguration != nil { 11610 objectMap["virtualNetworkConfiguration"] = sp.VirtualNetworkConfiguration 11611 } 11612 if sp.AdditionalLocations != nil { 11613 objectMap["additionalLocations"] = sp.AdditionalLocations 11614 } 11615 if sp.CustomProperties != nil { 11616 objectMap["customProperties"] = sp.CustomProperties 11617 } 11618 if sp.Certificates != nil { 11619 objectMap["certificates"] = sp.Certificates 11620 } 11621 if sp.EnableClientCertificate != nil { 11622 objectMap["enableClientCertificate"] = sp.EnableClientCertificate 11623 } 11624 if sp.DisableGateway != nil { 11625 objectMap["disableGateway"] = sp.DisableGateway 11626 } 11627 if sp.VirtualNetworkType != "" { 11628 objectMap["virtualNetworkType"] = sp.VirtualNetworkType 11629 } 11630 if sp.APIVersionConstraint != nil { 11631 objectMap["apiVersionConstraint"] = sp.APIVersionConstraint 11632 } 11633 return json.Marshal(objectMap) 11634} 11635 11636// ServiceResource a single API Management service resource in List or Get response. 11637type ServiceResource struct { 11638 autorest.Response `json:"-"` 11639 // ServiceProperties - Properties of the API Management service. 11640 *ServiceProperties `json:"properties,omitempty"` 11641 // Sku - SKU properties of the API Management service. 11642 Sku *ServiceSkuProperties `json:"sku,omitempty"` 11643 // Identity - Managed service identity of the Api Management service. 11644 Identity *ServiceIdentity `json:"identity,omitempty"` 11645 // Location - Resource location. 11646 Location *string `json:"location,omitempty"` 11647 // Etag - READ-ONLY; ETag of the resource. 11648 Etag *string `json:"etag,omitempty"` 11649 // ID - READ-ONLY; Resource ID. 11650 ID *string `json:"id,omitempty"` 11651 // Name - READ-ONLY; Resource name. 11652 Name *string `json:"name,omitempty"` 11653 // Type - READ-ONLY; Resource type for API Management resource is set to Microsoft.ApiManagement. 11654 Type *string `json:"type,omitempty"` 11655 // Tags - Resource tags. 11656 Tags map[string]*string `json:"tags"` 11657} 11658 11659// MarshalJSON is the custom marshaler for ServiceResource. 11660func (sr ServiceResource) MarshalJSON() ([]byte, error) { 11661 objectMap := make(map[string]interface{}) 11662 if sr.ServiceProperties != nil { 11663 objectMap["properties"] = sr.ServiceProperties 11664 } 11665 if sr.Sku != nil { 11666 objectMap["sku"] = sr.Sku 11667 } 11668 if sr.Identity != nil { 11669 objectMap["identity"] = sr.Identity 11670 } 11671 if sr.Location != nil { 11672 objectMap["location"] = sr.Location 11673 } 11674 if sr.Tags != nil { 11675 objectMap["tags"] = sr.Tags 11676 } 11677 return json.Marshal(objectMap) 11678} 11679 11680// UnmarshalJSON is the custom unmarshaler for ServiceResource struct. 11681func (sr *ServiceResource) UnmarshalJSON(body []byte) error { 11682 var m map[string]*json.RawMessage 11683 err := json.Unmarshal(body, &m) 11684 if err != nil { 11685 return err 11686 } 11687 for k, v := range m { 11688 switch k { 11689 case "properties": 11690 if v != nil { 11691 var serviceProperties ServiceProperties 11692 err = json.Unmarshal(*v, &serviceProperties) 11693 if err != nil { 11694 return err 11695 } 11696 sr.ServiceProperties = &serviceProperties 11697 } 11698 case "sku": 11699 if v != nil { 11700 var sku ServiceSkuProperties 11701 err = json.Unmarshal(*v, &sku) 11702 if err != nil { 11703 return err 11704 } 11705 sr.Sku = &sku 11706 } 11707 case "identity": 11708 if v != nil { 11709 var identity ServiceIdentity 11710 err = json.Unmarshal(*v, &identity) 11711 if err != nil { 11712 return err 11713 } 11714 sr.Identity = &identity 11715 } 11716 case "location": 11717 if v != nil { 11718 var location string 11719 err = json.Unmarshal(*v, &location) 11720 if err != nil { 11721 return err 11722 } 11723 sr.Location = &location 11724 } 11725 case "etag": 11726 if v != nil { 11727 var etag string 11728 err = json.Unmarshal(*v, &etag) 11729 if err != nil { 11730 return err 11731 } 11732 sr.Etag = &etag 11733 } 11734 case "id": 11735 if v != nil { 11736 var ID string 11737 err = json.Unmarshal(*v, &ID) 11738 if err != nil { 11739 return err 11740 } 11741 sr.ID = &ID 11742 } 11743 case "name": 11744 if v != nil { 11745 var name string 11746 err = json.Unmarshal(*v, &name) 11747 if err != nil { 11748 return err 11749 } 11750 sr.Name = &name 11751 } 11752 case "type": 11753 if v != nil { 11754 var typeVar string 11755 err = json.Unmarshal(*v, &typeVar) 11756 if err != nil { 11757 return err 11758 } 11759 sr.Type = &typeVar 11760 } 11761 case "tags": 11762 if v != nil { 11763 var tags map[string]*string 11764 err = json.Unmarshal(*v, &tags) 11765 if err != nil { 11766 return err 11767 } 11768 sr.Tags = tags 11769 } 11770 } 11771 } 11772 11773 return nil 11774} 11775 11776// ServiceRestoreFuture an abstraction for monitoring and retrieving the results of a long-running 11777// operation. 11778type ServiceRestoreFuture struct { 11779 azure.FutureAPI 11780 // Result returns the result of the asynchronous operation. 11781 // If the operation has not completed it will return an error. 11782 Result func(ServiceClient) (ServiceResource, error) 11783} 11784 11785// UnmarshalJSON is the custom unmarshaller for CreateFuture. 11786func (future *ServiceRestoreFuture) UnmarshalJSON(body []byte) error { 11787 var azFuture azure.Future 11788 if err := json.Unmarshal(body, &azFuture); err != nil { 11789 return err 11790 } 11791 future.FutureAPI = &azFuture 11792 future.Result = future.result 11793 return nil 11794} 11795 11796// result is the default implementation for ServiceRestoreFuture.Result. 11797func (future *ServiceRestoreFuture) result(client ServiceClient) (sr ServiceResource, err error) { 11798 var done bool 11799 done, err = future.DoneWithContext(context.Background(), client) 11800 if err != nil { 11801 err = autorest.NewErrorWithError(err, "apimanagement.ServiceRestoreFuture", "Result", future.Response(), "Polling failure") 11802 return 11803 } 11804 if !done { 11805 sr.Response.Response = future.Response() 11806 err = azure.NewAsyncOpIncompleteError("apimanagement.ServiceRestoreFuture") 11807 return 11808 } 11809 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 11810 if sr.Response.Response, err = future.GetResult(sender); err == nil && sr.Response.Response.StatusCode != http.StatusNoContent { 11811 sr, err = client.RestoreResponder(sr.Response.Response) 11812 if err != nil { 11813 err = autorest.NewErrorWithError(err, "apimanagement.ServiceRestoreFuture", "Result", sr.Response.Response, "Failure responding to request") 11814 } 11815 } 11816 return 11817} 11818 11819// ServiceSkuProperties API Management service resource SKU properties. 11820type ServiceSkuProperties struct { 11821 // Name - Name of the Sku. Possible values include: 'SkuTypeDeveloper', 'SkuTypeStandard', 'SkuTypePremium', 'SkuTypeBasic', 'SkuTypeConsumption' 11822 Name SkuType `json:"name,omitempty"` 11823 // Capacity - Capacity of the SKU (number of deployed units of the SKU). For Consumption SKU capacity must be specified as 0. 11824 Capacity *int32 `json:"capacity,omitempty"` 11825} 11826 11827// ServiceUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 11828// operation. 11829type ServiceUpdateFuture struct { 11830 azure.FutureAPI 11831 // Result returns the result of the asynchronous operation. 11832 // If the operation has not completed it will return an error. 11833 Result func(ServiceClient) (ServiceResource, error) 11834} 11835 11836// UnmarshalJSON is the custom unmarshaller for CreateFuture. 11837func (future *ServiceUpdateFuture) UnmarshalJSON(body []byte) error { 11838 var azFuture azure.Future 11839 if err := json.Unmarshal(body, &azFuture); err != nil { 11840 return err 11841 } 11842 future.FutureAPI = &azFuture 11843 future.Result = future.result 11844 return nil 11845} 11846 11847// result is the default implementation for ServiceUpdateFuture.Result. 11848func (future *ServiceUpdateFuture) result(client ServiceClient) (sr ServiceResource, err error) { 11849 var done bool 11850 done, err = future.DoneWithContext(context.Background(), client) 11851 if err != nil { 11852 err = autorest.NewErrorWithError(err, "apimanagement.ServiceUpdateFuture", "Result", future.Response(), "Polling failure") 11853 return 11854 } 11855 if !done { 11856 sr.Response.Response = future.Response() 11857 err = azure.NewAsyncOpIncompleteError("apimanagement.ServiceUpdateFuture") 11858 return 11859 } 11860 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 11861 if sr.Response.Response, err = future.GetResult(sender); err == nil && sr.Response.Response.StatusCode != http.StatusNoContent { 11862 sr, err = client.UpdateResponder(sr.Response.Response) 11863 if err != nil { 11864 err = autorest.NewErrorWithError(err, "apimanagement.ServiceUpdateFuture", "Result", sr.Response.Response, "Failure responding to request") 11865 } 11866 } 11867 return 11868} 11869 11870// ServiceUpdateParameters parameter supplied to Update Api Management Service. 11871type ServiceUpdateParameters struct { 11872 // ServiceUpdateProperties - Properties of the API Management service. 11873 *ServiceUpdateProperties `json:"properties,omitempty"` 11874 // Sku - SKU properties of the API Management service. 11875 Sku *ServiceSkuProperties `json:"sku,omitempty"` 11876 // Identity - Managed service identity of the Api Management service. 11877 Identity *ServiceIdentity `json:"identity,omitempty"` 11878 // Etag - READ-ONLY; ETag of the resource. 11879 Etag *string `json:"etag,omitempty"` 11880 // ID - READ-ONLY; Resource ID. 11881 ID *string `json:"id,omitempty"` 11882 // Name - READ-ONLY; Resource name. 11883 Name *string `json:"name,omitempty"` 11884 // Type - READ-ONLY; Resource type for API Management resource is set to Microsoft.ApiManagement. 11885 Type *string `json:"type,omitempty"` 11886 // Tags - Resource tags. 11887 Tags map[string]*string `json:"tags"` 11888} 11889 11890// MarshalJSON is the custom marshaler for ServiceUpdateParameters. 11891func (sup ServiceUpdateParameters) MarshalJSON() ([]byte, error) { 11892 objectMap := make(map[string]interface{}) 11893 if sup.ServiceUpdateProperties != nil { 11894 objectMap["properties"] = sup.ServiceUpdateProperties 11895 } 11896 if sup.Sku != nil { 11897 objectMap["sku"] = sup.Sku 11898 } 11899 if sup.Identity != nil { 11900 objectMap["identity"] = sup.Identity 11901 } 11902 if sup.Tags != nil { 11903 objectMap["tags"] = sup.Tags 11904 } 11905 return json.Marshal(objectMap) 11906} 11907 11908// UnmarshalJSON is the custom unmarshaler for ServiceUpdateParameters struct. 11909func (sup *ServiceUpdateParameters) UnmarshalJSON(body []byte) error { 11910 var m map[string]*json.RawMessage 11911 err := json.Unmarshal(body, &m) 11912 if err != nil { 11913 return err 11914 } 11915 for k, v := range m { 11916 switch k { 11917 case "properties": 11918 if v != nil { 11919 var serviceUpdateProperties ServiceUpdateProperties 11920 err = json.Unmarshal(*v, &serviceUpdateProperties) 11921 if err != nil { 11922 return err 11923 } 11924 sup.ServiceUpdateProperties = &serviceUpdateProperties 11925 } 11926 case "sku": 11927 if v != nil { 11928 var sku ServiceSkuProperties 11929 err = json.Unmarshal(*v, &sku) 11930 if err != nil { 11931 return err 11932 } 11933 sup.Sku = &sku 11934 } 11935 case "identity": 11936 if v != nil { 11937 var identity ServiceIdentity 11938 err = json.Unmarshal(*v, &identity) 11939 if err != nil { 11940 return err 11941 } 11942 sup.Identity = &identity 11943 } 11944 case "etag": 11945 if v != nil { 11946 var etag string 11947 err = json.Unmarshal(*v, &etag) 11948 if err != nil { 11949 return err 11950 } 11951 sup.Etag = &etag 11952 } 11953 case "id": 11954 if v != nil { 11955 var ID string 11956 err = json.Unmarshal(*v, &ID) 11957 if err != nil { 11958 return err 11959 } 11960 sup.ID = &ID 11961 } 11962 case "name": 11963 if v != nil { 11964 var name string 11965 err = json.Unmarshal(*v, &name) 11966 if err != nil { 11967 return err 11968 } 11969 sup.Name = &name 11970 } 11971 case "type": 11972 if v != nil { 11973 var typeVar string 11974 err = json.Unmarshal(*v, &typeVar) 11975 if err != nil { 11976 return err 11977 } 11978 sup.Type = &typeVar 11979 } 11980 case "tags": 11981 if v != nil { 11982 var tags map[string]*string 11983 err = json.Unmarshal(*v, &tags) 11984 if err != nil { 11985 return err 11986 } 11987 sup.Tags = tags 11988 } 11989 } 11990 } 11991 11992 return nil 11993} 11994 11995// ServiceUpdateProperties properties of an API Management service resource description. 11996type ServiceUpdateProperties struct { 11997 // PublisherEmail - Publisher email. 11998 PublisherEmail *string `json:"publisherEmail,omitempty"` 11999 // PublisherName - Publisher name. 12000 PublisherName *string `json:"publisherName,omitempty"` 12001 // NotificationSenderEmail - Email address from which the notification will be sent. 12002 NotificationSenderEmail *string `json:"notificationSenderEmail,omitempty"` 12003 // 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. 12004 ProvisioningState *string `json:"provisioningState,omitempty"` 12005 // TargetProvisioningState - READ-ONLY; The provisioning state of the API Management service, which is targeted by the long running operation started on the service. 12006 TargetProvisioningState *string `json:"targetProvisioningState,omitempty"` 12007 // 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. 12008 CreatedAtUtc *date.Time `json:"createdAtUtc,omitempty"` 12009 // GatewayURL - READ-ONLY; Gateway URL of the API Management service. 12010 GatewayURL *string `json:"gatewayUrl,omitempty"` 12011 // GatewayRegionalURL - READ-ONLY; Gateway URL of the API Management service in the Default Region. 12012 GatewayRegionalURL *string `json:"gatewayRegionalUrl,omitempty"` 12013 // PortalURL - READ-ONLY; Publisher portal endpoint Url of the API Management service. 12014 PortalURL *string `json:"portalUrl,omitempty"` 12015 // ManagementAPIURL - READ-ONLY; Management API endpoint URL of the API Management service. 12016 ManagementAPIURL *string `json:"managementApiUrl,omitempty"` 12017 // ScmURL - READ-ONLY; SCM endpoint URL of the API Management service. 12018 ScmURL *string `json:"scmUrl,omitempty"` 12019 // DeveloperPortalURL - READ-ONLY; DEveloper Portal endpoint URL of the API Management service. 12020 DeveloperPortalURL *string `json:"developerPortalUrl,omitempty"` 12021 // HostnameConfigurations - Custom hostname configuration of the API Management service. 12022 HostnameConfigurations *[]HostnameConfiguration `json:"hostnameConfigurations,omitempty"` 12023 // 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. 12024 PublicIPAddresses *[]string `json:"publicIPAddresses,omitempty"` 12025 // 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. 12026 PrivateIPAddresses *[]string `json:"privateIPAddresses,omitempty"` 12027 // VirtualNetworkConfiguration - Virtual network configuration of the API Management service. 12028 VirtualNetworkConfiguration *VirtualNetworkConfiguration `json:"virtualNetworkConfiguration,omitempty"` 12029 // AdditionalLocations - Additional datacenter locations of the API Management service. 12030 AdditionalLocations *[]AdditionalLocation `json:"additionalLocations,omitempty"` 12031 // CustomProperties - Custom properties of the API Management service.</br>Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TripleDes168` will disable the cipher TLS_RSA_WITH_3DES_EDE_CBC_SHA for all TLS(1.0, 1.1 and 1.2).</br>Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls11` can be used to disable just TLS 1.1.</br>Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls10` can be used to disable TLS 1.0 on an API Management service.</br>Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls11` can be used to disable just TLS 1.1 for communications with backends.</br>Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls10` can be used to disable TLS 1.0 for communications with backends.</br>Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Protocols.Server.Http2` can be used to enable HTTP2 protocol on an API Management service.</br></br>Not specifying any of these properties on PATCH operation will reset omitted properties' values to their defaults. For all the settings except Http2 the default value is `True` if the service was created on or before April 1st 2018 and `False` otherwise. Http2 setting's default value is `False`.</br></br>You can disable any of next ciphers by using settings `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.[cipher_name]`:</br>TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA</br>TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA</br>TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA</br>TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA</br>TLS_RSA_WITH_AES_128_GCM_SHA256</br>TLS_RSA_WITH_AES_256_CBC_SHA256<br/>TLS_RSA_WITH_AES_128_CBC_SHA256<br/>TLS_RSA_WITH_AES_256_CBC_SHA<br/>TLS_RSA_WITH_AES_128_CBC_SHA.<br/><br/>For example: `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TLS_RSA_WITH_AES_128_CBC_SHA256`:`false`. The default value is `true` for all of them.<br/><br/>Note: next ciphers can't be disabled since they are required by Azure CloudService internal components:<br/>TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384<br/>TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256<br/>TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384<br/>TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256<br/>TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384<br/>TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256<br/>TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384<br/>TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256<br/>TLS_RSA_WITH_AES_256_GCM_SHA384 12032 CustomProperties map[string]*string `json:"customProperties"` 12033 // Certificates - List of Certificates that need to be installed in the API Management service. Max supported certificates that can be installed is 10. 12034 Certificates *[]CertificateConfiguration `json:"certificates,omitempty"` 12035 // EnableClientCertificate - Property only meant to be used for Consumption SKU Service. This enforces a client certificate to be presented on each request to the gateway. This also enables the ability to authenticate the certificate in the policy on the gateway. 12036 EnableClientCertificate *bool `json:"enableClientCertificate,omitempty"` 12037 // DisableGateway - Property only valid for an Api Management service deployed in multiple locations. This can be used to disable the gateway in master region. 12038 DisableGateway *bool `json:"disableGateway,omitempty"` 12039 // 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' 12040 VirtualNetworkType VirtualNetworkType `json:"virtualNetworkType,omitempty"` 12041 // APIVersionConstraint - Control Plane Apis version constraint for the API Management service. 12042 APIVersionConstraint *APIVersionConstraint `json:"apiVersionConstraint,omitempty"` 12043} 12044 12045// MarshalJSON is the custom marshaler for ServiceUpdateProperties. 12046func (sup ServiceUpdateProperties) MarshalJSON() ([]byte, error) { 12047 objectMap := make(map[string]interface{}) 12048 if sup.PublisherEmail != nil { 12049 objectMap["publisherEmail"] = sup.PublisherEmail 12050 } 12051 if sup.PublisherName != nil { 12052 objectMap["publisherName"] = sup.PublisherName 12053 } 12054 if sup.NotificationSenderEmail != nil { 12055 objectMap["notificationSenderEmail"] = sup.NotificationSenderEmail 12056 } 12057 if sup.HostnameConfigurations != nil { 12058 objectMap["hostnameConfigurations"] = sup.HostnameConfigurations 12059 } 12060 if sup.VirtualNetworkConfiguration != nil { 12061 objectMap["virtualNetworkConfiguration"] = sup.VirtualNetworkConfiguration 12062 } 12063 if sup.AdditionalLocations != nil { 12064 objectMap["additionalLocations"] = sup.AdditionalLocations 12065 } 12066 if sup.CustomProperties != nil { 12067 objectMap["customProperties"] = sup.CustomProperties 12068 } 12069 if sup.Certificates != nil { 12070 objectMap["certificates"] = sup.Certificates 12071 } 12072 if sup.EnableClientCertificate != nil { 12073 objectMap["enableClientCertificate"] = sup.EnableClientCertificate 12074 } 12075 if sup.DisableGateway != nil { 12076 objectMap["disableGateway"] = sup.DisableGateway 12077 } 12078 if sup.VirtualNetworkType != "" { 12079 objectMap["virtualNetworkType"] = sup.VirtualNetworkType 12080 } 12081 if sup.APIVersionConstraint != nil { 12082 objectMap["apiVersionConstraint"] = sup.APIVersionConstraint 12083 } 12084 return json.Marshal(objectMap) 12085} 12086 12087// SubscriptionCollection paged Subscriptions list representation. 12088type SubscriptionCollection struct { 12089 autorest.Response `json:"-"` 12090 // Value - Page values. 12091 Value *[]SubscriptionContract `json:"value,omitempty"` 12092 // NextLink - Next page link if any. 12093 NextLink *string `json:"nextLink,omitempty"` 12094} 12095 12096// SubscriptionCollectionIterator provides access to a complete listing of SubscriptionContract values. 12097type SubscriptionCollectionIterator struct { 12098 i int 12099 page SubscriptionCollectionPage 12100} 12101 12102// NextWithContext advances to the next value. If there was an error making 12103// the request the iterator does not advance and the error is returned. 12104func (iter *SubscriptionCollectionIterator) NextWithContext(ctx context.Context) (err error) { 12105 if tracing.IsEnabled() { 12106 ctx = tracing.StartSpan(ctx, fqdn+"/SubscriptionCollectionIterator.NextWithContext") 12107 defer func() { 12108 sc := -1 12109 if iter.Response().Response.Response != nil { 12110 sc = iter.Response().Response.Response.StatusCode 12111 } 12112 tracing.EndSpan(ctx, sc, err) 12113 }() 12114 } 12115 iter.i++ 12116 if iter.i < len(iter.page.Values()) { 12117 return nil 12118 } 12119 err = iter.page.NextWithContext(ctx) 12120 if err != nil { 12121 iter.i-- 12122 return err 12123 } 12124 iter.i = 0 12125 return nil 12126} 12127 12128// Next advances to the next value. If there was an error making 12129// the request the iterator does not advance and the error is returned. 12130// Deprecated: Use NextWithContext() instead. 12131func (iter *SubscriptionCollectionIterator) Next() error { 12132 return iter.NextWithContext(context.Background()) 12133} 12134 12135// NotDone returns true if the enumeration should be started or is not yet complete. 12136func (iter SubscriptionCollectionIterator) NotDone() bool { 12137 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 12138} 12139 12140// Response returns the raw server response from the last page request. 12141func (iter SubscriptionCollectionIterator) Response() SubscriptionCollection { 12142 return iter.page.Response() 12143} 12144 12145// Value returns the current value or a zero-initialized value if the 12146// iterator has advanced beyond the end of the collection. 12147func (iter SubscriptionCollectionIterator) Value() SubscriptionContract { 12148 if !iter.page.NotDone() { 12149 return SubscriptionContract{} 12150 } 12151 return iter.page.Values()[iter.i] 12152} 12153 12154// Creates a new instance of the SubscriptionCollectionIterator type. 12155func NewSubscriptionCollectionIterator(page SubscriptionCollectionPage) SubscriptionCollectionIterator { 12156 return SubscriptionCollectionIterator{page: page} 12157} 12158 12159// IsEmpty returns true if the ListResult contains no values. 12160func (sc SubscriptionCollection) IsEmpty() bool { 12161 return sc.Value == nil || len(*sc.Value) == 0 12162} 12163 12164// hasNextLink returns true if the NextLink is not empty. 12165func (sc SubscriptionCollection) hasNextLink() bool { 12166 return sc.NextLink != nil && len(*sc.NextLink) != 0 12167} 12168 12169// subscriptionCollectionPreparer prepares a request to retrieve the next set of results. 12170// It returns nil if no more results exist. 12171func (sc SubscriptionCollection) subscriptionCollectionPreparer(ctx context.Context) (*http.Request, error) { 12172 if !sc.hasNextLink() { 12173 return nil, nil 12174 } 12175 return autorest.Prepare((&http.Request{}).WithContext(ctx), 12176 autorest.AsJSON(), 12177 autorest.AsGet(), 12178 autorest.WithBaseURL(to.String(sc.NextLink))) 12179} 12180 12181// SubscriptionCollectionPage contains a page of SubscriptionContract values. 12182type SubscriptionCollectionPage struct { 12183 fn func(context.Context, SubscriptionCollection) (SubscriptionCollection, error) 12184 sc SubscriptionCollection 12185} 12186 12187// NextWithContext advances to the next page of values. If there was an error making 12188// the request the page does not advance and the error is returned. 12189func (page *SubscriptionCollectionPage) NextWithContext(ctx context.Context) (err error) { 12190 if tracing.IsEnabled() { 12191 ctx = tracing.StartSpan(ctx, fqdn+"/SubscriptionCollectionPage.NextWithContext") 12192 defer func() { 12193 sc := -1 12194 if page.Response().Response.Response != nil { 12195 sc = page.Response().Response.Response.StatusCode 12196 } 12197 tracing.EndSpan(ctx, sc, err) 12198 }() 12199 } 12200 for { 12201 next, err := page.fn(ctx, page.sc) 12202 if err != nil { 12203 return err 12204 } 12205 page.sc = next 12206 if !next.hasNextLink() || !next.IsEmpty() { 12207 break 12208 } 12209 } 12210 return nil 12211} 12212 12213// Next advances to the next page of values. If there was an error making 12214// the request the page does not advance and the error is returned. 12215// Deprecated: Use NextWithContext() instead. 12216func (page *SubscriptionCollectionPage) Next() error { 12217 return page.NextWithContext(context.Background()) 12218} 12219 12220// NotDone returns true if the page enumeration should be started or is not yet complete. 12221func (page SubscriptionCollectionPage) NotDone() bool { 12222 return !page.sc.IsEmpty() 12223} 12224 12225// Response returns the raw server response from the last page request. 12226func (page SubscriptionCollectionPage) Response() SubscriptionCollection { 12227 return page.sc 12228} 12229 12230// Values returns the slice of values for the current page or nil if there are no values. 12231func (page SubscriptionCollectionPage) Values() []SubscriptionContract { 12232 if page.sc.IsEmpty() { 12233 return nil 12234 } 12235 return *page.sc.Value 12236} 12237 12238// Creates a new instance of the SubscriptionCollectionPage type. 12239func NewSubscriptionCollectionPage(cur SubscriptionCollection, getNextPage func(context.Context, SubscriptionCollection) (SubscriptionCollection, error)) SubscriptionCollectionPage { 12240 return SubscriptionCollectionPage{ 12241 fn: getNextPage, 12242 sc: cur, 12243 } 12244} 12245 12246// SubscriptionContract subscription details. 12247type SubscriptionContract struct { 12248 autorest.Response `json:"-"` 12249 // SubscriptionContractProperties - Subscription contract properties. 12250 *SubscriptionContractProperties `json:"properties,omitempty"` 12251 // ID - READ-ONLY; Resource ID. 12252 ID *string `json:"id,omitempty"` 12253 // Name - READ-ONLY; Resource name. 12254 Name *string `json:"name,omitempty"` 12255 // Type - READ-ONLY; Resource type for API Management resource. 12256 Type *string `json:"type,omitempty"` 12257} 12258 12259// MarshalJSON is the custom marshaler for SubscriptionContract. 12260func (sc SubscriptionContract) MarshalJSON() ([]byte, error) { 12261 objectMap := make(map[string]interface{}) 12262 if sc.SubscriptionContractProperties != nil { 12263 objectMap["properties"] = sc.SubscriptionContractProperties 12264 } 12265 return json.Marshal(objectMap) 12266} 12267 12268// UnmarshalJSON is the custom unmarshaler for SubscriptionContract struct. 12269func (sc *SubscriptionContract) UnmarshalJSON(body []byte) error { 12270 var m map[string]*json.RawMessage 12271 err := json.Unmarshal(body, &m) 12272 if err != nil { 12273 return err 12274 } 12275 for k, v := range m { 12276 switch k { 12277 case "properties": 12278 if v != nil { 12279 var subscriptionContractProperties SubscriptionContractProperties 12280 err = json.Unmarshal(*v, &subscriptionContractProperties) 12281 if err != nil { 12282 return err 12283 } 12284 sc.SubscriptionContractProperties = &subscriptionContractProperties 12285 } 12286 case "id": 12287 if v != nil { 12288 var ID string 12289 err = json.Unmarshal(*v, &ID) 12290 if err != nil { 12291 return err 12292 } 12293 sc.ID = &ID 12294 } 12295 case "name": 12296 if v != nil { 12297 var name string 12298 err = json.Unmarshal(*v, &name) 12299 if err != nil { 12300 return err 12301 } 12302 sc.Name = &name 12303 } 12304 case "type": 12305 if v != nil { 12306 var typeVar string 12307 err = json.Unmarshal(*v, &typeVar) 12308 if err != nil { 12309 return err 12310 } 12311 sc.Type = &typeVar 12312 } 12313 } 12314 } 12315 12316 return nil 12317} 12318 12319// SubscriptionContractProperties subscription details. 12320type SubscriptionContractProperties struct { 12321 // 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. 12322 OwnerID *string `json:"ownerId,omitempty"` 12323 // Scope - Scope like /products/{productId} or /apis or /apis/{apiId}. 12324 Scope *string `json:"scope,omitempty"` 12325 // DisplayName - The name of the subscription, or null if the subscription has no name. 12326 DisplayName *string `json:"displayName,omitempty"` 12327 // 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' 12328 State SubscriptionState `json:"state,omitempty"` 12329 // 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. 12330 CreatedDate *date.Time `json:"createdDate,omitempty"` 12331 // 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. 12332 StartDate *date.Time `json:"startDate,omitempty"` 12333 // 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. 12334 ExpirationDate *date.Time `json:"expirationDate,omitempty"` 12335 // 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. 12336 EndDate *date.Time `json:"endDate,omitempty"` 12337 // 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. 12338 NotificationDate *date.Time `json:"notificationDate,omitempty"` 12339 // PrimaryKey - Subscription primary key. This property will not be filled on 'GET' operations! Use '/listSecrets' POST request to get the value. 12340 PrimaryKey *string `json:"primaryKey,omitempty"` 12341 // SecondaryKey - Subscription secondary key. This property will not be filled on 'GET' operations! Use '/listSecrets' POST request to get the value. 12342 SecondaryKey *string `json:"secondaryKey,omitempty"` 12343 // StateComment - Optional subscription comment added by an administrator when the state is changed to the 'rejected'. 12344 StateComment *string `json:"stateComment,omitempty"` 12345 // AllowTracing - Determines whether tracing is enabled 12346 AllowTracing *bool `json:"allowTracing,omitempty"` 12347} 12348 12349// MarshalJSON is the custom marshaler for SubscriptionContractProperties. 12350func (scp SubscriptionContractProperties) MarshalJSON() ([]byte, error) { 12351 objectMap := make(map[string]interface{}) 12352 if scp.OwnerID != nil { 12353 objectMap["ownerId"] = scp.OwnerID 12354 } 12355 if scp.Scope != nil { 12356 objectMap["scope"] = scp.Scope 12357 } 12358 if scp.DisplayName != nil { 12359 objectMap["displayName"] = scp.DisplayName 12360 } 12361 if scp.State != "" { 12362 objectMap["state"] = scp.State 12363 } 12364 if scp.StartDate != nil { 12365 objectMap["startDate"] = scp.StartDate 12366 } 12367 if scp.ExpirationDate != nil { 12368 objectMap["expirationDate"] = scp.ExpirationDate 12369 } 12370 if scp.EndDate != nil { 12371 objectMap["endDate"] = scp.EndDate 12372 } 12373 if scp.NotificationDate != nil { 12374 objectMap["notificationDate"] = scp.NotificationDate 12375 } 12376 if scp.PrimaryKey != nil { 12377 objectMap["primaryKey"] = scp.PrimaryKey 12378 } 12379 if scp.SecondaryKey != nil { 12380 objectMap["secondaryKey"] = scp.SecondaryKey 12381 } 12382 if scp.StateComment != nil { 12383 objectMap["stateComment"] = scp.StateComment 12384 } 12385 if scp.AllowTracing != nil { 12386 objectMap["allowTracing"] = scp.AllowTracing 12387 } 12388 return json.Marshal(objectMap) 12389} 12390 12391// SubscriptionCreateParameterProperties parameters supplied to the Create subscription operation. 12392type SubscriptionCreateParameterProperties struct { 12393 // OwnerID - User (user id path) for whom subscription is being created in form /users/{userId} 12394 OwnerID *string `json:"ownerId,omitempty"` 12395 // Scope - Scope like /products/{productId} or /apis or /apis/{apiId}. 12396 Scope *string `json:"scope,omitempty"` 12397 // DisplayName - Subscription name. 12398 DisplayName *string `json:"displayName,omitempty"` 12399 // PrimaryKey - Primary subscription key. If not specified during request key will be generated automatically. 12400 PrimaryKey *string `json:"primaryKey,omitempty"` 12401 // SecondaryKey - Secondary subscription key. If not specified during request key will be generated automatically. 12402 SecondaryKey *string `json:"secondaryKey,omitempty"` 12403 // 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' 12404 State SubscriptionState `json:"state,omitempty"` 12405 // AllowTracing - Determines whether tracing can be enabled 12406 AllowTracing *bool `json:"allowTracing,omitempty"` 12407} 12408 12409// SubscriptionCreateParameters subscription create details. 12410type SubscriptionCreateParameters struct { 12411 // SubscriptionCreateParameterProperties - Subscription contract properties. 12412 *SubscriptionCreateParameterProperties `json:"properties,omitempty"` 12413} 12414 12415// MarshalJSON is the custom marshaler for SubscriptionCreateParameters. 12416func (scp SubscriptionCreateParameters) MarshalJSON() ([]byte, error) { 12417 objectMap := make(map[string]interface{}) 12418 if scp.SubscriptionCreateParameterProperties != nil { 12419 objectMap["properties"] = scp.SubscriptionCreateParameterProperties 12420 } 12421 return json.Marshal(objectMap) 12422} 12423 12424// UnmarshalJSON is the custom unmarshaler for SubscriptionCreateParameters struct. 12425func (scp *SubscriptionCreateParameters) UnmarshalJSON(body []byte) error { 12426 var m map[string]*json.RawMessage 12427 err := json.Unmarshal(body, &m) 12428 if err != nil { 12429 return err 12430 } 12431 for k, v := range m { 12432 switch k { 12433 case "properties": 12434 if v != nil { 12435 var subscriptionCreateParameterProperties SubscriptionCreateParameterProperties 12436 err = json.Unmarshal(*v, &subscriptionCreateParameterProperties) 12437 if err != nil { 12438 return err 12439 } 12440 scp.SubscriptionCreateParameterProperties = &subscriptionCreateParameterProperties 12441 } 12442 } 12443 } 12444 12445 return nil 12446} 12447 12448// SubscriptionKeyParameterNamesContract subscription key parameter names details. 12449type SubscriptionKeyParameterNamesContract struct { 12450 // Header - Subscription key header name. 12451 Header *string `json:"header,omitempty"` 12452 // Query - Subscription key query string parameter name. 12453 Query *string `json:"query,omitempty"` 12454} 12455 12456// SubscriptionKeysContract subscription keys. 12457type SubscriptionKeysContract struct { 12458 autorest.Response `json:"-"` 12459 // PrimaryKey - Subscription primary key. 12460 PrimaryKey *string `json:"primaryKey,omitempty"` 12461 // SecondaryKey - Subscription secondary key. 12462 SecondaryKey *string `json:"secondaryKey,omitempty"` 12463} 12464 12465// SubscriptionsDelegationSettingsProperties subscriptions delegation settings properties. 12466type SubscriptionsDelegationSettingsProperties struct { 12467 // Enabled - Enable or disable delegation for subscriptions. 12468 Enabled *bool `json:"enabled,omitempty"` 12469} 12470 12471// SubscriptionUpdateParameterProperties parameters supplied to the Update subscription operation. 12472type SubscriptionUpdateParameterProperties struct { 12473 // OwnerID - User identifier path: /users/{userId} 12474 OwnerID *string `json:"ownerId,omitempty"` 12475 // Scope - Scope like /products/{productId} or /apis or /apis/{apiId} 12476 Scope *string `json:"scope,omitempty"` 12477 // 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. 12478 ExpirationDate *date.Time `json:"expirationDate,omitempty"` 12479 // DisplayName - Subscription name. 12480 DisplayName *string `json:"displayName,omitempty"` 12481 // PrimaryKey - Primary subscription key. 12482 PrimaryKey *string `json:"primaryKey,omitempty"` 12483 // SecondaryKey - Secondary subscription key. 12484 SecondaryKey *string `json:"secondaryKey,omitempty"` 12485 // 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' 12486 State SubscriptionState `json:"state,omitempty"` 12487 // StateComment - Comments describing subscription state change by the administrator when the state is changed to the 'rejected'. 12488 StateComment *string `json:"stateComment,omitempty"` 12489 // AllowTracing - Determines whether tracing can be enabled 12490 AllowTracing *bool `json:"allowTracing,omitempty"` 12491} 12492 12493// SubscriptionUpdateParameters subscription update details. 12494type SubscriptionUpdateParameters struct { 12495 // SubscriptionUpdateParameterProperties - Subscription Update contract properties. 12496 *SubscriptionUpdateParameterProperties `json:"properties,omitempty"` 12497} 12498 12499// MarshalJSON is the custom marshaler for SubscriptionUpdateParameters. 12500func (sup SubscriptionUpdateParameters) MarshalJSON() ([]byte, error) { 12501 objectMap := make(map[string]interface{}) 12502 if sup.SubscriptionUpdateParameterProperties != nil { 12503 objectMap["properties"] = sup.SubscriptionUpdateParameterProperties 12504 } 12505 return json.Marshal(objectMap) 12506} 12507 12508// UnmarshalJSON is the custom unmarshaler for SubscriptionUpdateParameters struct. 12509func (sup *SubscriptionUpdateParameters) UnmarshalJSON(body []byte) error { 12510 var m map[string]*json.RawMessage 12511 err := json.Unmarshal(body, &m) 12512 if err != nil { 12513 return err 12514 } 12515 for k, v := range m { 12516 switch k { 12517 case "properties": 12518 if v != nil { 12519 var subscriptionUpdateParameterProperties SubscriptionUpdateParameterProperties 12520 err = json.Unmarshal(*v, &subscriptionUpdateParameterProperties) 12521 if err != nil { 12522 return err 12523 } 12524 sup.SubscriptionUpdateParameterProperties = &subscriptionUpdateParameterProperties 12525 } 12526 } 12527 } 12528 12529 return nil 12530} 12531 12532// TagCollection paged Tag list representation. 12533type TagCollection struct { 12534 autorest.Response `json:"-"` 12535 // Value - Page values. 12536 Value *[]TagContract `json:"value,omitempty"` 12537 // NextLink - Next page link if any. 12538 NextLink *string `json:"nextLink,omitempty"` 12539} 12540 12541// TagCollectionIterator provides access to a complete listing of TagContract values. 12542type TagCollectionIterator struct { 12543 i int 12544 page TagCollectionPage 12545} 12546 12547// NextWithContext advances to the next value. If there was an error making 12548// the request the iterator does not advance and the error is returned. 12549func (iter *TagCollectionIterator) NextWithContext(ctx context.Context) (err error) { 12550 if tracing.IsEnabled() { 12551 ctx = tracing.StartSpan(ctx, fqdn+"/TagCollectionIterator.NextWithContext") 12552 defer func() { 12553 sc := -1 12554 if iter.Response().Response.Response != nil { 12555 sc = iter.Response().Response.Response.StatusCode 12556 } 12557 tracing.EndSpan(ctx, sc, err) 12558 }() 12559 } 12560 iter.i++ 12561 if iter.i < len(iter.page.Values()) { 12562 return nil 12563 } 12564 err = iter.page.NextWithContext(ctx) 12565 if err != nil { 12566 iter.i-- 12567 return err 12568 } 12569 iter.i = 0 12570 return nil 12571} 12572 12573// Next advances to the next value. If there was an error making 12574// the request the iterator does not advance and the error is returned. 12575// Deprecated: Use NextWithContext() instead. 12576func (iter *TagCollectionIterator) Next() error { 12577 return iter.NextWithContext(context.Background()) 12578} 12579 12580// NotDone returns true if the enumeration should be started or is not yet complete. 12581func (iter TagCollectionIterator) NotDone() bool { 12582 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 12583} 12584 12585// Response returns the raw server response from the last page request. 12586func (iter TagCollectionIterator) Response() TagCollection { 12587 return iter.page.Response() 12588} 12589 12590// Value returns the current value or a zero-initialized value if the 12591// iterator has advanced beyond the end of the collection. 12592func (iter TagCollectionIterator) Value() TagContract { 12593 if !iter.page.NotDone() { 12594 return TagContract{} 12595 } 12596 return iter.page.Values()[iter.i] 12597} 12598 12599// Creates a new instance of the TagCollectionIterator type. 12600func NewTagCollectionIterator(page TagCollectionPage) TagCollectionIterator { 12601 return TagCollectionIterator{page: page} 12602} 12603 12604// IsEmpty returns true if the ListResult contains no values. 12605func (tc TagCollection) IsEmpty() bool { 12606 return tc.Value == nil || len(*tc.Value) == 0 12607} 12608 12609// hasNextLink returns true if the NextLink is not empty. 12610func (tc TagCollection) hasNextLink() bool { 12611 return tc.NextLink != nil && len(*tc.NextLink) != 0 12612} 12613 12614// tagCollectionPreparer prepares a request to retrieve the next set of results. 12615// It returns nil if no more results exist. 12616func (tc TagCollection) tagCollectionPreparer(ctx context.Context) (*http.Request, error) { 12617 if !tc.hasNextLink() { 12618 return nil, nil 12619 } 12620 return autorest.Prepare((&http.Request{}).WithContext(ctx), 12621 autorest.AsJSON(), 12622 autorest.AsGet(), 12623 autorest.WithBaseURL(to.String(tc.NextLink))) 12624} 12625 12626// TagCollectionPage contains a page of TagContract values. 12627type TagCollectionPage struct { 12628 fn func(context.Context, TagCollection) (TagCollection, error) 12629 tc TagCollection 12630} 12631 12632// NextWithContext advances to the next page of values. If there was an error making 12633// the request the page does not advance and the error is returned. 12634func (page *TagCollectionPage) NextWithContext(ctx context.Context) (err error) { 12635 if tracing.IsEnabled() { 12636 ctx = tracing.StartSpan(ctx, fqdn+"/TagCollectionPage.NextWithContext") 12637 defer func() { 12638 sc := -1 12639 if page.Response().Response.Response != nil { 12640 sc = page.Response().Response.Response.StatusCode 12641 } 12642 tracing.EndSpan(ctx, sc, err) 12643 }() 12644 } 12645 for { 12646 next, err := page.fn(ctx, page.tc) 12647 if err != nil { 12648 return err 12649 } 12650 page.tc = next 12651 if !next.hasNextLink() || !next.IsEmpty() { 12652 break 12653 } 12654 } 12655 return nil 12656} 12657 12658// Next advances to the next page of values. If there was an error making 12659// the request the page does not advance and the error is returned. 12660// Deprecated: Use NextWithContext() instead. 12661func (page *TagCollectionPage) Next() error { 12662 return page.NextWithContext(context.Background()) 12663} 12664 12665// NotDone returns true if the page enumeration should be started or is not yet complete. 12666func (page TagCollectionPage) NotDone() bool { 12667 return !page.tc.IsEmpty() 12668} 12669 12670// Response returns the raw server response from the last page request. 12671func (page TagCollectionPage) Response() TagCollection { 12672 return page.tc 12673} 12674 12675// Values returns the slice of values for the current page or nil if there are no values. 12676func (page TagCollectionPage) Values() []TagContract { 12677 if page.tc.IsEmpty() { 12678 return nil 12679 } 12680 return *page.tc.Value 12681} 12682 12683// Creates a new instance of the TagCollectionPage type. 12684func NewTagCollectionPage(cur TagCollection, getNextPage func(context.Context, TagCollection) (TagCollection, error)) TagCollectionPage { 12685 return TagCollectionPage{ 12686 fn: getNextPage, 12687 tc: cur, 12688 } 12689} 12690 12691// TagContract tag Contract details. 12692type TagContract struct { 12693 autorest.Response `json:"-"` 12694 // TagContractProperties - Tag entity contract properties. 12695 *TagContractProperties `json:"properties,omitempty"` 12696 // ID - READ-ONLY; Resource ID. 12697 ID *string `json:"id,omitempty"` 12698 // Name - READ-ONLY; Resource name. 12699 Name *string `json:"name,omitempty"` 12700 // Type - READ-ONLY; Resource type for API Management resource. 12701 Type *string `json:"type,omitempty"` 12702} 12703 12704// MarshalJSON is the custom marshaler for TagContract. 12705func (tc TagContract) MarshalJSON() ([]byte, error) { 12706 objectMap := make(map[string]interface{}) 12707 if tc.TagContractProperties != nil { 12708 objectMap["properties"] = tc.TagContractProperties 12709 } 12710 return json.Marshal(objectMap) 12711} 12712 12713// UnmarshalJSON is the custom unmarshaler for TagContract struct. 12714func (tc *TagContract) UnmarshalJSON(body []byte) error { 12715 var m map[string]*json.RawMessage 12716 err := json.Unmarshal(body, &m) 12717 if err != nil { 12718 return err 12719 } 12720 for k, v := range m { 12721 switch k { 12722 case "properties": 12723 if v != nil { 12724 var tagContractProperties TagContractProperties 12725 err = json.Unmarshal(*v, &tagContractProperties) 12726 if err != nil { 12727 return err 12728 } 12729 tc.TagContractProperties = &tagContractProperties 12730 } 12731 case "id": 12732 if v != nil { 12733 var ID string 12734 err = json.Unmarshal(*v, &ID) 12735 if err != nil { 12736 return err 12737 } 12738 tc.ID = &ID 12739 } 12740 case "name": 12741 if v != nil { 12742 var name string 12743 err = json.Unmarshal(*v, &name) 12744 if err != nil { 12745 return err 12746 } 12747 tc.Name = &name 12748 } 12749 case "type": 12750 if v != nil { 12751 var typeVar string 12752 err = json.Unmarshal(*v, &typeVar) 12753 if err != nil { 12754 return err 12755 } 12756 tc.Type = &typeVar 12757 } 12758 } 12759 } 12760 12761 return nil 12762} 12763 12764// TagContractProperties tag contract Properties. 12765type TagContractProperties struct { 12766 // DisplayName - Tag name. 12767 DisplayName *string `json:"displayName,omitempty"` 12768} 12769 12770// TagCreateUpdateParameters parameters supplied to Create/Update Tag operations. 12771type TagCreateUpdateParameters struct { 12772 // TagContractProperties - Properties supplied to Create Tag operation. 12773 *TagContractProperties `json:"properties,omitempty"` 12774} 12775 12776// MarshalJSON is the custom marshaler for TagCreateUpdateParameters. 12777func (tcup TagCreateUpdateParameters) MarshalJSON() ([]byte, error) { 12778 objectMap := make(map[string]interface{}) 12779 if tcup.TagContractProperties != nil { 12780 objectMap["properties"] = tcup.TagContractProperties 12781 } 12782 return json.Marshal(objectMap) 12783} 12784 12785// UnmarshalJSON is the custom unmarshaler for TagCreateUpdateParameters struct. 12786func (tcup *TagCreateUpdateParameters) UnmarshalJSON(body []byte) error { 12787 var m map[string]*json.RawMessage 12788 err := json.Unmarshal(body, &m) 12789 if err != nil { 12790 return err 12791 } 12792 for k, v := range m { 12793 switch k { 12794 case "properties": 12795 if v != nil { 12796 var tagContractProperties TagContractProperties 12797 err = json.Unmarshal(*v, &tagContractProperties) 12798 if err != nil { 12799 return err 12800 } 12801 tcup.TagContractProperties = &tagContractProperties 12802 } 12803 } 12804 } 12805 12806 return nil 12807} 12808 12809// TagDescriptionBaseProperties parameters supplied to the Create TagDescription operation. 12810type TagDescriptionBaseProperties struct { 12811 // Description - Description of the Tag. 12812 Description *string `json:"description,omitempty"` 12813 // ExternalDocsURL - Absolute URL of external resources describing the tag. 12814 ExternalDocsURL *string `json:"externalDocsUrl,omitempty"` 12815 // ExternalDocsDescription - Description of the external resources describing the tag. 12816 ExternalDocsDescription *string `json:"externalDocsDescription,omitempty"` 12817} 12818 12819// TagDescriptionCollection paged TagDescription list representation. 12820type TagDescriptionCollection struct { 12821 autorest.Response `json:"-"` 12822 // Value - Page values. 12823 Value *[]TagDescriptionContract `json:"value,omitempty"` 12824 // NextLink - Next page link if any. 12825 NextLink *string `json:"nextLink,omitempty"` 12826} 12827 12828// TagDescriptionCollectionIterator provides access to a complete listing of TagDescriptionContract values. 12829type TagDescriptionCollectionIterator struct { 12830 i int 12831 page TagDescriptionCollectionPage 12832} 12833 12834// NextWithContext advances to the next value. If there was an error making 12835// the request the iterator does not advance and the error is returned. 12836func (iter *TagDescriptionCollectionIterator) NextWithContext(ctx context.Context) (err error) { 12837 if tracing.IsEnabled() { 12838 ctx = tracing.StartSpan(ctx, fqdn+"/TagDescriptionCollectionIterator.NextWithContext") 12839 defer func() { 12840 sc := -1 12841 if iter.Response().Response.Response != nil { 12842 sc = iter.Response().Response.Response.StatusCode 12843 } 12844 tracing.EndSpan(ctx, sc, err) 12845 }() 12846 } 12847 iter.i++ 12848 if iter.i < len(iter.page.Values()) { 12849 return nil 12850 } 12851 err = iter.page.NextWithContext(ctx) 12852 if err != nil { 12853 iter.i-- 12854 return err 12855 } 12856 iter.i = 0 12857 return nil 12858} 12859 12860// Next advances to the next value. If there was an error making 12861// the request the iterator does not advance and the error is returned. 12862// Deprecated: Use NextWithContext() instead. 12863func (iter *TagDescriptionCollectionIterator) Next() error { 12864 return iter.NextWithContext(context.Background()) 12865} 12866 12867// NotDone returns true if the enumeration should be started or is not yet complete. 12868func (iter TagDescriptionCollectionIterator) NotDone() bool { 12869 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 12870} 12871 12872// Response returns the raw server response from the last page request. 12873func (iter TagDescriptionCollectionIterator) Response() TagDescriptionCollection { 12874 return iter.page.Response() 12875} 12876 12877// Value returns the current value or a zero-initialized value if the 12878// iterator has advanced beyond the end of the collection. 12879func (iter TagDescriptionCollectionIterator) Value() TagDescriptionContract { 12880 if !iter.page.NotDone() { 12881 return TagDescriptionContract{} 12882 } 12883 return iter.page.Values()[iter.i] 12884} 12885 12886// Creates a new instance of the TagDescriptionCollectionIterator type. 12887func NewTagDescriptionCollectionIterator(page TagDescriptionCollectionPage) TagDescriptionCollectionIterator { 12888 return TagDescriptionCollectionIterator{page: page} 12889} 12890 12891// IsEmpty returns true if the ListResult contains no values. 12892func (tdc TagDescriptionCollection) IsEmpty() bool { 12893 return tdc.Value == nil || len(*tdc.Value) == 0 12894} 12895 12896// hasNextLink returns true if the NextLink is not empty. 12897func (tdc TagDescriptionCollection) hasNextLink() bool { 12898 return tdc.NextLink != nil && len(*tdc.NextLink) != 0 12899} 12900 12901// tagDescriptionCollectionPreparer prepares a request to retrieve the next set of results. 12902// It returns nil if no more results exist. 12903func (tdc TagDescriptionCollection) tagDescriptionCollectionPreparer(ctx context.Context) (*http.Request, error) { 12904 if !tdc.hasNextLink() { 12905 return nil, nil 12906 } 12907 return autorest.Prepare((&http.Request{}).WithContext(ctx), 12908 autorest.AsJSON(), 12909 autorest.AsGet(), 12910 autorest.WithBaseURL(to.String(tdc.NextLink))) 12911} 12912 12913// TagDescriptionCollectionPage contains a page of TagDescriptionContract values. 12914type TagDescriptionCollectionPage struct { 12915 fn func(context.Context, TagDescriptionCollection) (TagDescriptionCollection, error) 12916 tdc TagDescriptionCollection 12917} 12918 12919// NextWithContext advances to the next page of values. If there was an error making 12920// the request the page does not advance and the error is returned. 12921func (page *TagDescriptionCollectionPage) NextWithContext(ctx context.Context) (err error) { 12922 if tracing.IsEnabled() { 12923 ctx = tracing.StartSpan(ctx, fqdn+"/TagDescriptionCollectionPage.NextWithContext") 12924 defer func() { 12925 sc := -1 12926 if page.Response().Response.Response != nil { 12927 sc = page.Response().Response.Response.StatusCode 12928 } 12929 tracing.EndSpan(ctx, sc, err) 12930 }() 12931 } 12932 for { 12933 next, err := page.fn(ctx, page.tdc) 12934 if err != nil { 12935 return err 12936 } 12937 page.tdc = next 12938 if !next.hasNextLink() || !next.IsEmpty() { 12939 break 12940 } 12941 } 12942 return nil 12943} 12944 12945// Next advances to the next page of values. If there was an error making 12946// the request the page does not advance and the error is returned. 12947// Deprecated: Use NextWithContext() instead. 12948func (page *TagDescriptionCollectionPage) Next() error { 12949 return page.NextWithContext(context.Background()) 12950} 12951 12952// NotDone returns true if the page enumeration should be started or is not yet complete. 12953func (page TagDescriptionCollectionPage) NotDone() bool { 12954 return !page.tdc.IsEmpty() 12955} 12956 12957// Response returns the raw server response from the last page request. 12958func (page TagDescriptionCollectionPage) Response() TagDescriptionCollection { 12959 return page.tdc 12960} 12961 12962// Values returns the slice of values for the current page or nil if there are no values. 12963func (page TagDescriptionCollectionPage) Values() []TagDescriptionContract { 12964 if page.tdc.IsEmpty() { 12965 return nil 12966 } 12967 return *page.tdc.Value 12968} 12969 12970// Creates a new instance of the TagDescriptionCollectionPage type. 12971func NewTagDescriptionCollectionPage(cur TagDescriptionCollection, getNextPage func(context.Context, TagDescriptionCollection) (TagDescriptionCollection, error)) TagDescriptionCollectionPage { 12972 return TagDescriptionCollectionPage{ 12973 fn: getNextPage, 12974 tdc: cur, 12975 } 12976} 12977 12978// TagDescriptionContract contract details. 12979type TagDescriptionContract struct { 12980 autorest.Response `json:"-"` 12981 // TagDescriptionContractProperties - TagDescription entity contract properties. 12982 *TagDescriptionContractProperties `json:"properties,omitempty"` 12983 // ID - READ-ONLY; Resource ID. 12984 ID *string `json:"id,omitempty"` 12985 // Name - READ-ONLY; Resource name. 12986 Name *string `json:"name,omitempty"` 12987 // Type - READ-ONLY; Resource type for API Management resource. 12988 Type *string `json:"type,omitempty"` 12989} 12990 12991// MarshalJSON is the custom marshaler for TagDescriptionContract. 12992func (tdc TagDescriptionContract) MarshalJSON() ([]byte, error) { 12993 objectMap := make(map[string]interface{}) 12994 if tdc.TagDescriptionContractProperties != nil { 12995 objectMap["properties"] = tdc.TagDescriptionContractProperties 12996 } 12997 return json.Marshal(objectMap) 12998} 12999 13000// UnmarshalJSON is the custom unmarshaler for TagDescriptionContract struct. 13001func (tdc *TagDescriptionContract) UnmarshalJSON(body []byte) error { 13002 var m map[string]*json.RawMessage 13003 err := json.Unmarshal(body, &m) 13004 if err != nil { 13005 return err 13006 } 13007 for k, v := range m { 13008 switch k { 13009 case "properties": 13010 if v != nil { 13011 var tagDescriptionContractProperties TagDescriptionContractProperties 13012 err = json.Unmarshal(*v, &tagDescriptionContractProperties) 13013 if err != nil { 13014 return err 13015 } 13016 tdc.TagDescriptionContractProperties = &tagDescriptionContractProperties 13017 } 13018 case "id": 13019 if v != nil { 13020 var ID string 13021 err = json.Unmarshal(*v, &ID) 13022 if err != nil { 13023 return err 13024 } 13025 tdc.ID = &ID 13026 } 13027 case "name": 13028 if v != nil { 13029 var name string 13030 err = json.Unmarshal(*v, &name) 13031 if err != nil { 13032 return err 13033 } 13034 tdc.Name = &name 13035 } 13036 case "type": 13037 if v != nil { 13038 var typeVar string 13039 err = json.Unmarshal(*v, &typeVar) 13040 if err != nil { 13041 return err 13042 } 13043 tdc.Type = &typeVar 13044 } 13045 } 13046 } 13047 13048 return nil 13049} 13050 13051// TagDescriptionContractProperties tagDescription contract Properties. 13052type TagDescriptionContractProperties struct { 13053 // TagID - Identifier of the tag in the form of /tags/{tagId} 13054 TagID *string `json:"tagId,omitempty"` 13055 // DisplayName - Tag name. 13056 DisplayName *string `json:"displayName,omitempty"` 13057 // Description - Description of the Tag. 13058 Description *string `json:"description,omitempty"` 13059 // ExternalDocsURL - Absolute URL of external resources describing the tag. 13060 ExternalDocsURL *string `json:"externalDocsUrl,omitempty"` 13061 // ExternalDocsDescription - Description of the external resources describing the tag. 13062 ExternalDocsDescription *string `json:"externalDocsDescription,omitempty"` 13063} 13064 13065// TagDescriptionCreateParameters parameters supplied to the Create TagDescription operation. 13066type TagDescriptionCreateParameters struct { 13067 // TagDescriptionBaseProperties - Properties supplied to Create TagDescription operation. 13068 *TagDescriptionBaseProperties `json:"properties,omitempty"` 13069} 13070 13071// MarshalJSON is the custom marshaler for TagDescriptionCreateParameters. 13072func (tdcp TagDescriptionCreateParameters) MarshalJSON() ([]byte, error) { 13073 objectMap := make(map[string]interface{}) 13074 if tdcp.TagDescriptionBaseProperties != nil { 13075 objectMap["properties"] = tdcp.TagDescriptionBaseProperties 13076 } 13077 return json.Marshal(objectMap) 13078} 13079 13080// UnmarshalJSON is the custom unmarshaler for TagDescriptionCreateParameters struct. 13081func (tdcp *TagDescriptionCreateParameters) UnmarshalJSON(body []byte) error { 13082 var m map[string]*json.RawMessage 13083 err := json.Unmarshal(body, &m) 13084 if err != nil { 13085 return err 13086 } 13087 for k, v := range m { 13088 switch k { 13089 case "properties": 13090 if v != nil { 13091 var tagDescriptionBaseProperties TagDescriptionBaseProperties 13092 err = json.Unmarshal(*v, &tagDescriptionBaseProperties) 13093 if err != nil { 13094 return err 13095 } 13096 tdcp.TagDescriptionBaseProperties = &tagDescriptionBaseProperties 13097 } 13098 } 13099 } 13100 13101 return nil 13102} 13103 13104// TagResourceCollection paged Tag list representation. 13105type TagResourceCollection struct { 13106 autorest.Response `json:"-"` 13107 // Value - Page values. 13108 Value *[]TagResourceContract `json:"value,omitempty"` 13109 // NextLink - Next page link if any. 13110 NextLink *string `json:"nextLink,omitempty"` 13111} 13112 13113// TagResourceCollectionIterator provides access to a complete listing of TagResourceContract values. 13114type TagResourceCollectionIterator struct { 13115 i int 13116 page TagResourceCollectionPage 13117} 13118 13119// NextWithContext advances to the next value. If there was an error making 13120// the request the iterator does not advance and the error is returned. 13121func (iter *TagResourceCollectionIterator) NextWithContext(ctx context.Context) (err error) { 13122 if tracing.IsEnabled() { 13123 ctx = tracing.StartSpan(ctx, fqdn+"/TagResourceCollectionIterator.NextWithContext") 13124 defer func() { 13125 sc := -1 13126 if iter.Response().Response.Response != nil { 13127 sc = iter.Response().Response.Response.StatusCode 13128 } 13129 tracing.EndSpan(ctx, sc, err) 13130 }() 13131 } 13132 iter.i++ 13133 if iter.i < len(iter.page.Values()) { 13134 return nil 13135 } 13136 err = iter.page.NextWithContext(ctx) 13137 if err != nil { 13138 iter.i-- 13139 return err 13140 } 13141 iter.i = 0 13142 return nil 13143} 13144 13145// Next advances to the next value. If there was an error making 13146// the request the iterator does not advance and the error is returned. 13147// Deprecated: Use NextWithContext() instead. 13148func (iter *TagResourceCollectionIterator) Next() error { 13149 return iter.NextWithContext(context.Background()) 13150} 13151 13152// NotDone returns true if the enumeration should be started or is not yet complete. 13153func (iter TagResourceCollectionIterator) NotDone() bool { 13154 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 13155} 13156 13157// Response returns the raw server response from the last page request. 13158func (iter TagResourceCollectionIterator) Response() TagResourceCollection { 13159 return iter.page.Response() 13160} 13161 13162// Value returns the current value or a zero-initialized value if the 13163// iterator has advanced beyond the end of the collection. 13164func (iter TagResourceCollectionIterator) Value() TagResourceContract { 13165 if !iter.page.NotDone() { 13166 return TagResourceContract{} 13167 } 13168 return iter.page.Values()[iter.i] 13169} 13170 13171// Creates a new instance of the TagResourceCollectionIterator type. 13172func NewTagResourceCollectionIterator(page TagResourceCollectionPage) TagResourceCollectionIterator { 13173 return TagResourceCollectionIterator{page: page} 13174} 13175 13176// IsEmpty returns true if the ListResult contains no values. 13177func (trc TagResourceCollection) IsEmpty() bool { 13178 return trc.Value == nil || len(*trc.Value) == 0 13179} 13180 13181// hasNextLink returns true if the NextLink is not empty. 13182func (trc TagResourceCollection) hasNextLink() bool { 13183 return trc.NextLink != nil && len(*trc.NextLink) != 0 13184} 13185 13186// tagResourceCollectionPreparer prepares a request to retrieve the next set of results. 13187// It returns nil if no more results exist. 13188func (trc TagResourceCollection) tagResourceCollectionPreparer(ctx context.Context) (*http.Request, error) { 13189 if !trc.hasNextLink() { 13190 return nil, nil 13191 } 13192 return autorest.Prepare((&http.Request{}).WithContext(ctx), 13193 autorest.AsJSON(), 13194 autorest.AsGet(), 13195 autorest.WithBaseURL(to.String(trc.NextLink))) 13196} 13197 13198// TagResourceCollectionPage contains a page of TagResourceContract values. 13199type TagResourceCollectionPage struct { 13200 fn func(context.Context, TagResourceCollection) (TagResourceCollection, error) 13201 trc TagResourceCollection 13202} 13203 13204// NextWithContext advances to the next page of values. If there was an error making 13205// the request the page does not advance and the error is returned. 13206func (page *TagResourceCollectionPage) NextWithContext(ctx context.Context) (err error) { 13207 if tracing.IsEnabled() { 13208 ctx = tracing.StartSpan(ctx, fqdn+"/TagResourceCollectionPage.NextWithContext") 13209 defer func() { 13210 sc := -1 13211 if page.Response().Response.Response != nil { 13212 sc = page.Response().Response.Response.StatusCode 13213 } 13214 tracing.EndSpan(ctx, sc, err) 13215 }() 13216 } 13217 for { 13218 next, err := page.fn(ctx, page.trc) 13219 if err != nil { 13220 return err 13221 } 13222 page.trc = next 13223 if !next.hasNextLink() || !next.IsEmpty() { 13224 break 13225 } 13226 } 13227 return nil 13228} 13229 13230// Next advances to the next page of values. If there was an error making 13231// the request the page does not advance and the error is returned. 13232// Deprecated: Use NextWithContext() instead. 13233func (page *TagResourceCollectionPage) Next() error { 13234 return page.NextWithContext(context.Background()) 13235} 13236 13237// NotDone returns true if the page enumeration should be started or is not yet complete. 13238func (page TagResourceCollectionPage) NotDone() bool { 13239 return !page.trc.IsEmpty() 13240} 13241 13242// Response returns the raw server response from the last page request. 13243func (page TagResourceCollectionPage) Response() TagResourceCollection { 13244 return page.trc 13245} 13246 13247// Values returns the slice of values for the current page or nil if there are no values. 13248func (page TagResourceCollectionPage) Values() []TagResourceContract { 13249 if page.trc.IsEmpty() { 13250 return nil 13251 } 13252 return *page.trc.Value 13253} 13254 13255// Creates a new instance of the TagResourceCollectionPage type. 13256func NewTagResourceCollectionPage(cur TagResourceCollection, getNextPage func(context.Context, TagResourceCollection) (TagResourceCollection, error)) TagResourceCollectionPage { 13257 return TagResourceCollectionPage{ 13258 fn: getNextPage, 13259 trc: cur, 13260 } 13261} 13262 13263// TagResourceContract tagResource contract properties. 13264type TagResourceContract struct { 13265 // Tag - Tag associated with the resource. 13266 Tag *TagTagResourceContractProperties `json:"tag,omitempty"` 13267 // API - Api associated with the tag. 13268 API *APITagResourceContractProperties `json:"api,omitempty"` 13269 // Operation - Operation associated with the tag. 13270 Operation *OperationTagResourceContractProperties `json:"operation,omitempty"` 13271 // Product - Product associated with the tag. 13272 Product *ProductTagResourceContractProperties `json:"product,omitempty"` 13273} 13274 13275// TagTagResourceContractProperties contract defining the Tag property in the Tag Resource Contract 13276type TagTagResourceContractProperties struct { 13277 // ID - Tag identifier 13278 ID *string `json:"id,omitempty"` 13279 // Name - Tag Name 13280 Name *string `json:"name,omitempty"` 13281} 13282 13283// TenantConfigurationDeployFuture an abstraction for monitoring and retrieving the results of a 13284// long-running operation. 13285type TenantConfigurationDeployFuture struct { 13286 azure.FutureAPI 13287 // Result returns the result of the asynchronous operation. 13288 // If the operation has not completed it will return an error. 13289 Result func(TenantConfigurationClient) (OperationResultContract, error) 13290} 13291 13292// UnmarshalJSON is the custom unmarshaller for CreateFuture. 13293func (future *TenantConfigurationDeployFuture) UnmarshalJSON(body []byte) error { 13294 var azFuture azure.Future 13295 if err := json.Unmarshal(body, &azFuture); err != nil { 13296 return err 13297 } 13298 future.FutureAPI = &azFuture 13299 future.Result = future.result 13300 return nil 13301} 13302 13303// result is the default implementation for TenantConfigurationDeployFuture.Result. 13304func (future *TenantConfigurationDeployFuture) result(client TenantConfigurationClient) (orc OperationResultContract, err error) { 13305 var done bool 13306 done, err = future.DoneWithContext(context.Background(), client) 13307 if err != nil { 13308 err = autorest.NewErrorWithError(err, "apimanagement.TenantConfigurationDeployFuture", "Result", future.Response(), "Polling failure") 13309 return 13310 } 13311 if !done { 13312 orc.Response.Response = future.Response() 13313 err = azure.NewAsyncOpIncompleteError("apimanagement.TenantConfigurationDeployFuture") 13314 return 13315 } 13316 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 13317 if orc.Response.Response, err = future.GetResult(sender); err == nil && orc.Response.Response.StatusCode != http.StatusNoContent { 13318 orc, err = client.DeployResponder(orc.Response.Response) 13319 if err != nil { 13320 err = autorest.NewErrorWithError(err, "apimanagement.TenantConfigurationDeployFuture", "Result", orc.Response.Response, "Failure responding to request") 13321 } 13322 } 13323 return 13324} 13325 13326// TenantConfigurationSaveFuture an abstraction for monitoring and retrieving the results of a long-running 13327// operation. 13328type TenantConfigurationSaveFuture struct { 13329 azure.FutureAPI 13330 // Result returns the result of the asynchronous operation. 13331 // If the operation has not completed it will return an error. 13332 Result func(TenantConfigurationClient) (OperationResultContract, error) 13333} 13334 13335// UnmarshalJSON is the custom unmarshaller for CreateFuture. 13336func (future *TenantConfigurationSaveFuture) UnmarshalJSON(body []byte) error { 13337 var azFuture azure.Future 13338 if err := json.Unmarshal(body, &azFuture); err != nil { 13339 return err 13340 } 13341 future.FutureAPI = &azFuture 13342 future.Result = future.result 13343 return nil 13344} 13345 13346// result is the default implementation for TenantConfigurationSaveFuture.Result. 13347func (future *TenantConfigurationSaveFuture) result(client TenantConfigurationClient) (orc OperationResultContract, err error) { 13348 var done bool 13349 done, err = future.DoneWithContext(context.Background(), client) 13350 if err != nil { 13351 err = autorest.NewErrorWithError(err, "apimanagement.TenantConfigurationSaveFuture", "Result", future.Response(), "Polling failure") 13352 return 13353 } 13354 if !done { 13355 orc.Response.Response = future.Response() 13356 err = azure.NewAsyncOpIncompleteError("apimanagement.TenantConfigurationSaveFuture") 13357 return 13358 } 13359 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 13360 if orc.Response.Response, err = future.GetResult(sender); err == nil && orc.Response.Response.StatusCode != http.StatusNoContent { 13361 orc, err = client.SaveResponder(orc.Response.Response) 13362 if err != nil { 13363 err = autorest.NewErrorWithError(err, "apimanagement.TenantConfigurationSaveFuture", "Result", orc.Response.Response, "Failure responding to request") 13364 } 13365 } 13366 return 13367} 13368 13369// TenantConfigurationSyncStateContract tenant Configuration Synchronization State. 13370type TenantConfigurationSyncStateContract struct { 13371 autorest.Response `json:"-"` 13372 // Branch - The name of Git branch. 13373 Branch *string `json:"branch,omitempty"` 13374 // CommitID - The latest commit Id. 13375 CommitID *string `json:"commitId,omitempty"` 13376 // IsExport - value indicating if last sync was save (true) or deploy (false) operation. 13377 IsExport *bool `json:"isExport,omitempty"` 13378 // IsSynced - value indicating if last synchronization was later than the configuration change. 13379 IsSynced *bool `json:"isSynced,omitempty"` 13380 // IsGitEnabled - value indicating whether Git configuration access is enabled. 13381 IsGitEnabled *bool `json:"isGitEnabled,omitempty"` 13382 // 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. 13383 SyncDate *date.Time `json:"syncDate,omitempty"` 13384 // 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. 13385 ConfigurationChangeDate *date.Time `json:"configurationChangeDate,omitempty"` 13386} 13387 13388// TenantConfigurationValidateFuture an abstraction for monitoring and retrieving the results of a 13389// long-running operation. 13390type TenantConfigurationValidateFuture struct { 13391 azure.FutureAPI 13392 // Result returns the result of the asynchronous operation. 13393 // If the operation has not completed it will return an error. 13394 Result func(TenantConfigurationClient) (OperationResultContract, error) 13395} 13396 13397// UnmarshalJSON is the custom unmarshaller for CreateFuture. 13398func (future *TenantConfigurationValidateFuture) UnmarshalJSON(body []byte) error { 13399 var azFuture azure.Future 13400 if err := json.Unmarshal(body, &azFuture); err != nil { 13401 return err 13402 } 13403 future.FutureAPI = &azFuture 13404 future.Result = future.result 13405 return nil 13406} 13407 13408// result is the default implementation for TenantConfigurationValidateFuture.Result. 13409func (future *TenantConfigurationValidateFuture) result(client TenantConfigurationClient) (orc OperationResultContract, err error) { 13410 var done bool 13411 done, err = future.DoneWithContext(context.Background(), client) 13412 if err != nil { 13413 err = autorest.NewErrorWithError(err, "apimanagement.TenantConfigurationValidateFuture", "Result", future.Response(), "Polling failure") 13414 return 13415 } 13416 if !done { 13417 orc.Response.Response = future.Response() 13418 err = azure.NewAsyncOpIncompleteError("apimanagement.TenantConfigurationValidateFuture") 13419 return 13420 } 13421 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 13422 if orc.Response.Response, err = future.GetResult(sender); err == nil && orc.Response.Response.StatusCode != http.StatusNoContent { 13423 orc, err = client.ValidateResponder(orc.Response.Response) 13424 if err != nil { 13425 err = autorest.NewErrorWithError(err, "apimanagement.TenantConfigurationValidateFuture", "Result", orc.Response.Response, "Failure responding to request") 13426 } 13427 } 13428 return 13429} 13430 13431// TermsOfServiceProperties terms of service contract properties. 13432type TermsOfServiceProperties struct { 13433 // Text - A terms of service text. 13434 Text *string `json:"text,omitempty"` 13435 // Enabled - Display terms of service during a sign-up process. 13436 Enabled *bool `json:"enabled,omitempty"` 13437 // ConsentRequired - Ask user for consent to the terms of service. 13438 ConsentRequired *bool `json:"consentRequired,omitempty"` 13439} 13440 13441// TokenBodyParameterContract oAuth acquire token request body parameter (www-url-form-encoded). 13442type TokenBodyParameterContract struct { 13443 // Name - body parameter name. 13444 Name *string `json:"name,omitempty"` 13445 // Value - body parameter value. 13446 Value *string `json:"value,omitempty"` 13447} 13448 13449// UserCollection paged Users list representation. 13450type UserCollection struct { 13451 autorest.Response `json:"-"` 13452 // Value - Page values. 13453 Value *[]UserContract `json:"value,omitempty"` 13454 // NextLink - Next page link if any. 13455 NextLink *string `json:"nextLink,omitempty"` 13456} 13457 13458// UserCollectionIterator provides access to a complete listing of UserContract values. 13459type UserCollectionIterator struct { 13460 i int 13461 page UserCollectionPage 13462} 13463 13464// NextWithContext advances to the next value. If there was an error making 13465// the request the iterator does not advance and the error is returned. 13466func (iter *UserCollectionIterator) NextWithContext(ctx context.Context) (err error) { 13467 if tracing.IsEnabled() { 13468 ctx = tracing.StartSpan(ctx, fqdn+"/UserCollectionIterator.NextWithContext") 13469 defer func() { 13470 sc := -1 13471 if iter.Response().Response.Response != nil { 13472 sc = iter.Response().Response.Response.StatusCode 13473 } 13474 tracing.EndSpan(ctx, sc, err) 13475 }() 13476 } 13477 iter.i++ 13478 if iter.i < len(iter.page.Values()) { 13479 return nil 13480 } 13481 err = iter.page.NextWithContext(ctx) 13482 if err != nil { 13483 iter.i-- 13484 return err 13485 } 13486 iter.i = 0 13487 return nil 13488} 13489 13490// Next advances to the next value. If there was an error making 13491// the request the iterator does not advance and the error is returned. 13492// Deprecated: Use NextWithContext() instead. 13493func (iter *UserCollectionIterator) Next() error { 13494 return iter.NextWithContext(context.Background()) 13495} 13496 13497// NotDone returns true if the enumeration should be started or is not yet complete. 13498func (iter UserCollectionIterator) NotDone() bool { 13499 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 13500} 13501 13502// Response returns the raw server response from the last page request. 13503func (iter UserCollectionIterator) Response() UserCollection { 13504 return iter.page.Response() 13505} 13506 13507// Value returns the current value or a zero-initialized value if the 13508// iterator has advanced beyond the end of the collection. 13509func (iter UserCollectionIterator) Value() UserContract { 13510 if !iter.page.NotDone() { 13511 return UserContract{} 13512 } 13513 return iter.page.Values()[iter.i] 13514} 13515 13516// Creates a new instance of the UserCollectionIterator type. 13517func NewUserCollectionIterator(page UserCollectionPage) UserCollectionIterator { 13518 return UserCollectionIterator{page: page} 13519} 13520 13521// IsEmpty returns true if the ListResult contains no values. 13522func (uc UserCollection) IsEmpty() bool { 13523 return uc.Value == nil || len(*uc.Value) == 0 13524} 13525 13526// hasNextLink returns true if the NextLink is not empty. 13527func (uc UserCollection) hasNextLink() bool { 13528 return uc.NextLink != nil && len(*uc.NextLink) != 0 13529} 13530 13531// userCollectionPreparer prepares a request to retrieve the next set of results. 13532// It returns nil if no more results exist. 13533func (uc UserCollection) userCollectionPreparer(ctx context.Context) (*http.Request, error) { 13534 if !uc.hasNextLink() { 13535 return nil, nil 13536 } 13537 return autorest.Prepare((&http.Request{}).WithContext(ctx), 13538 autorest.AsJSON(), 13539 autorest.AsGet(), 13540 autorest.WithBaseURL(to.String(uc.NextLink))) 13541} 13542 13543// UserCollectionPage contains a page of UserContract values. 13544type UserCollectionPage struct { 13545 fn func(context.Context, UserCollection) (UserCollection, error) 13546 uc UserCollection 13547} 13548 13549// NextWithContext advances to the next page of values. If there was an error making 13550// the request the page does not advance and the error is returned. 13551func (page *UserCollectionPage) NextWithContext(ctx context.Context) (err error) { 13552 if tracing.IsEnabled() { 13553 ctx = tracing.StartSpan(ctx, fqdn+"/UserCollectionPage.NextWithContext") 13554 defer func() { 13555 sc := -1 13556 if page.Response().Response.Response != nil { 13557 sc = page.Response().Response.Response.StatusCode 13558 } 13559 tracing.EndSpan(ctx, sc, err) 13560 }() 13561 } 13562 for { 13563 next, err := page.fn(ctx, page.uc) 13564 if err != nil { 13565 return err 13566 } 13567 page.uc = next 13568 if !next.hasNextLink() || !next.IsEmpty() { 13569 break 13570 } 13571 } 13572 return nil 13573} 13574 13575// Next advances to the next page of values. If there was an error making 13576// the request the page does not advance and the error is returned. 13577// Deprecated: Use NextWithContext() instead. 13578func (page *UserCollectionPage) Next() error { 13579 return page.NextWithContext(context.Background()) 13580} 13581 13582// NotDone returns true if the page enumeration should be started or is not yet complete. 13583func (page UserCollectionPage) NotDone() bool { 13584 return !page.uc.IsEmpty() 13585} 13586 13587// Response returns the raw server response from the last page request. 13588func (page UserCollectionPage) Response() UserCollection { 13589 return page.uc 13590} 13591 13592// Values returns the slice of values for the current page or nil if there are no values. 13593func (page UserCollectionPage) Values() []UserContract { 13594 if page.uc.IsEmpty() { 13595 return nil 13596 } 13597 return *page.uc.Value 13598} 13599 13600// Creates a new instance of the UserCollectionPage type. 13601func NewUserCollectionPage(cur UserCollection, getNextPage func(context.Context, UserCollection) (UserCollection, error)) UserCollectionPage { 13602 return UserCollectionPage{ 13603 fn: getNextPage, 13604 uc: cur, 13605 } 13606} 13607 13608// UserContract user details. 13609type UserContract struct { 13610 autorest.Response `json:"-"` 13611 // UserContractProperties - User entity contract properties. 13612 *UserContractProperties `json:"properties,omitempty"` 13613 // ID - READ-ONLY; Resource ID. 13614 ID *string `json:"id,omitempty"` 13615 // Name - READ-ONLY; Resource name. 13616 Name *string `json:"name,omitempty"` 13617 // Type - READ-ONLY; Resource type for API Management resource. 13618 Type *string `json:"type,omitempty"` 13619} 13620 13621// MarshalJSON is the custom marshaler for UserContract. 13622func (uc UserContract) MarshalJSON() ([]byte, error) { 13623 objectMap := make(map[string]interface{}) 13624 if uc.UserContractProperties != nil { 13625 objectMap["properties"] = uc.UserContractProperties 13626 } 13627 return json.Marshal(objectMap) 13628} 13629 13630// UnmarshalJSON is the custom unmarshaler for UserContract struct. 13631func (uc *UserContract) UnmarshalJSON(body []byte) error { 13632 var m map[string]*json.RawMessage 13633 err := json.Unmarshal(body, &m) 13634 if err != nil { 13635 return err 13636 } 13637 for k, v := range m { 13638 switch k { 13639 case "properties": 13640 if v != nil { 13641 var userContractProperties UserContractProperties 13642 err = json.Unmarshal(*v, &userContractProperties) 13643 if err != nil { 13644 return err 13645 } 13646 uc.UserContractProperties = &userContractProperties 13647 } 13648 case "id": 13649 if v != nil { 13650 var ID string 13651 err = json.Unmarshal(*v, &ID) 13652 if err != nil { 13653 return err 13654 } 13655 uc.ID = &ID 13656 } 13657 case "name": 13658 if v != nil { 13659 var name string 13660 err = json.Unmarshal(*v, &name) 13661 if err != nil { 13662 return err 13663 } 13664 uc.Name = &name 13665 } 13666 case "type": 13667 if v != nil { 13668 var typeVar string 13669 err = json.Unmarshal(*v, &typeVar) 13670 if err != nil { 13671 return err 13672 } 13673 uc.Type = &typeVar 13674 } 13675 } 13676 } 13677 13678 return nil 13679} 13680 13681// UserContractProperties user profile. 13682type UserContractProperties struct { 13683 // FirstName - First name. 13684 FirstName *string `json:"firstName,omitempty"` 13685 // LastName - Last name. 13686 LastName *string `json:"lastName,omitempty"` 13687 // Email - Email address. 13688 Email *string `json:"email,omitempty"` 13689 // RegistrationDate - Date of user registration. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. 13690 RegistrationDate *date.Time `json:"registrationDate,omitempty"` 13691 // Groups - READ-ONLY; Collection of groups user is part of. 13692 Groups *[]GroupContractProperties `json:"groups,omitempty"` 13693 // 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' 13694 State UserState `json:"state,omitempty"` 13695 // Note - Optional note about a user set by the administrator. 13696 Note *string `json:"note,omitempty"` 13697 // Identities - Collection of user identities. 13698 Identities *[]UserIdentityContract `json:"identities,omitempty"` 13699} 13700 13701// MarshalJSON is the custom marshaler for UserContractProperties. 13702func (ucp UserContractProperties) MarshalJSON() ([]byte, error) { 13703 objectMap := make(map[string]interface{}) 13704 if ucp.FirstName != nil { 13705 objectMap["firstName"] = ucp.FirstName 13706 } 13707 if ucp.LastName != nil { 13708 objectMap["lastName"] = ucp.LastName 13709 } 13710 if ucp.Email != nil { 13711 objectMap["email"] = ucp.Email 13712 } 13713 if ucp.RegistrationDate != nil { 13714 objectMap["registrationDate"] = ucp.RegistrationDate 13715 } 13716 if ucp.State != "" { 13717 objectMap["state"] = ucp.State 13718 } 13719 if ucp.Note != nil { 13720 objectMap["note"] = ucp.Note 13721 } 13722 if ucp.Identities != nil { 13723 objectMap["identities"] = ucp.Identities 13724 } 13725 return json.Marshal(objectMap) 13726} 13727 13728// UserCreateParameterProperties parameters supplied to the Create User operation. 13729type UserCreateParameterProperties struct { 13730 // Email - Email address. Must not be empty and must be unique within the service instance. 13731 Email *string `json:"email,omitempty"` 13732 // FirstName - First name. 13733 FirstName *string `json:"firstName,omitempty"` 13734 // LastName - Last name. 13735 LastName *string `json:"lastName,omitempty"` 13736 // Password - User Password. If no value is provided, a default password is generated. 13737 Password *string `json:"password,omitempty"` 13738 // AppType - Determines the type of application which send the create user request. Default is legacy portal. Possible values include: 'Portal', 'DeveloperPortal' 13739 AppType AppType `json:"appType,omitempty"` 13740 // Confirmation - Determines the type of confirmation e-mail that will be sent to the newly created user. Possible values include: 'Signup', 'Invite' 13741 Confirmation Confirmation `json:"confirmation,omitempty"` 13742 // 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' 13743 State UserState `json:"state,omitempty"` 13744 // Note - Optional note about a user set by the administrator. 13745 Note *string `json:"note,omitempty"` 13746 // Identities - Collection of user identities. 13747 Identities *[]UserIdentityContract `json:"identities,omitempty"` 13748} 13749 13750// UserCreateParameters user create details. 13751type UserCreateParameters struct { 13752 // UserCreateParameterProperties - User entity create contract properties. 13753 *UserCreateParameterProperties `json:"properties,omitempty"` 13754} 13755 13756// MarshalJSON is the custom marshaler for UserCreateParameters. 13757func (ucp UserCreateParameters) MarshalJSON() ([]byte, error) { 13758 objectMap := make(map[string]interface{}) 13759 if ucp.UserCreateParameterProperties != nil { 13760 objectMap["properties"] = ucp.UserCreateParameterProperties 13761 } 13762 return json.Marshal(objectMap) 13763} 13764 13765// UnmarshalJSON is the custom unmarshaler for UserCreateParameters struct. 13766func (ucp *UserCreateParameters) UnmarshalJSON(body []byte) error { 13767 var m map[string]*json.RawMessage 13768 err := json.Unmarshal(body, &m) 13769 if err != nil { 13770 return err 13771 } 13772 for k, v := range m { 13773 switch k { 13774 case "properties": 13775 if v != nil { 13776 var userCreateParameterProperties UserCreateParameterProperties 13777 err = json.Unmarshal(*v, &userCreateParameterProperties) 13778 if err != nil { 13779 return err 13780 } 13781 ucp.UserCreateParameterProperties = &userCreateParameterProperties 13782 } 13783 } 13784 } 13785 13786 return nil 13787} 13788 13789// UserEntityBaseParameters user Entity Base Parameters set. 13790type UserEntityBaseParameters struct { 13791 // 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' 13792 State UserState `json:"state,omitempty"` 13793 // Note - Optional note about a user set by the administrator. 13794 Note *string `json:"note,omitempty"` 13795 // Identities - Collection of user identities. 13796 Identities *[]UserIdentityContract `json:"identities,omitempty"` 13797} 13798 13799// UserIdentityCollection list of Users Identity list representation. 13800type UserIdentityCollection struct { 13801 autorest.Response `json:"-"` 13802 // Value - User Identity values. 13803 Value *[]UserIdentityContract `json:"value,omitempty"` 13804 // Count - Total record count number across all pages. 13805 Count *int64 `json:"count,omitempty"` 13806 // NextLink - Next page link if any. 13807 NextLink *string `json:"nextLink,omitempty"` 13808} 13809 13810// UserIdentityCollectionIterator provides access to a complete listing of UserIdentityContract values. 13811type UserIdentityCollectionIterator struct { 13812 i int 13813 page UserIdentityCollectionPage 13814} 13815 13816// NextWithContext advances to the next value. If there was an error making 13817// the request the iterator does not advance and the error is returned. 13818func (iter *UserIdentityCollectionIterator) NextWithContext(ctx context.Context) (err error) { 13819 if tracing.IsEnabled() { 13820 ctx = tracing.StartSpan(ctx, fqdn+"/UserIdentityCollectionIterator.NextWithContext") 13821 defer func() { 13822 sc := -1 13823 if iter.Response().Response.Response != nil { 13824 sc = iter.Response().Response.Response.StatusCode 13825 } 13826 tracing.EndSpan(ctx, sc, err) 13827 }() 13828 } 13829 iter.i++ 13830 if iter.i < len(iter.page.Values()) { 13831 return nil 13832 } 13833 err = iter.page.NextWithContext(ctx) 13834 if err != nil { 13835 iter.i-- 13836 return err 13837 } 13838 iter.i = 0 13839 return nil 13840} 13841 13842// Next advances to the next value. If there was an error making 13843// the request the iterator does not advance and the error is returned. 13844// Deprecated: Use NextWithContext() instead. 13845func (iter *UserIdentityCollectionIterator) Next() error { 13846 return iter.NextWithContext(context.Background()) 13847} 13848 13849// NotDone returns true if the enumeration should be started or is not yet complete. 13850func (iter UserIdentityCollectionIterator) NotDone() bool { 13851 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 13852} 13853 13854// Response returns the raw server response from the last page request. 13855func (iter UserIdentityCollectionIterator) Response() UserIdentityCollection { 13856 return iter.page.Response() 13857} 13858 13859// Value returns the current value or a zero-initialized value if the 13860// iterator has advanced beyond the end of the collection. 13861func (iter UserIdentityCollectionIterator) Value() UserIdentityContract { 13862 if !iter.page.NotDone() { 13863 return UserIdentityContract{} 13864 } 13865 return iter.page.Values()[iter.i] 13866} 13867 13868// Creates a new instance of the UserIdentityCollectionIterator type. 13869func NewUserIdentityCollectionIterator(page UserIdentityCollectionPage) UserIdentityCollectionIterator { 13870 return UserIdentityCollectionIterator{page: page} 13871} 13872 13873// IsEmpty returns true if the ListResult contains no values. 13874func (uic UserIdentityCollection) IsEmpty() bool { 13875 return uic.Value == nil || len(*uic.Value) == 0 13876} 13877 13878// hasNextLink returns true if the NextLink is not empty. 13879func (uic UserIdentityCollection) hasNextLink() bool { 13880 return uic.NextLink != nil && len(*uic.NextLink) != 0 13881} 13882 13883// userIdentityCollectionPreparer prepares a request to retrieve the next set of results. 13884// It returns nil if no more results exist. 13885func (uic UserIdentityCollection) userIdentityCollectionPreparer(ctx context.Context) (*http.Request, error) { 13886 if !uic.hasNextLink() { 13887 return nil, nil 13888 } 13889 return autorest.Prepare((&http.Request{}).WithContext(ctx), 13890 autorest.AsJSON(), 13891 autorest.AsGet(), 13892 autorest.WithBaseURL(to.String(uic.NextLink))) 13893} 13894 13895// UserIdentityCollectionPage contains a page of UserIdentityContract values. 13896type UserIdentityCollectionPage struct { 13897 fn func(context.Context, UserIdentityCollection) (UserIdentityCollection, error) 13898 uic UserIdentityCollection 13899} 13900 13901// NextWithContext advances to the next page of values. If there was an error making 13902// the request the page does not advance and the error is returned. 13903func (page *UserIdentityCollectionPage) NextWithContext(ctx context.Context) (err error) { 13904 if tracing.IsEnabled() { 13905 ctx = tracing.StartSpan(ctx, fqdn+"/UserIdentityCollectionPage.NextWithContext") 13906 defer func() { 13907 sc := -1 13908 if page.Response().Response.Response != nil { 13909 sc = page.Response().Response.Response.StatusCode 13910 } 13911 tracing.EndSpan(ctx, sc, err) 13912 }() 13913 } 13914 for { 13915 next, err := page.fn(ctx, page.uic) 13916 if err != nil { 13917 return err 13918 } 13919 page.uic = next 13920 if !next.hasNextLink() || !next.IsEmpty() { 13921 break 13922 } 13923 } 13924 return nil 13925} 13926 13927// Next advances to the next page of values. If there was an error making 13928// the request the page does not advance and the error is returned. 13929// Deprecated: Use NextWithContext() instead. 13930func (page *UserIdentityCollectionPage) Next() error { 13931 return page.NextWithContext(context.Background()) 13932} 13933 13934// NotDone returns true if the page enumeration should be started or is not yet complete. 13935func (page UserIdentityCollectionPage) NotDone() bool { 13936 return !page.uic.IsEmpty() 13937} 13938 13939// Response returns the raw server response from the last page request. 13940func (page UserIdentityCollectionPage) Response() UserIdentityCollection { 13941 return page.uic 13942} 13943 13944// Values returns the slice of values for the current page or nil if there are no values. 13945func (page UserIdentityCollectionPage) Values() []UserIdentityContract { 13946 if page.uic.IsEmpty() { 13947 return nil 13948 } 13949 return *page.uic.Value 13950} 13951 13952// Creates a new instance of the UserIdentityCollectionPage type. 13953func NewUserIdentityCollectionPage(cur UserIdentityCollection, getNextPage func(context.Context, UserIdentityCollection) (UserIdentityCollection, error)) UserIdentityCollectionPage { 13954 return UserIdentityCollectionPage{ 13955 fn: getNextPage, 13956 uic: cur, 13957 } 13958} 13959 13960// UserIdentityContract user identity details. 13961type UserIdentityContract struct { 13962 // Provider - Identity provider name. 13963 Provider *string `json:"provider,omitempty"` 13964 // ID - Identifier value within provider. 13965 ID *string `json:"id,omitempty"` 13966} 13967 13968// UserIdentityProperties ... 13969type UserIdentityProperties struct { 13970 // PrincipalID - The principal id of user assigned identity. 13971 PrincipalID *string `json:"principalId,omitempty"` 13972 // ClientID - The client id of user assigned identity. 13973 ClientID *string `json:"clientId,omitempty"` 13974} 13975 13976// UserTokenParameterProperties parameters supplied to the Get User Token operation. 13977type UserTokenParameterProperties struct { 13978 // KeyType - The Key to be used to generate token for user. Possible values include: 'Primary', 'Secondary' 13979 KeyType KeyType `json:"keyType,omitempty"` 13980 // 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. 13981 Expiry *date.Time `json:"expiry,omitempty"` 13982} 13983 13984// UserTokenParameters get User Token parameters. 13985type UserTokenParameters struct { 13986 // UserTokenParameterProperties - User Token Parameter contract properties. 13987 *UserTokenParameterProperties `json:"properties,omitempty"` 13988} 13989 13990// MarshalJSON is the custom marshaler for UserTokenParameters. 13991func (utp UserTokenParameters) MarshalJSON() ([]byte, error) { 13992 objectMap := make(map[string]interface{}) 13993 if utp.UserTokenParameterProperties != nil { 13994 objectMap["properties"] = utp.UserTokenParameterProperties 13995 } 13996 return json.Marshal(objectMap) 13997} 13998 13999// UnmarshalJSON is the custom unmarshaler for UserTokenParameters struct. 14000func (utp *UserTokenParameters) UnmarshalJSON(body []byte) error { 14001 var m map[string]*json.RawMessage 14002 err := json.Unmarshal(body, &m) 14003 if err != nil { 14004 return err 14005 } 14006 for k, v := range m { 14007 switch k { 14008 case "properties": 14009 if v != nil { 14010 var userTokenParameterProperties UserTokenParameterProperties 14011 err = json.Unmarshal(*v, &userTokenParameterProperties) 14012 if err != nil { 14013 return err 14014 } 14015 utp.UserTokenParameterProperties = &userTokenParameterProperties 14016 } 14017 } 14018 } 14019 14020 return nil 14021} 14022 14023// UserTokenResult get User Token response details. 14024type UserTokenResult struct { 14025 autorest.Response `json:"-"` 14026 // Value - Shared Access Authorization token for the User. 14027 Value *string `json:"value,omitempty"` 14028} 14029 14030// UserUpdateParameters user update parameters. 14031type UserUpdateParameters struct { 14032 // UserUpdateParametersProperties - User entity update contract properties. 14033 *UserUpdateParametersProperties `json:"properties,omitempty"` 14034} 14035 14036// MarshalJSON is the custom marshaler for UserUpdateParameters. 14037func (uup UserUpdateParameters) MarshalJSON() ([]byte, error) { 14038 objectMap := make(map[string]interface{}) 14039 if uup.UserUpdateParametersProperties != nil { 14040 objectMap["properties"] = uup.UserUpdateParametersProperties 14041 } 14042 return json.Marshal(objectMap) 14043} 14044 14045// UnmarshalJSON is the custom unmarshaler for UserUpdateParameters struct. 14046func (uup *UserUpdateParameters) UnmarshalJSON(body []byte) error { 14047 var m map[string]*json.RawMessage 14048 err := json.Unmarshal(body, &m) 14049 if err != nil { 14050 return err 14051 } 14052 for k, v := range m { 14053 switch k { 14054 case "properties": 14055 if v != nil { 14056 var userUpdateParametersProperties UserUpdateParametersProperties 14057 err = json.Unmarshal(*v, &userUpdateParametersProperties) 14058 if err != nil { 14059 return err 14060 } 14061 uup.UserUpdateParametersProperties = &userUpdateParametersProperties 14062 } 14063 } 14064 } 14065 14066 return nil 14067} 14068 14069// UserUpdateParametersProperties parameters supplied to the Update User operation. 14070type UserUpdateParametersProperties struct { 14071 // Email - Email address. Must not be empty and must be unique within the service instance. 14072 Email *string `json:"email,omitempty"` 14073 // Password - User Password. 14074 Password *string `json:"password,omitempty"` 14075 // FirstName - First name. 14076 FirstName *string `json:"firstName,omitempty"` 14077 // LastName - Last name. 14078 LastName *string `json:"lastName,omitempty"` 14079 // 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' 14080 State UserState `json:"state,omitempty"` 14081 // Note - Optional note about a user set by the administrator. 14082 Note *string `json:"note,omitempty"` 14083 // Identities - Collection of user identities. 14084 Identities *[]UserIdentityContract `json:"identities,omitempty"` 14085} 14086 14087// VirtualNetworkConfiguration configuration of a virtual network to which API Management service is 14088// deployed. 14089type VirtualNetworkConfiguration struct { 14090 // Vnetid - READ-ONLY; The virtual network ID. This is typically a GUID. Expect a null GUID by default. 14091 Vnetid *string `json:"vnetid,omitempty"` 14092 // Subnetname - READ-ONLY; The name of the subnet. 14093 Subnetname *string `json:"subnetname,omitempty"` 14094 // SubnetResourceID - The full resource ID of a subnet in a virtual network to deploy the API Management service in. 14095 SubnetResourceID *string `json:"subnetResourceId,omitempty"` 14096} 14097 14098// MarshalJSON is the custom marshaler for VirtualNetworkConfiguration. 14099func (vnc VirtualNetworkConfiguration) MarshalJSON() ([]byte, error) { 14100 objectMap := make(map[string]interface{}) 14101 if vnc.SubnetResourceID != nil { 14102 objectMap["subnetResourceId"] = vnc.SubnetResourceID 14103 } 14104 return json.Marshal(objectMap) 14105} 14106 14107// X509CertificateName properties of server X509Names. 14108type X509CertificateName struct { 14109 // Name - Common Name of the Certificate. 14110 Name *string `json:"name,omitempty"` 14111 // IssuerCertificateThumbprint - Thumbprint for the Issuer of the Certificate. 14112 IssuerCertificateThumbprint *string `json:"issuerCertificateThumbprint,omitempty"` 14113} 14114