1package appplatform 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 "net/http" 18) 19 20// The package's fully qualified name. 21const fqdn = "github.com/Azure/azure-sdk-for-go/services/appplatform/mgmt/2020-07-01/appplatform" 22 23// AppResource app resource payload 24type AppResource struct { 25 autorest.Response `json:"-"` 26 // Properties - Properties of the App resource 27 Properties *AppResourceProperties `json:"properties,omitempty"` 28 // Identity - The Managed Identity type of the app resource 29 Identity *ManagedIdentityProperties `json:"identity,omitempty"` 30 // Location - The GEO location of the application, always the same with its parent resource 31 Location *string `json:"location,omitempty"` 32 // ID - READ-ONLY; Fully qualified resource Id for the resource. 33 ID *string `json:"id,omitempty"` 34 // Name - READ-ONLY; The name of the resource. 35 Name *string `json:"name,omitempty"` 36 // Type - READ-ONLY; The type of the resource. 37 Type *string `json:"type,omitempty"` 38} 39 40// MarshalJSON is the custom marshaler for AppResource. 41func (ar AppResource) MarshalJSON() ([]byte, error) { 42 objectMap := make(map[string]interface{}) 43 if ar.Properties != nil { 44 objectMap["properties"] = ar.Properties 45 } 46 if ar.Identity != nil { 47 objectMap["identity"] = ar.Identity 48 } 49 if ar.Location != nil { 50 objectMap["location"] = ar.Location 51 } 52 return json.Marshal(objectMap) 53} 54 55// AppResourceCollection object that includes an array of App resources and a possible link for next set 56type AppResourceCollection struct { 57 autorest.Response `json:"-"` 58 // Value - Collection of App resources 59 Value *[]AppResource `json:"value,omitempty"` 60 // NextLink - URL client should use to fetch the next page (per server side paging). 61 // It's null for now, added for future use. 62 NextLink *string `json:"nextLink,omitempty"` 63} 64 65// AppResourceCollectionIterator provides access to a complete listing of AppResource values. 66type AppResourceCollectionIterator struct { 67 i int 68 page AppResourceCollectionPage 69} 70 71// NextWithContext advances to the next value. If there was an error making 72// the request the iterator does not advance and the error is returned. 73func (iter *AppResourceCollectionIterator) NextWithContext(ctx context.Context) (err error) { 74 if tracing.IsEnabled() { 75 ctx = tracing.StartSpan(ctx, fqdn+"/AppResourceCollectionIterator.NextWithContext") 76 defer func() { 77 sc := -1 78 if iter.Response().Response.Response != nil { 79 sc = iter.Response().Response.Response.StatusCode 80 } 81 tracing.EndSpan(ctx, sc, err) 82 }() 83 } 84 iter.i++ 85 if iter.i < len(iter.page.Values()) { 86 return nil 87 } 88 err = iter.page.NextWithContext(ctx) 89 if err != nil { 90 iter.i-- 91 return err 92 } 93 iter.i = 0 94 return nil 95} 96 97// Next advances to the next value. If there was an error making 98// the request the iterator does not advance and the error is returned. 99// Deprecated: Use NextWithContext() instead. 100func (iter *AppResourceCollectionIterator) Next() error { 101 return iter.NextWithContext(context.Background()) 102} 103 104// NotDone returns true if the enumeration should be started or is not yet complete. 105func (iter AppResourceCollectionIterator) NotDone() bool { 106 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 107} 108 109// Response returns the raw server response from the last page request. 110func (iter AppResourceCollectionIterator) Response() AppResourceCollection { 111 return iter.page.Response() 112} 113 114// Value returns the current value or a zero-initialized value if the 115// iterator has advanced beyond the end of the collection. 116func (iter AppResourceCollectionIterator) Value() AppResource { 117 if !iter.page.NotDone() { 118 return AppResource{} 119 } 120 return iter.page.Values()[iter.i] 121} 122 123// Creates a new instance of the AppResourceCollectionIterator type. 124func NewAppResourceCollectionIterator(page AppResourceCollectionPage) AppResourceCollectionIterator { 125 return AppResourceCollectionIterator{page: page} 126} 127 128// IsEmpty returns true if the ListResult contains no values. 129func (arc AppResourceCollection) IsEmpty() bool { 130 return arc.Value == nil || len(*arc.Value) == 0 131} 132 133// hasNextLink returns true if the NextLink is not empty. 134func (arc AppResourceCollection) hasNextLink() bool { 135 return arc.NextLink != nil && len(*arc.NextLink) != 0 136} 137 138// appResourceCollectionPreparer prepares a request to retrieve the next set of results. 139// It returns nil if no more results exist. 140func (arc AppResourceCollection) appResourceCollectionPreparer(ctx context.Context) (*http.Request, error) { 141 if !arc.hasNextLink() { 142 return nil, nil 143 } 144 return autorest.Prepare((&http.Request{}).WithContext(ctx), 145 autorest.AsJSON(), 146 autorest.AsGet(), 147 autorest.WithBaseURL(to.String(arc.NextLink))) 148} 149 150// AppResourceCollectionPage contains a page of AppResource values. 151type AppResourceCollectionPage struct { 152 fn func(context.Context, AppResourceCollection) (AppResourceCollection, error) 153 arc AppResourceCollection 154} 155 156// NextWithContext advances to the next page of values. If there was an error making 157// the request the page does not advance and the error is returned. 158func (page *AppResourceCollectionPage) NextWithContext(ctx context.Context) (err error) { 159 if tracing.IsEnabled() { 160 ctx = tracing.StartSpan(ctx, fqdn+"/AppResourceCollectionPage.NextWithContext") 161 defer func() { 162 sc := -1 163 if page.Response().Response.Response != nil { 164 sc = page.Response().Response.Response.StatusCode 165 } 166 tracing.EndSpan(ctx, sc, err) 167 }() 168 } 169 for { 170 next, err := page.fn(ctx, page.arc) 171 if err != nil { 172 return err 173 } 174 page.arc = next 175 if !next.hasNextLink() || !next.IsEmpty() { 176 break 177 } 178 } 179 return nil 180} 181 182// Next advances to the next page of values. If there was an error making 183// the request the page does not advance and the error is returned. 184// Deprecated: Use NextWithContext() instead. 185func (page *AppResourceCollectionPage) Next() error { 186 return page.NextWithContext(context.Background()) 187} 188 189// NotDone returns true if the page enumeration should be started or is not yet complete. 190func (page AppResourceCollectionPage) NotDone() bool { 191 return !page.arc.IsEmpty() 192} 193 194// Response returns the raw server response from the last page request. 195func (page AppResourceCollectionPage) Response() AppResourceCollection { 196 return page.arc 197} 198 199// Values returns the slice of values for the current page or nil if there are no values. 200func (page AppResourceCollectionPage) Values() []AppResource { 201 if page.arc.IsEmpty() { 202 return nil 203 } 204 return *page.arc.Value 205} 206 207// Creates a new instance of the AppResourceCollectionPage type. 208func NewAppResourceCollectionPage(cur AppResourceCollection, getNextPage func(context.Context, AppResourceCollection) (AppResourceCollection, error)) AppResourceCollectionPage { 209 return AppResourceCollectionPage{ 210 fn: getNextPage, 211 arc: cur, 212 } 213} 214 215// AppResourceProperties app resource properties payload 216type AppResourceProperties struct { 217 // Public - Indicates whether the App exposes public endpoint 218 Public *bool `json:"public,omitempty"` 219 // URL - READ-ONLY; URL of the App 220 URL *string `json:"url,omitempty"` 221 // ProvisioningState - READ-ONLY; Provisioning state of the App. Possible values include: 'Succeeded', 'Failed', 'Creating', 'Updating' 222 ProvisioningState AppResourceProvisioningState `json:"provisioningState,omitempty"` 223 // ActiveDeploymentName - Name of the active deployment of the App 224 ActiveDeploymentName *string `json:"activeDeploymentName,omitempty"` 225 // Fqdn - Fully qualified dns Name. 226 Fqdn *string `json:"fqdn,omitempty"` 227 // HTTPSOnly - Indicate if only https is allowed. 228 HTTPSOnly *bool `json:"httpsOnly,omitempty"` 229 // CreatedTime - READ-ONLY; Date time when the resource is created 230 CreatedTime *date.Time `json:"createdTime,omitempty"` 231 // TemporaryDisk - Temporary disk settings 232 TemporaryDisk *TemporaryDisk `json:"temporaryDisk,omitempty"` 233 // PersistentDisk - Persistent disk settings 234 PersistentDisk *PersistentDisk `json:"persistentDisk,omitempty"` 235} 236 237// MarshalJSON is the custom marshaler for AppResourceProperties. 238func (arp AppResourceProperties) MarshalJSON() ([]byte, error) { 239 objectMap := make(map[string]interface{}) 240 if arp.Public != nil { 241 objectMap["public"] = arp.Public 242 } 243 if arp.ActiveDeploymentName != nil { 244 objectMap["activeDeploymentName"] = arp.ActiveDeploymentName 245 } 246 if arp.Fqdn != nil { 247 objectMap["fqdn"] = arp.Fqdn 248 } 249 if arp.HTTPSOnly != nil { 250 objectMap["httpsOnly"] = arp.HTTPSOnly 251 } 252 if arp.TemporaryDisk != nil { 253 objectMap["temporaryDisk"] = arp.TemporaryDisk 254 } 255 if arp.PersistentDisk != nil { 256 objectMap["persistentDisk"] = arp.PersistentDisk 257 } 258 return json.Marshal(objectMap) 259} 260 261// AppsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 262// operation. 263type AppsCreateOrUpdateFuture struct { 264 azure.FutureAPI 265 // Result returns the result of the asynchronous operation. 266 // If the operation has not completed it will return an error. 267 Result func(AppsClient) (AppResource, error) 268} 269 270// UnmarshalJSON is the custom unmarshaller for CreateFuture. 271func (future *AppsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 272 var azFuture azure.Future 273 if err := json.Unmarshal(body, &azFuture); err != nil { 274 return err 275 } 276 future.FutureAPI = &azFuture 277 future.Result = future.result 278 return nil 279} 280 281// result is the default implementation for AppsCreateOrUpdateFuture.Result. 282func (future *AppsCreateOrUpdateFuture) result(client AppsClient) (ar AppResource, err error) { 283 var done bool 284 done, err = future.DoneWithContext(context.Background(), client) 285 if err != nil { 286 err = autorest.NewErrorWithError(err, "appplatform.AppsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 287 return 288 } 289 if !done { 290 ar.Response.Response = future.Response() 291 err = azure.NewAsyncOpIncompleteError("appplatform.AppsCreateOrUpdateFuture") 292 return 293 } 294 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 295 if ar.Response.Response, err = future.GetResult(sender); err == nil && ar.Response.Response.StatusCode != http.StatusNoContent { 296 ar, err = client.CreateOrUpdateResponder(ar.Response.Response) 297 if err != nil { 298 err = autorest.NewErrorWithError(err, "appplatform.AppsCreateOrUpdateFuture", "Result", ar.Response.Response, "Failure responding to request") 299 } 300 } 301 return 302} 303 304// AppsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running operation. 305type AppsDeleteFuture struct { 306 azure.FutureAPI 307 // Result returns the result of the asynchronous operation. 308 // If the operation has not completed it will return an error. 309 Result func(AppsClient) (autorest.Response, error) 310} 311 312// UnmarshalJSON is the custom unmarshaller for CreateFuture. 313func (future *AppsDeleteFuture) UnmarshalJSON(body []byte) error { 314 var azFuture azure.Future 315 if err := json.Unmarshal(body, &azFuture); err != nil { 316 return err 317 } 318 future.FutureAPI = &azFuture 319 future.Result = future.result 320 return nil 321} 322 323// result is the default implementation for AppsDeleteFuture.Result. 324func (future *AppsDeleteFuture) result(client AppsClient) (ar autorest.Response, err error) { 325 var done bool 326 done, err = future.DoneWithContext(context.Background(), client) 327 if err != nil { 328 err = autorest.NewErrorWithError(err, "appplatform.AppsDeleteFuture", "Result", future.Response(), "Polling failure") 329 return 330 } 331 if !done { 332 ar.Response = future.Response() 333 err = azure.NewAsyncOpIncompleteError("appplatform.AppsDeleteFuture") 334 return 335 } 336 ar.Response = future.Response() 337 return 338} 339 340// AppsUpdateFuture an abstraction for monitoring and retrieving the results of a long-running operation. 341type AppsUpdateFuture struct { 342 azure.FutureAPI 343 // Result returns the result of the asynchronous operation. 344 // If the operation has not completed it will return an error. 345 Result func(AppsClient) (AppResource, error) 346} 347 348// UnmarshalJSON is the custom unmarshaller for CreateFuture. 349func (future *AppsUpdateFuture) UnmarshalJSON(body []byte) error { 350 var azFuture azure.Future 351 if err := json.Unmarshal(body, &azFuture); err != nil { 352 return err 353 } 354 future.FutureAPI = &azFuture 355 future.Result = future.result 356 return nil 357} 358 359// result is the default implementation for AppsUpdateFuture.Result. 360func (future *AppsUpdateFuture) result(client AppsClient) (ar AppResource, err error) { 361 var done bool 362 done, err = future.DoneWithContext(context.Background(), client) 363 if err != nil { 364 err = autorest.NewErrorWithError(err, "appplatform.AppsUpdateFuture", "Result", future.Response(), "Polling failure") 365 return 366 } 367 if !done { 368 ar.Response.Response = future.Response() 369 err = azure.NewAsyncOpIncompleteError("appplatform.AppsUpdateFuture") 370 return 371 } 372 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 373 if ar.Response.Response, err = future.GetResult(sender); err == nil && ar.Response.Response.StatusCode != http.StatusNoContent { 374 ar, err = client.UpdateResponder(ar.Response.Response) 375 if err != nil { 376 err = autorest.NewErrorWithError(err, "appplatform.AppsUpdateFuture", "Result", ar.Response.Response, "Failure responding to request") 377 } 378 } 379 return 380} 381 382// AvailableOperations available operations of the service 383type AvailableOperations struct { 384 autorest.Response `json:"-"` 385 // Value - Collection of available operation details 386 Value *[]OperationDetail `json:"value,omitempty"` 387 // NextLink - URL client should use to fetch the next page (per server side paging). 388 // It's null for now, added for future use. 389 NextLink *string `json:"nextLink,omitempty"` 390} 391 392// AvailableOperationsIterator provides access to a complete listing of OperationDetail values. 393type AvailableOperationsIterator struct { 394 i int 395 page AvailableOperationsPage 396} 397 398// NextWithContext advances to the next value. If there was an error making 399// the request the iterator does not advance and the error is returned. 400func (iter *AvailableOperationsIterator) NextWithContext(ctx context.Context) (err error) { 401 if tracing.IsEnabled() { 402 ctx = tracing.StartSpan(ctx, fqdn+"/AvailableOperationsIterator.NextWithContext") 403 defer func() { 404 sc := -1 405 if iter.Response().Response.Response != nil { 406 sc = iter.Response().Response.Response.StatusCode 407 } 408 tracing.EndSpan(ctx, sc, err) 409 }() 410 } 411 iter.i++ 412 if iter.i < len(iter.page.Values()) { 413 return nil 414 } 415 err = iter.page.NextWithContext(ctx) 416 if err != nil { 417 iter.i-- 418 return err 419 } 420 iter.i = 0 421 return nil 422} 423 424// Next advances to the next value. If there was an error making 425// the request the iterator does not advance and the error is returned. 426// Deprecated: Use NextWithContext() instead. 427func (iter *AvailableOperationsIterator) Next() error { 428 return iter.NextWithContext(context.Background()) 429} 430 431// NotDone returns true if the enumeration should be started or is not yet complete. 432func (iter AvailableOperationsIterator) NotDone() bool { 433 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 434} 435 436// Response returns the raw server response from the last page request. 437func (iter AvailableOperationsIterator) Response() AvailableOperations { 438 return iter.page.Response() 439} 440 441// Value returns the current value or a zero-initialized value if the 442// iterator has advanced beyond the end of the collection. 443func (iter AvailableOperationsIterator) Value() OperationDetail { 444 if !iter.page.NotDone() { 445 return OperationDetail{} 446 } 447 return iter.page.Values()[iter.i] 448} 449 450// Creates a new instance of the AvailableOperationsIterator type. 451func NewAvailableOperationsIterator(page AvailableOperationsPage) AvailableOperationsIterator { 452 return AvailableOperationsIterator{page: page} 453} 454 455// IsEmpty returns true if the ListResult contains no values. 456func (ao AvailableOperations) IsEmpty() bool { 457 return ao.Value == nil || len(*ao.Value) == 0 458} 459 460// hasNextLink returns true if the NextLink is not empty. 461func (ao AvailableOperations) hasNextLink() bool { 462 return ao.NextLink != nil && len(*ao.NextLink) != 0 463} 464 465// availableOperationsPreparer prepares a request to retrieve the next set of results. 466// It returns nil if no more results exist. 467func (ao AvailableOperations) availableOperationsPreparer(ctx context.Context) (*http.Request, error) { 468 if !ao.hasNextLink() { 469 return nil, nil 470 } 471 return autorest.Prepare((&http.Request{}).WithContext(ctx), 472 autorest.AsJSON(), 473 autorest.AsGet(), 474 autorest.WithBaseURL(to.String(ao.NextLink))) 475} 476 477// AvailableOperationsPage contains a page of OperationDetail values. 478type AvailableOperationsPage struct { 479 fn func(context.Context, AvailableOperations) (AvailableOperations, error) 480 ao AvailableOperations 481} 482 483// NextWithContext advances to the next page of values. If there was an error making 484// the request the page does not advance and the error is returned. 485func (page *AvailableOperationsPage) NextWithContext(ctx context.Context) (err error) { 486 if tracing.IsEnabled() { 487 ctx = tracing.StartSpan(ctx, fqdn+"/AvailableOperationsPage.NextWithContext") 488 defer func() { 489 sc := -1 490 if page.Response().Response.Response != nil { 491 sc = page.Response().Response.Response.StatusCode 492 } 493 tracing.EndSpan(ctx, sc, err) 494 }() 495 } 496 for { 497 next, err := page.fn(ctx, page.ao) 498 if err != nil { 499 return err 500 } 501 page.ao = next 502 if !next.hasNextLink() || !next.IsEmpty() { 503 break 504 } 505 } 506 return nil 507} 508 509// Next advances to the next page of values. If there was an error making 510// the request the page does not advance and the error is returned. 511// Deprecated: Use NextWithContext() instead. 512func (page *AvailableOperationsPage) Next() error { 513 return page.NextWithContext(context.Background()) 514} 515 516// NotDone returns true if the page enumeration should be started or is not yet complete. 517func (page AvailableOperationsPage) NotDone() bool { 518 return !page.ao.IsEmpty() 519} 520 521// Response returns the raw server response from the last page request. 522func (page AvailableOperationsPage) Response() AvailableOperations { 523 return page.ao 524} 525 526// Values returns the slice of values for the current page or nil if there are no values. 527func (page AvailableOperationsPage) Values() []OperationDetail { 528 if page.ao.IsEmpty() { 529 return nil 530 } 531 return *page.ao.Value 532} 533 534// Creates a new instance of the AvailableOperationsPage type. 535func NewAvailableOperationsPage(cur AvailableOperations, getNextPage func(context.Context, AvailableOperations) (AvailableOperations, error)) AvailableOperationsPage { 536 return AvailableOperationsPage{ 537 fn: getNextPage, 538 ao: cur, 539 } 540} 541 542// AvailableRuntimeVersions ... 543type AvailableRuntimeVersions struct { 544 autorest.Response `json:"-"` 545 // Value - READ-ONLY; A list of all supported runtime versions. 546 Value *[]SupportedRuntimeVersion `json:"value,omitempty"` 547} 548 549// MarshalJSON is the custom marshaler for AvailableRuntimeVersions. 550func (arv AvailableRuntimeVersions) MarshalJSON() ([]byte, error) { 551 objectMap := make(map[string]interface{}) 552 return json.Marshal(objectMap) 553} 554 555// BindingResource binding resource payload 556type BindingResource struct { 557 autorest.Response `json:"-"` 558 // Properties - Properties of the Binding resource 559 Properties *BindingResourceProperties `json:"properties,omitempty"` 560 // ID - READ-ONLY; Fully qualified resource Id for the resource. 561 ID *string `json:"id,omitempty"` 562 // Name - READ-ONLY; The name of the resource. 563 Name *string `json:"name,omitempty"` 564 // Type - READ-ONLY; The type of the resource. 565 Type *string `json:"type,omitempty"` 566} 567 568// MarshalJSON is the custom marshaler for BindingResource. 569func (br BindingResource) MarshalJSON() ([]byte, error) { 570 objectMap := make(map[string]interface{}) 571 if br.Properties != nil { 572 objectMap["properties"] = br.Properties 573 } 574 return json.Marshal(objectMap) 575} 576 577// BindingResourceCollection object that includes an array of Binding resources and a possible link for 578// next set 579type BindingResourceCollection struct { 580 autorest.Response `json:"-"` 581 // Value - Collection of Binding resources 582 Value *[]BindingResource `json:"value,omitempty"` 583 // NextLink - URL client should use to fetch the next page (per server side paging). 584 // It's null for now, added for future use. 585 NextLink *string `json:"nextLink,omitempty"` 586} 587 588// BindingResourceCollectionIterator provides access to a complete listing of BindingResource values. 589type BindingResourceCollectionIterator struct { 590 i int 591 page BindingResourceCollectionPage 592} 593 594// NextWithContext advances to the next value. If there was an error making 595// the request the iterator does not advance and the error is returned. 596func (iter *BindingResourceCollectionIterator) NextWithContext(ctx context.Context) (err error) { 597 if tracing.IsEnabled() { 598 ctx = tracing.StartSpan(ctx, fqdn+"/BindingResourceCollectionIterator.NextWithContext") 599 defer func() { 600 sc := -1 601 if iter.Response().Response.Response != nil { 602 sc = iter.Response().Response.Response.StatusCode 603 } 604 tracing.EndSpan(ctx, sc, err) 605 }() 606 } 607 iter.i++ 608 if iter.i < len(iter.page.Values()) { 609 return nil 610 } 611 err = iter.page.NextWithContext(ctx) 612 if err != nil { 613 iter.i-- 614 return err 615 } 616 iter.i = 0 617 return nil 618} 619 620// Next advances to the next value. If there was an error making 621// the request the iterator does not advance and the error is returned. 622// Deprecated: Use NextWithContext() instead. 623func (iter *BindingResourceCollectionIterator) Next() error { 624 return iter.NextWithContext(context.Background()) 625} 626 627// NotDone returns true if the enumeration should be started or is not yet complete. 628func (iter BindingResourceCollectionIterator) NotDone() bool { 629 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 630} 631 632// Response returns the raw server response from the last page request. 633func (iter BindingResourceCollectionIterator) Response() BindingResourceCollection { 634 return iter.page.Response() 635} 636 637// Value returns the current value or a zero-initialized value if the 638// iterator has advanced beyond the end of the collection. 639func (iter BindingResourceCollectionIterator) Value() BindingResource { 640 if !iter.page.NotDone() { 641 return BindingResource{} 642 } 643 return iter.page.Values()[iter.i] 644} 645 646// Creates a new instance of the BindingResourceCollectionIterator type. 647func NewBindingResourceCollectionIterator(page BindingResourceCollectionPage) BindingResourceCollectionIterator { 648 return BindingResourceCollectionIterator{page: page} 649} 650 651// IsEmpty returns true if the ListResult contains no values. 652func (brc BindingResourceCollection) IsEmpty() bool { 653 return brc.Value == nil || len(*brc.Value) == 0 654} 655 656// hasNextLink returns true if the NextLink is not empty. 657func (brc BindingResourceCollection) hasNextLink() bool { 658 return brc.NextLink != nil && len(*brc.NextLink) != 0 659} 660 661// bindingResourceCollectionPreparer prepares a request to retrieve the next set of results. 662// It returns nil if no more results exist. 663func (brc BindingResourceCollection) bindingResourceCollectionPreparer(ctx context.Context) (*http.Request, error) { 664 if !brc.hasNextLink() { 665 return nil, nil 666 } 667 return autorest.Prepare((&http.Request{}).WithContext(ctx), 668 autorest.AsJSON(), 669 autorest.AsGet(), 670 autorest.WithBaseURL(to.String(brc.NextLink))) 671} 672 673// BindingResourceCollectionPage contains a page of BindingResource values. 674type BindingResourceCollectionPage struct { 675 fn func(context.Context, BindingResourceCollection) (BindingResourceCollection, error) 676 brc BindingResourceCollection 677} 678 679// NextWithContext advances to the next page of values. If there was an error making 680// the request the page does not advance and the error is returned. 681func (page *BindingResourceCollectionPage) NextWithContext(ctx context.Context) (err error) { 682 if tracing.IsEnabled() { 683 ctx = tracing.StartSpan(ctx, fqdn+"/BindingResourceCollectionPage.NextWithContext") 684 defer func() { 685 sc := -1 686 if page.Response().Response.Response != nil { 687 sc = page.Response().Response.Response.StatusCode 688 } 689 tracing.EndSpan(ctx, sc, err) 690 }() 691 } 692 for { 693 next, err := page.fn(ctx, page.brc) 694 if err != nil { 695 return err 696 } 697 page.brc = next 698 if !next.hasNextLink() || !next.IsEmpty() { 699 break 700 } 701 } 702 return nil 703} 704 705// Next advances to the next page of values. If there was an error making 706// the request the page does not advance and the error is returned. 707// Deprecated: Use NextWithContext() instead. 708func (page *BindingResourceCollectionPage) Next() error { 709 return page.NextWithContext(context.Background()) 710} 711 712// NotDone returns true if the page enumeration should be started or is not yet complete. 713func (page BindingResourceCollectionPage) NotDone() bool { 714 return !page.brc.IsEmpty() 715} 716 717// Response returns the raw server response from the last page request. 718func (page BindingResourceCollectionPage) Response() BindingResourceCollection { 719 return page.brc 720} 721 722// Values returns the slice of values for the current page or nil if there are no values. 723func (page BindingResourceCollectionPage) Values() []BindingResource { 724 if page.brc.IsEmpty() { 725 return nil 726 } 727 return *page.brc.Value 728} 729 730// Creates a new instance of the BindingResourceCollectionPage type. 731func NewBindingResourceCollectionPage(cur BindingResourceCollection, getNextPage func(context.Context, BindingResourceCollection) (BindingResourceCollection, error)) BindingResourceCollectionPage { 732 return BindingResourceCollectionPage{ 733 fn: getNextPage, 734 brc: cur, 735 } 736} 737 738// BindingResourceProperties binding resource properties payload 739type BindingResourceProperties struct { 740 // ResourceName - READ-ONLY; The name of the bound resource 741 ResourceName *string `json:"resourceName,omitempty"` 742 // ResourceType - READ-ONLY; The standard Azure resource type of the bound resource 743 ResourceType *string `json:"resourceType,omitempty"` 744 // ResourceID - The Azure resource id of the bound resource 745 ResourceID *string `json:"resourceId,omitempty"` 746 // Key - The key of the bound resource 747 Key *string `json:"key,omitempty"` 748 // BindingParameters - Binding parameters of the Binding resource 749 BindingParameters map[string]interface{} `json:"bindingParameters"` 750 // GeneratedProperties - READ-ONLY; The generated Spring Boot property file for this binding. The secret will be deducted. 751 GeneratedProperties *string `json:"generatedProperties,omitempty"` 752 // CreatedAt - READ-ONLY; Creation time of the Binding resource 753 CreatedAt *string `json:"createdAt,omitempty"` 754 // UpdatedAt - READ-ONLY; Update time of the Binding resource 755 UpdatedAt *string `json:"updatedAt,omitempty"` 756} 757 758// MarshalJSON is the custom marshaler for BindingResourceProperties. 759func (brp BindingResourceProperties) MarshalJSON() ([]byte, error) { 760 objectMap := make(map[string]interface{}) 761 if brp.ResourceID != nil { 762 objectMap["resourceId"] = brp.ResourceID 763 } 764 if brp.Key != nil { 765 objectMap["key"] = brp.Key 766 } 767 if brp.BindingParameters != nil { 768 objectMap["bindingParameters"] = brp.BindingParameters 769 } 770 return json.Marshal(objectMap) 771} 772 773// BindingsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 774// operation. 775type BindingsCreateOrUpdateFuture struct { 776 azure.FutureAPI 777 // Result returns the result of the asynchronous operation. 778 // If the operation has not completed it will return an error. 779 Result func(BindingsClient) (BindingResource, error) 780} 781 782// UnmarshalJSON is the custom unmarshaller for CreateFuture. 783func (future *BindingsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 784 var azFuture azure.Future 785 if err := json.Unmarshal(body, &azFuture); err != nil { 786 return err 787 } 788 future.FutureAPI = &azFuture 789 future.Result = future.result 790 return nil 791} 792 793// result is the default implementation for BindingsCreateOrUpdateFuture.Result. 794func (future *BindingsCreateOrUpdateFuture) result(client BindingsClient) (br BindingResource, err error) { 795 var done bool 796 done, err = future.DoneWithContext(context.Background(), client) 797 if err != nil { 798 err = autorest.NewErrorWithError(err, "appplatform.BindingsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 799 return 800 } 801 if !done { 802 br.Response.Response = future.Response() 803 err = azure.NewAsyncOpIncompleteError("appplatform.BindingsCreateOrUpdateFuture") 804 return 805 } 806 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 807 if br.Response.Response, err = future.GetResult(sender); err == nil && br.Response.Response.StatusCode != http.StatusNoContent { 808 br, err = client.CreateOrUpdateResponder(br.Response.Response) 809 if err != nil { 810 err = autorest.NewErrorWithError(err, "appplatform.BindingsCreateOrUpdateFuture", "Result", br.Response.Response, "Failure responding to request") 811 } 812 } 813 return 814} 815 816// BindingsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running 817// operation. 818type BindingsDeleteFuture struct { 819 azure.FutureAPI 820 // Result returns the result of the asynchronous operation. 821 // If the operation has not completed it will return an error. 822 Result func(BindingsClient) (autorest.Response, error) 823} 824 825// UnmarshalJSON is the custom unmarshaller for CreateFuture. 826func (future *BindingsDeleteFuture) UnmarshalJSON(body []byte) error { 827 var azFuture azure.Future 828 if err := json.Unmarshal(body, &azFuture); err != nil { 829 return err 830 } 831 future.FutureAPI = &azFuture 832 future.Result = future.result 833 return nil 834} 835 836// result is the default implementation for BindingsDeleteFuture.Result. 837func (future *BindingsDeleteFuture) result(client BindingsClient) (ar autorest.Response, err error) { 838 var done bool 839 done, err = future.DoneWithContext(context.Background(), client) 840 if err != nil { 841 err = autorest.NewErrorWithError(err, "appplatform.BindingsDeleteFuture", "Result", future.Response(), "Polling failure") 842 return 843 } 844 if !done { 845 ar.Response = future.Response() 846 err = azure.NewAsyncOpIncompleteError("appplatform.BindingsDeleteFuture") 847 return 848 } 849 ar.Response = future.Response() 850 return 851} 852 853// BindingsUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 854// operation. 855type BindingsUpdateFuture struct { 856 azure.FutureAPI 857 // Result returns the result of the asynchronous operation. 858 // If the operation has not completed it will return an error. 859 Result func(BindingsClient) (BindingResource, error) 860} 861 862// UnmarshalJSON is the custom unmarshaller for CreateFuture. 863func (future *BindingsUpdateFuture) UnmarshalJSON(body []byte) error { 864 var azFuture azure.Future 865 if err := json.Unmarshal(body, &azFuture); err != nil { 866 return err 867 } 868 future.FutureAPI = &azFuture 869 future.Result = future.result 870 return nil 871} 872 873// result is the default implementation for BindingsUpdateFuture.Result. 874func (future *BindingsUpdateFuture) result(client BindingsClient) (br BindingResource, err error) { 875 var done bool 876 done, err = future.DoneWithContext(context.Background(), client) 877 if err != nil { 878 err = autorest.NewErrorWithError(err, "appplatform.BindingsUpdateFuture", "Result", future.Response(), "Polling failure") 879 return 880 } 881 if !done { 882 br.Response.Response = future.Response() 883 err = azure.NewAsyncOpIncompleteError("appplatform.BindingsUpdateFuture") 884 return 885 } 886 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 887 if br.Response.Response, err = future.GetResult(sender); err == nil && br.Response.Response.StatusCode != http.StatusNoContent { 888 br, err = client.UpdateResponder(br.Response.Response) 889 if err != nil { 890 err = autorest.NewErrorWithError(err, "appplatform.BindingsUpdateFuture", "Result", br.Response.Response, "Failure responding to request") 891 } 892 } 893 return 894} 895 896// CertificateProperties certificate resource payload. 897type CertificateProperties struct { 898 // Thumbprint - READ-ONLY; The thumbprint of certificate. 899 Thumbprint *string `json:"thumbprint,omitempty"` 900 // VaultURI - The vault uri of user key vault. 901 VaultURI *string `json:"vaultUri,omitempty"` 902 // KeyVaultCertName - The certificate name of key vault. 903 KeyVaultCertName *string `json:"keyVaultCertName,omitempty"` 904 // CertVersion - The certificate version of key vault. 905 CertVersion *string `json:"certVersion,omitempty"` 906 // Issuer - READ-ONLY; The issuer of certificate. 907 Issuer *string `json:"issuer,omitempty"` 908 // IssuedDate - READ-ONLY; The issue date of certificate. 909 IssuedDate *string `json:"issuedDate,omitempty"` 910 // ExpirationDate - READ-ONLY; The expiration date of certificate. 911 ExpirationDate *string `json:"expirationDate,omitempty"` 912 // ActivateDate - READ-ONLY; The activate date of certificate. 913 ActivateDate *string `json:"activateDate,omitempty"` 914 // SubjectName - READ-ONLY; The subject name of certificate. 915 SubjectName *string `json:"subjectName,omitempty"` 916 // DNSNames - READ-ONLY; The domain list of certificate. 917 DNSNames *[]string `json:"dnsNames,omitempty"` 918} 919 920// MarshalJSON is the custom marshaler for CertificateProperties. 921func (cp CertificateProperties) MarshalJSON() ([]byte, error) { 922 objectMap := make(map[string]interface{}) 923 if cp.VaultURI != nil { 924 objectMap["vaultUri"] = cp.VaultURI 925 } 926 if cp.KeyVaultCertName != nil { 927 objectMap["keyVaultCertName"] = cp.KeyVaultCertName 928 } 929 if cp.CertVersion != nil { 930 objectMap["certVersion"] = cp.CertVersion 931 } 932 return json.Marshal(objectMap) 933} 934 935// CertificateResource certificate resource payload. 936type CertificateResource struct { 937 autorest.Response `json:"-"` 938 // Properties - Properties of the certificate resource payload. 939 Properties *CertificateProperties `json:"properties,omitempty"` 940 // ID - READ-ONLY; Fully qualified resource Id for the resource. 941 ID *string `json:"id,omitempty"` 942 // Name - READ-ONLY; The name of the resource. 943 Name *string `json:"name,omitempty"` 944 // Type - READ-ONLY; The type of the resource. 945 Type *string `json:"type,omitempty"` 946} 947 948// MarshalJSON is the custom marshaler for CertificateResource. 949func (cr CertificateResource) MarshalJSON() ([]byte, error) { 950 objectMap := make(map[string]interface{}) 951 if cr.Properties != nil { 952 objectMap["properties"] = cr.Properties 953 } 954 return json.Marshal(objectMap) 955} 956 957// CertificateResourceCollection collection compose of certificate resources list and a possible link for 958// next page. 959type CertificateResourceCollection struct { 960 autorest.Response `json:"-"` 961 // Value - The certificate resources list. 962 Value *[]CertificateResource `json:"value,omitempty"` 963 // NextLink - The link to next page of certificate list. 964 NextLink *string `json:"nextLink,omitempty"` 965} 966 967// CertificateResourceCollectionIterator provides access to a complete listing of CertificateResource 968// values. 969type CertificateResourceCollectionIterator struct { 970 i int 971 page CertificateResourceCollectionPage 972} 973 974// NextWithContext advances to the next value. If there was an error making 975// the request the iterator does not advance and the error is returned. 976func (iter *CertificateResourceCollectionIterator) NextWithContext(ctx context.Context) (err error) { 977 if tracing.IsEnabled() { 978 ctx = tracing.StartSpan(ctx, fqdn+"/CertificateResourceCollectionIterator.NextWithContext") 979 defer func() { 980 sc := -1 981 if iter.Response().Response.Response != nil { 982 sc = iter.Response().Response.Response.StatusCode 983 } 984 tracing.EndSpan(ctx, sc, err) 985 }() 986 } 987 iter.i++ 988 if iter.i < len(iter.page.Values()) { 989 return nil 990 } 991 err = iter.page.NextWithContext(ctx) 992 if err != nil { 993 iter.i-- 994 return err 995 } 996 iter.i = 0 997 return nil 998} 999 1000// Next advances to the next value. If there was an error making 1001// the request the iterator does not advance and the error is returned. 1002// Deprecated: Use NextWithContext() instead. 1003func (iter *CertificateResourceCollectionIterator) Next() error { 1004 return iter.NextWithContext(context.Background()) 1005} 1006 1007// NotDone returns true if the enumeration should be started or is not yet complete. 1008func (iter CertificateResourceCollectionIterator) NotDone() bool { 1009 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 1010} 1011 1012// Response returns the raw server response from the last page request. 1013func (iter CertificateResourceCollectionIterator) Response() CertificateResourceCollection { 1014 return iter.page.Response() 1015} 1016 1017// Value returns the current value or a zero-initialized value if the 1018// iterator has advanced beyond the end of the collection. 1019func (iter CertificateResourceCollectionIterator) Value() CertificateResource { 1020 if !iter.page.NotDone() { 1021 return CertificateResource{} 1022 } 1023 return iter.page.Values()[iter.i] 1024} 1025 1026// Creates a new instance of the CertificateResourceCollectionIterator type. 1027func NewCertificateResourceCollectionIterator(page CertificateResourceCollectionPage) CertificateResourceCollectionIterator { 1028 return CertificateResourceCollectionIterator{page: page} 1029} 1030 1031// IsEmpty returns true if the ListResult contains no values. 1032func (crc CertificateResourceCollection) IsEmpty() bool { 1033 return crc.Value == nil || len(*crc.Value) == 0 1034} 1035 1036// hasNextLink returns true if the NextLink is not empty. 1037func (crc CertificateResourceCollection) hasNextLink() bool { 1038 return crc.NextLink != nil && len(*crc.NextLink) != 0 1039} 1040 1041// certificateResourceCollectionPreparer prepares a request to retrieve the next set of results. 1042// It returns nil if no more results exist. 1043func (crc CertificateResourceCollection) certificateResourceCollectionPreparer(ctx context.Context) (*http.Request, error) { 1044 if !crc.hasNextLink() { 1045 return nil, nil 1046 } 1047 return autorest.Prepare((&http.Request{}).WithContext(ctx), 1048 autorest.AsJSON(), 1049 autorest.AsGet(), 1050 autorest.WithBaseURL(to.String(crc.NextLink))) 1051} 1052 1053// CertificateResourceCollectionPage contains a page of CertificateResource values. 1054type CertificateResourceCollectionPage struct { 1055 fn func(context.Context, CertificateResourceCollection) (CertificateResourceCollection, error) 1056 crc CertificateResourceCollection 1057} 1058 1059// NextWithContext advances to the next page of values. If there was an error making 1060// the request the page does not advance and the error is returned. 1061func (page *CertificateResourceCollectionPage) NextWithContext(ctx context.Context) (err error) { 1062 if tracing.IsEnabled() { 1063 ctx = tracing.StartSpan(ctx, fqdn+"/CertificateResourceCollectionPage.NextWithContext") 1064 defer func() { 1065 sc := -1 1066 if page.Response().Response.Response != nil { 1067 sc = page.Response().Response.Response.StatusCode 1068 } 1069 tracing.EndSpan(ctx, sc, err) 1070 }() 1071 } 1072 for { 1073 next, err := page.fn(ctx, page.crc) 1074 if err != nil { 1075 return err 1076 } 1077 page.crc = next 1078 if !next.hasNextLink() || !next.IsEmpty() { 1079 break 1080 } 1081 } 1082 return nil 1083} 1084 1085// Next advances to the next page of values. If there was an error making 1086// the request the page does not advance and the error is returned. 1087// Deprecated: Use NextWithContext() instead. 1088func (page *CertificateResourceCollectionPage) Next() error { 1089 return page.NextWithContext(context.Background()) 1090} 1091 1092// NotDone returns true if the page enumeration should be started or is not yet complete. 1093func (page CertificateResourceCollectionPage) NotDone() bool { 1094 return !page.crc.IsEmpty() 1095} 1096 1097// Response returns the raw server response from the last page request. 1098func (page CertificateResourceCollectionPage) Response() CertificateResourceCollection { 1099 return page.crc 1100} 1101 1102// Values returns the slice of values for the current page or nil if there are no values. 1103func (page CertificateResourceCollectionPage) Values() []CertificateResource { 1104 if page.crc.IsEmpty() { 1105 return nil 1106 } 1107 return *page.crc.Value 1108} 1109 1110// Creates a new instance of the CertificateResourceCollectionPage type. 1111func NewCertificateResourceCollectionPage(cur CertificateResourceCollection, getNextPage func(context.Context, CertificateResourceCollection) (CertificateResourceCollection, error)) CertificateResourceCollectionPage { 1112 return CertificateResourceCollectionPage{ 1113 fn: getNextPage, 1114 crc: cur, 1115 } 1116} 1117 1118// CertificatesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a 1119// long-running operation. 1120type CertificatesCreateOrUpdateFuture struct { 1121 azure.FutureAPI 1122 // Result returns the result of the asynchronous operation. 1123 // If the operation has not completed it will return an error. 1124 Result func(CertificatesClient) (CertificateResource, error) 1125} 1126 1127// UnmarshalJSON is the custom unmarshaller for CreateFuture. 1128func (future *CertificatesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 1129 var azFuture azure.Future 1130 if err := json.Unmarshal(body, &azFuture); err != nil { 1131 return err 1132 } 1133 future.FutureAPI = &azFuture 1134 future.Result = future.result 1135 return nil 1136} 1137 1138// result is the default implementation for CertificatesCreateOrUpdateFuture.Result. 1139func (future *CertificatesCreateOrUpdateFuture) result(client CertificatesClient) (cr CertificateResource, err error) { 1140 var done bool 1141 done, err = future.DoneWithContext(context.Background(), client) 1142 if err != nil { 1143 err = autorest.NewErrorWithError(err, "appplatform.CertificatesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 1144 return 1145 } 1146 if !done { 1147 cr.Response.Response = future.Response() 1148 err = azure.NewAsyncOpIncompleteError("appplatform.CertificatesCreateOrUpdateFuture") 1149 return 1150 } 1151 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 1152 if cr.Response.Response, err = future.GetResult(sender); err == nil && cr.Response.Response.StatusCode != http.StatusNoContent { 1153 cr, err = client.CreateOrUpdateResponder(cr.Response.Response) 1154 if err != nil { 1155 err = autorest.NewErrorWithError(err, "appplatform.CertificatesCreateOrUpdateFuture", "Result", cr.Response.Response, "Failure responding to request") 1156 } 1157 } 1158 return 1159} 1160 1161// CertificatesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running 1162// operation. 1163type CertificatesDeleteFuture struct { 1164 azure.FutureAPI 1165 // Result returns the result of the asynchronous operation. 1166 // If the operation has not completed it will return an error. 1167 Result func(CertificatesClient) (autorest.Response, error) 1168} 1169 1170// UnmarshalJSON is the custom unmarshaller for CreateFuture. 1171func (future *CertificatesDeleteFuture) UnmarshalJSON(body []byte) error { 1172 var azFuture azure.Future 1173 if err := json.Unmarshal(body, &azFuture); err != nil { 1174 return err 1175 } 1176 future.FutureAPI = &azFuture 1177 future.Result = future.result 1178 return nil 1179} 1180 1181// result is the default implementation for CertificatesDeleteFuture.Result. 1182func (future *CertificatesDeleteFuture) result(client CertificatesClient) (ar autorest.Response, err error) { 1183 var done bool 1184 done, err = future.DoneWithContext(context.Background(), client) 1185 if err != nil { 1186 err = autorest.NewErrorWithError(err, "appplatform.CertificatesDeleteFuture", "Result", future.Response(), "Polling failure") 1187 return 1188 } 1189 if !done { 1190 ar.Response = future.Response() 1191 err = azure.NewAsyncOpIncompleteError("appplatform.CertificatesDeleteFuture") 1192 return 1193 } 1194 ar.Response = future.Response() 1195 return 1196} 1197 1198// CloudError an error response from the service. 1199type CloudError struct { 1200 // Error - An error response from the service. 1201 Error *CloudErrorBody `json:"error,omitempty"` 1202} 1203 1204// CloudErrorBody an error response from the service. 1205type CloudErrorBody struct { 1206 // Code - An identifier for the error. Codes are invariant and are intended to be consumed programmatically. 1207 Code *string `json:"code,omitempty"` 1208 // Message - A message describing the error, intended to be suitable for display in a user interface. 1209 Message *string `json:"message,omitempty"` 1210 // Target - The target of the particular error. For example, the name of the property in error. 1211 Target *string `json:"target,omitempty"` 1212 // Details - A list of additional details about the error. 1213 Details *[]CloudErrorBody `json:"details,omitempty"` 1214} 1215 1216// ClusterResourceProperties service properties payload 1217type ClusterResourceProperties struct { 1218 // ProvisioningState - READ-ONLY; Provisioning state of the Service. Possible values include: 'ProvisioningStateCreating', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateDeleted', 'ProvisioningStateSucceeded', 'ProvisioningStateFailed', 'ProvisioningStateMoving', 'ProvisioningStateMoved', 'ProvisioningStateMoveFailed' 1219 ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` 1220 // NetworkProfile - Network profile of the Service 1221 NetworkProfile *NetworkProfile `json:"networkProfile,omitempty"` 1222 // Version - READ-ONLY; Version of the Service 1223 Version *int32 `json:"version,omitempty"` 1224 // ServiceID - READ-ONLY; ServiceInstanceEntity GUID which uniquely identifies a created resource 1225 ServiceID *string `json:"serviceId,omitempty"` 1226} 1227 1228// MarshalJSON is the custom marshaler for ClusterResourceProperties. 1229func (crp ClusterResourceProperties) MarshalJSON() ([]byte, error) { 1230 objectMap := make(map[string]interface{}) 1231 if crp.NetworkProfile != nil { 1232 objectMap["networkProfile"] = crp.NetworkProfile 1233 } 1234 return json.Marshal(objectMap) 1235} 1236 1237// ConfigServerGitProperty property of git. 1238type ConfigServerGitProperty struct { 1239 // Repositories - Repositories of git. 1240 Repositories *[]GitPatternRepository `json:"repositories,omitempty"` 1241 // URI - URI of the repository 1242 URI *string `json:"uri,omitempty"` 1243 // Label - Label of the repository 1244 Label *string `json:"label,omitempty"` 1245 // SearchPaths - Searching path of the repository 1246 SearchPaths *[]string `json:"searchPaths,omitempty"` 1247 // Username - Username of git repository basic auth. 1248 Username *string `json:"username,omitempty"` 1249 // Password - Password of git repository basic auth. 1250 Password *string `json:"password,omitempty"` 1251 // HostKey - Public sshKey of git repository. 1252 HostKey *string `json:"hostKey,omitempty"` 1253 // HostKeyAlgorithm - SshKey algorithm of git repository. 1254 HostKeyAlgorithm *string `json:"hostKeyAlgorithm,omitempty"` 1255 // PrivateKey - Private sshKey algorithm of git repository. 1256 PrivateKey *string `json:"privateKey,omitempty"` 1257 // StrictHostKeyChecking - Strict host key checking or not. 1258 StrictHostKeyChecking *bool `json:"strictHostKeyChecking,omitempty"` 1259} 1260 1261// ConfigServerProperties config server git properties payload 1262type ConfigServerProperties struct { 1263 // ProvisioningState - READ-ONLY; State of the config server. Possible values include: 'ConfigServerStateNotAvailable', 'ConfigServerStateDeleted', 'ConfigServerStateFailed', 'ConfigServerStateSucceeded', 'ConfigServerStateUpdating' 1264 ProvisioningState ConfigServerState `json:"provisioningState,omitempty"` 1265 // Error - Error when apply config server settings. 1266 Error *Error `json:"error,omitempty"` 1267 // ConfigServer - Settings of config server. 1268 ConfigServer *ConfigServerSettings `json:"configServer,omitempty"` 1269} 1270 1271// MarshalJSON is the custom marshaler for ConfigServerProperties. 1272func (csp ConfigServerProperties) MarshalJSON() ([]byte, error) { 1273 objectMap := make(map[string]interface{}) 1274 if csp.Error != nil { 1275 objectMap["error"] = csp.Error 1276 } 1277 if csp.ConfigServer != nil { 1278 objectMap["configServer"] = csp.ConfigServer 1279 } 1280 return json.Marshal(objectMap) 1281} 1282 1283// ConfigServerResource config Server resource 1284type ConfigServerResource struct { 1285 autorest.Response `json:"-"` 1286 // Properties - Properties of the Config Server resource 1287 Properties *ConfigServerProperties `json:"properties,omitempty"` 1288 // ID - READ-ONLY; Fully qualified resource Id for the resource. 1289 ID *string `json:"id,omitempty"` 1290 // Name - READ-ONLY; The name of the resource. 1291 Name *string `json:"name,omitempty"` 1292 // Type - READ-ONLY; The type of the resource. 1293 Type *string `json:"type,omitempty"` 1294} 1295 1296// MarshalJSON is the custom marshaler for ConfigServerResource. 1297func (csr ConfigServerResource) MarshalJSON() ([]byte, error) { 1298 objectMap := make(map[string]interface{}) 1299 if csr.Properties != nil { 1300 objectMap["properties"] = csr.Properties 1301 } 1302 return json.Marshal(objectMap) 1303} 1304 1305// ConfigServerSettings the settings of config server. 1306type ConfigServerSettings struct { 1307 // GitProperty - Property of git environment. 1308 GitProperty *ConfigServerGitProperty `json:"gitProperty,omitempty"` 1309} 1310 1311// ConfigServerSettingsErrorRecord error record of the config server settings 1312type ConfigServerSettingsErrorRecord struct { 1313 // Name - The name of the config server settings error record 1314 Name *string `json:"name,omitempty"` 1315 // URI - The uri of the config server settings error record 1316 URI *string `json:"uri,omitempty"` 1317 // Messages - The detail error messages of the record 1318 Messages *[]string `json:"messages,omitempty"` 1319} 1320 1321// ConfigServerSettingsValidateResult validation result for config server settings 1322type ConfigServerSettingsValidateResult struct { 1323 autorest.Response `json:"-"` 1324 // IsValid - Indicate if the config server settings are valid 1325 IsValid *bool `json:"isValid,omitempty"` 1326 // Details - The detail validation results 1327 Details *[]ConfigServerSettingsErrorRecord `json:"details,omitempty"` 1328} 1329 1330// ConfigServersUpdatePatchFuture an abstraction for monitoring and retrieving the results of a 1331// long-running operation. 1332type ConfigServersUpdatePatchFuture struct { 1333 azure.FutureAPI 1334 // Result returns the result of the asynchronous operation. 1335 // If the operation has not completed it will return an error. 1336 Result func(ConfigServersClient) (ConfigServerResource, error) 1337} 1338 1339// UnmarshalJSON is the custom unmarshaller for CreateFuture. 1340func (future *ConfigServersUpdatePatchFuture) UnmarshalJSON(body []byte) error { 1341 var azFuture azure.Future 1342 if err := json.Unmarshal(body, &azFuture); err != nil { 1343 return err 1344 } 1345 future.FutureAPI = &azFuture 1346 future.Result = future.result 1347 return nil 1348} 1349 1350// result is the default implementation for ConfigServersUpdatePatchFuture.Result. 1351func (future *ConfigServersUpdatePatchFuture) result(client ConfigServersClient) (csr ConfigServerResource, err error) { 1352 var done bool 1353 done, err = future.DoneWithContext(context.Background(), client) 1354 if err != nil { 1355 err = autorest.NewErrorWithError(err, "appplatform.ConfigServersUpdatePatchFuture", "Result", future.Response(), "Polling failure") 1356 return 1357 } 1358 if !done { 1359 csr.Response.Response = future.Response() 1360 err = azure.NewAsyncOpIncompleteError("appplatform.ConfigServersUpdatePatchFuture") 1361 return 1362 } 1363 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 1364 if csr.Response.Response, err = future.GetResult(sender); err == nil && csr.Response.Response.StatusCode != http.StatusNoContent { 1365 csr, err = client.UpdatePatchResponder(csr.Response.Response) 1366 if err != nil { 1367 err = autorest.NewErrorWithError(err, "appplatform.ConfigServersUpdatePatchFuture", "Result", csr.Response.Response, "Failure responding to request") 1368 } 1369 } 1370 return 1371} 1372 1373// ConfigServersUpdatePutFuture an abstraction for monitoring and retrieving the results of a long-running 1374// operation. 1375type ConfigServersUpdatePutFuture struct { 1376 azure.FutureAPI 1377 // Result returns the result of the asynchronous operation. 1378 // If the operation has not completed it will return an error. 1379 Result func(ConfigServersClient) (ConfigServerResource, error) 1380} 1381 1382// UnmarshalJSON is the custom unmarshaller for CreateFuture. 1383func (future *ConfigServersUpdatePutFuture) UnmarshalJSON(body []byte) error { 1384 var azFuture azure.Future 1385 if err := json.Unmarshal(body, &azFuture); err != nil { 1386 return err 1387 } 1388 future.FutureAPI = &azFuture 1389 future.Result = future.result 1390 return nil 1391} 1392 1393// result is the default implementation for ConfigServersUpdatePutFuture.Result. 1394func (future *ConfigServersUpdatePutFuture) result(client ConfigServersClient) (csr ConfigServerResource, err error) { 1395 var done bool 1396 done, err = future.DoneWithContext(context.Background(), client) 1397 if err != nil { 1398 err = autorest.NewErrorWithError(err, "appplatform.ConfigServersUpdatePutFuture", "Result", future.Response(), "Polling failure") 1399 return 1400 } 1401 if !done { 1402 csr.Response.Response = future.Response() 1403 err = azure.NewAsyncOpIncompleteError("appplatform.ConfigServersUpdatePutFuture") 1404 return 1405 } 1406 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 1407 if csr.Response.Response, err = future.GetResult(sender); err == nil && csr.Response.Response.StatusCode != http.StatusNoContent { 1408 csr, err = client.UpdatePutResponder(csr.Response.Response) 1409 if err != nil { 1410 err = autorest.NewErrorWithError(err, "appplatform.ConfigServersUpdatePutFuture", "Result", csr.Response.Response, "Failure responding to request") 1411 } 1412 } 1413 return 1414} 1415 1416// ConfigServersValidateFuture an abstraction for monitoring and retrieving the results of a long-running 1417// operation. 1418type ConfigServersValidateFuture struct { 1419 azure.FutureAPI 1420 // Result returns the result of the asynchronous operation. 1421 // If the operation has not completed it will return an error. 1422 Result func(ConfigServersClient) (ConfigServerSettingsValidateResult, error) 1423} 1424 1425// UnmarshalJSON is the custom unmarshaller for CreateFuture. 1426func (future *ConfigServersValidateFuture) UnmarshalJSON(body []byte) error { 1427 var azFuture azure.Future 1428 if err := json.Unmarshal(body, &azFuture); err != nil { 1429 return err 1430 } 1431 future.FutureAPI = &azFuture 1432 future.Result = future.result 1433 return nil 1434} 1435 1436// result is the default implementation for ConfigServersValidateFuture.Result. 1437func (future *ConfigServersValidateFuture) result(client ConfigServersClient) (cssvr ConfigServerSettingsValidateResult, err error) { 1438 var done bool 1439 done, err = future.DoneWithContext(context.Background(), client) 1440 if err != nil { 1441 err = autorest.NewErrorWithError(err, "appplatform.ConfigServersValidateFuture", "Result", future.Response(), "Polling failure") 1442 return 1443 } 1444 if !done { 1445 cssvr.Response.Response = future.Response() 1446 err = azure.NewAsyncOpIncompleteError("appplatform.ConfigServersValidateFuture") 1447 return 1448 } 1449 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 1450 if cssvr.Response.Response, err = future.GetResult(sender); err == nil && cssvr.Response.Response.StatusCode != http.StatusNoContent { 1451 cssvr, err = client.ValidateResponder(cssvr.Response.Response) 1452 if err != nil { 1453 err = autorest.NewErrorWithError(err, "appplatform.ConfigServersValidateFuture", "Result", cssvr.Response.Response, "Failure responding to request") 1454 } 1455 } 1456 return 1457} 1458 1459// CustomDomainProperties custom domain of app resource payload. 1460type CustomDomainProperties struct { 1461 // Thumbprint - The thumbprint of bound certificate. 1462 Thumbprint *string `json:"thumbprint,omitempty"` 1463 // AppName - READ-ONLY; The app name of domain. 1464 AppName *string `json:"appName,omitempty"` 1465 // CertName - The bound certificate name of domain. 1466 CertName *string `json:"certName,omitempty"` 1467} 1468 1469// MarshalJSON is the custom marshaler for CustomDomainProperties. 1470func (cdp CustomDomainProperties) MarshalJSON() ([]byte, error) { 1471 objectMap := make(map[string]interface{}) 1472 if cdp.Thumbprint != nil { 1473 objectMap["thumbprint"] = cdp.Thumbprint 1474 } 1475 if cdp.CertName != nil { 1476 objectMap["certName"] = cdp.CertName 1477 } 1478 return json.Marshal(objectMap) 1479} 1480 1481// CustomDomainResource custom domain resource payload. 1482type CustomDomainResource struct { 1483 autorest.Response `json:"-"` 1484 // Properties - Properties of the custom domain resource. 1485 Properties *CustomDomainProperties `json:"properties,omitempty"` 1486 // ID - READ-ONLY; Fully qualified resource Id for the resource. 1487 ID *string `json:"id,omitempty"` 1488 // Name - READ-ONLY; The name of the resource. 1489 Name *string `json:"name,omitempty"` 1490 // Type - READ-ONLY; The type of the resource. 1491 Type *string `json:"type,omitempty"` 1492} 1493 1494// MarshalJSON is the custom marshaler for CustomDomainResource. 1495func (cdr CustomDomainResource) MarshalJSON() ([]byte, error) { 1496 objectMap := make(map[string]interface{}) 1497 if cdr.Properties != nil { 1498 objectMap["properties"] = cdr.Properties 1499 } 1500 return json.Marshal(objectMap) 1501} 1502 1503// CustomDomainResourceCollection collection compose of a custom domain resources list and a possible link 1504// for next page. 1505type CustomDomainResourceCollection struct { 1506 autorest.Response `json:"-"` 1507 // Value - The custom domain resources list. 1508 Value *[]CustomDomainResource `json:"value,omitempty"` 1509 // NextLink - The link to next page of custom domain list. 1510 NextLink *string `json:"nextLink,omitempty"` 1511} 1512 1513// CustomDomainResourceCollectionIterator provides access to a complete listing of CustomDomainResource 1514// values. 1515type CustomDomainResourceCollectionIterator struct { 1516 i int 1517 page CustomDomainResourceCollectionPage 1518} 1519 1520// NextWithContext advances to the next value. If there was an error making 1521// the request the iterator does not advance and the error is returned. 1522func (iter *CustomDomainResourceCollectionIterator) NextWithContext(ctx context.Context) (err error) { 1523 if tracing.IsEnabled() { 1524 ctx = tracing.StartSpan(ctx, fqdn+"/CustomDomainResourceCollectionIterator.NextWithContext") 1525 defer func() { 1526 sc := -1 1527 if iter.Response().Response.Response != nil { 1528 sc = iter.Response().Response.Response.StatusCode 1529 } 1530 tracing.EndSpan(ctx, sc, err) 1531 }() 1532 } 1533 iter.i++ 1534 if iter.i < len(iter.page.Values()) { 1535 return nil 1536 } 1537 err = iter.page.NextWithContext(ctx) 1538 if err != nil { 1539 iter.i-- 1540 return err 1541 } 1542 iter.i = 0 1543 return nil 1544} 1545 1546// Next advances to the next value. If there was an error making 1547// the request the iterator does not advance and the error is returned. 1548// Deprecated: Use NextWithContext() instead. 1549func (iter *CustomDomainResourceCollectionIterator) Next() error { 1550 return iter.NextWithContext(context.Background()) 1551} 1552 1553// NotDone returns true if the enumeration should be started or is not yet complete. 1554func (iter CustomDomainResourceCollectionIterator) NotDone() bool { 1555 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 1556} 1557 1558// Response returns the raw server response from the last page request. 1559func (iter CustomDomainResourceCollectionIterator) Response() CustomDomainResourceCollection { 1560 return iter.page.Response() 1561} 1562 1563// Value returns the current value or a zero-initialized value if the 1564// iterator has advanced beyond the end of the collection. 1565func (iter CustomDomainResourceCollectionIterator) Value() CustomDomainResource { 1566 if !iter.page.NotDone() { 1567 return CustomDomainResource{} 1568 } 1569 return iter.page.Values()[iter.i] 1570} 1571 1572// Creates a new instance of the CustomDomainResourceCollectionIterator type. 1573func NewCustomDomainResourceCollectionIterator(page CustomDomainResourceCollectionPage) CustomDomainResourceCollectionIterator { 1574 return CustomDomainResourceCollectionIterator{page: page} 1575} 1576 1577// IsEmpty returns true if the ListResult contains no values. 1578func (cdrc CustomDomainResourceCollection) IsEmpty() bool { 1579 return cdrc.Value == nil || len(*cdrc.Value) == 0 1580} 1581 1582// hasNextLink returns true if the NextLink is not empty. 1583func (cdrc CustomDomainResourceCollection) hasNextLink() bool { 1584 return cdrc.NextLink != nil && len(*cdrc.NextLink) != 0 1585} 1586 1587// customDomainResourceCollectionPreparer prepares a request to retrieve the next set of results. 1588// It returns nil if no more results exist. 1589func (cdrc CustomDomainResourceCollection) customDomainResourceCollectionPreparer(ctx context.Context) (*http.Request, error) { 1590 if !cdrc.hasNextLink() { 1591 return nil, nil 1592 } 1593 return autorest.Prepare((&http.Request{}).WithContext(ctx), 1594 autorest.AsJSON(), 1595 autorest.AsGet(), 1596 autorest.WithBaseURL(to.String(cdrc.NextLink))) 1597} 1598 1599// CustomDomainResourceCollectionPage contains a page of CustomDomainResource values. 1600type CustomDomainResourceCollectionPage struct { 1601 fn func(context.Context, CustomDomainResourceCollection) (CustomDomainResourceCollection, error) 1602 cdrc CustomDomainResourceCollection 1603} 1604 1605// NextWithContext advances to the next page of values. If there was an error making 1606// the request the page does not advance and the error is returned. 1607func (page *CustomDomainResourceCollectionPage) NextWithContext(ctx context.Context) (err error) { 1608 if tracing.IsEnabled() { 1609 ctx = tracing.StartSpan(ctx, fqdn+"/CustomDomainResourceCollectionPage.NextWithContext") 1610 defer func() { 1611 sc := -1 1612 if page.Response().Response.Response != nil { 1613 sc = page.Response().Response.Response.StatusCode 1614 } 1615 tracing.EndSpan(ctx, sc, err) 1616 }() 1617 } 1618 for { 1619 next, err := page.fn(ctx, page.cdrc) 1620 if err != nil { 1621 return err 1622 } 1623 page.cdrc = next 1624 if !next.hasNextLink() || !next.IsEmpty() { 1625 break 1626 } 1627 } 1628 return nil 1629} 1630 1631// Next advances to the next page of values. If there was an error making 1632// the request the page does not advance and the error is returned. 1633// Deprecated: Use NextWithContext() instead. 1634func (page *CustomDomainResourceCollectionPage) Next() error { 1635 return page.NextWithContext(context.Background()) 1636} 1637 1638// NotDone returns true if the page enumeration should be started or is not yet complete. 1639func (page CustomDomainResourceCollectionPage) NotDone() bool { 1640 return !page.cdrc.IsEmpty() 1641} 1642 1643// Response returns the raw server response from the last page request. 1644func (page CustomDomainResourceCollectionPage) Response() CustomDomainResourceCollection { 1645 return page.cdrc 1646} 1647 1648// Values returns the slice of values for the current page or nil if there are no values. 1649func (page CustomDomainResourceCollectionPage) Values() []CustomDomainResource { 1650 if page.cdrc.IsEmpty() { 1651 return nil 1652 } 1653 return *page.cdrc.Value 1654} 1655 1656// Creates a new instance of the CustomDomainResourceCollectionPage type. 1657func NewCustomDomainResourceCollectionPage(cur CustomDomainResourceCollection, getNextPage func(context.Context, CustomDomainResourceCollection) (CustomDomainResourceCollection, error)) CustomDomainResourceCollectionPage { 1658 return CustomDomainResourceCollectionPage{ 1659 fn: getNextPage, 1660 cdrc: cur, 1661 } 1662} 1663 1664// CustomDomainsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a 1665// long-running operation. 1666type CustomDomainsCreateOrUpdateFuture struct { 1667 azure.FutureAPI 1668 // Result returns the result of the asynchronous operation. 1669 // If the operation has not completed it will return an error. 1670 Result func(CustomDomainsClient) (CustomDomainResource, error) 1671} 1672 1673// UnmarshalJSON is the custom unmarshaller for CreateFuture. 1674func (future *CustomDomainsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 1675 var azFuture azure.Future 1676 if err := json.Unmarshal(body, &azFuture); err != nil { 1677 return err 1678 } 1679 future.FutureAPI = &azFuture 1680 future.Result = future.result 1681 return nil 1682} 1683 1684// result is the default implementation for CustomDomainsCreateOrUpdateFuture.Result. 1685func (future *CustomDomainsCreateOrUpdateFuture) result(client CustomDomainsClient) (cdr CustomDomainResource, err error) { 1686 var done bool 1687 done, err = future.DoneWithContext(context.Background(), client) 1688 if err != nil { 1689 err = autorest.NewErrorWithError(err, "appplatform.CustomDomainsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 1690 return 1691 } 1692 if !done { 1693 cdr.Response.Response = future.Response() 1694 err = azure.NewAsyncOpIncompleteError("appplatform.CustomDomainsCreateOrUpdateFuture") 1695 return 1696 } 1697 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 1698 if cdr.Response.Response, err = future.GetResult(sender); err == nil && cdr.Response.Response.StatusCode != http.StatusNoContent { 1699 cdr, err = client.CreateOrUpdateResponder(cdr.Response.Response) 1700 if err != nil { 1701 err = autorest.NewErrorWithError(err, "appplatform.CustomDomainsCreateOrUpdateFuture", "Result", cdr.Response.Response, "Failure responding to request") 1702 } 1703 } 1704 return 1705} 1706 1707// CustomDomainsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running 1708// operation. 1709type CustomDomainsDeleteFuture struct { 1710 azure.FutureAPI 1711 // Result returns the result of the asynchronous operation. 1712 // If the operation has not completed it will return an error. 1713 Result func(CustomDomainsClient) (autorest.Response, error) 1714} 1715 1716// UnmarshalJSON is the custom unmarshaller for CreateFuture. 1717func (future *CustomDomainsDeleteFuture) UnmarshalJSON(body []byte) error { 1718 var azFuture azure.Future 1719 if err := json.Unmarshal(body, &azFuture); err != nil { 1720 return err 1721 } 1722 future.FutureAPI = &azFuture 1723 future.Result = future.result 1724 return nil 1725} 1726 1727// result is the default implementation for CustomDomainsDeleteFuture.Result. 1728func (future *CustomDomainsDeleteFuture) result(client CustomDomainsClient) (ar autorest.Response, err error) { 1729 var done bool 1730 done, err = future.DoneWithContext(context.Background(), client) 1731 if err != nil { 1732 err = autorest.NewErrorWithError(err, "appplatform.CustomDomainsDeleteFuture", "Result", future.Response(), "Polling failure") 1733 return 1734 } 1735 if !done { 1736 ar.Response = future.Response() 1737 err = azure.NewAsyncOpIncompleteError("appplatform.CustomDomainsDeleteFuture") 1738 return 1739 } 1740 ar.Response = future.Response() 1741 return 1742} 1743 1744// CustomDomainsUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 1745// operation. 1746type CustomDomainsUpdateFuture struct { 1747 azure.FutureAPI 1748 // Result returns the result of the asynchronous operation. 1749 // If the operation has not completed it will return an error. 1750 Result func(CustomDomainsClient) (CustomDomainResource, error) 1751} 1752 1753// UnmarshalJSON is the custom unmarshaller for CreateFuture. 1754func (future *CustomDomainsUpdateFuture) UnmarshalJSON(body []byte) error { 1755 var azFuture azure.Future 1756 if err := json.Unmarshal(body, &azFuture); err != nil { 1757 return err 1758 } 1759 future.FutureAPI = &azFuture 1760 future.Result = future.result 1761 return nil 1762} 1763 1764// result is the default implementation for CustomDomainsUpdateFuture.Result. 1765func (future *CustomDomainsUpdateFuture) result(client CustomDomainsClient) (cdr CustomDomainResource, err error) { 1766 var done bool 1767 done, err = future.DoneWithContext(context.Background(), client) 1768 if err != nil { 1769 err = autorest.NewErrorWithError(err, "appplatform.CustomDomainsUpdateFuture", "Result", future.Response(), "Polling failure") 1770 return 1771 } 1772 if !done { 1773 cdr.Response.Response = future.Response() 1774 err = azure.NewAsyncOpIncompleteError("appplatform.CustomDomainsUpdateFuture") 1775 return 1776 } 1777 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 1778 if cdr.Response.Response, err = future.GetResult(sender); err == nil && cdr.Response.Response.StatusCode != http.StatusNoContent { 1779 cdr, err = client.UpdateResponder(cdr.Response.Response) 1780 if err != nil { 1781 err = autorest.NewErrorWithError(err, "appplatform.CustomDomainsUpdateFuture", "Result", cdr.Response.Response, "Failure responding to request") 1782 } 1783 } 1784 return 1785} 1786 1787// CustomDomainValidatePayload custom domain validate payload. 1788type CustomDomainValidatePayload struct { 1789 // Name - Name to be validated 1790 Name *string `json:"name,omitempty"` 1791} 1792 1793// CustomDomainValidateResult validation result for custom domain. 1794type CustomDomainValidateResult struct { 1795 autorest.Response `json:"-"` 1796 // IsValid - Indicates if domain name is valid. 1797 IsValid *bool `json:"isValid,omitempty"` 1798 // Message - Message of why domain name is invalid. 1799 Message *string `json:"message,omitempty"` 1800} 1801 1802// DeploymentInstance deployment instance payload 1803type DeploymentInstance struct { 1804 // Name - READ-ONLY; Name of the deployment instance 1805 Name *string `json:"name,omitempty"` 1806 // Status - READ-ONLY; Status of the deployment instance 1807 Status *string `json:"status,omitempty"` 1808 // Reason - READ-ONLY; Failed reason of the deployment instance 1809 Reason *string `json:"reason,omitempty"` 1810 // DiscoveryStatus - READ-ONLY; Discovery status of the deployment instance 1811 DiscoveryStatus *string `json:"discoveryStatus,omitempty"` 1812 // StartTime - READ-ONLY; Start time of the deployment instance 1813 StartTime *string `json:"startTime,omitempty"` 1814} 1815 1816// MarshalJSON is the custom marshaler for DeploymentInstance. 1817func (di DeploymentInstance) MarshalJSON() ([]byte, error) { 1818 objectMap := make(map[string]interface{}) 1819 return json.Marshal(objectMap) 1820} 1821 1822// DeploymentResource deployment resource payload 1823type DeploymentResource struct { 1824 autorest.Response `json:"-"` 1825 // Properties - Properties of the Deployment resource 1826 Properties *DeploymentResourceProperties `json:"properties,omitempty"` 1827 // Sku - Sku of the Deployment resource 1828 Sku *Sku `json:"sku,omitempty"` 1829 // ID - READ-ONLY; Fully qualified resource Id for the resource. 1830 ID *string `json:"id,omitempty"` 1831 // Name - READ-ONLY; The name of the resource. 1832 Name *string `json:"name,omitempty"` 1833 // Type - READ-ONLY; The type of the resource. 1834 Type *string `json:"type,omitempty"` 1835} 1836 1837// MarshalJSON is the custom marshaler for DeploymentResource. 1838func (dr DeploymentResource) MarshalJSON() ([]byte, error) { 1839 objectMap := make(map[string]interface{}) 1840 if dr.Properties != nil { 1841 objectMap["properties"] = dr.Properties 1842 } 1843 if dr.Sku != nil { 1844 objectMap["sku"] = dr.Sku 1845 } 1846 return json.Marshal(objectMap) 1847} 1848 1849// DeploymentResourceCollection object that includes an array of App resources and a possible link for next 1850// set 1851type DeploymentResourceCollection struct { 1852 autorest.Response `json:"-"` 1853 // Value - Collection of Deployment resources 1854 Value *[]DeploymentResource `json:"value,omitempty"` 1855 // NextLink - URL client should use to fetch the next page (per server side paging). 1856 // It's null for now, added for future use. 1857 NextLink *string `json:"nextLink,omitempty"` 1858} 1859 1860// DeploymentResourceCollectionIterator provides access to a complete listing of DeploymentResource values. 1861type DeploymentResourceCollectionIterator struct { 1862 i int 1863 page DeploymentResourceCollectionPage 1864} 1865 1866// NextWithContext advances to the next value. If there was an error making 1867// the request the iterator does not advance and the error is returned. 1868func (iter *DeploymentResourceCollectionIterator) NextWithContext(ctx context.Context) (err error) { 1869 if tracing.IsEnabled() { 1870 ctx = tracing.StartSpan(ctx, fqdn+"/DeploymentResourceCollectionIterator.NextWithContext") 1871 defer func() { 1872 sc := -1 1873 if iter.Response().Response.Response != nil { 1874 sc = iter.Response().Response.Response.StatusCode 1875 } 1876 tracing.EndSpan(ctx, sc, err) 1877 }() 1878 } 1879 iter.i++ 1880 if iter.i < len(iter.page.Values()) { 1881 return nil 1882 } 1883 err = iter.page.NextWithContext(ctx) 1884 if err != nil { 1885 iter.i-- 1886 return err 1887 } 1888 iter.i = 0 1889 return nil 1890} 1891 1892// Next advances to the next value. If there was an error making 1893// the request the iterator does not advance and the error is returned. 1894// Deprecated: Use NextWithContext() instead. 1895func (iter *DeploymentResourceCollectionIterator) Next() error { 1896 return iter.NextWithContext(context.Background()) 1897} 1898 1899// NotDone returns true if the enumeration should be started or is not yet complete. 1900func (iter DeploymentResourceCollectionIterator) NotDone() bool { 1901 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 1902} 1903 1904// Response returns the raw server response from the last page request. 1905func (iter DeploymentResourceCollectionIterator) Response() DeploymentResourceCollection { 1906 return iter.page.Response() 1907} 1908 1909// Value returns the current value or a zero-initialized value if the 1910// iterator has advanced beyond the end of the collection. 1911func (iter DeploymentResourceCollectionIterator) Value() DeploymentResource { 1912 if !iter.page.NotDone() { 1913 return DeploymentResource{} 1914 } 1915 return iter.page.Values()[iter.i] 1916} 1917 1918// Creates a new instance of the DeploymentResourceCollectionIterator type. 1919func NewDeploymentResourceCollectionIterator(page DeploymentResourceCollectionPage) DeploymentResourceCollectionIterator { 1920 return DeploymentResourceCollectionIterator{page: page} 1921} 1922 1923// IsEmpty returns true if the ListResult contains no values. 1924func (drc DeploymentResourceCollection) IsEmpty() bool { 1925 return drc.Value == nil || len(*drc.Value) == 0 1926} 1927 1928// hasNextLink returns true if the NextLink is not empty. 1929func (drc DeploymentResourceCollection) hasNextLink() bool { 1930 return drc.NextLink != nil && len(*drc.NextLink) != 0 1931} 1932 1933// deploymentResourceCollectionPreparer prepares a request to retrieve the next set of results. 1934// It returns nil if no more results exist. 1935func (drc DeploymentResourceCollection) deploymentResourceCollectionPreparer(ctx context.Context) (*http.Request, error) { 1936 if !drc.hasNextLink() { 1937 return nil, nil 1938 } 1939 return autorest.Prepare((&http.Request{}).WithContext(ctx), 1940 autorest.AsJSON(), 1941 autorest.AsGet(), 1942 autorest.WithBaseURL(to.String(drc.NextLink))) 1943} 1944 1945// DeploymentResourceCollectionPage contains a page of DeploymentResource values. 1946type DeploymentResourceCollectionPage struct { 1947 fn func(context.Context, DeploymentResourceCollection) (DeploymentResourceCollection, error) 1948 drc DeploymentResourceCollection 1949} 1950 1951// NextWithContext advances to the next page of values. If there was an error making 1952// the request the page does not advance and the error is returned. 1953func (page *DeploymentResourceCollectionPage) NextWithContext(ctx context.Context) (err error) { 1954 if tracing.IsEnabled() { 1955 ctx = tracing.StartSpan(ctx, fqdn+"/DeploymentResourceCollectionPage.NextWithContext") 1956 defer func() { 1957 sc := -1 1958 if page.Response().Response.Response != nil { 1959 sc = page.Response().Response.Response.StatusCode 1960 } 1961 tracing.EndSpan(ctx, sc, err) 1962 }() 1963 } 1964 for { 1965 next, err := page.fn(ctx, page.drc) 1966 if err != nil { 1967 return err 1968 } 1969 page.drc = next 1970 if !next.hasNextLink() || !next.IsEmpty() { 1971 break 1972 } 1973 } 1974 return nil 1975} 1976 1977// Next advances to the next page of values. If there was an error making 1978// the request the page does not advance and the error is returned. 1979// Deprecated: Use NextWithContext() instead. 1980func (page *DeploymentResourceCollectionPage) Next() error { 1981 return page.NextWithContext(context.Background()) 1982} 1983 1984// NotDone returns true if the page enumeration should be started or is not yet complete. 1985func (page DeploymentResourceCollectionPage) NotDone() bool { 1986 return !page.drc.IsEmpty() 1987} 1988 1989// Response returns the raw server response from the last page request. 1990func (page DeploymentResourceCollectionPage) Response() DeploymentResourceCollection { 1991 return page.drc 1992} 1993 1994// Values returns the slice of values for the current page or nil if there are no values. 1995func (page DeploymentResourceCollectionPage) Values() []DeploymentResource { 1996 if page.drc.IsEmpty() { 1997 return nil 1998 } 1999 return *page.drc.Value 2000} 2001 2002// Creates a new instance of the DeploymentResourceCollectionPage type. 2003func NewDeploymentResourceCollectionPage(cur DeploymentResourceCollection, getNextPage func(context.Context, DeploymentResourceCollection) (DeploymentResourceCollection, error)) DeploymentResourceCollectionPage { 2004 return DeploymentResourceCollectionPage{ 2005 fn: getNextPage, 2006 drc: cur, 2007 } 2008} 2009 2010// DeploymentResourceProperties deployment resource properties payload 2011type DeploymentResourceProperties struct { 2012 // Source - Uploaded source information of the deployment. 2013 Source *UserSourceInfo `json:"source,omitempty"` 2014 // AppName - READ-ONLY; App name of the deployment 2015 AppName *string `json:"appName,omitempty"` 2016 // DeploymentSettings - Deployment settings of the Deployment 2017 DeploymentSettings *DeploymentSettings `json:"deploymentSettings,omitempty"` 2018 // ProvisioningState - READ-ONLY; Provisioning state of the Deployment. Possible values include: 'DeploymentResourceProvisioningStateCreating', 'DeploymentResourceProvisioningStateUpdating', 'DeploymentResourceProvisioningStateSucceeded', 'DeploymentResourceProvisioningStateFailed' 2019 ProvisioningState DeploymentResourceProvisioningState `json:"provisioningState,omitempty"` 2020 // Status - READ-ONLY; Status of the Deployment. Possible values include: 'DeploymentResourceStatusUnknown', 'DeploymentResourceStatusStopped', 'DeploymentResourceStatusRunning', 'DeploymentResourceStatusFailed', 'DeploymentResourceStatusAllocating', 'DeploymentResourceStatusUpgrading', 'DeploymentResourceStatusCompiling' 2021 Status DeploymentResourceStatus `json:"status,omitempty"` 2022 // Active - READ-ONLY; Indicates whether the Deployment is active 2023 Active *bool `json:"active,omitempty"` 2024 // CreatedTime - READ-ONLY; Date time when the resource is created 2025 CreatedTime *date.Time `json:"createdTime,omitempty"` 2026 // Instances - READ-ONLY; Collection of instances belong to the Deployment 2027 Instances *[]DeploymentInstance `json:"instances,omitempty"` 2028} 2029 2030// MarshalJSON is the custom marshaler for DeploymentResourceProperties. 2031func (drp DeploymentResourceProperties) MarshalJSON() ([]byte, error) { 2032 objectMap := make(map[string]interface{}) 2033 if drp.Source != nil { 2034 objectMap["source"] = drp.Source 2035 } 2036 if drp.DeploymentSettings != nil { 2037 objectMap["deploymentSettings"] = drp.DeploymentSettings 2038 } 2039 return json.Marshal(objectMap) 2040} 2041 2042// DeploymentsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a 2043// long-running operation. 2044type DeploymentsCreateOrUpdateFuture struct { 2045 azure.FutureAPI 2046 // Result returns the result of the asynchronous operation. 2047 // If the operation has not completed it will return an error. 2048 Result func(DeploymentsClient) (DeploymentResource, error) 2049} 2050 2051// UnmarshalJSON is the custom unmarshaller for CreateFuture. 2052func (future *DeploymentsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 2053 var azFuture azure.Future 2054 if err := json.Unmarshal(body, &azFuture); err != nil { 2055 return err 2056 } 2057 future.FutureAPI = &azFuture 2058 future.Result = future.result 2059 return nil 2060} 2061 2062// result is the default implementation for DeploymentsCreateOrUpdateFuture.Result. 2063func (future *DeploymentsCreateOrUpdateFuture) result(client DeploymentsClient) (dr DeploymentResource, err error) { 2064 var done bool 2065 done, err = future.DoneWithContext(context.Background(), client) 2066 if err != nil { 2067 err = autorest.NewErrorWithError(err, "appplatform.DeploymentsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 2068 return 2069 } 2070 if !done { 2071 dr.Response.Response = future.Response() 2072 err = azure.NewAsyncOpIncompleteError("appplatform.DeploymentsCreateOrUpdateFuture") 2073 return 2074 } 2075 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 2076 if dr.Response.Response, err = future.GetResult(sender); err == nil && dr.Response.Response.StatusCode != http.StatusNoContent { 2077 dr, err = client.CreateOrUpdateResponder(dr.Response.Response) 2078 if err != nil { 2079 err = autorest.NewErrorWithError(err, "appplatform.DeploymentsCreateOrUpdateFuture", "Result", dr.Response.Response, "Failure responding to request") 2080 } 2081 } 2082 return 2083} 2084 2085// DeploymentsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running 2086// operation. 2087type DeploymentsDeleteFuture struct { 2088 azure.FutureAPI 2089 // Result returns the result of the asynchronous operation. 2090 // If the operation has not completed it will return an error. 2091 Result func(DeploymentsClient) (autorest.Response, error) 2092} 2093 2094// UnmarshalJSON is the custom unmarshaller for CreateFuture. 2095func (future *DeploymentsDeleteFuture) UnmarshalJSON(body []byte) error { 2096 var azFuture azure.Future 2097 if err := json.Unmarshal(body, &azFuture); err != nil { 2098 return err 2099 } 2100 future.FutureAPI = &azFuture 2101 future.Result = future.result 2102 return nil 2103} 2104 2105// result is the default implementation for DeploymentsDeleteFuture.Result. 2106func (future *DeploymentsDeleteFuture) result(client DeploymentsClient) (ar autorest.Response, err error) { 2107 var done bool 2108 done, err = future.DoneWithContext(context.Background(), client) 2109 if err != nil { 2110 err = autorest.NewErrorWithError(err, "appplatform.DeploymentsDeleteFuture", "Result", future.Response(), "Polling failure") 2111 return 2112 } 2113 if !done { 2114 ar.Response = future.Response() 2115 err = azure.NewAsyncOpIncompleteError("appplatform.DeploymentsDeleteFuture") 2116 return 2117 } 2118 ar.Response = future.Response() 2119 return 2120} 2121 2122// DeploymentSettings deployment settings payload 2123type DeploymentSettings struct { 2124 // CPU - Required CPU, basic tier should be 1, standard tier should be in range (1, 4) 2125 CPU *int32 `json:"cpu,omitempty"` 2126 // MemoryInGB - Required Memory size in GB, basic tier should be in range (1, 2), standard tier should be in range (1, 8) 2127 MemoryInGB *int32 `json:"memoryInGB,omitempty"` 2128 // JvmOptions - JVM parameter 2129 JvmOptions *string `json:"jvmOptions,omitempty"` 2130 // NetCoreMainEntryPath - The path to the .NET executable relative to zip root 2131 NetCoreMainEntryPath *string `json:"netCoreMainEntryPath,omitempty"` 2132 // EnvironmentVariables - Collection of environment variables 2133 EnvironmentVariables map[string]*string `json:"environmentVariables"` 2134 // RuntimeVersion - Runtime version. Possible values include: 'Java8', 'Java11', 'NetCore31' 2135 RuntimeVersion RuntimeVersion `json:"runtimeVersion,omitempty"` 2136} 2137 2138// MarshalJSON is the custom marshaler for DeploymentSettings. 2139func (ds DeploymentSettings) MarshalJSON() ([]byte, error) { 2140 objectMap := make(map[string]interface{}) 2141 if ds.CPU != nil { 2142 objectMap["cpu"] = ds.CPU 2143 } 2144 if ds.MemoryInGB != nil { 2145 objectMap["memoryInGB"] = ds.MemoryInGB 2146 } 2147 if ds.JvmOptions != nil { 2148 objectMap["jvmOptions"] = ds.JvmOptions 2149 } 2150 if ds.NetCoreMainEntryPath != nil { 2151 objectMap["netCoreMainEntryPath"] = ds.NetCoreMainEntryPath 2152 } 2153 if ds.EnvironmentVariables != nil { 2154 objectMap["environmentVariables"] = ds.EnvironmentVariables 2155 } 2156 if ds.RuntimeVersion != "" { 2157 objectMap["runtimeVersion"] = ds.RuntimeVersion 2158 } 2159 return json.Marshal(objectMap) 2160} 2161 2162// DeploymentsRestartFuture an abstraction for monitoring and retrieving the results of a long-running 2163// operation. 2164type DeploymentsRestartFuture struct { 2165 azure.FutureAPI 2166 // Result returns the result of the asynchronous operation. 2167 // If the operation has not completed it will return an error. 2168 Result func(DeploymentsClient) (autorest.Response, error) 2169} 2170 2171// UnmarshalJSON is the custom unmarshaller for CreateFuture. 2172func (future *DeploymentsRestartFuture) UnmarshalJSON(body []byte) error { 2173 var azFuture azure.Future 2174 if err := json.Unmarshal(body, &azFuture); err != nil { 2175 return err 2176 } 2177 future.FutureAPI = &azFuture 2178 future.Result = future.result 2179 return nil 2180} 2181 2182// result is the default implementation for DeploymentsRestartFuture.Result. 2183func (future *DeploymentsRestartFuture) result(client DeploymentsClient) (ar autorest.Response, err error) { 2184 var done bool 2185 done, err = future.DoneWithContext(context.Background(), client) 2186 if err != nil { 2187 err = autorest.NewErrorWithError(err, "appplatform.DeploymentsRestartFuture", "Result", future.Response(), "Polling failure") 2188 return 2189 } 2190 if !done { 2191 ar.Response = future.Response() 2192 err = azure.NewAsyncOpIncompleteError("appplatform.DeploymentsRestartFuture") 2193 return 2194 } 2195 ar.Response = future.Response() 2196 return 2197} 2198 2199// DeploymentsStartFuture an abstraction for monitoring and retrieving the results of a long-running 2200// operation. 2201type DeploymentsStartFuture struct { 2202 azure.FutureAPI 2203 // Result returns the result of the asynchronous operation. 2204 // If the operation has not completed it will return an error. 2205 Result func(DeploymentsClient) (autorest.Response, error) 2206} 2207 2208// UnmarshalJSON is the custom unmarshaller for CreateFuture. 2209func (future *DeploymentsStartFuture) UnmarshalJSON(body []byte) error { 2210 var azFuture azure.Future 2211 if err := json.Unmarshal(body, &azFuture); err != nil { 2212 return err 2213 } 2214 future.FutureAPI = &azFuture 2215 future.Result = future.result 2216 return nil 2217} 2218 2219// result is the default implementation for DeploymentsStartFuture.Result. 2220func (future *DeploymentsStartFuture) result(client DeploymentsClient) (ar autorest.Response, err error) { 2221 var done bool 2222 done, err = future.DoneWithContext(context.Background(), client) 2223 if err != nil { 2224 err = autorest.NewErrorWithError(err, "appplatform.DeploymentsStartFuture", "Result", future.Response(), "Polling failure") 2225 return 2226 } 2227 if !done { 2228 ar.Response = future.Response() 2229 err = azure.NewAsyncOpIncompleteError("appplatform.DeploymentsStartFuture") 2230 return 2231 } 2232 ar.Response = future.Response() 2233 return 2234} 2235 2236// DeploymentsStopFuture an abstraction for monitoring and retrieving the results of a long-running 2237// operation. 2238type DeploymentsStopFuture struct { 2239 azure.FutureAPI 2240 // Result returns the result of the asynchronous operation. 2241 // If the operation has not completed it will return an error. 2242 Result func(DeploymentsClient) (autorest.Response, error) 2243} 2244 2245// UnmarshalJSON is the custom unmarshaller for CreateFuture. 2246func (future *DeploymentsStopFuture) UnmarshalJSON(body []byte) error { 2247 var azFuture azure.Future 2248 if err := json.Unmarshal(body, &azFuture); err != nil { 2249 return err 2250 } 2251 future.FutureAPI = &azFuture 2252 future.Result = future.result 2253 return nil 2254} 2255 2256// result is the default implementation for DeploymentsStopFuture.Result. 2257func (future *DeploymentsStopFuture) result(client DeploymentsClient) (ar autorest.Response, err error) { 2258 var done bool 2259 done, err = future.DoneWithContext(context.Background(), client) 2260 if err != nil { 2261 err = autorest.NewErrorWithError(err, "appplatform.DeploymentsStopFuture", "Result", future.Response(), "Polling failure") 2262 return 2263 } 2264 if !done { 2265 ar.Response = future.Response() 2266 err = azure.NewAsyncOpIncompleteError("appplatform.DeploymentsStopFuture") 2267 return 2268 } 2269 ar.Response = future.Response() 2270 return 2271} 2272 2273// DeploymentsUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 2274// operation. 2275type DeploymentsUpdateFuture struct { 2276 azure.FutureAPI 2277 // Result returns the result of the asynchronous operation. 2278 // If the operation has not completed it will return an error. 2279 Result func(DeploymentsClient) (DeploymentResource, error) 2280} 2281 2282// UnmarshalJSON is the custom unmarshaller for CreateFuture. 2283func (future *DeploymentsUpdateFuture) UnmarshalJSON(body []byte) error { 2284 var azFuture azure.Future 2285 if err := json.Unmarshal(body, &azFuture); err != nil { 2286 return err 2287 } 2288 future.FutureAPI = &azFuture 2289 future.Result = future.result 2290 return nil 2291} 2292 2293// result is the default implementation for DeploymentsUpdateFuture.Result. 2294func (future *DeploymentsUpdateFuture) result(client DeploymentsClient) (dr DeploymentResource, err error) { 2295 var done bool 2296 done, err = future.DoneWithContext(context.Background(), client) 2297 if err != nil { 2298 err = autorest.NewErrorWithError(err, "appplatform.DeploymentsUpdateFuture", "Result", future.Response(), "Polling failure") 2299 return 2300 } 2301 if !done { 2302 dr.Response.Response = future.Response() 2303 err = azure.NewAsyncOpIncompleteError("appplatform.DeploymentsUpdateFuture") 2304 return 2305 } 2306 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 2307 if dr.Response.Response, err = future.GetResult(sender); err == nil && dr.Response.Response.StatusCode != http.StatusNoContent { 2308 dr, err = client.UpdateResponder(dr.Response.Response) 2309 if err != nil { 2310 err = autorest.NewErrorWithError(err, "appplatform.DeploymentsUpdateFuture", "Result", dr.Response.Response, "Failure responding to request") 2311 } 2312 } 2313 return 2314} 2315 2316// Error the error code compose of code and message. 2317type Error struct { 2318 // Code - The code of error. 2319 Code *string `json:"code,omitempty"` 2320 // Message - The message of error. 2321 Message *string `json:"message,omitempty"` 2322} 2323 2324// GitPatternRepository git repository property payload 2325type GitPatternRepository struct { 2326 // Name - Name of the repository 2327 Name *string `json:"name,omitempty"` 2328 // Pattern - Collection of pattern of the repository 2329 Pattern *[]string `json:"pattern,omitempty"` 2330 // URI - URI of the repository 2331 URI *string `json:"uri,omitempty"` 2332 // Label - Label of the repository 2333 Label *string `json:"label,omitempty"` 2334 // SearchPaths - Searching path of the repository 2335 SearchPaths *[]string `json:"searchPaths,omitempty"` 2336 // Username - Username of git repository basic auth. 2337 Username *string `json:"username,omitempty"` 2338 // Password - Password of git repository basic auth. 2339 Password *string `json:"password,omitempty"` 2340 // HostKey - Public sshKey of git repository. 2341 HostKey *string `json:"hostKey,omitempty"` 2342 // HostKeyAlgorithm - SshKey algorithm of git repository. 2343 HostKeyAlgorithm *string `json:"hostKeyAlgorithm,omitempty"` 2344 // PrivateKey - Private sshKey algorithm of git repository. 2345 PrivateKey *string `json:"privateKey,omitempty"` 2346 // StrictHostKeyChecking - Strict host key checking or not. 2347 StrictHostKeyChecking *bool `json:"strictHostKeyChecking,omitempty"` 2348} 2349 2350// LogFileURLResponse log file URL payload 2351type LogFileURLResponse struct { 2352 autorest.Response `json:"-"` 2353 // URL - URL of the log file 2354 URL *string `json:"url,omitempty"` 2355} 2356 2357// LogSpecification specifications of the Log for Azure Monitoring 2358type LogSpecification struct { 2359 // Name - Name of the log 2360 Name *string `json:"name,omitempty"` 2361 // DisplayName - Localized friendly display name of the log 2362 DisplayName *string `json:"displayName,omitempty"` 2363 // BlobDuration - Blob duration of the log 2364 BlobDuration *string `json:"blobDuration,omitempty"` 2365} 2366 2367// ManagedIdentityProperties managed identity properties retrieved from ARM request headers. 2368type ManagedIdentityProperties struct { 2369 // Type - Type of the managed identity. Possible values include: 'None', 'SystemAssigned', 'UserAssigned', 'SystemAssignedUserAssigned' 2370 Type ManagedIdentityType `json:"type,omitempty"` 2371 // PrincipalID - Principal Id 2372 PrincipalID *string `json:"principalId,omitempty"` 2373 // TenantID - Tenant Id 2374 TenantID *string `json:"tenantId,omitempty"` 2375} 2376 2377// MetricDimension specifications of the Dimension of metrics 2378type MetricDimension struct { 2379 // Name - Name of the dimension 2380 Name *string `json:"name,omitempty"` 2381 // DisplayName - Localized friendly display name of the dimension 2382 DisplayName *string `json:"displayName,omitempty"` 2383} 2384 2385// MetricSpecification specifications of the Metrics for Azure Monitoring 2386type MetricSpecification struct { 2387 // Name - Name of the metric 2388 Name *string `json:"name,omitempty"` 2389 // DisplayName - Localized friendly display name of the metric 2390 DisplayName *string `json:"displayName,omitempty"` 2391 // DisplayDescription - Localized friendly description of the metric 2392 DisplayDescription *string `json:"displayDescription,omitempty"` 2393 // Unit - Unit that makes sense for the metric 2394 Unit *string `json:"unit,omitempty"` 2395 // Category - Name of the metric category that the metric belongs to. A metric can only belong to a single category. 2396 Category *string `json:"category,omitempty"` 2397 // AggregationType - Only provide one value for this field. Valid values: Average, Minimum, Maximum, Total, Count. 2398 AggregationType *string `json:"aggregationType,omitempty"` 2399 // SupportedAggregationTypes - Supported aggregation types 2400 SupportedAggregationTypes *[]string `json:"supportedAggregationTypes,omitempty"` 2401 // SupportedTimeGrainTypes - Supported time grain types 2402 SupportedTimeGrainTypes *[]string `json:"supportedTimeGrainTypes,omitempty"` 2403 // FillGapWithZero - Optional. If set to true, then zero will be returned for time duration where no metric is emitted/published. 2404 FillGapWithZero *bool `json:"fillGapWithZero,omitempty"` 2405 // Dimensions - Dimensions of the metric 2406 Dimensions *[]MetricDimension `json:"dimensions,omitempty"` 2407} 2408 2409// MonitoringSettingProperties monitoring Setting properties payload 2410type MonitoringSettingProperties struct { 2411 // ProvisioningState - READ-ONLY; State of the Monitoring Setting. Possible values include: 'MonitoringSettingStateNotAvailable', 'MonitoringSettingStateFailed', 'MonitoringSettingStateSucceeded', 'MonitoringSettingStateUpdating' 2412 ProvisioningState MonitoringSettingState `json:"provisioningState,omitempty"` 2413 // Error - Error when apply Monitoring Setting changes. 2414 Error *Error `json:"error,omitempty"` 2415 // TraceEnabled - Indicates whether enable the trace functionality 2416 TraceEnabled *bool `json:"traceEnabled,omitempty"` 2417 // AppInsightsInstrumentationKey - Target application insight instrumentation key 2418 AppInsightsInstrumentationKey *string `json:"appInsightsInstrumentationKey,omitempty"` 2419} 2420 2421// MarshalJSON is the custom marshaler for MonitoringSettingProperties. 2422func (msp MonitoringSettingProperties) MarshalJSON() ([]byte, error) { 2423 objectMap := make(map[string]interface{}) 2424 if msp.Error != nil { 2425 objectMap["error"] = msp.Error 2426 } 2427 if msp.TraceEnabled != nil { 2428 objectMap["traceEnabled"] = msp.TraceEnabled 2429 } 2430 if msp.AppInsightsInstrumentationKey != nil { 2431 objectMap["appInsightsInstrumentationKey"] = msp.AppInsightsInstrumentationKey 2432 } 2433 return json.Marshal(objectMap) 2434} 2435 2436// MonitoringSettingResource monitoring Setting resource 2437type MonitoringSettingResource struct { 2438 autorest.Response `json:"-"` 2439 // Properties - Properties of the Monitoring Setting resource 2440 Properties *MonitoringSettingProperties `json:"properties,omitempty"` 2441 // ID - READ-ONLY; Fully qualified resource Id for the resource. 2442 ID *string `json:"id,omitempty"` 2443 // Name - READ-ONLY; The name of the resource. 2444 Name *string `json:"name,omitempty"` 2445 // Type - READ-ONLY; The type of the resource. 2446 Type *string `json:"type,omitempty"` 2447} 2448 2449// MarshalJSON is the custom marshaler for MonitoringSettingResource. 2450func (msr MonitoringSettingResource) MarshalJSON() ([]byte, error) { 2451 objectMap := make(map[string]interface{}) 2452 if msr.Properties != nil { 2453 objectMap["properties"] = msr.Properties 2454 } 2455 return json.Marshal(objectMap) 2456} 2457 2458// MonitoringSettingsUpdatePatchFuture an abstraction for monitoring and retrieving the results of a 2459// long-running operation. 2460type MonitoringSettingsUpdatePatchFuture struct { 2461 azure.FutureAPI 2462 // Result returns the result of the asynchronous operation. 2463 // If the operation has not completed it will return an error. 2464 Result func(MonitoringSettingsClient) (MonitoringSettingResource, error) 2465} 2466 2467// UnmarshalJSON is the custom unmarshaller for CreateFuture. 2468func (future *MonitoringSettingsUpdatePatchFuture) UnmarshalJSON(body []byte) error { 2469 var azFuture azure.Future 2470 if err := json.Unmarshal(body, &azFuture); err != nil { 2471 return err 2472 } 2473 future.FutureAPI = &azFuture 2474 future.Result = future.result 2475 return nil 2476} 2477 2478// result is the default implementation for MonitoringSettingsUpdatePatchFuture.Result. 2479func (future *MonitoringSettingsUpdatePatchFuture) result(client MonitoringSettingsClient) (msr MonitoringSettingResource, err error) { 2480 var done bool 2481 done, err = future.DoneWithContext(context.Background(), client) 2482 if err != nil { 2483 err = autorest.NewErrorWithError(err, "appplatform.MonitoringSettingsUpdatePatchFuture", "Result", future.Response(), "Polling failure") 2484 return 2485 } 2486 if !done { 2487 msr.Response.Response = future.Response() 2488 err = azure.NewAsyncOpIncompleteError("appplatform.MonitoringSettingsUpdatePatchFuture") 2489 return 2490 } 2491 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 2492 if msr.Response.Response, err = future.GetResult(sender); err == nil && msr.Response.Response.StatusCode != http.StatusNoContent { 2493 msr, err = client.UpdatePatchResponder(msr.Response.Response) 2494 if err != nil { 2495 err = autorest.NewErrorWithError(err, "appplatform.MonitoringSettingsUpdatePatchFuture", "Result", msr.Response.Response, "Failure responding to request") 2496 } 2497 } 2498 return 2499} 2500 2501// MonitoringSettingsUpdatePutFuture an abstraction for monitoring and retrieving the results of a 2502// long-running operation. 2503type MonitoringSettingsUpdatePutFuture struct { 2504 azure.FutureAPI 2505 // Result returns the result of the asynchronous operation. 2506 // If the operation has not completed it will return an error. 2507 Result func(MonitoringSettingsClient) (MonitoringSettingResource, error) 2508} 2509 2510// UnmarshalJSON is the custom unmarshaller for CreateFuture. 2511func (future *MonitoringSettingsUpdatePutFuture) UnmarshalJSON(body []byte) error { 2512 var azFuture azure.Future 2513 if err := json.Unmarshal(body, &azFuture); err != nil { 2514 return err 2515 } 2516 future.FutureAPI = &azFuture 2517 future.Result = future.result 2518 return nil 2519} 2520 2521// result is the default implementation for MonitoringSettingsUpdatePutFuture.Result. 2522func (future *MonitoringSettingsUpdatePutFuture) result(client MonitoringSettingsClient) (msr MonitoringSettingResource, err error) { 2523 var done bool 2524 done, err = future.DoneWithContext(context.Background(), client) 2525 if err != nil { 2526 err = autorest.NewErrorWithError(err, "appplatform.MonitoringSettingsUpdatePutFuture", "Result", future.Response(), "Polling failure") 2527 return 2528 } 2529 if !done { 2530 msr.Response.Response = future.Response() 2531 err = azure.NewAsyncOpIncompleteError("appplatform.MonitoringSettingsUpdatePutFuture") 2532 return 2533 } 2534 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 2535 if msr.Response.Response, err = future.GetResult(sender); err == nil && msr.Response.Response.StatusCode != http.StatusNoContent { 2536 msr, err = client.UpdatePutResponder(msr.Response.Response) 2537 if err != nil { 2538 err = autorest.NewErrorWithError(err, "appplatform.MonitoringSettingsUpdatePutFuture", "Result", msr.Response.Response, "Failure responding to request") 2539 } 2540 } 2541 return 2542} 2543 2544// NameAvailability name availability result payload 2545type NameAvailability struct { 2546 autorest.Response `json:"-"` 2547 // NameAvailable - Indicates whether the name is available 2548 NameAvailable *bool `json:"nameAvailable,omitempty"` 2549 // Reason - Reason why the name is not available 2550 Reason *string `json:"reason,omitempty"` 2551 // Message - Message why the name is not available 2552 Message *string `json:"message,omitempty"` 2553} 2554 2555// NameAvailabilityParameters name availability parameters payload 2556type NameAvailabilityParameters struct { 2557 // Type - Type of the resource to check name availability 2558 Type *string `json:"type,omitempty"` 2559 // Name - Name to be checked 2560 Name *string `json:"name,omitempty"` 2561} 2562 2563// NetworkProfile service network profile payload 2564type NetworkProfile struct { 2565 // ServiceRuntimeSubnetID - Fully qualified resource Id of the subnet to host Azure Spring Cloud Service Runtime 2566 ServiceRuntimeSubnetID *string `json:"serviceRuntimeSubnetId,omitempty"` 2567 // AppSubnetID - Fully qualified resource Id of the subnet to host Azure Spring Cloud Apps 2568 AppSubnetID *string `json:"appSubnetId,omitempty"` 2569 // ServiceCidr - Azure Spring Cloud service reserved CIDR 2570 ServiceCidr *string `json:"serviceCidr,omitempty"` 2571 // ServiceRuntimeNetworkResourceGroup - Name of the resource group containing network resources of Azure Spring Cloud Service Runtime 2572 ServiceRuntimeNetworkResourceGroup *string `json:"serviceRuntimeNetworkResourceGroup,omitempty"` 2573 // AppNetworkResourceGroup - Name of the resource group containing network resources of Azure Spring Cloud Apps 2574 AppNetworkResourceGroup *string `json:"appNetworkResourceGroup,omitempty"` 2575 // OutboundIPs - READ-ONLY; Desired outbound IP resources for Azure Spring Cloud instance. 2576 OutboundIPs *NetworkProfileOutboundIPs `json:"outboundIPs,omitempty"` 2577} 2578 2579// MarshalJSON is the custom marshaler for NetworkProfile. 2580func (np NetworkProfile) MarshalJSON() ([]byte, error) { 2581 objectMap := make(map[string]interface{}) 2582 if np.ServiceRuntimeSubnetID != nil { 2583 objectMap["serviceRuntimeSubnetId"] = np.ServiceRuntimeSubnetID 2584 } 2585 if np.AppSubnetID != nil { 2586 objectMap["appSubnetId"] = np.AppSubnetID 2587 } 2588 if np.ServiceCidr != nil { 2589 objectMap["serviceCidr"] = np.ServiceCidr 2590 } 2591 if np.ServiceRuntimeNetworkResourceGroup != nil { 2592 objectMap["serviceRuntimeNetworkResourceGroup"] = np.ServiceRuntimeNetworkResourceGroup 2593 } 2594 if np.AppNetworkResourceGroup != nil { 2595 objectMap["appNetworkResourceGroup"] = np.AppNetworkResourceGroup 2596 } 2597 return json.Marshal(objectMap) 2598} 2599 2600// NetworkProfileOutboundIPs desired outbound IP resources for Azure Spring Cloud instance. 2601type NetworkProfileOutboundIPs struct { 2602 // PublicIPs - READ-ONLY; A list of public IP addresses. 2603 PublicIPs *[]string `json:"publicIPs,omitempty"` 2604} 2605 2606// MarshalJSON is the custom marshaler for NetworkProfileOutboundIPs. 2607func (npP NetworkProfileOutboundIPs) MarshalJSON() ([]byte, error) { 2608 objectMap := make(map[string]interface{}) 2609 return json.Marshal(objectMap) 2610} 2611 2612// OperationDetail operation detail payload 2613type OperationDetail struct { 2614 // Name - Name of the operation 2615 Name *string `json:"name,omitempty"` 2616 // IsDataAction - Indicates whether the operation is a data action 2617 IsDataAction *bool `json:"isDataAction,omitempty"` 2618 // Display - Display of the operation 2619 Display *OperationDisplay `json:"display,omitempty"` 2620 // Origin - Origin of the operation 2621 Origin *string `json:"origin,omitempty"` 2622 // Properties - Properties of the operation 2623 Properties *OperationProperties `json:"properties,omitempty"` 2624} 2625 2626// OperationDisplay operation display payload 2627type OperationDisplay struct { 2628 // Provider - Resource provider of the operation 2629 Provider *string `json:"provider,omitempty"` 2630 // Resource - Resource of the operation 2631 Resource *string `json:"resource,omitempty"` 2632 // Operation - Localized friendly name for the operation 2633 Operation *string `json:"operation,omitempty"` 2634 // Description - Localized friendly description for the operation 2635 Description *string `json:"description,omitempty"` 2636} 2637 2638// OperationProperties extra Operation properties 2639type OperationProperties struct { 2640 // ServiceSpecification - Service specifications of the operation 2641 ServiceSpecification *ServiceSpecification `json:"serviceSpecification,omitempty"` 2642} 2643 2644// PersistentDisk persistent disk payload 2645type PersistentDisk struct { 2646 // SizeInGB - Size of the persistent disk in GB 2647 SizeInGB *int32 `json:"sizeInGB,omitempty"` 2648 // UsedInGB - READ-ONLY; Size of the used persistent disk in GB 2649 UsedInGB *int32 `json:"usedInGB,omitempty"` 2650 // MountPath - Mount path of the persistent disk 2651 MountPath *string `json:"mountPath,omitempty"` 2652} 2653 2654// MarshalJSON is the custom marshaler for PersistentDisk. 2655func (pd PersistentDisk) MarshalJSON() ([]byte, error) { 2656 objectMap := make(map[string]interface{}) 2657 if pd.SizeInGB != nil { 2658 objectMap["sizeInGB"] = pd.SizeInGB 2659 } 2660 if pd.MountPath != nil { 2661 objectMap["mountPath"] = pd.MountPath 2662 } 2663 return json.Marshal(objectMap) 2664} 2665 2666// ProxyResource the resource model definition for a ARM proxy resource. It will have everything other than 2667// required location and tags. 2668type ProxyResource struct { 2669 // ID - READ-ONLY; Fully qualified resource Id for the resource. 2670 ID *string `json:"id,omitempty"` 2671 // Name - READ-ONLY; The name of the resource. 2672 Name *string `json:"name,omitempty"` 2673 // Type - READ-ONLY; The type of the resource. 2674 Type *string `json:"type,omitempty"` 2675} 2676 2677// MarshalJSON is the custom marshaler for ProxyResource. 2678func (pr ProxyResource) MarshalJSON() ([]byte, error) { 2679 objectMap := make(map[string]interface{}) 2680 return json.Marshal(objectMap) 2681} 2682 2683// RegenerateTestKeyRequestPayload regenerate test key request payload 2684type RegenerateTestKeyRequestPayload struct { 2685 // KeyType - Type of the test key. Possible values include: 'Primary', 'Secondary' 2686 KeyType TestKeyType `json:"keyType,omitempty"` 2687} 2688 2689// Resource the core properties of ARM resources. 2690type Resource struct { 2691 // ID - READ-ONLY; Fully qualified resource Id for the resource. 2692 ID *string `json:"id,omitempty"` 2693 // Name - READ-ONLY; The name of the resource. 2694 Name *string `json:"name,omitempty"` 2695 // Type - READ-ONLY; The type of the resource. 2696 Type *string `json:"type,omitempty"` 2697} 2698 2699// MarshalJSON is the custom marshaler for Resource. 2700func (r Resource) MarshalJSON() ([]byte, error) { 2701 objectMap := make(map[string]interface{}) 2702 return json.Marshal(objectMap) 2703} 2704 2705// ResourceSku describes an available Azure Spring Cloud SKU. 2706type ResourceSku struct { 2707 // ResourceType - Gets the type of resource the SKU applies to. 2708 ResourceType *string `json:"resourceType,omitempty"` 2709 // Name - Gets the name of SKU. 2710 Name *string `json:"name,omitempty"` 2711 // Tier - Gets the tier of SKU. 2712 Tier *string `json:"tier,omitempty"` 2713 // Capacity - Gets the capacity of SKU. 2714 Capacity *SkuCapacity `json:"capacity,omitempty"` 2715 // Locations - Gets the set of locations that the SKU is available. 2716 Locations *[]string `json:"locations,omitempty"` 2717 // LocationInfo - Gets a list of locations and availability zones in those locations where the SKU is available. 2718 LocationInfo *[]ResourceSkuLocationInfo `json:"locationInfo,omitempty"` 2719 // Restrictions - Gets the restrictions because of which SKU cannot be used. This is 2720 // empty if there are no restrictions. 2721 Restrictions *[]ResourceSkuRestrictions `json:"restrictions,omitempty"` 2722} 2723 2724// ResourceSkuCapabilities ... 2725type ResourceSkuCapabilities struct { 2726 // Name - Gets an invariant to describe the feature. 2727 Name *string `json:"name,omitempty"` 2728 // Value - Gets an invariant if the feature is measured by quantity. 2729 Value *string `json:"value,omitempty"` 2730} 2731 2732// ResourceSkuCollection object that includes an array of Azure Spring Cloud SKU and a possible link for 2733// next set 2734type ResourceSkuCollection struct { 2735 autorest.Response `json:"-"` 2736 // Value - Collection of resource SKU 2737 Value *[]ResourceSku `json:"value,omitempty"` 2738 // NextLink - URL client should use to fetch the next page (per server side paging). 2739 // It's null for now, added for future use. 2740 NextLink *string `json:"nextLink,omitempty"` 2741} 2742 2743// ResourceSkuCollectionIterator provides access to a complete listing of ResourceSku values. 2744type ResourceSkuCollectionIterator struct { 2745 i int 2746 page ResourceSkuCollectionPage 2747} 2748 2749// NextWithContext advances to the next value. If there was an error making 2750// the request the iterator does not advance and the error is returned. 2751func (iter *ResourceSkuCollectionIterator) NextWithContext(ctx context.Context) (err error) { 2752 if tracing.IsEnabled() { 2753 ctx = tracing.StartSpan(ctx, fqdn+"/ResourceSkuCollectionIterator.NextWithContext") 2754 defer func() { 2755 sc := -1 2756 if iter.Response().Response.Response != nil { 2757 sc = iter.Response().Response.Response.StatusCode 2758 } 2759 tracing.EndSpan(ctx, sc, err) 2760 }() 2761 } 2762 iter.i++ 2763 if iter.i < len(iter.page.Values()) { 2764 return nil 2765 } 2766 err = iter.page.NextWithContext(ctx) 2767 if err != nil { 2768 iter.i-- 2769 return err 2770 } 2771 iter.i = 0 2772 return nil 2773} 2774 2775// Next advances to the next value. If there was an error making 2776// the request the iterator does not advance and the error is returned. 2777// Deprecated: Use NextWithContext() instead. 2778func (iter *ResourceSkuCollectionIterator) Next() error { 2779 return iter.NextWithContext(context.Background()) 2780} 2781 2782// NotDone returns true if the enumeration should be started or is not yet complete. 2783func (iter ResourceSkuCollectionIterator) NotDone() bool { 2784 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 2785} 2786 2787// Response returns the raw server response from the last page request. 2788func (iter ResourceSkuCollectionIterator) Response() ResourceSkuCollection { 2789 return iter.page.Response() 2790} 2791 2792// Value returns the current value or a zero-initialized value if the 2793// iterator has advanced beyond the end of the collection. 2794func (iter ResourceSkuCollectionIterator) Value() ResourceSku { 2795 if !iter.page.NotDone() { 2796 return ResourceSku{} 2797 } 2798 return iter.page.Values()[iter.i] 2799} 2800 2801// Creates a new instance of the ResourceSkuCollectionIterator type. 2802func NewResourceSkuCollectionIterator(page ResourceSkuCollectionPage) ResourceSkuCollectionIterator { 2803 return ResourceSkuCollectionIterator{page: page} 2804} 2805 2806// IsEmpty returns true if the ListResult contains no values. 2807func (rsc ResourceSkuCollection) IsEmpty() bool { 2808 return rsc.Value == nil || len(*rsc.Value) == 0 2809} 2810 2811// hasNextLink returns true if the NextLink is not empty. 2812func (rsc ResourceSkuCollection) hasNextLink() bool { 2813 return rsc.NextLink != nil && len(*rsc.NextLink) != 0 2814} 2815 2816// resourceSkuCollectionPreparer prepares a request to retrieve the next set of results. 2817// It returns nil if no more results exist. 2818func (rsc ResourceSkuCollection) resourceSkuCollectionPreparer(ctx context.Context) (*http.Request, error) { 2819 if !rsc.hasNextLink() { 2820 return nil, nil 2821 } 2822 return autorest.Prepare((&http.Request{}).WithContext(ctx), 2823 autorest.AsJSON(), 2824 autorest.AsGet(), 2825 autorest.WithBaseURL(to.String(rsc.NextLink))) 2826} 2827 2828// ResourceSkuCollectionPage contains a page of ResourceSku values. 2829type ResourceSkuCollectionPage struct { 2830 fn func(context.Context, ResourceSkuCollection) (ResourceSkuCollection, error) 2831 rsc ResourceSkuCollection 2832} 2833 2834// NextWithContext advances to the next page of values. If there was an error making 2835// the request the page does not advance and the error is returned. 2836func (page *ResourceSkuCollectionPage) NextWithContext(ctx context.Context) (err error) { 2837 if tracing.IsEnabled() { 2838 ctx = tracing.StartSpan(ctx, fqdn+"/ResourceSkuCollectionPage.NextWithContext") 2839 defer func() { 2840 sc := -1 2841 if page.Response().Response.Response != nil { 2842 sc = page.Response().Response.Response.StatusCode 2843 } 2844 tracing.EndSpan(ctx, sc, err) 2845 }() 2846 } 2847 for { 2848 next, err := page.fn(ctx, page.rsc) 2849 if err != nil { 2850 return err 2851 } 2852 page.rsc = next 2853 if !next.hasNextLink() || !next.IsEmpty() { 2854 break 2855 } 2856 } 2857 return nil 2858} 2859 2860// Next advances to the next page of values. If there was an error making 2861// the request the page does not advance and the error is returned. 2862// Deprecated: Use NextWithContext() instead. 2863func (page *ResourceSkuCollectionPage) Next() error { 2864 return page.NextWithContext(context.Background()) 2865} 2866 2867// NotDone returns true if the page enumeration should be started or is not yet complete. 2868func (page ResourceSkuCollectionPage) NotDone() bool { 2869 return !page.rsc.IsEmpty() 2870} 2871 2872// Response returns the raw server response from the last page request. 2873func (page ResourceSkuCollectionPage) Response() ResourceSkuCollection { 2874 return page.rsc 2875} 2876 2877// Values returns the slice of values for the current page or nil if there are no values. 2878func (page ResourceSkuCollectionPage) Values() []ResourceSku { 2879 if page.rsc.IsEmpty() { 2880 return nil 2881 } 2882 return *page.rsc.Value 2883} 2884 2885// Creates a new instance of the ResourceSkuCollectionPage type. 2886func NewResourceSkuCollectionPage(cur ResourceSkuCollection, getNextPage func(context.Context, ResourceSkuCollection) (ResourceSkuCollection, error)) ResourceSkuCollectionPage { 2887 return ResourceSkuCollectionPage{ 2888 fn: getNextPage, 2889 rsc: cur, 2890 } 2891} 2892 2893// ResourceSkuLocationInfo locations and availability zones where the SKU is available 2894type ResourceSkuLocationInfo struct { 2895 // Location - Gets location of the SKU 2896 Location *string `json:"location,omitempty"` 2897 // Zones - Gets list of availability zones where the SKU is supported. 2898 Zones *[]string `json:"zones,omitempty"` 2899 // ZoneDetails - Gets details of capabilities available to a SKU in specific zones. 2900 ZoneDetails *[]ResourceSkuZoneDetails `json:"zoneDetails,omitempty"` 2901} 2902 2903// ResourceSkuRestrictionInfo information about the restriction where the SKU cannot be used 2904type ResourceSkuRestrictionInfo struct { 2905 // Locations - Gets locations where the SKU is restricted 2906 Locations *[]string `json:"locations,omitempty"` 2907 // Zones - Gets list of availability zones where the SKU is restricted. 2908 Zones *[]string `json:"zones,omitempty"` 2909} 2910 2911// ResourceSkuRestrictions restrictions where the SKU cannot be used 2912type ResourceSkuRestrictions struct { 2913 // Type - Gets the type of restrictions. Possible values include: 'Location', 'Zone' 2914 Type ResourceSkuRestrictionsType `json:"type,omitempty"` 2915 // Values - Gets the value of restrictions. If the restriction type is set to 2916 // location. This would be different locations where the SKU is restricted. 2917 Values *[]string `json:"values,omitempty"` 2918 // RestrictionInfo - Gets the information about the restriction where the SKU cannot be used. 2919 RestrictionInfo *ResourceSkuRestrictionInfo `json:"restrictionInfo,omitempty"` 2920 // ReasonCode - Gets the reason for restriction. Possible values include: 'QuotaId', 'NotAvailableForSubscription'. Possible values include: 'QuotaID', 'NotAvailableForSubscription' 2921 ReasonCode ResourceSkuRestrictionsReasonCode `json:"reasonCode,omitempty"` 2922} 2923 2924// ResourceSkuZoneDetails details of capabilities available to a SKU in specific zones 2925type ResourceSkuZoneDetails struct { 2926 // Name - Gets the set of zones that the SKU is available in with the 2927 // specified capabilities. 2928 Name *[]string `json:"name,omitempty"` 2929 // Capabilities - Gets a list of capabilities that are available for the SKU in the 2930 // specified list of zones. 2931 Capabilities *[]ResourceSkuCapabilities `json:"capabilities,omitempty"` 2932} 2933 2934// ResourceUploadDefinition resource upload definition payload 2935type ResourceUploadDefinition struct { 2936 autorest.Response `json:"-"` 2937 // RelativePath - Source relative path 2938 RelativePath *string `json:"relativePath,omitempty"` 2939 // UploadURL - Upload URL 2940 UploadURL *string `json:"uploadUrl,omitempty"` 2941} 2942 2943// ServiceResource service resource 2944type ServiceResource struct { 2945 autorest.Response `json:"-"` 2946 // Properties - Properties of the Service resource 2947 Properties *ClusterResourceProperties `json:"properties,omitempty"` 2948 // Sku - Sku of the Service resource 2949 Sku *Sku `json:"sku,omitempty"` 2950 // Location - The GEO location of the resource. 2951 Location *string `json:"location,omitempty"` 2952 // Tags - Tags of the service which is a list of key value pairs that describe the resource. 2953 Tags map[string]*string `json:"tags"` 2954 // ID - READ-ONLY; Fully qualified resource Id for the resource. 2955 ID *string `json:"id,omitempty"` 2956 // Name - READ-ONLY; The name of the resource. 2957 Name *string `json:"name,omitempty"` 2958 // Type - READ-ONLY; The type of the resource. 2959 Type *string `json:"type,omitempty"` 2960} 2961 2962// MarshalJSON is the custom marshaler for ServiceResource. 2963func (sr ServiceResource) MarshalJSON() ([]byte, error) { 2964 objectMap := make(map[string]interface{}) 2965 if sr.Properties != nil { 2966 objectMap["properties"] = sr.Properties 2967 } 2968 if sr.Sku != nil { 2969 objectMap["sku"] = sr.Sku 2970 } 2971 if sr.Location != nil { 2972 objectMap["location"] = sr.Location 2973 } 2974 if sr.Tags != nil { 2975 objectMap["tags"] = sr.Tags 2976 } 2977 return json.Marshal(objectMap) 2978} 2979 2980// ServiceResourceList object that includes an array of Service resources and a possible link for next set 2981type ServiceResourceList struct { 2982 autorest.Response `json:"-"` 2983 // Value - Collection of Service resources 2984 Value *[]ServiceResource `json:"value,omitempty"` 2985 // NextLink - URL client should use to fetch the next page (per server side paging). 2986 // It's null for now, added for future use. 2987 NextLink *string `json:"nextLink,omitempty"` 2988} 2989 2990// ServiceResourceListIterator provides access to a complete listing of ServiceResource values. 2991type ServiceResourceListIterator struct { 2992 i int 2993 page ServiceResourceListPage 2994} 2995 2996// NextWithContext advances to the next value. If there was an error making 2997// the request the iterator does not advance and the error is returned. 2998func (iter *ServiceResourceListIterator) NextWithContext(ctx context.Context) (err error) { 2999 if tracing.IsEnabled() { 3000 ctx = tracing.StartSpan(ctx, fqdn+"/ServiceResourceListIterator.NextWithContext") 3001 defer func() { 3002 sc := -1 3003 if iter.Response().Response.Response != nil { 3004 sc = iter.Response().Response.Response.StatusCode 3005 } 3006 tracing.EndSpan(ctx, sc, err) 3007 }() 3008 } 3009 iter.i++ 3010 if iter.i < len(iter.page.Values()) { 3011 return nil 3012 } 3013 err = iter.page.NextWithContext(ctx) 3014 if err != nil { 3015 iter.i-- 3016 return err 3017 } 3018 iter.i = 0 3019 return nil 3020} 3021 3022// Next advances to the next value. If there was an error making 3023// the request the iterator does not advance and the error is returned. 3024// Deprecated: Use NextWithContext() instead. 3025func (iter *ServiceResourceListIterator) Next() error { 3026 return iter.NextWithContext(context.Background()) 3027} 3028 3029// NotDone returns true if the enumeration should be started or is not yet complete. 3030func (iter ServiceResourceListIterator) NotDone() bool { 3031 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 3032} 3033 3034// Response returns the raw server response from the last page request. 3035func (iter ServiceResourceListIterator) Response() ServiceResourceList { 3036 return iter.page.Response() 3037} 3038 3039// Value returns the current value or a zero-initialized value if the 3040// iterator has advanced beyond the end of the collection. 3041func (iter ServiceResourceListIterator) Value() ServiceResource { 3042 if !iter.page.NotDone() { 3043 return ServiceResource{} 3044 } 3045 return iter.page.Values()[iter.i] 3046} 3047 3048// Creates a new instance of the ServiceResourceListIterator type. 3049func NewServiceResourceListIterator(page ServiceResourceListPage) ServiceResourceListIterator { 3050 return ServiceResourceListIterator{page: page} 3051} 3052 3053// IsEmpty returns true if the ListResult contains no values. 3054func (srl ServiceResourceList) IsEmpty() bool { 3055 return srl.Value == nil || len(*srl.Value) == 0 3056} 3057 3058// hasNextLink returns true if the NextLink is not empty. 3059func (srl ServiceResourceList) hasNextLink() bool { 3060 return srl.NextLink != nil && len(*srl.NextLink) != 0 3061} 3062 3063// serviceResourceListPreparer prepares a request to retrieve the next set of results. 3064// It returns nil if no more results exist. 3065func (srl ServiceResourceList) serviceResourceListPreparer(ctx context.Context) (*http.Request, error) { 3066 if !srl.hasNextLink() { 3067 return nil, nil 3068 } 3069 return autorest.Prepare((&http.Request{}).WithContext(ctx), 3070 autorest.AsJSON(), 3071 autorest.AsGet(), 3072 autorest.WithBaseURL(to.String(srl.NextLink))) 3073} 3074 3075// ServiceResourceListPage contains a page of ServiceResource values. 3076type ServiceResourceListPage struct { 3077 fn func(context.Context, ServiceResourceList) (ServiceResourceList, error) 3078 srl ServiceResourceList 3079} 3080 3081// NextWithContext advances to the next page of values. If there was an error making 3082// the request the page does not advance and the error is returned. 3083func (page *ServiceResourceListPage) NextWithContext(ctx context.Context) (err error) { 3084 if tracing.IsEnabled() { 3085 ctx = tracing.StartSpan(ctx, fqdn+"/ServiceResourceListPage.NextWithContext") 3086 defer func() { 3087 sc := -1 3088 if page.Response().Response.Response != nil { 3089 sc = page.Response().Response.Response.StatusCode 3090 } 3091 tracing.EndSpan(ctx, sc, err) 3092 }() 3093 } 3094 for { 3095 next, err := page.fn(ctx, page.srl) 3096 if err != nil { 3097 return err 3098 } 3099 page.srl = next 3100 if !next.hasNextLink() || !next.IsEmpty() { 3101 break 3102 } 3103 } 3104 return nil 3105} 3106 3107// Next advances to the next page of values. If there was an error making 3108// the request the page does not advance and the error is returned. 3109// Deprecated: Use NextWithContext() instead. 3110func (page *ServiceResourceListPage) Next() error { 3111 return page.NextWithContext(context.Background()) 3112} 3113 3114// NotDone returns true if the page enumeration should be started or is not yet complete. 3115func (page ServiceResourceListPage) NotDone() bool { 3116 return !page.srl.IsEmpty() 3117} 3118 3119// Response returns the raw server response from the last page request. 3120func (page ServiceResourceListPage) Response() ServiceResourceList { 3121 return page.srl 3122} 3123 3124// Values returns the slice of values for the current page or nil if there are no values. 3125func (page ServiceResourceListPage) Values() []ServiceResource { 3126 if page.srl.IsEmpty() { 3127 return nil 3128 } 3129 return *page.srl.Value 3130} 3131 3132// Creates a new instance of the ServiceResourceListPage type. 3133func NewServiceResourceListPage(cur ServiceResourceList, getNextPage func(context.Context, ServiceResourceList) (ServiceResourceList, error)) ServiceResourceListPage { 3134 return ServiceResourceListPage{ 3135 fn: getNextPage, 3136 srl: cur, 3137 } 3138} 3139 3140// ServicesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 3141// operation. 3142type ServicesCreateOrUpdateFuture struct { 3143 azure.FutureAPI 3144 // Result returns the result of the asynchronous operation. 3145 // If the operation has not completed it will return an error. 3146 Result func(ServicesClient) (ServiceResource, error) 3147} 3148 3149// UnmarshalJSON is the custom unmarshaller for CreateFuture. 3150func (future *ServicesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 3151 var azFuture azure.Future 3152 if err := json.Unmarshal(body, &azFuture); err != nil { 3153 return err 3154 } 3155 future.FutureAPI = &azFuture 3156 future.Result = future.result 3157 return nil 3158} 3159 3160// result is the default implementation for ServicesCreateOrUpdateFuture.Result. 3161func (future *ServicesCreateOrUpdateFuture) result(client ServicesClient) (sr ServiceResource, err error) { 3162 var done bool 3163 done, err = future.DoneWithContext(context.Background(), client) 3164 if err != nil { 3165 err = autorest.NewErrorWithError(err, "appplatform.ServicesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 3166 return 3167 } 3168 if !done { 3169 sr.Response.Response = future.Response() 3170 err = azure.NewAsyncOpIncompleteError("appplatform.ServicesCreateOrUpdateFuture") 3171 return 3172 } 3173 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 3174 if sr.Response.Response, err = future.GetResult(sender); err == nil && sr.Response.Response.StatusCode != http.StatusNoContent { 3175 sr, err = client.CreateOrUpdateResponder(sr.Response.Response) 3176 if err != nil { 3177 err = autorest.NewErrorWithError(err, "appplatform.ServicesCreateOrUpdateFuture", "Result", sr.Response.Response, "Failure responding to request") 3178 } 3179 } 3180 return 3181} 3182 3183// ServicesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running 3184// operation. 3185type ServicesDeleteFuture struct { 3186 azure.FutureAPI 3187 // Result returns the result of the asynchronous operation. 3188 // If the operation has not completed it will return an error. 3189 Result func(ServicesClient) (autorest.Response, error) 3190} 3191 3192// UnmarshalJSON is the custom unmarshaller for CreateFuture. 3193func (future *ServicesDeleteFuture) UnmarshalJSON(body []byte) error { 3194 var azFuture azure.Future 3195 if err := json.Unmarshal(body, &azFuture); err != nil { 3196 return err 3197 } 3198 future.FutureAPI = &azFuture 3199 future.Result = future.result 3200 return nil 3201} 3202 3203// result is the default implementation for ServicesDeleteFuture.Result. 3204func (future *ServicesDeleteFuture) result(client ServicesClient) (ar autorest.Response, err error) { 3205 var done bool 3206 done, err = future.DoneWithContext(context.Background(), client) 3207 if err != nil { 3208 err = autorest.NewErrorWithError(err, "appplatform.ServicesDeleteFuture", "Result", future.Response(), "Polling failure") 3209 return 3210 } 3211 if !done { 3212 ar.Response = future.Response() 3213 err = azure.NewAsyncOpIncompleteError("appplatform.ServicesDeleteFuture") 3214 return 3215 } 3216 ar.Response = future.Response() 3217 return 3218} 3219 3220// ServiceSpecification service specification payload 3221type ServiceSpecification struct { 3222 // LogSpecifications - Specifications of the Log for Azure Monitoring 3223 LogSpecifications *[]LogSpecification `json:"logSpecifications,omitempty"` 3224 // MetricSpecifications - Specifications of the Metrics for Azure Monitoring 3225 MetricSpecifications *[]MetricSpecification `json:"metricSpecifications,omitempty"` 3226} 3227 3228// ServicesUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 3229// operation. 3230type ServicesUpdateFuture struct { 3231 azure.FutureAPI 3232 // Result returns the result of the asynchronous operation. 3233 // If the operation has not completed it will return an error. 3234 Result func(ServicesClient) (ServiceResource, error) 3235} 3236 3237// UnmarshalJSON is the custom unmarshaller for CreateFuture. 3238func (future *ServicesUpdateFuture) UnmarshalJSON(body []byte) error { 3239 var azFuture azure.Future 3240 if err := json.Unmarshal(body, &azFuture); err != nil { 3241 return err 3242 } 3243 future.FutureAPI = &azFuture 3244 future.Result = future.result 3245 return nil 3246} 3247 3248// result is the default implementation for ServicesUpdateFuture.Result. 3249func (future *ServicesUpdateFuture) result(client ServicesClient) (sr ServiceResource, err error) { 3250 var done bool 3251 done, err = future.DoneWithContext(context.Background(), client) 3252 if err != nil { 3253 err = autorest.NewErrorWithError(err, "appplatform.ServicesUpdateFuture", "Result", future.Response(), "Polling failure") 3254 return 3255 } 3256 if !done { 3257 sr.Response.Response = future.Response() 3258 err = azure.NewAsyncOpIncompleteError("appplatform.ServicesUpdateFuture") 3259 return 3260 } 3261 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 3262 if sr.Response.Response, err = future.GetResult(sender); err == nil && sr.Response.Response.StatusCode != http.StatusNoContent { 3263 sr, err = client.UpdateResponder(sr.Response.Response) 3264 if err != nil { 3265 err = autorest.NewErrorWithError(err, "appplatform.ServicesUpdateFuture", "Result", sr.Response.Response, "Failure responding to request") 3266 } 3267 } 3268 return 3269} 3270 3271// Sku sku of Azure Spring Cloud 3272type Sku struct { 3273 // Name - Name of the Sku 3274 Name *string `json:"name,omitempty"` 3275 // Tier - Tier of the Sku 3276 Tier *string `json:"tier,omitempty"` 3277 // Capacity - Current capacity of the target resource 3278 Capacity *int32 `json:"capacity,omitempty"` 3279} 3280 3281// SkuCapacity the SKU capacity 3282type SkuCapacity struct { 3283 // Minimum - Gets or sets the minimum. 3284 Minimum *int32 `json:"minimum,omitempty"` 3285 // Maximum - Gets or sets the maximum. 3286 Maximum *int32 `json:"maximum,omitempty"` 3287 // Default - Gets or sets the default. 3288 Default *int32 `json:"default,omitempty"` 3289 // ScaleType - Gets or sets the type of the scale. Possible values include: 'SkuScaleTypeNone', 'SkuScaleTypeManual', 'SkuScaleTypeAutomatic' 3290 ScaleType SkuScaleType `json:"scaleType,omitempty"` 3291} 3292 3293// SupportedRuntimeVersion supported deployment runtime version descriptor. 3294type SupportedRuntimeVersion struct { 3295 // Value - The raw value which could be passed to deployment CRUD operations. Possible values include: 'SupportedRuntimeValueJava8', 'SupportedRuntimeValueJava11', 'SupportedRuntimeValueNetCore31' 3296 Value SupportedRuntimeValue `json:"value,omitempty"` 3297 // Platform - The platform of this runtime version (possible values: "Java" or ".NET"). Possible values include: 'Java', 'NETCore' 3298 Platform SupportedRuntimePlatform `json:"platform,omitempty"` 3299 // Version - The detailed version (major.minor) of the platform. 3300 Version *string `json:"version,omitempty"` 3301} 3302 3303// TemporaryDisk temporary disk payload 3304type TemporaryDisk struct { 3305 // SizeInGB - Size of the temporary disk in GB 3306 SizeInGB *int32 `json:"sizeInGB,omitempty"` 3307 // MountPath - Mount path of the temporary disk 3308 MountPath *string `json:"mountPath,omitempty"` 3309} 3310 3311// TestKeys test keys payload 3312type TestKeys struct { 3313 autorest.Response `json:"-"` 3314 // PrimaryKey - Primary key 3315 PrimaryKey *string `json:"primaryKey,omitempty"` 3316 // SecondaryKey - Secondary key 3317 SecondaryKey *string `json:"secondaryKey,omitempty"` 3318 // PrimaryTestEndpoint - Primary test endpoint 3319 PrimaryTestEndpoint *string `json:"primaryTestEndpoint,omitempty"` 3320 // SecondaryTestEndpoint - Secondary test endpoint 3321 SecondaryTestEndpoint *string `json:"secondaryTestEndpoint,omitempty"` 3322 // Enabled - Indicates whether the test endpoint feature enabled or not 3323 Enabled *bool `json:"enabled,omitempty"` 3324} 3325 3326// TrackedResource the resource model definition for a ARM tracked top level resource. 3327type TrackedResource struct { 3328 // Location - The GEO location of the resource. 3329 Location *string `json:"location,omitempty"` 3330 // Tags - Tags of the service which is a list of key value pairs that describe the resource. 3331 Tags map[string]*string `json:"tags"` 3332 // ID - READ-ONLY; Fully qualified resource Id for the resource. 3333 ID *string `json:"id,omitempty"` 3334 // Name - READ-ONLY; The name of the resource. 3335 Name *string `json:"name,omitempty"` 3336 // Type - READ-ONLY; The type of the resource. 3337 Type *string `json:"type,omitempty"` 3338} 3339 3340// MarshalJSON is the custom marshaler for TrackedResource. 3341func (tr TrackedResource) MarshalJSON() ([]byte, error) { 3342 objectMap := make(map[string]interface{}) 3343 if tr.Location != nil { 3344 objectMap["location"] = tr.Location 3345 } 3346 if tr.Tags != nil { 3347 objectMap["tags"] = tr.Tags 3348 } 3349 return json.Marshal(objectMap) 3350} 3351 3352// UserSourceInfo source information for a deployment 3353type UserSourceInfo struct { 3354 // Type - Type of the source uploaded. Possible values include: 'Jar', 'NetCoreZip', 'Source' 3355 Type UserSourceType `json:"type,omitempty"` 3356 // RelativePath - Relative path of the storage which stores the source 3357 RelativePath *string `json:"relativePath,omitempty"` 3358 // Version - Version of the source 3359 Version *string `json:"version,omitempty"` 3360 // ArtifactSelector - Selector for the artifact to be used for the deployment for multi-module projects. This should be 3361 // the relative path to the target module/project. 3362 ArtifactSelector *string `json:"artifactSelector,omitempty"` 3363} 3364