1package databoxedge 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/databoxedge/mgmt/2020-12-01/databoxedge" 22 23// BasicAddon role Addon 24type BasicAddon interface { 25 AsArcAddon() (*ArcAddon, bool) 26 AsIoTAddon() (*IoTAddon, bool) 27 AsAddon() (*Addon, bool) 28} 29 30// Addon role Addon 31type Addon struct { 32 autorest.Response `json:"-"` 33 // SystemData - Addon type 34 SystemData *SystemData `json:"systemData,omitempty"` 35 // Kind - Possible values include: 'KindAddon', 'KindArcForKubernetes', 'KindIotEdge' 36 Kind Kind `json:"kind,omitempty"` 37 // ID - READ-ONLY; The path ID that uniquely identifies the object. 38 ID *string `json:"id,omitempty"` 39 // Name - READ-ONLY; The object name. 40 Name *string `json:"name,omitempty"` 41 // Type - READ-ONLY; The hierarchical type of the object. 42 Type *string `json:"type,omitempty"` 43} 44 45func unmarshalBasicAddon(body []byte) (BasicAddon, error) { 46 var m map[string]interface{} 47 err := json.Unmarshal(body, &m) 48 if err != nil { 49 return nil, err 50 } 51 52 switch m["kind"] { 53 case string(KindArcForKubernetes): 54 var aa ArcAddon 55 err := json.Unmarshal(body, &aa) 56 return aa, err 57 case string(KindIotEdge): 58 var ita IoTAddon 59 err := json.Unmarshal(body, &ita) 60 return ita, err 61 default: 62 var a Addon 63 err := json.Unmarshal(body, &a) 64 return a, err 65 } 66} 67func unmarshalBasicAddonArray(body []byte) ([]BasicAddon, error) { 68 var rawMessages []*json.RawMessage 69 err := json.Unmarshal(body, &rawMessages) 70 if err != nil { 71 return nil, err 72 } 73 74 aArray := make([]BasicAddon, len(rawMessages)) 75 76 for index, rawMessage := range rawMessages { 77 a, err := unmarshalBasicAddon(*rawMessage) 78 if err != nil { 79 return nil, err 80 } 81 aArray[index] = a 82 } 83 return aArray, nil 84} 85 86// MarshalJSON is the custom marshaler for Addon. 87func (a Addon) MarshalJSON() ([]byte, error) { 88 a.Kind = KindAddon 89 objectMap := make(map[string]interface{}) 90 if a.SystemData != nil { 91 objectMap["systemData"] = a.SystemData 92 } 93 if a.Kind != "" { 94 objectMap["kind"] = a.Kind 95 } 96 return json.Marshal(objectMap) 97} 98 99// AsArcAddon is the BasicAddon implementation for Addon. 100func (a Addon) AsArcAddon() (*ArcAddon, bool) { 101 return nil, false 102} 103 104// AsIoTAddon is the BasicAddon implementation for Addon. 105func (a Addon) AsIoTAddon() (*IoTAddon, bool) { 106 return nil, false 107} 108 109// AsAddon is the BasicAddon implementation for Addon. 110func (a Addon) AsAddon() (*Addon, bool) { 111 return &a, true 112} 113 114// AsBasicAddon is the BasicAddon implementation for Addon. 115func (a Addon) AsBasicAddon() (BasicAddon, bool) { 116 return &a, true 117} 118 119// AddonList collection of all the Role addon on the Azure Stack Edge device. 120type AddonList struct { 121 autorest.Response `json:"-"` 122 // Value - READ-ONLY; The Value. 123 Value *[]BasicAddon `json:"value,omitempty"` 124 // NextLink - READ-ONLY; Link to the next set of results. 125 NextLink *string `json:"nextLink,omitempty"` 126} 127 128// MarshalJSON is the custom marshaler for AddonList. 129func (al AddonList) MarshalJSON() ([]byte, error) { 130 objectMap := make(map[string]interface{}) 131 return json.Marshal(objectMap) 132} 133 134// UnmarshalJSON is the custom unmarshaler for AddonList struct. 135func (al *AddonList) UnmarshalJSON(body []byte) error { 136 var m map[string]*json.RawMessage 137 err := json.Unmarshal(body, &m) 138 if err != nil { 139 return err 140 } 141 for k, v := range m { 142 switch k { 143 case "value": 144 if v != nil { 145 value, err := unmarshalBasicAddonArray(*v) 146 if err != nil { 147 return err 148 } 149 al.Value = &value 150 } 151 case "nextLink": 152 if v != nil { 153 var nextLink string 154 err = json.Unmarshal(*v, &nextLink) 155 if err != nil { 156 return err 157 } 158 al.NextLink = &nextLink 159 } 160 } 161 } 162 163 return nil 164} 165 166// AddonListIterator provides access to a complete listing of Addon values. 167type AddonListIterator struct { 168 i int 169 page AddonListPage 170} 171 172// NextWithContext advances to the next value. If there was an error making 173// the request the iterator does not advance and the error is returned. 174func (iter *AddonListIterator) NextWithContext(ctx context.Context) (err error) { 175 if tracing.IsEnabled() { 176 ctx = tracing.StartSpan(ctx, fqdn+"/AddonListIterator.NextWithContext") 177 defer func() { 178 sc := -1 179 if iter.Response().Response.Response != nil { 180 sc = iter.Response().Response.Response.StatusCode 181 } 182 tracing.EndSpan(ctx, sc, err) 183 }() 184 } 185 iter.i++ 186 if iter.i < len(iter.page.Values()) { 187 return nil 188 } 189 err = iter.page.NextWithContext(ctx) 190 if err != nil { 191 iter.i-- 192 return err 193 } 194 iter.i = 0 195 return nil 196} 197 198// Next advances to the next value. If there was an error making 199// the request the iterator does not advance and the error is returned. 200// Deprecated: Use NextWithContext() instead. 201func (iter *AddonListIterator) Next() error { 202 return iter.NextWithContext(context.Background()) 203} 204 205// NotDone returns true if the enumeration should be started or is not yet complete. 206func (iter AddonListIterator) NotDone() bool { 207 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 208} 209 210// Response returns the raw server response from the last page request. 211func (iter AddonListIterator) Response() AddonList { 212 return iter.page.Response() 213} 214 215// Value returns the current value or a zero-initialized value if the 216// iterator has advanced beyond the end of the collection. 217func (iter AddonListIterator) Value() BasicAddon { 218 if !iter.page.NotDone() { 219 return Addon{} 220 } 221 return iter.page.Values()[iter.i] 222} 223 224// Creates a new instance of the AddonListIterator type. 225func NewAddonListIterator(page AddonListPage) AddonListIterator { 226 return AddonListIterator{page: page} 227} 228 229// IsEmpty returns true if the ListResult contains no values. 230func (al AddonList) IsEmpty() bool { 231 return al.Value == nil || len(*al.Value) == 0 232} 233 234// hasNextLink returns true if the NextLink is not empty. 235func (al AddonList) hasNextLink() bool { 236 return al.NextLink != nil && len(*al.NextLink) != 0 237} 238 239// addonListPreparer prepares a request to retrieve the next set of results. 240// It returns nil if no more results exist. 241func (al AddonList) addonListPreparer(ctx context.Context) (*http.Request, error) { 242 if !al.hasNextLink() { 243 return nil, nil 244 } 245 return autorest.Prepare((&http.Request{}).WithContext(ctx), 246 autorest.AsJSON(), 247 autorest.AsGet(), 248 autorest.WithBaseURL(to.String(al.NextLink))) 249} 250 251// AddonListPage contains a page of BasicAddon values. 252type AddonListPage struct { 253 fn func(context.Context, AddonList) (AddonList, error) 254 al AddonList 255} 256 257// NextWithContext advances to the next page of values. If there was an error making 258// the request the page does not advance and the error is returned. 259func (page *AddonListPage) NextWithContext(ctx context.Context) (err error) { 260 if tracing.IsEnabled() { 261 ctx = tracing.StartSpan(ctx, fqdn+"/AddonListPage.NextWithContext") 262 defer func() { 263 sc := -1 264 if page.Response().Response.Response != nil { 265 sc = page.Response().Response.Response.StatusCode 266 } 267 tracing.EndSpan(ctx, sc, err) 268 }() 269 } 270 for { 271 next, err := page.fn(ctx, page.al) 272 if err != nil { 273 return err 274 } 275 page.al = next 276 if !next.hasNextLink() || !next.IsEmpty() { 277 break 278 } 279 } 280 return nil 281} 282 283// Next advances to the next page of values. If there was an error making 284// the request the page does not advance and the error is returned. 285// Deprecated: Use NextWithContext() instead. 286func (page *AddonListPage) Next() error { 287 return page.NextWithContext(context.Background()) 288} 289 290// NotDone returns true if the page enumeration should be started or is not yet complete. 291func (page AddonListPage) NotDone() bool { 292 return !page.al.IsEmpty() 293} 294 295// Response returns the raw server response from the last page request. 296func (page AddonListPage) Response() AddonList { 297 return page.al 298} 299 300// Values returns the slice of values for the current page or nil if there are no values. 301func (page AddonListPage) Values() []BasicAddon { 302 if page.al.IsEmpty() { 303 return nil 304 } 305 return *page.al.Value 306} 307 308// Creates a new instance of the AddonListPage type. 309func NewAddonListPage(cur AddonList, getNextPage func(context.Context, AddonList) (AddonList, error)) AddonListPage { 310 return AddonListPage{ 311 fn: getNextPage, 312 al: cur, 313 } 314} 315 316// AddonModel ... 317type AddonModel struct { 318 autorest.Response `json:"-"` 319 Value BasicAddon `json:"value,omitempty"` 320} 321 322// UnmarshalJSON is the custom unmarshaler for AddonModel struct. 323func (am *AddonModel) UnmarshalJSON(body []byte) error { 324 a, err := unmarshalBasicAddon(body) 325 if err != nil { 326 return err 327 } 328 am.Value = a 329 330 return nil 331} 332 333// AddonsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 334// operation. 335type AddonsCreateOrUpdateFuture struct { 336 azure.FutureAPI 337 // Result returns the result of the asynchronous operation. 338 // If the operation has not completed it will return an error. 339 Result func(AddonsClient) (AddonModel, error) 340} 341 342// UnmarshalJSON is the custom unmarshaller for CreateFuture. 343func (future *AddonsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 344 var azFuture azure.Future 345 if err := json.Unmarshal(body, &azFuture); err != nil { 346 return err 347 } 348 future.FutureAPI = &azFuture 349 future.Result = future.result 350 return nil 351} 352 353// result is the default implementation for AddonsCreateOrUpdateFuture.Result. 354func (future *AddonsCreateOrUpdateFuture) result(client AddonsClient) (am AddonModel, err error) { 355 var done bool 356 done, err = future.DoneWithContext(context.Background(), client) 357 if err != nil { 358 err = autorest.NewErrorWithError(err, "databoxedge.AddonsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 359 return 360 } 361 if !done { 362 am.Response.Response = future.Response() 363 err = azure.NewAsyncOpIncompleteError("databoxedge.AddonsCreateOrUpdateFuture") 364 return 365 } 366 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 367 if am.Response.Response, err = future.GetResult(sender); err == nil && am.Response.Response.StatusCode != http.StatusNoContent { 368 am, err = client.CreateOrUpdateResponder(am.Response.Response) 369 if err != nil { 370 err = autorest.NewErrorWithError(err, "databoxedge.AddonsCreateOrUpdateFuture", "Result", am.Response.Response, "Failure responding to request") 371 } 372 } 373 return 374} 375 376// AddonsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running operation. 377type AddonsDeleteFuture struct { 378 azure.FutureAPI 379 // Result returns the result of the asynchronous operation. 380 // If the operation has not completed it will return an error. 381 Result func(AddonsClient) (autorest.Response, error) 382} 383 384// UnmarshalJSON is the custom unmarshaller for CreateFuture. 385func (future *AddonsDeleteFuture) UnmarshalJSON(body []byte) error { 386 var azFuture azure.Future 387 if err := json.Unmarshal(body, &azFuture); err != nil { 388 return err 389 } 390 future.FutureAPI = &azFuture 391 future.Result = future.result 392 return nil 393} 394 395// result is the default implementation for AddonsDeleteFuture.Result. 396func (future *AddonsDeleteFuture) result(client AddonsClient) (ar autorest.Response, err error) { 397 var done bool 398 done, err = future.DoneWithContext(context.Background(), client) 399 if err != nil { 400 err = autorest.NewErrorWithError(err, "databoxedge.AddonsDeleteFuture", "Result", future.Response(), "Polling failure") 401 return 402 } 403 if !done { 404 ar.Response = future.Response() 405 err = azure.NewAsyncOpIncompleteError("databoxedge.AddonsDeleteFuture") 406 return 407 } 408 ar.Response = future.Response() 409 return 410} 411 412// Address the shipping address of the customer. 413type Address struct { 414 // AddressLine1 - The address line1. 415 AddressLine1 *string `json:"addressLine1,omitempty"` 416 // AddressLine2 - The address line2. 417 AddressLine2 *string `json:"addressLine2,omitempty"` 418 // AddressLine3 - The address line3. 419 AddressLine3 *string `json:"addressLine3,omitempty"` 420 // PostalCode - The postal code. 421 PostalCode *string `json:"postalCode,omitempty"` 422 // City - The city name. 423 City *string `json:"city,omitempty"` 424 // State - The state name. 425 State *string `json:"state,omitempty"` 426 // Country - The country name. 427 Country *string `json:"country,omitempty"` 428} 429 430// Alert alert on the data box edge/gateway device. 431type Alert struct { 432 autorest.Response `json:"-"` 433 // SystemData - Alert generated in the resource 434 SystemData *SystemData `json:"systemData,omitempty"` 435 // AlertProperties - READ-ONLY; Properties of alert. 436 *AlertProperties `json:"properties,omitempty"` 437 // ID - READ-ONLY; The path ID that uniquely identifies the object. 438 ID *string `json:"id,omitempty"` 439 // Name - READ-ONLY; The object name. 440 Name *string `json:"name,omitempty"` 441 // Type - READ-ONLY; The hierarchical type of the object. 442 Type *string `json:"type,omitempty"` 443} 444 445// MarshalJSON is the custom marshaler for Alert. 446func (a Alert) MarshalJSON() ([]byte, error) { 447 objectMap := make(map[string]interface{}) 448 if a.SystemData != nil { 449 objectMap["systemData"] = a.SystemData 450 } 451 return json.Marshal(objectMap) 452} 453 454// UnmarshalJSON is the custom unmarshaler for Alert struct. 455func (a *Alert) UnmarshalJSON(body []byte) error { 456 var m map[string]*json.RawMessage 457 err := json.Unmarshal(body, &m) 458 if err != nil { 459 return err 460 } 461 for k, v := range m { 462 switch k { 463 case "systemData": 464 if v != nil { 465 var systemData SystemData 466 err = json.Unmarshal(*v, &systemData) 467 if err != nil { 468 return err 469 } 470 a.SystemData = &systemData 471 } 472 case "properties": 473 if v != nil { 474 var alertProperties AlertProperties 475 err = json.Unmarshal(*v, &alertProperties) 476 if err != nil { 477 return err 478 } 479 a.AlertProperties = &alertProperties 480 } 481 case "id": 482 if v != nil { 483 var ID string 484 err = json.Unmarshal(*v, &ID) 485 if err != nil { 486 return err 487 } 488 a.ID = &ID 489 } 490 case "name": 491 if v != nil { 492 var name string 493 err = json.Unmarshal(*v, &name) 494 if err != nil { 495 return err 496 } 497 a.Name = &name 498 } 499 case "type": 500 if v != nil { 501 var typeVar string 502 err = json.Unmarshal(*v, &typeVar) 503 if err != nil { 504 return err 505 } 506 a.Type = &typeVar 507 } 508 } 509 } 510 511 return nil 512} 513 514// AlertErrorDetails error details for the alert. 515type AlertErrorDetails struct { 516 // ErrorCode - READ-ONLY; Error code. 517 ErrorCode *string `json:"errorCode,omitempty"` 518 // ErrorMessage - READ-ONLY; Error Message. 519 ErrorMessage *string `json:"errorMessage,omitempty"` 520 // Occurrences - READ-ONLY; Number of occurrences. 521 Occurrences *int32 `json:"occurrences,omitempty"` 522} 523 524// MarshalJSON is the custom marshaler for AlertErrorDetails. 525func (aed AlertErrorDetails) MarshalJSON() ([]byte, error) { 526 objectMap := make(map[string]interface{}) 527 return json.Marshal(objectMap) 528} 529 530// AlertList collection of alerts. 531type AlertList struct { 532 autorest.Response `json:"-"` 533 // Value - READ-ONLY; The value. 534 Value *[]Alert `json:"value,omitempty"` 535 // NextLink - READ-ONLY; Link to the next set of results. 536 NextLink *string `json:"nextLink,omitempty"` 537} 538 539// MarshalJSON is the custom marshaler for AlertList. 540func (al AlertList) MarshalJSON() ([]byte, error) { 541 objectMap := make(map[string]interface{}) 542 return json.Marshal(objectMap) 543} 544 545// AlertListIterator provides access to a complete listing of Alert values. 546type AlertListIterator struct { 547 i int 548 page AlertListPage 549} 550 551// NextWithContext advances to the next value. If there was an error making 552// the request the iterator does not advance and the error is returned. 553func (iter *AlertListIterator) NextWithContext(ctx context.Context) (err error) { 554 if tracing.IsEnabled() { 555 ctx = tracing.StartSpan(ctx, fqdn+"/AlertListIterator.NextWithContext") 556 defer func() { 557 sc := -1 558 if iter.Response().Response.Response != nil { 559 sc = iter.Response().Response.Response.StatusCode 560 } 561 tracing.EndSpan(ctx, sc, err) 562 }() 563 } 564 iter.i++ 565 if iter.i < len(iter.page.Values()) { 566 return nil 567 } 568 err = iter.page.NextWithContext(ctx) 569 if err != nil { 570 iter.i-- 571 return err 572 } 573 iter.i = 0 574 return nil 575} 576 577// Next advances to the next value. If there was an error making 578// the request the iterator does not advance and the error is returned. 579// Deprecated: Use NextWithContext() instead. 580func (iter *AlertListIterator) Next() error { 581 return iter.NextWithContext(context.Background()) 582} 583 584// NotDone returns true if the enumeration should be started or is not yet complete. 585func (iter AlertListIterator) NotDone() bool { 586 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 587} 588 589// Response returns the raw server response from the last page request. 590func (iter AlertListIterator) Response() AlertList { 591 return iter.page.Response() 592} 593 594// Value returns the current value or a zero-initialized value if the 595// iterator has advanced beyond the end of the collection. 596func (iter AlertListIterator) Value() Alert { 597 if !iter.page.NotDone() { 598 return Alert{} 599 } 600 return iter.page.Values()[iter.i] 601} 602 603// Creates a new instance of the AlertListIterator type. 604func NewAlertListIterator(page AlertListPage) AlertListIterator { 605 return AlertListIterator{page: page} 606} 607 608// IsEmpty returns true if the ListResult contains no values. 609func (al AlertList) IsEmpty() bool { 610 return al.Value == nil || len(*al.Value) == 0 611} 612 613// hasNextLink returns true if the NextLink is not empty. 614func (al AlertList) hasNextLink() bool { 615 return al.NextLink != nil && len(*al.NextLink) != 0 616} 617 618// alertListPreparer prepares a request to retrieve the next set of results. 619// It returns nil if no more results exist. 620func (al AlertList) alertListPreparer(ctx context.Context) (*http.Request, error) { 621 if !al.hasNextLink() { 622 return nil, nil 623 } 624 return autorest.Prepare((&http.Request{}).WithContext(ctx), 625 autorest.AsJSON(), 626 autorest.AsGet(), 627 autorest.WithBaseURL(to.String(al.NextLink))) 628} 629 630// AlertListPage contains a page of Alert values. 631type AlertListPage struct { 632 fn func(context.Context, AlertList) (AlertList, error) 633 al AlertList 634} 635 636// NextWithContext advances to the next page of values. If there was an error making 637// the request the page does not advance and the error is returned. 638func (page *AlertListPage) NextWithContext(ctx context.Context) (err error) { 639 if tracing.IsEnabled() { 640 ctx = tracing.StartSpan(ctx, fqdn+"/AlertListPage.NextWithContext") 641 defer func() { 642 sc := -1 643 if page.Response().Response.Response != nil { 644 sc = page.Response().Response.Response.StatusCode 645 } 646 tracing.EndSpan(ctx, sc, err) 647 }() 648 } 649 for { 650 next, err := page.fn(ctx, page.al) 651 if err != nil { 652 return err 653 } 654 page.al = next 655 if !next.hasNextLink() || !next.IsEmpty() { 656 break 657 } 658 } 659 return nil 660} 661 662// Next advances to the next page of values. If there was an error making 663// the request the page does not advance and the error is returned. 664// Deprecated: Use NextWithContext() instead. 665func (page *AlertListPage) Next() error { 666 return page.NextWithContext(context.Background()) 667} 668 669// NotDone returns true if the page enumeration should be started or is not yet complete. 670func (page AlertListPage) NotDone() bool { 671 return !page.al.IsEmpty() 672} 673 674// Response returns the raw server response from the last page request. 675func (page AlertListPage) Response() AlertList { 676 return page.al 677} 678 679// Values returns the slice of values for the current page or nil if there are no values. 680func (page AlertListPage) Values() []Alert { 681 if page.al.IsEmpty() { 682 return nil 683 } 684 return *page.al.Value 685} 686 687// Creates a new instance of the AlertListPage type. 688func NewAlertListPage(cur AlertList, getNextPage func(context.Context, AlertList) (AlertList, error)) AlertListPage { 689 return AlertListPage{ 690 fn: getNextPage, 691 al: cur, 692 } 693} 694 695// AlertProperties properties of alert. 696type AlertProperties struct { 697 // Title - READ-ONLY; Alert title. 698 Title *string `json:"title,omitempty"` 699 // AlertType - READ-ONLY; Alert type. 700 AlertType *string `json:"alertType,omitempty"` 701 // AppearedAtDateTime - READ-ONLY; UTC time when the alert appeared. 702 AppearedAtDateTime *date.Time `json:"appearedAtDateTime,omitempty"` 703 // Recommendation - READ-ONLY; Alert recommendation. 704 Recommendation *string `json:"recommendation,omitempty"` 705 // Severity - READ-ONLY; Severity of the alert. Possible values include: 'Informational', 'Warning', 'Critical' 706 Severity AlertSeverity `json:"severity,omitempty"` 707 // ErrorDetails - READ-ONLY; Error details of the alert. 708 ErrorDetails *AlertErrorDetails `json:"errorDetails,omitempty"` 709 // DetailedInformation - READ-ONLY; Alert details. 710 DetailedInformation map[string]*string `json:"detailedInformation"` 711} 712 713// MarshalJSON is the custom marshaler for AlertProperties. 714func (ap AlertProperties) MarshalJSON() ([]byte, error) { 715 objectMap := make(map[string]interface{}) 716 return json.Marshal(objectMap) 717} 718 719// ArcAddon arc Addon. 720type ArcAddon struct { 721 // ArcAddonProperties - Properties specific to Arc addon. 722 *ArcAddonProperties `json:"properties,omitempty"` 723 // SystemData - Addon type 724 SystemData *SystemData `json:"systemData,omitempty"` 725 // Kind - Possible values include: 'KindAddon', 'KindArcForKubernetes', 'KindIotEdge' 726 Kind Kind `json:"kind,omitempty"` 727 // ID - READ-ONLY; The path ID that uniquely identifies the object. 728 ID *string `json:"id,omitempty"` 729 // Name - READ-ONLY; The object name. 730 Name *string `json:"name,omitempty"` 731 // Type - READ-ONLY; The hierarchical type of the object. 732 Type *string `json:"type,omitempty"` 733} 734 735// MarshalJSON is the custom marshaler for ArcAddon. 736func (aa ArcAddon) MarshalJSON() ([]byte, error) { 737 aa.Kind = KindArcForKubernetes 738 objectMap := make(map[string]interface{}) 739 if aa.ArcAddonProperties != nil { 740 objectMap["properties"] = aa.ArcAddonProperties 741 } 742 if aa.SystemData != nil { 743 objectMap["systemData"] = aa.SystemData 744 } 745 if aa.Kind != "" { 746 objectMap["kind"] = aa.Kind 747 } 748 return json.Marshal(objectMap) 749} 750 751// AsArcAddon is the BasicAddon implementation for ArcAddon. 752func (aa ArcAddon) AsArcAddon() (*ArcAddon, bool) { 753 return &aa, true 754} 755 756// AsIoTAddon is the BasicAddon implementation for ArcAddon. 757func (aa ArcAddon) AsIoTAddon() (*IoTAddon, bool) { 758 return nil, false 759} 760 761// AsAddon is the BasicAddon implementation for ArcAddon. 762func (aa ArcAddon) AsAddon() (*Addon, bool) { 763 return nil, false 764} 765 766// AsBasicAddon is the BasicAddon implementation for ArcAddon. 767func (aa ArcAddon) AsBasicAddon() (BasicAddon, bool) { 768 return &aa, true 769} 770 771// UnmarshalJSON is the custom unmarshaler for ArcAddon struct. 772func (aa *ArcAddon) UnmarshalJSON(body []byte) error { 773 var m map[string]*json.RawMessage 774 err := json.Unmarshal(body, &m) 775 if err != nil { 776 return err 777 } 778 for k, v := range m { 779 switch k { 780 case "properties": 781 if v != nil { 782 var arcAddonProperties ArcAddonProperties 783 err = json.Unmarshal(*v, &arcAddonProperties) 784 if err != nil { 785 return err 786 } 787 aa.ArcAddonProperties = &arcAddonProperties 788 } 789 case "systemData": 790 if v != nil { 791 var systemData SystemData 792 err = json.Unmarshal(*v, &systemData) 793 if err != nil { 794 return err 795 } 796 aa.SystemData = &systemData 797 } 798 case "kind": 799 if v != nil { 800 var kind Kind 801 err = json.Unmarshal(*v, &kind) 802 if err != nil { 803 return err 804 } 805 aa.Kind = kind 806 } 807 case "id": 808 if v != nil { 809 var ID string 810 err = json.Unmarshal(*v, &ID) 811 if err != nil { 812 return err 813 } 814 aa.ID = &ID 815 } 816 case "name": 817 if v != nil { 818 var name string 819 err = json.Unmarshal(*v, &name) 820 if err != nil { 821 return err 822 } 823 aa.Name = &name 824 } 825 case "type": 826 if v != nil { 827 var typeVar string 828 err = json.Unmarshal(*v, &typeVar) 829 if err != nil { 830 return err 831 } 832 aa.Type = &typeVar 833 } 834 } 835 } 836 837 return nil 838} 839 840// ArcAddonProperties arc addon properties. 841type ArcAddonProperties struct { 842 // SubscriptionID - Arc resource subscription Id 843 SubscriptionID *string `json:"subscriptionId,omitempty"` 844 // ResourceGroupName - Arc resource group name 845 ResourceGroupName *string `json:"resourceGroupName,omitempty"` 846 // ResourceName - Arc resource Name 847 ResourceName *string `json:"resourceName,omitempty"` 848 // ResourceLocation - Arc resource location 849 ResourceLocation *string `json:"resourceLocation,omitempty"` 850 // Version - READ-ONLY; Arc resource version 851 Version *string `json:"version,omitempty"` 852 // HostPlatform - READ-ONLY; Host OS supported by the Arc addon. Possible values include: 'Windows', 'Linux' 853 HostPlatform PlatformType `json:"hostPlatform,omitempty"` 854 // HostPlatformType - READ-ONLY; Platform where the runtime is hosted. Possible values include: 'KubernetesCluster', 'LinuxVM' 855 HostPlatformType HostPlatformType `json:"hostPlatformType,omitempty"` 856 // ProvisioningState - READ-ONLY; Addon Provisioning State. Possible values include: 'Invalid', 'Creating', 'Created', 'Updating', 'Reconfiguring', 'Failed', 'Deleting' 857 ProvisioningState AddonState `json:"provisioningState,omitempty"` 858} 859 860// MarshalJSON is the custom marshaler for ArcAddonProperties. 861func (aap ArcAddonProperties) MarshalJSON() ([]byte, error) { 862 objectMap := make(map[string]interface{}) 863 if aap.SubscriptionID != nil { 864 objectMap["subscriptionId"] = aap.SubscriptionID 865 } 866 if aap.ResourceGroupName != nil { 867 objectMap["resourceGroupName"] = aap.ResourceGroupName 868 } 869 if aap.ResourceName != nil { 870 objectMap["resourceName"] = aap.ResourceName 871 } 872 if aap.ResourceLocation != nil { 873 objectMap["resourceLocation"] = aap.ResourceLocation 874 } 875 return json.Marshal(objectMap) 876} 877 878// ARMBaseModel represents the base class for all object models. 879type ARMBaseModel struct { 880 // ID - READ-ONLY; The path ID that uniquely identifies the object. 881 ID *string `json:"id,omitempty"` 882 // Name - READ-ONLY; The object name. 883 Name *string `json:"name,omitempty"` 884 // Type - READ-ONLY; The hierarchical type of the object. 885 Type *string `json:"type,omitempty"` 886} 887 888// MarshalJSON is the custom marshaler for ARMBaseModel. 889func (abm ARMBaseModel) MarshalJSON() ([]byte, error) { 890 objectMap := make(map[string]interface{}) 891 return json.Marshal(objectMap) 892} 893 894// AsymmetricEncryptedSecret represent the secrets intended for encryption with asymmetric key pair. 895type AsymmetricEncryptedSecret struct { 896 // Value - The value of the secret. 897 Value *string `json:"value,omitempty"` 898 // EncryptionCertThumbprint - Thumbprint certificate used to encrypt \"Value\". If the value is unencrypted, it will be null. 899 EncryptionCertThumbprint *string `json:"encryptionCertThumbprint,omitempty"` 900 // EncryptionAlgorithm - The algorithm used to encrypt "Value". Possible values include: 'None', 'AES256', 'RSAESPKCS1V15' 901 EncryptionAlgorithm EncryptionAlgorithm `json:"encryptionAlgorithm,omitempty"` 902} 903 904// Authentication authentication mechanism for IoT devices. 905type Authentication struct { 906 // SymmetricKey - Symmetric key for authentication. 907 SymmetricKey *SymmetricKey `json:"symmetricKey,omitempty"` 908} 909 910// AzureContainerInfo azure container mapping of the endpoint. 911type AzureContainerInfo struct { 912 // StorageAccountCredentialID - ID of the storage account credential used to access storage. 913 StorageAccountCredentialID *string `json:"storageAccountCredentialId,omitempty"` 914 // ContainerName - Container name (Based on the data format specified, this represents the name of Azure Files/Page blob/Block blob). 915 ContainerName *string `json:"containerName,omitempty"` 916 // DataFormat - Storage format used for the file represented by the share. Possible values include: 'BlockBlob', 'PageBlob', 'AzureFile' 917 DataFormat AzureContainerDataFormat `json:"dataFormat,omitempty"` 918} 919 920// BandwidthSchedule the bandwidth schedule details. 921type BandwidthSchedule struct { 922 autorest.Response `json:"-"` 923 // SystemData - Bandwidth object related to ASE resource 924 SystemData *SystemData `json:"systemData,omitempty"` 925 // BandwidthScheduleProperties - The properties of the bandwidth schedule. 926 *BandwidthScheduleProperties `json:"properties,omitempty"` 927 // ID - READ-ONLY; The path ID that uniquely identifies the object. 928 ID *string `json:"id,omitempty"` 929 // Name - READ-ONLY; The object name. 930 Name *string `json:"name,omitempty"` 931 // Type - READ-ONLY; The hierarchical type of the object. 932 Type *string `json:"type,omitempty"` 933} 934 935// MarshalJSON is the custom marshaler for BandwidthSchedule. 936func (bs BandwidthSchedule) MarshalJSON() ([]byte, error) { 937 objectMap := make(map[string]interface{}) 938 if bs.SystemData != nil { 939 objectMap["systemData"] = bs.SystemData 940 } 941 if bs.BandwidthScheduleProperties != nil { 942 objectMap["properties"] = bs.BandwidthScheduleProperties 943 } 944 return json.Marshal(objectMap) 945} 946 947// UnmarshalJSON is the custom unmarshaler for BandwidthSchedule struct. 948func (bs *BandwidthSchedule) UnmarshalJSON(body []byte) error { 949 var m map[string]*json.RawMessage 950 err := json.Unmarshal(body, &m) 951 if err != nil { 952 return err 953 } 954 for k, v := range m { 955 switch k { 956 case "systemData": 957 if v != nil { 958 var systemData SystemData 959 err = json.Unmarshal(*v, &systemData) 960 if err != nil { 961 return err 962 } 963 bs.SystemData = &systemData 964 } 965 case "properties": 966 if v != nil { 967 var bandwidthScheduleProperties BandwidthScheduleProperties 968 err = json.Unmarshal(*v, &bandwidthScheduleProperties) 969 if err != nil { 970 return err 971 } 972 bs.BandwidthScheduleProperties = &bandwidthScheduleProperties 973 } 974 case "id": 975 if v != nil { 976 var ID string 977 err = json.Unmarshal(*v, &ID) 978 if err != nil { 979 return err 980 } 981 bs.ID = &ID 982 } 983 case "name": 984 if v != nil { 985 var name string 986 err = json.Unmarshal(*v, &name) 987 if err != nil { 988 return err 989 } 990 bs.Name = &name 991 } 992 case "type": 993 if v != nil { 994 var typeVar string 995 err = json.Unmarshal(*v, &typeVar) 996 if err != nil { 997 return err 998 } 999 bs.Type = &typeVar 1000 } 1001 } 1002 } 1003 1004 return nil 1005} 1006 1007// BandwidthScheduleProperties the properties of the bandwidth schedule. 1008type BandwidthScheduleProperties struct { 1009 // Start - The start time of the schedule in UTC. 1010 Start *string `json:"start,omitempty"` 1011 // Stop - The stop time of the schedule in UTC. 1012 Stop *string `json:"stop,omitempty"` 1013 // RateInMbps - The bandwidth rate in Mbps. 1014 RateInMbps *int32 `json:"rateInMbps,omitempty"` 1015 // Days - The days of the week when this schedule is applicable. 1016 Days *[]DayOfWeek `json:"days,omitempty"` 1017} 1018 1019// BandwidthSchedulesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a 1020// long-running operation. 1021type BandwidthSchedulesCreateOrUpdateFuture struct { 1022 azure.FutureAPI 1023 // Result returns the result of the asynchronous operation. 1024 // If the operation has not completed it will return an error. 1025 Result func(BandwidthSchedulesClient) (BandwidthSchedule, error) 1026} 1027 1028// UnmarshalJSON is the custom unmarshaller for CreateFuture. 1029func (future *BandwidthSchedulesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 1030 var azFuture azure.Future 1031 if err := json.Unmarshal(body, &azFuture); err != nil { 1032 return err 1033 } 1034 future.FutureAPI = &azFuture 1035 future.Result = future.result 1036 return nil 1037} 1038 1039// result is the default implementation for BandwidthSchedulesCreateOrUpdateFuture.Result. 1040func (future *BandwidthSchedulesCreateOrUpdateFuture) result(client BandwidthSchedulesClient) (bs BandwidthSchedule, err error) { 1041 var done bool 1042 done, err = future.DoneWithContext(context.Background(), client) 1043 if err != nil { 1044 err = autorest.NewErrorWithError(err, "databoxedge.BandwidthSchedulesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 1045 return 1046 } 1047 if !done { 1048 bs.Response.Response = future.Response() 1049 err = azure.NewAsyncOpIncompleteError("databoxedge.BandwidthSchedulesCreateOrUpdateFuture") 1050 return 1051 } 1052 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 1053 if bs.Response.Response, err = future.GetResult(sender); err == nil && bs.Response.Response.StatusCode != http.StatusNoContent { 1054 bs, err = client.CreateOrUpdateResponder(bs.Response.Response) 1055 if err != nil { 1056 err = autorest.NewErrorWithError(err, "databoxedge.BandwidthSchedulesCreateOrUpdateFuture", "Result", bs.Response.Response, "Failure responding to request") 1057 } 1058 } 1059 return 1060} 1061 1062// BandwidthSchedulesDeleteFuture an abstraction for monitoring and retrieving the results of a 1063// long-running operation. 1064type BandwidthSchedulesDeleteFuture struct { 1065 azure.FutureAPI 1066 // Result returns the result of the asynchronous operation. 1067 // If the operation has not completed it will return an error. 1068 Result func(BandwidthSchedulesClient) (autorest.Response, error) 1069} 1070 1071// UnmarshalJSON is the custom unmarshaller for CreateFuture. 1072func (future *BandwidthSchedulesDeleteFuture) UnmarshalJSON(body []byte) error { 1073 var azFuture azure.Future 1074 if err := json.Unmarshal(body, &azFuture); err != nil { 1075 return err 1076 } 1077 future.FutureAPI = &azFuture 1078 future.Result = future.result 1079 return nil 1080} 1081 1082// result is the default implementation for BandwidthSchedulesDeleteFuture.Result. 1083func (future *BandwidthSchedulesDeleteFuture) result(client BandwidthSchedulesClient) (ar autorest.Response, err error) { 1084 var done bool 1085 done, err = future.DoneWithContext(context.Background(), client) 1086 if err != nil { 1087 err = autorest.NewErrorWithError(err, "databoxedge.BandwidthSchedulesDeleteFuture", "Result", future.Response(), "Polling failure") 1088 return 1089 } 1090 if !done { 1091 ar.Response = future.Response() 1092 err = azure.NewAsyncOpIncompleteError("databoxedge.BandwidthSchedulesDeleteFuture") 1093 return 1094 } 1095 ar.Response = future.Response() 1096 return 1097} 1098 1099// BandwidthSchedulesList the collection of bandwidth schedules. 1100type BandwidthSchedulesList struct { 1101 autorest.Response `json:"-"` 1102 // Value - READ-ONLY; The list of bandwidth schedules. 1103 Value *[]BandwidthSchedule `json:"value,omitempty"` 1104 // NextLink - READ-ONLY; Link to the next set of results. 1105 NextLink *string `json:"nextLink,omitempty"` 1106} 1107 1108// MarshalJSON is the custom marshaler for BandwidthSchedulesList. 1109func (bsl BandwidthSchedulesList) MarshalJSON() ([]byte, error) { 1110 objectMap := make(map[string]interface{}) 1111 return json.Marshal(objectMap) 1112} 1113 1114// BandwidthSchedulesListIterator provides access to a complete listing of BandwidthSchedule values. 1115type BandwidthSchedulesListIterator struct { 1116 i int 1117 page BandwidthSchedulesListPage 1118} 1119 1120// NextWithContext advances to the next value. If there was an error making 1121// the request the iterator does not advance and the error is returned. 1122func (iter *BandwidthSchedulesListIterator) NextWithContext(ctx context.Context) (err error) { 1123 if tracing.IsEnabled() { 1124 ctx = tracing.StartSpan(ctx, fqdn+"/BandwidthSchedulesListIterator.NextWithContext") 1125 defer func() { 1126 sc := -1 1127 if iter.Response().Response.Response != nil { 1128 sc = iter.Response().Response.Response.StatusCode 1129 } 1130 tracing.EndSpan(ctx, sc, err) 1131 }() 1132 } 1133 iter.i++ 1134 if iter.i < len(iter.page.Values()) { 1135 return nil 1136 } 1137 err = iter.page.NextWithContext(ctx) 1138 if err != nil { 1139 iter.i-- 1140 return err 1141 } 1142 iter.i = 0 1143 return nil 1144} 1145 1146// Next advances to the next value. If there was an error making 1147// the request the iterator does not advance and the error is returned. 1148// Deprecated: Use NextWithContext() instead. 1149func (iter *BandwidthSchedulesListIterator) Next() error { 1150 return iter.NextWithContext(context.Background()) 1151} 1152 1153// NotDone returns true if the enumeration should be started or is not yet complete. 1154func (iter BandwidthSchedulesListIterator) NotDone() bool { 1155 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 1156} 1157 1158// Response returns the raw server response from the last page request. 1159func (iter BandwidthSchedulesListIterator) Response() BandwidthSchedulesList { 1160 return iter.page.Response() 1161} 1162 1163// Value returns the current value or a zero-initialized value if the 1164// iterator has advanced beyond the end of the collection. 1165func (iter BandwidthSchedulesListIterator) Value() BandwidthSchedule { 1166 if !iter.page.NotDone() { 1167 return BandwidthSchedule{} 1168 } 1169 return iter.page.Values()[iter.i] 1170} 1171 1172// Creates a new instance of the BandwidthSchedulesListIterator type. 1173func NewBandwidthSchedulesListIterator(page BandwidthSchedulesListPage) BandwidthSchedulesListIterator { 1174 return BandwidthSchedulesListIterator{page: page} 1175} 1176 1177// IsEmpty returns true if the ListResult contains no values. 1178func (bsl BandwidthSchedulesList) IsEmpty() bool { 1179 return bsl.Value == nil || len(*bsl.Value) == 0 1180} 1181 1182// hasNextLink returns true if the NextLink is not empty. 1183func (bsl BandwidthSchedulesList) hasNextLink() bool { 1184 return bsl.NextLink != nil && len(*bsl.NextLink) != 0 1185} 1186 1187// bandwidthSchedulesListPreparer prepares a request to retrieve the next set of results. 1188// It returns nil if no more results exist. 1189func (bsl BandwidthSchedulesList) bandwidthSchedulesListPreparer(ctx context.Context) (*http.Request, error) { 1190 if !bsl.hasNextLink() { 1191 return nil, nil 1192 } 1193 return autorest.Prepare((&http.Request{}).WithContext(ctx), 1194 autorest.AsJSON(), 1195 autorest.AsGet(), 1196 autorest.WithBaseURL(to.String(bsl.NextLink))) 1197} 1198 1199// BandwidthSchedulesListPage contains a page of BandwidthSchedule values. 1200type BandwidthSchedulesListPage struct { 1201 fn func(context.Context, BandwidthSchedulesList) (BandwidthSchedulesList, error) 1202 bsl BandwidthSchedulesList 1203} 1204 1205// NextWithContext advances to the next page of values. If there was an error making 1206// the request the page does not advance and the error is returned. 1207func (page *BandwidthSchedulesListPage) NextWithContext(ctx context.Context) (err error) { 1208 if tracing.IsEnabled() { 1209 ctx = tracing.StartSpan(ctx, fqdn+"/BandwidthSchedulesListPage.NextWithContext") 1210 defer func() { 1211 sc := -1 1212 if page.Response().Response.Response != nil { 1213 sc = page.Response().Response.Response.StatusCode 1214 } 1215 tracing.EndSpan(ctx, sc, err) 1216 }() 1217 } 1218 for { 1219 next, err := page.fn(ctx, page.bsl) 1220 if err != nil { 1221 return err 1222 } 1223 page.bsl = next 1224 if !next.hasNextLink() || !next.IsEmpty() { 1225 break 1226 } 1227 } 1228 return nil 1229} 1230 1231// Next advances to the next page of values. If there was an error making 1232// the request the page does not advance and the error is returned. 1233// Deprecated: Use NextWithContext() instead. 1234func (page *BandwidthSchedulesListPage) Next() error { 1235 return page.NextWithContext(context.Background()) 1236} 1237 1238// NotDone returns true if the page enumeration should be started or is not yet complete. 1239func (page BandwidthSchedulesListPage) NotDone() bool { 1240 return !page.bsl.IsEmpty() 1241} 1242 1243// Response returns the raw server response from the last page request. 1244func (page BandwidthSchedulesListPage) Response() BandwidthSchedulesList { 1245 return page.bsl 1246} 1247 1248// Values returns the slice of values for the current page or nil if there are no values. 1249func (page BandwidthSchedulesListPage) Values() []BandwidthSchedule { 1250 if page.bsl.IsEmpty() { 1251 return nil 1252 } 1253 return *page.bsl.Value 1254} 1255 1256// Creates a new instance of the BandwidthSchedulesListPage type. 1257func NewBandwidthSchedulesListPage(cur BandwidthSchedulesList, getNextPage func(context.Context, BandwidthSchedulesList) (BandwidthSchedulesList, error)) BandwidthSchedulesListPage { 1258 return BandwidthSchedulesListPage{ 1259 fn: getNextPage, 1260 bsl: cur, 1261 } 1262} 1263 1264// ClientAccessRight the mapping between a particular client IP and the type of access client has on the 1265// NFS share. 1266type ClientAccessRight struct { 1267 // Client - IP of the client. 1268 Client *string `json:"client,omitempty"` 1269 // AccessPermission - Type of access to be allowed for the client. Possible values include: 'NoAccess', 'ReadOnly', 'ReadWrite' 1270 AccessPermission ClientPermissionType `json:"accessPermission,omitempty"` 1271} 1272 1273// CloudEdgeManagementRole cloudEdgeManagementRole role. 1274type CloudEdgeManagementRole struct { 1275 // CloudEdgeManagementRoleProperties - Properties specific to CloudEdgeManagementRole role. 1276 *CloudEdgeManagementRoleProperties `json:"properties,omitempty"` 1277 // SystemData - Role configured on ASE resource 1278 SystemData *SystemData `json:"systemData,omitempty"` 1279 // ID - READ-ONLY; The path ID that uniquely identifies the object. 1280 ID *string `json:"id,omitempty"` 1281 // Name - READ-ONLY; The object name. 1282 Name *string `json:"name,omitempty"` 1283 // Type - READ-ONLY; The hierarchical type of the object. 1284 Type *string `json:"type,omitempty"` 1285 // Kind - Possible values include: 'KindRole', 'KindCloudEdgeManagement', 'KindIOT', 'KindKubernetes', 'KindMEC' 1286 Kind KindBasicRole `json:"kind,omitempty"` 1287} 1288 1289// MarshalJSON is the custom marshaler for CloudEdgeManagementRole. 1290func (cemr CloudEdgeManagementRole) MarshalJSON() ([]byte, error) { 1291 cemr.Kind = KindCloudEdgeManagement 1292 objectMap := make(map[string]interface{}) 1293 if cemr.CloudEdgeManagementRoleProperties != nil { 1294 objectMap["properties"] = cemr.CloudEdgeManagementRoleProperties 1295 } 1296 if cemr.SystemData != nil { 1297 objectMap["systemData"] = cemr.SystemData 1298 } 1299 if cemr.Kind != "" { 1300 objectMap["kind"] = cemr.Kind 1301 } 1302 return json.Marshal(objectMap) 1303} 1304 1305// AsCloudEdgeManagementRole is the BasicRole implementation for CloudEdgeManagementRole. 1306func (cemr CloudEdgeManagementRole) AsCloudEdgeManagementRole() (*CloudEdgeManagementRole, bool) { 1307 return &cemr, true 1308} 1309 1310// AsIoTRole is the BasicRole implementation for CloudEdgeManagementRole. 1311func (cemr CloudEdgeManagementRole) AsIoTRole() (*IoTRole, bool) { 1312 return nil, false 1313} 1314 1315// AsKubernetesRole is the BasicRole implementation for CloudEdgeManagementRole. 1316func (cemr CloudEdgeManagementRole) AsKubernetesRole() (*KubernetesRole, bool) { 1317 return nil, false 1318} 1319 1320// AsMECRole is the BasicRole implementation for CloudEdgeManagementRole. 1321func (cemr CloudEdgeManagementRole) AsMECRole() (*MECRole, bool) { 1322 return nil, false 1323} 1324 1325// AsRole is the BasicRole implementation for CloudEdgeManagementRole. 1326func (cemr CloudEdgeManagementRole) AsRole() (*Role, bool) { 1327 return nil, false 1328} 1329 1330// AsBasicRole is the BasicRole implementation for CloudEdgeManagementRole. 1331func (cemr CloudEdgeManagementRole) AsBasicRole() (BasicRole, bool) { 1332 return &cemr, true 1333} 1334 1335// UnmarshalJSON is the custom unmarshaler for CloudEdgeManagementRole struct. 1336func (cemr *CloudEdgeManagementRole) UnmarshalJSON(body []byte) error { 1337 var m map[string]*json.RawMessage 1338 err := json.Unmarshal(body, &m) 1339 if err != nil { 1340 return err 1341 } 1342 for k, v := range m { 1343 switch k { 1344 case "properties": 1345 if v != nil { 1346 var cloudEdgeManagementRoleProperties CloudEdgeManagementRoleProperties 1347 err = json.Unmarshal(*v, &cloudEdgeManagementRoleProperties) 1348 if err != nil { 1349 return err 1350 } 1351 cemr.CloudEdgeManagementRoleProperties = &cloudEdgeManagementRoleProperties 1352 } 1353 case "systemData": 1354 if v != nil { 1355 var systemData SystemData 1356 err = json.Unmarshal(*v, &systemData) 1357 if err != nil { 1358 return err 1359 } 1360 cemr.SystemData = &systemData 1361 } 1362 case "kind": 1363 if v != nil { 1364 var kind KindBasicRole 1365 err = json.Unmarshal(*v, &kind) 1366 if err != nil { 1367 return err 1368 } 1369 cemr.Kind = kind 1370 } 1371 case "id": 1372 if v != nil { 1373 var ID string 1374 err = json.Unmarshal(*v, &ID) 1375 if err != nil { 1376 return err 1377 } 1378 cemr.ID = &ID 1379 } 1380 case "name": 1381 if v != nil { 1382 var name string 1383 err = json.Unmarshal(*v, &name) 1384 if err != nil { 1385 return err 1386 } 1387 cemr.Name = &name 1388 } 1389 case "type": 1390 if v != nil { 1391 var typeVar string 1392 err = json.Unmarshal(*v, &typeVar) 1393 if err != nil { 1394 return err 1395 } 1396 cemr.Type = &typeVar 1397 } 1398 } 1399 } 1400 1401 return nil 1402} 1403 1404// CloudEdgeManagementRoleProperties cloudEdgeManagement Role properties. 1405type CloudEdgeManagementRoleProperties struct { 1406 // LocalManagementStatus - READ-ONLY; Local Edge Management Status. Possible values include: 'RoleStatusEnabled', 'RoleStatusDisabled' 1407 LocalManagementStatus RoleStatus `json:"localManagementStatus,omitempty"` 1408 // EdgeProfile - READ-ONLY; Edge Profile of the resource 1409 EdgeProfile *EdgeProfile `json:"edgeProfile,omitempty"` 1410 // RoleStatus - Role status. Possible values include: 'RoleStatusEnabled', 'RoleStatusDisabled' 1411 RoleStatus RoleStatus `json:"roleStatus,omitempty"` 1412} 1413 1414// MarshalJSON is the custom marshaler for CloudEdgeManagementRoleProperties. 1415func (cemrp CloudEdgeManagementRoleProperties) MarshalJSON() ([]byte, error) { 1416 objectMap := make(map[string]interface{}) 1417 if cemrp.RoleStatus != "" { 1418 objectMap["roleStatus"] = cemrp.RoleStatus 1419 } 1420 return json.Marshal(objectMap) 1421} 1422 1423// CloudError an error response from the service. 1424type CloudError struct { 1425 // Error - The error details. 1426 Error *CloudErrorBody `json:"error,omitempty"` 1427} 1428 1429// CloudErrorBody an error response from the service. 1430type CloudErrorBody struct { 1431 // Code - An identifier for the error. Codes are invariant and are intended to be consumed programmatically. 1432 Code *string `json:"code,omitempty"` 1433 // Message - A message describing the error, intended to be suitable for display in a user interface. 1434 Message *string `json:"message,omitempty"` 1435 // Details - A list of additional details about the error. 1436 Details *[]CloudErrorBody `json:"details,omitempty"` 1437} 1438 1439// CniConfig cni configuration 1440type CniConfig struct { 1441 // Type - READ-ONLY; Cni type 1442 Type *string `json:"type,omitempty"` 1443 // Version - READ-ONLY; Cni version 1444 Version *string `json:"version,omitempty"` 1445 // PodSubnet - READ-ONLY; Pod Subnet 1446 PodSubnet *string `json:"podSubnet,omitempty"` 1447 // ServiceSubnet - READ-ONLY; Service subnet 1448 ServiceSubnet *string `json:"serviceSubnet,omitempty"` 1449} 1450 1451// MarshalJSON is the custom marshaler for CniConfig. 1452func (cc CniConfig) MarshalJSON() ([]byte, error) { 1453 objectMap := make(map[string]interface{}) 1454 return json.Marshal(objectMap) 1455} 1456 1457// ComputeResource compute infrastructure Resource 1458type ComputeResource struct { 1459 // ProcessorCount - Processor count 1460 ProcessorCount *int32 `json:"processorCount,omitempty"` 1461 // MemoryInGB - Memory in GB 1462 MemoryInGB *int64 `json:"memoryInGB,omitempty"` 1463} 1464 1465// ContactDetails contains all the contact details of the customer. 1466type ContactDetails struct { 1467 // ContactPerson - The contact person name. 1468 ContactPerson *string `json:"contactPerson,omitempty"` 1469 // CompanyName - The name of the company. 1470 CompanyName *string `json:"companyName,omitempty"` 1471 // Phone - The phone number. 1472 Phone *string `json:"phone,omitempty"` 1473 // EmailList - The email list. 1474 EmailList *[]string `json:"emailList,omitempty"` 1475} 1476 1477// Container represents a container on the Data Box Edge/Gateway device. 1478type Container struct { 1479 autorest.Response `json:"-"` 1480 // SystemData - Container in DataBoxEdge Resource 1481 SystemData *SystemData `json:"systemData,omitempty"` 1482 // ContainerProperties - The container properties. 1483 *ContainerProperties `json:"properties,omitempty"` 1484 // ID - READ-ONLY; The path ID that uniquely identifies the object. 1485 ID *string `json:"id,omitempty"` 1486 // Name - READ-ONLY; The object name. 1487 Name *string `json:"name,omitempty"` 1488 // Type - READ-ONLY; The hierarchical type of the object. 1489 Type *string `json:"type,omitempty"` 1490} 1491 1492// MarshalJSON is the custom marshaler for Container. 1493func (c Container) MarshalJSON() ([]byte, error) { 1494 objectMap := make(map[string]interface{}) 1495 if c.SystemData != nil { 1496 objectMap["systemData"] = c.SystemData 1497 } 1498 if c.ContainerProperties != nil { 1499 objectMap["properties"] = c.ContainerProperties 1500 } 1501 return json.Marshal(objectMap) 1502} 1503 1504// UnmarshalJSON is the custom unmarshaler for Container struct. 1505func (c *Container) UnmarshalJSON(body []byte) error { 1506 var m map[string]*json.RawMessage 1507 err := json.Unmarshal(body, &m) 1508 if err != nil { 1509 return err 1510 } 1511 for k, v := range m { 1512 switch k { 1513 case "systemData": 1514 if v != nil { 1515 var systemData SystemData 1516 err = json.Unmarshal(*v, &systemData) 1517 if err != nil { 1518 return err 1519 } 1520 c.SystemData = &systemData 1521 } 1522 case "properties": 1523 if v != nil { 1524 var containerProperties ContainerProperties 1525 err = json.Unmarshal(*v, &containerProperties) 1526 if err != nil { 1527 return err 1528 } 1529 c.ContainerProperties = &containerProperties 1530 } 1531 case "id": 1532 if v != nil { 1533 var ID string 1534 err = json.Unmarshal(*v, &ID) 1535 if err != nil { 1536 return err 1537 } 1538 c.ID = &ID 1539 } 1540 case "name": 1541 if v != nil { 1542 var name string 1543 err = json.Unmarshal(*v, &name) 1544 if err != nil { 1545 return err 1546 } 1547 c.Name = &name 1548 } 1549 case "type": 1550 if v != nil { 1551 var typeVar string 1552 err = json.Unmarshal(*v, &typeVar) 1553 if err != nil { 1554 return err 1555 } 1556 c.Type = &typeVar 1557 } 1558 } 1559 } 1560 1561 return nil 1562} 1563 1564// ContainerList collection of all the containers on the Data Box Edge/Gateway device. 1565type ContainerList struct { 1566 autorest.Response `json:"-"` 1567 // Value - READ-ONLY; The list of containers. 1568 Value *[]Container `json:"value,omitempty"` 1569 // NextLink - READ-ONLY; Link to the next set of results. 1570 NextLink *string `json:"nextLink,omitempty"` 1571} 1572 1573// MarshalJSON is the custom marshaler for ContainerList. 1574func (cl ContainerList) MarshalJSON() ([]byte, error) { 1575 objectMap := make(map[string]interface{}) 1576 return json.Marshal(objectMap) 1577} 1578 1579// ContainerListIterator provides access to a complete listing of Container values. 1580type ContainerListIterator struct { 1581 i int 1582 page ContainerListPage 1583} 1584 1585// NextWithContext advances to the next value. If there was an error making 1586// the request the iterator does not advance and the error is returned. 1587func (iter *ContainerListIterator) NextWithContext(ctx context.Context) (err error) { 1588 if tracing.IsEnabled() { 1589 ctx = tracing.StartSpan(ctx, fqdn+"/ContainerListIterator.NextWithContext") 1590 defer func() { 1591 sc := -1 1592 if iter.Response().Response.Response != nil { 1593 sc = iter.Response().Response.Response.StatusCode 1594 } 1595 tracing.EndSpan(ctx, sc, err) 1596 }() 1597 } 1598 iter.i++ 1599 if iter.i < len(iter.page.Values()) { 1600 return nil 1601 } 1602 err = iter.page.NextWithContext(ctx) 1603 if err != nil { 1604 iter.i-- 1605 return err 1606 } 1607 iter.i = 0 1608 return nil 1609} 1610 1611// Next advances to the next value. If there was an error making 1612// the request the iterator does not advance and the error is returned. 1613// Deprecated: Use NextWithContext() instead. 1614func (iter *ContainerListIterator) Next() error { 1615 return iter.NextWithContext(context.Background()) 1616} 1617 1618// NotDone returns true if the enumeration should be started or is not yet complete. 1619func (iter ContainerListIterator) NotDone() bool { 1620 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 1621} 1622 1623// Response returns the raw server response from the last page request. 1624func (iter ContainerListIterator) Response() ContainerList { 1625 return iter.page.Response() 1626} 1627 1628// Value returns the current value or a zero-initialized value if the 1629// iterator has advanced beyond the end of the collection. 1630func (iter ContainerListIterator) Value() Container { 1631 if !iter.page.NotDone() { 1632 return Container{} 1633 } 1634 return iter.page.Values()[iter.i] 1635} 1636 1637// Creates a new instance of the ContainerListIterator type. 1638func NewContainerListIterator(page ContainerListPage) ContainerListIterator { 1639 return ContainerListIterator{page: page} 1640} 1641 1642// IsEmpty returns true if the ListResult contains no values. 1643func (cl ContainerList) IsEmpty() bool { 1644 return cl.Value == nil || len(*cl.Value) == 0 1645} 1646 1647// hasNextLink returns true if the NextLink is not empty. 1648func (cl ContainerList) hasNextLink() bool { 1649 return cl.NextLink != nil && len(*cl.NextLink) != 0 1650} 1651 1652// containerListPreparer prepares a request to retrieve the next set of results. 1653// It returns nil if no more results exist. 1654func (cl ContainerList) containerListPreparer(ctx context.Context) (*http.Request, error) { 1655 if !cl.hasNextLink() { 1656 return nil, nil 1657 } 1658 return autorest.Prepare((&http.Request{}).WithContext(ctx), 1659 autorest.AsJSON(), 1660 autorest.AsGet(), 1661 autorest.WithBaseURL(to.String(cl.NextLink))) 1662} 1663 1664// ContainerListPage contains a page of Container values. 1665type ContainerListPage struct { 1666 fn func(context.Context, ContainerList) (ContainerList, error) 1667 cl ContainerList 1668} 1669 1670// NextWithContext advances to the next page of values. If there was an error making 1671// the request the page does not advance and the error is returned. 1672func (page *ContainerListPage) NextWithContext(ctx context.Context) (err error) { 1673 if tracing.IsEnabled() { 1674 ctx = tracing.StartSpan(ctx, fqdn+"/ContainerListPage.NextWithContext") 1675 defer func() { 1676 sc := -1 1677 if page.Response().Response.Response != nil { 1678 sc = page.Response().Response.Response.StatusCode 1679 } 1680 tracing.EndSpan(ctx, sc, err) 1681 }() 1682 } 1683 for { 1684 next, err := page.fn(ctx, page.cl) 1685 if err != nil { 1686 return err 1687 } 1688 page.cl = next 1689 if !next.hasNextLink() || !next.IsEmpty() { 1690 break 1691 } 1692 } 1693 return nil 1694} 1695 1696// Next advances to the next page of values. If there was an error making 1697// the request the page does not advance and the error is returned. 1698// Deprecated: Use NextWithContext() instead. 1699func (page *ContainerListPage) Next() error { 1700 return page.NextWithContext(context.Background()) 1701} 1702 1703// NotDone returns true if the page enumeration should be started or is not yet complete. 1704func (page ContainerListPage) NotDone() bool { 1705 return !page.cl.IsEmpty() 1706} 1707 1708// Response returns the raw server response from the last page request. 1709func (page ContainerListPage) Response() ContainerList { 1710 return page.cl 1711} 1712 1713// Values returns the slice of values for the current page or nil if there are no values. 1714func (page ContainerListPage) Values() []Container { 1715 if page.cl.IsEmpty() { 1716 return nil 1717 } 1718 return *page.cl.Value 1719} 1720 1721// Creates a new instance of the ContainerListPage type. 1722func NewContainerListPage(cur ContainerList, getNextPage func(context.Context, ContainerList) (ContainerList, error)) ContainerListPage { 1723 return ContainerListPage{ 1724 fn: getNextPage, 1725 cl: cur, 1726 } 1727} 1728 1729// ContainerProperties the container properties. 1730type ContainerProperties struct { 1731 // ContainerStatus - READ-ONLY; Current status of the container. Possible values include: 'ContainerStatusOK', 'ContainerStatusOffline', 'ContainerStatusUnknown', 'ContainerStatusUpdating', 'ContainerStatusNeedsAttention' 1732 ContainerStatus ContainerStatus `json:"containerStatus,omitempty"` 1733 // DataFormat - DataFormat for Container. Possible values include: 'BlockBlob', 'PageBlob', 'AzureFile' 1734 DataFormat AzureContainerDataFormat `json:"dataFormat,omitempty"` 1735 // RefreshDetails - READ-ONLY; Details of the refresh job on this container. 1736 RefreshDetails *RefreshDetails `json:"refreshDetails,omitempty"` 1737 // CreatedDateTime - READ-ONLY; The UTC time when container got created. 1738 CreatedDateTime *date.Time `json:"createdDateTime,omitempty"` 1739} 1740 1741// MarshalJSON is the custom marshaler for ContainerProperties. 1742func (cp ContainerProperties) MarshalJSON() ([]byte, error) { 1743 objectMap := make(map[string]interface{}) 1744 if cp.DataFormat != "" { 1745 objectMap["dataFormat"] = cp.DataFormat 1746 } 1747 return json.Marshal(objectMap) 1748} 1749 1750// ContainersCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a 1751// long-running operation. 1752type ContainersCreateOrUpdateFuture struct { 1753 azure.FutureAPI 1754 // Result returns the result of the asynchronous operation. 1755 // If the operation has not completed it will return an error. 1756 Result func(ContainersClient) (Container, error) 1757} 1758 1759// UnmarshalJSON is the custom unmarshaller for CreateFuture. 1760func (future *ContainersCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 1761 var azFuture azure.Future 1762 if err := json.Unmarshal(body, &azFuture); err != nil { 1763 return err 1764 } 1765 future.FutureAPI = &azFuture 1766 future.Result = future.result 1767 return nil 1768} 1769 1770// result is the default implementation for ContainersCreateOrUpdateFuture.Result. 1771func (future *ContainersCreateOrUpdateFuture) result(client ContainersClient) (c Container, err error) { 1772 var done bool 1773 done, err = future.DoneWithContext(context.Background(), client) 1774 if err != nil { 1775 err = autorest.NewErrorWithError(err, "databoxedge.ContainersCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 1776 return 1777 } 1778 if !done { 1779 c.Response.Response = future.Response() 1780 err = azure.NewAsyncOpIncompleteError("databoxedge.ContainersCreateOrUpdateFuture") 1781 return 1782 } 1783 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 1784 if c.Response.Response, err = future.GetResult(sender); err == nil && c.Response.Response.StatusCode != http.StatusNoContent { 1785 c, err = client.CreateOrUpdateResponder(c.Response.Response) 1786 if err != nil { 1787 err = autorest.NewErrorWithError(err, "databoxedge.ContainersCreateOrUpdateFuture", "Result", c.Response.Response, "Failure responding to request") 1788 } 1789 } 1790 return 1791} 1792 1793// ContainersDeleteFuture an abstraction for monitoring and retrieving the results of a long-running 1794// operation. 1795type ContainersDeleteFuture struct { 1796 azure.FutureAPI 1797 // Result returns the result of the asynchronous operation. 1798 // If the operation has not completed it will return an error. 1799 Result func(ContainersClient) (autorest.Response, error) 1800} 1801 1802// UnmarshalJSON is the custom unmarshaller for CreateFuture. 1803func (future *ContainersDeleteFuture) UnmarshalJSON(body []byte) error { 1804 var azFuture azure.Future 1805 if err := json.Unmarshal(body, &azFuture); err != nil { 1806 return err 1807 } 1808 future.FutureAPI = &azFuture 1809 future.Result = future.result 1810 return nil 1811} 1812 1813// result is the default implementation for ContainersDeleteFuture.Result. 1814func (future *ContainersDeleteFuture) result(client ContainersClient) (ar autorest.Response, err error) { 1815 var done bool 1816 done, err = future.DoneWithContext(context.Background(), client) 1817 if err != nil { 1818 err = autorest.NewErrorWithError(err, "databoxedge.ContainersDeleteFuture", "Result", future.Response(), "Polling failure") 1819 return 1820 } 1821 if !done { 1822 ar.Response = future.Response() 1823 err = azure.NewAsyncOpIncompleteError("databoxedge.ContainersDeleteFuture") 1824 return 1825 } 1826 ar.Response = future.Response() 1827 return 1828} 1829 1830// ContainersRefreshFuture an abstraction for monitoring and retrieving the results of a long-running 1831// operation. 1832type ContainersRefreshFuture struct { 1833 azure.FutureAPI 1834 // Result returns the result of the asynchronous operation. 1835 // If the operation has not completed it will return an error. 1836 Result func(ContainersClient) (autorest.Response, error) 1837} 1838 1839// UnmarshalJSON is the custom unmarshaller for CreateFuture. 1840func (future *ContainersRefreshFuture) UnmarshalJSON(body []byte) error { 1841 var azFuture azure.Future 1842 if err := json.Unmarshal(body, &azFuture); err != nil { 1843 return err 1844 } 1845 future.FutureAPI = &azFuture 1846 future.Result = future.result 1847 return nil 1848} 1849 1850// result is the default implementation for ContainersRefreshFuture.Result. 1851func (future *ContainersRefreshFuture) result(client ContainersClient) (ar autorest.Response, err error) { 1852 var done bool 1853 done, err = future.DoneWithContext(context.Background(), client) 1854 if err != nil { 1855 err = autorest.NewErrorWithError(err, "databoxedge.ContainersRefreshFuture", "Result", future.Response(), "Polling failure") 1856 return 1857 } 1858 if !done { 1859 ar.Response = future.Response() 1860 err = azure.NewAsyncOpIncompleteError("databoxedge.ContainersRefreshFuture") 1861 return 1862 } 1863 ar.Response = future.Response() 1864 return 1865} 1866 1867// DCAccessCode DC Access code in the case of Self Managed Shipping. 1868type DCAccessCode struct { 1869 autorest.Response `json:"-"` 1870 // DCAccessCodeProperties - DCAccessCode properties. 1871 *DCAccessCodeProperties `json:"properties,omitempty"` 1872} 1873 1874// MarshalJSON is the custom marshaler for DCAccessCode. 1875func (dac DCAccessCode) MarshalJSON() ([]byte, error) { 1876 objectMap := make(map[string]interface{}) 1877 if dac.DCAccessCodeProperties != nil { 1878 objectMap["properties"] = dac.DCAccessCodeProperties 1879 } 1880 return json.Marshal(objectMap) 1881} 1882 1883// UnmarshalJSON is the custom unmarshaler for DCAccessCode struct. 1884func (dac *DCAccessCode) UnmarshalJSON(body []byte) error { 1885 var m map[string]*json.RawMessage 1886 err := json.Unmarshal(body, &m) 1887 if err != nil { 1888 return err 1889 } 1890 for k, v := range m { 1891 switch k { 1892 case "properties": 1893 if v != nil { 1894 var dCAccessCodeProperties DCAccessCodeProperties 1895 err = json.Unmarshal(*v, &dCAccessCodeProperties) 1896 if err != nil { 1897 return err 1898 } 1899 dac.DCAccessCodeProperties = &dCAccessCodeProperties 1900 } 1901 } 1902 } 1903 1904 return nil 1905} 1906 1907// DCAccessCodeProperties dCAccessCode Properties. 1908type DCAccessCodeProperties struct { 1909 // AuthCode - DCAccess Code for the Self Managed shipment. 1910 AuthCode *string `json:"authCode,omitempty"` 1911} 1912 1913// Device the Data Box Edge/Gateway device. 1914type Device struct { 1915 autorest.Response `json:"-"` 1916 // Location - The location of the device. This is a supported and registered Azure geographical region (for example, West US, East US, or Southeast Asia). The geographical region of a device cannot be changed once it is created, but if an identical geographical region is specified on update, the request will succeed. 1917 Location *string `json:"location,omitempty"` 1918 // Tags - The list of tags that describe the device. These tags can be used to view and group this device (across resource groups). 1919 Tags map[string]*string `json:"tags"` 1920 // Sku - The SKU type. 1921 Sku *Sku `json:"sku,omitempty"` 1922 // Etag - The etag for the devices. 1923 Etag *string `json:"etag,omitempty"` 1924 // Identity - Msi identity of the resource 1925 Identity *ResourceIdentity `json:"identity,omitempty"` 1926 // Kind - READ-ONLY; The etag for the devices. Possible values include: 'AzureDataBoxGateway', 'AzureStackEdge', 'AzureStackHub', 'AzureModularDataCentre' 1927 Kind DeviceKind `json:"kind,omitempty"` 1928 // SystemData - DataBoxEdge Resource 1929 SystemData *SystemData `json:"systemData,omitempty"` 1930 // DeviceProperties - READ-ONLY; The properties of the Data Box Edge/Gateway device. 1931 *DeviceProperties `json:"properties,omitempty"` 1932 // ID - READ-ONLY; The path ID that uniquely identifies the object. 1933 ID *string `json:"id,omitempty"` 1934 // Name - READ-ONLY; The object name. 1935 Name *string `json:"name,omitempty"` 1936 // Type - READ-ONLY; The hierarchical type of the object. 1937 Type *string `json:"type,omitempty"` 1938} 1939 1940// MarshalJSON is the custom marshaler for Device. 1941func (d Device) MarshalJSON() ([]byte, error) { 1942 objectMap := make(map[string]interface{}) 1943 if d.Location != nil { 1944 objectMap["location"] = d.Location 1945 } 1946 if d.Tags != nil { 1947 objectMap["tags"] = d.Tags 1948 } 1949 if d.Sku != nil { 1950 objectMap["sku"] = d.Sku 1951 } 1952 if d.Etag != nil { 1953 objectMap["etag"] = d.Etag 1954 } 1955 if d.Identity != nil { 1956 objectMap["identity"] = d.Identity 1957 } 1958 if d.SystemData != nil { 1959 objectMap["systemData"] = d.SystemData 1960 } 1961 return json.Marshal(objectMap) 1962} 1963 1964// UnmarshalJSON is the custom unmarshaler for Device struct. 1965func (d *Device) UnmarshalJSON(body []byte) error { 1966 var m map[string]*json.RawMessage 1967 err := json.Unmarshal(body, &m) 1968 if err != nil { 1969 return err 1970 } 1971 for k, v := range m { 1972 switch k { 1973 case "location": 1974 if v != nil { 1975 var location string 1976 err = json.Unmarshal(*v, &location) 1977 if err != nil { 1978 return err 1979 } 1980 d.Location = &location 1981 } 1982 case "tags": 1983 if v != nil { 1984 var tags map[string]*string 1985 err = json.Unmarshal(*v, &tags) 1986 if err != nil { 1987 return err 1988 } 1989 d.Tags = tags 1990 } 1991 case "sku": 1992 if v != nil { 1993 var sku Sku 1994 err = json.Unmarshal(*v, &sku) 1995 if err != nil { 1996 return err 1997 } 1998 d.Sku = &sku 1999 } 2000 case "etag": 2001 if v != nil { 2002 var etag string 2003 err = json.Unmarshal(*v, &etag) 2004 if err != nil { 2005 return err 2006 } 2007 d.Etag = &etag 2008 } 2009 case "identity": 2010 if v != nil { 2011 var identity ResourceIdentity 2012 err = json.Unmarshal(*v, &identity) 2013 if err != nil { 2014 return err 2015 } 2016 d.Identity = &identity 2017 } 2018 case "kind": 2019 if v != nil { 2020 var kind DeviceKind 2021 err = json.Unmarshal(*v, &kind) 2022 if err != nil { 2023 return err 2024 } 2025 d.Kind = kind 2026 } 2027 case "systemData": 2028 if v != nil { 2029 var systemData SystemData 2030 err = json.Unmarshal(*v, &systemData) 2031 if err != nil { 2032 return err 2033 } 2034 d.SystemData = &systemData 2035 } 2036 case "properties": 2037 if v != nil { 2038 var deviceProperties DeviceProperties 2039 err = json.Unmarshal(*v, &deviceProperties) 2040 if err != nil { 2041 return err 2042 } 2043 d.DeviceProperties = &deviceProperties 2044 } 2045 case "id": 2046 if v != nil { 2047 var ID string 2048 err = json.Unmarshal(*v, &ID) 2049 if err != nil { 2050 return err 2051 } 2052 d.ID = &ID 2053 } 2054 case "name": 2055 if v != nil { 2056 var name string 2057 err = json.Unmarshal(*v, &name) 2058 if err != nil { 2059 return err 2060 } 2061 d.Name = &name 2062 } 2063 case "type": 2064 if v != nil { 2065 var typeVar string 2066 err = json.Unmarshal(*v, &typeVar) 2067 if err != nil { 2068 return err 2069 } 2070 d.Type = &typeVar 2071 } 2072 } 2073 } 2074 2075 return nil 2076} 2077 2078// DeviceExtendedInfo the extended Info of the Data Box Edge/Gateway device. 2079type DeviceExtendedInfo struct { 2080 autorest.Response `json:"-"` 2081 // DeviceExtendedInfoProperties - The extended info properties. 2082 *DeviceExtendedInfoProperties `json:"properties,omitempty"` 2083 // ID - READ-ONLY; The path ID that uniquely identifies the object. 2084 ID *string `json:"id,omitempty"` 2085 // Name - READ-ONLY; The object name. 2086 Name *string `json:"name,omitempty"` 2087 // Type - READ-ONLY; The hierarchical type of the object. 2088 Type *string `json:"type,omitempty"` 2089} 2090 2091// MarshalJSON is the custom marshaler for DeviceExtendedInfo. 2092func (dei DeviceExtendedInfo) MarshalJSON() ([]byte, error) { 2093 objectMap := make(map[string]interface{}) 2094 if dei.DeviceExtendedInfoProperties != nil { 2095 objectMap["properties"] = dei.DeviceExtendedInfoProperties 2096 } 2097 return json.Marshal(objectMap) 2098} 2099 2100// UnmarshalJSON is the custom unmarshaler for DeviceExtendedInfo struct. 2101func (dei *DeviceExtendedInfo) UnmarshalJSON(body []byte) error { 2102 var m map[string]*json.RawMessage 2103 err := json.Unmarshal(body, &m) 2104 if err != nil { 2105 return err 2106 } 2107 for k, v := range m { 2108 switch k { 2109 case "properties": 2110 if v != nil { 2111 var deviceExtendedInfoProperties DeviceExtendedInfoProperties 2112 err = json.Unmarshal(*v, &deviceExtendedInfoProperties) 2113 if err != nil { 2114 return err 2115 } 2116 dei.DeviceExtendedInfoProperties = &deviceExtendedInfoProperties 2117 } 2118 case "id": 2119 if v != nil { 2120 var ID string 2121 err = json.Unmarshal(*v, &ID) 2122 if err != nil { 2123 return err 2124 } 2125 dei.ID = &ID 2126 } 2127 case "name": 2128 if v != nil { 2129 var name string 2130 err = json.Unmarshal(*v, &name) 2131 if err != nil { 2132 return err 2133 } 2134 dei.Name = &name 2135 } 2136 case "type": 2137 if v != nil { 2138 var typeVar string 2139 err = json.Unmarshal(*v, &typeVar) 2140 if err != nil { 2141 return err 2142 } 2143 dei.Type = &typeVar 2144 } 2145 } 2146 } 2147 2148 return nil 2149} 2150 2151// DeviceExtendedInfoPatch the Data Box Edge/Gateway device extended info patch. 2152type DeviceExtendedInfoPatch struct { 2153 // ClientSecretStoreID - The Key Vault ARM Id for client secrets 2154 ClientSecretStoreID *string `json:"clientSecretStoreId,omitempty"` 2155 // ClientSecretStoreURL - The url to access the Client Key Vault 2156 ClientSecretStoreURL *string `json:"clientSecretStoreUrl,omitempty"` 2157 // ChannelIntegrityKeyName - The name for Channel Integrity Key stored in the Client Key Vault 2158 ChannelIntegrityKeyName *string `json:"channelIntegrityKeyName,omitempty"` 2159 // ChannelIntegrityKeyVersion - The version of Channel Integrity Key stored in the Client Key Vault 2160 ChannelIntegrityKeyVersion *string `json:"channelIntegrityKeyVersion,omitempty"` 2161 // SyncStatus - For changing or to initiate the resync to key-vault set the status to KeyVaultSyncPending, rest of the status will not be applicable. Possible values include: 'KeyVaultSynced', 'KeyVaultSyncFailed', 'KeyVaultNotConfigured', 'KeyVaultSyncPending', 'KeyVaultSyncing' 2162 SyncStatus KeyVaultSyncStatus `json:"syncStatus,omitempty"` 2163} 2164 2165// DeviceExtendedInfoProperties the properties of the Data Box Edge/Gateway device extended info. 2166type DeviceExtendedInfoProperties struct { 2167 // EncryptionKeyThumbprint - The digital signature of encrypted certificate. 2168 EncryptionKeyThumbprint *string `json:"encryptionKeyThumbprint,omitempty"` 2169 // EncryptionKey - The public part of the encryption certificate. Client uses this to encrypt any secret. 2170 EncryptionKey *string `json:"encryptionKey,omitempty"` 2171 // ResourceKey - READ-ONLY; The Resource ID of the Resource. 2172 ResourceKey *string `json:"resourceKey,omitempty"` 2173 // ClientSecretStoreID - The Key Vault ARM Id for client secrets 2174 ClientSecretStoreID *string `json:"clientSecretStoreId,omitempty"` 2175 // ClientSecretStoreURL - The url to access the Client Key Vault 2176 ClientSecretStoreURL *string `json:"clientSecretStoreUrl,omitempty"` 2177 // ChannelIntegrityKeyName - The name of Channel Integrity Key stored in the Client Key Vault 2178 ChannelIntegrityKeyName *string `json:"channelIntegrityKeyName,omitempty"` 2179 // ChannelIntegrityKeyVersion - The version of Channel Integrity Key stored in the Client Key Vault 2180 ChannelIntegrityKeyVersion *string `json:"channelIntegrityKeyVersion,omitempty"` 2181 // KeyVaultSyncStatus - Key vault sync status. Possible values include: 'KeyVaultSynced', 'KeyVaultSyncFailed', 'KeyVaultNotConfigured', 'KeyVaultSyncPending', 'KeyVaultSyncing' 2182 KeyVaultSyncStatus KeyVaultSyncStatus `json:"keyVaultSyncStatus,omitempty"` 2183 // DeviceSecrets - READ-ONLY; Device secrets, will be returned only with ODataFilter $expand=deviceSecrets 2184 DeviceSecrets *DeviceSecrets `json:"deviceSecrets,omitempty"` 2185} 2186 2187// MarshalJSON is the custom marshaler for DeviceExtendedInfoProperties. 2188func (deip DeviceExtendedInfoProperties) MarshalJSON() ([]byte, error) { 2189 objectMap := make(map[string]interface{}) 2190 if deip.EncryptionKeyThumbprint != nil { 2191 objectMap["encryptionKeyThumbprint"] = deip.EncryptionKeyThumbprint 2192 } 2193 if deip.EncryptionKey != nil { 2194 objectMap["encryptionKey"] = deip.EncryptionKey 2195 } 2196 if deip.ClientSecretStoreID != nil { 2197 objectMap["clientSecretStoreId"] = deip.ClientSecretStoreID 2198 } 2199 if deip.ClientSecretStoreURL != nil { 2200 objectMap["clientSecretStoreUrl"] = deip.ClientSecretStoreURL 2201 } 2202 if deip.ChannelIntegrityKeyName != nil { 2203 objectMap["channelIntegrityKeyName"] = deip.ChannelIntegrityKeyName 2204 } 2205 if deip.ChannelIntegrityKeyVersion != nil { 2206 objectMap["channelIntegrityKeyVersion"] = deip.ChannelIntegrityKeyVersion 2207 } 2208 if deip.KeyVaultSyncStatus != "" { 2209 objectMap["keyVaultSyncStatus"] = deip.KeyVaultSyncStatus 2210 } 2211 return json.Marshal(objectMap) 2212} 2213 2214// DeviceList the collection of Data Box Edge/Gateway devices. 2215type DeviceList struct { 2216 autorest.Response `json:"-"` 2217 // Value - READ-ONLY; The list of Data Box Edge/Gateway devices. 2218 Value *[]Device `json:"value,omitempty"` 2219 // NextLink - READ-ONLY; Link to the next set of results. 2220 NextLink *string `json:"nextLink,omitempty"` 2221} 2222 2223// MarshalJSON is the custom marshaler for DeviceList. 2224func (dl DeviceList) MarshalJSON() ([]byte, error) { 2225 objectMap := make(map[string]interface{}) 2226 return json.Marshal(objectMap) 2227} 2228 2229// DeviceListIterator provides access to a complete listing of Device values. 2230type DeviceListIterator struct { 2231 i int 2232 page DeviceListPage 2233} 2234 2235// NextWithContext advances to the next value. If there was an error making 2236// the request the iterator does not advance and the error is returned. 2237func (iter *DeviceListIterator) NextWithContext(ctx context.Context) (err error) { 2238 if tracing.IsEnabled() { 2239 ctx = tracing.StartSpan(ctx, fqdn+"/DeviceListIterator.NextWithContext") 2240 defer func() { 2241 sc := -1 2242 if iter.Response().Response.Response != nil { 2243 sc = iter.Response().Response.Response.StatusCode 2244 } 2245 tracing.EndSpan(ctx, sc, err) 2246 }() 2247 } 2248 iter.i++ 2249 if iter.i < len(iter.page.Values()) { 2250 return nil 2251 } 2252 err = iter.page.NextWithContext(ctx) 2253 if err != nil { 2254 iter.i-- 2255 return err 2256 } 2257 iter.i = 0 2258 return nil 2259} 2260 2261// Next advances to the next value. If there was an error making 2262// the request the iterator does not advance and the error is returned. 2263// Deprecated: Use NextWithContext() instead. 2264func (iter *DeviceListIterator) Next() error { 2265 return iter.NextWithContext(context.Background()) 2266} 2267 2268// NotDone returns true if the enumeration should be started or is not yet complete. 2269func (iter DeviceListIterator) NotDone() bool { 2270 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 2271} 2272 2273// Response returns the raw server response from the last page request. 2274func (iter DeviceListIterator) Response() DeviceList { 2275 return iter.page.Response() 2276} 2277 2278// Value returns the current value or a zero-initialized value if the 2279// iterator has advanced beyond the end of the collection. 2280func (iter DeviceListIterator) Value() Device { 2281 if !iter.page.NotDone() { 2282 return Device{} 2283 } 2284 return iter.page.Values()[iter.i] 2285} 2286 2287// Creates a new instance of the DeviceListIterator type. 2288func NewDeviceListIterator(page DeviceListPage) DeviceListIterator { 2289 return DeviceListIterator{page: page} 2290} 2291 2292// IsEmpty returns true if the ListResult contains no values. 2293func (dl DeviceList) IsEmpty() bool { 2294 return dl.Value == nil || len(*dl.Value) == 0 2295} 2296 2297// hasNextLink returns true if the NextLink is not empty. 2298func (dl DeviceList) hasNextLink() bool { 2299 return dl.NextLink != nil && len(*dl.NextLink) != 0 2300} 2301 2302// deviceListPreparer prepares a request to retrieve the next set of results. 2303// It returns nil if no more results exist. 2304func (dl DeviceList) deviceListPreparer(ctx context.Context) (*http.Request, error) { 2305 if !dl.hasNextLink() { 2306 return nil, nil 2307 } 2308 return autorest.Prepare((&http.Request{}).WithContext(ctx), 2309 autorest.AsJSON(), 2310 autorest.AsGet(), 2311 autorest.WithBaseURL(to.String(dl.NextLink))) 2312} 2313 2314// DeviceListPage contains a page of Device values. 2315type DeviceListPage struct { 2316 fn func(context.Context, DeviceList) (DeviceList, error) 2317 dl DeviceList 2318} 2319 2320// NextWithContext advances to the next page of values. If there was an error making 2321// the request the page does not advance and the error is returned. 2322func (page *DeviceListPage) NextWithContext(ctx context.Context) (err error) { 2323 if tracing.IsEnabled() { 2324 ctx = tracing.StartSpan(ctx, fqdn+"/DeviceListPage.NextWithContext") 2325 defer func() { 2326 sc := -1 2327 if page.Response().Response.Response != nil { 2328 sc = page.Response().Response.Response.StatusCode 2329 } 2330 tracing.EndSpan(ctx, sc, err) 2331 }() 2332 } 2333 for { 2334 next, err := page.fn(ctx, page.dl) 2335 if err != nil { 2336 return err 2337 } 2338 page.dl = next 2339 if !next.hasNextLink() || !next.IsEmpty() { 2340 break 2341 } 2342 } 2343 return nil 2344} 2345 2346// Next advances to the next page of values. If there was an error making 2347// the request the page does not advance and the error is returned. 2348// Deprecated: Use NextWithContext() instead. 2349func (page *DeviceListPage) Next() error { 2350 return page.NextWithContext(context.Background()) 2351} 2352 2353// NotDone returns true if the page enumeration should be started or is not yet complete. 2354func (page DeviceListPage) NotDone() bool { 2355 return !page.dl.IsEmpty() 2356} 2357 2358// Response returns the raw server response from the last page request. 2359func (page DeviceListPage) Response() DeviceList { 2360 return page.dl 2361} 2362 2363// Values returns the slice of values for the current page or nil if there are no values. 2364func (page DeviceListPage) Values() []Device { 2365 if page.dl.IsEmpty() { 2366 return nil 2367 } 2368 return *page.dl.Value 2369} 2370 2371// Creates a new instance of the DeviceListPage type. 2372func NewDeviceListPage(cur DeviceList, getNextPage func(context.Context, DeviceList) (DeviceList, error)) DeviceListPage { 2373 return DeviceListPage{ 2374 fn: getNextPage, 2375 dl: cur, 2376 } 2377} 2378 2379// DevicePatch the Data Box Edge/Gateway device patch. 2380type DevicePatch struct { 2381 // Tags - The tags attached to the Data Box Edge/Gateway resource. 2382 Tags map[string]*string `json:"tags"` 2383 // Identity - Msi identity of the resource 2384 Identity *ResourceIdentity `json:"identity,omitempty"` 2385 // DevicePropertiesPatch - The properties associated with the Data Box Edge/Gateway resource 2386 *DevicePropertiesPatch `json:"properties,omitempty"` 2387} 2388 2389// MarshalJSON is the custom marshaler for DevicePatch. 2390func (dp DevicePatch) MarshalJSON() ([]byte, error) { 2391 objectMap := make(map[string]interface{}) 2392 if dp.Tags != nil { 2393 objectMap["tags"] = dp.Tags 2394 } 2395 if dp.Identity != nil { 2396 objectMap["identity"] = dp.Identity 2397 } 2398 if dp.DevicePropertiesPatch != nil { 2399 objectMap["properties"] = dp.DevicePropertiesPatch 2400 } 2401 return json.Marshal(objectMap) 2402} 2403 2404// UnmarshalJSON is the custom unmarshaler for DevicePatch struct. 2405func (dp *DevicePatch) UnmarshalJSON(body []byte) error { 2406 var m map[string]*json.RawMessage 2407 err := json.Unmarshal(body, &m) 2408 if err != nil { 2409 return err 2410 } 2411 for k, v := range m { 2412 switch k { 2413 case "tags": 2414 if v != nil { 2415 var tags map[string]*string 2416 err = json.Unmarshal(*v, &tags) 2417 if err != nil { 2418 return err 2419 } 2420 dp.Tags = tags 2421 } 2422 case "identity": 2423 if v != nil { 2424 var identity ResourceIdentity 2425 err = json.Unmarshal(*v, &identity) 2426 if err != nil { 2427 return err 2428 } 2429 dp.Identity = &identity 2430 } 2431 case "properties": 2432 if v != nil { 2433 var devicePropertiesPatch DevicePropertiesPatch 2434 err = json.Unmarshal(*v, &devicePropertiesPatch) 2435 if err != nil { 2436 return err 2437 } 2438 dp.DevicePropertiesPatch = &devicePropertiesPatch 2439 } 2440 } 2441 } 2442 2443 return nil 2444} 2445 2446// DeviceProperties the properties of the Data Box Edge/Gateway device. 2447type DeviceProperties struct { 2448 // DataBoxEdgeDeviceStatus - The status of the Data Box Edge/Gateway device. Possible values include: 'ReadyToSetup', 'Online', 'Offline', 'NeedsAttention', 'Disconnected', 'PartiallyDisconnected', 'Maintenance' 2449 DataBoxEdgeDeviceStatus DeviceStatus `json:"dataBoxEdgeDeviceStatus,omitempty"` 2450 // SerialNumber - READ-ONLY; The Serial Number of Data Box Edge/Gateway device. 2451 SerialNumber *string `json:"serialNumber,omitempty"` 2452 // Description - READ-ONLY; The Description of the Data Box Edge/Gateway device. 2453 Description *string `json:"description,omitempty"` 2454 // ModelDescription - READ-ONLY; The description of the Data Box Edge/Gateway device model. 2455 ModelDescription *string `json:"modelDescription,omitempty"` 2456 // DeviceType - READ-ONLY; The type of the Data Box Edge/Gateway device. Possible values include: 'DataBoxEdgeDevice' 2457 DeviceType DeviceType `json:"deviceType,omitempty"` 2458 // FriendlyName - READ-ONLY; The Data Box Edge/Gateway device name. 2459 FriendlyName *string `json:"friendlyName,omitempty"` 2460 // Culture - READ-ONLY; The Data Box Edge/Gateway device culture. 2461 Culture *string `json:"culture,omitempty"` 2462 // DeviceModel - READ-ONLY; The Data Box Edge/Gateway device model. 2463 DeviceModel *string `json:"deviceModel,omitempty"` 2464 // DeviceSoftwareVersion - READ-ONLY; The Data Box Edge/Gateway device software version. 2465 DeviceSoftwareVersion *string `json:"deviceSoftwareVersion,omitempty"` 2466 // DeviceLocalCapacity - READ-ONLY; The Data Box Edge/Gateway device local capacity in MB. 2467 DeviceLocalCapacity *int64 `json:"deviceLocalCapacity,omitempty"` 2468 // TimeZone - READ-ONLY; The Data Box Edge/Gateway device timezone. 2469 TimeZone *string `json:"timeZone,omitempty"` 2470 // DeviceHcsVersion - READ-ONLY; The device software version number of the device (eg: 1.2.18105.6). 2471 DeviceHcsVersion *string `json:"deviceHcsVersion,omitempty"` 2472 // ConfiguredRoleTypes - READ-ONLY; Type of compute roles configured. 2473 ConfiguredRoleTypes *[]RoleTypes `json:"configuredRoleTypes,omitempty"` 2474 // NodeCount - READ-ONLY; The number of nodes in the cluster. 2475 NodeCount *int32 `json:"nodeCount,omitempty"` 2476 // ResourceMoveDetails - READ-ONLY; The details of the move operation on this resource. 2477 ResourceMoveDetails *ResourceMoveDetails `json:"resourceMoveDetails,omitempty"` 2478 // EdgeProfile - READ-ONLY; The details of Edge Profile for this resource 2479 EdgeProfile *EdgeProfile `json:"edgeProfile,omitempty"` 2480} 2481 2482// MarshalJSON is the custom marshaler for DeviceProperties. 2483func (dp DeviceProperties) MarshalJSON() ([]byte, error) { 2484 objectMap := make(map[string]interface{}) 2485 if dp.DataBoxEdgeDeviceStatus != "" { 2486 objectMap["dataBoxEdgeDeviceStatus"] = dp.DataBoxEdgeDeviceStatus 2487 } 2488 return json.Marshal(objectMap) 2489} 2490 2491// DevicePropertiesPatch the Data Box Edge/Gateway device properties patch. 2492type DevicePropertiesPatch struct { 2493 // EdgeProfile - Edge Profile property of the Data Box Edge/Gateway device 2494 EdgeProfile *EdgeProfilePatch `json:"edgeProfile,omitempty"` 2495} 2496 2497// DevicesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 2498// operation. 2499type DevicesCreateOrUpdateFuture struct { 2500 azure.FutureAPI 2501 // Result returns the result of the asynchronous operation. 2502 // If the operation has not completed it will return an error. 2503 Result func(DevicesClient) (Device, error) 2504} 2505 2506// UnmarshalJSON is the custom unmarshaller for CreateFuture. 2507func (future *DevicesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 2508 var azFuture azure.Future 2509 if err := json.Unmarshal(body, &azFuture); err != nil { 2510 return err 2511 } 2512 future.FutureAPI = &azFuture 2513 future.Result = future.result 2514 return nil 2515} 2516 2517// result is the default implementation for DevicesCreateOrUpdateFuture.Result. 2518func (future *DevicesCreateOrUpdateFuture) result(client DevicesClient) (d Device, err error) { 2519 var done bool 2520 done, err = future.DoneWithContext(context.Background(), client) 2521 if err != nil { 2522 err = autorest.NewErrorWithError(err, "databoxedge.DevicesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 2523 return 2524 } 2525 if !done { 2526 d.Response.Response = future.Response() 2527 err = azure.NewAsyncOpIncompleteError("databoxedge.DevicesCreateOrUpdateFuture") 2528 return 2529 } 2530 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 2531 if d.Response.Response, err = future.GetResult(sender); err == nil && d.Response.Response.StatusCode != http.StatusNoContent { 2532 d, err = client.CreateOrUpdateResponder(d.Response.Response) 2533 if err != nil { 2534 err = autorest.NewErrorWithError(err, "databoxedge.DevicesCreateOrUpdateFuture", "Result", d.Response.Response, "Failure responding to request") 2535 } 2536 } 2537 return 2538} 2539 2540// DevicesCreateOrUpdateSecuritySettingsFuture an abstraction for monitoring and retrieving the results of 2541// a long-running operation. 2542type DevicesCreateOrUpdateSecuritySettingsFuture struct { 2543 azure.FutureAPI 2544 // Result returns the result of the asynchronous operation. 2545 // If the operation has not completed it will return an error. 2546 Result func(DevicesClient) (autorest.Response, error) 2547} 2548 2549// UnmarshalJSON is the custom unmarshaller for CreateFuture. 2550func (future *DevicesCreateOrUpdateSecuritySettingsFuture) UnmarshalJSON(body []byte) error { 2551 var azFuture azure.Future 2552 if err := json.Unmarshal(body, &azFuture); err != nil { 2553 return err 2554 } 2555 future.FutureAPI = &azFuture 2556 future.Result = future.result 2557 return nil 2558} 2559 2560// result is the default implementation for DevicesCreateOrUpdateSecuritySettingsFuture.Result. 2561func (future *DevicesCreateOrUpdateSecuritySettingsFuture) result(client DevicesClient) (ar autorest.Response, err error) { 2562 var done bool 2563 done, err = future.DoneWithContext(context.Background(), client) 2564 if err != nil { 2565 err = autorest.NewErrorWithError(err, "databoxedge.DevicesCreateOrUpdateSecuritySettingsFuture", "Result", future.Response(), "Polling failure") 2566 return 2567 } 2568 if !done { 2569 ar.Response = future.Response() 2570 err = azure.NewAsyncOpIncompleteError("databoxedge.DevicesCreateOrUpdateSecuritySettingsFuture") 2571 return 2572 } 2573 ar.Response = future.Response() 2574 return 2575} 2576 2577// DevicesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running 2578// operation. 2579type DevicesDeleteFuture struct { 2580 azure.FutureAPI 2581 // Result returns the result of the asynchronous operation. 2582 // If the operation has not completed it will return an error. 2583 Result func(DevicesClient) (autorest.Response, error) 2584} 2585 2586// UnmarshalJSON is the custom unmarshaller for CreateFuture. 2587func (future *DevicesDeleteFuture) UnmarshalJSON(body []byte) error { 2588 var azFuture azure.Future 2589 if err := json.Unmarshal(body, &azFuture); err != nil { 2590 return err 2591 } 2592 future.FutureAPI = &azFuture 2593 future.Result = future.result 2594 return nil 2595} 2596 2597// result is the default implementation for DevicesDeleteFuture.Result. 2598func (future *DevicesDeleteFuture) result(client DevicesClient) (ar autorest.Response, err error) { 2599 var done bool 2600 done, err = future.DoneWithContext(context.Background(), client) 2601 if err != nil { 2602 err = autorest.NewErrorWithError(err, "databoxedge.DevicesDeleteFuture", "Result", future.Response(), "Polling failure") 2603 return 2604 } 2605 if !done { 2606 ar.Response = future.Response() 2607 err = azure.NewAsyncOpIncompleteError("databoxedge.DevicesDeleteFuture") 2608 return 2609 } 2610 ar.Response = future.Response() 2611 return 2612} 2613 2614// DevicesDownloadUpdatesFuture an abstraction for monitoring and retrieving the results of a long-running 2615// operation. 2616type DevicesDownloadUpdatesFuture struct { 2617 azure.FutureAPI 2618 // Result returns the result of the asynchronous operation. 2619 // If the operation has not completed it will return an error. 2620 Result func(DevicesClient) (autorest.Response, error) 2621} 2622 2623// UnmarshalJSON is the custom unmarshaller for CreateFuture. 2624func (future *DevicesDownloadUpdatesFuture) UnmarshalJSON(body []byte) error { 2625 var azFuture azure.Future 2626 if err := json.Unmarshal(body, &azFuture); err != nil { 2627 return err 2628 } 2629 future.FutureAPI = &azFuture 2630 future.Result = future.result 2631 return nil 2632} 2633 2634// result is the default implementation for DevicesDownloadUpdatesFuture.Result. 2635func (future *DevicesDownloadUpdatesFuture) result(client DevicesClient) (ar autorest.Response, err error) { 2636 var done bool 2637 done, err = future.DoneWithContext(context.Background(), client) 2638 if err != nil { 2639 err = autorest.NewErrorWithError(err, "databoxedge.DevicesDownloadUpdatesFuture", "Result", future.Response(), "Polling failure") 2640 return 2641 } 2642 if !done { 2643 ar.Response = future.Response() 2644 err = azure.NewAsyncOpIncompleteError("databoxedge.DevicesDownloadUpdatesFuture") 2645 return 2646 } 2647 ar.Response = future.Response() 2648 return 2649} 2650 2651// DeviceSecrets device Secrets 2652type DeviceSecrets struct { 2653 // HcsDataVolumeBitLockerExternalKey - Keyvault Id of HcsDataVolumeBitLockerExternalKey 2654 HcsDataVolumeBitLockerExternalKey *Secret `json:"hcsDataVolumeBitLockerExternalKey,omitempty"` 2655 // HcsInternalVolumeBitLockerExternalKey - Keyvault Id of HcsInternalVolumeBitLockerExternalKey 2656 HcsInternalVolumeBitLockerExternalKey *Secret `json:"hcsInternalVolumeBitLockerExternalKey,omitempty"` 2657 // SystemVolumeBitLockerRecoveryKey - Keyvault Id of SystemVolumeBitLockerRecoveryKey 2658 SystemVolumeBitLockerRecoveryKey *Secret `json:"systemVolumeBitLockerRecoveryKey,omitempty"` 2659 // SedEncryptionExternalKeyID - Keyvault Id of SEDEncryptionExternalKeyId 2660 SedEncryptionExternalKeyID *Secret `json:"sedEncryptionExternalKeyId,omitempty"` 2661 // SedEncryptionExternalKey - Keyvault Id of SEDEncryptionExternalKey 2662 SedEncryptionExternalKey *Secret `json:"sedEncryptionExternalKey,omitempty"` 2663 // BmcDefaultUserPassword - Keyvault Id of BMCDefaultUserPassword 2664 BmcDefaultUserPassword *Secret `json:"bmcDefaultUserPassword,omitempty"` 2665 // RotateKeyForDataVolumeBitlocker - Keyvault Id of RotateKeyForDataVolumeBitlocker 2666 RotateKeyForDataVolumeBitlocker *Secret `json:"rotateKeyForDataVolumeBitlocker,omitempty"` 2667 // RotateKeysForSedDrivesSerialized - Keyvault Id of RotateKeysForSedDrivesSerialized 2668 RotateKeysForSedDrivesSerialized *Secret `json:"rotateKeysForSedDrivesSerialized,omitempty"` 2669} 2670 2671// DevicesInstallUpdatesFuture an abstraction for monitoring and retrieving the results of a long-running 2672// operation. 2673type DevicesInstallUpdatesFuture struct { 2674 azure.FutureAPI 2675 // Result returns the result of the asynchronous operation. 2676 // If the operation has not completed it will return an error. 2677 Result func(DevicesClient) (autorest.Response, error) 2678} 2679 2680// UnmarshalJSON is the custom unmarshaller for CreateFuture. 2681func (future *DevicesInstallUpdatesFuture) UnmarshalJSON(body []byte) error { 2682 var azFuture azure.Future 2683 if err := json.Unmarshal(body, &azFuture); err != nil { 2684 return err 2685 } 2686 future.FutureAPI = &azFuture 2687 future.Result = future.result 2688 return nil 2689} 2690 2691// result is the default implementation for DevicesInstallUpdatesFuture.Result. 2692func (future *DevicesInstallUpdatesFuture) result(client DevicesClient) (ar autorest.Response, err error) { 2693 var done bool 2694 done, err = future.DoneWithContext(context.Background(), client) 2695 if err != nil { 2696 err = autorest.NewErrorWithError(err, "databoxedge.DevicesInstallUpdatesFuture", "Result", future.Response(), "Polling failure") 2697 return 2698 } 2699 if !done { 2700 ar.Response = future.Response() 2701 err = azure.NewAsyncOpIncompleteError("databoxedge.DevicesInstallUpdatesFuture") 2702 return 2703 } 2704 ar.Response = future.Response() 2705 return 2706} 2707 2708// DevicesScanForUpdatesFuture an abstraction for monitoring and retrieving the results of a long-running 2709// operation. 2710type DevicesScanForUpdatesFuture struct { 2711 azure.FutureAPI 2712 // Result returns the result of the asynchronous operation. 2713 // If the operation has not completed it will return an error. 2714 Result func(DevicesClient) (autorest.Response, error) 2715} 2716 2717// UnmarshalJSON is the custom unmarshaller for CreateFuture. 2718func (future *DevicesScanForUpdatesFuture) UnmarshalJSON(body []byte) error { 2719 var azFuture azure.Future 2720 if err := json.Unmarshal(body, &azFuture); err != nil { 2721 return err 2722 } 2723 future.FutureAPI = &azFuture 2724 future.Result = future.result 2725 return nil 2726} 2727 2728// result is the default implementation for DevicesScanForUpdatesFuture.Result. 2729func (future *DevicesScanForUpdatesFuture) result(client DevicesClient) (ar autorest.Response, err error) { 2730 var done bool 2731 done, err = future.DoneWithContext(context.Background(), client) 2732 if err != nil { 2733 err = autorest.NewErrorWithError(err, "databoxedge.DevicesScanForUpdatesFuture", "Result", future.Response(), "Polling failure") 2734 return 2735 } 2736 if !done { 2737 ar.Response = future.Response() 2738 err = azure.NewAsyncOpIncompleteError("databoxedge.DevicesScanForUpdatesFuture") 2739 return 2740 } 2741 ar.Response = future.Response() 2742 return 2743} 2744 2745// EdgeProfile details about Edge Profile for the resource 2746type EdgeProfile struct { 2747 // Subscription - Edge Profile Subscription 2748 Subscription *EdgeProfileSubscription `json:"subscription,omitempty"` 2749} 2750 2751// EdgeProfilePatch the Data Box Edge/Gateway Edge Profile patch. 2752type EdgeProfilePatch struct { 2753 // Subscription - The Data Box Edge/Gateway Edge Profile Subscription patch 2754 Subscription *EdgeProfileSubscriptionPatch `json:"subscription,omitempty"` 2755} 2756 2757// EdgeProfileSubscription subscription details for the Edge Profile 2758type EdgeProfileSubscription struct { 2759 // RegistrationID - Edge Subscription Registration ID 2760 RegistrationID *string `json:"registrationId,omitempty"` 2761 // ID - ARM ID of the subscription 2762 ID *string `json:"id,omitempty"` 2763 // State - Possible values include: 'Registered', 'Warned', 'Suspended', 'Deleted', 'Unregistered' 2764 State SubscriptionState `json:"state,omitempty"` 2765 RegistrationDate *string `json:"registrationDate,omitempty"` 2766 SubscriptionID *string `json:"subscriptionId,omitempty"` 2767 *SubscriptionProperties `json:"properties,omitempty"` 2768} 2769 2770// MarshalJSON is the custom marshaler for EdgeProfileSubscription. 2771func (eps EdgeProfileSubscription) MarshalJSON() ([]byte, error) { 2772 objectMap := make(map[string]interface{}) 2773 if eps.RegistrationID != nil { 2774 objectMap["registrationId"] = eps.RegistrationID 2775 } 2776 if eps.ID != nil { 2777 objectMap["id"] = eps.ID 2778 } 2779 if eps.State != "" { 2780 objectMap["state"] = eps.State 2781 } 2782 if eps.RegistrationDate != nil { 2783 objectMap["registrationDate"] = eps.RegistrationDate 2784 } 2785 if eps.SubscriptionID != nil { 2786 objectMap["subscriptionId"] = eps.SubscriptionID 2787 } 2788 if eps.SubscriptionProperties != nil { 2789 objectMap["properties"] = eps.SubscriptionProperties 2790 } 2791 return json.Marshal(objectMap) 2792} 2793 2794// UnmarshalJSON is the custom unmarshaler for EdgeProfileSubscription struct. 2795func (eps *EdgeProfileSubscription) UnmarshalJSON(body []byte) error { 2796 var m map[string]*json.RawMessage 2797 err := json.Unmarshal(body, &m) 2798 if err != nil { 2799 return err 2800 } 2801 for k, v := range m { 2802 switch k { 2803 case "registrationId": 2804 if v != nil { 2805 var registrationID string 2806 err = json.Unmarshal(*v, ®istrationID) 2807 if err != nil { 2808 return err 2809 } 2810 eps.RegistrationID = ®istrationID 2811 } 2812 case "id": 2813 if v != nil { 2814 var ID string 2815 err = json.Unmarshal(*v, &ID) 2816 if err != nil { 2817 return err 2818 } 2819 eps.ID = &ID 2820 } 2821 case "state": 2822 if v != nil { 2823 var state SubscriptionState 2824 err = json.Unmarshal(*v, &state) 2825 if err != nil { 2826 return err 2827 } 2828 eps.State = state 2829 } 2830 case "registrationDate": 2831 if v != nil { 2832 var registrationDate string 2833 err = json.Unmarshal(*v, ®istrationDate) 2834 if err != nil { 2835 return err 2836 } 2837 eps.RegistrationDate = ®istrationDate 2838 } 2839 case "subscriptionId": 2840 if v != nil { 2841 var subscriptionID string 2842 err = json.Unmarshal(*v, &subscriptionID) 2843 if err != nil { 2844 return err 2845 } 2846 eps.SubscriptionID = &subscriptionID 2847 } 2848 case "properties": 2849 if v != nil { 2850 var subscriptionProperties SubscriptionProperties 2851 err = json.Unmarshal(*v, &subscriptionProperties) 2852 if err != nil { 2853 return err 2854 } 2855 eps.SubscriptionProperties = &subscriptionProperties 2856 } 2857 } 2858 } 2859 2860 return nil 2861} 2862 2863// EdgeProfileSubscriptionPatch the Data Box Edge/Gateway Edge Profile Subscription patch. 2864type EdgeProfileSubscriptionPatch struct { 2865 // ID - The path ID that uniquely identifies the subscription of the edge profile. 2866 ID *string `json:"id,omitempty"` 2867} 2868 2869// EtcdInfo etcd configuration 2870type EtcdInfo struct { 2871 // Type - READ-ONLY; Etcd type 2872 Type *string `json:"type,omitempty"` 2873 // Version - READ-ONLY; Etcd version 2874 Version *string `json:"version,omitempty"` 2875} 2876 2877// MarshalJSON is the custom marshaler for EtcdInfo. 2878func (ei EtcdInfo) MarshalJSON() ([]byte, error) { 2879 objectMap := make(map[string]interface{}) 2880 return json.Marshal(objectMap) 2881} 2882 2883// FileEventTrigger trigger details. 2884type FileEventTrigger struct { 2885 // FileTriggerProperties - File trigger properties. 2886 *FileTriggerProperties `json:"properties,omitempty"` 2887 // SystemData - Trigger in DataBoxEdge Resource 2888 SystemData *SystemData `json:"systemData,omitempty"` 2889 // ID - READ-ONLY; The path ID that uniquely identifies the object. 2890 ID *string `json:"id,omitempty"` 2891 // Name - READ-ONLY; The object name. 2892 Name *string `json:"name,omitempty"` 2893 // Type - READ-ONLY; The hierarchical type of the object. 2894 Type *string `json:"type,omitempty"` 2895 // Kind - Possible values include: 'KindTrigger', 'KindFileEvent', 'KindPeriodicTimerEvent' 2896 Kind KindBasicTrigger `json:"kind,omitempty"` 2897} 2898 2899// MarshalJSON is the custom marshaler for FileEventTrigger. 2900func (fet FileEventTrigger) MarshalJSON() ([]byte, error) { 2901 fet.Kind = KindFileEvent 2902 objectMap := make(map[string]interface{}) 2903 if fet.FileTriggerProperties != nil { 2904 objectMap["properties"] = fet.FileTriggerProperties 2905 } 2906 if fet.SystemData != nil { 2907 objectMap["systemData"] = fet.SystemData 2908 } 2909 if fet.Kind != "" { 2910 objectMap["kind"] = fet.Kind 2911 } 2912 return json.Marshal(objectMap) 2913} 2914 2915// AsFileEventTrigger is the BasicTrigger implementation for FileEventTrigger. 2916func (fet FileEventTrigger) AsFileEventTrigger() (*FileEventTrigger, bool) { 2917 return &fet, true 2918} 2919 2920// AsPeriodicTimerEventTrigger is the BasicTrigger implementation for FileEventTrigger. 2921func (fet FileEventTrigger) AsPeriodicTimerEventTrigger() (*PeriodicTimerEventTrigger, bool) { 2922 return nil, false 2923} 2924 2925// AsTrigger is the BasicTrigger implementation for FileEventTrigger. 2926func (fet FileEventTrigger) AsTrigger() (*Trigger, bool) { 2927 return nil, false 2928} 2929 2930// AsBasicTrigger is the BasicTrigger implementation for FileEventTrigger. 2931func (fet FileEventTrigger) AsBasicTrigger() (BasicTrigger, bool) { 2932 return &fet, true 2933} 2934 2935// UnmarshalJSON is the custom unmarshaler for FileEventTrigger struct. 2936func (fet *FileEventTrigger) UnmarshalJSON(body []byte) error { 2937 var m map[string]*json.RawMessage 2938 err := json.Unmarshal(body, &m) 2939 if err != nil { 2940 return err 2941 } 2942 for k, v := range m { 2943 switch k { 2944 case "properties": 2945 if v != nil { 2946 var fileTriggerProperties FileTriggerProperties 2947 err = json.Unmarshal(*v, &fileTriggerProperties) 2948 if err != nil { 2949 return err 2950 } 2951 fet.FileTriggerProperties = &fileTriggerProperties 2952 } 2953 case "systemData": 2954 if v != nil { 2955 var systemData SystemData 2956 err = json.Unmarshal(*v, &systemData) 2957 if err != nil { 2958 return err 2959 } 2960 fet.SystemData = &systemData 2961 } 2962 case "kind": 2963 if v != nil { 2964 var kind KindBasicTrigger 2965 err = json.Unmarshal(*v, &kind) 2966 if err != nil { 2967 return err 2968 } 2969 fet.Kind = kind 2970 } 2971 case "id": 2972 if v != nil { 2973 var ID string 2974 err = json.Unmarshal(*v, &ID) 2975 if err != nil { 2976 return err 2977 } 2978 fet.ID = &ID 2979 } 2980 case "name": 2981 if v != nil { 2982 var name string 2983 err = json.Unmarshal(*v, &name) 2984 if err != nil { 2985 return err 2986 } 2987 fet.Name = &name 2988 } 2989 case "type": 2990 if v != nil { 2991 var typeVar string 2992 err = json.Unmarshal(*v, &typeVar) 2993 if err != nil { 2994 return err 2995 } 2996 fet.Type = &typeVar 2997 } 2998 } 2999 } 3000 3001 return nil 3002} 3003 3004// FileSourceInfo file source details. 3005type FileSourceInfo struct { 3006 // ShareID - File share ID. 3007 ShareID *string `json:"shareId,omitempty"` 3008} 3009 3010// FileTriggerProperties file trigger properties. 3011type FileTriggerProperties struct { 3012 // SourceInfo - File event source details. 3013 SourceInfo *FileSourceInfo `json:"sourceInfo,omitempty"` 3014 // SinkInfo - Role sink info. 3015 SinkInfo *RoleSinkInfo `json:"sinkInfo,omitempty"` 3016 // CustomContextTag - A custom context tag typically used to correlate the trigger against its usage. For example, if a periodic timer trigger is intended for certain specific IoT modules in the device, the tag can be the name or the image URL of the module. 3017 CustomContextTag *string `json:"customContextTag,omitempty"` 3018} 3019 3020// GenerateCertResponse used in activation key generation flow. 3021type GenerateCertResponse struct { 3022 autorest.Response `json:"-"` 3023 // PublicKey - Gets or sets base64 encoded certificate raw data, 3024 // this is the public part needed to be uploaded to cert vault 3025 PublicKey *string `json:"publicKey,omitempty"` 3026 // PrivateKey - Gets or sets base64 encoded private part of the certificate, 3027 // needed to form the activation key 3028 PrivateKey *string `json:"privateKey,omitempty"` 3029 // ExpiryTimeInUTC - Gets or sets expiry time in UTC 3030 ExpiryTimeInUTC *string `json:"expiryTimeInUTC,omitempty"` 3031} 3032 3033// ImageRepositoryCredential image repository credential. 3034type ImageRepositoryCredential struct { 3035 // ImageRepositoryURL - Image repository url (e.g.: mcr.microsoft.com). 3036 ImageRepositoryURL *string `json:"imageRepositoryUrl,omitempty"` 3037 // UserName - Repository user name. 3038 UserName *string `json:"userName,omitempty"` 3039 // Password - Repository user password. 3040 Password *AsymmetricEncryptedSecret `json:"password,omitempty"` 3041} 3042 3043// IoTAddon ioT Addon. 3044type IoTAddon struct { 3045 // IoTAddonProperties - Properties specific to IOT addon. 3046 *IoTAddonProperties `json:"properties,omitempty"` 3047 // SystemData - Addon type 3048 SystemData *SystemData `json:"systemData,omitempty"` 3049 // Kind - Possible values include: 'KindAddon', 'KindArcForKubernetes', 'KindIotEdge' 3050 Kind Kind `json:"kind,omitempty"` 3051 // ID - READ-ONLY; The path ID that uniquely identifies the object. 3052 ID *string `json:"id,omitempty"` 3053 // Name - READ-ONLY; The object name. 3054 Name *string `json:"name,omitempty"` 3055 // Type - READ-ONLY; The hierarchical type of the object. 3056 Type *string `json:"type,omitempty"` 3057} 3058 3059// MarshalJSON is the custom marshaler for IoTAddon. 3060func (ita IoTAddon) MarshalJSON() ([]byte, error) { 3061 ita.Kind = KindIotEdge 3062 objectMap := make(map[string]interface{}) 3063 if ita.IoTAddonProperties != nil { 3064 objectMap["properties"] = ita.IoTAddonProperties 3065 } 3066 if ita.SystemData != nil { 3067 objectMap["systemData"] = ita.SystemData 3068 } 3069 if ita.Kind != "" { 3070 objectMap["kind"] = ita.Kind 3071 } 3072 return json.Marshal(objectMap) 3073} 3074 3075// AsArcAddon is the BasicAddon implementation for IoTAddon. 3076func (ita IoTAddon) AsArcAddon() (*ArcAddon, bool) { 3077 return nil, false 3078} 3079 3080// AsIoTAddon is the BasicAddon implementation for IoTAddon. 3081func (ita IoTAddon) AsIoTAddon() (*IoTAddon, bool) { 3082 return &ita, true 3083} 3084 3085// AsAddon is the BasicAddon implementation for IoTAddon. 3086func (ita IoTAddon) AsAddon() (*Addon, bool) { 3087 return nil, false 3088} 3089 3090// AsBasicAddon is the BasicAddon implementation for IoTAddon. 3091func (ita IoTAddon) AsBasicAddon() (BasicAddon, bool) { 3092 return &ita, true 3093} 3094 3095// UnmarshalJSON is the custom unmarshaler for IoTAddon struct. 3096func (ita *IoTAddon) UnmarshalJSON(body []byte) error { 3097 var m map[string]*json.RawMessage 3098 err := json.Unmarshal(body, &m) 3099 if err != nil { 3100 return err 3101 } 3102 for k, v := range m { 3103 switch k { 3104 case "properties": 3105 if v != nil { 3106 var ioTAddonProperties IoTAddonProperties 3107 err = json.Unmarshal(*v, &ioTAddonProperties) 3108 if err != nil { 3109 return err 3110 } 3111 ita.IoTAddonProperties = &ioTAddonProperties 3112 } 3113 case "systemData": 3114 if v != nil { 3115 var systemData SystemData 3116 err = json.Unmarshal(*v, &systemData) 3117 if err != nil { 3118 return err 3119 } 3120 ita.SystemData = &systemData 3121 } 3122 case "kind": 3123 if v != nil { 3124 var kind Kind 3125 err = json.Unmarshal(*v, &kind) 3126 if err != nil { 3127 return err 3128 } 3129 ita.Kind = kind 3130 } 3131 case "id": 3132 if v != nil { 3133 var ID string 3134 err = json.Unmarshal(*v, &ID) 3135 if err != nil { 3136 return err 3137 } 3138 ita.ID = &ID 3139 } 3140 case "name": 3141 if v != nil { 3142 var name string 3143 err = json.Unmarshal(*v, &name) 3144 if err != nil { 3145 return err 3146 } 3147 ita.Name = &name 3148 } 3149 case "type": 3150 if v != nil { 3151 var typeVar string 3152 err = json.Unmarshal(*v, &typeVar) 3153 if err != nil { 3154 return err 3155 } 3156 ita.Type = &typeVar 3157 } 3158 } 3159 } 3160 3161 return nil 3162} 3163 3164// IoTAddonProperties ioT addon properties. 3165type IoTAddonProperties struct { 3166 // IoTDeviceDetails - IoT device metadata to which appliance needs to be connected. 3167 IoTDeviceDetails *IoTDeviceInfo `json:"ioTDeviceDetails,omitempty"` 3168 // IoTEdgeDeviceDetails - IoT edge device to which the IoT Addon needs to be configured. 3169 IoTEdgeDeviceDetails *IoTDeviceInfo `json:"ioTEdgeDeviceDetails,omitempty"` 3170 // Version - READ-ONLY; Version of IoT running on the appliance. 3171 Version *string `json:"version,omitempty"` 3172 // HostPlatform - READ-ONLY; Host OS supported by the IoT addon. Possible values include: 'Windows', 'Linux' 3173 HostPlatform PlatformType `json:"hostPlatform,omitempty"` 3174 // HostPlatformType - READ-ONLY; Platform where the runtime is hosted. Possible values include: 'KubernetesCluster', 'LinuxVM' 3175 HostPlatformType HostPlatformType `json:"hostPlatformType,omitempty"` 3176 // ProvisioningState - READ-ONLY; Addon Provisioning State. Possible values include: 'Invalid', 'Creating', 'Created', 'Updating', 'Reconfiguring', 'Failed', 'Deleting' 3177 ProvisioningState AddonState `json:"provisioningState,omitempty"` 3178} 3179 3180// MarshalJSON is the custom marshaler for IoTAddonProperties. 3181func (itap IoTAddonProperties) MarshalJSON() ([]byte, error) { 3182 objectMap := make(map[string]interface{}) 3183 if itap.IoTDeviceDetails != nil { 3184 objectMap["ioTDeviceDetails"] = itap.IoTDeviceDetails 3185 } 3186 if itap.IoTEdgeDeviceDetails != nil { 3187 objectMap["ioTEdgeDeviceDetails"] = itap.IoTEdgeDeviceDetails 3188 } 3189 return json.Marshal(objectMap) 3190} 3191 3192// IoTDeviceInfo metadata of IoT device/IoT Edge device to be configured. 3193type IoTDeviceInfo struct { 3194 // DeviceID - ID of the IoT device/edge device. 3195 DeviceID *string `json:"deviceId,omitempty"` 3196 // IoTHostHub - Host name for the IoT hub associated to the device. 3197 IoTHostHub *string `json:"ioTHostHub,omitempty"` 3198 // IoTHostHubID - Id for the IoT hub associated to the device. 3199 IoTHostHubID *string `json:"ioTHostHubId,omitempty"` 3200 // Authentication - Encrypted IoT device/IoT edge device connection string. 3201 Authentication *Authentication `json:"authentication,omitempty"` 3202} 3203 3204// IoTEdgeAgentInfo ioT edge agent details is optional, this will be used for download system Agent module 3205// while bootstrapping IoT Role if specified. 3206type IoTEdgeAgentInfo struct { 3207 // ImageName - Name of the IoT edge agent image. 3208 ImageName *string `json:"imageName,omitempty"` 3209 // Tag - Image Tag. 3210 Tag *string `json:"tag,omitempty"` 3211 // ImageRepository - Image repository details. 3212 ImageRepository *ImageRepositoryCredential `json:"imageRepository,omitempty"` 3213} 3214 3215// IoTRole compute role. 3216type IoTRole struct { 3217 // IoTRoleProperties - Properties specific to IoT role. 3218 *IoTRoleProperties `json:"properties,omitempty"` 3219 // SystemData - Role configured on ASE resource 3220 SystemData *SystemData `json:"systemData,omitempty"` 3221 // Kind - Possible values include: 'KindRole', 'KindCloudEdgeManagement', 'KindIOT', 'KindKubernetes', 'KindMEC' 3222 Kind KindBasicRole `json:"kind,omitempty"` 3223 // ID - READ-ONLY; The path ID that uniquely identifies the object. 3224 ID *string `json:"id,omitempty"` 3225 // Name - READ-ONLY; The object name. 3226 Name *string `json:"name,omitempty"` 3227 // Type - READ-ONLY; The hierarchical type of the object. 3228 Type *string `json:"type,omitempty"` 3229} 3230 3231// MarshalJSON is the custom marshaler for IoTRole. 3232func (itr IoTRole) MarshalJSON() ([]byte, error) { 3233 itr.Kind = KindIOT 3234 objectMap := make(map[string]interface{}) 3235 if itr.IoTRoleProperties != nil { 3236 objectMap["properties"] = itr.IoTRoleProperties 3237 } 3238 if itr.SystemData != nil { 3239 objectMap["systemData"] = itr.SystemData 3240 } 3241 if itr.Kind != "" { 3242 objectMap["kind"] = itr.Kind 3243 } 3244 return json.Marshal(objectMap) 3245} 3246 3247// AsCloudEdgeManagementRole is the BasicRole implementation for IoTRole. 3248func (itr IoTRole) AsCloudEdgeManagementRole() (*CloudEdgeManagementRole, bool) { 3249 return nil, false 3250} 3251 3252// AsIoTRole is the BasicRole implementation for IoTRole. 3253func (itr IoTRole) AsIoTRole() (*IoTRole, bool) { 3254 return &itr, true 3255} 3256 3257// AsKubernetesRole is the BasicRole implementation for IoTRole. 3258func (itr IoTRole) AsKubernetesRole() (*KubernetesRole, bool) { 3259 return nil, false 3260} 3261 3262// AsMECRole is the BasicRole implementation for IoTRole. 3263func (itr IoTRole) AsMECRole() (*MECRole, bool) { 3264 return nil, false 3265} 3266 3267// AsRole is the BasicRole implementation for IoTRole. 3268func (itr IoTRole) AsRole() (*Role, bool) { 3269 return nil, false 3270} 3271 3272// AsBasicRole is the BasicRole implementation for IoTRole. 3273func (itr IoTRole) AsBasicRole() (BasicRole, bool) { 3274 return &itr, true 3275} 3276 3277// UnmarshalJSON is the custom unmarshaler for IoTRole struct. 3278func (itr *IoTRole) UnmarshalJSON(body []byte) error { 3279 var m map[string]*json.RawMessage 3280 err := json.Unmarshal(body, &m) 3281 if err != nil { 3282 return err 3283 } 3284 for k, v := range m { 3285 switch k { 3286 case "properties": 3287 if v != nil { 3288 var ioTRoleProperties IoTRoleProperties 3289 err = json.Unmarshal(*v, &ioTRoleProperties) 3290 if err != nil { 3291 return err 3292 } 3293 itr.IoTRoleProperties = &ioTRoleProperties 3294 } 3295 case "systemData": 3296 if v != nil { 3297 var systemData SystemData 3298 err = json.Unmarshal(*v, &systemData) 3299 if err != nil { 3300 return err 3301 } 3302 itr.SystemData = &systemData 3303 } 3304 case "kind": 3305 if v != nil { 3306 var kind KindBasicRole 3307 err = json.Unmarshal(*v, &kind) 3308 if err != nil { 3309 return err 3310 } 3311 itr.Kind = kind 3312 } 3313 case "id": 3314 if v != nil { 3315 var ID string 3316 err = json.Unmarshal(*v, &ID) 3317 if err != nil { 3318 return err 3319 } 3320 itr.ID = &ID 3321 } 3322 case "name": 3323 if v != nil { 3324 var name string 3325 err = json.Unmarshal(*v, &name) 3326 if err != nil { 3327 return err 3328 } 3329 itr.Name = &name 3330 } 3331 case "type": 3332 if v != nil { 3333 var typeVar string 3334 err = json.Unmarshal(*v, &typeVar) 3335 if err != nil { 3336 return err 3337 } 3338 itr.Type = &typeVar 3339 } 3340 } 3341 } 3342 3343 return nil 3344} 3345 3346// IoTRoleProperties ioT role properties. 3347type IoTRoleProperties struct { 3348 // HostPlatform - Host OS supported by the IoT role. Possible values include: 'Windows', 'Linux' 3349 HostPlatform PlatformType `json:"hostPlatform,omitempty"` 3350 // IoTDeviceDetails - IoT device metadata to which data box edge device needs to be connected. 3351 IoTDeviceDetails *IoTDeviceInfo `json:"ioTDeviceDetails,omitempty"` 3352 // IoTEdgeDeviceDetails - IoT edge device to which the IoT role needs to be configured. 3353 IoTEdgeDeviceDetails *IoTDeviceInfo `json:"ioTEdgeDeviceDetails,omitempty"` 3354 // ShareMappings - Mount points of shares in role(s). 3355 ShareMappings *[]MountPointMap `json:"shareMappings,omitempty"` 3356 // IoTEdgeAgentInfo - Iot edge agent details to download the agent and bootstrap iot runtime. 3357 IoTEdgeAgentInfo *IoTEdgeAgentInfo `json:"ioTEdgeAgentInfo,omitempty"` 3358 // HostPlatformType - READ-ONLY; Platform where the Iot runtime is hosted. Possible values include: 'KubernetesCluster', 'LinuxVM' 3359 HostPlatformType HostPlatformType `json:"hostPlatformType,omitempty"` 3360 // ComputeResource - Resource allocation 3361 ComputeResource *ComputeResource `json:"computeResource,omitempty"` 3362 // RoleStatus - Role status. Possible values include: 'RoleStatusEnabled', 'RoleStatusDisabled' 3363 RoleStatus RoleStatus `json:"roleStatus,omitempty"` 3364} 3365 3366// MarshalJSON is the custom marshaler for IoTRoleProperties. 3367func (itrp IoTRoleProperties) MarshalJSON() ([]byte, error) { 3368 objectMap := make(map[string]interface{}) 3369 if itrp.HostPlatform != "" { 3370 objectMap["hostPlatform"] = itrp.HostPlatform 3371 } 3372 if itrp.IoTDeviceDetails != nil { 3373 objectMap["ioTDeviceDetails"] = itrp.IoTDeviceDetails 3374 } 3375 if itrp.IoTEdgeDeviceDetails != nil { 3376 objectMap["ioTEdgeDeviceDetails"] = itrp.IoTEdgeDeviceDetails 3377 } 3378 if itrp.ShareMappings != nil { 3379 objectMap["shareMappings"] = itrp.ShareMappings 3380 } 3381 if itrp.IoTEdgeAgentInfo != nil { 3382 objectMap["ioTEdgeAgentInfo"] = itrp.IoTEdgeAgentInfo 3383 } 3384 if itrp.ComputeResource != nil { 3385 objectMap["computeResource"] = itrp.ComputeResource 3386 } 3387 if itrp.RoleStatus != "" { 3388 objectMap["roleStatus"] = itrp.RoleStatus 3389 } 3390 return json.Marshal(objectMap) 3391} 3392 3393// Ipv4Config details related to the IPv4 address configuration. 3394type Ipv4Config struct { 3395 // IPAddress - READ-ONLY; The IPv4 address of the network adapter. 3396 IPAddress *string `json:"ipAddress,omitempty"` 3397 // Subnet - READ-ONLY; The IPv4 subnet of the network adapter. 3398 Subnet *string `json:"subnet,omitempty"` 3399 // Gateway - READ-ONLY; The IPv4 gateway of the network adapter. 3400 Gateway *string `json:"gateway,omitempty"` 3401} 3402 3403// MarshalJSON is the custom marshaler for Ipv4Config. 3404func (i4c Ipv4Config) MarshalJSON() ([]byte, error) { 3405 objectMap := make(map[string]interface{}) 3406 return json.Marshal(objectMap) 3407} 3408 3409// Ipv6Config details related to the IPv6 address configuration. 3410type Ipv6Config struct { 3411 // IPAddress - READ-ONLY; The IPv6 address of the network adapter. 3412 IPAddress *string `json:"ipAddress,omitempty"` 3413 // PrefixLength - READ-ONLY; The IPv6 prefix of the network adapter. 3414 PrefixLength *int32 `json:"prefixLength,omitempty"` 3415 // Gateway - READ-ONLY; The IPv6 gateway of the network adapter. 3416 Gateway *string `json:"gateway,omitempty"` 3417} 3418 3419// MarshalJSON is the custom marshaler for Ipv6Config. 3420func (i6c Ipv6Config) MarshalJSON() ([]byte, error) { 3421 objectMap := make(map[string]interface{}) 3422 return json.Marshal(objectMap) 3423} 3424 3425// Job a device job. 3426type Job struct { 3427 autorest.Response `json:"-"` 3428 // ID - READ-ONLY; The path ID that uniquely identifies the object. 3429 ID *string `json:"id,omitempty"` 3430 // Name - READ-ONLY; The name of the object. 3431 Name *string `json:"name,omitempty"` 3432 // Type - READ-ONLY; The hierarchical type of the object. 3433 Type *string `json:"type,omitempty"` 3434 // Status - READ-ONLY; The current status of the job. Possible values include: 'JobStatusInvalid', 'JobStatusRunning', 'JobStatusSucceeded', 'JobStatusFailed', 'JobStatusCanceled', 'JobStatusPaused', 'JobStatusScheduled' 3435 Status JobStatus `json:"status,omitempty"` 3436 // StartTime - READ-ONLY; The UTC date and time at which the job started. 3437 StartTime *date.Time `json:"startTime,omitempty"` 3438 // EndTime - READ-ONLY; The UTC date and time at which the job completed. 3439 EndTime *date.Time `json:"endTime,omitempty"` 3440 // PercentComplete - READ-ONLY; The percentage of the job that is complete. 3441 PercentComplete *int32 `json:"percentComplete,omitempty"` 3442 // Error - READ-ONLY; The error details. 3443 Error *JobErrorDetails `json:"error,omitempty"` 3444 // JobProperties - READ-ONLY; The properties of the job. 3445 *JobProperties `json:"properties,omitempty"` 3446} 3447 3448// MarshalJSON is the custom marshaler for Job. 3449func (j Job) MarshalJSON() ([]byte, error) { 3450 objectMap := make(map[string]interface{}) 3451 return json.Marshal(objectMap) 3452} 3453 3454// UnmarshalJSON is the custom unmarshaler for Job struct. 3455func (j *Job) UnmarshalJSON(body []byte) error { 3456 var m map[string]*json.RawMessage 3457 err := json.Unmarshal(body, &m) 3458 if err != nil { 3459 return err 3460 } 3461 for k, v := range m { 3462 switch k { 3463 case "id": 3464 if v != nil { 3465 var ID string 3466 err = json.Unmarshal(*v, &ID) 3467 if err != nil { 3468 return err 3469 } 3470 j.ID = &ID 3471 } 3472 case "name": 3473 if v != nil { 3474 var name string 3475 err = json.Unmarshal(*v, &name) 3476 if err != nil { 3477 return err 3478 } 3479 j.Name = &name 3480 } 3481 case "type": 3482 if v != nil { 3483 var typeVar string 3484 err = json.Unmarshal(*v, &typeVar) 3485 if err != nil { 3486 return err 3487 } 3488 j.Type = &typeVar 3489 } 3490 case "status": 3491 if v != nil { 3492 var status JobStatus 3493 err = json.Unmarshal(*v, &status) 3494 if err != nil { 3495 return err 3496 } 3497 j.Status = status 3498 } 3499 case "startTime": 3500 if v != nil { 3501 var startTime date.Time 3502 err = json.Unmarshal(*v, &startTime) 3503 if err != nil { 3504 return err 3505 } 3506 j.StartTime = &startTime 3507 } 3508 case "endTime": 3509 if v != nil { 3510 var endTime date.Time 3511 err = json.Unmarshal(*v, &endTime) 3512 if err != nil { 3513 return err 3514 } 3515 j.EndTime = &endTime 3516 } 3517 case "percentComplete": 3518 if v != nil { 3519 var percentComplete int32 3520 err = json.Unmarshal(*v, &percentComplete) 3521 if err != nil { 3522 return err 3523 } 3524 j.PercentComplete = &percentComplete 3525 } 3526 case "error": 3527 if v != nil { 3528 var errorVar JobErrorDetails 3529 err = json.Unmarshal(*v, &errorVar) 3530 if err != nil { 3531 return err 3532 } 3533 j.Error = &errorVar 3534 } 3535 case "properties": 3536 if v != nil { 3537 var jobProperties JobProperties 3538 err = json.Unmarshal(*v, &jobProperties) 3539 if err != nil { 3540 return err 3541 } 3542 j.JobProperties = &jobProperties 3543 } 3544 } 3545 } 3546 3547 return nil 3548} 3549 3550// JobErrorDetails the job error information containing the list of job errors. 3551type JobErrorDetails struct { 3552 // ErrorDetails - READ-ONLY; The error details. 3553 ErrorDetails *[]JobErrorItem `json:"errorDetails,omitempty"` 3554 // Code - READ-ONLY; The code intended for programmatic access. 3555 Code *string `json:"code,omitempty"` 3556 // Message - READ-ONLY; The message that describes the error in detail. 3557 Message *string `json:"message,omitempty"` 3558} 3559 3560// MarshalJSON is the custom marshaler for JobErrorDetails. 3561func (jed JobErrorDetails) MarshalJSON() ([]byte, error) { 3562 objectMap := make(map[string]interface{}) 3563 return json.Marshal(objectMap) 3564} 3565 3566// JobErrorItem the job error items. 3567type JobErrorItem struct { 3568 // Recommendations - READ-ONLY; The recommended actions. 3569 Recommendations *[]string `json:"recommendations,omitempty"` 3570 // Code - READ-ONLY; The code intended for programmatic access. 3571 Code *string `json:"code,omitempty"` 3572 // Message - READ-ONLY; The message that describes the error in detail. 3573 Message *string `json:"message,omitempty"` 3574} 3575 3576// MarshalJSON is the custom marshaler for JobErrorItem. 3577func (jei JobErrorItem) MarshalJSON() ([]byte, error) { 3578 objectMap := make(map[string]interface{}) 3579 return json.Marshal(objectMap) 3580} 3581 3582// JobProperties the properties for the job. 3583type JobProperties struct { 3584 // JobType - READ-ONLY; The type of the job. Possible values include: 'JobTypeInvalid', 'JobTypeScanForUpdates', 'JobTypeDownloadUpdates', 'JobTypeInstallUpdates', 'JobTypeRefreshShare', 'JobTypeRefreshContainer', 'JobTypeBackup', 'JobTypeRestore', 'JobTypeTriggerSupportPackage' 3585 JobType JobType `json:"jobType,omitempty"` 3586 // CurrentStage - READ-ONLY; Current stage of the update operation. Possible values include: 'UpdateOperationStageUnknown', 'UpdateOperationStageInitial', 'UpdateOperationStageScanStarted', 'UpdateOperationStageScanComplete', 'UpdateOperationStageScanFailed', 'UpdateOperationStageDownloadStarted', 'UpdateOperationStageDownloadComplete', 'UpdateOperationStageDownloadFailed', 'UpdateOperationStageInstallStarted', 'UpdateOperationStageInstallComplete', 'UpdateOperationStageInstallFailed', 'UpdateOperationStageRebootInitiated', 'UpdateOperationStageSuccess', 'UpdateOperationStageFailure', 'UpdateOperationStageRescanStarted', 'UpdateOperationStageRescanComplete', 'UpdateOperationStageRescanFailed' 3587 CurrentStage UpdateOperationStage `json:"currentStage,omitempty"` 3588 // DownloadProgress - READ-ONLY; The download progress. 3589 DownloadProgress *UpdateDownloadProgress `json:"downloadProgress,omitempty"` 3590 // InstallProgress - READ-ONLY; The install progress. 3591 InstallProgress *UpdateInstallProgress `json:"installProgress,omitempty"` 3592 // TotalRefreshErrors - READ-ONLY; Total number of errors encountered during the refresh process. 3593 TotalRefreshErrors *int32 `json:"totalRefreshErrors,omitempty"` 3594 // ErrorManifestFile - READ-ONLY; Local share/remote container relative path to the error manifest file of the refresh. 3595 ErrorManifestFile *string `json:"errorManifestFile,omitempty"` 3596 // RefreshedEntityID - READ-ONLY; ARM ID of the entity that was refreshed. 3597 RefreshedEntityID *string `json:"refreshedEntityId,omitempty"` 3598 // Folder - If only subfolders need to be refreshed, then the subfolder path inside the share or container. (The path is empty if there are no subfolders.) 3599 Folder *string `json:"folder,omitempty"` 3600} 3601 3602// MarshalJSON is the custom marshaler for JobProperties. 3603func (jp JobProperties) MarshalJSON() ([]byte, error) { 3604 objectMap := make(map[string]interface{}) 3605 if jp.Folder != nil { 3606 objectMap["folder"] = jp.Folder 3607 } 3608 return json.Marshal(objectMap) 3609} 3610 3611// KubernetesClusterInfo kubernetes cluster configuration 3612type KubernetesClusterInfo struct { 3613 // EtcdInfo - READ-ONLY; Etcd configuration 3614 EtcdInfo *EtcdInfo `json:"etcdInfo,omitempty"` 3615 // Nodes - READ-ONLY; Kubernetes cluster nodes 3616 Nodes *[]NodeInfo `json:"nodes,omitempty"` 3617 // Version - Kubernetes cluster version 3618 Version *string `json:"version,omitempty"` 3619} 3620 3621// MarshalJSON is the custom marshaler for KubernetesClusterInfo. 3622func (kci KubernetesClusterInfo) MarshalJSON() ([]byte, error) { 3623 objectMap := make(map[string]interface{}) 3624 if kci.Version != nil { 3625 objectMap["version"] = kci.Version 3626 } 3627 return json.Marshal(objectMap) 3628} 3629 3630// KubernetesIPConfiguration kubernetes node IP configuration 3631type KubernetesIPConfiguration struct { 3632 // Port - READ-ONLY; Port of the Kubernetes node. 3633 Port *string `json:"port,omitempty"` 3634 // IPAddress - IP address of the Kubernetes node. 3635 IPAddress *string `json:"ipAddress,omitempty"` 3636} 3637 3638// MarshalJSON is the custom marshaler for KubernetesIPConfiguration. 3639func (kic KubernetesIPConfiguration) MarshalJSON() ([]byte, error) { 3640 objectMap := make(map[string]interface{}) 3641 if kic.IPAddress != nil { 3642 objectMap["ipAddress"] = kic.IPAddress 3643 } 3644 return json.Marshal(objectMap) 3645} 3646 3647// KubernetesRole kubernetes role. 3648type KubernetesRole struct { 3649 // KubernetesRoleProperties - Properties specific to Kubernetes role. 3650 *KubernetesRoleProperties `json:"properties,omitempty"` 3651 // SystemData - Role configured on ASE resource 3652 SystemData *SystemData `json:"systemData,omitempty"` 3653 // Kind - Possible values include: 'KindRole', 'KindCloudEdgeManagement', 'KindIOT', 'KindKubernetes', 'KindMEC' 3654 Kind KindBasicRole `json:"kind,omitempty"` 3655 // ID - READ-ONLY; The path ID that uniquely identifies the object. 3656 ID *string `json:"id,omitempty"` 3657 // Name - READ-ONLY; The object name. 3658 Name *string `json:"name,omitempty"` 3659 // Type - READ-ONLY; The hierarchical type of the object. 3660 Type *string `json:"type,omitempty"` 3661} 3662 3663// MarshalJSON is the custom marshaler for KubernetesRole. 3664func (kr KubernetesRole) MarshalJSON() ([]byte, error) { 3665 kr.Kind = KindKubernetes 3666 objectMap := make(map[string]interface{}) 3667 if kr.KubernetesRoleProperties != nil { 3668 objectMap["properties"] = kr.KubernetesRoleProperties 3669 } 3670 if kr.SystemData != nil { 3671 objectMap["systemData"] = kr.SystemData 3672 } 3673 if kr.Kind != "" { 3674 objectMap["kind"] = kr.Kind 3675 } 3676 return json.Marshal(objectMap) 3677} 3678 3679// AsCloudEdgeManagementRole is the BasicRole implementation for KubernetesRole. 3680func (kr KubernetesRole) AsCloudEdgeManagementRole() (*CloudEdgeManagementRole, bool) { 3681 return nil, false 3682} 3683 3684// AsIoTRole is the BasicRole implementation for KubernetesRole. 3685func (kr KubernetesRole) AsIoTRole() (*IoTRole, bool) { 3686 return nil, false 3687} 3688 3689// AsKubernetesRole is the BasicRole implementation for KubernetesRole. 3690func (kr KubernetesRole) AsKubernetesRole() (*KubernetesRole, bool) { 3691 return &kr, true 3692} 3693 3694// AsMECRole is the BasicRole implementation for KubernetesRole. 3695func (kr KubernetesRole) AsMECRole() (*MECRole, bool) { 3696 return nil, false 3697} 3698 3699// AsRole is the BasicRole implementation for KubernetesRole. 3700func (kr KubernetesRole) AsRole() (*Role, bool) { 3701 return nil, false 3702} 3703 3704// AsBasicRole is the BasicRole implementation for KubernetesRole. 3705func (kr KubernetesRole) AsBasicRole() (BasicRole, bool) { 3706 return &kr, true 3707} 3708 3709// UnmarshalJSON is the custom unmarshaler for KubernetesRole struct. 3710func (kr *KubernetesRole) UnmarshalJSON(body []byte) error { 3711 var m map[string]*json.RawMessage 3712 err := json.Unmarshal(body, &m) 3713 if err != nil { 3714 return err 3715 } 3716 for k, v := range m { 3717 switch k { 3718 case "properties": 3719 if v != nil { 3720 var kubernetesRoleProperties KubernetesRoleProperties 3721 err = json.Unmarshal(*v, &kubernetesRoleProperties) 3722 if err != nil { 3723 return err 3724 } 3725 kr.KubernetesRoleProperties = &kubernetesRoleProperties 3726 } 3727 case "systemData": 3728 if v != nil { 3729 var systemData SystemData 3730 err = json.Unmarshal(*v, &systemData) 3731 if err != nil { 3732 return err 3733 } 3734 kr.SystemData = &systemData 3735 } 3736 case "kind": 3737 if v != nil { 3738 var kind KindBasicRole 3739 err = json.Unmarshal(*v, &kind) 3740 if err != nil { 3741 return err 3742 } 3743 kr.Kind = kind 3744 } 3745 case "id": 3746 if v != nil { 3747 var ID string 3748 err = json.Unmarshal(*v, &ID) 3749 if err != nil { 3750 return err 3751 } 3752 kr.ID = &ID 3753 } 3754 case "name": 3755 if v != nil { 3756 var name string 3757 err = json.Unmarshal(*v, &name) 3758 if err != nil { 3759 return err 3760 } 3761 kr.Name = &name 3762 } 3763 case "type": 3764 if v != nil { 3765 var typeVar string 3766 err = json.Unmarshal(*v, &typeVar) 3767 if err != nil { 3768 return err 3769 } 3770 kr.Type = &typeVar 3771 } 3772 } 3773 } 3774 3775 return nil 3776} 3777 3778// KubernetesRoleCompute kubernetes role compute resource 3779type KubernetesRoleCompute struct { 3780 // VMProfile - VM profile 3781 VMProfile *string `json:"vmProfile,omitempty"` 3782 // MemoryInBytes - READ-ONLY; Memory in bytes 3783 MemoryInBytes *int64 `json:"memoryInBytes,omitempty"` 3784 // ProcessorCount - READ-ONLY; Processor count 3785 ProcessorCount *int32 `json:"processorCount,omitempty"` 3786} 3787 3788// MarshalJSON is the custom marshaler for KubernetesRoleCompute. 3789func (krc KubernetesRoleCompute) MarshalJSON() ([]byte, error) { 3790 objectMap := make(map[string]interface{}) 3791 if krc.VMProfile != nil { 3792 objectMap["vmProfile"] = krc.VMProfile 3793 } 3794 return json.Marshal(objectMap) 3795} 3796 3797// KubernetesRoleNetwork kubernetes role network resource 3798type KubernetesRoleNetwork struct { 3799 // CniConfig - READ-ONLY; Cni configuration 3800 CniConfig *CniConfig `json:"cniConfig,omitempty"` 3801 // LoadBalancerConfig - READ-ONLY; Load balancer configuration 3802 LoadBalancerConfig *LoadBalancerConfig `json:"loadBalancerConfig,omitempty"` 3803} 3804 3805// MarshalJSON is the custom marshaler for KubernetesRoleNetwork. 3806func (krn KubernetesRoleNetwork) MarshalJSON() ([]byte, error) { 3807 objectMap := make(map[string]interface{}) 3808 return json.Marshal(objectMap) 3809} 3810 3811// KubernetesRoleProperties kubernetes role properties. 3812type KubernetesRoleProperties struct { 3813 // HostPlatform - Host OS supported by the Kubernetes role. Possible values include: 'Windows', 'Linux' 3814 HostPlatform PlatformType `json:"hostPlatform,omitempty"` 3815 // ProvisioningState - READ-ONLY; State of Kubernetes deployment. Possible values include: 'KubernetesStateInvalid', 'KubernetesStateCreating', 'KubernetesStateCreated', 'KubernetesStateUpdating', 'KubernetesStateReconfiguring', 'KubernetesStateFailed', 'KubernetesStateDeleting' 3816 ProvisioningState KubernetesState `json:"provisioningState,omitempty"` 3817 // HostPlatformType - READ-ONLY; Platform where the runtime is hosted. Possible values include: 'KubernetesCluster', 'LinuxVM' 3818 HostPlatformType HostPlatformType `json:"hostPlatformType,omitempty"` 3819 // KubernetesClusterInfo - Kubernetes cluster configuration 3820 KubernetesClusterInfo *KubernetesClusterInfo `json:"kubernetesClusterInfo,omitempty"` 3821 // KubernetesRoleResources - Kubernetes role resources 3822 KubernetesRoleResources *KubernetesRoleResources `json:"kubernetesRoleResources,omitempty"` 3823 // RoleStatus - Role status. Possible values include: 'RoleStatusEnabled', 'RoleStatusDisabled' 3824 RoleStatus RoleStatus `json:"roleStatus,omitempty"` 3825} 3826 3827// MarshalJSON is the custom marshaler for KubernetesRoleProperties. 3828func (krp KubernetesRoleProperties) MarshalJSON() ([]byte, error) { 3829 objectMap := make(map[string]interface{}) 3830 if krp.HostPlatform != "" { 3831 objectMap["hostPlatform"] = krp.HostPlatform 3832 } 3833 if krp.KubernetesClusterInfo != nil { 3834 objectMap["kubernetesClusterInfo"] = krp.KubernetesClusterInfo 3835 } 3836 if krp.KubernetesRoleResources != nil { 3837 objectMap["kubernetesRoleResources"] = krp.KubernetesRoleResources 3838 } 3839 if krp.RoleStatus != "" { 3840 objectMap["roleStatus"] = krp.RoleStatus 3841 } 3842 return json.Marshal(objectMap) 3843} 3844 3845// KubernetesRoleResources kubernetes role resources 3846type KubernetesRoleResources struct { 3847 // Storage - Kubernetes role storage resource 3848 Storage *KubernetesRoleStorage `json:"storage,omitempty"` 3849 // Compute - Kubernetes role compute resource 3850 Compute *KubernetesRoleCompute `json:"compute,omitempty"` 3851 // Network - READ-ONLY; Kubernetes role network resource 3852 Network *KubernetesRoleNetwork `json:"network,omitempty"` 3853} 3854 3855// MarshalJSON is the custom marshaler for KubernetesRoleResources. 3856func (krr KubernetesRoleResources) MarshalJSON() ([]byte, error) { 3857 objectMap := make(map[string]interface{}) 3858 if krr.Storage != nil { 3859 objectMap["storage"] = krr.Storage 3860 } 3861 if krr.Compute != nil { 3862 objectMap["compute"] = krr.Compute 3863 } 3864 return json.Marshal(objectMap) 3865} 3866 3867// KubernetesRoleStorage kubernetes role storage resource 3868type KubernetesRoleStorage struct { 3869 // StorageClasses - READ-ONLY; Kubernetes storage class info. 3870 StorageClasses *[]KubernetesRoleStorageClassInfo `json:"storageClasses,omitempty"` 3871 // Endpoints - Mount points of shares in role(s). 3872 Endpoints *[]MountPointMap `json:"endpoints,omitempty"` 3873} 3874 3875// MarshalJSON is the custom marshaler for KubernetesRoleStorage. 3876func (krs KubernetesRoleStorage) MarshalJSON() ([]byte, error) { 3877 objectMap := make(map[string]interface{}) 3878 if krs.Endpoints != nil { 3879 objectMap["endpoints"] = krs.Endpoints 3880 } 3881 return json.Marshal(objectMap) 3882} 3883 3884// KubernetesRoleStorageClassInfo kubernetes storage class info. 3885type KubernetesRoleStorageClassInfo struct { 3886 // Name - READ-ONLY; Storage class name. 3887 Name *string `json:"name,omitempty"` 3888 // Type - READ-ONLY; Storage class type. 3889 Type *string `json:"type,omitempty"` 3890 // PosixCompliant - READ-ONLY; If provisioned storage is posix compliant. Possible values include: 'PosixComplianceStatusInvalid', 'PosixComplianceStatusEnabled', 'PosixComplianceStatusDisabled' 3891 PosixCompliant PosixComplianceStatus `json:"posixCompliant,omitempty"` 3892} 3893 3894// MarshalJSON is the custom marshaler for KubernetesRoleStorageClassInfo. 3895func (krsci KubernetesRoleStorageClassInfo) MarshalJSON() ([]byte, error) { 3896 objectMap := make(map[string]interface{}) 3897 return json.Marshal(objectMap) 3898} 3899 3900// LoadBalancerConfig load balancer configuration 3901type LoadBalancerConfig struct { 3902 // Type - READ-ONLY; Load balancer type 3903 Type *string `json:"type,omitempty"` 3904 // Version - READ-ONLY; Load balancer version 3905 Version *string `json:"version,omitempty"` 3906} 3907 3908// MarshalJSON is the custom marshaler for LoadBalancerConfig. 3909func (lbc LoadBalancerConfig) MarshalJSON() ([]byte, error) { 3910 objectMap := make(map[string]interface{}) 3911 return json.Marshal(objectMap) 3912} 3913 3914// MECRole MEC role. 3915type MECRole struct { 3916 // MECRoleProperties - Properties specific to MEC role. 3917 *MECRoleProperties `json:"properties,omitempty"` 3918 // SystemData - Role configured on ASE resource 3919 SystemData *SystemData `json:"systemData,omitempty"` 3920 // Kind - Possible values include: 'KindRole', 'KindCloudEdgeManagement', 'KindIOT', 'KindKubernetes', 'KindMEC' 3921 Kind KindBasicRole `json:"kind,omitempty"` 3922 // ID - READ-ONLY; The path ID that uniquely identifies the object. 3923 ID *string `json:"id,omitempty"` 3924 // Name - READ-ONLY; The object name. 3925 Name *string `json:"name,omitempty"` 3926 // Type - READ-ONLY; The hierarchical type of the object. 3927 Type *string `json:"type,omitempty"` 3928} 3929 3930// MarshalJSON is the custom marshaler for MECRole. 3931func (mr MECRole) MarshalJSON() ([]byte, error) { 3932 mr.Kind = KindMEC 3933 objectMap := make(map[string]interface{}) 3934 if mr.MECRoleProperties != nil { 3935 objectMap["properties"] = mr.MECRoleProperties 3936 } 3937 if mr.SystemData != nil { 3938 objectMap["systemData"] = mr.SystemData 3939 } 3940 if mr.Kind != "" { 3941 objectMap["kind"] = mr.Kind 3942 } 3943 return json.Marshal(objectMap) 3944} 3945 3946// AsCloudEdgeManagementRole is the BasicRole implementation for MECRole. 3947func (mr MECRole) AsCloudEdgeManagementRole() (*CloudEdgeManagementRole, bool) { 3948 return nil, false 3949} 3950 3951// AsIoTRole is the BasicRole implementation for MECRole. 3952func (mr MECRole) AsIoTRole() (*IoTRole, bool) { 3953 return nil, false 3954} 3955 3956// AsKubernetesRole is the BasicRole implementation for MECRole. 3957func (mr MECRole) AsKubernetesRole() (*KubernetesRole, bool) { 3958 return nil, false 3959} 3960 3961// AsMECRole is the BasicRole implementation for MECRole. 3962func (mr MECRole) AsMECRole() (*MECRole, bool) { 3963 return &mr, true 3964} 3965 3966// AsRole is the BasicRole implementation for MECRole. 3967func (mr MECRole) AsRole() (*Role, bool) { 3968 return nil, false 3969} 3970 3971// AsBasicRole is the BasicRole implementation for MECRole. 3972func (mr MECRole) AsBasicRole() (BasicRole, bool) { 3973 return &mr, true 3974} 3975 3976// UnmarshalJSON is the custom unmarshaler for MECRole struct. 3977func (mr *MECRole) UnmarshalJSON(body []byte) error { 3978 var m map[string]*json.RawMessage 3979 err := json.Unmarshal(body, &m) 3980 if err != nil { 3981 return err 3982 } 3983 for k, v := range m { 3984 switch k { 3985 case "properties": 3986 if v != nil { 3987 var mECRoleProperties MECRoleProperties 3988 err = json.Unmarshal(*v, &mECRoleProperties) 3989 if err != nil { 3990 return err 3991 } 3992 mr.MECRoleProperties = &mECRoleProperties 3993 } 3994 case "systemData": 3995 if v != nil { 3996 var systemData SystemData 3997 err = json.Unmarshal(*v, &systemData) 3998 if err != nil { 3999 return err 4000 } 4001 mr.SystemData = &systemData 4002 } 4003 case "kind": 4004 if v != nil { 4005 var kind KindBasicRole 4006 err = json.Unmarshal(*v, &kind) 4007 if err != nil { 4008 return err 4009 } 4010 mr.Kind = kind 4011 } 4012 case "id": 4013 if v != nil { 4014 var ID string 4015 err = json.Unmarshal(*v, &ID) 4016 if err != nil { 4017 return err 4018 } 4019 mr.ID = &ID 4020 } 4021 case "name": 4022 if v != nil { 4023 var name string 4024 err = json.Unmarshal(*v, &name) 4025 if err != nil { 4026 return err 4027 } 4028 mr.Name = &name 4029 } 4030 case "type": 4031 if v != nil { 4032 var typeVar string 4033 err = json.Unmarshal(*v, &typeVar) 4034 if err != nil { 4035 return err 4036 } 4037 mr.Type = &typeVar 4038 } 4039 } 4040 } 4041 4042 return nil 4043} 4044 4045// MECRoleProperties MEC role properties. 4046type MECRoleProperties struct { 4047 // ConnectionString - Activation key of the MEC. 4048 ConnectionString *AsymmetricEncryptedSecret `json:"connectionString,omitempty"` 4049 // RoleStatus - Role status. Possible values include: 'RoleStatusEnabled', 'RoleStatusDisabled' 4050 RoleStatus RoleStatus `json:"roleStatus,omitempty"` 4051} 4052 4053// MetricConfiguration metric configuration. 4054type MetricConfiguration struct { 4055 // ResourceID - The Resource ID on which the metrics should be pushed. 4056 ResourceID *string `json:"resourceId,omitempty"` 4057 // MdmAccount - The MDM account to which the counters should be pushed. 4058 MdmAccount *string `json:"mdmAccount,omitempty"` 4059 // MetricNameSpace - The MDM namespace to which the counters should be pushed. This is required if MDMAccount is specified 4060 MetricNameSpace *string `json:"metricNameSpace,omitempty"` 4061 // CounterSets - Host name for the IoT hub associated to the device. 4062 CounterSets *[]MetricCounterSet `json:"counterSets,omitempty"` 4063} 4064 4065// MetricCounter the metric counter 4066type MetricCounter struct { 4067 // Name - The counter name. 4068 Name *string `json:"name,omitempty"` 4069 // Instance - The instance from which counter should be collected. 4070 Instance *string `json:"instance,omitempty"` 4071 // DimensionFilter - The dimension filter. 4072 DimensionFilter *[]MetricDimension `json:"dimensionFilter,omitempty"` 4073 // AdditionalDimensions - The additional dimensions to be added to metric. 4074 AdditionalDimensions *[]MetricDimension `json:"additionalDimensions,omitempty"` 4075} 4076 4077// MetricCounterSet the metric counter set 4078type MetricCounterSet struct { 4079 // Counters - The counters that should be collected in this set. 4080 Counters *[]MetricCounter `json:"counters,omitempty"` 4081} 4082 4083// MetricDimension the metric dimension 4084type MetricDimension struct { 4085 // SourceType - The dimension type. 4086 SourceType *string `json:"sourceType,omitempty"` 4087 // SourceName - The dimension value. 4088 SourceName *string `json:"sourceName,omitempty"` 4089} 4090 4091// MetricDimensionV1 metric Dimension v1. 4092type MetricDimensionV1 struct { 4093 // Name - Name of the metrics dimension. 4094 Name *string `json:"name,omitempty"` 4095 // DisplayName - Display name of the metrics dimension. 4096 DisplayName *string `json:"displayName,omitempty"` 4097 // ToBeExportedForShoebox - To be exported to shoe box. 4098 ToBeExportedForShoebox *bool `json:"toBeExportedForShoebox,omitempty"` 4099} 4100 4101// MetricSpecificationV1 metric specification version 1. 4102type MetricSpecificationV1 struct { 4103 // Name - Name of the metric. 4104 Name *string `json:"name,omitempty"` 4105 // DisplayName - Display name of the metric. 4106 DisplayName *string `json:"displayName,omitempty"` 4107 // DisplayDescription - Description of the metric to be displayed. 4108 DisplayDescription *string `json:"displayDescription,omitempty"` 4109 // Unit - Metric units. Possible values include: 'NotSpecified', 'Percent', 'Count', 'Seconds', 'Milliseconds', 'Bytes', 'BytesPerSecond', 'CountPerSecond' 4110 Unit MetricUnit `json:"unit,omitempty"` 4111 // AggregationType - Metric aggregation type. Possible values include: 'MetricAggregationTypeNotSpecified', 'MetricAggregationTypeNone', 'MetricAggregationTypeAverage', 'MetricAggregationTypeMinimum', 'MetricAggregationTypeMaximum', 'MetricAggregationTypeTotal', 'MetricAggregationTypeCount' 4112 AggregationType MetricAggregationType `json:"aggregationType,omitempty"` 4113 // Dimensions - Metric dimensions, other than default dimension which is resource. 4114 Dimensions *[]MetricDimensionV1 `json:"dimensions,omitempty"` 4115 // FillGapWithZero - Set true to fill the gaps with zero. 4116 FillGapWithZero *bool `json:"fillGapWithZero,omitempty"` 4117 // Category - Metric category. Possible values include: 'Capacity', 'Transaction' 4118 Category MetricCategory `json:"category,omitempty"` 4119 // ResourceIDDimensionNameOverride - Resource name override. 4120 ResourceIDDimensionNameOverride *string `json:"resourceIdDimensionNameOverride,omitempty"` 4121 // SupportedTimeGrainTypes - Support granularity of metrics. 4122 SupportedTimeGrainTypes *[]TimeGrain `json:"supportedTimeGrainTypes,omitempty"` 4123 // SupportedAggregationTypes - Support metric aggregation type. 4124 SupportedAggregationTypes *[]MetricAggregationType `json:"supportedAggregationTypes,omitempty"` 4125} 4126 4127// MonitoringConfigCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a 4128// long-running operation. 4129type MonitoringConfigCreateOrUpdateFuture struct { 4130 azure.FutureAPI 4131 // Result returns the result of the asynchronous operation. 4132 // If the operation has not completed it will return an error. 4133 Result func(MonitoringConfigClient) (MonitoringMetricConfiguration, error) 4134} 4135 4136// UnmarshalJSON is the custom unmarshaller for CreateFuture. 4137func (future *MonitoringConfigCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 4138 var azFuture azure.Future 4139 if err := json.Unmarshal(body, &azFuture); err != nil { 4140 return err 4141 } 4142 future.FutureAPI = &azFuture 4143 future.Result = future.result 4144 return nil 4145} 4146 4147// result is the default implementation for MonitoringConfigCreateOrUpdateFuture.Result. 4148func (future *MonitoringConfigCreateOrUpdateFuture) result(client MonitoringConfigClient) (mmc MonitoringMetricConfiguration, err error) { 4149 var done bool 4150 done, err = future.DoneWithContext(context.Background(), client) 4151 if err != nil { 4152 err = autorest.NewErrorWithError(err, "databoxedge.MonitoringConfigCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 4153 return 4154 } 4155 if !done { 4156 mmc.Response.Response = future.Response() 4157 err = azure.NewAsyncOpIncompleteError("databoxedge.MonitoringConfigCreateOrUpdateFuture") 4158 return 4159 } 4160 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 4161 if mmc.Response.Response, err = future.GetResult(sender); err == nil && mmc.Response.Response.StatusCode != http.StatusNoContent { 4162 mmc, err = client.CreateOrUpdateResponder(mmc.Response.Response) 4163 if err != nil { 4164 err = autorest.NewErrorWithError(err, "databoxedge.MonitoringConfigCreateOrUpdateFuture", "Result", mmc.Response.Response, "Failure responding to request") 4165 } 4166 } 4167 return 4168} 4169 4170// MonitoringConfigDeleteFuture an abstraction for monitoring and retrieving the results of a long-running 4171// operation. 4172type MonitoringConfigDeleteFuture struct { 4173 azure.FutureAPI 4174 // Result returns the result of the asynchronous operation. 4175 // If the operation has not completed it will return an error. 4176 Result func(MonitoringConfigClient) (autorest.Response, error) 4177} 4178 4179// UnmarshalJSON is the custom unmarshaller for CreateFuture. 4180func (future *MonitoringConfigDeleteFuture) UnmarshalJSON(body []byte) error { 4181 var azFuture azure.Future 4182 if err := json.Unmarshal(body, &azFuture); err != nil { 4183 return err 4184 } 4185 future.FutureAPI = &azFuture 4186 future.Result = future.result 4187 return nil 4188} 4189 4190// result is the default implementation for MonitoringConfigDeleteFuture.Result. 4191func (future *MonitoringConfigDeleteFuture) result(client MonitoringConfigClient) (ar autorest.Response, err error) { 4192 var done bool 4193 done, err = future.DoneWithContext(context.Background(), client) 4194 if err != nil { 4195 err = autorest.NewErrorWithError(err, "databoxedge.MonitoringConfigDeleteFuture", "Result", future.Response(), "Polling failure") 4196 return 4197 } 4198 if !done { 4199 ar.Response = future.Response() 4200 err = azure.NewAsyncOpIncompleteError("databoxedge.MonitoringConfigDeleteFuture") 4201 return 4202 } 4203 ar.Response = future.Response() 4204 return 4205} 4206 4207// MonitoringMetricConfiguration the metric setting details for the role 4208type MonitoringMetricConfiguration struct { 4209 autorest.Response `json:"-"` 4210 // MonitoringMetricConfigurationProperties - The metric setting properties. 4211 *MonitoringMetricConfigurationProperties `json:"properties,omitempty"` 4212 // ID - READ-ONLY; The path ID that uniquely identifies the object. 4213 ID *string `json:"id,omitempty"` 4214 // Name - READ-ONLY; The object name. 4215 Name *string `json:"name,omitempty"` 4216 // Type - READ-ONLY; The hierarchical type of the object. 4217 Type *string `json:"type,omitempty"` 4218} 4219 4220// MarshalJSON is the custom marshaler for MonitoringMetricConfiguration. 4221func (mmc MonitoringMetricConfiguration) MarshalJSON() ([]byte, error) { 4222 objectMap := make(map[string]interface{}) 4223 if mmc.MonitoringMetricConfigurationProperties != nil { 4224 objectMap["properties"] = mmc.MonitoringMetricConfigurationProperties 4225 } 4226 return json.Marshal(objectMap) 4227} 4228 4229// UnmarshalJSON is the custom unmarshaler for MonitoringMetricConfiguration struct. 4230func (mmc *MonitoringMetricConfiguration) UnmarshalJSON(body []byte) error { 4231 var m map[string]*json.RawMessage 4232 err := json.Unmarshal(body, &m) 4233 if err != nil { 4234 return err 4235 } 4236 for k, v := range m { 4237 switch k { 4238 case "properties": 4239 if v != nil { 4240 var monitoringMetricConfigurationProperties MonitoringMetricConfigurationProperties 4241 err = json.Unmarshal(*v, &monitoringMetricConfigurationProperties) 4242 if err != nil { 4243 return err 4244 } 4245 mmc.MonitoringMetricConfigurationProperties = &monitoringMetricConfigurationProperties 4246 } 4247 case "id": 4248 if v != nil { 4249 var ID string 4250 err = json.Unmarshal(*v, &ID) 4251 if err != nil { 4252 return err 4253 } 4254 mmc.ID = &ID 4255 } 4256 case "name": 4257 if v != nil { 4258 var name string 4259 err = json.Unmarshal(*v, &name) 4260 if err != nil { 4261 return err 4262 } 4263 mmc.Name = &name 4264 } 4265 case "type": 4266 if v != nil { 4267 var typeVar string 4268 err = json.Unmarshal(*v, &typeVar) 4269 if err != nil { 4270 return err 4271 } 4272 mmc.Type = &typeVar 4273 } 4274 } 4275 } 4276 4277 return nil 4278} 4279 4280// MonitoringMetricConfigurationList collection of metric configurations. 4281type MonitoringMetricConfigurationList struct { 4282 autorest.Response `json:"-"` 4283 // Value - READ-ONLY; The list of metric configurations. 4284 Value *[]MonitoringMetricConfiguration `json:"value,omitempty"` 4285 // NextLink - READ-ONLY; Link to the next set of results. 4286 NextLink *string `json:"nextLink,omitempty"` 4287} 4288 4289// MarshalJSON is the custom marshaler for MonitoringMetricConfigurationList. 4290func (mmcl MonitoringMetricConfigurationList) MarshalJSON() ([]byte, error) { 4291 objectMap := make(map[string]interface{}) 4292 return json.Marshal(objectMap) 4293} 4294 4295// MonitoringMetricConfigurationListIterator provides access to a complete listing of 4296// MonitoringMetricConfiguration values. 4297type MonitoringMetricConfigurationListIterator struct { 4298 i int 4299 page MonitoringMetricConfigurationListPage 4300} 4301 4302// NextWithContext advances to the next value. If there was an error making 4303// the request the iterator does not advance and the error is returned. 4304func (iter *MonitoringMetricConfigurationListIterator) NextWithContext(ctx context.Context) (err error) { 4305 if tracing.IsEnabled() { 4306 ctx = tracing.StartSpan(ctx, fqdn+"/MonitoringMetricConfigurationListIterator.NextWithContext") 4307 defer func() { 4308 sc := -1 4309 if iter.Response().Response.Response != nil { 4310 sc = iter.Response().Response.Response.StatusCode 4311 } 4312 tracing.EndSpan(ctx, sc, err) 4313 }() 4314 } 4315 iter.i++ 4316 if iter.i < len(iter.page.Values()) { 4317 return nil 4318 } 4319 err = iter.page.NextWithContext(ctx) 4320 if err != nil { 4321 iter.i-- 4322 return err 4323 } 4324 iter.i = 0 4325 return nil 4326} 4327 4328// Next advances to the next value. If there was an error making 4329// the request the iterator does not advance and the error is returned. 4330// Deprecated: Use NextWithContext() instead. 4331func (iter *MonitoringMetricConfigurationListIterator) Next() error { 4332 return iter.NextWithContext(context.Background()) 4333} 4334 4335// NotDone returns true if the enumeration should be started or is not yet complete. 4336func (iter MonitoringMetricConfigurationListIterator) NotDone() bool { 4337 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 4338} 4339 4340// Response returns the raw server response from the last page request. 4341func (iter MonitoringMetricConfigurationListIterator) Response() MonitoringMetricConfigurationList { 4342 return iter.page.Response() 4343} 4344 4345// Value returns the current value or a zero-initialized value if the 4346// iterator has advanced beyond the end of the collection. 4347func (iter MonitoringMetricConfigurationListIterator) Value() MonitoringMetricConfiguration { 4348 if !iter.page.NotDone() { 4349 return MonitoringMetricConfiguration{} 4350 } 4351 return iter.page.Values()[iter.i] 4352} 4353 4354// Creates a new instance of the MonitoringMetricConfigurationListIterator type. 4355func NewMonitoringMetricConfigurationListIterator(page MonitoringMetricConfigurationListPage) MonitoringMetricConfigurationListIterator { 4356 return MonitoringMetricConfigurationListIterator{page: page} 4357} 4358 4359// IsEmpty returns true if the ListResult contains no values. 4360func (mmcl MonitoringMetricConfigurationList) IsEmpty() bool { 4361 return mmcl.Value == nil || len(*mmcl.Value) == 0 4362} 4363 4364// hasNextLink returns true if the NextLink is not empty. 4365func (mmcl MonitoringMetricConfigurationList) hasNextLink() bool { 4366 return mmcl.NextLink != nil && len(*mmcl.NextLink) != 0 4367} 4368 4369// monitoringMetricConfigurationListPreparer prepares a request to retrieve the next set of results. 4370// It returns nil if no more results exist. 4371func (mmcl MonitoringMetricConfigurationList) monitoringMetricConfigurationListPreparer(ctx context.Context) (*http.Request, error) { 4372 if !mmcl.hasNextLink() { 4373 return nil, nil 4374 } 4375 return autorest.Prepare((&http.Request{}).WithContext(ctx), 4376 autorest.AsJSON(), 4377 autorest.AsGet(), 4378 autorest.WithBaseURL(to.String(mmcl.NextLink))) 4379} 4380 4381// MonitoringMetricConfigurationListPage contains a page of MonitoringMetricConfiguration values. 4382type MonitoringMetricConfigurationListPage struct { 4383 fn func(context.Context, MonitoringMetricConfigurationList) (MonitoringMetricConfigurationList, error) 4384 mmcl MonitoringMetricConfigurationList 4385} 4386 4387// NextWithContext advances to the next page of values. If there was an error making 4388// the request the page does not advance and the error is returned. 4389func (page *MonitoringMetricConfigurationListPage) NextWithContext(ctx context.Context) (err error) { 4390 if tracing.IsEnabled() { 4391 ctx = tracing.StartSpan(ctx, fqdn+"/MonitoringMetricConfigurationListPage.NextWithContext") 4392 defer func() { 4393 sc := -1 4394 if page.Response().Response.Response != nil { 4395 sc = page.Response().Response.Response.StatusCode 4396 } 4397 tracing.EndSpan(ctx, sc, err) 4398 }() 4399 } 4400 for { 4401 next, err := page.fn(ctx, page.mmcl) 4402 if err != nil { 4403 return err 4404 } 4405 page.mmcl = next 4406 if !next.hasNextLink() || !next.IsEmpty() { 4407 break 4408 } 4409 } 4410 return nil 4411} 4412 4413// Next advances to the next page of values. If there was an error making 4414// the request the page does not advance and the error is returned. 4415// Deprecated: Use NextWithContext() instead. 4416func (page *MonitoringMetricConfigurationListPage) Next() error { 4417 return page.NextWithContext(context.Background()) 4418} 4419 4420// NotDone returns true if the page enumeration should be started or is not yet complete. 4421func (page MonitoringMetricConfigurationListPage) NotDone() bool { 4422 return !page.mmcl.IsEmpty() 4423} 4424 4425// Response returns the raw server response from the last page request. 4426func (page MonitoringMetricConfigurationListPage) Response() MonitoringMetricConfigurationList { 4427 return page.mmcl 4428} 4429 4430// Values returns the slice of values for the current page or nil if there are no values. 4431func (page MonitoringMetricConfigurationListPage) Values() []MonitoringMetricConfiguration { 4432 if page.mmcl.IsEmpty() { 4433 return nil 4434 } 4435 return *page.mmcl.Value 4436} 4437 4438// Creates a new instance of the MonitoringMetricConfigurationListPage type. 4439func NewMonitoringMetricConfigurationListPage(cur MonitoringMetricConfigurationList, getNextPage func(context.Context, MonitoringMetricConfigurationList) (MonitoringMetricConfigurationList, error)) MonitoringMetricConfigurationListPage { 4440 return MonitoringMetricConfigurationListPage{ 4441 fn: getNextPage, 4442 mmcl: cur, 4443 } 4444} 4445 4446// MonitoringMetricConfigurationProperties metrics properties 4447type MonitoringMetricConfigurationProperties struct { 4448 // MetricConfigurations - The metrics configuration details 4449 MetricConfigurations *[]MetricConfiguration `json:"metricConfigurations,omitempty"` 4450} 4451 4452// MountPointMap the share mount point. 4453type MountPointMap struct { 4454 // ShareID - ID of the share mounted to the role VM. 4455 ShareID *string `json:"shareId,omitempty"` 4456 // RoleID - READ-ONLY; ID of the role to which share is mounted. 4457 RoleID *string `json:"roleId,omitempty"` 4458 // MountPoint - READ-ONLY; Mount point for the share. 4459 MountPoint *string `json:"mountPoint,omitempty"` 4460 // MountType - READ-ONLY; Mounting type. Possible values include: 'Volume', 'HostPath' 4461 MountType MountType `json:"mountType,omitempty"` 4462 // RoleType - READ-ONLY; Role type. Possible values include: 'IOT', 'ASA', 'Functions', 'Cognitive', 'MEC', 'CloudEdgeManagement', 'Kubernetes' 4463 RoleType RoleTypes `json:"roleType,omitempty"` 4464} 4465 4466// MarshalJSON is the custom marshaler for MountPointMap. 4467func (mpm MountPointMap) MarshalJSON() ([]byte, error) { 4468 objectMap := make(map[string]interface{}) 4469 if mpm.ShareID != nil { 4470 objectMap["shareId"] = mpm.ShareID 4471 } 4472 return json.Marshal(objectMap) 4473} 4474 4475// MoveRequest resource Move details 4476type MoveRequest struct { 4477 // TargetResourceGroup - Target resource group ARMId 4478 TargetResourceGroup *string `json:"targetResourceGroup,omitempty"` 4479 // Resources - List of resources to be moved 4480 Resources *[]string `json:"resources,omitempty"` 4481} 4482 4483// NetworkAdapter represents the networkAdapter on a device. 4484type NetworkAdapter struct { 4485 // AdapterID - READ-ONLY; Instance ID of network adapter. 4486 AdapterID *string `json:"adapterId,omitempty"` 4487 // AdapterPosition - READ-ONLY; Hardware position of network adapter. 4488 AdapterPosition *NetworkAdapterPosition `json:"adapterPosition,omitempty"` 4489 // Index - READ-ONLY; Logical index of the adapter. 4490 Index *int32 `json:"index,omitempty"` 4491 // NodeID - READ-ONLY; Node ID of the network adapter. 4492 NodeID *string `json:"nodeId,omitempty"` 4493 // NetworkAdapterName - READ-ONLY; Network adapter name. 4494 NetworkAdapterName *string `json:"networkAdapterName,omitempty"` 4495 // Label - READ-ONLY; Hardware label for the adapter. 4496 Label *string `json:"label,omitempty"` 4497 // MacAddress - READ-ONLY; MAC address. 4498 MacAddress *string `json:"macAddress,omitempty"` 4499 // LinkSpeed - READ-ONLY; Link speed. 4500 LinkSpeed *int64 `json:"linkSpeed,omitempty"` 4501 // Status - READ-ONLY; Value indicating whether this adapter is valid. Possible values include: 'Inactive', 'Active' 4502 Status NetworkAdapterStatus `json:"status,omitempty"` 4503 // RdmaStatus - Value indicating whether this adapter is RDMA capable. Possible values include: 'Incapable', 'Capable' 4504 RdmaStatus NetworkAdapterRDMAStatus `json:"rdmaStatus,omitempty"` 4505 // DhcpStatus - Value indicating whether this adapter has DHCP enabled. Possible values include: 'NetworkAdapterDHCPStatusDisabled', 'NetworkAdapterDHCPStatusEnabled' 4506 DhcpStatus NetworkAdapterDHCPStatus `json:"dhcpStatus,omitempty"` 4507 // Ipv4Configuration - READ-ONLY; The IPv4 configuration of the network adapter. 4508 Ipv4Configuration *Ipv4Config `json:"ipv4Configuration,omitempty"` 4509 // Ipv6Configuration - READ-ONLY; The IPv6 configuration of the network adapter. 4510 Ipv6Configuration *Ipv6Config `json:"ipv6Configuration,omitempty"` 4511 // Ipv6LinkLocalAddress - READ-ONLY; The IPv6 local address. 4512 Ipv6LinkLocalAddress *string `json:"ipv6LinkLocalAddress,omitempty"` 4513 // DNSServers - READ-ONLY; The list of DNS Servers of the device. 4514 DNSServers *[]string `json:"dnsServers,omitempty"` 4515} 4516 4517// MarshalJSON is the custom marshaler for NetworkAdapter. 4518func (na NetworkAdapter) MarshalJSON() ([]byte, error) { 4519 objectMap := make(map[string]interface{}) 4520 if na.RdmaStatus != "" { 4521 objectMap["rdmaStatus"] = na.RdmaStatus 4522 } 4523 if na.DhcpStatus != "" { 4524 objectMap["dhcpStatus"] = na.DhcpStatus 4525 } 4526 return json.Marshal(objectMap) 4527} 4528 4529// NetworkAdapterPosition the network adapter position. 4530type NetworkAdapterPosition struct { 4531 // NetworkGroup - READ-ONLY; The network group. Possible values include: 'NetworkGroupNone', 'NetworkGroupNonRDMA', 'NetworkGroupRDMA' 4532 NetworkGroup NetworkGroup `json:"networkGroup,omitempty"` 4533 // Port - READ-ONLY; The port. 4534 Port *int32 `json:"port,omitempty"` 4535} 4536 4537// MarshalJSON is the custom marshaler for NetworkAdapterPosition. 4538func (nap NetworkAdapterPosition) MarshalJSON() ([]byte, error) { 4539 objectMap := make(map[string]interface{}) 4540 return json.Marshal(objectMap) 4541} 4542 4543// NetworkSettings the network settings of a device. 4544type NetworkSettings struct { 4545 autorest.Response `json:"-"` 4546 // NetworkSettingsProperties - READ-ONLY; The properties of network settings of a device. 4547 *NetworkSettingsProperties `json:"properties,omitempty"` 4548 // ID - READ-ONLY; The path ID that uniquely identifies the object. 4549 ID *string `json:"id,omitempty"` 4550 // Name - READ-ONLY; The object name. 4551 Name *string `json:"name,omitempty"` 4552 // Type - READ-ONLY; The hierarchical type of the object. 4553 Type *string `json:"type,omitempty"` 4554} 4555 4556// MarshalJSON is the custom marshaler for NetworkSettings. 4557func (ns NetworkSettings) MarshalJSON() ([]byte, error) { 4558 objectMap := make(map[string]interface{}) 4559 return json.Marshal(objectMap) 4560} 4561 4562// UnmarshalJSON is the custom unmarshaler for NetworkSettings struct. 4563func (ns *NetworkSettings) UnmarshalJSON(body []byte) error { 4564 var m map[string]*json.RawMessage 4565 err := json.Unmarshal(body, &m) 4566 if err != nil { 4567 return err 4568 } 4569 for k, v := range m { 4570 switch k { 4571 case "properties": 4572 if v != nil { 4573 var networkSettingsProperties NetworkSettingsProperties 4574 err = json.Unmarshal(*v, &networkSettingsProperties) 4575 if err != nil { 4576 return err 4577 } 4578 ns.NetworkSettingsProperties = &networkSettingsProperties 4579 } 4580 case "id": 4581 if v != nil { 4582 var ID string 4583 err = json.Unmarshal(*v, &ID) 4584 if err != nil { 4585 return err 4586 } 4587 ns.ID = &ID 4588 } 4589 case "name": 4590 if v != nil { 4591 var name string 4592 err = json.Unmarshal(*v, &name) 4593 if err != nil { 4594 return err 4595 } 4596 ns.Name = &name 4597 } 4598 case "type": 4599 if v != nil { 4600 var typeVar string 4601 err = json.Unmarshal(*v, &typeVar) 4602 if err != nil { 4603 return err 4604 } 4605 ns.Type = &typeVar 4606 } 4607 } 4608 } 4609 4610 return nil 4611} 4612 4613// NetworkSettingsProperties the properties of network settings. 4614type NetworkSettingsProperties struct { 4615 // NetworkAdapters - READ-ONLY; The network adapter list on the device. 4616 NetworkAdapters *[]NetworkAdapter `json:"networkAdapters,omitempty"` 4617} 4618 4619// MarshalJSON is the custom marshaler for NetworkSettingsProperties. 4620func (nsp NetworkSettingsProperties) MarshalJSON() ([]byte, error) { 4621 objectMap := make(map[string]interface{}) 4622 return json.Marshal(objectMap) 4623} 4624 4625// Node represents a single node in a Data box Edge/Gateway device 4626// Gateway devices, standalone Edge devices and a single node cluster Edge device will all have 1 node 4627// Multi-node Edge devices will have more than 1 nodes 4628type Node struct { 4629 // NodeProperties - READ-ONLY; The properties of the node 4630 *NodeProperties `json:"properties,omitempty"` 4631 // ID - READ-ONLY; The path ID that uniquely identifies the object. 4632 ID *string `json:"id,omitempty"` 4633 // Name - READ-ONLY; The object name. 4634 Name *string `json:"name,omitempty"` 4635 // Type - READ-ONLY; The hierarchical type of the object. 4636 Type *string `json:"type,omitempty"` 4637} 4638 4639// MarshalJSON is the custom marshaler for Node. 4640func (n Node) MarshalJSON() ([]byte, error) { 4641 objectMap := make(map[string]interface{}) 4642 return json.Marshal(objectMap) 4643} 4644 4645// UnmarshalJSON is the custom unmarshaler for Node struct. 4646func (n *Node) UnmarshalJSON(body []byte) error { 4647 var m map[string]*json.RawMessage 4648 err := json.Unmarshal(body, &m) 4649 if err != nil { 4650 return err 4651 } 4652 for k, v := range m { 4653 switch k { 4654 case "properties": 4655 if v != nil { 4656 var nodeProperties NodeProperties 4657 err = json.Unmarshal(*v, &nodeProperties) 4658 if err != nil { 4659 return err 4660 } 4661 n.NodeProperties = &nodeProperties 4662 } 4663 case "id": 4664 if v != nil { 4665 var ID string 4666 err = json.Unmarshal(*v, &ID) 4667 if err != nil { 4668 return err 4669 } 4670 n.ID = &ID 4671 } 4672 case "name": 4673 if v != nil { 4674 var name string 4675 err = json.Unmarshal(*v, &name) 4676 if err != nil { 4677 return err 4678 } 4679 n.Name = &name 4680 } 4681 case "type": 4682 if v != nil { 4683 var typeVar string 4684 err = json.Unmarshal(*v, &typeVar) 4685 if err != nil { 4686 return err 4687 } 4688 n.Type = &typeVar 4689 } 4690 } 4691 } 4692 4693 return nil 4694} 4695 4696// NodeInfo kubernetes node info 4697type NodeInfo struct { 4698 // Name - READ-ONLY; Node name. 4699 Name *string `json:"name,omitempty"` 4700 // Type - READ-ONLY; Node type - Master/Worker. Possible values include: 'KubernetesNodeTypeInvalid', 'KubernetesNodeTypeMaster', 'KubernetesNodeTypeWorker' 4701 Type KubernetesNodeType `json:"type,omitempty"` 4702 // IPConfiguration - IP Configuration of the Kubernetes node. 4703 IPConfiguration *[]KubernetesIPConfiguration `json:"ipConfiguration,omitempty"` 4704} 4705 4706// MarshalJSON is the custom marshaler for NodeInfo. 4707func (ni NodeInfo) MarshalJSON() ([]byte, error) { 4708 objectMap := make(map[string]interface{}) 4709 if ni.IPConfiguration != nil { 4710 objectMap["ipConfiguration"] = ni.IPConfiguration 4711 } 4712 return json.Marshal(objectMap) 4713} 4714 4715// NodeList collection of Nodes. 4716type NodeList struct { 4717 autorest.Response `json:"-"` 4718 // Value - READ-ONLY; The list of Nodes. 4719 Value *[]Node `json:"value,omitempty"` 4720 // NextLink - Link to the next set of results. 4721 NextLink *string `json:"nextLink,omitempty"` 4722} 4723 4724// MarshalJSON is the custom marshaler for NodeList. 4725func (nl NodeList) MarshalJSON() ([]byte, error) { 4726 objectMap := make(map[string]interface{}) 4727 if nl.NextLink != nil { 4728 objectMap["nextLink"] = nl.NextLink 4729 } 4730 return json.Marshal(objectMap) 4731} 4732 4733// NodeListIterator provides access to a complete listing of Node values. 4734type NodeListIterator struct { 4735 i int 4736 page NodeListPage 4737} 4738 4739// NextWithContext advances to the next value. If there was an error making 4740// the request the iterator does not advance and the error is returned. 4741func (iter *NodeListIterator) NextWithContext(ctx context.Context) (err error) { 4742 if tracing.IsEnabled() { 4743 ctx = tracing.StartSpan(ctx, fqdn+"/NodeListIterator.NextWithContext") 4744 defer func() { 4745 sc := -1 4746 if iter.Response().Response.Response != nil { 4747 sc = iter.Response().Response.Response.StatusCode 4748 } 4749 tracing.EndSpan(ctx, sc, err) 4750 }() 4751 } 4752 iter.i++ 4753 if iter.i < len(iter.page.Values()) { 4754 return nil 4755 } 4756 err = iter.page.NextWithContext(ctx) 4757 if err != nil { 4758 iter.i-- 4759 return err 4760 } 4761 iter.i = 0 4762 return nil 4763} 4764 4765// Next advances to the next value. If there was an error making 4766// the request the iterator does not advance and the error is returned. 4767// Deprecated: Use NextWithContext() instead. 4768func (iter *NodeListIterator) Next() error { 4769 return iter.NextWithContext(context.Background()) 4770} 4771 4772// NotDone returns true if the enumeration should be started or is not yet complete. 4773func (iter NodeListIterator) NotDone() bool { 4774 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 4775} 4776 4777// Response returns the raw server response from the last page request. 4778func (iter NodeListIterator) Response() NodeList { 4779 return iter.page.Response() 4780} 4781 4782// Value returns the current value or a zero-initialized value if the 4783// iterator has advanced beyond the end of the collection. 4784func (iter NodeListIterator) Value() Node { 4785 if !iter.page.NotDone() { 4786 return Node{} 4787 } 4788 return iter.page.Values()[iter.i] 4789} 4790 4791// Creates a new instance of the NodeListIterator type. 4792func NewNodeListIterator(page NodeListPage) NodeListIterator { 4793 return NodeListIterator{page: page} 4794} 4795 4796// IsEmpty returns true if the ListResult contains no values. 4797func (nl NodeList) IsEmpty() bool { 4798 return nl.Value == nil || len(*nl.Value) == 0 4799} 4800 4801// hasNextLink returns true if the NextLink is not empty. 4802func (nl NodeList) hasNextLink() bool { 4803 return nl.NextLink != nil && len(*nl.NextLink) != 0 4804} 4805 4806// nodeListPreparer prepares a request to retrieve the next set of results. 4807// It returns nil if no more results exist. 4808func (nl NodeList) nodeListPreparer(ctx context.Context) (*http.Request, error) { 4809 if !nl.hasNextLink() { 4810 return nil, nil 4811 } 4812 return autorest.Prepare((&http.Request{}).WithContext(ctx), 4813 autorest.AsJSON(), 4814 autorest.AsGet(), 4815 autorest.WithBaseURL(to.String(nl.NextLink))) 4816} 4817 4818// NodeListPage contains a page of Node values. 4819type NodeListPage struct { 4820 fn func(context.Context, NodeList) (NodeList, error) 4821 nl NodeList 4822} 4823 4824// NextWithContext advances to the next page of values. If there was an error making 4825// the request the page does not advance and the error is returned. 4826func (page *NodeListPage) NextWithContext(ctx context.Context) (err error) { 4827 if tracing.IsEnabled() { 4828 ctx = tracing.StartSpan(ctx, fqdn+"/NodeListPage.NextWithContext") 4829 defer func() { 4830 sc := -1 4831 if page.Response().Response.Response != nil { 4832 sc = page.Response().Response.Response.StatusCode 4833 } 4834 tracing.EndSpan(ctx, sc, err) 4835 }() 4836 } 4837 for { 4838 next, err := page.fn(ctx, page.nl) 4839 if err != nil { 4840 return err 4841 } 4842 page.nl = next 4843 if !next.hasNextLink() || !next.IsEmpty() { 4844 break 4845 } 4846 } 4847 return nil 4848} 4849 4850// Next advances to the next page of values. If there was an error making 4851// the request the page does not advance and the error is returned. 4852// Deprecated: Use NextWithContext() instead. 4853func (page *NodeListPage) Next() error { 4854 return page.NextWithContext(context.Background()) 4855} 4856 4857// NotDone returns true if the page enumeration should be started or is not yet complete. 4858func (page NodeListPage) NotDone() bool { 4859 return !page.nl.IsEmpty() 4860} 4861 4862// Response returns the raw server response from the last page request. 4863func (page NodeListPage) Response() NodeList { 4864 return page.nl 4865} 4866 4867// Values returns the slice of values for the current page or nil if there are no values. 4868func (page NodeListPage) Values() []Node { 4869 if page.nl.IsEmpty() { 4870 return nil 4871 } 4872 return *page.nl.Value 4873} 4874 4875// Creates a new instance of the NodeListPage type. 4876func NewNodeListPage(cur NodeList, getNextPage func(context.Context, NodeList) (NodeList, error)) NodeListPage { 4877 return NodeListPage{ 4878 fn: getNextPage, 4879 nl: cur, 4880 } 4881} 4882 4883// NodeProperties this class represents the nodes in a highly available cluster 4884type NodeProperties struct { 4885 // NodeStatus - READ-ONLY; The current status of the individual node. Possible values include: 'NodeStatusUnknown', 'NodeStatusUp', 'NodeStatusDown', 'NodeStatusRebooting', 'NodeStatusShuttingDown' 4886 NodeStatus NodeStatus `json:"nodeStatus,omitempty"` 4887 // NodeChassisSerialNumber - READ-ONLY; Serial number of the Chassis 4888 NodeChassisSerialNumber *string `json:"nodeChassisSerialNumber,omitempty"` 4889 // NodeSerialNumber - READ-ONLY; Serial number of the individual node 4890 NodeSerialNumber *string `json:"nodeSerialNumber,omitempty"` 4891 // NodeDisplayName - READ-ONLY; Display Name of the individual node 4892 NodeDisplayName *string `json:"nodeDisplayName,omitempty"` 4893 // NodeFriendlySoftwareVersion - READ-ONLY; Friendly software version name that is currently installed on the node 4894 NodeFriendlySoftwareVersion *string `json:"nodeFriendlySoftwareVersion,omitempty"` 4895 // NodeHcsVersion - READ-ONLY; HCS version that is currently installed on the node 4896 NodeHcsVersion *string `json:"nodeHcsVersion,omitempty"` 4897 // NodeInstanceID - READ-ONLY; Guid instance id of the node 4898 NodeInstanceID *string `json:"nodeInstanceId,omitempty"` 4899} 4900 4901// MarshalJSON is the custom marshaler for NodeProperties. 4902func (np NodeProperties) MarshalJSON() ([]byte, error) { 4903 objectMap := make(map[string]interface{}) 4904 return json.Marshal(objectMap) 4905} 4906 4907// Operation operations. 4908type Operation struct { 4909 // Name - Name of the operation. 4910 Name *string `json:"name,omitempty"` 4911 // IsDataAction - Is data action. 4912 IsDataAction *bool `json:"isDataAction,omitempty"` 4913 // Display - Properties displayed for the operation. 4914 Display *OperationDisplay `json:"display,omitempty"` 4915 // Origin - Origin of the operation. 4916 Origin *string `json:"origin,omitempty"` 4917 // OperationProperties - Operation properties. 4918 *OperationProperties `json:"properties,omitempty"` 4919} 4920 4921// MarshalJSON is the custom marshaler for Operation. 4922func (o Operation) MarshalJSON() ([]byte, error) { 4923 objectMap := make(map[string]interface{}) 4924 if o.Name != nil { 4925 objectMap["name"] = o.Name 4926 } 4927 if o.IsDataAction != nil { 4928 objectMap["isDataAction"] = o.IsDataAction 4929 } 4930 if o.Display != nil { 4931 objectMap["display"] = o.Display 4932 } 4933 if o.Origin != nil { 4934 objectMap["origin"] = o.Origin 4935 } 4936 if o.OperationProperties != nil { 4937 objectMap["properties"] = o.OperationProperties 4938 } 4939 return json.Marshal(objectMap) 4940} 4941 4942// UnmarshalJSON is the custom unmarshaler for Operation struct. 4943func (o *Operation) UnmarshalJSON(body []byte) error { 4944 var m map[string]*json.RawMessage 4945 err := json.Unmarshal(body, &m) 4946 if err != nil { 4947 return err 4948 } 4949 for k, v := range m { 4950 switch k { 4951 case "name": 4952 if v != nil { 4953 var name string 4954 err = json.Unmarshal(*v, &name) 4955 if err != nil { 4956 return err 4957 } 4958 o.Name = &name 4959 } 4960 case "isDataAction": 4961 if v != nil { 4962 var isDataAction bool 4963 err = json.Unmarshal(*v, &isDataAction) 4964 if err != nil { 4965 return err 4966 } 4967 o.IsDataAction = &isDataAction 4968 } 4969 case "display": 4970 if v != nil { 4971 var display OperationDisplay 4972 err = json.Unmarshal(*v, &display) 4973 if err != nil { 4974 return err 4975 } 4976 o.Display = &display 4977 } 4978 case "origin": 4979 if v != nil { 4980 var origin string 4981 err = json.Unmarshal(*v, &origin) 4982 if err != nil { 4983 return err 4984 } 4985 o.Origin = &origin 4986 } 4987 case "properties": 4988 if v != nil { 4989 var operationProperties OperationProperties 4990 err = json.Unmarshal(*v, &operationProperties) 4991 if err != nil { 4992 return err 4993 } 4994 o.OperationProperties = &operationProperties 4995 } 4996 } 4997 } 4998 4999 return nil 5000} 5001 5002// OperationDisplay operation display properties. 5003type OperationDisplay struct { 5004 // Provider - Provider name. 5005 Provider *string `json:"provider,omitempty"` 5006 // Resource - The type of resource in which the operation is performed. 5007 Resource *string `json:"resource,omitempty"` 5008 // Operation - Operation to be performed on the resource. 5009 Operation *string `json:"operation,omitempty"` 5010 // Description - Description of the operation to be performed. 5011 Description *string `json:"description,omitempty"` 5012} 5013 5014// OperationProperties operation properties. 5015type OperationProperties struct { 5016 // ServiceSpecification - Service specification. 5017 ServiceSpecification *ServiceSpecification `json:"serviceSpecification,omitempty"` 5018} 5019 5020// OperationsList the list of operations used for the discovery of available provider operations. 5021type OperationsList struct { 5022 autorest.Response `json:"-"` 5023 // Value - The value. 5024 Value *[]Operation `json:"value,omitempty"` 5025 // NextLink - Link to the next set of results. 5026 NextLink *string `json:"nextLink,omitempty"` 5027} 5028 5029// OperationsListIterator provides access to a complete listing of Operation values. 5030type OperationsListIterator struct { 5031 i int 5032 page OperationsListPage 5033} 5034 5035// NextWithContext advances to the next value. If there was an error making 5036// the request the iterator does not advance and the error is returned. 5037func (iter *OperationsListIterator) NextWithContext(ctx context.Context) (err error) { 5038 if tracing.IsEnabled() { 5039 ctx = tracing.StartSpan(ctx, fqdn+"/OperationsListIterator.NextWithContext") 5040 defer func() { 5041 sc := -1 5042 if iter.Response().Response.Response != nil { 5043 sc = iter.Response().Response.Response.StatusCode 5044 } 5045 tracing.EndSpan(ctx, sc, err) 5046 }() 5047 } 5048 iter.i++ 5049 if iter.i < len(iter.page.Values()) { 5050 return nil 5051 } 5052 err = iter.page.NextWithContext(ctx) 5053 if err != nil { 5054 iter.i-- 5055 return err 5056 } 5057 iter.i = 0 5058 return nil 5059} 5060 5061// Next advances to the next value. If there was an error making 5062// the request the iterator does not advance and the error is returned. 5063// Deprecated: Use NextWithContext() instead. 5064func (iter *OperationsListIterator) Next() error { 5065 return iter.NextWithContext(context.Background()) 5066} 5067 5068// NotDone returns true if the enumeration should be started or is not yet complete. 5069func (iter OperationsListIterator) NotDone() bool { 5070 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 5071} 5072 5073// Response returns the raw server response from the last page request. 5074func (iter OperationsListIterator) Response() OperationsList { 5075 return iter.page.Response() 5076} 5077 5078// Value returns the current value or a zero-initialized value if the 5079// iterator has advanced beyond the end of the collection. 5080func (iter OperationsListIterator) Value() Operation { 5081 if !iter.page.NotDone() { 5082 return Operation{} 5083 } 5084 return iter.page.Values()[iter.i] 5085} 5086 5087// Creates a new instance of the OperationsListIterator type. 5088func NewOperationsListIterator(page OperationsListPage) OperationsListIterator { 5089 return OperationsListIterator{page: page} 5090} 5091 5092// IsEmpty returns true if the ListResult contains no values. 5093func (ol OperationsList) IsEmpty() bool { 5094 return ol.Value == nil || len(*ol.Value) == 0 5095} 5096 5097// hasNextLink returns true if the NextLink is not empty. 5098func (ol OperationsList) hasNextLink() bool { 5099 return ol.NextLink != nil && len(*ol.NextLink) != 0 5100} 5101 5102// operationsListPreparer prepares a request to retrieve the next set of results. 5103// It returns nil if no more results exist. 5104func (ol OperationsList) operationsListPreparer(ctx context.Context) (*http.Request, error) { 5105 if !ol.hasNextLink() { 5106 return nil, nil 5107 } 5108 return autorest.Prepare((&http.Request{}).WithContext(ctx), 5109 autorest.AsJSON(), 5110 autorest.AsGet(), 5111 autorest.WithBaseURL(to.String(ol.NextLink))) 5112} 5113 5114// OperationsListPage contains a page of Operation values. 5115type OperationsListPage struct { 5116 fn func(context.Context, OperationsList) (OperationsList, error) 5117 ol OperationsList 5118} 5119 5120// NextWithContext advances to the next page of values. If there was an error making 5121// the request the page does not advance and the error is returned. 5122func (page *OperationsListPage) NextWithContext(ctx context.Context) (err error) { 5123 if tracing.IsEnabled() { 5124 ctx = tracing.StartSpan(ctx, fqdn+"/OperationsListPage.NextWithContext") 5125 defer func() { 5126 sc := -1 5127 if page.Response().Response.Response != nil { 5128 sc = page.Response().Response.Response.StatusCode 5129 } 5130 tracing.EndSpan(ctx, sc, err) 5131 }() 5132 } 5133 for { 5134 next, err := page.fn(ctx, page.ol) 5135 if err != nil { 5136 return err 5137 } 5138 page.ol = next 5139 if !next.hasNextLink() || !next.IsEmpty() { 5140 break 5141 } 5142 } 5143 return nil 5144} 5145 5146// Next advances to the next page of values. If there was an error making 5147// the request the page does not advance and the error is returned. 5148// Deprecated: Use NextWithContext() instead. 5149func (page *OperationsListPage) Next() error { 5150 return page.NextWithContext(context.Background()) 5151} 5152 5153// NotDone returns true if the page enumeration should be started or is not yet complete. 5154func (page OperationsListPage) NotDone() bool { 5155 return !page.ol.IsEmpty() 5156} 5157 5158// Response returns the raw server response from the last page request. 5159func (page OperationsListPage) Response() OperationsList { 5160 return page.ol 5161} 5162 5163// Values returns the slice of values for the current page or nil if there are no values. 5164func (page OperationsListPage) Values() []Operation { 5165 if page.ol.IsEmpty() { 5166 return nil 5167 } 5168 return *page.ol.Value 5169} 5170 5171// Creates a new instance of the OperationsListPage type. 5172func NewOperationsListPage(cur OperationsList, getNextPage func(context.Context, OperationsList) (OperationsList, error)) OperationsListPage { 5173 return OperationsListPage{ 5174 fn: getNextPage, 5175 ol: cur, 5176 } 5177} 5178 5179// Order the order details. 5180type Order struct { 5181 autorest.Response `json:"-"` 5182 // OrderProperties - The order properties. 5183 *OrderProperties `json:"properties,omitempty"` 5184 // ID - READ-ONLY; The path ID that uniquely identifies the object. 5185 ID *string `json:"id,omitempty"` 5186 // Name - READ-ONLY; The object name. 5187 Name *string `json:"name,omitempty"` 5188 // Type - READ-ONLY; The hierarchical type of the object. 5189 Type *string `json:"type,omitempty"` 5190} 5191 5192// MarshalJSON is the custom marshaler for Order. 5193func (o Order) MarshalJSON() ([]byte, error) { 5194 objectMap := make(map[string]interface{}) 5195 if o.OrderProperties != nil { 5196 objectMap["properties"] = o.OrderProperties 5197 } 5198 return json.Marshal(objectMap) 5199} 5200 5201// UnmarshalJSON is the custom unmarshaler for Order struct. 5202func (o *Order) UnmarshalJSON(body []byte) error { 5203 var m map[string]*json.RawMessage 5204 err := json.Unmarshal(body, &m) 5205 if err != nil { 5206 return err 5207 } 5208 for k, v := range m { 5209 switch k { 5210 case "properties": 5211 if v != nil { 5212 var orderProperties OrderProperties 5213 err = json.Unmarshal(*v, &orderProperties) 5214 if err != nil { 5215 return err 5216 } 5217 o.OrderProperties = &orderProperties 5218 } 5219 case "id": 5220 if v != nil { 5221 var ID string 5222 err = json.Unmarshal(*v, &ID) 5223 if err != nil { 5224 return err 5225 } 5226 o.ID = &ID 5227 } 5228 case "name": 5229 if v != nil { 5230 var name string 5231 err = json.Unmarshal(*v, &name) 5232 if err != nil { 5233 return err 5234 } 5235 o.Name = &name 5236 } 5237 case "type": 5238 if v != nil { 5239 var typeVar string 5240 err = json.Unmarshal(*v, &typeVar) 5241 if err != nil { 5242 return err 5243 } 5244 o.Type = &typeVar 5245 } 5246 } 5247 } 5248 5249 return nil 5250} 5251 5252// OrderList list of order entities. 5253type OrderList struct { 5254 autorest.Response `json:"-"` 5255 // Value - READ-ONLY; The list of orders. 5256 Value *[]Order `json:"value,omitempty"` 5257 // NextLink - READ-ONLY; Link to the next set of results. 5258 NextLink *string `json:"nextLink,omitempty"` 5259} 5260 5261// MarshalJSON is the custom marshaler for OrderList. 5262func (ol OrderList) MarshalJSON() ([]byte, error) { 5263 objectMap := make(map[string]interface{}) 5264 return json.Marshal(objectMap) 5265} 5266 5267// OrderListIterator provides access to a complete listing of Order values. 5268type OrderListIterator struct { 5269 i int 5270 page OrderListPage 5271} 5272 5273// NextWithContext advances to the next value. If there was an error making 5274// the request the iterator does not advance and the error is returned. 5275func (iter *OrderListIterator) NextWithContext(ctx context.Context) (err error) { 5276 if tracing.IsEnabled() { 5277 ctx = tracing.StartSpan(ctx, fqdn+"/OrderListIterator.NextWithContext") 5278 defer func() { 5279 sc := -1 5280 if iter.Response().Response.Response != nil { 5281 sc = iter.Response().Response.Response.StatusCode 5282 } 5283 tracing.EndSpan(ctx, sc, err) 5284 }() 5285 } 5286 iter.i++ 5287 if iter.i < len(iter.page.Values()) { 5288 return nil 5289 } 5290 err = iter.page.NextWithContext(ctx) 5291 if err != nil { 5292 iter.i-- 5293 return err 5294 } 5295 iter.i = 0 5296 return nil 5297} 5298 5299// Next advances to the next value. If there was an error making 5300// the request the iterator does not advance and the error is returned. 5301// Deprecated: Use NextWithContext() instead. 5302func (iter *OrderListIterator) Next() error { 5303 return iter.NextWithContext(context.Background()) 5304} 5305 5306// NotDone returns true if the enumeration should be started or is not yet complete. 5307func (iter OrderListIterator) NotDone() bool { 5308 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 5309} 5310 5311// Response returns the raw server response from the last page request. 5312func (iter OrderListIterator) Response() OrderList { 5313 return iter.page.Response() 5314} 5315 5316// Value returns the current value or a zero-initialized value if the 5317// iterator has advanced beyond the end of the collection. 5318func (iter OrderListIterator) Value() Order { 5319 if !iter.page.NotDone() { 5320 return Order{} 5321 } 5322 return iter.page.Values()[iter.i] 5323} 5324 5325// Creates a new instance of the OrderListIterator type. 5326func NewOrderListIterator(page OrderListPage) OrderListIterator { 5327 return OrderListIterator{page: page} 5328} 5329 5330// IsEmpty returns true if the ListResult contains no values. 5331func (ol OrderList) IsEmpty() bool { 5332 return ol.Value == nil || len(*ol.Value) == 0 5333} 5334 5335// hasNextLink returns true if the NextLink is not empty. 5336func (ol OrderList) hasNextLink() bool { 5337 return ol.NextLink != nil && len(*ol.NextLink) != 0 5338} 5339 5340// orderListPreparer prepares a request to retrieve the next set of results. 5341// It returns nil if no more results exist. 5342func (ol OrderList) orderListPreparer(ctx context.Context) (*http.Request, error) { 5343 if !ol.hasNextLink() { 5344 return nil, nil 5345 } 5346 return autorest.Prepare((&http.Request{}).WithContext(ctx), 5347 autorest.AsJSON(), 5348 autorest.AsGet(), 5349 autorest.WithBaseURL(to.String(ol.NextLink))) 5350} 5351 5352// OrderListPage contains a page of Order values. 5353type OrderListPage struct { 5354 fn func(context.Context, OrderList) (OrderList, error) 5355 ol OrderList 5356} 5357 5358// NextWithContext advances to the next page of values. If there was an error making 5359// the request the page does not advance and the error is returned. 5360func (page *OrderListPage) NextWithContext(ctx context.Context) (err error) { 5361 if tracing.IsEnabled() { 5362 ctx = tracing.StartSpan(ctx, fqdn+"/OrderListPage.NextWithContext") 5363 defer func() { 5364 sc := -1 5365 if page.Response().Response.Response != nil { 5366 sc = page.Response().Response.Response.StatusCode 5367 } 5368 tracing.EndSpan(ctx, sc, err) 5369 }() 5370 } 5371 for { 5372 next, err := page.fn(ctx, page.ol) 5373 if err != nil { 5374 return err 5375 } 5376 page.ol = next 5377 if !next.hasNextLink() || !next.IsEmpty() { 5378 break 5379 } 5380 } 5381 return nil 5382} 5383 5384// Next advances to the next page of values. If there was an error making 5385// the request the page does not advance and the error is returned. 5386// Deprecated: Use NextWithContext() instead. 5387func (page *OrderListPage) Next() error { 5388 return page.NextWithContext(context.Background()) 5389} 5390 5391// NotDone returns true if the page enumeration should be started or is not yet complete. 5392func (page OrderListPage) NotDone() bool { 5393 return !page.ol.IsEmpty() 5394} 5395 5396// Response returns the raw server response from the last page request. 5397func (page OrderListPage) Response() OrderList { 5398 return page.ol 5399} 5400 5401// Values returns the slice of values for the current page or nil if there are no values. 5402func (page OrderListPage) Values() []Order { 5403 if page.ol.IsEmpty() { 5404 return nil 5405 } 5406 return *page.ol.Value 5407} 5408 5409// Creates a new instance of the OrderListPage type. 5410func NewOrderListPage(cur OrderList, getNextPage func(context.Context, OrderList) (OrderList, error)) OrderListPage { 5411 return OrderListPage{ 5412 fn: getNextPage, 5413 ol: cur, 5414 } 5415} 5416 5417// OrderProperties order properties. 5418type OrderProperties struct { 5419 // ContactInformation - The contact details. 5420 ContactInformation *ContactDetails `json:"contactInformation,omitempty"` 5421 // ShippingAddress - The shipping address. 5422 ShippingAddress *Address `json:"shippingAddress,omitempty"` 5423 // CurrentStatus - READ-ONLY; Current status of the order. 5424 CurrentStatus *OrderStatus `json:"currentStatus,omitempty"` 5425 // OrderHistory - READ-ONLY; List of status changes in the order. 5426 OrderHistory *[]OrderStatus `json:"orderHistory,omitempty"` 5427 // SerialNumber - READ-ONLY; Serial number of the device. 5428 SerialNumber *string `json:"serialNumber,omitempty"` 5429 // DeliveryTrackingInfo - READ-ONLY; Tracking information for the package delivered to the customer whether it has an original or a replacement device. 5430 DeliveryTrackingInfo *[]TrackingInfo `json:"deliveryTrackingInfo,omitempty"` 5431 // ReturnTrackingInfo - READ-ONLY; Tracking information for the package returned from the customer whether it has an original or a replacement device. 5432 ReturnTrackingInfo *[]TrackingInfo `json:"returnTrackingInfo,omitempty"` 5433 // ShipmentType - ShipmentType of the order. Possible values include: 'NotApplicable', 'ShippedToCustomer', 'SelfPickup' 5434 ShipmentType ShipmentType `json:"shipmentType,omitempty"` 5435} 5436 5437// MarshalJSON is the custom marshaler for OrderProperties. 5438func (op OrderProperties) MarshalJSON() ([]byte, error) { 5439 objectMap := make(map[string]interface{}) 5440 if op.ContactInformation != nil { 5441 objectMap["contactInformation"] = op.ContactInformation 5442 } 5443 if op.ShippingAddress != nil { 5444 objectMap["shippingAddress"] = op.ShippingAddress 5445 } 5446 if op.ShipmentType != "" { 5447 objectMap["shipmentType"] = op.ShipmentType 5448 } 5449 return json.Marshal(objectMap) 5450} 5451 5452// OrdersCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 5453// operation. 5454type OrdersCreateOrUpdateFuture struct { 5455 azure.FutureAPI 5456 // Result returns the result of the asynchronous operation. 5457 // If the operation has not completed it will return an error. 5458 Result func(OrdersClient) (Order, error) 5459} 5460 5461// UnmarshalJSON is the custom unmarshaller for CreateFuture. 5462func (future *OrdersCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 5463 var azFuture azure.Future 5464 if err := json.Unmarshal(body, &azFuture); err != nil { 5465 return err 5466 } 5467 future.FutureAPI = &azFuture 5468 future.Result = future.result 5469 return nil 5470} 5471 5472// result is the default implementation for OrdersCreateOrUpdateFuture.Result. 5473func (future *OrdersCreateOrUpdateFuture) result(client OrdersClient) (o Order, err error) { 5474 var done bool 5475 done, err = future.DoneWithContext(context.Background(), client) 5476 if err != nil { 5477 err = autorest.NewErrorWithError(err, "databoxedge.OrdersCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 5478 return 5479 } 5480 if !done { 5481 o.Response.Response = future.Response() 5482 err = azure.NewAsyncOpIncompleteError("databoxedge.OrdersCreateOrUpdateFuture") 5483 return 5484 } 5485 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 5486 if o.Response.Response, err = future.GetResult(sender); err == nil && o.Response.Response.StatusCode != http.StatusNoContent { 5487 o, err = client.CreateOrUpdateResponder(o.Response.Response) 5488 if err != nil { 5489 err = autorest.NewErrorWithError(err, "databoxedge.OrdersCreateOrUpdateFuture", "Result", o.Response.Response, "Failure responding to request") 5490 } 5491 } 5492 return 5493} 5494 5495// OrdersDeleteFuture an abstraction for monitoring and retrieving the results of a long-running operation. 5496type OrdersDeleteFuture struct { 5497 azure.FutureAPI 5498 // Result returns the result of the asynchronous operation. 5499 // If the operation has not completed it will return an error. 5500 Result func(OrdersClient) (autorest.Response, error) 5501} 5502 5503// UnmarshalJSON is the custom unmarshaller for CreateFuture. 5504func (future *OrdersDeleteFuture) UnmarshalJSON(body []byte) error { 5505 var azFuture azure.Future 5506 if err := json.Unmarshal(body, &azFuture); err != nil { 5507 return err 5508 } 5509 future.FutureAPI = &azFuture 5510 future.Result = future.result 5511 return nil 5512} 5513 5514// result is the default implementation for OrdersDeleteFuture.Result. 5515func (future *OrdersDeleteFuture) result(client OrdersClient) (ar autorest.Response, err error) { 5516 var done bool 5517 done, err = future.DoneWithContext(context.Background(), client) 5518 if err != nil { 5519 err = autorest.NewErrorWithError(err, "databoxedge.OrdersDeleteFuture", "Result", future.Response(), "Polling failure") 5520 return 5521 } 5522 if !done { 5523 ar.Response = future.Response() 5524 err = azure.NewAsyncOpIncompleteError("databoxedge.OrdersDeleteFuture") 5525 return 5526 } 5527 ar.Response = future.Response() 5528 return 5529} 5530 5531// OrderStatus represents a single status change. 5532type OrderStatus struct { 5533 // Status - Status of the order as per the allowed status types. Possible values include: 'Untracked', 'AwaitingFulfilment', 'AwaitingPreparation', 'AwaitingShipment', 'Shipped', 'Arriving', 'Delivered', 'ReplacementRequested', 'LostDevice', 'Declined', 'ReturnInitiated', 'AwaitingReturnShipment', 'ShippedBack', 'CollectedAtMicrosoft', 'AwaitingPickup', 'PickupCompleted', 'AwaitingDrop' 5534 Status OrderState `json:"status,omitempty"` 5535 // UpdateDateTime - READ-ONLY; Time of status update. 5536 UpdateDateTime *date.Time `json:"updateDateTime,omitempty"` 5537 // Comments - Comments related to this status change. 5538 Comments *string `json:"comments,omitempty"` 5539 // TrackingInformation - READ-ONLY; Tracking information related to the state in the ordering flow 5540 TrackingInformation *TrackingInfo `json:"trackingInformation,omitempty"` 5541 // AdditionalOrderDetails - READ-ONLY; Dictionary to hold generic information which is not stored 5542 // by the already existing properties 5543 AdditionalOrderDetails map[string]*string `json:"additionalOrderDetails"` 5544} 5545 5546// MarshalJSON is the custom marshaler for OrderStatus. 5547func (osVar OrderStatus) MarshalJSON() ([]byte, error) { 5548 objectMap := make(map[string]interface{}) 5549 if osVar.Status != "" { 5550 objectMap["status"] = osVar.Status 5551 } 5552 if osVar.Comments != nil { 5553 objectMap["comments"] = osVar.Comments 5554 } 5555 return json.Marshal(objectMap) 5556} 5557 5558// PeriodicTimerEventTrigger trigger details. 5559type PeriodicTimerEventTrigger struct { 5560 // PeriodicTimerProperties - Periodic timer trigger properties. 5561 *PeriodicTimerProperties `json:"properties,omitempty"` 5562 // SystemData - Trigger in DataBoxEdge Resource 5563 SystemData *SystemData `json:"systemData,omitempty"` 5564 // Kind - Possible values include: 'KindTrigger', 'KindFileEvent', 'KindPeriodicTimerEvent' 5565 Kind KindBasicTrigger `json:"kind,omitempty"` 5566 // ID - READ-ONLY; The path ID that uniquely identifies the object. 5567 ID *string `json:"id,omitempty"` 5568 // Name - READ-ONLY; The object name. 5569 Name *string `json:"name,omitempty"` 5570 // Type - READ-ONLY; The hierarchical type of the object. 5571 Type *string `json:"type,omitempty"` 5572} 5573 5574// MarshalJSON is the custom marshaler for PeriodicTimerEventTrigger. 5575func (ptet PeriodicTimerEventTrigger) MarshalJSON() ([]byte, error) { 5576 ptet.Kind = KindPeriodicTimerEvent 5577 objectMap := make(map[string]interface{}) 5578 if ptet.PeriodicTimerProperties != nil { 5579 objectMap["properties"] = ptet.PeriodicTimerProperties 5580 } 5581 if ptet.SystemData != nil { 5582 objectMap["systemData"] = ptet.SystemData 5583 } 5584 if ptet.Kind != "" { 5585 objectMap["kind"] = ptet.Kind 5586 } 5587 return json.Marshal(objectMap) 5588} 5589 5590// AsFileEventTrigger is the BasicTrigger implementation for PeriodicTimerEventTrigger. 5591func (ptet PeriodicTimerEventTrigger) AsFileEventTrigger() (*FileEventTrigger, bool) { 5592 return nil, false 5593} 5594 5595// AsPeriodicTimerEventTrigger is the BasicTrigger implementation for PeriodicTimerEventTrigger. 5596func (ptet PeriodicTimerEventTrigger) AsPeriodicTimerEventTrigger() (*PeriodicTimerEventTrigger, bool) { 5597 return &ptet, true 5598} 5599 5600// AsTrigger is the BasicTrigger implementation for PeriodicTimerEventTrigger. 5601func (ptet PeriodicTimerEventTrigger) AsTrigger() (*Trigger, bool) { 5602 return nil, false 5603} 5604 5605// AsBasicTrigger is the BasicTrigger implementation for PeriodicTimerEventTrigger. 5606func (ptet PeriodicTimerEventTrigger) AsBasicTrigger() (BasicTrigger, bool) { 5607 return &ptet, true 5608} 5609 5610// UnmarshalJSON is the custom unmarshaler for PeriodicTimerEventTrigger struct. 5611func (ptet *PeriodicTimerEventTrigger) UnmarshalJSON(body []byte) error { 5612 var m map[string]*json.RawMessage 5613 err := json.Unmarshal(body, &m) 5614 if err != nil { 5615 return err 5616 } 5617 for k, v := range m { 5618 switch k { 5619 case "properties": 5620 if v != nil { 5621 var periodicTimerProperties PeriodicTimerProperties 5622 err = json.Unmarshal(*v, &periodicTimerProperties) 5623 if err != nil { 5624 return err 5625 } 5626 ptet.PeriodicTimerProperties = &periodicTimerProperties 5627 } 5628 case "systemData": 5629 if v != nil { 5630 var systemData SystemData 5631 err = json.Unmarshal(*v, &systemData) 5632 if err != nil { 5633 return err 5634 } 5635 ptet.SystemData = &systemData 5636 } 5637 case "kind": 5638 if v != nil { 5639 var kind KindBasicTrigger 5640 err = json.Unmarshal(*v, &kind) 5641 if err != nil { 5642 return err 5643 } 5644 ptet.Kind = kind 5645 } 5646 case "id": 5647 if v != nil { 5648 var ID string 5649 err = json.Unmarshal(*v, &ID) 5650 if err != nil { 5651 return err 5652 } 5653 ptet.ID = &ID 5654 } 5655 case "name": 5656 if v != nil { 5657 var name string 5658 err = json.Unmarshal(*v, &name) 5659 if err != nil { 5660 return err 5661 } 5662 ptet.Name = &name 5663 } 5664 case "type": 5665 if v != nil { 5666 var typeVar string 5667 err = json.Unmarshal(*v, &typeVar) 5668 if err != nil { 5669 return err 5670 } 5671 ptet.Type = &typeVar 5672 } 5673 } 5674 } 5675 5676 return nil 5677} 5678 5679// PeriodicTimerProperties periodic timer trigger properties. 5680type PeriodicTimerProperties struct { 5681 // SourceInfo - Periodic timer details. 5682 SourceInfo *PeriodicTimerSourceInfo `json:"sourceInfo,omitempty"` 5683 // SinkInfo - Role Sink information. 5684 SinkInfo *RoleSinkInfo `json:"sinkInfo,omitempty"` 5685 // CustomContextTag - A custom context tag typically used to correlate the trigger against its usage. For example, if a periodic timer trigger is intended for certain specific IoT modules in the device, the tag can be the name or the image URL of the module. 5686 CustomContextTag *string `json:"customContextTag,omitempty"` 5687} 5688 5689// PeriodicTimerSourceInfo periodic timer event source. 5690type PeriodicTimerSourceInfo struct { 5691 // StartTime - The time of the day that results in a valid trigger. Schedule is computed with reference to the time specified upto seconds. If timezone is not specified the time will considered to be in device timezone. The value will always be returned as UTC time. 5692 StartTime *date.Time `json:"startTime,omitempty"` 5693 // Schedule - Periodic frequency at which timer event needs to be raised. Supports daily, hourly, minutes, and seconds. 5694 Schedule *string `json:"schedule,omitempty"` 5695 // Topic - Topic where periodic events are published to IoT device. 5696 Topic *string `json:"topic,omitempty"` 5697} 5698 5699// RawCertificateData raw Certificate Data. 5700type RawCertificateData struct { 5701 // AuthenticationType - The authentication type. Possible values include: 'AuthenticationTypeInvalid', 'AuthenticationTypeAzureActiveDirectory' 5702 AuthenticationType AuthenticationType `json:"authenticationType,omitempty"` 5703 // Certificate - The base64 encoded certificate raw data. 5704 Certificate *string `json:"certificate,omitempty"` 5705} 5706 5707// RefreshDetails fields for tracking refresh job on the share or container. 5708type RefreshDetails struct { 5709 // InProgressRefreshJobID - If a refresh job is currently in progress on this share or container, this field indicates the ARM resource ID of that job. The field is empty if no job is in progress. 5710 InProgressRefreshJobID *string `json:"inProgressRefreshJobId,omitempty"` 5711 // LastCompletedRefreshJobTimeInUTC - Indicates the completed time for the last refresh job on this particular share or container, if any.This could be a failed job or a successful job. 5712 LastCompletedRefreshJobTimeInUTC *date.Time `json:"lastCompletedRefreshJobTimeInUTC,omitempty"` 5713 // ErrorManifestFile - Indicates the relative path of the error xml for the last refresh job on this particular share or container, if any. This could be a failed job or a successful job. 5714 ErrorManifestFile *string `json:"errorManifestFile,omitempty"` 5715 // LastJob - Indicates the id of the last refresh job on this particular share or container,if any. This could be a failed job or a successful job. 5716 LastJob *string `json:"lastJob,omitempty"` 5717} 5718 5719// ResourceIdentity msi identity details of the resource 5720type ResourceIdentity struct { 5721 // Type - Identity type. Possible values include: 'MsiIdentityTypeNone', 'MsiIdentityTypeSystemAssigned', 'MsiIdentityTypeUserAssigned' 5722 Type MsiIdentityType `json:"type,omitempty"` 5723 // PrincipalID - READ-ONLY; Service Principal Id backing the Msi 5724 PrincipalID *string `json:"principalId,omitempty"` 5725 // TenantID - READ-ONLY; Home Tenant Id 5726 TenantID *string `json:"tenantId,omitempty"` 5727} 5728 5729// MarshalJSON is the custom marshaler for ResourceIdentity. 5730func (ri ResourceIdentity) MarshalJSON() ([]byte, error) { 5731 objectMap := make(map[string]interface{}) 5732 if ri.Type != "" { 5733 objectMap["type"] = ri.Type 5734 } 5735 return json.Marshal(objectMap) 5736} 5737 5738// ResourceMoveDetails fields for tracking resource move 5739type ResourceMoveDetails struct { 5740 // OperationInProgress - Denotes whether move operation is in progress. Possible values include: 'ResourceMoveStatusNone', 'ResourceMoveStatusResourceMoveInProgress', 'ResourceMoveStatusResourceMoveFailed' 5741 OperationInProgress ResourceMoveStatus `json:"operationInProgress,omitempty"` 5742 // OperationInProgressLockTimeoutInUTC - Denotes the timeout of the operation to finish 5743 OperationInProgressLockTimeoutInUTC *date.Time `json:"operationInProgressLockTimeoutInUTC,omitempty"` 5744} 5745 5746// ResourceTypeSku resource type Sku object 5747type ResourceTypeSku struct { 5748 // ResourceType - READ-ONLY; The resource type. 5749 ResourceType *string `json:"resourceType,omitempty"` 5750 // Skus - READ-ONLY; The skus. 5751 Skus *[]SkuInformation `json:"skus,omitempty"` 5752} 5753 5754// MarshalJSON is the custom marshaler for ResourceTypeSku. 5755func (rts ResourceTypeSku) MarshalJSON() ([]byte, error) { 5756 objectMap := make(map[string]interface{}) 5757 return json.Marshal(objectMap) 5758} 5759 5760// BasicRole compute role. 5761type BasicRole interface { 5762 AsCloudEdgeManagementRole() (*CloudEdgeManagementRole, bool) 5763 AsIoTRole() (*IoTRole, bool) 5764 AsKubernetesRole() (*KubernetesRole, bool) 5765 AsMECRole() (*MECRole, bool) 5766 AsRole() (*Role, bool) 5767} 5768 5769// Role compute role. 5770type Role struct { 5771 autorest.Response `json:"-"` 5772 // SystemData - Role configured on ASE resource 5773 SystemData *SystemData `json:"systemData,omitempty"` 5774 // Kind - Possible values include: 'KindRole', 'KindCloudEdgeManagement', 'KindIOT', 'KindKubernetes', 'KindMEC' 5775 Kind KindBasicRole `json:"kind,omitempty"` 5776 // ID - READ-ONLY; The path ID that uniquely identifies the object. 5777 ID *string `json:"id,omitempty"` 5778 // Name - READ-ONLY; The object name. 5779 Name *string `json:"name,omitempty"` 5780 // Type - READ-ONLY; The hierarchical type of the object. 5781 Type *string `json:"type,omitempty"` 5782} 5783 5784func unmarshalBasicRole(body []byte) (BasicRole, error) { 5785 var m map[string]interface{} 5786 err := json.Unmarshal(body, &m) 5787 if err != nil { 5788 return nil, err 5789 } 5790 5791 switch m["kind"] { 5792 case string(KindCloudEdgeManagement): 5793 var cemr CloudEdgeManagementRole 5794 err := json.Unmarshal(body, &cemr) 5795 return cemr, err 5796 case string(KindIOT): 5797 var itr IoTRole 5798 err := json.Unmarshal(body, &itr) 5799 return itr, err 5800 case string(KindKubernetes): 5801 var kr KubernetesRole 5802 err := json.Unmarshal(body, &kr) 5803 return kr, err 5804 case string(KindMEC): 5805 var mr MECRole 5806 err := json.Unmarshal(body, &mr) 5807 return mr, err 5808 default: 5809 var r Role 5810 err := json.Unmarshal(body, &r) 5811 return r, err 5812 } 5813} 5814func unmarshalBasicRoleArray(body []byte) ([]BasicRole, error) { 5815 var rawMessages []*json.RawMessage 5816 err := json.Unmarshal(body, &rawMessages) 5817 if err != nil { 5818 return nil, err 5819 } 5820 5821 rArray := make([]BasicRole, len(rawMessages)) 5822 5823 for index, rawMessage := range rawMessages { 5824 r, err := unmarshalBasicRole(*rawMessage) 5825 if err != nil { 5826 return nil, err 5827 } 5828 rArray[index] = r 5829 } 5830 return rArray, nil 5831} 5832 5833// MarshalJSON is the custom marshaler for Role. 5834func (r Role) MarshalJSON() ([]byte, error) { 5835 r.Kind = KindRole 5836 objectMap := make(map[string]interface{}) 5837 if r.SystemData != nil { 5838 objectMap["systemData"] = r.SystemData 5839 } 5840 if r.Kind != "" { 5841 objectMap["kind"] = r.Kind 5842 } 5843 return json.Marshal(objectMap) 5844} 5845 5846// AsCloudEdgeManagementRole is the BasicRole implementation for Role. 5847func (r Role) AsCloudEdgeManagementRole() (*CloudEdgeManagementRole, bool) { 5848 return nil, false 5849} 5850 5851// AsIoTRole is the BasicRole implementation for Role. 5852func (r Role) AsIoTRole() (*IoTRole, bool) { 5853 return nil, false 5854} 5855 5856// AsKubernetesRole is the BasicRole implementation for Role. 5857func (r Role) AsKubernetesRole() (*KubernetesRole, bool) { 5858 return nil, false 5859} 5860 5861// AsMECRole is the BasicRole implementation for Role. 5862func (r Role) AsMECRole() (*MECRole, bool) { 5863 return nil, false 5864} 5865 5866// AsRole is the BasicRole implementation for Role. 5867func (r Role) AsRole() (*Role, bool) { 5868 return &r, true 5869} 5870 5871// AsBasicRole is the BasicRole implementation for Role. 5872func (r Role) AsBasicRole() (BasicRole, bool) { 5873 return &r, true 5874} 5875 5876// RoleList collection of all the roles on the Data Box Edge device. 5877type RoleList struct { 5878 autorest.Response `json:"-"` 5879 // Value - READ-ONLY; The Value. 5880 Value *[]BasicRole `json:"value,omitempty"` 5881 // NextLink - READ-ONLY; Link to the next set of results. 5882 NextLink *string `json:"nextLink,omitempty"` 5883} 5884 5885// MarshalJSON is the custom marshaler for RoleList. 5886func (rl RoleList) MarshalJSON() ([]byte, error) { 5887 objectMap := make(map[string]interface{}) 5888 return json.Marshal(objectMap) 5889} 5890 5891// UnmarshalJSON is the custom unmarshaler for RoleList struct. 5892func (rl *RoleList) UnmarshalJSON(body []byte) error { 5893 var m map[string]*json.RawMessage 5894 err := json.Unmarshal(body, &m) 5895 if err != nil { 5896 return err 5897 } 5898 for k, v := range m { 5899 switch k { 5900 case "value": 5901 if v != nil { 5902 value, err := unmarshalBasicRoleArray(*v) 5903 if err != nil { 5904 return err 5905 } 5906 rl.Value = &value 5907 } 5908 case "nextLink": 5909 if v != nil { 5910 var nextLink string 5911 err = json.Unmarshal(*v, &nextLink) 5912 if err != nil { 5913 return err 5914 } 5915 rl.NextLink = &nextLink 5916 } 5917 } 5918 } 5919 5920 return nil 5921} 5922 5923// RoleListIterator provides access to a complete listing of Role values. 5924type RoleListIterator struct { 5925 i int 5926 page RoleListPage 5927} 5928 5929// NextWithContext advances to the next value. If there was an error making 5930// the request the iterator does not advance and the error is returned. 5931func (iter *RoleListIterator) NextWithContext(ctx context.Context) (err error) { 5932 if tracing.IsEnabled() { 5933 ctx = tracing.StartSpan(ctx, fqdn+"/RoleListIterator.NextWithContext") 5934 defer func() { 5935 sc := -1 5936 if iter.Response().Response.Response != nil { 5937 sc = iter.Response().Response.Response.StatusCode 5938 } 5939 tracing.EndSpan(ctx, sc, err) 5940 }() 5941 } 5942 iter.i++ 5943 if iter.i < len(iter.page.Values()) { 5944 return nil 5945 } 5946 err = iter.page.NextWithContext(ctx) 5947 if err != nil { 5948 iter.i-- 5949 return err 5950 } 5951 iter.i = 0 5952 return nil 5953} 5954 5955// Next advances to the next value. If there was an error making 5956// the request the iterator does not advance and the error is returned. 5957// Deprecated: Use NextWithContext() instead. 5958func (iter *RoleListIterator) Next() error { 5959 return iter.NextWithContext(context.Background()) 5960} 5961 5962// NotDone returns true if the enumeration should be started or is not yet complete. 5963func (iter RoleListIterator) NotDone() bool { 5964 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 5965} 5966 5967// Response returns the raw server response from the last page request. 5968func (iter RoleListIterator) Response() RoleList { 5969 return iter.page.Response() 5970} 5971 5972// Value returns the current value or a zero-initialized value if the 5973// iterator has advanced beyond the end of the collection. 5974func (iter RoleListIterator) Value() BasicRole { 5975 if !iter.page.NotDone() { 5976 return Role{} 5977 } 5978 return iter.page.Values()[iter.i] 5979} 5980 5981// Creates a new instance of the RoleListIterator type. 5982func NewRoleListIterator(page RoleListPage) RoleListIterator { 5983 return RoleListIterator{page: page} 5984} 5985 5986// IsEmpty returns true if the ListResult contains no values. 5987func (rl RoleList) IsEmpty() bool { 5988 return rl.Value == nil || len(*rl.Value) == 0 5989} 5990 5991// hasNextLink returns true if the NextLink is not empty. 5992func (rl RoleList) hasNextLink() bool { 5993 return rl.NextLink != nil && len(*rl.NextLink) != 0 5994} 5995 5996// roleListPreparer prepares a request to retrieve the next set of results. 5997// It returns nil if no more results exist. 5998func (rl RoleList) roleListPreparer(ctx context.Context) (*http.Request, error) { 5999 if !rl.hasNextLink() { 6000 return nil, nil 6001 } 6002 return autorest.Prepare((&http.Request{}).WithContext(ctx), 6003 autorest.AsJSON(), 6004 autorest.AsGet(), 6005 autorest.WithBaseURL(to.String(rl.NextLink))) 6006} 6007 6008// RoleListPage contains a page of BasicRole values. 6009type RoleListPage struct { 6010 fn func(context.Context, RoleList) (RoleList, error) 6011 rl RoleList 6012} 6013 6014// NextWithContext advances to the next page of values. If there was an error making 6015// the request the page does not advance and the error is returned. 6016func (page *RoleListPage) NextWithContext(ctx context.Context) (err error) { 6017 if tracing.IsEnabled() { 6018 ctx = tracing.StartSpan(ctx, fqdn+"/RoleListPage.NextWithContext") 6019 defer func() { 6020 sc := -1 6021 if page.Response().Response.Response != nil { 6022 sc = page.Response().Response.Response.StatusCode 6023 } 6024 tracing.EndSpan(ctx, sc, err) 6025 }() 6026 } 6027 for { 6028 next, err := page.fn(ctx, page.rl) 6029 if err != nil { 6030 return err 6031 } 6032 page.rl = next 6033 if !next.hasNextLink() || !next.IsEmpty() { 6034 break 6035 } 6036 } 6037 return nil 6038} 6039 6040// Next advances to the next page of values. If there was an error making 6041// the request the page does not advance and the error is returned. 6042// Deprecated: Use NextWithContext() instead. 6043func (page *RoleListPage) Next() error { 6044 return page.NextWithContext(context.Background()) 6045} 6046 6047// NotDone returns true if the page enumeration should be started or is not yet complete. 6048func (page RoleListPage) NotDone() bool { 6049 return !page.rl.IsEmpty() 6050} 6051 6052// Response returns the raw server response from the last page request. 6053func (page RoleListPage) Response() RoleList { 6054 return page.rl 6055} 6056 6057// Values returns the slice of values for the current page or nil if there are no values. 6058func (page RoleListPage) Values() []BasicRole { 6059 if page.rl.IsEmpty() { 6060 return nil 6061 } 6062 return *page.rl.Value 6063} 6064 6065// Creates a new instance of the RoleListPage type. 6066func NewRoleListPage(cur RoleList, getNextPage func(context.Context, RoleList) (RoleList, error)) RoleListPage { 6067 return RoleListPage{ 6068 fn: getNextPage, 6069 rl: cur, 6070 } 6071} 6072 6073// RoleModel ... 6074type RoleModel struct { 6075 autorest.Response `json:"-"` 6076 Value BasicRole `json:"value,omitempty"` 6077} 6078 6079// UnmarshalJSON is the custom unmarshaler for RoleModel struct. 6080func (rm *RoleModel) UnmarshalJSON(body []byte) error { 6081 r, err := unmarshalBasicRole(body) 6082 if err != nil { 6083 return err 6084 } 6085 rm.Value = r 6086 6087 return nil 6088} 6089 6090// RolesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 6091// operation. 6092type RolesCreateOrUpdateFuture struct { 6093 azure.FutureAPI 6094 // Result returns the result of the asynchronous operation. 6095 // If the operation has not completed it will return an error. 6096 Result func(RolesClient) (RoleModel, error) 6097} 6098 6099// UnmarshalJSON is the custom unmarshaller for CreateFuture. 6100func (future *RolesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 6101 var azFuture azure.Future 6102 if err := json.Unmarshal(body, &azFuture); err != nil { 6103 return err 6104 } 6105 future.FutureAPI = &azFuture 6106 future.Result = future.result 6107 return nil 6108} 6109 6110// result is the default implementation for RolesCreateOrUpdateFuture.Result. 6111func (future *RolesCreateOrUpdateFuture) result(client RolesClient) (rm RoleModel, err error) { 6112 var done bool 6113 done, err = future.DoneWithContext(context.Background(), client) 6114 if err != nil { 6115 err = autorest.NewErrorWithError(err, "databoxedge.RolesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 6116 return 6117 } 6118 if !done { 6119 rm.Response.Response = future.Response() 6120 err = azure.NewAsyncOpIncompleteError("databoxedge.RolesCreateOrUpdateFuture") 6121 return 6122 } 6123 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 6124 if rm.Response.Response, err = future.GetResult(sender); err == nil && rm.Response.Response.StatusCode != http.StatusNoContent { 6125 rm, err = client.CreateOrUpdateResponder(rm.Response.Response) 6126 if err != nil { 6127 err = autorest.NewErrorWithError(err, "databoxedge.RolesCreateOrUpdateFuture", "Result", rm.Response.Response, "Failure responding to request") 6128 } 6129 } 6130 return 6131} 6132 6133// RolesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running operation. 6134type RolesDeleteFuture struct { 6135 azure.FutureAPI 6136 // Result returns the result of the asynchronous operation. 6137 // If the operation has not completed it will return an error. 6138 Result func(RolesClient) (autorest.Response, error) 6139} 6140 6141// UnmarshalJSON is the custom unmarshaller for CreateFuture. 6142func (future *RolesDeleteFuture) UnmarshalJSON(body []byte) error { 6143 var azFuture azure.Future 6144 if err := json.Unmarshal(body, &azFuture); err != nil { 6145 return err 6146 } 6147 future.FutureAPI = &azFuture 6148 future.Result = future.result 6149 return nil 6150} 6151 6152// result is the default implementation for RolesDeleteFuture.Result. 6153func (future *RolesDeleteFuture) result(client RolesClient) (ar autorest.Response, err error) { 6154 var done bool 6155 done, err = future.DoneWithContext(context.Background(), client) 6156 if err != nil { 6157 err = autorest.NewErrorWithError(err, "databoxedge.RolesDeleteFuture", "Result", future.Response(), "Polling failure") 6158 return 6159 } 6160 if !done { 6161 ar.Response = future.Response() 6162 err = azure.NewAsyncOpIncompleteError("databoxedge.RolesDeleteFuture") 6163 return 6164 } 6165 ar.Response = future.Response() 6166 return 6167} 6168 6169// RoleSinkInfo compute role against which events will be raised. 6170type RoleSinkInfo struct { 6171 // RoleID - Compute role ID. 6172 RoleID *string `json:"roleId,omitempty"` 6173} 6174 6175// Secret holds device secret either as a KeyVault reference or as an encrypted value. 6176type Secret struct { 6177 // EncryptedSecret - Encrypted (using device public key) secret value. 6178 EncryptedSecret *AsymmetricEncryptedSecret `json:"encryptedSecret,omitempty"` 6179 // KeyVaultID - Id of the Key-Vault where secret is stored (ex: secrets/AuthClientSecret/82ef4346187a4033a10d629cde07d740). 6180 KeyVaultID *string `json:"keyVaultId,omitempty"` 6181} 6182 6183// SecuritySettings the security settings of a device. 6184type SecuritySettings struct { 6185 // SecuritySettingsProperties - Properties of the security settings. 6186 *SecuritySettingsProperties `json:"properties,omitempty"` 6187 // ID - READ-ONLY; The path ID that uniquely identifies the object. 6188 ID *string `json:"id,omitempty"` 6189 // Name - READ-ONLY; The object name. 6190 Name *string `json:"name,omitempty"` 6191 // Type - READ-ONLY; The hierarchical type of the object. 6192 Type *string `json:"type,omitempty"` 6193} 6194 6195// MarshalJSON is the custom marshaler for SecuritySettings. 6196func (ss SecuritySettings) MarshalJSON() ([]byte, error) { 6197 objectMap := make(map[string]interface{}) 6198 if ss.SecuritySettingsProperties != nil { 6199 objectMap["properties"] = ss.SecuritySettingsProperties 6200 } 6201 return json.Marshal(objectMap) 6202} 6203 6204// UnmarshalJSON is the custom unmarshaler for SecuritySettings struct. 6205func (ss *SecuritySettings) UnmarshalJSON(body []byte) error { 6206 var m map[string]*json.RawMessage 6207 err := json.Unmarshal(body, &m) 6208 if err != nil { 6209 return err 6210 } 6211 for k, v := range m { 6212 switch k { 6213 case "properties": 6214 if v != nil { 6215 var securitySettingsProperties SecuritySettingsProperties 6216 err = json.Unmarshal(*v, &securitySettingsProperties) 6217 if err != nil { 6218 return err 6219 } 6220 ss.SecuritySettingsProperties = &securitySettingsProperties 6221 } 6222 case "id": 6223 if v != nil { 6224 var ID string 6225 err = json.Unmarshal(*v, &ID) 6226 if err != nil { 6227 return err 6228 } 6229 ss.ID = &ID 6230 } 6231 case "name": 6232 if v != nil { 6233 var name string 6234 err = json.Unmarshal(*v, &name) 6235 if err != nil { 6236 return err 6237 } 6238 ss.Name = &name 6239 } 6240 case "type": 6241 if v != nil { 6242 var typeVar string 6243 err = json.Unmarshal(*v, &typeVar) 6244 if err != nil { 6245 return err 6246 } 6247 ss.Type = &typeVar 6248 } 6249 } 6250 } 6251 6252 return nil 6253} 6254 6255// SecuritySettingsProperties the properties of security settings. 6256type SecuritySettingsProperties struct { 6257 // DeviceAdminPassword - Device administrator password as an encrypted string (encrypted using RSA PKCS #1) is used to sign into the local web UI of the device. The Actual password should have at least 8 characters that are a combination of uppercase, lowercase, numeric, and special characters. 6258 DeviceAdminPassword *AsymmetricEncryptedSecret `json:"deviceAdminPassword,omitempty"` 6259} 6260 6261// ServiceSpecification service specification. 6262type ServiceSpecification struct { 6263 // MetricSpecifications - Metric specification as defined by shoebox. 6264 MetricSpecifications *[]MetricSpecificationV1 `json:"metricSpecifications,omitempty"` 6265} 6266 6267// Share represents a share on the Data Box Edge/Gateway device. 6268type Share struct { 6269 autorest.Response `json:"-"` 6270 // SystemData - Share on ASE device 6271 SystemData *SystemData `json:"systemData,omitempty"` 6272 // ShareProperties - The share properties. 6273 *ShareProperties `json:"properties,omitempty"` 6274 // ID - READ-ONLY; The path ID that uniquely identifies the object. 6275 ID *string `json:"id,omitempty"` 6276 // Name - READ-ONLY; The object name. 6277 Name *string `json:"name,omitempty"` 6278 // Type - READ-ONLY; The hierarchical type of the object. 6279 Type *string `json:"type,omitempty"` 6280} 6281 6282// MarshalJSON is the custom marshaler for Share. 6283func (s Share) MarshalJSON() ([]byte, error) { 6284 objectMap := make(map[string]interface{}) 6285 if s.SystemData != nil { 6286 objectMap["systemData"] = s.SystemData 6287 } 6288 if s.ShareProperties != nil { 6289 objectMap["properties"] = s.ShareProperties 6290 } 6291 return json.Marshal(objectMap) 6292} 6293 6294// UnmarshalJSON is the custom unmarshaler for Share struct. 6295func (s *Share) UnmarshalJSON(body []byte) error { 6296 var m map[string]*json.RawMessage 6297 err := json.Unmarshal(body, &m) 6298 if err != nil { 6299 return err 6300 } 6301 for k, v := range m { 6302 switch k { 6303 case "systemData": 6304 if v != nil { 6305 var systemData SystemData 6306 err = json.Unmarshal(*v, &systemData) 6307 if err != nil { 6308 return err 6309 } 6310 s.SystemData = &systemData 6311 } 6312 case "properties": 6313 if v != nil { 6314 var shareProperties ShareProperties 6315 err = json.Unmarshal(*v, &shareProperties) 6316 if err != nil { 6317 return err 6318 } 6319 s.ShareProperties = &shareProperties 6320 } 6321 case "id": 6322 if v != nil { 6323 var ID string 6324 err = json.Unmarshal(*v, &ID) 6325 if err != nil { 6326 return err 6327 } 6328 s.ID = &ID 6329 } 6330 case "name": 6331 if v != nil { 6332 var name string 6333 err = json.Unmarshal(*v, &name) 6334 if err != nil { 6335 return err 6336 } 6337 s.Name = &name 6338 } 6339 case "type": 6340 if v != nil { 6341 var typeVar string 6342 err = json.Unmarshal(*v, &typeVar) 6343 if err != nil { 6344 return err 6345 } 6346 s.Type = &typeVar 6347 } 6348 } 6349 } 6350 6351 return nil 6352} 6353 6354// ShareAccessRight specifies the mapping between this particular user and the type of access he has on 6355// shares on this device. 6356type ShareAccessRight struct { 6357 // ShareID - The share ID. 6358 ShareID *string `json:"shareId,omitempty"` 6359 // AccessType - Type of access to be allowed on the share for this user. Possible values include: 'Change', 'Read', 'Custom' 6360 AccessType ShareAccessType `json:"accessType,omitempty"` 6361} 6362 6363// ShareList collection of all the shares on the Data Box Edge/Gateway device. 6364type ShareList struct { 6365 autorest.Response `json:"-"` 6366 // Value - READ-ONLY; The list of shares. 6367 Value *[]Share `json:"value,omitempty"` 6368 // NextLink - READ-ONLY; Link to the next set of results. 6369 NextLink *string `json:"nextLink,omitempty"` 6370} 6371 6372// MarshalJSON is the custom marshaler for ShareList. 6373func (sl ShareList) MarshalJSON() ([]byte, error) { 6374 objectMap := make(map[string]interface{}) 6375 return json.Marshal(objectMap) 6376} 6377 6378// ShareListIterator provides access to a complete listing of Share values. 6379type ShareListIterator struct { 6380 i int 6381 page ShareListPage 6382} 6383 6384// NextWithContext advances to the next value. If there was an error making 6385// the request the iterator does not advance and the error is returned. 6386func (iter *ShareListIterator) NextWithContext(ctx context.Context) (err error) { 6387 if tracing.IsEnabled() { 6388 ctx = tracing.StartSpan(ctx, fqdn+"/ShareListIterator.NextWithContext") 6389 defer func() { 6390 sc := -1 6391 if iter.Response().Response.Response != nil { 6392 sc = iter.Response().Response.Response.StatusCode 6393 } 6394 tracing.EndSpan(ctx, sc, err) 6395 }() 6396 } 6397 iter.i++ 6398 if iter.i < len(iter.page.Values()) { 6399 return nil 6400 } 6401 err = iter.page.NextWithContext(ctx) 6402 if err != nil { 6403 iter.i-- 6404 return err 6405 } 6406 iter.i = 0 6407 return nil 6408} 6409 6410// Next advances to the next value. If there was an error making 6411// the request the iterator does not advance and the error is returned. 6412// Deprecated: Use NextWithContext() instead. 6413func (iter *ShareListIterator) Next() error { 6414 return iter.NextWithContext(context.Background()) 6415} 6416 6417// NotDone returns true if the enumeration should be started or is not yet complete. 6418func (iter ShareListIterator) NotDone() bool { 6419 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 6420} 6421 6422// Response returns the raw server response from the last page request. 6423func (iter ShareListIterator) Response() ShareList { 6424 return iter.page.Response() 6425} 6426 6427// Value returns the current value or a zero-initialized value if the 6428// iterator has advanced beyond the end of the collection. 6429func (iter ShareListIterator) Value() Share { 6430 if !iter.page.NotDone() { 6431 return Share{} 6432 } 6433 return iter.page.Values()[iter.i] 6434} 6435 6436// Creates a new instance of the ShareListIterator type. 6437func NewShareListIterator(page ShareListPage) ShareListIterator { 6438 return ShareListIterator{page: page} 6439} 6440 6441// IsEmpty returns true if the ListResult contains no values. 6442func (sl ShareList) IsEmpty() bool { 6443 return sl.Value == nil || len(*sl.Value) == 0 6444} 6445 6446// hasNextLink returns true if the NextLink is not empty. 6447func (sl ShareList) hasNextLink() bool { 6448 return sl.NextLink != nil && len(*sl.NextLink) != 0 6449} 6450 6451// shareListPreparer prepares a request to retrieve the next set of results. 6452// It returns nil if no more results exist. 6453func (sl ShareList) shareListPreparer(ctx context.Context) (*http.Request, error) { 6454 if !sl.hasNextLink() { 6455 return nil, nil 6456 } 6457 return autorest.Prepare((&http.Request{}).WithContext(ctx), 6458 autorest.AsJSON(), 6459 autorest.AsGet(), 6460 autorest.WithBaseURL(to.String(sl.NextLink))) 6461} 6462 6463// ShareListPage contains a page of Share values. 6464type ShareListPage struct { 6465 fn func(context.Context, ShareList) (ShareList, error) 6466 sl ShareList 6467} 6468 6469// NextWithContext advances to the next page of values. If there was an error making 6470// the request the page does not advance and the error is returned. 6471func (page *ShareListPage) NextWithContext(ctx context.Context) (err error) { 6472 if tracing.IsEnabled() { 6473 ctx = tracing.StartSpan(ctx, fqdn+"/ShareListPage.NextWithContext") 6474 defer func() { 6475 sc := -1 6476 if page.Response().Response.Response != nil { 6477 sc = page.Response().Response.Response.StatusCode 6478 } 6479 tracing.EndSpan(ctx, sc, err) 6480 }() 6481 } 6482 for { 6483 next, err := page.fn(ctx, page.sl) 6484 if err != nil { 6485 return err 6486 } 6487 page.sl = next 6488 if !next.hasNextLink() || !next.IsEmpty() { 6489 break 6490 } 6491 } 6492 return nil 6493} 6494 6495// Next advances to the next page of values. If there was an error making 6496// the request the page does not advance and the error is returned. 6497// Deprecated: Use NextWithContext() instead. 6498func (page *ShareListPage) Next() error { 6499 return page.NextWithContext(context.Background()) 6500} 6501 6502// NotDone returns true if the page enumeration should be started or is not yet complete. 6503func (page ShareListPage) NotDone() bool { 6504 return !page.sl.IsEmpty() 6505} 6506 6507// Response returns the raw server response from the last page request. 6508func (page ShareListPage) Response() ShareList { 6509 return page.sl 6510} 6511 6512// Values returns the slice of values for the current page or nil if there are no values. 6513func (page ShareListPage) Values() []Share { 6514 if page.sl.IsEmpty() { 6515 return nil 6516 } 6517 return *page.sl.Value 6518} 6519 6520// Creates a new instance of the ShareListPage type. 6521func NewShareListPage(cur ShareList, getNextPage func(context.Context, ShareList) (ShareList, error)) ShareListPage { 6522 return ShareListPage{ 6523 fn: getNextPage, 6524 sl: cur, 6525 } 6526} 6527 6528// ShareProperties the share properties. 6529type ShareProperties struct { 6530 // Description - Description for the share. 6531 Description *string `json:"description,omitempty"` 6532 // ShareStatus - Current status of the share. Possible values include: 'ShareStatusOffline', 'ShareStatusUnknown', 'ShareStatusOK', 'ShareStatusUpdating', 'ShareStatusNeedsAttention' 6533 ShareStatus ShareStatus `json:"shareStatus,omitempty"` 6534 // MonitoringStatus - Current monitoring status of the share. Possible values include: 'Enabled', 'Disabled' 6535 MonitoringStatus MonitoringStatus `json:"monitoringStatus,omitempty"` 6536 // AzureContainerInfo - Azure container mapping for the share. 6537 AzureContainerInfo *AzureContainerInfo `json:"azureContainerInfo,omitempty"` 6538 // AccessProtocol - Access protocol to be used by the share. Possible values include: 'SMB', 'NFS' 6539 AccessProtocol ShareAccessProtocol `json:"accessProtocol,omitempty"` 6540 // UserAccessRights - Mapping of users and corresponding access rights on the share (required for SMB protocol). 6541 UserAccessRights *[]UserAccessRight `json:"userAccessRights,omitempty"` 6542 // ClientAccessRights - List of IP addresses and corresponding access rights on the share(required for NFS protocol). 6543 ClientAccessRights *[]ClientAccessRight `json:"clientAccessRights,omitempty"` 6544 // RefreshDetails - Details of the refresh job on this share. 6545 RefreshDetails *RefreshDetails `json:"refreshDetails,omitempty"` 6546 // ShareMappings - READ-ONLY; Share mount point to the role. 6547 ShareMappings *[]MountPointMap `json:"shareMappings,omitempty"` 6548 // DataPolicy - Data policy of the share. Possible values include: 'Cloud', 'Local' 6549 DataPolicy DataPolicy `json:"dataPolicy,omitempty"` 6550} 6551 6552// MarshalJSON is the custom marshaler for ShareProperties. 6553func (sp ShareProperties) MarshalJSON() ([]byte, error) { 6554 objectMap := make(map[string]interface{}) 6555 if sp.Description != nil { 6556 objectMap["description"] = sp.Description 6557 } 6558 if sp.ShareStatus != "" { 6559 objectMap["shareStatus"] = sp.ShareStatus 6560 } 6561 if sp.MonitoringStatus != "" { 6562 objectMap["monitoringStatus"] = sp.MonitoringStatus 6563 } 6564 if sp.AzureContainerInfo != nil { 6565 objectMap["azureContainerInfo"] = sp.AzureContainerInfo 6566 } 6567 if sp.AccessProtocol != "" { 6568 objectMap["accessProtocol"] = sp.AccessProtocol 6569 } 6570 if sp.UserAccessRights != nil { 6571 objectMap["userAccessRights"] = sp.UserAccessRights 6572 } 6573 if sp.ClientAccessRights != nil { 6574 objectMap["clientAccessRights"] = sp.ClientAccessRights 6575 } 6576 if sp.RefreshDetails != nil { 6577 objectMap["refreshDetails"] = sp.RefreshDetails 6578 } 6579 if sp.DataPolicy != "" { 6580 objectMap["dataPolicy"] = sp.DataPolicy 6581 } 6582 return json.Marshal(objectMap) 6583} 6584 6585// SharesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 6586// operation. 6587type SharesCreateOrUpdateFuture struct { 6588 azure.FutureAPI 6589 // Result returns the result of the asynchronous operation. 6590 // If the operation has not completed it will return an error. 6591 Result func(SharesClient) (Share, error) 6592} 6593 6594// UnmarshalJSON is the custom unmarshaller for CreateFuture. 6595func (future *SharesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 6596 var azFuture azure.Future 6597 if err := json.Unmarshal(body, &azFuture); err != nil { 6598 return err 6599 } 6600 future.FutureAPI = &azFuture 6601 future.Result = future.result 6602 return nil 6603} 6604 6605// result is the default implementation for SharesCreateOrUpdateFuture.Result. 6606func (future *SharesCreateOrUpdateFuture) result(client SharesClient) (s Share, err error) { 6607 var done bool 6608 done, err = future.DoneWithContext(context.Background(), client) 6609 if err != nil { 6610 err = autorest.NewErrorWithError(err, "databoxedge.SharesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 6611 return 6612 } 6613 if !done { 6614 s.Response.Response = future.Response() 6615 err = azure.NewAsyncOpIncompleteError("databoxedge.SharesCreateOrUpdateFuture") 6616 return 6617 } 6618 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 6619 if s.Response.Response, err = future.GetResult(sender); err == nil && s.Response.Response.StatusCode != http.StatusNoContent { 6620 s, err = client.CreateOrUpdateResponder(s.Response.Response) 6621 if err != nil { 6622 err = autorest.NewErrorWithError(err, "databoxedge.SharesCreateOrUpdateFuture", "Result", s.Response.Response, "Failure responding to request") 6623 } 6624 } 6625 return 6626} 6627 6628// SharesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running operation. 6629type SharesDeleteFuture struct { 6630 azure.FutureAPI 6631 // Result returns the result of the asynchronous operation. 6632 // If the operation has not completed it will return an error. 6633 Result func(SharesClient) (autorest.Response, error) 6634} 6635 6636// UnmarshalJSON is the custom unmarshaller for CreateFuture. 6637func (future *SharesDeleteFuture) UnmarshalJSON(body []byte) error { 6638 var azFuture azure.Future 6639 if err := json.Unmarshal(body, &azFuture); err != nil { 6640 return err 6641 } 6642 future.FutureAPI = &azFuture 6643 future.Result = future.result 6644 return nil 6645} 6646 6647// result is the default implementation for SharesDeleteFuture.Result. 6648func (future *SharesDeleteFuture) result(client SharesClient) (ar autorest.Response, err error) { 6649 var done bool 6650 done, err = future.DoneWithContext(context.Background(), client) 6651 if err != nil { 6652 err = autorest.NewErrorWithError(err, "databoxedge.SharesDeleteFuture", "Result", future.Response(), "Polling failure") 6653 return 6654 } 6655 if !done { 6656 ar.Response = future.Response() 6657 err = azure.NewAsyncOpIncompleteError("databoxedge.SharesDeleteFuture") 6658 return 6659 } 6660 ar.Response = future.Response() 6661 return 6662} 6663 6664// SharesRefreshFuture an abstraction for monitoring and retrieving the results of a long-running 6665// operation. 6666type SharesRefreshFuture struct { 6667 azure.FutureAPI 6668 // Result returns the result of the asynchronous operation. 6669 // If the operation has not completed it will return an error. 6670 Result func(SharesClient) (autorest.Response, error) 6671} 6672 6673// UnmarshalJSON is the custom unmarshaller for CreateFuture. 6674func (future *SharesRefreshFuture) UnmarshalJSON(body []byte) error { 6675 var azFuture azure.Future 6676 if err := json.Unmarshal(body, &azFuture); err != nil { 6677 return err 6678 } 6679 future.FutureAPI = &azFuture 6680 future.Result = future.result 6681 return nil 6682} 6683 6684// result is the default implementation for SharesRefreshFuture.Result. 6685func (future *SharesRefreshFuture) result(client SharesClient) (ar autorest.Response, err error) { 6686 var done bool 6687 done, err = future.DoneWithContext(context.Background(), client) 6688 if err != nil { 6689 err = autorest.NewErrorWithError(err, "databoxedge.SharesRefreshFuture", "Result", future.Response(), "Polling failure") 6690 return 6691 } 6692 if !done { 6693 ar.Response = future.Response() 6694 err = azure.NewAsyncOpIncompleteError("databoxedge.SharesRefreshFuture") 6695 return 6696 } 6697 ar.Response = future.Response() 6698 return 6699} 6700 6701// Sku the SKU type. 6702type Sku struct { 6703 // Name - SKU name. Possible values include: 'Gateway', 'Edge', 'TEA1Node', 'TEA1NodeUPS', 'TEA1NodeHeater', 'TEA1NodeUPSHeater', 'TEA4NodeHeater', 'TEA4NodeUPSHeater', 'TMA', 'TDC', 'TCASmall', 'GPU', 'TCALarge', 'EdgePBase', 'EdgePHigh', 'EdgePRBase', 'EdgePRBaseUPS', 'EdgeMRMini', 'RCASmall', 'RCALarge', 'RDC' 6704 Name SkuName `json:"name,omitempty"` 6705 // Tier - The SKU tier. This is based on the SKU name. Possible values include: 'Standard' 6706 Tier SkuTier `json:"tier,omitempty"` 6707} 6708 6709// SkuCapability the metadata to describe the capability. 6710type SkuCapability struct { 6711 // Name - READ-ONLY; An invariant to describe the feature. 6712 Name *string `json:"name,omitempty"` 6713 // Value - READ-ONLY; An invariant if the feature is measured by quantity. 6714 Value *string `json:"value,omitempty"` 6715} 6716 6717// MarshalJSON is the custom marshaler for SkuCapability. 6718func (sc SkuCapability) MarshalJSON() ([]byte, error) { 6719 objectMap := make(map[string]interface{}) 6720 return json.Marshal(objectMap) 6721} 6722 6723// SkuCost the metadata for retrieving price info. 6724type SkuCost struct { 6725 // MeterID - READ-ONLY; Used for querying price from commerce. 6726 MeterID *string `json:"meterId,omitempty"` 6727 // Quantity - READ-ONLY; The cost quantity. 6728 Quantity *int64 `json:"quantity,omitempty"` 6729 // ExtendedUnit - READ-ONLY; The extended unit. 6730 ExtendedUnit *string `json:"extendedUnit,omitempty"` 6731} 6732 6733// MarshalJSON is the custom marshaler for SkuCost. 6734func (sc SkuCost) MarshalJSON() ([]byte, error) { 6735 objectMap := make(map[string]interface{}) 6736 return json.Marshal(objectMap) 6737} 6738 6739// SkuInformation sku information 6740type SkuInformation struct { 6741 // Name - READ-ONLY; The sku name. 6742 Name *string `json:"name,omitempty"` 6743 // Tier - READ-ONLY; The sku tier. 6744 Tier *string `json:"tier,omitempty"` 6745 // Kind - READ-ONLY; The sku kind. 6746 Kind *string `json:"kind,omitempty"` 6747 // Family - READ-ONLY; The Sku family. 6748 Family *string `json:"family,omitempty"` 6749 // Costs - READ-ONLY; The pricing info of the Sku. 6750 Costs *[]SkuCost `json:"costs,omitempty"` 6751 // Locations - READ-ONLY; The locations where Sku is available. 6752 Locations *[]string `json:"locations,omitempty"` 6753 // LocationInfo - READ-ONLY; The locations where Sku is available with zones and sites info 6754 LocationInfo *[]SkuLocationInfo `json:"locationInfo,omitempty"` 6755 // RequiredQuotaIds - READ-ONLY; The required quotaIds for the sku to be available. 6756 RequiredQuotaIds *[]string `json:"requiredQuotaIds,omitempty"` 6757 // RequiredFeatures - READ-ONLY; The required features for the sku to be available. 6758 RequiredFeatures *[]string `json:"requiredFeatures,omitempty"` 6759} 6760 6761// MarshalJSON is the custom marshaler for SkuInformation. 6762func (si SkuInformation) MarshalJSON() ([]byte, error) { 6763 objectMap := make(map[string]interface{}) 6764 return json.Marshal(objectMap) 6765} 6766 6767// SkuInformationList list of SKU Information objects 6768type SkuInformationList struct { 6769 // Value - READ-ONLY; List of ResourceTypeSku objects 6770 Value *[]ResourceTypeSku `json:"value,omitempty"` 6771 // NextLink - READ-ONLY; Links to the next set of results 6772 NextLink *string `json:"nextLink,omitempty"` 6773} 6774 6775// MarshalJSON is the custom marshaler for SkuInformationList. 6776func (sil SkuInformationList) MarshalJSON() ([]byte, error) { 6777 objectMap := make(map[string]interface{}) 6778 return json.Marshal(objectMap) 6779} 6780 6781// SkuList list of SKU Information objects. 6782type SkuList struct { 6783 autorest.Response `json:"-"` 6784 // Value - READ-ONLY; List of ResourceType Sku 6785 Value *[]SkuType `json:"value,omitempty"` 6786 // NextLink - READ-ONLY; Links to the next set of results 6787 NextLink *string `json:"nextLink,omitempty"` 6788} 6789 6790// MarshalJSON is the custom marshaler for SkuList. 6791func (sl SkuList) MarshalJSON() ([]byte, error) { 6792 objectMap := make(map[string]interface{}) 6793 return json.Marshal(objectMap) 6794} 6795 6796// SkuListIterator provides access to a complete listing of SkuType values. 6797type SkuListIterator struct { 6798 i int 6799 page SkuListPage 6800} 6801 6802// NextWithContext advances to the next value. If there was an error making 6803// the request the iterator does not advance and the error is returned. 6804func (iter *SkuListIterator) NextWithContext(ctx context.Context) (err error) { 6805 if tracing.IsEnabled() { 6806 ctx = tracing.StartSpan(ctx, fqdn+"/SkuListIterator.NextWithContext") 6807 defer func() { 6808 sc := -1 6809 if iter.Response().Response.Response != nil { 6810 sc = iter.Response().Response.Response.StatusCode 6811 } 6812 tracing.EndSpan(ctx, sc, err) 6813 }() 6814 } 6815 iter.i++ 6816 if iter.i < len(iter.page.Values()) { 6817 return nil 6818 } 6819 err = iter.page.NextWithContext(ctx) 6820 if err != nil { 6821 iter.i-- 6822 return err 6823 } 6824 iter.i = 0 6825 return nil 6826} 6827 6828// Next advances to the next value. If there was an error making 6829// the request the iterator does not advance and the error is returned. 6830// Deprecated: Use NextWithContext() instead. 6831func (iter *SkuListIterator) Next() error { 6832 return iter.NextWithContext(context.Background()) 6833} 6834 6835// NotDone returns true if the enumeration should be started or is not yet complete. 6836func (iter SkuListIterator) NotDone() bool { 6837 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 6838} 6839 6840// Response returns the raw server response from the last page request. 6841func (iter SkuListIterator) Response() SkuList { 6842 return iter.page.Response() 6843} 6844 6845// Value returns the current value or a zero-initialized value if the 6846// iterator has advanced beyond the end of the collection. 6847func (iter SkuListIterator) Value() SkuType { 6848 if !iter.page.NotDone() { 6849 return SkuType{} 6850 } 6851 return iter.page.Values()[iter.i] 6852} 6853 6854// Creates a new instance of the SkuListIterator type. 6855func NewSkuListIterator(page SkuListPage) SkuListIterator { 6856 return SkuListIterator{page: page} 6857} 6858 6859// IsEmpty returns true if the ListResult contains no values. 6860func (sl SkuList) IsEmpty() bool { 6861 return sl.Value == nil || len(*sl.Value) == 0 6862} 6863 6864// hasNextLink returns true if the NextLink is not empty. 6865func (sl SkuList) hasNextLink() bool { 6866 return sl.NextLink != nil && len(*sl.NextLink) != 0 6867} 6868 6869// skuListPreparer prepares a request to retrieve the next set of results. 6870// It returns nil if no more results exist. 6871func (sl SkuList) skuListPreparer(ctx context.Context) (*http.Request, error) { 6872 if !sl.hasNextLink() { 6873 return nil, nil 6874 } 6875 return autorest.Prepare((&http.Request{}).WithContext(ctx), 6876 autorest.AsJSON(), 6877 autorest.AsGet(), 6878 autorest.WithBaseURL(to.String(sl.NextLink))) 6879} 6880 6881// SkuListPage contains a page of SkuType values. 6882type SkuListPage struct { 6883 fn func(context.Context, SkuList) (SkuList, error) 6884 sl SkuList 6885} 6886 6887// NextWithContext advances to the next page of values. If there was an error making 6888// the request the page does not advance and the error is returned. 6889func (page *SkuListPage) NextWithContext(ctx context.Context) (err error) { 6890 if tracing.IsEnabled() { 6891 ctx = tracing.StartSpan(ctx, fqdn+"/SkuListPage.NextWithContext") 6892 defer func() { 6893 sc := -1 6894 if page.Response().Response.Response != nil { 6895 sc = page.Response().Response.Response.StatusCode 6896 } 6897 tracing.EndSpan(ctx, sc, err) 6898 }() 6899 } 6900 for { 6901 next, err := page.fn(ctx, page.sl) 6902 if err != nil { 6903 return err 6904 } 6905 page.sl = next 6906 if !next.hasNextLink() || !next.IsEmpty() { 6907 break 6908 } 6909 } 6910 return nil 6911} 6912 6913// Next advances to the next page of values. If there was an error making 6914// the request the page does not advance and the error is returned. 6915// Deprecated: Use NextWithContext() instead. 6916func (page *SkuListPage) Next() error { 6917 return page.NextWithContext(context.Background()) 6918} 6919 6920// NotDone returns true if the page enumeration should be started or is not yet complete. 6921func (page SkuListPage) NotDone() bool { 6922 return !page.sl.IsEmpty() 6923} 6924 6925// Response returns the raw server response from the last page request. 6926func (page SkuListPage) Response() SkuList { 6927 return page.sl 6928} 6929 6930// Values returns the slice of values for the current page or nil if there are no values. 6931func (page SkuListPage) Values() []SkuType { 6932 if page.sl.IsEmpty() { 6933 return nil 6934 } 6935 return *page.sl.Value 6936} 6937 6938// Creates a new instance of the SkuListPage type. 6939func NewSkuListPage(cur SkuList, getNextPage func(context.Context, SkuList) (SkuList, error)) SkuListPage { 6940 return SkuListPage{ 6941 fn: getNextPage, 6942 sl: cur, 6943 } 6944} 6945 6946// SkuLocationInfo the location info. 6947type SkuLocationInfo struct { 6948 // Location - READ-ONLY; The location. 6949 Location *string `json:"location,omitempty"` 6950 // Zones - READ-ONLY; The zones. 6951 Zones *[]string `json:"zones,omitempty"` 6952 // Sites - READ-ONLY; The sites. 6953 Sites *[]string `json:"sites,omitempty"` 6954} 6955 6956// MarshalJSON is the custom marshaler for SkuLocationInfo. 6957func (sli SkuLocationInfo) MarshalJSON() ([]byte, error) { 6958 objectMap := make(map[string]interface{}) 6959 return json.Marshal(objectMap) 6960} 6961 6962// SkuType the Sku information. 6963type SkuType struct { 6964 // ResourceType - READ-ONLY; The type of the resource. 6965 ResourceType *string `json:"resourceType,omitempty"` 6966 // Name - READ-ONLY; The Sku name. Possible values include: 'Gateway', 'Edge', 'TEA1Node', 'TEA1NodeUPS', 'TEA1NodeHeater', 'TEA1NodeUPSHeater', 'TEA4NodeHeater', 'TEA4NodeUPSHeater', 'TMA', 'TDC', 'TCASmall', 'GPU', 'TCALarge', 'EdgePBase', 'EdgePHigh', 'EdgePRBase', 'EdgePRBaseUPS', 'EdgeMRMini', 'RCASmall', 'RCALarge', 'RDC' 6967 Name SkuName `json:"name,omitempty"` 6968 // Kind - READ-ONLY; The Sku kind. 6969 Kind *string `json:"kind,omitempty"` 6970 // Tier - READ-ONLY; The Sku tier. Possible values include: 'Standard' 6971 Tier SkuTier `json:"tier,omitempty"` 6972 // Size - READ-ONLY; The Sku kind. 6973 Size *string `json:"size,omitempty"` 6974 // Family - READ-ONLY; The Sku family. 6975 Family *string `json:"family,omitempty"` 6976 // Locations - READ-ONLY; Availability of the Sku for the region. 6977 Locations *[]string `json:"locations,omitempty"` 6978 // APIVersions - READ-ONLY; The API versions in which Sku is available. 6979 APIVersions *[]string `json:"apiVersions,omitempty"` 6980 // LocationInfo - READ-ONLY; Availability of the Sku for the location/zone/site. 6981 LocationInfo *[]SkuLocationInfo `json:"locationInfo,omitempty"` 6982 // Costs - READ-ONLY; The pricing info of the Sku. 6983 Costs *[]SkuCost `json:"costs,omitempty"` 6984 // SignupOption - READ-ONLY; Sku can be signed up by customer or not. Possible values include: 'SkuSignupOptionNone', 'SkuSignupOptionAvailable' 6985 SignupOption SkuSignupOption `json:"signupOption,omitempty"` 6986 // Version - READ-ONLY; Availability of the Sku as preview/stable. Possible values include: 'Stable', 'Preview' 6987 Version SkuVersion `json:"version,omitempty"` 6988 // Availability - READ-ONLY; Links to the next set of results. Possible values include: 'Available', 'Unavailable' 6989 Availability SkuAvailability `json:"availability,omitempty"` 6990 // ShipmentTypes - READ-ONLY; List of Shipment Types supported by this SKU 6991 ShipmentTypes *[]ShipmentType `json:"shipmentTypes,omitempty"` 6992 // Capabilities - READ-ONLY; The capability info of the SKU. 6993 Capabilities *[]SkuCapability `json:"capabilities,omitempty"` 6994} 6995 6996// MarshalJSON is the custom marshaler for SkuType. 6997func (st SkuType) MarshalJSON() ([]byte, error) { 6998 objectMap := make(map[string]interface{}) 6999 return json.Marshal(objectMap) 7000} 7001 7002// StorageAccount represents a Storage Account on the Data Box Edge/Gateway device. 7003type StorageAccount struct { 7004 autorest.Response `json:"-"` 7005 // SystemData - StorageAccount object on ASE device 7006 SystemData *SystemData `json:"systemData,omitempty"` 7007 // StorageAccountProperties - The Storage Account properties. 7008 *StorageAccountProperties `json:"properties,omitempty"` 7009 // ID - READ-ONLY; The path ID that uniquely identifies the object. 7010 ID *string `json:"id,omitempty"` 7011 // Name - READ-ONLY; The object name. 7012 Name *string `json:"name,omitempty"` 7013 // Type - READ-ONLY; The hierarchical type of the object. 7014 Type *string `json:"type,omitempty"` 7015} 7016 7017// MarshalJSON is the custom marshaler for StorageAccount. 7018func (sa StorageAccount) MarshalJSON() ([]byte, error) { 7019 objectMap := make(map[string]interface{}) 7020 if sa.SystemData != nil { 7021 objectMap["systemData"] = sa.SystemData 7022 } 7023 if sa.StorageAccountProperties != nil { 7024 objectMap["properties"] = sa.StorageAccountProperties 7025 } 7026 return json.Marshal(objectMap) 7027} 7028 7029// UnmarshalJSON is the custom unmarshaler for StorageAccount struct. 7030func (sa *StorageAccount) UnmarshalJSON(body []byte) error { 7031 var m map[string]*json.RawMessage 7032 err := json.Unmarshal(body, &m) 7033 if err != nil { 7034 return err 7035 } 7036 for k, v := range m { 7037 switch k { 7038 case "systemData": 7039 if v != nil { 7040 var systemData SystemData 7041 err = json.Unmarshal(*v, &systemData) 7042 if err != nil { 7043 return err 7044 } 7045 sa.SystemData = &systemData 7046 } 7047 case "properties": 7048 if v != nil { 7049 var storageAccountProperties StorageAccountProperties 7050 err = json.Unmarshal(*v, &storageAccountProperties) 7051 if err != nil { 7052 return err 7053 } 7054 sa.StorageAccountProperties = &storageAccountProperties 7055 } 7056 case "id": 7057 if v != nil { 7058 var ID string 7059 err = json.Unmarshal(*v, &ID) 7060 if err != nil { 7061 return err 7062 } 7063 sa.ID = &ID 7064 } 7065 case "name": 7066 if v != nil { 7067 var name string 7068 err = json.Unmarshal(*v, &name) 7069 if err != nil { 7070 return err 7071 } 7072 sa.Name = &name 7073 } 7074 case "type": 7075 if v != nil { 7076 var typeVar string 7077 err = json.Unmarshal(*v, &typeVar) 7078 if err != nil { 7079 return err 7080 } 7081 sa.Type = &typeVar 7082 } 7083 } 7084 } 7085 7086 return nil 7087} 7088 7089// StorageAccountCredential the storage account credential. 7090type StorageAccountCredential struct { 7091 autorest.Response `json:"-"` 7092 // SystemData - StorageAccountCredential object 7093 SystemData *SystemData `json:"systemData,omitempty"` 7094 // StorageAccountCredentialProperties - The storage account credential properties. 7095 *StorageAccountCredentialProperties `json:"properties,omitempty"` 7096 // ID - READ-ONLY; The path ID that uniquely identifies the object. 7097 ID *string `json:"id,omitempty"` 7098 // Name - READ-ONLY; The object name. 7099 Name *string `json:"name,omitempty"` 7100 // Type - READ-ONLY; The hierarchical type of the object. 7101 Type *string `json:"type,omitempty"` 7102} 7103 7104// MarshalJSON is the custom marshaler for StorageAccountCredential. 7105func (sac StorageAccountCredential) MarshalJSON() ([]byte, error) { 7106 objectMap := make(map[string]interface{}) 7107 if sac.SystemData != nil { 7108 objectMap["systemData"] = sac.SystemData 7109 } 7110 if sac.StorageAccountCredentialProperties != nil { 7111 objectMap["properties"] = sac.StorageAccountCredentialProperties 7112 } 7113 return json.Marshal(objectMap) 7114} 7115 7116// UnmarshalJSON is the custom unmarshaler for StorageAccountCredential struct. 7117func (sac *StorageAccountCredential) UnmarshalJSON(body []byte) error { 7118 var m map[string]*json.RawMessage 7119 err := json.Unmarshal(body, &m) 7120 if err != nil { 7121 return err 7122 } 7123 for k, v := range m { 7124 switch k { 7125 case "systemData": 7126 if v != nil { 7127 var systemData SystemData 7128 err = json.Unmarshal(*v, &systemData) 7129 if err != nil { 7130 return err 7131 } 7132 sac.SystemData = &systemData 7133 } 7134 case "properties": 7135 if v != nil { 7136 var storageAccountCredentialProperties StorageAccountCredentialProperties 7137 err = json.Unmarshal(*v, &storageAccountCredentialProperties) 7138 if err != nil { 7139 return err 7140 } 7141 sac.StorageAccountCredentialProperties = &storageAccountCredentialProperties 7142 } 7143 case "id": 7144 if v != nil { 7145 var ID string 7146 err = json.Unmarshal(*v, &ID) 7147 if err != nil { 7148 return err 7149 } 7150 sac.ID = &ID 7151 } 7152 case "name": 7153 if v != nil { 7154 var name string 7155 err = json.Unmarshal(*v, &name) 7156 if err != nil { 7157 return err 7158 } 7159 sac.Name = &name 7160 } 7161 case "type": 7162 if v != nil { 7163 var typeVar string 7164 err = json.Unmarshal(*v, &typeVar) 7165 if err != nil { 7166 return err 7167 } 7168 sac.Type = &typeVar 7169 } 7170 } 7171 } 7172 7173 return nil 7174} 7175 7176// StorageAccountCredentialList the collection of storage account credentials. 7177type StorageAccountCredentialList struct { 7178 autorest.Response `json:"-"` 7179 // Value - READ-ONLY; The value. 7180 Value *[]StorageAccountCredential `json:"value,omitempty"` 7181 // NextLink - READ-ONLY; Link to the next set of results. 7182 NextLink *string `json:"nextLink,omitempty"` 7183} 7184 7185// MarshalJSON is the custom marshaler for StorageAccountCredentialList. 7186func (sacl StorageAccountCredentialList) MarshalJSON() ([]byte, error) { 7187 objectMap := make(map[string]interface{}) 7188 return json.Marshal(objectMap) 7189} 7190 7191// StorageAccountCredentialListIterator provides access to a complete listing of StorageAccountCredential 7192// values. 7193type StorageAccountCredentialListIterator struct { 7194 i int 7195 page StorageAccountCredentialListPage 7196} 7197 7198// NextWithContext advances to the next value. If there was an error making 7199// the request the iterator does not advance and the error is returned. 7200func (iter *StorageAccountCredentialListIterator) NextWithContext(ctx context.Context) (err error) { 7201 if tracing.IsEnabled() { 7202 ctx = tracing.StartSpan(ctx, fqdn+"/StorageAccountCredentialListIterator.NextWithContext") 7203 defer func() { 7204 sc := -1 7205 if iter.Response().Response.Response != nil { 7206 sc = iter.Response().Response.Response.StatusCode 7207 } 7208 tracing.EndSpan(ctx, sc, err) 7209 }() 7210 } 7211 iter.i++ 7212 if iter.i < len(iter.page.Values()) { 7213 return nil 7214 } 7215 err = iter.page.NextWithContext(ctx) 7216 if err != nil { 7217 iter.i-- 7218 return err 7219 } 7220 iter.i = 0 7221 return nil 7222} 7223 7224// Next advances to the next value. If there was an error making 7225// the request the iterator does not advance and the error is returned. 7226// Deprecated: Use NextWithContext() instead. 7227func (iter *StorageAccountCredentialListIterator) Next() error { 7228 return iter.NextWithContext(context.Background()) 7229} 7230 7231// NotDone returns true if the enumeration should be started or is not yet complete. 7232func (iter StorageAccountCredentialListIterator) NotDone() bool { 7233 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 7234} 7235 7236// Response returns the raw server response from the last page request. 7237func (iter StorageAccountCredentialListIterator) Response() StorageAccountCredentialList { 7238 return iter.page.Response() 7239} 7240 7241// Value returns the current value or a zero-initialized value if the 7242// iterator has advanced beyond the end of the collection. 7243func (iter StorageAccountCredentialListIterator) Value() StorageAccountCredential { 7244 if !iter.page.NotDone() { 7245 return StorageAccountCredential{} 7246 } 7247 return iter.page.Values()[iter.i] 7248} 7249 7250// Creates a new instance of the StorageAccountCredentialListIterator type. 7251func NewStorageAccountCredentialListIterator(page StorageAccountCredentialListPage) StorageAccountCredentialListIterator { 7252 return StorageAccountCredentialListIterator{page: page} 7253} 7254 7255// IsEmpty returns true if the ListResult contains no values. 7256func (sacl StorageAccountCredentialList) IsEmpty() bool { 7257 return sacl.Value == nil || len(*sacl.Value) == 0 7258} 7259 7260// hasNextLink returns true if the NextLink is not empty. 7261func (sacl StorageAccountCredentialList) hasNextLink() bool { 7262 return sacl.NextLink != nil && len(*sacl.NextLink) != 0 7263} 7264 7265// storageAccountCredentialListPreparer prepares a request to retrieve the next set of results. 7266// It returns nil if no more results exist. 7267func (sacl StorageAccountCredentialList) storageAccountCredentialListPreparer(ctx context.Context) (*http.Request, error) { 7268 if !sacl.hasNextLink() { 7269 return nil, nil 7270 } 7271 return autorest.Prepare((&http.Request{}).WithContext(ctx), 7272 autorest.AsJSON(), 7273 autorest.AsGet(), 7274 autorest.WithBaseURL(to.String(sacl.NextLink))) 7275} 7276 7277// StorageAccountCredentialListPage contains a page of StorageAccountCredential values. 7278type StorageAccountCredentialListPage struct { 7279 fn func(context.Context, StorageAccountCredentialList) (StorageAccountCredentialList, error) 7280 sacl StorageAccountCredentialList 7281} 7282 7283// NextWithContext advances to the next page of values. If there was an error making 7284// the request the page does not advance and the error is returned. 7285func (page *StorageAccountCredentialListPage) NextWithContext(ctx context.Context) (err error) { 7286 if tracing.IsEnabled() { 7287 ctx = tracing.StartSpan(ctx, fqdn+"/StorageAccountCredentialListPage.NextWithContext") 7288 defer func() { 7289 sc := -1 7290 if page.Response().Response.Response != nil { 7291 sc = page.Response().Response.Response.StatusCode 7292 } 7293 tracing.EndSpan(ctx, sc, err) 7294 }() 7295 } 7296 for { 7297 next, err := page.fn(ctx, page.sacl) 7298 if err != nil { 7299 return err 7300 } 7301 page.sacl = next 7302 if !next.hasNextLink() || !next.IsEmpty() { 7303 break 7304 } 7305 } 7306 return nil 7307} 7308 7309// Next advances to the next page of values. If there was an error making 7310// the request the page does not advance and the error is returned. 7311// Deprecated: Use NextWithContext() instead. 7312func (page *StorageAccountCredentialListPage) Next() error { 7313 return page.NextWithContext(context.Background()) 7314} 7315 7316// NotDone returns true if the page enumeration should be started or is not yet complete. 7317func (page StorageAccountCredentialListPage) NotDone() bool { 7318 return !page.sacl.IsEmpty() 7319} 7320 7321// Response returns the raw server response from the last page request. 7322func (page StorageAccountCredentialListPage) Response() StorageAccountCredentialList { 7323 return page.sacl 7324} 7325 7326// Values returns the slice of values for the current page or nil if there are no values. 7327func (page StorageAccountCredentialListPage) Values() []StorageAccountCredential { 7328 if page.sacl.IsEmpty() { 7329 return nil 7330 } 7331 return *page.sacl.Value 7332} 7333 7334// Creates a new instance of the StorageAccountCredentialListPage type. 7335func NewStorageAccountCredentialListPage(cur StorageAccountCredentialList, getNextPage func(context.Context, StorageAccountCredentialList) (StorageAccountCredentialList, error)) StorageAccountCredentialListPage { 7336 return StorageAccountCredentialListPage{ 7337 fn: getNextPage, 7338 sacl: cur, 7339 } 7340} 7341 7342// StorageAccountCredentialProperties the storage account credential properties. 7343type StorageAccountCredentialProperties struct { 7344 // Alias - Alias for the storage account. 7345 Alias *string `json:"alias,omitempty"` 7346 // UserName - Username for the storage account. 7347 UserName *string `json:"userName,omitempty"` 7348 // AccountKey - Encrypted storage key. 7349 AccountKey *AsymmetricEncryptedSecret `json:"accountKey,omitempty"` 7350 // ConnectionString - Connection string for the storage account. Use this string if username and account key are not specified. 7351 ConnectionString *string `json:"connectionString,omitempty"` 7352 // SslStatus - Signifies whether SSL needs to be enabled or not. Possible values include: 'SSLStatusEnabled', 'SSLStatusDisabled' 7353 SslStatus SSLStatus `json:"sslStatus,omitempty"` 7354 // BlobDomainName - Blob end point for private clouds. 7355 BlobDomainName *string `json:"blobDomainName,omitempty"` 7356 // AccountType - Type of storage accessed on the storage account. Possible values include: 'GeneralPurposeStorage', 'BlobStorage' 7357 AccountType AccountType `json:"accountType,omitempty"` 7358 // StorageAccountID - Id of the storage account. 7359 StorageAccountID *string `json:"storageAccountId,omitempty"` 7360} 7361 7362// StorageAccountCredentialsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results 7363// of a long-running operation. 7364type StorageAccountCredentialsCreateOrUpdateFuture struct { 7365 azure.FutureAPI 7366 // Result returns the result of the asynchronous operation. 7367 // If the operation has not completed it will return an error. 7368 Result func(StorageAccountCredentialsClient) (StorageAccountCredential, error) 7369} 7370 7371// UnmarshalJSON is the custom unmarshaller for CreateFuture. 7372func (future *StorageAccountCredentialsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 7373 var azFuture azure.Future 7374 if err := json.Unmarshal(body, &azFuture); err != nil { 7375 return err 7376 } 7377 future.FutureAPI = &azFuture 7378 future.Result = future.result 7379 return nil 7380} 7381 7382// result is the default implementation for StorageAccountCredentialsCreateOrUpdateFuture.Result. 7383func (future *StorageAccountCredentialsCreateOrUpdateFuture) result(client StorageAccountCredentialsClient) (sac StorageAccountCredential, err error) { 7384 var done bool 7385 done, err = future.DoneWithContext(context.Background(), client) 7386 if err != nil { 7387 err = autorest.NewErrorWithError(err, "databoxedge.StorageAccountCredentialsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 7388 return 7389 } 7390 if !done { 7391 sac.Response.Response = future.Response() 7392 err = azure.NewAsyncOpIncompleteError("databoxedge.StorageAccountCredentialsCreateOrUpdateFuture") 7393 return 7394 } 7395 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 7396 if sac.Response.Response, err = future.GetResult(sender); err == nil && sac.Response.Response.StatusCode != http.StatusNoContent { 7397 sac, err = client.CreateOrUpdateResponder(sac.Response.Response) 7398 if err != nil { 7399 err = autorest.NewErrorWithError(err, "databoxedge.StorageAccountCredentialsCreateOrUpdateFuture", "Result", sac.Response.Response, "Failure responding to request") 7400 } 7401 } 7402 return 7403} 7404 7405// StorageAccountCredentialsDeleteFuture an abstraction for monitoring and retrieving the results of a 7406// long-running operation. 7407type StorageAccountCredentialsDeleteFuture struct { 7408 azure.FutureAPI 7409 // Result returns the result of the asynchronous operation. 7410 // If the operation has not completed it will return an error. 7411 Result func(StorageAccountCredentialsClient) (autorest.Response, error) 7412} 7413 7414// UnmarshalJSON is the custom unmarshaller for CreateFuture. 7415func (future *StorageAccountCredentialsDeleteFuture) UnmarshalJSON(body []byte) error { 7416 var azFuture azure.Future 7417 if err := json.Unmarshal(body, &azFuture); err != nil { 7418 return err 7419 } 7420 future.FutureAPI = &azFuture 7421 future.Result = future.result 7422 return nil 7423} 7424 7425// result is the default implementation for StorageAccountCredentialsDeleteFuture.Result. 7426func (future *StorageAccountCredentialsDeleteFuture) result(client StorageAccountCredentialsClient) (ar autorest.Response, err error) { 7427 var done bool 7428 done, err = future.DoneWithContext(context.Background(), client) 7429 if err != nil { 7430 err = autorest.NewErrorWithError(err, "databoxedge.StorageAccountCredentialsDeleteFuture", "Result", future.Response(), "Polling failure") 7431 return 7432 } 7433 if !done { 7434 ar.Response = future.Response() 7435 err = azure.NewAsyncOpIncompleteError("databoxedge.StorageAccountCredentialsDeleteFuture") 7436 return 7437 } 7438 ar.Response = future.Response() 7439 return 7440} 7441 7442// StorageAccountList collection of all the Storage Accounts on the Data Box Edge/Gateway device. 7443type StorageAccountList struct { 7444 autorest.Response `json:"-"` 7445 // Value - READ-ONLY; The list of storageAccounts. 7446 Value *[]StorageAccount `json:"value,omitempty"` 7447 // NextLink - READ-ONLY; Link to the next set of results. 7448 NextLink *string `json:"nextLink,omitempty"` 7449} 7450 7451// MarshalJSON is the custom marshaler for StorageAccountList. 7452func (sal StorageAccountList) MarshalJSON() ([]byte, error) { 7453 objectMap := make(map[string]interface{}) 7454 return json.Marshal(objectMap) 7455} 7456 7457// StorageAccountListIterator provides access to a complete listing of StorageAccount values. 7458type StorageAccountListIterator struct { 7459 i int 7460 page StorageAccountListPage 7461} 7462 7463// NextWithContext advances to the next value. If there was an error making 7464// the request the iterator does not advance and the error is returned. 7465func (iter *StorageAccountListIterator) NextWithContext(ctx context.Context) (err error) { 7466 if tracing.IsEnabled() { 7467 ctx = tracing.StartSpan(ctx, fqdn+"/StorageAccountListIterator.NextWithContext") 7468 defer func() { 7469 sc := -1 7470 if iter.Response().Response.Response != nil { 7471 sc = iter.Response().Response.Response.StatusCode 7472 } 7473 tracing.EndSpan(ctx, sc, err) 7474 }() 7475 } 7476 iter.i++ 7477 if iter.i < len(iter.page.Values()) { 7478 return nil 7479 } 7480 err = iter.page.NextWithContext(ctx) 7481 if err != nil { 7482 iter.i-- 7483 return err 7484 } 7485 iter.i = 0 7486 return nil 7487} 7488 7489// Next advances to the next value. If there was an error making 7490// the request the iterator does not advance and the error is returned. 7491// Deprecated: Use NextWithContext() instead. 7492func (iter *StorageAccountListIterator) Next() error { 7493 return iter.NextWithContext(context.Background()) 7494} 7495 7496// NotDone returns true if the enumeration should be started or is not yet complete. 7497func (iter StorageAccountListIterator) NotDone() bool { 7498 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 7499} 7500 7501// Response returns the raw server response from the last page request. 7502func (iter StorageAccountListIterator) Response() StorageAccountList { 7503 return iter.page.Response() 7504} 7505 7506// Value returns the current value or a zero-initialized value if the 7507// iterator has advanced beyond the end of the collection. 7508func (iter StorageAccountListIterator) Value() StorageAccount { 7509 if !iter.page.NotDone() { 7510 return StorageAccount{} 7511 } 7512 return iter.page.Values()[iter.i] 7513} 7514 7515// Creates a new instance of the StorageAccountListIterator type. 7516func NewStorageAccountListIterator(page StorageAccountListPage) StorageAccountListIterator { 7517 return StorageAccountListIterator{page: page} 7518} 7519 7520// IsEmpty returns true if the ListResult contains no values. 7521func (sal StorageAccountList) IsEmpty() bool { 7522 return sal.Value == nil || len(*sal.Value) == 0 7523} 7524 7525// hasNextLink returns true if the NextLink is not empty. 7526func (sal StorageAccountList) hasNextLink() bool { 7527 return sal.NextLink != nil && len(*sal.NextLink) != 0 7528} 7529 7530// storageAccountListPreparer prepares a request to retrieve the next set of results. 7531// It returns nil if no more results exist. 7532func (sal StorageAccountList) storageAccountListPreparer(ctx context.Context) (*http.Request, error) { 7533 if !sal.hasNextLink() { 7534 return nil, nil 7535 } 7536 return autorest.Prepare((&http.Request{}).WithContext(ctx), 7537 autorest.AsJSON(), 7538 autorest.AsGet(), 7539 autorest.WithBaseURL(to.String(sal.NextLink))) 7540} 7541 7542// StorageAccountListPage contains a page of StorageAccount values. 7543type StorageAccountListPage struct { 7544 fn func(context.Context, StorageAccountList) (StorageAccountList, error) 7545 sal StorageAccountList 7546} 7547 7548// NextWithContext advances to the next page of values. If there was an error making 7549// the request the page does not advance and the error is returned. 7550func (page *StorageAccountListPage) NextWithContext(ctx context.Context) (err error) { 7551 if tracing.IsEnabled() { 7552 ctx = tracing.StartSpan(ctx, fqdn+"/StorageAccountListPage.NextWithContext") 7553 defer func() { 7554 sc := -1 7555 if page.Response().Response.Response != nil { 7556 sc = page.Response().Response.Response.StatusCode 7557 } 7558 tracing.EndSpan(ctx, sc, err) 7559 }() 7560 } 7561 for { 7562 next, err := page.fn(ctx, page.sal) 7563 if err != nil { 7564 return err 7565 } 7566 page.sal = next 7567 if !next.hasNextLink() || !next.IsEmpty() { 7568 break 7569 } 7570 } 7571 return nil 7572} 7573 7574// Next advances to the next page of values. If there was an error making 7575// the request the page does not advance and the error is returned. 7576// Deprecated: Use NextWithContext() instead. 7577func (page *StorageAccountListPage) Next() error { 7578 return page.NextWithContext(context.Background()) 7579} 7580 7581// NotDone returns true if the page enumeration should be started or is not yet complete. 7582func (page StorageAccountListPage) NotDone() bool { 7583 return !page.sal.IsEmpty() 7584} 7585 7586// Response returns the raw server response from the last page request. 7587func (page StorageAccountListPage) Response() StorageAccountList { 7588 return page.sal 7589} 7590 7591// Values returns the slice of values for the current page or nil if there are no values. 7592func (page StorageAccountListPage) Values() []StorageAccount { 7593 if page.sal.IsEmpty() { 7594 return nil 7595 } 7596 return *page.sal.Value 7597} 7598 7599// Creates a new instance of the StorageAccountListPage type. 7600func NewStorageAccountListPage(cur StorageAccountList, getNextPage func(context.Context, StorageAccountList) (StorageAccountList, error)) StorageAccountListPage { 7601 return StorageAccountListPage{ 7602 fn: getNextPage, 7603 sal: cur, 7604 } 7605} 7606 7607// StorageAccountProperties the storage account properties. 7608type StorageAccountProperties struct { 7609 // Description - Description for the storage Account. 7610 Description *string `json:"description,omitempty"` 7611 // StorageAccountStatus - Current status of the storage account. Possible values include: 'StorageAccountStatusOK', 'StorageAccountStatusOffline', 'StorageAccountStatusUnknown', 'StorageAccountStatusUpdating', 'StorageAccountStatusNeedsAttention' 7612 StorageAccountStatus StorageAccountStatus `json:"storageAccountStatus,omitempty"` 7613 // DataPolicy - Data policy of the storage Account. Possible values include: 'Cloud', 'Local' 7614 DataPolicy DataPolicy `json:"dataPolicy,omitempty"` 7615 // StorageAccountCredentialID - Storage Account Credential Id 7616 StorageAccountCredentialID *string `json:"storageAccountCredentialId,omitempty"` 7617 // BlobEndpoint - READ-ONLY; BlobEndpoint of Storage Account 7618 BlobEndpoint *string `json:"blobEndpoint,omitempty"` 7619 // ContainerCount - READ-ONLY; The Container Count. Present only for Storage Accounts with DataPolicy set to Cloud. 7620 ContainerCount *int32 `json:"containerCount,omitempty"` 7621} 7622 7623// MarshalJSON is the custom marshaler for StorageAccountProperties. 7624func (sap StorageAccountProperties) MarshalJSON() ([]byte, error) { 7625 objectMap := make(map[string]interface{}) 7626 if sap.Description != nil { 7627 objectMap["description"] = sap.Description 7628 } 7629 if sap.StorageAccountStatus != "" { 7630 objectMap["storageAccountStatus"] = sap.StorageAccountStatus 7631 } 7632 if sap.DataPolicy != "" { 7633 objectMap["dataPolicy"] = sap.DataPolicy 7634 } 7635 if sap.StorageAccountCredentialID != nil { 7636 objectMap["storageAccountCredentialId"] = sap.StorageAccountCredentialID 7637 } 7638 return json.Marshal(objectMap) 7639} 7640 7641// StorageAccountsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a 7642// long-running operation. 7643type StorageAccountsCreateOrUpdateFuture struct { 7644 azure.FutureAPI 7645 // Result returns the result of the asynchronous operation. 7646 // If the operation has not completed it will return an error. 7647 Result func(StorageAccountsClient) (StorageAccount, error) 7648} 7649 7650// UnmarshalJSON is the custom unmarshaller for CreateFuture. 7651func (future *StorageAccountsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 7652 var azFuture azure.Future 7653 if err := json.Unmarshal(body, &azFuture); err != nil { 7654 return err 7655 } 7656 future.FutureAPI = &azFuture 7657 future.Result = future.result 7658 return nil 7659} 7660 7661// result is the default implementation for StorageAccountsCreateOrUpdateFuture.Result. 7662func (future *StorageAccountsCreateOrUpdateFuture) result(client StorageAccountsClient) (sa StorageAccount, err error) { 7663 var done bool 7664 done, err = future.DoneWithContext(context.Background(), client) 7665 if err != nil { 7666 err = autorest.NewErrorWithError(err, "databoxedge.StorageAccountsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 7667 return 7668 } 7669 if !done { 7670 sa.Response.Response = future.Response() 7671 err = azure.NewAsyncOpIncompleteError("databoxedge.StorageAccountsCreateOrUpdateFuture") 7672 return 7673 } 7674 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 7675 if sa.Response.Response, err = future.GetResult(sender); err == nil && sa.Response.Response.StatusCode != http.StatusNoContent { 7676 sa, err = client.CreateOrUpdateResponder(sa.Response.Response) 7677 if err != nil { 7678 err = autorest.NewErrorWithError(err, "databoxedge.StorageAccountsCreateOrUpdateFuture", "Result", sa.Response.Response, "Failure responding to request") 7679 } 7680 } 7681 return 7682} 7683 7684// StorageAccountsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running 7685// operation. 7686type StorageAccountsDeleteFuture struct { 7687 azure.FutureAPI 7688 // Result returns the result of the asynchronous operation. 7689 // If the operation has not completed it will return an error. 7690 Result func(StorageAccountsClient) (autorest.Response, error) 7691} 7692 7693// UnmarshalJSON is the custom unmarshaller for CreateFuture. 7694func (future *StorageAccountsDeleteFuture) UnmarshalJSON(body []byte) error { 7695 var azFuture azure.Future 7696 if err := json.Unmarshal(body, &azFuture); err != nil { 7697 return err 7698 } 7699 future.FutureAPI = &azFuture 7700 future.Result = future.result 7701 return nil 7702} 7703 7704// result is the default implementation for StorageAccountsDeleteFuture.Result. 7705func (future *StorageAccountsDeleteFuture) result(client StorageAccountsClient) (ar autorest.Response, err error) { 7706 var done bool 7707 done, err = future.DoneWithContext(context.Background(), client) 7708 if err != nil { 7709 err = autorest.NewErrorWithError(err, "databoxedge.StorageAccountsDeleteFuture", "Result", future.Response(), "Polling failure") 7710 return 7711 } 7712 if !done { 7713 ar.Response = future.Response() 7714 err = azure.NewAsyncOpIncompleteError("databoxedge.StorageAccountsDeleteFuture") 7715 return 7716 } 7717 ar.Response = future.Response() 7718 return 7719} 7720 7721// SubscriptionProperties ... 7722type SubscriptionProperties struct { 7723 TenantID *string `json:"tenantId,omitempty"` 7724 LocationPlacementID *string `json:"locationPlacementId,omitempty"` 7725 QuotaID *string `json:"quotaId,omitempty"` 7726 SerializedDetails *string `json:"serializedDetails,omitempty"` 7727 RegisteredFeatures *[]SubscriptionRegisteredFeatures `json:"registeredFeatures,omitempty"` 7728} 7729 7730// SubscriptionRegisteredFeatures ... 7731type SubscriptionRegisteredFeatures struct { 7732 Name *string `json:"name,omitempty"` 7733 State *string `json:"state,omitempty"` 7734} 7735 7736// SymmetricKey symmetric key for authentication. 7737type SymmetricKey struct { 7738 // ConnectionString - Connection string based on the symmetric key. 7739 ConnectionString *AsymmetricEncryptedSecret `json:"connectionString,omitempty"` 7740} 7741 7742// SystemData metadata pertaining to creation and last modification of the resource. 7743type SystemData struct { 7744 // CreatedBy - The identity that created the resource. 7745 CreatedBy *string `json:"createdBy,omitempty"` 7746 // CreatedByType - The type of identity that created the resource. Possible values include: 'CreatedByTypeUser', 'CreatedByTypeApplication', 'CreatedByTypeManagedIdentity', 'CreatedByTypeKey' 7747 CreatedByType CreatedByType `json:"createdByType,omitempty"` 7748 // CreatedAt - The timestamp of resource creation (UTC). 7749 CreatedAt *date.Time `json:"createdAt,omitempty"` 7750 // LastModifiedBy - The identity that last modified the resource. 7751 LastModifiedBy *string `json:"lastModifiedBy,omitempty"` 7752 // LastModifiedByType - The type of identity that last modified the resource. Possible values include: 'CreatedByTypeUser', 'CreatedByTypeApplication', 'CreatedByTypeManagedIdentity', 'CreatedByTypeKey' 7753 LastModifiedByType CreatedByType `json:"lastModifiedByType,omitempty"` 7754 // LastModifiedAt - The type of identity that last modified the resource. 7755 LastModifiedAt *date.Time `json:"lastModifiedAt,omitempty"` 7756} 7757 7758// TrackingInfo tracking courier information. 7759type TrackingInfo struct { 7760 // SerialNumber - Serial number of the device being tracked. 7761 SerialNumber *string `json:"serialNumber,omitempty"` 7762 // CarrierName - Name of the carrier used in the delivery. 7763 CarrierName *string `json:"carrierName,omitempty"` 7764 // TrackingID - Tracking ID of the shipment. 7765 TrackingID *string `json:"trackingId,omitempty"` 7766 // TrackingURL - Tracking URL of the shipment. 7767 TrackingURL *string `json:"trackingUrl,omitempty"` 7768} 7769 7770// BasicTrigger trigger details. 7771type BasicTrigger interface { 7772 AsFileEventTrigger() (*FileEventTrigger, bool) 7773 AsPeriodicTimerEventTrigger() (*PeriodicTimerEventTrigger, bool) 7774 AsTrigger() (*Trigger, bool) 7775} 7776 7777// Trigger trigger details. 7778type Trigger struct { 7779 autorest.Response `json:"-"` 7780 // SystemData - Trigger in DataBoxEdge Resource 7781 SystemData *SystemData `json:"systemData,omitempty"` 7782 // Kind - Possible values include: 'KindTrigger', 'KindFileEvent', 'KindPeriodicTimerEvent' 7783 Kind KindBasicTrigger `json:"kind,omitempty"` 7784 // ID - READ-ONLY; The path ID that uniquely identifies the object. 7785 ID *string `json:"id,omitempty"` 7786 // Name - READ-ONLY; The object name. 7787 Name *string `json:"name,omitempty"` 7788 // Type - READ-ONLY; The hierarchical type of the object. 7789 Type *string `json:"type,omitempty"` 7790} 7791 7792func unmarshalBasicTrigger(body []byte) (BasicTrigger, error) { 7793 var m map[string]interface{} 7794 err := json.Unmarshal(body, &m) 7795 if err != nil { 7796 return nil, err 7797 } 7798 7799 switch m["kind"] { 7800 case string(KindFileEvent): 7801 var fet FileEventTrigger 7802 err := json.Unmarshal(body, &fet) 7803 return fet, err 7804 case string(KindPeriodicTimerEvent): 7805 var ptet PeriodicTimerEventTrigger 7806 err := json.Unmarshal(body, &ptet) 7807 return ptet, err 7808 default: 7809 var t Trigger 7810 err := json.Unmarshal(body, &t) 7811 return t, err 7812 } 7813} 7814func unmarshalBasicTriggerArray(body []byte) ([]BasicTrigger, error) { 7815 var rawMessages []*json.RawMessage 7816 err := json.Unmarshal(body, &rawMessages) 7817 if err != nil { 7818 return nil, err 7819 } 7820 7821 tArray := make([]BasicTrigger, len(rawMessages)) 7822 7823 for index, rawMessage := range rawMessages { 7824 t, err := unmarshalBasicTrigger(*rawMessage) 7825 if err != nil { 7826 return nil, err 7827 } 7828 tArray[index] = t 7829 } 7830 return tArray, nil 7831} 7832 7833// MarshalJSON is the custom marshaler for Trigger. 7834func (t Trigger) MarshalJSON() ([]byte, error) { 7835 t.Kind = KindTrigger 7836 objectMap := make(map[string]interface{}) 7837 if t.SystemData != nil { 7838 objectMap["systemData"] = t.SystemData 7839 } 7840 if t.Kind != "" { 7841 objectMap["kind"] = t.Kind 7842 } 7843 return json.Marshal(objectMap) 7844} 7845 7846// AsFileEventTrigger is the BasicTrigger implementation for Trigger. 7847func (t Trigger) AsFileEventTrigger() (*FileEventTrigger, bool) { 7848 return nil, false 7849} 7850 7851// AsPeriodicTimerEventTrigger is the BasicTrigger implementation for Trigger. 7852func (t Trigger) AsPeriodicTimerEventTrigger() (*PeriodicTimerEventTrigger, bool) { 7853 return nil, false 7854} 7855 7856// AsTrigger is the BasicTrigger implementation for Trigger. 7857func (t Trigger) AsTrigger() (*Trigger, bool) { 7858 return &t, true 7859} 7860 7861// AsBasicTrigger is the BasicTrigger implementation for Trigger. 7862func (t Trigger) AsBasicTrigger() (BasicTrigger, bool) { 7863 return &t, true 7864} 7865 7866// TriggerList collection of all trigger on the data box edge device. 7867type TriggerList struct { 7868 autorest.Response `json:"-"` 7869 // Value - READ-ONLY; The list of triggers. 7870 Value *[]BasicTrigger `json:"value,omitempty"` 7871 // NextLink - READ-ONLY; Link to the next set of results. 7872 NextLink *string `json:"nextLink,omitempty"` 7873} 7874 7875// MarshalJSON is the custom marshaler for TriggerList. 7876func (tl TriggerList) MarshalJSON() ([]byte, error) { 7877 objectMap := make(map[string]interface{}) 7878 return json.Marshal(objectMap) 7879} 7880 7881// UnmarshalJSON is the custom unmarshaler for TriggerList struct. 7882func (tl *TriggerList) UnmarshalJSON(body []byte) error { 7883 var m map[string]*json.RawMessage 7884 err := json.Unmarshal(body, &m) 7885 if err != nil { 7886 return err 7887 } 7888 for k, v := range m { 7889 switch k { 7890 case "value": 7891 if v != nil { 7892 value, err := unmarshalBasicTriggerArray(*v) 7893 if err != nil { 7894 return err 7895 } 7896 tl.Value = &value 7897 } 7898 case "nextLink": 7899 if v != nil { 7900 var nextLink string 7901 err = json.Unmarshal(*v, &nextLink) 7902 if err != nil { 7903 return err 7904 } 7905 tl.NextLink = &nextLink 7906 } 7907 } 7908 } 7909 7910 return nil 7911} 7912 7913// TriggerListIterator provides access to a complete listing of Trigger values. 7914type TriggerListIterator struct { 7915 i int 7916 page TriggerListPage 7917} 7918 7919// NextWithContext advances to the next value. If there was an error making 7920// the request the iterator does not advance and the error is returned. 7921func (iter *TriggerListIterator) NextWithContext(ctx context.Context) (err error) { 7922 if tracing.IsEnabled() { 7923 ctx = tracing.StartSpan(ctx, fqdn+"/TriggerListIterator.NextWithContext") 7924 defer func() { 7925 sc := -1 7926 if iter.Response().Response.Response != nil { 7927 sc = iter.Response().Response.Response.StatusCode 7928 } 7929 tracing.EndSpan(ctx, sc, err) 7930 }() 7931 } 7932 iter.i++ 7933 if iter.i < len(iter.page.Values()) { 7934 return nil 7935 } 7936 err = iter.page.NextWithContext(ctx) 7937 if err != nil { 7938 iter.i-- 7939 return err 7940 } 7941 iter.i = 0 7942 return nil 7943} 7944 7945// Next advances to the next value. If there was an error making 7946// the request the iterator does not advance and the error is returned. 7947// Deprecated: Use NextWithContext() instead. 7948func (iter *TriggerListIterator) Next() error { 7949 return iter.NextWithContext(context.Background()) 7950} 7951 7952// NotDone returns true if the enumeration should be started or is not yet complete. 7953func (iter TriggerListIterator) NotDone() bool { 7954 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 7955} 7956 7957// Response returns the raw server response from the last page request. 7958func (iter TriggerListIterator) Response() TriggerList { 7959 return iter.page.Response() 7960} 7961 7962// Value returns the current value or a zero-initialized value if the 7963// iterator has advanced beyond the end of the collection. 7964func (iter TriggerListIterator) Value() BasicTrigger { 7965 if !iter.page.NotDone() { 7966 return Trigger{} 7967 } 7968 return iter.page.Values()[iter.i] 7969} 7970 7971// Creates a new instance of the TriggerListIterator type. 7972func NewTriggerListIterator(page TriggerListPage) TriggerListIterator { 7973 return TriggerListIterator{page: page} 7974} 7975 7976// IsEmpty returns true if the ListResult contains no values. 7977func (tl TriggerList) IsEmpty() bool { 7978 return tl.Value == nil || len(*tl.Value) == 0 7979} 7980 7981// hasNextLink returns true if the NextLink is not empty. 7982func (tl TriggerList) hasNextLink() bool { 7983 return tl.NextLink != nil && len(*tl.NextLink) != 0 7984} 7985 7986// triggerListPreparer prepares a request to retrieve the next set of results. 7987// It returns nil if no more results exist. 7988func (tl TriggerList) triggerListPreparer(ctx context.Context) (*http.Request, error) { 7989 if !tl.hasNextLink() { 7990 return nil, nil 7991 } 7992 return autorest.Prepare((&http.Request{}).WithContext(ctx), 7993 autorest.AsJSON(), 7994 autorest.AsGet(), 7995 autorest.WithBaseURL(to.String(tl.NextLink))) 7996} 7997 7998// TriggerListPage contains a page of BasicTrigger values. 7999type TriggerListPage struct { 8000 fn func(context.Context, TriggerList) (TriggerList, error) 8001 tl TriggerList 8002} 8003 8004// NextWithContext advances to the next page of values. If there was an error making 8005// the request the page does not advance and the error is returned. 8006func (page *TriggerListPage) NextWithContext(ctx context.Context) (err error) { 8007 if tracing.IsEnabled() { 8008 ctx = tracing.StartSpan(ctx, fqdn+"/TriggerListPage.NextWithContext") 8009 defer func() { 8010 sc := -1 8011 if page.Response().Response.Response != nil { 8012 sc = page.Response().Response.Response.StatusCode 8013 } 8014 tracing.EndSpan(ctx, sc, err) 8015 }() 8016 } 8017 for { 8018 next, err := page.fn(ctx, page.tl) 8019 if err != nil { 8020 return err 8021 } 8022 page.tl = next 8023 if !next.hasNextLink() || !next.IsEmpty() { 8024 break 8025 } 8026 } 8027 return nil 8028} 8029 8030// Next advances to the next page of values. If there was an error making 8031// the request the page does not advance and the error is returned. 8032// Deprecated: Use NextWithContext() instead. 8033func (page *TriggerListPage) Next() error { 8034 return page.NextWithContext(context.Background()) 8035} 8036 8037// NotDone returns true if the page enumeration should be started or is not yet complete. 8038func (page TriggerListPage) NotDone() bool { 8039 return !page.tl.IsEmpty() 8040} 8041 8042// Response returns the raw server response from the last page request. 8043func (page TriggerListPage) Response() TriggerList { 8044 return page.tl 8045} 8046 8047// Values returns the slice of values for the current page or nil if there are no values. 8048func (page TriggerListPage) Values() []BasicTrigger { 8049 if page.tl.IsEmpty() { 8050 return nil 8051 } 8052 return *page.tl.Value 8053} 8054 8055// Creates a new instance of the TriggerListPage type. 8056func NewTriggerListPage(cur TriggerList, getNextPage func(context.Context, TriggerList) (TriggerList, error)) TriggerListPage { 8057 return TriggerListPage{ 8058 fn: getNextPage, 8059 tl: cur, 8060 } 8061} 8062 8063// TriggerModel ... 8064type TriggerModel struct { 8065 autorest.Response `json:"-"` 8066 Value BasicTrigger `json:"value,omitempty"` 8067} 8068 8069// UnmarshalJSON is the custom unmarshaler for TriggerModel struct. 8070func (tm *TriggerModel) UnmarshalJSON(body []byte) error { 8071 t, err := unmarshalBasicTrigger(body) 8072 if err != nil { 8073 return err 8074 } 8075 tm.Value = t 8076 8077 return nil 8078} 8079 8080// TriggersCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 8081// operation. 8082type TriggersCreateOrUpdateFuture struct { 8083 azure.FutureAPI 8084 // Result returns the result of the asynchronous operation. 8085 // If the operation has not completed it will return an error. 8086 Result func(TriggersClient) (TriggerModel, error) 8087} 8088 8089// UnmarshalJSON is the custom unmarshaller for CreateFuture. 8090func (future *TriggersCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 8091 var azFuture azure.Future 8092 if err := json.Unmarshal(body, &azFuture); err != nil { 8093 return err 8094 } 8095 future.FutureAPI = &azFuture 8096 future.Result = future.result 8097 return nil 8098} 8099 8100// result is the default implementation for TriggersCreateOrUpdateFuture.Result. 8101func (future *TriggersCreateOrUpdateFuture) result(client TriggersClient) (tm TriggerModel, err error) { 8102 var done bool 8103 done, err = future.DoneWithContext(context.Background(), client) 8104 if err != nil { 8105 err = autorest.NewErrorWithError(err, "databoxedge.TriggersCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 8106 return 8107 } 8108 if !done { 8109 tm.Response.Response = future.Response() 8110 err = azure.NewAsyncOpIncompleteError("databoxedge.TriggersCreateOrUpdateFuture") 8111 return 8112 } 8113 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 8114 if tm.Response.Response, err = future.GetResult(sender); err == nil && tm.Response.Response.StatusCode != http.StatusNoContent { 8115 tm, err = client.CreateOrUpdateResponder(tm.Response.Response) 8116 if err != nil { 8117 err = autorest.NewErrorWithError(err, "databoxedge.TriggersCreateOrUpdateFuture", "Result", tm.Response.Response, "Failure responding to request") 8118 } 8119 } 8120 return 8121} 8122 8123// TriggersDeleteFuture an abstraction for monitoring and retrieving the results of a long-running 8124// operation. 8125type TriggersDeleteFuture struct { 8126 azure.FutureAPI 8127 // Result returns the result of the asynchronous operation. 8128 // If the operation has not completed it will return an error. 8129 Result func(TriggersClient) (autorest.Response, error) 8130} 8131 8132// UnmarshalJSON is the custom unmarshaller for CreateFuture. 8133func (future *TriggersDeleteFuture) UnmarshalJSON(body []byte) error { 8134 var azFuture azure.Future 8135 if err := json.Unmarshal(body, &azFuture); err != nil { 8136 return err 8137 } 8138 future.FutureAPI = &azFuture 8139 future.Result = future.result 8140 return nil 8141} 8142 8143// result is the default implementation for TriggersDeleteFuture.Result. 8144func (future *TriggersDeleteFuture) result(client TriggersClient) (ar autorest.Response, err error) { 8145 var done bool 8146 done, err = future.DoneWithContext(context.Background(), client) 8147 if err != nil { 8148 err = autorest.NewErrorWithError(err, "databoxedge.TriggersDeleteFuture", "Result", future.Response(), "Polling failure") 8149 return 8150 } 8151 if !done { 8152 ar.Response = future.Response() 8153 err = azure.NewAsyncOpIncompleteError("databoxedge.TriggersDeleteFuture") 8154 return 8155 } 8156 ar.Response = future.Response() 8157 return 8158} 8159 8160// UpdateDownloadProgress details about the download progress of update. 8161type UpdateDownloadProgress struct { 8162 // DownloadPhase - READ-ONLY; The download phase. Possible values include: 'Unknown', 'Initializing', 'Downloading', 'Verifying' 8163 DownloadPhase DownloadPhase `json:"downloadPhase,omitempty"` 8164 // PercentComplete - READ-ONLY; Percentage of completion. 8165 PercentComplete *int32 `json:"percentComplete,omitempty"` 8166 // TotalBytesToDownload - READ-ONLY; Total bytes to download. 8167 TotalBytesToDownload *float64 `json:"totalBytesToDownload,omitempty"` 8168 // TotalBytesDownloaded - READ-ONLY; Total bytes downloaded. 8169 TotalBytesDownloaded *float64 `json:"totalBytesDownloaded,omitempty"` 8170 // NumberOfUpdatesToDownload - READ-ONLY; Number of updates to download. 8171 NumberOfUpdatesToDownload *int32 `json:"numberOfUpdatesToDownload,omitempty"` 8172 // NumberOfUpdatesDownloaded - READ-ONLY; Number of updates downloaded. 8173 NumberOfUpdatesDownloaded *int32 `json:"numberOfUpdatesDownloaded,omitempty"` 8174} 8175 8176// MarshalJSON is the custom marshaler for UpdateDownloadProgress. 8177func (UDP UpdateDownloadProgress) MarshalJSON() ([]byte, error) { 8178 objectMap := make(map[string]interface{}) 8179 return json.Marshal(objectMap) 8180} 8181 8182// UpdateInstallProgress progress details during installation of updates. 8183type UpdateInstallProgress struct { 8184 // PercentComplete - READ-ONLY; Percentage completed. 8185 PercentComplete *int32 `json:"percentComplete,omitempty"` 8186 // NumberOfUpdatesToInstall - READ-ONLY; Number of updates to install. 8187 NumberOfUpdatesToInstall *int32 `json:"numberOfUpdatesToInstall,omitempty"` 8188 // NumberOfUpdatesInstalled - READ-ONLY; Number of updates installed. 8189 NumberOfUpdatesInstalled *int32 `json:"numberOfUpdatesInstalled,omitempty"` 8190} 8191 8192// MarshalJSON is the custom marshaler for UpdateInstallProgress. 8193func (uip UpdateInstallProgress) MarshalJSON() ([]byte, error) { 8194 objectMap := make(map[string]interface{}) 8195 return json.Marshal(objectMap) 8196} 8197 8198// UpdateSummary details about ongoing updates and availability of updates on the device. 8199type UpdateSummary struct { 8200 autorest.Response `json:"-"` 8201 // UpdateSummaryProperties - The device update information summary. 8202 *UpdateSummaryProperties `json:"properties,omitempty"` 8203 // ID - READ-ONLY; The path ID that uniquely identifies the object. 8204 ID *string `json:"id,omitempty"` 8205 // Name - READ-ONLY; The object name. 8206 Name *string `json:"name,omitempty"` 8207 // Type - READ-ONLY; The hierarchical type of the object. 8208 Type *string `json:"type,omitempty"` 8209} 8210 8211// MarshalJSON is the custom marshaler for UpdateSummary. 8212func (us UpdateSummary) MarshalJSON() ([]byte, error) { 8213 objectMap := make(map[string]interface{}) 8214 if us.UpdateSummaryProperties != nil { 8215 objectMap["properties"] = us.UpdateSummaryProperties 8216 } 8217 return json.Marshal(objectMap) 8218} 8219 8220// UnmarshalJSON is the custom unmarshaler for UpdateSummary struct. 8221func (us *UpdateSummary) UnmarshalJSON(body []byte) error { 8222 var m map[string]*json.RawMessage 8223 err := json.Unmarshal(body, &m) 8224 if err != nil { 8225 return err 8226 } 8227 for k, v := range m { 8228 switch k { 8229 case "properties": 8230 if v != nil { 8231 var updateSummaryProperties UpdateSummaryProperties 8232 err = json.Unmarshal(*v, &updateSummaryProperties) 8233 if err != nil { 8234 return err 8235 } 8236 us.UpdateSummaryProperties = &updateSummaryProperties 8237 } 8238 case "id": 8239 if v != nil { 8240 var ID string 8241 err = json.Unmarshal(*v, &ID) 8242 if err != nil { 8243 return err 8244 } 8245 us.ID = &ID 8246 } 8247 case "name": 8248 if v != nil { 8249 var name string 8250 err = json.Unmarshal(*v, &name) 8251 if err != nil { 8252 return err 8253 } 8254 us.Name = &name 8255 } 8256 case "type": 8257 if v != nil { 8258 var typeVar string 8259 err = json.Unmarshal(*v, &typeVar) 8260 if err != nil { 8261 return err 8262 } 8263 us.Type = &typeVar 8264 } 8265 } 8266 } 8267 8268 return nil 8269} 8270 8271// UpdateSummaryProperties the device update information summary. 8272type UpdateSummaryProperties struct { 8273 // DeviceVersionNumber - The current version of the device in format: 1.2.17312.13.", 8274 DeviceVersionNumber *string `json:"deviceVersionNumber,omitempty"` 8275 // FriendlyDeviceVersionName - The current version of the device in text format. 8276 FriendlyDeviceVersionName *string `json:"friendlyDeviceVersionName,omitempty"` 8277 // DeviceLastScannedDateTime - The last time when a scan was done on the device. 8278 DeviceLastScannedDateTime *date.Time `json:"deviceLastScannedDateTime,omitempty"` 8279 // LastCompletedScanJobDateTime - The time when the last scan job was completed (success/cancelled/failed) on the appliance. 8280 LastCompletedScanJobDateTime *date.Time `json:"lastCompletedScanJobDateTime,omitempty"` 8281 // LastCompletedDownloadJobDateTime - READ-ONLY; The time when the last Download job was completed (success/cancelled/failed) on the appliance. 8282 LastCompletedDownloadJobDateTime *date.Time `json:"lastCompletedDownloadJobDateTime,omitempty"` 8283 // LastCompletedInstallJobDateTime - READ-ONLY; The time when the last Install job was completed (success/cancelled/failed) on the appliance. 8284 LastCompletedInstallJobDateTime *date.Time `json:"lastCompletedInstallJobDateTime,omitempty"` 8285 // TotalNumberOfUpdatesAvailable - READ-ONLY; The number of updates available for the current device version as per the last device scan. 8286 TotalNumberOfUpdatesAvailable *int32 `json:"totalNumberOfUpdatesAvailable,omitempty"` 8287 // TotalNumberOfUpdatesPendingDownload - READ-ONLY; The total number of items pending download. 8288 TotalNumberOfUpdatesPendingDownload *int32 `json:"totalNumberOfUpdatesPendingDownload,omitempty"` 8289 // TotalNumberOfUpdatesPendingInstall - READ-ONLY; The total number of items pending install. 8290 TotalNumberOfUpdatesPendingInstall *int32 `json:"totalNumberOfUpdatesPendingInstall,omitempty"` 8291 // RebootBehavior - READ-ONLY; Indicates if updates are available and at least one of the updates needs a reboot. Possible values include: 'NeverReboots', 'RequiresReboot', 'RequestReboot' 8292 RebootBehavior InstallRebootBehavior `json:"rebootBehavior,omitempty"` 8293 // OngoingUpdateOperation - READ-ONLY; The current update operation. Possible values include: 'UpdateOperationNone', 'UpdateOperationScan', 'UpdateOperationDownload', 'UpdateOperationInstall' 8294 OngoingUpdateOperation UpdateOperation `json:"ongoingUpdateOperation,omitempty"` 8295 // InProgressDownloadJobID - READ-ONLY; The job ID of the download job in progress. 8296 InProgressDownloadJobID *string `json:"inProgressDownloadJobId,omitempty"` 8297 // InProgressInstallJobID - READ-ONLY; The job ID of the install job in progress. 8298 InProgressInstallJobID *string `json:"inProgressInstallJobId,omitempty"` 8299 // InProgressDownloadJobStartedDateTime - READ-ONLY; The time when the currently running download (if any) started. 8300 InProgressDownloadJobStartedDateTime *date.Time `json:"inProgressDownloadJobStartedDateTime,omitempty"` 8301 // InProgressInstallJobStartedDateTime - READ-ONLY; The time when the currently running install (if any) started. 8302 InProgressInstallJobStartedDateTime *date.Time `json:"inProgressInstallJobStartedDateTime,omitempty"` 8303 // UpdateTitles - READ-ONLY; The list of updates available for install. 8304 UpdateTitles *[]string `json:"updateTitles,omitempty"` 8305 // TotalUpdateSizeInBytes - READ-ONLY; The total size of updates available for download in bytes. 8306 TotalUpdateSizeInBytes *float64 `json:"totalUpdateSizeInBytes,omitempty"` 8307} 8308 8309// MarshalJSON is the custom marshaler for UpdateSummaryProperties. 8310func (usp UpdateSummaryProperties) MarshalJSON() ([]byte, error) { 8311 objectMap := make(map[string]interface{}) 8312 if usp.DeviceVersionNumber != nil { 8313 objectMap["deviceVersionNumber"] = usp.DeviceVersionNumber 8314 } 8315 if usp.FriendlyDeviceVersionName != nil { 8316 objectMap["friendlyDeviceVersionName"] = usp.FriendlyDeviceVersionName 8317 } 8318 if usp.DeviceLastScannedDateTime != nil { 8319 objectMap["deviceLastScannedDateTime"] = usp.DeviceLastScannedDateTime 8320 } 8321 if usp.LastCompletedScanJobDateTime != nil { 8322 objectMap["lastCompletedScanJobDateTime"] = usp.LastCompletedScanJobDateTime 8323 } 8324 return json.Marshal(objectMap) 8325} 8326 8327// UploadCertificateRequest the upload certificate request. 8328type UploadCertificateRequest struct { 8329 // RawCertificateData - The Base 64 encoded certificate raw data. 8330 *RawCertificateData `json:"properties,omitempty"` 8331} 8332 8333// MarshalJSON is the custom marshaler for UploadCertificateRequest. 8334func (ucr UploadCertificateRequest) MarshalJSON() ([]byte, error) { 8335 objectMap := make(map[string]interface{}) 8336 if ucr.RawCertificateData != nil { 8337 objectMap["properties"] = ucr.RawCertificateData 8338 } 8339 return json.Marshal(objectMap) 8340} 8341 8342// UnmarshalJSON is the custom unmarshaler for UploadCertificateRequest struct. 8343func (ucr *UploadCertificateRequest) UnmarshalJSON(body []byte) error { 8344 var m map[string]*json.RawMessage 8345 err := json.Unmarshal(body, &m) 8346 if err != nil { 8347 return err 8348 } 8349 for k, v := range m { 8350 switch k { 8351 case "properties": 8352 if v != nil { 8353 var rawCertificateData RawCertificateData 8354 err = json.Unmarshal(*v, &rawCertificateData) 8355 if err != nil { 8356 return err 8357 } 8358 ucr.RawCertificateData = &rawCertificateData 8359 } 8360 } 8361 } 8362 8363 return nil 8364} 8365 8366// UploadCertificateResponse the upload registration certificate response. 8367type UploadCertificateResponse struct { 8368 autorest.Response `json:"-"` 8369 // AuthType - Specifies authentication type. Possible values include: 'AuthenticationTypeInvalid', 'AuthenticationTypeAzureActiveDirectory' 8370 AuthType AuthenticationType `json:"authType,omitempty"` 8371 // ResourceID - READ-ONLY; The resource ID of the Data Box Edge/Gateway device. 8372 ResourceID *string `json:"resourceId,omitempty"` 8373 // AadAuthority - READ-ONLY; Azure Active Directory tenant authority. 8374 AadAuthority *string `json:"aadAuthority,omitempty"` 8375 // AadTenantID - READ-ONLY; Azure Active Directory tenant ID. 8376 AadTenantID *string `json:"aadTenantId,omitempty"` 8377 // ServicePrincipalClientID - READ-ONLY; Azure Active Directory service principal client ID. 8378 ServicePrincipalClientID *string `json:"servicePrincipalClientId,omitempty"` 8379 // ServicePrincipalObjectID - READ-ONLY; Azure Active Directory service principal object ID. 8380 ServicePrincipalObjectID *string `json:"servicePrincipalObjectId,omitempty"` 8381 // AzureManagementEndpointAudience - READ-ONLY; The azure management endpoint audience. 8382 AzureManagementEndpointAudience *string `json:"azureManagementEndpointAudience,omitempty"` 8383 // AadAudience - READ-ONLY; Identifier of the target resource that is the recipient of the requested token. 8384 AadAudience *string `json:"aadAudience,omitempty"` 8385} 8386 8387// MarshalJSON is the custom marshaler for UploadCertificateResponse. 8388func (ucr UploadCertificateResponse) MarshalJSON() ([]byte, error) { 8389 objectMap := make(map[string]interface{}) 8390 if ucr.AuthType != "" { 8391 objectMap["authType"] = ucr.AuthType 8392 } 8393 return json.Marshal(objectMap) 8394} 8395 8396// User represents a user who has access to one or more shares on the Data Box Edge/Gateway device. 8397type User struct { 8398 autorest.Response `json:"-"` 8399 // SystemData - User in DataBoxEdge Resource 8400 SystemData *SystemData `json:"systemData,omitempty"` 8401 // UserProperties - The storage account credential properties. 8402 *UserProperties `json:"properties,omitempty"` 8403 // ID - READ-ONLY; The path ID that uniquely identifies the object. 8404 ID *string `json:"id,omitempty"` 8405 // Name - READ-ONLY; The object name. 8406 Name *string `json:"name,omitempty"` 8407 // Type - READ-ONLY; The hierarchical type of the object. 8408 Type *string `json:"type,omitempty"` 8409} 8410 8411// MarshalJSON is the custom marshaler for User. 8412func (u User) MarshalJSON() ([]byte, error) { 8413 objectMap := make(map[string]interface{}) 8414 if u.SystemData != nil { 8415 objectMap["systemData"] = u.SystemData 8416 } 8417 if u.UserProperties != nil { 8418 objectMap["properties"] = u.UserProperties 8419 } 8420 return json.Marshal(objectMap) 8421} 8422 8423// UnmarshalJSON is the custom unmarshaler for User struct. 8424func (u *User) UnmarshalJSON(body []byte) error { 8425 var m map[string]*json.RawMessage 8426 err := json.Unmarshal(body, &m) 8427 if err != nil { 8428 return err 8429 } 8430 for k, v := range m { 8431 switch k { 8432 case "systemData": 8433 if v != nil { 8434 var systemData SystemData 8435 err = json.Unmarshal(*v, &systemData) 8436 if err != nil { 8437 return err 8438 } 8439 u.SystemData = &systemData 8440 } 8441 case "properties": 8442 if v != nil { 8443 var userProperties UserProperties 8444 err = json.Unmarshal(*v, &userProperties) 8445 if err != nil { 8446 return err 8447 } 8448 u.UserProperties = &userProperties 8449 } 8450 case "id": 8451 if v != nil { 8452 var ID string 8453 err = json.Unmarshal(*v, &ID) 8454 if err != nil { 8455 return err 8456 } 8457 u.ID = &ID 8458 } 8459 case "name": 8460 if v != nil { 8461 var name string 8462 err = json.Unmarshal(*v, &name) 8463 if err != nil { 8464 return err 8465 } 8466 u.Name = &name 8467 } 8468 case "type": 8469 if v != nil { 8470 var typeVar string 8471 err = json.Unmarshal(*v, &typeVar) 8472 if err != nil { 8473 return err 8474 } 8475 u.Type = &typeVar 8476 } 8477 } 8478 } 8479 8480 return nil 8481} 8482 8483// UserAccessRight the mapping between a particular user and the access type on the SMB share. 8484type UserAccessRight struct { 8485 // UserID - User ID (already existing in the device). 8486 UserID *string `json:"userId,omitempty"` 8487 // AccessType - Type of access to be allowed for the user. Possible values include: 'Change', 'Read', 'Custom' 8488 AccessType ShareAccessType `json:"accessType,omitempty"` 8489} 8490 8491// UserList collection of users. 8492type UserList struct { 8493 autorest.Response `json:"-"` 8494 // Value - READ-ONLY; The list of users. 8495 Value *[]User `json:"value,omitempty"` 8496 // NextLink - READ-ONLY; Link to the next set of results. 8497 NextLink *string `json:"nextLink,omitempty"` 8498} 8499 8500// MarshalJSON is the custom marshaler for UserList. 8501func (ul UserList) MarshalJSON() ([]byte, error) { 8502 objectMap := make(map[string]interface{}) 8503 return json.Marshal(objectMap) 8504} 8505 8506// UserListIterator provides access to a complete listing of User values. 8507type UserListIterator struct { 8508 i int 8509 page UserListPage 8510} 8511 8512// NextWithContext advances to the next value. If there was an error making 8513// the request the iterator does not advance and the error is returned. 8514func (iter *UserListIterator) NextWithContext(ctx context.Context) (err error) { 8515 if tracing.IsEnabled() { 8516 ctx = tracing.StartSpan(ctx, fqdn+"/UserListIterator.NextWithContext") 8517 defer func() { 8518 sc := -1 8519 if iter.Response().Response.Response != nil { 8520 sc = iter.Response().Response.Response.StatusCode 8521 } 8522 tracing.EndSpan(ctx, sc, err) 8523 }() 8524 } 8525 iter.i++ 8526 if iter.i < len(iter.page.Values()) { 8527 return nil 8528 } 8529 err = iter.page.NextWithContext(ctx) 8530 if err != nil { 8531 iter.i-- 8532 return err 8533 } 8534 iter.i = 0 8535 return nil 8536} 8537 8538// Next advances to the next value. If there was an error making 8539// the request the iterator does not advance and the error is returned. 8540// Deprecated: Use NextWithContext() instead. 8541func (iter *UserListIterator) Next() error { 8542 return iter.NextWithContext(context.Background()) 8543} 8544 8545// NotDone returns true if the enumeration should be started or is not yet complete. 8546func (iter UserListIterator) NotDone() bool { 8547 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 8548} 8549 8550// Response returns the raw server response from the last page request. 8551func (iter UserListIterator) Response() UserList { 8552 return iter.page.Response() 8553} 8554 8555// Value returns the current value or a zero-initialized value if the 8556// iterator has advanced beyond the end of the collection. 8557func (iter UserListIterator) Value() User { 8558 if !iter.page.NotDone() { 8559 return User{} 8560 } 8561 return iter.page.Values()[iter.i] 8562} 8563 8564// Creates a new instance of the UserListIterator type. 8565func NewUserListIterator(page UserListPage) UserListIterator { 8566 return UserListIterator{page: page} 8567} 8568 8569// IsEmpty returns true if the ListResult contains no values. 8570func (ul UserList) IsEmpty() bool { 8571 return ul.Value == nil || len(*ul.Value) == 0 8572} 8573 8574// hasNextLink returns true if the NextLink is not empty. 8575func (ul UserList) hasNextLink() bool { 8576 return ul.NextLink != nil && len(*ul.NextLink) != 0 8577} 8578 8579// userListPreparer prepares a request to retrieve the next set of results. 8580// It returns nil if no more results exist. 8581func (ul UserList) userListPreparer(ctx context.Context) (*http.Request, error) { 8582 if !ul.hasNextLink() { 8583 return nil, nil 8584 } 8585 return autorest.Prepare((&http.Request{}).WithContext(ctx), 8586 autorest.AsJSON(), 8587 autorest.AsGet(), 8588 autorest.WithBaseURL(to.String(ul.NextLink))) 8589} 8590 8591// UserListPage contains a page of User values. 8592type UserListPage struct { 8593 fn func(context.Context, UserList) (UserList, error) 8594 ul UserList 8595} 8596 8597// NextWithContext advances to the next page of values. If there was an error making 8598// the request the page does not advance and the error is returned. 8599func (page *UserListPage) NextWithContext(ctx context.Context) (err error) { 8600 if tracing.IsEnabled() { 8601 ctx = tracing.StartSpan(ctx, fqdn+"/UserListPage.NextWithContext") 8602 defer func() { 8603 sc := -1 8604 if page.Response().Response.Response != nil { 8605 sc = page.Response().Response.Response.StatusCode 8606 } 8607 tracing.EndSpan(ctx, sc, err) 8608 }() 8609 } 8610 for { 8611 next, err := page.fn(ctx, page.ul) 8612 if err != nil { 8613 return err 8614 } 8615 page.ul = next 8616 if !next.hasNextLink() || !next.IsEmpty() { 8617 break 8618 } 8619 } 8620 return nil 8621} 8622 8623// Next advances to the next page of values. If there was an error making 8624// the request the page does not advance and the error is returned. 8625// Deprecated: Use NextWithContext() instead. 8626func (page *UserListPage) Next() error { 8627 return page.NextWithContext(context.Background()) 8628} 8629 8630// NotDone returns true if the page enumeration should be started or is not yet complete. 8631func (page UserListPage) NotDone() bool { 8632 return !page.ul.IsEmpty() 8633} 8634 8635// Response returns the raw server response from the last page request. 8636func (page UserListPage) Response() UserList { 8637 return page.ul 8638} 8639 8640// Values returns the slice of values for the current page or nil if there are no values. 8641func (page UserListPage) Values() []User { 8642 if page.ul.IsEmpty() { 8643 return nil 8644 } 8645 return *page.ul.Value 8646} 8647 8648// Creates a new instance of the UserListPage type. 8649func NewUserListPage(cur UserList, getNextPage func(context.Context, UserList) (UserList, error)) UserListPage { 8650 return UserListPage{ 8651 fn: getNextPage, 8652 ul: cur, 8653 } 8654} 8655 8656// UserProperties the user properties. 8657type UserProperties struct { 8658 // EncryptedPassword - The password details. 8659 EncryptedPassword *AsymmetricEncryptedSecret `json:"encryptedPassword,omitempty"` 8660 // ShareAccessRights - READ-ONLY; List of shares that the user has rights on. This field should not be specified during user creation. 8661 ShareAccessRights *[]ShareAccessRight `json:"shareAccessRights,omitempty"` 8662 // UserType - Type of the user. Possible values include: 'UserTypeShare', 'UserTypeLocalManagement', 'UserTypeARM' 8663 UserType UserType `json:"userType,omitempty"` 8664} 8665 8666// MarshalJSON is the custom marshaler for UserProperties. 8667func (up UserProperties) MarshalJSON() ([]byte, error) { 8668 objectMap := make(map[string]interface{}) 8669 if up.EncryptedPassword != nil { 8670 objectMap["encryptedPassword"] = up.EncryptedPassword 8671 } 8672 if up.UserType != "" { 8673 objectMap["userType"] = up.UserType 8674 } 8675 return json.Marshal(objectMap) 8676} 8677 8678// UsersCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 8679// operation. 8680type UsersCreateOrUpdateFuture struct { 8681 azure.FutureAPI 8682 // Result returns the result of the asynchronous operation. 8683 // If the operation has not completed it will return an error. 8684 Result func(UsersClient) (User, error) 8685} 8686 8687// UnmarshalJSON is the custom unmarshaller for CreateFuture. 8688func (future *UsersCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 8689 var azFuture azure.Future 8690 if err := json.Unmarshal(body, &azFuture); err != nil { 8691 return err 8692 } 8693 future.FutureAPI = &azFuture 8694 future.Result = future.result 8695 return nil 8696} 8697 8698// result is the default implementation for UsersCreateOrUpdateFuture.Result. 8699func (future *UsersCreateOrUpdateFuture) result(client UsersClient) (u User, err error) { 8700 var done bool 8701 done, err = future.DoneWithContext(context.Background(), client) 8702 if err != nil { 8703 err = autorest.NewErrorWithError(err, "databoxedge.UsersCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 8704 return 8705 } 8706 if !done { 8707 u.Response.Response = future.Response() 8708 err = azure.NewAsyncOpIncompleteError("databoxedge.UsersCreateOrUpdateFuture") 8709 return 8710 } 8711 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 8712 if u.Response.Response, err = future.GetResult(sender); err == nil && u.Response.Response.StatusCode != http.StatusNoContent { 8713 u, err = client.CreateOrUpdateResponder(u.Response.Response) 8714 if err != nil { 8715 err = autorest.NewErrorWithError(err, "databoxedge.UsersCreateOrUpdateFuture", "Result", u.Response.Response, "Failure responding to request") 8716 } 8717 } 8718 return 8719} 8720 8721// UsersDeleteFuture an abstraction for monitoring and retrieving the results of a long-running operation. 8722type UsersDeleteFuture struct { 8723 azure.FutureAPI 8724 // Result returns the result of the asynchronous operation. 8725 // If the operation has not completed it will return an error. 8726 Result func(UsersClient) (autorest.Response, error) 8727} 8728 8729// UnmarshalJSON is the custom unmarshaller for CreateFuture. 8730func (future *UsersDeleteFuture) UnmarshalJSON(body []byte) error { 8731 var azFuture azure.Future 8732 if err := json.Unmarshal(body, &azFuture); err != nil { 8733 return err 8734 } 8735 future.FutureAPI = &azFuture 8736 future.Result = future.result 8737 return nil 8738} 8739 8740// result is the default implementation for UsersDeleteFuture.Result. 8741func (future *UsersDeleteFuture) result(client UsersClient) (ar autorest.Response, err error) { 8742 var done bool 8743 done, err = future.DoneWithContext(context.Background(), client) 8744 if err != nil { 8745 err = autorest.NewErrorWithError(err, "databoxedge.UsersDeleteFuture", "Result", future.Response(), "Polling failure") 8746 return 8747 } 8748 if !done { 8749 ar.Response = future.Response() 8750 err = azure.NewAsyncOpIncompleteError("databoxedge.UsersDeleteFuture") 8751 return 8752 } 8753 ar.Response = future.Response() 8754 return 8755} 8756